reshaped 4.2.0 → 4.3.0-canary.1
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/bin/cli.js +1 -1
- package/dist/bundle.cjs +2 -0
- package/dist/bundle.css +1 -1
- package/dist/bundle.d.cts +158 -0
- package/dist/components/Accordion/Accordion.context.d.ts +1 -1
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.js +2 -2
- package/dist/components/Accordion/Accordion.types.d.ts +3 -3
- package/dist/components/Accordion/AccordionContent.d.ts +1 -1
- package/dist/components/Accordion/AccordionContent.js +3 -3
- package/dist/components/Accordion/AccordionControlled.d.ts +1 -1
- package/dist/components/Accordion/AccordionControlled.js +3 -3
- package/dist/components/Accordion/AccordionTrigger.d.ts +1 -1
- package/dist/components/Accordion/AccordionTrigger.js +5 -5
- package/dist/components/Accordion/AccordionUncontrolled.d.ts +1 -1
- package/dist/components/Accordion/AccordionUncontrolled.js +1 -1
- package/dist/components/Accordion/index.d.ts +4 -4
- package/dist/components/Accordion/index.js +3 -3
- package/dist/components/Accordion/tests/Accordion.stories.d.ts +3 -3
- package/dist/components/Accordion/tests/Accordion.stories.js +152 -158
- package/dist/components/Actionable/Actionable.d.ts +1 -1
- package/dist/components/Actionable/Actionable.types.d.ts +1 -1
- package/dist/components/Actionable/index.d.ts +2 -2
- package/dist/components/Actionable/index.js +1 -1
- package/dist/components/Actionable/tests/Actionable.stories.d.ts +1 -1
- package/dist/components/Actionable/tests/Actionable.stories.js +136 -142
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/Alert.js +3 -3
- package/dist/components/Alert/Alert.types.d.ts +3 -3
- package/dist/components/Alert/index.d.ts +2 -2
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Alert/tests/Alert.stories.d.ts +1 -1
- package/dist/components/Alert/tests/Alert.stories.js +46 -52
- package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +10 -8
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +5 -5
- package/dist/components/Autocomplete/index.d.ts +2 -2
- package/dist/components/Autocomplete/index.js +1 -1
- package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +2 -2
- package/dist/components/Autocomplete/tests/Autocomplete.stories.js +118 -124
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +5 -5
- package/dist/components/Avatar/Avatar.types.d.ts +3 -3
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Avatar/tests/Avatar.stories.d.ts +1 -1
- package/dist/components/Avatar/tests/Avatar.stories.js +122 -128
- package/dist/components/Badge/Badge.context.d.ts +7 -0
- package/dist/components/Badge/Badge.context.js +8 -0
- package/dist/components/Badge/Badge.d.ts +4 -3
- package/dist/components/Badge/Badge.js +26 -6
- package/dist/components/Badge/Badge.module.css +1 -1
- package/dist/components/Badge/Badge.types.d.ts +3 -3
- package/dist/components/Badge/BadgeContainer.d.ts +2 -1
- package/dist/components/Badge/BadgeContainer.js +5 -1
- package/dist/components/Badge/index.d.ts +3 -3
- package/dist/components/Badge/index.js +2 -2
- package/dist/components/Badge/tests/Badge.stories.d.ts +3 -2
- package/dist/components/Badge/tests/Badge.stories.js +298 -274
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +6 -6
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +2 -2
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsItem.js +2 -2
- package/dist/components/Breadcrumbs/index.d.ts +3 -3
- package/dist/components/Breadcrumbs/index.js +2 -2
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +2 -2
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +137 -143
- package/dist/components/Button/Button.d.ts +7 -7
- package/dist/components/Button/Button.js +4 -4
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Button/Button.types.d.ts +5 -5
- package/dist/components/Button/ButtonAligner.d.ts +1 -1
- package/dist/components/Button/ButtonAligner.js +1 -1
- package/dist/components/Button/ButtonGroup.d.ts +1 -1
- package/dist/components/Button/index.d.ts +4 -4
- package/dist/components/Button/index.js +3 -3
- package/dist/components/Button/tests/Button.stories.d.ts +9 -12
- package/dist/components/Button/tests/Button.stories.js +590 -585
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Calendar/Calendar.js +2 -2
- package/dist/components/Calendar/Calendar.module.css +1 -1
- package/dist/components/Calendar/Calendar.utils.d.ts +1 -1
- package/dist/components/Calendar/CalendarControlled.d.ts +1 -1
- package/dist/components/Calendar/CalendarControlled.js +7 -7
- package/dist/components/Calendar/CalendarControls.d.ts +1 -1
- package/dist/components/Calendar/CalendarControls.js +8 -8
- package/dist/components/Calendar/CalendarDate.d.ts +1 -1
- package/dist/components/Calendar/CalendarDate.js +5 -2
- package/dist/components/Calendar/CalendarMonth.d.ts +1 -1
- package/dist/components/Calendar/CalendarMonth.js +2 -2
- package/dist/components/Calendar/CalendarUncontrolled.d.ts +1 -1
- package/dist/components/Calendar/CalendarUncontrolled.js +1 -1
- package/dist/components/Calendar/CalendarYear.d.ts +1 -1
- package/dist/components/Calendar/CalendarYear.js +3 -3
- package/dist/components/Calendar/index.d.ts +2 -2
- package/dist/components/Calendar/index.js +1 -1
- package/dist/components/Calendar/tests/Calendar.stories.d.ts +2 -1
- package/dist/components/Calendar/tests/Calendar.stories.js +237 -228
- package/dist/components/Calendar/useCalendarKeyboardNavigation.js +3 -3
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +3 -3
- package/dist/components/Card/Card.types.d.ts +3 -3
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Card/tests/Card.stories.d.ts +1 -1
- package/dist/components/Card/tests/Card.stories.js +111 -117
- package/dist/components/Carousel/Carousel.d.ts +1 -1
- package/dist/components/Carousel/Carousel.js +5 -5
- package/dist/components/Carousel/Carousel.types.d.ts +3 -3
- package/dist/components/Carousel/CarouselControl.d.ts +1 -1
- package/dist/components/Carousel/CarouselControl.js +4 -4
- package/dist/components/Carousel/index.d.ts +2 -2
- package/dist/components/Carousel/index.js +1 -1
- package/dist/components/Carousel/tests/Carousel.stories.d.ts +1 -1
- package/dist/components/Carousel/tests/Carousel.stories.js +163 -169
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +10 -8
- package/dist/components/Checkbox/Checkbox.types.d.ts +2 -2
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/tests/Checkbox.stories.d.ts +1 -1
- package/dist/components/Checkbox/tests/Checkbox.stories.js +97 -103
- package/dist/components/CheckboxGroup/CheckboxGroup.context.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.js +2 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.types.d.ts +2 -2
- package/dist/components/CheckboxGroup/CheckboxGroupControlled.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupControlled.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupUncontrolled.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroupUncontrolled.js +1 -1
- package/dist/components/CheckboxGroup/index.d.ts +3 -3
- package/dist/components/CheckboxGroup/index.js +2 -2
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.d.ts +1 -1
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.js +44 -50
- package/dist/components/Container/Container.d.ts +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.types.d.ts +3 -3
- package/dist/components/Container/index.d.ts +2 -2
- package/dist/components/Container/index.js +1 -1
- package/dist/components/Container/tests/Container.stories.d.ts +1 -1
- package/dist/components/Container/tests/Container.stories.js +55 -61
- package/dist/components/ContentToggle/ContentToggle.d.ts +1 -1
- package/dist/components/ContentToggle/ContentToggle.js +1 -1
- package/dist/components/ContentToggle/ContentToggle.types.d.ts +1 -1
- package/dist/components/ContentToggle/index.d.ts +2 -2
- package/dist/components/ContentToggle/index.js +1 -1
- package/dist/components/ContentToggle/tests/ContentToggle.stories.d.ts +1 -1
- package/dist/components/ContentToggle/tests/ContentToggle.stories.js +32 -38
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +6 -6
- package/dist/components/ContextMenu/ContextMenu.types.d.ts +10 -2
- package/dist/components/ContextMenu/index.d.ts +3 -3
- package/dist/components/ContextMenu/index.js +2 -2
- package/dist/components/ContextMenu/tests/ContextMenu.stories.d.ts +13 -6
- package/dist/components/ContextMenu/tests/ContextMenu.stories.js +164 -70
- package/dist/components/Dismissible/Dismissible.d.ts +1 -1
- package/dist/components/Dismissible/Dismissible.js +2 -2
- package/dist/components/Dismissible/Dismissible.types.d.ts +1 -1
- package/dist/components/Dismissible/index.d.ts +2 -2
- package/dist/components/Dismissible/index.js +1 -1
- package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +1 -1
- package/dist/components/Dismissible/tests/Dismissible.stories.js +60 -66
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +3 -3
- package/dist/components/Divider/Divider.types.d.ts +2 -2
- package/dist/components/Divider/index.d.ts +2 -2
- package/dist/components/Divider/index.js +1 -1
- package/dist/components/Divider/tests/Divider.stories.d.ts +1 -1
- package/dist/components/Divider/tests/Divider.stories.js +85 -91
- package/dist/components/DropdownMenu/DropdownMenu.context.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +6 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +18 -12
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +5 -5
- package/dist/components/DropdownMenu/index.d.ts +3 -3
- package/dist/components/DropdownMenu/index.js +2 -2
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +8 -8
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.js +247 -253
- package/dist/components/Expandable/Expandable.d.ts +1 -1
- package/dist/components/Expandable/Expandable.js +3 -3
- package/dist/components/Expandable/Expandable.module.css +1 -1
- package/dist/components/Expandable/Expandable.types.d.ts +1 -1
- package/dist/components/Expandable/index.d.ts +2 -2
- package/dist/components/Expandable/index.js +1 -1
- package/dist/components/Expandable/tests/Expandable.stories.d.ts +1 -1
- package/dist/components/Expandable/tests/Expandable.stories.js +56 -62
- package/dist/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/components/FileUpload/FileUpload.js +3 -3
- package/dist/components/FileUpload/FileUpload.types.d.ts +3 -3
- package/dist/components/FileUpload/index.d.ts +2 -2
- package/dist/components/FileUpload/index.js +1 -1
- package/dist/components/FileUpload/tests/FileUpload.stories.d.ts +2 -2
- package/dist/components/FileUpload/tests/FileUpload.stories.js +102 -108
- package/dist/components/Flyout/Flyout.constants.d.ts +0 -3
- package/dist/components/Flyout/Flyout.constants.js +0 -17
- package/dist/components/Flyout/Flyout.context.d.ts +1 -1
- package/dist/components/Flyout/Flyout.d.ts +1 -1
- package/dist/components/Flyout/Flyout.js +2 -2
- package/dist/components/Flyout/Flyout.module.css +1 -1
- package/dist/components/Flyout/Flyout.types.d.ts +5 -2
- package/dist/components/Flyout/FlyoutContent.d.ts +1 -1
- package/dist/components/Flyout/FlyoutContent.js +11 -8
- package/dist/components/Flyout/FlyoutControlled.d.ts +1 -1
- package/dist/components/Flyout/FlyoutControlled.js +72 -20
- package/dist/components/Flyout/FlyoutTrigger.d.ts +1 -1
- package/dist/components/Flyout/FlyoutTrigger.js +1 -1
- package/dist/components/Flyout/FlyoutUncontrolled.d.ts +1 -1
- package/dist/components/Flyout/FlyoutUncontrolled.js +1 -1
- package/dist/components/Flyout/index.d.ts +5 -5
- package/dist/components/Flyout/index.js +4 -4
- package/dist/components/Flyout/tests/Flyout.stories.d.ts +7 -0
- package/dist/components/Flyout/tests/Flyout.stories.js +521 -386
- package/dist/components/Flyout/useFlyout.d.ts +1 -1
- package/dist/components/Flyout/useFlyout.js +1 -1
- package/dist/components/FormControl/FormControl.context.d.ts +1 -3
- package/dist/components/FormControl/FormControl.d.ts +1 -1
- package/dist/components/FormControl/FormControl.js +20 -11
- package/dist/components/FormControl/FormControl.types.d.ts +4 -5
- package/dist/components/FormControl/FormControl.utilities.d.ts +1 -1
- package/dist/components/FormControl/FormControlCaption.d.ts +1 -1
- package/dist/components/FormControl/FormControlCaption.js +14 -8
- package/dist/components/FormControl/FormControlError.d.ts +1 -1
- package/dist/components/FormControl/FormControlError.js +2 -2
- package/dist/components/FormControl/FormControlHelper.d.ts +1 -1
- package/dist/components/FormControl/FormControlHelper.js +2 -2
- package/dist/components/FormControl/FormControlLabel.d.ts +1 -1
- package/dist/components/FormControl/FormControlLabel.js +5 -5
- package/dist/components/FormControl/index.d.ts +6 -6
- package/dist/components/FormControl/index.js +5 -5
- package/dist/components/FormControl/tests/FormControl.stories.d.ts +4 -4
- package/dist/components/FormControl/tests/FormControl.stories.js +114 -113
- package/dist/components/Grid/Grid.d.ts +1 -1
- package/dist/components/Grid/Grid.js +2 -2
- package/dist/components/Grid/Grid.types.d.ts +3 -3
- package/dist/components/Grid/index.d.ts +2 -2
- package/dist/components/Grid/index.js +1 -1
- package/dist/components/Grid/tests/Grid.stories.d.ts +2 -2
- package/dist/components/Grid/tests/Grid.stories.js +180 -186
- package/dist/components/Hidden/Hidden.d.ts +1 -1
- package/dist/components/Hidden/Hidden.js +1 -1
- package/dist/components/Hidden/Hidden.types.d.ts +1 -1
- package/dist/components/Hidden/index.d.ts +2 -2
- package/dist/components/Hidden/index.js +1 -1
- package/dist/components/Hidden/tests/Hidden.stories.d.ts +1 -1
- package/dist/components/Hidden/tests/Hidden.stories.js +33 -39
- package/dist/components/HiddenInput/HiddenInput.d.ts +1 -1
- package/dist/components/HiddenInput/HiddenInput.js +5 -7
- package/dist/components/HiddenInput/HiddenInput.types.d.ts +2 -2
- package/dist/components/HiddenInput/index.d.ts +2 -2
- package/dist/components/HiddenInput/index.js +1 -1
- package/dist/components/HiddenInput/tests/HiddenInput.stories.d.ts +5 -1
- package/dist/components/HiddenInput/tests/HiddenInput.stories.js +138 -119
- package/dist/components/HiddenVisually/HiddenVisually.d.ts +1 -1
- package/dist/components/HiddenVisually/index.d.ts +2 -2
- package/dist/components/HiddenVisually/index.js +1 -1
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +1 -1
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +14 -20
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Icon/Icon.types.d.ts +2 -2
- package/dist/components/Icon/index.d.ts +2 -2
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Icon/tests/Icon.stories.d.ts +1 -1
- package/dist/components/Icon/tests/Icon.stories.js +78 -84
- package/dist/components/IconToggle/IconToggle.d.ts +1 -1
- package/dist/components/IconToggle/IconToggle.js +2 -2
- package/dist/components/IconToggle/IconToggle.module.css +1 -1
- package/dist/components/IconToggle/IconToggle.types.d.ts +1 -1
- package/dist/components/IconToggle/index.d.ts +2 -2
- package/dist/components/IconToggle/index.js +1 -1
- package/dist/components/IconToggle/tests/IconToggle.stories.d.ts +1 -1
- package/dist/components/IconToggle/tests/IconToggle.stories.js +12 -18
- package/dist/components/Image/Image.d.ts +1 -1
- package/dist/components/Image/Image.js +8 -5
- package/dist/components/Image/Image.module.css +1 -1
- package/dist/components/Image/Image.types.d.ts +3 -3
- package/dist/components/Image/index.d.ts +2 -2
- package/dist/components/Image/index.js +1 -1
- package/dist/components/Image/tests/Image.stories.d.ts +6 -5
- package/dist/components/Image/tests/Image.stories.js +182 -151
- package/dist/components/Link/Link.d.ts +3 -3
- package/dist/components/Link/Link.js +2 -2
- package/dist/components/Link/Link.types.d.ts +2 -2
- package/dist/components/Link/index.d.ts +2 -2
- package/dist/components/Link/index.js +1 -1
- package/dist/components/Link/tests/Link.stories.d.ts +3 -3
- package/dist/components/Link/tests/Link.stories.js +98 -104
- package/dist/components/Loader/Loader.d.ts +1 -1
- package/dist/components/Loader/Loader.js +1 -1
- package/dist/components/Loader/Loader.types.d.ts +2 -2
- package/dist/components/Loader/index.d.ts +2 -2
- package/dist/components/Loader/index.js +1 -1
- package/dist/components/Loader/tests/Loader.stories.d.ts +1 -1
- package/dist/components/Loader/tests/Loader.stories.js +43 -49
- package/dist/components/LoaderText/LoaderText.d.ts +1 -1
- package/dist/components/LoaderText/LoaderText.js +2 -2
- package/dist/components/LoaderText/LoaderText.types.d.ts +2 -2
- package/dist/components/LoaderText/index.d.ts +2 -2
- package/dist/components/LoaderText/index.js +1 -1
- package/dist/components/LoaderText/tests/LoaderText.stories.d.ts +1 -1
- package/dist/components/LoaderText/tests/LoaderText.stories.js +35 -41
- package/dist/components/MenuItem/MenuItem.d.ts +7 -6
- package/dist/components/MenuItem/MenuItem.js +6 -6
- package/dist/components/MenuItem/MenuItem.module.css +1 -1
- package/dist/components/MenuItem/MenuItem.types.d.ts +7 -4
- package/dist/components/MenuItem/MenuItemAligner.d.ts +1 -1
- package/dist/components/MenuItem/MenuItemAligner.js +1 -1
- package/dist/components/MenuItem/index.d.ts +3 -3
- package/dist/components/MenuItem/index.js +2 -2
- package/dist/components/MenuItem/tests/MenuItem.stories.d.ts +11 -6
- package/dist/components/MenuItem/tests/MenuItem.stories.js +157 -143
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +27 -187
- package/dist/components/Modal/Modal.module.css +1 -1
- package/dist/components/Modal/Modal.types.d.ts +5 -4
- package/dist/components/Modal/index.d.ts +2 -2
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal/tests/Modal.stories.d.ts +3 -3
- package/dist/components/Modal/tests/Modal.stories.js +277 -269
- package/dist/components/Modal/useModalDrag.d.ts +21 -0
- package/dist/components/Modal/useModalDrag.js +318 -0
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/NumberField.js +2 -2
- package/dist/components/NumberField/NumberField.types.d.ts +2 -2
- package/dist/components/NumberField/NumberFieldControlled.d.ts +1 -1
- package/dist/components/NumberField/NumberFieldControlled.js +29 -20
- package/dist/components/NumberField/NumberFieldUncontrolled.d.ts +1 -1
- package/dist/components/NumberField/NumberFieldUncontrolled.js +1 -1
- package/dist/components/NumberField/index.d.ts +2 -2
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/NumberField/tests/NumberField.stories.d.ts +1 -1
- package/dist/components/NumberField/tests/NumberField.stories.js +182 -188
- package/dist/components/Overlay/Overlay.d.ts +1 -1
- package/dist/components/Overlay/Overlay.js +14 -13
- package/dist/components/Overlay/Overlay.module.css +1 -1
- package/dist/components/Overlay/Overlay.types.d.ts +1 -1
- package/dist/components/Overlay/index.d.ts +2 -2
- package/dist/components/Overlay/index.js +1 -1
- package/dist/components/Overlay/tests/Overlay.stories.d.ts +1 -1
- package/dist/components/Overlay/tests/Overlay.stories.js +127 -131
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.js +2 -2
- package/dist/components/Pagination/Pagination.types.d.ts +1 -1
- package/dist/components/Pagination/PaginationControlled.d.ts +1 -1
- package/dist/components/Pagination/PaginationControlled.js +5 -5
- package/dist/components/Pagination/PaginationUncontrolled.d.ts +1 -1
- package/dist/components/Pagination/PaginationUncontrolled.js +1 -1
- package/dist/components/Pagination/index.d.ts +2 -2
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/Pagination/tests/Pagination.stories.d.ts +1 -1
- package/dist/components/Pagination/tests/Pagination.stories.js +55 -61
- package/dist/components/PinField/PinField.d.ts +1 -1
- package/dist/components/PinField/PinField.js +2 -2
- package/dist/components/PinField/PinField.types.d.ts +2 -2
- package/dist/components/PinField/PinFieldControlled.d.ts +1 -1
- package/dist/components/PinField/PinFieldControlled.js +46 -16
- package/dist/components/PinField/PinFieldUncontrolled.d.ts +1 -1
- package/dist/components/PinField/PinFieldUncontrolled.js +1 -1
- package/dist/components/PinField/index.d.ts +2 -2
- package/dist/components/PinField/index.js +1 -1
- package/dist/components/PinField/tests/PinField.stories.d.ts +1 -1
- package/dist/components/PinField/tests/PinField.stories.js +121 -127
- package/dist/components/Popover/Popover.d.ts +2 -2
- package/dist/components/Popover/Popover.js +4 -4
- package/dist/components/Popover/Popover.types.d.ts +1 -1
- package/dist/components/Popover/index.d.ts +3 -3
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Popover/tests/Popover.stories.d.ts +4 -4
- package/dist/components/Popover/tests/Popover.stories.js +231 -237
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +1 -1
- package/dist/components/ProgressBar/index.d.ts +2 -2
- package/dist/components/ProgressBar/index.js +1 -1
- package/dist/components/ProgressBar/tests/ProgressBar.stories.d.ts +1 -1
- package/dist/components/ProgressBar/tests/ProgressBar.stories.js +72 -78
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.types.d.ts +1 -1
- package/dist/components/ProgressIndicator/index.d.ts +2 -2
- package/dist/components/ProgressIndicator/index.js +1 -1
- package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.d.ts +1 -1
- package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.js +52 -58
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Radio/Radio.js +10 -6
- package/dist/components/Radio/Radio.types.d.ts +2 -2
- package/dist/components/Radio/index.d.ts +2 -2
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Radio/tests/Radio.stories.d.ts +1 -1
- package/dist/components/Radio/tests/Radio.stories.js +85 -91
- package/dist/components/RadioGroup/RadioGroup.context.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +3 -3
- package/dist/components/RadioGroup/RadioGroupControlled.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroupControlled.js +1 -1
- package/dist/components/RadioGroup/RadioGroupUncontrolled.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroupUncontrolled.js +1 -1
- package/dist/components/RadioGroup/index.d.ts +3 -3
- package/dist/components/RadioGroup/index.js +2 -2
- package/dist/components/RadioGroup/tests/RadioGroup.stories.d.ts +1 -1
- package/dist/components/RadioGroup/tests/RadioGroup.stories.js +38 -44
- package/dist/components/Reshaped/Reshaped.d.ts +1 -1
- package/dist/components/Reshaped/Reshaped.js +7 -7
- package/dist/components/Reshaped/Reshaped.types.d.ts +3 -3
- package/dist/components/Reshaped/index.d.ts +2 -2
- package/dist/components/Reshaped/index.js +1 -1
- package/dist/components/Reshaped/tests/Reshaped.stories.js +56 -62
- package/dist/components/Resizable/Resizable.d.ts +1 -1
- package/dist/components/Resizable/Resizable.js +2 -2
- package/dist/components/Resizable/Resizable.types.d.ts +2 -2
- package/dist/components/Resizable/ResizableContext.d.ts +1 -1
- package/dist/components/Resizable/ResizableHandle.d.ts +1 -1
- package/dist/components/Resizable/ResizableHandle.js +3 -3
- package/dist/components/Resizable/index.d.ts +3 -3
- package/dist/components/Resizable/index.js +2 -2
- package/dist/components/Resizable/tests/Resizable.stories.d.ts +3 -3
- package/dist/components/Resizable/tests/Resizable.stories.js +131 -137
- package/dist/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +32 -19
- package/dist/components/ScrollArea/ScrollArea.module.css +1 -1
- package/dist/components/ScrollArea/ScrollArea.types.d.ts +3 -3
- package/dist/components/ScrollArea/index.d.ts +2 -2
- package/dist/components/ScrollArea/index.js +1 -1
- package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +1 -1
- package/dist/components/ScrollArea/tests/ScrollArea.stories.js +220 -226
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +11 -6
- package/dist/components/Select/Select.types.d.ts +7 -7
- package/dist/components/Select/SelectCustom.d.ts +1 -1
- package/dist/components/Select/SelectCustom.js +2 -2
- package/dist/components/Select/SelectCustomControlled.d.ts +1 -1
- package/dist/components/Select/SelectCustomControlled.js +27 -14
- package/dist/components/Select/SelectCustomUncontrolled.d.ts +1 -1
- package/dist/components/Select/SelectCustomUncontrolled.js +1 -1
- package/dist/components/Select/SelectEndContent.d.ts +1 -1
- package/dist/components/Select/SelectEndContent.js +3 -3
- package/dist/components/Select/SelectGroup.d.ts +1 -1
- package/dist/components/Select/SelectGroup.js +2 -2
- package/dist/components/Select/SelectHiddenInput.d.ts +1 -1
- package/dist/components/Select/SelectNative.d.ts +1 -1
- package/dist/components/Select/SelectNative.js +4 -4
- package/dist/components/Select/SelectOption.d.ts +1 -1
- package/dist/components/Select/SelectOption.js +1 -1
- package/dist/components/Select/SelectStartContent.d.ts +1 -1
- package/dist/components/Select/SelectStartContent.js +2 -2
- package/dist/components/Select/SelectTrigger.d.ts +1 -1
- package/dist/components/Select/SelectTrigger.js +8 -8
- package/dist/components/Select/index.d.ts +5 -5
- package/dist/components/Select/index.js +4 -4
- package/dist/components/Select/tests/Select.stories.d.ts +4 -4
- package/dist/components/Select/tests/Select.stories.js +452 -470
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Skeleton/Skeleton.types.d.ts +2 -2
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Skeleton/index.js +1 -1
- package/dist/components/Skeleton/tests/Skeleton.stories.d.ts +1 -1
- package/dist/components/Skeleton/tests/Skeleton.stories.js +39 -45
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/Slider.types.d.ts +2 -1
- package/dist/components/Slider/SliderControlled.d.ts +1 -1
- package/dist/components/Slider/SliderControlled.js +11 -7
- package/dist/components/Slider/SliderThumb.d.ts +1 -1
- package/dist/components/Slider/SliderThumb.js +5 -6
- package/dist/components/Slider/SliderUncontrolled.d.ts +1 -1
- package/dist/components/Slider/SliderUncontrolled.js +1 -1
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Slider/tests/Slider.stories.d.ts +1 -1
- package/dist/components/Slider/tests/Slider.stories.js +172 -178
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.js +8 -5
- package/dist/components/Switch/Switch.types.d.ts +2 -2
- package/dist/components/Switch/index.d.ts +2 -2
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Switch/tests/Switch.stories.d.ts +1 -1
- package/dist/components/Switch/tests/Switch.stories.js +90 -98
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.js +2 -2
- package/dist/components/Table/Table.types.d.ts +1 -1
- package/dist/components/Table/index.d.ts +2 -2
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Table/tests/Table.stories.d.ts +6 -6
- package/dist/components/Table/tests/Table.stories.js +281 -287
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/Tabs.types.d.ts +3 -3
- package/dist/components/Tabs/TabsContext.d.ts +1 -1
- package/dist/components/Tabs/TabsControlled.d.ts +1 -1
- package/dist/components/Tabs/TabsControlled.js +2 -2
- package/dist/components/Tabs/TabsItem.d.ts +2 -2
- package/dist/components/Tabs/TabsItem.js +6 -6
- package/dist/components/Tabs/TabsList.d.ts +1 -1
- package/dist/components/Tabs/TabsList.js +10 -10
- package/dist/components/Tabs/TabsPanel.d.ts +1 -1
- package/dist/components/Tabs/TabsPanel.js +2 -2
- package/dist/components/Tabs/TabsUncontrolled.d.ts +1 -1
- package/dist/components/Tabs/TabsUncontrolled.js +1 -1
- package/dist/components/Tabs/index.d.ts +5 -5
- package/dist/components/Tabs/index.js +4 -4
- package/dist/components/Tabs/tests/Tabs.stories.d.ts +4 -4
- package/dist/components/Tabs/tests/Tabs.stories.js +503 -509
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/Text/Text.js +2 -2
- package/dist/components/Text/Text.types.d.ts +2 -2
- package/dist/components/Text/index.d.ts +2 -2
- package/dist/components/Text/index.js +1 -1
- package/dist/components/Text/tests/Text.stories.d.ts +1 -1
- package/dist/components/Text/tests/Text.stories.js +159 -165
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.js +9 -5
- package/dist/components/TextArea/TextArea.types.d.ts +3 -3
- package/dist/components/TextArea/index.d.ts +3 -3
- package/dist/components/TextArea/index.js +2 -2
- package/dist/components/TextArea/tests/TextArea.stories.d.ts +2 -2
- package/dist/components/TextArea/tests/TextArea.stories.js +131 -137
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TextField/TextField.js +11 -7
- package/dist/components/TextField/TextField.types.d.ts +4 -4
- package/dist/components/TextField/index.d.ts +3 -3
- package/dist/components/TextField/index.js +2 -2
- package/dist/components/TextField/tests/TextField.stories.d.ts +2 -2
- package/dist/components/TextField/tests/TextField.stories.js +160 -166
- package/dist/components/Theme/GlobalColorMode.d.ts +1 -1
- package/dist/components/Theme/GlobalColorMode.js +5 -5
- package/dist/components/Theme/Theme.context.d.ts +1 -1
- package/dist/components/Theme/Theme.d.ts +1 -1
- package/dist/components/Theme/Theme.js +4 -4
- package/dist/components/Theme/Theme.types.d.ts +1 -1
- package/dist/components/Theme/index.d.ts +4 -4
- package/dist/components/Theme/index.js +3 -3
- package/dist/components/Theme/tests/Theme.stories.d.ts +1 -1
- package/dist/components/Theme/tests/Theme.stories.js +99 -138
- package/dist/components/Theme/useTheme.d.ts +7 -7
- package/dist/components/Theme/useTheme.js +1 -1
- package/dist/components/Toast/Toast.constants.d.ts +1 -1
- package/dist/components/Toast/Toast.context.d.ts +1 -1
- package/dist/components/Toast/Toast.context.js +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js +4 -4
- package/dist/components/Toast/Toast.types.d.ts +2 -2
- package/dist/components/Toast/ToastContainer.d.ts +1 -1
- package/dist/components/Toast/ToastContainer.js +4 -4
- package/dist/components/Toast/ToastProvider.d.ts +1 -1
- package/dist/components/Toast/ToastProvider.js +4 -4
- package/dist/components/Toast/ToastRegion.d.ts +1 -1
- package/dist/components/Toast/ToastRegion.js +2 -2
- package/dist/components/Toast/index.d.ts +3 -3
- package/dist/components/Toast/index.js +2 -2
- package/dist/components/Toast/tests/Toast.stories.js +199 -205
- package/dist/components/Toast/useToast.d.ts +1 -1
- package/dist/components/Toast/useToast.js +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +2 -2
- package/dist/components/ToggleButton/ToggleButton.types.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButtonControlled.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButtonControlled.js +2 -2
- package/dist/components/ToggleButton/ToggleButtonUncontrolled.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButtonUncontrolled.js +2 -2
- package/dist/components/ToggleButton/index.d.ts +2 -2
- package/dist/components/ToggleButton/index.js +1 -1
- package/dist/components/ToggleButton/tests/ToggleButton.stories.d.ts +1 -1
- package/dist/components/ToggleButton/tests/ToggleButton.stories.js +60 -66
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.context.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.types.d.ts +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupControlled.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupControlled.js +3 -3
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupUncontrolled.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupUncontrolled.js +1 -1
- package/dist/components/ToggleButtonGroup/index.d.ts +3 -3
- package/dist/components/ToggleButtonGroup/index.js +2 -2
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/tests/ToggleButtonGroup.stories.js +134 -140
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +3 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +2 -2
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tooltip/tests/Tooltip.stories.d.ts +1 -1
- package/dist/components/Tooltip/tests/Tooltip.stories.js +144 -150
- package/dist/components/View/View.d.ts +1 -1
- package/dist/components/View/View.js +4 -4
- package/dist/components/View/View.types.d.ts +5 -5
- package/dist/components/View/index.d.ts +2 -2
- package/dist/components/View/index.js +1 -1
- package/dist/components/View/tests/View.stories.d.ts +2 -2
- package/dist/components/View/tests/View.stories.js +1098 -1131
- package/dist/components/_private/Aligner/Aligner.d.ts +1 -1
- package/dist/components/_private/Aligner/Aligner.types.d.ts +1 -1
- package/dist/components/_private/Aligner/index.d.ts +2 -2
- package/dist/components/_private/Aligner/index.js +1 -1
- package/dist/components/_private/Freeze/Freeze.d.ts +4 -0
- package/dist/components/_private/Freeze/Freeze.js +46 -0
- package/dist/components/_private/Freeze/Freeze.module.css +1 -0
- package/dist/components/_private/Freeze/Freeze.types.d.ts +14 -0
- package/dist/components/_private/Freeze/Freeze.types.js +1 -0
- package/dist/components/_private/Freeze/index.d.ts +1 -0
- package/dist/components/_private/Freeze/index.js +1 -0
- package/dist/components/_private/Freeze/tests/Freeze.stories.d.ts +7 -0
- package/dist/components/_private/Freeze/tests/Freeze.stories.js +82 -0
- package/dist/components/_private/Portal/Portal.d.ts +1 -1
- package/dist/components/_private/Portal/Portal.js +11 -5
- package/dist/components/_private/Portal/Portal.types.d.ts +1 -1
- package/dist/components/_private/Portal/index.d.ts +2 -2
- package/dist/components/_private/Portal/index.js +1 -1
- package/dist/components/_private/Portal/tests/Portal.stories.d.ts +2 -0
- package/dist/components/_private/Portal/tests/Portal.stories.js +40 -15
- package/dist/components/_private/Presence/Presence.d.ts +1 -1
- package/dist/components/_private/Presence/Presence.js +1 -1
- package/dist/components/_private/Presence/Presence.types.d.ts +1 -1
- package/dist/components/_private/Presence/index.d.ts +1 -1
- package/dist/components/_private/Presence/index.js +1 -1
- package/dist/hooks/_internal/useDrag.js +4 -4
- package/dist/hooks/_internal/useFadeSide.js +2 -2
- package/dist/hooks/_internal/useSingletonHotkeys.js +4 -0
- package/dist/hooks/_internal/useSingletonRTL.d.ts +5 -0
- package/dist/hooks/_internal/useSingletonRTL.js +2 -2
- package/dist/hooks/_internal/useSingletonViewport.d.ts +1 -1
- package/dist/hooks/_internal/useSingletonViewport.js +1 -1
- package/dist/hooks/tests/useDrag.stories.js +57 -63
- package/dist/hooks/tests/useElementId.stories.js +7 -13
- package/dist/hooks/tests/useHandlerRef.stories.js +12 -18
- package/dist/hooks/tests/useHotkeys.stories.d.ts +3 -0
- package/dist/hooks/tests/useHotkeys.stories.js +65 -54
- package/dist/hooks/tests/useKeyboardArrowNavigation.stories.js +56 -62
- package/dist/hooks/tests/useKeyboardMode.stories.js +16 -22
- package/dist/hooks/tests/useOnClickOutside.stories.d.ts +10 -0
- package/dist/hooks/tests/useOnClickOutside.stories.js +130 -48
- package/dist/hooks/tests/useRTL.stories.js +8 -14
- package/dist/hooks/tests/useResponsiveClientValue.stories.js +8 -14
- package/dist/hooks/tests/useScrollLock.stories.js +37 -43
- package/dist/hooks/tests/useToggle.stories.js +20 -26
- package/dist/hooks/useHandlerRef.js +1 -1
- package/dist/hooks/useHotkeys.d.ts +1 -1
- package/dist/hooks/useHotkeys.js +1 -1
- package/dist/hooks/useIsDismissible.js +1 -1
- package/dist/hooks/useKeyboardArrowNavigation.js +1 -1
- package/dist/hooks/useKeyboardMode.d.ts +1 -1
- package/dist/hooks/useKeyboardMode.js +1 -1
- package/dist/hooks/useOnClickOutside.js +23 -19
- package/dist/hooks/useRTL.d.ts +2 -2
- package/dist/hooks/useRTL.js +4 -2
- package/dist/hooks/useResponsiveClientValue.d.ts +1 -1
- package/dist/hooks/useResponsiveClientValue.js +1 -1
- package/dist/hooks/useViewport.d.ts +1 -1
- package/dist/hooks/useViewport.js +1 -1
- package/dist/index.d.ts +139 -139
- package/dist/index.js +76 -76
- package/dist/styles/mixin.d.ts +1 -1
- package/dist/styles/mixin.js +18 -18
- package/dist/styles/resolvers/align/index.d.ts +1 -1
- package/dist/styles/resolvers/align/index.js +1 -1
- package/dist/styles/resolvers/aspectRatio/index.d.ts +1 -1
- package/dist/styles/resolvers/aspectRatio/index.js +1 -1
- package/dist/styles/resolvers/bleed/index.d.ts +1 -1
- package/dist/styles/resolvers/bleed/index.js +1 -1
- package/dist/styles/resolvers/border/index.d.ts +1 -1
- package/dist/styles/resolvers/border/index.js +1 -1
- package/dist/styles/resolvers/height/index.d.ts +1 -1
- package/dist/styles/resolvers/height/index.js +1 -1
- package/dist/styles/resolvers/inset/index.d.ts +2 -2
- package/dist/styles/resolvers/inset/index.js +12 -2
- package/dist/styles/resolvers/inset/inset.css +1 -1
- package/dist/styles/resolvers/justify/index.d.ts +1 -1
- package/dist/styles/resolvers/justify/index.js +1 -1
- package/dist/styles/resolvers/margin/index.d.ts +1 -1
- package/dist/styles/resolvers/margin/index.js +1 -1
- package/dist/styles/resolvers/maxHeight/index.d.ts +1 -1
- package/dist/styles/resolvers/maxHeight/index.js +1 -1
- package/dist/styles/resolvers/maxWidth/index.d.ts +1 -1
- package/dist/styles/resolvers/maxWidth/index.js +1 -1
- package/dist/styles/resolvers/minHeight/index.d.ts +1 -1
- package/dist/styles/resolvers/minHeight/index.js +1 -1
- package/dist/styles/resolvers/minWidth/index.d.ts +1 -1
- package/dist/styles/resolvers/minWidth/index.js +1 -1
- package/dist/styles/resolvers/padding/index.d.ts +1 -1
- package/dist/styles/resolvers/padding/index.js +1 -1
- package/dist/styles/resolvers/position/index.d.ts +1 -1
- package/dist/styles/resolvers/position/index.js +1 -1
- package/dist/styles/resolvers/radius/index.d.ts +1 -1
- package/dist/styles/resolvers/radius/index.js +1 -1
- package/dist/styles/resolvers/shadow/index.d.ts +1 -1
- package/dist/styles/resolvers/textAlign/index.d.ts +1 -1
- package/dist/styles/resolvers/textAlign/index.js +1 -1
- package/dist/styles/resolvers/width/index.d.ts +1 -1
- package/dist/styles/resolvers/width/index.js +1 -1
- package/dist/styles/resolvers/zIndex/index.d.ts +1 -1
- package/dist/styles/types.d.ts +2 -2
- package/dist/tests/ShadowDOM.stories.js +46 -86
- package/dist/tests/ThemesPlayground.js +22 -22
- package/dist/tests/themes.stories.js +207 -250
- package/dist/themes/slate/theme.css +1 -1
- package/dist/utilities/animation.d.ts +17 -0
- package/dist/utilities/animation.js +73 -0
- package/dist/utilities/props.d.ts +2 -2
- package/dist/utilities/storybook/Example.js +2 -2
- package/dist/utilities/storybook/index.d.ts +2 -2
- package/dist/utilities/storybook/index.js +2 -2
- package/package.json +8 -7
- package/dist/bundle.d.ts +0 -158
- package/dist/bundle.js +0 -2
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const View_1 = __importDefault(require("../../../components/View"));
|
|
14
|
-
const storybook_1 = require("../../../utilities/storybook");
|
|
15
|
-
const Plus_1 = __importDefault(require("../../../icons/Plus"));
|
|
16
|
-
const Zap_1 = __importDefault(require("../../../icons/Zap"));
|
|
17
|
-
exports.default = {
|
|
1
|
+
import { expect, fn, userEvent } from "storybook/test";
|
|
2
|
+
import Avatar from "../../../components/Avatar/index.js";
|
|
3
|
+
import Badge from "../../../components/Badge/index.js";
|
|
4
|
+
import Button from "../../../components/Button/index.js";
|
|
5
|
+
import Image from "../../../components/Image/index.js";
|
|
6
|
+
import Text from "../../../components/Text/index.js";
|
|
7
|
+
import View from "../../../components/View/index.js";
|
|
8
|
+
import { Example, Placeholder } from "../../../utilities/storybook/index.js";
|
|
9
|
+
import IconChevronDown from "../../../icons/ChevronDown.js";
|
|
10
|
+
import IconPlus from "../../../icons/Plus.js";
|
|
11
|
+
import IconZap from "../../../icons/Zap.js";
|
|
12
|
+
export default {
|
|
18
13
|
title: "Components/Button",
|
|
19
|
-
component:
|
|
14
|
+
component: Button,
|
|
20
15
|
parameters: {
|
|
21
16
|
iframe: {
|
|
22
17
|
url: "https://reshaped.so/docs/components/button",
|
|
@@ -24,734 +19,744 @@ exports.default = {
|
|
|
24
19
|
},
|
|
25
20
|
};
|
|
26
21
|
const imgUrl = "https://images.unsplash.com/photo-1632502361954-0dd92ce797db?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1625&q=80";
|
|
27
|
-
|
|
22
|
+
export const variantAndColor = {
|
|
28
23
|
name: "variant, color",
|
|
29
|
-
render: () => (<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
<
|
|
24
|
+
render: () => (<Example>
|
|
25
|
+
<Example.Item title="variant: solid">
|
|
26
|
+
<View gap={4} direction="row" align="center">
|
|
27
|
+
<Button onClick={() => { }}>Neutral</Button>
|
|
28
|
+
<Button onClick={() => { }} color="primary">
|
|
34
29
|
Primary
|
|
35
|
-
</
|
|
36
|
-
<
|
|
30
|
+
</Button>
|
|
31
|
+
<Button onClick={() => { }} color="critical">
|
|
37
32
|
Critical
|
|
38
|
-
</
|
|
39
|
-
<
|
|
33
|
+
</Button>
|
|
34
|
+
<Button onClick={() => { }} color="positive">
|
|
40
35
|
Positive
|
|
41
|
-
</
|
|
42
|
-
<
|
|
43
|
-
<
|
|
36
|
+
</Button>
|
|
37
|
+
<View backgroundColor="primary" borderRadius="medium" padding={2} direction="row" gap={4}>
|
|
38
|
+
<Button onClick={() => { }} color="media">
|
|
44
39
|
Media
|
|
45
|
-
</
|
|
46
|
-
</
|
|
47
|
-
</
|
|
48
|
-
</
|
|
40
|
+
</Button>
|
|
41
|
+
</View>
|
|
42
|
+
</View>
|
|
43
|
+
</Example.Item>
|
|
49
44
|
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
<
|
|
45
|
+
<Example.Item title="variant: outline">
|
|
46
|
+
<View direction="row" gap={4}>
|
|
47
|
+
<Button onClick={() => { }} variant="outline">
|
|
53
48
|
Neutral
|
|
54
|
-
</
|
|
55
|
-
<
|
|
49
|
+
</Button>
|
|
50
|
+
<Button onClick={() => { }} color="primary" variant="outline">
|
|
56
51
|
Primary
|
|
57
|
-
</
|
|
58
|
-
<
|
|
52
|
+
</Button>
|
|
53
|
+
<Button onClick={() => { }} color="critical" variant="outline">
|
|
59
54
|
Critical
|
|
60
|
-
</
|
|
61
|
-
<
|
|
55
|
+
</Button>
|
|
56
|
+
<Button onClick={() => { }} color="positive" variant="outline">
|
|
62
57
|
Positive
|
|
63
|
-
</
|
|
58
|
+
</Button>
|
|
64
59
|
|
|
65
|
-
<
|
|
66
|
-
<
|
|
60
|
+
<View attributes={{ style: { color: "#029CFD" } }}>
|
|
61
|
+
<Button onClick={() => { }} color="inherit" variant="outline">
|
|
67
62
|
Inherit
|
|
68
|
-
</
|
|
69
|
-
</
|
|
70
|
-
</
|
|
71
|
-
</
|
|
72
|
-
<
|
|
73
|
-
<
|
|
74
|
-
<
|
|
63
|
+
</Button>
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
</Example.Item>
|
|
67
|
+
<Example.Item title="variant: ghost">
|
|
68
|
+
<View direction="row" gap={4} align="center">
|
|
69
|
+
<Button onClick={() => { }} variant="ghost">
|
|
75
70
|
Neutral
|
|
76
|
-
</
|
|
77
|
-
<
|
|
71
|
+
</Button>
|
|
72
|
+
<Button onClick={() => { }} color="primary" variant="ghost">
|
|
78
73
|
Primary
|
|
79
|
-
</
|
|
80
|
-
<
|
|
74
|
+
</Button>
|
|
75
|
+
<Button onClick={() => { }} color="critical" variant="ghost">
|
|
81
76
|
Critical
|
|
82
|
-
</
|
|
83
|
-
<
|
|
77
|
+
</Button>
|
|
78
|
+
<Button onClick={() => { }} color="positive" variant="ghost">
|
|
84
79
|
Positive
|
|
85
|
-
</
|
|
80
|
+
</Button>
|
|
86
81
|
|
|
87
|
-
<
|
|
88
|
-
<
|
|
82
|
+
<View backgroundColor="primary" borderRadius="medium" padding={2} direction="row" gap={4}>
|
|
83
|
+
<Button onClick={() => { }} variant="ghost" color="media">
|
|
89
84
|
Media
|
|
90
|
-
</
|
|
91
|
-
</
|
|
85
|
+
</Button>
|
|
86
|
+
</View>
|
|
92
87
|
|
|
93
|
-
<
|
|
94
|
-
<
|
|
88
|
+
<View attributes={{ style: { color: "#029CFD" } }}>
|
|
89
|
+
<Button onClick={() => { }} color="inherit" variant="ghost">
|
|
95
90
|
Inherit
|
|
96
|
-
</
|
|
97
|
-
</
|
|
91
|
+
</Button>
|
|
92
|
+
</View>
|
|
98
93
|
|
|
99
|
-
<
|
|
100
|
-
<
|
|
94
|
+
<View padding={2} backgroundColor="primary" borderRadius="medium">
|
|
95
|
+
<Button onClick={() => { }} color="inherit" variant="ghost">
|
|
101
96
|
Inherit
|
|
102
|
-
</
|
|
103
|
-
</
|
|
97
|
+
</Button>
|
|
98
|
+
</View>
|
|
104
99
|
|
|
105
|
-
<
|
|
106
|
-
<
|
|
100
|
+
<View padding={2} backgroundColor="white" borderRadius="medium">
|
|
101
|
+
<Button onClick={() => { }} color="inherit" variant="ghost">
|
|
107
102
|
Inherit
|
|
108
|
-
</
|
|
109
|
-
</
|
|
110
|
-
</
|
|
111
|
-
</
|
|
112
|
-
</
|
|
103
|
+
</Button>
|
|
104
|
+
</View>
|
|
105
|
+
</View>
|
|
106
|
+
</Example.Item>
|
|
107
|
+
</Example>),
|
|
113
108
|
};
|
|
114
|
-
|
|
109
|
+
export const icon = {
|
|
115
110
|
name: "icon",
|
|
116
|
-
render: () => (<
|
|
117
|
-
<
|
|
118
|
-
<
|
|
111
|
+
render: () => (<Example>
|
|
112
|
+
<Example.Item title="icon">
|
|
113
|
+
<Button onClick={() => { }} icon={IconPlus}>
|
|
119
114
|
Button
|
|
120
|
-
</
|
|
121
|
-
</
|
|
115
|
+
</Button>
|
|
116
|
+
</Example.Item>
|
|
122
117
|
|
|
123
|
-
<
|
|
124
|
-
<
|
|
118
|
+
<Example.Item title="endIcon">
|
|
119
|
+
<Button onClick={() => { }} endIcon={IconZap}>
|
|
125
120
|
Button
|
|
126
|
-
</
|
|
127
|
-
</
|
|
121
|
+
</Button>
|
|
122
|
+
</Example.Item>
|
|
128
123
|
|
|
129
|
-
<
|
|
130
|
-
<
|
|
124
|
+
<Example.Item title="icon, endIcon">
|
|
125
|
+
<Button onClick={() => { }} icon={IconZap} endIcon={IconZap}>
|
|
131
126
|
Button
|
|
132
|
-
</
|
|
133
|
-
</
|
|
127
|
+
</Button>
|
|
128
|
+
</Example.Item>
|
|
129
|
+
|
|
130
|
+
<Example.Item title="icon only">
|
|
131
|
+
<Button onClick={() => { }} icon={IconZap} attributes={{ "aria-label": "Action" }}/>
|
|
132
|
+
</Example.Item>
|
|
134
133
|
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
</
|
|
138
|
-
</
|
|
134
|
+
<Example.Item title="icon, endIcon, icon only">
|
|
135
|
+
<Button onClick={() => { }} icon={IconZap} endIcon={IconChevronDown} attributes={{ "aria-label": "Options", "data-testid": "icon-end-icon-only" }}/>
|
|
136
|
+
</Example.Item>
|
|
137
|
+
</Example>),
|
|
138
|
+
play: ({ canvas }) => {
|
|
139
|
+
const el = canvas.getByTestId("icon-end-icon-only");
|
|
140
|
+
const [startIcon, endIcon] = el.querySelectorAll("[aria-hidden='true']");
|
|
141
|
+
const gap = endIcon.getBoundingClientRect().left - startIcon.getBoundingClientRect().right;
|
|
142
|
+
expect(gap).toBe(parseFloat(getComputedStyle(el).getPropertyValue("--rs-button-gap")));
|
|
143
|
+
},
|
|
139
144
|
};
|
|
140
|
-
|
|
145
|
+
export const size = {
|
|
141
146
|
name: "size",
|
|
142
|
-
render: () => (<
|
|
143
|
-
<
|
|
144
|
-
<
|
|
145
|
-
<
|
|
147
|
+
render: () => (<Example>
|
|
148
|
+
<Example.Item title="size: small">
|
|
149
|
+
<View gap={4} direction="row">
|
|
150
|
+
<Button size="small" icon={IconZap}>
|
|
146
151
|
Button
|
|
147
|
-
</
|
|
148
|
-
<
|
|
152
|
+
</Button>
|
|
153
|
+
<Button size="small" variant="outline" icon={IconZap}>
|
|
149
154
|
Button
|
|
150
|
-
</
|
|
151
|
-
<
|
|
155
|
+
</Button>
|
|
156
|
+
<Button size="small" variant="ghost" icon={IconZap}>
|
|
152
157
|
Button
|
|
153
|
-
</
|
|
154
|
-
<
|
|
155
|
-
</
|
|
156
|
-
</
|
|
158
|
+
</Button>
|
|
159
|
+
<Button size="small" variant="outline" icon={IconZap}/>
|
|
160
|
+
</View>
|
|
161
|
+
</Example.Item>
|
|
157
162
|
|
|
158
|
-
<
|
|
159
|
-
<
|
|
160
|
-
<
|
|
161
|
-
<
|
|
163
|
+
<Example.Item title="size: medium">
|
|
164
|
+
<View gap={4} direction="row">
|
|
165
|
+
<Button icon={IconZap}>Button</Button>
|
|
166
|
+
<Button variant="outline" icon={IconZap}>
|
|
162
167
|
Button
|
|
163
|
-
</
|
|
164
|
-
<
|
|
168
|
+
</Button>
|
|
169
|
+
<Button variant="ghost" icon={IconZap}>
|
|
165
170
|
Button
|
|
166
|
-
</
|
|
167
|
-
</
|
|
168
|
-
</
|
|
171
|
+
</Button>
|
|
172
|
+
</View>
|
|
173
|
+
</Example.Item>
|
|
169
174
|
|
|
170
|
-
<
|
|
171
|
-
<
|
|
172
|
-
<
|
|
175
|
+
<Example.Item title="size: large">
|
|
176
|
+
<View gap={4} direction="row">
|
|
177
|
+
<Button size="large" icon={IconZap}>
|
|
173
178
|
Button
|
|
174
|
-
</
|
|
175
|
-
<
|
|
179
|
+
</Button>
|
|
180
|
+
<Button size="large" variant="outline" icon={IconZap}>
|
|
176
181
|
Button
|
|
177
|
-
</
|
|
178
|
-
<
|
|
182
|
+
</Button>
|
|
183
|
+
<Button size="large" variant="ghost" icon={IconZap}>
|
|
179
184
|
Button
|
|
180
|
-
</
|
|
181
|
-
</
|
|
182
|
-
</
|
|
185
|
+
</Button>
|
|
186
|
+
</View>
|
|
187
|
+
</Example.Item>
|
|
183
188
|
|
|
184
|
-
<
|
|
185
|
-
<
|
|
186
|
-
<
|
|
189
|
+
<Example.Item title="size: xlarge">
|
|
190
|
+
<View gap={4} direction="row">
|
|
191
|
+
<Button size="xlarge" icon={IconZap}>
|
|
187
192
|
Button
|
|
188
|
-
</
|
|
189
|
-
<
|
|
193
|
+
</Button>
|
|
194
|
+
<Button size="xlarge" variant="outline" icon={IconZap}>
|
|
190
195
|
Button
|
|
191
|
-
</
|
|
192
|
-
<
|
|
196
|
+
</Button>
|
|
197
|
+
<Button size="xlarge" variant="ghost" icon={IconZap}>
|
|
193
198
|
Button
|
|
194
|
-
</
|
|
195
|
-
</
|
|
196
|
-
</
|
|
199
|
+
</Button>
|
|
200
|
+
</View>
|
|
201
|
+
</Example.Item>
|
|
197
202
|
|
|
198
|
-
<
|
|
199
|
-
<
|
|
203
|
+
<Example.Item title="size: large, [m+] medium">
|
|
204
|
+
<Button size={{ s: "large", m: "medium" }} icon={IconZap}>
|
|
200
205
|
Responsive
|
|
201
|
-
</
|
|
202
|
-
</
|
|
203
|
-
</
|
|
206
|
+
</Button>
|
|
207
|
+
</Example.Item>
|
|
208
|
+
</Example>),
|
|
204
209
|
};
|
|
205
|
-
|
|
210
|
+
export const raised = {
|
|
206
211
|
name: "raised",
|
|
207
|
-
render: () => (<
|
|
208
|
-
<
|
|
209
|
-
<
|
|
210
|
-
<
|
|
212
|
+
render: () => (<Example>
|
|
213
|
+
<Example.Item title="elevated, color: neutral">
|
|
214
|
+
<View direction="row" gap={4}>
|
|
215
|
+
<Button raised onClick={() => { }}>
|
|
211
216
|
Button
|
|
212
|
-
</
|
|
213
|
-
<
|
|
217
|
+
</Button>
|
|
218
|
+
<Button raised variant="outline" onClick={() => { }}>
|
|
214
219
|
Button
|
|
215
|
-
</
|
|
216
|
-
</
|
|
217
|
-
</
|
|
220
|
+
</Button>
|
|
221
|
+
</View>
|
|
222
|
+
</Example.Item>
|
|
218
223
|
|
|
219
|
-
<
|
|
220
|
-
<
|
|
221
|
-
<
|
|
224
|
+
<Example.Item title="elevated, color">
|
|
225
|
+
<View direction="row" gap={4}>
|
|
226
|
+
<Button raised color="primary">
|
|
222
227
|
Button
|
|
223
|
-
</
|
|
224
|
-
<
|
|
228
|
+
</Button>
|
|
229
|
+
<Button raised variant="outline" color="primary">
|
|
225
230
|
Button
|
|
226
|
-
</
|
|
227
|
-
</
|
|
228
|
-
</
|
|
231
|
+
</Button>
|
|
232
|
+
</View>
|
|
233
|
+
</Example.Item>
|
|
229
234
|
|
|
230
|
-
<
|
|
231
|
-
<
|
|
232
|
-
<
|
|
233
|
-
Button
|
|
234
|
-
</
|
|
235
|
-
</
|
|
236
|
-
</
|
|
237
|
-
</
|
|
235
|
+
<Example.Item title="excluded">
|
|
236
|
+
<View backgroundColor="primary" padding={4} borderRadius="medium">
|
|
237
|
+
<Button color="media" raised>
|
|
238
|
+
Button
|
|
239
|
+
</Button>
|
|
240
|
+
</View>
|
|
241
|
+
</Example.Item>
|
|
242
|
+
</Example>),
|
|
238
243
|
};
|
|
239
|
-
|
|
244
|
+
export const rounded = {
|
|
240
245
|
name: "rounded",
|
|
241
|
-
render: () => (<
|
|
242
|
-
<
|
|
243
|
-
<
|
|
244
|
-
<
|
|
245
|
-
Button
|
|
246
|
-
</
|
|
247
|
-
<
|
|
248
|
-
Button
|
|
249
|
-
</
|
|
250
|
-
<
|
|
251
|
-
Button
|
|
252
|
-
</
|
|
253
|
-
</
|
|
254
|
-
</
|
|
255
|
-
<
|
|
256
|
-
<
|
|
257
|
-
<
|
|
258
|
-
Button
|
|
259
|
-
</
|
|
260
|
-
<
|
|
261
|
-
Button
|
|
262
|
-
</
|
|
263
|
-
<
|
|
264
|
-
Button
|
|
265
|
-
</
|
|
266
|
-
</
|
|
267
|
-
</
|
|
268
|
-
<
|
|
269
|
-
<
|
|
270
|
-
<
|
|
271
|
-
Button
|
|
272
|
-
</
|
|
273
|
-
<
|
|
274
|
-
Button
|
|
275
|
-
</
|
|
276
|
-
<
|
|
277
|
-
Button
|
|
278
|
-
</
|
|
279
|
-
</
|
|
280
|
-
</
|
|
281
|
-
<
|
|
282
|
-
<
|
|
283
|
-
<
|
|
284
|
-
<
|
|
285
|
-
<
|
|
286
|
-
</
|
|
287
|
-
</
|
|
288
|
-
</
|
|
246
|
+
render: () => (<Example>
|
|
247
|
+
<Example.Item title="rounded, size: small, all variants">
|
|
248
|
+
<View gap={3} direction="row">
|
|
249
|
+
<Button rounded size="small" icon={IconZap}>
|
|
250
|
+
Button
|
|
251
|
+
</Button>
|
|
252
|
+
<Button rounded variant="outline" size="small" icon={IconZap}>
|
|
253
|
+
Button
|
|
254
|
+
</Button>
|
|
255
|
+
<Button rounded variant="ghost" size="small" icon={IconZap}>
|
|
256
|
+
Button
|
|
257
|
+
</Button>
|
|
258
|
+
</View>
|
|
259
|
+
</Example.Item>
|
|
260
|
+
<Example.Item title="rounded, size: medium, all variants">
|
|
261
|
+
<View gap={3} direction="row">
|
|
262
|
+
<Button rounded icon={IconZap}>
|
|
263
|
+
Button
|
|
264
|
+
</Button>
|
|
265
|
+
<Button rounded variant="outline" icon={IconZap}>
|
|
266
|
+
Button
|
|
267
|
+
</Button>
|
|
268
|
+
<Button rounded variant="ghost" icon={IconZap}>
|
|
269
|
+
Button
|
|
270
|
+
</Button>
|
|
271
|
+
</View>
|
|
272
|
+
</Example.Item>
|
|
273
|
+
<Example.Item title="rounded, size: large, all variants">
|
|
274
|
+
<View gap={3} direction="row">
|
|
275
|
+
<Button rounded size="large" icon={IconZap}>
|
|
276
|
+
Button
|
|
277
|
+
</Button>
|
|
278
|
+
<Button rounded variant="outline" size="large" icon={IconZap}>
|
|
279
|
+
Button
|
|
280
|
+
</Button>
|
|
281
|
+
<Button rounded variant="ghost" size="large" icon={IconZap}>
|
|
282
|
+
Button
|
|
283
|
+
</Button>
|
|
284
|
+
</View>
|
|
285
|
+
</Example.Item>
|
|
286
|
+
<Example.Item title="rounded, icon only, all sizes">
|
|
287
|
+
<View gap={3} direction="row">
|
|
288
|
+
<Button rounded size="small" icon={IconZap}/>
|
|
289
|
+
<Button rounded icon={IconZap}/>
|
|
290
|
+
<Button rounded size="large" icon={IconZap}/>
|
|
291
|
+
</View>
|
|
292
|
+
</Example.Item>
|
|
293
|
+
</Example>),
|
|
289
294
|
};
|
|
290
|
-
|
|
295
|
+
export const fullWidth = {
|
|
291
296
|
name: "fullWidth",
|
|
292
|
-
render: () => (<
|
|
293
|
-
<
|
|
294
|
-
<
|
|
295
|
-
<
|
|
296
|
-
<
|
|
297
|
+
render: () => (<Example>
|
|
298
|
+
<Example.Item title="fullWidth, all variants">
|
|
299
|
+
<View gap={3}>
|
|
300
|
+
<Button fullWidth>Neutral</Button>
|
|
301
|
+
<Button fullWidth variant="outline">
|
|
297
302
|
Outline
|
|
298
|
-
</
|
|
299
|
-
<
|
|
303
|
+
</Button>
|
|
304
|
+
<Button fullWidth variant="ghost">
|
|
300
305
|
Ghost
|
|
301
|
-
</
|
|
302
|
-
</
|
|
303
|
-
</
|
|
306
|
+
</Button>
|
|
307
|
+
</View>
|
|
308
|
+
</Example.Item>
|
|
304
309
|
|
|
305
|
-
<
|
|
306
|
-
<
|
|
307
|
-
</
|
|
308
|
-
</
|
|
310
|
+
<Example.Item title={["responsive fullWidth", "[s] true", "[m+] false"]}>
|
|
311
|
+
<Button fullWidth={{ s: true, m: false }}>Button</Button>
|
|
312
|
+
</Example.Item>
|
|
313
|
+
</Example>),
|
|
309
314
|
};
|
|
310
|
-
|
|
315
|
+
export const loading = {
|
|
311
316
|
name: "loading",
|
|
312
|
-
render: () => (<
|
|
313
|
-
<
|
|
314
|
-
<
|
|
315
|
-
<
|
|
316
|
-
Button
|
|
317
|
-
</
|
|
318
|
-
<
|
|
319
|
-
Button
|
|
320
|
-
</
|
|
321
|
-
<
|
|
322
|
-
Button
|
|
323
|
-
</
|
|
324
|
-
</
|
|
325
|
-
</
|
|
326
|
-
<
|
|
327
|
-
<
|
|
328
|
-
<
|
|
329
|
-
Button
|
|
330
|
-
</
|
|
331
|
-
<
|
|
332
|
-
Button
|
|
333
|
-
</
|
|
334
|
-
<
|
|
335
|
-
Button
|
|
336
|
-
</
|
|
337
|
-
</
|
|
338
|
-
</
|
|
339
|
-
<
|
|
340
|
-
<
|
|
341
|
-
<
|
|
342
|
-
Button
|
|
343
|
-
</
|
|
344
|
-
<
|
|
345
|
-
Button
|
|
346
|
-
</
|
|
347
|
-
<
|
|
348
|
-
Button
|
|
349
|
-
</
|
|
350
|
-
</
|
|
351
|
-
</
|
|
317
|
+
render: () => (<Example>
|
|
318
|
+
<Example.Item title="loading, color: neutral, all variants">
|
|
319
|
+
<View gap={3} direction="row">
|
|
320
|
+
<Button loading loadingAriaLabel="Loading">
|
|
321
|
+
Button
|
|
322
|
+
</Button>
|
|
323
|
+
<Button loading loadingAriaLabel="Loading" variant="outline">
|
|
324
|
+
Button
|
|
325
|
+
</Button>
|
|
326
|
+
<Button loading loadingAriaLabel="Loading" variant="ghost">
|
|
327
|
+
Button
|
|
328
|
+
</Button>
|
|
329
|
+
</View>
|
|
330
|
+
</Example.Item>
|
|
331
|
+
<Example.Item title="loading, color critical, all variants">
|
|
332
|
+
<View gap={3} direction="row">
|
|
333
|
+
<Button loading loadingAriaLabel="Loading" color="critical">
|
|
334
|
+
Button
|
|
335
|
+
</Button>
|
|
336
|
+
<Button loading loadingAriaLabel="Loading" color="critical" variant="outline">
|
|
337
|
+
Button
|
|
338
|
+
</Button>
|
|
339
|
+
<Button loading loadingAriaLabel="Loading" color="critical" variant="ghost">
|
|
340
|
+
Button
|
|
341
|
+
</Button>
|
|
342
|
+
</View>
|
|
343
|
+
</Example.Item>
|
|
344
|
+
<Example.Item title="loading, color positive, all variants">
|
|
345
|
+
<View gap={3} direction="row">
|
|
346
|
+
<Button loading loadingAriaLabel="Loading" color="positive">
|
|
347
|
+
Button
|
|
348
|
+
</Button>
|
|
349
|
+
<Button loading loadingAriaLabel="Loading" color="positive" variant="outline">
|
|
350
|
+
Button
|
|
351
|
+
</Button>
|
|
352
|
+
<Button loading loadingAriaLabel="Loading" color="positive" variant="ghost">
|
|
353
|
+
Button
|
|
354
|
+
</Button>
|
|
355
|
+
</View>
|
|
356
|
+
</Example.Item>
|
|
352
357
|
|
|
353
|
-
<
|
|
354
|
-
<
|
|
355
|
-
<
|
|
358
|
+
<Example.Item title="loading, color: media">
|
|
359
|
+
<View aspectRatio={16 / 9}>
|
|
360
|
+
<Image src={imgUrl}/>
|
|
356
361
|
|
|
357
362
|
<div style={{ position: "absolute", top: 16, left: 16 }}>
|
|
358
|
-
<
|
|
359
|
-
<
|
|
363
|
+
<View gap={3} direction="row">
|
|
364
|
+
<Button color="media" loading loadingAriaLabel="Loading">
|
|
360
365
|
Button
|
|
361
|
-
</
|
|
362
|
-
</
|
|
366
|
+
</Button>
|
|
367
|
+
</View>
|
|
363
368
|
</div>
|
|
364
|
-
</
|
|
365
|
-
</
|
|
369
|
+
</View>
|
|
370
|
+
</Example.Item>
|
|
366
371
|
|
|
367
|
-
<
|
|
368
|
-
<
|
|
372
|
+
<Example.Item title={["loading, long button text", "button size should stay the same"]}>
|
|
373
|
+
<Button loading loadingAriaLabel="Loading" color="primary">
|
|
369
374
|
Long button text
|
|
370
|
-
</
|
|
371
|
-
</
|
|
375
|
+
</Button>
|
|
376
|
+
</Example.Item>
|
|
372
377
|
|
|
373
|
-
<
|
|
374
|
-
<
|
|
375
|
-
</
|
|
376
|
-
</
|
|
378
|
+
<Example.Item title={["loading, icon only", "button keep square 1/1 ratio"]}>
|
|
379
|
+
<Button icon={IconZap} rounded loading loadingAriaLabel="Loading"/>
|
|
380
|
+
</Example.Item>
|
|
381
|
+
</Example>),
|
|
377
382
|
};
|
|
378
|
-
|
|
383
|
+
export const highlighted = {
|
|
379
384
|
name: "highlighted",
|
|
380
|
-
render: () => (<
|
|
381
|
-
<
|
|
382
|
-
<
|
|
383
|
-
<
|
|
384
|
-
Button
|
|
385
|
-
</
|
|
386
|
-
<
|
|
387
|
-
Button
|
|
388
|
-
</
|
|
389
|
-
<
|
|
390
|
-
Button
|
|
391
|
-
</
|
|
392
|
-
</
|
|
393
|
-
</
|
|
394
|
-
<
|
|
395
|
-
<
|
|
396
|
-
<
|
|
397
|
-
Button
|
|
398
|
-
</
|
|
399
|
-
<
|
|
400
|
-
Button
|
|
401
|
-
</
|
|
402
|
-
<
|
|
403
|
-
Button
|
|
404
|
-
</
|
|
405
|
-
</
|
|
406
|
-
</
|
|
407
|
-
<
|
|
408
|
-
<
|
|
409
|
-
<
|
|
410
|
-
Button
|
|
411
|
-
</
|
|
412
|
-
<
|
|
413
|
-
Button
|
|
414
|
-
</
|
|
415
|
-
<
|
|
416
|
-
Button
|
|
417
|
-
</
|
|
418
|
-
</
|
|
419
|
-
</
|
|
420
|
-
<
|
|
421
|
-
<
|
|
422
|
-
<
|
|
423
|
-
Button
|
|
424
|
-
</
|
|
425
|
-
<
|
|
426
|
-
Button
|
|
427
|
-
</
|
|
428
|
-
<
|
|
429
|
-
Button
|
|
430
|
-
</
|
|
431
|
-
</
|
|
432
|
-
</
|
|
433
|
-
</
|
|
385
|
+
render: () => (<Example>
|
|
386
|
+
<Example.Item title="highlighted, color: neutral, all variants">
|
|
387
|
+
<View gap={3} direction="row">
|
|
388
|
+
<Button highlighted icon={IconZap}>
|
|
389
|
+
Button
|
|
390
|
+
</Button>
|
|
391
|
+
<Button highlighted variant="outline" icon={IconZap}>
|
|
392
|
+
Button
|
|
393
|
+
</Button>
|
|
394
|
+
<Button highlighted variant="ghost" icon={IconZap}>
|
|
395
|
+
Button
|
|
396
|
+
</Button>
|
|
397
|
+
</View>
|
|
398
|
+
</Example.Item>
|
|
399
|
+
<Example.Item title="highlighted, color: primary, all variants">
|
|
400
|
+
<View gap={3} direction="row">
|
|
401
|
+
<Button highlighted color="primary" icon={IconZap}>
|
|
402
|
+
Button
|
|
403
|
+
</Button>
|
|
404
|
+
<Button highlighted color="primary" variant="outline" icon={IconZap}>
|
|
405
|
+
Button
|
|
406
|
+
</Button>
|
|
407
|
+
<Button highlighted color="critical" variant="ghost" icon={IconZap}>
|
|
408
|
+
Button
|
|
409
|
+
</Button>
|
|
410
|
+
</View>
|
|
411
|
+
</Example.Item>
|
|
412
|
+
<Example.Item title="highlighted, color: critical, all variants">
|
|
413
|
+
<View gap={3} direction="row">
|
|
414
|
+
<Button highlighted color="critical" icon={IconZap}>
|
|
415
|
+
Button
|
|
416
|
+
</Button>
|
|
417
|
+
<Button highlighted color="critical" variant="outline" icon={IconZap}>
|
|
418
|
+
Button
|
|
419
|
+
</Button>
|
|
420
|
+
<Button highlighted color="critical" variant="ghost" icon={IconZap}>
|
|
421
|
+
Button
|
|
422
|
+
</Button>
|
|
423
|
+
</View>
|
|
424
|
+
</Example.Item>
|
|
425
|
+
<Example.Item title="highlighted, color: positive, all variants">
|
|
426
|
+
<View gap={3} direction="row">
|
|
427
|
+
<Button highlighted color="positive" icon={IconZap}>
|
|
428
|
+
Button
|
|
429
|
+
</Button>
|
|
430
|
+
<Button highlighted color="positive" variant="outline" icon={IconZap}>
|
|
431
|
+
Button
|
|
432
|
+
</Button>
|
|
433
|
+
<Button highlighted color="positive" variant="ghost" icon={IconZap}>
|
|
434
|
+
Button
|
|
435
|
+
</Button>
|
|
436
|
+
</View>
|
|
437
|
+
</Example.Item>
|
|
438
|
+
</Example>),
|
|
434
439
|
};
|
|
435
|
-
|
|
440
|
+
export const disabled = {
|
|
436
441
|
name: "disabled",
|
|
437
|
-
render: () => (<
|
|
438
|
-
<
|
|
439
|
-
<
|
|
440
|
-
<
|
|
441
|
-
Button
|
|
442
|
-
</
|
|
443
|
-
<
|
|
444
|
-
Button
|
|
445
|
-
</
|
|
446
|
-
<
|
|
447
|
-
Button
|
|
448
|
-
</
|
|
449
|
-
</
|
|
450
|
-
</
|
|
451
|
-
<
|
|
452
|
-
<
|
|
453
|
-
<
|
|
454
|
-
Button
|
|
455
|
-
</
|
|
456
|
-
<
|
|
457
|
-
Button
|
|
458
|
-
</
|
|
459
|
-
<
|
|
460
|
-
Button
|
|
461
|
-
</
|
|
462
|
-
</
|
|
463
|
-
</
|
|
464
|
-
<
|
|
465
|
-
<
|
|
466
|
-
<
|
|
467
|
-
Button
|
|
468
|
-
</
|
|
469
|
-
<
|
|
470
|
-
Button
|
|
471
|
-
</
|
|
472
|
-
<
|
|
473
|
-
Button
|
|
474
|
-
</
|
|
475
|
-
</
|
|
476
|
-
</
|
|
442
|
+
render: () => (<Example>
|
|
443
|
+
<Example.Item title="disabled, color: neutral, all variants">
|
|
444
|
+
<View gap={3} direction="row">
|
|
445
|
+
<Button disabled icon={IconZap} onClick={() => { }}>
|
|
446
|
+
Button
|
|
447
|
+
</Button>
|
|
448
|
+
<Button disabled variant="outline" icon={IconZap}>
|
|
449
|
+
Button
|
|
450
|
+
</Button>
|
|
451
|
+
<Button disabled variant="ghost" icon={IconZap}>
|
|
452
|
+
Button
|
|
453
|
+
</Button>
|
|
454
|
+
</View>
|
|
455
|
+
</Example.Item>
|
|
456
|
+
<Example.Item title="disabled, color: critical, all variants">
|
|
457
|
+
<View gap={3} direction="row">
|
|
458
|
+
<Button disabled color="critical" icon={IconZap}>
|
|
459
|
+
Button
|
|
460
|
+
</Button>
|
|
461
|
+
<Button disabled color="critical" variant="outline" icon={IconZap}>
|
|
462
|
+
Button
|
|
463
|
+
</Button>
|
|
464
|
+
<Button disabled color="critical" variant="ghost" icon={IconZap}>
|
|
465
|
+
Button
|
|
466
|
+
</Button>
|
|
467
|
+
</View>
|
|
468
|
+
</Example.Item>
|
|
469
|
+
<Example.Item title="disabled, color: positive, all variants">
|
|
470
|
+
<View gap={3} direction="row">
|
|
471
|
+
<Button disabled color="positive" icon={IconZap}>
|
|
472
|
+
Button
|
|
473
|
+
</Button>
|
|
474
|
+
<Button disabled color="positive" variant="outline" icon={IconZap}>
|
|
475
|
+
Button
|
|
476
|
+
</Button>
|
|
477
|
+
<Button disabled color="positive" variant="ghost" icon={IconZap}>
|
|
478
|
+
Button
|
|
479
|
+
</Button>
|
|
480
|
+
</View>
|
|
481
|
+
</Example.Item>
|
|
477
482
|
|
|
478
|
-
<
|
|
479
|
-
<
|
|
480
|
-
<
|
|
483
|
+
<Example.Item title="disabled, color: media">
|
|
484
|
+
<View aspectRatio={16 / 9}>
|
|
485
|
+
<Image src={imgUrl}/>
|
|
481
486
|
|
|
482
487
|
<div style={{ position: "absolute", top: 16, left: 16 }}>
|
|
483
|
-
<
|
|
484
|
-
<
|
|
488
|
+
<View gap={3} direction="row">
|
|
489
|
+
<Button color="media" disabled>
|
|
485
490
|
Button
|
|
486
|
-
</
|
|
487
|
-
</
|
|
491
|
+
</Button>
|
|
492
|
+
</View>
|
|
488
493
|
</div>
|
|
489
|
-
</
|
|
490
|
-
</
|
|
491
|
-
</
|
|
494
|
+
</View>
|
|
495
|
+
</Example.Item>
|
|
496
|
+
</Example>),
|
|
492
497
|
play: ({ canvas }) => {
|
|
493
498
|
const el = canvas.getAllByRole("button")[0];
|
|
494
|
-
|
|
499
|
+
expect(el).toBeDisabled();
|
|
495
500
|
},
|
|
496
501
|
};
|
|
497
|
-
|
|
502
|
+
export const aligner = {
|
|
498
503
|
name: "aligner",
|
|
499
|
-
render: () => (<
|
|
500
|
-
<
|
|
501
|
-
<
|
|
502
|
-
<
|
|
503
|
-
<
|
|
504
|
-
<
|
|
505
|
-
</
|
|
506
|
-
</
|
|
507
|
-
</
|
|
504
|
+
render: () => (<Example>
|
|
505
|
+
<Example.Item title="aligner: all">
|
|
506
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2}>
|
|
507
|
+
<View.Item grow>Content</View.Item>
|
|
508
|
+
<Button.Aligner>
|
|
509
|
+
<Button icon={IconZap} variant="ghost" size="small"/>
|
|
510
|
+
</Button.Aligner>
|
|
511
|
+
</View>
|
|
512
|
+
</Example.Item>
|
|
508
513
|
|
|
509
|
-
<
|
|
510
|
-
<
|
|
511
|
-
<
|
|
512
|
-
<
|
|
513
|
-
</
|
|
514
|
-
<
|
|
515
|
-
<
|
|
516
|
-
</
|
|
517
|
-
</
|
|
518
|
-
</
|
|
514
|
+
<Example.Item title="aligner: top">
|
|
515
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2}>
|
|
516
|
+
<View.Item grow>
|
|
517
|
+
<Placeholder />
|
|
518
|
+
</View.Item>
|
|
519
|
+
<Button.Aligner side="top">
|
|
520
|
+
<Button icon={IconZap} variant="ghost"/>
|
|
521
|
+
</Button.Aligner>
|
|
522
|
+
</View>
|
|
523
|
+
</Example.Item>
|
|
519
524
|
|
|
520
|
-
<
|
|
521
|
-
<
|
|
522
|
-
<
|
|
523
|
-
<
|
|
524
|
-
</
|
|
525
|
-
<
|
|
526
|
-
<
|
|
527
|
-
</
|
|
528
|
-
</
|
|
529
|
-
</
|
|
525
|
+
<Example.Item title="aligner: top and end">
|
|
526
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2}>
|
|
527
|
+
<View.Item grow>
|
|
528
|
+
<Placeholder />
|
|
529
|
+
</View.Item>
|
|
530
|
+
<Button.Aligner side={["top", "end"]}>
|
|
531
|
+
<Button icon={IconZap} variant="ghost"/>
|
|
532
|
+
</Button.Aligner>
|
|
533
|
+
</View>
|
|
534
|
+
</Example.Item>
|
|
530
535
|
|
|
531
|
-
<
|
|
532
|
-
<
|
|
533
|
-
<
|
|
534
|
-
<
|
|
535
|
-
</
|
|
536
|
-
<
|
|
537
|
-
<
|
|
538
|
-
</
|
|
539
|
-
</
|
|
540
|
-
</
|
|
536
|
+
<Example.Item title="aligner: bottom">
|
|
537
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2} align="end">
|
|
538
|
+
<View.Item grow>
|
|
539
|
+
<Placeholder />
|
|
540
|
+
</View.Item>
|
|
541
|
+
<Button.Aligner side="bottom">
|
|
542
|
+
<Button icon={IconZap} variant="ghost"/>
|
|
543
|
+
</Button.Aligner>
|
|
544
|
+
</View>
|
|
545
|
+
</Example.Item>
|
|
541
546
|
|
|
542
|
-
<
|
|
543
|
-
<
|
|
544
|
-
<
|
|
545
|
-
<
|
|
546
|
-
</
|
|
547
|
-
<
|
|
548
|
-
<
|
|
549
|
-
</
|
|
550
|
-
</
|
|
551
|
-
</
|
|
547
|
+
<Example.Item title="aligner: start">
|
|
548
|
+
<View padding={4} borderColor="neutral-faded" gap={2} align="start">
|
|
549
|
+
<View.Item grow>
|
|
550
|
+
<Placeholder />
|
|
551
|
+
</View.Item>
|
|
552
|
+
<Button.Aligner side="start">
|
|
553
|
+
<Button icon={IconZap} variant="ghost"/>
|
|
554
|
+
</Button.Aligner>
|
|
555
|
+
</View>
|
|
556
|
+
</Example.Item>
|
|
552
557
|
|
|
553
|
-
<
|
|
554
|
-
<
|
|
555
|
-
<
|
|
556
|
-
<
|
|
557
|
-
</
|
|
558
|
-
<
|
|
559
|
-
<
|
|
560
|
-
</
|
|
561
|
-
</
|
|
562
|
-
</
|
|
563
|
-
</
|
|
558
|
+
<Example.Item title="aligner: end">
|
|
559
|
+
<View padding={4} borderColor="neutral-faded" gap={2} align="end">
|
|
560
|
+
<View.Item grow>
|
|
561
|
+
<Placeholder />
|
|
562
|
+
</View.Item>
|
|
563
|
+
<Button.Aligner side="end">
|
|
564
|
+
<Button icon={IconZap} variant="ghost"/>
|
|
565
|
+
</Button.Aligner>
|
|
566
|
+
</View>
|
|
567
|
+
</Example.Item>
|
|
568
|
+
</Example>),
|
|
564
569
|
};
|
|
565
|
-
|
|
570
|
+
export const composition = {
|
|
566
571
|
name: "test: composition",
|
|
567
|
-
render: () => (<
|
|
568
|
-
<
|
|
569
|
-
<
|
|
570
|
-
<
|
|
572
|
+
render: () => (<Example>
|
|
573
|
+
<Example.Item title="slot start">
|
|
574
|
+
<Button variant="outline">
|
|
575
|
+
<Avatar size={6} initials="RS"/>
|
|
571
576
|
Label
|
|
572
|
-
</
|
|
573
|
-
</
|
|
574
|
-
<
|
|
575
|
-
<
|
|
577
|
+
</Button>
|
|
578
|
+
</Example.Item>
|
|
579
|
+
<Example.Item title="slot end">
|
|
580
|
+
<Button variant="outline">
|
|
576
581
|
Label
|
|
577
|
-
<
|
|
578
|
-
</
|
|
579
|
-
</
|
|
582
|
+
<Badge size="small">B</Badge>
|
|
583
|
+
</Button>
|
|
584
|
+
</Example.Item>
|
|
580
585
|
|
|
581
|
-
<
|
|
582
|
-
<
|
|
583
|
-
<
|
|
584
|
-
</
|
|
585
|
-
</
|
|
586
|
-
</
|
|
586
|
+
<Example.Item title="slot with text component">
|
|
587
|
+
<Button variant="outline">
|
|
588
|
+
<Text>Label</Text>
|
|
589
|
+
</Button>
|
|
590
|
+
</Example.Item>
|
|
591
|
+
</Example>),
|
|
587
592
|
};
|
|
588
|
-
|
|
593
|
+
export const href = {
|
|
589
594
|
name: "href",
|
|
590
|
-
render: () => <
|
|
595
|
+
render: () => <Button href="https://reshaped.so">Trigger</Button>,
|
|
591
596
|
play: async ({ canvas }) => {
|
|
592
597
|
const el = canvas.getByRole("link");
|
|
593
|
-
|
|
598
|
+
expect(el).toHaveAttribute("href", "https://reshaped.so");
|
|
594
599
|
},
|
|
595
600
|
};
|
|
596
|
-
|
|
601
|
+
export const onClick = {
|
|
597
602
|
name: "onClick",
|
|
598
603
|
args: {
|
|
599
|
-
handleClick:
|
|
604
|
+
handleClick: fn(),
|
|
600
605
|
},
|
|
601
|
-
render: (args) => <
|
|
606
|
+
render: (args) => <Button onClick={args.handleClick}>Trigger</Button>,
|
|
602
607
|
play: async ({ canvas, args }) => {
|
|
603
608
|
const { handleClick } = args;
|
|
604
609
|
const el = canvas.getAllByRole("button")[0];
|
|
605
|
-
await
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
610
|
+
await userEvent.click(el);
|
|
611
|
+
expect(el).toHaveAttribute("type", "button");
|
|
612
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
613
|
+
expect(handleClick).toHaveBeenCalledWith(expect.objectContaining({ target: el }));
|
|
609
614
|
},
|
|
610
615
|
};
|
|
611
|
-
|
|
616
|
+
export const hrefOnClick = {
|
|
612
617
|
name: "href, onClick",
|
|
613
618
|
args: {
|
|
614
|
-
handleClick:
|
|
619
|
+
handleClick: fn(),
|
|
615
620
|
},
|
|
616
|
-
render: (args) => (<
|
|
621
|
+
render: (args) => (<Button onClick={(e) => {
|
|
617
622
|
e.preventDefault();
|
|
618
623
|
args.handleClick(e);
|
|
619
624
|
}} href="https://reshaped.so">
|
|
620
625
|
Trigger
|
|
621
|
-
</
|
|
626
|
+
</Button>),
|
|
622
627
|
play: async ({ canvas, args }) => {
|
|
623
628
|
const { handleClick } = args;
|
|
624
629
|
const el = canvas.getByRole("link");
|
|
625
|
-
await
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
630
|
+
await userEvent.click(el);
|
|
631
|
+
expect(el).toHaveAttribute("href", "https://reshaped.so");
|
|
632
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
633
|
+
expect(handleClick).toHaveBeenCalledWith(expect.objectContaining({ target: el }));
|
|
629
634
|
},
|
|
630
635
|
};
|
|
631
|
-
|
|
636
|
+
export const as = {
|
|
632
637
|
name: "as",
|
|
633
|
-
render: () => (<
|
|
634
|
-
<
|
|
635
|
-
<
|
|
638
|
+
render: () => (<Example>
|
|
639
|
+
<Example.Item title="as: span">
|
|
640
|
+
<Button onClick={() => { }} as="span">
|
|
636
641
|
Trigger
|
|
637
|
-
</
|
|
638
|
-
</
|
|
639
|
-
<
|
|
640
|
-
<
|
|
642
|
+
</Button>
|
|
643
|
+
</Example.Item>
|
|
644
|
+
<Example.Item title="render, disabled">
|
|
645
|
+
<Button disabled onClick={() => { }} render={(props) => <section {...props}/>} attributes={{ "data-testid": "render-el" }}>
|
|
641
646
|
Trigger
|
|
642
|
-
</
|
|
643
|
-
</
|
|
644
|
-
</
|
|
647
|
+
</Button>
|
|
648
|
+
</Example.Item>
|
|
649
|
+
</Example>),
|
|
645
650
|
play: ({ canvas }) => {
|
|
646
651
|
const [asEl] = canvas.getAllByText("Trigger");
|
|
647
652
|
const renderEl = canvas.getByTestId("render-el");
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
653
|
+
expect(asEl.tagName).toBe("SPAN");
|
|
654
|
+
expect(renderEl.tagName).toBe("SECTION");
|
|
655
|
+
expect(renderEl).toHaveAttribute("aria-disabled", "true");
|
|
651
656
|
},
|
|
652
657
|
};
|
|
653
|
-
|
|
658
|
+
export const className = {
|
|
654
659
|
name: "className, attributes",
|
|
655
660
|
render: () => (<div data-testid="root">
|
|
656
|
-
<
|
|
661
|
+
<Button className="test-classname" attributes={{ id: "test-id" }}>
|
|
657
662
|
Trigger
|
|
658
|
-
</
|
|
663
|
+
</Button>
|
|
659
664
|
</div>),
|
|
660
665
|
play: async ({ canvas }) => {
|
|
661
666
|
const root = canvas.getByTestId("root").firstChild;
|
|
662
|
-
|
|
663
|
-
|
|
667
|
+
expect(root).toHaveClass("test-classname");
|
|
668
|
+
expect(root).toHaveAttribute("id", "test-id");
|
|
664
669
|
},
|
|
665
670
|
};
|
|
666
|
-
|
|
671
|
+
export const group = {
|
|
667
672
|
name: "group",
|
|
668
|
-
render: () => (<
|
|
669
|
-
<
|
|
670
|
-
<
|
|
671
|
-
<
|
|
672
|
-
<
|
|
673
|
-
</
|
|
674
|
-
</
|
|
675
|
-
<
|
|
676
|
-
<
|
|
677
|
-
{["neutral", "primary", "critical", "positive"].map((color) => (<
|
|
678
|
-
<
|
|
679
|
-
<
|
|
680
|
-
<
|
|
681
|
-
</
|
|
682
|
-
<
|
|
683
|
-
<
|
|
684
|
-
<
|
|
685
|
-
<
|
|
686
|
-
<
|
|
687
|
-
</
|
|
688
|
-
</
|
|
689
|
-
</
|
|
690
|
-
</
|
|
691
|
-
<
|
|
692
|
-
<
|
|
693
|
-
{["neutral", "primary", "critical", "positive"].map((color) => (<
|
|
694
|
-
<
|
|
673
|
+
render: () => (<Example>
|
|
674
|
+
<Example.Item title="with icon">
|
|
675
|
+
<Button.Group>
|
|
676
|
+
<Button rounded>Submit</Button>
|
|
677
|
+
<Button rounded icon={IconZap}/>
|
|
678
|
+
</Button.Group>
|
|
679
|
+
</Example.Item>
|
|
680
|
+
<Example.Item title="variant: solid">
|
|
681
|
+
<View gap={2} align="start">
|
|
682
|
+
{["neutral", "primary", "critical", "positive"].map((color) => (<Button.Group key={color}>
|
|
683
|
+
<Button color={color}>One</Button>
|
|
684
|
+
<Button color={color}>Two</Button>
|
|
685
|
+
<Button color={color}>Three</Button>
|
|
686
|
+
</Button.Group>))}
|
|
687
|
+
<View backgroundColor="primary" padding={4} borderRadius="medium">
|
|
688
|
+
<Button.Group>
|
|
689
|
+
<Button color="media">One</Button>
|
|
690
|
+
<Button color="media">Two</Button>
|
|
691
|
+
<Button color="media">Three</Button>
|
|
692
|
+
</Button.Group>
|
|
693
|
+
</View>
|
|
694
|
+
</View>
|
|
695
|
+
</Example.Item>
|
|
696
|
+
<Example.Item title="variant: outline">
|
|
697
|
+
<View gap={2} align="start">
|
|
698
|
+
{["neutral", "primary", "critical", "positive"].map((color) => (<Button.Group key={color}>
|
|
699
|
+
<Button color={color} variant="outline">
|
|
695
700
|
One
|
|
696
|
-
</
|
|
697
|
-
<
|
|
701
|
+
</Button>
|
|
702
|
+
<Button color={color} variant="outline">
|
|
698
703
|
Two
|
|
699
|
-
</
|
|
700
|
-
<
|
|
704
|
+
</Button>
|
|
705
|
+
<Button color={color} variant="outline">
|
|
701
706
|
Three
|
|
702
|
-
</
|
|
703
|
-
</
|
|
704
|
-
</
|
|
705
|
-
</
|
|
707
|
+
</Button>
|
|
708
|
+
</Button.Group>))}
|
|
709
|
+
</View>
|
|
710
|
+
</Example.Item>
|
|
706
711
|
|
|
707
|
-
<
|
|
708
|
-
<
|
|
709
|
-
{["neutral", "primary", "critical", "positive"].map((color) => (<
|
|
710
|
-
<
|
|
712
|
+
<Example.Item title="variant: ghost">
|
|
713
|
+
<View gap={2} align="start">
|
|
714
|
+
{["neutral", "primary", "critical", "positive"].map((color) => (<Button.Group key={color}>
|
|
715
|
+
<Button color={color} variant="ghost">
|
|
711
716
|
One
|
|
712
|
-
</
|
|
713
|
-
<
|
|
717
|
+
</Button>
|
|
718
|
+
<Button color={color} variant="ghost">
|
|
714
719
|
Two
|
|
715
|
-
</
|
|
716
|
-
<
|
|
720
|
+
</Button>
|
|
721
|
+
<Button color={color} variant="ghost">
|
|
717
722
|
Three
|
|
718
|
-
</
|
|
719
|
-
</
|
|
720
|
-
</
|
|
721
|
-
</
|
|
722
|
-
</
|
|
723
|
+
</Button>
|
|
724
|
+
</Button.Group>))}
|
|
725
|
+
</View>
|
|
726
|
+
</Example.Item>
|
|
727
|
+
</Example>),
|
|
723
728
|
play: async ({ canvas }) => {
|
|
724
729
|
const [el] = canvas.getAllByRole("group");
|
|
725
|
-
|
|
726
|
-
|
|
730
|
+
expect(el).toBeInTheDocument();
|
|
731
|
+
expect(el.childElementCount).toEqual(2);
|
|
727
732
|
},
|
|
728
733
|
};
|
|
729
|
-
|
|
734
|
+
export const groupFullWidth = {
|
|
730
735
|
name: "group, fullWidth",
|
|
731
|
-
render: () => (<
|
|
732
|
-
<
|
|
733
|
-
<
|
|
734
|
-
<
|
|
736
|
+
render: () => (<Example>
|
|
737
|
+
<Example.Item title="fullWidth">
|
|
738
|
+
<Button.Group>
|
|
739
|
+
<Button variant="outline" fullWidth>
|
|
735
740
|
Button 1
|
|
736
|
-
</
|
|
737
|
-
<
|
|
741
|
+
</Button>
|
|
742
|
+
<Button variant="outline" fullWidth>
|
|
738
743
|
Button 2
|
|
739
|
-
</
|
|
740
|
-
<
|
|
741
|
-
</
|
|
742
|
-
</
|
|
743
|
-
</
|
|
744
|
+
</Button>
|
|
745
|
+
<Button variant="outline">Button 3</Button>
|
|
746
|
+
</Button.Group>
|
|
747
|
+
</Example.Item>
|
|
748
|
+
</Example>),
|
|
744
749
|
};
|
|
745
|
-
|
|
750
|
+
export const groupClassName = {
|
|
746
751
|
name: "group className, attributes",
|
|
747
752
|
render: () => (<div data-testid="root">
|
|
748
|
-
<
|
|
749
|
-
<
|
|
750
|
-
</
|
|
753
|
+
<Button.Group className="test-classname" attributes={{ id: "test-id" }}>
|
|
754
|
+
<Button>Trigger</Button>
|
|
755
|
+
</Button.Group>
|
|
751
756
|
</div>),
|
|
752
757
|
play: async ({ canvas }) => {
|
|
753
758
|
const root = canvas.getByTestId("root").firstChild;
|
|
754
|
-
|
|
755
|
-
|
|
759
|
+
expect(root).toHaveClass("test-classname");
|
|
760
|
+
expect(root).toHaveAttribute("id", "test-id");
|
|
756
761
|
},
|
|
757
762
|
};
|