@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,148 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Accordion } from './Accordion';
|
|
4
|
+
import { Badge } from '../../Info/Badge/Badge';
|
|
5
|
+
import { Group } from '../Group/Group';
|
|
6
|
+
import { Stack } from '../Stack/Stack';
|
|
7
|
+
import { Text } from '../../Typography/Text/Text';
|
|
8
|
+
import { Toggle } from '../../Inputs/Controls/Toggle/Toggle';
|
|
9
|
+
import { neutral } from '../../../constants/colors';
|
|
10
|
+
import { spacing } from '../../../constants/spacing';
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Components/Layout/Accordion',
|
|
13
|
+
component: Accordion,
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: 'centered',
|
|
16
|
+
docs: {
|
|
17
|
+
description: {
|
|
18
|
+
component: '[View Mantine Docs](https://v6.mantine.dev/core/accordion/)\n\nAccordion renders a list of expandable items. It extends Mantine v6\'s Accordion with Taiv styling: Poppins font, neutral dividers, `neutral[25]` hover, and a right-chevron that rotates 90° on expand.\n\nSupports controlled and uncontrolled modes, multi-expand via the `multiple` prop, and fully custom control content via `Accordion.Control`.',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
decorators: [
|
|
23
|
+
(Story) => (_jsx("div", { style: { width: '560px' }, children: _jsx(Story, {}) })),
|
|
24
|
+
],
|
|
25
|
+
argTypes: {
|
|
26
|
+
multiple: {
|
|
27
|
+
control: { type: 'boolean' },
|
|
28
|
+
description: 'Allow multiple items to be open simultaneously',
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: 'boolean' },
|
|
31
|
+
defaultValue: { summary: 'false' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultValue: {
|
|
35
|
+
control: { type: 'text' },
|
|
36
|
+
description: 'Uncontrolled default open item value',
|
|
37
|
+
table: { type: { summary: 'string | string[]' } },
|
|
38
|
+
},
|
|
39
|
+
value: {
|
|
40
|
+
control: false,
|
|
41
|
+
description: 'Controlled open item value',
|
|
42
|
+
table: { type: { summary: 'string | string[] | null' } },
|
|
43
|
+
},
|
|
44
|
+
onChange: {
|
|
45
|
+
action: 'changed',
|
|
46
|
+
description: 'Called when the open item changes',
|
|
47
|
+
table: { type: { summary: '(value: string | string[] | null) => void' } },
|
|
48
|
+
},
|
|
49
|
+
chevron: {
|
|
50
|
+
control: false,
|
|
51
|
+
description: 'Override the default right-chevron icon',
|
|
52
|
+
table: { type: { summary: 'ReactNode' } },
|
|
53
|
+
},
|
|
54
|
+
styles: {
|
|
55
|
+
control: { type: 'object' },
|
|
56
|
+
description: 'Style overrides using Mantine styles API',
|
|
57
|
+
table: { type: { summary: 'Record<string, CSSObject>' } },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export default meta;
|
|
62
|
+
// ─── Single-expand (default) ────────────────────────────────────────────────
|
|
63
|
+
export const Default = {
|
|
64
|
+
args: { defaultValue: 'item-1' },
|
|
65
|
+
render: (args) => (_jsxs(Accordion, { ...args, children: [_jsxs(Accordion.Item, { value: 'item-1', children: [_jsx(Accordion.Control, { children: "Section one" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "Content for section one. Click the header to collapse." }) })] }), _jsxs(Accordion.Item, { value: 'item-2', children: [_jsx(Accordion.Control, { children: "Section two" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "Content for section two." }) })] }), _jsxs(Accordion.Item, { value: 'item-3', children: [_jsx(Accordion.Control, { children: "Section three" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "Content for section three." }) })] })] })),
|
|
66
|
+
parameters: {
|
|
67
|
+
docs: {
|
|
68
|
+
source: {
|
|
69
|
+
code: `<Accordion defaultValue="item-1">
|
|
70
|
+
<Accordion.Item value="item-1">
|
|
71
|
+
<Accordion.Control>Section one</Accordion.Control>
|
|
72
|
+
<Accordion.Panel>Content for section one.</Accordion.Panel>
|
|
73
|
+
</Accordion.Item>
|
|
74
|
+
<Accordion.Item value="item-2">
|
|
75
|
+
<Accordion.Control>Section two</Accordion.Control>
|
|
76
|
+
<Accordion.Panel>Content for section two.</Accordion.Panel>
|
|
77
|
+
</Accordion.Item>
|
|
78
|
+
</Accordion>`,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
// ─── Multi-expand ────────────────────────────────────────────────────────────
|
|
84
|
+
export const MultiExpand = {
|
|
85
|
+
render: () => (_jsxs(Accordion, { multiple: true, children: [_jsxs(Accordion.Item, { value: 'item-1', children: [_jsx(Accordion.Control, { children: "Open simultaneously" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "Both panels can be open at once when `multiple` is set." }) })] }), _jsxs(Accordion.Item, { value: 'item-2', children: [_jsx(Accordion.Control, { children: "Also open" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "This one is open too." }) })] }), _jsxs(Accordion.Item, { value: 'item-3', children: [_jsx(Accordion.Control, { children: "Collapsed" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "This panel starts collapsed." }) })] })] })),
|
|
86
|
+
parameters: {
|
|
87
|
+
docs: {
|
|
88
|
+
description: { story: 'Pass `multiple` to allow any number of items to be open at once.' },
|
|
89
|
+
source: { code: `<Accordion multiple defaultValue={['item-1', 'item-2']}>...</Accordion>` },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
// ─── Custom header content (Ad Preferences-style row) ───────────────────────
|
|
94
|
+
const categories = [
|
|
95
|
+
{ value: 'adult', emoji: '🔞', label: 'Adult Content', badge: null },
|
|
96
|
+
{ value: 'gambling', emoji: '🎰', label: 'Gambling', badge: null },
|
|
97
|
+
{ value: 'food', emoji: '🍽️', label: 'Food & Drink', badge: '1 of 9 blocked' },
|
|
98
|
+
{ value: 'health', emoji: '💪', label: 'Health & Fitness', badge: '1 of 14 blocked' },
|
|
99
|
+
];
|
|
100
|
+
export const CustomHeader = {
|
|
101
|
+
render: () => {
|
|
102
|
+
const [blocked, setBlocked] = useState({});
|
|
103
|
+
const toggle = (value, e) => {
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
setBlocked((prev) => ({ ...prev, [value]: !prev[value] }));
|
|
106
|
+
};
|
|
107
|
+
return (_jsx(Accordion, { children: categories.map(({ value, emoji, label, badge }) => (_jsxs(Accordion.Item, { value: value, children: [_jsx(Accordion.Control, { children: _jsxs(Group, { position: 'apart', noWrap: true, children: [_jsxs(Group, { spacing: spacing.sm, noWrap: true, children: [_jsx("span", { style: { fontSize: '20px', lineHeight: 1 }, children: emoji }), _jsx(Text, { variant: 'body', children: label })] }), _jsxs(Group, { spacing: spacing.sm, noWrap: true, onClick: (e) => e.stopPropagation(), children: [badge ? (_jsx(Badge, { variant: 'filled', color: 'warning', size: 'sm', children: badge })) : (_jsx(Text, { variant: 'label', color: neutral[200], children: "Not blocked" })), _jsx(Toggle, { size: 'sm', checked: !!blocked[value], variant: 'error', onChange: (e) => {
|
|
108
|
+
e.stopPropagation();
|
|
109
|
+
setBlocked((prev) => ({ ...prev, [value]: e.currentTarget.checked }));
|
|
110
|
+
} })] })] }) }), _jsx(Accordion.Panel, { children: _jsx(Stack, { spacing: spacing.sm, children: _jsxs(Text, { variant: 'subtle', children: ["Subcategories for ", label, " would appear here."] }) }) })] }, value))) }));
|
|
111
|
+
},
|
|
112
|
+
parameters: {
|
|
113
|
+
docs: {
|
|
114
|
+
description: {
|
|
115
|
+
story: 'Compose any content inside `Accordion.Control`. Wrap interactive elements (toggles, buttons) in a click-stopping container so they don\'t trigger expand/collapse.',
|
|
116
|
+
},
|
|
117
|
+
source: { code: false },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
// ─── Disabled item ───────────────────────────────────────────────────────────
|
|
122
|
+
export const DisabledItem = {
|
|
123
|
+
render: () => (_jsxs(Accordion, { children: [_jsxs(Accordion.Item, { value: 'active', children: [_jsx(Accordion.Control, { children: "Available category" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "This item can be expanded." }) })] }), _jsxs(Accordion.Item, { value: 'disabled', disabled: true, children: [_jsx(Accordion.Control, { children: "Disabled category" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "This content is inaccessible." }) })] })] })),
|
|
124
|
+
parameters: {
|
|
125
|
+
docs: {
|
|
126
|
+
description: { story: 'Pass `disabled` on an `Accordion.Item` to prevent it from being opened.' },
|
|
127
|
+
source: {
|
|
128
|
+
code: `<Accordion.Item value="disabled" disabled>
|
|
129
|
+
<Accordion.Control>Disabled</Accordion.Control>
|
|
130
|
+
<Accordion.Panel>...</Accordion.Panel>
|
|
131
|
+
</Accordion.Item>`,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
// ─── Controlled ──────────────────────────────────────────────────────────────
|
|
137
|
+
export const Controlled = {
|
|
138
|
+
render: () => {
|
|
139
|
+
const [value, setValue] = useState('item-1');
|
|
140
|
+
return (_jsxs(Stack, { spacing: spacing.md, children: [_jsxs(Text, { variant: 'label', children: ["Open item: ", value !== null && value !== void 0 ? value : 'none'] }), _jsxs(Accordion, { value: value, onChange: (v) => setValue(v), children: [_jsxs(Accordion.Item, { value: 'item-1', children: [_jsx(Accordion.Control, { children: "Controlled item 1" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "Controlled via external state." }) })] }), _jsxs(Accordion.Item, { value: 'item-2', children: [_jsx(Accordion.Control, { children: "Controlled item 2" }), _jsx(Accordion.Panel, { children: _jsx(Text, { variant: 'subtle', children: "Only one open at a time." }) })] })] })] }));
|
|
141
|
+
},
|
|
142
|
+
parameters: {
|
|
143
|
+
docs: {
|
|
144
|
+
description: { story: 'Pass `value` and `onChange` for full controlled behaviour.' },
|
|
145
|
+
source: { code: false },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { type SimpleGridProps } from '@mantine/core';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Tailwind-style responsive column map. Missing entries inherit from the
|
|
5
|
+
* next-smaller breakpoint. `base` applies at viewports below `sm` (640px).
|
|
6
|
+
*/
|
|
7
|
+
export type ResponsiveCols = {
|
|
8
|
+
base?: number;
|
|
9
|
+
sm?: number;
|
|
10
|
+
md?: number;
|
|
11
|
+
lg?: number;
|
|
12
|
+
xl?: number;
|
|
13
|
+
};
|
|
14
|
+
export interface AutoGridProps extends Omit<SimpleGridProps, 'cols'> {
|
|
4
15
|
children: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Number of columns. Accepts a number, or a Tailwind-style responsive map
|
|
18
|
+
* (`{ base: 1, sm: 2, lg: 3 }`). Defaults to `1`.
|
|
19
|
+
*/
|
|
20
|
+
cols?: number | ResponsiveCols;
|
|
5
21
|
}
|
|
6
|
-
declare const AutoGrid: ({ children, ...props }: AutoGridProps) =>
|
|
7
|
-
export { AutoGrid };
|
|
22
|
+
export declare const AutoGrid: ({ cols, children, ...props }: AutoGridProps) => React.JSX.Element;
|
|
8
23
|
//# sourceMappingURL=AutoGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/AutoGrid/AutoGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"AutoGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/AutoGrid/AutoGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC;IAClE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;CAChC;AAqDD,eAAO,MAAM,QAAQ,GAAI,8BAAkC,aAAa,sBAmBvE,CAAC"}
|
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SimpleGrid } from '@mantine/core';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { breakpoints } from '../../../constants/breakpoints';
|
|
4
|
+
const BP_WIDTH_PX = {
|
|
5
|
+
base: 0,
|
|
6
|
+
lg: breakpoints.LAPTOP, // 1024
|
|
7
|
+
md: breakpoints.TABLET, // 768
|
|
8
|
+
sm: breakpoints.MOBILE, // 640
|
|
9
|
+
xl: breakpoints.DESKTOP, // 1280
|
|
10
|
+
};
|
|
11
|
+
const RESPONSIVE_KEYS = [
|
|
12
|
+
'base',
|
|
13
|
+
'sm',
|
|
14
|
+
'md',
|
|
15
|
+
'lg',
|
|
16
|
+
'xl',
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Translate a mobile-first responsive cols map into Mantine v6's
|
|
20
|
+
* `{ cols, breakpoints: [{ maxWidth, cols }, …] }` shape. Mantine applies
|
|
21
|
+
* breakpoints below a `maxWidth` so we resolve the largest entry as the base
|
|
22
|
+
* `cols` and emit descending `maxWidth` thresholds for smaller steps.
|
|
23
|
+
*/
|
|
24
|
+
const resolveResponsiveCols = (map) => {
|
|
25
|
+
// Forward-fill so `{ base: 1, lg: 3 }` implies sm/md also pick up 1 until lg.
|
|
26
|
+
let last = 1;
|
|
27
|
+
const filled = RESPONSIVE_KEYS.reduce((acc, k) => {
|
|
28
|
+
const v = map[k];
|
|
29
|
+
if (typeof v === 'number')
|
|
30
|
+
last = v;
|
|
31
|
+
acc[k] = last;
|
|
32
|
+
return acc;
|
|
33
|
+
}, { base: 1, lg: 1, md: 1, sm: 1, xl: 1 });
|
|
34
|
+
const baseCols = filled.xl;
|
|
35
|
+
const stops = [];
|
|
36
|
+
// Walk descending: each step fires when viewport drops below its threshold.
|
|
37
|
+
const descending = ['xl', 'lg', 'md', 'sm'];
|
|
38
|
+
for (const key of descending) {
|
|
39
|
+
const smaller = RESPONSIVE_KEYS[RESPONSIVE_KEYS.indexOf(key) - 1];
|
|
40
|
+
if (!smaller)
|
|
41
|
+
continue;
|
|
42
|
+
if (filled[smaller] !== filled[key]) {
|
|
43
|
+
stops === null || stops === void 0 ? void 0 : stops.push({ cols: filled[smaller], maxWidth: BP_WIDTH_PX[key] });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { breakpoints: stops, cols: baseCols };
|
|
47
|
+
};
|
|
48
|
+
export const AutoGrid = ({ cols = 1, children, ...props }) => {
|
|
49
|
+
if (typeof cols === 'number') {
|
|
50
|
+
return (_jsx(SimpleGrid, { cols: cols, ...props, children: children }));
|
|
51
|
+
}
|
|
52
|
+
const { cols: resolvedCols, breakpoints: resolvedBreakpoints } = resolveResponsiveCols(cols);
|
|
53
|
+
return (_jsx(SimpleGrid, { breakpoints: resolvedBreakpoints, cols: resolvedCols, ...props, children: children }));
|
|
5
54
|
};
|
|
6
|
-
export { AutoGrid };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoGrid.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/AutoGrid/AutoGrid.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"AutoGrid.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/AutoGrid/AutoGrid.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAqD/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAwBnC,eAAO,MAAM,OAAO,EAAE,KAwBrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAoB5B,CAAC"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AutoGrid } from './AutoGrid';
|
|
3
|
-
import { Card } from '../Card/Card';
|
|
4
2
|
import { Title } from '../../Typography/Title/Title';
|
|
3
|
+
import { Card } from '../Card/Card';
|
|
4
|
+
import { AutoGrid } from './AutoGrid';
|
|
5
5
|
const meta = {
|
|
6
|
-
title: 'Components/Layout/AutoGrid',
|
|
7
|
-
component: AutoGrid,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: "[View Mantine Docs](https://v6.mantine.dev/core/simple-grid/)\n\nThe AutoGrid component is a responsive grid where each item takes an equal amount of space. It extends Mantine v6's SimpleGrid component and provides automatic column distribution with customizable spacing.",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
6
|
argTypes: {
|
|
17
7
|
children: {
|
|
18
8
|
control: false,
|
|
@@ -25,45 +15,55 @@ const meta = {
|
|
|
25
15
|
control: { type: 'number' },
|
|
26
16
|
description: 'Number of columns in each row',
|
|
27
17
|
table: {
|
|
28
|
-
type: { summary: 'number | ResponsiveObject' },
|
|
29
18
|
defaultValue: { summary: '1' },
|
|
19
|
+
type: { summary: 'number | ResponsiveObject' },
|
|
30
20
|
},
|
|
31
21
|
},
|
|
32
22
|
spacing: {
|
|
33
23
|
control: { type: 'select' },
|
|
34
|
-
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
35
24
|
description: 'Horizontal spacing between items',
|
|
25
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
36
26
|
table: {
|
|
37
|
-
type: { summary: "'xs' | 'sm' | 'md' | 'lg' | 'xl' | number" },
|
|
38
27
|
defaultValue: { summary: "'md'" },
|
|
28
|
+
type: { summary: "'xs' | 'sm' | 'md' | 'lg' | 'xl' | number" },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
styles: {
|
|
32
|
+
control: { type: 'object' },
|
|
33
|
+
description: 'Custom styles to override with if necessary',
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: 'Record<string, CSSObject>' },
|
|
39
36
|
},
|
|
40
37
|
},
|
|
41
38
|
verticalSpacing: {
|
|
42
39
|
control: { type: 'select' },
|
|
43
|
-
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
44
40
|
description: 'Vertical spacing between items',
|
|
41
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
45
42
|
table: {
|
|
46
43
|
type: { summary: "'xs' | 'sm' | 'md' | 'lg' | 'xl' | number" },
|
|
47
44
|
},
|
|
48
45
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
},
|
|
47
|
+
component: AutoGrid,
|
|
48
|
+
parameters: {
|
|
49
|
+
docs: {
|
|
50
|
+
description: {
|
|
51
|
+
component: "[View Mantine Docs](https://v6.mantine.dev/core/simple-grid/)\n\nThe AutoGrid component is a responsive grid where each item takes an equal amount of space. It extends Mantine v6's SimpleGrid component and provides automatic column distribution with customizable spacing.",
|
|
54
52
|
},
|
|
55
53
|
},
|
|
54
|
+
layout: 'centered',
|
|
56
55
|
},
|
|
56
|
+
title: 'Components/Layout/AutoGrid',
|
|
57
57
|
};
|
|
58
58
|
export default meta;
|
|
59
|
-
const SampleCard = ({ title, description }) => (_jsxs(Card, { animate: true, padding:
|
|
59
|
+
const SampleCard = ({ title, description, }) => (_jsxs(Card, { animate: true, padding: 'lg', children: [_jsx(Title, { variant: 'cardHeader', children: title }), _jsx(Title, { variant: 'cardSubheader', children: description })] }));
|
|
60
60
|
const items = [
|
|
61
|
-
{ id: 1, title: 'Item 1'
|
|
62
|
-
{ id: 2, title: 'Item 2'
|
|
63
|
-
{ id: 3, title: 'Item 3'
|
|
64
|
-
{ id: 4, title: 'Item 4'
|
|
65
|
-
{ id: 5, title: 'Item 5'
|
|
66
|
-
{ id: 6, title: 'Item 6'
|
|
61
|
+
{ description: 'Grid item content', id: 1, title: 'Item 1' },
|
|
62
|
+
{ description: 'Grid item content', id: 2, title: 'Item 2' },
|
|
63
|
+
{ description: 'Grid item content', id: 3, title: 'Item 3' },
|
|
64
|
+
{ description: 'Grid item content', id: 4, title: 'Item 4' },
|
|
65
|
+
{ description: 'Grid item content', id: 5, title: 'Item 5' },
|
|
66
|
+
{ description: 'Grid item content', id: 6, title: 'Item 6' },
|
|
67
67
|
];
|
|
68
68
|
export const Default = {
|
|
69
69
|
args: {
|
|
@@ -74,5 +74,15 @@ export const Default = {
|
|
|
74
74
|
decorators: [
|
|
75
75
|
(Story) => (_jsx("div", { style: { width: '700px' }, children: _jsx(Story, {}) })),
|
|
76
76
|
],
|
|
77
|
-
render: (args) => (_jsx(AutoGrid, { ...args, children: items.map((item) => (_jsx(SampleCard, {
|
|
77
|
+
render: (args) => (_jsx(AutoGrid, { ...args, children: items.map((item) => (_jsx(SampleCard, { description: item.description, title: item.title }, item.id))) })),
|
|
78
|
+
};
|
|
79
|
+
export const ResponsiveCols = {
|
|
80
|
+
parameters: {
|
|
81
|
+
docs: {
|
|
82
|
+
description: {
|
|
83
|
+
story: 'Pass a responsive map to `cols` — Tailwind-style `base`/`sm`/`md`/`lg`/`xl`. Missing stops inherit from the next-smaller entry. Resize the viewport to see the grid reflow.',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
render: () => (_jsx(AutoGrid, { cols: { base: 1, lg: 3, sm: 2 }, spacing: 'md', children: items.map((item) => (_jsx(SampleCard, { description: item.description, title: item.title }, item.id))) })),
|
|
78
88
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BottomActionBarItem {
|
|
3
|
+
/** Stable identifier for React key + accessibility. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Icon element (e.g. `<IconLayout />`). Rendered above the label. */
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
/** Short label rendered below the icon. */
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Mark the item as active / pressed. */
|
|
12
|
+
active?: boolean;
|
|
13
|
+
/** Accessibility label. Defaults to `label` when it's a string. */
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BottomActionBarProps {
|
|
17
|
+
items: BottomActionBarItem[];
|
|
18
|
+
/** Pin to the viewport bottom. Default `true`. */
|
|
19
|
+
fixed?: boolean;
|
|
20
|
+
/** z-index when `fixed`. Default `20` (below `SelectionToolbar` at 30). */
|
|
21
|
+
zIndex?: number;
|
|
22
|
+
/** Backdrop blur intensity in px. Default `8`. 0 disables the blur. */
|
|
23
|
+
blur?: number;
|
|
24
|
+
/** Override the container height (px). Default `64`. */
|
|
25
|
+
height?: number;
|
|
26
|
+
ariaLabel?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
style?: React.CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Launcher row of icon+label cells, typically used to switch between tools
|
|
32
|
+
* (layout / text / media / animate…) at the bottom of a canvas-like editor.
|
|
33
|
+
* Columns auto-distribute evenly via `grid-template-columns: repeat(N, 1fr)`.
|
|
34
|
+
*
|
|
35
|
+
* `SelectionToolbar` and modals should sit above this bar — keep their
|
|
36
|
+
* `z-index` above the default `20`. `MobileDrawer` should receive
|
|
37
|
+
* `bottomOffset={height}` so sheets stack on top rather than overlap.
|
|
38
|
+
*/
|
|
39
|
+
export declare const BottomActionBar: ({ items, fixed, zIndex, blur, height, ariaLabel, className, style, }: BottomActionBarProps) => React.JSX.Element;
|
|
40
|
+
//# sourceMappingURL=BottomActionBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomActionBar.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BottomActionBar/BottomActionBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,sEAAsE;IACtE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,2CAA2C;IAC3C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,sEAS7B,oBAAoB,sBA8BtB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { neutral, primary, white } from '../../../constants/colors';
|
|
4
|
+
import { spacing } from '../../../constants/spacing';
|
|
5
|
+
import { Text } from '../../Typography/Text/Text';
|
|
6
|
+
/**
|
|
7
|
+
* Launcher row of icon+label cells, typically used to switch between tools
|
|
8
|
+
* (layout / text / media / animate…) at the bottom of a canvas-like editor.
|
|
9
|
+
* Columns auto-distribute evenly via `grid-template-columns: repeat(N, 1fr)`.
|
|
10
|
+
*
|
|
11
|
+
* `SelectionToolbar` and modals should sit above this bar — keep their
|
|
12
|
+
* `z-index` above the default `20`. `MobileDrawer` should receive
|
|
13
|
+
* `bottomOffset={height}` so sheets stack on top rather than overlap.
|
|
14
|
+
*/
|
|
15
|
+
export const BottomActionBar = ({ items, fixed = true, zIndex = 20, blur = 8, height = 64, ariaLabel = 'Editor tools', className, style, }) => {
|
|
16
|
+
return (_jsx("nav", { "aria-label": ariaLabel, className: className, style: {
|
|
17
|
+
backdropFilter: blur ? `blur(${blur}px)` : undefined,
|
|
18
|
+
backgroundColor: blur ? 'rgba(255, 255, 255, 0.85)' : white,
|
|
19
|
+
borderTop: `1px solid ${neutral[50]}`,
|
|
20
|
+
bottom: fixed ? 0 : undefined,
|
|
21
|
+
display: 'grid',
|
|
22
|
+
gridTemplateColumns: `repeat(${items.length}, minmax(0, 1fr))`,
|
|
23
|
+
height,
|
|
24
|
+
left: fixed ? 0 : undefined,
|
|
25
|
+
position: fixed ? 'fixed' : 'relative',
|
|
26
|
+
right: fixed ? 0 : undefined,
|
|
27
|
+
width: fixed ? '100%' : undefined,
|
|
28
|
+
zIndex: fixed ? zIndex : undefined,
|
|
29
|
+
...style,
|
|
30
|
+
}, children: items.map((item, i) => (_jsx(BottomActionBarButton, { item: item, showDivider: i < items.length - 1 }, item.id))) }));
|
|
31
|
+
};
|
|
32
|
+
const BottomActionBarButton = ({ item, showDivider, }) => {
|
|
33
|
+
var _a;
|
|
34
|
+
const [hover, setHover] = useState(false);
|
|
35
|
+
const [focus, setFocus] = useState(false);
|
|
36
|
+
const labelText = (_a = item.ariaLabel) !== null && _a !== void 0 ? _a : (typeof item.label === 'string' ? item.label : undefined);
|
|
37
|
+
const showPrimary = !item.disabled && (item.active || hover || focus);
|
|
38
|
+
const color = showPrimary ? primary[200] : neutral[200];
|
|
39
|
+
return (_jsxs("div", { style: { position: 'relative', height: '100%' }, children: [_jsxs("button", { "aria-label": labelText, "aria-pressed": item.active ? true : undefined, disabled: item.disabled, onClick: item.onClick, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), onFocus: () => setFocus(true), onBlur: () => {
|
|
40
|
+
setFocus(false);
|
|
41
|
+
setHover(false);
|
|
42
|
+
}, style: {
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
background: 'transparent',
|
|
45
|
+
border: 'none',
|
|
46
|
+
color,
|
|
47
|
+
cursor: item.disabled ? 'not-allowed' : 'pointer',
|
|
48
|
+
display: 'flex',
|
|
49
|
+
flexDirection: 'column',
|
|
50
|
+
gap: spacing.xs,
|
|
51
|
+
height: '100%',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
opacity: item.disabled ? 0.5 : 1,
|
|
54
|
+
// Browser default focus outline reads as a yellow/orange box on
|
|
55
|
+
// some platforms. Suppress it — the primary-color text + icon
|
|
56
|
+
// treatment driven by `focus` state is the keyboard-visible cue.
|
|
57
|
+
outline: 'none',
|
|
58
|
+
padding: spacing.xs,
|
|
59
|
+
transition: 'color 150ms ease',
|
|
60
|
+
WebkitTapHighlightColor: 'transparent',
|
|
61
|
+
width: '100%',
|
|
62
|
+
}, type: 'button', children: [_jsx("span", { style: {
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
color: 'inherit',
|
|
65
|
+
display: 'inline-flex',
|
|
66
|
+
height: 24,
|
|
67
|
+
justifyContent: 'center',
|
|
68
|
+
width: 24,
|
|
69
|
+
}, children: item.icon }), _jsx(Text, { variant: 'label', weight: item.active ? 'semibold' : 'medium', color: 'inherit', styles: { lineHeight: 1 }, children: item.label })] }), showDivider ? (_jsx("span", { "aria-hidden": 'true', style: {
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
right: 0,
|
|
72
|
+
top: '50%',
|
|
73
|
+
transform: 'translateY(-50%)',
|
|
74
|
+
width: 1,
|
|
75
|
+
height: 24,
|
|
76
|
+
backgroundColor: neutral[50],
|
|
77
|
+
pointerEvents: 'none',
|
|
78
|
+
} })) : null] }));
|
|
79
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { BottomActionBar } from './BottomActionBar';
|
|
3
|
+
declare const meta: Meta<typeof BottomActionBar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const ThreeUp: Story;
|
|
7
|
+
export declare const FourUp: Story;
|
|
8
|
+
export declare const WithContentAbove: Story;
|
|
9
|
+
export declare const DisabledItem: Story;
|
|
10
|
+
//# sourceMappingURL=BottomActionBar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomActionBar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BottomActionBar/BottomActionBar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAY5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAYtC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA+BrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAsCpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KA2B9B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAe1B,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconLayoutGrid, IconMovie, IconPhoto, IconSparkles, IconTypography, } from '@tabler/icons-react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { neutral } from '../../../constants/colors';
|
|
5
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
|
+
import { Text } from '../../Typography/Text/Text';
|
|
7
|
+
import { BottomActionBar } from './BottomActionBar';
|
|
8
|
+
const meta = {
|
|
9
|
+
component: BottomActionBar,
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component: 'Bottom-pinned launcher of icon+label cells. Columns are evenly distributed (`1fr` per item). Acts as the shell for slide-editor tool sheets; pair with `MobileDrawer` + `bottomOffset={height}` so sheets stack on top rather than overlap.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
layout: 'fullscreen',
|
|
17
|
+
},
|
|
18
|
+
title: 'Components/Layout/BottomActionBar',
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
export const ThreeUp = {
|
|
22
|
+
render: () => {
|
|
23
|
+
const [active, setActive] = useState('layout');
|
|
24
|
+
return (_jsx(BottomActionBar, { items: [
|
|
25
|
+
{
|
|
26
|
+
active: active === 'layout',
|
|
27
|
+
icon: _jsx(IconLayoutGrid, { size: 20 }),
|
|
28
|
+
id: 'layout',
|
|
29
|
+
label: 'Layout',
|
|
30
|
+
onClick: () => setActive('layout'),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
active: active === 'text',
|
|
34
|
+
icon: _jsx(IconTypography, { size: 20 }),
|
|
35
|
+
id: 'text',
|
|
36
|
+
label: 'Text',
|
|
37
|
+
onClick: () => setActive('text'),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
active: active === 'media',
|
|
41
|
+
icon: _jsx(IconPhoto, { size: 20 }),
|
|
42
|
+
id: 'media',
|
|
43
|
+
label: 'Media',
|
|
44
|
+
onClick: () => setActive('media'),
|
|
45
|
+
},
|
|
46
|
+
] }));
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export const FourUp = {
|
|
50
|
+
render: () => {
|
|
51
|
+
const [active, setActive] = useState('text');
|
|
52
|
+
return (_jsx(BottomActionBar, { items: [
|
|
53
|
+
{
|
|
54
|
+
active: active === 'layout',
|
|
55
|
+
icon: _jsx(IconLayoutGrid, { size: 20 }),
|
|
56
|
+
id: 'layout',
|
|
57
|
+
label: 'Layout',
|
|
58
|
+
onClick: () => setActive('layout'),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
active: active === 'text',
|
|
62
|
+
icon: _jsx(IconTypography, { size: 20 }),
|
|
63
|
+
id: 'text',
|
|
64
|
+
label: 'Text',
|
|
65
|
+
onClick: () => setActive('text'),
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
active: active === 'media',
|
|
69
|
+
icon: _jsx(IconMovie, { size: 20 }),
|
|
70
|
+
id: 'media',
|
|
71
|
+
label: 'Media',
|
|
72
|
+
onClick: () => setActive('media'),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
active: active === 'animate',
|
|
76
|
+
icon: _jsx(IconSparkles, { size: 20 }),
|
|
77
|
+
id: 'animate',
|
|
78
|
+
label: 'Animate',
|
|
79
|
+
onClick: () => setActive('animate'),
|
|
80
|
+
},
|
|
81
|
+
] }));
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
export const WithContentAbove = {
|
|
85
|
+
render: () => (_jsxs("div", { style: { minHeight: '100vh', paddingBottom: 80 }, children: [_jsxs("div", { style: { padding: spacing.lg }, children: [_jsx(Text, { children: "Scroll content sits above the bar. Use `paddingBottom` on the page wrapper so nothing is occluded by the fixed bar." }), Array.from({ length: 30 }, (_, i) => `row-${i + 1}`).map((key, i) => (_jsxs(Text, { style: { color: neutral[200], padding: `${spacing.xs} 0` }, variant: 'subtle', children: ["Row ", i + 1] }, key)))] }), _jsx(BottomActionBar, { items: [
|
|
86
|
+
{ icon: _jsx(IconLayoutGrid, { size: 20 }), id: 'layout', label: 'Layout' },
|
|
87
|
+
{ icon: _jsx(IconTypography, { size: 20 }), id: 'text', label: 'Text' },
|
|
88
|
+
{ icon: _jsx(IconPhoto, { size: 20 }), id: 'media', label: 'Media' },
|
|
89
|
+
] })] })),
|
|
90
|
+
};
|
|
91
|
+
export const DisabledItem = {
|
|
92
|
+
render: () => (_jsx(BottomActionBar, { items: [
|
|
93
|
+
{ icon: _jsx(IconLayoutGrid, { size: 20 }), id: 'layout', label: 'Layout' },
|
|
94
|
+
{ icon: _jsx(IconTypography, { size: 20 }), id: 'text', label: 'Text' },
|
|
95
|
+
{
|
|
96
|
+
disabled: true,
|
|
97
|
+
icon: _jsx(IconSparkles, { size: 20 }),
|
|
98
|
+
id: 'animate',
|
|
99
|
+
label: 'Animate',
|
|
100
|
+
},
|
|
101
|
+
] })),
|
|
102
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { BoxProps as MantineBoxProps } from '@mantine/core';
|
|
2
3
|
interface BoxProps extends MantineBoxProps {
|
|
3
4
|
width?: string | number;
|
|
4
5
|
onClick?: () => void;
|
|
5
6
|
}
|
|
6
|
-
declare const Box: ({ width, onClick, ...props }: BoxProps) =>
|
|
7
|
+
declare const Box: ({ width, onClick, ...props }: BoxProps) => React.JSX.Element;
|
|
7
8
|
export { Box };
|
|
8
9
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Box/Box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqB,QAAQ,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAE/E,UAAU,QAAS,SAAQ,eAAe;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,GAAG,GAAI,8BAA8B,QAAQ,sBAElD,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardProps as MantineCardProps } from '@mantine/core';
|
|
3
|
-
export interface CardProps extends MantineCardProps {
|
|
3
|
+
export interface CardProps extends MantineCardProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof MantineCardProps> {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
animate?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const Card: ({ children, animate, p, radius, ...props }: CardProps) =>
|
|
7
|
+
export declare const Card: ({ children, animate, p, radius, ...props }: CardProps) => React.JSX.Element;
|
|
8
8
|
//# sourceMappingURL=Card.d.ts.map
|