reshaped 3.9.0-canary.0 → 3.9.0-canary.10
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/bundle.css +1 -1
- package/dist/bundle.js +2 -31
- package/dist/cli/theming/index.js +4 -4
- package/dist/cli/theming/reshaped.config.js +1 -1
- package/dist/components/Accordion/Accordion.types.d.ts +1 -1
- package/dist/components/Accordion/AccordionControlled.js +2 -2
- package/dist/components/Accordion/AccordionTrigger.js +2 -2
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/ActionBar/ActionBar.js +1 -1
- package/dist/components/ActionBar/ActionBar.types.d.ts +1 -1
- package/dist/components/Actionable/Actionable.js +1 -1
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Alert/Alert.types.d.ts +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +6 -6
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +3 -3
- package/dist/components/Avatar/Avatar.js +9 -26
- package/dist/components/Avatar/Avatar.module.css +1 -1
- package/dist/components/Badge/Badge.js +4 -4
- package/dist/components/Badge/Badge.module.css +1 -1
- package/dist/components/Badge/Badge.types.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.js +1 -1
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Button/Button.types.d.ts +3 -3
- package/dist/components/Calendar/Calendar.types.d.ts +25 -6
- package/dist/components/Calendar/CalendarControlled.js +45 -10
- package/dist/components/Calendar/CalendarControls.js +11 -11
- package/dist/components/Calendar/CalendarDate.js +13 -11
- package/dist/components/Calendar/CalendarMonth.js +3 -3
- package/dist/components/Calendar/CalendarYear.js +1 -1
- package/dist/components/Calendar/useCalendarKeyboardNavigation.js +1 -1
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Card/Card.module.css +1 -1
- package/dist/components/Card/Card.types.d.ts +1 -1
- package/dist/components/Carousel/Carousel.js +4 -4
- package/dist/components/Carousel/Carousel.types.d.ts +1 -1
- package/dist/components/Carousel/CarouselControl.d.ts +1 -1
- package/dist/components/Carousel/CarouselControl.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +5 -15
- package/dist/components/CheckboxGroup/CheckboxGroup.types.d.ts +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.types.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/Dismissible/Dismissible.js +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +6 -6
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +4 -4
- package/dist/components/FileUpload/FileUpload.js +9 -7
- package/dist/components/FileUpload/FileUpload.module.css +1 -1
- package/dist/components/FileUpload/FileUpload.types.d.ts +3 -1
- package/dist/components/Flyout/Flyout.constants.d.ts +3 -6
- package/dist/components/Flyout/Flyout.constants.js +1 -3
- package/dist/components/Flyout/Flyout.js +1 -1
- package/dist/components/Flyout/Flyout.module.css +1 -1
- package/dist/components/Flyout/Flyout.types.d.ts +6 -7
- package/dist/components/Flyout/FlyoutContent.js +7 -7
- package/dist/components/Flyout/FlyoutControlled.js +17 -14
- package/dist/components/Flyout/index.d.ts +1 -1
- package/dist/components/Flyout/index.js +1 -1
- package/dist/components/Flyout/useFlyout.d.ts +2 -2
- package/dist/components/Flyout/useFlyout.js +5 -18
- package/dist/components/Flyout/utilities/calculatePosition.d.ts +6 -6
- package/dist/components/Flyout/utilities/calculatePosition.js +6 -6
- package/dist/components/Flyout/utilities/cooldown.js +1 -2
- package/dist/components/Flyout/utilities/flyout.d.ts +1 -1
- package/dist/components/Flyout/utilities/flyout.js +5 -2
- package/dist/components/FormControl/FormControlCaption.js +1 -1
- package/dist/components/FormControl/FormControlLabel.js +1 -1
- package/dist/components/FormControl/index.d.ts +2 -2
- package/dist/components/FormControl/index.js +2 -2
- package/dist/components/Grid/Grid.js +1 -1
- package/dist/components/Grid/Grid.types.d.ts +2 -2
- package/dist/components/HiddenInput/HiddenInput.js +34 -0
- package/dist/components/HiddenInput/HiddenInput.types.d.ts +26 -0
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Icon/Icon.module.css +1 -1
- package/dist/components/Image/Image.js +14 -9
- package/dist/components/Image/Image.module.css +1 -1
- package/dist/components/Image/Image.types.d.ts +4 -2
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/MenuItem/MenuItem.js +1 -1
- package/dist/components/MenuItem/MenuItem.types.d.ts +2 -2
- package/dist/components/Modal/Modal.js +8 -8
- package/dist/components/Modal/Modal.module.css +1 -1
- package/dist/components/Modal/Modal.types.d.ts +1 -1
- package/dist/components/NumberField/NumberFieldControlled.js +7 -7
- package/dist/components/Overlay/Overlay.js +8 -8
- package/dist/components/PinField/PinFieldControlled.js +4 -4
- package/dist/components/Popover/Popover.js +3 -3
- package/dist/components/Popover/Popover.module.css +1 -1
- package/dist/components/Popover/Popover.types.d.ts +2 -2
- package/dist/components/Progress/Progress.module.css +1 -1
- package/dist/components/Radio/Radio.js +5 -15
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +1 -1
- package/dist/components/Reshaped/Reshaped.css +1 -1
- package/dist/components/Reshaped/Reshaped.js +4 -4
- package/dist/components/Reshaped/Reshaped.types.d.ts +1 -1
- package/dist/components/Resizable/Resizable.js +2 -2
- package/dist/components/Resizable/Resizable.types.d.ts +1 -1
- package/dist/components/Resizable/ResizableHandle.js +1 -1
- package/dist/components/Scrim/Scrim.js +4 -3
- package/dist/components/Scrim/Scrim.module.css +1 -1
- package/dist/components/Scrim/Scrim.types.d.ts +2 -1
- package/dist/components/ScrollArea/ScrollArea.js +5 -5
- package/dist/components/Select/Select.types.d.ts +3 -3
- package/dist/components/Select/SelectCustomControlled.js +6 -3
- package/dist/components/Select/SelectEndContent.js +1 -1
- package/dist/components/Select/SelectGroup.js +1 -1
- package/dist/components/Select/SelectNative.js +2 -2
- package/dist/components/Select/SelectRoot.js +1 -1
- package/dist/components/Select/SelectTrigger.js +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Slider/SliderControlled.js +7 -7
- package/dist/components/Slider/SliderThumb.js +3 -3
- package/dist/components/Stepper/Stepper.js +4 -4
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.js +2 -2
- package/dist/components/Tabs/Tabs.module.css +1 -1
- package/dist/components/Tabs/Tabs.types.d.ts +4 -2
- package/dist/components/Tabs/TabsContext.d.ts +1 -0
- package/dist/components/Tabs/TabsControlled.js +2 -1
- package/dist/components/Tabs/TabsItem.js +4 -4
- package/dist/components/Tabs/TabsList.js +17 -13
- package/dist/components/Tabs/TabsPanel.js +3 -3
- package/dist/components/Text/Text.js +3 -3
- package/dist/components/Text/Text.module.css +1 -1
- package/dist/components/Text/Text.types.d.ts +2 -0
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextArea/TextArea.types.d.ts +1 -1
- package/dist/components/TextField/TextField.js +2 -2
- package/dist/components/TextField/TextField.types.d.ts +2 -2
- package/dist/components/Theme/GlobalColorMode.js +1 -1
- package/dist/components/Theme/Theme.js +2 -2
- package/dist/components/Theme/Theme.module.css +1 -1
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Toast/Toast.js +2 -2
- package/dist/components/Toast/Toast.types.d.ts +1 -1
- package/dist/components/Toast/ToastContainer.js +3 -3
- package/dist/components/Toast/ToastProvider.js +1 -1
- package/dist/components/Toast/ToastRegion.js +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.types.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupControlled.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +5 -3
- package/dist/components/View/View.js +2 -2
- package/dist/components/View/View.types.d.ts +1 -1
- package/dist/components/_private/Expandable/Expandable.js +2 -2
- package/dist/components/_private/Portal/Portal.js +1 -1
- package/dist/config/tailwind.js +2 -2
- package/dist/hooks/_private/useDrag.js +4 -4
- package/dist/hooks/_private/useFadeSide.js +1 -1
- package/dist/hooks/useOnClickOutside.js +2 -4
- package/dist/hooks/useResponsiveClientValue.js +1 -1
- package/dist/styles/mixin.js +1 -1
- package/dist/tests/ThemesPlayground.js +16 -16
- package/dist/themes/_generator/definitions/slate.js +1 -1
- package/dist/themes/_generator/tokens/color/utilities/generateColors.d.ts +1 -1
- package/dist/themes/_generator/tokens/color/utilities/generateMetaColors.d.ts +1 -1
- package/dist/themes/_generator/tokens/color/utilities/generateMetaColors.js +1 -1
- package/dist/themes/_generator/tokens/css.js +2 -2
- package/dist/themes/_generator/tokens/font/font.types.d.ts +2 -2
- package/dist/themes/_generator/tokens/transforms.js +1 -1
- package/dist/themes/_generator/tokens/types.d.ts +3 -3
- package/dist/themes/_generator/transform.d.ts +1 -1
- package/dist/themes/_generator/transform.js +3 -3
- package/dist/themes/figma/theme.css +1 -1
- package/dist/themes/fragments/twitter/theme.css +1 -1
- package/dist/themes/index.d.ts +1 -1
- package/dist/themes/reshaped/theme.css +1 -1
- package/dist/themes/slate/theme.css +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/utilities/a11y/TrapFocus.js +4 -4
- package/dist/utilities/scroll/lock.js +1 -1
- package/dist/utilities/scroll/lockStandard.js +1 -1
- package/dist/utilities/storybook/Example.js +1 -1
- package/package.json +42 -35
- package/dist/components/Accordion/tests/Accordion.stories.d.ts +0 -44
- package/dist/components/Accordion/tests/Accordion.stories.js +0 -204
- package/dist/components/ActionBar/tests/ActionBar.stories.d.ts +0 -40
- package/dist/components/ActionBar/tests/ActionBar.stories.js +0 -223
- package/dist/components/Actionable/tests/Actionable.stories.d.ts +0 -41
- package/dist/components/Actionable/tests/Actionable.stories.js +0 -220
- package/dist/components/Alert/tests/Alert.stories.d.ts +0 -24
- package/dist/components/Alert/tests/Alert.stories.js +0 -78
- package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +0 -32
- package/dist/components/Autocomplete/tests/Autocomplete.stories.js +0 -246
- package/dist/components/Avatar/tests/Avatar.stories.d.ts +0 -31
- package/dist/components/Avatar/tests/Avatar.stories.js +0 -176
- package/dist/components/Badge/tests/Badge.stories.d.ts +0 -55
- package/dist/components/Badge/tests/Badge.stories.js +0 -328
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +0 -40
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +0 -187
- package/dist/components/Button/tests/Button.stories.d.ts +0 -79
- package/dist/components/Button/tests/Button.stories.js +0 -789
- package/dist/components/Calendar/tests/Calendar.stories.d.ts +0 -29
- package/dist/components/Calendar/tests/Calendar.stories.js +0 -255
- package/dist/components/Card/tests/Card.stories.d.ts +0 -52
- package/dist/components/Card/tests/Card.stories.js +0 -125
- package/dist/components/Carousel/tests/Carousel.stories.d.ts +0 -34
- package/dist/components/Carousel/tests/Carousel.stories.js +0 -224
- package/dist/components/Checkbox/tests/Checkbox.stories.d.ts +0 -30
- package/dist/components/Checkbox/tests/Checkbox.stories.js +0 -171
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.d.ts +0 -19
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.js +0 -83
- package/dist/components/Container/tests/Container.stories.d.ts +0 -24
- package/dist/components/Container/tests/Container.stories.js +0 -75
- package/dist/components/ContextMenu/tests/ContextMenu.stories.d.ts +0 -26
- package/dist/components/ContextMenu/tests/ContextMenu.stories.js +0 -70
- package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +0 -25
- package/dist/components/Dismissible/tests/Dismissible.stories.js +0 -97
- package/dist/components/Divider/tests/Divider.stories.d.ts +0 -20
- package/dist/components/Divider/tests/Divider.stories.js +0 -120
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +0 -53
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.js +0 -278
- package/dist/components/FileUpload/tests/FileUpload.stories.d.ts +0 -31
- package/dist/components/FileUpload/tests/FileUpload.stories.js +0 -140
- package/dist/components/Flyout/tests/Flyout.stories.d.ts +0 -103
- package/dist/components/Flyout/tests/Flyout.stories.js +0 -738
- package/dist/components/FormControl/tests/FormControl.stories.d.ts +0 -31
- package/dist/components/FormControl/tests/FormControl.stories.js +0 -143
- package/dist/components/Grid/tests/Grid.stories.d.ts +0 -38
- package/dist/components/Grid/tests/Grid.stories.js +0 -245
- package/dist/components/Hidden/tests/Hidden.stories.d.ts +0 -16
- package/dist/components/Hidden/tests/Hidden.stories.js +0 -48
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +0 -16
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +0 -28
- package/dist/components/Hotkey/tests/Hotkey.stories.d.ts +0 -13
- package/dist/components/Hotkey/tests/Hotkey.stories.js +0 -53
- package/dist/components/Icon/tests/Icon.stories.d.ts +0 -25
- package/dist/components/Icon/tests/Icon.stories.js +0 -113
- package/dist/components/Image/tests/Image.stories.d.ts +0 -41
- package/dist/components/Image/tests/Image.stories.js +0 -196
- package/dist/components/Link/tests/Link.stories.d.ts +0 -42
- package/dist/components/Link/tests/Link.stories.js +0 -155
- package/dist/components/Loader/tests/Loader.stories.d.ts +0 -21
- package/dist/components/Loader/tests/Loader.stories.js +0 -68
- package/dist/components/MenuItem/tests/MenuItem.stories.d.ts +0 -59
- package/dist/components/MenuItem/tests/MenuItem.stories.js +0 -236
- package/dist/components/Modal/tests/Modal.stories.d.ts +0 -64
- package/dist/components/Modal/tests/Modal.stories.js +0 -410
- package/dist/components/NumberField/tests/NumberField.stories.d.ts +0 -28
- package/dist/components/NumberField/tests/NumberField.stories.js +0 -258
- package/dist/components/Overlay/tests/Overlay.stories.d.ts +0 -28
- package/dist/components/Overlay/tests/Overlay.stories.js +0 -202
- package/dist/components/Pagination/tests/Pagination.stories.d.ts +0 -24
- package/dist/components/Pagination/tests/Pagination.stories.js +0 -105
- package/dist/components/PinField/tests/PinField.stories.d.ts +0 -34
- package/dist/components/PinField/tests/PinField.stories.js +0 -209
- package/dist/components/Popover/tests/Popover.stories.d.ts +0 -69
- package/dist/components/Popover/tests/Popover.stories.js +0 -340
- package/dist/components/Progress/tests/Progress.stories.d.ts +0 -30
- package/dist/components/Progress/tests/Progress.stories.js +0 -102
- package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.d.ts +0 -19
- package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.js +0 -92
- package/dist/components/Radio/tests/Radio.stories.d.ts +0 -35
- package/dist/components/Radio/tests/Radio.stories.js +0 -162
- package/dist/components/RadioGroup/tests/RadioGroup.stories.d.ts +0 -19
- package/dist/components/RadioGroup/tests/RadioGroup.stories.js +0 -77
- package/dist/components/Reshaped/tests/Reshaped.stories.d.ts +0 -34
- package/dist/components/Reshaped/tests/Reshaped.stories.js +0 -108
- package/dist/components/Resizable/tests/Resizable.stories.d.ts +0 -38
- package/dist/components/Resizable/tests/Resizable.stories.js +0 -185
- package/dist/components/Scrim/tests/Scrim.stories.d.ts +0 -20
- package/dist/components/Scrim/tests/Scrim.stories.js +0 -67
- package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +0 -37
- package/dist/components/ScrollArea/tests/ScrollArea.stories.js +0 -244
- package/dist/components/Select/tests/Select.stories.d.ts +0 -53
- package/dist/components/Select/tests/Select.stories.js +0 -616
- package/dist/components/Skeleton/tests/Skeleton.stories.d.ts +0 -20
- package/dist/components/Skeleton/tests/Skeleton.stories.js +0 -63
- package/dist/components/Slider/tests/Slider.stories.d.ts +0 -47
- package/dist/components/Slider/tests/Slider.stories.js +0 -279
- package/dist/components/Stepper/tests/Stepper.stories.d.ts +0 -31
- package/dist/components/Stepper/tests/Stepper.stories.js +0 -135
- package/dist/components/Switch/tests/Switch.stories.d.ts +0 -22
- package/dist/components/Switch/tests/Switch.stories.js +0 -137
- package/dist/components/Switch/tests/Switch.test.stories.d.ts +0 -13
- package/dist/components/Switch/tests/Switch.test.stories.js +0 -11
- package/dist/components/Table/tests/Table.stories.d.ts +0 -42
- package/dist/components/Table/tests/Table.stories.js +0 -348
- package/dist/components/Tabs/tests/Tabs.stories.d.ts +0 -62
- package/dist/components/Tabs/tests/Tabs.stories.js +0 -539
- package/dist/components/Text/tests/Text.stories.d.ts +0 -48
- package/dist/components/Text/tests/Text.stories.js +0 -201
- package/dist/components/TextArea/tests/TextArea.stories.d.ts +0 -53
- package/dist/components/TextArea/tests/TextArea.stories.js +0 -204
- package/dist/components/TextField/tests/TextField.stories.d.ts +0 -54
- package/dist/components/TextField/tests/TextField.stories.js +0 -252
- package/dist/components/Theme/tests/Theme.stories.d.ts +0 -25
- package/dist/components/Theme/tests/Theme.stories.js +0 -171
- package/dist/components/Timeline/tests/Timeline.stories.d.ts +0 -22
- package/dist/components/Timeline/tests/Timeline.stories.js +0 -86
- package/dist/components/Toast/tests/Toast.stories.d.ts +0 -41
- package/dist/components/Toast/tests/Toast.stories.js +0 -432
- package/dist/components/ToggleButton/tests/ToggleButton.stories.d.ts +0 -27
- package/dist/components/ToggleButton/tests/ToggleButton.stories.js +0 -97
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.d.ts +0 -27
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.js +0 -169
- package/dist/components/Tooltip/tests/Tooltip.stories.d.ts +0 -28
- package/dist/components/Tooltip/tests/Tooltip.stories.js +0 -182
- package/dist/components/View/tests/View.stories.d.ts +0 -141
- package/dist/components/View/tests/View.stories.js +0 -1329
- package/dist/components/_private/HiddenInput/HiddenInput.js +0 -10
- package/dist/components/_private/HiddenInput/HiddenInput.types.d.ts +0 -15
- package/dist/components/_private/Portal/tests/Portal.stories.d.ts +0 -6
- package/dist/components/_private/Portal/tests/Portal.stories.js +0 -17
- package/dist/hooks/tests/useDrag.stories.d.ts +0 -31
- package/dist/hooks/tests/useDrag.stories.js +0 -147
- package/dist/hooks/tests/useElementId.stories.d.ts +0 -11
- package/dist/hooks/tests/useElementId.stories.js +0 -23
- package/dist/hooks/tests/useHandlerRef.stories.d.ts +0 -14
- package/dist/hooks/tests/useHandlerRef.stories.js +0 -44
- package/dist/hooks/tests/useHotkeys.stories.d.ts +0 -43
- package/dist/hooks/tests/useHotkeys.stories.js +0 -158
- package/dist/hooks/tests/useKeyboardArrowNavigation.stories.d.ts +0 -15
- package/dist/hooks/tests/useKeyboardArrowNavigation.stories.js +0 -128
- package/dist/hooks/tests/useKeyboardMode.stories.d.ts +0 -11
- package/dist/hooks/tests/useKeyboardMode.stories.js +0 -42
- package/dist/hooks/tests/useOnClickOutside.stories.d.ts +0 -23
- package/dist/hooks/tests/useOnClickOutside.stories.js +0 -111
- package/dist/hooks/tests/useRTL.stories.d.ts +0 -11
- package/dist/hooks/tests/useRTL.stories.js +0 -23
- package/dist/hooks/tests/useResponsiveClientValue.stories.d.ts +0 -18
- package/dist/hooks/tests/useResponsiveClientValue.stories.js +0 -30
- package/dist/hooks/tests/useScrollLock.stories.d.ts +0 -14
- package/dist/hooks/tests/useScrollLock.stories.js +0 -97
- package/dist/hooks/tests/useToggle.stories.d.ts +0 -13
- package/dist/hooks/tests/useToggle.stories.js +0 -59
- package/dist/tests/ShadowDOM.stories.d.ts +0 -6
- package/dist/tests/ShadowDOM.stories.js +0 -110
- package/dist/tests/themes.stories.d.ts +0 -16
- package/dist/tests/themes.stories.js +0 -327
- package/dist/utilities/a11y/tests/TrapFocus.stories.d.ts +0 -14
- package/dist/utilities/a11y/tests/TrapFocus.stories.js +0 -615
- /package/dist/components/{_private/HiddenInput → HiddenInput}/HiddenInput.d.ts +0 -0
- /package/dist/components/{_private/HiddenInput → HiddenInput}/HiddenInput.module.css +0 -0
- /package/dist/components/{_private/HiddenInput → HiddenInput}/HiddenInput.types.js +0 -0
- /package/dist/components/{_private/HiddenInput → HiddenInput}/index.d.ts +0 -0
- /package/dist/components/{_private/HiddenInput → HiddenInput}/index.js +0 -0
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { expect, fn, userEvent, waitFor } from "storybook/test";
|
|
3
|
-
import { Example, Placeholder } from "../../../utilities/storybook/index.js";
|
|
4
|
-
import Carousel from "../index.js";
|
|
5
|
-
import Button from "../../Button/index.js";
|
|
6
|
-
import View from "../../View/index.js";
|
|
7
|
-
export default {
|
|
8
|
-
title: "Components/Carousel",
|
|
9
|
-
component: Carousel,
|
|
10
|
-
parameters: {
|
|
11
|
-
// Skip because of the aria-hidden applied to buttons, they're replaced by screen reader navigation
|
|
12
|
-
a11y: {
|
|
13
|
-
disable: true,
|
|
14
|
-
},
|
|
15
|
-
iframe: {
|
|
16
|
-
url: "https://reshaped.so/docs/components/carousel",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
export const base = {
|
|
21
|
-
name: "base",
|
|
22
|
-
render: () => (<Carousel attributes={{ "data-testid": "test-id" }} visibleItems={3}>
|
|
23
|
-
<Placeholder h={100}>Content</Placeholder>
|
|
24
|
-
<Placeholder h={100}>Content</Placeholder>
|
|
25
|
-
<Placeholder h={100}>Content</Placeholder>
|
|
26
|
-
<Placeholder h={100}>Content</Placeholder>
|
|
27
|
-
<Placeholder h={100}>Content</Placeholder>
|
|
28
|
-
<Placeholder h={100}>Content</Placeholder>
|
|
29
|
-
</Carousel>),
|
|
30
|
-
play: async ({ canvas }) => {
|
|
31
|
-
const root = canvas.getByTestId("test-id");
|
|
32
|
-
const items = canvas.getAllByText("Content");
|
|
33
|
-
const buttons = root.querySelectorAll("button");
|
|
34
|
-
expect(root).toBeInTheDocument();
|
|
35
|
-
expect(root.tagName).toBe("SECTION");
|
|
36
|
-
expect(items).toHaveLength(6);
|
|
37
|
-
expect(buttons).toHaveLength(2);
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
export const visibleItems = {
|
|
41
|
-
name: "visibleItems",
|
|
42
|
-
render: () => (<Example>
|
|
43
|
-
<Example.Item title="visibleItems: 3">
|
|
44
|
-
<Carousel visibleItems={3}>
|
|
45
|
-
<Placeholder h={100}/>
|
|
46
|
-
<Placeholder h={100}/>
|
|
47
|
-
<Placeholder h={100}/>
|
|
48
|
-
<Placeholder h={100}/>
|
|
49
|
-
<Placeholder h={100}/>
|
|
50
|
-
<Placeholder h={100}/>
|
|
51
|
-
</Carousel>
|
|
52
|
-
</Example.Item>
|
|
53
|
-
|
|
54
|
-
<Example.Item title={["responsive visibleItems", "s: 2, m+ 3"]}>
|
|
55
|
-
<Carousel visibleItems={{ s: 2, m: 3 }}>
|
|
56
|
-
<Placeholder h={100}/>
|
|
57
|
-
<Placeholder h={100}/>
|
|
58
|
-
<Placeholder h={100}/>
|
|
59
|
-
<Placeholder h={100}/>
|
|
60
|
-
<Placeholder h={100}/>
|
|
61
|
-
<Placeholder h={100}/>
|
|
62
|
-
</Carousel>
|
|
63
|
-
</Example.Item>
|
|
64
|
-
|
|
65
|
-
<Example.Item title="visibleItems: auto">
|
|
66
|
-
<Carousel>
|
|
67
|
-
<Placeholder h={100}/>
|
|
68
|
-
<Placeholder h={100} w={200}/>
|
|
69
|
-
<Placeholder h={100} w={300}/>
|
|
70
|
-
<Placeholder h={100}/>
|
|
71
|
-
<Placeholder h={100}/>
|
|
72
|
-
<Placeholder h={100}/>
|
|
73
|
-
</Carousel>
|
|
74
|
-
</Example.Item>
|
|
75
|
-
</Example>),
|
|
76
|
-
};
|
|
77
|
-
export const gap = {
|
|
78
|
-
name: "gap",
|
|
79
|
-
render: () => (<Example>
|
|
80
|
-
<Example.Item title="gap: 2, visibleItems 3">
|
|
81
|
-
<Carousel visibleItems={3} gap={2}>
|
|
82
|
-
<Placeholder h={100}/>
|
|
83
|
-
<Placeholder h={100}/>
|
|
84
|
-
<Placeholder h={100}/>
|
|
85
|
-
<Placeholder h={100}/>
|
|
86
|
-
<Placeholder h={100}/>
|
|
87
|
-
<Placeholder h={100}/>
|
|
88
|
-
</Carousel>
|
|
89
|
-
</Example.Item>
|
|
90
|
-
|
|
91
|
-
<Example.Item title={["gap: responsive, visibleItems: 3", "s: 2, l: 8"]}>
|
|
92
|
-
<Carousel visibleItems={3} gap={{ s: 2, l: 8 }}>
|
|
93
|
-
<Placeholder h={100}/>
|
|
94
|
-
<Placeholder h={100}/>
|
|
95
|
-
<Placeholder h={100}/>
|
|
96
|
-
<Placeholder h={100}/>
|
|
97
|
-
<Placeholder h={100}/>
|
|
98
|
-
<Placeholder h={100}/>
|
|
99
|
-
</Carousel>
|
|
100
|
-
</Example.Item>
|
|
101
|
-
</Example>),
|
|
102
|
-
};
|
|
103
|
-
export const bleed = {
|
|
104
|
-
name: "bleed",
|
|
105
|
-
render: () => (<Example>
|
|
106
|
-
<Example.Item title="bleed: 4, visibleItems: 3">
|
|
107
|
-
<Carousel visibleItems={3} bleed={4}>
|
|
108
|
-
<Placeholder h={100}/>
|
|
109
|
-
<Placeholder h={100}/>
|
|
110
|
-
<Placeholder h={100}/>
|
|
111
|
-
<Placeholder h={100}/>
|
|
112
|
-
<Placeholder h={100}/>
|
|
113
|
-
<Placeholder h={100}/>
|
|
114
|
-
</Carousel>
|
|
115
|
-
</Example.Item>
|
|
116
|
-
|
|
117
|
-
<Example.Item title={["responsive bleed, visibleItems: 3", "[s] 4, [l+] 0"]}>
|
|
118
|
-
<Carousel visibleItems={3} bleed={{ s: 4, l: 0 }}>
|
|
119
|
-
<Placeholder h={100}/>
|
|
120
|
-
<Placeholder h={100}/>
|
|
121
|
-
<Placeholder h={100}/>
|
|
122
|
-
<Placeholder h={100}/>
|
|
123
|
-
<Placeholder h={100}/>
|
|
124
|
-
<Placeholder h={100}/>
|
|
125
|
-
</Carousel>
|
|
126
|
-
</Example.Item>
|
|
127
|
-
</Example>),
|
|
128
|
-
};
|
|
129
|
-
export const navigationDisplay = {
|
|
130
|
-
name: "navigationDisplay",
|
|
131
|
-
render: () => (<Example>
|
|
132
|
-
<Example.Item title="navigationDisplay: hidden">
|
|
133
|
-
<Carousel visibleItems={3} navigationDisplay="hidden" attributes={{ "data-testid": "test-id" }}>
|
|
134
|
-
<Placeholder h={100}/>
|
|
135
|
-
<Placeholder h={100}/>
|
|
136
|
-
<Placeholder h={100}/>
|
|
137
|
-
<Placeholder h={100}/>
|
|
138
|
-
<Placeholder h={100}/>
|
|
139
|
-
<Placeholder h={100}/>
|
|
140
|
-
</Carousel>
|
|
141
|
-
</Example.Item>
|
|
142
|
-
</Example>),
|
|
143
|
-
play: async ({ canvas }) => {
|
|
144
|
-
const root = canvas.getByTestId("test-id");
|
|
145
|
-
const buttons = root.querySelectorAll("button");
|
|
146
|
-
expect(buttons).toHaveLength(0);
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
export const instanceRef = {
|
|
150
|
-
name: "instanceRef, onChange",
|
|
151
|
-
args: {
|
|
152
|
-
handleChange: fn(),
|
|
153
|
-
},
|
|
154
|
-
render: (args) => {
|
|
155
|
-
const carouselRef = React.useRef(null);
|
|
156
|
-
const [index, setIndex] = React.useState(0);
|
|
157
|
-
return (<Example>
|
|
158
|
-
<Example.Item title="instanceRef, onChange">
|
|
159
|
-
<View gap={3}>
|
|
160
|
-
<View gap={3} direction="row" align="center">
|
|
161
|
-
<Button onClick={() => carouselRef.current?.navigateBack()}>Back</Button>
|
|
162
|
-
<Button onClick={() => carouselRef.current?.navigateForward()}>Forward</Button>
|
|
163
|
-
<Button onClick={() => carouselRef.current?.navigateTo(3)}>To 3</Button>
|
|
164
|
-
<View.Item>Index: {index}</View.Item>
|
|
165
|
-
</View>
|
|
166
|
-
<Carousel visibleItems={2} instanceRef={carouselRef} navigationDisplay="hidden" onChange={(changeArgs) => {
|
|
167
|
-
args.handleChange(changeArgs);
|
|
168
|
-
setIndex(changeArgs.index);
|
|
169
|
-
}}>
|
|
170
|
-
<Placeholder h={100}>Item 0</Placeholder>
|
|
171
|
-
<Placeholder h={100}>Item 1</Placeholder>
|
|
172
|
-
<Placeholder h={100}>Item 2</Placeholder>
|
|
173
|
-
<Placeholder h={100}>Item 3</Placeholder>
|
|
174
|
-
<Placeholder h={100}>Item 4</Placeholder>
|
|
175
|
-
<Placeholder h={100}>Item 5</Placeholder>
|
|
176
|
-
</Carousel>
|
|
177
|
-
</View>
|
|
178
|
-
</Example.Item>
|
|
179
|
-
</Example>);
|
|
180
|
-
},
|
|
181
|
-
play: async ({ canvas, args }) => {
|
|
182
|
-
const buttons = canvas.getAllByRole("button");
|
|
183
|
-
const backButton = buttons[0];
|
|
184
|
-
const forwardButton = buttons[1];
|
|
185
|
-
const toButton = buttons[2];
|
|
186
|
-
await userEvent.click(forwardButton);
|
|
187
|
-
await waitFor(() => {
|
|
188
|
-
expect(args.handleChange).toHaveBeenCalledWith({ index: 1 });
|
|
189
|
-
expect(args.handleChange).toHaveBeenCalledWith({ index: 2 });
|
|
190
|
-
expect(args.handleChange).not.toHaveBeenCalledWith({ index: 3 });
|
|
191
|
-
});
|
|
192
|
-
args.handleChange.mockClear();
|
|
193
|
-
await userEvent.click(backButton);
|
|
194
|
-
await waitFor(() => {
|
|
195
|
-
expect(args.handleChange).toHaveBeenCalledWith({ index: 0 });
|
|
196
|
-
expect(args.handleChange).toHaveBeenCalledWith({ index: 1 });
|
|
197
|
-
});
|
|
198
|
-
args.handleChange.mockClear();
|
|
199
|
-
await userEvent.click(toButton);
|
|
200
|
-
await waitFor(() => {
|
|
201
|
-
expect(args.handleChange).toHaveBeenCalledWith({ index: 1 });
|
|
202
|
-
expect(args.handleChange).toHaveBeenCalledWith({ index: 2 });
|
|
203
|
-
expect(args.handleChange).toHaveBeenCalledWith({ index: 3 });
|
|
204
|
-
});
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
export const className = {
|
|
208
|
-
name: "className, attributes",
|
|
209
|
-
render: () => (<div data-testid="root">
|
|
210
|
-
<Carousel visibleItems={2} className="test-classname" attributes={{ id: "test-id" }}>
|
|
211
|
-
<Placeholder h={100}>Item 0</Placeholder>
|
|
212
|
-
<Placeholder h={100}>Item 1</Placeholder>
|
|
213
|
-
<Placeholder h={100}>Item 2</Placeholder>
|
|
214
|
-
<Placeholder h={100}>Item 3</Placeholder>
|
|
215
|
-
<Placeholder h={100}>Item 4</Placeholder>
|
|
216
|
-
<Placeholder h={100}>Item 5</Placeholder>
|
|
217
|
-
</Carousel>
|
|
218
|
-
</div>),
|
|
219
|
-
play: async ({ canvas }) => {
|
|
220
|
-
const root = canvas.getByTestId("root").firstChild;
|
|
221
|
-
expect(root).toHaveClass("test-classname");
|
|
222
|
-
expect(root).toHaveAttribute("id", "test-id");
|
|
223
|
-
},
|
|
224
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { fn } from "storybook/test";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: import("react").FC<import("./..").CheckboxProps>;
|
|
6
|
-
parameters: {
|
|
7
|
-
iframe: {
|
|
8
|
-
url: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
|
13
|
-
export declare const render: StoryObj;
|
|
14
|
-
export declare const size: {
|
|
15
|
-
name: string;
|
|
16
|
-
render: () => import("react").JSX.Element;
|
|
17
|
-
};
|
|
18
|
-
export declare const error: {
|
|
19
|
-
name: string;
|
|
20
|
-
render: () => import("react").JSX.Element;
|
|
21
|
-
};
|
|
22
|
-
export declare const disabled: StoryObj;
|
|
23
|
-
export declare const checked: StoryObj<{
|
|
24
|
-
handleChange: ReturnType<typeof fn>;
|
|
25
|
-
}>;
|
|
26
|
-
export declare const defaultChecked: StoryObj<{
|
|
27
|
-
handleChange: ReturnType<typeof fn>;
|
|
28
|
-
}>;
|
|
29
|
-
export declare const indeterminate: StoryObj;
|
|
30
|
-
export declare const className: StoryObj;
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { Example } from "../../../utilities/storybook/index.js";
|
|
2
|
-
import Checkbox from "../index.js";
|
|
3
|
-
import View from "../../View/index.js";
|
|
4
|
-
import { expect, fn, userEvent } from "storybook/test";
|
|
5
|
-
export default {
|
|
6
|
-
title: "Components/Checkbox",
|
|
7
|
-
component: Checkbox,
|
|
8
|
-
parameters: {
|
|
9
|
-
iframe: {
|
|
10
|
-
url: "https://reshaped.so/docs/components/checkbox",
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export const render = {
|
|
15
|
-
name: "name, value",
|
|
16
|
-
render: () => (<Checkbox name="test-name" value="test-value">
|
|
17
|
-
Content
|
|
18
|
-
</Checkbox>),
|
|
19
|
-
play: async ({ canvas }) => {
|
|
20
|
-
const input = canvas.getByRole("checkbox");
|
|
21
|
-
expect(input).toHaveAttribute("value", "test-value");
|
|
22
|
-
expect(input).toHaveAttribute("name", "test-name");
|
|
23
|
-
expect(input).not.toBeChecked();
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export const size = {
|
|
27
|
-
name: "size",
|
|
28
|
-
render: () => (<Example>
|
|
29
|
-
<Example.Item title="size: small">
|
|
30
|
-
<View gap={4} direction="row">
|
|
31
|
-
<Checkbox name="animal" value="dog" size="small" defaultChecked>
|
|
32
|
-
Checkbox
|
|
33
|
-
</Checkbox>
|
|
34
|
-
<Checkbox name="animal" value="dog" size="small" indeterminate>
|
|
35
|
-
Checkbox
|
|
36
|
-
</Checkbox>
|
|
37
|
-
</View>
|
|
38
|
-
</Example.Item>
|
|
39
|
-
<Example.Item title="size: medium">
|
|
40
|
-
<View gap={4} direction="row">
|
|
41
|
-
<Checkbox name="animal" value="dog" size="medium" defaultChecked>
|
|
42
|
-
Checkbox
|
|
43
|
-
</Checkbox>
|
|
44
|
-
<Checkbox name="animal" value="dog" size="medium" indeterminate>
|
|
45
|
-
Checkbox
|
|
46
|
-
</Checkbox>
|
|
47
|
-
</View>
|
|
48
|
-
</Example.Item>
|
|
49
|
-
<Example.Item title="size: large">
|
|
50
|
-
<View gap={4} direction="row">
|
|
51
|
-
<Checkbox name="animal" value="dog" size="large" defaultChecked>
|
|
52
|
-
Checkbox
|
|
53
|
-
</Checkbox>
|
|
54
|
-
<Checkbox name="animal" value="dog" size="large" indeterminate>
|
|
55
|
-
Checkbox
|
|
56
|
-
</Checkbox>
|
|
57
|
-
</View>
|
|
58
|
-
</Example.Item>
|
|
59
|
-
<Example.Item title="size: responsive, s: small, m: large">
|
|
60
|
-
<View gap={4} direction="row">
|
|
61
|
-
<Checkbox name="animal" value="dog" size={{ s: "small", m: "large" }} defaultChecked>
|
|
62
|
-
Checkbox
|
|
63
|
-
</Checkbox>
|
|
64
|
-
</View>
|
|
65
|
-
</Example.Item>
|
|
66
|
-
</Example>),
|
|
67
|
-
};
|
|
68
|
-
export const error = {
|
|
69
|
-
name: "hasError",
|
|
70
|
-
render: () => (<Example>
|
|
71
|
-
<Example.Item title="error">
|
|
72
|
-
<Checkbox name="animal" value="dog" hasError>
|
|
73
|
-
Checkbox
|
|
74
|
-
</Checkbox>
|
|
75
|
-
</Example.Item>
|
|
76
|
-
</Example>),
|
|
77
|
-
};
|
|
78
|
-
export const disabled = {
|
|
79
|
-
name: "disabled",
|
|
80
|
-
render: () => (<Example>
|
|
81
|
-
<Example.Item title="disabled">
|
|
82
|
-
<Checkbox name="animal" value="dog" disabled>
|
|
83
|
-
Checkbox
|
|
84
|
-
</Checkbox>
|
|
85
|
-
</Example.Item>
|
|
86
|
-
<Example.Item title="disabled, checked">
|
|
87
|
-
<Checkbox name="animal" value="dog" disabled checked>
|
|
88
|
-
Checkbox
|
|
89
|
-
</Checkbox>
|
|
90
|
-
</Example.Item>
|
|
91
|
-
<Example.Item title="disabled, indeterminate">
|
|
92
|
-
<Checkbox name="animal" value="dog" disabled indeterminate>
|
|
93
|
-
Checkbox
|
|
94
|
-
</Checkbox>
|
|
95
|
-
</Example.Item>
|
|
96
|
-
</Example>),
|
|
97
|
-
play: async ({ canvas }) => {
|
|
98
|
-
const [input] = canvas.getAllByRole("checkbox");
|
|
99
|
-
expect(input).toBeDisabled();
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
export const checked = {
|
|
103
|
-
name: "checked, controlled",
|
|
104
|
-
args: {
|
|
105
|
-
handleChange: fn(),
|
|
106
|
-
},
|
|
107
|
-
render: (args) => (<Checkbox name="test-name" value="test-value" checked onChange={args.handleChange}>
|
|
108
|
-
Content
|
|
109
|
-
</Checkbox>),
|
|
110
|
-
play: async ({ canvas, args }) => {
|
|
111
|
-
const input = canvas.getByRole("checkbox");
|
|
112
|
-
expect(input).toBeChecked();
|
|
113
|
-
await userEvent.click(input);
|
|
114
|
-
expect(args.handleChange).toHaveBeenCalledTimes(1);
|
|
115
|
-
expect(args.handleChange).toHaveBeenCalledWith({
|
|
116
|
-
name: "test-name",
|
|
117
|
-
value: "test-value",
|
|
118
|
-
checked: false,
|
|
119
|
-
event: expect.objectContaining({ target: input }),
|
|
120
|
-
});
|
|
121
|
-
// Still checked because it's controlled
|
|
122
|
-
expect(input).toBeChecked();
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
export const defaultChecked = {
|
|
126
|
-
name: "defaultChecked, uncontrolled",
|
|
127
|
-
args: {
|
|
128
|
-
handleChange: fn(),
|
|
129
|
-
},
|
|
130
|
-
render: (args) => (<Checkbox name="test-name" value="test-value" defaultChecked onChange={args.handleChange}>
|
|
131
|
-
Content
|
|
132
|
-
</Checkbox>),
|
|
133
|
-
play: async ({ canvas, args }) => {
|
|
134
|
-
const input = canvas.getByRole("checkbox");
|
|
135
|
-
expect(input).toBeChecked();
|
|
136
|
-
await userEvent.click(input);
|
|
137
|
-
expect(args.handleChange).toHaveBeenCalledTimes(1);
|
|
138
|
-
expect(args.handleChange).toHaveBeenCalledWith({
|
|
139
|
-
name: "test-name",
|
|
140
|
-
value: "test-value",
|
|
141
|
-
checked: false,
|
|
142
|
-
event: expect.objectContaining({ target: input }),
|
|
143
|
-
});
|
|
144
|
-
expect(input).not.toBeChecked();
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
export const indeterminate = {
|
|
148
|
-
name: "indeterminate",
|
|
149
|
-
render: () => (<Checkbox name="test-name" value="test-value" indeterminate>
|
|
150
|
-
Content
|
|
151
|
-
</Checkbox>),
|
|
152
|
-
play: async ({ canvas }) => {
|
|
153
|
-
const input = canvas.getByRole("checkbox");
|
|
154
|
-
expect(input.indeterminate).toBeTruthy();
|
|
155
|
-
await userEvent.click(input);
|
|
156
|
-
expect(input.indeterminate).toBeFalsy();
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
export const className = {
|
|
160
|
-
name: "className, attributes",
|
|
161
|
-
render: () => (<div data-testid="root">
|
|
162
|
-
<Checkbox className="test-classname" attributes={{ id: "test-id" }}>
|
|
163
|
-
Content
|
|
164
|
-
</Checkbox>
|
|
165
|
-
</div>),
|
|
166
|
-
play: async ({ canvas }) => {
|
|
167
|
-
const root = canvas.getByTestId("root").firstChild;
|
|
168
|
-
expect(root).toHaveClass("test-classname");
|
|
169
|
-
expect(root).toHaveAttribute("id", "test-id");
|
|
170
|
-
},
|
|
171
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { fn } from "storybook/test";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: import("react").FC<import("./..").CheckboxGroupProps>;
|
|
6
|
-
parameters: {
|
|
7
|
-
iframe: {
|
|
8
|
-
url: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
|
13
|
-
export declare const value: StoryObj<{
|
|
14
|
-
handleChange: ReturnType<typeof fn>;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const defaultValue: StoryObj<{
|
|
17
|
-
handleChange: ReturnType<typeof fn>;
|
|
18
|
-
}>;
|
|
19
|
-
export declare const disabled: StoryObj;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import View from "../../View/index.js";
|
|
2
|
-
import CheckboxGroup from "../index.js";
|
|
3
|
-
import Checkbox from "../../Checkbox/index.js";
|
|
4
|
-
import { expect, fn, userEvent } from "storybook/test";
|
|
5
|
-
export default {
|
|
6
|
-
title: "Components/CheckboxGroup",
|
|
7
|
-
component: CheckboxGroup,
|
|
8
|
-
parameters: {
|
|
9
|
-
iframe: {
|
|
10
|
-
url: "https://reshaped.so/docs/components/checkbox",
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export const value = {
|
|
15
|
-
name: "value, controlled",
|
|
16
|
-
args: {
|
|
17
|
-
handleChange: fn(),
|
|
18
|
-
},
|
|
19
|
-
render: (args) => (<View gap={2}>
|
|
20
|
-
<CheckboxGroup name="test-name" value={["1"]} onChange={args.handleChange}>
|
|
21
|
-
{/* checked should be ignored */}
|
|
22
|
-
<Checkbox value="1" checked={false}>
|
|
23
|
-
Content
|
|
24
|
-
</Checkbox>
|
|
25
|
-
|
|
26
|
-
<Checkbox value="2">Content 2</Checkbox>
|
|
27
|
-
</CheckboxGroup>
|
|
28
|
-
</View>),
|
|
29
|
-
play: async ({ canvas, args }) => {
|
|
30
|
-
const inputs = canvas.getAllByRole("checkbox");
|
|
31
|
-
expect(inputs[0]).toBeChecked();
|
|
32
|
-
await userEvent.click(inputs[1]);
|
|
33
|
-
expect(args.handleChange).toHaveBeenCalledTimes(1);
|
|
34
|
-
expect(args.handleChange).toHaveBeenCalledWith({
|
|
35
|
-
name: "test-name",
|
|
36
|
-
value: ["1", "2"],
|
|
37
|
-
event: expect.objectContaining({ target: inputs[1] }),
|
|
38
|
-
});
|
|
39
|
-
// Still checked because it's controlled
|
|
40
|
-
expect(inputs[0]).toBeChecked();
|
|
41
|
-
expect(inputs[1]).not.toBeChecked();
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
export const defaultValue = {
|
|
45
|
-
name: "defaultValue, uncontrolled",
|
|
46
|
-
args: {
|
|
47
|
-
handleChange: fn(),
|
|
48
|
-
},
|
|
49
|
-
render: (args) => (<View gap={2}>
|
|
50
|
-
<CheckboxGroup name="test-name" defaultValue={["1"]} onChange={args.handleChange}>
|
|
51
|
-
{/* checked should be ignored */}
|
|
52
|
-
<Checkbox value="1" checked={false}>
|
|
53
|
-
Content
|
|
54
|
-
</Checkbox>
|
|
55
|
-
|
|
56
|
-
<Checkbox value="2">Content 2</Checkbox>
|
|
57
|
-
</CheckboxGroup>
|
|
58
|
-
</View>),
|
|
59
|
-
play: async ({ canvas, args }) => {
|
|
60
|
-
const inputs = canvas.getAllByRole("checkbox");
|
|
61
|
-
expect(inputs[0]).toBeChecked();
|
|
62
|
-
await userEvent.click(inputs[1]);
|
|
63
|
-
expect(args.handleChange).toHaveBeenCalledTimes(1);
|
|
64
|
-
expect(args.handleChange).toHaveBeenCalledWith({
|
|
65
|
-
name: "test-name",
|
|
66
|
-
value: ["1", "2"],
|
|
67
|
-
event: expect.objectContaining({ target: inputs[1] }),
|
|
68
|
-
});
|
|
69
|
-
expect(inputs[0]).toBeChecked();
|
|
70
|
-
expect(inputs[1]).toBeChecked();
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
export const disabled = {
|
|
74
|
-
name: "disabled",
|
|
75
|
-
render: () => (<CheckboxGroup name="test-name" disabled>
|
|
76
|
-
<Checkbox value="test-value">Item 1</Checkbox>
|
|
77
|
-
<Checkbox value="test-value-2">Item 2</Checkbox>
|
|
78
|
-
</CheckboxGroup>),
|
|
79
|
-
play: async ({ canvas }) => {
|
|
80
|
-
const [input] = canvas.getAllByRole("checkbox");
|
|
81
|
-
expect(input).toBeDisabled();
|
|
82
|
-
},
|
|
83
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: import("react").FC<import("./..").ContainerProps>;
|
|
5
|
-
parameters: {
|
|
6
|
-
iframe: {
|
|
7
|
-
url: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|
|
12
|
-
export declare const padding: {
|
|
13
|
-
name: string;
|
|
14
|
-
render: () => import("react").JSX.Element;
|
|
15
|
-
};
|
|
16
|
-
export declare const size: {
|
|
17
|
-
name: string;
|
|
18
|
-
render: () => import("react").JSX.Element;
|
|
19
|
-
};
|
|
20
|
-
export declare const flex: {
|
|
21
|
-
name: string;
|
|
22
|
-
render: () => import("react").JSX.Element;
|
|
23
|
-
};
|
|
24
|
-
export declare const className: StoryObj;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Example, Placeholder } from "../../../utilities/storybook/index.js";
|
|
2
|
-
import Container from "../index.js";
|
|
3
|
-
import { expect } from "storybook/test";
|
|
4
|
-
export default {
|
|
5
|
-
title: "Utility components/Container",
|
|
6
|
-
component: Container,
|
|
7
|
-
parameters: {
|
|
8
|
-
iframe: {
|
|
9
|
-
url: "https://reshaped.so/docs/utilities/container",
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
export const padding = {
|
|
14
|
-
name: "padding",
|
|
15
|
-
render: () => (<Example>
|
|
16
|
-
<Example.Item title="padding: default">
|
|
17
|
-
<Container>
|
|
18
|
-
<Placeholder />
|
|
19
|
-
</Container>
|
|
20
|
-
</Example.Item>
|
|
21
|
-
<Example.Item title="padding: 0">
|
|
22
|
-
<Container padding={0}>
|
|
23
|
-
<Placeholder />
|
|
24
|
-
</Container>
|
|
25
|
-
</Example.Item>
|
|
26
|
-
</Example>),
|
|
27
|
-
};
|
|
28
|
-
export const size = {
|
|
29
|
-
name: "width, height, maxHeight",
|
|
30
|
-
render: () => (<Example>
|
|
31
|
-
<Example.Item title="width: 200px, height: 200px">
|
|
32
|
-
<Container width="200px" height="200px">
|
|
33
|
-
<Placeholder h="100%"/>
|
|
34
|
-
</Container>
|
|
35
|
-
</Example.Item>
|
|
36
|
-
<Example.Item title="width: 200px, height: 200px, maxHeight: 100px">
|
|
37
|
-
<Container width="200px" height="200px" maxHeight="100px">
|
|
38
|
-
<Placeholder h="100%"/>
|
|
39
|
-
</Container>
|
|
40
|
-
</Example.Item>
|
|
41
|
-
<Example.Item title="width, height: [s] 100px, [m+] 200px">
|
|
42
|
-
<Container width={{ s: "100px", m: "200px" }} height={{ s: "100px", m: "200px" }}>
|
|
43
|
-
<Placeholder h="100%"/>
|
|
44
|
-
</Container>
|
|
45
|
-
</Example.Item>
|
|
46
|
-
<Example.Item title="width, height: [s] 100px, [m+] 200px, maxHeight: [s] 50px, [m+]: 100px">
|
|
47
|
-
<Container width={{ s: "100px", m: "200px" }} height={{ s: "100px", m: "200px" }} maxHeight={{ s: "50px", m: "100px" }}>
|
|
48
|
-
<Placeholder h="100%"/>
|
|
49
|
-
</Container>
|
|
50
|
-
</Example.Item>
|
|
51
|
-
</Example>),
|
|
52
|
-
};
|
|
53
|
-
export const flex = {
|
|
54
|
-
name: "align, justify",
|
|
55
|
-
render: () => (<Example>
|
|
56
|
-
<Example.Item title="align: center, justify: center">
|
|
57
|
-
<Container align="center" justify="center" height="200px">
|
|
58
|
-
<Placeholder />
|
|
59
|
-
</Container>
|
|
60
|
-
</Example.Item>
|
|
61
|
-
</Example>),
|
|
62
|
-
};
|
|
63
|
-
export const className = {
|
|
64
|
-
name: "className, attributes",
|
|
65
|
-
render: () => (<div data-testid="root">
|
|
66
|
-
<Container className="test-classname" attributes={{ id: "test-id" }}>
|
|
67
|
-
<Placeholder />
|
|
68
|
-
</Container>
|
|
69
|
-
</div>),
|
|
70
|
-
play: async ({ canvas }) => {
|
|
71
|
-
const root = canvas.getByTestId("root").firstChild;
|
|
72
|
-
expect(root).toHaveClass("test-classname");
|
|
73
|
-
expect(root).toHaveAttribute("id", "test-id");
|
|
74
|
-
},
|
|
75
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import { fn } from "storybook/test";
|
|
3
|
-
declare const _default: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: import("react").FC<import("./..").ContextMenuProps> & {
|
|
6
|
-
Content: import("react").FC<import("../../DropdownMenu/DropdownMenu.types").ContentProps>;
|
|
7
|
-
Item: import("react").FC<import("../../DropdownMenu/DropdownMenu.types").ItemProps>;
|
|
8
|
-
Section: import("react").FC<import("../../DropdownMenu/DropdownMenu.types").SectionProps>;
|
|
9
|
-
SubMenu: import("react").FC<import("../../DropdownMenu/DropdownMenu.types").SubMenuProps>;
|
|
10
|
-
SubTrigger: import("react").FC<import("../../DropdownMenu/DropdownMenu.types").SubTriggerProps>;
|
|
11
|
-
};
|
|
12
|
-
parameters: {
|
|
13
|
-
iframe: {
|
|
14
|
-
url: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|
|
19
|
-
export declare const base: {
|
|
20
|
-
name: string;
|
|
21
|
-
render: () => import("react").JSX.Element;
|
|
22
|
-
};
|
|
23
|
-
export declare const handlers: StoryObj<{
|
|
24
|
-
handleOpen: ReturnType<typeof fn>;
|
|
25
|
-
handleClose: ReturnType<typeof fn>;
|
|
26
|
-
}>;
|