@cl-light-ds/ui 0.2.0 → 0.4.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.
- package/README.md +45 -45
- package/package.json +2 -2
- package/src/components/accordion/Accordion.astro +248 -248
- package/src/components/accordion/AccordionContent.astro +26 -26
- package/src/components/accordion/AccordionItem.astro +36 -36
- package/src/components/accordion/AccordionTrigger.astro +118 -118
- package/src/components/accordion/CHANGELOG.md +41 -41
- package/src/components/accordion/index.ts +4 -4
- package/src/components/alert/Alert.astro +167 -167
- package/src/components/alert/AlertDescription.astro +24 -24
- package/src/components/alert/AlertTitle.astro +24 -24
- package/src/components/alert/CHANGELOG.md +5 -5
- package/src/components/alert/index.ts +4 -4
- package/src/components/avatar/Avatar.astro +197 -197
- package/src/components/avatar/AvatarBadge.astro +44 -44
- package/src/components/avatar/AvatarFallback.astro +26 -26
- package/src/components/avatar/AvatarGroup.astro +26 -26
- package/src/components/avatar/AvatarGroupCount.astro +30 -30
- package/src/components/avatar/AvatarImage.astro +46 -46
- package/src/components/avatar/CHANGELOG.md +44 -44
- package/src/components/avatar/index.ts +6 -6
- package/src/components/badge/Badge.astro +167 -167
- package/src/components/badge/CHANGELOG.md +49 -49
- package/src/components/badge/index.ts +2 -2
- package/src/components/breadcrumb/Breadcrumb.astro +76 -76
- package/src/components/breadcrumb/BreadcrumbItem.astro +32 -32
- package/src/components/breadcrumb/BreadcrumbList.astro +26 -26
- package/src/components/breadcrumb/BreadcrumbSeparator.astro +26 -26
- package/src/components/breadcrumb/CHANGELOG.md +24 -24
- package/src/components/breadcrumb/index.ts +5 -5
- package/src/components/button/Button.astro +233 -233
- package/src/components/button/CHANGELOG.md +41 -41
- package/src/components/button/index.ts +2 -2
- package/src/components/button-group/ButtonGroup.astro +130 -130
- package/src/components/button-group/ButtonGroupSeparator.astro +30 -30
- package/src/components/button-group/ButtonGroupText.astro +21 -21
- package/src/components/button-group/CHANGELOG.md +34 -34
- package/src/components/button-group/index.ts +3 -3
- package/src/components/callout/CHANGELOG.md +32 -0
- package/src/components/callout/Callout.astro +147 -0
- package/src/components/callout/CalloutDescription.astro +16 -0
- package/src/components/callout/CalloutTitle.astro +16 -0
- package/src/components/callout/index.ts +3 -0
- package/src/components/card/CHANGELOG.md +162 -119
- package/src/components/card/Card.astro +197 -182
- package/src/components/card/CardAction.astro +26 -26
- package/src/components/card/CardContent.astro +28 -28
- package/src/components/card/CardDescription.astro +28 -28
- package/src/components/card/CardFooter.astro +24 -24
- package/src/components/card/CardHeader.astro +30 -30
- package/src/components/card/CardMedia.astro +27 -27
- package/src/components/card/CardMediaActions.astro +21 -0
- package/src/components/card/CardMediaSelect.astro +21 -0
- package/src/components/card/CardOverlay.astro +32 -32
- package/src/components/card/CardTitle.astro +21 -21
- package/src/components/card/index.ts +12 -10
- package/src/components/carousel/CHANGELOG.md +5 -5
- package/src/components/carousel/Carousel.astro +106 -106
- package/src/components/carousel/CarouselSlide.astro +22 -22
- package/src/components/carousel/index.ts +3 -3
- package/src/components/checkbox/CHANGELOG.md +58 -58
- package/src/components/checkbox/Checkbox.astro +159 -159
- package/src/components/checkbox/index.ts +1 -1
- package/src/components/collapsible/CHANGELOG.md +5 -5
- package/src/components/collapsible/Collapsible.astro +202 -202
- package/src/components/collapsible/CollapsibleContent.astro +36 -36
- package/src/components/collapsible/CollapsibleTrigger.astro +34 -34
- package/src/components/collapsible/index.ts +4 -4
- package/src/components/combobox/CHANGELOG.md +27 -27
- package/src/components/combobox/Combobox.astro +365 -365
- package/src/components/combobox/ComboboxContent.astro +37 -37
- package/src/components/combobox/ComboboxEmpty.astro +18 -18
- package/src/components/combobox/ComboboxGroup.astro +19 -19
- package/src/components/combobox/ComboboxInput.astro +74 -74
- package/src/components/combobox/ComboboxItem.astro +39 -39
- package/src/components/combobox/ComboboxLabel.astro +18 -18
- package/src/components/combobox/ComboboxList.astro +21 -21
- package/src/components/combobox/ComboboxSeparator.astro +17 -17
- package/src/components/combobox/ComboboxTrigger.astro +30 -30
- package/src/components/combobox/ComboboxValue.astro +22 -22
- package/src/components/combobox/index.ts +11 -11
- package/src/components/date/CHANGELOG.md +18 -18
- package/src/components/date/Date.astro +137 -137
- package/src/components/date/index.ts +2 -2
- package/src/components/dialog/CHANGELOG.md +39 -39
- package/src/components/dialog/Dialog.astro +196 -196
- package/src/components/dialog/DialogClose.astro +23 -23
- package/src/components/dialog/DialogContent.astro +42 -42
- package/src/components/dialog/DialogDescription.astro +18 -18
- package/src/components/dialog/DialogFooter.astro +18 -18
- package/src/components/dialog/DialogHeader.astro +18 -18
- package/src/components/dialog/DialogOverlay.astro +19 -19
- package/src/components/dialog/DialogTitle.astro +18 -18
- package/src/components/dialog/DialogTrigger.astro +37 -37
- package/src/components/dialog/index.ts +9 -9
- package/src/components/dropdown-menu/CHANGELOG.md +194 -194
- package/src/components/dropdown-menu/DropdownMenu.astro +226 -226
- package/src/components/dropdown-menu/DropdownMenuCheckboxItem.astro +114 -114
- package/src/components/dropdown-menu/DropdownMenuContent.astro +42 -42
- package/src/components/dropdown-menu/DropdownMenuGroup.astro +19 -19
- package/src/components/dropdown-menu/DropdownMenuItem.astro +220 -220
- package/src/components/dropdown-menu/DropdownMenuItemContent.astro +79 -79
- package/src/components/dropdown-menu/DropdownMenuLabel.astro +20 -20
- package/src/components/dropdown-menu/DropdownMenuPortal.astro +13 -13
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.astro +13 -13
- package/src/components/dropdown-menu/DropdownMenuRadioItem.astro +101 -101
- package/src/components/dropdown-menu/DropdownMenuSeparator.astro +18 -18
- package/src/components/dropdown-menu/DropdownMenuShortcut.astro +18 -18
- package/src/components/dropdown-menu/DropdownMenuTrigger.astro +49 -49
- package/src/components/dropdown-menu/dropdown-menu-item-variants.ts +24 -24
- package/src/components/dropdown-menu/index.ts +12 -12
- package/src/components/field/CHANGELOG.md +33 -33
- package/src/components/field/Field.astro +664 -664
- package/src/components/field/FieldContent.astro +20 -20
- package/src/components/field/FieldDescription.astro +22 -22
- package/src/components/field/FieldError.astro +51 -51
- package/src/components/field/FieldGroup.astro +20 -20
- package/src/components/field/FieldLabel.astro +22 -22
- package/src/components/field/FieldLegend.astro +23 -23
- package/src/components/field/FieldSeparator.astro +30 -30
- package/src/components/field/FieldSet.astro +20 -20
- package/src/components/field/FieldTitle.astro +20 -20
- package/src/components/field/index.ts +10 -10
- package/src/components/hover-card/CHANGELOG.md +20 -20
- package/src/components/hover-card/HoverCard.astro +235 -235
- package/src/components/hover-card/HoverCardContent.astro +54 -54
- package/src/components/hover-card/HoverCardTrigger.astro +38 -38
- package/src/components/hover-card/index.ts +3 -3
- package/src/components/input/CHANGELOG.md +44 -29
- package/src/components/input/Input.astro +130 -130
- package/src/components/input/InputOTP.astro +211 -0
- package/src/components/input/index.ts +2 -2
- package/src/components/input-group/CHANGELOG.md +49 -49
- package/src/components/input-group/InputGroup.astro +135 -135
- package/src/components/input-group/InputGroupAddon.astro +49 -49
- package/src/components/input-group/InputGroupButton.astro +58 -58
- package/src/components/input-group/InputGroupInput.astro +18 -18
- package/src/components/input-group/InputGroupText.astro +21 -21
- package/src/components/input-group/InputGroupTextarea.astro +17 -17
- package/src/components/input-group/controlClasses.ts +2 -2
- package/src/components/input-group/index.ts +6 -6
- package/src/components/item/CHANGELOG.md +27 -27
- package/src/components/item/Item.astro +122 -122
- package/src/components/item/ItemActions.astro +21 -21
- package/src/components/item/ItemContent.astro +25 -25
- package/src/components/item/ItemDescription.astro +25 -25
- package/src/components/item/ItemFooter.astro +24 -24
- package/src/components/item/ItemGroup.astro +24 -24
- package/src/components/item/ItemHeader.astro +24 -24
- package/src/components/item/ItemMedia.astro +47 -47
- package/src/components/item/ItemSeparator.astro +21 -21
- package/src/components/item/ItemTitle.astro +25 -25
- package/src/components/item/index.ts +10 -10
- package/src/components/kbd/CHANGELOG.md +5 -5
- package/src/components/kbd/Kbd.astro +145 -145
- package/src/components/kbd/KbdGroup.astro +55 -55
- package/src/components/kbd/index.ts +2 -2
- package/src/components/label/CHANGELOG.md +28 -28
- package/src/components/label/Label.astro +97 -97
- package/src/components/label/index.ts +2 -2
- package/src/components/link-group/CHANGELOG.md +75 -75
- package/src/components/link-group/LinkGroup.astro +67 -67
- package/src/components/link-group/LinkGroupItem.astro +32 -32
- package/src/components/link-group/LinkGroupList.astro +25 -25
- package/src/components/link-group/LinkGroupTitle.astro +22 -22
- package/src/components/link-group/index.ts +5 -5
- package/src/components/link-group/link-group-list-variants.ts +15 -15
- package/src/components/logo/CHANGELOG.md +17 -0
- package/src/components/logo/Logo.astro +90 -0
- package/src/components/logo/index.ts +3 -0
- package/src/components/logo/logo-paths.ts +57 -0
- package/src/components/marquee/CHANGELOG.md +5 -5
- package/src/components/marquee/Marquee.astro +119 -119
- package/src/components/marquee/index.ts +2 -2
- package/src/components/native-select/CHANGELOG.md +5 -5
- package/src/components/native-select/NativeSelect.astro +125 -125
- package/src/components/native-select/NativeSelectOptGroup.astro +14 -14
- package/src/components/native-select/NativeSelectOption.astro +9 -9
- package/src/components/native-select/index.ts +3 -3
- package/src/components/navigation-menu/CHANGELOG.md +63 -63
- package/src/components/navigation-menu/NavigationMenu.astro +414 -414
- package/src/components/navigation-menu/NavigationMenuContent.astro +37 -37
- package/src/components/navigation-menu/NavigationMenuIndicator.astro +24 -24
- package/src/components/navigation-menu/NavigationMenuItem.astro +22 -22
- package/src/components/navigation-menu/NavigationMenuLink.astro +18 -18
- package/src/components/navigation-menu/NavigationMenuList.astro +21 -21
- package/src/components/navigation-menu/NavigationMenuPositioner.astro +44 -44
- package/src/components/navigation-menu/NavigationMenuTrigger.astro +30 -30
- package/src/components/navigation-menu/NavigationMenuViewport.astro +19 -19
- package/src/components/navigation-menu/index.ts +10 -10
- package/src/components/organisms/lightning-sidebar-nav/CHANGELOG.md +50 -0
- package/src/components/organisms/lightning-sidebar-nav/LightningSidebarNav.astro +176 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNav.astro +50 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavGroup.astro +74 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavItem.astro +94 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavProBadge.astro +26 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavSection.astro +71 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavSkeleton.astro +67 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavSubItem.astro +69 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavUsage.astro +78 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavWorkspaceAvatar.astro +46 -0
- package/src/components/organisms/lightning-sidebar-nav/SidebarNavWorkspaceSwitcher.astro +130 -0
- package/src/components/organisms/lightning-sidebar-nav/icons.ts +46 -0
- package/src/components/organisms/lightning-sidebar-nav/index.ts +18 -0
- package/src/components/organisms/lightning-sidebar-nav/types.ts +77 -0
- package/src/components/popover/CHANGELOG.md +20 -20
- package/src/components/popover/Popover.astro +211 -211
- package/src/components/popover/PopoverClose.astro +18 -18
- package/src/components/popover/PopoverContent.astro +50 -50
- package/src/components/popover/PopoverDescription.astro +18 -18
- package/src/components/popover/PopoverHeader.astro +18 -18
- package/src/components/popover/PopoverTitle.astro +18 -18
- package/src/components/popover/PopoverTrigger.astro +35 -35
- package/src/components/popover/index.ts +7 -7
- package/src/components/radio-group/CHANGELOG.md +31 -31
- package/src/components/radio-group/RadioGroup.astro +81 -81
- package/src/components/radio-group/RadioGroupItem.astro +51 -51
- package/src/components/radio-group/index.ts +3 -3
- package/src/components/select/CHANGELOG.md +39 -39
- package/src/components/select/Select.astro +373 -373
- package/src/components/select/SelectContent.astro +91 -91
- package/src/components/select/SelectGroup.astro +19 -19
- package/src/components/select/SelectItem.astro +48 -48
- package/src/components/select/SelectLabel.astro +18 -18
- package/src/components/select/SelectSeparator.astro +17 -17
- package/src/components/select/SelectTrigger.astro +34 -34
- package/src/components/select/SelectValue.astro +22 -22
- package/src/components/select/index.ts +8 -8
- package/src/components/separator/CHANGELOG.md +5 -5
- package/src/components/separator/Separator.astro +60 -60
- package/src/components/separator/index.ts +2 -2
- package/src/components/skeleton/CHANGELOG.md +5 -5
- package/src/components/skeleton/Skeleton.astro +121 -121
- package/src/components/skeleton/index.ts +1 -1
- package/src/components/slider/CHANGELOG.md +5 -5
- package/src/components/slider/Slider.astro +198 -198
- package/src/components/slider/index.ts +1 -1
- package/src/components/spinner/CHANGELOG.md +18 -18
- package/src/components/spinner/Spinner.astro +135 -135
- package/src/components/spinner/index.ts +1 -1
- package/src/components/sticky-surface/CHANGELOG.md +5 -5
- package/src/components/sticky-surface/StickySurface.astro +152 -152
- package/src/components/sticky-surface/index.ts +2 -2
- package/src/components/switch/CHANGELOG.md +29 -29
- package/src/components/switch/Switch.astro +106 -106
- package/src/components/switch/index.ts +1 -1
- package/src/components/table/CHANGELOG.md +24 -24
- package/src/components/table/Table.astro +358 -251
- package/src/components/table/TableBody.astro +17 -18
- package/src/components/table/TableBulkToolbar.astro +37 -0
- package/src/components/table/TableCaption.astro +17 -17
- package/src/components/table/TableCell.astro +45 -21
- package/src/components/table/TableCellText.astro +17 -0
- package/src/components/table/TableColumnMenu.astro +50 -0
- package/src/components/table/TableEditableCell.astro +287 -0
- package/src/components/table/TableEmpty.astro +17 -0
- package/src/components/table/TableFolderCell.astro +38 -0
- package/src/components/table/TableFooter.astro +21 -21
- package/src/components/table/TableHead.astro +90 -21
- package/src/components/table/TableHeader.astro +17 -17
- package/src/components/table/TablePagination.astro +57 -0
- package/src/components/table/TableRow.astro +52 -21
- package/src/components/table/TableSelectAllBanner.astro +34 -0
- package/src/components/table/TableSelectCell.astro +50 -0
- package/src/components/table/TableSkeletonRow.astro +21 -0
- package/src/components/table/index.ts +19 -9
- package/src/components/table/table-cell-variants.ts +29 -0
- package/src/components/tabs/CHANGELOG.md +5 -5
- package/src/components/tabs/Tabs.astro +306 -306
- package/src/components/tabs/TabsContent.astro +47 -47
- package/src/components/tabs/TabsList.astro +69 -69
- package/src/components/tabs/TabsTrigger.astro +40 -40
- package/src/components/tabs/index.ts +6 -6
- package/src/components/textarea/CHANGELOG.md +22 -22
- package/src/components/textarea/Textarea.astro +58 -58
- package/src/components/textarea/index.ts +2 -2
- package/src/components/toggle/CHANGELOG.md +23 -23
- package/src/components/toggle/Toggle.astro +150 -150
- package/src/components/toggle/index.ts +1 -1
- package/src/components/toggle-group/CHANGELOG.md +18 -18
- package/src/components/toggle-group/ToggleGroup.astro +236 -236
- package/src/components/toggle-group/ToggleGroupItem.astro +48 -48
- package/src/components/toggle-group/index.ts +2 -2
- package/src/components/tooltip/CHANGELOG.md +22 -22
- package/src/components/tooltip/Tooltip.astro +357 -357
- package/src/components/tooltip/TooltipContent.astro +85 -85
- package/src/components/tooltip/TooltipTrigger.astro +34 -34
- package/src/components/tooltip/index.ts +3 -3
- package/src/lib/table-controller.ts +1090 -0
- package/src/lib/toggle-group-controller.ts +113 -113
- package/src/lib/toggle-shared.ts +27 -27
- package/src/lib/utils.ts +6 -6
- package/src/styles/globals.css +209 -177
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
---
|
|
2
|
-
/**
|
|
3
|
-
* @component NativeSelect
|
|
4
|
-
* @title Native Select
|
|
5
|
-
* @description A styled native HTML select element with consistent design system integration.
|
|
6
|
-
*
|
|
7
|
-
* @preview
|
|
8
|
-
* <NativeSelect class="w-[200px]">
|
|
9
|
-
* <NativeSelectOption value="">Select a fruit</NativeSelectOption>
|
|
10
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
11
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
12
|
-
* <NativeSelectOption value="cherry">Cherry</NativeSelectOption>
|
|
13
|
-
* </NativeSelect>
|
|
14
|
-
*
|
|
15
|
-
* @usage
|
|
16
|
-
*
|
|
17
|
-
* ```astro nocollapse
|
|
18
|
-
* ---
|
|
19
|
-
* import {
|
|
20
|
-
* NativeSelect,
|
|
21
|
-
* NativeSelectOption,
|
|
22
|
-
* NativeSelectOptGroup,
|
|
23
|
-
* } from '@bejamas/ui/components/native-select';
|
|
24
|
-
* ---
|
|
25
|
-
*
|
|
26
|
-
* <NativeSelect>
|
|
27
|
-
* <NativeSelectOption value="">Select a fruit</NativeSelectOption>
|
|
28
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
29
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
30
|
-
* </NativeSelect>
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* ### Native Select vs Select
|
|
34
|
-
*
|
|
35
|
-
* Use **NativeSelect** when you need standard browser form behavior — native validation, mobile-optimized pickers, and zero JavaScript. Use **Select** when you need a custom-styled dropdown with keyboard navigation, grouped items, and rich content.
|
|
36
|
-
*
|
|
37
|
-
* @examples
|
|
38
|
-
*
|
|
39
|
-
* ### With Groups
|
|
40
|
-
*
|
|
41
|
-
* <NativeSelect class="w-[200px]">
|
|
42
|
-
* <NativeSelectOptGroup label="Fruits">
|
|
43
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
44
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
45
|
-
* </NativeSelectOptGroup>
|
|
46
|
-
* <NativeSelectOptGroup label="Vegetables">
|
|
47
|
-
* <NativeSelectOption value="carrot">Carrot</NativeSelectOption>
|
|
48
|
-
* <NativeSelectOption value="broccoli">Broccoli</NativeSelectOption>
|
|
49
|
-
* </NativeSelectOptGroup>
|
|
50
|
-
* </NativeSelect>
|
|
51
|
-
*
|
|
52
|
-
* ### Sizes
|
|
53
|
-
*
|
|
54
|
-
* <div class="flex flex-col items-start gap-4 sm:flex-row">
|
|
55
|
-
* <NativeSelect class="w-[180px]" size="sm">
|
|
56
|
-
* <NativeSelectOption value="">Small (h-8)</NativeSelectOption>
|
|
57
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
58
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
59
|
-
* </NativeSelect>
|
|
60
|
-
* <NativeSelect class="w-[180px]" size="default">
|
|
61
|
-
* <NativeSelectOption value="">Default (h-9)</NativeSelectOption>
|
|
62
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
63
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
64
|
-
* </NativeSelect>
|
|
65
|
-
* <NativeSelect class="w-[180px]" size="lg">
|
|
66
|
-
* <NativeSelectOption value="">Large (h-10)</NativeSelectOption>
|
|
67
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
68
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
69
|
-
* </NativeSelect>
|
|
70
|
-
* </div>
|
|
71
|
-
*
|
|
72
|
-
* ### Disabled
|
|
73
|
-
*
|
|
74
|
-
* <NativeSelect disabled class="w-[200px]">
|
|
75
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
76
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
77
|
-
* </NativeSelect>
|
|
78
|
-
*
|
|
79
|
-
* ### Invalid
|
|
80
|
-
*
|
|
81
|
-
* <NativeSelect aria-invalid="true" class="w-[200px]">
|
|
82
|
-
* <NativeSelectOption value="">Select a fruit</NativeSelectOption>
|
|
83
|
-
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
84
|
-
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
85
|
-
* </NativeSelect>
|
|
86
|
-
*
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
import type { HTMLAttributes } from "astro/types";
|
|
90
|
-
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
91
|
-
|
|
92
|
-
interface Props extends HTMLAttributes<"select"> {
|
|
93
|
-
class?: string;
|
|
94
|
-
size?: "sm" | "default" | "lg";
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const {
|
|
98
|
-
class: className = "",
|
|
99
|
-
size = "default",
|
|
100
|
-
...rest
|
|
101
|
-
} = Astro.props as Props;
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
<div
|
|
105
|
-
data-slot="native-select-wrapper"
|
|
106
|
-
data-size={size}
|
|
107
|
-
class={cn("",
|
|
108
|
-
"group/native-select relative w-fit has-[select:disabled]:opacity-50",
|
|
109
|
-
className,
|
|
110
|
-
)}
|
|
111
|
-
>
|
|
112
|
-
<select
|
|
113
|
-
data-slot="native-select"
|
|
114
|
-
data-size={size}
|
|
115
|
-
class={cn(
|
|
116
|
-
"border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent py-1 pr-8 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-8 rounded-lg outline-none disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
117
|
-
)}
|
|
118
|
-
{...rest}
|
|
119
|
-
>
|
|
120
|
-
<slot />
|
|
121
|
-
</select>
|
|
122
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none"
|
|
123
|
-
aria-hidden="true"
|
|
124
|
-
data-slot="native-select-icon"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9l6 6l6-6"/></svg>
|
|
125
|
-
</div>
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* @component NativeSelect
|
|
4
|
+
* @title Native Select
|
|
5
|
+
* @description A styled native HTML select element with consistent design system integration.
|
|
6
|
+
*
|
|
7
|
+
* @preview
|
|
8
|
+
* <NativeSelect class="w-[200px]">
|
|
9
|
+
* <NativeSelectOption value="">Select a fruit</NativeSelectOption>
|
|
10
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
11
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
12
|
+
* <NativeSelectOption value="cherry">Cherry</NativeSelectOption>
|
|
13
|
+
* </NativeSelect>
|
|
14
|
+
*
|
|
15
|
+
* @usage
|
|
16
|
+
*
|
|
17
|
+
* ```astro nocollapse
|
|
18
|
+
* ---
|
|
19
|
+
* import {
|
|
20
|
+
* NativeSelect,
|
|
21
|
+
* NativeSelectOption,
|
|
22
|
+
* NativeSelectOptGroup,
|
|
23
|
+
* } from '@bejamas/ui/components/native-select';
|
|
24
|
+
* ---
|
|
25
|
+
*
|
|
26
|
+
* <NativeSelect>
|
|
27
|
+
* <NativeSelectOption value="">Select a fruit</NativeSelectOption>
|
|
28
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
29
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
30
|
+
* </NativeSelect>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* ### Native Select vs Select
|
|
34
|
+
*
|
|
35
|
+
* Use **NativeSelect** when you need standard browser form behavior — native validation, mobile-optimized pickers, and zero JavaScript. Use **Select** when you need a custom-styled dropdown with keyboard navigation, grouped items, and rich content.
|
|
36
|
+
*
|
|
37
|
+
* @examples
|
|
38
|
+
*
|
|
39
|
+
* ### With Groups
|
|
40
|
+
*
|
|
41
|
+
* <NativeSelect class="w-[200px]">
|
|
42
|
+
* <NativeSelectOptGroup label="Fruits">
|
|
43
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
44
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
45
|
+
* </NativeSelectOptGroup>
|
|
46
|
+
* <NativeSelectOptGroup label="Vegetables">
|
|
47
|
+
* <NativeSelectOption value="carrot">Carrot</NativeSelectOption>
|
|
48
|
+
* <NativeSelectOption value="broccoli">Broccoli</NativeSelectOption>
|
|
49
|
+
* </NativeSelectOptGroup>
|
|
50
|
+
* </NativeSelect>
|
|
51
|
+
*
|
|
52
|
+
* ### Sizes
|
|
53
|
+
*
|
|
54
|
+
* <div class="flex flex-col items-start gap-4 sm:flex-row">
|
|
55
|
+
* <NativeSelect class="w-[180px]" size="sm">
|
|
56
|
+
* <NativeSelectOption value="">Small (h-8)</NativeSelectOption>
|
|
57
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
58
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
59
|
+
* </NativeSelect>
|
|
60
|
+
* <NativeSelect class="w-[180px]" size="default">
|
|
61
|
+
* <NativeSelectOption value="">Default (h-9)</NativeSelectOption>
|
|
62
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
63
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
64
|
+
* </NativeSelect>
|
|
65
|
+
* <NativeSelect class="w-[180px]" size="lg">
|
|
66
|
+
* <NativeSelectOption value="">Large (h-10)</NativeSelectOption>
|
|
67
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
68
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
69
|
+
* </NativeSelect>
|
|
70
|
+
* </div>
|
|
71
|
+
*
|
|
72
|
+
* ### Disabled
|
|
73
|
+
*
|
|
74
|
+
* <NativeSelect disabled class="w-[200px]">
|
|
75
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
76
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
77
|
+
* </NativeSelect>
|
|
78
|
+
*
|
|
79
|
+
* ### Invalid
|
|
80
|
+
*
|
|
81
|
+
* <NativeSelect aria-invalid="true" class="w-[200px]">
|
|
82
|
+
* <NativeSelectOption value="">Select a fruit</NativeSelectOption>
|
|
83
|
+
* <NativeSelectOption value="apple">Apple</NativeSelectOption>
|
|
84
|
+
* <NativeSelectOption value="banana">Banana</NativeSelectOption>
|
|
85
|
+
* </NativeSelect>
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
import type { HTMLAttributes } from "astro/types";
|
|
90
|
+
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
91
|
+
|
|
92
|
+
interface Props extends HTMLAttributes<"select"> {
|
|
93
|
+
class?: string;
|
|
94
|
+
size?: "sm" | "default" | "lg";
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const {
|
|
98
|
+
class: className = "",
|
|
99
|
+
size = "default",
|
|
100
|
+
...rest
|
|
101
|
+
} = Astro.props as Props;
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
<div
|
|
105
|
+
data-slot="native-select-wrapper"
|
|
106
|
+
data-size={size}
|
|
107
|
+
class={cn("",
|
|
108
|
+
"group/native-select relative w-fit has-[select:disabled]:opacity-50",
|
|
109
|
+
className,
|
|
110
|
+
)}
|
|
111
|
+
>
|
|
112
|
+
<select
|
|
113
|
+
data-slot="native-select"
|
|
114
|
+
data-size={size}
|
|
115
|
+
class={cn(
|
|
116
|
+
"border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent py-1 pr-8 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-8 rounded-lg outline-none disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
117
|
+
)}
|
|
118
|
+
{...rest}
|
|
119
|
+
>
|
|
120
|
+
<slot />
|
|
121
|
+
</select>
|
|
122
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none"
|
|
123
|
+
aria-hidden="true"
|
|
124
|
+
data-slot="native-select-icon"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9l6 6l6-6"/></svg>
|
|
125
|
+
</div>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
4
|
-
|
|
5
|
-
interface Props extends HTMLAttributes<"optgroup"> {
|
|
6
|
-
class?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const { class: className = "", ...rest } = Astro.props as Props;
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<optgroup data-slot="native-select-optgroup" class={cn("", className)} {...rest}>
|
|
13
|
-
<slot />
|
|
14
|
-
</optgroup>
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cn } from "@cl-light-ds/ui/lib/utils";
|
|
4
|
+
|
|
5
|
+
interface Props extends HTMLAttributes<"optgroup"> {
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { class: className = "", ...rest } = Astro.props as Props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<optgroup data-slot="native-select-optgroup" class={cn("", className)} {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</optgroup>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
|
|
4
|
-
interface Props extends HTMLAttributes<"option"> {}
|
|
5
|
-
|
|
6
|
-
const { ...rest } = Astro.props as Props;
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<option data-slot="native-select-option" {...rest} class=""><slot /></option>
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
|
|
4
|
+
interface Props extends HTMLAttributes<"option"> {}
|
|
5
|
+
|
|
6
|
+
const { ...rest } = Astro.props as Props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<option data-slot="native-select-option" {...rest} class=""><slot /></option>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as NativeSelect } from "./NativeSelect.astro";
|
|
2
|
-
export { default as NativeSelectOption } from "./NativeSelectOption.astro";
|
|
3
|
-
export { default as NativeSelectOptGroup } from "./NativeSelectOptGroup.astro";
|
|
1
|
+
export { default as NativeSelect } from "./NativeSelect.astro";
|
|
2
|
+
export { default as NativeSelectOption } from "./NativeSelectOption.astro";
|
|
3
|
+
export { default as NativeSelectOptGroup } from "./NativeSelectOptGroup.astro";
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to the `NavigationMenu` component will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## Date 10th Sep 2026 (follow-up)
|
|
6
|
-
## Fix: NavigationMenuItem's `align` prop was a no-op
|
|
7
|
-
|
|
8
|
-
### Fixed
|
|
9
|
-
|
|
10
|
-
- `NavigationMenuItem.astro`: added an `align?: "start" | "center" | "end"` prop, rendered as `data-align` on the `<li>` — mirrors how `value`/`data-value` already worked in this file. Previously the prop wasn't declared at all, so passing `align="..."` fell into the component's `{...rest}` spread and rendered as an inert, non-`data-*` HTML attribute that `@data-slot/navigation-menu`'s runtime never reads (it only reads `data-*`). The runtime already supported per-item alignment via `data-align` on either `NavigationMenuContent` (checked first) or `NavigationMenuItem` (checked as a fallback) — confirmed by reading its bundled source — so this was purely a missing pass-through in the Astro wrapper, not a runtime limitation. This also makes `NavigationMenuItem`'s entry in the live Storybook `PropsTable` (`"Content alignment relative to trigger (on NavigationMenuItem/NavigationMenuContent)"`) actually true for the first time.
|
|
11
|
-
- Caught via the new "Item alignment" Storybook preview lane, which showed all three `align` values opening in the identical position before this fix.
|
|
12
|
-
|
|
13
|
-
## Date 10th Sep 2026 (follow-up)
|
|
14
|
-
## Fix: link title/subtext font tokens (node 5548-10862)
|
|
15
|
-
|
|
16
|
-
### Fixed
|
|
17
|
-
|
|
18
|
-
- The designer re-bound the component's font variables in Figma, exposing two named text styles: `text/lg/lg-medium` (Inter, 500, 16px/24px line-height — used for every title/label) and `text/md/md-medium` (Inter, 500, 14px/20px line-height — used for every subtext/description line, now explicitly Medium weight where it was previously an unbound raw value).
|
|
19
|
-
- Audited the codebase's font bindings against these: `--font-sans` (Inter, via Astro's `fontProviders.google()`) and Tailwind's `font-medium` (500) already matched exactly, and Tailwind's `text-base`/`text-sm` utilities already match Figma's `text-base`/`text-md` sizes and line-heights value-for-value — no new CSS tokens were needed.
|
|
20
|
-
- The gap was in the repeated title/subtext markup pattern used everywhere a `NavigationMenuLink` holds a title + description (in `NavigationMenu.astro`'s JSDoc `@preview`/`@usage`/`@examples` blocks, and mirrored in `apps/web/src/pages/storybook/_sections/navigation-menu.astro`): titles used `leading-none font-medium` with no `text-base`, so they inherited `NavigationMenuLink`'s wrapper `text-sm` (14px) instead of the correct 16px, and subtext used `line-clamp-2 text-muted-foreground` with no `font-medium`, rendering at regular/400 weight instead of the now-explicit Medium/500. Fixed both: titles are now `text-base font-medium` (dropped `leading-none` — Tailwind's `text-base` already pairs a matching 24px/1.5 line-height by default), subtext is now `line-clamp-2 font-medium text-muted-foreground`.
|
|
21
|
-
- The JSDoc-only "Featured Card" example had its own drift (`text-lg` title, no `font-medium` on the description) — fixed to `text-base font-medium` / `text-sm font-medium text-muted-foreground` to match the Card variant's spec.
|
|
22
|
-
- `NavigationMenuLink.astro` and `NavigationMenuTrigger.astro` themselves were not changed — the trigger already matched `text/lg/lg-medium` exactly, and the link's base `text-sm` remains the correct default for plain text-only links (e.g. the "With Simple Links" example); only the title/subtext content pattern needed to explicitly opt into the right size/weight at the point of use.
|
|
23
|
-
|
|
24
|
-
## Date 10th Sep 2026 (follow-up)
|
|
25
|
-
## Fix: NavigationMenuIndicator painting over trigger text (node 5548-10862)
|
|
26
|
-
|
|
27
|
-
### Fixed
|
|
28
|
-
|
|
29
|
-
- `NavigationMenuItem.astro`: added `z-10` alongside the existing `relative` class. `NavigationMenuIndicator` is an absolutely-positioned `bg-muted/60` highlight the runtime slides to match the active trigger's exact bounding box; because it's `absolute z-0` and comes last in DOM order among the list's positioned children (`NavigationMenuList` is `relative`, each `NavigationMenuItem` was `relative` with no explicit `z-index`), it was painting on top of — not behind — the active/hovered trigger, washing its text out to a translucent gray instead of `--foreground`. The trigger's own text/background styling was already correct (verified via computed `color`, `opacity`, and `-webkit-text-fill-color`, all unaffected); this was purely a stacking-order bug from a second element overlapping it. Figma's design has no separate sliding-highlight layer at all — every hover/open highlight is baked into the trigger's own background classes — so restacking the indicator behind the trigger is a no-op visually (it's now fully covered by the trigger's own opaque/semi-opaque background) rather than a loss of functionality.
|
|
30
|
-
|
|
31
|
-
## Date 10th Sep 2026 (follow-up)
|
|
32
|
-
## Fix: trigger label color in the open state (node 5548-10862)
|
|
33
|
-
|
|
34
|
-
### Fixed
|
|
35
|
-
|
|
36
|
-
- `NavigationMenuTrigger.astro`: added an explicit `text-foreground` to `navigationMenuTriggerStyle`'s base classes. The trigger previously set no text color at all and relied on inheritance, which let the label read as a dimmer color once open (`data-open:bg-muted/50`). Figma binds the label to `--foreground` in every state (Closed/Default, Closed/Hover, Closed/Focus, Opened) — never a muted color — and every other trigger-style element in the system (`Button`'s `outline`/`ghost` variants) already binds color explicitly rather than relying on inheritance. This brings `NavigationMenuTrigger` in line with both.
|
|
37
|
-
|
|
38
|
-
## Date 10th Sep 2026
|
|
39
|
-
## Figma alignment (node 5548-10862)
|
|
40
|
-
|
|
41
|
-
### Sizing & Spacing
|
|
42
|
-
|
|
43
|
-
- **Trigger** (`NavigationMenuTrigger`): height `h-9` (36px) → `h-11` (44px); vertical padding `py-2` (8px) → `py-2.5` (10px); added an explicit `gap-1.5` (6px) between the label and the chevron, replacing the chevron's old `ml-1` (4px) margin — matches Figma's `padding/p-1-5` gap token exactly.
|
|
44
|
-
- **Link** (`NavigationMenuLink`): padding `p-2` (8px) → `p-3` (12px); icon↔content gap `gap-1.5` (6px) → `gap-4` (16px); alignment `items-center` → `items-start` (Figma's link items top-align icon + title + two-line subtext); radius `rounded-sm` (4px) → `rounded-lg` (8px), matching the popup surface radius and `DropdownMenuItem`'s established radius.
|
|
45
|
-
- **Popup/viewport chrome** (`NavigationMenuPositioner`, `NavigationMenuViewport`, and the no-viewport branch of `NavigationMenuContent`): `ring-1 ring-foreground/10` + generic `shadow` → `border border-border` + Figma's literal `card-light` effect (`shadow-[0px_1px_1px_0px_rgba(5,23,41,0.06)]`) — Figma uses a real 1px border, not a ring, same fix already applied to `DropdownMenuContent` in the dropdown-menu pass.
|
|
46
|
-
- **Content** (`NavigationMenuContent`): padding `p-2 pr-2.5` (asymmetric, scrollbar-compensated) → uniform `p-2` (8px), matching Figma's content padding exactly.
|
|
47
|
-
|
|
48
|
-
### Docs
|
|
49
|
-
|
|
50
|
-
- `NavigationMenu.astro`'s "Featured Card" `@examples` block switched from a gradient fill (`bg-gradient-to-b from-muted/50 to-muted`, `rounded-md`) to a solid `bg-accent rounded-lg` fill, matching the structure of Figma's featured-card highlight (a flat accent-colored panel, not a gradient).
|
|
51
|
-
|
|
52
|
-
### Tokens
|
|
53
|
-
|
|
54
|
-
- No new tokens added. `popover`, `border`, `muted-foreground`, and `ring` (`primary-400`) were already bound correctly and needed no change.
|
|
55
|
-
- **Known drift (not fixed in this pass):** Figma's `accent` variable for the featured-card highlight is `#ebf3fc` (light blue); the codebase's `--accent` token (`globals.css`) is a near-white gray (`oklch(0.97 0 0)`). Left as-is per design decision — the "Featured Card" example above uses `bg-accent` structurally, so it will pick up the correct color automatically whenever `--accent` is revisited as its own task.
|
|
56
|
-
|
|
57
|
-
### Flagged for the designer / engineering (not addressed in this pass)
|
|
58
|
-
|
|
59
|
-
- Figma's `showIcon`/`showTitle`/`showSubtext` booleans on the "Navigation Menu" component are Figma-prototyping variants, not real component props — Astro's slot-based composition shows/hides content by presence in the slot, not via a boolean prop. No action needed unless a named-slot pattern (e.g. `<slot name="icon">`) is specifically wanted.
|
|
60
|
-
- The new 44px trigger height doesn't correspond to any size in the shared `Button` scale (`sm`=32px, `default`=36px, `lg`=40px, used by `DropdownMenuTrigger`) — currently bespoke to `NavigationMenuTrigger`. Worth a deliberate call on whether that should become a reusable `Button` size.
|
|
61
|
-
- `NavigationMenuTrigger.astro` calls `cva()` with no `variants` map (just a base-string wrapper) — fine while the trigger has no real variants, but if Figma introduces trigger variants later, extend via the established `<component>-<part>-variants.ts` convention (see `dropdown-menu-item-variants.ts`, `link-group-list-variants.ts`) rather than inline `data-[...]:` selectors.
|
|
62
|
-
|
|
63
|
-
## Unreleased
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `NavigationMenu` component will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## Date 10th Sep 2026 (follow-up)
|
|
6
|
+
## Fix: NavigationMenuItem's `align` prop was a no-op
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- `NavigationMenuItem.astro`: added an `align?: "start" | "center" | "end"` prop, rendered as `data-align` on the `<li>` — mirrors how `value`/`data-value` already worked in this file. Previously the prop wasn't declared at all, so passing `align="..."` fell into the component's `{...rest}` spread and rendered as an inert, non-`data-*` HTML attribute that `@data-slot/navigation-menu`'s runtime never reads (it only reads `data-*`). The runtime already supported per-item alignment via `data-align` on either `NavigationMenuContent` (checked first) or `NavigationMenuItem` (checked as a fallback) — confirmed by reading its bundled source — so this was purely a missing pass-through in the Astro wrapper, not a runtime limitation. This also makes `NavigationMenuItem`'s entry in the live Storybook `PropsTable` (`"Content alignment relative to trigger (on NavigationMenuItem/NavigationMenuContent)"`) actually true for the first time.
|
|
11
|
+
- Caught via the new "Item alignment" Storybook preview lane, which showed all three `align` values opening in the identical position before this fix.
|
|
12
|
+
|
|
13
|
+
## Date 10th Sep 2026 (follow-up)
|
|
14
|
+
## Fix: link title/subtext font tokens (node 5548-10862)
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- The designer re-bound the component's font variables in Figma, exposing two named text styles: `text/lg/lg-medium` (Inter, 500, 16px/24px line-height — used for every title/label) and `text/md/md-medium` (Inter, 500, 14px/20px line-height — used for every subtext/description line, now explicitly Medium weight where it was previously an unbound raw value).
|
|
19
|
+
- Audited the codebase's font bindings against these: `--font-sans` (Inter, via Astro's `fontProviders.google()`) and Tailwind's `font-medium` (500) already matched exactly, and Tailwind's `text-base`/`text-sm` utilities already match Figma's `text-base`/`text-md` sizes and line-heights value-for-value — no new CSS tokens were needed.
|
|
20
|
+
- The gap was in the repeated title/subtext markup pattern used everywhere a `NavigationMenuLink` holds a title + description (in `NavigationMenu.astro`'s JSDoc `@preview`/`@usage`/`@examples` blocks, and mirrored in `apps/web/src/pages/storybook/_sections/navigation-menu.astro`): titles used `leading-none font-medium` with no `text-base`, so they inherited `NavigationMenuLink`'s wrapper `text-sm` (14px) instead of the correct 16px, and subtext used `line-clamp-2 text-muted-foreground` with no `font-medium`, rendering at regular/400 weight instead of the now-explicit Medium/500. Fixed both: titles are now `text-base font-medium` (dropped `leading-none` — Tailwind's `text-base` already pairs a matching 24px/1.5 line-height by default), subtext is now `line-clamp-2 font-medium text-muted-foreground`.
|
|
21
|
+
- The JSDoc-only "Featured Card" example had its own drift (`text-lg` title, no `font-medium` on the description) — fixed to `text-base font-medium` / `text-sm font-medium text-muted-foreground` to match the Card variant's spec.
|
|
22
|
+
- `NavigationMenuLink.astro` and `NavigationMenuTrigger.astro` themselves were not changed — the trigger already matched `text/lg/lg-medium` exactly, and the link's base `text-sm` remains the correct default for plain text-only links (e.g. the "With Simple Links" example); only the title/subtext content pattern needed to explicitly opt into the right size/weight at the point of use.
|
|
23
|
+
|
|
24
|
+
## Date 10th Sep 2026 (follow-up)
|
|
25
|
+
## Fix: NavigationMenuIndicator painting over trigger text (node 5548-10862)
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- `NavigationMenuItem.astro`: added `z-10` alongside the existing `relative` class. `NavigationMenuIndicator` is an absolutely-positioned `bg-muted/60` highlight the runtime slides to match the active trigger's exact bounding box; because it's `absolute z-0` and comes last in DOM order among the list's positioned children (`NavigationMenuList` is `relative`, each `NavigationMenuItem` was `relative` with no explicit `z-index`), it was painting on top of — not behind — the active/hovered trigger, washing its text out to a translucent gray instead of `--foreground`. The trigger's own text/background styling was already correct (verified via computed `color`, `opacity`, and `-webkit-text-fill-color`, all unaffected); this was purely a stacking-order bug from a second element overlapping it. Figma's design has no separate sliding-highlight layer at all — every hover/open highlight is baked into the trigger's own background classes — so restacking the indicator behind the trigger is a no-op visually (it's now fully covered by the trigger's own opaque/semi-opaque background) rather than a loss of functionality.
|
|
30
|
+
|
|
31
|
+
## Date 10th Sep 2026 (follow-up)
|
|
32
|
+
## Fix: trigger label color in the open state (node 5548-10862)
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- `NavigationMenuTrigger.astro`: added an explicit `text-foreground` to `navigationMenuTriggerStyle`'s base classes. The trigger previously set no text color at all and relied on inheritance, which let the label read as a dimmer color once open (`data-open:bg-muted/50`). Figma binds the label to `--foreground` in every state (Closed/Default, Closed/Hover, Closed/Focus, Opened) — never a muted color — and every other trigger-style element in the system (`Button`'s `outline`/`ghost` variants) already binds color explicitly rather than relying on inheritance. This brings `NavigationMenuTrigger` in line with both.
|
|
37
|
+
|
|
38
|
+
## Date 10th Sep 2026
|
|
39
|
+
## Figma alignment (node 5548-10862)
|
|
40
|
+
|
|
41
|
+
### Sizing & Spacing
|
|
42
|
+
|
|
43
|
+
- **Trigger** (`NavigationMenuTrigger`): height `h-9` (36px) → `h-11` (44px); vertical padding `py-2` (8px) → `py-2.5` (10px); added an explicit `gap-1.5` (6px) between the label and the chevron, replacing the chevron's old `ml-1` (4px) margin — matches Figma's `padding/p-1-5` gap token exactly.
|
|
44
|
+
- **Link** (`NavigationMenuLink`): padding `p-2` (8px) → `p-3` (12px); icon↔content gap `gap-1.5` (6px) → `gap-4` (16px); alignment `items-center` → `items-start` (Figma's link items top-align icon + title + two-line subtext); radius `rounded-sm` (4px) → `rounded-lg` (8px), matching the popup surface radius and `DropdownMenuItem`'s established radius.
|
|
45
|
+
- **Popup/viewport chrome** (`NavigationMenuPositioner`, `NavigationMenuViewport`, and the no-viewport branch of `NavigationMenuContent`): `ring-1 ring-foreground/10` + generic `shadow` → `border border-border` + Figma's literal `card-light` effect (`shadow-[0px_1px_1px_0px_rgba(5,23,41,0.06)]`) — Figma uses a real 1px border, not a ring, same fix already applied to `DropdownMenuContent` in the dropdown-menu pass.
|
|
46
|
+
- **Content** (`NavigationMenuContent`): padding `p-2 pr-2.5` (asymmetric, scrollbar-compensated) → uniform `p-2` (8px), matching Figma's content padding exactly.
|
|
47
|
+
|
|
48
|
+
### Docs
|
|
49
|
+
|
|
50
|
+
- `NavigationMenu.astro`'s "Featured Card" `@examples` block switched from a gradient fill (`bg-gradient-to-b from-muted/50 to-muted`, `rounded-md`) to a solid `bg-accent rounded-lg` fill, matching the structure of Figma's featured-card highlight (a flat accent-colored panel, not a gradient).
|
|
51
|
+
|
|
52
|
+
### Tokens
|
|
53
|
+
|
|
54
|
+
- No new tokens added. `popover`, `border`, `muted-foreground`, and `ring` (`primary-400`) were already bound correctly and needed no change.
|
|
55
|
+
- **Known drift (not fixed in this pass):** Figma's `accent` variable for the featured-card highlight is `#ebf3fc` (light blue); the codebase's `--accent` token (`globals.css`) is a near-white gray (`oklch(0.97 0 0)`). Left as-is per design decision — the "Featured Card" example above uses `bg-accent` structurally, so it will pick up the correct color automatically whenever `--accent` is revisited as its own task.
|
|
56
|
+
|
|
57
|
+
### Flagged for the designer / engineering (not addressed in this pass)
|
|
58
|
+
|
|
59
|
+
- Figma's `showIcon`/`showTitle`/`showSubtext` booleans on the "Navigation Menu" component are Figma-prototyping variants, not real component props — Astro's slot-based composition shows/hides content by presence in the slot, not via a boolean prop. No action needed unless a named-slot pattern (e.g. `<slot name="icon">`) is specifically wanted.
|
|
60
|
+
- The new 44px trigger height doesn't correspond to any size in the shared `Button` scale (`sm`=32px, `default`=36px, `lg`=40px, used by `DropdownMenuTrigger`) — currently bespoke to `NavigationMenuTrigger`. Worth a deliberate call on whether that should become a reusable `Button` size.
|
|
61
|
+
- `NavigationMenuTrigger.astro` calls `cva()` with no `variants` map (just a base-string wrapper) — fine while the trigger has no real variants, but if Figma introduces trigger variants later, extend via the established `<component>-<part>-variants.ts` convention (see `dropdown-menu-item-variants.ts`, `link-group-list-variants.ts`) rather than inline `data-[...]:` selectors.
|
|
62
|
+
|
|
63
|
+
## Unreleased
|