@aleph-alpha/ui-library 1.25.2 → 2.2.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/config.d.ts +11 -23
- package/config.js +161 -105
- package/dist/system/components/UiFileUploadBox/index.d.ts +1 -1
- package/dist/system/components/UiSnackbar/UiSnackbar.vue.d.ts +5 -0
- package/dist/system/components/UiSnackbar/index.d.ts +3 -0
- package/dist/system/components/UiSnackbar/types.d.ts +96 -0
- package/dist/system/components/core/sonner/Sonner.vue.d.ts +3 -0
- package/dist/system/components/core/sonner/index.d.ts +1 -0
- package/dist/system/components/index.d.ts +1 -1
- package/dist/system/index.d.ts +3 -4
- package/dist/system/lib.js +20826 -19243
- package/dist/system/patterns/UiSidebar/UiSidebarGroupLabel.vue.d.ts +6 -6
- package/dist/system/patterns/UiSidebar/activeIndicator.d.ts +1 -2
- package/dist/system/patterns/UiSidebar/index.d.ts +1 -3
- package/dist/system/patterns/UiSidebar/types.d.ts +1 -92
- package/docs/public-docs/component-directory.md +8 -4
- package/docs/public-docs/contributing.md +3 -3
- package/docs/public-docs/external-links.md +1 -9
- package/docs/public-docs/foundations.md +101 -6
- package/docs/public-docs/getting-started-designers.md +2 -2
- package/hover-mix.d.ts +18 -14
- package/hover-mix.js +24 -20
- package/package.json +9 -7
- package/src/components/UiAccordion/UiAccordion.stories.ts +48 -10
- package/src/components/UiAccordion/UiAccordion.vue +10 -10
- package/src/components/UiAccordion/UiAccordionContent.vue +6 -6
- package/src/components/UiAccordion/UiAccordionItem.vue +6 -6
- package/src/components/UiAccordion/UiAccordionTrigger.vue +14 -10
- package/src/components/UiAccordion/__tests__/UiAccordion.test.ts +72 -14
- package/src/components/UiAccordion/types.ts +3 -1
- package/src/components/UiAlert/UiAlert.stories.ts +9 -4
- package/src/components/UiAlert/UiAlert.vue +15 -15
- package/src/components/UiAlert/UiAlertDescription.vue +4 -4
- package/src/components/UiAlert/UiAlertTitle.vue +4 -4
- package/src/components/UiAlertDialog/UiAlertDialog.vue +9 -9
- package/src/components/UiAlertDialog/UiAlertDialogAction.vue +6 -6
- package/src/components/UiAlertDialog/UiAlertDialogCancel.vue +6 -6
- package/src/components/UiAlertDialog/UiAlertDialogContent.vue +7 -7
- package/src/components/UiAlertDialog/UiAlertDialogDescription.vue +6 -6
- package/src/components/UiAlertDialog/UiAlertDialogFooter.vue +4 -4
- package/src/components/UiAlertDialog/UiAlertDialogHeader.vue +6 -6
- package/src/components/UiAlertDialog/UiAlertDialogTitle.vue +6 -6
- package/src/components/UiAlertDialog/UiAlertDialogTrigger.vue +6 -6
- package/src/components/UiAvatar/UiAvatar.stories.ts +6 -2
- package/src/components/UiAvatar/UiAvatar.vue +4 -4
- package/src/components/UiAvatar/UiAvatarFallback.vue +4 -4
- package/src/components/UiAvatar/UiAvatarImage.vue +6 -6
- package/src/components/UiAvatar/__tests__/UiAvatar.test.ts +3 -1
- package/src/components/UiBadge/UiBadge.stories.ts +11 -1
- package/src/components/UiBadge/UiBadge.vue +13 -13
- package/src/components/UiBadge/__tests__/UiBadge.test.ts +7 -2
- package/src/components/UiButton/UiButton.stories.ts +20 -2
- package/src/components/UiButton/UiButton.vue +54 -51
- package/src/components/UiButton/__tests__/UiButton.test.ts +8 -1
- package/src/components/UiCalendar/UiCalendar.stories.ts +12 -27
- package/src/components/UiCalendar/UiCalendar.vue +37 -21
- package/src/components/UiCard/UiCard.stories.ts +8 -4
- package/src/components/UiCard/UiCard.vue +4 -4
- package/src/components/UiCard/UiCardAction.vue +4 -4
- package/src/components/UiCard/UiCardContent.vue +4 -4
- package/src/components/UiCard/UiCardDescription.vue +4 -4
- package/src/components/UiCard/UiCardFooter.vue +4 -4
- package/src/components/UiCard/UiCardHeader.vue +4 -4
- package/src/components/UiCard/UiCardTitle.vue +4 -4
- package/src/components/UiCard/__tests__/UiCardDescription.test.ts +3 -1
- package/src/components/UiCheckbox/UiCheckbox.stories.ts +4 -0
- package/src/components/UiCheckbox/UiCheckbox.vue +10 -10
- package/src/components/UiChip/UiChip.stories.ts +12 -1
- package/src/components/UiChip/UiChip.vue +94 -75
- package/src/components/UiCodeBlock/UiCodeBlock.stories.ts +19 -3
- package/src/components/UiCodeBlock/UiCodeBlock.vue +122 -109
- package/src/components/UiCodeBlock/__tests__/UiCodeBlock.test.ts +22 -6
- package/src/components/UiDialog/UiDialog.stories.ts +2 -1
- package/src/components/UiDialog/UiDialog.vue +9 -9
- package/src/components/UiDialog/UiDialogClose.vue +6 -6
- package/src/components/UiDialog/UiDialogContent.vue +61 -52
- package/src/components/UiDialog/UiDialogDescription.vue +6 -6
- package/src/components/UiDialog/UiDialogFooter.vue +6 -6
- package/src/components/UiDialog/UiDialogHeader.vue +6 -6
- package/src/components/UiDialog/UiDialogTitle.vue +6 -6
- package/src/components/UiDialog/UiDialogTrigger.vue +6 -6
- package/src/components/UiDialog/__tests__/UiDialog.test.ts +6 -2
- package/src/components/UiDrawer/UiDrawer.stories.ts +10 -8
- package/src/components/UiDrawer/UiDrawer.vue +9 -9
- package/src/components/UiDrawer/UiDrawerClose.vue +6 -6
- package/src/components/UiDrawer/UiDrawerContent.vue +10 -10
- package/src/components/UiDrawer/UiDrawerDescription.vue +6 -6
- package/src/components/UiDrawer/UiDrawerFooter.vue +6 -6
- package/src/components/UiDrawer/UiDrawerHeader.vue +6 -6
- package/src/components/UiDrawer/UiDrawerTitle.vue +6 -6
- package/src/components/UiDrawer/UiDrawerTrigger.vue +6 -6
- package/src/components/UiDropdownMenu/UiDropdownMenu.stories.ts +18 -6
- package/src/components/UiDropdownMenu/UiDropdownMenu.vue +10 -10
- package/src/components/UiDropdownMenu/UiDropdownMenuCheckboxItem.vue +11 -11
- package/src/components/UiDropdownMenu/UiDropdownMenuContent.vue +14 -11
- package/src/components/UiDropdownMenu/UiDropdownMenuGroup.vue +4 -4
- package/src/components/UiDropdownMenu/UiDropdownMenuItem.vue +11 -11
- package/src/components/UiDropdownMenu/UiDropdownMenuLabel.vue +8 -8
- package/src/components/UiDropdownMenu/UiDropdownMenuRadioGroup.vue +10 -7
- package/src/components/UiDropdownMenu/UiDropdownMenuRadioItem.vue +9 -9
- package/src/components/UiDropdownMenu/UiDropdownMenuSeparator.vue +4 -4
- package/src/components/UiDropdownMenu/UiDropdownMenuShortcut.vue +4 -4
- package/src/components/UiDropdownMenu/UiDropdownMenuSub.vue +10 -10
- package/src/components/UiDropdownMenu/UiDropdownMenuSubContent.vue +12 -9
- package/src/components/UiDropdownMenu/UiDropdownMenuSubTrigger.vue +10 -10
- package/src/components/UiDropdownMenu/UiDropdownMenuTrigger.vue +10 -10
- package/src/components/UiDropdownMenu/__tests__/UiDropdownMenu.test.ts +105 -15
- package/src/components/UiEmpty/UiEmpty.stories.ts +5 -0
- package/src/components/UiEmpty/UiEmpty.vue +14 -11
- package/src/components/UiField/UiField.stories.ts +48 -8
- package/src/components/UiField/UiField.vue +78 -72
- package/src/components/UiField/UiFieldContent.vue +4 -4
- package/src/components/UiField/UiFieldDescription.vue +23 -17
- package/src/components/UiField/UiFieldError.vue +11 -9
- package/src/components/UiField/UiFieldGroup.vue +4 -4
- package/src/components/UiField/UiFieldLabel.vue +12 -8
- package/src/components/UiField/UiFieldLabelInfo.vue +15 -11
- package/src/components/UiField/UiFieldLegend.vue +4 -4
- package/src/components/UiField/UiFieldSeparator.vue +4 -4
- package/src/components/UiField/UiFieldSet.vue +4 -4
- package/src/components/UiField/UiFieldTitle.vue +4 -4
- package/src/components/UiField/__tests__/UiFieldError.test.ts +5 -1
- package/src/components/UiField/keys.ts +3 -3
- package/src/components/UiFileItem/UiFileItem.stories.ts +20 -8
- package/src/components/UiFileItem/UiFileItem.vue +51 -47
- package/src/components/UiFileItem/__tests__/UiFileItem.test.ts +4 -1
- package/src/components/UiFileUploadBox/UiFileUploadBox.stories.ts +8 -3
- package/src/components/UiFileUploadBox/UiFileUploadBox.vue +140 -126
- package/src/components/UiFileUploadBox/__tests__/file-validation.test.ts +6 -1
- package/src/components/UiFileUploadBox/file-validation.ts +17 -4
- package/src/components/UiFileUploadBox/index.ts +6 -1
- package/src/components/UiIcon/UiIcon.stories.ts +94 -20
- package/src/components/UiIcon/UiIcon.vue +59 -59
- package/src/components/UiInput/UiInput.stories.ts +6 -2
- package/src/components/UiInput/UiInput.vue +40 -38
- package/src/components/UiInput/__tests__/UiInput.test.ts +3 -1
- package/src/components/UiItem/UiItem.stories.ts +4 -0
- package/src/components/UiItem/UiItem.vue +11 -11
- package/src/components/UiItem/UiItemMedia.vue +8 -8
- package/src/components/UiItem/__tests__/UiItem.test.ts +15 -5
- package/src/components/UiItem/constants.ts +4 -1
- package/src/components/UiKbd/UiKbd.stories.ts +20 -11
- package/src/components/UiKbd/UiKbd.vue +46 -46
- package/src/components/UiKbd/UiKbdGroup.vue +4 -4
- package/src/components/UiLabel/UiLabel.stories.ts +2 -2
- package/src/components/UiLabel/UiLabel.vue +6 -6
- package/src/components/UiListbox/UiListbox.stories.ts +19 -14
- package/src/components/UiListbox/UiListbox.vue +28 -12
- package/src/components/UiListbox/UiListboxContent.vue +4 -4
- package/src/components/UiListbox/UiListboxFilter.vue +7 -7
- package/src/components/UiListbox/UiListboxGroup.vue +4 -4
- package/src/components/UiListbox/UiListboxGroupLabel.vue +4 -4
- package/src/components/UiListbox/UiListboxItem.vue +10 -10
- package/src/components/UiListbox/UiListboxItemIndicator.vue +4 -4
- package/src/components/UiListbox/__tests__/UiListbox.test.ts +6 -2
- package/src/components/UiNavigationMenu/UiNavigationMenu.stories.ts +34 -16
- package/src/components/UiNavigationMenu/UiNavigationMenu.vue +17 -17
- package/src/components/UiNavigationMenu/UiNavigationMenuContent.vue +10 -7
- package/src/components/UiNavigationMenu/UiNavigationMenuIndicator.vue +9 -7
- package/src/components/UiNavigationMenu/UiNavigationMenuItem.vue +6 -6
- package/src/components/UiNavigationMenu/UiNavigationMenuLink.vue +13 -10
- package/src/components/UiNavigationMenu/UiNavigationMenuList.vue +6 -6
- package/src/components/UiNavigationMenu/UiNavigationMenuTrigger.vue +10 -7
- package/src/components/UiPopover/UiPopover.stories.ts +10 -6
- package/src/components/UiPopover/UiPopover.vue +7 -7
- package/src/components/UiPopover/UiPopoverContent.vue +11 -11
- package/src/components/UiPopover/UiPopoverTrigger.vue +10 -7
- package/src/components/UiProgress/UiProgress.stories.ts +8 -2
- package/src/components/UiProgress/UiProgress.vue +15 -15
- package/src/components/UiRadioGroup/UiRadioGroup.stories.ts +26 -22
- package/src/components/UiRadioGroup/UiRadioGroup.vue +23 -21
- package/src/components/UiRadioGroup/UiRadioGroupItem.vue +10 -10
- package/src/components/UiRadioGroup/__tests__/UiRadioGroup.test.ts +11 -3
- package/src/components/UiRangeCalendar/UiRangeCalendar.stories.ts +21 -25
- package/src/components/UiRangeCalendar/UiRangeCalendar.vue +36 -19
- package/src/components/UiSelect/UiSelect.stories.ts +53 -7
- package/src/components/UiSelect/UiSelect.vue +136 -130
- package/src/components/UiSelect/UiSelectContent.vue +16 -16
- package/src/components/UiSelect/UiSelectGroup.vue +4 -4
- package/src/components/UiSelect/UiSelectItem.vue +60 -60
- package/src/components/UiSelect/UiSelectLabel.vue +4 -4
- package/src/components/UiSelect/UiSelectSeparator.vue +4 -4
- package/src/components/UiSelect/UiSelectTrigger.vue +50 -48
- package/src/components/UiSelect/UiSelectValue.vue +34 -24
- package/src/components/UiSelect/__tests__/UiSelect.test.ts +142 -23
- package/src/components/UiSelect/__tests__/UiSelectContent.test.ts +14 -2
- package/src/components/UiSelect/__tests__/UiSelectItem.test.ts +32 -5
- package/src/components/UiSelect/__tests__/UiSelectSeparator.test.ts +6 -2
- package/src/components/UiSelect/__tests__/UiSelectTrigger.test.ts +11 -2
- package/src/components/UiSelect/__tests__/UiSelectValue.test.ts +6 -1
- package/src/components/UiSelect/context.ts +2 -1
- package/src/components/UiSeparator/UiSeparator.stories.ts +14 -9
- package/src/components/UiSeparator/UiSeparator.vue +13 -10
- package/src/components/UiSheet/UiSheet.stories.ts +16 -14
- package/src/components/UiSkeleton/UiSkeleton.stories.ts +24 -20
- package/src/components/UiSkeleton/UiSkeleton.vue +14 -14
- package/src/components/UiSlider/UiSlider.stories.ts +11 -8
- package/src/components/UiSlider/UiSlider.vue +18 -18
- package/src/components/UiSnackbar/UiSnackbar.stories.ts +508 -0
- package/src/components/UiSnackbar/UiSnackbar.vue +286 -0
- package/src/components/UiSnackbar/__tests__/UiSnackbar.test.ts +17 -0
- package/src/components/UiSnackbar/index.ts +4 -0
- package/src/components/UiSnackbar/types.ts +97 -0
- package/src/components/UiSpinner/UiSpinner.stories.ts +6 -1
- package/src/components/UiSpinner/UiSpinner.vue +8 -8
- package/src/components/UiSpinner/__tests__/UiSpinner.test.ts +4 -1
- package/src/components/UiStepper/UiStepper.stories.ts +32 -5
- package/src/components/UiStepper/UiStepper.vue +7 -7
- package/src/components/UiStepper/UiStepperDescription.vue +4 -4
- package/src/components/UiStepper/UiStepperIndicator.vue +4 -4
- package/src/components/UiStepper/UiStepperItem.vue +6 -6
- package/src/components/UiStepper/UiStepperSeparator.vue +4 -4
- package/src/components/UiStepper/UiStepperTitle.vue +4 -4
- package/src/components/UiStepper/UiStepperTrigger.vue +8 -8
- package/src/components/UiStepper/__tests__/UiStepper.test.ts +4 -1
- package/src/components/UiSwitch/UiSwitch.stories.ts +8 -4
- package/src/components/UiSwitch/UiSwitch.vue +12 -12
- package/src/components/UiSwitch/__tests__/UiSwitch.test.ts +9 -2
- package/src/components/UiTable/UiTable.stories.ts +8 -1
- package/src/components/UiTable/UiTable.vue +4 -4
- package/src/components/UiTable/UiTableBody.vue +4 -4
- package/src/components/UiTable/UiTableCaption.vue +4 -4
- package/src/components/UiTable/UiTableCell.vue +6 -6
- package/src/components/UiTable/UiTableEmpty.vue +8 -8
- package/src/components/UiTable/UiTableFooter.vue +4 -4
- package/src/components/UiTable/UiTableHead.vue +13 -9
- package/src/components/UiTable/UiTableHeader.vue +4 -4
- package/src/components/UiTable/UiTableRow.vue +8 -8
- package/src/components/UiTable/__tests__/UiTableRow.test.ts +10 -0
- package/src/components/UiTabs/UiTabs.stories.ts +6 -2
- package/src/components/UiTabs/UiTabs.vue +12 -12
- package/src/components/UiTabs/UiTabsContent.vue +6 -6
- package/src/components/UiTabs/UiTabsList.vue +6 -6
- package/src/components/UiTabs/UiTabsTrigger.vue +6 -6
- package/src/components/UiTabs/__tests__/UiTabs.test.ts +33 -2
- package/src/components/UiTagsInput/UiTagsInput.stories.ts +22 -3
- package/src/components/UiTagsInput/UiTagsInput.vue +9 -9
- package/src/components/UiTagsInput/UiTagsInputInput.vue +6 -6
- package/src/components/UiTagsInput/UiTagsInputItem.vue +6 -6
- package/src/components/UiTagsInput/UiTagsInputItemDelete.vue +4 -4
- package/src/components/UiTagsInput/UiTagsInputItemText.vue +4 -4
- package/src/components/UiTagsInput/__tests__/UiTagsInput.test.ts +6 -2
- package/src/components/UiTagsInput/types.ts +4 -1
- package/src/components/UiTextarea/UiTextarea.stories.ts +4 -0
- package/src/components/UiTextarea/UiTextarea.vue +10 -10
- package/src/components/UiTextarea/__tests__/UiTextarea.test.ts +3 -1
- package/src/components/UiToggle/UiToggle.stories.ts +4 -0
- package/src/components/UiToggle/UiToggle.vue +11 -11
- package/src/components/UiToggle/__tests__/UiToggle.test.ts +9 -0
- package/src/components/UiToggleGroup/UiToggleGroup.stories.ts +9 -2
- package/src/components/UiToggleGroup/UiToggleGroup.vue +31 -31
- package/src/components/UiToggleGroup/UiToggleGroupItem.vue +6 -6
- package/src/components/UiToggleGroup/__tests__/UiToggleGroup.test.ts +23 -2
- package/src/components/UiToggleGroup/types.ts +5 -4
- package/src/components/UiTooltip/UiTooltip.stories.ts +13 -8
- package/src/components/UiTooltip/UiTooltip.vue +19 -19
- package/src/components/core/accordion/Accordion.vue +5 -5
- package/src/components/core/accordion/AccordionContent.vue +9 -7
- package/src/components/core/accordion/AccordionItem.vue +10 -8
- package/src/components/core/accordion/AccordionTrigger.vue +10 -8
- package/src/components/core/alert/Alert.vue +13 -9
- package/src/components/core/alert/AlertDescription.vue +5 -5
- package/src/components/core/alert/AlertTitle.vue +11 -6
- package/src/components/core/alert/index.ts +3 -2
- package/src/components/core/alert-dialog/AlertDialog.vue +10 -6
- package/src/components/core/alert-dialog/AlertDialogAction.vue +5 -5
- package/src/components/core/alert-dialog/AlertDialogCancel.vue +5 -5
- package/src/components/core/alert-dialog/AlertDialogContent.vue +25 -25
- package/src/components/core/alert-dialog/AlertDialogDescription.vue +4 -4
- package/src/components/core/alert-dialog/AlertDialogFooter.vue +1 -1
- package/src/components/core/alert-dialog/AlertDialogHeader.vue +5 -2
- package/src/components/core/alert-dialog/AlertDialogTitle.vue +4 -4
- package/src/components/core/alert-dialog/AlertDialogTrigger.vue +3 -3
- package/src/components/core/avatar/Avatar.vue +12 -7
- package/src/components/core/avatar/AvatarFallback.vue +15 -8
- package/src/components/core/avatar/AvatarImage.vue +8 -4
- package/src/components/core/badge/Badge.vue +31 -31
- package/src/components/core/badge/index.ts +6 -3
- package/src/components/core/button/Button.vue +32 -20
- package/src/components/core/button/index.ts +5 -6
- package/src/components/core/calendar/Calendar.vue +88 -69
- package/src/components/core/calendar/CalendarCell.vue +10 -8
- package/src/components/core/calendar/CalendarCellTrigger.vue +14 -14
- package/src/components/core/calendar/CalendarGrid.vue +11 -9
- package/src/components/core/calendar/CalendarGridBody.vue +3 -3
- package/src/components/core/calendar/CalendarGridHead.vue +6 -4
- package/src/components/core/calendar/CalendarGridRow.vue +10 -8
- package/src/components/core/calendar/CalendarHeadCell.vue +16 -9
- package/src/components/core/calendar/CalendarHeader.vue +16 -9
- package/src/components/core/calendar/CalendarHeading.vue +13 -11
- package/src/components/core/calendar/CalendarNextButton.vue +12 -10
- package/src/components/core/calendar/CalendarPrevButton.vue +12 -10
- package/src/components/core/calendar/index.ts +5 -1
- package/src/components/core/card/Card.vue +6 -6
- package/src/components/core/card/CardAction.vue +11 -6
- package/src/components/core/card/CardContent.vue +5 -5
- package/src/components/core/card/CardDescription.vue +9 -6
- package/src/components/core/card/CardFooter.vue +9 -6
- package/src/components/core/card/CardHeader.vue +5 -5
- package/src/components/core/card/CardTitle.vue +9 -6
- package/src/components/core/checkbox/Checkbox.vue +12 -10
- package/src/components/core/dialog/Dialog.vue +5 -5
- package/src/components/core/dialog/DialogClose.vue +3 -3
- package/src/components/core/dialog/DialogContent.vue +24 -24
- package/src/components/core/dialog/DialogDescription.vue +4 -4
- package/src/components/core/dialog/DialogFooter.vue +1 -1
- package/src/components/core/dialog/DialogHeader.vue +1 -1
- package/src/components/core/dialog/DialogOverlay.vue +5 -5
- package/src/components/core/dialog/DialogTitle.vue +4 -4
- package/src/components/core/dialog/DialogTrigger.vue +3 -3
- package/src/components/core/drawer/Drawer.vue +5 -5
- package/src/components/core/drawer/DrawerClose.vue +3 -3
- package/src/components/core/drawer/DrawerContent.vue +26 -21
- package/src/components/core/drawer/DrawerDescription.vue +9 -7
- package/src/components/core/drawer/DrawerFooter.vue +11 -6
- package/src/components/core/drawer/DrawerHeader.vue +5 -5
- package/src/components/core/drawer/DrawerTitle.vue +9 -7
- package/src/components/core/drawer/DrawerTrigger.vue +3 -3
- package/src/components/core/dropdown-menu/DropdownMenu.vue +10 -6
- package/src/components/core/dropdown-menu/DropdownMenuCheckboxItem.vue +29 -21
- package/src/components/core/dropdown-menu/DropdownMenuContent.vue +24 -17
- package/src/components/core/dropdown-menu/DropdownMenuGroup.vue +3 -3
- package/src/components/core/dropdown-menu/DropdownMenuItem.vue +20 -20
- package/src/components/core/dropdown-menu/DropdownMenuLabel.vue +16 -11
- package/src/components/core/dropdown-menu/DropdownMenuRadioGroup.vue +12 -6
- package/src/components/core/dropdown-menu/DropdownMenuRadioItem.vue +38 -17
- package/src/components/core/dropdown-menu/DropdownMenuSeparator.vue +11 -11
- package/src/components/core/dropdown-menu/DropdownMenuShortcut.vue +8 -6
- package/src/components/core/dropdown-menu/DropdownMenuSub.vue +10 -6
- package/src/components/core/dropdown-menu/DropdownMenuSubContent.vue +14 -9
- package/src/components/core/dropdown-menu/DropdownMenuSubTrigger.vue +15 -12
- package/src/components/core/dropdown-menu/DropdownMenuTrigger.vue +8 -5
- package/src/components/core/field/Field.vue +8 -8
- package/src/components/core/field/FieldContent.vue +11 -6
- package/src/components/core/field/FieldDescription.vue +5 -5
- package/src/components/core/field/FieldError.vue +48 -38
- package/src/components/core/field/FieldGroup.vue +5 -5
- package/src/components/core/field/FieldLabel.vue +7 -7
- package/src/components/core/field/FieldLegend.vue +6 -6
- package/src/components/core/field/FieldSeparator.vue +10 -7
- package/src/components/core/field/FieldSet.vue +5 -5
- package/src/components/core/field/FieldTitle.vue +5 -5
- package/src/components/core/icon/Icon.vue +21 -21
- package/src/components/core/input/Input.vue +15 -15
- package/src/components/core/item/Item.vue +27 -22
- package/src/components/core/item/ItemActions.vue +9 -6
- package/src/components/core/item/ItemContent.vue +11 -6
- package/src/components/core/item/ItemDescription.vue +5 -5
- package/src/components/core/item/ItemFooter.vue +8 -6
- package/src/components/core/item/ItemGroup.vue +5 -5
- package/src/components/core/item/ItemHeader.vue +8 -6
- package/src/components/core/item/ItemMedia.vue +8 -8
- package/src/components/core/item/ItemSeparator.vue +12 -6
- package/src/components/core/item/ItemTitle.vue +11 -6
- package/src/components/core/item/index.ts +2 -1
- package/src/components/core/kbd/Kbd.vue +3 -3
- package/src/components/core/kbd/KbdGroup.vue +7 -4
- package/src/components/core/label/Label.vue +7 -7
- package/src/components/core/listbox/Listbox.vue +19 -13
- package/src/components/core/listbox/ListboxContent.vue +19 -12
- package/src/components/core/listbox/ListboxFilter.vue +14 -12
- package/src/components/core/listbox/ListboxGroup.vue +13 -11
- package/src/components/core/listbox/ListboxGroupLabel.vue +16 -12
- package/src/components/core/listbox/ListboxItem.vue +15 -13
- package/src/components/core/listbox/ListboxItemIndicator.vue +13 -11
- package/src/components/core/native-select/NativeSelect.vue +20 -20
- package/src/components/core/native-select/NativeSelectOptGroup.vue +9 -4
- package/src/components/core/native-select/NativeSelectOption.vue +9 -4
- package/src/components/core/navigation-menu/NavigationMenu.vue +17 -17
- package/src/components/core/navigation-menu/NavigationMenuContent.vue +10 -7
- package/src/components/core/navigation-menu/NavigationMenuIndicator.vue +9 -7
- package/src/components/core/navigation-menu/NavigationMenuItem.vue +5 -5
- package/src/components/core/navigation-menu/NavigationMenuLink.vue +7 -7
- package/src/components/core/navigation-menu/NavigationMenuList.vue +12 -7
- package/src/components/core/navigation-menu/NavigationMenuTrigger.vue +8 -8
- package/src/components/core/navigation-menu/NavigationMenuViewport.vue +6 -6
- package/src/components/core/popover/Popover.vue +9 -9
- package/src/components/core/popover/PopoverContent.vue +19 -19
- package/src/components/core/popover/PopoverTrigger.vue +2 -2
- package/src/components/core/progress/Progress.vue +12 -12
- package/src/components/core/radio-group/RadioGroup.vue +11 -9
- package/src/components/core/radio-group/RadioGroupItem.vue +10 -8
- package/src/components/core/range-calendar/RangeCalendar.vue +24 -22
- package/src/components/core/range-calendar/RangeCalendarCell.vue +10 -8
- package/src/components/core/range-calendar/RangeCalendarCellTrigger.vue +16 -14
- package/src/components/core/range-calendar/RangeCalendarGrid.vue +11 -9
- package/src/components/core/range-calendar/RangeCalendarGridBody.vue +3 -3
- package/src/components/core/range-calendar/RangeCalendarGridHead.vue +3 -3
- package/src/components/core/range-calendar/RangeCalendarGridRow.vue +10 -8
- package/src/components/core/range-calendar/RangeCalendarHeadCell.vue +16 -9
- package/src/components/core/range-calendar/RangeCalendarHeader.vue +13 -9
- package/src/components/core/range-calendar/RangeCalendarHeading.vue +13 -11
- package/src/components/core/range-calendar/RangeCalendarNextButton.vue +12 -10
- package/src/components/core/range-calendar/RangeCalendarPrevButton.vue +12 -10
- package/src/components/core/select/Select.vue +5 -5
- package/src/components/core/select/SelectContent.vue +23 -18
- package/src/components/core/select/SelectGroup.vue +3 -3
- package/src/components/core/select/SelectItem.vue +17 -10
- package/src/components/core/select/SelectItemText.vue +3 -3
- package/src/components/core/select/SelectLabel.vue +7 -5
- package/src/components/core/select/SelectScrollDownButton.vue +14 -10
- package/src/components/core/select/SelectScrollUpButton.vue +14 -10
- package/src/components/core/select/SelectSeparator.vue +9 -7
- package/src/components/core/select/SelectTrigger.vue +17 -14
- package/src/components/core/select/SelectValue.vue +3 -3
- package/src/components/core/separator/Separator.vue +11 -8
- package/src/components/core/sheet/Sheet.vue +5 -5
- package/src/components/core/sheet/SheetClose.vue +3 -3
- package/src/components/core/sheet/SheetContent.vue +24 -19
- package/src/components/core/sheet/SheetDescription.vue +5 -5
- package/src/components/core/sheet/SheetFooter.vue +5 -2
- package/src/components/core/sheet/SheetHeader.vue +5 -2
- package/src/components/core/sheet/SheetOverlay.vue +5 -5
- package/src/components/core/sheet/SheetTitle.vue +5 -5
- package/src/components/core/sheet/SheetTrigger.vue +3 -3
- package/src/components/core/sidebar/Sidebar.vue +22 -17
- package/src/components/core/sidebar/SidebarContent.vue +9 -9
- package/src/components/core/sidebar/SidebarFooter.vue +9 -9
- package/src/components/core/sidebar/SidebarGroup.vue +9 -9
- package/src/components/core/sidebar/SidebarGroupAction.vue +4 -4
- package/src/components/core/sidebar/SidebarGroupContent.vue +2 -2
- package/src/components/core/sidebar/SidebarGroupLabel.vue +3 -3
- package/src/components/core/sidebar/SidebarHeader.vue +9 -9
- package/src/components/core/sidebar/SidebarInput.vue +3 -3
- package/src/components/core/sidebar/SidebarInset.vue +2 -2
- package/src/components/core/sidebar/SidebarMenu.vue +13 -10
- package/src/components/core/sidebar/SidebarMenuAction.vue +7 -7
- package/src/components/core/sidebar/SidebarMenuBadge.vue +2 -2
- package/src/components/core/sidebar/SidebarMenuButton.vue +31 -24
- package/src/components/core/sidebar/SidebarMenuButtonChild.vue +19 -17
- package/src/components/core/sidebar/SidebarMenuItem.vue +2 -2
- package/src/components/core/sidebar/SidebarMenuSkeleton.vue +18 -12
- package/src/components/core/sidebar/SidebarMenuSub.vue +2 -2
- package/src/components/core/sidebar/SidebarMenuSubButton.vue +14 -14
- package/src/components/core/sidebar/SidebarMenuSubItem.vue +2 -2
- package/src/components/core/sidebar/SidebarProvider.vue +78 -66
- package/src/components/core/sidebar/SidebarRail.vue +4 -4
- package/src/components/core/sidebar/SidebarSeparator.vue +16 -11
- package/src/components/core/sidebar/SidebarTrigger.vue +9 -9
- package/src/components/core/sidebar/index.ts +7 -4
- package/src/components/core/sidebar/utils.ts +2 -1
- package/src/components/core/skeleton/Skeleton.vue +7 -4
- package/src/components/core/slider/Slider.vue +17 -9
- package/src/components/core/sonner/Sonner.vue +43 -0
- package/src/components/core/sonner/index.ts +1 -0
- package/src/components/core/spinner/Spinner.vue +6 -6
- package/src/components/core/stepper/Stepper.vue +16 -10
- package/src/components/core/stepper/StepperDescription.vue +10 -8
- package/src/components/core/stepper/StepperIndicator.vue +10 -8
- package/src/components/core/stepper/StepperItem.vue +16 -9
- package/src/components/core/stepper/StepperSeparator.vue +10 -8
- package/src/components/core/stepper/StepperTitle.vue +16 -9
- package/src/components/core/stepper/StepperTrigger.vue +16 -9
- package/src/components/core/switch/Switch.vue +13 -11
- package/src/components/core/table/Table.vue +9 -6
- package/src/components/core/table/TableBody.vue +9 -6
- package/src/components/core/table/TableCaption.vue +5 -5
- package/src/components/core/table/TableCell.vue +7 -7
- package/src/components/core/table/TableEmpty.vue +19 -14
- package/src/components/core/table/TableFooter.vue +8 -6
- package/src/components/core/table/TableHead.vue +8 -8
- package/src/components/core/table/TableHeader.vue +5 -5
- package/src/components/core/table/TableRow.vue +7 -7
- package/src/components/core/table/utils.ts +3 -1
- package/src/components/core/tabs/Tabs.vue +11 -9
- package/src/components/core/tabs/TabsContent.vue +9 -7
- package/src/components/core/tabs/TabsList.vue +10 -8
- package/src/components/core/tabs/TabsTrigger.vue +11 -9
- package/src/components/core/tags-input/TagsInput.vue +14 -12
- package/src/components/core/tags-input/TagsInputInput.vue +19 -12
- package/src/components/core/tags-input/TagsInputItem.vue +13 -11
- package/src/components/core/tags-input/TagsInputItemDelete.vue +13 -11
- package/src/components/core/tags-input/TagsInputItemText.vue +13 -11
- package/src/components/core/textarea/Textarea.vue +15 -15
- package/src/components/core/toggle/Toggle.vue +25 -20
- package/src/components/core/toggle/index.ts +1 -1
- package/src/components/core/toggle-group/ToggleGroup.vue +22 -22
- package/src/components/core/toggle-group/ToggleGroupItem.vue +14 -14
- package/src/components/core/toggle-group/index.ts +1 -1
- package/src/components/core/tooltip/Tooltip.vue +5 -5
- package/src/components/core/tooltip/TooltipContent.vue +17 -17
- package/src/components/core/tooltip/TooltipProvider.vue +3 -3
- package/src/components/core/tooltip/TooltipTrigger.vue +3 -3
- package/src/components/index.ts +1 -1
- package/src/directives/vHover.stories.ts +1 -1
- package/src/directives/vHover.ts +11 -4
- package/src/directives/vOverlay.ts +9 -2
- package/src/index.ts +3 -0
- package/src/patterns/UiDataTable/UiDataTable.mock.ts +13 -2
- package/src/patterns/UiDataTable/UiDataTable.stories.ts +89 -44
- package/src/patterns/UiDataTable/UiDataTable.vue +96 -78
- package/src/patterns/UiDataTable/UiDataTableColumnHeader.vue +57 -38
- package/src/patterns/UiDataTable/UiDataTablePagination.vue +46 -35
- package/src/patterns/UiDataTable/UiDataTableToolbar.vue +46 -38
- package/src/patterns/UiDataTable/__tests__/UiDataTable.test.ts +46 -13
- package/src/patterns/UiDataTable/__tests__/UiDataTableColumnHeader.test.ts +39 -13
- package/src/patterns/UiDataTable/__tests__/UiDataTablePagination.test.ts +15 -4
- package/src/patterns/UiDataTable/__tests__/UiDataTableToolbar.test.ts +34 -10
- package/src/patterns/UiDataTable/constants.ts +2 -1
- package/src/patterns/UiDataTable/types.ts +5 -1
- package/src/patterns/UiDatePicker/UiDatePicker.stories.ts +10 -7
- package/src/patterns/UiDatePicker/UiDatePicker.vue +146 -123
- package/src/patterns/UiDatePicker/__tests__/UiDatePicker.test.ts +15 -7
- package/src/patterns/UiFileUpload/UiFileUpload.stories.ts +2 -1
- package/src/patterns/UiFileUpload/UiFileUpload.vue +18 -18
- package/src/patterns/UiFileUpload/__tests__/UiFileUpload.test.ts +16 -5
- package/src/patterns/UiPlaceholder/UiPlaceholder.vue +3 -3
- package/src/patterns/UiSidebar/UiSidebar.stories.ts +27 -239
- package/src/patterns/UiSidebar/UiSidebar.vue +11 -11
- package/src/patterns/UiSidebar/UiSidebarContent.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarFooter.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarGroup.stories.ts +6 -8
- package/src/patterns/UiSidebar/UiSidebarGroup.vue +36 -34
- package/src/patterns/UiSidebar/UiSidebarGroupContent.vue +40 -40
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.stories.ts +25 -15
- package/src/patterns/UiSidebar/UiSidebarGroupLabel.vue +103 -72
- package/src/patterns/UiSidebar/UiSidebarHeader.vue +22 -21
- package/src/patterns/UiSidebar/UiSidebarInset.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarMenu.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarMenuButton.stories.ts +35 -35
- package/src/patterns/UiSidebar/UiSidebarMenuButton.vue +82 -71
- package/src/patterns/UiSidebar/UiSidebarMenuItem.stories.ts +11 -13
- package/src/patterns/UiSidebar/UiSidebarMenuItem.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarMenuSub.vue +27 -25
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.stories.ts +2 -1
- package/src/patterns/UiSidebar/UiSidebarMenuSubItem.vue +46 -43
- package/src/patterns/UiSidebar/UiSidebarPopover.vue +16 -12
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.stories.ts +8 -9
- package/src/patterns/UiSidebar/UiSidebarPopoverMenu.vue +36 -29
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.stories.ts +8 -8
- package/src/patterns/UiSidebar/UiSidebarPopoverMenuItem.vue +56 -46
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.stories.ts +5 -4
- package/src/patterns/UiSidebar/UiSidebarPopoverTrigger.vue +45 -44
- package/src/patterns/UiSidebar/UiSidebarProvider.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarRail.vue +4 -4
- package/src/patterns/UiSidebar/UiSidebarSub.vue +42 -42
- package/src/patterns/UiSidebar/UiSidebarTrigger.vue +28 -23
- package/src/patterns/UiSidebar/__tests__/UiSidebar.test.ts +7 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarContent.test.ts +11 -3
- package/src/patterns/UiSidebar/__tests__/UiSidebarFooter.test.ts +14 -5
- package/src/patterns/UiSidebar/__tests__/UiSidebarGroup.test.ts +4 -1
- package/src/patterns/UiSidebar/__tests__/UiSidebarGroupContent.test.ts +4 -1
- package/src/patterns/UiSidebar/__tests__/UiSidebarHeader.test.ts +10 -4
- package/src/patterns/UiSidebar/__tests__/UiSidebarInset.test.ts +10 -4
- package/src/patterns/UiSidebar/__tests__/UiSidebarMenu.test.ts +7 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarMenuItem.test.ts +4 -1
- package/src/patterns/UiSidebar/__tests__/UiSidebarMenuSub.test.ts +4 -1
- package/src/patterns/UiSidebar/__tests__/UiSidebarMenuSubItem.test.ts +7 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarPopover.test.ts +4 -1
- package/src/patterns/UiSidebar/__tests__/UiSidebarPopoverMenu.test.ts +7 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarPopoverMenuItem.test.ts +10 -4
- package/src/patterns/UiSidebar/__tests__/UiSidebarPopoverTrigger.test.ts +9 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarProvider.test.ts +10 -3
- package/src/patterns/UiSidebar/__tests__/UiSidebarRail.test.ts +4 -1
- package/src/patterns/UiSidebar/__tests__/UiSidebarSub.test.ts +7 -2
- package/src/patterns/UiSidebar/__tests__/UiSidebarTrigger.test.ts +7 -2
- package/src/patterns/UiSidebar/activeIndicator.ts +1 -2
- package/src/patterns/UiSidebar/index.ts +0 -5
- package/src/patterns/UiSidebar/types.ts +1 -108
- package/src/templates/UiTemplatePlaceholder/UiTemplatePlaceholder.vue +3 -3
- package/src/theme/Background.stories.ts +5 -5
- package/src/theme/Border.stories.ts +3 -3
- package/src/theme/Extended.stories.ts +6 -6
- package/src/theme/Flex.stories.ts +10 -10
- package/src/theme/Grid.stories.ts +10 -10
- package/src/theme/HoverLayer.stories.ts +215 -0
- package/src/theme/Overlay.stories.ts +2 -2
- package/src/theme/Shadow.stories.ts +1 -1
- package/src/theme/Theme.stories.ts +4 -4
- package/src/theme/Typography.stories.ts +21 -21
- package/tokens.json +788 -90
- package/dist/system/components/UiIconButton/UiIconButton.vue.d.ts +0 -25
- package/dist/system/components/UiIconButton/index.d.ts +0 -7
- package/dist/system/components/UiIconButton/types.d.ts +0 -67
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistory.vue.d.ts +0 -20
- package/dist/system/patterns/UiSidebar/UiSidebarChatHistoryItem.vue.d.ts +0 -34
- package/docs/public-docs/index.md +0 -5
- package/docs/public-docs/standards-guidelines.md +0 -15
- package/src/components/UiIconButton/UiIconButton.stories.ts +0 -462
- package/src/components/UiIconButton/UiIconButton.vue +0 -72
- package/src/components/UiIconButton/__tests__/UiIconButton.test.ts +0 -95
- package/src/components/UiIconButton/index.ts +0 -13
- package/src/components/UiIconButton/types.ts +0 -83
- package/src/patterns/UiSidebar/UiSidebarChatHistory.stories.ts +0 -92
- package/src/patterns/UiSidebar/UiSidebarChatHistory.vue +0 -35
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.stories.ts +0 -201
- package/src/patterns/UiSidebar/UiSidebarChatHistoryItem.vue +0 -245
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistory.test.ts +0 -29
- package/src/patterns/UiSidebar/__tests__/UiSidebarChatHistoryItem.test.ts +0 -49
- package/src/theme/BackgroundHover.stories.ts +0 -174
- package/src/theme/ContentHover.stories.ts +0 -165
package/config.d.ts
CHANGED
|
@@ -68,7 +68,8 @@ export interface UiLibraryThemeConfig {
|
|
|
68
68
|
/**
|
|
69
69
|
* Combined options for `presetUiLibraryThemeFromTokens`.
|
|
70
70
|
*/
|
|
71
|
-
export type UiLibraryPresetOptions = UiLibraryThemeOptions &
|
|
71
|
+
export type UiLibraryPresetOptions = UiLibraryThemeOptions &
|
|
72
|
+
UiLibraryThemeConfig;
|
|
72
73
|
|
|
73
74
|
/**
|
|
74
75
|
* UnoCSS theme colors record where keys are color names
|
|
@@ -92,7 +93,9 @@ export type UiLibraryTokenColors = Record<string, string>;
|
|
|
92
93
|
* });
|
|
93
94
|
* ```
|
|
94
95
|
*/
|
|
95
|
-
export declare const defineThemeConfig: <T extends UiLibraryThemeConfig>(
|
|
96
|
+
export declare const defineThemeConfig: <T extends UiLibraryThemeConfig>(
|
|
97
|
+
config: T,
|
|
98
|
+
) => T;
|
|
96
99
|
|
|
97
100
|
/**
|
|
98
101
|
* Returns the default theme derived from the library's `tokens.json`.
|
|
@@ -127,25 +130,6 @@ export declare const getUiLibraryTokenVars: () => UiLibraryTheme;
|
|
|
127
130
|
*/
|
|
128
131
|
export declare const getUiLibraryTokenColors: () => UiLibraryTokenColors;
|
|
129
132
|
|
|
130
|
-
/**
|
|
131
|
-
* Returns the full list of hover-mix utility class names — one `bg-`, `text-`,
|
|
132
|
-
* and `border-` class per `background.*` or `content.*` base token crossed
|
|
133
|
-
* with the three hover tiers (e.g. `bg-background-surface-primary-hover-subtle`,
|
|
134
|
-
* `text-content-on-surface-primary-hover-default`). Because these classes are
|
|
135
|
-
* usually composed at runtime (`${baseClass}-hover-${variant}`), they can't be
|
|
136
|
-
* discovered by UnoCSS's content scanner — use this helper to build a
|
|
137
|
-
* safelist.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```ts
|
|
141
|
-
* import { getUiLibraryHoverMixUtilityClasses } from '@aleph-alpha/ui-library/config';
|
|
142
|
-
* export default defineConfig({
|
|
143
|
-
* safelist: [...getUiLibraryHoverMixUtilityClasses()],
|
|
144
|
-
* });
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
export declare const getUiLibraryHoverMixUtilityClasses: () => string[];
|
|
148
|
-
|
|
149
133
|
/**
|
|
150
134
|
* Creates an UnoCSS preset with custom theme variables.
|
|
151
135
|
* Use this when you want full control over the theme.
|
|
@@ -186,7 +170,9 @@ export declare const presetUiLibraryTheme: (
|
|
|
186
170
|
* presetUiLibraryThemeFromTokens(themeConfig)
|
|
187
171
|
* ```
|
|
188
172
|
*/
|
|
189
|
-
export declare const presetUiLibraryThemeFromTokens: (
|
|
173
|
+
export declare const presetUiLibraryThemeFromTokens: (
|
|
174
|
+
options?: UiLibraryPresetOptions,
|
|
175
|
+
) => Preset;
|
|
190
176
|
|
|
191
177
|
/**
|
|
192
178
|
* UnoCSS preset with utility rules required by the UI library's components.
|
|
@@ -268,4 +254,6 @@ export interface UiLibraryConfigOptions extends UiLibraryPresetOptions {
|
|
|
268
254
|
* })
|
|
269
255
|
* ```
|
|
270
256
|
*/
|
|
271
|
-
export declare const defineUiLibraryConfig: (
|
|
257
|
+
export declare const defineUiLibraryConfig: (
|
|
258
|
+
options?: UiLibraryConfigOptions,
|
|
259
|
+
) => UserConfig;
|
package/config.js
CHANGED
|
@@ -3,7 +3,7 @@ import { defineConfig, definePreset } from 'unocss';
|
|
|
3
3
|
import presetWind from '@unocss/preset-wind4';
|
|
4
4
|
import presetAnimations from 'unocss-preset-animations';
|
|
5
5
|
import presetShadcn from 'unocss-preset-shadcn';
|
|
6
|
-
import {
|
|
6
|
+
import { tokenPreset as sparkTokenPreset } from '@aleph-alpha/config-css';
|
|
7
7
|
|
|
8
8
|
let tokensCache;
|
|
9
9
|
|
|
@@ -45,8 +45,10 @@ const getTokens = () => {
|
|
|
45
45
|
|
|
46
46
|
// Color conversion utilities
|
|
47
47
|
const clamp01 = (n) => (Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 0);
|
|
48
|
-
const roundTo = (n, decimals) =>
|
|
49
|
-
|
|
48
|
+
const roundTo = (n, decimals) =>
|
|
49
|
+
Math.round(n * 10 ** decimals) / 10 ** decimals;
|
|
50
|
+
const srgbToLinear = (c) =>
|
|
51
|
+
c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
50
52
|
|
|
51
53
|
const parseHexColorToRgba = (hex) => {
|
|
52
54
|
const s = hex.trim();
|
|
@@ -127,12 +129,15 @@ const hslToRgb = (h, s, l) => {
|
|
|
127
129
|
};
|
|
128
130
|
|
|
129
131
|
const hslComponentsToRgb = (raw) => {
|
|
130
|
-
const m = raw.match(
|
|
132
|
+
const m = raw.match(
|
|
133
|
+
/^(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%\s*$/,
|
|
134
|
+
);
|
|
131
135
|
if (!m) return null;
|
|
132
136
|
const h = Number(m[1]);
|
|
133
137
|
const s = Number(m[2]) / 100;
|
|
134
138
|
const l = Number(m[3]) / 100;
|
|
135
|
-
if (!Number.isFinite(h) || !Number.isFinite(s) || !Number.isFinite(l))
|
|
139
|
+
if (!Number.isFinite(h) || !Number.isFinite(s) || !Number.isFinite(l))
|
|
140
|
+
return null;
|
|
136
141
|
return hslToRgb(h, s, l);
|
|
137
142
|
};
|
|
138
143
|
|
|
@@ -151,7 +156,8 @@ const normalizeShadcnVarValue = (input) => {
|
|
|
151
156
|
}
|
|
152
157
|
|
|
153
158
|
const rawHslRgb = hslComponentsToRgb(v);
|
|
154
|
-
if (rawHslRgb)
|
|
159
|
+
if (rawHslRgb)
|
|
160
|
+
return rgbToOklchComponents(rawHslRgb.r, rawHslRgb.g, rawHslRgb.b);
|
|
155
161
|
|
|
156
162
|
const rgbMatch = v.match(
|
|
157
163
|
/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*(\d+(?:\.\d+)?))?\s*\)$/i,
|
|
@@ -167,7 +173,8 @@ const normalizeShadcnVarValue = (input) => {
|
|
|
167
173
|
}
|
|
168
174
|
|
|
169
175
|
const hexRgba = parseHexColorToRgba(v);
|
|
170
|
-
if (hexRgba)
|
|
176
|
+
if (hexRgba)
|
|
177
|
+
return rgbToOklchComponents(hexRgba.r, hexRgba.g, hexRgba.b, hexRgba.a);
|
|
171
178
|
|
|
172
179
|
return v;
|
|
173
180
|
};
|
|
@@ -184,7 +191,8 @@ const getTokenSetSearchOrder = () => {
|
|
|
184
191
|
? order
|
|
185
192
|
: Object.keys(tokens || {}).filter((k) => !k.startsWith('$'));
|
|
186
193
|
return raw.filter(
|
|
187
|
-
(name) =>
|
|
194
|
+
(name) =>
|
|
195
|
+
!name.startsWith('2-theme/') || name === UI_LIBRARY_REFERENCE_THEME_SET,
|
|
188
196
|
);
|
|
189
197
|
};
|
|
190
198
|
|
|
@@ -212,7 +220,9 @@ const resolveReferences = (value, seen) => {
|
|
|
212
220
|
const marker = `ref:${refPath}`;
|
|
213
221
|
|
|
214
222
|
if (seen.has(marker)) {
|
|
215
|
-
throw new Error(
|
|
223
|
+
throw new Error(
|
|
224
|
+
`Circular token reference: ${[...seen].join(' -> ')} -> ${refPath}`,
|
|
225
|
+
);
|
|
216
226
|
}
|
|
217
227
|
seen.add(marker);
|
|
218
228
|
|
|
@@ -242,7 +252,10 @@ const resolveReferences = (value, seen) => {
|
|
|
242
252
|
const resolveTokenValue = (tokenSetName, path) => {
|
|
243
253
|
const leaf = getTokenLeaf(tokenSetName, path);
|
|
244
254
|
if (!leaf) return null;
|
|
245
|
-
const resolved = resolveReferences(
|
|
255
|
+
const resolved = resolveReferences(
|
|
256
|
+
leaf.value,
|
|
257
|
+
new Set([`${tokenSetName}:${path}`]),
|
|
258
|
+
);
|
|
246
259
|
return typeof resolved === 'string' ? resolved : null;
|
|
247
260
|
};
|
|
248
261
|
|
|
@@ -256,7 +269,12 @@ const collectColorTokenPaths = (obj, prefix = '') => {
|
|
|
256
269
|
const paths = [];
|
|
257
270
|
for (const [key, value] of Object.entries(obj)) {
|
|
258
271
|
const path = prefix ? `${prefix}.${key}` : key;
|
|
259
|
-
if (
|
|
272
|
+
if (
|
|
273
|
+
value &&
|
|
274
|
+
typeof value === 'object' &&
|
|
275
|
+
'value' in value &&
|
|
276
|
+
value.type === 'color'
|
|
277
|
+
) {
|
|
260
278
|
paths.push(path);
|
|
261
279
|
} else if (value && typeof value === 'object' && !('value' in value)) {
|
|
262
280
|
paths.push(...collectColorTokenPaths(value, path));
|
|
@@ -287,40 +305,6 @@ const buildAllTokenVarsFromModeSet = (modeSetName) => {
|
|
|
287
305
|
return vars;
|
|
288
306
|
};
|
|
289
307
|
|
|
290
|
-
/**
|
|
291
|
-
* Resolve every `background.*` and `content.*` color token and composite it
|
|
292
|
-
* with each `overlay.hover.{subtle|default|strong}` token to produce flat hex
|
|
293
|
-
* colors. The formula lives in `./hover-mix.js`; this function only handles
|
|
294
|
-
* token resolution for a given mode set (Light/Dark).
|
|
295
|
-
*/
|
|
296
|
-
const buildHoverMixVarsFromModeSet = (modeSetName) => {
|
|
297
|
-
const tokens = getTokens();
|
|
298
|
-
const modeSet = tokens?.[modeSetName];
|
|
299
|
-
if (!modeSet) return {};
|
|
300
|
-
|
|
301
|
-
const baseColors = {};
|
|
302
|
-
for (const path of collectColorTokenPaths(modeSet)) {
|
|
303
|
-
if (!HOVER_MIX_TOKEN_PREFIXES.some((p) => path.startsWith(p))) continue;
|
|
304
|
-
const value = resolveTokenValue(modeSetName, path);
|
|
305
|
-
if (!value) continue;
|
|
306
|
-
baseColors[path.replace(/\./g, '-')] = value;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
const overlays = {};
|
|
310
|
-
for (const variant of HOVER_VARIANTS) {
|
|
311
|
-
const value = resolveTokenValue(modeSetName, `overlay.hover.${variant}`);
|
|
312
|
-
if (value) overlays[variant] = value;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// Semi-transparent base tokens (e.g. `background.button.secondary-button`
|
|
316
|
-
// uses `alpha.sand.30`) are rendered against the page's primary surface, so
|
|
317
|
-
// we flatten them onto it before applying the overlay blend — otherwise
|
|
318
|
-
// the hover color comes out significantly too dark.
|
|
319
|
-
const parentSurface = resolveTokenValue(modeSetName, 'background.surface.primary');
|
|
320
|
-
|
|
321
|
-
return buildHoverMixVars({ baseColors, overlays, parentSurface });
|
|
322
|
-
};
|
|
323
|
-
|
|
324
308
|
// shadcn CSS variable builders
|
|
325
309
|
const buildShadcnVarsFromModeSet = (modeSetName) => {
|
|
326
310
|
const resolve = (path) => resolveTokenValue(modeSetName, path);
|
|
@@ -331,33 +315,48 @@ const buildShadcnVarsFromModeSet = (modeSetName) => {
|
|
|
331
315
|
|
|
332
316
|
// Primary - main brand/action button color
|
|
333
317
|
const primary = resolve('background.button.primary-button');
|
|
334
|
-
const primaryForeground =
|
|
318
|
+
const primaryForeground =
|
|
319
|
+
resolve('content.on-button.primary-button') ?? foreground;
|
|
335
320
|
|
|
336
321
|
// Secondary - less prominent actions
|
|
337
322
|
const secondary =
|
|
338
|
-
resolve('background.button.secondary-button') ??
|
|
339
|
-
|
|
323
|
+
resolve('background.button.secondary-button') ??
|
|
324
|
+
resolve('background.surface.secondary');
|
|
325
|
+
const secondaryForeground =
|
|
326
|
+
resolve('content.on-button.secondary-button') ?? foreground;
|
|
340
327
|
|
|
341
328
|
// Muted - de-emphasized surfaces
|
|
342
|
-
const muted =
|
|
329
|
+
const muted =
|
|
330
|
+
resolve('background.surface.muted') ??
|
|
331
|
+
resolve('background.surface.secondary');
|
|
343
332
|
const mutedForeground =
|
|
344
|
-
resolve('content.on-surface.muted') ??
|
|
333
|
+
resolve('content.on-surface.muted') ??
|
|
334
|
+
resolve('content.on-surface.tertiary') ??
|
|
335
|
+
foreground;
|
|
345
336
|
|
|
346
337
|
// Accent - highlight/focus elements
|
|
347
|
-
const accent =
|
|
338
|
+
const accent =
|
|
339
|
+
resolve('background.accent.soft') ?? resolve('background.accent.default');
|
|
348
340
|
const accentForeground =
|
|
349
|
-
resolve('content.on-accent.soft') ??
|
|
341
|
+
resolve('content.on-accent.soft') ??
|
|
342
|
+
resolve('content.on-accent.default') ??
|
|
343
|
+
foreground;
|
|
350
344
|
const accentDefault = resolve('background.accent.default');
|
|
351
|
-
const accentDefaultForeground =
|
|
345
|
+
const accentDefaultForeground =
|
|
346
|
+
resolve('content.on-accent.default') ?? foreground;
|
|
352
347
|
|
|
353
348
|
// Destructive - danger/error actions
|
|
354
349
|
const destructive = resolve('background.button.danger-button');
|
|
355
|
-
const destructiveForeground =
|
|
350
|
+
const destructiveForeground =
|
|
351
|
+
resolve('content.on-button.danger-button') ?? foreground;
|
|
356
352
|
|
|
357
353
|
// Border tokens
|
|
358
|
-
const border =
|
|
354
|
+
const border =
|
|
355
|
+
resolve('border.surface.default') ?? resolve('border.input.default');
|
|
359
356
|
const input = resolve('border.input.default') ?? border;
|
|
360
|
-
const ring =
|
|
357
|
+
const ring =
|
|
358
|
+
resolve('border.surface.focus-ring') ??
|
|
359
|
+
resolve('background.accent.default');
|
|
361
360
|
|
|
362
361
|
// Surface tokens
|
|
363
362
|
const modal = resolve('background.surface.modal') ?? background;
|
|
@@ -393,7 +392,8 @@ const buildShadcnVarsFromModeSet = (modeSetName) => {
|
|
|
393
392
|
const inverseForeground = resolve('content.on-surface.inverse') ?? foreground;
|
|
394
393
|
|
|
395
394
|
// Secondary content color (for calendar unselected dates)
|
|
396
|
-
const secondaryContent =
|
|
395
|
+
const secondaryContent =
|
|
396
|
+
resolve('content.on-surface.secondary') ?? foreground;
|
|
397
397
|
|
|
398
398
|
// Sidebar tokens (overrides unocss-preset-shadcn defaults with design-system colors)
|
|
399
399
|
const sidebar = resolve('background.surface.primary') ?? background;
|
|
@@ -487,11 +487,9 @@ export const getUiLibraryThemeFromTokens = () => ({
|
|
|
487
487
|
export const getUiLibraryTokenVars = () => ({
|
|
488
488
|
light: {
|
|
489
489
|
...buildAllTokenVarsFromModeSet('3-mode/Light'),
|
|
490
|
-
...buildHoverMixVarsFromModeSet('3-mode/Light'),
|
|
491
490
|
},
|
|
492
491
|
dark: {
|
|
493
492
|
...buildAllTokenVarsFromModeSet('3-mode/Dark'),
|
|
494
|
-
...buildHoverMixVarsFromModeSet('3-mode/Dark'),
|
|
495
493
|
},
|
|
496
494
|
});
|
|
497
495
|
|
|
@@ -516,7 +514,6 @@ export const getUiLibraryTokenVars = () => ({
|
|
|
516
514
|
export const getUiLibraryTokenColors = () => {
|
|
517
515
|
const lightVars = {
|
|
518
516
|
...buildAllTokenVarsFromModeSet('3-mode/Light'),
|
|
519
|
-
...buildHoverMixVarsFromModeSet('3-mode/Light'),
|
|
520
517
|
};
|
|
521
518
|
const colors = {};
|
|
522
519
|
|
|
@@ -528,36 +525,6 @@ export const getUiLibraryTokenColors = () => {
|
|
|
528
525
|
return colors;
|
|
529
526
|
};
|
|
530
527
|
|
|
531
|
-
/**
|
|
532
|
-
* Generated hover-mix utility class names — one `bg-`, `text-`, and `border-`
|
|
533
|
-
* class per `background.*` or `content.*` base token × `{subtle|default|strong}`
|
|
534
|
-
* hover tier. Classes are composed dynamically by consumers
|
|
535
|
-
* (e.g. `${baseClass}-hover-${variant}`) and therefore can't be discovered by
|
|
536
|
-
* UnoCSS's content scanner, so we expose the full list for use as a safelist.
|
|
537
|
-
*
|
|
538
|
-
* @returns {string[]} Flat array of fully-qualified utility class names.
|
|
539
|
-
*
|
|
540
|
-
* @example
|
|
541
|
-
* ```ts
|
|
542
|
-
* // uno.config.ts
|
|
543
|
-
* import { getUiLibraryHoverMixUtilityClasses } from '@aleph-alpha/ui-library/config';
|
|
544
|
-
* export default defineConfig({
|
|
545
|
-
* safelist: [...getUiLibraryHoverMixUtilityClasses()],
|
|
546
|
-
* // ...
|
|
547
|
-
* });
|
|
548
|
-
* ```
|
|
549
|
-
*/
|
|
550
|
-
export const getUiLibraryHoverMixUtilityClasses = () => {
|
|
551
|
-
const varNames = Object.keys(buildHoverMixVarsFromModeSet('3-mode/Light'));
|
|
552
|
-
const classes = [];
|
|
553
|
-
for (const varName of varNames) {
|
|
554
|
-
classes.push(`bg-${varName}`);
|
|
555
|
-
classes.push(`text-${varName}`);
|
|
556
|
-
classes.push(`border-${varName}`);
|
|
557
|
-
}
|
|
558
|
-
return classes;
|
|
559
|
-
};
|
|
560
|
-
|
|
561
528
|
export const defineThemeConfig = (config) => config;
|
|
562
529
|
|
|
563
530
|
export const presetUiLibraryTheme = (theme, options = {}) => {
|
|
@@ -576,9 +543,13 @@ export const presetUiLibraryTheme = (theme, options = {}) => {
|
|
|
576
543
|
}`.trim();
|
|
577
544
|
|
|
578
545
|
const toCssBlock = (selector, vars) => {
|
|
579
|
-
const entries = Object.entries(vars || {}).filter(
|
|
546
|
+
const entries = Object.entries(vars || {}).filter(
|
|
547
|
+
([k]) => k && typeof k === 'string',
|
|
548
|
+
);
|
|
580
549
|
if (!entries.length) return '';
|
|
581
|
-
const lines = entries
|
|
550
|
+
const lines = entries
|
|
551
|
+
.map(([k, v]) => ` --${k}: ${normalizeShadcnVarValue(v)};`)
|
|
552
|
+
.join('\n');
|
|
582
553
|
return `${selector} {\n${lines}\n}\n`;
|
|
583
554
|
};
|
|
584
555
|
|
|
@@ -674,7 +645,10 @@ export const presetUiLibraryThemeFromTokens = (options = {}) => {
|
|
|
674
645
|
// Typography classes from design tokens (heading-48-bold, body-14-normal, label-12-medium, etc.)
|
|
675
646
|
...typographyShortcuts.map(([name, css]) => [
|
|
676
647
|
new RegExp(`^${name}$`),
|
|
677
|
-
() =>
|
|
648
|
+
() =>
|
|
649
|
+
Object.fromEntries(
|
|
650
|
+
css.split(';').map((p) => p.split(':').map((s) => s.trim())),
|
|
651
|
+
),
|
|
678
652
|
]),
|
|
679
653
|
],
|
|
680
654
|
};
|
|
@@ -699,7 +673,6 @@ const vHoverOverlayCSS = `
|
|
|
699
673
|
border-radius: inherit;
|
|
700
674
|
pointer-events: none;
|
|
701
675
|
opacity: 0;
|
|
702
|
-
mix-blend-mode: overlay;
|
|
703
676
|
transition: opacity 0.2s ease;
|
|
704
677
|
}
|
|
705
678
|
.v-hover-root > :not(.v-hover-overlay) {
|
|
@@ -729,8 +702,53 @@ const vHoverOverlayCSS = `
|
|
|
729
702
|
.v-hover-root:active .v-hover-overlay {
|
|
730
703
|
opacity: 1;
|
|
731
704
|
}
|
|
705
|
+
.hover-layer {
|
|
706
|
+
position: relative;
|
|
707
|
+
isolation: isolate;
|
|
708
|
+
overflow: hidden;
|
|
709
|
+
}
|
|
710
|
+
.hover-layer::after {
|
|
711
|
+
content: "";
|
|
712
|
+
position: absolute;
|
|
713
|
+
inset: 0;
|
|
714
|
+
z-index: 0;
|
|
715
|
+
border-radius: inherit;
|
|
716
|
+
pointer-events: none;
|
|
717
|
+
opacity: 0;
|
|
718
|
+
background-color: var(--hover-layer-background, oklch(var(--overlay-hover-default)));
|
|
719
|
+
transition: opacity 0.2s ease;
|
|
720
|
+
}
|
|
721
|
+
.hover-layer > :not(.v-hover-overlay) {
|
|
722
|
+
position: relative;
|
|
723
|
+
z-index: 1;
|
|
724
|
+
}
|
|
725
|
+
.hover-layer-subtle {
|
|
726
|
+
--hover-layer-background: oklch(var(--overlay-hover-subtle));
|
|
727
|
+
}
|
|
728
|
+
.hover-layer-default {
|
|
729
|
+
--hover-layer-background: oklch(var(--overlay-hover-default));
|
|
730
|
+
}
|
|
731
|
+
.hover-layer-strong {
|
|
732
|
+
--hover-layer-background: oklch(var(--overlay-hover-strong));
|
|
733
|
+
}
|
|
734
|
+
@media (hover: hover) {
|
|
735
|
+
.hover-layer:hover::after {
|
|
736
|
+
opacity: 1;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
.hover-layer:focus::after,
|
|
740
|
+
.hover-layer:focus-visible::after,
|
|
741
|
+
.hover-layer:has(:focus-visible)::after,
|
|
742
|
+
.hover-layer:active::after,
|
|
743
|
+
.hover-layer-active::after,
|
|
744
|
+
.hover-layer[data-highlighted]::after,
|
|
745
|
+
.hover-layer[data-state="open"]::after,
|
|
746
|
+
.hover-layer[data-active="true"]::after {
|
|
747
|
+
opacity: 1;
|
|
748
|
+
}
|
|
732
749
|
@media (prefers-reduced-motion: reduce) {
|
|
733
|
-
.v-hover-overlay
|
|
750
|
+
.v-hover-overlay,
|
|
751
|
+
.hover-layer::after {
|
|
734
752
|
transition: none;
|
|
735
753
|
}
|
|
736
754
|
}
|
|
@@ -774,7 +792,22 @@ export const presetUiLibraryUtils = () =>
|
|
|
774
792
|
[/^w-\(--(.+)\)$/, ([, name]) => ({ width: `var(--${name})` })],
|
|
775
793
|
[/^max-w-\(--(.+)\)$/, ([, name]) => ({ 'max-width': `var(--${name})` })],
|
|
776
794
|
[/^h-\(--(.+)\)$/, ([, name]) => ({ height: `var(--${name})` })],
|
|
777
|
-
[
|
|
795
|
+
[
|
|
796
|
+
/^origin-\(--(.+)\)$/,
|
|
797
|
+
([, name]) => ({ 'transform-origin': `var(--${name})` }),
|
|
798
|
+
],
|
|
799
|
+
[
|
|
800
|
+
/^bg-overlay-hover-(subtle|default|strong)$/,
|
|
801
|
+
([, overlayVariant]) => ({
|
|
802
|
+
'background-color': `oklch(var(--overlay-hover-${overlayVariant}))`,
|
|
803
|
+
}),
|
|
804
|
+
],
|
|
805
|
+
[
|
|
806
|
+
/^bg-background-surface-muted-subtle$/,
|
|
807
|
+
() => ({
|
|
808
|
+
'background-color': 'oklch(var(--background-surface-muted-subtle))',
|
|
809
|
+
}),
|
|
810
|
+
],
|
|
778
811
|
],
|
|
779
812
|
}))();
|
|
780
813
|
|
|
@@ -815,17 +848,26 @@ export const defineUiLibraryConfig = (options = {}) => {
|
|
|
815
848
|
if (rootSelector !== undefined) themeOptions.rootSelector = rootSelector;
|
|
816
849
|
if (extend !== undefined) themeOptions.extend = extend;
|
|
817
850
|
if (theme !== undefined) themeOptions.theme = theme;
|
|
818
|
-
if (includeAllTokens !== undefined)
|
|
851
|
+
if (includeAllTokens !== undefined)
|
|
852
|
+
themeOptions.includeAllTokens = includeAllTokens;
|
|
819
853
|
|
|
820
854
|
return defineConfig({
|
|
821
855
|
...getUiLibraryContentConfig(),
|
|
822
|
-
safelist: ['overlay-link-hover-subtle'
|
|
856
|
+
safelist: ['overlay-link-hover-subtle'],
|
|
823
857
|
presets: [
|
|
824
858
|
presetWind(),
|
|
825
859
|
presetAnimations(),
|
|
826
|
-
presetShadcn({
|
|
860
|
+
presetShadcn({
|
|
861
|
+
color: 'neutral',
|
|
862
|
+
darkSelector: darkSelector ?? 'html.dark',
|
|
863
|
+
}),
|
|
827
864
|
presetUiLibraryThemeFromTokens(themeOptions),
|
|
828
865
|
presetUiLibraryUtils(),
|
|
866
|
+
// Spark Colors / Spacings / Box-shadow tokens. Disjoint namespace from
|
|
867
|
+
// AA-Base; pulled in for components designed against the Spark layer of
|
|
868
|
+
// the Figma file (currently UiSnackbar). Consumers of
|
|
869
|
+
// defineUiLibraryConfig get this transparently.
|
|
870
|
+
sparkTokenPreset,
|
|
829
871
|
...extraPresets,
|
|
830
872
|
],
|
|
831
873
|
rules: [...extraRules],
|
|
@@ -858,7 +900,8 @@ const numericDesignPxToRem = (raw) => {
|
|
|
858
900
|
/** Token Studio may export dimensions as strings; plain numbers are design px → rem. */
|
|
859
901
|
const normalizeFontSizeForCss = (value) => {
|
|
860
902
|
if (value == null) return value;
|
|
861
|
-
if (typeof value === 'number' && Number.isFinite(value))
|
|
903
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
904
|
+
return numericDesignPxToRem(value);
|
|
862
905
|
if (typeof value === 'string') {
|
|
863
906
|
const t = value.trim();
|
|
864
907
|
if (/^(calc|var|--)/i.test(t)) return t;
|
|
@@ -875,8 +918,10 @@ const normalizeFontSizeForCss = (value) => {
|
|
|
875
918
|
const normalizeLineHeightForCss = (value) => {
|
|
876
919
|
if (value == null) return value;
|
|
877
920
|
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
878
|
-
if (value >= 0 && value < 4 && Number.isInteger(value))
|
|
879
|
-
|
|
921
|
+
if (value >= 0 && value < 4 && Number.isInteger(value))
|
|
922
|
+
return String(value);
|
|
923
|
+
if (value > 0 && value <= 3 && !Number.isInteger(value))
|
|
924
|
+
return String(value);
|
|
880
925
|
return numericDesignPxToRem(value) ?? String(value);
|
|
881
926
|
}
|
|
882
927
|
if (typeof value === 'string') {
|
|
@@ -907,7 +952,8 @@ const isTypographyTokenGroup = (group) =>
|
|
|
907
952
|
group &&
|
|
908
953
|
typeof group === 'object' &&
|
|
909
954
|
Object.values(group).some(
|
|
910
|
-
(v) =>
|
|
955
|
+
(v) =>
|
|
956
|
+
v && typeof v === 'object' && v.type === 'typography' && v.value != null,
|
|
911
957
|
);
|
|
912
958
|
|
|
913
959
|
/**
|
|
@@ -928,7 +974,13 @@ const groupKebabForTypographyKey = (tokenKey) => {
|
|
|
928
974
|
};
|
|
929
975
|
|
|
930
976
|
/** One class per scale; `2-theme/AA Base` supplies `font.font-size.Heading …` (Solea excluded from `{…}` search). */
|
|
931
|
-
const HEADING_SCALE_KEYS = [
|
|
977
|
+
const HEADING_SCALE_KEYS = [
|
|
978
|
+
'Heading S',
|
|
979
|
+
'Heading M',
|
|
980
|
+
'Heading L',
|
|
981
|
+
'Heading XL',
|
|
982
|
+
'Heading 2XL',
|
|
983
|
+
];
|
|
932
984
|
|
|
933
985
|
const HEADING_SCALE_LINE_HEIGHT_REF = {
|
|
934
986
|
'Heading S': '{font.line-height.28}',
|
|
@@ -1034,7 +1086,11 @@ export const getUiLibraryTypographyShortcuts = () => {
|
|
|
1034
1086
|
pushResolvedTypographyShortcut(shortcuts, className, resolved);
|
|
1035
1087
|
// Token name is `regular`; many components use `*-normal` — keep both class names.
|
|
1036
1088
|
if (variantKebab === 'regular') {
|
|
1037
|
-
pushResolvedTypographyShortcut(
|
|
1089
|
+
pushResolvedTypographyShortcut(
|
|
1090
|
+
shortcuts,
|
|
1091
|
+
`${groupKebab}-normal`,
|
|
1092
|
+
resolved,
|
|
1093
|
+
);
|
|
1038
1094
|
}
|
|
1039
1095
|
}
|
|
1040
1096
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as UiFileUploadBox } from './UiFileUploadBox.vue';
|
|
2
2
|
export type { UiFileUploadBoxEmits, UiFileUploadBoxErrorPayload, UiFileUploadBoxProps, } from './types';
|
|
3
|
-
export { formatFileSize, fileMatchesAccept, validateFile, validateFiles } from './file-validation';
|
|
3
|
+
export { formatFileSize, fileMatchesAccept, validateFile, validateFiles, } from './file-validation';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UiSnackbarProps } from './types';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<UiSnackbarProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiSnackbarProps> & Readonly<{}>, {
|
|
3
|
+
containerAriaLabel: string;
|
|
4
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ToasterProps } from 'vue-sonner';
|
|
2
|
+
/**
|
|
3
|
+
* Toast notification container (Sonner). Place once near the app root,
|
|
4
|
+
* then call `toast()` (or `toast.success()`, `toast.error()`, etc.) from
|
|
5
|
+
* anywhere to display a non-blocking notification.
|
|
6
|
+
* @category Feedback
|
|
7
|
+
* @useCases success confirmation, error notice, undo action, async progress, background updates
|
|
8
|
+
* @keywords snackbar, toast, sonner, notification, alert, message, banner, undo
|
|
9
|
+
* @related UiAlert, UiAlertDialog
|
|
10
|
+
*/
|
|
11
|
+
export type UiSnackbarProps = {
|
|
12
|
+
/**
|
|
13
|
+
* Where toasts appear on screen.
|
|
14
|
+
* @default 'bottom-right'
|
|
15
|
+
*/
|
|
16
|
+
position?: ToasterProps['position'];
|
|
17
|
+
/**
|
|
18
|
+
* Color theme for toasts.
|
|
19
|
+
* @default 'light'
|
|
20
|
+
*/
|
|
21
|
+
theme?: ToasterProps['theme'];
|
|
22
|
+
/** Mirror the body color scheme so toasts contrast against it. */
|
|
23
|
+
invert?: ToasterProps['invert'];
|
|
24
|
+
/**
|
|
25
|
+
* Apply colored backgrounds for `success`, `error`, `info`, and `warning` toasts.
|
|
26
|
+
*
|
|
27
|
+
* Accessibility: color must not be the only signal of toast type
|
|
28
|
+
* (WCAG 1.4.1 Use of Color). Always pair with a descriptive message
|
|
29
|
+
* and/or icon so the meaning is conveyed to users who cannot perceive
|
|
30
|
+
* the color difference.
|
|
31
|
+
*/
|
|
32
|
+
richColors?: ToasterProps['richColors'];
|
|
33
|
+
/** Show all stacked toasts expanded by default instead of collapsed. */
|
|
34
|
+
expand?: ToasterProps['expand'];
|
|
35
|
+
/**
|
|
36
|
+
* Show a close (X) button on every toast.
|
|
37
|
+
*
|
|
38
|
+
* Accessibility: recommended whenever toasts have non-trivial
|
|
39
|
+
* `duration` values or contain actions, so keyboard and screen
|
|
40
|
+
* reader users can dismiss them on their own terms. The close
|
|
41
|
+
* button has an accessible name of `'Close toast'` by default;
|
|
42
|
+
* customise via `toastOptions.closeButtonAriaLabel`.
|
|
43
|
+
*/
|
|
44
|
+
closeButton?: ToasterProps['closeButton'];
|
|
45
|
+
/** Position of the close button within each toast. */
|
|
46
|
+
closeButtonPosition?: ToasterProps['closeButtonPosition'];
|
|
47
|
+
/**
|
|
48
|
+
* Default duration in milliseconds before a toast auto-dismisses.
|
|
49
|
+
* Pass `Infinity` to keep toasts open until dismissed.
|
|
50
|
+
*
|
|
51
|
+
* Accessibility: very short durations can violate WCAG 2.2.1
|
|
52
|
+
* (Timing Adjustable). For toasts that carry critical information
|
|
53
|
+
* or actions (e.g. an Undo button), prefer longer durations or
|
|
54
|
+
* `Infinity` combined with `closeButton: true` so users with
|
|
55
|
+
* cognitive or motor impairments have time to read and respond.
|
|
56
|
+
*/
|
|
57
|
+
duration?: ToasterProps['duration'];
|
|
58
|
+
/** Pixel gap between stacked toasts. */
|
|
59
|
+
gap?: ToasterProps['gap'];
|
|
60
|
+
/**
|
|
61
|
+
* Maximum number of toasts visible at the same time.
|
|
62
|
+
* @default 3
|
|
63
|
+
*/
|
|
64
|
+
visibleToasts?: ToasterProps['visibleToasts'];
|
|
65
|
+
/** Offset from the viewport edges. Accepts a string, number, or per-side object. */
|
|
66
|
+
offset?: ToasterProps['offset'];
|
|
67
|
+
/** Offset used on mobile viewports. */
|
|
68
|
+
mobileOffset?: ToasterProps['mobileOffset'];
|
|
69
|
+
/** Document writing direction. */
|
|
70
|
+
dir?: ToasterProps['dir'];
|
|
71
|
+
/**
|
|
72
|
+
* Keyboard combination that focuses the toast region.
|
|
73
|
+
* Provides a keyboard escape hatch (WCAG 2.1.1 Keyboard) so users
|
|
74
|
+
* can reach toasts without a pointing device. Document the chosen
|
|
75
|
+
* combination in your app's keyboard-shortcuts help.
|
|
76
|
+
* @default ['altKey', 'KeyT']
|
|
77
|
+
*/
|
|
78
|
+
hotkey?: ToasterProps['hotkey'];
|
|
79
|
+
/** Directions in which a toast can be dismissed by swipe. */
|
|
80
|
+
swipeDirections?: ToasterProps['swipeDirections'];
|
|
81
|
+
/** Custom icons used for each toast type. */
|
|
82
|
+
icons?: ToasterProps['icons'];
|
|
83
|
+
/** Default options applied to every toast. */
|
|
84
|
+
toastOptions?: ToasterProps['toastOptions'];
|
|
85
|
+
/**
|
|
86
|
+
* Accessible label announced to screen readers for the live region wrapping all toasts.
|
|
87
|
+
*
|
|
88
|
+
* The default `'Notifications'` is sufficient for most apps. Override only
|
|
89
|
+
* when you need a localized label or when multiple Toaster instances exist
|
|
90
|
+
* on the same page and need to be distinguishable to assistive technology.
|
|
91
|
+
* @default 'Notifications'
|
|
92
|
+
*/
|
|
93
|
+
containerAriaLabel?: ToasterProps['containerAriaLabel'];
|
|
94
|
+
/** Identifier when rendering more than one Toaster instance. */
|
|
95
|
+
id?: ToasterProps['id'];
|
|
96
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ToasterProps } from 'vue-sonner';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<ToasterProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToasterProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toaster } from './Sonner.vue';
|
|
@@ -21,7 +21,6 @@ export * from './UiField';
|
|
|
21
21
|
export * from './UiFileItem';
|
|
22
22
|
export * from './UiFileUploadBox';
|
|
23
23
|
export * from './UiIcon';
|
|
24
|
-
export * from './UiIconButton';
|
|
25
24
|
export * from './UiInput';
|
|
26
25
|
export * from './UiItem';
|
|
27
26
|
export * from './UiKbd';
|
|
@@ -37,6 +36,7 @@ export * from './UiSeparator';
|
|
|
37
36
|
export * from './UiSheet';
|
|
38
37
|
export * from './UiSkeleton';
|
|
39
38
|
export * from './UiSlider';
|
|
39
|
+
export * from './UiSnackbar';
|
|
40
40
|
export * from './UiSpinner';
|
|
41
41
|
export * from './UiStepper';
|
|
42
42
|
export * from './UiSwitch';
|