Skip to content

Commit 8c2e4ab

Browse files
Merge pull request #189 from linked-planet/dev
Dev
2 parents b264b37 + f4290b0 commit 8c2e4ab

File tree

15 files changed

+2034
-1821
lines changed

15 files changed

+2034
-1821
lines changed

library/src/components/Avatar.tsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import * as RAvatar from "@radix-ui/react-avatar"
2+
import { CheckIcon, LockKeyholeIcon, UserRoundIcon, XIcon } from "lucide-react"
23
import type React from "react"
4+
import { useMemo } from "react"
35
import { twMerge } from "tailwind-merge"
4-
56
import { IconSizeHelper } from "./IconSizeHelper"
6-
import { XIcon, CheckIcon, LockKeyholeIcon, UserRoundIcon } from "lucide-react"
7-
import { useMemo } from "react"
87

98
type PresenceStatus = "busy" | "focus" | "online" | "offline"
109
type Status = "approved" | "declined" | "locked"
@@ -59,11 +58,22 @@ const statusStyles: { [status in Status]: string } = {
5958
locked: "bg-icon",
6059
} as const
6160

62-
const statusSVGs: { [status in Status]: JSX.Element } = {
63-
approved: <CheckIcon aria-label="approved" size="12" strokeWidth={4} />,
64-
declined: <XIcon aria-label="declined" size="12" strokeWidth={4} />,
65-
locked: <LockKeyholeIcon aria-label="locked" size="12" strokeWidth={4} />,
66-
} as const
61+
const getStatusSVG = (status: Status): JSX.Element => {
62+
switch (status) {
63+
case "approved":
64+
return <CheckIcon aria-label="approved" size="12" strokeWidth={4} />
65+
case "declined":
66+
return <XIcon aria-label="declined" size="12" strokeWidth={4} />
67+
case "locked":
68+
return (
69+
<LockKeyholeIcon
70+
aria-label="locked"
71+
size="12"
72+
strokeWidth={4}
73+
/>
74+
)
75+
}
76+
}
6777

6878
function PresenceIcon({
6979
presence,
@@ -147,7 +157,7 @@ function StatusIcon({
147157
padding: 1,
148158
}}
149159
>
150-
{statusSVGs[status]}
160+
{getStatusSVG(status)}
151161
</IconSizeHelper>
152162
)
153163
}

library/src/components/Collapsible.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Trigger.displayName = "CollapsibleTrigger"
142142

143143
function Panel({ className, role, ...props }: PanelProps) {
144144
const classNameResolved = useCallback(
145-
(state: CollapsibleRUI.Root.State) => {
145+
(state: CollapsibleRUI.Panel.State) => {
146146
const basicClassName =
147147
"overflow-hidden h-[var(--collapsible-panel-height)] data-[starting-style]:h-0 border-border data-[ending-style]:h-0 origin-top border-0 data-[open]:border-x data-[open]:border-b data-[open]:border-t-0 bg-surface data-[open]:border-border border-solid transition-all ease-linear motion-reduce:transition-none"
148148
if (typeof className === "function") {

library/src/components/timetable/ItemWrapper.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ export default function ItemWrapper<
105105
style={{
106106
left,
107107
width,
108-
height,
108+
height: "auto",
109109
maxHeight: height,
110110
pointerEvents: "none",
111111
}}
112+
data-component="timetable-item-wrapper-outer"
112113
{...mouseHandler}
113114
>
114115
{/** biome-ignore lint/a11y/useSemanticElements: should be div to be able to have buttons inside */}
@@ -119,10 +120,15 @@ export default function ItemWrapper<
119120
style={{
120121
pointerEvents: multiSelectionMode ? "none" : "auto",
121122
}}
122-
onClick={onTimeSlotItemClick ? (e) => {
123-
e.stopPropagation()
124-
if (onTimeSlotItemClick) onTimeSlotItemClick(group, item)
125-
} : undefined}
123+
onClick={
124+
onTimeSlotItemClick
125+
? (e) => {
126+
e.stopPropagation()
127+
if (onTimeSlotItemClick)
128+
onTimeSlotItemClick(group, item)
129+
}
130+
: undefined
131+
}
126132
onKeyUp={(e) => {
127133
if (e.key === "Enter") {
128134
e.stopPropagation()
@@ -139,6 +145,7 @@ export default function ItemWrapper<
139145
role="button"
140146
tabIndex={-1}
141147
id={id}
148+
data-component="timetable-item-wrapper-inner"
142149
>
143150
<TimeSlotItemComponent
144151
group={group}

0 commit comments

Comments
 (0)