@cl-light-ds/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/README.md +45 -0
  2. package/package.json +59 -0
  3. package/src/components/accordion/Accordion.astro +248 -0
  4. package/src/components/accordion/AccordionContent.astro +26 -0
  5. package/src/components/accordion/AccordionItem.astro +36 -0
  6. package/src/components/accordion/AccordionTrigger.astro +118 -0
  7. package/src/components/accordion/CHANGELOG.md +41 -0
  8. package/src/components/accordion/index.ts +4 -0
  9. package/src/components/alert/Alert.astro +167 -0
  10. package/src/components/alert/AlertDescription.astro +24 -0
  11. package/src/components/alert/AlertTitle.astro +24 -0
  12. package/src/components/alert/CHANGELOG.md +5 -0
  13. package/src/components/alert/index.ts +4 -0
  14. package/src/components/avatar/Avatar.astro +197 -0
  15. package/src/components/avatar/AvatarBadge.astro +44 -0
  16. package/src/components/avatar/AvatarFallback.astro +26 -0
  17. package/src/components/avatar/AvatarGroup.astro +26 -0
  18. package/src/components/avatar/AvatarGroupCount.astro +30 -0
  19. package/src/components/avatar/AvatarImage.astro +46 -0
  20. package/src/components/avatar/CHANGELOG.md +44 -0
  21. package/src/components/avatar/index.ts +6 -0
  22. package/src/components/badge/Badge.astro +167 -0
  23. package/src/components/badge/CHANGELOG.md +49 -0
  24. package/src/components/badge/index.ts +2 -0
  25. package/src/components/breadcrumb/Breadcrumb.astro +76 -0
  26. package/src/components/breadcrumb/BreadcrumbItem.astro +32 -0
  27. package/src/components/breadcrumb/BreadcrumbList.astro +26 -0
  28. package/src/components/breadcrumb/BreadcrumbSeparator.astro +26 -0
  29. package/src/components/breadcrumb/CHANGELOG.md +24 -0
  30. package/src/components/breadcrumb/index.ts +5 -0
  31. package/src/components/button/Button.astro +233 -0
  32. package/src/components/button/CHANGELOG.md +41 -0
  33. package/src/components/button/index.ts +2 -0
  34. package/src/components/button-group/ButtonGroup.astro +130 -0
  35. package/src/components/button-group/ButtonGroupSeparator.astro +30 -0
  36. package/src/components/button-group/ButtonGroupText.astro +21 -0
  37. package/src/components/button-group/CHANGELOG.md +34 -0
  38. package/src/components/button-group/index.ts +3 -0
  39. package/src/components/card/CHANGELOG.md +119 -0
  40. package/src/components/card/Card.astro +182 -0
  41. package/src/components/card/CardAction.astro +26 -0
  42. package/src/components/card/CardContent.astro +28 -0
  43. package/src/components/card/CardDescription.astro +28 -0
  44. package/src/components/card/CardFooter.astro +24 -0
  45. package/src/components/card/CardHeader.astro +30 -0
  46. package/src/components/card/CardMedia.astro +27 -0
  47. package/src/components/card/CardOverlay.astro +32 -0
  48. package/src/components/card/CardTitle.astro +21 -0
  49. package/src/components/card/index.ts +10 -0
  50. package/src/components/carousel/CHANGELOG.md +5 -0
  51. package/src/components/carousel/Carousel.astro +106 -0
  52. package/src/components/carousel/CarouselSlide.astro +22 -0
  53. package/src/components/carousel/index.ts +3 -0
  54. package/src/components/checkbox/CHANGELOG.md +58 -0
  55. package/src/components/checkbox/Checkbox.astro +159 -0
  56. package/src/components/checkbox/index.ts +1 -0
  57. package/src/components/collapsible/CHANGELOG.md +5 -0
  58. package/src/components/collapsible/Collapsible.astro +202 -0
  59. package/src/components/collapsible/CollapsibleContent.astro +36 -0
  60. package/src/components/collapsible/CollapsibleTrigger.astro +34 -0
  61. package/src/components/collapsible/index.ts +4 -0
  62. package/src/components/combobox/CHANGELOG.md +27 -0
  63. package/src/components/combobox/Combobox.astro +365 -0
  64. package/src/components/combobox/ComboboxContent.astro +37 -0
  65. package/src/components/combobox/ComboboxEmpty.astro +18 -0
  66. package/src/components/combobox/ComboboxGroup.astro +19 -0
  67. package/src/components/combobox/ComboboxInput.astro +74 -0
  68. package/src/components/combobox/ComboboxItem.astro +39 -0
  69. package/src/components/combobox/ComboboxLabel.astro +18 -0
  70. package/src/components/combobox/ComboboxList.astro +21 -0
  71. package/src/components/combobox/ComboboxSeparator.astro +17 -0
  72. package/src/components/combobox/ComboboxTrigger.astro +30 -0
  73. package/src/components/combobox/ComboboxValue.astro +22 -0
  74. package/src/components/combobox/index.ts +11 -0
  75. package/src/components/date/CHANGELOG.md +18 -0
  76. package/src/components/date/Date.astro +137 -0
  77. package/src/components/date/index.ts +2 -0
  78. package/src/components/dialog/CHANGELOG.md +39 -0
  79. package/src/components/dialog/Dialog.astro +196 -0
  80. package/src/components/dialog/DialogClose.astro +23 -0
  81. package/src/components/dialog/DialogContent.astro +42 -0
  82. package/src/components/dialog/DialogDescription.astro +18 -0
  83. package/src/components/dialog/DialogFooter.astro +18 -0
  84. package/src/components/dialog/DialogHeader.astro +18 -0
  85. package/src/components/dialog/DialogOverlay.astro +19 -0
  86. package/src/components/dialog/DialogTitle.astro +18 -0
  87. package/src/components/dialog/DialogTrigger.astro +37 -0
  88. package/src/components/dialog/index.ts +9 -0
  89. package/src/components/dropdown-menu/CHANGELOG.md +194 -0
  90. package/src/components/dropdown-menu/DropdownMenu.astro +226 -0
  91. package/src/components/dropdown-menu/DropdownMenuCheckboxItem.astro +114 -0
  92. package/src/components/dropdown-menu/DropdownMenuContent.astro +42 -0
  93. package/src/components/dropdown-menu/DropdownMenuGroup.astro +19 -0
  94. package/src/components/dropdown-menu/DropdownMenuItem.astro +220 -0
  95. package/src/components/dropdown-menu/DropdownMenuItemContent.astro +79 -0
  96. package/src/components/dropdown-menu/DropdownMenuLabel.astro +20 -0
  97. package/src/components/dropdown-menu/DropdownMenuPortal.astro +13 -0
  98. package/src/components/dropdown-menu/DropdownMenuRadioGroup.astro +13 -0
  99. package/src/components/dropdown-menu/DropdownMenuRadioItem.astro +101 -0
  100. package/src/components/dropdown-menu/DropdownMenuSeparator.astro +18 -0
  101. package/src/components/dropdown-menu/DropdownMenuShortcut.astro +18 -0
  102. package/src/components/dropdown-menu/DropdownMenuTrigger.astro +49 -0
  103. package/src/components/dropdown-menu/dropdown-menu-item-variants.ts +24 -0
  104. package/src/components/dropdown-menu/index.ts +12 -0
  105. package/src/components/field/CHANGELOG.md +33 -0
  106. package/src/components/field/Field.astro +664 -0
  107. package/src/components/field/FieldContent.astro +20 -0
  108. package/src/components/field/FieldDescription.astro +22 -0
  109. package/src/components/field/FieldError.astro +51 -0
  110. package/src/components/field/FieldGroup.astro +20 -0
  111. package/src/components/field/FieldLabel.astro +22 -0
  112. package/src/components/field/FieldLegend.astro +23 -0
  113. package/src/components/field/FieldSeparator.astro +30 -0
  114. package/src/components/field/FieldSet.astro +20 -0
  115. package/src/components/field/FieldTitle.astro +20 -0
  116. package/src/components/field/index.ts +10 -0
  117. package/src/components/hover-card/CHANGELOG.md +20 -0
  118. package/src/components/hover-card/HoverCard.astro +235 -0
  119. package/src/components/hover-card/HoverCardContent.astro +54 -0
  120. package/src/components/hover-card/HoverCardTrigger.astro +38 -0
  121. package/src/components/hover-card/index.ts +3 -0
  122. package/src/components/input/CHANGELOG.md +29 -0
  123. package/src/components/input/Input.astro +130 -0
  124. package/src/components/input/index.ts +2 -0
  125. package/src/components/input-group/CHANGELOG.md +49 -0
  126. package/src/components/input-group/InputGroup.astro +135 -0
  127. package/src/components/input-group/InputGroupAddon.astro +49 -0
  128. package/src/components/input-group/InputGroupButton.astro +58 -0
  129. package/src/components/input-group/InputGroupInput.astro +18 -0
  130. package/src/components/input-group/InputGroupText.astro +21 -0
  131. package/src/components/input-group/InputGroupTextarea.astro +17 -0
  132. package/src/components/input-group/controlClasses.ts +2 -0
  133. package/src/components/input-group/index.ts +6 -0
  134. package/src/components/item/CHANGELOG.md +27 -0
  135. package/src/components/item/Item.astro +122 -0
  136. package/src/components/item/ItemActions.astro +21 -0
  137. package/src/components/item/ItemContent.astro +25 -0
  138. package/src/components/item/ItemDescription.astro +25 -0
  139. package/src/components/item/ItemFooter.astro +24 -0
  140. package/src/components/item/ItemGroup.astro +24 -0
  141. package/src/components/item/ItemHeader.astro +24 -0
  142. package/src/components/item/ItemMedia.astro +47 -0
  143. package/src/components/item/ItemSeparator.astro +21 -0
  144. package/src/components/item/ItemTitle.astro +25 -0
  145. package/src/components/item/index.ts +10 -0
  146. package/src/components/kbd/CHANGELOG.md +5 -0
  147. package/src/components/kbd/Kbd.astro +145 -0
  148. package/src/components/kbd/KbdGroup.astro +55 -0
  149. package/src/components/kbd/index.ts +2 -0
  150. package/src/components/label/CHANGELOG.md +28 -0
  151. package/src/components/label/Label.astro +97 -0
  152. package/src/components/label/index.ts +2 -0
  153. package/src/components/link-group/CHANGELOG.md +75 -0
  154. package/src/components/link-group/LinkGroup.astro +67 -0
  155. package/src/components/link-group/LinkGroupItem.astro +32 -0
  156. package/src/components/link-group/LinkGroupList.astro +25 -0
  157. package/src/components/link-group/LinkGroupTitle.astro +22 -0
  158. package/src/components/link-group/index.ts +5 -0
  159. package/src/components/link-group/link-group-list-variants.ts +15 -0
  160. package/src/components/marquee/CHANGELOG.md +5 -0
  161. package/src/components/marquee/Marquee.astro +119 -0
  162. package/src/components/marquee/index.ts +2 -0
  163. package/src/components/native-select/CHANGELOG.md +5 -0
  164. package/src/components/native-select/NativeSelect.astro +125 -0
  165. package/src/components/native-select/NativeSelectOptGroup.astro +14 -0
  166. package/src/components/native-select/NativeSelectOption.astro +9 -0
  167. package/src/components/native-select/index.ts +3 -0
  168. package/src/components/navigation-menu/CHANGELOG.md +63 -0
  169. package/src/components/navigation-menu/NavigationMenu.astro +414 -0
  170. package/src/components/navigation-menu/NavigationMenuContent.astro +37 -0
  171. package/src/components/navigation-menu/NavigationMenuIndicator.astro +24 -0
  172. package/src/components/navigation-menu/NavigationMenuItem.astro +22 -0
  173. package/src/components/navigation-menu/NavigationMenuLink.astro +18 -0
  174. package/src/components/navigation-menu/NavigationMenuList.astro +21 -0
  175. package/src/components/navigation-menu/NavigationMenuPositioner.astro +44 -0
  176. package/src/components/navigation-menu/NavigationMenuTrigger.astro +30 -0
  177. package/src/components/navigation-menu/NavigationMenuViewport.astro +19 -0
  178. package/src/components/navigation-menu/index.ts +10 -0
  179. package/src/components/popover/CHANGELOG.md +5 -0
  180. package/src/components/popover/Popover.astro +210 -0
  181. package/src/components/popover/PopoverClose.astro +18 -0
  182. package/src/components/popover/PopoverContent.astro +49 -0
  183. package/src/components/popover/PopoverDescription.astro +18 -0
  184. package/src/components/popover/PopoverHeader.astro +18 -0
  185. package/src/components/popover/PopoverTitle.astro +18 -0
  186. package/src/components/popover/PopoverTrigger.astro +29 -0
  187. package/src/components/popover/index.ts +7 -0
  188. package/src/components/radio-group/CHANGELOG.md +9 -0
  189. package/src/components/radio-group/RadioGroup.astro +81 -0
  190. package/src/components/radio-group/RadioGroupItem.astro +42 -0
  191. package/src/components/radio-group/index.ts +3 -0
  192. package/src/components/select/CHANGELOG.md +39 -0
  193. package/src/components/select/Select.astro +373 -0
  194. package/src/components/select/SelectContent.astro +91 -0
  195. package/src/components/select/SelectGroup.astro +19 -0
  196. package/src/components/select/SelectItem.astro +48 -0
  197. package/src/components/select/SelectLabel.astro +18 -0
  198. package/src/components/select/SelectSeparator.astro +17 -0
  199. package/src/components/select/SelectTrigger.astro +34 -0
  200. package/src/components/select/SelectValue.astro +22 -0
  201. package/src/components/select/index.ts +8 -0
  202. package/src/components/separator/CHANGELOG.md +5 -0
  203. package/src/components/separator/Separator.astro +60 -0
  204. package/src/components/separator/index.ts +2 -0
  205. package/src/components/skeleton/CHANGELOG.md +5 -0
  206. package/src/components/skeleton/Skeleton.astro +121 -0
  207. package/src/components/skeleton/index.ts +1 -0
  208. package/src/components/slider/CHANGELOG.md +5 -0
  209. package/src/components/slider/Slider.astro +198 -0
  210. package/src/components/slider/index.ts +1 -0
  211. package/src/components/spinner/CHANGELOG.md +5 -0
  212. package/src/components/spinner/Spinner.astro +134 -0
  213. package/src/components/spinner/index.ts +1 -0
  214. package/src/components/sticky-surface/CHANGELOG.md +5 -0
  215. package/src/components/sticky-surface/StickySurface.astro +152 -0
  216. package/src/components/sticky-surface/index.ts +2 -0
  217. package/src/components/switch/CHANGELOG.md +9 -0
  218. package/src/components/switch/Switch.astro +106 -0
  219. package/src/components/switch/index.ts +1 -0
  220. package/src/components/table/CHANGELOG.md +5 -0
  221. package/src/components/table/Table.astro +250 -0
  222. package/src/components/table/TableBody.astro +18 -0
  223. package/src/components/table/TableCaption.astro +17 -0
  224. package/src/components/table/TableCell.astro +21 -0
  225. package/src/components/table/TableFooter.astro +21 -0
  226. package/src/components/table/TableHead.astro +21 -0
  227. package/src/components/table/TableHeader.astro +17 -0
  228. package/src/components/table/TableRow.astro +21 -0
  229. package/src/components/table/index.ts +9 -0
  230. package/src/components/tabs/CHANGELOG.md +5 -0
  231. package/src/components/tabs/Tabs.astro +306 -0
  232. package/src/components/tabs/TabsContent.astro +47 -0
  233. package/src/components/tabs/TabsList.astro +69 -0
  234. package/src/components/tabs/TabsTrigger.astro +40 -0
  235. package/src/components/tabs/index.ts +6 -0
  236. package/src/components/textarea/CHANGELOG.md +5 -0
  237. package/src/components/textarea/Textarea.astro +36 -0
  238. package/src/components/textarea/index.ts +2 -0
  239. package/src/components/toggle/CHANGELOG.md +5 -0
  240. package/src/components/toggle/Toggle.astro +138 -0
  241. package/src/components/toggle/index.ts +1 -0
  242. package/src/components/toggle-group/CHANGELOG.md +5 -0
  243. package/src/components/toggle-group/ToggleGroup.astro +224 -0
  244. package/src/components/toggle-group/ToggleGroupItem.astro +48 -0
  245. package/src/components/toggle-group/index.ts +2 -0
  246. package/src/components/tooltip/CHANGELOG.md +5 -0
  247. package/src/components/tooltip/Tooltip.astro +331 -0
  248. package/src/components/tooltip/TooltipContent.astro +60 -0
  249. package/src/components/tooltip/TooltipTrigger.astro +34 -0
  250. package/src/components/tooltip/index.ts +3 -0
  251. package/src/lib/toggle-group-controller.ts +113 -0
  252. package/src/lib/toggle-shared.ts +26 -0
  253. package/src/lib/utils.ts +6 -0
  254. package/src/styles/globals.css +177 -0
