reshaped 1.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE.md +37 -0
- package/bin/clean.sh +2 -0
- package/bin/cli.js +78 -0
- package/bin/copy-release.sh +8 -0
- package/bundle.css +1 -0
- package/bundle.d.ts +118 -0
- package/bundle.js +27 -0
- package/cli/theming/definitions/base.d.ts +3 -0
- package/cli/theming/definitions/base.js +11 -0
- package/cli/theming/definitions/figma.d.ts +3 -0
- package/cli/theming/definitions/figma.js +180 -0
- package/cli/theming/definitions/minimal.d.ts +3 -0
- package/cli/theming/definitions/minimal.js +80 -0
- package/cli/theming/definitions/reshaped.d.ts +3 -0
- package/cli/theming/definitions/reshaped.js +188 -0
- package/cli/theming/definitions/slate.d.ts +3 -0
- package/cli/theming/definitions/slate.js +80 -0
- package/cli/theming/index.d.ts +4 -0
- package/cli/theming/index.js +140 -0
- package/cli/theming/reshaped.config.d.ts +3 -0
- package/cli/theming/reshaped.config.js +25 -0
- package/cli/theming/tokens/color/color.transforms.d.ts +4 -0
- package/cli/theming/tokens/color/color.transforms.js +20 -0
- package/cli/theming/tokens/color/color.types.d.ts +7 -0
- package/cli/theming/tokens/color/color.types.js +2 -0
- package/cli/theming/tokens/duration/duration.transforms.d.ts +4 -0
- package/cli/theming/tokens/duration/duration.transforms.js +11 -0
- package/cli/theming/tokens/duration/duration.types.d.ts +4 -0
- package/cli/theming/tokens/duration/duration.types.js +2 -0
- package/cli/theming/tokens/easing/easing.transforms.d.ts +4 -0
- package/cli/theming/tokens/easing/easing.transforms.js +11 -0
- package/cli/theming/tokens/easing/easing.types.d.ts +7 -0
- package/cli/theming/tokens/easing/easing.types.js +2 -0
- package/cli/theming/tokens/font/font.transforms.d.ts +4 -0
- package/cli/theming/tokens/font/font.transforms.js +36 -0
- package/cli/theming/tokens/font/font.types.d.ts +10 -0
- package/cli/theming/tokens/font/font.types.js +2 -0
- package/cli/theming/tokens/fontFamily/fontFamily.transforms.d.ts +4 -0
- package/cli/theming/tokens/fontFamily/fontFamily.transforms.js +11 -0
- package/cli/theming/tokens/fontFamily/fontFamily.types.d.ts +4 -0
- package/cli/theming/tokens/fontFamily/fontFamily.types.js +2 -0
- package/cli/theming/tokens/fontWeight/fontWeight.transforms.d.ts +4 -0
- package/cli/theming/tokens/fontWeight/fontWeight.transforms.js +11 -0
- package/cli/theming/tokens/fontWeight/fontWeight.types.d.ts +4 -0
- package/cli/theming/tokens/fontWeight/fontWeight.types.js +2 -0
- package/cli/theming/tokens/shadow/shadow.transforms.d.ts +4 -0
- package/cli/theming/tokens/shadow/shadow.transforms.js +20 -0
- package/cli/theming/tokens/shadow/shadow.types.d.ts +13 -0
- package/cli/theming/tokens/shadow/shadow.types.js +2 -0
- package/cli/theming/tokens/transforms.d.ts +11 -0
- package/cli/theming/tokens/transforms.js +26 -0
- package/cli/theming/tokens/types.d.ts +52 -0
- package/cli/theming/tokens/types.js +2 -0
- package/cli/theming/tokens/unit/unit.transforms.d.ts +4 -0
- package/cli/theming/tokens/unit/unit.transforms.js +11 -0
- package/cli/theming/tokens/unit/unit.types.d.ts +7 -0
- package/cli/theming/tokens/unit/unit.types.js +2 -0
- package/cli/theming/tokens/viewport/viewport.transforms.d.ts +4 -0
- package/cli/theming/tokens/viewport/viewport.transforms.js +18 -0
- package/cli/theming/tokens/viewport/viewport.types.d.ts +5 -0
- package/cli/theming/tokens/viewport/viewport.types.js +2 -0
- package/cli/theming/types.d.ts +14 -0
- package/cli/theming/types.js +2 -0
- package/cli/theming/utilities/css.d.ts +6 -0
- package/cli/theming/utilities/css.js +50 -0
- package/cli/theming/utilities/mergeDeep.d.ts +5 -0
- package/cli/theming/utilities/mergeDeep.js +24 -0
- package/cli/theming/utilities/mergeDefinitions.d.ts +5 -0
- package/cli/theming/utilities/mergeDefinitions.js +17 -0
- package/cli/theming/utilities/resolveTokenReference.d.ts +3 -0
- package/cli/theming/utilities/resolveTokenReference.js +16 -0
- package/cli/utilities/color.d.ts +15 -0
- package/cli/utilities/color.js +39 -0
- package/cli/utilities/string.d.ts +2 -0
- package/cli/utilities/string.js +11 -0
- package/cli/utilities/tests/color.test.d.ts +1 -0
- package/cli/utilities/tests/color.test.js +63 -0
- package/components/Accordion/Accordion.context.d.ts +4 -0
- package/components/Accordion/Accordion.context.js +9 -0
- package/components/Accordion/Accordion.d.ts +8 -0
- package/components/Accordion/Accordion.js +14 -0
- package/components/Accordion/Accordion.module.css +1 -0
- package/components/Accordion/Accordion.types.d.ts +39 -0
- package/components/Accordion/Accordion.types.js +1 -0
- package/components/Accordion/AccordionContent.d.ts +4 -0
- package/components/Accordion/AccordionContent.js +43 -0
- package/components/Accordion/AccordionControlled.d.ts +4 -0
- package/components/Accordion/AccordionControlled.js +23 -0
- package/components/Accordion/AccordionTrigger.d.ts +4 -0
- package/components/Accordion/AccordionTrigger.js +26 -0
- package/components/Accordion/AccordionUncontrolled.d.ts +4 -0
- package/components/Accordion/AccordionUncontrolled.js +24 -0
- package/components/Accordion/index.d.ts +2 -0
- package/components/Accordion/index.js +1 -0
- package/components/Accordion/tests/Accordion.stories.d.ts +9 -0
- package/components/Accordion/tests/Accordion.stories.js +119 -0
- package/components/ActionBar/ActionBar.d.ts +4 -0
- package/components/ActionBar/ActionBar.js +10 -0
- package/components/ActionBar/ActionBar.module.css +1 -0
- package/components/ActionBar/ActionBar.types.d.ts +10 -0
- package/components/ActionBar/ActionBar.types.js +1 -0
- package/components/ActionBar/index.d.ts +2 -0
- package/components/ActionBar/index.js +1 -0
- package/components/ActionBar/tests/ActionBar.stories.d.ts +8 -0
- package/components/ActionBar/tests/ActionBar.stories.js +43 -0
- package/components/Actionable/Actionable.d.ts +4 -0
- package/components/Actionable/Actionable.js +54 -0
- package/components/Actionable/Actionable.module.css +1 -0
- package/components/Actionable/Actionable.types.d.ts +18 -0
- package/components/Actionable/Actionable.types.js +1 -0
- package/components/Actionable/index.d.ts +2 -0
- package/components/Actionable/index.js +1 -0
- package/components/Actionable/tests/Actionable.stories.d.ts +9 -0
- package/components/Actionable/tests/Actionable.stories.js +56 -0
- package/components/Alert/Alert.d.ts +4 -0
- package/components/Alert/Alert.js +31 -0
- package/components/Alert/Alert.types.d.ts +14 -0
- package/components/Alert/Alert.types.js +1 -0
- package/components/Alert/index.d.ts +2 -0
- package/components/Alert/index.js +1 -0
- package/components/Alert/tests/Alert.stories.d.ts +8 -0
- package/components/Alert/tests/Alert.stories.js +78 -0
- package/components/Autocomplete/Autocomplete.d.ts +7 -0
- package/components/Autocomplete/Autocomplete.js +69 -0
- package/components/Autocomplete/Autocomplete.types.d.ts +17 -0
- package/components/Autocomplete/Autocomplete.types.js +1 -0
- package/components/Autocomplete/index.d.ts +2 -0
- package/components/Autocomplete/index.js +1 -0
- package/components/Autocomplete/tests/Autocomplete.stories.d.ts +6 -0
- package/components/Autocomplete/tests/Autocomplete.stories.js +21 -0
- package/components/Avatar/Avatar.d.ts +4 -0
- package/components/Avatar/Avatar.js +29 -0
- package/components/Avatar/Avatar.module.css +1 -0
- package/components/Avatar/Avatar.types.d.ts +30 -0
- package/components/Avatar/Avatar.types.js +1 -0
- package/components/Avatar/index.d.ts +2 -0
- package/components/Avatar/index.js +1 -0
- package/components/Avatar/tests/Avatar.stories.d.ts +9 -0
- package/components/Avatar/tests/Avatar.stories.js +83 -0
- package/components/Badge/Badge.d.ts +7 -0
- package/components/Badge/Badge.js +24 -0
- package/components/Badge/Badge.module.css +1 -0
- package/components/Badge/Badge.types.d.ts +39 -0
- package/components/Badge/Badge.types.js +1 -0
- package/components/Badge/BadgeContainer.d.ts +4 -0
- package/components/Badge/BadgeContainer.js +9 -0
- package/components/Badge/index.d.ts +2 -0
- package/components/Badge/index.js +1 -0
- package/components/Badge/tests/Badge.stories.d.ts +13 -0
- package/components/Badge/tests/Badge.stories.js +222 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +7 -0
- package/components/Breadcrumbs/Breadcrumbs.js +54 -0
- package/components/Breadcrumbs/Breadcrumbs.types.d.ts +13 -0
- package/components/Breadcrumbs/Breadcrumbs.types.js +1 -0
- package/components/Breadcrumbs/index.d.ts +2 -0
- package/components/Breadcrumbs/index.js +1 -0
- package/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +10 -0
- package/components/Breadcrumbs/tests/Breadcrumbs.stories.js +95 -0
- package/components/Button/Button.d.ts +3 -0
- package/components/Button/Button.js +37 -0
- package/components/Button/Button.module.css +1 -0
- package/components/Button/Button.types.d.ts +31 -0
- package/components/Button/Button.types.js +1 -0
- package/components/Button/ButtonAligner.d.ts +4 -0
- package/components/Button/ButtonAligner.js +13 -0
- package/components/Button/index.d.ts +2 -0
- package/components/Button/index.js +1 -0
- package/components/Button/tests/Button.stories.d.ts +15 -0
- package/components/Button/tests/Button.stories.js +561 -0
- package/components/Card/Card.d.ts +17 -0
- package/components/Card/Card.js +31 -0
- package/components/Card/Card.module.css +1 -0
- package/components/Card/Card.types.d.ts +16 -0
- package/components/Card/Card.types.js +1 -0
- package/components/Card/index.d.ts +2 -0
- package/components/Card/index.js +1 -0
- package/components/Card/tests/Card.stories.d.ts +12 -0
- package/components/Card/tests/Card.stories.js +83 -0
- package/components/Carousel/Carousel.d.ts +4 -0
- package/components/Carousel/Carousel.js +67 -0
- package/components/Carousel/Carousel.module.css +1 -0
- package/components/Carousel/Carousel.types.d.ts +28 -0
- package/components/Carousel/Carousel.types.js +5 -0
- package/components/Carousel/CarouselControl.d.ts +4 -0
- package/components/Carousel/CarouselControl.js +42 -0
- package/components/Carousel/index.d.ts +2 -0
- package/components/Carousel/index.js +1 -0
- package/components/Carousel/tests/Carousel.stories.d.ts +9 -0
- package/components/Carousel/tests/Carousel.stories.js +119 -0
- package/components/Checkbox/Checkbox.d.ts +4 -0
- package/components/Checkbox/Checkbox.js +44 -0
- package/components/Checkbox/Checkbox.module.css +1 -0
- package/components/Checkbox/Checkbox.types.d.ts +26 -0
- package/components/Checkbox/Checkbox.types.js +1 -0
- package/components/Checkbox/index.d.ts +2 -0
- package/components/Checkbox/index.js +1 -0
- package/components/Checkbox/tests/Checkbox.stories.d.ts +8 -0
- package/components/Checkbox/tests/Checkbox.stories.js +53 -0
- package/components/CheckboxGroup/CheckboxGroup.context.d.ts +5 -0
- package/components/CheckboxGroup/CheckboxGroup.context.js +5 -0
- package/components/CheckboxGroup/CheckboxGroup.d.ts +4 -0
- package/components/CheckboxGroup/CheckboxGroup.js +10 -0
- package/components/CheckboxGroup/CheckboxGroup.types.d.ts +28 -0
- package/components/CheckboxGroup/CheckboxGroup.types.js +1 -0
- package/components/CheckboxGroup/CheckboxGroupControlled.d.ts +4 -0
- package/components/CheckboxGroup/CheckboxGroupControlled.js +22 -0
- package/components/CheckboxGroup/CheckboxGroupUncontrolled.d.ts +4 -0
- package/components/CheckboxGroup/CheckboxGroupUncontrolled.js +16 -0
- package/components/CheckboxGroup/index.d.ts +3 -0
- package/components/CheckboxGroup/index.js +2 -0
- package/components/CheckboxGroup/tests/CheckboxGroup.stories.d.ts +7 -0
- package/components/CheckboxGroup/tests/CheckboxGroup.stories.js +44 -0
- package/components/Container/Container.d.ts +4 -0
- package/components/Container/Container.js +10 -0
- package/components/Container/Container.module.css +1 -0
- package/components/Container/Container.types.d.ts +9 -0
- package/components/Container/Container.types.js +1 -0
- package/components/Container/index.d.ts +2 -0
- package/components/Container/index.js +1 -0
- package/components/Container/tests/Container.stories.d.ts +7 -0
- package/components/Container/tests/Container.stories.js +28 -0
- package/components/Dismissible/Dismissible.d.ts +4 -0
- package/components/Dismissible/Dismissible.js +15 -0
- package/components/Dismissible/Dismissible.module.css +1 -0
- package/components/Dismissible/Dismissible.types.d.ts +20 -0
- package/components/Dismissible/Dismissible.types.js +1 -0
- package/components/Dismissible/index.d.ts +2 -0
- package/components/Dismissible/index.js +1 -0
- package/components/Dismissible/tests/Dismissible.stories.d.ts +8 -0
- package/components/Dismissible/tests/Dismissible.stories.js +44 -0
- package/components/Divider/Divider.d.ts +4 -0
- package/components/Divider/Divider.js +14 -0
- package/components/Divider/Divider.module.css +1 -0
- package/components/Divider/Divider.types.d.ts +7 -0
- package/components/Divider/Divider.types.js +1 -0
- package/components/Divider/index.d.ts +2 -0
- package/components/Divider/index.js +1 -0
- package/components/Divider/tests/Divider.stories.d.ts +7 -0
- package/components/Divider/tests/Divider.stories.js +36 -0
- package/components/DropdownMenu/DropdownMenu.d.ts +13 -0
- package/components/DropdownMenu/DropdownMenu.js +90 -0
- package/components/DropdownMenu/DropdownMenu.module.css +1 -0
- package/components/DropdownMenu/DropdownMenu.types.d.ts +16 -0
- package/components/DropdownMenu/DropdownMenu.types.js +1 -0
- package/components/DropdownMenu/index.d.ts +2 -0
- package/components/DropdownMenu/index.js +1 -0
- package/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +11 -0
- package/components/DropdownMenu/tests/DropdownMenu.stories.js +138 -0
- package/components/FormControl/FormControl.context.d.ts +281 -0
- package/components/FormControl/FormControl.context.js +18 -0
- package/components/FormControl/FormControl.d.ts +9 -0
- package/components/FormControl/FormControl.js +68 -0
- package/components/FormControl/FormControl.module.css +1 -0
- package/components/FormControl/FormControl.types.d.ts +33 -0
- package/components/FormControl/FormControl.types.js +1 -0
- package/components/FormControl/index.d.ts +3 -0
- package/components/FormControl/index.js +2 -0
- package/components/FormControl/tests/FormControl.stories.d.ts +10 -0
- package/components/FormControl/tests/FormControl.stories.js +78 -0
- package/components/Hidden/Hidden.d.ts +4 -0
- package/components/Hidden/Hidden.js +11 -0
- package/components/Hidden/Hidden.module.css +1 -0
- package/components/Hidden/Hidden.types.d.ts +9 -0
- package/components/Hidden/Hidden.types.js +1 -0
- package/components/Hidden/index.d.ts +2 -0
- package/components/Hidden/index.js +1 -0
- package/components/Hidden/tests/Hidden.stories.d.ts +7 -0
- package/components/Hidden/tests/Hidden.stories.js +39 -0
- package/components/HiddenVisually/HiddenVisually.d.ts +4 -0
- package/components/HiddenVisually/HiddenVisually.js +7 -0
- package/components/HiddenVisually/HiddenVisually.module.css +1 -0
- package/components/HiddenVisually/HiddenVisually.types.d.ts +4 -0
- package/components/HiddenVisually/HiddenVisually.types.js +1 -0
- package/components/HiddenVisually/index.d.ts +2 -0
- package/components/HiddenVisually/index.js +1 -0
- package/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +6 -0
- package/components/HiddenVisually/tests/HiddenVisually.stories.js +9 -0
- package/components/Hotkey/Hotkey.d.ts +4 -0
- package/components/Hotkey/Hotkey.js +10 -0
- package/components/Hotkey/Hotkey.module.css +1 -0
- package/components/Hotkey/Hotkey.types.d.ts +8 -0
- package/components/Hotkey/Hotkey.types.js +1 -0
- package/components/Hotkey/index.d.ts +2 -0
- package/components/Hotkey/index.js +1 -0
- package/components/Hotkey/tests/Hotkey.stories.d.ts +6 -0
- package/components/Hotkey/tests/Hotkey.stories.js +26 -0
- package/components/Icon/Icon.d.ts +4 -0
- package/components/Icon/Icon.js +15 -0
- package/components/Icon/Icon.module.css +1 -0
- package/components/Icon/Icon.types.d.ts +10 -0
- package/components/Icon/Icon.types.js +1 -0
- package/components/Icon/index.d.ts +2 -0
- package/components/Icon/index.js +1 -0
- package/components/Icon/tests/Icon.stories.d.ts +8 -0
- package/components/Icon/tests/Icon.stories.js +69 -0
- package/components/Image/Image.d.ts +4 -0
- package/components/Image/Image.js +37 -0
- package/components/Image/Image.module.css +1 -0
- package/components/Image/Image.types.d.ts +19 -0
- package/components/Image/Image.types.js +1 -0
- package/components/Image/index.d.ts +2 -0
- package/components/Image/index.js +1 -0
- package/components/Image/tests/Image.stories.d.ts +10 -0
- package/components/Image/tests/Image.stories.js +90 -0
- package/components/Link/Link.d.ts +7 -0
- package/components/Link/Link.js +13 -0
- package/components/Link/Link.module.css +1 -0
- package/components/Link/Link.types.d.ts +7 -0
- package/components/Link/Link.types.js +1 -0
- package/components/Link/index.d.ts +2 -0
- package/components/Link/index.js +1 -0
- package/components/Link/tests/Link.stories.d.ts +10 -0
- package/components/Link/tests/Link.stories.js +62 -0
- package/components/Loader/Loader.d.ts +4 -0
- package/components/Loader/Loader.js +11 -0
- package/components/Loader/Loader.module.css +1 -0
- package/components/Loader/Loader.types.d.ts +7 -0
- package/components/Loader/Loader.types.js +1 -0
- package/components/Loader/index.d.ts +2 -0
- package/components/Loader/index.js +1 -0
- package/components/Loader/tests/Loader.stories.d.ts +7 -0
- package/components/Loader/tests/Loader.stories.js +29 -0
- package/components/MenuItem/MenuItem.d.ts +3 -0
- package/components/MenuItem/MenuItem.js +22 -0
- package/components/MenuItem/MenuItem.module.css +1 -0
- package/components/MenuItem/MenuItem.types.d.ts +23 -0
- package/components/MenuItem/MenuItem.types.js +1 -0
- package/components/MenuItem/MenuItemAligner.d.ts +4 -0
- package/components/MenuItem/MenuItemAligner.js +9 -0
- package/components/MenuItem/index.d.ts +2 -0
- package/components/MenuItem/index.js +1 -0
- package/components/MenuItem/tests/MenuItem.stories.d.ts +12 -0
- package/components/MenuItem/tests/MenuItem.stories.js +122 -0
- package/components/Modal/Modal.d.ts +8 -0
- package/components/Modal/Modal.js +56 -0
- package/components/Modal/Modal.module.css +1 -0
- package/components/Modal/Modal.types.d.ts +26 -0
- package/components/Modal/Modal.types.js +1 -0
- package/components/Modal/index.d.ts +2 -0
- package/components/Modal/index.js +1 -0
- package/components/Modal/tests/Modal.stories.d.ts +11 -0
- package/components/Modal/tests/Modal.stories.js +145 -0
- package/components/Overlay/Overlay.d.ts +4 -0
- package/components/Overlay/Overlay.js +110 -0
- package/components/Overlay/Overlay.module.css +1 -0
- package/components/Overlay/Overlay.types.d.ts +12 -0
- package/components/Overlay/Overlay.types.js +1 -0
- package/components/Overlay/index.d.ts +2 -0
- package/components/Overlay/index.js +1 -0
- package/components/Overlay/tests/Overlay.stories.d.ts +6 -0
- package/components/Overlay/tests/Overlay.stories.js +27 -0
- package/components/Popover/Popover.d.ts +8 -0
- package/components/Popover/Popover.js +19 -0
- package/components/Popover/Popover.module.css +1 -0
- package/components/Popover/Popover.types.d.ts +7 -0
- package/components/Popover/Popover.types.js +1 -0
- package/components/Popover/index.d.ts +2 -0
- package/components/Popover/index.js +1 -0
- package/components/Popover/tests/Popover.stories.d.ts +10 -0
- package/components/Popover/tests/Popover.stories.js +99 -0
- package/components/Progress/Progress.d.ts +4 -0
- package/components/Progress/Progress.js +18 -0
- package/components/Progress/Progress.module.css +1 -0
- package/components/Progress/Progress.types.d.ts +11 -0
- package/components/Progress/Progress.types.js +1 -0
- package/components/Progress/index.d.ts +2 -0
- package/components/Progress/index.js +1 -0
- package/components/Progress/tests/Progress.stories.d.ts +9 -0
- package/components/Progress/tests/Progress.stories.js +55 -0
- package/components/Radio/Radio.d.ts +4 -0
- package/components/Radio/Radio.js +35 -0
- package/components/Radio/Radio.module.css +1 -0
- package/components/Radio/Radio.types.d.ts +25 -0
- package/components/Radio/Radio.types.js +1 -0
- package/components/Radio/index.d.ts +2 -0
- package/components/Radio/index.js +1 -0
- package/components/Radio/tests/Radio.stories.d.ts +8 -0
- package/components/Radio/tests/Radio.stories.js +42 -0
- package/components/RadioGroup/RadioGroup.context.d.ts +5 -0
- package/components/RadioGroup/RadioGroup.context.js +5 -0
- package/components/RadioGroup/RadioGroup.d.ts +4 -0
- package/components/RadioGroup/RadioGroup.js +10 -0
- package/components/RadioGroup/RadioGroup.types.d.ts +28 -0
- package/components/RadioGroup/RadioGroup.types.js +1 -0
- package/components/RadioGroup/RadioGroupControlled.d.ts +4 -0
- package/components/RadioGroup/RadioGroupControlled.js +14 -0
- package/components/RadioGroup/RadioGroupUncontrolled.d.ts +4 -0
- package/components/RadioGroup/RadioGroupUncontrolled.js +16 -0
- package/components/RadioGroup/index.d.ts +3 -0
- package/components/RadioGroup/index.js +2 -0
- package/components/RadioGroup/tests/RadioGroup.stories.d.ts +7 -0
- package/components/RadioGroup/tests/RadioGroup.stories.js +44 -0
- package/components/Reshaped/Reshaped.css +1 -0
- package/components/Reshaped/Reshaped.d.ts +5 -0
- package/components/Reshaped/Reshaped.js +26 -0
- package/components/Reshaped/Reshaped.module.css +1 -0
- package/components/Reshaped/Reshaped.types.d.ts +14 -0
- package/components/Reshaped/Reshaped.types.js +1 -0
- package/components/Reshaped/index.d.ts +2 -0
- package/components/Reshaped/index.js +1 -0
- package/components/Scrim/Scrim.d.ts +4 -0
- package/components/Scrim/Scrim.js +13 -0
- package/components/Scrim/Scrim.module.css +1 -0
- package/components/Scrim/Scrim.types.d.ts +11 -0
- package/components/Scrim/Scrim.types.js +1 -0
- package/components/Scrim/index.d.ts +2 -0
- package/components/Scrim/index.js +1 -0
- package/components/Scrim/tests/Scrim.stories.d.ts +7 -0
- package/components/Scrim/tests/Scrim.stories.js +40 -0
- package/components/Select/Select.d.ts +4 -0
- package/components/Select/Select.js +59 -0
- package/components/Select/Select.module.css +1 -0
- package/components/Select/Select.types.d.ts +49 -0
- package/components/Select/Select.types.js +1 -0
- package/components/Select/index.d.ts +2 -0
- package/components/Select/index.js +1 -0
- package/components/Select/tests/Select.stories.d.ts +14 -0
- package/components/Select/tests/Select.stories.js +165 -0
- package/components/Skeleton/Skeleton.d.ts +4 -0
- package/components/Skeleton/Skeleton.js +10 -0
- package/components/Skeleton/Skeleton.module.css +1 -0
- package/components/Skeleton/Skeleton.types.d.ts +6 -0
- package/components/Skeleton/Skeleton.types.js +1 -0
- package/components/Skeleton/index.d.ts +2 -0
- package/components/Skeleton/index.js +1 -0
- package/components/Skeleton/tests/Skeleton.stories.d.ts +7 -0
- package/components/Skeleton/tests/Skeleton.stories.js +38 -0
- package/components/Switch/Switch.d.ts +4 -0
- package/components/Switch/Switch.js +31 -0
- package/components/Switch/Switch.module.css +1 -0
- package/components/Switch/Switch.types.d.ts +26 -0
- package/components/Switch/Switch.types.js +1 -0
- package/components/Switch/index.d.ts +2 -0
- package/components/Switch/index.js +1 -0
- package/components/Switch/tests/Switch.stories.d.ts +9 -0
- package/components/Switch/tests/Switch.stories.js +53 -0
- package/components/Tabs/Tabs.d.ts +16 -0
- package/components/Tabs/Tabs.js +16 -0
- package/components/Tabs/Tabs.module.css +1 -0
- package/components/Tabs/Tabs.types.d.ts +61 -0
- package/components/Tabs/Tabs.types.js +1 -0
- package/components/Tabs/TabsContext.d.ts +18 -0
- package/components/Tabs/TabsContext.js +19 -0
- package/components/Tabs/TabsControlled.d.ts +4 -0
- package/components/Tabs/TabsControlled.js +16 -0
- package/components/Tabs/TabsItem.d.ts +11 -0
- package/components/Tabs/TabsItem.js +31 -0
- package/components/Tabs/TabsList.d.ts +4 -0
- package/components/Tabs/TabsList.js +163 -0
- package/components/Tabs/TabsPanel.d.ts +4 -0
- package/components/Tabs/TabsPanel.js +13 -0
- package/components/Tabs/TabsUncontrolled.d.ts +4 -0
- package/components/Tabs/TabsUncontrolled.js +18 -0
- package/components/Tabs/index.d.ts +2 -0
- package/components/Tabs/index.js +1 -0
- package/components/Tabs/tests/Tabs.stories.d.ts +13 -0
- package/components/Tabs/tests/Tabs.stories.js +251 -0
- package/components/Text/Text.d.ts +4 -0
- package/components/Text/Text.js +24 -0
- package/components/Text/Text.module.css +1 -0
- package/components/Text/Text.types.d.ts +15 -0
- package/components/Text/Text.types.js +1 -0
- package/components/Text/index.d.ts +2 -0
- package/components/Text/index.js +1 -0
- package/components/Text/tests/Text.stories.d.ts +11 -0
- package/components/Text/tests/Text.stories.js +117 -0
- package/components/TextArea/TextArea.d.ts +4 -0
- package/components/TextArea/TextArea.js +25 -0
- package/components/TextArea/TextArea.module.css +1 -0
- package/components/TextArea/TextArea.types.d.ts +28 -0
- package/components/TextArea/TextArea.types.js +1 -0
- package/components/TextArea/index.d.ts +2 -0
- package/components/TextArea/index.js +1 -0
- package/components/TextArea/tests/TextArea.stories.d.ts +11 -0
- package/components/TextArea/tests/TextArea.stories.js +72 -0
- package/components/TextField/TextField.d.ts +4 -0
- package/components/TextField/TextField.js +47 -0
- package/components/TextField/TextField.module.css +1 -0
- package/components/TextField/TextField.types.d.ts +42 -0
- package/components/TextField/TextField.types.js +1 -0
- package/components/TextField/index.d.ts +2 -0
- package/components/TextField/index.js +1 -0
- package/components/TextField/tests/TextField.stories.d.ts +14 -0
- package/components/TextField/tests/TextField.stories.js +100 -0
- package/components/Theme/GlobalColorMode.d.ts +4 -0
- package/components/Theme/GlobalColorMode.js +31 -0
- package/components/Theme/Theme.context.d.ts +4 -0
- package/components/Theme/Theme.context.js +14 -0
- package/components/Theme/Theme.d.ts +4 -0
- package/components/Theme/Theme.js +39 -0
- package/components/Theme/Theme.module.css +1 -0
- package/components/Theme/Theme.types.d.ts +24 -0
- package/components/Theme/Theme.types.js +1 -0
- package/components/Theme/index.d.ts +4 -0
- package/components/Theme/index.js +3 -0
- package/components/Theme/tests/Theme.stories.d.ts +7 -0
- package/components/Theme/tests/Theme.stories.js +40 -0
- package/components/Theme/useTheme.d.ts +8 -0
- package/components/Theme/useTheme.js +18 -0
- package/components/Timeline/Timeline.d.ts +7 -0
- package/components/Timeline/Timeline.js +21 -0
- package/components/Timeline/Timeline.module.css +1 -0
- package/components/Timeline/Timeline.types.d.ts +13 -0
- package/components/Timeline/Timeline.types.js +1 -0
- package/components/Timeline/index.d.ts +2 -0
- package/components/Timeline/index.js +1 -0
- package/components/Timeline/tests/Timeline.stories.d.ts +7 -0
- package/components/Timeline/tests/Timeline.stories.js +55 -0
- package/components/Toast/Toast.constants.d.ts +10 -0
- package/components/Toast/Toast.constants.js +20 -0
- package/components/Toast/Toast.context.d.ts +4 -0
- package/components/Toast/Toast.context.js +5 -0
- package/components/Toast/Toast.d.ts +6 -0
- package/components/Toast/Toast.js +55 -0
- package/components/Toast/Toast.module.css +1 -0
- package/components/Toast/Toast.types.d.ts +77 -0
- package/components/Toast/Toast.types.js +1 -0
- package/components/Toast/ToastContainer.d.ts +4 -0
- package/components/Toast/ToastContainer.js +97 -0
- package/components/Toast/ToastProvider.d.ts +4 -0
- package/components/Toast/ToastProvider.js +80 -0
- package/components/Toast/ToastRegion.d.ts +4 -0
- package/components/Toast/ToastRegion.js +63 -0
- package/components/Toast/index.d.ts +3 -0
- package/components/Toast/index.js +2 -0
- package/components/Toast/tests/Toast.stories.d.ts +13 -0
- package/components/Toast/tests/Toast.stories.js +304 -0
- package/components/Toast/useToast.d.ts +5 -0
- package/components/Toast/useToast.js +8 -0
- package/components/Tooltip/Tooltip.d.ts +4 -0
- package/components/Tooltip/Tooltip.js +15 -0
- package/components/Tooltip/Tooltip.module.css +1 -0
- package/components/Tooltip/Tooltip.types.d.ts +5 -0
- package/components/Tooltip/Tooltip.types.js +1 -0
- package/components/Tooltip/index.d.ts +2 -0
- package/components/Tooltip/index.js +1 -0
- package/components/Tooltip/tests/Tooltip.stories.d.ts +7 -0
- package/components/Tooltip/tests/Tooltip.stories.js +58 -0
- package/components/View/View.d.ts +7 -0
- package/components/View/View.js +135 -0
- package/components/View/View.module.css +1 -0
- package/components/View/View.types.d.ts +64 -0
- package/components/View/View.types.js +1 -0
- package/components/View/index.d.ts +2 -0
- package/components/View/index.js +1 -0
- package/components/View/tests/View.stories.d.ts +32 -0
- package/components/View/tests/View.stories.js +1015 -0
- package/components/_private/Flyout/Flyout.context.d.ts +6 -0
- package/components/_private/Flyout/Flyout.context.js +6 -0
- package/components/_private/Flyout/Flyout.d.ts +8 -0
- package/components/_private/Flyout/Flyout.js +14 -0
- package/components/_private/Flyout/Flyout.module.css +1 -0
- package/components/_private/Flyout/Flyout.types.d.ts +77 -0
- package/components/_private/Flyout/Flyout.types.js +1 -0
- package/components/_private/Flyout/FlyoutContent.d.ts +4 -0
- package/components/_private/Flyout/FlyoutContent.js +40 -0
- package/components/_private/Flyout/FlyoutControlled.d.ts +4 -0
- package/components/_private/Flyout/FlyoutControlled.js +214 -0
- package/components/_private/Flyout/FlyoutTrigger.d.ts +4 -0
- package/components/_private/Flyout/FlyoutTrigger.js +47 -0
- package/components/_private/Flyout/FlyoutUncontrolled.d.ts +4 -0
- package/components/_private/Flyout/FlyoutUncontrolled.js +19 -0
- package/components/_private/Flyout/index.d.ts +3 -0
- package/components/_private/Flyout/index.js +2 -0
- package/components/_private/Flyout/tests/Flyout.stories.d.ts +16 -0
- package/components/_private/Flyout/tests/Flyout.stories.js +133 -0
- package/components/_private/HiddenInput/HiddenInput.d.ts +4 -0
- package/components/_private/HiddenInput/HiddenInput.js +9 -0
- package/components/_private/HiddenInput/HiddenInput.module.css +1 -0
- package/components/_private/HiddenInput/HiddenInput.types.d.ts +15 -0
- package/components/_private/HiddenInput/HiddenInput.types.js +1 -0
- package/components/_private/HiddenInput/index.d.ts +2 -0
- package/components/_private/HiddenInput/index.js +1 -0
- package/components/_private/Portal/Portal.d.ts +8 -0
- package/components/_private/Portal/Portal.js +21 -0
- package/components/_private/Portal/Portal.types.d.ts +6 -0
- package/components/_private/Portal/Portal.types.js +1 -0
- package/components/_private/Portal/index.d.ts +2 -0
- package/components/_private/Portal/index.js +1 -0
- package/components/_private/Portal/tests/Portal.stories.d.ts +6 -0
- package/components/_private/Portal/tests/Portal.stories.js +18 -0
- package/config/postcss.d.ts +13 -0
- package/config/postcss.js +19 -0
- package/config/tailwind.d.ts +2 -0
- package/config/tailwind.js +91 -0
- package/constants/attributes.d.ts +2 -0
- package/constants/attributes.js +2 -0
- package/constants/keys.d.ts +10 -0
- package/constants/keys.js +10 -0
- package/constants/timeouts.d.ts +2 -0
- package/constants/timeouts.js +2 -0
- package/hooks/_private/useFlyout.d.ts +27 -0
- package/hooks/_private/useFlyout.js +269 -0
- package/hooks/_private/useIsDismissible.d.ts +8 -0
- package/hooks/_private/useIsDismissible.js +45 -0
- package/hooks/_private/useOnClickOutside.d.ts +3 -0
- package/hooks/_private/useOnClickOutside.js +29 -0
- package/hooks/_private/useSingletonEnvironment.d.ts +9 -0
- package/hooks/_private/useSingletonEnvironment.js +33 -0
- package/hooks/_private/useSingletonHotkeys.d.ts +34 -0
- package/hooks/_private/useSingletonHotkeys.js +191 -0
- package/hooks/_private/useSingletonKeyboardMode.d.ts +2 -0
- package/hooks/_private/useSingletonKeyboardMode.js +21 -0
- package/hooks/tests/useHotkeys.stories.d.ts +6 -0
- package/hooks/tests/useHotkeys.stories.js +25 -0
- package/hooks/tests/useResponsiveClientValue.stories.d.ts +6 -0
- package/hooks/tests/useResponsiveClientValue.stories.js +13 -0
- package/hooks/useElementId.d.ts +2 -0
- package/hooks/useElementId.js +8 -0
- package/hooks/useHotkeys.d.ts +8 -0
- package/hooks/useHotkeys.js +15 -0
- package/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/hooks/useIsomorphicLayoutEffect.js +4 -0
- package/hooks/useRTL.d.ts +2 -0
- package/hooks/useRTL.js +7 -0
- package/hooks/useResponsiveClientValue.d.ts +3 -0
- package/hooks/useResponsiveClientValue.js +43 -0
- package/hooks/useScrollLock.d.ts +6 -0
- package/hooks/useScrollLock.js +44 -0
- package/hooks/useToggle.d.ts +7 -0
- package/hooks/useToggle.js +16 -0
- package/icons/ArrowUpRight.d.ts +3 -0
- package/icons/ArrowUpRight.js +7 -0
- package/icons/Checkmark.d.ts +3 -0
- package/icons/Checkmark.js +6 -0
- package/icons/ChevronDown.d.ts +3 -0
- package/icons/ChevronDown.js +6 -0
- package/icons/ChevronLeft.d.ts +3 -0
- package/icons/ChevronLeft.js +6 -0
- package/icons/ChevronRight.d.ts +3 -0
- package/icons/ChevronRight.js +6 -0
- package/icons/ChevronVertical.d.ts +3 -0
- package/icons/ChevronVertical.js +5 -0
- package/icons/Close.d.ts +3 -0
- package/icons/Close.js +7 -0
- package/icons/DotsHorizontal.d.ts +3 -0
- package/icons/DotsHorizontal.js +6 -0
- package/icons/Mic.d.ts +3 -0
- package/icons/Mic.js +9 -0
- package/icons/Zap.d.ts +3 -0
- package/icons/Zap.js +6 -0
- package/index.d.ts +118 -0
- package/index.js +67 -0
- package/package.json +141 -4
- package/styles/aspectRatio/aspectRatio.module.css +1 -0
- package/styles/aspectRatio/index.d.ts +3 -0
- package/styles/aspectRatio/index.js +9 -0
- package/styles/aspectRatio/index.test.d.ts +1 -0
- package/styles/aspectRatio/index.test.js +24 -0
- package/styles/bleed/bleed.module.css +1 -0
- package/styles/bleed/index.d.ts +3 -0
- package/styles/bleed/index.js +13 -0
- package/styles/bleed/index.test.d.ts +1 -0
- package/styles/bleed/index.test.js +24 -0
- package/styles/height/height.module.css +1 -0
- package/styles/height/index.d.ts +3 -0
- package/styles/height/index.js +10 -0
- package/styles/height/index.test.d.ts +1 -0
- package/styles/height/index.test.js +27 -0
- package/styles/inset/index.d.ts +4 -0
- package/styles/inset/index.js +14 -0
- package/styles/inset/index.test.d.ts +1 -0
- package/styles/inset/index.test.js +27 -0
- package/styles/inset/inset.module.css +1 -0
- package/styles/maxHeight/index.d.ts +3 -0
- package/styles/maxHeight/index.js +10 -0
- package/styles/maxHeight/index.test.d.ts +1 -0
- package/styles/maxHeight/index.test.js +27 -0
- package/styles/maxHeight/maxHeight.module.css +1 -0
- package/styles/maxWidth/index.d.ts +3 -0
- package/styles/maxWidth/index.js +10 -0
- package/styles/maxWidth/index.test.d.ts +1 -0
- package/styles/maxWidth/index.test.js +27 -0
- package/styles/maxWidth/maxWidth.module.css +1 -0
- package/styles/padding/index.d.ts +3 -0
- package/styles/padding/index.js +9 -0
- package/styles/padding/index.test.d.ts +1 -0
- package/styles/padding/index.test.js +24 -0
- package/styles/padding/padding.module.css +1 -0
- package/styles/position/index.d.ts +3 -0
- package/styles/position/index.js +9 -0
- package/styles/position/index.test.d.ts +1 -0
- package/styles/position/index.test.js +21 -0
- package/styles/position/position.module.css +1 -0
- package/styles/radius/index.d.ts +3 -0
- package/styles/radius/index.js +10 -0
- package/styles/radius/index.test.d.ts +1 -0
- package/styles/radius/index.test.js +24 -0
- package/styles/radius/radius.module.css +1 -0
- package/styles/types.d.ts +19 -0
- package/styles/types.js +1 -0
- package/styles/width/index.d.ts +3 -0
- package/styles/width/index.js +10 -0
- package/styles/width/index.test.d.ts +1 -0
- package/styles/width/index.test.js +27 -0
- package/styles/width/width.module.css +1 -0
- package/themes/figma/theme.css +1 -0
- package/themes/fragments/twitter/theme.css +1 -0
- package/themes/media.css +5 -0
- package/themes/minimal/theme.css +1 -0
- package/themes/reshaped/theme.css +1 -0
- package/themes/slate/theme.css +1 -0
- package/types/config.d.ts +8 -0
- package/types/config.js +2 -0
- package/types/global.d.ts +29 -0
- package/types/global.js +1 -0
- package/utilities/Chain.d.ts +20 -0
- package/utilities/Chain.js +63 -0
- package/utilities/a11y.d.ts +36 -0
- package/utilities/a11y.js +175 -0
- package/utilities/animation.d.ts +4 -0
- package/utilities/animation.js +15 -0
- package/utilities/helpers.d.ts +15 -0
- package/utilities/helpers.js +121 -0
- package/utilities/storybook/Example.d.ts +13 -0
- package/utilities/storybook/Example.js +19 -0
- package/utilities/storybook/Example.module.css +1 -0
- package/utilities/storybook/Placeholder.d.ts +9 -0
- package/utilities/storybook/Placeholder.js +17 -0
- package/utilities/storybook/index.d.ts +2 -0
- package/utilities/storybook/index.js +2 -0
- package/utilities/testPresets.d.ts +25 -0
- package/utilities/testPresets.js +76 -0
- package/utilities/tests/Chain.test.d.ts +1 -0
- package/utilities/tests/Chain.test.js +45 -0
- package/README.md +0 -1
@@ -0,0 +1,561 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Example, Placeholder } from "../../../utilities/storybook/index.js";
|
3
|
+
import Button from "../index.js";
|
4
|
+
import View from "../../View/index.js";
|
5
|
+
import Image from "../../Image/index.js";
|
6
|
+
import IconZap from "../../../icons/Zap.js";
|
7
|
+
export default { title: "Components/Button" };
|
8
|
+
const imgUrl = "https://images.unsplash.com/photo-1632502361954-0dd92ce797db?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1625&q=80";
|
9
|
+
export const variant = () => (<Example>
|
10
|
+
<Example.Item title="variant: solid">
|
11
|
+
<View gap={4} direction="row">
|
12
|
+
<Button onClick={() => { }}>Button</Button>
|
13
|
+
<Button onClick={() => { }} color="primary">
|
14
|
+
Button
|
15
|
+
</Button>
|
16
|
+
<Button onClick={() => { }} color="critical">
|
17
|
+
Button
|
18
|
+
</Button>
|
19
|
+
<Button onClick={() => { }} color="positive">
|
20
|
+
Button
|
21
|
+
</Button>
|
22
|
+
<Button onClick={() => { }} color="black">
|
23
|
+
Button
|
24
|
+
</Button>
|
25
|
+
<Button onClick={() => { }} color="white">
|
26
|
+
Button
|
27
|
+
</Button>
|
28
|
+
</View>
|
29
|
+
</Example.Item>
|
30
|
+
<Example.Item title="variant: faded">
|
31
|
+
<View direction="row" gap={4}>
|
32
|
+
<Button onClick={() => { }} variant="faded">
|
33
|
+
Button
|
34
|
+
</Button>
|
35
|
+
<Button onClick={() => { }} color="primary" variant="faded">
|
36
|
+
Button
|
37
|
+
</Button>
|
38
|
+
<Button onClick={() => { }} color="critical" variant="faded">
|
39
|
+
Button
|
40
|
+
</Button>
|
41
|
+
<Button onClick={() => { }} color="positive" variant="faded">
|
42
|
+
Button
|
43
|
+
</Button>
|
44
|
+
<Button onClick={() => { }} color="black" variant="faded">
|
45
|
+
Button
|
46
|
+
</Button>
|
47
|
+
<Button onClick={() => { }} color="white" variant="faded">
|
48
|
+
Button
|
49
|
+
</Button>
|
50
|
+
<div style={{ color: "#029CFD" }}>
|
51
|
+
<Button onClick={() => { }} color="inherit" variant="faded">
|
52
|
+
Inherit
|
53
|
+
</Button>
|
54
|
+
</div>
|
55
|
+
</View>
|
56
|
+
</Example.Item>
|
57
|
+
<Example.Item title="variant: outline">
|
58
|
+
<View direction="row" gap={4}>
|
59
|
+
<Button onClick={() => { }} variant="outline">
|
60
|
+
Button
|
61
|
+
</Button>
|
62
|
+
<Button onClick={() => { }} color="primary" variant="outline">
|
63
|
+
Button
|
64
|
+
</Button>
|
65
|
+
<Button onClick={() => { }} color="critical" variant="outline">
|
66
|
+
Button
|
67
|
+
</Button>
|
68
|
+
<Button onClick={() => { }} color="positive" variant="outline">
|
69
|
+
Button
|
70
|
+
</Button>
|
71
|
+
<Button onClick={() => { }} color="black" variant="outline">
|
72
|
+
Button
|
73
|
+
</Button>
|
74
|
+
<Button onClick={() => { }} color="white" variant="outline">
|
75
|
+
Button
|
76
|
+
</Button>
|
77
|
+
<div style={{ color: "#029CFD" }}>
|
78
|
+
<Button onClick={() => { }} color="inherit" variant="outline">
|
79
|
+
Inherit
|
80
|
+
</Button>
|
81
|
+
</div>
|
82
|
+
</View>
|
83
|
+
</Example.Item>
|
84
|
+
<Example.Item title="variant: ghost">
|
85
|
+
<View direction="row" gap={4}>
|
86
|
+
<Button onClick={() => { }} variant="ghost">
|
87
|
+
Button
|
88
|
+
</Button>
|
89
|
+
<Button onClick={() => { }} color="primary" variant="ghost">
|
90
|
+
Button
|
91
|
+
</Button>
|
92
|
+
<Button onClick={() => { }} color="critical" variant="ghost">
|
93
|
+
Button
|
94
|
+
</Button>
|
95
|
+
<Button onClick={() => { }} color="positive" variant="ghost">
|
96
|
+
Button
|
97
|
+
</Button>
|
98
|
+
<Button onClick={() => { }} color="black" variant="ghost">
|
99
|
+
Button
|
100
|
+
</Button>
|
101
|
+
<Button onClick={() => { }} color="white" variant="ghost">
|
102
|
+
Button
|
103
|
+
</Button>
|
104
|
+
<div style={{ color: "#029CFD" }}>
|
105
|
+
<Button onClick={() => { }} color="inherit" variant="ghost">
|
106
|
+
Inherit
|
107
|
+
</Button>
|
108
|
+
</div>
|
109
|
+
</View>
|
110
|
+
</Example.Item>
|
111
|
+
</Example>);
|
112
|
+
export const icon = () => (<Example>
|
113
|
+
<Example.Item title="icon: start">
|
114
|
+
<Button onClick={() => { }} icon={IconZap}>
|
115
|
+
Button
|
116
|
+
</Button>
|
117
|
+
</Example.Item>
|
118
|
+
<Example.Item title="icon: end">
|
119
|
+
<Button onClick={() => { }} endIcon={IconZap}>
|
120
|
+
Button
|
121
|
+
</Button>
|
122
|
+
</Example.Item>
|
123
|
+
|
124
|
+
<Example.Item title="icon: start and end">
|
125
|
+
<Button onClick={() => { }} icon={IconZap} endIcon={IconZap}>
|
126
|
+
Button
|
127
|
+
</Button>
|
128
|
+
</Example.Item>
|
129
|
+
|
130
|
+
<Example.Item title="icon only">
|
131
|
+
<Button onClick={() => { }} icon={IconZap} attributes={{ "aria-label": "Action" }}/>
|
132
|
+
</Example.Item>
|
133
|
+
</Example>);
|
134
|
+
export const elevated = () => (<Example>
|
135
|
+
<Example.Item title="color: neutral, elevated, variant: solid and outline">
|
136
|
+
<View gap={3} direction="row">
|
137
|
+
<Button elevated>Button</Button>
|
138
|
+
<Button elevated variant="outline">
|
139
|
+
Button
|
140
|
+
</Button>
|
141
|
+
</View>
|
142
|
+
</Example.Item>
|
143
|
+
<Example.Item title="color: primary, elevated, variant: solid and outline">
|
144
|
+
<View gap={3} direction="row">
|
145
|
+
<Button elevated color="primary">
|
146
|
+
Button
|
147
|
+
</Button>
|
148
|
+
<Button elevated variant="outline" color="primary">
|
149
|
+
Button
|
150
|
+
</Button>
|
151
|
+
</View>
|
152
|
+
</Example.Item>
|
153
|
+
|
154
|
+
<Example.Item title="color: white, elevated, variant: solid">
|
155
|
+
<View gap={3} backgroundColor="primary-faded" padding={2} direction="row">
|
156
|
+
<Button color="white" elevated>
|
157
|
+
Button
|
158
|
+
</Button>
|
159
|
+
</View>
|
160
|
+
</Example.Item>
|
161
|
+
|
162
|
+
<Example.Item title="color: black, elevated, variant: solid">
|
163
|
+
<View gap={3} backgroundColor="primary-faded" padding={2} direction="row">
|
164
|
+
<Button color="black" elevated>
|
165
|
+
Button
|
166
|
+
</Button>
|
167
|
+
</View>
|
168
|
+
</Example.Item>
|
169
|
+
</Example>);
|
170
|
+
export const size = () => (<Example>
|
171
|
+
<Example.Item title="size: small, all variants">
|
172
|
+
<View gap={3} direction="row">
|
173
|
+
<Button size="small" icon={IconZap}>
|
174
|
+
Button
|
175
|
+
</Button>
|
176
|
+
<Button size="small" variant="outline" icon={IconZap}>
|
177
|
+
Button
|
178
|
+
</Button>
|
179
|
+
<Button size="small" variant="ghost" icon={IconZap}>
|
180
|
+
Button
|
181
|
+
</Button>
|
182
|
+
</View>
|
183
|
+
</Example.Item>
|
184
|
+
|
185
|
+
<Example.Item title="size: medium, all variants">
|
186
|
+
<View gap={3} direction="row">
|
187
|
+
<Button icon={IconZap}>Button</Button>
|
188
|
+
<Button variant="outline" icon={IconZap}>
|
189
|
+
Button
|
190
|
+
</Button>
|
191
|
+
<Button variant="ghost" icon={IconZap}>
|
192
|
+
Button
|
193
|
+
</Button>
|
194
|
+
</View>
|
195
|
+
</Example.Item>
|
196
|
+
|
197
|
+
<Example.Item title="size: large, all variants">
|
198
|
+
<View gap={3} direction="row">
|
199
|
+
<Button size="large" icon={IconZap}>
|
200
|
+
Button
|
201
|
+
</Button>
|
202
|
+
<Button size="large" variant="outline" icon={IconZap}>
|
203
|
+
Button
|
204
|
+
</Button>
|
205
|
+
<Button size="large" variant="ghost" icon={IconZap}>
|
206
|
+
Button
|
207
|
+
</Button>
|
208
|
+
</View>
|
209
|
+
</Example.Item>
|
210
|
+
|
211
|
+
<Example.Item title="size: xlarge, all variants">
|
212
|
+
<View gap={3} direction="row">
|
213
|
+
<Button size="xlarge" icon={IconZap}>
|
214
|
+
Button
|
215
|
+
</Button>
|
216
|
+
<Button size="xlarge" variant="outline" icon={IconZap}>
|
217
|
+
Button
|
218
|
+
</Button>
|
219
|
+
<Button size="xlarge" variant="ghost" icon={IconZap}>
|
220
|
+
Button
|
221
|
+
</Button>
|
222
|
+
</View>
|
223
|
+
</Example.Item>
|
224
|
+
|
225
|
+
<Example.Item title={["responsive size", "[s] large", "[m+] medium"]}>
|
226
|
+
<Button size={{ s: "large", m: "medium" }} icon={IconZap}>
|
227
|
+
Button
|
228
|
+
</Button>
|
229
|
+
</Example.Item>
|
230
|
+
</Example>);
|
231
|
+
export const rounded = () => (<Example>
|
232
|
+
<Example.Item title="rounded, size: small, all variants">
|
233
|
+
<View gap={3} direction="row">
|
234
|
+
<Button rounded size="small" icon={IconZap}>
|
235
|
+
Button
|
236
|
+
</Button>
|
237
|
+
<Button rounded variant="outline" size="small" icon={IconZap}>
|
238
|
+
Button
|
239
|
+
</Button>
|
240
|
+
<Button rounded variant="ghost" size="small" icon={IconZap}>
|
241
|
+
Button
|
242
|
+
</Button>
|
243
|
+
</View>
|
244
|
+
</Example.Item>
|
245
|
+
<Example.Item title="rounded, size: medium, all variants">
|
246
|
+
<View gap={3} direction="row">
|
247
|
+
<Button rounded icon={IconZap}>
|
248
|
+
Button
|
249
|
+
</Button>
|
250
|
+
<Button rounded variant="outline" icon={IconZap}>
|
251
|
+
Button
|
252
|
+
</Button>
|
253
|
+
<Button rounded variant="ghost" icon={IconZap}>
|
254
|
+
Button
|
255
|
+
</Button>
|
256
|
+
</View>
|
257
|
+
</Example.Item>
|
258
|
+
<Example.Item title="rounded, size: large, all variants">
|
259
|
+
<View gap={3} direction="row">
|
260
|
+
<Button rounded size="large" icon={IconZap}>
|
261
|
+
Button
|
262
|
+
</Button>
|
263
|
+
<Button rounded variant="outline" size="large" icon={IconZap}>
|
264
|
+
Button
|
265
|
+
</Button>
|
266
|
+
<Button rounded variant="ghost" size="large" icon={IconZap}>
|
267
|
+
Button
|
268
|
+
</Button>
|
269
|
+
</View>
|
270
|
+
</Example.Item>
|
271
|
+
<Example.Item title="rounded, icon only, all sizes">
|
272
|
+
<View gap={3} direction="row">
|
273
|
+
<Button rounded size="small" icon={IconZap}/>
|
274
|
+
<Button rounded icon={IconZap}/>
|
275
|
+
<Button rounded size="large" icon={IconZap}/>
|
276
|
+
</View>
|
277
|
+
</Example.Item>
|
278
|
+
</Example>);
|
279
|
+
export const fullWidth = () => (<Example>
|
280
|
+
<Example.Item title="fullWidth, all variants">
|
281
|
+
<View gap={3}>
|
282
|
+
<Button fullWidth>Neutral</Button>
|
283
|
+
<Button fullWidth variant="faded">
|
284
|
+
Faded
|
285
|
+
</Button>
|
286
|
+
<Button fullWidth variant="outline">
|
287
|
+
Outline
|
288
|
+
</Button>
|
289
|
+
<Button fullWidth variant="ghost">
|
290
|
+
Ghost
|
291
|
+
</Button>
|
292
|
+
</View>
|
293
|
+
</Example.Item>
|
294
|
+
|
295
|
+
<Example.Item title={["responsive fullWidth", "[s] true", "[m+] false"]}>
|
296
|
+
<Button fullWidth={{ s: true, m: false }}>Button</Button>
|
297
|
+
</Example.Item>
|
298
|
+
</Example>);
|
299
|
+
export const loading = () => (<Example>
|
300
|
+
<Example.Item title="loading, color: neutral, all variants">
|
301
|
+
<View gap={3} direction="row">
|
302
|
+
<Button loading>Button</Button>
|
303
|
+
<Button loading variant="faded">
|
304
|
+
Button
|
305
|
+
</Button>
|
306
|
+
<Button loading variant="outline">
|
307
|
+
Button
|
308
|
+
</Button>
|
309
|
+
<Button loading variant="ghost">
|
310
|
+
Button
|
311
|
+
</Button>
|
312
|
+
</View>
|
313
|
+
</Example.Item>
|
314
|
+
<Example.Item title="loading, color critical, all variants">
|
315
|
+
<View gap={3} direction="row">
|
316
|
+
<Button loading color="critical">
|
317
|
+
Button
|
318
|
+
</Button>
|
319
|
+
<Button loading color="critical" variant="faded">
|
320
|
+
Button
|
321
|
+
</Button>
|
322
|
+
<Button loading color="critical" variant="outline">
|
323
|
+
Button
|
324
|
+
</Button>
|
325
|
+
<Button loading color="critical" variant="ghost">
|
326
|
+
Button
|
327
|
+
</Button>
|
328
|
+
</View>
|
329
|
+
</Example.Item>
|
330
|
+
<Example.Item title="loading, color positive, all variants">
|
331
|
+
<View gap={3} direction="row">
|
332
|
+
<Button loading color="positive">
|
333
|
+
Button
|
334
|
+
</Button>
|
335
|
+
<Button loading color="positive" variant="faded">
|
336
|
+
Button
|
337
|
+
</Button>
|
338
|
+
<Button loading color="positive" variant="outline">
|
339
|
+
Button
|
340
|
+
</Button>
|
341
|
+
<Button loading color="positive" variant="ghost">
|
342
|
+
Button
|
343
|
+
</Button>
|
344
|
+
</View>
|
345
|
+
</Example.Item>
|
346
|
+
|
347
|
+
<Example.Item title="loading, color: black and white">
|
348
|
+
<View aspectRatio={16 / 9}>
|
349
|
+
<Image src={imgUrl}/>
|
350
|
+
|
351
|
+
<div style={{ position: "absolute", top: 16, left: 16 }}>
|
352
|
+
<View gap={3} direction="row">
|
353
|
+
<Button color="black" loading>
|
354
|
+
Button
|
355
|
+
</Button>
|
356
|
+
<Button color="white" loading>
|
357
|
+
Button
|
358
|
+
</Button>
|
359
|
+
<Button color="white" variant="ghost" loading>
|
360
|
+
Button
|
361
|
+
</Button>
|
362
|
+
</View>
|
363
|
+
</div>
|
364
|
+
</View>
|
365
|
+
</Example.Item>
|
366
|
+
|
367
|
+
<Example.Item title={["loading, long button text", "button size should stay the same"]}>
|
368
|
+
<Button loading color="primary">
|
369
|
+
Long button text
|
370
|
+
</Button>
|
371
|
+
</Example.Item>
|
372
|
+
|
373
|
+
<Example.Item title={["loading, icon only", "button keep square 1/1 ratio"]}>
|
374
|
+
<Button icon={IconZap} rounded loading/>
|
375
|
+
</Example.Item>
|
376
|
+
</Example>);
|
377
|
+
export const highlighted = () => (<Example>
|
378
|
+
<Example.Item title="highlighted, color: neutral, all variants">
|
379
|
+
<View gap={3} direction="row">
|
380
|
+
<Button highlighted icon={IconZap}>
|
381
|
+
Button
|
382
|
+
</Button>
|
383
|
+
<Button highlighted variant="faded" icon={IconZap}>
|
384
|
+
Button
|
385
|
+
</Button>
|
386
|
+
<Button highlighted variant="outline" icon={IconZap}>
|
387
|
+
Button
|
388
|
+
</Button>
|
389
|
+
<Button highlighted variant="ghost" icon={IconZap}>
|
390
|
+
Button
|
391
|
+
</Button>
|
392
|
+
</View>
|
393
|
+
</Example.Item>
|
394
|
+
<Example.Item title="highlighted, color: critical, all variants">
|
395
|
+
<View gap={3} direction="row">
|
396
|
+
<Button highlighted color="critical" icon={IconZap}>
|
397
|
+
Button
|
398
|
+
</Button>
|
399
|
+
<Button highlighted color="critical" variant="faded" icon={IconZap}>
|
400
|
+
Button
|
401
|
+
</Button>
|
402
|
+
<Button highlighted color="critical" variant="outline" icon={IconZap}>
|
403
|
+
Button
|
404
|
+
</Button>
|
405
|
+
<Button highlighted color="critical" variant="ghost" icon={IconZap}>
|
406
|
+
Button
|
407
|
+
</Button>
|
408
|
+
</View>
|
409
|
+
</Example.Item>
|
410
|
+
<Example.Item title="highlighted, color: positive, all variants">
|
411
|
+
<View gap={3} direction="row">
|
412
|
+
<Button highlighted color="positive" icon={IconZap}>
|
413
|
+
Button
|
414
|
+
</Button>
|
415
|
+
<Button highlighted color="positive" variant="faded" icon={IconZap}>
|
416
|
+
Button
|
417
|
+
</Button>
|
418
|
+
<Button highlighted color="positive" variant="outline" icon={IconZap}>
|
419
|
+
Button
|
420
|
+
</Button>
|
421
|
+
<Button highlighted color="positive" variant="ghost" icon={IconZap}>
|
422
|
+
Button
|
423
|
+
</Button>
|
424
|
+
</View>
|
425
|
+
</Example.Item>
|
426
|
+
</Example>);
|
427
|
+
export const disabled = () => (<Example>
|
428
|
+
<Example.Item title="disabled, color: neutral, all variants">
|
429
|
+
<View gap={3} direction="row">
|
430
|
+
<Button disabled icon={IconZap}>
|
431
|
+
Button
|
432
|
+
</Button>
|
433
|
+
<Button disabled variant="faded" icon={IconZap}>
|
434
|
+
Button
|
435
|
+
</Button>
|
436
|
+
<Button disabled variant="outline" icon={IconZap}>
|
437
|
+
Button
|
438
|
+
</Button>
|
439
|
+
<Button disabled variant="ghost" icon={IconZap}>
|
440
|
+
Button
|
441
|
+
</Button>
|
442
|
+
</View>
|
443
|
+
</Example.Item>
|
444
|
+
<Example.Item title="disabled, color: critical, all variants">
|
445
|
+
<View gap={3} direction="row">
|
446
|
+
<Button disabled color="critical" icon={IconZap}>
|
447
|
+
Button
|
448
|
+
</Button>
|
449
|
+
<Button disabled color="critical" variant="faded" icon={IconZap}>
|
450
|
+
Button
|
451
|
+
</Button>
|
452
|
+
<Button disabled color="critical" variant="outline" icon={IconZap}>
|
453
|
+
Button
|
454
|
+
</Button>
|
455
|
+
<Button disabled color="critical" variant="ghost" icon={IconZap}>
|
456
|
+
Button
|
457
|
+
</Button>
|
458
|
+
</View>
|
459
|
+
</Example.Item>
|
460
|
+
<Example.Item title="disabled, color: positive, all variants">
|
461
|
+
<View gap={3} direction="row">
|
462
|
+
<Button disabled color="positive" icon={IconZap}>
|
463
|
+
Button
|
464
|
+
</Button>
|
465
|
+
<Button disabled color="positive" variant="faded" icon={IconZap}>
|
466
|
+
Button
|
467
|
+
</Button>
|
468
|
+
<Button disabled color="positive" variant="outline" icon={IconZap}>
|
469
|
+
Button
|
470
|
+
</Button>
|
471
|
+
<Button disabled color="positive" variant="ghost" icon={IconZap}>
|
472
|
+
Button
|
473
|
+
</Button>
|
474
|
+
</View>
|
475
|
+
</Example.Item>
|
476
|
+
|
477
|
+
<Example.Item title="disabled, color: black and white">
|
478
|
+
<View aspectRatio={16 / 9}>
|
479
|
+
<Image src={imgUrl}/>
|
480
|
+
|
481
|
+
<div style={{ position: "absolute", top: 16, left: 16 }}>
|
482
|
+
<View gap={3} direction="row">
|
483
|
+
<Button color="black" disabled>
|
484
|
+
Button
|
485
|
+
</Button>
|
486
|
+
<Button color="white" disabled>
|
487
|
+
Button
|
488
|
+
</Button>
|
489
|
+
<Button color="white" variant="ghost" disabled>
|
490
|
+
Button
|
491
|
+
</Button>
|
492
|
+
</View>
|
493
|
+
</div>
|
494
|
+
</View>
|
495
|
+
</Example.Item>
|
496
|
+
</Example>);
|
497
|
+
export const aligner = () => (<Example>
|
498
|
+
<Example.Item title="aligner: all">
|
499
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2}>
|
500
|
+
<View.Item grow>Content</View.Item>
|
501
|
+
<Button.Aligner>
|
502
|
+
<Button icon={IconZap} variant="ghost"/>
|
503
|
+
</Button.Aligner>
|
504
|
+
</View>
|
505
|
+
</Example.Item>
|
506
|
+
|
507
|
+
<Example.Item title="aligner: top">
|
508
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2}>
|
509
|
+
<View.Item grow>
|
510
|
+
<Placeholder />
|
511
|
+
</View.Item>
|
512
|
+
<Button.Aligner position="top">
|
513
|
+
<Button icon={IconZap} variant="ghost"/>
|
514
|
+
</Button.Aligner>
|
515
|
+
</View>
|
516
|
+
</Example.Item>
|
517
|
+
|
518
|
+
<Example.Item title="aligner: top and end">
|
519
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2}>
|
520
|
+
<View.Item grow>
|
521
|
+
<Placeholder />
|
522
|
+
</View.Item>
|
523
|
+
<Button.Aligner position={["top", "end"]}>
|
524
|
+
<Button icon={IconZap} variant="ghost"/>
|
525
|
+
</Button.Aligner>
|
526
|
+
</View>
|
527
|
+
</Example.Item>
|
528
|
+
|
529
|
+
<Example.Item title="aligner: bottom">
|
530
|
+
<View padding={4} borderColor="neutral-faded" direction="row" gap={2} align="end">
|
531
|
+
<View.Item grow>
|
532
|
+
<Placeholder />
|
533
|
+
</View.Item>
|
534
|
+
<Button.Aligner position="bottom">
|
535
|
+
<Button icon={IconZap} variant="ghost"/>
|
536
|
+
</Button.Aligner>
|
537
|
+
</View>
|
538
|
+
</Example.Item>
|
539
|
+
|
540
|
+
<Example.Item title="aligner: start">
|
541
|
+
<View padding={4} borderColor="neutral-faded" gap={2} align="start">
|
542
|
+
<View.Item grow>
|
543
|
+
<Placeholder />
|
544
|
+
</View.Item>
|
545
|
+
<Button.Aligner position="start">
|
546
|
+
<Button icon={IconZap} variant="ghost"/>
|
547
|
+
</Button.Aligner>
|
548
|
+
</View>
|
549
|
+
</Example.Item>
|
550
|
+
|
551
|
+
<Example.Item title="aligner: end">
|
552
|
+
<View padding={4} borderColor="neutral-faded" gap={2} align="end">
|
553
|
+
<View.Item grow>
|
554
|
+
<Placeholder />
|
555
|
+
</View.Item>
|
556
|
+
<Button.Aligner position="end">
|
557
|
+
<Button icon={IconZap} variant="ghost"/>
|
558
|
+
</Button.Aligner>
|
559
|
+
</View>
|
560
|
+
</Example.Item>
|
561
|
+
</Example>);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type * as T from "./Card.types";
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<{
|
4
|
+
padding?: import("../..").Responsive<number> | undefined;
|
5
|
+
bleed?: import("../..").Responsive<number> | undefined;
|
6
|
+
selected?: boolean | undefined;
|
7
|
+
elevated?: boolean | undefined;
|
8
|
+
children?: React.ReactNode;
|
9
|
+
onClick?: ((e: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLElement, MouseEvent>) => void) | undefined;
|
10
|
+
href?: string | undefined;
|
11
|
+
as?: keyof JSX.IntrinsicElements | undefined;
|
12
|
+
className?: import("../../types/global").ClassName;
|
13
|
+
attributes?: (import("../../types/global").Attributes<keyof JSX.IntrinsicElements, T.Props<"div">> & Omit<import("../../types/global").Attributes<"button", void>, "ref"> & Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, `data-${string}` | "form" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "nonce" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "color" | "suppressHydrationWarning" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "value" | "type" | keyof React.ClassAttributes<HTMLButtonElement> | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name"> & {
|
14
|
+
ref?: React.RefObject<HTMLAnchorElement | HTMLButtonElement> | undefined;
|
15
|
+
}) | undefined;
|
16
|
+
} & Pick<import("../View").ViewProps, "height"> & React.RefAttributes<HTMLElement>>;
|
17
|
+
export default _default;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { classNames } from "../../utilities/helpers.js";
|
3
|
+
import Actionable from "../Actionable/index.js";
|
4
|
+
import s from "./Card.module.css";
|
5
|
+
import getRadiusStyles from "../../styles/radius/index.js";
|
6
|
+
import getBleedStyles from "../../styles/bleed/index.js";
|
7
|
+
import getPaddingStyles from "../../styles/padding/index.js";
|
8
|
+
import getHeightStyles from "../../styles/height/index.js";
|
9
|
+
const Card = (props, ref) => {
|
10
|
+
const { padding = 4 } = props;
|
11
|
+
const { selected, elevated, bleed, height, onClick, href, children, className, attributes,
|
12
|
+
/**
|
13
|
+
* Using any here to let TS save on type resolving, otherwise TS throws an error due to the type complexity
|
14
|
+
* It still resolves the attributes correctly based on the tag
|
15
|
+
*/
|
16
|
+
as: TagName = "div", } = props;
|
17
|
+
const isActionable = !!href || !!onClick;
|
18
|
+
const radiusStyles = getRadiusStyles("medium");
|
19
|
+
const bleedStyles = getBleedStyles(bleed);
|
20
|
+
const paddingStyles = getPaddingStyles(padding);
|
21
|
+
const heightStyles = getHeightStyles(height);
|
22
|
+
const rootClassNames = classNames(s.root, radiusStyles === null || radiusStyles === void 0 ? void 0 : radiusStyles.classNames, bleedStyles === null || bleedStyles === void 0 ? void 0 : bleedStyles.classNames, paddingStyles === null || paddingStyles === void 0 ? void 0 : paddingStyles.classNames, heightStyles === null || heightStyles === void 0 ? void 0 : heightStyles.classNames, isActionable && s["--actionable"], elevated && s["--elevated"], selected && s["--selected"], className);
|
23
|
+
const style = Object.assign(Object.assign(Object.assign(Object.assign({}, attributes === null || attributes === void 0 ? void 0 : attributes.style), bleedStyles === null || bleedStyles === void 0 ? void 0 : bleedStyles.variables), paddingStyles === null || paddingStyles === void 0 ? void 0 : paddingStyles.variables), heightStyles === null || heightStyles === void 0 ? void 0 : heightStyles.variables);
|
24
|
+
if (isActionable) {
|
25
|
+
return (React.createElement(Actionable, { className: rootClassNames, attributes: Object.assign(Object.assign({}, attributes), { style }), href: href, as: TagName, onClick: onClick, ref: ref },
|
26
|
+
React.createElement("span", { className: s.content }, children)));
|
27
|
+
}
|
28
|
+
return (React.createElement(TagName, Object.assign({}, attributes, { onClick: onClick, href: href, ref: ref, className: rootClassNames, style: style }),
|
29
|
+
React.createElement("span", { className: s.content }, children)));
|
30
|
+
};
|
31
|
+
export default React.forwardRef(Card);
|
@@ -0,0 +1 @@
|
|
1
|
+
.root{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral-faded);color:var(--rs-color-foreground-neutral);display:block;overflow:hidden;text-align:initial}.content,.root{position:relative}.content{z-index:var(--rs-z-index-raised)}.--selected{border-color:transparent;box-shadow:0 0 0 2px var(--rs-color-border-primary)}.--elevated{background:var(--rs-color-background-elevation-raised);box-shadow:var(--rs-shadow-raised)}.--actionable:not(.--selected){color:inherit;cursor:pointer;outline:none;text-decoration:none}[data-rs-keyboard] .--actionable:not(.--selected):focus{box-shadow:var(--rs-focus-shadow)}.--actionable:not(.--selected):before{background:rgba(var(--rs-color-rgb-background-neutral-faded),40%);content:"";inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity var(--rs-duration-fast) var(--rs-easing-standard)}.--actionable:not(.--selected):hover:before{opacity:1}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type { ActionableProps } from "../Actionable";
|
3
|
+
import type { ViewProps } from "../View";
|
4
|
+
import type * as G from "../../types/global";
|
5
|
+
export type Props<TagName extends keyof JSX.IntrinsicElements = "div"> = {
|
6
|
+
padding?: G.Responsive<number>;
|
7
|
+
bleed?: G.Responsive<number>;
|
8
|
+
selected?: boolean;
|
9
|
+
elevated?: boolean;
|
10
|
+
children?: React.ReactNode;
|
11
|
+
onClick?: ActionableProps["onClick"];
|
12
|
+
href?: string;
|
13
|
+
as?: TagName;
|
14
|
+
className?: G.ClassName;
|
15
|
+
attributes?: G.Attributes<TagName, Props> & ActionableProps["attributes"];
|
16
|
+
} & Pick<ViewProps, "height">;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./Card.js";
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from "react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
};
|
5
|
+
export default _default;
|
6
|
+
export declare const padding: () => React.JSX.Element;
|
7
|
+
export declare const actionable: () => React.JSX.Element;
|
8
|
+
export declare const selected: () => React.JSX.Element;
|
9
|
+
export declare const elevated: () => React.JSX.Element;
|
10
|
+
export declare const bleed: () => React.JSX.Element;
|
11
|
+
export declare const height: () => React.JSX.Element;
|
12
|
+
export declare const testComposition: () => React.JSX.Element;
|