@taiv/ui 1.15.0 → 2.0.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/dist/assets/assets.d.ts +12 -1
- package/dist/assets/assets.d.ts.map +1 -1
- package/dist/assets/assets.js +22 -16
- package/dist/assets/brand/taiv-favicon-dark.png +0 -0
- package/dist/assets/brand/taiv-favicon-light.png +0 -0
- package/dist/assets/brand/taiv-icon-black.svg +10 -0
- package/dist/assets/brand/taiv-icon-dark.svg +17 -0
- package/dist/assets/brand/taiv-icon-white.svg +17 -0
- package/dist/assets/brand/taiv-logo-black.svg +16 -0
- package/dist/assets/brand/taiv-logo-dark.svg +23 -0
- package/dist/assets/brand/taiv-logo-old.svg +1 -0
- package/dist/assets/brand/taiv-logo-purple.svg +16 -0
- package/dist/assets/brand/taiv-logo-white.svg +23 -0
- package/dist/assets/icons.d.ts +1 -1
- package/dist/assets/icons.d.ts.map +1 -1
- package/dist/assets/icons.js +57 -53
- package/dist/assets/index.d.ts +3 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/index.js +2 -0
- package/dist/components/Data/BigCalendar/BigCalendar.d.ts +26 -0
- package/dist/components/Data/BigCalendar/BigCalendar.d.ts.map +1 -0
- package/dist/components/Data/BigCalendar/BigCalendar.js +54 -0
- package/dist/components/Data/BigCalendar/BigCalendar.stories.d.ts +8 -0
- package/dist/components/Data/BigCalendar/BigCalendar.stories.d.ts.map +1 -0
- package/dist/components/Data/BigCalendar/BigCalendar.stories.js +77 -0
- package/dist/components/Data/Calendar/Calendar.d.ts +102 -0
- package/dist/components/Data/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Data/Calendar/Calendar.js +671 -0
- package/dist/components/Data/Calendar/Calendar.stories.d.ts +10 -0
- package/dist/components/Data/Calendar/Calendar.stories.d.ts.map +1 -0
- package/dist/components/Data/Calendar/Calendar.stories.js +87 -0
- package/dist/components/Data/MediaPill/MediaPill.d.ts +27 -0
- package/dist/components/Data/MediaPill/MediaPill.d.ts.map +1 -0
- package/dist/components/Data/MediaPill/MediaPill.js +53 -0
- package/dist/components/Data/MediaPill/MediaPill.stories.d.ts +10 -0
- package/dist/components/Data/MediaPill/MediaPill.stories.d.ts.map +1 -0
- package/dist/components/Data/MediaPill/MediaPill.stories.js +51 -0
- package/dist/components/Info/Avatar/Avatar.d.ts +9 -0
- package/dist/components/Info/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Info/Avatar/Avatar.js +36 -0
- package/dist/components/Info/Avatar/Avatar.stories.d.ts +9 -0
- package/dist/components/Info/Avatar/Avatar.stories.d.ts.map +1 -0
- package/dist/components/Info/Avatar/Avatar.stories.js +78 -0
- package/dist/components/Info/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/components/Info/Badge/Badge.stories.js +21 -6
- package/dist/components/Info/Badge/sizes.d.ts +10 -10
- package/dist/components/Info/Badge/sizes.js +16 -16
- package/dist/components/Info/Badge/variants.d.ts +4 -4
- package/dist/components/Info/Badge/variants.d.ts.map +1 -1
- package/dist/components/Info/Badge/variants.js +26 -13
- package/dist/components/Info/Drawer/Drawer.d.ts +24 -0
- package/dist/components/Info/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Info/Drawer/Drawer.js +44 -0
- package/dist/components/Info/Drawer/Drawer.stories.d.ts +10 -0
- package/dist/components/Info/Drawer/Drawer.stories.d.ts.map +1 -0
- package/dist/components/Info/Drawer/Drawer.stories.js +47 -0
- package/dist/components/Info/HoverCard/HoverCard.d.ts +16 -0
- package/dist/components/Info/HoverCard/HoverCard.d.ts.map +1 -0
- package/dist/components/Info/HoverCard/HoverCard.js +26 -0
- package/dist/components/Info/HoverCard/HoverCard.stories.d.ts +11 -0
- package/dist/components/Info/HoverCard/HoverCard.stories.d.ts.map +1 -0
- package/dist/components/Info/HoverCard/HoverCard.stories.js +86 -0
- package/dist/components/Info/HoverCard/HoverCardMenuItem.d.ts +12 -0
- package/dist/components/Info/HoverCard/HoverCardMenuItem.d.ts.map +1 -0
- package/dist/components/Info/HoverCard/HoverCardMenuItem.js +22 -0
- package/dist/components/Info/Indicator/Indicator.d.ts +3 -0
- package/dist/components/Info/Indicator/Indicator.d.ts.map +1 -0
- package/dist/components/Info/Indicator/Indicator.js +1 -0
- package/dist/components/Info/Indicator/Indicator.stories.d.ts +11 -0
- package/dist/components/Info/Indicator/Indicator.stories.d.ts.map +1 -0
- package/dist/components/Info/Indicator/Indicator.stories.js +123 -0
- package/dist/components/Info/InfoCard/InfoCard.d.ts +2 -2
- package/dist/components/Info/InfoCard/InfoCard.d.ts.map +1 -1
- package/dist/components/Info/InfoCard/InfoCard.js +5 -5
- package/dist/components/Info/MobileDrawer/MobileDrawer.d.ts +30 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.d.ts.map +1 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.js +52 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.stories.d.ts +9 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.stories.d.ts.map +1 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.stories.js +38 -0
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts +17 -1
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts.map +1 -1
- package/dist/components/Info/Modals/FormModal/FormModal.js +30 -12
- package/dist/components/Info/Modals/FormModalV2/FormModalV2.d.ts +60 -0
- package/dist/components/Info/Modals/FormModalV2/FormModalV2.d.ts.map +1 -0
- package/dist/components/Info/Modals/FormModalV2/FormModalV2.js +96 -0
- package/dist/components/Info/Modals/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Info/Modals/Modal/Modal.js +9 -1
- package/dist/components/Info/Modals/variants.d.ts +61 -41
- package/dist/components/Info/Modals/variants.d.ts.map +1 -1
- package/dist/components/Info/Modals/variants.js +58 -38
- package/dist/components/Info/Notifications/Notifications.stories.d.ts +1 -0
- package/dist/components/Info/Notifications/Notifications.stories.d.ts.map +1 -1
- package/dist/components/Info/Notifications/Notifications.stories.js +31 -0
- package/dist/components/Info/Notifications/variants.d.ts +25 -19
- package/dist/components/Info/Notifications/variants.d.ts.map +1 -1
- package/dist/components/Info/Notifications/variants.js +30 -24
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.d.ts +37 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.d.ts.map +1 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.js +17 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.stories.d.ts +7 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.stories.d.ts.map +1 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.stories.js +26 -0
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.d.ts +1 -1
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.js +9 -3
- package/dist/components/Info/Tooltips/Popover/Popover.d.ts +16 -0
- package/dist/components/Info/Tooltips/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Info/Tooltips/Popover/Popover.js +32 -0
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.d.ts +5 -1
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.js +10 -8
- package/dist/components/Inputs/Buttons/Button/Button.d.ts +3 -1
- package/dist/components/Inputs/Buttons/Button/Button.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.js +38 -5
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts +1 -0
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.stories.js +105 -79
- package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts +7 -2
- package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/IconButton.js +35 -11
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts +1 -0
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.js +100 -74
- package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts +15 -0
- package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/sizes.js +3 -0
- package/dist/components/Inputs/Buttons/shared/variants.d.ts +399 -164
- package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/shared/variants.js +353 -143
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.d.ts +40 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.d.ts.map +1 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.js +139 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.stories.d.ts +13 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.stories.d.ts.map +1 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.stories.js +75 -0
- package/dist/components/Inputs/ColorSwatch/ColorSwatch.d.ts +27 -0
- package/dist/components/Inputs/ColorSwatch/ColorSwatch.d.ts.map +1 -0
- package/dist/components/Inputs/ColorSwatch/ColorSwatch.js +46 -0
- package/dist/components/Inputs/Controls/DaysOfWeek/DaysOfWeek.d.ts +32 -0
- package/dist/components/Inputs/Controls/DaysOfWeek/DaysOfWeek.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/DaysOfWeek/DaysOfWeek.js +92 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.d.ts +11 -8
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.js +20 -12
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts +25 -11
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/Toggle/Toggle.js +67 -20
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts +1 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.js +86 -69
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.js +23 -7
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.d.ts +12 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.js +87 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.stories.d.ts +13 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.stories.js +239 -0
- package/dist/components/Inputs/Dates/TimeInput/TimeInput.d.ts +19 -0
- package/dist/components/Inputs/Dates/TimeInput/TimeInput.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/TimeInput/TimeInput.js +51 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.js +8 -1
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts +2 -2
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.js +76 -57
- package/dist/components/Inputs/Dropdowns/Select/Select.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/Select/Select.js +5 -3
- package/dist/components/Inputs/Dropzone/Dropzone.d.ts +23 -0
- package/dist/components/Inputs/Dropzone/Dropzone.d.ts.map +1 -0
- package/dist/components/Inputs/Dropzone/Dropzone.js +44 -0
- package/dist/components/Inputs/Dropzone/Dropzone.stories.d.ts +12 -0
- package/dist/components/Inputs/Dropzone/Dropzone.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dropzone/Dropzone.stories.js +114 -0
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.js +4 -1
- package/dist/components/Inputs/TextInputs/NumberInput/ResponsiveNumberInput.d.ts +46 -0
- package/dist/components/Inputs/TextInputs/NumberInput/ResponsiveNumberInput.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/NumberInput/ResponsiveNumberInput.js +60 -0
- package/dist/components/Layout/Accordion/Accordion.d.ts +16 -0
- package/dist/components/Layout/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Layout/Accordion/Accordion.js +63 -0
- package/dist/components/Layout/Accordion/Accordion.stories.d.ts +11 -0
- package/dist/components/Layout/Accordion/Accordion.stories.d.ts.map +1 -0
- package/dist/components/Layout/Accordion/Accordion.stories.js +148 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.d.ts +20 -5
- package/dist/components/Layout/AutoGrid/AutoGrid.d.ts.map +1 -1
- package/dist/components/Layout/AutoGrid/AutoGrid.js +51 -3
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.d.ts +1 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.d.ts.map +1 -1
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.js +39 -29
- package/dist/components/Layout/BottomActionBar/BottomActionBar.d.ts +40 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.d.ts.map +1 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.js +79 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.stories.d.ts +10 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.stories.d.ts.map +1 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.stories.js +102 -0
- package/dist/components/Layout/Card/Card.d.ts +1 -1
- package/dist/components/Layout/Card/Card.d.ts.map +1 -1
- package/dist/components/Layout/Container/Container.d.ts +3 -0
- package/dist/components/Layout/Container/Container.d.ts.map +1 -0
- package/dist/components/Layout/Container/Container.js +1 -0
- package/dist/components/Layout/Container/Container.stories.d.ts +8 -0
- package/dist/components/Layout/Container/Container.stories.d.ts.map +1 -0
- package/dist/components/Layout/Container/Container.stories.js +52 -0
- package/dist/components/Layout/DataState/DataState.d.ts +34 -0
- package/dist/components/Layout/DataState/DataState.d.ts.map +1 -0
- package/dist/components/Layout/DataState/DataState.js +22 -0
- package/dist/components/Layout/DataState/DataState.stories.d.ts +11 -0
- package/dist/components/Layout/DataState/DataState.stories.d.ts.map +1 -0
- package/dist/components/Layout/DataState/DataState.stories.js +38 -0
- package/dist/components/Layout/Divider/Divider.d.ts.map +1 -1
- package/dist/components/Layout/Divider/Divider.js +4 -2
- package/dist/components/Layout/Group/Group.d.ts +1 -1
- package/dist/components/Layout/Group/Group.d.ts.map +1 -1
- package/dist/components/Layout/Loader/Loader.d.ts +1 -1
- package/dist/components/Layout/Loader/Loader.d.ts.map +1 -1
- package/dist/components/Layout/Loader/Loader.js +3 -2
- package/dist/components/Layout/Navbar/Navbar.d.ts +15 -0
- package/dist/components/Layout/Navbar/Navbar.d.ts.map +1 -0
- package/dist/components/Layout/Navbar/Navbar.js +20 -0
- package/dist/components/Layout/Navbar/Navbar.stories.d.ts +9 -0
- package/dist/components/Layout/Navbar/Navbar.stories.d.ts.map +1 -0
- package/dist/components/Layout/Navbar/Navbar.stories.js +98 -0
- package/dist/components/Layout/Page/Page.d.ts +13 -0
- package/dist/components/Layout/Page/Page.d.ts.map +1 -0
- package/dist/components/Layout/Page/Page.js +13 -0
- package/dist/components/Layout/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Layout/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Layout/Pagination/Pagination.js +53 -0
- package/dist/components/Layout/Pagination/Pagination.stories.d.ts +10 -0
- package/dist/components/Layout/Pagination/Pagination.stories.d.ts.map +1 -0
- package/dist/components/Layout/Pagination/Pagination.stories.js +76 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.d.ts +3 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.js +1 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.stories.d.ts +8 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.stories.d.ts.map +1 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.stories.js +62 -0
- package/dist/components/Layout/Tabs/Tabs.d.ts +16 -5
- package/dist/components/Layout/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.js +53 -18
- package/dist/components/Layout/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.stories.js +39 -39
- package/dist/components/Layout/VirtualGrid/VirtualGrid.d.ts +63 -0
- package/dist/components/Layout/VirtualGrid/VirtualGrid.d.ts.map +1 -0
- package/dist/components/Layout/VirtualGrid/VirtualGrid.js +159 -0
- package/dist/components/Misc/Burger/Burger.d.ts +6 -0
- package/dist/components/Misc/Burger/Burger.d.ts.map +1 -0
- package/dist/components/Misc/Burger/Burger.js +7 -0
- package/dist/components/Misc/Burger/Burger.stories.d.ts +10 -0
- package/dist/components/Misc/Burger/Burger.stories.d.ts.map +1 -0
- package/dist/components/Misc/Burger/Burger.stories.js +86 -0
- package/dist/components/Misc/Carousel/Carousel.d.ts +32 -0
- package/dist/components/Misc/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/Misc/Carousel/Carousel.js +16 -0
- package/dist/components/Misc/DragHandle/DragHandle.d.ts +19 -0
- package/dist/components/Misc/DragHandle/DragHandle.d.ts.map +1 -0
- package/dist/components/Misc/DragHandle/DragHandle.js +39 -0
- package/dist/components/Misc/DragHandle/DragHandle.stories.d.ts +9 -0
- package/dist/components/Misc/DragHandle/DragHandle.stories.d.ts.map +1 -0
- package/dist/components/Misc/DragHandle/DragHandle.stories.js +54 -0
- package/dist/components/Misc/FAB/FAB.d.ts +54 -0
- package/dist/components/Misc/FAB/FAB.d.ts.map +1 -0
- package/dist/components/Misc/FAB/FAB.js +53 -0
- package/dist/components/Misc/FAB/FAB.stories.d.ts +10 -0
- package/dist/components/Misc/FAB/FAB.stories.d.ts.map +1 -0
- package/dist/components/Misc/FAB/FAB.stories.js +100 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.d.ts +50 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.d.ts.map +1 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.js +40 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.stories.d.ts +9 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.stories.d.ts.map +1 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.stories.js +53 -0
- package/dist/components/Misc/HoverAction/HoverAction.d.ts +50 -0
- package/dist/components/Misc/HoverAction/HoverAction.d.ts.map +1 -0
- package/dist/components/Misc/HoverAction/HoverAction.js +61 -0
- package/dist/components/Misc/HoverAction/HoverAction.stories.d.ts +12 -0
- package/dist/components/Misc/HoverAction/HoverAction.stories.d.ts.map +1 -0
- package/dist/components/Misc/HoverAction/HoverAction.stories.js +96 -0
- package/dist/components/Misc/IconBadge/IconBadge.d.ts.map +1 -1
- package/dist/components/Misc/IconBadge/IconBadge.js +8 -6
- package/dist/components/Misc/Image/Image.d.ts +3 -0
- package/dist/components/Misc/Image/Image.d.ts.map +1 -0
- package/dist/components/Misc/Image/Image.js +1 -0
- package/dist/components/Misc/Image/Image.stories.d.ts +11 -0
- package/dist/components/Misc/Image/Image.stories.d.ts.map +1 -0
- package/dist/components/Misc/Image/Image.stories.js +63 -0
- package/dist/components/Misc/Kbd/Kbd.d.ts +6 -0
- package/dist/components/Misc/Kbd/Kbd.d.ts.map +1 -0
- package/dist/components/Misc/Kbd/Kbd.js +16 -0
- package/dist/components/Misc/Kbd/Kbd.stories.d.ts +9 -0
- package/dist/components/Misc/Kbd/Kbd.stories.d.ts.map +1 -0
- package/dist/components/Misc/Kbd/Kbd.stories.js +52 -0
- package/dist/components/Misc/Menu/Menu.d.ts +17 -0
- package/dist/components/Misc/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Misc/Menu/Menu.js +52 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.d.ts +42 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.d.ts.map +1 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.js +110 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.stories.d.ts +11 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.stories.d.ts.map +1 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.stories.js +112 -0
- package/dist/components/Misc/Picker/Picker.d.ts +62 -0
- package/dist/components/Misc/Picker/Picker.d.ts.map +1 -0
- package/dist/components/Misc/Picker/Picker.js +111 -0
- package/dist/components/Misc/Picker/Picker.stories.d.ts +14 -0
- package/dist/components/Misc/Picker/Picker.stories.d.ts.map +1 -0
- package/dist/components/Misc/Picker/Picker.stories.js +154 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.d.ts +38 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.d.ts.map +1 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.js +70 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.stories.d.ts +11 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.stories.d.ts.map +1 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.stories.js +84 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.d.ts +26 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.d.ts.map +1 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.js +41 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.stories.d.ts +10 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.stories.d.ts.map +1 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.stories.js +48 -0
- package/dist/components/Misc/Stepper/Step.stories.d.ts +118 -118
- package/dist/components/Misc/Stepper/variants.d.ts +1 -1
- package/dist/components/Misc/Timeline/Timeline.d.ts +18 -0
- package/dist/components/Misc/Timeline/Timeline.d.ts.map +1 -0
- package/dist/components/Misc/Timeline/Timeline.js +38 -0
- package/dist/components/Misc/Timeline/Timeline.stories.d.ts +8 -0
- package/dist/components/Misc/Timeline/Timeline.stories.d.ts.map +1 -0
- package/dist/components/Misc/Timeline/Timeline.stories.js +54 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.d.ts +35 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.d.ts.map +1 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.js +112 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.stories.d.ts +11 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.stories.d.ts.map +1 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.stories.js +48 -0
- package/dist/components/index.d.ts +148 -66
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +110 -68
- package/dist/constants/colors.d.ts +117 -91
- package/dist/constants/colors.d.ts.map +1 -1
- package/dist/constants/colors.js +56 -43
- package/dist/constants/font.d.ts +4 -4
- package/dist/constants/font.js +2 -2
- package/dist/hooks/index.d.ts +9 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +7 -1
- package/dist/hooks/useConfirmationModal.d.ts.map +1 -1
- package/dist/hooks/useConfirmationModal.js +20 -1
- package/dist/hooks/useDisclosure.d.ts +11 -0
- package/dist/hooks/useDisclosure.d.ts.map +1 -0
- package/dist/hooks/useDisclosure.js +10 -0
- package/dist/hooks/useHeadroom.d.ts +18 -0
- package/dist/hooks/useHeadroom.d.ts.map +1 -0
- package/dist/hooks/useHeadroom.js +17 -0
- package/dist/hooks/useInfoModal.d.ts.map +1 -1
- package/dist/hooks/useInfoModal.js +13 -1
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +1 -0
- package/dist/hooks/useNotifications.d.ts +39 -7
- package/dist/hooks/useNotifications.d.ts.map +1 -1
- package/dist/hooks/useNotifications.js +108 -5
- package/dist/hooks/usePagination.d.ts +11 -0
- package/dist/hooks/usePagination.d.ts.map +1 -0
- package/dist/hooks/usePagination.js +2 -0
- package/dist/hooks/useScrollLock.d.ts +21 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -0
- package/dist/hooks/useScrollLock.js +20 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/styles/iosInputZoomFix.d.ts +31 -0
- package/dist/styles/iosInputZoomFix.d.ts.map +1 -0
- package/dist/styles/iosInputZoomFix.js +135 -0
- package/dist/utils/bytes.d.ts +10 -0
- package/dist/utils/bytes.d.ts.map +1 -0
- package/dist/utils/bytes.js +17 -0
- package/dist/utils/datetime.d.ts +18 -0
- package/dist/utils/datetime.d.ts.map +1 -0
- package/dist/utils/datetime.js +42 -0
- package/dist/utils/duration.d.ts +17 -0
- package/dist/utils/duration.d.ts.map +1 -0
- package/dist/utils/duration.js +30 -0
- package/dist/utils/index.d.ts +8 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +7 -2
- package/dist/utils/sort.d.ts +44 -0
- package/dist/utils/sort.d.ts.map +1 -0
- package/dist/utils/sort.js +53 -0
- package/dist/utils/string.d.ts +22 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +25 -0
- package/package.json +26 -2
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Tabs } from './Tabs';
|
|
3
|
-
import { Stack } from '../Stack/Stack';
|
|
4
2
|
import { primary } from '../../../constants/colors';
|
|
5
3
|
import { spacing } from '../../../constants/spacing';
|
|
6
4
|
import { Text } from '../../Typography/Text/Text';
|
|
5
|
+
import { Stack } from '../Stack/Stack';
|
|
6
|
+
import { Tabs } from './Tabs';
|
|
7
7
|
const meta = {
|
|
8
|
-
title: 'Components/Layout/Tabs',
|
|
9
|
-
component: Tabs,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'centered',
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component: "[View Mantine Docs](https://v6.mantine.dev/core/tabs/)\n\nThe Tabs component organizes content into sections that users can switch between. It extends Mantine v6's Tabs component with custom styling and variant options.",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
8
|
argTypes: {
|
|
19
9
|
children: {
|
|
20
10
|
control: false,
|
|
@@ -23,26 +13,10 @@ const meta = {
|
|
|
23
13
|
type: { summary: 'ReactNode' },
|
|
24
14
|
},
|
|
25
15
|
},
|
|
26
|
-
variant: {
|
|
27
|
-
control: { type: 'select' },
|
|
28
|
-
options: ['default', 'outline', 'pills'],
|
|
29
|
-
description: 'The preset variant to use for styling',
|
|
30
|
-
table: {
|
|
31
|
-
type: { summary: "'default' | 'outline' | 'pills'" },
|
|
32
|
-
defaultValue: { summary: "'default'" },
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
16
|
defaultValue: {
|
|
36
17
|
control: { type: 'select' },
|
|
37
|
-
options: ['overview', 'details', 'settings'],
|
|
38
18
|
description: 'The default tab when the component is mounted',
|
|
39
|
-
|
|
40
|
-
type: { summary: 'string' },
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
value: {
|
|
44
|
-
control: { type: 'text' },
|
|
45
|
-
description: 'The currently active tab value',
|
|
19
|
+
options: ['overview', 'details', 'settings'],
|
|
46
20
|
table: {
|
|
47
21
|
type: { summary: 'string' },
|
|
48
22
|
},
|
|
@@ -61,44 +35,70 @@ const meta = {
|
|
|
61
35
|
type: { summary: 'Record<string, CSSObject>' },
|
|
62
36
|
},
|
|
63
37
|
},
|
|
38
|
+
value: {
|
|
39
|
+
control: { type: 'text' },
|
|
40
|
+
description: 'The currently active tab value',
|
|
41
|
+
table: {
|
|
42
|
+
type: { summary: 'string' },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
variant: {
|
|
46
|
+
control: { type: 'select' },
|
|
47
|
+
description: 'The preset variant to use for styling',
|
|
48
|
+
options: ['default', 'outline', 'pills'],
|
|
49
|
+
table: {
|
|
50
|
+
defaultValue: { summary: "'default'" },
|
|
51
|
+
type: { summary: "'default' | 'outline' | 'pills'" },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
64
54
|
},
|
|
55
|
+
component: Tabs,
|
|
56
|
+
parameters: {
|
|
57
|
+
docs: {
|
|
58
|
+
description: {
|
|
59
|
+
component: "[View Mantine Docs](https://v6.mantine.dev/core/tabs/)\n\nThe Tabs component organizes content into sections that users can switch between. It extends Mantine v6's Tabs component with custom styling and variant options.",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
layout: 'centered',
|
|
63
|
+
},
|
|
64
|
+
title: 'Components/Layout/Tabs',
|
|
65
65
|
};
|
|
66
66
|
export default meta;
|
|
67
67
|
export const Default = {
|
|
68
68
|
args: {
|
|
69
69
|
children: undefined,
|
|
70
|
-
variant: 'default',
|
|
71
70
|
defaultValue: 'overview',
|
|
71
|
+
variant: 'default',
|
|
72
72
|
},
|
|
73
73
|
decorators: [
|
|
74
74
|
(Story) => (_jsx("div", { style: { width: '600px' }, children: _jsx(Story, {}) })),
|
|
75
75
|
],
|
|
76
|
-
render: (args) => (_jsxs(Tabs, { ...args, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value:
|
|
76
|
+
render: (args) => (_jsxs(Tabs, { ...args, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: 'overview', children: "Overview" }), _jsx(Tabs.Tab, { value: 'details', children: "Details" }), _jsx(Tabs.Tab, { value: 'settings', children: "Settings" })] }), _jsx(Tabs.Panel, { mt: spacing.lg, value: 'overview', children: _jsx(Text, { variant: 'subtle', children: "This is the tab panel for Overview" }) }), _jsx(Tabs.Panel, { mt: spacing.lg, value: 'details', children: _jsx(Text, { variant: 'subtle', children: "This is the tab panel for Details" }) }), _jsx(Tabs.Panel, { mt: spacing.lg, value: 'settings', children: _jsx(Text, { variant: 'subtle', children: "This is the tab panel for Settings" }) })] })),
|
|
77
77
|
};
|
|
78
78
|
export const Variants = {
|
|
79
|
-
render: () => (_jsxs(Stack, {
|
|
79
|
+
render: () => (_jsxs(Stack, { py: spacing.xl, spacing: '48px', sx: { width: '600px' }, children: [_jsx(Tabs, { defaultValue: 'overview', variant: 'default', children: _jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: 'overview', children: "Default" }), _jsx(Tabs.Tab, { value: 'details', children: "Tab 2" }), _jsx(Tabs.Tab, { value: 'settings', children: "Tab 3" })] }) }), _jsx(Tabs, { defaultValue: 'overview', variant: 'outline', children: _jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: 'overview', children: "Outline" }), _jsx(Tabs.Tab, { value: 'details', children: "Tab 2" }), _jsx(Tabs.Tab, { value: 'settings', children: "Tab 3" })] }) }), _jsx(Tabs, { defaultValue: 'overview', variant: 'pills', children: _jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: 'overview', children: "Pills" }), _jsx(Tabs.Tab, { value: 'details', children: "Tab 2" }), _jsx(Tabs.Tab, { value: 'settings', children: "Tab 3" })] }) })] })),
|
|
80
80
|
};
|
|
81
81
|
export const CustomStyling = {
|
|
82
82
|
args: {
|
|
83
83
|
defaultValue: 'overview',
|
|
84
84
|
styles: {
|
|
85
|
+
panel: {
|
|
86
|
+
color: 'white',
|
|
87
|
+
},
|
|
85
88
|
root: {
|
|
86
89
|
background: primary[200],
|
|
87
|
-
padding: '20px',
|
|
88
90
|
borderRadius: '12px',
|
|
91
|
+
padding: '20px',
|
|
89
92
|
},
|
|
90
93
|
tab: {
|
|
91
|
-
color: 'white',
|
|
92
94
|
'&:hover': {
|
|
95
|
+
backgroundColor: primary[200],
|
|
93
96
|
color: 'white',
|
|
94
|
-
backgroundColor: primary[300],
|
|
95
97
|
},
|
|
96
98
|
'&[data-active]': {
|
|
97
|
-
color: 'white',
|
|
98
99
|
backgroundColor: primary[100],
|
|
100
|
+
color: 'white',
|
|
99
101
|
},
|
|
100
|
-
},
|
|
101
|
-
panel: {
|
|
102
102
|
color: 'white',
|
|
103
103
|
},
|
|
104
104
|
},
|
|
@@ -106,7 +106,6 @@ export const CustomStyling = {
|
|
|
106
106
|
decorators: [
|
|
107
107
|
(Story) => (_jsx("div", { style: { width: '600px' }, children: _jsx(Story, {}) })),
|
|
108
108
|
],
|
|
109
|
-
render: (args) => (_jsxs(Tabs, { variant: "pills", ...args, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: "overview", children: "Overview" }), _jsx(Tabs.Tab, { value: "details", children: "Details" })] }), _jsx(Tabs.Panel, { mt: spacing.lg, value: "overview", children: "Overview" }), _jsx(Tabs.Panel, { mt: spacing.lg, value: "details", children: "Details" })] })),
|
|
110
109
|
parameters: {
|
|
111
110
|
docs: {
|
|
112
111
|
source: {
|
|
@@ -138,4 +137,5 @@ export const CustomStyling = {
|
|
|
138
137
|
},
|
|
139
138
|
},
|
|
140
139
|
},
|
|
140
|
+
render: (args) => (_jsxs(Tabs, { variant: 'pills', ...args, children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Tab, { value: 'overview', children: "Overview" }), _jsx(Tabs.Tab, { value: 'details', children: "Details" })] }), _jsx(Tabs.Panel, { mt: spacing.lg, value: 'overview', children: "Overview" }), _jsx(Tabs.Panel, { mt: spacing.lg, value: 'details', children: "Details" })] })),
|
|
141
141
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { spacing as spacingTokens } from '../../../constants/spacing';
|
|
3
|
+
import type { ResponsiveCols } from '../AutoGrid/AutoGrid';
|
|
4
|
+
type SpacingToken = keyof typeof spacingTokens;
|
|
5
|
+
export interface VirtualGridProps<T> {
|
|
6
|
+
/** Items to render. */
|
|
7
|
+
items: T[];
|
|
8
|
+
/**
|
|
9
|
+
* Stable key for each item. Applied to virtuoso's `computeItemKey` so
|
|
10
|
+
* cells keep their identity (and measured height) when items shift around
|
|
11
|
+
* — sort changes, filter updates, etc.
|
|
12
|
+
*/
|
|
13
|
+
getKey: (item: T, index: number) => string;
|
|
14
|
+
/** Render function for each item. */
|
|
15
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Number of columns. Accepts a number or a responsive map matching
|
|
18
|
+
* `AutoGrid`'s `ResponsiveCols` shape. `1` switches to the list-style
|
|
19
|
+
* virtuoso (`<Virtuoso>`); larger values use `<VirtuosoGrid>` with a
|
|
20
|
+
* CSS-grid container. Defaults to `1`.
|
|
21
|
+
*/
|
|
22
|
+
cols?: number | ResponsiveCols;
|
|
23
|
+
/**
|
|
24
|
+
* Spacing between cells in px or a `@taiv/ui/constants` spacing token name
|
|
25
|
+
* (e.g. `'lg'`). Applied as a CSS-grid gap for multi-col layouts, or as
|
|
26
|
+
* bottom padding inside each list cell for cols=1.
|
|
27
|
+
*/
|
|
28
|
+
gap?: SpacingToken | number;
|
|
29
|
+
/** Container style. */
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
/** Container className. */
|
|
32
|
+
className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Optional callback when the visible item range changes. Useful for
|
|
35
|
+
* downstream "infinite load" hooks. Receives flat-item indices.
|
|
36
|
+
*/
|
|
37
|
+
onItemsRendered?: (range: {
|
|
38
|
+
startIndex: number;
|
|
39
|
+
stopIndex: number;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Windowed grid primitive — renders only the items currently in (or near)
|
|
44
|
+
* the viewport. Auto-measures each cell's natural height via
|
|
45
|
+
* `react-virtuoso`, so consumers don't pick magic-number `rowHeight`s per
|
|
46
|
+
* breakpoint per card type. Same responsive `cols` and gap-token API as
|
|
47
|
+
* `AutoGrid`.
|
|
48
|
+
*
|
|
49
|
+
* Behavior:
|
|
50
|
+
* - `cols=1` → `<Virtuoso>` (single-column list). Each item takes whatever
|
|
51
|
+
* height it renders at.
|
|
52
|
+
* - `cols>1` → `<VirtuosoGrid>` with a CSS-grid container. Cells reserve
|
|
53
|
+
* equal column width; the row height is whatever the tallest cell in
|
|
54
|
+
* that row needs.
|
|
55
|
+
*
|
|
56
|
+
* Use this for any list where the rendered count can reach the hundreds —
|
|
57
|
+
* library grids, rotation pools, picker results, etc. For short lists
|
|
58
|
+
* (under ~50 cells) prefer `AutoGrid`: native CSS-grid is simpler and has
|
|
59
|
+
* no measurement overhead.
|
|
60
|
+
*/
|
|
61
|
+
export declare function VirtualGrid<T>({ items, getKey, renderItem, cols, gap, style, className, onItemsRendered, }: VirtualGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=VirtualGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/VirtualGrid/VirtualGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,KAAK,YAAY,GAAG,MAAM,OAAO,aAAa,CAAC;AAE/C,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,uBAAuB;IACvB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX;;;;OAIG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,qCAAqC;IACrC,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IACxD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IAC/B;;;;OAIG;IACH,GAAG,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC5B,uBAAuB;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9E;AAmFD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC7B,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAQ,EACR,GAAO,EACP,KAAK,EACL,SAAS,EACT,eAAe,GAChB,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CAkHrB"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
|
+
import { Virtuoso, VirtuosoGrid } from 'react-virtuoso';
|
|
4
|
+
import { breakpoints } from '../../../constants/breakpoints';
|
|
5
|
+
import { spacing as spacingTokens } from '../../../constants/spacing';
|
|
6
|
+
/**
|
|
7
|
+
* Resolve responsive `cols` against the current window width — matches the
|
|
8
|
+
* AutoGrid/Mantine media-query model so consumers using `useScreenSize()` +
|
|
9
|
+
* a number, or a responsive map directly, both land on the same bucket.
|
|
10
|
+
*/
|
|
11
|
+
const resolveCols = (cols, windowWidth) => {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
13
|
+
if (typeof cols === 'number')
|
|
14
|
+
return Math.max(1, Math.floor(cols));
|
|
15
|
+
const filled = {
|
|
16
|
+
base: (_a = cols.base) !== null && _a !== void 0 ? _a : 1,
|
|
17
|
+
sm: (_c = (_b = cols.sm) !== null && _b !== void 0 ? _b : cols.base) !== null && _c !== void 0 ? _c : 1,
|
|
18
|
+
md: (_f = (_e = (_d = cols.md) !== null && _d !== void 0 ? _d : cols.sm) !== null && _e !== void 0 ? _e : cols.base) !== null && _f !== void 0 ? _f : 1,
|
|
19
|
+
lg: (_k = (_j = (_h = (_g = cols.lg) !== null && _g !== void 0 ? _g : cols.md) !== null && _h !== void 0 ? _h : cols.sm) !== null && _j !== void 0 ? _j : cols.base) !== null && _k !== void 0 ? _k : 1,
|
|
20
|
+
xl: (_q = (_p = (_o = (_m = (_l = cols.xl) !== null && _l !== void 0 ? _l : cols.lg) !== null && _m !== void 0 ? _m : cols.md) !== null && _o !== void 0 ? _o : cols.sm) !== null && _p !== void 0 ? _p : cols.base) !== null && _q !== void 0 ? _q : 1,
|
|
21
|
+
};
|
|
22
|
+
if (windowWidth >= breakpoints.DESKTOP)
|
|
23
|
+
return filled.xl;
|
|
24
|
+
if (windowWidth >= breakpoints.LAPTOP)
|
|
25
|
+
return filled.lg;
|
|
26
|
+
if (windowWidth >= breakpoints.TABLET)
|
|
27
|
+
return filled.md;
|
|
28
|
+
if (windowWidth >= breakpoints.MOBILE)
|
|
29
|
+
return filled.sm;
|
|
30
|
+
return filled.base;
|
|
31
|
+
};
|
|
32
|
+
/** Resolve a gap value (token name or px) to a numeric pixel value. */
|
|
33
|
+
const resolveGap = (gap) => {
|
|
34
|
+
if (gap == null)
|
|
35
|
+
return 0;
|
|
36
|
+
if (typeof gap === 'number')
|
|
37
|
+
return gap;
|
|
38
|
+
const value = spacingTokens[gap];
|
|
39
|
+
if (typeof value !== 'string')
|
|
40
|
+
return 0;
|
|
41
|
+
const parsed = parseInt(value, 10);
|
|
42
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Walk the ancestor chain looking for the nearest element that scrolls —
|
|
46
|
+
* `overflow-y: auto | scroll`. When found, we hand it to virtuoso as its
|
|
47
|
+
* `customScrollParent`, so the drawer/modal's existing scroll IS the
|
|
48
|
+
* virtualization scroll (single scroll, no double-scroll fight). When not
|
|
49
|
+
* found, the page itself is the scroller and virtuoso runs in window-scroll
|
|
50
|
+
* mode (library, rotation pages) — see `useWindowScroll` below.
|
|
51
|
+
*/
|
|
52
|
+
const findScrollableAncestor = (el) => {
|
|
53
|
+
let p = el.parentElement;
|
|
54
|
+
while (p && p !== document.body) {
|
|
55
|
+
const overflowY = window.getComputedStyle(p).overflowY;
|
|
56
|
+
if (overflowY === 'auto' || overflowY === 'scroll')
|
|
57
|
+
return p;
|
|
58
|
+
p = p.parentElement;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the nearest scrollable ancestor synchronously after mount but
|
|
64
|
+
* before paint. Critical: virtuoso commits to a scroll strategy on its
|
|
65
|
+
* first render — if we hand it `customScrollParent=undefined` initially
|
|
66
|
+
* (because `useEffect` runs post-paint), it picks window-scroll and never
|
|
67
|
+
* re-attaches when the ancestor arrives a render later. Symptom: pickers
|
|
68
|
+
* inside modals/drawers render only the first 1–2 items.
|
|
69
|
+
*
|
|
70
|
+
* Returning `{ resolved }` lets the caller hold off mounting virtuoso
|
|
71
|
+
* until we know what to pass — so virtuoso always mounts exactly once
|
|
72
|
+
* with the correct prop.
|
|
73
|
+
*/
|
|
74
|
+
const useScrollableAncestor = (containerRef) => {
|
|
75
|
+
const [state, setState] = useState({ resolved: false, ancestor: null });
|
|
76
|
+
useLayoutEffect(() => {
|
|
77
|
+
const el = containerRef.current;
|
|
78
|
+
setState({
|
|
79
|
+
resolved: true,
|
|
80
|
+
ancestor: el ? findScrollableAncestor(el) : null,
|
|
81
|
+
});
|
|
82
|
+
}, [containerRef]);
|
|
83
|
+
return state;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Windowed grid primitive — renders only the items currently in (or near)
|
|
87
|
+
* the viewport. Auto-measures each cell's natural height via
|
|
88
|
+
* `react-virtuoso`, so consumers don't pick magic-number `rowHeight`s per
|
|
89
|
+
* breakpoint per card type. Same responsive `cols` and gap-token API as
|
|
90
|
+
* `AutoGrid`.
|
|
91
|
+
*
|
|
92
|
+
* Behavior:
|
|
93
|
+
* - `cols=1` → `<Virtuoso>` (single-column list). Each item takes whatever
|
|
94
|
+
* height it renders at.
|
|
95
|
+
* - `cols>1` → `<VirtuosoGrid>` with a CSS-grid container. Cells reserve
|
|
96
|
+
* equal column width; the row height is whatever the tallest cell in
|
|
97
|
+
* that row needs.
|
|
98
|
+
*
|
|
99
|
+
* Use this for any list where the rendered count can reach the hundreds —
|
|
100
|
+
* library grids, rotation pools, picker results, etc. For short lists
|
|
101
|
+
* (under ~50 cells) prefer `AutoGrid`: native CSS-grid is simpler and has
|
|
102
|
+
* no measurement overhead.
|
|
103
|
+
*/
|
|
104
|
+
export function VirtualGrid({ items, getKey, renderItem, cols = 1, gap = 0, style, className, onItemsRendered, }) {
|
|
105
|
+
const containerRef = useRef(null);
|
|
106
|
+
const { resolved: ancestorResolved, ancestor: scrollAncestor } = useScrollableAncestor(containerRef);
|
|
107
|
+
// Two scroll modes, decided by whether a scrollable ancestor exists:
|
|
108
|
+
// - ancestor found (drawer/modal body) → hand it to virtuoso as
|
|
109
|
+
// `customScrollParent`; the ancestor's scrollbar drives virtualization.
|
|
110
|
+
// - no ancestor (full pages) → the page/window is the scroller, so run
|
|
111
|
+
// virtuoso in `useWindowScroll` mode. The grid then participates in the
|
|
112
|
+
// single document scroll instead of carving out its own internal
|
|
113
|
+
// scrollbar (which would nest a second scroll inside the page scroll).
|
|
114
|
+
const usesAncestorScroll = scrollAncestor !== null;
|
|
115
|
+
const [windowWidth, setWindowWidth] = useState(() => typeof window !== 'undefined' ? window.innerWidth : 0);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
const onResize = () => setWindowWidth(window.innerWidth);
|
|
118
|
+
window.addEventListener('resize', onResize);
|
|
119
|
+
return () => window.removeEventListener('resize', onResize);
|
|
120
|
+
}, []);
|
|
121
|
+
const gapPx = useMemo(() => resolveGap(gap), [gap]);
|
|
122
|
+
const colCount = useMemo(() => resolveCols(cols, windowWidth), [cols, windowWidth]);
|
|
123
|
+
// Stable key callback — virtuoso re-renders on identity changes, so a new
|
|
124
|
+
// inline arrow per render would force a full remount. Memoize.
|
|
125
|
+
const computeItemKey = useMemo(() => (index, item) => getKey(item, index), [getKey]);
|
|
126
|
+
// Component override for VirtuosoGrid's internal list element — sets the
|
|
127
|
+
// CSS-grid layout with the responsive column count + gap. Memoized so the
|
|
128
|
+
// override identity is stable across renders (virtuoso treats a changed
|
|
129
|
+
// `components.List` as a structural reset).
|
|
130
|
+
const ListComponent = useMemo(() => {
|
|
131
|
+
const Comp = forwardRef(({ style: listStyle, children, ...rest }, ref) => (_jsx("div", { ref: ref, ...rest, style: {
|
|
132
|
+
...listStyle,
|
|
133
|
+
display: 'grid',
|
|
134
|
+
gridTemplateColumns: `repeat(${colCount}, minmax(0, 1fr))`,
|
|
135
|
+
gap: gapPx,
|
|
136
|
+
}, children: children })));
|
|
137
|
+
Comp.displayName = 'VirtualGridList';
|
|
138
|
+
return Comp;
|
|
139
|
+
}, [colCount, gapPx]);
|
|
140
|
+
const handleItemsRendered = useMemo(() => {
|
|
141
|
+
if (!onItemsRendered)
|
|
142
|
+
return undefined;
|
|
143
|
+
return (range) => {
|
|
144
|
+
onItemsRendered({
|
|
145
|
+
startIndex: range.startIndex,
|
|
146
|
+
stopIndex: range.endIndex,
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
}, [onItemsRendered]);
|
|
150
|
+
return (_jsx("div", { ref: containerRef, className: className,
|
|
151
|
+
// Content-sized in both modes: virtuoso pads its own scroller to the
|
|
152
|
+
// full virtualized height, so the wrapper just grows to fit — the
|
|
153
|
+
// ancestor (or the window) provides the actual scroll.
|
|
154
|
+
style: { width: '100%', ...style }, children: !ancestorResolved ? null : colCount === 1 ? (_jsx(Virtuoso, { data: items, computeItemKey: computeItemKey, itemContent: (index, item) => (_jsx("div", { style: { paddingBottom: gapPx }, children: renderItem(item, index) })), rangeChanged: handleItemsRendered,
|
|
155
|
+
// Ancestor scroll (drawer/modal) → customScrollParent. No ancestor
|
|
156
|
+
// (full page) → window scroll. The two are mutually exclusive: when
|
|
157
|
+
// an ancestor exists, useWindowScroll is false and vice-versa.
|
|
158
|
+
customScrollParent: scrollAncestor !== null && scrollAncestor !== void 0 ? scrollAncestor : undefined, useWindowScroll: !usesAncestorScroll })) : (_jsx(VirtuosoGrid, { data: items, computeItemKey: computeItemKey, itemContent: (index, item) => renderItem(item, index), components: { List: ListComponent }, rangeChanged: handleItemsRendered, customScrollParent: scrollAncestor !== null && scrollAncestor !== void 0 ? scrollAncestor : undefined, useWindowScroll: !usesAncestorScroll })) }));
|
|
159
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BurgerProps as MantineBurgerProps } from '@mantine/core';
|
|
2
|
+
export interface BurgerProps extends MantineBurgerProps {
|
|
3
|
+
}
|
|
4
|
+
declare const Burger: ({ color, size, transitionDuration, ...props }: BurgerProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { Burger };
|
|
6
|
+
//# sourceMappingURL=Burger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Burger.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Burger/Burger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG3F,MAAM,WAAW,WAAY,SAAQ,kBAAkB;CAAG;AAE1D,QAAA,MAAM,MAAM,GAAI,+CAA2E,WAAW,4CASrG,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Burger as MantineBurger } from '@mantine/core';
|
|
3
|
+
import { neutral } from '../../../constants/colors';
|
|
4
|
+
const Burger = ({ color = neutral[300], size = 'md', transitionDuration = 200, ...props }) => {
|
|
5
|
+
return (_jsx(MantineBurger, { color: color, size: size, transitionDuration: transitionDuration, ...props }));
|
|
6
|
+
};
|
|
7
|
+
export { Burger };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Burger } from './Burger';
|
|
3
|
+
declare const meta: Meta<typeof Burger>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Burger>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Colors: Story;
|
|
9
|
+
export declare const InANavHeader: Story;
|
|
10
|
+
//# sourceMappingURL=Burger.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Burger.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Burger/Burger.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAgC7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAcnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAYpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA6C1B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Burger } from './Burger';
|
|
4
|
+
import { Group } from '../../Layout/Group/Group';
|
|
5
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
|
+
import { Text } from '../../Typography/Text/Text';
|
|
7
|
+
import { spacing } from '../../../constants/spacing';
|
|
8
|
+
import { neutral, primary, error } from '../../../constants/colors';
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Components/Misc/Burger',
|
|
11
|
+
component: Burger,
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: 'centered',
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component: 'Animated hamburger / close icon toggle. Thin wrapper around Mantine Burger with Taiv default color (neutral[300]) and a 200ms transition. Controlled by the `opened` prop.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
opened: {
|
|
22
|
+
control: { type: 'boolean' },
|
|
23
|
+
description: 'false renders burger, true renders close (×)',
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
control: { type: 'select' },
|
|
27
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
28
|
+
table: { defaultValue: { summary: "'md'" } },
|
|
29
|
+
},
|
|
30
|
+
color: {
|
|
31
|
+
control: { type: 'color' },
|
|
32
|
+
description: 'CSS color (not a theme token — Mantine limitation)',
|
|
33
|
+
table: { defaultValue: { summary: 'neutral[300]' } },
|
|
34
|
+
},
|
|
35
|
+
transitionDuration: {
|
|
36
|
+
control: { type: 'number' },
|
|
37
|
+
table: { defaultValue: { summary: '200' } },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export default meta;
|
|
42
|
+
export const Default = {
|
|
43
|
+
args: {
|
|
44
|
+
opened: false,
|
|
45
|
+
size: 'md',
|
|
46
|
+
},
|
|
47
|
+
render: (args) => {
|
|
48
|
+
const [opened, setOpened] = useState(args.opened);
|
|
49
|
+
return _jsx(Burger, { ...args, opened: opened, onClick: () => setOpened((o) => !o) });
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const Sizes = {
|
|
53
|
+
render: () => {
|
|
54
|
+
const [opened, setOpened] = useState(false);
|
|
55
|
+
return (_jsx(Group, { gap: spacing.xl, align: 'center', children: ['xs', 'sm', 'md', 'lg', 'xl'].map((size) => (_jsxs(Stack, { gap: spacing.xs, align: 'center', children: [_jsx(Burger, { opened: opened, size: size, onClick: () => setOpened((o) => !o) }), _jsx(Text, { variant: 'label', children: size })] }, size))) }));
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export const Colors = {
|
|
59
|
+
render: () => {
|
|
60
|
+
const [opened, setOpened] = useState(false);
|
|
61
|
+
return (_jsxs(Group, { gap: spacing.xl, children: [_jsx(Burger, { opened: opened, onClick: () => setOpened((o) => !o) }), _jsx(Burger, { color: primary[200], opened: opened, onClick: () => setOpened((o) => !o) }), _jsx(Burger, { color: error[200], opened: opened, onClick: () => setOpened((o) => !o) }), _jsx(Burger, { color: neutral[200], opened: opened, onClick: () => setOpened((o) => !o) })] }));
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export const InANavHeader = {
|
|
65
|
+
parameters: {
|
|
66
|
+
docs: {
|
|
67
|
+
description: {
|
|
68
|
+
story: 'Typical use: toggling a mobile nav drawer.',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
render: () => {
|
|
73
|
+
const [opened, setOpened] = useState(false);
|
|
74
|
+
return (_jsxs(Stack, { gap: spacing.sm, style: { width: 320 }, children: [_jsxs(Group, { position: 'apart', align: 'center', style: {
|
|
75
|
+
padding: spacing.md,
|
|
76
|
+
border: `1px solid ${neutral[50]}`,
|
|
77
|
+
borderRadius: 8,
|
|
78
|
+
background: 'white',
|
|
79
|
+
}, children: [_jsx(Text, { variant: 'body', style: { fontWeight: 600 }, children: "TAIV" }), _jsx(Burger, { opened: opened, onClick: () => setOpened((o) => !o) })] }), opened && (_jsxs(Stack, { gap: spacing.xs, style: {
|
|
80
|
+
padding: spacing.md,
|
|
81
|
+
border: `1px solid ${neutral[50]}`,
|
|
82
|
+
borderRadius: 8,
|
|
83
|
+
background: 'white',
|
|
84
|
+
}, children: [_jsx(Text, { variant: 'body', children: "Dashboard" }), _jsx(Text, { variant: 'body', children: "Account" }), _jsx(Text, { variant: 'body', children: "Settings" })] }))] }));
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CarouselProps as MantineCarouselProps } from '@mantine/carousel';
|
|
3
|
+
import EmblaAutoplay from 'embla-carousel-autoplay';
|
|
4
|
+
import type { EmblaCarouselType, EmblaPluginType } from 'embla-carousel-react';
|
|
5
|
+
/**
|
|
6
|
+
* `@taiv/ui` Carousel — thin wrapper over `@mantine/carousel` (built on
|
|
7
|
+
* Embla v7). Re-exports `Carousel.Slide` as a compound subcomponent so
|
|
8
|
+
* consumers don't have to import directly from `@mantine/carousel`.
|
|
9
|
+
*
|
|
10
|
+
* For advanced usage (autoplay, scale/opacity tween, etc.) consumers can:
|
|
11
|
+
* - Pass an Embla plugin array via `plugins` (e.g. the re-exported
|
|
12
|
+
* `carouselAutoplay`).
|
|
13
|
+
* - Subscribe to the underlying Embla API via `getEmblaApi` and use the
|
|
14
|
+
* re-exported `EmblaCarouselType` for typing.
|
|
15
|
+
*/
|
|
16
|
+
export interface CarouselProps extends MantineCarouselProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare const Carousel: (({ children, ...props }: CarouselProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
20
|
+
Slide: React.ForwardRefExoticComponent<import("@mantine/carousel/lib/CarouselSlide/CarouselSlide").CarouselSlideProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Embla Autoplay plugin factory, re-exported so consumers can configure
|
|
24
|
+
* autoplay without needing a direct dependency on `embla-carousel-autoplay`.
|
|
25
|
+
*
|
|
26
|
+
* Usage:
|
|
27
|
+
* const autoplay = useRef(carouselAutoplay({ delay: 3000, stopOnMouseEnter: true }));
|
|
28
|
+
* <Carousel plugins={[autoplay.current]}>...</Carousel>
|
|
29
|
+
*/
|
|
30
|
+
export declare const carouselAutoplay: typeof EmblaAutoplay;
|
|
31
|
+
export type { EmblaCarouselType, EmblaPluginType };
|
|
32
|
+
//# sourceMappingURL=Carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/Carousel/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,aAAa,IAAI,oBAAoB,EACtC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IACzD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD,eAAO,MAAM,QAAQ,4BAJ8B,aAAa;;CAM9D,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,sBAAgB,CAAC;AAE9C,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Carousel as MantineCarousel, } from '@mantine/carousel';
|
|
3
|
+
import EmblaAutoplay from 'embla-carousel-autoplay';
|
|
4
|
+
const CarouselComponent = ({ children, ...props }) => (_jsx(MantineCarousel, { ...props, children: children }));
|
|
5
|
+
export const Carousel = Object.assign(CarouselComponent, {
|
|
6
|
+
Slide: MantineCarousel.Slide,
|
|
7
|
+
});
|
|
8
|
+
/**
|
|
9
|
+
* Embla Autoplay plugin factory, re-exported so consumers can configure
|
|
10
|
+
* autoplay without needing a direct dependency on `embla-carousel-autoplay`.
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* const autoplay = useRef(carouselAutoplay({ delay: 3000, stopOnMouseEnter: true }));
|
|
14
|
+
* <Carousel plugins={[autoplay.current]}>...</Carousel>
|
|
15
|
+
*/
|
|
16
|
+
export const carouselAutoplay = EmblaAutoplay;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface DragHandleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
3
|
+
/** Accessibility label. Default `'Reorder'`. */
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
/** Size of the handle box (px). Default `20`. */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** Dot color. Default `neutral[200]`. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Called with `-1` / `+1` on arrow-key reorder. */
|
|
10
|
+
onReorder?: (direction: -1 | 1) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Drag handle primitive — six-dot pattern rendered as a real `<button>` so
|
|
14
|
+
* accessibility (focus, keyboard reorder, aria-label) lives here, not on each
|
|
15
|
+
* consumer. Pair with `@dnd-kit` or similar; the handle's ref forwards to the
|
|
16
|
+
* underlying button element for listener attachment.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DragHandle: React.ForwardRefExoticComponent<DragHandleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
//# sourceMappingURL=DragHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragHandle.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/DragHandle/DragHandle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACvE,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CACzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,2FAkEtB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { neutral } from '../../../constants/colors';
|
|
4
|
+
/**
|
|
5
|
+
* Drag handle primitive — six-dot pattern rendered as a real `<button>` so
|
|
6
|
+
* accessibility (focus, keyboard reorder, aria-label) lives here, not on each
|
|
7
|
+
* consumer. Pair with `@dnd-kit` or similar; the handle's ref forwards to the
|
|
8
|
+
* underlying button element for listener attachment.
|
|
9
|
+
*/
|
|
10
|
+
export const DragHandle = forwardRef(({ ariaLabel = 'Reorder', size = 20, color = neutral[200], onReorder, onKeyDown, style, ...props }, ref) => {
|
|
11
|
+
const handleKeyDown = (e) => {
|
|
12
|
+
if (onReorder) {
|
|
13
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
onReorder(-1);
|
|
16
|
+
}
|
|
17
|
+
else if (e.key === 'ArrowDown' || e.key === 'ArrowRight') {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
onReorder(1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
23
|
+
};
|
|
24
|
+
return (_jsx("button", { "aria-label": ariaLabel, onKeyDown: handleKeyDown, ref: ref, style: {
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
background: 'transparent',
|
|
27
|
+
border: 'none',
|
|
28
|
+
borderRadius: 4,
|
|
29
|
+
cursor: 'grab',
|
|
30
|
+
display: 'inline-flex',
|
|
31
|
+
height: size,
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
padding: 0,
|
|
34
|
+
touchAction: 'none',
|
|
35
|
+
width: size,
|
|
36
|
+
...style,
|
|
37
|
+
}, type: 'button', ...props, children: _jsxs("svg", { "aria-hidden": 'true', fill: 'none', height: size, viewBox: '0 0 20 20', width: size, xmlns: 'http://www.w3.org/2000/svg', children: [_jsx("circle", { cx: '7', cy: '5', fill: color, r: '1.5' }), _jsx("circle", { cx: '13', cy: '5', fill: color, r: '1.5' }), _jsx("circle", { cx: '7', cy: '10', fill: color, r: '1.5' }), _jsx("circle", { cx: '13', cy: '10', fill: color, r: '1.5' }), _jsx("circle", { cx: '7', cy: '15', fill: color, r: '1.5' }), _jsx("circle", { cx: '13', cy: '15', fill: color, r: '1.5' })] }) }));
|
|
38
|
+
});
|
|
39
|
+
DragHandle.displayName = 'DragHandle';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { DragHandle } from './DragHandle';
|
|
3
|
+
declare const meta: Meta<typeof DragHandle>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const InListRow: Story;
|
|
8
|
+
export declare const KeyboardReorder: Story;
|
|
9
|
+
//# sourceMappingURL=DragHandle.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragHandle.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/DragHandle/DragHandle.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAYjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KA2BvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAiC7B,CAAC"}
|