@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,197 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var k = Object.defineProperty, G = Object.defineProperties;
|
|
3
|
+
var H = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var f = Object.getOwnPropertySymbols;
|
|
5
|
+
var S = Object.prototype.hasOwnProperty, z = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var y = (t, o, e) => o in t ? k(t, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[o] = e, r = (t, o) => {
|
|
7
|
+
for (var e in o || (o = {}))
|
|
8
|
+
S.call(o, e) && y(t, e, o[e]);
|
|
9
|
+
if (f)
|
|
10
|
+
for (var e of f(o))
|
|
11
|
+
z.call(o, e) && y(t, e, o[e]);
|
|
12
|
+
return t;
|
|
13
|
+
}, N = (t, o) => G(t, H(o));
|
|
14
|
+
var E = (t, o) => {
|
|
15
|
+
var e = {};
|
|
16
|
+
for (var a in t)
|
|
17
|
+
S.call(t, a) && o.indexOf(a) < 0 && (e[a] = t[a]);
|
|
18
|
+
if (t != null && f)
|
|
19
|
+
for (var a of f(t))
|
|
20
|
+
o.indexOf(a) < 0 && z.call(t, a) && (e[a] = t[a]);
|
|
21
|
+
return e;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
24
|
+
import { PanelLeftOpen as J, PanelLeftClose as K } from "lucide-react";
|
|
25
|
+
import { useSideNavbarStateRequired as Q } from "../contexts/SideNavbarStateContext.js";
|
|
26
|
+
import { useSideNavbarThemeRequired as U } from "../contexts/SideNavbarThemeContext.js";
|
|
27
|
+
import { useSideNavbarConfigRequired as V } from "../contexts/SideNavbarConfigContext.js";
|
|
28
|
+
import { getRadiusClass as W } from "../../../tokens/radius.js";
|
|
29
|
+
import { getShadowClass as O } from "../../../tokens/shadows.js";
|
|
30
|
+
import { getSpacingClass as I } from "../../../tokens/spacing.js";
|
|
31
|
+
import { Z_INDEX_TOKENS as R, getZIndexClass as tt } from "../../../tokens/z-index.js";
|
|
32
|
+
import q from "../../../primitives/Tooltip/Tooltip.js";
|
|
33
|
+
const ot = {
|
|
34
|
+
xs: "w-5 h-5",
|
|
35
|
+
sm: "w-6 h-6",
|
|
36
|
+
md: "w-8 h-8",
|
|
37
|
+
lg: "w-10 h-10"
|
|
38
|
+
}, et = {
|
|
39
|
+
xs: "w-3 h-3",
|
|
40
|
+
sm: "w-4 h-4",
|
|
41
|
+
md: "w-5 h-5",
|
|
42
|
+
lg: "w-6 h-6"
|
|
43
|
+
}, at = {
|
|
44
|
+
floating: `absolute ${tt("fixed")}`,
|
|
45
|
+
// Right edge of navbar, vertically centered - position set via style
|
|
46
|
+
// micro-z: toggle above adjacent siblings in absolute corner position
|
|
47
|
+
top: "absolute top-2 right-2 z-10",
|
|
48
|
+
// micro-z: toggle above adjacent siblings in absolute corner position
|
|
49
|
+
bottom: "absolute bottom-2 right-2 z-10",
|
|
50
|
+
// micro-z: toggle above sibling content in relative inside position
|
|
51
|
+
inside: "relative z-10",
|
|
52
|
+
// micro-z: toggle above sibling content in relative inside position
|
|
53
|
+
"navigation-top": `relative ${I("sm", "mt")} mx-auto z-10`,
|
|
54
|
+
// micro-z: toggle above sibling content in relative inside position
|
|
55
|
+
"navigation-bottom": `relative mt-auto ${I("sm", "mb")} mx-auto z-10`
|
|
56
|
+
}, nt = {
|
|
57
|
+
default: `bg-surface-raised border border-line-default ${O("sm")} hover:bg-surface-hover hover:shadow`,
|
|
58
|
+
ghost: "bg-transparent hover:bg-surface-hover border-0",
|
|
59
|
+
outline: "bg-transparent border border-line-default hover:bg-surface-hover"
|
|
60
|
+
}, rt = {
|
|
61
|
+
floating: "right",
|
|
62
|
+
top: "bottom",
|
|
63
|
+
bottom: "top",
|
|
64
|
+
inside: "right",
|
|
65
|
+
"navigation-top": "right",
|
|
66
|
+
"navigation-bottom": "right"
|
|
67
|
+
};
|
|
68
|
+
function xt(st) {
|
|
69
|
+
var p = st, {
|
|
70
|
+
position: t = "floating",
|
|
71
|
+
offset: o,
|
|
72
|
+
icon: e,
|
|
73
|
+
expandIcon: a,
|
|
74
|
+
collapseIcon: d,
|
|
75
|
+
size: b = "sm",
|
|
76
|
+
variant: L = "default",
|
|
77
|
+
showTooltip: g = !0,
|
|
78
|
+
tooltipPosition: u,
|
|
79
|
+
keyboardShortcut: m,
|
|
80
|
+
enableKeyboardShortcut: c,
|
|
81
|
+
className: j = "",
|
|
82
|
+
style: D,
|
|
83
|
+
"aria-label": P
|
|
84
|
+
} = p, T = E(p, [
|
|
85
|
+
"position",
|
|
86
|
+
"offset",
|
|
87
|
+
"icon",
|
|
88
|
+
"expandIcon",
|
|
89
|
+
"collapseIcon",
|
|
90
|
+
"size",
|
|
91
|
+
"variant",
|
|
92
|
+
"showTooltip",
|
|
93
|
+
"tooltipPosition",
|
|
94
|
+
"keyboardShortcut",
|
|
95
|
+
"enableKeyboardShortcut",
|
|
96
|
+
"className",
|
|
97
|
+
"style",
|
|
98
|
+
"aria-label"
|
|
99
|
+
]);
|
|
100
|
+
var C, v;
|
|
101
|
+
const { collapsed: n, toggle: Y } = Q(), { animationDuration: Z, animationEasing: _ } = U(), h = V(), A = m != null ? m : h.keyboardShortcut, B = c != null ? c : h.enableKeyboardShortcut, F = () => typeof e == "function" ? e(n) : e || (n && a ? a : !n && d ? d : /* @__PURE__ */ s(
|
|
102
|
+
n ? J : K,
|
|
103
|
+
{
|
|
104
|
+
className: et[b],
|
|
105
|
+
style: {
|
|
106
|
+
transition: "none",
|
|
107
|
+
transform: "none",
|
|
108
|
+
willChange: "auto"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
)), M = n ? "Expand sidebar" : "Collapse sidebar", x = u != null ? u : rt[t], i = g ? `${n ? "Expand" : "Collapse"} sidebar${B ? ` (${A})` : ""}` : void 0, $ = o ? {
|
|
112
|
+
transform: `translate(${(C = o.x) != null ? C : 0}px, ${(v = o.y) != null ? v : 0}px)`
|
|
113
|
+
} : {}, X = t === "floating" ? r({
|
|
114
|
+
// Toggle sempre na borda direita da sidebar completa (<aside>)
|
|
115
|
+
// O <aside> é o container pai, então right: -12px sempre posiciona na borda direita da sidebar
|
|
116
|
+
// Isso faz o toggle acompanhar o resize da sidebar automaticamente
|
|
117
|
+
right: "-12px",
|
|
118
|
+
// Posicionar na mesma altura do primeiro ícone (home)
|
|
119
|
+
// Usando 1rem (16px) para melhor alinhamento com o primeiro item
|
|
120
|
+
// Considerando p-2 (8px) + gap-2 (8px) + metade do primeiro item = ~16px
|
|
121
|
+
top: "1rem",
|
|
122
|
+
transform: "translateY(-50%)",
|
|
123
|
+
// Transição suave para acompanhar o resize da sidebar
|
|
124
|
+
transition: `right ${Z}ms ${_}`
|
|
125
|
+
}, $) : $, l = /* @__PURE__ */ s(
|
|
126
|
+
"button",
|
|
127
|
+
N(r({
|
|
128
|
+
type: "button",
|
|
129
|
+
onClick: Y,
|
|
130
|
+
className: `
|
|
131
|
+
${ot[b]}
|
|
132
|
+
${nt[L]}
|
|
133
|
+
${W("full")}
|
|
134
|
+
flex items-center justify-center
|
|
135
|
+
text-fg-secondary hover:text-fg-primary
|
|
136
|
+
focus:outline-none focus:ring-2 focus:ring-line-focus focus:ring-offset-1
|
|
137
|
+
${t === "floating" ? "" : at[t]}
|
|
138
|
+
${j}
|
|
139
|
+
`,
|
|
140
|
+
style: r(r(r(r({}, t === "floating" ? {
|
|
141
|
+
position: "absolute",
|
|
142
|
+
// Absolute within the floating wrapper
|
|
143
|
+
// The custom wrapper is at sidebar's content edge (right: 0 = 319px, sidebar has 1px border)
|
|
144
|
+
// The Tooltip wrapper (div.static.inline-block) is inside the custom wrapper and doesn't interfere
|
|
145
|
+
// Position button so its RIGHT edge is 12px outside sidebar's border edge
|
|
146
|
+
// Sidebar border edge: 320px, desired right edge: 320 - 12 = 308px
|
|
147
|
+
// Button width: 24px, so left edge should be: 308 - 24 = 284px
|
|
148
|
+
// Wrapper is at content edge (319px), so button right should be: 319 - (320 - 308) = 307px
|
|
149
|
+
// But we want right edge at 308px, so: right = -12px - 1px (border) = -13px
|
|
150
|
+
// Actually, if wrapper is at 319px and we want button right at 308px: 319 - 308 = 11px offset
|
|
151
|
+
// So: right = -11px (but this positions right edge at 319 - 11 = 308px ✓)
|
|
152
|
+
right: "-11px",
|
|
153
|
+
// Position button's right edge 11px outside wrapper (319px) = 308px (12px outside sidebar border)
|
|
154
|
+
left: "auto"
|
|
155
|
+
// Ensure left doesn't interfere
|
|
156
|
+
} : {}), t !== "floating" ? X : {}), t === "floating" ? { zIndex: R.fixed.value } : {}), D),
|
|
157
|
+
"aria-label": P || M,
|
|
158
|
+
"aria-expanded": !n,
|
|
159
|
+
"aria-controls": "side-navbar-sidebar",
|
|
160
|
+
"data-position": t
|
|
161
|
+
}, T), {
|
|
162
|
+
children: F()
|
|
163
|
+
})
|
|
164
|
+
);
|
|
165
|
+
if (t === "floating") {
|
|
166
|
+
const w = g && i ? /* @__PURE__ */ s(
|
|
167
|
+
q,
|
|
168
|
+
{
|
|
169
|
+
content: i,
|
|
170
|
+
position: x,
|
|
171
|
+
preservePositioning: !0,
|
|
172
|
+
children: l
|
|
173
|
+
}
|
|
174
|
+
) : l;
|
|
175
|
+
return /* @__PURE__ */ s(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
style: {
|
|
179
|
+
position: "absolute",
|
|
180
|
+
right: "0",
|
|
181
|
+
// Align to sidebar's content edge (319px with 1px border)
|
|
182
|
+
// Note: sidebar has box-sizing: border-box, so right: 0 positions at content edge
|
|
183
|
+
// We compensate by adjusting the button's right value
|
|
184
|
+
top: "1rem",
|
|
185
|
+
transform: "translateY(-50%)",
|
|
186
|
+
zIndex: R.fixed.value
|
|
187
|
+
},
|
|
188
|
+
children: w
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
return g && i ? /* @__PURE__ */ s(q, { content: i, position: x, children: l }) : l;
|
|
193
|
+
}
|
|
194
|
+
export {
|
|
195
|
+
xt as default
|
|
196
|
+
};
|
|
197
|
+
//# sourceMappingURL=SideNavbarToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SideNavbarToggle.js","sources":["../../../../../../src/ui/components/SideNavbar/components/SideNavbarToggle.tsx"],"sourcesContent":["\"use client\";\n\nimport { PanelLeftClose, PanelLeftOpen } from \"lucide-react\";\nimport { useSideNavbarStateRequired } from \"../contexts/SideNavbarStateContext\";\nimport { useSideNavbarThemeRequired } from \"../contexts/SideNavbarThemeContext\";\nimport { useSideNavbarConfigRequired } from \"../contexts/SideNavbarConfigContext\";\nimport { getRadiusClass } from \"../../../tokens/radius\";\nimport { getShadowClass } from \"../../../tokens/shadows\";\nimport { getSpacingClass } from \"../../../tokens/spacing\";\nimport { getZIndexClass, Z_INDEX_TOKENS } from \"../../../tokens/z-index\";\nimport Tooltip from \"../../../primitives/Tooltip/Tooltip\";\nimport type {\n SideNavbarToggleProps,\n SideNavbarTogglePosition,\n SideNavbarToggleVariant,\n} from \"../types\";\n\nconst sizeClasses = {\n xs: \"w-5 h-5\",\n sm: \"w-6 h-6\",\n md: \"w-8 h-8\",\n lg: \"w-10 h-10\",\n};\n\nconst iconSizeClasses = {\n xs: \"w-3 h-3\",\n sm: \"w-4 h-4\",\n md: \"w-5 h-5\",\n lg: \"w-6 h-6\",\n};\n\nconst positionClasses: Record<SideNavbarTogglePosition, string> = {\n floating: `absolute ${getZIndexClass(\"fixed\")}`, // Right edge of navbar, vertically centered - position set via style\n // micro-z: toggle above adjacent siblings in absolute corner position\n top: \"absolute top-2 right-2 z-10\",\n // micro-z: toggle above adjacent siblings in absolute corner position\n bottom: \"absolute bottom-2 right-2 z-10\",\n // micro-z: toggle above sibling content in relative inside position\n inside: \"relative z-10\",\n // micro-z: toggle above sibling content in relative inside position\n \"navigation-top\": `relative ${getSpacingClass(\"sm\", \"mt\")} mx-auto z-10`,\n // micro-z: toggle above sibling content in relative inside position\n \"navigation-bottom\": `relative mt-auto ${getSpacingClass(\"sm\", \"mb\")} mx-auto z-10`,\n};\n\nconst variantClasses: Record<SideNavbarToggleVariant, string> = {\n default: `bg-surface-raised border border-line-default ${getShadowClass(\"sm\")} hover:bg-surface-hover hover:shadow`,\n ghost: \"bg-transparent hover:bg-surface-hover border-0\",\n outline: \"bg-transparent border border-line-default hover:bg-surface-hover\",\n};\n\nconst tooltipPositionMap: Record<\n SideNavbarTogglePosition,\n \"top\" | \"right\" | \"bottom\" | \"left\"\n> = {\n floating: \"right\",\n top: \"bottom\",\n bottom: \"top\",\n inside: \"right\",\n \"navigation-top\": \"right\",\n \"navigation-bottom\": \"right\",\n};\n\n/**\n * SideNavbarToggle Component\n *\n * A flexible toggle button for collapsing/expanding the SideNavbar.\n * Supports custom icons, multiple positions, and variants.\n *\n * @example\n * ```tsx\n * // Default usage (with PanelLeft icons)\n * <SideNavbar.Toggle />\n *\n * // Custom icons\n * <SideNavbar.Toggle\n * icon={(collapsed) => collapsed ? <ChevronRight /> : <ChevronLeft />}\n * />\n *\n * // Or separate icons\n * <SideNavbar.Toggle\n * expandIcon={<ChevronRight />}\n * collapseIcon={<ChevronLeft />}\n * />\n *\n * // Inside navigation\n * <SideNavbar.Navbar>\n * <NavItems />\n * <SideNavbar.Toggle position=\"navigation-bottom\" variant=\"ghost\" />\n * </SideNavbar.Navbar>\n * ```\n */\nexport default function SideNavbarToggle({\n position = \"floating\",\n offset,\n icon,\n expandIcon,\n collapseIcon,\n size = \"sm\",\n variant = \"default\",\n showTooltip = true,\n tooltipPosition: tooltipPositionOverride,\n keyboardShortcut: keyboardShortcutOverride,\n enableKeyboardShortcut: enableKeyboardShortcutOverride,\n className = \"\",\n style,\n \"aria-label\": ariaLabel,\n ...props\n}: SideNavbarToggleProps) {\n const { collapsed, toggle } = useSideNavbarStateRequired();\n const { animationDuration, animationEasing } = useSideNavbarThemeRequired();\n const config = useSideNavbarConfigRequired();\n\n // Use config values as defaults, allow prop overrides\n const keyboardShortcut = keyboardShortcutOverride ?? config.keyboardShortcut;\n const enableKeyboardShortcut =\n enableKeyboardShortcutOverride ?? config.enableKeyboardShortcut;\n\n // Render icon logic\n const renderIcon = () => {\n // Custom render function\n if (typeof icon === \"function\") {\n return icon(collapsed);\n }\n\n // Static custom icon\n if (icon) {\n return icon;\n }\n\n // Separate expand/collapse icons\n if (collapsed && expandIcon) {\n return expandIcon;\n }\n if (!collapsed && collapseIcon) {\n return collapseIcon;\n }\n\n // Default Lucide icons - sem animação de transform\n const Icon = collapsed ? PanelLeftOpen : PanelLeftClose;\n return (\n <Icon\n className={iconSizeClasses[size]}\n style={{\n transition: \"none\",\n transform: \"none\",\n willChange: \"auto\",\n }}\n />\n );\n };\n\n const defaultAriaLabel = collapsed ? \"Expand sidebar\" : \"Collapse sidebar\";\n const tooltipPosition =\n tooltipPositionOverride ?? tooltipPositionMap[position];\n\n const tooltipContent = showTooltip\n ? `${collapsed ? \"Expand\" : \"Collapse\"} sidebar${enableKeyboardShortcut ? ` (${keyboardShortcut})` : \"\"}`\n : undefined;\n\n // Calculate offset styles\n const offsetStyle = offset\n ? {\n transform: `translate(${offset.x ?? 0}px, ${offset.y ?? 0}px)`,\n }\n : {};\n\n // Edge-following toggle positioning (right edge of sidebar)\n // The toggle is now positioned in SideNavbarRoot (at <aside> level), not in <nav>\n // This means it's positioned relative to the entire sidebar, not just the navbar\n // When collapsed: sidebar width = nav width, toggle at right edge\n // When expanded: sidebar width = nav + content, toggle at right edge of full sidebar\n // Position: right edge of sidebar, aligned with first navbar item (home icon)\n // The toggle will automatically follow the sidebar's width when resized\n const edgeFollowingStyle =\n position === \"floating\"\n ? {\n // Toggle sempre na borda direita da sidebar completa (<aside>)\n // O <aside> é o container pai, então right: -12px sempre posiciona na borda direita da sidebar\n // Isso faz o toggle acompanhar o resize da sidebar automaticamente\n right: \"-12px\",\n // Posicionar na mesma altura do primeiro ícone (home)\n // Usando 1rem (16px) para melhor alinhamento com o primeiro item\n // Considerando p-2 (8px) + gap-2 (8px) + metade do primeiro item = ~16px\n top: \"1rem\",\n transform: \"translateY(-50%)\",\n // Transição suave para acompanhar o resize da sidebar\n transition: `right ${animationDuration}ms ${animationEasing}`,\n ...offsetStyle,\n }\n : offsetStyle;\n\n const button = (\n <button\n type=\"button\"\n onClick={toggle}\n className={`\n ${sizeClasses[size]}\n ${variantClasses[variant]}\n ${getRadiusClass(\"full\")}\n flex items-center justify-center\n text-fg-secondary hover:text-fg-primary\n focus:outline-none focus:ring-2 focus:ring-line-focus focus:ring-offset-1\n ${position === \"floating\" ? \"\" : positionClasses[position]}\n ${className}\n `}\n style={{\n ...(position === \"floating\"\n ? {\n position: \"absolute\", // Absolute within the floating wrapper\n // The custom wrapper is at sidebar's content edge (right: 0 = 319px, sidebar has 1px border)\n // The Tooltip wrapper (div.static.inline-block) is inside the custom wrapper and doesn't interfere\n // Position button so its RIGHT edge is 12px outside sidebar's border edge\n // Sidebar border edge: 320px, desired right edge: 320 - 12 = 308px\n // Button width: 24px, so left edge should be: 308 - 24 = 284px\n // Wrapper is at content edge (319px), so button right should be: 319 - (320 - 308) = 307px\n // But we want right edge at 308px, so: right = -12px - 1px (border) = -13px\n // Actually, if wrapper is at 319px and we want button right at 308px: 319 - 308 = 11px offset\n // So: right = -11px (but this positions right edge at 319 - 11 = 308px ✓)\n right: \"-11px\", // Position button's right edge 11px outside wrapper (319px) = 308px (12px outside sidebar border)\n left: \"auto\", // Ensure left doesn't interfere\n }\n : {}),\n ...(position !== \"floating\" ? edgeFollowingStyle : {}),\n ...(position === \"floating\"\n ? { zIndex: Z_INDEX_TOKENS.fixed.value }\n : {}), // Ensure z-index is applied inline for floating position\n ...style,\n }}\n aria-label={ariaLabel || defaultAriaLabel}\n aria-expanded={!collapsed}\n aria-controls=\"side-navbar-sidebar\"\n data-position={position}\n {...props}\n >\n {renderIcon()}\n </button>\n );\n\n // For floating position, wrap in a container positioned relative to the sidebar (<aside>)\n // This ensures the toggle is always at the right edge of the entire sidebar, not just the nav\n // The toggle will automatically follow the sidebar's width when resized\n // The toggle should be positioned 12px outside the sidebar edge (half button width for visual balance)\n if (position === \"floating\") {\n // Create a wrapper that positions the toggle at the sidebar's right edge\n // The wrapper is positioned at sidebar's right edge (<aside>), and the button is positioned 12px outside\n const floatingButton =\n showTooltip && tooltipContent ? (\n <Tooltip\n content={tooltipContent}\n position={tooltipPosition}\n preservePositioning={true}\n >\n {button}\n </Tooltip>\n ) : (\n button\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n right: \"0\", // Align to sidebar's content edge (319px with 1px border)\n // Note: sidebar has box-sizing: border-box, so right: 0 positions at content edge\n // We compensate by adjusting the button's right value\n top: \"1rem\",\n transform: \"translateY(-50%)\",\n zIndex: Z_INDEX_TOKENS.fixed.value,\n }}\n >\n {floatingButton}\n </div>\n );\n }\n\n if (showTooltip && tooltipContent) {\n return (\n <Tooltip content={tooltipContent} position={tooltipPosition}>\n {button}\n </Tooltip>\n );\n }\n\n return button;\n}\n"],"names":["sizeClasses","iconSizeClasses","positionClasses","getZIndexClass","getSpacingClass","variantClasses","getShadowClass","tooltipPositionMap","SideNavbarToggle","_a","_b","position","offset","icon","expandIcon","collapseIcon","size","variant","showTooltip","tooltipPositionOverride","keyboardShortcutOverride","enableKeyboardShortcutOverride","className","style","ariaLabel","props","__objRest","collapsed","toggle","useSideNavbarStateRequired","animationDuration","animationEasing","useSideNavbarThemeRequired","config","useSideNavbarConfigRequired","keyboardShortcut","enableKeyboardShortcut","renderIcon","jsx","PanelLeftOpen","PanelLeftClose","defaultAriaLabel","tooltipPosition","tooltipContent","offsetStyle","edgeFollowingStyle","__spreadValues","button","__spreadProps","getRadiusClass","Z_INDEX_TOKENS","floatingButton","Tooltip"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,KAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,KAAkB;AAAA,EACtB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,KAA4D;AAAA,EAChE,UAAU,YAAYC,GAAe,OAAO,CAAC;AAAA;AAAA;AAAA,EAE7C,KAAK;AAAA;AAAA,EAEL,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA;AAAA,EAER,kBAAkB,YAAYC,EAAgB,MAAM,IAAI,CAAC;AAAA;AAAA,EAEzD,qBAAqB,oBAAoBA,EAAgB,MAAM,IAAI,CAAC;AACtE,GAEMC,KAA0D;AAAA,EAC9D,SAAS,gDAAgDC,EAAe,IAAI,CAAC;AAAA,EAC7E,OAAO;AAAA,EACP,SAAS;AACX,GAEMC,KAGF;AAAA,EACF,UAAU;AAAA,EACV,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,qBAAqB;AACvB;AA+BA,SAAwBC,GAAiBC,IAgBf;AAhBe,MAAAC,IAAAD,IACvC;AAAA,cAAAE,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,SAAAC,IAAU;AAAA,IACV,aAAAC,IAAc;AAAA,IACd,iBAAiBC;AAAA,IACjB,kBAAkBC;AAAA,IAClB,wBAAwBC;AAAA,IACxB,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,IACA,cAAcC;AAAA,MAdyBd,GAepCe,IAAAC,EAfoChB,GAepC;AAAA,IAdH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;;AAGA,QAAM,EAAE,WAAAiB,GAAW,QAAAC,EAAA,IAAWC,EAAA,GACxB,EAAE,mBAAAC,GAAmB,iBAAAC,EAAA,IAAoBC,EAAA,GACzCC,IAASC,EAAA,GAGTC,IAAmBf,KAAA,OAAAA,IAA4Ba,EAAO,kBACtDG,IACJf,KAAA,OAAAA,IAAkCY,EAAO,wBAGrCI,IAAa,MAEb,OAAOxB,KAAS,aACXA,EAAKc,CAAS,IAInBd,MAKAc,KAAab,IACRA,IAEL,CAACa,KAAaZ,IACTA,IAMP,gBAAAuB;AAAA,IAFWX,IAAYY,IAAgBC;AAAA,IAEtC;AAAA,MACC,WAAWvC,GAAgBe,CAAI;AAAA,MAC/B,OAAO;AAAA,QACL,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,YAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA,IAKAyB,IAAmBd,IAAY,mBAAmB,oBAClDe,IACJvB,KAAA,OAAAA,IAA2BZ,GAAmBI,CAAQ,GAElDgC,IAAiBzB,IACnB,GAAGS,IAAY,WAAW,UAAU,WAAWS,IAAyB,KAAKD,CAAgB,MAAM,EAAE,KACrG,QAGES,IAAchC,IAChB;AAAA,IACE,WAAW,cAAaH,IAAAG,EAAO,MAAP,OAAAH,IAAY,CAAC,QAAOC,IAAAE,EAAO,MAAP,OAAAF,IAAY,CAAC;AAAA,EAAA,IAE3D,CAAA,GASEmC,IACJlC,MAAa,aACTmC,EAAA;AAAA;AAAA;AAAA;AAAA,IAIE,OAAO;AAAA;AAAA;AAAA;AAAA,IAIP,KAAK;AAAA,IACL,WAAW;AAAA;AAAA,IAEX,YAAY,SAAShB,CAAiB,MAAMC,CAAe;AAAA,KACxDa,KAELA,GAEAG,IACJ,gBAAAT;AAAA,IAAC;AAAA,IAAAU,EAAAF,EAAA;AAAA,MACC,MAAK;AAAA,MACL,SAASlB;AAAA,MACT,WAAW;AAAA,UACP5B,GAAYgB,CAAI,CAAC;AAAA,UACjBX,GAAeY,CAAO,CAAC;AAAA,UACvBgC,EAAe,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA,UAItBtC,MAAa,aAAa,KAAKT,GAAgBS,CAAQ,CAAC;AAAA,UACxDW,CAAS;AAAA;AAAA,MAEb,OAAOwB,QAAA,IACDnC,MAAa,aACb;AAAA,QACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAUV,OAAO;AAAA;AAAA,QACP,MAAM;AAAA;AAAA,MAAA,IAER,CAAA,IACAA,MAAa,aAAakC,IAAqB,CAAA,IAC/ClC,MAAa,aACb,EAAE,QAAQuC,EAAe,MAAM,MAAA,IAC/B,CAAA,IACD3B;AAAA,MAEL,cAAYC,KAAaiB;AAAA,MACzB,iBAAe,CAACd;AAAA,MAChB,iBAAc;AAAA,MACd,iBAAehB;AAAA,OACXc,IAxCL;AAAA,MA0CE,UAAAY,EAAA;AAAA,IAAW;AAAA,EAAA;AAQhB,MAAI1B,MAAa,YAAY;AAG3B,UAAMwC,IACJjC,KAAeyB,IACb,gBAAAL;AAAA,MAACc;AAAA,MAAA;AAAA,QACC,SAAST;AAAA,QACT,UAAUD;AAAA,QACV,qBAAqB;AAAA,QAEpB,UAAAK;AAAA,MAAA;AAAA,IAAA,IAGHA;AAGJ,WACE,gBAAAT;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,OAAO;AAAA;AAAA;AAAA;AAAA,UAGP,KAAK;AAAA,UACL,WAAW;AAAA,UACX,QAAQY,EAAe,MAAM;AAAA,QAAA;AAAA,QAG9B,UAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AAEA,SAAIjC,KAAeyB,sBAEdS,GAAA,EAAQ,SAAST,GAAgB,UAAUD,GACzC,UAAAK,GACH,IAIGA;AACT;"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var k = Object.defineProperty, A = Object.defineProperties;
|
|
3
|
+
var E = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var n = Object.getOwnPropertySymbols;
|
|
5
|
+
var y = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var F = (e, t, o) => t in e ? k(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, c = (e, t) => {
|
|
7
|
+
for (var o in t || (t = {}))
|
|
8
|
+
y.call(t, o) && F(e, o, t[o]);
|
|
9
|
+
if (n)
|
|
10
|
+
for (var o of n(t))
|
|
11
|
+
C.call(t, o) && F(e, o, t[o]);
|
|
12
|
+
return e;
|
|
13
|
+
}, P = (e, t) => A(e, E(t));
|
|
14
|
+
var G = (e, t) => {
|
|
15
|
+
var o = {};
|
|
16
|
+
for (var r in e)
|
|
17
|
+
y.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
|
|
18
|
+
if (e != null && n)
|
|
19
|
+
for (var r of n(e))
|
|
20
|
+
t.indexOf(r) < 0 && C.call(e, r) && (o[r] = e[r]);
|
|
21
|
+
return o;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as M } from "react/jsx-runtime";
|
|
24
|
+
import { useRef as V, useState as l, useCallback as d, useMemo as $ } from "react";
|
|
25
|
+
import { SidebarContext as z } from "../../contexts/SidebarContext.js";
|
|
26
|
+
import { useSideNavbarStateRequired as B } from "../../contexts/SideNavbarStateContext.js";
|
|
27
|
+
import { useSideNavbarThemeRequired as I } from "../../contexts/SideNavbarThemeContext.js";
|
|
28
|
+
import J from "./SidebarHeader.js";
|
|
29
|
+
import K from "./SidebarContent.js";
|
|
30
|
+
import L from "./SidebarFooter.js";
|
|
31
|
+
import O from "./SidebarGroup.js";
|
|
32
|
+
import { SidebarSlot as Q } from "./SidebarSlot.js";
|
|
33
|
+
import { SidebarSlotContent as U } from "./SidebarSlotContent.js";
|
|
34
|
+
import { parseWidthToPixels as R } from "../../utils/parseWidth.js";
|
|
35
|
+
import { cn as X } from "../../../../utils/cn.js";
|
|
36
|
+
function s(Y) {
|
|
37
|
+
var m = Y, { children: e, className: t = "", style: o } = m, r = G(m, ["children", "className", "style"]);
|
|
38
|
+
const i = B(), a = I(), u = V(null), [p, T] = l(0), [f, b] = l(!1), [h, S] = l(!1), [v, w] = l(null), W = d(() => b(!0), []), g = d(() => b(!1), []), H = d(() => S(!0), []), x = d(() => S(!1), []), N = $(
|
|
39
|
+
() => ({
|
|
40
|
+
// Inherited from root
|
|
41
|
+
collapsed: i.collapsed,
|
|
42
|
+
currentWidth: i.currentWidth,
|
|
43
|
+
isMobile: i.isMobile,
|
|
44
|
+
// Sidebar-specific
|
|
45
|
+
sidebarRef: u,
|
|
46
|
+
scrollPosition: p,
|
|
47
|
+
setScrollPosition: T,
|
|
48
|
+
hasHeader: f,
|
|
49
|
+
hasFooter: h,
|
|
50
|
+
registerHeader: W,
|
|
51
|
+
unregisterHeader: g,
|
|
52
|
+
registerFooter: H,
|
|
53
|
+
unregisterFooter: x,
|
|
54
|
+
activeGroup: v,
|
|
55
|
+
setActiveGroup: w
|
|
56
|
+
}),
|
|
57
|
+
[
|
|
58
|
+
i.collapsed,
|
|
59
|
+
i.currentWidth,
|
|
60
|
+
i.isMobile,
|
|
61
|
+
p,
|
|
62
|
+
f,
|
|
63
|
+
h,
|
|
64
|
+
W,
|
|
65
|
+
g,
|
|
66
|
+
H,
|
|
67
|
+
x,
|
|
68
|
+
v
|
|
69
|
+
]
|
|
70
|
+
), q = R(a.contentWidth), D = R(a.navigationWidth), j = q - D;
|
|
71
|
+
return /* @__PURE__ */ M(z.Provider, { value: N, children: /* @__PURE__ */ M(
|
|
72
|
+
"div",
|
|
73
|
+
P(c({
|
|
74
|
+
ref: u,
|
|
75
|
+
className: X(
|
|
76
|
+
"flex",
|
|
77
|
+
"flex-col",
|
|
78
|
+
"h-full",
|
|
79
|
+
"bg-surface-subtle",
|
|
80
|
+
"border-r",
|
|
81
|
+
"border-line-default",
|
|
82
|
+
"overflow-hidden",
|
|
83
|
+
t
|
|
84
|
+
),
|
|
85
|
+
style: c({
|
|
86
|
+
width: i.collapsed ? 0 : j,
|
|
87
|
+
opacity: i.collapsed ? 0 : 1,
|
|
88
|
+
visibility: i.collapsed ? "hidden" : "visible",
|
|
89
|
+
transitionProperty: "width, opacity, visibility",
|
|
90
|
+
transitionDuration: `${a.animationDuration}ms`,
|
|
91
|
+
transitionTimingFunction: a.animationEasing
|
|
92
|
+
}, o),
|
|
93
|
+
"aria-hidden": i.collapsed
|
|
94
|
+
}, r), {
|
|
95
|
+
children: e
|
|
96
|
+
})
|
|
97
|
+
) });
|
|
98
|
+
}
|
|
99
|
+
s.Header = J;
|
|
100
|
+
s.Content = K;
|
|
101
|
+
s.Footer = L;
|
|
102
|
+
s.Group = O;
|
|
103
|
+
s.Slot = Q;
|
|
104
|
+
s.SlotContent = U;
|
|
105
|
+
export {
|
|
106
|
+
s as default
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.js","sources":["../../../../../../../src/ui/components/SideNavbar/components/Sidebar/Sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, useRef, useMemo, useCallback } from \"react\";\nimport { SidebarContext } from \"../../contexts/SidebarContext\";\nimport { useSideNavbarStateRequired } from \"../../contexts/SideNavbarStateContext\";\nimport { useSideNavbarThemeRequired } from \"../../contexts/SideNavbarThemeContext\";\nimport { parseWidthToPixels } from \"../../utils\";\nimport type { SidebarProps, SidebarContextValue } from \"../../types\";\nimport SidebarHeader from \"./SidebarHeader\";\nimport SidebarContent from \"./SidebarContent\";\nimport SidebarFooter from \"./SidebarFooter\";\nimport SidebarGroup from \"./SidebarGroup\";\nimport { SidebarSlot } from \"./SidebarSlot\";\nimport { SidebarSlotContent } from \"./SidebarSlotContent\";\nimport { cn } from \"../../../../utils\";\n\n/**\n * Sidebar subcomponent for SideNavbar\n *\n * Provides its own context that inherits from the root SideNavbar context.\n * Contains the expandable content area with header, content, and footer.\n *\n * @example\n * ```tsx\n * <SideNavbar.Sidebar>\n * <SideNavbar.Sidebar.Header title=\"Dashboard\" />\n * <SideNavbar.Sidebar.Content>\n * <SideNavbar.Sidebar.Group id=\"filters\" title=\"Filters\">\n * <FilterList />\n * </SideNavbar.Sidebar.Group>\n * </SideNavbar.Sidebar.Content>\n * <SideNavbar.Sidebar.Footer>\n * <Button>Apply</Button>\n * </SideNavbar.Sidebar.Footer>\n * </SideNavbar.Sidebar>\n * ```\n */\nfunction Sidebar({ children, className = \"\", style, ...props }: SidebarProps) {\n const rootState = useSideNavbarStateRequired();\n const rootTheme = useSideNavbarThemeRequired();\n const sidebarRef = useRef<HTMLDivElement>(null);\n const [scrollPosition, setScrollPosition] = useState(0);\n const [hasHeader, setHasHeader] = useState(false);\n const [hasFooter, setHasFooter] = useState(false);\n const [activeGroup, setActiveGroup] = useState<string | null>(null);\n\n const registerHeader = useCallback(() => setHasHeader(true), []);\n const unregisterHeader = useCallback(() => setHasHeader(false), []);\n const registerFooter = useCallback(() => setHasFooter(true), []);\n const unregisterFooter = useCallback(() => setHasFooter(false), []);\n\n const contextValue: SidebarContextValue = useMemo(\n () => ({\n // Inherited from root\n collapsed: rootState.collapsed,\n currentWidth: rootState.currentWidth,\n isMobile: rootState.isMobile,\n // Sidebar-specific\n sidebarRef,\n scrollPosition,\n setScrollPosition,\n hasHeader,\n hasFooter,\n registerHeader,\n unregisterHeader,\n registerFooter,\n unregisterFooter,\n activeGroup,\n setActiveGroup,\n }),\n [\n rootState.collapsed,\n rootState.currentWidth,\n rootState.isMobile,\n scrollPosition,\n hasHeader,\n hasFooter,\n registerHeader,\n unregisterHeader,\n registerFooter,\n unregisterFooter,\n activeGroup,\n ],\n );\n\n // Calculate sidebar width (total width minus navigation width)\n const totalWidth = parseWidthToPixels(rootTheme.contentWidth);\n const navWidth = parseWidthToPixels(rootTheme.navigationWidth);\n const sidebarWidth = totalWidth - navWidth;\n\n return (\n <SidebarContext.Provider value={contextValue}>\n {/* This inner container was previously an `<aside>` — a second\n * landmark nested inside SideNavbarRoot's outer `<aside\n * role=\"complementary\" aria-label=\"Sidebar navigation\">`. axe\n * `landmark-complementary-is-top-level` flagged it across all 20+\n * SideNavbar stories. The outer aside already provides the\n * landmark; this inner div is purely a layout container for the\n * collapsible content area. */}\n <div\n ref={sidebarRef}\n className={cn(\n \"flex\",\n \"flex-col\",\n \"h-full\",\n \"bg-surface-subtle\",\n \"border-r\",\n \"border-line-default\",\n \"overflow-hidden\",\n className,\n )}\n style={{\n width: rootState.collapsed ? 0 : sidebarWidth,\n opacity: rootState.collapsed ? 0 : 1,\n visibility: rootState.collapsed ? \"hidden\" : \"visible\",\n transitionProperty: \"width, opacity, visibility\",\n transitionDuration: `${rootTheme.animationDuration}ms`,\n transitionTimingFunction: rootTheme.animationEasing,\n ...style,\n }}\n aria-hidden={rootState.collapsed}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n );\n}\n\n// Attach compound components\nSidebar.Header = SidebarHeader;\nSidebar.Content = SidebarContent;\nSidebar.Footer = SidebarFooter;\nSidebar.Group = SidebarGroup;\n// Slot components (exclusive to Sidebar, not Navbar)\nSidebar.Slot = SidebarSlot;\nSidebar.SlotContent = SidebarSlotContent;\n\nexport default Sidebar;\n"],"names":["Sidebar","_a","_b","children","className","style","props","__objRest","rootState","useSideNavbarStateRequired","rootTheme","useSideNavbarThemeRequired","sidebarRef","useRef","scrollPosition","setScrollPosition","useState","hasHeader","setHasHeader","hasFooter","setHasFooter","activeGroup","setActiveGroup","registerHeader","useCallback","unregisterHeader","registerFooter","unregisterFooter","contextValue","useMemo","totalWidth","parseWidthToPixels","navWidth","sidebarWidth","jsx","SidebarContext","__spreadProps","__spreadValues","cn","SidebarHeader","SidebarContent","SidebarFooter","SidebarGroup","SidebarSlot","SidebarSlotContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAASA,EAAQC,GAA6D;AAA7D,MAAAC,IAAAD,GAAE,YAAAE,GAAU,WAAAC,IAAY,IAAI,OAAAC,MAA5BH,GAAsCI,IAAAC,EAAtCL,GAAsC,CAApC,YAAU,aAAgB;AAC3C,QAAMM,IAAYC,EAAA,GACZC,IAAYC,EAAA,GACZC,IAAaC,EAAuB,IAAI,GACxC,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,CAAC,GAChD,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAC1C,CAACG,GAAWC,CAAY,IAAIJ,EAAS,EAAK,GAC1C,CAACK,GAAaC,CAAc,IAAIN,EAAwB,IAAI,GAE5DO,IAAiBC,EAAY,MAAMN,EAAa,EAAI,GAAG,CAAA,CAAE,GACzDO,IAAmBD,EAAY,MAAMN,EAAa,EAAK,GAAG,CAAA,CAAE,GAC5DQ,IAAiBF,EAAY,MAAMJ,EAAa,EAAI,GAAG,CAAA,CAAE,GACzDO,IAAmBH,EAAY,MAAMJ,EAAa,EAAK,GAAG,CAAA,CAAE,GAE5DQ,IAAoCC;AAAA,IACxC,OAAO;AAAA;AAAA,MAEL,WAAWrB,EAAU;AAAA,MACrB,cAAcA,EAAU;AAAA,MACxB,UAAUA,EAAU;AAAA;AAAA,MAEpB,YAAAI;AAAA,MACA,gBAAAE;AAAA,MACA,mBAAAC;AAAA,MACA,WAAAE;AAAA,MACA,WAAAE;AAAA,MACA,gBAAAI;AAAA,MACA,kBAAAE;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,aAAAN;AAAA,MACA,gBAAAC;AAAA,IAAA;AAAA,IAEF;AAAA,MACEd,EAAU;AAAA,MACVA,EAAU;AAAA,MACVA,EAAU;AAAA,MACVM;AAAA,MACAG;AAAA,MACAE;AAAA,MACAI;AAAA,MACAE;AAAA,MACAC;AAAA,MACAC;AAAA,MACAN;AAAA,IAAA;AAAA,EACF,GAIIS,IAAaC,EAAmBrB,EAAU,YAAY,GACtDsB,IAAWD,EAAmBrB,EAAU,eAAe,GACvDuB,IAAeH,IAAaE;AAElC,SACE,gBAAAE,EAACC,EAAe,UAAf,EAAwB,OAAOP,GAQ9B,UAAA,gBAAAM;AAAA,IAAC;AAAA,IAAAE,EAAAC,EAAA;AAAA,MACC,KAAKzB;AAAA,MACL,WAAW0B;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAlC;AAAA,MAAA;AAAA,MAEF,OAAOiC,EAAA;AAAA,QACL,OAAO7B,EAAU,YAAY,IAAIyB;AAAA,QACjC,SAASzB,EAAU,YAAY,IAAI;AAAA,QACnC,YAAYA,EAAU,YAAY,WAAW;AAAA,QAC7C,oBAAoB;AAAA,QACpB,oBAAoB,GAAGE,EAAU,iBAAiB;AAAA,QAClD,0BAA0BA,EAAU;AAAA,SACjCL;AAAA,MAEL,eAAaG,EAAU;AAAA,OACnBF,IAtBL;AAAA,MAwBE,UAAAH;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;AAGAH,EAAQ,SAASuC;AACjBvC,EAAQ,UAAUwC;AAClBxC,EAAQ,SAASyC;AACjBzC,EAAQ,QAAQ0C;AAEhB1C,EAAQ,OAAO2C;AACf3C,EAAQ,cAAc4C;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var w = Object.defineProperty, g = Object.defineProperties;
|
|
3
|
+
var y = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var e = Object.getOwnPropertySymbols;
|
|
5
|
+
var a = Object.prototype.hasOwnProperty, d = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var i = (o, r, t) => r in o ? w(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t, n = (o, r) => {
|
|
7
|
+
for (var t in r || (r = {}))
|
|
8
|
+
a.call(r, t) && i(o, t, r[t]);
|
|
9
|
+
if (e)
|
|
10
|
+
for (var t of e(r))
|
|
11
|
+
d.call(r, t) && i(o, t, r[t]);
|
|
12
|
+
return o;
|
|
13
|
+
}, f = (o, r) => g(o, y(r));
|
|
14
|
+
var m = (o, r) => {
|
|
15
|
+
var t = {};
|
|
16
|
+
for (var l in o)
|
|
17
|
+
a.call(o, l) && r.indexOf(l) < 0 && (t[l] = o[l]);
|
|
18
|
+
if (o != null && e)
|
|
19
|
+
for (var l of e(o))
|
|
20
|
+
r.indexOf(l) < 0 && d.call(o, l) && (t[l] = o[l]);
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
24
|
+
import { useSidebarRequired as E } from "../../contexts/SidebarContext.js";
|
|
25
|
+
import { SIDEBAR_TOKENS as s } from "../../../../tokens/sidebar.js";
|
|
26
|
+
import { getSpacingClass as I } from "../../../../tokens/spacing.js";
|
|
27
|
+
function B(N) {
|
|
28
|
+
var c = N, {
|
|
29
|
+
scrollable: o = !0,
|
|
30
|
+
padding: r = "md",
|
|
31
|
+
children: t,
|
|
32
|
+
className: l = "",
|
|
33
|
+
style: u
|
|
34
|
+
} = c, p = m(c, [
|
|
35
|
+
"scrollable",
|
|
36
|
+
"padding",
|
|
37
|
+
"children",
|
|
38
|
+
"className",
|
|
39
|
+
"style"
|
|
40
|
+
]);
|
|
41
|
+
const { collapsed: S, setScrollPosition: b } = E();
|
|
42
|
+
if (S)
|
|
43
|
+
return null;
|
|
44
|
+
const h = r !== "none" ? I(r, "p") : "", v = o ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden", x = o ? {
|
|
45
|
+
scrollbarWidth: s.content.scrollbar.width,
|
|
46
|
+
scrollbarColor: `${s.content.scrollbar.color.thumb} ${s.content.scrollbar.color.track}`
|
|
47
|
+
} : {}, C = ($) => {
|
|
48
|
+
o && b($.currentTarget.scrollTop);
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ T(
|
|
51
|
+
"div",
|
|
52
|
+
f(n({
|
|
53
|
+
className: `
|
|
54
|
+
flex-1
|
|
55
|
+
min-h-0
|
|
56
|
+
${v}
|
|
57
|
+
${h}
|
|
58
|
+
${l}
|
|
59
|
+
`,
|
|
60
|
+
style: n(n({}, x), u),
|
|
61
|
+
onScroll: C,
|
|
62
|
+
tabIndex: o ? 0 : void 0
|
|
63
|
+
}, p), {
|
|
64
|
+
children: t
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
B as default
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=SidebarContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarContent.js","sources":["../../../../../../../src/ui/components/SideNavbar/components/Sidebar/SidebarContent.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { useSidebarRequired } from \"../../contexts/SidebarContext\";\nimport { getSpacingClass } from \"../../../../tokens\";\nimport { SIDEBAR_TOKENS } from \"../../../../tokens/sidebar\";\nimport type { SidebarContentProps } from \"../../types\";\n\n/**\n * Content component for the Sidebar subcomponent\n *\n * The main scrollable area of the sidebar.\n * Supports configurable padding and scroll tracking.\n *\n * @example\n * ```tsx\n * <SideNavbar.Sidebar.Content padding=\"md\" scrollable>\n * <SideNavbar.Sidebar.Group id=\"filters\" title=\"Filters\">\n * <FilterList />\n * </SideNavbar.Sidebar.Group>\n * </SideNavbar.Sidebar.Content>\n * ```\n */\nexport default function SidebarContent({\n scrollable = true,\n padding = \"md\",\n children,\n className = \"\",\n style,\n ...props\n}: SidebarContentProps) {\n const { collapsed, setScrollPosition } = useSidebarRequired();\n\n if (collapsed) {\n return null;\n }\n\n const paddingClass = padding !== \"none\" ? getSpacingClass(padding, \"p\") : \"\";\n\n const scrollClasses = scrollable\n ? \"overflow-y-auto overflow-x-hidden\"\n : \"overflow-hidden\";\n\n const scrollbarStyles = scrollable\n ? {\n scrollbarWidth: SIDEBAR_TOKENS.content.scrollbar.width as \"thin\",\n scrollbarColor: `${SIDEBAR_TOKENS.content.scrollbar.color.thumb} ${SIDEBAR_TOKENS.content.scrollbar.color.track}`,\n }\n : {};\n\n const handleScroll = (e: React.UIEvent<HTMLDivElement>) => {\n if (scrollable) {\n setScrollPosition(e.currentTarget.scrollTop);\n }\n };\n\n return (\n <div\n className={`\n flex-1\n min-h-0\n ${scrollClasses}\n ${paddingClass}\n ${className}\n `}\n style={{\n ...scrollbarStyles,\n ...style,\n }}\n onScroll={handleScroll}\n // Defensive `tabIndex={0}` on the scrollable container so keyboard\n // users can enter the region and scroll with arrow keys. Required\n // by axe `scrollable-region-focusable` (serious) whenever the\n // content inside doesn't include focusable elements (the\n // LongContent story rendered plain text with no actionable items;\n // a keyboard user had no way to reach the scrollbar). When the\n // content DOES include focusable elements axe is also satisfied,\n // so the attribute is harmless then. Only set when scrollable\n // (a non-scrollable container has no region to enter).\n tabIndex={scrollable ? 0 : undefined}\n {...props}\n >\n {children}\n </div>\n );\n}\n"],"names":["SidebarContent","_a","_b","scrollable","padding","children","className","style","props","__objRest","collapsed","setScrollPosition","useSidebarRequired","paddingClass","getSpacingClass","scrollClasses","scrollbarStyles","SIDEBAR_TOKENS","handleScroll","e","jsx","__spreadProps","__spreadValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAwBA,EAAeC,GAOf;AAPe,MAAAC,IAAAD,GACrC;AAAA,gBAAAE,IAAa;AAAA,IACb,SAAAC,IAAU;AAAA,IACV,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,MALqCL,GAMlCM,IAAAC,EANkCP,GAMlC;AAAA,IALH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,EAAE,WAAAQ,GAAW,mBAAAC,EAAA,IAAsBC,EAAA;AAEzC,MAAIF;AACF,WAAO;AAGT,QAAMG,IAAeT,MAAY,SAASU,EAAgBV,GAAS,GAAG,IAAI,IAEpEW,IAAgBZ,IAClB,sCACA,mBAEEa,IAAkBb,IACpB;AAAA,IACE,gBAAgBc,EAAe,QAAQ,UAAU;AAAA,IACjD,gBAAgB,GAAGA,EAAe,QAAQ,UAAU,MAAM,KAAK,IAAIA,EAAe,QAAQ,UAAU,MAAM,KAAK;AAAA,EAAA,IAEjH,CAAA,GAEEC,IAAe,CAACC,MAAqC;AACzD,IAAIhB,KACFQ,EAAkBQ,EAAE,cAAc,SAAS;AAAA,EAE/C;AAEA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAAC,EAAAC,EAAA;AAAA,MACC,WAAW;AAAA;AAAA;AAAA,UAGPP,CAAa;AAAA,UACbF,CAAY;AAAA,UACZP,CAAS;AAAA;AAAA,MAEb,OAAOgB,IAAA,IACFN,IACAT;AAAA,MAEL,UAAUW;AAAA,MAUV,UAAUf,IAAa,IAAI;AAAA,OACvBK,IAvBL;AAAA,MAyBE,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var F = Object.defineProperty, S = Object.defineProperties;
|
|
3
|
+
var $ = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var s = Object.getOwnPropertySymbols;
|
|
5
|
+
var a = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var l = (e, r, t) => r in e ? F(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, d = (e, r) => {
|
|
7
|
+
for (var t in r || (r = {}))
|
|
8
|
+
a.call(r, t) && l(e, t, r[t]);
|
|
9
|
+
if (s)
|
|
10
|
+
for (var t of s(r))
|
|
11
|
+
f.call(r, t) && l(e, t, r[t]);
|
|
12
|
+
return e;
|
|
13
|
+
}, m = (e, r) => S(e, $(r));
|
|
14
|
+
var c = (e, r) => {
|
|
15
|
+
var t = {};
|
|
16
|
+
for (var o in e)
|
|
17
|
+
a.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
18
|
+
if (e != null && s)
|
|
19
|
+
for (var o of s(e))
|
|
20
|
+
r.indexOf(o) < 0 && f.call(e, o) && (t[o] = e[o]);
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
24
|
+
import { useEffect as h } from "react";
|
|
25
|
+
import { useSidebarRequired as j } from "../../contexts/SidebarContext.js";
|
|
26
|
+
import { getSpacingClass as k } from "../../../../tokens/spacing.js";
|
|
27
|
+
function y(q) {
|
|
28
|
+
var i = q, {
|
|
29
|
+
padding: e = "md",
|
|
30
|
+
showBorder: r = !0,
|
|
31
|
+
children: t,
|
|
32
|
+
className: o = "",
|
|
33
|
+
style: p
|
|
34
|
+
} = i, b = c(i, [
|
|
35
|
+
"padding",
|
|
36
|
+
"showBorder",
|
|
37
|
+
"children",
|
|
38
|
+
"className",
|
|
39
|
+
"style"
|
|
40
|
+
]);
|
|
41
|
+
const { collapsed: g, registerFooter: n, unregisterFooter: u } = j();
|
|
42
|
+
if (h(() => (n(), () => u()), [n, u]), g)
|
|
43
|
+
return null;
|
|
44
|
+
const x = e !== "none" ? k(e, "p") : "";
|
|
45
|
+
return /* @__PURE__ */ C(
|
|
46
|
+
"div",
|
|
47
|
+
m(d({
|
|
48
|
+
className: `
|
|
49
|
+
flex-shrink-0
|
|
50
|
+
${x}
|
|
51
|
+
${r ? "border-t border-line-default" : ""}
|
|
52
|
+
bg-surface-subtle
|
|
53
|
+
${o}
|
|
54
|
+
`,
|
|
55
|
+
style: p
|
|
56
|
+
}, b), {
|
|
57
|
+
children: t
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
y as default
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=SidebarFooter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarFooter.js","sources":["../../../../../../../src/ui/components/SideNavbar/components/Sidebar/SidebarFooter.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { useSidebarRequired } from \"../../contexts/SidebarContext\";\nimport { getSpacingClass } from \"../../../../tokens\";\nimport type { SidebarFooterProps } from \"../../types\";\n\n/**\n * Footer component for the Sidebar subcomponent\n *\n * Displays content at the bottom of the sidebar.\n * Automatically registers its presence with the Sidebar context.\n *\n * @example\n * ```tsx\n * <SideNavbar.Sidebar.Footer>\n * <Button variant=\"primary\">Apply Changes</Button>\n * </SideNavbar.Sidebar.Footer>\n * ```\n */\nexport default function SidebarFooter({\n padding = \"md\",\n showBorder = true,\n children,\n className = \"\",\n style,\n ...props\n}: SidebarFooterProps) {\n const { collapsed, registerFooter, unregisterFooter } = useSidebarRequired();\n\n // Register footer presence with Sidebar context\n useEffect(() => {\n registerFooter();\n return () => unregisterFooter();\n }, [registerFooter, unregisterFooter]);\n\n if (collapsed) {\n return null;\n }\n\n const paddingClass = padding !== \"none\" ? getSpacingClass(padding, \"p\") : \"\";\n\n return (\n <div\n className={`\n flex-shrink-0\n ${paddingClass}\n ${showBorder ? \"border-t border-line-default\" : \"\"}\n bg-surface-subtle\n ${className}\n `}\n style={style}\n {...props}\n >\n {children}\n </div>\n );\n}\n"],"names":["SidebarFooter","_a","_b","padding","showBorder","children","className","style","props","__objRest","collapsed","registerFooter","unregisterFooter","useSidebarRequired","useEffect","paddingClass","getSpacingClass","jsx","__spreadProps","__spreadValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAwBA,EAAcC,GAOf;AAPe,MAAAC,IAAAD,GACpC;AAAA,aAAAE,IAAU;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,MALoCL,GAMjCM,IAAAC,EANiCP,GAMjC;AAAA,IALH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,EAAE,WAAAQ,GAAW,gBAAAC,GAAgB,kBAAAC,EAAA,IAAqBC,EAAA;AAQxD,MALAC,EAAU,OACRH,EAAA,GACO,MAAMC,EAAA,IACZ,CAACD,GAAgBC,CAAgB,CAAC,GAEjCF;AACF,WAAO;AAGT,QAAMK,IAAeZ,MAAY,SAASa,EAAgBb,GAAS,GAAG,IAAI;AAE1E,SACE,gBAAAc;AAAA,IAAC;AAAA,IAAAC,EAAAC,EAAA;AAAA,MACC,WAAW;AAAA;AAAA,UAEPJ,CAAY;AAAA,UACZX,IAAa,iCAAiC,EAAE;AAAA;AAAA,UAEhDE,CAAS;AAAA;AAAA,MAEb,OAAAC;AAAA,OACIC,IATL;AAAA,MAWE,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var A = Object.defineProperty, z = Object.defineProperties;
|
|
3
|
+
var E = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var n = Object.getOwnPropertySymbols;
|
|
5
|
+
var h = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var g = (e, r, t) => r in e ? A(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, N = (e, r) => {
|
|
7
|
+
for (var t in r || (r = {}))
|
|
8
|
+
h.call(r, t) && g(e, t, r[t]);
|
|
9
|
+
if (n)
|
|
10
|
+
for (var t of n(r))
|
|
11
|
+
b.call(r, t) && g(e, t, r[t]);
|
|
12
|
+
return e;
|
|
13
|
+
}, y = (e, r) => z(e, E(r));
|
|
14
|
+
var S = (e, r) => {
|
|
15
|
+
var t = {};
|
|
16
|
+
for (var s in e)
|
|
17
|
+
h.call(e, s) && r.indexOf(s) < 0 && (t[s] = e[s]);
|
|
18
|
+
if (e != null && n)
|
|
19
|
+
for (var s of n(e))
|
|
20
|
+
r.indexOf(s) < 0 && b.call(e, s) && (t[s] = e[s]);
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
24
|
+
import { useRef as H, useEffect as I } from "react";
|
|
25
|
+
import { ChevronDown as T } from "lucide-react";
|
|
26
|
+
import { useSidebarRequired as B } from "../../contexts/SidebarContext.js";
|
|
27
|
+
import { useSideNavbarStateRequired as F } from "../../contexts/SideNavbarStateContext.js";
|
|
28
|
+
import { useSideNavbarThemeRequired as J } from "../../contexts/SideNavbarThemeContext.js";
|
|
29
|
+
import K from "../../../../primitives/Collapsible/Collapsible.js";
|
|
30
|
+
import { getSpacingClass as a } from "../../../../tokens/spacing.js";
|
|
31
|
+
function Z(L) {
|
|
32
|
+
var p = L, {
|
|
33
|
+
id: e,
|
|
34
|
+
title: r,
|
|
35
|
+
icon: t,
|
|
36
|
+
actions: s,
|
|
37
|
+
collapsible: o = !0,
|
|
38
|
+
defaultCollapsed: c = !1,
|
|
39
|
+
children: f,
|
|
40
|
+
className: C = ""
|
|
41
|
+
} = p, w = S(p, [
|
|
42
|
+
"id",
|
|
43
|
+
"title",
|
|
44
|
+
"icon",
|
|
45
|
+
"actions",
|
|
46
|
+
"collapsible",
|
|
47
|
+
"defaultCollapsed",
|
|
48
|
+
"children",
|
|
49
|
+
"className"
|
|
50
|
+
]);
|
|
51
|
+
var $;
|
|
52
|
+
const {
|
|
53
|
+
collapsed: G,
|
|
54
|
+
activeGroup: R,
|
|
55
|
+
setActiveGroup: j
|
|
56
|
+
} = B(), { groupStates: u, toggleGroup: q, setGroupCollapsed: l } = F(), { animationDuration: v } = J(), x = H(!1);
|
|
57
|
+
if (I(() => {
|
|
58
|
+
!x.current && u[e] === void 0 && (x.current = !0, l(e, c));
|
|
59
|
+
}, [e, c, u, l]), G)
|
|
60
|
+
return null;
|
|
61
|
+
const d = ($ = u[e]) != null ? $ : c, D = R === e, k = () => {
|
|
62
|
+
j(e), o && q(e);
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ m(
|
|
65
|
+
"div",
|
|
66
|
+
y(N({
|
|
67
|
+
className: `
|
|
68
|
+
border-b
|
|
69
|
+
border-line-default
|
|
70
|
+
last:border-b-0
|
|
71
|
+
${C}
|
|
72
|
+
`
|
|
73
|
+
}, w), {
|
|
74
|
+
children: [
|
|
75
|
+
r && /* @__PURE__ */ m(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
type: "button",
|
|
79
|
+
onClick: k,
|
|
80
|
+
className: `
|
|
81
|
+
flex
|
|
82
|
+
items-center
|
|
83
|
+
justify-between
|
|
84
|
+
w-full
|
|
85
|
+
${a("md", "px")}
|
|
86
|
+
${a("2.5", "py")}
|
|
87
|
+
text-left
|
|
88
|
+
transition-colors
|
|
89
|
+
duration-150
|
|
90
|
+
${D ? "bg-surface-active" : "hover:bg-surface-active"}
|
|
91
|
+
${o ? "cursor-pointer" : "cursor-default"}
|
|
92
|
+
`,
|
|
93
|
+
"aria-expanded": o ? !d : void 0,
|
|
94
|
+
"aria-controls": o ? `sidebar-group-${e}` : void 0,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ m("div", { className: `flex items-center ${a("sm", "gap")}`, children: [
|
|
97
|
+
t && /* @__PURE__ */ i("span", { className: "w-4 h-4 text-fg-tertiary", children: t }),
|
|
98
|
+
/* @__PURE__ */ i("span", { className: "text-sm font-medium text-fg-secondary", children: r })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ m("div", { className: `flex items-center ${a("sm", "gap")}`, children: [
|
|
101
|
+
s,
|
|
102
|
+
o && /* @__PURE__ */ i(
|
|
103
|
+
T,
|
|
104
|
+
{
|
|
105
|
+
className: `
|
|
106
|
+
w-4
|
|
107
|
+
h-4
|
|
108
|
+
text-fg-tertiary
|
|
109
|
+
transition-transform
|
|
110
|
+
${d ? "-rotate-90" : "rotate-0"}
|
|
111
|
+
`,
|
|
112
|
+
style: { transitionDuration: `${v}ms` },
|
|
113
|
+
"aria-hidden": "true"
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
o ? /* @__PURE__ */ i(K, { open: !d, duration: v, children: /* @__PURE__ */ i(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
id: `sidebar-group-${e}`,
|
|
124
|
+
className: `${a("md", "px")} ${a("sm", "py")}`,
|
|
125
|
+
children: f
|
|
126
|
+
}
|
|
127
|
+
) }) : /* @__PURE__ */ i(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: `${a("md", "px")} ${a("sm", "py")}`,
|
|
131
|
+
children: f
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
Z as default
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=SidebarGroup.js.map
|