@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,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useDisclosure } from '../../../hooks/useDisclosure';
|
|
3
|
+
import { Button } from '../../Inputs/Buttons/Button/Button';
|
|
4
|
+
import { Group } from '../../Layout/Group/Group';
|
|
5
|
+
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
|
+
import { Text } from '../../Typography/Text/Text';
|
|
7
|
+
import { MobileDrawer } from './MobileDrawer';
|
|
8
|
+
const meta = {
|
|
9
|
+
component: MobileDrawer,
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component: 'Bottom-anchored mobile sheet with a grab-handle, rounded top corners, and pinned header/footer. Use on touch viewports; pair with the right-anchored `Drawer` on desktop or use `ResponsiveDrawer` to branch automatically.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
layout: 'fullscreen',
|
|
17
|
+
},
|
|
18
|
+
title: 'Components/Info/MobileDrawer',
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
export const Default = {
|
|
22
|
+
render: () => {
|
|
23
|
+
const [opened, { open, close }] = useDisclosure(false);
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: open, children: "Open mobile drawer" }), _jsx(MobileDrawer, { onClose: close, opened: opened, title: 'Slide details', children: _jsxs(Stack, { children: [_jsx(Text, { children: "Grab handle at the top. Body scrolls when needed." }), _jsx(Text, { variant: 'subtle', children: "Anchored to the bottom at up to 75% viewport height." })] }) })] }));
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const WithFooter = {
|
|
28
|
+
render: () => {
|
|
29
|
+
const [opened, { open, close }] = useDisclosure(false);
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: open, children: "Open with pinned footer" }), _jsx(MobileDrawer, { footer: _jsxs(Group, { grow: true, children: [_jsx(Button, { onClick: close, variant: 'cancel', children: "Cancel" }), _jsx(Button, { onClick: close, children: "Confirm" })] }), onClose: close, opened: opened, title: 'Discard changes?', children: _jsx(Text, { children: "Pinned footer keeps primary actions visible while body scrolls." }) })] }));
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const ShorterSheet = {
|
|
34
|
+
render: () => {
|
|
35
|
+
const [opened, { open, close }] = useDisclosure(false);
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: open, children: "Open 60% sheet" }), _jsx(MobileDrawer, { maxHeightVh: 60, onClose: close, opened: opened, title: 'Filter', children: _jsx(Text, { children: "Custom viewport cap via `maxHeightVh`." }) })] }));
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { CSSObject } from "@mantine/core";
|
|
2
3
|
import { modalVariants } from "../variants";
|
|
4
|
+
import { ButtonProps } from "../../../Inputs/Buttons/Button/Button";
|
|
5
|
+
/** Style overrides merged into Mantine `Modal` `styles` (object form only). */
|
|
6
|
+
export type FormModalStylesOverride = Partial<Record<"body" | "close" | "content" | "header" | "inner" | "overlay" | "root" | "title", CSSObject>>;
|
|
3
7
|
export interface FormModalProps {
|
|
4
8
|
opened: boolean;
|
|
5
9
|
onClose: () => void;
|
|
@@ -13,6 +17,18 @@ export interface FormModalProps {
|
|
|
13
17
|
onConfirm?: () => void;
|
|
14
18
|
cancelLabel?: string;
|
|
15
19
|
confirmLabel?: string;
|
|
20
|
+
confirmRightIcon?: React.ReactNode;
|
|
21
|
+
cancelLeftIcon?: React.ReactNode;
|
|
22
|
+
confirmVariant?: ButtonProps['variant'];
|
|
23
|
+
/** Optional destructive footer action (e.g. Delete on edit modals). Rendered before Cancel. */
|
|
24
|
+
onDelete?: () => void;
|
|
25
|
+
deleteLabel?: string;
|
|
26
|
+
deleteButtonDisabled?: boolean;
|
|
27
|
+
deleteButtonLoading?: boolean;
|
|
28
|
+
deleteLeftIcon?: React.ReactNode;
|
|
29
|
+
fullScreen?: boolean;
|
|
30
|
+
/** Merged into Mantine `Modal` `styles` (e.g. lock body scroll when children use an inner `ScrollArea`). */
|
|
31
|
+
modalStyles?: FormModalStylesOverride;
|
|
16
32
|
}
|
|
17
|
-
export declare const FormModal: ({ opened, onClose, icon, children, size, modalVariant, confirmButtonDisabled, confirmButtonLoading, onCancel, onConfirm, cancelLabel, confirmLabel, }: FormModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const FormModal: ({ opened, onClose, icon, children, size, modalVariant, confirmButtonDisabled, confirmButtonLoading, onCancel, onConfirm, cancelLabel, confirmLabel, confirmRightIcon, cancelLeftIcon, confirmVariant, onDelete, deleteLabel, deleteButtonDisabled, deleteButtonLoading, deleteLeftIcon, modalStyles, fullScreen, }: FormModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
34
|
//# sourceMappingURL=FormModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/FormModal/FormModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/FormModal/FormModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAU,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAE5E,+EAA+E;AAC/E,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAC3C,MAAM,CACF,MAAM,GACN,OAAO,GACP,SAAS,GACT,QAAQ,GACR,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,EACT,SAAS,CACV,CACF,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;IAC1C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,cAAc,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC;AAED,eAAO,MAAM,SAAS,GAAI,oTAuBvB,cAAc,4CAwIhB,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { Center } from "../../../Layout/Center/Center";
|
|
|
8
8
|
import { modalVariants } from "../variants";
|
|
9
9
|
import { Group } from "../../../Layout/Group/Group";
|
|
10
10
|
import { Button } from "../../../Inputs/Buttons/Button/Button";
|
|
11
|
-
export const FormModal = ({ opened, onClose, icon, children, size = "400px", modalVariant = "info", confirmButtonDisabled = false, confirmButtonLoading = false, onCancel, onConfirm, cancelLabel, confirmLabel, }) => {
|
|
11
|
+
export const FormModal = ({ opened, onClose, icon, children, size = "400px", modalVariant = "info", confirmButtonDisabled = false, confirmButtonLoading = false, onCancel, onConfirm, cancelLabel, confirmLabel, confirmRightIcon, cancelLeftIcon, confirmVariant, onDelete, deleteLabel = "Delete", deleteButtonDisabled = false, deleteButtonLoading = false, deleteLeftIcon, modalStyles, fullScreen = false, }) => {
|
|
12
12
|
const selectedVariant = modalVariants[modalVariant];
|
|
13
13
|
const iconContainer = {
|
|
14
14
|
width: "42px",
|
|
@@ -19,7 +19,7 @@ export const FormModal = ({ opened, onClose, icon, children, size = "400px", mod
|
|
|
19
19
|
};
|
|
20
20
|
const coloredIcon = icon && React.cloneElement(icon, { color: icon.props.color || selectedVariant.iconColor });
|
|
21
21
|
const modalIcon = coloredIcon || (_jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: "20px" } }));
|
|
22
|
-
return (_jsx(MantineModal, { opened: opened, onClose: onClose, centered: true, radius: "16px", overlayProps: {
|
|
22
|
+
return (_jsx(MantineModal, { opened: opened, onClose: onClose, centered: true, fullScreen: fullScreen, radius: "16px", overlayProps: {
|
|
23
23
|
opacity: 0,
|
|
24
24
|
blur: 4,
|
|
25
25
|
}, size: size, transitionProps: {
|
|
@@ -33,13 +33,15 @@ export const FormModal = ({ opened, onClose, icon, children, size = "400px", mod
|
|
|
33
33
|
height: "18px",
|
|
34
34
|
},
|
|
35
35
|
}, styles: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
...modalStyles,
|
|
37
|
+
body: {
|
|
38
|
+
padding: `0 ${spacing.xxl} ${spacing.lg} ${spacing.xxl}`,
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexDirection: "column",
|
|
41
|
+
flex: 1,
|
|
42
|
+
minHeight: 0,
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body,
|
|
43
45
|
},
|
|
44
46
|
close: {
|
|
45
47
|
borderRadius: "16px",
|
|
@@ -52,9 +54,25 @@ export const FormModal = ({ opened, onClose, icon, children, size = "400px", mod
|
|
|
52
54
|
"&:active": {
|
|
53
55
|
transform: "none",
|
|
54
56
|
},
|
|
57
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.close,
|
|
55
58
|
},
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
content: {
|
|
60
|
+
borderRadius: "8px",
|
|
61
|
+
border: `1px solid ${neutral[50]}`,
|
|
62
|
+
boxShadow: "0px 0px 19px 0px #00000040",
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexDirection: "column",
|
|
65
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.content,
|
|
66
|
+
},
|
|
67
|
+
header: {
|
|
68
|
+
padding: spacing.sm,
|
|
69
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.header,
|
|
58
70
|
},
|
|
59
|
-
}, children:
|
|
71
|
+
}, children: _jsxs(Stack, { gap: "20px", w: "100%", align: "stretch", style: { minWidth: 0, flex: 1, minHeight: 0 }, children: [_jsx(Center, { mx: "auto", style: { ...iconContainer, flexShrink: 0 }, children: modalIcon }), children && (_jsx(Stack, { gap: spacing.xxs, align: "stretch", w: "100%", style: {
|
|
72
|
+
minWidth: 0,
|
|
73
|
+
maxWidth: "100%",
|
|
74
|
+
flex: 1,
|
|
75
|
+
minHeight: 0,
|
|
76
|
+
overflow: "hidden",
|
|
77
|
+
}, children: children })), _jsx(Center, { w: "100%", style: { flexShrink: 0 }, children: _jsxs(Group, { gap: "10px", align: "center", children: [_jsx(Button, { onClick: onCancel, variant: "secondary", leftIcon: cancelLeftIcon, children: cancelLabel || selectedVariant.cancelLabel }), onDelete && (_jsx(Button, { onClick: onDelete, variant: "cancel", disabled: deleteButtonDisabled, loading: deleteButtonLoading, leftIcon: deleteLeftIcon, children: deleteLabel })), _jsx(Button, { onClick: onConfirm, variant: confirmVariant || selectedVariant.buttonVariant, disabled: confirmButtonDisabled, loading: confirmButtonLoading, rightIcon: confirmRightIcon, children: confirmLabel || selectedVariant.confirmLabel })] }) })] }) }));
|
|
60
78
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CSSObject } from "@mantine/core";
|
|
3
|
+
import { modalVariants } from "../variants";
|
|
4
|
+
import { ButtonProps } from "../../../Inputs/Buttons/Button/Button";
|
|
5
|
+
/** Style overrides merged into Mantine `Modal` `styles` (object form only). */
|
|
6
|
+
export type FormModalV2StylesOverride = Partial<Record<"body" | "close" | "content" | "header" | "inner" | "overlay" | "root" | "title", CSSObject>>;
|
|
7
|
+
export interface FormModalV2Props {
|
|
8
|
+
opened: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
icon?: React.ReactElement;
|
|
11
|
+
/** Pinned title rendered in the header zone — stays visible while body scrolls. */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Pinned subtitle rendered below the title in the header zone. */
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Form content. Rendered inside a scrollable body zone — the body grows
|
|
17
|
+
* up to the available modal height, then scrolls. Consumers do NOT need to
|
|
18
|
+
* wrap children in a ScrollArea; the body owns scroll behavior.
|
|
19
|
+
*/
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
size?: string | number;
|
|
22
|
+
modalVariant?: keyof typeof modalVariants;
|
|
23
|
+
confirmButtonDisabled?: boolean;
|
|
24
|
+
confirmButtonLoading?: boolean;
|
|
25
|
+
onCancel?: () => void;
|
|
26
|
+
onConfirm?: () => void;
|
|
27
|
+
cancelLabel?: string;
|
|
28
|
+
confirmLabel?: string;
|
|
29
|
+
confirmRightIcon?: React.ReactNode;
|
|
30
|
+
cancelLeftIcon?: React.ReactNode;
|
|
31
|
+
confirmVariant?: ButtonProps['variant'];
|
|
32
|
+
/** Optional destructive footer action (e.g. Delete on edit modals). Rendered before Cancel. */
|
|
33
|
+
onDelete?: () => void;
|
|
34
|
+
deleteLabel?: string;
|
|
35
|
+
deleteButtonDisabled?: boolean;
|
|
36
|
+
deleteButtonLoading?: boolean;
|
|
37
|
+
deleteLeftIcon?: React.ReactNode;
|
|
38
|
+
fullScreen?: boolean;
|
|
39
|
+
/** Merged into Mantine `Modal` `styles`. Consumer overrides win. */
|
|
40
|
+
modalStyles?: FormModalV2StylesOverride;
|
|
41
|
+
/**
|
|
42
|
+
* Override for the pinned footer zone. When provided, replaces the
|
|
43
|
+
* default Cancel/Delete/Confirm button cluster entirely — useful for
|
|
44
|
+
* content pickers, multi-step wizards, or any flow whose footer doesn't
|
|
45
|
+
* map cleanly onto the three-button preset. The override is rendered in
|
|
46
|
+
* the same `flexShrink: 0` slot so layout invariants (scrollable body,
|
|
47
|
+
* pinned footer) hold either way.
|
|
48
|
+
*/
|
|
49
|
+
footer?: React.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Three-zone modal: pinned header (icon + title + subtitle), scrollable body,
|
|
53
|
+
* pinned footer (buttons). The body is the only scroll surface — consumers
|
|
54
|
+
* pass form fields as children without any wrapper.
|
|
55
|
+
*
|
|
56
|
+
* Scroll height is enforced by flex layout, so content can never render behind
|
|
57
|
+
* the footer regardless of viewport size.
|
|
58
|
+
*/
|
|
59
|
+
export declare const FormModalV2: ({ opened, onClose, icon, title, subtitle, children, size, modalVariant, confirmButtonDisabled, confirmButtonLoading, onCancel, onConfirm, cancelLabel, confirmLabel, confirmRightIcon, cancelLeftIcon, confirmVariant, onDelete, deleteLabel, deleteButtonDisabled, deleteButtonLoading, deleteLeftIcon, modalStyles, fullScreen, footer, }: FormModalV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
//# sourceMappingURL=FormModalV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormModalV2.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/FormModalV2/FormModalV2.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAU,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAE5E,+EAA+E;AAC/E,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CACF,MAAM,GACN,OAAO,GACP,SAAS,GACT,QAAQ,GACR,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,EACT,SAAS,CACV,CACF,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;IAC1C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,cAAc,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,6UA0BzB,gBAAgB,4CAuLlB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Modal as MantineModal } from "@mantine/core";
|
|
4
|
+
import { neutral } from "../../../../constants/colors";
|
|
5
|
+
import { spacing } from "../../../../constants/spacing";
|
|
6
|
+
import { Stack } from "../../../Layout/Stack/Stack";
|
|
7
|
+
import { Center } from "../../../Layout/Center/Center";
|
|
8
|
+
import { Title } from "../../../Typography/Title/Title";
|
|
9
|
+
import { modalVariants } from "../variants";
|
|
10
|
+
import { Group } from "../../../Layout/Group/Group";
|
|
11
|
+
import { Button } from "../../../Inputs/Buttons/Button/Button";
|
|
12
|
+
/**
|
|
13
|
+
* Three-zone modal: pinned header (icon + title + subtitle), scrollable body,
|
|
14
|
+
* pinned footer (buttons). The body is the only scroll surface — consumers
|
|
15
|
+
* pass form fields as children without any wrapper.
|
|
16
|
+
*
|
|
17
|
+
* Scroll height is enforced by flex layout, so content can never render behind
|
|
18
|
+
* the footer regardless of viewport size.
|
|
19
|
+
*/
|
|
20
|
+
export const FormModalV2 = ({ opened, onClose, icon, title, subtitle, children, size = "400px", modalVariant = "info", confirmButtonDisabled = false, confirmButtonLoading = false, onCancel, onConfirm, cancelLabel, confirmLabel, confirmRightIcon, cancelLeftIcon, confirmVariant, onDelete, deleteLabel = "Delete", deleteButtonDisabled = false, deleteButtonLoading = false, deleteLeftIcon, modalStyles, fullScreen = false, footer, }) => {
|
|
21
|
+
const selectedVariant = modalVariants[modalVariant];
|
|
22
|
+
const iconContainer = {
|
|
23
|
+
width: "42px",
|
|
24
|
+
height: "42px",
|
|
25
|
+
borderRadius: "50%",
|
|
26
|
+
backgroundColor: selectedVariant.iconBackgroundColor,
|
|
27
|
+
border: `2px solid ${selectedVariant.iconColor}`,
|
|
28
|
+
};
|
|
29
|
+
const coloredIcon = icon &&
|
|
30
|
+
React.cloneElement(icon, {
|
|
31
|
+
color: icon.props.color || selectedVariant.iconColor,
|
|
32
|
+
});
|
|
33
|
+
const modalIcon = coloredIcon || (_jsx("i", { className: selectedVariant.icon, style: { color: selectedVariant.iconColor, fontSize: "20px" } }));
|
|
34
|
+
return (_jsx(MantineModal, { opened: opened, onClose: onClose, centered: true, fullScreen: fullScreen, radius: "16px", overlayProps: {
|
|
35
|
+
opacity: 0,
|
|
36
|
+
blur: 4,
|
|
37
|
+
}, size: size, transitionProps: {
|
|
38
|
+
transition: "pop",
|
|
39
|
+
duration: 200,
|
|
40
|
+
}, closeButtonProps: {
|
|
41
|
+
style: {
|
|
42
|
+
borderRadius: "16px",
|
|
43
|
+
backgroundColor: neutral[50],
|
|
44
|
+
width: "18px",
|
|
45
|
+
height: "18px",
|
|
46
|
+
},
|
|
47
|
+
}, styles: {
|
|
48
|
+
...modalStyles,
|
|
49
|
+
body: {
|
|
50
|
+
// Tighter side padding on fullScreen (mobile) — `xxl` (32px)
|
|
51
|
+
// eats ~17% of a 375px viewport and forces the form's 2-col
|
|
52
|
+
// grids to overflow the right edge.
|
|
53
|
+
padding: fullScreen
|
|
54
|
+
? `0 ${spacing.md} ${spacing.lg} ${spacing.md}`
|
|
55
|
+
: `0 ${spacing.xxl} ${spacing.lg} ${spacing.xxl}`,
|
|
56
|
+
display: "flex",
|
|
57
|
+
flexDirection: "column",
|
|
58
|
+
flex: 1,
|
|
59
|
+
minHeight: 0,
|
|
60
|
+
overflow: "hidden",
|
|
61
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body,
|
|
62
|
+
},
|
|
63
|
+
close: {
|
|
64
|
+
borderRadius: "16px",
|
|
65
|
+
backgroundColor: neutral[50],
|
|
66
|
+
width: "18px",
|
|
67
|
+
height: "18px",
|
|
68
|
+
"&:hover": {
|
|
69
|
+
backgroundColor: neutral[50],
|
|
70
|
+
},
|
|
71
|
+
"&:active": {
|
|
72
|
+
transform: "none",
|
|
73
|
+
},
|
|
74
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.close,
|
|
75
|
+
},
|
|
76
|
+
content: {
|
|
77
|
+
borderRadius: "8px",
|
|
78
|
+
border: `1px solid ${neutral[50]}`,
|
|
79
|
+
boxShadow: "0px 0px 19px 0px #00000040",
|
|
80
|
+
display: "flex",
|
|
81
|
+
flexDirection: "column",
|
|
82
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.content,
|
|
83
|
+
},
|
|
84
|
+
header: {
|
|
85
|
+
padding: spacing.sm,
|
|
86
|
+
...modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.header,
|
|
87
|
+
},
|
|
88
|
+
}, children: _jsxs(Stack, { gap: "20px", w: "100%", align: "stretch", style: { minWidth: 0, flex: 1, minHeight: 0 }, children: [_jsxs(Stack, { gap: spacing.sm, align: "center", w: "100%", style: { minWidth: 0, flexShrink: 0 }, children: [_jsx(Center, { mx: "auto", style: iconContainer, children: modalIcon }), title && (_jsx(Title, { variant: "cardHeader", align: "center", children: title })), subtitle && (_jsx(Title, { variant: "cardSubheader", align: "center", children: subtitle }))] }), children && (_jsx(Stack, { gap: spacing.lg, align: "stretch", w: "100%", style: {
|
|
89
|
+
minWidth: 0,
|
|
90
|
+
maxWidth: "100%",
|
|
91
|
+
flex: 1,
|
|
92
|
+
minHeight: 0,
|
|
93
|
+
overflowY: "auto",
|
|
94
|
+
overflowX: "hidden",
|
|
95
|
+
}, children: children })), footer !== undefined ? (_jsx("div", { style: { flexShrink: 0, width: '100%' }, children: footer })) : (_jsx(Center, { w: "100%", style: { flexShrink: 0 }, children: _jsxs(Group, { gap: "10px", align: "center", children: [_jsx(Button, { onClick: onCancel, variant: "secondary", leftIcon: cancelLeftIcon, children: cancelLabel || selectedVariant.cancelLabel }), onDelete && (_jsx(Button, { onClick: onDelete, variant: "cancel", disabled: deleteButtonDisabled, loading: deleteButtonLoading, leftIcon: deleteLeftIcon, children: deleteLabel })), _jsx(Button, { onClick: onConfirm, variant: confirmVariant || selectedVariant.buttonVariant, disabled: confirmButtonDisabled, loading: confirmButtonLoading, rightIcon: confirmRightIcon, children: confirmLabel || selectedVariant.confirmLabel })] }) }))] }) }));
|
|
96
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,UAAU,UAAU;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAGD,eAAO,MAAM,KAAK,GAAI,6DAAuE,UAAU,4CA2EtG,CAAC"}
|
|
@@ -2,11 +2,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Modal as MantineModal } from '@mantine/core';
|
|
3
3
|
import { neutral } from '../../../../constants/colors';
|
|
4
4
|
import { spacing } from '../../../../constants/spacing';
|
|
5
|
+
import { useMobile } from '../../../../hooks/useMediaQuery';
|
|
5
6
|
import { Title } from '../../../Typography/Title/Title';
|
|
6
7
|
import { Stack } from '../../../Layout/Stack/Stack';
|
|
7
8
|
import { Center } from '../../../Layout/Center/Center';
|
|
8
9
|
// Base modal is intended to be extended and customized - use InfoModal or ConfirmationModal for common use cases
|
|
9
10
|
export const Modal = ({ opened, onClose, icon, title, subtitle, children, width = '400px' }) => {
|
|
11
|
+
// On mobile the modal usually fills the viewport (consumers pass
|
|
12
|
+
// `width='100%'`), so the desktop body's 32px side padding eats real
|
|
13
|
+
// estate that grid pickers and 4-segment SegmentedControls need. Tighten
|
|
14
|
+
// to `spacing.md` (12px) on mobile so children get an extra ~40px of
|
|
15
|
+
// usable width without making desktop look cramped.
|
|
16
|
+
const isMobile = useMobile();
|
|
17
|
+
const bodyPaddingX = isMobile ? spacing.md : spacing.xxl;
|
|
10
18
|
return (_jsx(MantineModal, { opened: opened, onClose: onClose, centered: true, radius: '16px', overlayProps: {
|
|
11
19
|
opacity: 0,
|
|
12
20
|
blur: 4,
|
|
@@ -38,7 +46,7 @@ export const Modal = ({ opened, onClose, icon, title, subtitle, children, width
|
|
|
38
46
|
},
|
|
39
47
|
},
|
|
40
48
|
body: {
|
|
41
|
-
padding: `0 ${
|
|
49
|
+
padding: `0 ${bodyPaddingX} ${spacing.lg} ${bodyPaddingX}`,
|
|
42
50
|
},
|
|
43
51
|
}, children: _jsx(Center, { h: "100%", w: "100%", children: _jsxs(Stack, { gap: "20px", h: "100%", w: "100%", align: "center", children: [_jsxs(Stack, { gap: spacing.lg, align: "center", children: [icon, _jsxs(Stack, { gap: spacing.xxs, align: "center", children: [_jsx(Title, { variant: "cardHeader", align: "center", children: title }), subtitle && (_jsx(Title, { variant: "cardSubheader", align: "center", children: subtitle }))] })] }), _jsx(Center, { h: "100%", w: "100%", children: children })] }) }) }));
|
|
44
52
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface StepperModalProps {
|
|
3
|
+
opened: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
width?: string | number;
|
|
8
|
+
stepLabels?: string[];
|
|
9
|
+
children: React.ReactNode[];
|
|
10
|
+
onConfirm: () => void;
|
|
11
|
+
cancelLabel?: string;
|
|
12
|
+
backLabel?: string;
|
|
13
|
+
nextLabel?: string;
|
|
14
|
+
confirmLabel?: string;
|
|
15
|
+
confirmButtonDisabled?: boolean;
|
|
16
|
+
confirmButtonLoading?: boolean;
|
|
17
|
+
nextButtonDisabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const StepperModal: ({ opened, onClose, title, subtitle, width, stepLabels, children, onConfirm, cancelLabel, backLabel, nextLabel, confirmLabel, confirmButtonDisabled, confirmButtonLoading, nextButtonDisabled, }: StepperModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=StepperModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepperModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/StepperModal/StepperModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,UAAU,iBAAiB;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,YAAY,GAAI,iMAgB1B,iBAAiB,4CAkHnB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as MantineModal } from '@mantine/core';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { neutral } from '../../../../constants/colors';
|
|
5
|
+
import { spacing } from '../../../../constants/spacing';
|
|
6
|
+
import { Button } from '../../../Inputs/Buttons/Button/Button';
|
|
7
|
+
import { Center } from '../../../Layout/Center/Center';
|
|
8
|
+
import { Group } from '../../../Layout/Group/Group';
|
|
9
|
+
import { Stack } from '../../../Layout/Stack/Stack';
|
|
10
|
+
import { Text } from '../../../Typography/Text/Text';
|
|
11
|
+
import { Title } from '../../../Typography/Title/Title';
|
|
12
|
+
import { Badge } from '../../Badge/Badge';
|
|
13
|
+
export const StepperModal = ({ opened, onClose, title, subtitle, width = '500px', stepLabels, children, onConfirm, cancelLabel = 'Cancel', backLabel = 'Back', nextLabel = 'Next', confirmLabel = 'Confirm', confirmButtonDisabled = false, confirmButtonLoading = false, nextButtonDisabled = false, }) => {
|
|
14
|
+
const [activeStep, setActiveStep] = useState(0);
|
|
15
|
+
const stepCount = children.length;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!opened)
|
|
18
|
+
setActiveStep(0);
|
|
19
|
+
}, [opened]);
|
|
20
|
+
return (_jsx(MantineModal, { centered: true, closeButtonProps: {
|
|
21
|
+
style: {
|
|
22
|
+
backgroundColor: neutral[50],
|
|
23
|
+
borderRadius: '16px',
|
|
24
|
+
height: '18px',
|
|
25
|
+
width: '18px',
|
|
26
|
+
},
|
|
27
|
+
}, onClose: onClose, opened: opened, overlayProps: {
|
|
28
|
+
blur: 4,
|
|
29
|
+
opacity: 0,
|
|
30
|
+
}, radius: '16px', size: width, styles: {
|
|
31
|
+
body: {
|
|
32
|
+
padding: `0 ${spacing.xxl} ${spacing.lg} ${spacing.xxl}`,
|
|
33
|
+
},
|
|
34
|
+
close: {
|
|
35
|
+
'&:active': { transform: 'none' },
|
|
36
|
+
'&:hover': { backgroundColor: neutral[50] },
|
|
37
|
+
},
|
|
38
|
+
content: {
|
|
39
|
+
border: `1px solid ${neutral[50]}`,
|
|
40
|
+
borderRadius: '8px',
|
|
41
|
+
boxShadow: '0px 0px 19px 0px #00000040',
|
|
42
|
+
},
|
|
43
|
+
header: {
|
|
44
|
+
padding: spacing.sm,
|
|
45
|
+
},
|
|
46
|
+
}, transitionProps: {
|
|
47
|
+
duration: 200,
|
|
48
|
+
transition: 'pop',
|
|
49
|
+
}, children: _jsx(Center, { h: '100%', w: '100%', children: _jsxs(Stack, { gap: '20px', h: '100%', w: '100%', children: [_jsxs(Group, { align: 'center', gap: '8px', children: [_jsxs(Badge, { variant: 'outline', children: ["Step ", activeStep + 1, " of ", stepCount] }), (stepLabels === null || stepLabels === void 0 ? void 0 : stepLabels[activeStep]) && (_jsxs(Text, { size: 'sm', children: ["\u2014 ", stepLabels[activeStep]] }))] }), _jsx(Stack, { align: 'center', children: _jsxs(Stack, { align: 'center', children: [_jsx(Title, { align: 'center', variant: 'cardHeader', children: title }), subtitle && (_jsx(Title, { align: 'center', variant: 'cardSubheader', children: subtitle }))] }) }), _jsx(Center, { h: '100%', w: '100%', children: children[activeStep] }), _jsx(Center, { children: _jsxs(Group, { align: 'center', gap: '10px', children: [activeStep === 0 ? (_jsx(Button, { onClick: onClose, variant: 'secondary', children: cancelLabel })) : (_jsx(Button, { onClick: () => setActiveStep((step) => step - 1), variant: 'secondary', children: backLabel })), activeStep === stepCount - 1 ? (_jsx(Button, { disabled: confirmButtonDisabled, loading: confirmButtonLoading, onClick: onConfirm, variant: 'primary', children: confirmLabel })) : (_jsx(Button, { disabled: nextButtonDisabled, onClick: () => setActiveStep((step) => step + 1), variant: 'primary', children: nextLabel }))] }) })] }) }) }));
|
|
50
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { StepperModal } from './StepperModal';
|
|
3
|
+
declare const meta: Meta<typeof StepperModal>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const TwoSteps: Story;
|
|
8
|
+
export declare const ConfirmButtonLoading: Story;
|
|
9
|
+
export declare const CustomLabels: Story;
|
|
10
|
+
//# sourceMappingURL=StepperModal.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepperModal.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Info/Modals/StepperModal/StepperModal.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAoGnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAiErB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAuCtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAsClC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAmC1B,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Button } from '../../../Inputs/Buttons/Button/Button';
|
|
4
|
+
import { NumberInput } from '../../../Inputs/TextInputs/NumberInput/NumberInput';
|
|
5
|
+
import { TextInput } from '../../../Inputs/TextInputs/TextInput/TextInput';
|
|
6
|
+
import { Center } from '../../../Layout/Center/Center';
|
|
7
|
+
import { Stack } from '../../../Layout/Stack/Stack';
|
|
8
|
+
import { Title } from '../../../Typography/Title/Title';
|
|
9
|
+
import { StepperModal } from './StepperModal';
|
|
10
|
+
const meta = {
|
|
11
|
+
argTypes: {
|
|
12
|
+
backLabel: {
|
|
13
|
+
control: { type: 'text' },
|
|
14
|
+
description: 'Label for the back button on middle and final steps.',
|
|
15
|
+
table: {
|
|
16
|
+
defaultValue: { summary: "'Back'" },
|
|
17
|
+
type: { summary: 'string' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
cancelLabel: {
|
|
21
|
+
control: { type: 'text' },
|
|
22
|
+
description: 'Label for the cancel button on the first step.',
|
|
23
|
+
table: {
|
|
24
|
+
defaultValue: { summary: "'Cancel'" },
|
|
25
|
+
type: { summary: 'string' },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
children: {
|
|
29
|
+
control: false,
|
|
30
|
+
description: 'Array of ReactNode, one per step. Only the active step is mounted — lift form state to the parent to preserve values across navigation.',
|
|
31
|
+
table: { type: { summary: 'ReactNode[]' } },
|
|
32
|
+
},
|
|
33
|
+
confirmButtonDisabled: {
|
|
34
|
+
control: false,
|
|
35
|
+
description: 'Whether the confirm button is disabled.',
|
|
36
|
+
table: { type: { summary: 'boolean' } },
|
|
37
|
+
},
|
|
38
|
+
confirmButtonLoading: {
|
|
39
|
+
control: false,
|
|
40
|
+
description: 'Whether the confirm button shows a loading state.',
|
|
41
|
+
table: { type: { summary: 'boolean' } },
|
|
42
|
+
},
|
|
43
|
+
confirmLabel: {
|
|
44
|
+
control: { type: 'text' },
|
|
45
|
+
description: 'Label for the confirm button on the final step.',
|
|
46
|
+
table: {
|
|
47
|
+
defaultValue: { summary: "'Confirm'" },
|
|
48
|
+
type: { summary: 'string' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
nextButtonDisabled: {
|
|
52
|
+
control: false,
|
|
53
|
+
description: 'Whether the next button is disabled.',
|
|
54
|
+
table: { type: { summary: 'boolean' } },
|
|
55
|
+
},
|
|
56
|
+
nextLabel: {
|
|
57
|
+
control: { type: 'text' },
|
|
58
|
+
description: 'Label for the next button on non-final steps.',
|
|
59
|
+
table: {
|
|
60
|
+
defaultValue: { summary: "'Next'" },
|
|
61
|
+
type: { summary: 'string' },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
onClose: {
|
|
65
|
+
control: false,
|
|
66
|
+
description: 'Called when the modal is dismissed (X button or Cancel).',
|
|
67
|
+
table: { type: { summary: '() => void' } },
|
|
68
|
+
},
|
|
69
|
+
onConfirm: {
|
|
70
|
+
control: false,
|
|
71
|
+
description: 'Called when the Confirm button is clicked on the final step.',
|
|
72
|
+
table: { type: { summary: '() => void' } },
|
|
73
|
+
},
|
|
74
|
+
opened: {
|
|
75
|
+
control: false,
|
|
76
|
+
description: 'Controls whether the modal is open.',
|
|
77
|
+
table: { type: { summary: 'boolean' } },
|
|
78
|
+
},
|
|
79
|
+
stepLabels: {
|
|
80
|
+
control: { type: 'object' },
|
|
81
|
+
description: 'Labels shown next to the step badge. One string per step.',
|
|
82
|
+
table: { type: { summary: 'string[]' } },
|
|
83
|
+
},
|
|
84
|
+
subtitle: {
|
|
85
|
+
control: { type: 'text' },
|
|
86
|
+
description: 'Optional subtitle below the title.',
|
|
87
|
+
table: { type: { summary: 'string' } },
|
|
88
|
+
},
|
|
89
|
+
title: {
|
|
90
|
+
control: { type: 'text' },
|
|
91
|
+
description: 'Modal title.',
|
|
92
|
+
table: { type: { summary: 'string' } },
|
|
93
|
+
},
|
|
94
|
+
width: {
|
|
95
|
+
control: { type: 'text' },
|
|
96
|
+
description: 'Modal width override.',
|
|
97
|
+
table: {
|
|
98
|
+
defaultValue: { summary: "'500px'" },
|
|
99
|
+
type: { summary: 'string | number' },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
component: StepperModal,
|
|
104
|
+
parameters: {
|
|
105
|
+
layout: 'centered',
|
|
106
|
+
},
|
|
107
|
+
title: 'Components/Info/Modals/StepperModal',
|
|
108
|
+
};
|
|
109
|
+
export default meta;
|
|
110
|
+
export const Default = {
|
|
111
|
+
args: {
|
|
112
|
+
backLabel: 'Back',
|
|
113
|
+
cancelLabel: 'Cancel',
|
|
114
|
+
confirmLabel: 'Create Account',
|
|
115
|
+
nextLabel: 'Continue',
|
|
116
|
+
stepLabels: ['Your Info', 'Contact', 'Additional Info'],
|
|
117
|
+
subtitle: 'Complete all steps to get started',
|
|
118
|
+
title: 'Create Account',
|
|
119
|
+
width: '500px',
|
|
120
|
+
},
|
|
121
|
+
render: (args) => {
|
|
122
|
+
const [opened, setOpened] = useState(false);
|
|
123
|
+
const [name, setName] = useState('');
|
|
124
|
+
const [email, setEmail] = useState('');
|
|
125
|
+
const [age, setAge] = useState(18);
|
|
126
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Open StepperModal" }) }), _jsx(StepperModal, { ...args, onClose: () => setOpened(false), onConfirm: () => setOpened(false), opened: opened, children: [
|
|
127
|
+
_jsx(Stack, { align: 'center', gap: '12px', w: '100%', children: _jsx(TextInput, { label: 'Full Name', onChange: (e) => setName(e.target.value), placeholder: 'Jane Smith', value: name }) }, 'step-0'),
|
|
128
|
+
_jsxs(Stack, { align: 'center', gap: '12px', w: '100%', children: [_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "How can we reach you?" }), _jsx(TextInput, { label: 'Email Address', onChange: (e) => setEmail(e.target.value), placeholder: 'jane@example.com', value: email })] }, 'step-1'),
|
|
129
|
+
_jsxs(Stack, { align: 'center', gap: '12px', w: '100%', children: [_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "A few more details." }), _jsx(NumberInput, { label: 'Age', max: 120, min: 1, onChange: (val) => setAge(val !== null && val !== void 0 ? val : 18), value: age })] }, 'step-2'),
|
|
130
|
+
] })] }));
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
export const TwoSteps = {
|
|
134
|
+
render: () => {
|
|
135
|
+
const [opened, setOpened] = useState(false);
|
|
136
|
+
const [value, setValue] = useState('');
|
|
137
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Open 2-Step Modal" }) }), _jsx(StepperModal, { onClose: () => setOpened(false), onConfirm: () => setOpened(false), opened: opened, stepLabels: ['Configure', 'Confirm'], title: 'Quick Setup', children: [
|
|
138
|
+
_jsx(Stack, { align: 'center', gap: '12px', w: '100%', children: _jsx(TextInput, { label: 'Configuration Value', onChange: (e) => setValue(e.target.value), placeholder: 'Enter value...', value: value }) }, 'step-0'),
|
|
139
|
+
_jsxs(Stack, { align: 'center', gap: '8px', w: '100%', children: [_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "You entered:" }), _jsx(Title, { align: 'center', variant: 'cardHeader', children: value || '(empty)' })] }, 'step-1'),
|
|
140
|
+
] })] }));
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
export const ConfirmButtonLoading = {
|
|
144
|
+
render: () => {
|
|
145
|
+
const [opened, setOpened] = useState(false);
|
|
146
|
+
const [loading, setLoading] = useState(false);
|
|
147
|
+
const handleConfirm = () => {
|
|
148
|
+
setLoading(true);
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
setLoading(false);
|
|
151
|
+
setOpened(false);
|
|
152
|
+
}, 2000);
|
|
153
|
+
};
|
|
154
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Open StepperModal" }) }), _jsx(StepperModal, { confirmButtonLoading: loading, onClose: () => setOpened(false), onConfirm: handleConfirm, opened: opened, stepLabels: ['Prepare', 'Submit'], title: 'Submit Data', children: [
|
|
155
|
+
_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "Click Next to proceed." }, 'step-0'),
|
|
156
|
+
_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "Click Confirm to submit and see the loading state." }, 'step-1'),
|
|
157
|
+
] })] }));
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
export const CustomLabels = {
|
|
161
|
+
render: () => {
|
|
162
|
+
const [opened, setOpened] = useState(false);
|
|
163
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { children: _jsx(Button, { onClick: () => setOpened(true), children: "Open StepperModal" }) }), _jsx(StepperModal, { backLabel: 'Previous', cancelLabel: 'Dismiss', confirmLabel: 'Submit', nextLabel: 'Continue', onClose: () => setOpened(false), onConfirm: () => setOpened(false), opened: opened, stepLabels: ['Step 1', 'Step 2', 'Step 3'], title: 'Custom Button Labels', children: [
|
|
164
|
+
_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "First step \u2014 notice the Dismiss button." }, 'step-0'),
|
|
165
|
+
_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "Middle step \u2014 Previous and Continue." }, 'step-1'),
|
|
166
|
+
_jsx(Title, { align: 'center', variant: 'cardSubheader', children: "Final step \u2014 Previous and Submit." }, 'step-2'),
|
|
167
|
+
] })] }));
|
|
168
|
+
},
|
|
169
|
+
};
|