@fabio.caffarello/react-design-system 3.8.0 → 3.10.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 +2 -1
- package/dist/granular/index.js +447 -0
- package/dist/granular/index.js.map +1 -0
- package/dist/granular/ui/components/Accordion/Accordion.js +105 -0
- package/dist/granular/ui/components/Accordion/Accordion.js.map +1 -0
- package/dist/granular/ui/components/Autocomplete/Autocomplete.js +133 -0
- package/dist/granular/ui/components/Autocomplete/Autocomplete.js.map +1 -0
- package/dist/granular/ui/components/Autocomplete/AutocompleteList.js +119 -0
- package/dist/granular/ui/components/Autocomplete/AutocompleteList.js.map +1 -0
- package/dist/granular/ui/components/Autocomplete/AutocompleteOption.js +42 -0
- package/dist/granular/ui/components/Autocomplete/AutocompleteOption.js.map +1 -0
- package/dist/granular/ui/components/Breadcrumb/Breadcrumb.js +100 -0
- package/dist/granular/ui/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/granular/ui/components/Card/Card.js +113 -0
- package/dist/granular/ui/components/Card/Card.js.map +1 -0
- package/dist/granular/ui/components/Card/CardActions.js +51 -0
- package/dist/granular/ui/components/Card/CardActions.js.map +1 -0
- package/dist/granular/ui/components/Card/CardBody.js +32 -0
- package/dist/granular/ui/components/Card/CardBody.js.map +1 -0
- package/dist/granular/ui/components/Card/CardHeader.js +47 -0
- package/dist/granular/ui/components/Card/CardHeader.js.map +1 -0
- package/dist/granular/ui/components/Card/CardSubtitle.js +38 -0
- package/dist/granular/ui/components/Card/CardSubtitle.js.map +1 -0
- package/dist/granular/ui/components/Card/CardTitle.js +61 -0
- package/dist/granular/ui/components/Card/CardTitle.js.map +1 -0
- package/dist/granular/ui/components/ColorPicker/ColorPicker.js +250 -0
- package/dist/granular/ui/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/granular/ui/components/CommandPalette/CommandPalette.js +274 -0
- package/dist/granular/ui/components/CommandPalette/CommandPalette.js.map +1 -0
- package/dist/granular/ui/components/DashboardLayout/DashboardLayout.js +37 -0
- package/dist/granular/ui/components/DashboardLayout/DashboardLayout.js.map +1 -0
- package/dist/granular/ui/components/DataGrid/DataGrid.js +155 -0
- package/dist/granular/ui/components/DataGrid/DataGrid.js.map +1 -0
- package/dist/granular/ui/components/DataTablePattern/DataTablePattern.js +113 -0
- package/dist/granular/ui/components/DataTablePattern/DataTablePattern.js.map +1 -0
- package/dist/granular/ui/components/DatePicker/DatePicker.js +126 -0
- package/dist/granular/ui/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/granular/ui/components/DatePicker/DatePickerCalendar.js +294 -0
- package/dist/granular/ui/components/DatePicker/DatePickerCalendar.js.map +1 -0
- package/dist/granular/ui/components/DatePicker/DatePickerContext.js +16 -0
- package/dist/granular/ui/components/DatePicker/DatePickerContext.js.map +1 -0
- package/dist/granular/ui/components/DatePicker/DatePickerInput.js +119 -0
- package/dist/granular/ui/components/DatePicker/DatePickerInput.js.map +1 -0
- package/dist/granular/ui/components/DatePicker/DatePickerProvider.js +47 -0
- package/dist/granular/ui/components/DatePicker/DatePickerProvider.js.map +1 -0
- package/dist/granular/ui/components/Dialog/AlertDialog.js +48 -0
- package/dist/granular/ui/components/Dialog/AlertDialog.js.map +1 -0
- package/dist/granular/ui/components/Dialog/Dialog.js +36 -0
- package/dist/granular/ui/components/Dialog/Dialog.js.map +1 -0
- package/dist/granular/ui/components/Dialog/DialogClose.js +34 -0
- package/dist/granular/ui/components/Dialog/DialogClose.js.map +1 -0
- package/dist/granular/ui/components/Dialog/DialogContent.js +114 -0
- package/dist/granular/ui/components/Dialog/DialogContent.js.map +1 -0
- package/dist/granular/ui/components/Dialog/DialogDescription.js +51 -0
- package/dist/granular/ui/components/Dialog/DialogDescription.js.map +1 -0
- package/dist/granular/ui/components/Dialog/DialogFooter.js +45 -0
- package/dist/granular/ui/components/Dialog/DialogFooter.js.map +1 -0
- package/dist/granular/ui/components/Dialog/DialogHeader.js +45 -0
- package/dist/granular/ui/components/Dialog/DialogHeader.js.map +1 -0
- package/dist/granular/ui/components/Dialog/DialogTitle.js +53 -0
- package/dist/granular/ui/components/Dialog/DialogTitle.js.map +1 -0
- package/dist/granular/ui/components/Dialog/DialogTrigger.js +28 -0
- package/dist/granular/ui/components/Dialog/DialogTrigger.js.map +1 -0
- package/dist/granular/ui/components/Drawer/Drawer.js +47 -0
- package/dist/granular/ui/components/Drawer/Drawer.js.map +1 -0
- package/dist/granular/ui/components/Drawer/DrawerContent.js +140 -0
- package/dist/granular/ui/components/Drawer/DrawerContent.js.map +1 -0
- package/dist/granular/ui/components/Drawer/DrawerContext.js +21 -0
- package/dist/granular/ui/components/Drawer/DrawerContext.js.map +1 -0
- package/dist/granular/ui/components/Drawer/DrawerFooter.js +53 -0
- package/dist/granular/ui/components/Drawer/DrawerFooter.js.map +1 -0
- package/dist/granular/ui/components/Drawer/DrawerHeader.js +50 -0
- package/dist/granular/ui/components/Drawer/DrawerHeader.js.map +1 -0
- package/dist/granular/ui/components/Dropdown/Dropdown.js +243 -0
- package/dist/granular/ui/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/granular/ui/components/EmptyState/EmptyState.js +102 -0
- package/dist/granular/ui/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/granular/ui/components/FileUpload/FileUpload.js +342 -0
- package/dist/granular/ui/components/FileUpload/FileUpload.js.map +1 -0
- package/dist/granular/ui/components/FilterChips/FilterChips.js +67 -0
- package/dist/granular/ui/components/FilterChips/FilterChips.js.map +1 -0
- package/dist/granular/ui/components/Form/Form.js +184 -0
- package/dist/granular/ui/components/Form/Form.js.map +1 -0
- package/dist/granular/ui/components/Form/FormContext.js +19 -0
- package/dist/granular/ui/components/Form/FormContext.js.map +1 -0
- package/dist/granular/ui/components/Form/FormField.js +66 -0
- package/dist/granular/ui/components/Form/FormField.js.map +1 -0
- package/dist/granular/ui/components/Form/FormProvider.js +17 -0
- package/dist/granular/ui/components/Form/FormProvider.js.map +1 -0
- package/dist/granular/ui/components/Form/useFormFieldArray.js +29 -0
- package/dist/granular/ui/components/Form/useFormFieldArray.js.map +1 -0
- package/dist/granular/ui/components/FormWizardPattern/FormWizardPattern.js +121 -0
- package/dist/granular/ui/components/FormWizardPattern/FormWizardPattern.js.map +1 -0
- package/dist/granular/ui/components/Header/Header.js +98 -0
- package/dist/granular/ui/components/Header/Header.js.map +1 -0
- package/dist/granular/ui/components/Header/components/HeaderActions.js +21 -0
- package/dist/granular/ui/components/Header/components/HeaderActions.js.map +1 -0
- package/dist/granular/ui/components/Header/components/HeaderHamburger.js +31 -0
- package/dist/granular/ui/components/Header/components/HeaderHamburger.js.map +1 -0
- package/dist/granular/ui/components/Header/components/HeaderLogo.js +50 -0
- package/dist/granular/ui/components/Header/components/HeaderLogo.js.map +1 -0
- package/dist/granular/ui/components/Header/components/HeaderMobileMenu.js +38 -0
- package/dist/granular/ui/components/Header/components/HeaderMobileMenu.js.map +1 -0
- package/dist/granular/ui/components/Header/components/HeaderNavigation.js +27 -0
- package/dist/granular/ui/components/Header/components/HeaderNavigation.js.map +1 -0
- package/dist/granular/ui/components/Header/contexts/HeaderContext.js +49 -0
- package/dist/granular/ui/components/Header/contexts/HeaderContext.js.map +1 -0
- package/dist/granular/ui/components/LoginBox/LoginBox.js +84 -0
- package/dist/granular/ui/components/LoginBox/LoginBox.js.map +1 -0
- package/dist/granular/ui/components/Menu/Menu.js +45 -0
- package/dist/granular/ui/components/Menu/Menu.js.map +1 -0
- package/dist/granular/ui/components/Menu/MenuContent.js +94 -0
- package/dist/granular/ui/components/Menu/MenuContent.js.map +1 -0
- package/dist/granular/ui/components/Menu/MenuContext.js +21 -0
- package/dist/granular/ui/components/Menu/MenuContext.js.map +1 -0
- package/dist/granular/ui/components/Menu/MenuItem.js +93 -0
- package/dist/granular/ui/components/Menu/MenuItem.js.map +1 -0
- package/dist/granular/ui/components/Menu/MenuSeparator.js +46 -0
- package/dist/granular/ui/components/Menu/MenuSeparator.js.map +1 -0
- package/dist/granular/ui/components/Menu/MenuTrigger.js +71 -0
- package/dist/granular/ui/components/Menu/MenuTrigger.js.map +1 -0
- package/dist/granular/ui/components/Modal/Modal.js +171 -0
- package/dist/granular/ui/components/Modal/Modal.js.map +1 -0
- package/dist/granular/ui/components/MultiSelect/MultiSelect.js +193 -0
- package/dist/granular/ui/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/granular/ui/components/Navigation/Navigation.js +141 -0
- package/dist/granular/ui/components/Navigation/Navigation.js.map +1 -0
- package/dist/granular/ui/components/PageHeader/PageHeader.js +95 -0
- package/dist/granular/ui/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/granular/ui/components/Pagination/Pagination.js +156 -0
- package/dist/granular/ui/components/Pagination/Pagination.js.map +1 -0
- package/dist/granular/ui/components/Popover/Popover.js +171 -0
- package/dist/granular/ui/components/Popover/Popover.js.map +1 -0
- package/dist/granular/ui/components/Rating/Rating.js +110 -0
- package/dist/granular/ui/components/Rating/Rating.js.map +1 -0
- package/dist/granular/ui/components/SearchAndFilterPattern/SearchAndFilterPattern.js +120 -0
- package/dist/granular/ui/components/SearchAndFilterPattern/SearchAndFilterPattern.js.map +1 -0
- package/dist/granular/ui/components/SearchInput/SearchInput.js +103 -0
- package/dist/granular/ui/components/SearchInput/SearchInput.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/SideNavbar.js +143 -0
- package/dist/granular/ui/components/SideNavbar/SideNavbar.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/Navbar.js +173 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/Navbar.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarGroup.js +87 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarGroup.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarItem.js +242 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarItem.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarSeparator.js +66 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarSeparator.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarToggle.js +108 -0
- package/dist/granular/ui/components/SideNavbar/components/Navbar/NavbarToggle.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarBackdrop.js +63 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarBackdrop.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarResizeHandle.js +113 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarResizeHandle.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarRoot.js +150 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarRoot.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarToggle.js +197 -0
- package/dist/granular/ui/components/SideNavbar/components/SideNavbarToggle.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/Sidebar.js +108 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/Sidebar.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarContent.js +71 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarContent.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarFooter.js +64 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarFooter.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarGroup.js +141 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarGroup.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarHeader.js +90 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarHeader.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarSlot.js +12 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarSlot.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarSlotContent.js +13 -0
- package/dist/granular/ui/components/SideNavbar/components/Sidebar/SidebarSlotContent.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/contexts/NavbarContext.js +20 -0
- package/dist/granular/ui/components/SideNavbar/contexts/NavbarContext.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarConfigContext.js +37 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarConfigContext.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarStateContext.js +20 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarStateContext.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarThemeContext.js +28 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarThemeContext.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarToggleContext.js +19 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SideNavbarToggleContext.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SidebarContext.js +20 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SidebarContext.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SidebarSlotContext.js +22 -0
- package/dist/granular/ui/components/SideNavbar/contexts/SidebarSlotContext.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useFocusManagement.js +43 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useFocusManagement.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useGroupState.js +59 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useGroupState.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useKeyboardShortcut.js +34 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useKeyboardShortcut.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useResize.js +58 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useResize.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useResponsiveSidebar.js +35 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useResponsiveSidebar.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useSideNavbar.js +21 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useSideNavbar.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useSideNavbarContent.js +19 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useSideNavbarContent.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useSideNavbarNavigation.js +21 -0
- package/dist/granular/ui/components/SideNavbar/hooks/useSideNavbarNavigation.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarConfigProvider.js +61 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarConfigProvider.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarProvider.js +82 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarProvider.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarStateProvider.js +165 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarStateProvider.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarThemeProvider.js +34 -0
- package/dist/granular/ui/components/SideNavbar/providers/SideNavbarThemeProvider.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/providers/SidebarSlotProvider.js +28 -0
- package/dist/granular/ui/components/SideNavbar/providers/SidebarSlotProvider.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/utils/parseKeyboardShortcut.js +60 -0
- package/dist/granular/ui/components/SideNavbar/utils/parseKeyboardShortcut.js.map +1 -0
- package/dist/granular/ui/components/SideNavbar/utils/parseWidth.js +19 -0
- package/dist/granular/ui/components/SideNavbar/utils/parseWidth.js.map +1 -0
- package/dist/granular/ui/components/Stat/Stat.js +84 -0
- package/dist/granular/ui/components/Stat/Stat.js.map +1 -0
- package/dist/granular/ui/components/Stat/StatGroup.js +61 -0
- package/dist/granular/ui/components/Stat/StatGroup.js.map +1 -0
- package/dist/granular/ui/components/Stepper/Stepper.js +248 -0
- package/dist/granular/ui/components/Stepper/Stepper.js.map +1 -0
- package/dist/granular/ui/components/Table/Table.js +162 -0
- package/dist/granular/ui/components/Table/Table.js.map +1 -0
- package/dist/granular/ui/components/Table/TableActions/TableActions.js +67 -0
- package/dist/granular/ui/components/Table/TableActions/TableActions.js.map +1 -0
- package/dist/granular/ui/components/Table/TableActions.js +44 -0
- package/dist/granular/ui/components/Table/TableActions.js.map +1 -0
- package/dist/granular/ui/components/Table/TableBody.js +134 -0
- package/dist/granular/ui/components/Table/TableBody.js.map +1 -0
- package/dist/granular/ui/components/Table/TableCell.js +40 -0
- package/dist/granular/ui/components/Table/TableCell.js.map +1 -0
- package/dist/granular/ui/components/Table/TableContext.js +19 -0
- package/dist/granular/ui/components/Table/TableContext.js.map +1 -0
- package/dist/granular/ui/components/Table/TableEmptyState.js +62 -0
- package/dist/granular/ui/components/Table/TableEmptyState.js.map +1 -0
- package/dist/granular/ui/components/Table/TableFilters/TableFilters.js +189 -0
- package/dist/granular/ui/components/Table/TableFilters/TableFilters.js.map +1 -0
- package/dist/granular/ui/components/Table/TableFilters.js +48 -0
- package/dist/granular/ui/components/Table/TableFilters.js.map +1 -0
- package/dist/granular/ui/components/Table/TableHeader.js +45 -0
- package/dist/granular/ui/components/Table/TableHeader.js.map +1 -0
- package/dist/granular/ui/components/Table/TableHeaderCell.js +117 -0
- package/dist/granular/ui/components/Table/TableHeaderCell.js.map +1 -0
- package/dist/granular/ui/components/Table/TableHeaderRow.js +89 -0
- package/dist/granular/ui/components/Table/TableHeaderRow.js.map +1 -0
- package/dist/granular/ui/components/Table/TablePagination/TablePagination.js +216 -0
- package/dist/granular/ui/components/Table/TablePagination/TablePagination.js.map +1 -0
- package/dist/granular/ui/components/Table/TablePagination.js +56 -0
- package/dist/granular/ui/components/Table/TablePagination.js.map +1 -0
- package/dist/granular/ui/components/Table/TableProvider.js +244 -0
- package/dist/granular/ui/components/Table/TableProvider.js.map +1 -0
- package/dist/granular/ui/components/Table/TableRow.js +95 -0
- package/dist/granular/ui/components/Table/TableRow.js.map +1 -0
- package/dist/granular/ui/components/Table/useColumnResizing.js +71 -0
- package/dist/granular/ui/components/Table/useColumnResizing.js.map +1 -0
- package/dist/granular/ui/components/Table/useVirtualScrolling.js +50 -0
- package/dist/granular/ui/components/Table/useVirtualScrolling.js.map +1 -0
- package/dist/granular/ui/components/Tabs/Tabs.js +39 -0
- package/dist/granular/ui/components/Tabs/Tabs.js.map +1 -0
- package/dist/granular/ui/components/Tabs/TabsContent.js +59 -0
- package/dist/granular/ui/components/Tabs/TabsContent.js.map +1 -0
- package/dist/granular/ui/components/Tabs/TabsContext.js +18 -0
- package/dist/granular/ui/components/Tabs/TabsContext.js.map +1 -0
- package/dist/granular/ui/components/Tabs/TabsList.js +84 -0
- package/dist/granular/ui/components/Tabs/TabsList.js.map +1 -0
- package/dist/granular/ui/components/Tabs/TabsProvider.js +31 -0
- package/dist/granular/ui/components/Tabs/TabsProvider.js.map +1 -0
- package/dist/granular/ui/components/Tabs/TabsTrigger.js +103 -0
- package/dist/granular/ui/components/Tabs/TabsTrigger.js.map +1 -0
- package/dist/granular/ui/components/TimePicker/TimePicker.js +216 -0
- package/dist/granular/ui/components/TimePicker/TimePicker.js.map +1 -0
- package/dist/granular/ui/components/Timeline/Timeline.js +152 -0
- package/dist/granular/ui/components/Timeline/Timeline.js.map +1 -0
- package/dist/granular/ui/components/Toast/Toast.js +159 -0
- package/dist/granular/ui/components/Toast/Toast.js.map +1 -0
- package/dist/granular/ui/components/Toast/ToastContainer.js +41 -0
- package/dist/granular/ui/components/Toast/ToastContainer.js.map +1 -0
- package/dist/granular/ui/components/Toast/useToast.js +64 -0
- package/dist/granular/ui/components/Toast/useToast.js.map +1 -0
- package/dist/granular/ui/hooks/createGenericContext.js +27 -0
- package/dist/granular/ui/hooks/createGenericContext.js.map +1 -0
- package/dist/granular/ui/hooks/focusable.js +14 -0
- package/dist/granular/ui/hooks/focusable.js.map +1 -0
- package/dist/granular/ui/hooks/useAutoFocus.js +23 -0
- package/dist/granular/ui/hooks/useAutoFocus.js.map +1 -0
- package/dist/granular/ui/hooks/useCollapsible.js +37 -0
- package/dist/granular/ui/hooks/useCollapsible.js.map +1 -0
- package/dist/granular/ui/hooks/useFocusRestore.js +20 -0
- package/dist/granular/ui/hooks/useFocusRestore.js.map +1 -0
- package/dist/granular/ui/hooks/useFocusTrap.js +31 -0
- package/dist/granular/ui/hooks/useFocusTrap.js.map +1 -0
- package/dist/granular/ui/hooks/useScrollSpy.js +23 -0
- package/dist/granular/ui/hooks/useScrollSpy.js.map +1 -0
- package/dist/granular/ui/layouts/Container/Container.js +73 -0
- package/dist/granular/ui/layouts/Container/Container.js.map +1 -0
- package/dist/granular/ui/layouts/Stack/Stack.js +79 -0
- package/dist/granular/ui/layouts/Stack/Stack.js.map +1 -0
- package/dist/granular/ui/primitives/Avatar/Avatar.js +122 -0
- package/dist/granular/ui/primitives/Avatar/Avatar.js.map +1 -0
- package/dist/granular/ui/primitives/Avatar/AvatarGroup.js +97 -0
- package/dist/granular/ui/primitives/Avatar/AvatarGroup.js.map +1 -0
- package/dist/granular/ui/primitives/Badge/Badge.js +212 -0
- package/dist/granular/ui/primitives/Badge/Badge.js.map +1 -0
- package/dist/granular/ui/primitives/Button/Button.js +288 -0
- package/dist/granular/ui/primitives/Button/Button.js.map +1 -0
- package/dist/granular/ui/primitives/Checkbox/Checkbox.js +129 -0
- package/dist/granular/ui/primitives/Checkbox/Checkbox.js.map +1 -0
- package/dist/granular/ui/primitives/Chip/Chip.js +206 -0
- package/dist/granular/ui/primitives/Chip/Chip.js.map +1 -0
- package/dist/granular/ui/primitives/Collapsible/Collapsible.js +115 -0
- package/dist/granular/ui/primitives/Collapsible/Collapsible.js.map +1 -0
- package/dist/granular/ui/primitives/ErrorMessage/ErrorMessage.js +54 -0
- package/dist/granular/ui/primitives/ErrorMessage/ErrorMessage.js.map +1 -0
- package/dist/granular/ui/primitives/Info/Info.js +57 -0
- package/dist/granular/ui/primitives/Info/Info.js.map +1 -0
- package/dist/granular/ui/primitives/Input/Input.js +351 -0
- package/dist/granular/ui/primitives/Input/Input.js.map +1 -0
- package/dist/granular/ui/primitives/Label/Label.js +61 -0
- package/dist/granular/ui/primitives/Label/Label.js.map +1 -0
- package/dist/granular/ui/primitives/NavLink/NavLink.js +229 -0
- package/dist/granular/ui/primitives/NavLink/NavLink.js.map +1 -0
- package/dist/granular/ui/primitives/NavLink/hooks/useNavLink.js +15 -0
- package/dist/granular/ui/primitives/NavLink/hooks/useNavLink.js.map +1 -0
- package/dist/granular/ui/primitives/Progress/Progress.js +182 -0
- package/dist/granular/ui/primitives/Progress/Progress.js.map +1 -0
- package/dist/granular/ui/primitives/Radio/Radio.js +118 -0
- package/dist/granular/ui/primitives/Radio/Radio.js.map +1 -0
- package/dist/granular/ui/primitives/Select/Select.js +210 -0
- package/dist/granular/ui/primitives/Select/Select.js.map +1 -0
- package/dist/granular/ui/primitives/Separator/Separator.js +69 -0
- package/dist/granular/ui/primitives/Separator/Separator.js.map +1 -0
- package/dist/granular/ui/primitives/Skeleton/Skeleton.js +87 -0
- package/dist/granular/ui/primitives/Skeleton/Skeleton.js.map +1 -0
- package/dist/granular/ui/primitives/Slider/Slider.js +291 -0
- package/dist/granular/ui/primitives/Slider/Slider.js.map +1 -0
- package/dist/granular/ui/primitives/Spinner/Spinner.js +95 -0
- package/dist/granular/ui/primitives/Spinner/Spinner.js.map +1 -0
- package/dist/granular/ui/primitives/Switch/Switch.js +212 -0
- package/dist/granular/ui/primitives/Switch/Switch.js.map +1 -0
- package/dist/granular/ui/primitives/Text/Text.js +118 -0
- package/dist/granular/ui/primitives/Text/Text.js.map +1 -0
- package/dist/granular/ui/primitives/Textarea/Textarea.js +129 -0
- package/dist/granular/ui/primitives/Textarea/Textarea.js.map +1 -0
- package/dist/granular/ui/primitives/Tooltip/Tooltip.js +227 -0
- package/dist/granular/ui/primitives/Tooltip/Tooltip.js.map +1 -0
- package/dist/granular/ui/providers/AppProvider.js +50 -0
- package/dist/granular/ui/providers/AppProvider.js.map +1 -0
- package/dist/granular/ui/providers/ConfigProvider.js +95 -0
- package/dist/granular/ui/providers/ConfigProvider.js.map +1 -0
- package/dist/granular/ui/providers/DialogContext.js +20 -0
- package/dist/granular/ui/providers/DialogContext.js.map +1 -0
- package/dist/granular/ui/providers/DialogProvider.js +32 -0
- package/dist/granular/ui/providers/DialogProvider.js.map +1 -0
- package/dist/granular/ui/providers/ThemeProvider.js +56 -0
- package/dist/granular/ui/providers/ThemeProvider.js.map +1 -0
- package/dist/granular/ui/providers/ToastContext.js +20 -0
- package/dist/granular/ui/providers/ToastContext.js.map +1 -0
- package/dist/granular/ui/providers/ToastProvider.js +47 -0
- package/dist/granular/ui/providers/ToastProvider.js.map +1 -0
- package/dist/granular/ui/providers/providers-bundle.js +23 -0
- package/dist/granular/ui/providers/providers-bundle.js.map +1 -0
- package/dist/granular/ui/tokens/animations.js +106 -0
- package/dist/granular/ui/tokens/animations.js.map +1 -0
- package/dist/granular/ui/tokens/borders.js +54 -0
- package/dist/granular/ui/tokens/borders.js.map +1 -0
- package/dist/granular/ui/tokens/breakpoints.js +43 -0
- package/dist/granular/ui/tokens/breakpoints.js.map +1 -0
- package/dist/granular/ui/tokens/colors/brand.js +67 -0
- package/dist/granular/ui/tokens/colors/brand.js.map +1 -0
- package/dist/granular/ui/tokens/colors/index.js +25 -0
- package/dist/granular/ui/tokens/colors/index.js.map +1 -0
- package/dist/granular/ui/tokens/colors/primitives.js +320 -0
- package/dist/granular/ui/tokens/colors/primitives.js.map +1 -0
- package/dist/granular/ui/tokens/colors/semantic.js +212 -0
- package/dist/granular/ui/tokens/colors/semantic.js.map +1 -0
- package/dist/granular/ui/tokens/colors/types.js +18 -0
- package/dist/granular/ui/tokens/colors/types.js.map +1 -0
- package/dist/granular/ui/tokens/colors/utils.js +131 -0
- package/dist/granular/ui/tokens/colors/utils.js.map +1 -0
- package/dist/granular/ui/tokens/opacity.js +59 -0
- package/dist/granular/ui/tokens/opacity.js.map +1 -0
- package/dist/granular/ui/tokens/radius.js +76 -0
- package/dist/granular/ui/tokens/radius.js.map +1 -0
- package/dist/granular/ui/tokens/shadows.js +63 -0
- package/dist/granular/ui/tokens/shadows.js.map +1 -0
- package/dist/granular/ui/tokens/sidebar.js +92 -0
- package/dist/granular/ui/tokens/sidebar.js.map +1 -0
- package/dist/granular/ui/tokens/spacing.js +143 -0
- package/dist/granular/ui/tokens/spacing.js.map +1 -0
- package/dist/granular/ui/tokens/switch.js +51 -0
- package/dist/granular/ui/tokens/switch.js.map +1 -0
- package/dist/granular/ui/tokens/typography.js +146 -0
- package/dist/granular/ui/tokens/typography.js.map +1 -0
- package/dist/granular/ui/tokens/z-index.js +79 -0
- package/dist/granular/ui/tokens/z-index.js.map +1 -0
- package/dist/granular/ui/utils/cn.js +10 -0
- package/dist/granular/ui/utils/cn.js.map +1 -0
- package/dist/granular/ui/utils/cva.js +14 -0
- package/dist/granular/ui/utils/cva.js.map +1 -0
- package/dist/granular/ui/utils/mergeRefs.js +11 -0
- package/dist/granular/ui/utils/mergeRefs.js.map +1 -0
- package/dist/granular/vite.svg +1 -0
- package/dist/index.cjs +46 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1172 -1135
- package/dist/index.js.map +1 -1
- package/dist/react-design-system.css +1 -1
- package/dist/server/index.cjs +23 -23
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +882 -1179
- package/dist/server/index.js.map +1 -1
- package/dist/ui/components/FilterChips/FilterChips.d.ts +83 -0
- package/dist/ui/components/FilterChips/index.d.ts +2 -0
- package/dist/ui/components/index.d.ts +2 -0
- package/dist/ui/server.d.ts +2 -0
- package/package.json +9 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e = {
|
|
3
|
+
// Icon sizes
|
|
4
|
+
icon: {
|
|
5
|
+
sm: "h-4 w-4",
|
|
6
|
+
// 16px
|
|
7
|
+
md: "h-5 w-5",
|
|
8
|
+
// 20px (default)
|
|
9
|
+
lg: "h-6 w-6"
|
|
10
|
+
// 24px
|
|
11
|
+
},
|
|
12
|
+
// Text sizes
|
|
13
|
+
text: {
|
|
14
|
+
xs: "text-xs",
|
|
15
|
+
// 12px (group titles)
|
|
16
|
+
sm: "text-sm",
|
|
17
|
+
// 14px (items - default)
|
|
18
|
+
base: "text-base"
|
|
19
|
+
// 16px
|
|
20
|
+
},
|
|
21
|
+
// Spacing
|
|
22
|
+
spacing: {
|
|
23
|
+
itemPaddingX: "px-4",
|
|
24
|
+
// 16px horizontal padding for items
|
|
25
|
+
itemPaddingY: "py-2",
|
|
26
|
+
// 8px vertical padding for items
|
|
27
|
+
nestedIndent: "pl-6",
|
|
28
|
+
// 24px for nested items (level 1)
|
|
29
|
+
nestedIndentLevel2: "pl-10",
|
|
30
|
+
// 40px for nested items (level 2)
|
|
31
|
+
nestedIndentLevel3: "pl-14",
|
|
32
|
+
// 56px for nested items (level 3)
|
|
33
|
+
groupTitlePadding: "px-4 py-2",
|
|
34
|
+
// Padding for group titles
|
|
35
|
+
iconMargin: "mr-3"
|
|
36
|
+
// 12px margin between icon and text
|
|
37
|
+
},
|
|
38
|
+
// Colors (using Tailwind classes)
|
|
39
|
+
colors: {
|
|
40
|
+
active: {
|
|
41
|
+
bg: "bg-surface-brand-muted",
|
|
42
|
+
text: "text-fg-brand-emphasis",
|
|
43
|
+
border: "border-line-brand"
|
|
44
|
+
},
|
|
45
|
+
inactive: {
|
|
46
|
+
text: "text-fg-secondary",
|
|
47
|
+
hover: "hover:bg-surface-hover hover:text-fg-primary"
|
|
48
|
+
},
|
|
49
|
+
groupTitle: "text-fg-tertiary"
|
|
50
|
+
},
|
|
51
|
+
// Chevron (for collapsible groups)
|
|
52
|
+
chevron: {
|
|
53
|
+
size: "h-3 w-3",
|
|
54
|
+
// 12px (reduced from h-4 w-4)
|
|
55
|
+
color: "text-fg-quaternary"
|
|
56
|
+
},
|
|
57
|
+
// Navigation column (for split sidebar)
|
|
58
|
+
navigation: {
|
|
59
|
+
width: {
|
|
60
|
+
default: "56px",
|
|
61
|
+
compact: "48px",
|
|
62
|
+
expanded: "200px"
|
|
63
|
+
},
|
|
64
|
+
background: {
|
|
65
|
+
default: "#fafafa",
|
|
66
|
+
hover: "#f5f5f5"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
// Split sidebar
|
|
70
|
+
split: {
|
|
71
|
+
transition: "transition-all duration-300",
|
|
72
|
+
collapsedWidth: "0px"
|
|
73
|
+
},
|
|
74
|
+
// Content area
|
|
75
|
+
content: {
|
|
76
|
+
scrollbar: {
|
|
77
|
+
width: "thin",
|
|
78
|
+
color: {
|
|
79
|
+
thumb: "#cbd5e1",
|
|
80
|
+
track: "#f1f5f9"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
function n(t) {
|
|
86
|
+
return t <= 0 ? e.spacing.itemPaddingX : t === 1 ? e.spacing.nestedIndent : t === 2 ? e.spacing.nestedIndentLevel2 : t === 3 ? e.spacing.nestedIndentLevel3 : `pl-${4 + t * 4}`;
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
e as SIDEBAR_TOKENS,
|
|
90
|
+
n as getNestedIndentClass
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.js","sources":["../../../../src/ui/tokens/sidebar.ts"],"sourcesContent":["/**\n * Sidebar Design Tokens\n *\n * Centralized tokens for sidebar components to ensure consistency\n * and ease of maintenance. All spacing, sizing, and color values\n * should reference these tokens.\n */\n\nexport const SIDEBAR_TOKENS = {\n // Icon sizes\n icon: {\n sm: \"h-4 w-4\", // 16px\n md: \"h-5 w-5\", // 20px (default)\n lg: \"h-6 w-6\", // 24px\n },\n\n // Text sizes\n text: {\n xs: \"text-xs\", // 12px (group titles)\n sm: \"text-sm\", // 14px (items - default)\n base: \"text-base\", // 16px\n },\n\n // Spacing\n spacing: {\n itemPaddingX: \"px-4\", // 16px horizontal padding for items\n itemPaddingY: \"py-2\", // 8px vertical padding for items\n nestedIndent: \"pl-6\", // 24px for nested items (level 1)\n nestedIndentLevel2: \"pl-10\", // 40px for nested items (level 2)\n nestedIndentLevel3: \"pl-14\", // 56px for nested items (level 3)\n groupTitlePadding: \"px-4 py-2\", // Padding for group titles\n iconMargin: \"mr-3\", // 12px margin between icon and text\n },\n\n // Colors (using Tailwind classes)\n colors: {\n active: {\n bg: \"bg-surface-brand-muted\",\n text: \"text-fg-brand-emphasis\",\n border: \"border-line-brand\",\n },\n inactive: {\n text: \"text-fg-secondary\",\n hover: \"hover:bg-surface-hover hover:text-fg-primary\",\n },\n groupTitle: \"text-fg-tertiary\",\n },\n\n // Chevron (for collapsible groups)\n chevron: {\n size: \"h-3 w-3\", // 12px (reduced from h-4 w-4)\n color: \"text-fg-quaternary\",\n },\n\n // Navigation column (for split sidebar)\n navigation: {\n width: {\n default: \"56px\",\n compact: \"48px\",\n expanded: \"200px\",\n },\n background: {\n default: \"#fafafa\",\n hover: \"#f5f5f5\",\n },\n },\n\n // Split sidebar\n split: {\n transition: \"transition-all duration-300\",\n collapsedWidth: \"0px\",\n },\n\n // Content area\n content: {\n scrollbar: {\n width: \"thin\",\n color: {\n thumb: \"#cbd5e1\",\n track: \"#f1f5f9\",\n },\n },\n },\n} as const;\n\n/**\n * Helper function to get nested indent class based on level\n */\nexport function getNestedIndentClass(level: number): string {\n if (level <= 0) return SIDEBAR_TOKENS.spacing.itemPaddingX;\n if (level === 1) return SIDEBAR_TOKENS.spacing.nestedIndent;\n if (level === 2) return SIDEBAR_TOKENS.spacing.nestedIndentLevel2;\n if (level === 3) return SIDEBAR_TOKENS.spacing.nestedIndentLevel3;\n // For levels > 3, calculate dynamically: pl-{4 + level * 4}\n return `pl-${4 + level * 4}`;\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Ae,QAAQ,eAC1CE,MAAU,IAAUF,EAAe,QAAQ,eAC3CE,MAAU,IAAUF,EAAe,QAAQ,qBAC3CE,MAAU,IAAUF,EAAe,QAAQ,qBAExC,MAAM,IAAIE,IAAQ,CAAC;AAC5B;"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var s = Object.defineProperty;
|
|
3
|
+
var i = (a, t, p) => t in a ? s(a, t, { enumerable: !0, configurable: !0, writable: !0, value: p }) : a[t] = p;
|
|
4
|
+
var c = (a, t, p) => i(a, typeof t != "symbol" ? t + "" : t, p);
|
|
5
|
+
class e {
|
|
6
|
+
// 4px base
|
|
7
|
+
/**
|
|
8
|
+
* Create a spacing token from scale value
|
|
9
|
+
*/
|
|
10
|
+
static create(t) {
|
|
11
|
+
const p = t * this.BASE_UNIT, r = p / 16;
|
|
12
|
+
return {
|
|
13
|
+
value: p,
|
|
14
|
+
rem: `${r}rem`,
|
|
15
|
+
px: `${p}px`,
|
|
16
|
+
tailwind: this.getTailwindClass(t)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get Tailwind class for spacing value
|
|
21
|
+
*/
|
|
22
|
+
static getTailwindClass(t) {
|
|
23
|
+
return {
|
|
24
|
+
0: "0",
|
|
25
|
+
0.5: "0.5",
|
|
26
|
+
// 2px — half-step, used by fine UI (badges, switches, separators)
|
|
27
|
+
1: "1",
|
|
28
|
+
// 4px
|
|
29
|
+
1.5: "1.5",
|
|
30
|
+
// 6px — half-step
|
|
31
|
+
2: "2",
|
|
32
|
+
// 8px
|
|
33
|
+
2.5: "2.5",
|
|
34
|
+
// 10px — half-step
|
|
35
|
+
3: "3",
|
|
36
|
+
// 12px
|
|
37
|
+
3.5: "3.5",
|
|
38
|
+
// 14px — half-step
|
|
39
|
+
4: "4",
|
|
40
|
+
// 16px
|
|
41
|
+
5: "5",
|
|
42
|
+
// 20px
|
|
43
|
+
6: "6",
|
|
44
|
+
// 24px
|
|
45
|
+
8: "8",
|
|
46
|
+
// 32px
|
|
47
|
+
10: "10",
|
|
48
|
+
// 40px
|
|
49
|
+
12: "12",
|
|
50
|
+
// 48px
|
|
51
|
+
16: "16",
|
|
52
|
+
// 64px
|
|
53
|
+
20: "20",
|
|
54
|
+
// 80px
|
|
55
|
+
24: "24",
|
|
56
|
+
// 96px
|
|
57
|
+
32: "32",
|
|
58
|
+
// 128px
|
|
59
|
+
40: "40",
|
|
60
|
+
// 160px
|
|
61
|
+
48: "48",
|
|
62
|
+
// 192px
|
|
63
|
+
64: "64",
|
|
64
|
+
// 256px
|
|
65
|
+
80: "80",
|
|
66
|
+
// 320px
|
|
67
|
+
96: "96"
|
|
68
|
+
// 384px
|
|
69
|
+
}[t] || String(t);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
c(e, "BASE_UNIT", 4);
|
|
73
|
+
const n = {
|
|
74
|
+
// Micro spacing (0-14px)
|
|
75
|
+
none: e.create(0),
|
|
76
|
+
"0.5": e.create(0.5),
|
|
77
|
+
// 2px (half-step)
|
|
78
|
+
xs: e.create(1),
|
|
79
|
+
// 4px
|
|
80
|
+
"1.5": e.create(1.5),
|
|
81
|
+
// 6px (half-step)
|
|
82
|
+
sm: e.create(2),
|
|
83
|
+
// 8px
|
|
84
|
+
"2.5": e.create(2.5),
|
|
85
|
+
// 10px (half-step)
|
|
86
|
+
md: e.create(3),
|
|
87
|
+
// 12px
|
|
88
|
+
"3.5": e.create(3.5),
|
|
89
|
+
// 14px (half-step)
|
|
90
|
+
// Standard spacing (16-32px)
|
|
91
|
+
base: e.create(4),
|
|
92
|
+
// 16px
|
|
93
|
+
lg: e.create(6),
|
|
94
|
+
// 24px
|
|
95
|
+
xl: e.create(8),
|
|
96
|
+
// 32px
|
|
97
|
+
// Large spacing (40-64px)
|
|
98
|
+
"2xl": e.create(10),
|
|
99
|
+
// 40px
|
|
100
|
+
"3xl": e.create(12),
|
|
101
|
+
// 48px
|
|
102
|
+
"4xl": e.create(16),
|
|
103
|
+
// 64px
|
|
104
|
+
// Extra large spacing (80px+)
|
|
105
|
+
"5xl": e.create(20),
|
|
106
|
+
// 80px
|
|
107
|
+
"6xl": e.create(24)
|
|
108
|
+
// 96px
|
|
109
|
+
};
|
|
110
|
+
function m(a) {
|
|
111
|
+
return n[a];
|
|
112
|
+
}
|
|
113
|
+
function g(a, t = "p") {
|
|
114
|
+
const r = n[a].tailwind;
|
|
115
|
+
return `${{
|
|
116
|
+
p: "p",
|
|
117
|
+
m: "m",
|
|
118
|
+
px: "px",
|
|
119
|
+
mx: "mx",
|
|
120
|
+
py: "py",
|
|
121
|
+
my: "my",
|
|
122
|
+
pt: "pt",
|
|
123
|
+
mt: "mt",
|
|
124
|
+
pr: "pr",
|
|
125
|
+
mr: "mr",
|
|
126
|
+
pb: "pb",
|
|
127
|
+
mb: "mb",
|
|
128
|
+
pl: "pl",
|
|
129
|
+
ml: "ml",
|
|
130
|
+
gap: "gap",
|
|
131
|
+
"gap-x": "gap-x",
|
|
132
|
+
"gap-y": "gap-y",
|
|
133
|
+
"space-x": "space-x",
|
|
134
|
+
"space-y": "space-y"
|
|
135
|
+
}[t]}-${r}`;
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
n as SPACING_TOKENS,
|
|
139
|
+
e as SpacingTokenFactory,
|
|
140
|
+
m as getSpacing,
|
|
141
|
+
g as getSpacingClass
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=spacing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spacing.js","sources":["../../../../src/ui/tokens/spacing.ts"],"sourcesContent":["/**\n * Spacing Tokens\n *\n * Centralized spacing scale based on 4px base unit.\n * Uses Factory Pattern for type-safe token creation.\n */\n\nexport type SpacingScale =\n | 0\n | 0.5\n | 1\n | 1.5\n | 2\n | 2.5\n | 3\n | 3.5\n | 4\n | 5\n | 6\n | 8\n | 10\n | 12\n | 16\n | 20\n | 24\n | 32\n | 40\n | 48\n | 64\n | 80\n | 96;\n\nexport interface SpacingToken {\n value: number;\n rem: string;\n px: string;\n tailwind: string;\n}\n\n/**\n * Spacing Token Factory\n * Creates spacing tokens with consistent naming and values\n */\nexport class SpacingTokenFactory {\n private static readonly BASE_UNIT = 4; // 4px base\n\n /**\n * Create a spacing token from scale value\n */\n static create(scale: SpacingScale): SpacingToken {\n const px = scale * this.BASE_UNIT;\n const rem = px / 16; // 16px = 1rem\n\n return {\n value: px,\n rem: `${rem}rem`,\n px: `${px}px`,\n tailwind: this.getTailwindClass(scale),\n };\n }\n\n /**\n * Get Tailwind class for spacing value\n */\n private static getTailwindClass(scale: SpacingScale): string {\n const tailwindMap: Record<SpacingScale, string> = {\n 0: \"0\",\n 0.5: \"0.5\", // 2px — half-step, used by fine UI (badges, switches, separators)\n 1: \"1\", // 4px\n 1.5: \"1.5\", // 6px — half-step\n 2: \"2\", // 8px\n 2.5: \"2.5\", // 10px — half-step\n 3: \"3\", // 12px\n 3.5: \"3.5\", // 14px — half-step\n 4: \"4\", // 16px\n 5: \"5\", // 20px\n 6: \"6\", // 24px\n 8: \"8\", // 32px\n 10: \"10\", // 40px\n 12: \"12\", // 48px\n 16: \"16\", // 64px\n 20: \"20\", // 80px\n 24: \"24\", // 96px\n 32: \"32\", // 128px\n 40: \"40\", // 160px\n 48: \"48\", // 192px\n 64: \"64\", // 256px\n 80: \"80\", // 320px\n 96: \"96\", // 384px\n };\n\n return tailwindMap[scale] || String(scale);\n }\n}\n\n/**\n * Pre-defined spacing tokens\n */\nexport const SPACING_TOKENS = {\n // Micro spacing (0-14px)\n none: SpacingTokenFactory.create(0),\n \"0.5\": SpacingTokenFactory.create(0.5), // 2px (half-step)\n xs: SpacingTokenFactory.create(1), // 4px\n \"1.5\": SpacingTokenFactory.create(1.5), // 6px (half-step)\n sm: SpacingTokenFactory.create(2), // 8px\n \"2.5\": SpacingTokenFactory.create(2.5), // 10px (half-step)\n md: SpacingTokenFactory.create(3), // 12px\n \"3.5\": SpacingTokenFactory.create(3.5), // 14px (half-step)\n\n // Standard spacing (16-32px)\n base: SpacingTokenFactory.create(4), // 16px\n lg: SpacingTokenFactory.create(6), // 24px\n xl: SpacingTokenFactory.create(8), // 32px\n\n // Large spacing (40-64px)\n \"2xl\": SpacingTokenFactory.create(10), // 40px\n \"3xl\": SpacingTokenFactory.create(12), // 48px\n \"4xl\": SpacingTokenFactory.create(16), // 64px\n\n // Extra large spacing (80px+)\n \"5xl\": SpacingTokenFactory.create(20), // 80px\n \"6xl\": SpacingTokenFactory.create(24), // 96px\n} as const;\n\n/**\n * Helper function to get spacing value\n */\nexport function getSpacing(scale: keyof typeof SPACING_TOKENS): SpacingToken {\n return SPACING_TOKENS[scale];\n}\n\n/**\n * Helper function to get spacing as Tailwind class\n */\nexport function getSpacingClass(\n scale: keyof typeof SPACING_TOKENS,\n direction:\n | \"p\"\n | \"m\"\n | \"px\"\n | \"mx\"\n | \"py\"\n | \"my\"\n | \"pt\"\n | \"mt\"\n | \"pr\"\n | \"mr\"\n | \"pb\"\n | \"mb\"\n | \"pl\"\n | \"ml\"\n | \"gap\"\n | \"gap-x\"\n | \"gap-y\"\n | \"space-x\"\n | \"space-y\" = \"p\",\n): string {\n const token = SPACING_TOKENS[scale];\n const value = token.tailwind;\n\n const prefixMap: Record<string, string> = {\n p: \"p\",\n m: \"m\",\n px: \"px\",\n mx: \"mx\",\n py: \"py\",\n my: \"my\",\n pt: \"pt\",\n mt: \"mt\",\n pr: \"pr\",\n mr: \"mr\",\n pb: \"pb\",\n mb: \"mb\",\n pl: \"pl\",\n ml: \"ml\",\n gap: \"gap\",\n \"gap-x\": \"gap-x\",\n \"gap-y\": \"gap-y\",\n \"space-x\": \"space-x\",\n \"space-y\": \"space-y\",\n };\n\n return `${prefixMap[direction]}-${value}`;\n}\n"],"names":["SpacingTokenFactory","scale","px","rem","__publicField","SPACING_TOKENS","getSpacing","getSpacingClass","direction","value"],"mappings":";;;;AA2CO,MAAMA,EAAoB;AAAA;AAAA;AAAA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|
|
9
|
+
*/
|
|
10
|
+
track: {
|
|
11
|
+
sm: { w: "w-9", h: "h-5" },
|
|
12
|
+
md: { w: "w-11", h: "h-6" },
|
|
13
|
+
lg: { w: "w-14", h: "h-7" }
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* Thumb (the circular knob).
|
|
17
|
+
* w * h:
|
|
18
|
+
* sm — 16 × 16 px
|
|
19
|
+
* md — 20 × 20 px
|
|
20
|
+
* lg — 24 × 24 px
|
|
21
|
+
*/
|
|
22
|
+
thumb: {
|
|
23
|
+
sm: { w: "w-4", h: "h-4" },
|
|
24
|
+
md: { w: "w-5", h: "h-5" },
|
|
25
|
+
lg: { w: "w-6", h: "h-6" }
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Translation distance of the thumb when the switch is on. Matches the
|
|
29
|
+
* track width minus the thumb width and border for visual symmetry.
|
|
30
|
+
* sm — 16 px
|
|
31
|
+
* md — 20 px
|
|
32
|
+
* lg — 28 px
|
|
33
|
+
*/
|
|
34
|
+
translate: {
|
|
35
|
+
sm: "translate-x-4",
|
|
36
|
+
md: "translate-x-5",
|
|
37
|
+
lg: "translate-x-7"
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function a(t) {
|
|
41
|
+
return {
|
|
42
|
+
track: `${h.track[t].w} ${h.track[t].h}`,
|
|
43
|
+
thumb: `${h.thumb[t].w} ${h.thumb[t].h}`,
|
|
44
|
+
translate: h.translate[t]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
h as SWITCH_TOKENS,
|
|
49
|
+
a as getSwitchClasses
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","sources":["../../../../src/ui/tokens/switch.ts"],"sourcesContent":["/**\n * Switch Design Tokens\n *\n * Component-scoped tokens for the Switch primitive. These dimensions are\n * anatomical to the control (track / thumb / on-state translation) and do\n * not belong in the global spacing scale — keeping them here prevents the\n * scale from being polluted with one-off values like w-9 / w-11 / w-14 /\n * h-7 that only ever make sense on a switch.\n *\n * Sizes mirror the SwitchSize variants (\"sm\" | \"md\" | \"lg\").\n */\n\nexport type SwitchSizeToken = \"sm\" | \"md\" | \"lg\";\n\nexport const SWITCH_TOKENS = {\n /**\n * Track (the rounded background bar).\n * w * h:\n * sm — 36 × 20 px\n * md — 44 × 24 px\n * lg — 56 × 28 px\n */\n track: {\n sm: { w: \"w-9\", h: \"h-5\" },\n md: { w: \"w-11\", h: \"h-6\" },\n lg: { w: \"w-14\", h: \"h-7\" },\n },\n\n /**\n * Thumb (the circular knob).\n * w * h:\n * sm — 16 × 16 px\n * md — 20 × 20 px\n * lg — 24 × 24 px\n */\n thumb: {\n sm: { w: \"w-4\", h: \"h-4\" },\n md: { w: \"w-5\", h: \"h-5\" },\n lg: { w: \"w-6\", h: \"h-6\" },\n },\n\n /**\n * Translation distance of the thumb when the switch is on. Matches the\n * track width minus the thumb width and border for visual symmetry.\n * sm — 16 px\n * md — 20 px\n * lg — 28 px\n */\n translate: {\n sm: \"translate-x-4\",\n md: \"translate-x-5\",\n lg: \"translate-x-7\",\n },\n} as const;\n\n/**\n * Helper: returns the full set of classes for a given switch size.\n */\nexport function getSwitchClasses(size: SwitchSizeToken): {\n track: string;\n thumb: string;\n translate: string;\n} {\n return {\n track: `${SWITCH_TOKENS.track[size].w} ${SWITCH_TOKENS.track[size].h}`,\n thumb: `${SWITCH_TOKENS.thumb[size].w} ${SWITCH_TOKENS.thumb[size].h}`,\n translate: SWITCH_TOKENS.translate[size],\n };\n}\n"],"names":["SWITCH_TOKENS","getSwitchClasses","size"],"mappings":";AAcO,MAAMA,IAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ3B,OAAO;AAAA,IACL,IAAI,EAAE,GAAG,OAAO,GAAG,MAAA;AAAA,IACnB,IAAI,EAAE,GAAG,QAAQ,GAAG,MAAA;AAAA,IACpB,IAAI,EAAE,GAAG,QAAQ,GAAG,MAAA;AAAA,EAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU5B,OAAO;AAAA,IACL,IAAI,EAAE,GAAG,OAAO,GAAG,MAAA;AAAA,IACnB,IAAI,EAAE,GAAG,OAAO,GAAG,MAAA;AAAA,IACnB,IAAI,EAAE,GAAG,OAAO,GAAG,MAAA;AAAA,EAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU3B,WAAW;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA;AAER;AAKO,SAASC,EAAiBC,GAI/B;AACA,SAAO;AAAA,IACL,OAAO,GAAGF,EAAc,MAAME,CAAI,EAAE,CAAC,IAAIF,EAAc,MAAME,CAAI,EAAE,CAAC;AAAA,IACpE,OAAO,GAAGF,EAAc,MAAME,CAAI,EAAE,CAAC,IAAIF,EAAc,MAAME,CAAI,EAAE,CAAC;AAAA,IACpE,WAAWF,EAAc,UAAUE,CAAI;AAAA,EAAA;AAE3C;"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
class e {
|
|
3
|
+
/**
|
|
4
|
+
* Create font size token
|
|
5
|
+
*/
|
|
6
|
+
static createFontSize(n) {
|
|
7
|
+
const i = {
|
|
8
|
+
"2xs": { px: 10, tailwind: "text-2xs" },
|
|
9
|
+
// micro-text (badge counters, mini chips)
|
|
10
|
+
xs: { px: 12, tailwind: "text-xs" },
|
|
11
|
+
sm: { px: 14, tailwind: "text-sm" },
|
|
12
|
+
base: { px: 16, tailwind: "text-base" },
|
|
13
|
+
lg: { px: 18, tailwind: "text-lg" },
|
|
14
|
+
xl: { px: 20, tailwind: "text-xl" },
|
|
15
|
+
"2xl": { px: 24, tailwind: "text-2xl" },
|
|
16
|
+
"3xl": { px: 30, tailwind: "text-3xl" },
|
|
17
|
+
"4xl": { px: 36, tailwind: "text-4xl" },
|
|
18
|
+
"5xl": { px: 48, tailwind: "text-5xl" },
|
|
19
|
+
"6xl": { px: 60, tailwind: "text-6xl" }
|
|
20
|
+
}[n];
|
|
21
|
+
return {
|
|
22
|
+
value: i.px,
|
|
23
|
+
rem: `${i.px / 16}rem`,
|
|
24
|
+
px: `${i.px}px`,
|
|
25
|
+
tailwind: i.tailwind
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create line height token
|
|
30
|
+
*/
|
|
31
|
+
static createLineHeight(n) {
|
|
32
|
+
const i = {
|
|
33
|
+
none: { value: 1, tailwind: "leading-none" },
|
|
34
|
+
tight: { value: 1.25, tailwind: "leading-tight" },
|
|
35
|
+
snug: { value: 1.375, tailwind: "leading-snug" },
|
|
36
|
+
normal: { value: 1.5, tailwind: "leading-normal" },
|
|
37
|
+
relaxed: { value: 1.625, tailwind: "leading-relaxed" },
|
|
38
|
+
loose: { value: 2, tailwind: "leading-loose" }
|
|
39
|
+
}[n];
|
|
40
|
+
return {
|
|
41
|
+
value: i.value,
|
|
42
|
+
tailwind: i.tailwind
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create font weight token
|
|
47
|
+
*/
|
|
48
|
+
static createFontWeight(n) {
|
|
49
|
+
const i = {
|
|
50
|
+
light: { value: 300, tailwind: "font-light" },
|
|
51
|
+
normal: { value: 400, tailwind: "font-normal" },
|
|
52
|
+
medium: { value: 500, tailwind: "font-medium" },
|
|
53
|
+
semibold: { value: 600, tailwind: "font-semibold" },
|
|
54
|
+
bold: { value: 700, tailwind: "font-bold" }
|
|
55
|
+
}[n];
|
|
56
|
+
return {
|
|
57
|
+
value: i.value,
|
|
58
|
+
tailwind: i.tailwind
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Create complete typography token
|
|
63
|
+
*/
|
|
64
|
+
static create(n, l = "normal", i = "normal") {
|
|
65
|
+
return {
|
|
66
|
+
fontSize: this.createFontSize(n),
|
|
67
|
+
lineHeight: this.createLineHeight(l),
|
|
68
|
+
fontWeight: this.createFontWeight(i)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const o = {
|
|
73
|
+
sans: {
|
|
74
|
+
name: "sans",
|
|
75
|
+
stack: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif',
|
|
76
|
+
tailwind: "font-sans"
|
|
77
|
+
},
|
|
78
|
+
serif: {
|
|
79
|
+
name: "serif",
|
|
80
|
+
stack: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
|
|
81
|
+
tailwind: "font-serif"
|
|
82
|
+
},
|
|
83
|
+
mono: {
|
|
84
|
+
name: "mono",
|
|
85
|
+
stack: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
86
|
+
tailwind: "font-mono"
|
|
87
|
+
}
|
|
88
|
+
}, r = {
|
|
89
|
+
light: e.createFontWeight("light"),
|
|
90
|
+
normal: e.createFontWeight("normal"),
|
|
91
|
+
medium: e.createFontWeight("medium"),
|
|
92
|
+
semibold: e.createFontWeight("semibold"),
|
|
93
|
+
bold: e.createFontWeight("bold")
|
|
94
|
+
}, a = {
|
|
95
|
+
// Headings
|
|
96
|
+
h1: e.create("4xl", "tight", "bold"),
|
|
97
|
+
h2: e.create("3xl", "tight", "bold"),
|
|
98
|
+
h3: e.create("2xl", "snug", "semibold"),
|
|
99
|
+
h4: e.create("xl", "snug", "semibold"),
|
|
100
|
+
h5: e.create("lg", "normal", "medium"),
|
|
101
|
+
h6: e.create("base", "normal", "medium"),
|
|
102
|
+
// Body text
|
|
103
|
+
body: e.create("base", "relaxed", "normal"),
|
|
104
|
+
bodySmall: e.create("sm", "relaxed", "normal"),
|
|
105
|
+
bodyLarge: e.create("lg", "relaxed", "normal"),
|
|
106
|
+
// UI elements
|
|
107
|
+
label: e.create("sm", "normal", "medium"),
|
|
108
|
+
caption: e.create("xs", "normal", "normal"),
|
|
109
|
+
button: e.create("base", "normal", "medium")
|
|
110
|
+
};
|
|
111
|
+
function s(t) {
|
|
112
|
+
return a[t];
|
|
113
|
+
}
|
|
114
|
+
function d(t) {
|
|
115
|
+
const n = a[t];
|
|
116
|
+
return `${n.fontSize.tailwind} ${n.lineHeight.tailwind} ${n.fontWeight.tailwind}`;
|
|
117
|
+
}
|
|
118
|
+
function g(t) {
|
|
119
|
+
return a[t].fontSize.tailwind;
|
|
120
|
+
}
|
|
121
|
+
function m(t) {
|
|
122
|
+
return e.createFontSize(t).tailwind;
|
|
123
|
+
}
|
|
124
|
+
function c(t) {
|
|
125
|
+
return a[t].fontWeight.tailwind;
|
|
126
|
+
}
|
|
127
|
+
function u(t) {
|
|
128
|
+
return e.createFontWeight(t).tailwind;
|
|
129
|
+
}
|
|
130
|
+
function x(t) {
|
|
131
|
+
return a[t].lineHeight.tailwind;
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
o as FONT_FAMILY_TOKENS,
|
|
135
|
+
r as FONT_WEIGHT_TOKENS,
|
|
136
|
+
a as TYPOGRAPHY_TOKENS,
|
|
137
|
+
e as TypographyTokenFactory,
|
|
138
|
+
s as getTypography,
|
|
139
|
+
d as getTypographyClasses,
|
|
140
|
+
x as getTypographyLineHeight,
|
|
141
|
+
g as getTypographySize,
|
|
142
|
+
m as getTypographySizeFromFontSize,
|
|
143
|
+
c as getTypographyWeight,
|
|
144
|
+
u as getTypographyWeightFromFontWeight
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=typography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.js","sources":["../../../../src/ui/tokens/typography.ts"],"sourcesContent":["/**\n * Typography Tokens\n *\n * Centralized typography system with font families, sizes, weights, and line heights.\n * Uses Factory Pattern for type-safe token creation.\n */\n\nexport type FontFamily = \"sans\" | \"serif\" | \"mono\";\nexport type FontWeight = \"light\" | \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type FontSize =\n | \"2xs\"\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"xl\"\n | \"2xl\"\n | \"3xl\"\n | \"4xl\"\n | \"5xl\"\n | \"6xl\";\nexport type LineHeight =\n | \"none\"\n | \"tight\"\n | \"snug\"\n | \"normal\"\n | \"relaxed\"\n | \"loose\";\n\nexport interface TypographyToken {\n fontSize: {\n value: number;\n rem: string;\n px: string;\n tailwind: string;\n };\n lineHeight: {\n value: number;\n tailwind: string;\n };\n fontWeight: {\n value: number;\n tailwind: string;\n };\n}\n\nexport interface FontFamilyToken {\n name: string;\n stack: string;\n tailwind: string;\n}\n\nexport interface FontWeightToken {\n value: number;\n tailwind: string;\n}\n\n/**\n * Typography Token Factory\n * Creates typography tokens with consistent values\n */\nexport class TypographyTokenFactory {\n /**\n * Create font size token\n */\n static createFontSize(size: FontSize): TypographyToken[\"fontSize\"] {\n const sizeMap: Record<FontSize, { px: number; tailwind: string }> = {\n \"2xs\": { px: 10, tailwind: \"text-2xs\" }, // micro-text (badge counters, mini chips)\n xs: { px: 12, tailwind: \"text-xs\" },\n sm: { px: 14, tailwind: \"text-sm\" },\n base: { px: 16, tailwind: \"text-base\" },\n lg: { px: 18, tailwind: \"text-lg\" },\n xl: { px: 20, tailwind: \"text-xl\" },\n \"2xl\": { px: 24, tailwind: \"text-2xl\" },\n \"3xl\": { px: 30, tailwind: \"text-3xl\" },\n \"4xl\": { px: 36, tailwind: \"text-4xl\" },\n \"5xl\": { px: 48, tailwind: \"text-5xl\" },\n \"6xl\": { px: 60, tailwind: \"text-6xl\" },\n };\n\n const config = sizeMap[size];\n return {\n value: config.px,\n rem: `${config.px / 16}rem`,\n px: `${config.px}px`,\n tailwind: config.tailwind,\n };\n }\n\n /**\n * Create line height token\n */\n static createLineHeight(height: LineHeight): TypographyToken[\"lineHeight\"] {\n const heightMap: Record<LineHeight, { value: number; tailwind: string }> = {\n none: { value: 1, tailwind: \"leading-none\" },\n tight: { value: 1.25, tailwind: \"leading-tight\" },\n snug: { value: 1.375, tailwind: \"leading-snug\" },\n normal: { value: 1.5, tailwind: \"leading-normal\" },\n relaxed: { value: 1.625, tailwind: \"leading-relaxed\" },\n loose: { value: 2, tailwind: \"leading-loose\" },\n };\n\n const config = heightMap[height];\n return {\n value: config.value,\n tailwind: config.tailwind,\n };\n }\n\n /**\n * Create font weight token\n */\n static createFontWeight(weight: FontWeight): FontWeightToken {\n const weightMap: Record<FontWeight, { value: number; tailwind: string }> = {\n light: { value: 300, tailwind: \"font-light\" },\n normal: { value: 400, tailwind: \"font-normal\" },\n medium: { value: 500, tailwind: \"font-medium\" },\n semibold: { value: 600, tailwind: \"font-semibold\" },\n bold: { value: 700, tailwind: \"font-bold\" },\n };\n\n const config = weightMap[weight];\n return {\n value: config.value,\n tailwind: config.tailwind,\n };\n }\n\n /**\n * Create complete typography token\n */\n static create(\n size: FontSize,\n lineHeight: LineHeight = \"normal\",\n weight: FontWeight = \"normal\",\n ): TypographyToken {\n return {\n fontSize: this.createFontSize(size),\n lineHeight: this.createLineHeight(lineHeight),\n fontWeight: this.createFontWeight(weight),\n };\n }\n}\n\n/**\n * Font family tokens\n */\nexport const FONT_FAMILY_TOKENS: Record<FontFamily, FontFamilyToken> = {\n sans: {\n name: \"sans\",\n stack:\n 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif',\n tailwind: \"font-sans\",\n },\n serif: {\n name: \"serif\",\n stack: 'ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif',\n tailwind: \"font-serif\",\n },\n mono: {\n name: \"mono\",\n stack:\n 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace',\n tailwind: \"font-mono\",\n },\n} as const;\n\n/**\n * Font weight tokens\n */\nexport const FONT_WEIGHT_TOKENS: Record<FontWeight, FontWeightToken> = {\n light: TypographyTokenFactory.createFontWeight(\"light\"),\n normal: TypographyTokenFactory.createFontWeight(\"normal\"),\n medium: TypographyTokenFactory.createFontWeight(\"medium\"),\n semibold: TypographyTokenFactory.createFontWeight(\"semibold\"),\n bold: TypographyTokenFactory.createFontWeight(\"bold\"),\n} as const;\n\n/**\n * Pre-defined typography tokens for common use cases\n */\nexport const TYPOGRAPHY_TOKENS = {\n // Headings\n h1: TypographyTokenFactory.create(\"4xl\", \"tight\", \"bold\"),\n h2: TypographyTokenFactory.create(\"3xl\", \"tight\", \"bold\"),\n h3: TypographyTokenFactory.create(\"2xl\", \"snug\", \"semibold\"),\n h4: TypographyTokenFactory.create(\"xl\", \"snug\", \"semibold\"),\n h5: TypographyTokenFactory.create(\"lg\", \"normal\", \"medium\"),\n h6: TypographyTokenFactory.create(\"base\", \"normal\", \"medium\"),\n\n // Body text\n body: TypographyTokenFactory.create(\"base\", \"relaxed\", \"normal\"),\n bodySmall: TypographyTokenFactory.create(\"sm\", \"relaxed\", \"normal\"),\n bodyLarge: TypographyTokenFactory.create(\"lg\", \"relaxed\", \"normal\"),\n\n // UI elements\n label: TypographyTokenFactory.create(\"sm\", \"normal\", \"medium\"),\n caption: TypographyTokenFactory.create(\"xs\", \"normal\", \"normal\"),\n button: TypographyTokenFactory.create(\"base\", \"normal\", \"medium\"),\n} as const;\n\n/**\n * Helper function to get typography token\n */\nexport function getTypography(\n variant: keyof typeof TYPOGRAPHY_TOKENS,\n): TypographyToken {\n return TYPOGRAPHY_TOKENS[variant];\n}\n\n/**\n * Helper function to get typography classes as string\n */\nexport function getTypographyClasses(\n variant: keyof typeof TYPOGRAPHY_TOKENS,\n): string {\n const token = TYPOGRAPHY_TOKENS[variant];\n return `${token.fontSize.tailwind} ${token.lineHeight.tailwind} ${token.fontWeight.tailwind}`;\n}\n\n/**\n * Helper function to get only font size class\n */\nexport function getTypographySize(\n variant: keyof typeof TYPOGRAPHY_TOKENS,\n): string {\n return TYPOGRAPHY_TOKENS[variant].fontSize.tailwind;\n}\n\n/**\n * Helper function to get font size class directly from FontSize\n * This is a convenience function for when you just need a size, not a full typography variant\n */\nexport function getTypographySizeFromFontSize(size: FontSize): string {\n return TypographyTokenFactory.createFontSize(size).tailwind;\n}\n\n/**\n * Helper function to get only font weight class\n */\nexport function getTypographyWeight(\n variant: keyof typeof TYPOGRAPHY_TOKENS,\n): string {\n return TYPOGRAPHY_TOKENS[variant].fontWeight.tailwind;\n}\n\n/**\n * Helper function to get font weight class directly from FontWeight\n * This is a convenience function for when you just need a weight, not a full typography variant\n */\nexport function getTypographyWeightFromFontWeight(weight: FontWeight): string {\n return TypographyTokenFactory.createFontWeight(weight).tailwind;\n}\n\n/**\n * Helper function to get only line height class\n */\nexport function getTypographyLineHeight(\n variant: keyof typeof TYPOGRAPHY_TOKENS,\n): string {\n return TYPOGRAPHY_TOKENS[variant].lineHeight.tailwind;\n}\n"],"names":["TypographyTokenFactory","size","config","height","weight","lineHeight","FONT_FAMILY_TOKENS","FONT_WEIGHT_TOKENS","TYPOGRAPHY_TOKENS","getTypography","variant","getTypographyClasses","token","getTypographySize","getTypographySizeFromFontSize","getTypographyWeight","getTypographyWeightFromFontWeight","getTypographyLineHeight"],"mappings":";AA6DO,MAAMA,EAAuB;AAAA;AAAA;AAAA;AAAA,EAIlC,OAAO,eAAeC,GAA6C;AAejE,UAAMC,IAd8D;AAAA,MAClE,OAAO,EAAE,IAAI,IAAI,UAAU,WAAA;AAAA;AAAA,MAC3B,IAAI,EAAE,IAAI,IAAI,UAAU,UAAA;AAAA,MACxB,IAAI,EAAE,IAAI,IAAI,UAAU,UAAA;AAAA,MACxB,MAAM,EAAE,IAAI,IAAI,UAAU,YAAA;AAAA,MAC1B,IAAI,EAAE,IAAI,IAAI,UAAU,UAAA;AAAA,MACxB,IAAI,EAAE,IAAI,IAAI,UAAU,UAAA;AAAA,MACxB,OAAO,EAAE,IAAI,IAAI,UAAU,WAAA;AAAA,MA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AAW,QAAQ;AAAA,EAClE,WAAWA,EAAuB,OAAO,MAAM,WAAW,QAAQ;AAAA;AAAA,EAGlE,OAAOA,EAAuB,OAAO,MAAM,UAAU,QAAQ;AAAA,EAC7D,SAASA,EAAuB,OAAO,MAAM,UAAU,QAAQ;AAAA,EAC/D,QAAQA,EAAuB,OAAO,QAAQ,UAAU,QAAQ;AAClE;AAKO,SAASS,EACdC,GACiB;AACjB,SAAOF,EAAkBE,CAAO;AAClC;AAKO,SAASC,EACdD,GACQ;AACR,QAAME,IAAQJ,EAAkBE,CAAO;AACvC,SAAO,GAAGE,EAAM,SAAS,QAAQ,IAAIA,EAAM,WAAW,QAAQ,IAAIA,EAAM,WAAW,QAAQ;AAC7F;AAKO,SAASC,EACdH,GACQ;AACR,SAAOF,EAAkBE,CAAO,EAAE,SAAS;AAC7C;AAMO,SAASI,EAA8Bb,GAAwB;AACpE,SAAOD,EAAuB,eAAeC,CAAI,EAAE;AACrD;AAKO,SAASc,EACdL,GACQ;AACR,SAAOF,EAAkBE,CAAO,EAAE,WAAW;AAC/C;AAMO,SAASM,EAAkCZ,GAA4B;AAC5E,SAAOJ,EAAuB,iBAAiBI,CAAM,EAAE;AACzD;AAKO,SAASa,EACdP,GACQ;AACR,SAAOF,EAAkBE,CAAO,EAAE,WAAW;AAC/C;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
class e {
|
|
3
|
+
/**
|
|
4
|
+
* Create a z-index token
|
|
5
|
+
*/
|
|
6
|
+
static create(a) {
|
|
7
|
+
return {
|
|
8
|
+
base: {
|
|
9
|
+
value: 0,
|
|
10
|
+
tailwind: "z-0",
|
|
11
|
+
description: "Base layer for normal content"
|
|
12
|
+
},
|
|
13
|
+
dropdown: {
|
|
14
|
+
value: 1e3,
|
|
15
|
+
tailwind: "z-[1000]",
|
|
16
|
+
description: "Dropdown menus and select options"
|
|
17
|
+
},
|
|
18
|
+
sticky: {
|
|
19
|
+
value: 1020,
|
|
20
|
+
tailwind: "z-[1020]",
|
|
21
|
+
description: "Sticky headers and navigation"
|
|
22
|
+
},
|
|
23
|
+
fixed: {
|
|
24
|
+
value: 1030,
|
|
25
|
+
tailwind: "z-[1030]",
|
|
26
|
+
description: "Fixed position elements"
|
|
27
|
+
},
|
|
28
|
+
"modal-backdrop": {
|
|
29
|
+
value: 1040,
|
|
30
|
+
tailwind: "z-[1040]",
|
|
31
|
+
description: "Modal backdrop/overlay"
|
|
32
|
+
},
|
|
33
|
+
modal: {
|
|
34
|
+
value: 1050,
|
|
35
|
+
tailwind: "z-[1050]",
|
|
36
|
+
description: "Modal dialogs and drawers"
|
|
37
|
+
},
|
|
38
|
+
popover: {
|
|
39
|
+
value: 1060,
|
|
40
|
+
tailwind: "z-[1060]",
|
|
41
|
+
description: "Popovers and tooltips"
|
|
42
|
+
},
|
|
43
|
+
tooltip: {
|
|
44
|
+
value: 1070,
|
|
45
|
+
tailwind: "z-[1070]",
|
|
46
|
+
description: "Tooltips (highest priority)"
|
|
47
|
+
},
|
|
48
|
+
toast: {
|
|
49
|
+
value: 1080,
|
|
50
|
+
tailwind: "z-[1080]",
|
|
51
|
+
description: "Toast notifications (highest priority)"
|
|
52
|
+
}
|
|
53
|
+
}[a];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const i = {
|
|
57
|
+
base: e.create("base"),
|
|
58
|
+
dropdown: e.create("dropdown"),
|
|
59
|
+
sticky: e.create("sticky"),
|
|
60
|
+
fixed: e.create("fixed"),
|
|
61
|
+
"modal-backdrop": e.create("modal-backdrop"),
|
|
62
|
+
modal: e.create("modal"),
|
|
63
|
+
popover: e.create("popover"),
|
|
64
|
+
tooltip: e.create("tooltip"),
|
|
65
|
+
toast: e.create("toast")
|
|
66
|
+
};
|
|
67
|
+
function r(t) {
|
|
68
|
+
return e.create(t);
|
|
69
|
+
}
|
|
70
|
+
function d(t) {
|
|
71
|
+
return e.create(t).tailwind;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
e as ZIndexTokenFactory,
|
|
75
|
+
i as Z_INDEX_TOKENS,
|
|
76
|
+
r as getZIndex,
|
|
77
|
+
d as getZIndexClass
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=z-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"z-index.js","sources":["../../../../src/ui/tokens/z-index.ts"],"sourcesContent":["/**\n * Z-Index Tokens\n *\n * Centralized z-index system for consistent layering.\n * Uses Factory Pattern for type-safe token creation.\n */\n\nexport type ZIndexLayer =\n | \"base\"\n | \"dropdown\"\n | \"sticky\"\n | \"fixed\"\n | \"modal-backdrop\"\n | \"modal\"\n | \"popover\"\n | \"tooltip\"\n | \"toast\";\n\nexport interface ZIndexToken {\n value: number;\n tailwind: string;\n description: string;\n}\n\n/**\n * Z-Index Token Factory\n * Creates z-index tokens with consistent layering\n */\nexport class ZIndexTokenFactory {\n /**\n * Create a z-index token\n */\n static create(layer: ZIndexLayer): ZIndexToken {\n const layerMap: Record<\n ZIndexLayer,\n { value: number; tailwind: string; description: string }\n > = {\n base: {\n value: 0,\n tailwind: \"z-0\",\n description: \"Base layer for normal content\",\n },\n dropdown: {\n value: 1000,\n tailwind: \"z-[1000]\",\n description: \"Dropdown menus and select options\",\n },\n sticky: {\n value: 1020,\n tailwind: \"z-[1020]\",\n description: \"Sticky headers and navigation\",\n },\n fixed: {\n value: 1030,\n tailwind: \"z-[1030]\",\n description: \"Fixed position elements\",\n },\n \"modal-backdrop\": {\n value: 1040,\n tailwind: \"z-[1040]\",\n description: \"Modal backdrop/overlay\",\n },\n modal: {\n value: 1050,\n tailwind: \"z-[1050]\",\n description: \"Modal dialogs and drawers\",\n },\n popover: {\n value: 1060,\n tailwind: \"z-[1060]\",\n description: \"Popovers and tooltips\",\n },\n tooltip: {\n value: 1070,\n tailwind: \"z-[1070]\",\n description: \"Tooltips (highest priority)\",\n },\n toast: {\n value: 1080,\n tailwind: \"z-[1080]\",\n description: \"Toast notifications (highest priority)\",\n },\n };\n\n return layerMap[layer];\n }\n}\n\n/**\n * Pre-defined z-index tokens\n */\nexport const Z_INDEX_TOKENS = {\n base: ZIndexTokenFactory.create(\"base\"),\n dropdown: ZIndexTokenFactory.create(\"dropdown\"),\n sticky: ZIndexTokenFactory.create(\"sticky\"),\n fixed: ZIndexTokenFactory.create(\"fixed\"),\n \"modal-backdrop\": ZIndexTokenFactory.create(\"modal-backdrop\"),\n modal: ZIndexTokenFactory.create(\"modal\"),\n popover: ZIndexTokenFactory.create(\"popover\"),\n tooltip: ZIndexTokenFactory.create(\"tooltip\"),\n toast: ZIndexTokenFactory.create(\"toast\"),\n} as const;\n\n/**\n * Helper function to get z-index token\n */\nexport function getZIndex(layer: ZIndexLayer): ZIndexToken {\n return ZIndexTokenFactory.create(layer);\n}\n\n/**\n * Helper function to get z-index as Tailwind class\n */\nexport function getZIndexClass(layer: ZIndexLayer): string {\n return ZIndexTokenFactory.create(layer).tailwind;\n}\n"],"names":["ZIndexTokenFactory","layer","Z_INDEX_TOKENS","getZIndex","getZIndexClass"],"mappings":";AA4BO,MAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA,EAI9B,OAAO,OAAOC,GAAiC;AAoD7C,WAhDI;AAAA,MACF,MAAM;AAAA,QACJ,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,UAAU;AAAA,QACR,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,QAAQ;AAAA,QACN,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,OAAO;AAAA,QACL,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,kBAAkB;AAAA,QAChB,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,OAAO;AAAA,QACL,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,SAAS;AAAA,QACP,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,SAAS;AAAA,QACP,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,MAEf,OAAO;AAAA,QACL,OAAO;AAAA,QACP,UAAU;AAAA,QACV,aAAa;AAAA,MAAA;AAAA,IACf,EAGcA,CAAK;AAAA,EACvB;AACF;AAKO,MAAMC,IAAiB;AAAA,EAC5B,MAAMF,EAAmB,OAAO,MAAM;AAAA,EACtC,UAAUA,EAAmB,OAAO,UAAU;AAAA,EAC9C,QAAQA,EAAmB,OAAO,QAAQ;AAAA,EAC1C,OAAOA,EAAmB,OAAO,OAAO;AAAA,EACxC,kBAAkBA,EAAmB,OAAO,gBAAgB;AAAA,EAC5D,OAAOA,EAAmB,OAAO,OAAO;AAAA,EACxC,SAASA,EAAmB,OAAO,SAAS;AAAA,EAC5C,SAASA,EAAmB,OAAO,SAAS;AAAA,EAC5C,OAAOA,EAAmB,OAAO,OAAO;AAC1C;AAKO,SAASG,EAAUF,GAAiC;AACzD,SAAOD,EAAmB,OAAOC,CAAK;AACxC;AAKO,SAASG,EAAeH,GAA4B;AACzD,SAAOD,EAAmB,OAAOC,CAAK,EAAE;AAC1C;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","sources":["../../../../src/ui/utils/cn.ts"],"sourcesContent":["/**\n * CN Utility - ClassName Merge\n *\n * Utility function for merging classNames with Tailwind conflict resolution.\n * Combines clsx for conditional classes and tailwind-merge for conflict resolution.\n *\n * @example\n * ```tsx\n * cn('base-class', condition && 'conditional-class', className)\n * cn(['class1', 'class2'], { 'class3': true })\n * ```\n */\n\nimport { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merges classNames and resolves Tailwind class conflicts.\n *\n * Uses clsx for conditional class handling and tailwind-merge\n * to intelligently merge Tailwind classes, resolving conflicts\n * (e.g., 'p-2' and 'p-4' -> 'p-4').\n *\n * @param inputs - Class values to merge (strings, arrays, objects)\n * @returns Merged className string with conflicts resolved\n *\n * @example\n * ```tsx\n * // Basic usage\n * cn('base-class', 'another-class') // 'base-class another-class'\n *\n * // Conditional classes\n * cn('base', isActive && 'active', className)\n *\n * // Arrays and objects\n * cn(['class1', 'class2'], { 'class3': true, 'class4': false })\n *\n * // Tailwind conflict resolution\n * cn('p-2', 'p-4') // 'p-4' (p-2 is overridden)\n * cn('text-red-500', 'text-blue-500') // 'text-blue-500'\n * ```\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"],"names":["cn","inputs","twMerge","clsx"],"mappings":";;;AA0CO,SAASA,KAAMC,GAA8B;AAClD,SAAOC,EAAQC,EAAKF,CAAM,CAAC;AAC7B;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cva as o } from "class-variance-authority";
|
|
3
|
+
import { cn as s } from "./cn.js";
|
|
4
|
+
const v = (r, t) => {
|
|
5
|
+
const n = o(r, t);
|
|
6
|
+
return ((a) => {
|
|
7
|
+
const c = n(a);
|
|
8
|
+
return s(c);
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
v as cva
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=cva.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cva.js","sources":["../../../../src/ui/utils/cva.ts"],"sourcesContent":["/**\n * CVA Utility - Class Variance Authority\n *\n * Type-safe utility for creating component variants with compound variants support.\n * Based on class-variance-authority but integrated with our design system.\n *\n * @example\n * ```tsx\n * const buttonVariants = cva('base-class', {\n * variants: {\n * variant: { primary: 'bg-blue-500', secondary: 'bg-gray-500' },\n * size: { sm: 'text-sm', md: 'text-base' }\n * },\n * defaultVariants: { variant: 'primary', size: 'md' }\n * })\n * ```\n */\n\nimport { type VariantProps, cva as cvaLib } from \"class-variance-authority\";\nimport type { ClassValue } from \"clsx\";\nimport { cn } from \"./cn\";\n\n/**\n * Re-export VariantProps for type inference\n */\nexport type { VariantProps };\n\n/**\n * Creates a type-safe variant function with compound variants support.\n *\n * Integrates with our cn() utility for proper Tailwind conflict resolution.\n * This is a thin wrapper around class-variance-authority's cva function\n * that ensures cn() is used for final class merging.\n *\n * @param base - Base classes that always apply\n * @param config - Variant configuration with variants, compoundVariants, and defaultVariants\n * @returns Function that returns className based on variant props\n *\n * @example\n * ```tsx\n * // Simple variants\n * const buttonVariants = cva('base-class', {\n * variants: {\n * variant: {\n * primary: 'bg-blue-500 text-white',\n * secondary: 'bg-gray-500 text-white'\n * },\n * size: {\n * sm: 'px-2 py-1 text-sm',\n * md: 'px-4 py-2 text-base'\n * }\n * },\n * defaultVariants: {\n * variant: 'primary',\n * size: 'md'\n * }\n * });\n *\n * // Usage\n * buttonVariants({ variant: 'primary', size: 'sm' })\n *\n * // Compound variants\n * const badgeVariants = cva('base', {\n * variants: {\n * variant: { success: '', error: '' },\n * style: { solid: '', outline: '' }\n * },\n * compoundVariants: [\n * { variant: 'success', style: 'solid', class: 'bg-green-500' },\n * { variant: 'error', style: 'outline', class: 'border-red-500' }\n * ]\n * });\n * ```\n */\nexport const cva = <T extends Record<string, Record<string, ClassValue>>>(\n base?: ClassValue,\n config?: Parameters<typeof cvaLib<T>>[1],\n) => {\n const variantFn = cvaLib(base, config);\n\n // Wrap to ensure cn() is used for final merge\n return ((props?: Parameters<typeof variantFn>[0]) => {\n const variantClasses = variantFn(props);\n return cn(variantClasses);\n }) as typeof variantFn;\n};\n"],"names":["cva","base","config","variantFn","cvaLib","props","variantClasses","cn"],"mappings":";;;AA0EO,MAAMA,IAAM,CACjBC,GACAC,MACG;AACH,QAAMC,IAAYC,EAAOH,GAAMC,CAAM;AAGrC,UAAQ,CAACG,MAA4C;AACnD,UAAMC,IAAiBH,EAAUE,CAAK;AACtC,WAAOE,EAAGD,CAAc;AAAA,EAC1B;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeRefs.js","sources":["../../../../src/ui/utils/mergeRefs.ts"],"sourcesContent":["import type { Ref, RefCallback } from \"react\";\n\n/**\n * Compose multiple refs into a single ref callback.\n *\n * Each input ref receives the node when the returned callback is invoked.\n * Callback refs are called with the node; object refs receive it via\n * `.current`; `null`/`undefined` entries are ignored. Designed for the\n * common cloneElement pattern where a parent owns an internal ref to a\n * trigger AND the consumer may have supplied their own ref on that\n * trigger — both need to land on the same node.\n *\n * Under React 19, a consumer's ref attached to `<Child ref={r}/>` flows\n * through `child.props.ref` after cloneElement; pass that into mergeRefs\n * alongside the parent's internal ref.\n */\nexport function mergeRefs<T>(\n ...refs: Array<Ref<T> | undefined>\n): RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === \"function\") {\n ref(node);\n } else {\n // RefObject is invariant on T; the only writable shape we accept\n // is { current: T | null }, which matches both useRef and\n // createRef outputs.\n (ref as { current: T | null }).current = node;\n }\n }\n };\n}\n"],"names":["mergeRefs","refs","node","ref"],"mappings":";AAgBO,SAASA,KACXC,GACa;AAChB,SAAO,CAACC,MAAmB;AACzB,eAAWC,KAAOF;AAChB,MAAKE,MACD,OAAOA,KAAQ,aACjBA,EAAID,CAAI,IAKPC,EAA8B,UAAUD;AAAA,EAG/C;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|