@taiv/ui 1.14.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/assets.d.ts +12 -1
- package/dist/assets/assets.d.ts.map +1 -1
- package/dist/assets/assets.js +22 -16
- package/dist/assets/brand/taiv-favicon-dark.png +0 -0
- package/dist/assets/brand/taiv-favicon-light.png +0 -0
- package/dist/assets/brand/taiv-icon-black.svg +10 -0
- package/dist/assets/brand/taiv-icon-dark.svg +17 -0
- package/dist/assets/brand/taiv-icon-white.svg +17 -0
- package/dist/assets/brand/taiv-logo-black.svg +16 -0
- package/dist/assets/brand/taiv-logo-dark.svg +23 -0
- package/dist/assets/brand/taiv-logo-old.svg +1 -0
- package/dist/assets/brand/taiv-logo-purple.svg +16 -0
- package/dist/assets/brand/taiv-logo-white.svg +23 -0
- package/dist/assets/icons.d.ts +1 -1
- package/dist/assets/icons.d.ts.map +1 -1
- package/dist/assets/icons.js +57 -53
- package/dist/assets/index.d.ts +3 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/index.js +2 -0
- package/dist/components/Data/BigCalendar/BigCalendar.d.ts +26 -0
- package/dist/components/Data/BigCalendar/BigCalendar.d.ts.map +1 -0
- package/dist/components/Data/BigCalendar/BigCalendar.js +54 -0
- package/dist/components/Data/BigCalendar/BigCalendar.stories.d.ts +8 -0
- package/dist/components/Data/BigCalendar/BigCalendar.stories.d.ts.map +1 -0
- package/dist/components/Data/BigCalendar/BigCalendar.stories.js +77 -0
- package/dist/components/Data/Calendar/Calendar.d.ts +102 -0
- package/dist/components/Data/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Data/Calendar/Calendar.js +671 -0
- package/dist/components/Data/Calendar/Calendar.stories.d.ts +10 -0
- package/dist/components/Data/Calendar/Calendar.stories.d.ts.map +1 -0
- package/dist/components/Data/Calendar/Calendar.stories.js +87 -0
- package/dist/components/Data/MediaPill/MediaPill.d.ts +27 -0
- package/dist/components/Data/MediaPill/MediaPill.d.ts.map +1 -0
- package/dist/components/Data/MediaPill/MediaPill.js +53 -0
- package/dist/components/Data/MediaPill/MediaPill.stories.d.ts +10 -0
- package/dist/components/Data/MediaPill/MediaPill.stories.d.ts.map +1 -0
- package/dist/components/Data/MediaPill/MediaPill.stories.js +51 -0
- package/dist/components/Info/Avatar/Avatar.d.ts +9 -0
- package/dist/components/Info/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Info/Avatar/Avatar.js +36 -0
- package/dist/components/Info/Avatar/Avatar.stories.d.ts +9 -0
- package/dist/components/Info/Avatar/Avatar.stories.d.ts.map +1 -0
- package/dist/components/Info/Avatar/Avatar.stories.js +78 -0
- package/dist/components/Info/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/components/Info/Badge/Badge.stories.js +21 -6
- package/dist/components/Info/Badge/sizes.d.ts +10 -10
- package/dist/components/Info/Badge/sizes.js +16 -16
- package/dist/components/Info/Badge/variants.d.ts +4 -4
- package/dist/components/Info/Badge/variants.d.ts.map +1 -1
- package/dist/components/Info/Badge/variants.js +26 -13
- package/dist/components/Info/Drawer/Drawer.d.ts +24 -0
- package/dist/components/Info/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Info/Drawer/Drawer.js +44 -0
- package/dist/components/Info/Drawer/Drawer.stories.d.ts +10 -0
- package/dist/components/Info/Drawer/Drawer.stories.d.ts.map +1 -0
- package/dist/components/Info/Drawer/Drawer.stories.js +47 -0
- package/dist/components/Info/HoverCard/HoverCard.d.ts +16 -0
- package/dist/components/Info/HoverCard/HoverCard.d.ts.map +1 -0
- package/dist/components/Info/HoverCard/HoverCard.js +26 -0
- package/dist/components/Info/HoverCard/HoverCard.stories.d.ts +11 -0
- package/dist/components/Info/HoverCard/HoverCard.stories.d.ts.map +1 -0
- package/dist/components/Info/HoverCard/HoverCard.stories.js +86 -0
- package/dist/components/Info/HoverCard/HoverCardMenuItem.d.ts +12 -0
- package/dist/components/Info/HoverCard/HoverCardMenuItem.d.ts.map +1 -0
- package/dist/components/Info/HoverCard/HoverCardMenuItem.js +22 -0
- package/dist/components/Info/Indicator/Indicator.d.ts +3 -0
- package/dist/components/Info/Indicator/Indicator.d.ts.map +1 -0
- package/dist/components/Info/Indicator/Indicator.js +1 -0
- package/dist/components/Info/Indicator/Indicator.stories.d.ts +11 -0
- package/dist/components/Info/Indicator/Indicator.stories.d.ts.map +1 -0
- package/dist/components/Info/Indicator/Indicator.stories.js +123 -0
- package/dist/components/Info/InfoCard/InfoCard.d.ts +2 -2
- package/dist/components/Info/InfoCard/InfoCard.d.ts.map +1 -1
- package/dist/components/Info/InfoCard/InfoCard.js +5 -5
- package/dist/components/Info/MobileDrawer/MobileDrawer.d.ts +30 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.d.ts.map +1 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.js +52 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.stories.d.ts +9 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.stories.d.ts.map +1 -0
- package/dist/components/Info/MobileDrawer/MobileDrawer.stories.js +38 -0
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts +17 -1
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts.map +1 -1
- package/dist/components/Info/Modals/FormModal/FormModal.js +30 -12
- package/dist/components/Info/Modals/FormModalV2/FormModalV2.d.ts +60 -0
- package/dist/components/Info/Modals/FormModalV2/FormModalV2.d.ts.map +1 -0
- package/dist/components/Info/Modals/FormModalV2/FormModalV2.js +96 -0
- package/dist/components/Info/Modals/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Info/Modals/Modal/Modal.js +9 -1
- package/dist/components/Info/Modals/StepperModal/StepperModal.d.ts +21 -0
- package/dist/components/Info/Modals/StepperModal/StepperModal.d.ts.map +1 -0
- package/dist/components/Info/Modals/StepperModal/StepperModal.js +50 -0
- package/dist/components/Info/Modals/StepperModal/StepperModal.stories.d.ts +10 -0
- package/dist/components/Info/Modals/StepperModal/StepperModal.stories.d.ts.map +1 -0
- package/dist/components/Info/Modals/StepperModal/StepperModal.stories.js +169 -0
- package/dist/components/Info/Modals/variants.d.ts +61 -41
- package/dist/components/Info/Modals/variants.d.ts.map +1 -1
- package/dist/components/Info/Modals/variants.js +58 -38
- package/dist/components/Info/Notifications/Notifications.stories.d.ts +1 -0
- package/dist/components/Info/Notifications/Notifications.stories.d.ts.map +1 -1
- package/dist/components/Info/Notifications/Notifications.stories.js +31 -0
- package/dist/components/Info/Notifications/variants.d.ts +25 -19
- package/dist/components/Info/Notifications/variants.d.ts.map +1 -1
- package/dist/components/Info/Notifications/variants.js +30 -24
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.d.ts +37 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.d.ts.map +1 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.js +17 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.stories.d.ts +7 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.stories.d.ts.map +1 -0
- package/dist/components/Info/ResponsiveDrawer/ResponsiveDrawer.stories.js +26 -0
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.d.ts +1 -1
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.js +9 -3
- package/dist/components/Info/Tooltips/Popover/Popover.d.ts +16 -0
- package/dist/components/Info/Tooltips/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Info/Tooltips/Popover/Popover.js +32 -0
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.d.ts +5 -1
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.js +10 -8
- package/dist/components/Inputs/Buttons/Button/Button.d.ts +3 -1
- package/dist/components/Inputs/Buttons/Button/Button.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.js +38 -5
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts +1 -0
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.stories.js +105 -79
- package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts +7 -2
- package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/IconButton.js +35 -11
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts +1 -0
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.js +100 -74
- package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts +15 -0
- package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/sizes.js +3 -0
- package/dist/components/Inputs/Buttons/shared/variants.d.ts +399 -164
- package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/shared/variants.js +353 -143
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.d.ts +40 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.d.ts.map +1 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.js +139 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.stories.d.ts +13 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.stories.d.ts.map +1 -0
- package/dist/components/Inputs/ColorPickerTrigger/ColorPickerTrigger.stories.js +75 -0
- package/dist/components/Inputs/ColorSwatch/ColorSwatch.d.ts +27 -0
- package/dist/components/Inputs/ColorSwatch/ColorSwatch.d.ts.map +1 -0
- package/dist/components/Inputs/ColorSwatch/ColorSwatch.js +46 -0
- package/dist/components/Inputs/Controls/DaysOfWeek/DaysOfWeek.d.ts +32 -0
- package/dist/components/Inputs/Controls/DaysOfWeek/DaysOfWeek.d.ts.map +1 -0
- package/dist/components/Inputs/Controls/DaysOfWeek/DaysOfWeek.js +92 -0
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.d.ts +11 -8
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.js +20 -12
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts +25 -11
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/Toggle/Toggle.js +67 -20
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts +1 -0
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.js +86 -69
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.js +23 -7
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.d.ts +12 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.js +87 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.stories.d.ts +13 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/DateTimePicker/DateTimePicker.stories.js +239 -0
- package/dist/components/Inputs/Dates/TimeInput/TimeInput.d.ts +19 -0
- package/dist/components/Inputs/Dates/TimeInput/TimeInput.d.ts.map +1 -0
- package/dist/components/Inputs/Dates/TimeInput/TimeInput.js +51 -0
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.js +8 -1
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts +2 -2
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.js +76 -57
- package/dist/components/Inputs/Dropdowns/Select/Select.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/Select/Select.js +5 -3
- package/dist/components/Inputs/Dropzone/Dropzone.d.ts +23 -0
- package/dist/components/Inputs/Dropzone/Dropzone.d.ts.map +1 -0
- package/dist/components/Inputs/Dropzone/Dropzone.js +44 -0
- package/dist/components/Inputs/Dropzone/Dropzone.stories.d.ts +12 -0
- package/dist/components/Inputs/Dropzone/Dropzone.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Dropzone/Dropzone.stories.js +114 -0
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.js +4 -1
- package/dist/components/Inputs/TextInputs/NumberInput/ResponsiveNumberInput.d.ts +46 -0
- package/dist/components/Inputs/TextInputs/NumberInput/ResponsiveNumberInput.d.ts.map +1 -0
- package/dist/components/Inputs/TextInputs/NumberInput/ResponsiveNumberInput.js +60 -0
- package/dist/components/Layout/Accordion/Accordion.d.ts +16 -0
- package/dist/components/Layout/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/Layout/Accordion/Accordion.js +63 -0
- package/dist/components/Layout/Accordion/Accordion.stories.d.ts +11 -0
- package/dist/components/Layout/Accordion/Accordion.stories.d.ts.map +1 -0
- package/dist/components/Layout/Accordion/Accordion.stories.js +148 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.d.ts +20 -5
- package/dist/components/Layout/AutoGrid/AutoGrid.d.ts.map +1 -1
- package/dist/components/Layout/AutoGrid/AutoGrid.js +51 -3
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.d.ts +1 -0
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.d.ts.map +1 -1
- package/dist/components/Layout/AutoGrid/AutoGrid.stories.js +39 -29
- package/dist/components/Layout/BottomActionBar/BottomActionBar.d.ts +40 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.d.ts.map +1 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.js +79 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.stories.d.ts +10 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.stories.d.ts.map +1 -0
- package/dist/components/Layout/BottomActionBar/BottomActionBar.stories.js +102 -0
- package/dist/components/Layout/Card/Card.d.ts +1 -1
- package/dist/components/Layout/Card/Card.d.ts.map +1 -1
- package/dist/components/Layout/Container/Container.d.ts +3 -0
- package/dist/components/Layout/Container/Container.d.ts.map +1 -0
- package/dist/components/Layout/Container/Container.js +1 -0
- package/dist/components/Layout/Container/Container.stories.d.ts +8 -0
- package/dist/components/Layout/Container/Container.stories.d.ts.map +1 -0
- package/dist/components/Layout/Container/Container.stories.js +52 -0
- package/dist/components/Layout/DataState/DataState.d.ts +34 -0
- package/dist/components/Layout/DataState/DataState.d.ts.map +1 -0
- package/dist/components/Layout/DataState/DataState.js +22 -0
- package/dist/components/Layout/DataState/DataState.stories.d.ts +11 -0
- package/dist/components/Layout/DataState/DataState.stories.d.ts.map +1 -0
- package/dist/components/Layout/DataState/DataState.stories.js +38 -0
- package/dist/components/Layout/Divider/Divider.d.ts.map +1 -1
- package/dist/components/Layout/Divider/Divider.js +4 -2
- package/dist/components/Layout/Group/Group.d.ts +1 -1
- package/dist/components/Layout/Group/Group.d.ts.map +1 -1
- package/dist/components/Layout/Loader/Loader.d.ts +1 -1
- package/dist/components/Layout/Loader/Loader.d.ts.map +1 -1
- package/dist/components/Layout/Loader/Loader.js +3 -2
- package/dist/components/Layout/Navbar/Navbar.d.ts +15 -0
- package/dist/components/Layout/Navbar/Navbar.d.ts.map +1 -0
- package/dist/components/Layout/Navbar/Navbar.js +20 -0
- package/dist/components/Layout/Navbar/Navbar.stories.d.ts +9 -0
- package/dist/components/Layout/Navbar/Navbar.stories.d.ts.map +1 -0
- package/dist/components/Layout/Navbar/Navbar.stories.js +98 -0
- package/dist/components/Layout/Page/Page.d.ts +13 -0
- package/dist/components/Layout/Page/Page.d.ts.map +1 -0
- package/dist/components/Layout/Page/Page.js +13 -0
- package/dist/components/Layout/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Layout/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Layout/Pagination/Pagination.js +53 -0
- package/dist/components/Layout/Pagination/Pagination.stories.d.ts +10 -0
- package/dist/components/Layout/Pagination/Pagination.stories.d.ts.map +1 -0
- package/dist/components/Layout/Pagination/Pagination.stories.js +76 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.d.ts +3 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.js +1 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.stories.d.ts +8 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.stories.d.ts.map +1 -0
- package/dist/components/Layout/ScrollArea/ScrollArea.stories.js +62 -0
- package/dist/components/Layout/Tabs/Tabs.d.ts +16 -5
- package/dist/components/Layout/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.js +53 -18
- package/dist/components/Layout/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.stories.js +39 -39
- package/dist/components/Layout/VirtualGrid/VirtualGrid.d.ts +63 -0
- package/dist/components/Layout/VirtualGrid/VirtualGrid.d.ts.map +1 -0
- package/dist/components/Layout/VirtualGrid/VirtualGrid.js +159 -0
- package/dist/components/Misc/Burger/Burger.d.ts +6 -0
- package/dist/components/Misc/Burger/Burger.d.ts.map +1 -0
- package/dist/components/Misc/Burger/Burger.js +7 -0
- package/dist/components/Misc/Burger/Burger.stories.d.ts +10 -0
- package/dist/components/Misc/Burger/Burger.stories.d.ts.map +1 -0
- package/dist/components/Misc/Burger/Burger.stories.js +86 -0
- package/dist/components/Misc/Carousel/Carousel.d.ts +32 -0
- package/dist/components/Misc/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/Misc/Carousel/Carousel.js +16 -0
- package/dist/components/Misc/DragHandle/DragHandle.d.ts +19 -0
- package/dist/components/Misc/DragHandle/DragHandle.d.ts.map +1 -0
- package/dist/components/Misc/DragHandle/DragHandle.js +39 -0
- package/dist/components/Misc/DragHandle/DragHandle.stories.d.ts +9 -0
- package/dist/components/Misc/DragHandle/DragHandle.stories.d.ts.map +1 -0
- package/dist/components/Misc/DragHandle/DragHandle.stories.js +54 -0
- package/dist/components/Misc/FAB/FAB.d.ts +54 -0
- package/dist/components/Misc/FAB/FAB.d.ts.map +1 -0
- package/dist/components/Misc/FAB/FAB.js +53 -0
- package/dist/components/Misc/FAB/FAB.stories.d.ts +10 -0
- package/dist/components/Misc/FAB/FAB.stories.d.ts.map +1 -0
- package/dist/components/Misc/FAB/FAB.stories.js +100 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.d.ts +50 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.d.ts.map +1 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.js +40 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.stories.d.ts +9 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.stories.d.ts.map +1 -0
- package/dist/components/Misc/FloatingToolbar/FloatingToolbar.stories.js +53 -0
- package/dist/components/Misc/HoverAction/HoverAction.d.ts +50 -0
- package/dist/components/Misc/HoverAction/HoverAction.d.ts.map +1 -0
- package/dist/components/Misc/HoverAction/HoverAction.js +61 -0
- package/dist/components/Misc/HoverAction/HoverAction.stories.d.ts +12 -0
- package/dist/components/Misc/HoverAction/HoverAction.stories.d.ts.map +1 -0
- package/dist/components/Misc/HoverAction/HoverAction.stories.js +96 -0
- package/dist/components/Misc/IconBadge/IconBadge.d.ts.map +1 -1
- package/dist/components/Misc/IconBadge/IconBadge.js +8 -6
- package/dist/components/Misc/Image/Image.d.ts +3 -0
- package/dist/components/Misc/Image/Image.d.ts.map +1 -0
- package/dist/components/Misc/Image/Image.js +1 -0
- package/dist/components/Misc/Image/Image.stories.d.ts +11 -0
- package/dist/components/Misc/Image/Image.stories.d.ts.map +1 -0
- package/dist/components/Misc/Image/Image.stories.js +63 -0
- package/dist/components/Misc/Kbd/Kbd.d.ts +6 -0
- package/dist/components/Misc/Kbd/Kbd.d.ts.map +1 -0
- package/dist/components/Misc/Kbd/Kbd.js +16 -0
- package/dist/components/Misc/Kbd/Kbd.stories.d.ts +9 -0
- package/dist/components/Misc/Kbd/Kbd.stories.d.ts.map +1 -0
- package/dist/components/Misc/Kbd/Kbd.stories.js +52 -0
- package/dist/components/Misc/Menu/Menu.d.ts +17 -0
- package/dist/components/Misc/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Misc/Menu/Menu.js +52 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.d.ts +42 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.d.ts.map +1 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.js +110 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.stories.d.ts +11 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.stories.d.ts.map +1 -0
- package/dist/components/Misc/OverflowFade/OverflowFade.stories.js +112 -0
- package/dist/components/Misc/Picker/Picker.d.ts +62 -0
- package/dist/components/Misc/Picker/Picker.d.ts.map +1 -0
- package/dist/components/Misc/Picker/Picker.js +111 -0
- package/dist/components/Misc/Picker/Picker.stories.d.ts +14 -0
- package/dist/components/Misc/Picker/Picker.stories.d.ts.map +1 -0
- package/dist/components/Misc/Picker/Picker.stories.js +154 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.d.ts +38 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.d.ts.map +1 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.js +70 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.stories.d.ts +11 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.stories.d.ts.map +1 -0
- package/dist/components/Misc/SelectableObject/SelectableObject.stories.js +84 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.d.ts +26 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.d.ts.map +1 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.js +41 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.stories.d.ts +10 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.stories.d.ts.map +1 -0
- package/dist/components/Misc/SelectionToolbar/SelectionToolbar.stories.js +48 -0
- package/dist/components/Misc/Stepper/Step.stories.d.ts +118 -118
- package/dist/components/Misc/Stepper/variants.d.ts +1 -1
- package/dist/components/Misc/Timeline/Timeline.d.ts +18 -0
- package/dist/components/Misc/Timeline/Timeline.d.ts.map +1 -0
- package/dist/components/Misc/Timeline/Timeline.js +38 -0
- package/dist/components/Misc/Timeline/Timeline.stories.d.ts +8 -0
- package/dist/components/Misc/Timeline/Timeline.stories.d.ts.map +1 -0
- package/dist/components/Misc/Timeline/Timeline.stories.js +54 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.d.ts +35 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.d.ts.map +1 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.js +112 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.stories.d.ts +11 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.stories.d.ts.map +1 -0
- package/dist/components/Typography/InlineEditableText/InlineEditableText.stories.js +48 -0
- package/dist/components/index.d.ts +149 -66
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +110 -67
- package/dist/constants/colors.d.ts +117 -91
- package/dist/constants/colors.d.ts.map +1 -1
- package/dist/constants/colors.js +56 -43
- package/dist/constants/font.d.ts +4 -4
- package/dist/constants/font.js +2 -2
- package/dist/hooks/index.d.ts +9 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +7 -1
- package/dist/hooks/useConfirmationModal.d.ts.map +1 -1
- package/dist/hooks/useConfirmationModal.js +20 -1
- package/dist/hooks/useDisclosure.d.ts +11 -0
- package/dist/hooks/useDisclosure.d.ts.map +1 -0
- package/dist/hooks/useDisclosure.js +10 -0
- package/dist/hooks/useHeadroom.d.ts +18 -0
- package/dist/hooks/useHeadroom.d.ts.map +1 -0
- package/dist/hooks/useHeadroom.js +17 -0
- package/dist/hooks/useInfoModal.d.ts.map +1 -1
- package/dist/hooks/useInfoModal.js +13 -1
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/hooks/useMediaQuery.js +1 -0
- package/dist/hooks/useNotifications.d.ts +39 -7
- package/dist/hooks/useNotifications.d.ts.map +1 -1
- package/dist/hooks/useNotifications.js +108 -5
- package/dist/hooks/usePagination.d.ts +11 -0
- package/dist/hooks/usePagination.d.ts.map +1 -0
- package/dist/hooks/usePagination.js +2 -0
- package/dist/hooks/useScrollLock.d.ts +21 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -0
- package/dist/hooks/useScrollLock.js +20 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/styles/iosInputZoomFix.d.ts +31 -0
- package/dist/styles/iosInputZoomFix.d.ts.map +1 -0
- package/dist/styles/iosInputZoomFix.js +135 -0
- package/dist/utils/bytes.d.ts +10 -0
- package/dist/utils/bytes.d.ts.map +1 -0
- package/dist/utils/bytes.js +17 -0
- package/dist/utils/datetime.d.ts +18 -0
- package/dist/utils/datetime.d.ts.map +1 -0
- package/dist/utils/datetime.js +42 -0
- package/dist/utils/duration.d.ts +17 -0
- package/dist/utils/duration.d.ts.map +1 -0
- package/dist/utils/duration.js +30 -0
- package/dist/utils/index.d.ts +8 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +7 -2
- package/dist/utils/sort.d.ts +44 -0
- package/dist/utils/sort.d.ts.map +1 -0
- package/dist/utils/sort.js +53 -0
- package/dist/utils/string.d.ts +22 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +25 -0
- package/package.json +26 -2
|
@@ -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-runtime").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,mDA2BV,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"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheck, IconPencil, IconPlus, IconTrash } from '@tabler/icons-react';
|
|
3
|
+
import { neutral } from '../../../constants/colors';
|
|
4
|
+
import { spacing } from '../../../constants/spacing';
|
|
5
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
|
+
import { Text } from '../../Typography/Text/Text';
|
|
7
|
+
import { Title } from '../../Typography/Title/Title';
|
|
8
|
+
import { FAB } from './FAB';
|
|
9
|
+
const meta = {
|
|
10
|
+
argTypes: {
|
|
11
|
+
ariaLabel: {
|
|
12
|
+
control: { type: 'text' },
|
|
13
|
+
description: 'Accessible label — required since the FAB has no visible text',
|
|
14
|
+
},
|
|
15
|
+
hidden: {
|
|
16
|
+
control: { type: 'boolean' },
|
|
17
|
+
description: 'Force-hide the FAB regardless of viewport',
|
|
18
|
+
table: { defaultValue: { summary: 'false' } },
|
|
19
|
+
},
|
|
20
|
+
mobileOnly: {
|
|
21
|
+
control: { type: 'boolean' },
|
|
22
|
+
description: 'Only render on tablet/mobile viewports (≤ 768px)',
|
|
23
|
+
table: { defaultValue: { summary: 'true' } },
|
|
24
|
+
},
|
|
25
|
+
offset: {
|
|
26
|
+
control: { type: 'text' },
|
|
27
|
+
description: 'Distance from the anchored edges',
|
|
28
|
+
table: { defaultValue: { summary: 'spacing.lg (16px)' } },
|
|
29
|
+
},
|
|
30
|
+
onClick: { action: 'clicked' },
|
|
31
|
+
position: {
|
|
32
|
+
control: { type: 'select' },
|
|
33
|
+
options: ['bottom-right', 'bottom-left', 'top-right', 'top-left'],
|
|
34
|
+
table: { defaultValue: { summary: "'bottom-right'" } },
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
control: { type: 'select' },
|
|
38
|
+
options: ['sm', 'md', 'lg', 'xl', '2xl'],
|
|
39
|
+
table: { defaultValue: { summary: "'2xl'" } },
|
|
40
|
+
},
|
|
41
|
+
variant: {
|
|
42
|
+
control: { type: 'select' },
|
|
43
|
+
options: ['primary', 'secondary', 'tertiary', 'cancel', 'success', 'warning'],
|
|
44
|
+
table: { defaultValue: { summary: "'primary'" } },
|
|
45
|
+
},
|
|
46
|
+
zIndex: {
|
|
47
|
+
control: { type: 'number' },
|
|
48
|
+
table: { defaultValue: { summary: '10' } },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
component: FAB,
|
|
52
|
+
parameters: {
|
|
53
|
+
docs: {
|
|
54
|
+
description: {
|
|
55
|
+
component: "Floating Action Button. A `position: fixed` IconButton anchored to a viewport corner, used for the page's primary action when screen real estate is tight. Defaults to mobile-only (≤ 768px) — on desktop, prefer an inline `<Button>` for the same action.",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
layout: 'fullscreen',
|
|
59
|
+
},
|
|
60
|
+
title: 'Components/Misc/FAB',
|
|
61
|
+
};
|
|
62
|
+
export default meta;
|
|
63
|
+
const StageBackdrop = ({ children }) => (_jsxs(Stack, { gap: spacing.md, style: {
|
|
64
|
+
background: neutral[25],
|
|
65
|
+
height: '100vh',
|
|
66
|
+
padding: spacing.xl,
|
|
67
|
+
position: 'relative',
|
|
68
|
+
}, children: [_jsx(Title, { variant: 'sectionHeader', children: "Page content" }), _jsxs(Text, { variant: 'subtle', children: ["The FAB anchors to the viewport \u2014 scroll, resize, or move other content; it stays put. Defaults to mobile-only; toggle ", _jsx("code", { children: "mobileOnly" }), " in controls to preview it on desktop."] }), children] }));
|
|
69
|
+
export const Default = {
|
|
70
|
+
args: {
|
|
71
|
+
ariaLabel: 'Add item',
|
|
72
|
+
icon: _jsx(IconPlus, {}),
|
|
73
|
+
mobileOnly: false,
|
|
74
|
+
onClick: () => { },
|
|
75
|
+
},
|
|
76
|
+
render: (args) => (_jsx(StageBackdrop, { children: _jsx(FAB, { ...args }) })),
|
|
77
|
+
};
|
|
78
|
+
export const Positions = {
|
|
79
|
+
parameters: {
|
|
80
|
+
docs: {
|
|
81
|
+
description: {
|
|
82
|
+
story: 'Each of the four corner anchors. `mobileOnly` disabled for the demo.',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
render: () => (_jsxs(StageBackdrop, { children: [_jsx(FAB, { ariaLabel: 'Top-left', icon: _jsx(IconPencil, {}), mobileOnly: false, onClick: () => { }, position: 'top-left', variant: 'secondary' }), _jsx(FAB, { ariaLabel: 'Top-right', icon: _jsx(IconCheck, {}), mobileOnly: false, onClick: () => { }, position: 'top-right', variant: 'success' }), _jsx(FAB, { ariaLabel: 'Bottom-left', icon: _jsx(IconTrash, {}), mobileOnly: false, onClick: () => { }, position: 'bottom-left', variant: 'cancel' }), _jsx(FAB, { ariaLabel: 'Bottom-right', icon: _jsx(IconPlus, {}), mobileOnly: false, onClick: () => { }, position: 'bottom-right' })] })),
|
|
87
|
+
};
|
|
88
|
+
export const Variants = {
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
description: {
|
|
92
|
+
story: "All IconButton variants are supported. `tertiary` (white bg, primary outline) is the recommended FAB style — softer than `primary` while still reading as a brand-colored CTA.",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
render: () => (_jsxs(StageBackdrop, { children: [_jsx(FAB, { ariaLabel: 'Primary', icon: _jsx(IconPlus, {}), mobileOnly: false, onClick: () => { }, position: 'bottom-right' }), _jsx(FAB, { ariaLabel: 'Tertiary', icon: _jsx(IconPlus, {}), mobileOnly: false, onClick: () => { }, position: 'bottom-left', variant: 'tertiary' })] })),
|
|
97
|
+
};
|
|
98
|
+
export const Sizes = {
|
|
99
|
+
render: () => (_jsxs(StageBackdrop, { children: [_jsx(FAB, { ariaLabel: '2XL (default, recommended for mobile FABs)', icon: _jsx(IconPlus, {}), mobileOnly: false, onClick: () => { }, position: 'bottom-right' }), _jsx(FAB, { ariaLabel: 'XL', icon: _jsx(IconPlus, {}), mobileOnly: false, onClick: () => { }, position: 'bottom-left', size: 'xl' }), _jsx(FAB, { ariaLabel: 'Large', icon: _jsx(IconPlus, {}), mobileOnly: false, onClick: () => { }, position: 'top-left', size: 'lg' }), _jsx(FAB, { ariaLabel: 'Medium', icon: _jsx(IconPlus, {}), mobileOnly: false, onClick: () => { }, position: 'top-right', size: 'md' })] })),
|
|
100
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FloatingToolbarProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* How `children` are separated. Default `spacing.xs`.
|
|
6
|
+
*/
|
|
7
|
+
gap?: string | number;
|
|
8
|
+
/**
|
|
9
|
+
* When children overflow horizontally, scroll instead of wrapping. Default `true`.
|
|
10
|
+
*/
|
|
11
|
+
scrollOverflow?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Override the pill's inner padding. Accepts a CSS `padding` value.
|
|
14
|
+
* Default `'4px 8px'`.
|
|
15
|
+
*/
|
|
16
|
+
padding?: string | number;
|
|
17
|
+
/**
|
|
18
|
+
* Additional inline styles forwarded to the pill container. Consumers use
|
|
19
|
+
* this to position the toolbar over a canvas — the component itself is
|
|
20
|
+
* position-agnostic (see `SelectableObject` + consumer selection state
|
|
21
|
+
* for the anchor/flipping behavior).
|
|
22
|
+
*/
|
|
23
|
+
style?: React.CSSProperties;
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Accessible label for the toolbar. Default `'Formatting options'`.
|
|
27
|
+
*/
|
|
28
|
+
ariaLabel?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Chrome for a Canva-style floating action toolbar. Renders a white pill with
|
|
32
|
+
* shadow + border + horizontal overflow scrolling and a flex-row gap between
|
|
33
|
+
* children. **Positioning is the consumer's responsibility** — wrap this in
|
|
34
|
+
* your own portal / absolute-positioned shell, or use it inline.
|
|
35
|
+
*
|
|
36
|
+
* The *composition* inside (font select, size stepper, B/I/U, color pickers,
|
|
37
|
+
* delete) stays in the consuming app since it depends on the canvas object's
|
|
38
|
+
* shape. This component only ships the shell.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* <div style={{ position: 'absolute', top: y, left: x, transform: 'translate(-50%, -100%)' }}>
|
|
42
|
+
* <FloatingToolbar>
|
|
43
|
+
* <Select ... />
|
|
44
|
+
* <Divider orientation="vertical" />
|
|
45
|
+
* <IconButton>...</IconButton>
|
|
46
|
+
* </FloatingToolbar>
|
|
47
|
+
* </div>
|
|
48
|
+
*/
|
|
49
|
+
export declare const FloatingToolbar: ({ children, gap, scrollOverflow, padding, style, className, ariaLabel, }: FloatingToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
//# sourceMappingURL=FloatingToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingToolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/FloatingToolbar/FloatingToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,GAAI,0EAQ7B,oBAAoB,4CA6BtB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { neutral, white } from '../../../constants/colors';
|
|
4
|
+
import { spacing } from '../../../constants/spacing';
|
|
5
|
+
/**
|
|
6
|
+
* Chrome for a Canva-style floating action toolbar. Renders a white pill with
|
|
7
|
+
* shadow + border + horizontal overflow scrolling and a flex-row gap between
|
|
8
|
+
* children. **Positioning is the consumer's responsibility** — wrap this in
|
|
9
|
+
* your own portal / absolute-positioned shell, or use it inline.
|
|
10
|
+
*
|
|
11
|
+
* The *composition* inside (font select, size stepper, B/I/U, color pickers,
|
|
12
|
+
* delete) stays in the consuming app since it depends on the canvas object's
|
|
13
|
+
* shape. This component only ships the shell.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <div style={{ position: 'absolute', top: y, left: x, transform: 'translate(-50%, -100%)' }}>
|
|
17
|
+
* <FloatingToolbar>
|
|
18
|
+
* <Select ... />
|
|
19
|
+
* <Divider orientation="vertical" />
|
|
20
|
+
* <IconButton>...</IconButton>
|
|
21
|
+
* </FloatingToolbar>
|
|
22
|
+
* </div>
|
|
23
|
+
*/
|
|
24
|
+
export const FloatingToolbar = ({ children, gap = spacing.xs, scrollOverflow = true, padding = `${spacing.xxs} ${spacing.sm}`, style, className, ariaLabel = 'Formatting options', }) => {
|
|
25
|
+
return (_jsx("div", { "aria-label": ariaLabel, className: className, role: 'toolbar', style: {
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
backgroundColor: white,
|
|
28
|
+
border: `1px solid ${neutral[50]}`,
|
|
29
|
+
borderRadius: '999px',
|
|
30
|
+
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.12)',
|
|
31
|
+
display: 'inline-flex',
|
|
32
|
+
gap,
|
|
33
|
+
maxWidth: '100%',
|
|
34
|
+
overflowX: scrollOverflow ? 'auto' : 'visible',
|
|
35
|
+
overflowY: 'visible',
|
|
36
|
+
padding,
|
|
37
|
+
whiteSpace: 'nowrap',
|
|
38
|
+
...style,
|
|
39
|
+
}, children: React.Children.map(children, (child, i) => (_jsx("div", { style: { flexShrink: 0, display: 'inline-flex', alignItems: 'center' }, children: child }, i))) }));
|
|
40
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FloatingToolbar } from './FloatingToolbar';
|
|
3
|
+
declare const meta: Meta<typeof FloatingToolbar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const TextToolbar: Story;
|
|
7
|
+
export declare const OverflowScroll: Story;
|
|
8
|
+
export declare const OverCanvas: Story;
|
|
9
|
+
//# sourceMappingURL=FloatingToolbar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingToolbar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/FloatingToolbar/FloatingToolbar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAc5D,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,WAAW,EAAE,KA8CzB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAY5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAmCxB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconBold, IconItalic, IconTrash, IconUnderline, } from '@tabler/icons-react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { neutral } from '../../../constants/colors';
|
|
5
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
|
+
import { IconButton } from '../../Inputs/Buttons/IconButton/IconButton';
|
|
7
|
+
import { ColorPickerTrigger } from '../../Inputs/ColorPickerTrigger/ColorPickerTrigger';
|
|
8
|
+
import { Select } from '../../Inputs/Dropdowns/Select/Select';
|
|
9
|
+
import { Divider } from '../../Layout/Divider/Divider';
|
|
10
|
+
import { FloatingToolbar } from './FloatingToolbar';
|
|
11
|
+
const meta = {
|
|
12
|
+
component: FloatingToolbar,
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component: "White pill used as the chrome for Canva-style floating action toolbars. Positioning is the consumer's responsibility — wrap this in a portal / absolute-positioned shell, or use it inline.",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
layout: 'centered',
|
|
20
|
+
},
|
|
21
|
+
title: 'Components/Misc/FloatingToolbar',
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
export const TextToolbar = {
|
|
25
|
+
render: () => {
|
|
26
|
+
const [font, setFont] = useState('poppins');
|
|
27
|
+
const [color, setColor] = useState('#1E293B');
|
|
28
|
+
const [fill, setFill] = useState('transparent');
|
|
29
|
+
return (_jsxs(FloatingToolbar, { children: [_jsx(Select, { data: [
|
|
30
|
+
{ label: 'Poppins', value: 'poppins' },
|
|
31
|
+
{ label: 'Inter', value: 'inter' },
|
|
32
|
+
{ label: 'Georgia', value: 'georgia' },
|
|
33
|
+
], onChange: setFont, size: 'sm', style: { width: 140 }, value: font }), _jsx(Divider, { orientation: 'vertical' }), _jsx(IconButton, { "aria-label": 'Bold', variant: 'text', children: _jsx(IconBold, { size: 16 }) }), _jsx(IconButton, { "aria-label": 'Italic', variant: 'text', children: _jsx(IconItalic, { size: 16 }) }), _jsx(IconButton, { "aria-label": 'Underline', variant: 'text', children: _jsx(IconUnderline, { size: 16 }) }), _jsx(Divider, { orientation: 'vertical' }), _jsx(ColorPickerTrigger, { onChange: setColor, value: color, variant: 'fontColor' }), _jsx(ColorPickerTrigger, { onChange: setFill, value: fill, variant: 'fillColor' }), _jsx(Divider, { orientation: 'vertical' }), _jsx(IconButton, { "aria-label": 'Delete', variant: 'text', children: _jsx(IconTrash, { size: 16 }) })] }));
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const OverflowScroll = {
|
|
37
|
+
render: () => (_jsx("div", { style: { maxWidth: 320 }, children: _jsx(FloatingToolbar, { children: Array.from({ length: 12 }, (_, i) => `tool-${i + 1}`).map((key, i) => (_jsx(IconButton, { "aria-label": `Tool ${i + 1}`, variant: 'text', children: _jsx(IconBold, { size: 16 }) }, key))) }) })),
|
|
38
|
+
};
|
|
39
|
+
export const OverCanvas = {
|
|
40
|
+
render: () => (_jsx("div", { style: {
|
|
41
|
+
background: neutral[25],
|
|
42
|
+
border: `1px solid ${neutral[50]}`,
|
|
43
|
+
borderRadius: 8,
|
|
44
|
+
height: 320,
|
|
45
|
+
position: 'relative',
|
|
46
|
+
width: 480,
|
|
47
|
+
}, children: _jsx("div", { style: {
|
|
48
|
+
left: '50%',
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
top: spacing.md,
|
|
51
|
+
transform: 'translateX(-50%)',
|
|
52
|
+
}, children: _jsxs(FloatingToolbar, { children: [_jsx(IconButton, { "aria-label": 'Bold', variant: 'text', children: _jsx(IconBold, { size: 16 }) }), _jsx(IconButton, { "aria-label": 'Italic', variant: 'text', children: _jsx(IconItalic, { size: 16 }) }), _jsx(Divider, { orientation: 'vertical' }), _jsx(IconButton, { "aria-label": 'Delete', variant: 'text', children: _jsx(IconTrash, { size: 16 }) })] }) }) })),
|
|
53
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare const componentVariants: {
|
|
3
|
+
readonly close: {
|
|
4
|
+
readonly Icon: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
5
|
+
readonly color: "#6D6D6D";
|
|
6
|
+
readonly hoverColor: "#C10007";
|
|
7
|
+
};
|
|
8
|
+
readonly trash: {
|
|
9
|
+
readonly Icon: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
10
|
+
readonly color: "#6D6D6D";
|
|
11
|
+
readonly hoverColor: "#C10007";
|
|
12
|
+
};
|
|
13
|
+
readonly edit: {
|
|
14
|
+
readonly Icon: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
15
|
+
readonly color: "#6D6D6D";
|
|
16
|
+
readonly hoverColor: "#6F3FEE";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
declare const componentSizes: {
|
|
20
|
+
readonly sm: {
|
|
21
|
+
readonly borderLength: 24;
|
|
22
|
+
readonly iconSize: 14;
|
|
23
|
+
};
|
|
24
|
+
readonly md: {
|
|
25
|
+
readonly borderLength: 32;
|
|
26
|
+
readonly iconSize: 18;
|
|
27
|
+
};
|
|
28
|
+
readonly lg: {
|
|
29
|
+
readonly borderLength: 44;
|
|
30
|
+
readonly iconSize: 24;
|
|
31
|
+
};
|
|
32
|
+
readonly xl: {
|
|
33
|
+
readonly borderLength: 56;
|
|
34
|
+
readonly iconSize: 30;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export interface HoverActionProps {
|
|
38
|
+
variant: keyof typeof componentVariants;
|
|
39
|
+
onClick: () => void;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
showBackground?: boolean;
|
|
42
|
+
offset?: number;
|
|
43
|
+
visible?: boolean;
|
|
44
|
+
iconSize?: number;
|
|
45
|
+
size?: keyof typeof componentSizes;
|
|
46
|
+
fullWidth?: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare const HoverAction: ({ variant, onClick, children, showBackground, offset, visible, iconSize, size, fullWidth, }: HoverActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export { HoverAction };
|
|
50
|
+
//# sourceMappingURL=HoverAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverAction.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/HoverAction/HoverAction.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAM9C,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;CAgBb,CAAC;AAEX,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;CAKV,CAAC;AAEX,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,OAAO,iBAAiB,CAAC;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,WAAW,GAAI,6FAUlB,gBAAgB,4CA4ClB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ActionIcon, Box } from '@mantine/core';
|
|
3
|
+
import { useHover } from '@mantine/hooks';
|
|
4
|
+
import { IconX, IconTrash, IconPencil } from '@tabler/icons-react';
|
|
5
|
+
import { neutral, error, primary, white } from '../../../constants/colors';
|
|
6
|
+
const componentVariants = {
|
|
7
|
+
close: {
|
|
8
|
+
Icon: IconX,
|
|
9
|
+
color: neutral[200],
|
|
10
|
+
hoverColor: error[200],
|
|
11
|
+
},
|
|
12
|
+
trash: {
|
|
13
|
+
Icon: IconTrash,
|
|
14
|
+
color: neutral[200],
|
|
15
|
+
hoverColor: error[200],
|
|
16
|
+
},
|
|
17
|
+
edit: {
|
|
18
|
+
Icon: IconPencil,
|
|
19
|
+
color: neutral[200],
|
|
20
|
+
hoverColor: primary[200],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const componentSizes = {
|
|
24
|
+
sm: { borderLength: 24, iconSize: 14 },
|
|
25
|
+
md: { borderLength: 32, iconSize: 18 },
|
|
26
|
+
lg: { borderLength: 44, iconSize: 24 },
|
|
27
|
+
xl: { borderLength: 56, iconSize: 30 },
|
|
28
|
+
};
|
|
29
|
+
const HoverAction = ({ variant, onClick, children, showBackground = false, offset = 10, visible, iconSize, size = 'md', fullWidth = false, }) => {
|
|
30
|
+
const { ref, hovered } = useHover();
|
|
31
|
+
const { Icon, color, hoverColor } = componentVariants[variant];
|
|
32
|
+
const selectedSize = componentSizes[size];
|
|
33
|
+
const resolvedIconSize = iconSize !== null && iconSize !== void 0 ? iconSize : selectedSize.iconSize;
|
|
34
|
+
const isVisible = visible !== undefined ? visible : hovered;
|
|
35
|
+
const handleClick = (e) => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
onClick();
|
|
39
|
+
};
|
|
40
|
+
return (_jsxs(Box, { ref: ref, sx: { position: 'relative', width: fullWidth ? '100%' : 'fit-content' }, children: [children, _jsx(ActionIcon, { onClick: handleClick, radius: 'xl', sx: {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
top: -offset,
|
|
43
|
+
right: -offset,
|
|
44
|
+
height: `${selectedSize.borderLength}px`,
|
|
45
|
+
width: `${selectedSize.borderLength}px`,
|
|
46
|
+
minHeight: `${selectedSize.borderLength}px`,
|
|
47
|
+
minWidth: `${selectedSize.borderLength}px`,
|
|
48
|
+
opacity: isVisible ? 1 : 0,
|
|
49
|
+
pointerEvents: isVisible ? 'auto' : 'none',
|
|
50
|
+
transition: 'opacity 0.15s ease-in-out, color 0.1s ease-in-out',
|
|
51
|
+
backgroundColor: showBackground ? white : 'transparent',
|
|
52
|
+
boxShadow: showBackground ? '0 2px 6px rgba(0, 0, 0, 0.12)' : 'none',
|
|
53
|
+
color,
|
|
54
|
+
'&:hover': {
|
|
55
|
+
backgroundColor: white,
|
|
56
|
+
color: hoverColor,
|
|
57
|
+
boxShadow: '0 2px 6px rgba(0, 0, 0, 0.12)',
|
|
58
|
+
},
|
|
59
|
+
}, children: _jsx(Icon, { size: resolvedIconSize }) })] }));
|
|
60
|
+
};
|
|
61
|
+
export { HoverAction };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { HoverAction } from './HoverAction';
|
|
3
|
+
declare const meta: Meta<typeof HoverAction>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof HoverAction>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Variants: Story;
|
|
8
|
+
export declare const HiddenUntilHover: Story;
|
|
9
|
+
export declare const AlwaysVisible: Story;
|
|
10
|
+
export declare const WrappingACard: Story;
|
|
11
|
+
export declare const CustomOffset: Story;
|
|
12
|
+
//# sourceMappingURL=HoverAction.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverAction.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Misc/HoverAction/HoverAction.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA8B5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAiClC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KActB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAc9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAa3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAqB3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAc1B,CAAC"}
|