@taiv/ui 1.15.0 → 2.1.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 +92 -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/Cards/StatsCard/StatsCard.d.ts +1 -1
- package/dist/components/Data/Cards/StatsCard/StatsCard.d.ts.map +1 -1
- package/dist/components/Data/CheckboxTable/CheckboxTable.d.ts +1 -1
- package/dist/components/Data/CheckboxTable/CheckboxTable.d.ts.map +1 -1
- 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/Data/Progress/Progress.d.ts +1 -1
- package/dist/components/Data/Progress/Progress.d.ts.map +1 -1
- package/dist/components/Data/RemovableItemList/RemovableItemList.d.ts +1 -1
- package/dist/components/Data/RemovableItemList/RemovableItemList.d.ts.map +1 -1
- package/dist/components/Data/StatsBadge/StatsBadge.d.ts +2 -1
- package/dist/components/Data/StatsBadge/StatsBadge.d.ts.map +1 -1
- 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.d.ts +1 -1
- package/dist/components/Info/Badge/Badge.d.ts.map +1 -1
- 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 +3 -3
- 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 +1 -1
- 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/ModalProvider/ModalProvider.d.ts +1 -1
- package/dist/components/Info/Modals/ModalProvider/ModalProvider.d.ts.map +1 -1
- package/dist/components/Info/Modals/StepperModal/StepperModal.d.ts +1 -1
- package/dist/components/Info/Modals/StepperModal/StepperModal.d.ts.map +1 -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/NotificationProvider/NotificationProvider.d.ts +2 -1
- package/dist/components/Info/Notifications/NotificationProvider/NotificationProvider.d.ts.map +1 -1
- 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 +30 -23
- 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/FormulaTooltip/FormulaTooltip.d.ts +2 -1
- package/dist/components/Info/Tooltips/FormulaTooltip/FormulaTooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.d.ts +2 -2
- 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/SSOButton/SSOButton.d.ts +2 -2
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.d.ts +1 -1
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- 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 +41 -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/Checkbox/Checkbox.d.ts +2 -1
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.d.ts.map +1 -1
- 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/Radio/Radio.d.ts +2 -1
- package/dist/components/Inputs/Controls/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts +1 -1
- package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.d.ts +13 -9
- 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 +2 -1
- 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 +13 -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 +20 -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/CascadingSelect/CascadingSelect.d.ts +1 -1
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.d.ts +2 -1
- 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 +4 -3
- 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 +2 -1
- 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 +24 -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/Sliders/Slider/Slider.d.ts +1 -1
- package/dist/components/Inputs/Sliders/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts +2 -1
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts +2 -1
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.d.ts +2 -1
- 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/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts +2 -1
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts +2 -1
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts +2 -1
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts +2 -1
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts.map +1 -1
- 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/Box/Box.d.ts +2 -1
- package/dist/components/Layout/Box/Box.d.ts.map +1 -1
- package/dist/components/Layout/Card/Card.d.ts +2 -2
- package/dist/components/Layout/Card/Card.d.ts.map +1 -1
- package/dist/components/Layout/Center/Center.d.ts +2 -1
- package/dist/components/Layout/Center/Center.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 +2 -1
- package/dist/components/Layout/Divider/Divider.d.ts.map +1 -1
- package/dist/components/Layout/Divider/Divider.js +4 -2
- package/dist/components/Layout/Frame/Frame.d.ts +2 -1
- package/dist/components/Layout/Frame/Frame.d.ts.map +1 -1
- package/dist/components/Layout/Grid/Grid.d.ts +1 -1
- package/dist/components/Layout/Group/Group.d.ts +3 -2
- package/dist/components/Layout/Group/Group.d.ts.map +1 -1
- package/dist/components/Layout/Loader/Loader.d.ts +2 -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 +24 -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/SectionCard/SectionCard.d.ts +1 -1
- package/dist/components/Layout/SectionCard/SectionCard.d.ts.map +1 -1
- package/dist/components/Layout/Stack/Stack.d.ts +2 -1
- package/dist/components/Layout/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Layout/Table/Table.d.ts +1 -1
- package/dist/components/Layout/Table/Table.d.ts.map +1 -1
- 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 +1 -1
- 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 +7 -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/LoadingOverlay/LoadingOverlay.d.ts +2 -1
- package/dist/components/Misc/LoadingOverlay/LoadingOverlay.d.ts.map +1 -1
- 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/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Misc/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Misc/Stepper/Step.d.ts +1 -1
- package/dist/components/Misc/Stepper/Step.d.ts.map +1 -1
- package/dist/components/Misc/Stepper/Step.stories.d.ts +120 -120
- package/dist/components/Misc/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Misc/Stepper/Stepper.d.ts.map +1 -1
- 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/Misc/Transition/Transition.d.ts +2 -1
- package/dist/components/Misc/Transition/Transition.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.d.ts +1 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.d.ts +1 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.d.ts.map +1 -1
- package/dist/components/Typography/Formula/Formula.d.ts +2 -1
- package/dist/components/Typography/Formula/Formula.d.ts.map +1 -1
- package/dist/components/Typography/Fraction/Fraction.d.ts +1 -1
- package/dist/components/Typography/Fraction/Fraction.d.ts.map +1 -1
- 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/Typography/Text/Text.d.ts +1 -1
- package/dist/components/Typography/Text/Text.d.ts.map +1 -1
- package/dist/components/Typography/Title/Title.d.ts +1 -1
- package/dist/components/Typography/Title/Title.d.ts.map +1 -1
- 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/docs/AIGeneratedBanner.d.ts +1 -1
- package/dist/docs/AIGeneratedBanner.d.ts.map +1 -1
- 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 +28 -4
|
@@ -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.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,gCASrG,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) => React.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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { neutral } from '../../../constants/colors';
|
|
4
|
+
import { spacing } from '../../../constants/spacing';
|
|
5
|
+
import { Group } from '../../Layout/Group/Group';
|
|
6
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
7
|
+
import { Text } from '../../Typography/Text/Text';
|
|
8
|
+
import { DragHandle } from './DragHandle';
|
|
9
|
+
const meta = {
|
|
10
|
+
component: DragHandle,
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: 'Six-dot drag handle rendered as a real `<button>` — owns focus, keyboard reorder (arrow keys), and `aria-label`. Pair with a DnD library (e.g. `@dnd-kit`) by attaching listeners via the forwarded ref.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
layout: 'centered',
|
|
18
|
+
},
|
|
19
|
+
title: 'Components/Misc/DragHandle',
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
export const Default = {
|
|
23
|
+
render: () => _jsx(DragHandle, {}),
|
|
24
|
+
};
|
|
25
|
+
export const InListRow = {
|
|
26
|
+
render: () => (_jsx(Stack, { spacing: spacing.xs, style: {
|
|
27
|
+
border: `1px solid ${neutral[50]}`,
|
|
28
|
+
borderRadius: 8,
|
|
29
|
+
padding: spacing.sm,
|
|
30
|
+
width: 320,
|
|
31
|
+
}, children: ['Nike ad', 'Spotify ad', 'Apple ad'].map((name) => (_jsxs(Group, { spacing: spacing.sm, style: {
|
|
32
|
+
border: `1px solid ${neutral[50]}`,
|
|
33
|
+
borderRadius: 6,
|
|
34
|
+
padding: spacing.xs,
|
|
35
|
+
}, children: [_jsx(DragHandle, { ariaLabel: `Reorder ${name}` }), _jsx(Text, { variant: 'body', children: name })] }, name))) })),
|
|
36
|
+
};
|
|
37
|
+
export const KeyboardReorder = {
|
|
38
|
+
render: () => {
|
|
39
|
+
const [items, setItems] = useState(['A', 'B', 'C', 'D']);
|
|
40
|
+
const reorder = (i, dir) => {
|
|
41
|
+
const next = [...items];
|
|
42
|
+
const target = i + dir;
|
|
43
|
+
if (target < 0 || target >= next.length)
|
|
44
|
+
return;
|
|
45
|
+
[next[i], next[target]] = [next[target], next[i]];
|
|
46
|
+
setItems(next);
|
|
47
|
+
};
|
|
48
|
+
return (_jsxs(Stack, { spacing: spacing.xs, style: { width: 280 }, children: [_jsx(Text, { variant: 'subtle', children: "Focus a handle and press \u2191/\u2193 to reorder." }), items.map((name, i) => (_jsxs(Group, { spacing: spacing.sm, style: {
|
|
49
|
+
border: `1px solid ${neutral[50]}`,
|
|
50
|
+
borderRadius: 6,
|
|
51
|
+
padding: spacing.xs,
|
|
52
|
+
}, children: [_jsx(DragHandle, { ariaLabel: `Reorder ${name}`, onReorder: (dir) => reorder(i, dir) }), _jsx(Text, { variant: 'body', children: name })] }, name)))] }));
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IconButtonProps } from '../../Inputs/Buttons/IconButton/IconButton';
|
|
3
|
+
export type FABPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
4
|
+
export interface FABProps {
|
|
5
|
+
/**
|
|
6
|
+
* Icon rendered inside the button. Sized automatically by IconButton.
|
|
7
|
+
*/
|
|
8
|
+
icon: ReactElement<{
|
|
9
|
+
size?: number;
|
|
10
|
+
}>;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Required for accessibility — the FAB has no visible label.
|
|
14
|
+
*/
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
variant?: IconButtonProps['variant'];
|
|
17
|
+
size?: IconButtonProps['size'];
|
|
18
|
+
/**
|
|
19
|
+
* Corner of the viewport to anchor to. Default `'bottom-right'`.
|
|
20
|
+
*/
|
|
21
|
+
position?: FABPosition;
|
|
22
|
+
/**
|
|
23
|
+
* Distance from the anchored edges. Accepts any CSS length. Default `spacing.lg` (16px).
|
|
24
|
+
*/
|
|
25
|
+
offset?: number | string;
|
|
26
|
+
/**
|
|
27
|
+
* When true, only renders on tablet/mobile viewports (≤ 768px). Default `true` —
|
|
28
|
+
* the FAB is intended as a mobile/tablet pattern. Set `false` to always render.
|
|
29
|
+
*/
|
|
30
|
+
mobileOnly?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Explicit override to suppress rendering regardless of viewport.
|
|
33
|
+
*/
|
|
34
|
+
hidden?: boolean;
|
|
35
|
+
zIndex?: number;
|
|
36
|
+
'data-testid'?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Floating Action Button. A `position: fixed` IconButton with shadow, used for the
|
|
40
|
+
* primary action on a page when screen real estate is tight (typically mobile).
|
|
41
|
+
*
|
|
42
|
+
* Defaults to mobile-only (≤ 768px). On desktop, prefer an inline `<Button>` for the
|
|
43
|
+
* same action and let the FAB take over on smaller viewports — the two should trigger
|
|
44
|
+
* the same handler.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <FAB
|
|
48
|
+
* icon={<IconPlus />}
|
|
49
|
+
* onClick={openAddDeviceModal}
|
|
50
|
+
* ariaLabel="Add device"
|
|
51
|
+
* />
|
|
52
|
+
*/
|
|
53
|
+
export declare const FAB: ({ icon, onClick, ariaLabel, variant, size, position, offset, mobileOnly, hidden, zIndex, "data-testid": dataTestId, }: FABProps) => import("react").JSX.Element | null;
|
|
54
|
+
//# sourceMappingURL=FAB.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FAB.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/FAB/FAB.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,OAAO,EAAc,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAGzF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;AAEpF,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA8BD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,GAAG,GAAI,uHAYjB,QAAQ,uCA2BV,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { spacing } from '../../../constants/spacing';
|
|
3
|
+
import { useTablet } from '../../../hooks/useMediaQuery';
|
|
4
|
+
import { IconButton } from '../../Inputs/Buttons/IconButton/IconButton';
|
|
5
|
+
import { Box } from '../../Layout/Box/Box';
|
|
6
|
+
// Bottom-anchored FABs additively read `--app-bottom-inset` from the
|
|
7
|
+
// document so apps with a fixed bottom chrome (e.g. mobile nav) can lift
|
|
8
|
+
// every FAB clear of the bar without each consumer threading an explicit
|
|
9
|
+
// offset. Defaults to `0px` when the variable isn't set, so apps without
|
|
10
|
+
// bottom chrome see no behavior change.
|
|
11
|
+
const APP_BOTTOM_INSET_VAR = 'var(--app-bottom-inset, 0px)';
|
|
12
|
+
const toCssLength = (offset) => typeof offset === 'number' ? `${offset}px` : offset;
|
|
13
|
+
const positionStyle = (position, offset) => {
|
|
14
|
+
const o = toCssLength(offset);
|
|
15
|
+
const bottomWithInset = `calc(${o} + ${APP_BOTTOM_INSET_VAR})`;
|
|
16
|
+
switch (position) {
|
|
17
|
+
case 'bottom-right':
|
|
18
|
+
return { bottom: bottomWithInset, right: o };
|
|
19
|
+
case 'bottom-left':
|
|
20
|
+
return { bottom: bottomWithInset, left: o };
|
|
21
|
+
case 'top-right':
|
|
22
|
+
return { top: o, right: o };
|
|
23
|
+
case 'top-left':
|
|
24
|
+
return { top: o, left: o };
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Floating Action Button. A `position: fixed` IconButton with shadow, used for the
|
|
29
|
+
* primary action on a page when screen real estate is tight (typically mobile).
|
|
30
|
+
*
|
|
31
|
+
* Defaults to mobile-only (≤ 768px). On desktop, prefer an inline `<Button>` for the
|
|
32
|
+
* same action and let the FAB take over on smaller viewports — the two should trigger
|
|
33
|
+
* the same handler.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* <FAB
|
|
37
|
+
* icon={<IconPlus />}
|
|
38
|
+
* onClick={openAddDeviceModal}
|
|
39
|
+
* ariaLabel="Add device"
|
|
40
|
+
* />
|
|
41
|
+
*/
|
|
42
|
+
export const FAB = ({ icon, onClick, ariaLabel, variant = 'primary', size = '2xl', position = 'bottom-right', offset = spacing.lg, mobileOnly = true, hidden = false, zIndex = 10, 'data-testid': dataTestId, }) => {
|
|
43
|
+
const isTablet = useTablet();
|
|
44
|
+
if (hidden)
|
|
45
|
+
return null;
|
|
46
|
+
if (mobileOnly && !isTablet)
|
|
47
|
+
return null;
|
|
48
|
+
return (_jsx(Box, { style: {
|
|
49
|
+
position: 'fixed',
|
|
50
|
+
zIndex,
|
|
51
|
+
...positionStyle(position, offset),
|
|
52
|
+
}, children: _jsx(IconButton, { "aria-label": ariaLabel, "data-testid": dataTestId, onClick: onClick, radius: '50%', shadow: true, size: size, variant: variant, children: icon }) }));
|
|
53
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FAB } from './FAB';
|
|
3
|
+
declare const meta: Meta<typeof FAB>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FAB>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Positions: Story;
|
|
8
|
+
export declare const Variants: Story;
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
//# sourceMappingURL=FAB.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FAB.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/FAB/FAB.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,GAAG,CAqD1B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC;AAsBlC,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KA2CvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA4BtB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAoCnB,CAAC"}
|