@studiocubics/components 0.0.1 → 0.0.2
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/dist/Cards/Card/Card.d.ts +49 -0
- package/dist/Cards/Card/Card.js +45 -0
- package/dist/Cards/Card/Card.js.map +1 -0
- package/dist/Cards/Card/Card.module.css.js +4 -0
- package/dist/Cards/Card/Card.module.css.js.map +1 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCard.d.ts +55 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCard.js +48 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCard.js.map +1 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCard.module.css.js +4 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCard.module.css.js.map +1 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCardActions.d.ts +19 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCardActions.js +34 -0
- package/dist/Cards/CollectionItemCard/CollectionItemCardActions.js.map +1 -0
- package/dist/Cards/GlassCard/GlassCard.d.ts +7 -0
- package/dist/Cards/GlassCard/GlassCard.js +52 -0
- package/dist/Cards/GlassCard/GlassCard.js.map +1 -0
- package/dist/Cards/GlassCard/GlassCard.module.css.js +4 -0
- package/dist/Cards/GlassCard/GlassCard.module.css.js.map +1 -0
- package/dist/Display/Accordion/Accordion.d.ts +14 -0
- package/dist/Display/Accordion/Accordion.js +28 -0
- package/dist/Display/Accordion/Accordion.js.map +1 -0
- package/dist/Display/Accordion/Accordion.module.css.js +4 -0
- package/dist/Display/Accordion/Accordion.module.css.js.map +1 -0
- package/dist/Display/Accordion/AccordionItem.d.ts +15 -0
- package/dist/Display/Accordion/AccordionItem.js +56 -0
- package/dist/Display/Accordion/AccordionItem.js.map +1 -0
- package/dist/Display/Chip/Chip.d.ts +46 -0
- package/dist/Display/Chip/Chip.js +43 -0
- package/dist/Display/Chip/Chip.js.map +1 -0
- package/dist/Display/Chip/Chip.module.css.js +4 -0
- package/dist/Display/Chip/Chip.module.css.js.map +1 -0
- package/dist/Display/IdentityDisplay/IdentityDisplay.d.ts +21 -0
- package/dist/Display/IdentityDisplay/IdentityDisplay.js +36 -0
- package/dist/Display/IdentityDisplay/IdentityDisplay.js.map +1 -0
- package/dist/Display/IdentityDisplay/IdentityDisplay.module.css.js +4 -0
- package/dist/Display/IdentityDisplay/IdentityDisplay.module.css.js.map +1 -0
- package/dist/Display/InputErrors/InputErrors.d.ts +11 -0
- package/dist/Display/InputErrors/InputErrors.js +25 -0
- package/dist/Display/InputErrors/InputErrors.js.map +1 -0
- package/dist/Display/InputErrors/InputErrors.module.css.js +4 -0
- package/dist/Display/InputErrors/InputErrors.module.css.js.map +1 -0
- package/dist/Display/Kbd/Kbd.d.ts +8 -0
- package/dist/Display/Kbd/Kbd.js +19 -0
- package/dist/Display/Kbd/Kbd.js.map +1 -0
- package/dist/Display/Kbd/Kbd.module.css.js +4 -0
- package/dist/Display/Kbd/Kbd.module.css.js.map +1 -0
- package/dist/Display/Kbd/buttonList.d.ts +324 -0
- package/dist/Display/Kbd/buttonList.js +198 -0
- package/dist/Display/Kbd/buttonList.js.map +1 -0
- package/dist/Display/LabeledValue/LabeledValue.d.ts +9 -0
- package/dist/Display/LabeledValue/LabeledValue.js +11 -0
- package/dist/Display/LabeledValue/LabeledValue.js.map +1 -0
- package/dist/Display/LabeledValue/LabeledValue.module.css.js +4 -0
- package/dist/Display/LabeledValue/LabeledValue.module.css.js.map +1 -0
- package/dist/Display/List/List.d.ts +50 -0
- package/dist/Display/List/List.js +96 -0
- package/dist/Display/List/List.js.map +1 -0
- package/dist/Display/List/List.module.css.js +4 -0
- package/dist/Display/List/List.module.css.js.map +1 -0
- package/dist/Display/PasswordStrength/PasswordStrength.d.ts +4 -0
- package/dist/Display/PasswordStrength/PasswordStrength.js +17 -0
- package/dist/Display/PasswordStrength/PasswordStrength.js.map +1 -0
- package/dist/Display/PasswordStrength/PasswordStrength.module.css.js +4 -0
- package/dist/Display/PasswordStrength/PasswordStrength.module.css.js.map +1 -0
- package/dist/Display/PasswordStrength/usePasswordStrength.d.ts +42 -0
- package/dist/Display/PasswordStrength/usePasswordStrength.js +49 -0
- package/dist/Display/PasswordStrength/usePasswordStrength.js.map +1 -0
- package/dist/Display/Skeleton/Skeleton.d.ts +8 -0
- package/dist/Display/Skeleton/Skeleton.js +11 -0
- package/dist/Display/Skeleton/Skeleton.js.map +1 -0
- package/dist/Display/Skeleton/Skeleton.module.css.js +4 -0
- package/dist/Display/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/Display/Toast/Toaster.d.ts +1 -0
- package/dist/Display/Toast/Toaster.js +45 -0
- package/dist/Display/Toast/Toaster.js.map +1 -0
- package/dist/Display/Toast/toast.d.ts +12 -0
- package/dist/Display/Toast/toast.js +32 -0
- package/dist/Display/Toast/toast.js.map +1 -0
- package/dist/Display/Tooltip/Tooltip.d.ts +8 -0
- package/dist/Display/Tooltip/Tooltip.js +45 -0
- package/dist/Display/Tooltip/Tooltip.js.map +1 -0
- package/dist/Display/Tooltip/Tooltip.module.css.js +4 -0
- package/dist/Display/Tooltip/Tooltip.module.css.js.map +1 -0
- package/dist/Display/Tooltip/getArrowDirection.d.ts +1 -0
- package/dist/Display/Tooltip/getArrowDirection.js +48 -0
- package/dist/Display/Tooltip/getArrowDirection.js.map +1 -0
- package/dist/Display/Tooltip/useTooltip.d.ts +8 -0
- package/dist/Display/Tooltip/useTooltip.js +48 -0
- package/dist/Display/Tooltip/useTooltip.js.map +1 -0
- package/dist/Forms/ConfirmationForm/ConfirmationForm.d.ts +15 -0
- package/dist/Forms/ConfirmationForm/ConfirmationForm.js +12 -0
- package/dist/Forms/ConfirmationForm/ConfirmationForm.js.map +1 -0
- package/dist/Forms/ConfirmationForm/ConfirmationForm.module.css.js +4 -0
- package/dist/Forms/ConfirmationForm/ConfirmationForm.module.css.js.map +1 -0
- package/dist/Inputs/Button/Button.d.ts +83 -0
- package/dist/Inputs/Button/Button.js +56 -0
- package/dist/Inputs/Button/Button.js.map +1 -0
- package/dist/Inputs/Button/Button.module.css.js +4 -0
- package/dist/Inputs/Button/Button.module.css.js.map +1 -0
- package/dist/Inputs/Checkbox/Checkbox.d.ts +23 -0
- package/dist/Inputs/Checkbox/Checkbox.js +55 -0
- package/dist/Inputs/Checkbox/Checkbox.js.map +1 -0
- package/dist/Inputs/Checkbox/Checkbox.module.css.js +4 -0
- package/dist/Inputs/Checkbox/Checkbox.module.css.js.map +1 -0
- package/dist/Inputs/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +15 -0
- package/dist/Inputs/Checkbox/CheckboxGroup/CheckboxGroup.js +35 -0
- package/dist/Inputs/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/Inputs/Checkbox/CheckboxGroup/CheckboxGroup.module.css.js +4 -0
- package/dist/Inputs/Checkbox/CheckboxGroup/CheckboxGroup.module.css.js.map +1 -0
- package/dist/Inputs/Checkbox/CheckboxSelectAll.d.ts +5 -0
- package/dist/Inputs/Checkbox/CheckboxSelectAll.js +19 -0
- package/dist/Inputs/Checkbox/CheckboxSelectAll.js.map +1 -0
- package/dist/Inputs/PasswordInput/PasswordInput.d.ts +31 -0
- package/dist/Inputs/PasswordInput/PasswordInput.js +45 -0
- package/dist/Inputs/PasswordInput/PasswordInput.js.map +1 -0
- package/dist/Inputs/PasswordInput/PasswordInput.module.css.js +4 -0
- package/dist/Inputs/PasswordInput/PasswordInput.module.css.js.map +1 -0
- package/dist/Inputs/Select/Select.d.ts +22 -0
- package/dist/Inputs/Select/Select.js +26 -0
- package/dist/Inputs/Select/Select.js.map +1 -0
- package/dist/Inputs/Select/Select.module.css.js +4 -0
- package/dist/Inputs/Select/Select.module.css.js.map +1 -0
- package/dist/Inputs/Switch/Switch.d.ts +43 -0
- package/dist/Inputs/Switch/Switch.js +81 -0
- package/dist/Inputs/Switch/Switch.js.map +1 -0
- package/dist/Inputs/Switch/Switch.module.css.js +4 -0
- package/dist/Inputs/Switch/Switch.module.css.js.map +1 -0
- package/dist/Inputs/TextAreaInput/TextAreaInput.d.ts +17 -0
- package/dist/Inputs/TextAreaInput/TextAreaInput.js +30 -0
- package/dist/Inputs/TextAreaInput/TextAreaInput.js.map +1 -0
- package/dist/Inputs/TextAreaInput/TextAreaInput.module.css.js +4 -0
- package/dist/Inputs/TextAreaInput/TextAreaInput.module.css.js.map +1 -0
- package/dist/Inputs/TextInput/TextInput.d.ts +27 -0
- package/dist/Inputs/TextInput/TextInput.js +23 -0
- package/dist/Inputs/TextInput/TextInput.js.map +1 -0
- package/dist/Inputs/TextInput/TextInput.module.css.js +4 -0
- package/dist/Inputs/TextInput/TextInput.module.css.js.map +1 -0
- package/dist/Inputs/ThemeToggle/ThemeToggleListItem.d.ts +16 -0
- package/dist/Inputs/ThemeToggle/ThemeToggleListItem.js +31 -0
- package/dist/Inputs/ThemeToggle/ThemeToggleListItem.js.map +1 -0
- package/dist/Inputs/ThemeToggle/_index.d.ts +1 -0
- package/dist/Layout/Dialog/Dialog.d.ts +13 -0
- package/dist/Layout/Dialog/Dialog.js +74 -0
- package/dist/Layout/Dialog/Dialog.js.map +1 -0
- package/dist/Layout/Dialog/Dialog.module.css.js +4 -0
- package/dist/Layout/Dialog/Dialog.module.css.js.map +1 -0
- package/dist/Layout/PageLayout/PageLayout.d.ts +28 -0
- package/dist/Layout/PageLayout/PageLayout.js +25 -0
- package/dist/Layout/PageLayout/PageLayout.js.map +1 -0
- package/dist/Layout/PageLayout/PageLayout.module.css.js +4 -0
- package/dist/Layout/PageLayout/PageLayout.module.css.js.map +1 -0
- package/dist/Layout/PageLayoutPagination/PageLayoutPagination.d.ts +7 -0
- package/dist/Layout/PageLayoutPagination/PageLayoutPagination.js +13 -0
- package/dist/Layout/PageLayoutPagination/PageLayoutPagination.js.map +1 -0
- package/dist/Layout/PageLayoutPagination/PageLayoutPagination.module.css.js +4 -0
- package/dist/Layout/PageLayoutPagination/PageLayoutPagination.module.css.js.map +1 -0
- package/dist/Layout/PageLayoutTabs/PageLayoutTabs.d.ts +14 -0
- package/dist/Layout/PageLayoutTabs/PageLayoutTabs.js +22 -0
- package/dist/Layout/PageLayoutTabs/PageLayoutTabs.js.map +1 -0
- package/dist/Layout/PageLayoutTabs/PageLayoutTabs.module.css.js +4 -0
- package/dist/Layout/PageLayoutTabs/PageLayoutTabs.module.css.js.map +1 -0
- package/dist/Layout/Popover/Popover.d.ts +14 -0
- package/dist/Layout/Popover/Popover.js +103 -0
- package/dist/Layout/Popover/Popover.js.map +1 -0
- package/dist/Layout/Popover/Popover.module.css.js +4 -0
- package/dist/Layout/Popover/Popover.module.css.js.map +1 -0
- package/dist/Layout/SectionWrapper/SectionWrapper.d.ts +14 -0
- package/dist/Layout/SectionWrapper/SectionWrapper.js +11 -0
- package/dist/Layout/SectionWrapper/SectionWrapper.js.map +1 -0
- package/dist/Layout/SectionWrapper/SectionWrapper.module.css.js +4 -0
- package/dist/Layout/SectionWrapper/SectionWrapper.module.css.js.map +1 -0
- package/dist/Layout/Sidebar/Sidebar.d.ts +15 -0
- package/dist/Layout/Sidebar/Sidebar.js +25 -0
- package/dist/Layout/Sidebar/Sidebar.js.map +1 -0
- package/dist/Layout/Sidebar/Sidebar.module.css.js +4 -0
- package/dist/Layout/Sidebar/Sidebar.module.css.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarBody/SidebarBody.d.ts +2 -0
- package/dist/Layout/Sidebar/SidebarBody/SidebarBody.js +14 -0
- package/dist/Layout/Sidebar/SidebarBody/SidebarBody.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarBody/SidebarBody.module.css.js +4 -0
- package/dist/Layout/Sidebar/SidebarBody/SidebarBody.module.css.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarDrawer/SidebarDrawer.d.ts +2 -0
- package/dist/Layout/Sidebar/SidebarDrawer/SidebarDrawer.js +14 -0
- package/dist/Layout/Sidebar/SidebarDrawer/SidebarDrawer.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarDrawer/SidebarDrawer.module.css.js +4 -0
- package/dist/Layout/Sidebar/SidebarDrawer/SidebarDrawer.module.css.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarFooter/SidebarFooter.d.ts +2 -0
- package/dist/Layout/Sidebar/SidebarFooter/SidebarFooter.js +14 -0
- package/dist/Layout/Sidebar/SidebarFooter/SidebarFooter.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarFooter/SidebarFooter.module.css.js +4 -0
- package/dist/Layout/Sidebar/SidebarFooter/SidebarFooter.module.css.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarHeader/SidebarHeader.d.ts +2 -0
- package/dist/Layout/Sidebar/SidebarHeader/SidebarHeader.js +12 -0
- package/dist/Layout/Sidebar/SidebarHeader/SidebarHeader.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarViewport/SidebarViewport.d.ts +2 -0
- package/dist/Layout/Sidebar/SidebarViewport/SidebarViewport.js +11 -0
- package/dist/Layout/Sidebar/SidebarViewport/SidebarViewport.js.map +1 -0
- package/dist/Layout/Sidebar/SidebarViewport/SidebarViewport.module.css.js +4 -0
- package/dist/Layout/Sidebar/SidebarViewport/SidebarViewport.module.css.js.map +1 -0
- package/dist/Layout/Table/Table.d.ts +54 -0
- package/dist/Layout/Table/Table.js +131 -0
- package/dist/Layout/Table/Table.js.map +1 -0
- package/dist/Layout/Table/Table.module.css.js +4 -0
- package/dist/Layout/Table/Table.module.css.js.map +1 -0
- package/dist/Layout/Table/TableFooter.d.ts +1 -0
- package/dist/Layout/Table/TableFooter.js +9 -0
- package/dist/Layout/Table/TableFooter.js.map +1 -0
- package/dist/Layout/Table/TableHeader.d.ts +1 -0
- package/dist/Layout/Table/TableHeader.js +9 -0
- package/dist/Layout/Table/TableHeader.js.map +1 -0
- package/dist/Layout/Table/tableUtils.d.ts +52 -0
- package/dist/Layout/Table/tableUtils.js +124 -0
- package/dist/Layout/Table/tableUtils.js.map +1 -0
- package/dist/Layout/Table/types.d.ts +43 -0
- package/dist/Misc/Cursor/Cursor.d.ts +1 -0
- package/dist/Misc/Cursor/Cursor.js +59 -0
- package/dist/Misc/Cursor/Cursor.js.map +1 -0
- package/dist/Misc/Cursor/Cursor.module.css.js +4 -0
- package/dist/Misc/Cursor/Cursor.module.css.js.map +1 -0
- package/dist/Misc/Logos.d.ts +14 -0
- package/dist/Misc/Logos.js +29 -0
- package/dist/Misc/Logos.js.map +1 -0
- package/dist/Misc/PoweredByBanner/PoweredByBanner.d.ts +3 -0
- package/dist/Misc/PoweredByBanner/PoweredByBanner.js +11 -0
- package/dist/Misc/PoweredByBanner/PoweredByBanner.js.map +1 -0
- package/dist/Misc/PoweredByBanner/PoweredByBanner.module.css.js +4 -0
- package/dist/Misc/PoweredByBanner/PoweredByBanner.module.css.js.map +1 -0
- package/dist/Misc/Ripple/Ripple.d.ts +21 -0
- package/dist/Misc/Ripple/Ripple.js +62 -0
- package/dist/Misc/Ripple/Ripple.js.map +1 -0
- package/dist/Misc/Ripple/Ripple.module.css.js +4 -0
- package/dist/Misc/Ripple/Ripple.module.css.js.map +1 -0
- package/dist/Misc/Spinner/Spinner.d.ts +2 -0
- package/dist/Misc/Spinner/Spinner.js +12 -0
- package/dist/Misc/Spinner/Spinner.js.map +1 -0
- package/dist/Misc/Spinner/Spinner.module.css.js +4 -0
- package/dist/Misc/Spinner/Spinner.module.css.js.map +1 -0
- package/dist/Misc/TransitionAnimation/TransitionAnimation.d.ts +71 -0
- package/dist/Misc/TransitionAnimation/TransitionAnimation.js +87 -0
- package/dist/Misc/TransitionAnimation/TransitionAnimation.js.map +1 -0
- package/dist/Misc/TransitionAnimation/TransitionAnimation.module.css.js +4 -0
- package/dist/Misc/TransitionAnimation/TransitionAnimation.module.css.js.map +1 -0
- package/dist/Navigation/Breadcrumbs/Breadcrumbs.d.ts +39 -0
- package/dist/Navigation/Breadcrumbs/Breadcrumbs.js +36 -0
- package/dist/Navigation/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/Navigation/Breadcrumbs/Breadcrumbs.module.css.js +4 -0
- package/dist/Navigation/Breadcrumbs/Breadcrumbs.module.css.js.map +1 -0
- package/dist/Navigation/Breadcrumbs/BreadcrumbsItem.d.ts +10 -0
- package/dist/Navigation/Breadcrumbs/BreadcrumbsItem.js +15 -0
- package/dist/Navigation/Breadcrumbs/BreadcrumbsItem.js.map +1 -0
- package/dist/Navigation/Breadcrumbs/useBreadcrumbs.d.ts +7 -0
- package/dist/Navigation/Breadcrumbs/useBreadcrumbs.js +44 -0
- package/dist/Navigation/Breadcrumbs/useBreadcrumbs.js.map +1 -0
- package/dist/Navigation/Pagination/Pagination.d.ts +52 -0
- package/dist/Navigation/Pagination/Pagination.js +61 -0
- package/dist/Navigation/Pagination/Pagination.js.map +1 -0
- package/dist/Navigation/Pagination/Pagination.module.css.js +4 -0
- package/dist/Navigation/Pagination/Pagination.module.css.js.map +1 -0
- package/dist/Navigation/Pagination/PaginationItem.d.ts +8 -0
- package/dist/Navigation/Pagination/PaginationItem.js +14 -0
- package/dist/Navigation/Pagination/PaginationItem.js.map +1 -0
- package/dist/Navigation/Pagination/usePagination.d.ts +6 -0
- package/dist/Navigation/Pagination/usePagination.js +38 -0
- package/dist/Navigation/Pagination/usePagination.js.map +1 -0
- package/dist/Navigation/Tabs/Tab/Tab.d.ts +46 -0
- package/dist/Navigation/Tabs/Tab/Tab.js +70 -0
- package/dist/Navigation/Tabs/Tab/Tab.js.map +1 -0
- package/dist/Navigation/Tabs/Tab/Tab.module.css.js +4 -0
- package/dist/Navigation/Tabs/Tab/Tab.module.css.js.map +1 -0
- package/dist/Navigation/Tabs/Tabs.d.ts +12 -0
- package/dist/Navigation/Tabs/Tabs.js +22 -0
- package/dist/Navigation/Tabs/Tabs.js.map +1 -0
- package/dist/Navigation/Tabs/TabsBar/TabsBar.d.ts +12 -0
- package/dist/Navigation/Tabs/TabsBar/TabsBar.js +44 -0
- package/dist/Navigation/Tabs/TabsBar/TabsBar.js.map +1 -0
- package/dist/Navigation/Tabs/TabsBar/TabsBar.module.css.js +4 -0
- package/dist/Navigation/Tabs/TabsBar/TabsBar.module.css.js.map +1 -0
- package/dist/Typography/ClampedText/ClampedText.d.ts +38 -0
- package/dist/Typography/ClampedText/ClampedText.js +44 -0
- package/dist/Typography/ClampedText/ClampedText.js.map +1 -0
- package/dist/Typography/ClampedText/ClampedText.module.css.js +4 -0
- package/dist/Typography/ClampedText/ClampedText.module.css.js.map +1 -0
- package/dist/Typography/CopyableText/CopyableText.d.ts +16 -0
- package/dist/Typography/CopyableText/CopyableText.js +39 -0
- package/dist/Typography/CopyableText/CopyableText.js.map +1 -0
- package/dist/Typography/CopyableText/CopyableText.module.css.js +4 -0
- package/dist/Typography/CopyableText/CopyableText.module.css.js.map +1 -0
- package/dist/Typography/PageTitle/PageTitle.d.ts +9 -0
- package/dist/Typography/PageTitle/PageTitle.js +10 -0
- package/dist/Typography/PageTitle/PageTitle.js.map +1 -0
- package/dist/Typography/PageTitle/PageTitle.module.css.js +4 -0
- package/dist/Typography/PageTitle/PageTitle.module.css.js.map +1 -0
- package/dist/index.css +2392 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/package.json +4 -4
- package/CHANGELOG.md +0 -11
- package/eslint.config.js +0 -21
- package/src/Cards/Card/Card.module.css +0 -27
- package/src/Cards/Card/Card.tsx +0 -105
- package/src/Cards/CollectionItemCard/CollectionItemCard.module.css +0 -84
- package/src/Cards/CollectionItemCard/CollectionItemCard.tsx +0 -170
- package/src/Cards/CollectionItemCard/CollectionItemCardActions.tsx +0 -85
- package/src/Cards/GlassCard/GlassCard.module.css +0 -71
- package/src/Cards/GlassCard/GlassCard.tsx +0 -80
- package/src/Display/Accordion/Accordion.module.css +0 -69
- package/src/Display/Accordion/Accordion.tsx +0 -61
- package/src/Display/Accordion/AccordionItem.tsx +0 -135
- package/src/Display/Chip/Chip.module.css +0 -64
- package/src/Display/Chip/Chip.tsx +0 -105
- package/src/Display/IdentityDisplay/IdentityDisplay.module.css +0 -95
- package/src/Display/IdentityDisplay/IdentityDisplay.tsx +0 -119
- package/src/Display/InputErrors/InputErrors.module.css +0 -6
- package/src/Display/InputErrors/InputErrors.tsx +0 -52
- package/src/Display/Kbd/Kbd.module.css +0 -29
- package/src/Display/Kbd/Kbd.tsx +0 -39
- package/src/Display/Kbd/buttonList.tsx +0 -246
- package/src/Display/LabeledValue/LabeledValue.module.css +0 -32
- package/src/Display/LabeledValue/LabeledValue.tsx +0 -20
- package/src/Display/List/List.module.css +0 -143
- package/src/Display/List/List.tsx +0 -298
- package/src/Display/PasswordStrength/PasswordStrength.module.css +0 -45
- package/src/Display/PasswordStrength/PasswordStrength.tsx +0 -41
- package/src/Display/PasswordStrength/usePasswordStrength.tsx +0 -77
- package/src/Display/Skeleton/Skeleton.module.css +0 -54
- package/src/Display/Skeleton/Skeleton.tsx +0 -28
- package/src/Display/Toast/Toaster.tsx +0 -58
- package/src/Display/Toast/toast.ts +0 -44
- package/src/Display/Tooltip/Tooltip.module.css +0 -128
- package/src/Display/Tooltip/Tooltip.tsx +0 -93
- package/src/Display/Tooltip/getArrowDirection.ts +0 -55
- package/src/Display/Tooltip/useTooltip.tsx +0 -63
- package/src/Forms/ConfirmationForm/ConfirmationForm.module.css +0 -23
- package/src/Forms/ConfirmationForm/ConfirmationForm.tsx +0 -60
- package/src/Inputs/Button/Button.module.css +0 -131
- package/src/Inputs/Button/Button.tsx +0 -178
- package/src/Inputs/Checkbox/Checkbox.module.css +0 -77
- package/src/Inputs/Checkbox/Checkbox.tsx +0 -191
- package/src/Inputs/Checkbox/CheckboxGroup/CheckboxGroup.module.css +0 -10
- package/src/Inputs/Checkbox/CheckboxGroup/CheckboxGroup.tsx +0 -83
- package/src/Inputs/Checkbox/CheckboxSelectAll.tsx +0 -34
- package/src/Inputs/PasswordInput/PasswordInput.module.css +0 -111
- package/src/Inputs/PasswordInput/PasswordInput.tsx +0 -229
- package/src/Inputs/Select/Select.module.css +0 -138
- package/src/Inputs/Select/Select.tsx +0 -136
- package/src/Inputs/Switch/Switch.module.css +0 -119
- package/src/Inputs/Switch/Switch.tsx +0 -195
- package/src/Inputs/TextAreaInput/TextAreaInput.module.css +0 -65
- package/src/Inputs/TextAreaInput/TextAreaInput.tsx +0 -97
- package/src/Inputs/TextInput/TextInput.module.css +0 -112
- package/src/Inputs/TextInput/TextInput.tsx +0 -142
- package/src/Inputs/ThemeToggle/ThemeToggleListItem.tsx +0 -80
- package/src/Inputs/ThemeToggle/_index.ts +0 -1
- package/src/Layout/Dialog/Dialog.module.css +0 -15
- package/src/Layout/Dialog/Dialog.tsx +0 -115
- package/src/Layout/PageLayout/PageLayout.module.css +0 -20
- package/src/Layout/PageLayout/PageLayout.tsx +0 -79
- package/src/Layout/PageLayoutPagination/PageLayoutPagination.module.css +0 -5
- package/src/Layout/PageLayoutPagination/PageLayoutPagination.tsx +0 -40
- package/src/Layout/PageLayoutTabs/PageLayoutTabs.module.css +0 -3
- package/src/Layout/PageLayoutTabs/PageLayoutTabs.tsx +0 -62
- package/src/Layout/Popover/Popover.module.css +0 -9
- package/src/Layout/Popover/Popover.tsx +0 -145
- package/src/Layout/SectionWrapper/SectionWrapper.module.css +0 -31
- package/src/Layout/SectionWrapper/SectionWrapper.tsx +0 -62
- package/src/Layout/Sidebar/Sidebar.module.css +0 -17
- package/src/Layout/Sidebar/Sidebar.tsx +0 -39
- package/src/Layout/Sidebar/SidebarBody/SidebarBody.module.css +0 -31
- package/src/Layout/Sidebar/SidebarBody/SidebarBody.tsx +0 -18
- package/src/Layout/Sidebar/SidebarDrawer/SidebarDrawer.module.css +0 -20
- package/src/Layout/Sidebar/SidebarDrawer/SidebarDrawer.tsx +0 -19
- package/src/Layout/Sidebar/SidebarFooter/SidebarFooter.module.css +0 -35
- package/src/Layout/Sidebar/SidebarFooter/SidebarFooter.tsx +0 -19
- package/src/Layout/Sidebar/SidebarHeader/SidebarHeader.tsx +0 -14
- package/src/Layout/Sidebar/SidebarViewport/SidebarViewport.module.css +0 -12
- package/src/Layout/Sidebar/SidebarViewport/SidebarViewport.tsx +0 -11
- package/src/Layout/Table/Table.module.css +0 -46
- package/src/Layout/Table/Table.tsx +0 -222
- package/src/Layout/Table/TableFooter.tsx +0 -4
- package/src/Layout/Table/TableHeader.tsx +0 -4
- package/src/Layout/Table/tableUtils.ts +0 -142
- package/src/Layout/Table/types.ts +0 -48
- package/src/Misc/Cursor/Cursor.module.css +0 -31
- package/src/Misc/Cursor/Cursor.tsx +0 -77
- package/src/Misc/Logos.tsx +0 -230
- package/src/Misc/PoweredByBanner/PoweredByBanner.module.css +0 -20
- package/src/Misc/PoweredByBanner/PoweredByBanner.tsx +0 -17
- package/src/Misc/Ripple/Ripple.module.css +0 -25
- package/src/Misc/Ripple/Ripple.tsx +0 -126
- package/src/Misc/Spinner/Spinner.module.css +0 -38
- package/src/Misc/Spinner/Spinner.tsx +0 -36
- package/src/Misc/TransitionAnimation/TransitionAnimation.module.css +0 -131
- package/src/Misc/TransitionAnimation/TransitionAnimation.tsx +0 -166
- package/src/Navigation/Breadcrumbs/Breadcrumbs.module.css +0 -22
- package/src/Navigation/Breadcrumbs/Breadcrumbs.tsx +0 -127
- package/src/Navigation/Breadcrumbs/BreadcrumbsItem.tsx +0 -31
- package/src/Navigation/Breadcrumbs/useBreadcrumbs.tsx +0 -74
- package/src/Navigation/Pagination/Pagination.module.css +0 -41
- package/src/Navigation/Pagination/Pagination.tsx +0 -187
- package/src/Navigation/Pagination/PaginationItem.tsx +0 -28
- package/src/Navigation/Pagination/usePagination.tsx +0 -65
- package/src/Navigation/Tabs/Tab/Tab.module.css +0 -43
- package/src/Navigation/Tabs/Tab/Tab.tsx +0 -155
- package/src/Navigation/Tabs/Tabs.tsx +0 -37
- package/src/Navigation/Tabs/TabsBar/TabsBar.module.css +0 -47
- package/src/Navigation/Tabs/TabsBar/TabsBar.tsx +0 -92
- package/src/Typography/ClampedText/ClampedText.module.css +0 -5
- package/src/Typography/ClampedText/ClampedText.tsx +0 -77
- package/src/Typography/CopyableText/CopyableText.module.css +0 -21
- package/src/Typography/CopyableText/CopyableText.tsx +0 -120
- package/src/Typography/PageTitle/PageTitle.module.css +0 -47
- package/src/Typography/PageTitle/PageTitle.tsx +0 -35
- package/src/declaration.d.ts +0 -4
- package/tsconfig.json +0 -32
- /package/{src/Cards/CollectionItemCard/_index.ts → dist/Cards/CollectionItemCard/_index.d.ts} +0 -0
- /package/{src/Cards/_index.ts → dist/Cards/_index.d.ts} +0 -0
- /package/{src/Display/Accordion/_index.ts → dist/Display/Accordion/_index.d.ts} +0 -0
- /package/{src/Display/Kbd/_index.ts → dist/Display/Kbd/_index.d.ts} +0 -0
- /package/{src/Display/Toast/_index.ts → dist/Display/Toast/_index.d.ts} +0 -0
- /package/{src/Display/_index.ts → dist/Display/_index.d.ts} +0 -0
- /package/{src/Forms/_index.ts → dist/Forms/_index.d.ts} +0 -0
- /package/{src/Inputs/Checkbox/_index.ts → dist/Inputs/Checkbox/_index.d.ts} +0 -0
- /package/{src/Inputs/_index.ts → dist/Inputs/_index.d.ts} +0 -0
- /package/{src/Layout/Sidebar/_index.ts → dist/Layout/Sidebar/_index.d.ts} +0 -0
- /package/{src/Layout/Table/_index.ts → dist/Layout/Table/_index.d.ts} +0 -0
- /package/{src/Layout/_index.ts → dist/Layout/_index.d.ts} +0 -0
- /package/{src/Misc/_index.ts → dist/Misc/_index.d.ts} +0 -0
- /package/{src/Navigation/Breadcrumbs/_index.ts → dist/Navigation/Breadcrumbs/_index.d.ts} +0 -0
- /package/{src/Navigation/Pagination/_index.ts → dist/Navigation/Pagination/_index.d.ts} +0 -0
- /package/{src/Navigation/Tabs/_index.ts → dist/Navigation/Tabs/_index.d.ts} +0 -0
- /package/{src/Navigation/_index.ts → dist/Navigation/_index.d.ts} +0 -0
- /package/{src/Typography/_index.ts → dist/Typography/_index.d.ts} +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
type ComponentProps,
|
|
5
|
-
createContext,
|
|
6
|
-
type ElementType,
|
|
7
|
-
type ReactNode,
|
|
8
|
-
useContext,
|
|
9
|
-
useEffect,
|
|
10
|
-
useRef,
|
|
11
|
-
useState,
|
|
12
|
-
} from "react";
|
|
13
|
-
import styles from "./List.module.css";
|
|
14
|
-
import { cn, mergeRefs } from "@studiocubics/utils";
|
|
15
|
-
import {
|
|
16
|
-
eventWithRipple,
|
|
17
|
-
useRipple,
|
|
18
|
-
type UseRippleProps,
|
|
19
|
-
} from "../../Misc/_index";
|
|
20
|
-
import { useDisclosure } from "@studiocubics/hooks";
|
|
21
|
-
import { GlassCard, type GlassCardProps } from "../../Cards/_index";
|
|
22
|
-
import type { SetState } from "@studiocubics/types";
|
|
23
|
-
|
|
24
|
-
interface ListContextProps {
|
|
25
|
-
activeListItem: HTMLLIElement | null;
|
|
26
|
-
setActiveListItem: SetState<HTMLLIElement | null>;
|
|
27
|
-
}
|
|
28
|
-
export type ListProps = {
|
|
29
|
-
ordered?: boolean;
|
|
30
|
-
className?: string;
|
|
31
|
-
secondary?: boolean;
|
|
32
|
-
renderMarker?: boolean;
|
|
33
|
-
|
|
34
|
-
slotProps?: {
|
|
35
|
-
marker?: GlassCardProps;
|
|
36
|
-
};
|
|
37
|
-
} & (
|
|
38
|
-
| {
|
|
39
|
-
listData?: ListItemProps[];
|
|
40
|
-
children?: undefined;
|
|
41
|
-
listItemProps?: ListItemProps;
|
|
42
|
-
}
|
|
43
|
-
| {
|
|
44
|
-
children?: ReactNode;
|
|
45
|
-
listData?: undefined;
|
|
46
|
-
listItemProps?: undefined;
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const ListContext = createContext<ListContextProps | null>(null);
|
|
51
|
-
|
|
52
|
-
export function useList() {
|
|
53
|
-
const c = useContext(ListContext);
|
|
54
|
-
if (!c) throw new Error("Components must be wrapped in <List/>");
|
|
55
|
-
return c;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function List(props: ListProps) {
|
|
59
|
-
const {
|
|
60
|
-
children,
|
|
61
|
-
ordered = false,
|
|
62
|
-
secondary = false,
|
|
63
|
-
listData = [],
|
|
64
|
-
slotProps = {},
|
|
65
|
-
className,
|
|
66
|
-
renderMarker = true,
|
|
67
|
-
listItemProps = {},
|
|
68
|
-
} = props;
|
|
69
|
-
const [activeListItem, setActiveListItem] =
|
|
70
|
-
useState<ListContextProps["activeListItem"]>(null);
|
|
71
|
-
const markerRef = useRef<HTMLDivElement>(null);
|
|
72
|
-
const rootRef = useRef<HTMLOListElement>(null);
|
|
73
|
-
|
|
74
|
-
const rootClass = cn(
|
|
75
|
-
styles.root,
|
|
76
|
-
className,
|
|
77
|
-
secondary ? styles.secondary : "",
|
|
78
|
-
);
|
|
79
|
-
const body = listData.length
|
|
80
|
-
? listData.map((ld, i) => <ListItem key={i} {...listItemProps} {...ld} />)
|
|
81
|
-
: children;
|
|
82
|
-
|
|
83
|
-
const marker = renderMarker ? (
|
|
84
|
-
<GlassCard
|
|
85
|
-
{...slotProps.marker}
|
|
86
|
-
ref={markerRef}
|
|
87
|
-
className={cn(styles.marker, slotProps.marker?.className)}
|
|
88
|
-
/>
|
|
89
|
-
) : null;
|
|
90
|
-
const Component = ordered ? "ol" : "ul";
|
|
91
|
-
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
if (!rootRef.current || !markerRef.current || !activeListItem) return;
|
|
94
|
-
|
|
95
|
-
const updateMarkerPosition = () => {
|
|
96
|
-
if (!rootRef.current || !markerRef.current || !activeListItem) return;
|
|
97
|
-
|
|
98
|
-
const marker = markerRef.current;
|
|
99
|
-
const tabRect = activeListItem.getBoundingClientRect();
|
|
100
|
-
const rootRect = rootRef.current.getBoundingClientRect();
|
|
101
|
-
|
|
102
|
-
// Account for scroll offset
|
|
103
|
-
const scrollLeft = rootRef.current.scrollLeft;
|
|
104
|
-
const scrollTop = rootRef.current.scrollTop;
|
|
105
|
-
|
|
106
|
-
marker.style.display = "block";
|
|
107
|
-
marker.style.width = `${tabRect.width}px`;
|
|
108
|
-
marker.style.height = `${tabRect.height}px`;
|
|
109
|
-
marker.style.left = `${tabRect.left - rootRect.left + scrollLeft}px`;
|
|
110
|
-
marker.style.top = `${tabRect.top - rootRect.top + scrollTop}px`;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
updateMarkerPosition();
|
|
114
|
-
|
|
115
|
-
const container = rootRef.current;
|
|
116
|
-
|
|
117
|
-
// Update marker position when container resizes
|
|
118
|
-
const resizeObserver = new ResizeObserver(updateMarkerPosition);
|
|
119
|
-
resizeObserver.observe(container);
|
|
120
|
-
|
|
121
|
-
return () => {
|
|
122
|
-
resizeObserver.disconnect();
|
|
123
|
-
};
|
|
124
|
-
}, [activeListItem]);
|
|
125
|
-
return (
|
|
126
|
-
<ListContext.Provider value={{ activeListItem, setActiveListItem }}>
|
|
127
|
-
<Component ref={rootRef} className={rootClass}>
|
|
128
|
-
{body}
|
|
129
|
-
{marker}
|
|
130
|
-
</Component>
|
|
131
|
-
</ListContext.Provider>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface ListItemProps extends ComponentProps<"li"> {
|
|
136
|
-
startIcon?: ReactNode;
|
|
137
|
-
endIcon?: ReactNode;
|
|
138
|
-
dropDownIcon?: ReactNode;
|
|
139
|
-
selected?: boolean;
|
|
140
|
-
shortened?: boolean;
|
|
141
|
-
shortenedIcon?: "start" | "end";
|
|
142
|
-
href?: ComponentProps<"a">["href"];
|
|
143
|
-
disabled?: boolean;
|
|
144
|
-
color?: "primary" | "secondary" | "error";
|
|
145
|
-
slotProps?: {
|
|
146
|
-
ripple?: UseRippleProps;
|
|
147
|
-
content?: ComponentProps<"span">;
|
|
148
|
-
startIcon?: ComponentProps<"span">;
|
|
149
|
-
endIcon?: ComponentProps<"span">;
|
|
150
|
-
dropDownIcon?: ComponentProps<"span">;
|
|
151
|
-
linkComponent?: ComponentProps<"a">;
|
|
152
|
-
};
|
|
153
|
-
childNodes?: Array<ListItemProps>;
|
|
154
|
-
LinkComponent?: ElementType<ComponentProps<any>>;
|
|
155
|
-
}
|
|
156
|
-
function ChevronDown() {
|
|
157
|
-
return (
|
|
158
|
-
<svg
|
|
159
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
-
width="16"
|
|
161
|
-
height="16"
|
|
162
|
-
viewBox="0 0 24 24"
|
|
163
|
-
fill="none"
|
|
164
|
-
stroke="currentColor"
|
|
165
|
-
strokeWidth="2"
|
|
166
|
-
strokeLinecap="round"
|
|
167
|
-
strokeLinejoin="round"
|
|
168
|
-
className="lucide lucide-chevron-down-icon lucide-chevron-down"
|
|
169
|
-
>
|
|
170
|
-
<path d="m6 9 6 6 6-6" />
|
|
171
|
-
</svg>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
// Create the base component with forwardRef
|
|
175
|
-
export function ListItem(props: ListItemProps) {
|
|
176
|
-
const {
|
|
177
|
-
className,
|
|
178
|
-
children,
|
|
179
|
-
onTouchStart,
|
|
180
|
-
onClick,
|
|
181
|
-
shortened = false,
|
|
182
|
-
shortenedIcon = "start",
|
|
183
|
-
selected = false,
|
|
184
|
-
dropDownIcon = <ChevronDown />,
|
|
185
|
-
color,
|
|
186
|
-
startIcon,
|
|
187
|
-
endIcon,
|
|
188
|
-
disabled,
|
|
189
|
-
childNodes = [],
|
|
190
|
-
href,
|
|
191
|
-
LinkComponent = "a",
|
|
192
|
-
slotProps: _slotProps,
|
|
193
|
-
ref,
|
|
194
|
-
...restProps
|
|
195
|
-
} = props;
|
|
196
|
-
const slotProps: NonNullable<ListItemProps["slotProps"]> = _slotProps ?? {};
|
|
197
|
-
const { setActiveListItem } = useList();
|
|
198
|
-
const listItemRef = useRef<HTMLLIElement>(null);
|
|
199
|
-
|
|
200
|
-
const { rippleElements, createRipple } = useRipple(slotProps.ripple);
|
|
201
|
-
const { open, handleToggle } = useDisclosure();
|
|
202
|
-
|
|
203
|
-
const clickable =
|
|
204
|
-
!disabled && (!!href || !!onClick || (!shortened && !!childNodes.length));
|
|
205
|
-
|
|
206
|
-
const componentProps = {
|
|
207
|
-
className: cn(
|
|
208
|
-
className,
|
|
209
|
-
styles.listItem,
|
|
210
|
-
shortened ? styles.shortened : "",
|
|
211
|
-
selected ? styles.selected : "",
|
|
212
|
-
clickable ? styles.clickable : "",
|
|
213
|
-
disabled ? styles.disabled : "",
|
|
214
|
-
),
|
|
215
|
-
onTouchStart: disabled
|
|
216
|
-
? undefined
|
|
217
|
-
: eventWithRipple(createRipple, onTouchStart, handleToggle),
|
|
218
|
-
onClick: disabled
|
|
219
|
-
? undefined
|
|
220
|
-
: eventWithRipple(createRipple, onClick, handleToggle),
|
|
221
|
-
"data-color": color,
|
|
222
|
-
ref: mergeRefs(ref, listItemRef),
|
|
223
|
-
...restProps,
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
const body = (
|
|
227
|
-
<>
|
|
228
|
-
{clickable && rippleElements}
|
|
229
|
-
{startIcon && (
|
|
230
|
-
<span
|
|
231
|
-
{...slotProps.startIcon}
|
|
232
|
-
className={cn(
|
|
233
|
-
styles.iconContainer,
|
|
234
|
-
shortenedIcon == "start" ? styles.primaryIcon : "",
|
|
235
|
-
slotProps.startIcon?.className,
|
|
236
|
-
)}
|
|
237
|
-
>
|
|
238
|
-
{startIcon}
|
|
239
|
-
</span>
|
|
240
|
-
)}
|
|
241
|
-
<span
|
|
242
|
-
{...slotProps.content}
|
|
243
|
-
className={cn(styles.content, slotProps.content?.className)}
|
|
244
|
-
>
|
|
245
|
-
{children}
|
|
246
|
-
</span>
|
|
247
|
-
{endIcon && (
|
|
248
|
-
<span
|
|
249
|
-
{...slotProps.endIcon}
|
|
250
|
-
className={cn(
|
|
251
|
-
styles.iconContainer,
|
|
252
|
-
shortenedIcon == "end" ? styles.primaryIcon : "",
|
|
253
|
-
slotProps.endIcon?.className,
|
|
254
|
-
)}
|
|
255
|
-
>
|
|
256
|
-
{endIcon}
|
|
257
|
-
</span>
|
|
258
|
-
)}
|
|
259
|
-
{!!childNodes.length && (
|
|
260
|
-
<span
|
|
261
|
-
{...slotProps.dropDownIcon}
|
|
262
|
-
className={cn(
|
|
263
|
-
styles.iconContainer,
|
|
264
|
-
styles.dropDownIcon,
|
|
265
|
-
slotProps.dropDownIcon?.className,
|
|
266
|
-
open ? styles.openSublist : "",
|
|
267
|
-
)}
|
|
268
|
-
>
|
|
269
|
-
{dropDownIcon}
|
|
270
|
-
</span>
|
|
271
|
-
)}
|
|
272
|
-
</>
|
|
273
|
-
);
|
|
274
|
-
|
|
275
|
-
useEffect(() => {
|
|
276
|
-
if (!listItemRef.current) return;
|
|
277
|
-
if (selected) setActiveListItem(listItemRef.current);
|
|
278
|
-
}, [selected]);
|
|
279
|
-
|
|
280
|
-
return (
|
|
281
|
-
<>
|
|
282
|
-
{href ? (
|
|
283
|
-
<LinkComponent href={href} disabled={disabled} {...componentProps}>
|
|
284
|
-
{body}
|
|
285
|
-
</LinkComponent>
|
|
286
|
-
) : (
|
|
287
|
-
<li {...componentProps}>{body}</li>
|
|
288
|
-
)}
|
|
289
|
-
{!!childNodes.length && !shortened && open && (
|
|
290
|
-
<List secondary>
|
|
291
|
-
{childNodes.map((c, i) => (
|
|
292
|
-
<ListItem key={i} {...c} />
|
|
293
|
-
))}
|
|
294
|
-
</List>
|
|
295
|
-
)}
|
|
296
|
-
</>
|
|
297
|
-
);
|
|
298
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
.root {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
gap: var(--spacing-gap);
|
|
5
|
-
flex-wrap: wrap;
|
|
6
|
-
padding-inline: var(--spacing-gap);
|
|
7
|
-
scale: 1 0;
|
|
8
|
-
transition: scale var(--transition-time) var(--transition-tf);
|
|
9
|
-
}
|
|
10
|
-
.title {
|
|
11
|
-
font-size: 0.5rem;
|
|
12
|
-
flex: 0 0 auto;
|
|
13
|
-
}
|
|
14
|
-
.strengthBars {
|
|
15
|
-
flex: 1 1 50%;
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: flex-start;
|
|
18
|
-
gap: var(--spacing-gap);
|
|
19
|
-
}
|
|
20
|
-
.bar {
|
|
21
|
-
transition: all var(--transition-time) var(--transition-tf);
|
|
22
|
-
background-color: currentColor;
|
|
23
|
-
scale: 0 0;
|
|
24
|
-
flex: 1 1 25%;
|
|
25
|
-
transform-origin: top left;
|
|
26
|
-
border-radius: 999px;
|
|
27
|
-
}
|
|
28
|
-
.weak {
|
|
29
|
-
height: 3px;
|
|
30
|
-
opacity: 0.3;
|
|
31
|
-
}
|
|
32
|
-
.medium {
|
|
33
|
-
height: 5px;
|
|
34
|
-
opacity: 0.5;
|
|
35
|
-
}
|
|
36
|
-
.good {
|
|
37
|
-
height: 7px;
|
|
38
|
-
opacity: 0.8;
|
|
39
|
-
}
|
|
40
|
-
.strong {
|
|
41
|
-
height: 9px;
|
|
42
|
-
}
|
|
43
|
-
.show {
|
|
44
|
-
scale: 1 1;
|
|
45
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import styles from "./PasswordStrength.module.css";
|
|
4
|
-
import { cn, remap } from "@studiocubics/utils";
|
|
5
|
-
import type { ComponentProps } from "react";
|
|
6
|
-
|
|
7
|
-
export const STRENGTH_MESSAGES = ["", "Weak", "Medium", "Good", "Strong"];
|
|
8
|
-
|
|
9
|
-
const Bar = ({ className, ...rest }: ComponentProps<"span">) => {
|
|
10
|
-
return <span className={cn(styles.bar, className)} {...rest} />;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function PasswordStrength({ strength }: { strength?: number | null }) {
|
|
14
|
-
const remappedStrength = strength ? remap(strength, [1, 5], [1, 4]) : 0;
|
|
15
|
-
const strengthMsg = STRENGTH_MESSAGES[remappedStrength];
|
|
16
|
-
return (
|
|
17
|
-
<div className={cn(styles.root, !!strength ? styles.show : "")}>
|
|
18
|
-
<p className={cn(styles.title)}>{strengthMsg}</p>
|
|
19
|
-
<div className={cn(styles.strengthBars)}>
|
|
20
|
-
<Bar
|
|
21
|
-
className={cn(styles.weak, remappedStrength >= 1 ? styles.show : "")}
|
|
22
|
-
/>
|
|
23
|
-
<Bar
|
|
24
|
-
className={cn(
|
|
25
|
-
styles.medium,
|
|
26
|
-
remappedStrength >= 2 ? styles.show : "",
|
|
27
|
-
)}
|
|
28
|
-
/>
|
|
29
|
-
<Bar
|
|
30
|
-
className={cn(styles.good, remappedStrength >= 3 ? styles.show : "")}
|
|
31
|
-
/>
|
|
32
|
-
<Bar
|
|
33
|
-
className={cn(
|
|
34
|
-
styles.strong,
|
|
35
|
-
remappedStrength == 4 ? styles.show : "",
|
|
36
|
-
)}
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
export const PASSWORD_REGEX = {
|
|
4
|
-
ASCII_NO_SPACE: { ex: /^[!-~]+$/, score: 0.5 },
|
|
5
|
-
LOWERCASE: { ex: /[a-z]/, score: 0.5 },
|
|
6
|
-
UPPERCASE: { ex: /[A-Z]/, score: 1 },
|
|
7
|
-
DIGIT: { ex: /\d/, score: 1 },
|
|
8
|
-
SPECIAL: { ex: /[!@#$%^&*()_\-+=\[\]{};:'",.<>/?\\|`~]/, score: 1 },
|
|
9
|
-
NO_TRIPLE_REPEAT: { ex: /^(?!.*(.)\1\1).*$/, score: 1 },
|
|
10
|
-
} as const;
|
|
11
|
-
|
|
12
|
-
export type PasswordTest = keyof typeof PASSWORD_REGEX;
|
|
13
|
-
|
|
14
|
-
export const ALL_PASSWORD_TESTS: PasswordTest[] = [
|
|
15
|
-
"ASCII_NO_SPACE",
|
|
16
|
-
"DIGIT",
|
|
17
|
-
"LOWERCASE",
|
|
18
|
-
"NO_TRIPLE_REPEAT",
|
|
19
|
-
"SPECIAL",
|
|
20
|
-
"UPPERCASE",
|
|
21
|
-
];
|
|
22
|
-
export interface PasswordStrengthProps {
|
|
23
|
-
password?: string;
|
|
24
|
-
requiredTests?: PasswordTest[];
|
|
25
|
-
disableStrengthMeter?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Minimum length of the password when it should start checking,
|
|
28
|
-
* before reaching the minimum length the strength will always be 1
|
|
29
|
-
*/
|
|
30
|
-
minLength?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function usePasswordStrength({
|
|
34
|
-
password,
|
|
35
|
-
requiredTests = [],
|
|
36
|
-
disableStrengthMeter = true,
|
|
37
|
-
minLength = 8,
|
|
38
|
-
}: PasswordStrengthProps) {
|
|
39
|
-
const [strength, setStrength] = useState<number | null>(null);
|
|
40
|
-
const [testsPassed, setPassed] = useState<PasswordTest[]>([]);
|
|
41
|
-
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (!password) {
|
|
44
|
-
setStrength(null);
|
|
45
|
-
setPassed([]);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const results: PasswordTest[] = [];
|
|
50
|
-
|
|
51
|
-
for (const [key, regex] of Object.entries(PASSWORD_REGEX)) {
|
|
52
|
-
if (regex.ex.test(password)) results.push(key as PasswordTest);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
setPassed(results);
|
|
56
|
-
|
|
57
|
-
// REQUIRED TESTS GATE
|
|
58
|
-
const allRequiredPassed = results.every((test) =>
|
|
59
|
-
requiredTests.includes(test),
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
if (!allRequiredPassed || password.length < minLength) {
|
|
63
|
-
setStrength(1); // Weak
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Otherwise score by total passed tests
|
|
68
|
-
const totalScore = Object.entries(PASSWORD_REGEX).reduce(
|
|
69
|
-
(acc, [key, value]) =>
|
|
70
|
-
results.includes(key as PasswordTest) ? acc + value.score : acc,
|
|
71
|
-
0,
|
|
72
|
-
);
|
|
73
|
-
setStrength(totalScore);
|
|
74
|
-
}, [password, requiredTests]);
|
|
75
|
-
|
|
76
|
-
if (!disableStrengthMeter) return { strength, testsPassed };
|
|
77
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
.root {
|
|
2
|
-
--skeleton-color-main: var(--color-surface);
|
|
3
|
-
--skeleton-color-wave: color-mix(
|
|
4
|
-
in srgb,
|
|
5
|
-
var(--color-surface) 80%,
|
|
6
|
-
var(--color-primary) 10%
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
background-image: linear-gradient(
|
|
10
|
-
to right,
|
|
11
|
-
var(--skeleton-color-main) 0%,
|
|
12
|
-
var(--skeleton-color-wave) 50%,
|
|
13
|
-
var(--skeleton-color-main) 100%
|
|
14
|
-
);
|
|
15
|
-
background-size: 1000px 1000px;
|
|
16
|
-
background-repeat: repeat-x;
|
|
17
|
-
animation: throb 2s var(--transition-tf) infinite;
|
|
18
|
-
/* animation: wave 0.8s linear infinite forwards; */
|
|
19
|
-
border-radius: var(--shape-br-md);
|
|
20
|
-
}
|
|
21
|
-
.large {
|
|
22
|
-
font-size: 2rem;
|
|
23
|
-
}
|
|
24
|
-
.medium {
|
|
25
|
-
font-size: 1.2rem;
|
|
26
|
-
}
|
|
27
|
-
.small {
|
|
28
|
-
font-size: 0.75rem;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes wave {
|
|
32
|
-
0% {
|
|
33
|
-
background-position: 0% 0%;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
100% {
|
|
37
|
-
background-position: -200% 0%;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
@keyframes throb {
|
|
41
|
-
0% {
|
|
42
|
-
background: var(--color-surface);
|
|
43
|
-
}
|
|
44
|
-
50% {
|
|
45
|
-
background: color-mix(
|
|
46
|
-
in srgb,
|
|
47
|
-
var(--color-primary) 10%,
|
|
48
|
-
var(--color-surface) 100%
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
100% {
|
|
52
|
-
background: var(--color-surface);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, CSSProperties } from "react";
|
|
2
|
-
import styles from "./Skeleton.module.css";
|
|
3
|
-
import { cn } from "@studiocubics/utils";
|
|
4
|
-
export interface SkeletonProps extends ComponentProps<"span"> {
|
|
5
|
-
type?: "text" | "card";
|
|
6
|
-
size?: "small" | "medium" | "large";
|
|
7
|
-
width?: CSSProperties["width"];
|
|
8
|
-
height?: CSSProperties["height"];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function Skeleton(props: SkeletonProps) {
|
|
12
|
-
const {
|
|
13
|
-
className,
|
|
14
|
-
style,
|
|
15
|
-
type = "text",
|
|
16
|
-
size = "medium",
|
|
17
|
-
width = "100%",
|
|
18
|
-
height = "1.5em",
|
|
19
|
-
...rest
|
|
20
|
-
} = props;
|
|
21
|
-
return (
|
|
22
|
-
<span
|
|
23
|
-
className={cn(className, styles.root, styles[size], styles[type])}
|
|
24
|
-
style={{ width, height, ...style }}
|
|
25
|
-
{...rest}
|
|
26
|
-
></span>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { subscribe, dismiss, type Toast } from "./toast";
|
|
5
|
-
|
|
6
|
-
export function Toaster() {
|
|
7
|
-
const [toasts, setToasts] = useState<Toast[]>([]);
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
return () => {
|
|
11
|
-
subscribe(setToasts);
|
|
12
|
-
};
|
|
13
|
-
}, []);
|
|
14
|
-
|
|
15
|
-
if (toasts.length === 0) return null;
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div style={containerStyle}>
|
|
19
|
-
{toasts.map((t) => (
|
|
20
|
-
<div key={t.id} style={toastStyle}>
|
|
21
|
-
<span>{t.message}</span>
|
|
22
|
-
<button onClick={() => dismiss(t.id)} style={closeStyle}>
|
|
23
|
-
×
|
|
24
|
-
</button>
|
|
25
|
-
</div>
|
|
26
|
-
))}
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const containerStyle: React.CSSProperties = {
|
|
32
|
-
position: "fixed",
|
|
33
|
-
top: 16,
|
|
34
|
-
right: 16,
|
|
35
|
-
display: "flex",
|
|
36
|
-
flexDirection: "column",
|
|
37
|
-
gap: 8,
|
|
38
|
-
zIndex: 1000,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const toastStyle: React.CSSProperties = {
|
|
42
|
-
background: "#111",
|
|
43
|
-
color: "#fff",
|
|
44
|
-
padding: "12px 16px",
|
|
45
|
-
borderRadius: 6,
|
|
46
|
-
minWidth: 200,
|
|
47
|
-
display: "flex",
|
|
48
|
-
justifyContent: "space-between",
|
|
49
|
-
alignItems: "center",
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const closeStyle: React.CSSProperties = {
|
|
53
|
-
background: "transparent",
|
|
54
|
-
border: "none",
|
|
55
|
-
color: "#fff",
|
|
56
|
-
fontSize: 16,
|
|
57
|
-
cursor: "pointer",
|
|
58
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export type Toast = {
|
|
2
|
-
id: string;
|
|
3
|
-
message: string;
|
|
4
|
-
duration?: number;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
type Listener = (toasts: Toast[]) => void;
|
|
8
|
-
|
|
9
|
-
let toasts: Toast[] = [];
|
|
10
|
-
const listeners = new Set<Listener>();
|
|
11
|
-
|
|
12
|
-
function emit() {
|
|
13
|
-
listeners.forEach((l) => l(toasts));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function subscribe(listener: Listener) {
|
|
17
|
-
listeners.add(listener);
|
|
18
|
-
return () => listeners.delete(listener);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function toast(message: string, options?: { duration?: number }) {
|
|
22
|
-
const id = crypto.randomUUID();
|
|
23
|
-
|
|
24
|
-
const t: Required<Toast> = {
|
|
25
|
-
id,
|
|
26
|
-
message,
|
|
27
|
-
duration: options?.duration ?? 3000,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
toasts = [...toasts, t];
|
|
31
|
-
emit();
|
|
32
|
-
|
|
33
|
-
// Its a toast not a lecture!
|
|
34
|
-
if (t.duration <= 20000) {
|
|
35
|
-
setTimeout(() => {
|
|
36
|
-
dismiss(id);
|
|
37
|
-
}, t.duration);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function dismiss(id: string) {
|
|
42
|
-
toasts = toasts.filter((t) => t.id !== id);
|
|
43
|
-
emit();
|
|
44
|
-
}
|