@@ -0,0 +1,37 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ class?: string;
7
+ side?: "top" | "bottom";
8
+ align?: "start" | "center" | "end";
9
+ sideOffset?: number;
10
+ alignOffset?: number;
11
+ }
12
+
13
+ const {
14
+ class: className = "",
15
+ side = "bottom",
16
+ align = "center",
17
+ sideOffset = 6,
18
+ alignOffset = 0,
19
+ ...rest
20
+ } = Astro.props as Props;
21
+ ---
22
+
23
+ <div
24
+ {...rest}
25
+ data-slot="combobox-content"
26
+ data-side={side}
27
+ data-align={align}
28
+ data-side-offset={sideOffset}
29
+ data-align-offset={alignOffset}
30
+ hidden
31
+ class={cn(
32
+ "bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 max-h-72 min-w-36 overflow-hidden rounded-md shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 group/combobox-content relative w-[var(--anchor-width)] max-h-[var(--available-height)] max-w-[var(--available-width)] min-w-[max(8rem,var(--anchor-width))] origin-(--transform-origin)",
33
+ className,
34
+ )}
35
+ >
36
+ <slot />
37
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ class?: string;
7
+ }
8
+
9
+ const { class: className = "", ...rest } = Astro.props as Props;
10
+ ---
11
+
12
+ <div
13
+ {...rest}
14
+ data-slot="combobox-empty"
15
+ class={cn("text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex", className)}
16
+ >
17
+ <slot />
18
+ </div>
@@ -0,0 +1,19 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ class?: string;
7
+ }
8
+
9
+ const { class: className = "", ...rest } = Astro.props as Props;
10
+ ---
11
+
12
+ <div
13
+ {...rest}
14
+ role="group"
15
+ data-slot="combobox-group"
16
+ class={cn("", "scroll-my-1", className)}
17
+ >
18
+ <slot />
19
+ </div>
@@ -0,0 +1,74 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+ import {
5
+ InputGroup,
6
+ InputGroupInput,
7
+ InputGroupAddon,
8
+ InputGroupButton,
9
+ } from "../input-group";
10
+
11
+ interface Props extends Omit<HTMLAttributes<"input">, "size"> {
12
+ class?: string;
13
+ size?: "sm" | "default" | "lg";
14
+ placeholder?: string;
15
+ disabled?: boolean;
16
+ showTrigger?: boolean;
17
+ showClear?: boolean;
18
+ }
19
+
20
+ const {
21
+ class: className = "",
22
+ size = "default",
23
+ placeholder,
24
+ disabled = false,
25
+ showTrigger = true,
26
+ showClear = false,
27
+ ...rest
28
+ } = Astro.props as Props;
29
+ ---
30
+
31
+ <InputGroup size={size} class={cn("w-auto", className)}>
32
+ <InputGroupInput
33
+ data-input-group-control
34
+ data-slot="combobox-input"
35
+ placeholder={placeholder}
36
+ disabled={disabled}
37
+ autocomplete="off"
38
+ {...rest}
39
+ class="" />
40
+ {
41
+ (showTrigger || showClear) && (
42
+ <InputGroupAddon align="inline-end">
43
+ {showClear && (
44
+ <InputGroupButton
45
+ data-slot="combobox-clear"
46
+ type="button"
47
+ size="icon-xs"
48
+ class="hidden [[data-value]_&]:inline-flex"
49
+ aria-label="Clear selection"
50
+ >
51
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="size-3.5 group-data-[size=sm]/input-group:size-3"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"/></svg>
52
+ </InputGroupButton>
53
+ )}
54
+ {showTrigger && (
55
+ <InputGroupButton
56
+ data-slot="combobox-trigger"
57
+ type="button"
58
+ size="icon-xs"
59
+ tabindex={-1}
60
+ disabled={disabled}
61
+ class={cn("[&_svg:not([class*='size-'])]:size-4 rounded-lg",
62
+ "text-muted-foreground",
63
+ showClear && "[[data-value]_&]:hidden",
64
+ )}
65
+ aria-label="Toggle menu"
66
+ >
67
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" data-slot="combobox-icon"
68
+ class="size-4 group-data-[size=sm]/input-group:size-3.5"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9l6 6l6-6"/></svg>
69
+ </InputGroupButton>
70
+ )}
71
+ </InputGroupAddon>
72
+ )
73
+ }
74
+ </InputGroup>
@@ -0,0 +1,39 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ value: string;
7
+ label?: string;
8
+ disabled?: boolean;
9
+ class?: string;
10
+ }
11
+
12
+ const {
13
+ value,
14
+ label,
15
+ disabled = false,
16
+ class: className = "",
17
+ ...rest
18
+ } = Astro.props as Props;
19
+ ---
20
+
21
+ <div
22
+ {...rest}
23
+ data-slot="combobox-item"
24
+ data-value={value}
25
+ data-label={label}
26
+ data-disabled={disabled ? "" : undefined}
27
+ class={cn(
28
+ "data-highlighted:bg-background-hover data-highlighted:text-foreground not-data-[variant=destructive]:data-highlighted:**:text-foreground gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
29
+ className,
30
+ )}
31
+ >
32
+ <span
33
+ data-slot="combobox-item-indicator"
34
+ class="pointer-events-none absolute right-2 flex size-4 items-center justify-center"
35
+ >
36
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="pointer-events-none"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6L9 17l-5-5"/></svg>
37
+ </span>
38
+ <span data-slot="combobox-item-text" class="flex flex-1 gap-2"><slot /></span>
39
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ class?: string;
7
+ }
8
+
9
+ const { class: className = "", ...rest } = Astro.props as Props;
10
+ ---
11
+
12
+ <div
13
+ {...rest}
14
+ data-slot="combobox-label"
15
+ class={cn("text-muted-foreground px-2 py-1.5 text-xs font-medium", className)}
16
+ >
17
+ <slot />
18
+ </div>
@@ -0,0 +1,21 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ class?: string;
7
+ }
8
+
9
+ const { class: className = "", ...rest } = Astro.props as Props;
10
+ ---
11
+
12
+ <div
13
+ {...rest}
14
+ data-slot="combobox-list"
15
+ class={cn(
16
+ "no-scrollbar scroll-py-1 overflow-y-auto p-1 data-empty:p-0 max-h-[min(18rem,calc(var(--available-height)-var(--anchor-height)))] overscroll-contain",
17
+ className,
18
+ )}
19
+ >
20
+ <slot />
21
+ </div>
@@ -0,0 +1,17 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"div"> {
6
+ class?: string;
7
+ }
8
+
9
+ const { class: className = "", ...rest } = Astro.props as Props;
10
+ ---
11
+
12
+ <div
13
+ {...rest}
14
+ role="separator"
15
+ data-slot="combobox-separator"
16
+ class={cn("bg-border -mx-1 my-1 h-px", className)}
17
+ />
@@ -0,0 +1,30 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"button"> {
6
+ class?: string;
7
+ size?: "sm" | "default" | "lg";
8
+ }
9
+
10
+ const {
11
+ class: className = "",
12
+ size = "default",
13
+ ...rest
14
+ } = Astro.props as Props;
15
+ ---
16
+
17
+ <button
18
+ {...rest}
19
+ type="button"
20
+ data-slot="combobox-trigger"
21
+ data-size={size}
22
+ class={cn(
23
+ "[&_svg:not([class*='size-'])]:size-4 rounded-lg flex w-full items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=combobox-value]:line-clamp-1 *:data-[slot=combobox-value]:flex *:data-[slot=combobox-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
24
+ className,
25
+ )}
26
+ >
27
+ <slot />
28
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="text-muted-foreground size-4 pointer-events-none"
29
+ data-slot="combobox-icon"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9l6 6l6-6"/></svg>
30
+ </button>
@@ -0,0 +1,22 @@
1
+ ---
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { cn } from "@cl-light-ds/ui/lib/utils";
4
+
5
+ interface Props extends HTMLAttributes<"span"> {
6
+ class?: string;
7
+ placeholder?: string;
8
+ }
9
+
10
+ const {
11
+ class: className = "",
12
+ placeholder = "",
13
+ ...rest
14
+ } = Astro.props as Props;
15
+ ---
16
+
17
+ <span
18
+ {...rest}
19
+ data-slot="combobox-value"
20
+ data-placeholder={placeholder}
21
+ class={cn("", "block truncate pointer-events-none", className)}
22
+ >{placeholder}</span>
@@ -0,0 +1,11 @@
1
+ export { default as Combobox } from "./Combobox.astro";
2
+ export { default as ComboboxContent } from "./ComboboxContent.astro";
3
+ export { default as ComboboxEmpty } from "./ComboboxEmpty.astro";
4
+ export { default as ComboboxGroup } from "./ComboboxGroup.astro";
5
+ export { default as ComboboxInput } from "./ComboboxInput.astro";
6
+ export { default as ComboboxItem } from "./ComboboxItem.astro";
7
+ export { default as ComboboxLabel } from "./ComboboxLabel.astro";
8
+ export { default as ComboboxList } from "./ComboboxList.astro";
9
+ export { default as ComboboxSeparator } from "./ComboboxSeparator.astro";
10
+ export { default as ComboboxTrigger } from "./ComboboxTrigger.astro";
11
+ export { default as ComboboxValue } from "./ComboboxValue.astro";
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `Date` component will be documented in this file.
4
+
5
+ ## 2026-09-09 — Figma alignment (ClickLearn Lightning Design Library, node `2329-6519`)
6
+
7
+ Unlike Accordion/Combobox/Checkbox, `Date` is not an interactive widget — it's a lightweight, non-interactive date-*formatting* component (renders a plain `<time>`, no sub-components, no behavior library). Figma's "Date" page turned out to be a reference table of six formatting variants (Default, Short, Time, Full, Long, "Long with time") with sample output strings, not a visual widget spec.
8
+
9
+ ### Notes (no missing variants or props found)
10
+
11
+ - All six variants Figma demos are already fully supported by the existing `format` (`"short" | "time" | "full" | "long"`, default `"long"`) and `includeTime` props — confirmed each one produces the exact same formatted output Figma shows (e.g. `format="full"` → "Friday, June 13, 2025"). No new props were needed.
12
+ - Figma's "Short" sample text ("6/13/2025") doesn't match what `Intl.DateTimeFormat`'s real `dateStyle: "short"` produces ("6/13/25", 2-digit year — the correct standard short-style output). Left the component using the real `Intl` API rather than "fixing" it to match what was evidently a hand-typed mockup value.
13
+
14
+ ### Fixed
15
+
16
+ - The rendered `<time>` element had **zero** default styling (`class={cn("", className)}` — a literal empty base string). Added `text-sm` plus a text color as the default — first set to `text-muted-foreground` per Figma's reference table (which styled the value text as regular-weight/muted), then corrected to `text-foreground` per your direct call.
17
+ - Updated `@figmaUrl` from the old Bejamas file to the ClickLearn Lightning Design Library link.
18
+ - Polished the demo page (`apps/web/.../_sections/date.astro`) and the component's own JSDoc `@preview`: the row labels ("Default:", "Short:", etc.) were plain unstyled `<div>`s; Figma styles them `text-foreground text-sm font-medium` (bold, dark) — added to both.
@@ -0,0 +1,137 @@
1
+ ---
2
+ import { cn } from "@cl-light-ds/ui/lib/utils";
3
+ /**
4
+ * @component Date
5
+ * @description Formats and displays dates and times in human-readable styles.
6
+ * @figmaUrl https://www.figma.com/design/qXkzdqZ3QPQqgckU3AwIAH/ClickLearn-Lightning-Design-Library?node-id=2329-6519
7
+ *
8
+ * @preview
9
+ *
10
+ * <div class="grid grid-cols-2 gap-4">
11
+ * <div class="text-foreground text-sm font-medium">Default:</div> <Date date="2025-06-13T12:00:00Z" />
12
+ * <Separator class="col-span-2" />
13
+ * <div class="text-foreground text-sm font-medium">Short:</div> <Date date="2025-06-13T12:00:00Z" format="short" />
14
+ * <Separator class="col-span-2" />
15
+ * <div class="text-foreground text-sm font-medium">Time:</div> <Date date="2025-06-13T12:00:00Z" format="time" />
16
+ * <Separator class="col-span-2" />
17
+ * <div class="text-foreground text-sm font-medium">Full:</div> <Date date="2025-06-13T12:00:00Z" format="full" />
18
+ * <Separator class="col-span-2" />
19
+ * <div class="text-foreground text-sm font-medium">Long:</div> <Date date="2025-06-13T12:00:00Z" format="long" />
20
+ * <Separator class="col-span-2" />
21
+ * <div class="text-foreground text-sm font-medium">Long with time:</div> <Date date="2025-06-13T12:00:00Z" format="long" includeTime />
22
+ * </div>
23
+ *
24
+ * @usage
25
+ *
26
+ * ```astro nocollapse
27
+ * ---
28
+ * import { Date } from '@bejamas/ui/components/date';
29
+ * ---
30
+ *
31
+ * <Date date="2025-06-24T12:00:00Z" />
32
+ * ```
33
+ *
34
+ * @examples
35
+ *
36
+ * ### Custom locale
37
+ *
38
+ * <div class="flex gap-2 flex-col">
39
+ * <Date date="2025-06-24T12:00:00Z" locale="fr-FR" />
40
+ * <Date date="2025-06-24T12:00:00Z" locale="de-DE" />
41
+ * <Date date="2025-06-24T12:00:00Z" locale="es-ES" />
42
+ * <Date date="2025-06-24T12:00:00Z" locale="pl-PL" />
43
+ * </div>
44
+ */
45
+ const {
46
+ date,
47
+ format = "long",
48
+ includeTime = false,
49
+ locale = "en-US",
50
+ class: className = "",
51
+ ...props
52
+ } = Astro.props;
53
+
54
+ // Helper: parse date input
55
+ function parseDate(input: string | globalThis.Date | null | undefined) {
56
+ if (!input) return null;
57
+ if (input instanceof globalThis.Date) return input;
58
+ // Try to parse string
59
+ const d = new globalThis.Date(input);
60
+ return isNaN(d.getTime()) ? null : d;
61
+ }
62
+
63
+ const parsedDate = parseDate(date);
64
+
65
+ // Precompute separate date and time strings to support custom rendering via slot
66
+ let dateText = "";
67
+ let timeText = "";
68
+ let formatted = "";
69
+ let html = "";
70
+ if (parsedDate) {
71
+ let dateOptions: Intl.DateTimeFormatOptions | undefined;
72
+ switch (format) {
73
+ case "short":
74
+ dateOptions = { dateStyle: "short" };
75
+ break;
76
+ case "full":
77
+ dateOptions = { dateStyle: "full" };
78
+ break;
79
+ case "time":
80
+ dateOptions = undefined;
81
+ break;
82
+ case "long":
83
+ default:
84
+ dateOptions = { dateStyle: "long" };
85
+ break;
86
+ }
87
+ if (dateOptions) {
88
+ dateText = new Intl.DateTimeFormat(locale, dateOptions).format(parsedDate);
89
+ }
90
+ if (includeTime || format === "time") {
91
+ timeText = new Intl.DateTimeFormat(locale, { timeStyle: "short" }).format(
92
+ parsedDate,
93
+ );
94
+ }
95
+ formatted =
96
+ format === "time"
97
+ ? timeText
98
+ : includeTime && timeText
99
+ ? `${dateText}, ${timeText}`
100
+ : dateText;
101
+
102
+ if (Astro.slots.has("default")) {
103
+ html = await Astro.slots.render("default", [
104
+ {
105
+ date: dateText,
106
+ time: timeText,
107
+ formatted,
108
+ iso: parsedDate.toISOString(),
109
+ dateObj: parsedDate,
110
+ },
111
+ ]);
112
+ }
113
+ }
114
+ ---
115
+
116
+ {
117
+ parsedDate ? (
118
+ Astro.slots.has("default") ? (
119
+ <Fragment set:html={html} />
120
+ ) : (
121
+ <time
122
+ datetime={parsedDate.toISOString()}
123
+ class={cn("text-foreground text-sm", className)}
124
+ {...props}
125
+ >
126
+ {formatted}
127
+ </time>
128
+ )
129
+ ) : (
130
+ <span
131
+ class={cn("text-destructive", className)}
132
+ {...props}
133
+ >
134
+ Invalid date
135
+ </span>
136
+ )
137
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Date } from "./Date.astro";
2
+
@@ -0,0 +1,39 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `Dialog` component family (`Dialog`, `DialogTrigger`, `DialogContent`, `DialogOverlay`, `DialogHeader`, `DialogFooter`, `DialogTitle`, `DialogDescription`, `DialogClose`) are documented in this file.
4
+
5
+ ## Earlier (commit `c3cec7d`, undocumented at the time)
6
+
7
+ - `DialogContent`: `rounded-xl` → `rounded-lg` (Figma binds 8px radius).
8
+ - `DialogTitle`: `font-medium` → `font-semibold` (Figma title token is Semi Bold/600).
9
+ - Added `Dialog.stories.ts`/`DialogStory.astro` (astrobook preview scaffolding).
10
+
11
+ No changelog entry was added at the time — backfilled here for a complete history. Everything else in the family (`Dialog.astro`, `DialogTrigger`, `DialogOverlay`, `DialogHeader`, `DialogFooter`, `DialogDescription`, `DialogClose`, `index.ts`) was untouched since the original Bejamas import until this pass.
12
+
13
+ ## 2026-09-09 — Figma alignment (ClickLearn Lightning Design Library, node `141-6002`)
14
+
15
+ Figma shows a single "Opened" dialog state (a cookie-consent example: title, description, content slot, and a Close/Save-changes action row), which surfaced several real gaps beyond what `c3cec7d` had already fixed.
16
+
17
+ ### Fixed
18
+
19
+ - `DialogContent`: panel background `bg-background` → `bg-card` — these are the same color in light mode but genuinely differ in dark mode (`--background` vs `--card`), so this was a real, if currently invisible, mismatch.
20
+ - `DialogContent`: replaced the `ring-1 ring-foreground/10` approximation with an actual `border border-border` **and** `shadow-lg` — Figma's panel has both a visible 1px border and a distinct multi-layer drop shadow (explicitly annotated "shadow-lg" in the design tokens), not a single subtle ring.
21
+ - `DialogContent`: **restructured** to match Figma's two-layer composition — an outer unpadded panel (bg/border/shadow/radius/position/animation only) now wraps an inner `<div class="grid gap-6 p-6 text-sm">` holding the slotted content, with the close button as a sibling of that inner wrapper rather than a child of it. Previously, the close button (`position: absolute`) was a child of the *padded* content div, so `top-4 right-4` was actually offset from the padding edge — i.e. 24px (padding) + 16px (`top-4`/`right-4`) = 40px from the panel's true corner, not the ~15px Figma shows. Now it's positioned relative to the outer unpadded panel, landing close to the corner as intended.
22
+ - `DialogTitle`: was missing an explicit font-size entirely (relied on inherited/browser default) and used `leading-none` (line-height: 1). Figma specifies `text-xl` (20px) with a 24px line-height — added `text-xl leading-6`. Verified computed: `fontSize: 20px`, `lineHeight: 24px`.
23
+ - `DialogClose`: was a bare, completely unstyled `<button>` — no hover state, no focus ring, no consistent sizing — despite every real usage example (`DialogStory.astro`, the storybook docs page, `Dialog.astro`'s own JSDoc) actually using the shared `Button` component for the footer's "Close" action instead. Figma's own close-button layer is literally named "Ghost" (matching `Button`'s `ghost` variant exactly). Rewrote `DialogClose` to render `<Button variant="ghost" size="icon-sm">` internally instead of a bare button, repositioned to `top-2 right-2` (matches the icon-button's own built-in padding placing the glyph near Figma's corner inset). Verified live: 32×32 hit area, correct hover/focus states inherited from `Button`.
24
+ - Docs/examples (`Dialog.astro` JSDoc, `DialogStory.astro`, the storybook page): the footer's "Close" `Button` used `variant="outline"` (visible border) everywhere — but Figma's own layer name for that button is "Ghost" (no border, text-only until hover). Changed all three to `variant="ghost"`. **Reverted in the follow-up below** — the user confirmed the footer's secondary Close action should stay `outline`; the "Ghost" Figma layer name applies to the corner X close icon (`DialogClose`, see above), not this button.
25
+ - `DialogFooter`: removed a dead, redundant `"gap-2"` first argument to `cn()` that was already superseded by `"flex justify-end gap-2"` later in the same call — the same class of bug `c3cec7d` fixed elsewhere (e.g. `TooltipContent`) but missed here.
26
+ - `index.ts`: `DialogOverlay` existed and is used internally by `DialogContent` but was never exported, so consumers couldn't import or reference it by name. Added the export.
27
+ - Updated `@figmaUrl` from the old Bejamas file to the ClickLearn Lightning Design Library link.
28
+
29
+ ### Notes
30
+
31
+ - `DialogDescription` (`text-muted-foreground text-sm`) already matched Figma exactly — no change needed.
32
+ - `DialogOverlay`'s `bg-black/10` backdrop color was left as-is — Figma's export didn't capture a visible backdrop to diff against, and a raw-black dimming overlay (rather than a theme-aware token) is a common, deliberate convention for modal backdrops regardless of light/dark theme.
33
+ - The underlying `@data-slot/dialog` behavior library supports an `alertDialog` option that isn't exposed as a `Dialog` prop. Not added — Figma's file shows only one dialog variant, with no alert-dialog-specific visual spec to align against.
34
+ - All values are token-based (`--card`, `--border`, `--foreground`, `--muted-foreground`, `--radius-lg`, Tailwind's `shadow-lg`) — no hardcoded arbitrary values introduced.
35
+
36
+ ### Fixed (follow-up)
37
+
38
+ - Removed a leftover `border-red-800` demo class from the nested-dialog example (`Dialog.astro` JSDoc and the storybook docs page). It was inherited from the original Bejamas import and had been a silent no-op (no border-width utility was present to give it a visible width), but became visible once this pass added a real `border` to `DialogContent` — so it started rendering an unintended red border. The nested dialog now correctly falls back to the standard `border-border` color.
39
+ - User correction: the footer's secondary "Close" `Button` (`Dialog.astro` JSDoc ×2, `DialogStory.astro`, the storybook page ×2) reverted from `variant="ghost"` back to `variant="outline"`. The corner X close icon (`DialogClose.astro`) stays `variant="ghost"`, matching Figma's "Ghost" layer name for that specific icon button — that layer name doesn't extend to the separate footer text button.