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,10 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { classNames } from "../../utilities/helpers.js";
|
3
|
+
import View from "../View/index.js";
|
4
|
+
import s from "./ActionBar.module.css";
|
5
|
+
const ActionBar = (props) => {
|
6
|
+
const { position = "bottom", padding, paddingBlock = 3, paddingInline = 4, children, elevated, className, attributes, } = props;
|
7
|
+
const rootClassNames = classNames(s.root, elevated && s["--elevated"], position && s[`--position-${position}`], className);
|
8
|
+
return (React.createElement(View, { className: rootClassNames, attributes: attributes, paddingBlock: padding || paddingBlock, paddingInline: padding || paddingInline }, children));
|
9
|
+
};
|
10
|
+
export default ActionBar;
|
@@ -0,0 +1 @@
|
|
1
|
+
.root{background:var(--rs-color-background-elevation-base);position:relative}.--position-bottom{border-top:1px solid var(--rs-color-border-neutral-faded)}.--position-top{border-bottom:1px solid var(--rs-color-border-neutral-faded)}.--elevated{background-color:var(--rs-color-background-elevation-raised);border:none;overflow-x:clip}.--elevated:after{bottom:0;box-shadow:var(--rs-shadow-raised);content:"";display:block;height:100%;left:0;position:absolute;right:0}.--position-bottom.--elevated:after{transform:rotateX(180deg)}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type { ViewProps } from "../View";
|
3
|
+
import type * as G from "../../types/global";
|
4
|
+
export type Props = Pick<ViewProps, "paddingBlock" | "paddingInline" | "padding"> & {
|
5
|
+
position?: "top" | "bottom";
|
6
|
+
elevated?: boolean;
|
7
|
+
children?: React.ReactNode;
|
8
|
+
className?: G.ClassName;
|
9
|
+
attributes?: G.Attributes<"div", Props>;
|
10
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./ActionBar.js";
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from "react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
};
|
5
|
+
export default _default;
|
6
|
+
export declare const position: () => React.JSX.Element;
|
7
|
+
export declare const elevated: () => React.JSX.Element;
|
8
|
+
export declare const padding: () => React.JSX.Element;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Placeholder, Example } from "../../../utilities/storybook/index.js";
|
3
|
+
import ActionBar from "../index.js";
|
4
|
+
export default { title: "Components/ActionBar" };
|
5
|
+
export const position = () => (<Example>
|
6
|
+
<Example.Item title="position: top">
|
7
|
+
<ActionBar position="top">
|
8
|
+
<Placeholder />
|
9
|
+
</ActionBar>
|
10
|
+
</Example.Item>
|
11
|
+
|
12
|
+
<Example.Item title="position: bottom">
|
13
|
+
<ActionBar>
|
14
|
+
<Placeholder />
|
15
|
+
</ActionBar>
|
16
|
+
</Example.Item>
|
17
|
+
</Example>);
|
18
|
+
export const elevated = () => (<Example>
|
19
|
+
<Example.Item title="elevated, position: top">
|
20
|
+
<ActionBar position="top" elevated>
|
21
|
+
<Placeholder />
|
22
|
+
</ActionBar>
|
23
|
+
</Example.Item>
|
24
|
+
|
25
|
+
<Example.Item title="elevated, position: bottom">
|
26
|
+
<ActionBar elevated>
|
27
|
+
<Placeholder h={16}/>
|
28
|
+
</ActionBar>
|
29
|
+
</Example.Item>
|
30
|
+
</Example>);
|
31
|
+
export const padding = () => (<Example>
|
32
|
+
<Example.Item title="padding: 6">
|
33
|
+
<ActionBar padding={6}>
|
34
|
+
<Placeholder />
|
35
|
+
</ActionBar>
|
36
|
+
</Example.Item>
|
37
|
+
|
38
|
+
<Example.Item title={["padding: responsive", "[s] 4", "[m+] 6"]}>
|
39
|
+
<ActionBar padding={{ s: 4, m: 6 }}>
|
40
|
+
<Placeholder />
|
41
|
+
</ActionBar>
|
42
|
+
</Example.Item>
|
43
|
+
</Example>);
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use client";
|
2
|
+
import React from "react";
|
3
|
+
import { classNames } from "../../utilities/helpers.js";
|
4
|
+
import s from "./Actionable.module.css";
|
5
|
+
const Actionable = (props, ref) => {
|
6
|
+
const { children, href, onClick, type, disabled, insetFocus, borderRadius, as, fullWidth, className, attributes, } = props;
|
7
|
+
const rootClassNames = classNames(s.root, className, disabled && s["--disabled"], borderRadius && s[`--radius-${borderRadius}`], insetFocus && s["--inset"], fullWidth && s["--full-width"]);
|
8
|
+
const rootAttributes = Object.assign({}, attributes);
|
9
|
+
const hasClickHandler = onClick || (attributes === null || attributes === void 0 ? void 0 : attributes.onClick);
|
10
|
+
const hasFocusHandler = (attributes === null || attributes === void 0 ? void 0 : attributes.onFocus) || (attributes === null || attributes === void 0 ? void 0 : attributes.onBlur);
|
11
|
+
const isLink = Boolean(href || (attributes === null || attributes === void 0 ? void 0 : attributes.href));
|
12
|
+
const isButton = Boolean(hasClickHandler || hasFocusHandler || type);
|
13
|
+
let TagName;
|
14
|
+
if (isLink) {
|
15
|
+
rootAttributes.href = disabled ? undefined : href || (attributes === null || attributes === void 0 ? void 0 : attributes.href);
|
16
|
+
TagName = "a";
|
17
|
+
}
|
18
|
+
else if (isButton && (!as || as === "button")) {
|
19
|
+
TagName = "button";
|
20
|
+
rootAttributes.type = type || (attributes === null || attributes === void 0 ? void 0 : attributes.type) || "button";
|
21
|
+
rootAttributes.disabled = disabled || (attributes === null || attributes === void 0 ? void 0 : attributes.disabled);
|
22
|
+
}
|
23
|
+
else if (isButton) {
|
24
|
+
const isFocusable = as === "label";
|
25
|
+
const simulateButton = !isFocusable || hasClickHandler || hasFocusHandler;
|
26
|
+
TagName = as || "span";
|
27
|
+
rootAttributes.role = simulateButton ? "button" : undefined;
|
28
|
+
rootAttributes.tabIndex = simulateButton ? 0 : undefined;
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
TagName = as || "span";
|
32
|
+
}
|
33
|
+
const handlePress = (event) => {
|
34
|
+
var _a;
|
35
|
+
if (disabled)
|
36
|
+
return;
|
37
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
38
|
+
(_a = attributes === null || attributes === void 0 ? void 0 : attributes.onClick) === null || _a === void 0 ? void 0 : _a.call(attributes, event);
|
39
|
+
};
|
40
|
+
const handleClick = (event) => handlePress(event);
|
41
|
+
const handleKeyDown = (event) => {
|
42
|
+
const simulatingButton = rootAttributes.role === "button";
|
43
|
+
if (!simulatingButton || isLink)
|
44
|
+
return;
|
45
|
+
const isSpace = event.key === " ";
|
46
|
+
const isEnter = event.key === "Enter";
|
47
|
+
if (!isSpace && !isEnter)
|
48
|
+
return;
|
49
|
+
event.preventDefault();
|
50
|
+
handlePress(event);
|
51
|
+
};
|
52
|
+
return (React.createElement(TagName, Object.assign({ ref: ref }, rootAttributes, { className: rootClassNames, onClick: handleClick, onKeyDown: handleKeyDown }), children));
|
53
|
+
};
|
54
|
+
export default React.forwardRef(Actionable);
|
@@ -0,0 +1 @@
|
|
1
|
+
.root{-webkit-tap-highlight-color:none;background:none;border:0;color:inherit;display:inline-block;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-align:initial;text-decoration:none;vertical-align:top}.root:focus{outline:none;z-index:var(--rs-z-index-raised)}[role=button].root,button.root{cursor:pointer}.root.--disabled,.root[disabled]{cursor:not-allowed}.root.--disabled:active,.root[disabled]:active{transform:none}.--full-width{width:100%}[data-rs-keyboard] .root:focus{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--inset:focus{box-shadow:var(--rs-focus-inset-shadow)}[data-rs-keyboard] .root.--radius-inherit:focus{box-shadow:none}[data-rs-keyboard] .root.--radius-inherit:focus>*{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--radius-inherit.--inset:focus>*{box-shadow:var(--rs-focus-inset-shadow)}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import type React from "react";
|
2
|
+
import type * as G from "../../types/global";
|
3
|
+
export type Props = {
|
4
|
+
children?: React.ReactNode;
|
5
|
+
onClick?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
|
6
|
+
href?: string;
|
7
|
+
type?: React.ButtonHTMLAttributes<HTMLButtonElement>["type"];
|
8
|
+
disabled?: boolean;
|
9
|
+
fullWidth?: boolean;
|
10
|
+
insetFocus?: boolean;
|
11
|
+
borderRadius?: "inherit";
|
12
|
+
as?: keyof JSX.IntrinsicElements;
|
13
|
+
className?: G.ClassName;
|
14
|
+
attributes?: Omit<G.Attributes<"button">, "ref"> & Omit<JSX.IntrinsicElements["a"], keyof G.Attributes<"button">> & {
|
15
|
+
ref?: React.RefObject<HTMLButtonElement | HTMLAnchorElement>;
|
16
|
+
};
|
17
|
+
};
|
18
|
+
export type Ref = React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./Actionable.js";
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from "react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
};
|
5
|
+
export default _default;
|
6
|
+
export declare const role: () => React.JSX.Element;
|
7
|
+
export declare const disabled: () => React.JSX.Element;
|
8
|
+
export declare const fullWidth: () => React.JSX.Element;
|
9
|
+
export declare const focusRing: () => React.JSX.Element;
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Example } from "../../../utilities/storybook/index.js";
|
3
|
+
import Actionable from "../index.js";
|
4
|
+
import View from "../../View/index.js";
|
5
|
+
export default { title: "Utilities/Actionable" };
|
6
|
+
export const role = () => (<Example>
|
7
|
+
<Example.Item title="rendered as link">
|
8
|
+
<Actionable href="https://reshaped.so" attributes={{ target: "_blank" }}>
|
9
|
+
Actionable
|
10
|
+
</Actionable>
|
11
|
+
</Example.Item>
|
12
|
+
<Example.Item title="rendered as button">
|
13
|
+
<Actionable onClick={() => console.log("Clicked")}>Actionable</Actionable>
|
14
|
+
</Example.Item>
|
15
|
+
<Example.Item title="rendered as div with button role">
|
16
|
+
<Actionable as="div" onClick={() => console.log("Clicked")}>
|
17
|
+
Actionable
|
18
|
+
</Actionable>
|
19
|
+
</Example.Item>
|
20
|
+
<Example.Item title="rendered as link with onClick">
|
21
|
+
<Actionable onClick={() => console.log("Clicked")} href="https://reshaped.so">
|
22
|
+
Actionable
|
23
|
+
</Actionable>
|
24
|
+
</Example.Item>
|
25
|
+
</Example>);
|
26
|
+
export const disabled = () => (<Example>
|
27
|
+
<Example.Item title="disabled, button">
|
28
|
+
<Actionable disabled onClick={() => { }}>
|
29
|
+
Actionable
|
30
|
+
</Actionable>
|
31
|
+
</Example.Item>
|
32
|
+
<Example.Item title="disabled, link">
|
33
|
+
<Actionable disabled href="https://reshaped.so">
|
34
|
+
Actionable
|
35
|
+
</Actionable>
|
36
|
+
</Example.Item>
|
37
|
+
</Example>);
|
38
|
+
export const fullWidth = () => (<Example>
|
39
|
+
<Example.Item title="fullWidth">
|
40
|
+
<Actionable fullWidth href="https://reshaped.so">
|
41
|
+
Actionable
|
42
|
+
</Actionable>
|
43
|
+
</Example.Item>
|
44
|
+
</Example>);
|
45
|
+
export const focusRing = () => (<Example>
|
46
|
+
<Example.Item title="insetFocus">
|
47
|
+
<Actionable insetFocus onClick={() => { }}>
|
48
|
+
Actionable
|
49
|
+
</Actionable>
|
50
|
+
</Example.Item>
|
51
|
+
<Example.Item title="radius: inherit">
|
52
|
+
<Actionable borderRadius="inherit" onClick={() => { }}>
|
53
|
+
<View borderRadius="large">Actionable</View>
|
54
|
+
</Actionable>
|
55
|
+
</Example.Item>
|
56
|
+
</Example>);
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import Icon from "../Icon/index.js";
|
3
|
+
import View from "../View/index.js";
|
4
|
+
import Text from "../Text/index.js";
|
5
|
+
const Alert = (props) => {
|
6
|
+
const { title, children, icon, actionsSlot, color = "neutral", inline, bleed, className, attributes, } = props;
|
7
|
+
const isNeutral = color === "neutral";
|
8
|
+
const renderContent = () => {
|
9
|
+
if (inline) {
|
10
|
+
return (React.createElement(React.Fragment, null,
|
11
|
+
title && (React.createElement(Text, { variant: "body-3", weight: "medium", as: "span" }, title)),
|
12
|
+
title && children && " ",
|
13
|
+
children && (React.createElement(Text, { variant: "body-3", as: "span" }, children))));
|
14
|
+
}
|
15
|
+
return (React.createElement(View, { gap: 1 },
|
16
|
+
title && (React.createElement(Text, { variant: "body-3", weight: "medium" }, title)),
|
17
|
+
children && React.createElement(Text, { variant: "body-3" }, children)));
|
18
|
+
};
|
19
|
+
const applyActions = (content) => {
|
20
|
+
if (!actionsSlot)
|
21
|
+
return content;
|
22
|
+
return (React.createElement(View, { gap: 2, direction: inline ? "row" : "column" },
|
23
|
+
inline ? React.createElement(View.Item, { grow: true }, content) : content,
|
24
|
+
actionsSlot && (React.createElement(Text, { variant: "body-3", weight: "medium" },
|
25
|
+
React.createElement(View, { direction: "row", gap: 3 }, actionsSlot)))));
|
26
|
+
};
|
27
|
+
return (React.createElement(View, { direction: "row", gap: 3, padding: 4, bleed: bleed, borderRadius: "medium", borderColor: `${color}-faded`, backgroundColor: `${color}-faded`, className: className, attributes: Object.assign(Object.assign({}, attributes), { role: color === "critical" ? "alert" : "status" }) }, icon ? (React.createElement(React.Fragment, null,
|
28
|
+
React.createElement(Icon, { svg: icon, size: 5, color: isNeutral ? "primary" : color }),
|
29
|
+
React.createElement(View.Item, { grow: true }, applyActions(renderContent())))) : (applyActions(renderContent()))));
|
30
|
+
};
|
31
|
+
export default Alert;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import type { IconProps } from "../Icon";
|
3
|
+
import type * as G from "../../types/global";
|
4
|
+
export type Props = {
|
5
|
+
icon?: IconProps["svg"];
|
6
|
+
title?: React.ReactNode;
|
7
|
+
children?: React.ReactNode;
|
8
|
+
actionsSlot?: React.ReactNode;
|
9
|
+
color?: "neutral" | "critical" | "positive" | "primary";
|
10
|
+
inline?: boolean;
|
11
|
+
bleed?: G.Responsive<number>;
|
12
|
+
className?: G.ClassName;
|
13
|
+
attributes?: G.Attributes<"div", Props>;
|
14
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./Alert.js";
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from "react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
};
|
5
|
+
export default _default;
|
6
|
+
export declare const color: () => React.JSX.Element;
|
7
|
+
export declare const inline: () => React.JSX.Element;
|
8
|
+
export declare const bleed: () => React.JSX.Element;
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Example } from "../../../utilities/storybook/index.js";
|
3
|
+
import Alert from "../index.js";
|
4
|
+
import Link from "../../Link/index.js";
|
5
|
+
import IconZap from "../../../icons/Zap.js";
|
6
|
+
export default { title: "Components/Alert" };
|
7
|
+
export const color = () => (<Example>
|
8
|
+
<Example.Item title="color: neutral">
|
9
|
+
<Alert title="Alert title goes here" icon={IconZap} actionsSlot={<>
|
10
|
+
<Link variant="plain">View now</Link>
|
11
|
+
<Link variant="plain">Dismiss</Link>
|
12
|
+
</>}>
|
13
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
14
|
+
been the industry's standard
|
15
|
+
</Alert>
|
16
|
+
</Example.Item>
|
17
|
+
|
18
|
+
<Example.Item title="color: primary">
|
19
|
+
<Alert color="primary" title="Alert title goes here" icon={IconZap} actionsSlot={<>
|
20
|
+
<Link variant="plain">View now</Link>
|
21
|
+
<Link variant="plain">Dismiss</Link>
|
22
|
+
</>}>
|
23
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
24
|
+
been the industry's standard
|
25
|
+
</Alert>
|
26
|
+
</Example.Item>
|
27
|
+
|
28
|
+
<Example.Item title="color: critical">
|
29
|
+
<Alert color="critical" title="Alert title goes here" icon={IconZap} actionsSlot={<>
|
30
|
+
<Link variant="plain" color="critical">
|
31
|
+
View now
|
32
|
+
</Link>
|
33
|
+
<Link variant="plain" color="critical">
|
34
|
+
Dismiss
|
35
|
+
</Link>
|
36
|
+
</>}>
|
37
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
38
|
+
been the industry's standard
|
39
|
+
</Alert>
|
40
|
+
</Example.Item>
|
41
|
+
|
42
|
+
<Example.Item title="color: positive">
|
43
|
+
<Alert color="positive" title="Alert title goes here" icon={IconZap} actionsSlot={<>
|
44
|
+
<Link variant="plain" color="positive">
|
45
|
+
View now
|
46
|
+
</Link>
|
47
|
+
<Link variant="plain" color="positive">
|
48
|
+
Dismiss
|
49
|
+
</Link>
|
50
|
+
</>}>
|
51
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
52
|
+
been the industry's standard
|
53
|
+
</Alert>
|
54
|
+
</Example.Item>
|
55
|
+
</Example>);
|
56
|
+
export const inline = () => (<Example>
|
57
|
+
<Example.Item title="inline: true">
|
58
|
+
<Alert inline title="Alert title goes here" icon={IconZap} actionsSlot={<>
|
59
|
+
<Link variant="plain">View now</Link>
|
60
|
+
<Link variant="plain">Dismiss</Link>
|
61
|
+
</>}>
|
62
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
63
|
+
been the industry's standard
|
64
|
+
</Alert>
|
65
|
+
</Example.Item>
|
66
|
+
</Example>);
|
67
|
+
export const bleed = () => (<Example>
|
68
|
+
<Example.Item title="bleed: 4">
|
69
|
+
<Alert bleed={4} icon={IconZap}>
|
70
|
+
Content
|
71
|
+
</Alert>
|
72
|
+
</Example.Item>
|
73
|
+
<Example.Item title={["responsive bleed", "[s] 4", "[m+] 0"]}>
|
74
|
+
<Alert bleed={{ s: 4, m: 0 }} icon={IconZap}>
|
75
|
+
Content
|
76
|
+
</Alert>
|
77
|
+
</Example.Item>
|
78
|
+
</Example>);
|
@@ -0,0 +1,69 @@
|
|
1
|
+
"use client";
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
3
|
+
var t = {};
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
5
|
+
t[p] = s[p];
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
9
|
+
t[p[i]] = s[p[i]];
|
10
|
+
}
|
11
|
+
return t;
|
12
|
+
};
|
13
|
+
import React from "react";
|
14
|
+
import TextField from "../TextField/index.js";
|
15
|
+
import DropdownMenu from "../DropdownMenu/index.js";
|
16
|
+
const AutocompleteContext = React.createContext({});
|
17
|
+
const Autocomplete = (props) => {
|
18
|
+
const { children, onChange, onItemSelect, name } = props, textFieldProps = __rest(props, ["children", "onChange", "onItemSelect", "name"]);
|
19
|
+
const [active, setActive] = React.useState(false);
|
20
|
+
// Prevent dropdown from opening on selecting an item
|
21
|
+
const [locked, setLocked] = React.useState(false);
|
22
|
+
const hasChildren = !!React.Children.toArray(children).filter(Boolean).length;
|
23
|
+
const handleOpen = () => setActive(true);
|
24
|
+
const handleClose = () => setActive(false);
|
25
|
+
const handleChange = (args) => {
|
26
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(args);
|
27
|
+
setLocked(false);
|
28
|
+
handleOpen();
|
29
|
+
};
|
30
|
+
const handleItemClick = (args) => {
|
31
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({ value: args.value, name });
|
32
|
+
onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect({ value: args.value });
|
33
|
+
setLocked(true);
|
34
|
+
};
|
35
|
+
const handleFocus = (e) => {
|
36
|
+
var _a;
|
37
|
+
requestAnimationFrame(() => {
|
38
|
+
if (!locked)
|
39
|
+
return;
|
40
|
+
setActive(false);
|
41
|
+
setLocked(false);
|
42
|
+
});
|
43
|
+
(_a = textFieldProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
|
44
|
+
};
|
45
|
+
return (React.createElement(AutocompleteContext.Provider, { value: { onItemClick: handleItemClick } },
|
46
|
+
React.createElement(DropdownMenu, { position: "bottom", width: "trigger", triggerType: "focus", trapFocusMode: "selection-menu", active: !locked && hasChildren && active, onClose: handleClose, onOpen: handleOpen, disableHideAnimation: true },
|
47
|
+
React.createElement(DropdownMenu.Trigger, null, (_a) => {
|
48
|
+
var { ref } = _a, attributes = __rest(_a, ["ref"]);
|
49
|
+
return (React.createElement(TextField, Object.assign({}, textFieldProps, { name: name, onChange: handleChange,
|
50
|
+
// Ignoring the type check since TS can't infer the correct html element type
|
51
|
+
attributes: Object.assign(Object.assign({}, textFieldProps.attributes), { ref }), inputAttributes: Object.assign(Object.assign({}, attributes), { onFocus: (e) => {
|
52
|
+
var _a;
|
53
|
+
(_a = attributes.onFocus) === null || _a === void 0 ? void 0 : _a.call(attributes);
|
54
|
+
handleFocus(e);
|
55
|
+
}, role: "combobox" }) })));
|
56
|
+
}),
|
57
|
+
React.createElement(DropdownMenu.Content, null, children))));
|
58
|
+
};
|
59
|
+
const AutocompleteItem = (props) => {
|
60
|
+
const { value, onClick } = props, menuItemProps = __rest(props, ["value", "onClick"]);
|
61
|
+
const { onItemClick } = React.useContext(AutocompleteContext);
|
62
|
+
const hanleClick = (e) => {
|
63
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
64
|
+
onItemClick({ value });
|
65
|
+
};
|
66
|
+
return (React.createElement(DropdownMenu.Item, Object.assign({}, menuItemProps, { attributes: Object.assign(Object.assign({}, menuItemProps.attributes), { role: "option" }), onClick: hanleClick })));
|
67
|
+
};
|
68
|
+
Autocomplete.Item = AutocompleteItem;
|
69
|
+
export default Autocomplete;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { TextFieldProps } from "../TextField";
|
3
|
+
import type { MenuItemProps } from "../MenuItem";
|
4
|
+
export type Props = TextFieldProps & {
|
5
|
+
onItemSelect?: (args: {
|
6
|
+
value: string;
|
7
|
+
}) => void;
|
8
|
+
children: React.ReactNode;
|
9
|
+
};
|
10
|
+
export type ItemProps = MenuItemProps & {
|
11
|
+
value: string;
|
12
|
+
};
|
13
|
+
export type Context = {
|
14
|
+
onItemClick: (args: {
|
15
|
+
value: string;
|
16
|
+
}) => void;
|
17
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./Autocomplete.js";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Example } from "../../../utilities/storybook/index.js";
|
3
|
+
import Autocomplete from "../index.js";
|
4
|
+
export default { title: "Components/Autocomplete" };
|
5
|
+
const Demo = () => {
|
6
|
+
const [value, setValue] = React.useState("");
|
7
|
+
return (<Autocomplete name="fruit" value={value} placeholder="Pick your food" onChange={({ value }) => setValue(value)}>
|
8
|
+
{["Pizza", "Pie", "Ice-cream"].map((v) => {
|
9
|
+
if (!v.toLowerCase().includes(value.toLowerCase()))
|
10
|
+
return;
|
11
|
+
return (<Autocomplete.Item key={v} value={v}>
|
12
|
+
{v}
|
13
|
+
</Autocomplete.Item>);
|
14
|
+
})}
|
15
|
+
</Autocomplete>);
|
16
|
+
};
|
17
|
+
export const base = () => (<Example>
|
18
|
+
<Example.Item title="Default">
|
19
|
+
<Demo />
|
20
|
+
</Example.Item>
|
21
|
+
</Example>);
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { classNames, responsivePropDependency } from "../../utilities/helpers.js";
|
3
|
+
import getHeightStyles from "../../styles/height/index.js";
|
4
|
+
import Icon from "../Icon/index.js";
|
5
|
+
import View from "../View/index.js";
|
6
|
+
import s from "./Avatar.module.css";
|
7
|
+
const Avatar = (props) => {
|
8
|
+
const { color = "neutral", variant, src, size = 12, squared, initials, icon, alt, className, attributes, } = props;
|
9
|
+
const radius = squared
|
10
|
+
? responsivePropDependency(size, (size) => {
|
11
|
+
if (size >= 24)
|
12
|
+
return "large";
|
13
|
+
if (size >= 12)
|
14
|
+
return "medium";
|
15
|
+
return "small";
|
16
|
+
})
|
17
|
+
: "circular";
|
18
|
+
const heightStyles = getHeightStyles(size);
|
19
|
+
const rootClassNames = classNames(s.root, className, heightStyles === null || heightStyles === void 0 ? void 0 : heightStyles.classNames, color && s[`--color-${color}`], variant && s[`--variant-${variant}`]);
|
20
|
+
const renderContent = () => {
|
21
|
+
if (src)
|
22
|
+
return (React.createElement("img", { role: !initials ? "presentation" : undefined, src: src, alt: alt, className: s.img }));
|
23
|
+
if (icon)
|
24
|
+
return (React.createElement(Icon, { svg: icon, size: responsivePropDependency(size, (size) => Math.ceil(size * 0.4)) }));
|
25
|
+
return initials;
|
26
|
+
};
|
27
|
+
return (React.createElement(View, { borderRadius: radius, attributes: Object.assign(Object.assign({}, attributes), { style: Object.assign({}, heightStyles === null || heightStyles === void 0 ? void 0 : heightStyles.variables) }), backgroundColor: variant === "faded" ? `${color}-${variant}` : color, className: rootClassNames }, renderContent()));
|
28
|
+
};
|
29
|
+
export default Avatar;
|
@@ -0,0 +1 @@
|
|
1
|
+
.root{align-items:center;aspect-ratio:1;display:flex;font-size:calc(var(--rs-h) / 3);font-weight:700;justify-content:center;line-height:100%}.img{border-radius:inherit;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.--variant-faded.--color-neutral{color:var(--rs-color-foreground-neutral)}.--variant-faded.--color-critical{color:var(--rs-color-foreground-critical)}.--variant-faded.--color-positive{color:var(--rs-color-foreground-positive)}.--variant-faded.--color-primary{color:var(--rs-color-foreground-primary)}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import type { IconProps } from "../Icon";
|
2
|
+
import type * as G from "../../types/global";
|
3
|
+
type WithImage = {
|
4
|
+
src: string;
|
5
|
+
initials?: string;
|
6
|
+
icon?: IconProps["svg"];
|
7
|
+
alt?: string;
|
8
|
+
};
|
9
|
+
type WithInitials = {
|
10
|
+
src?: never;
|
11
|
+
initials: string;
|
12
|
+
icon?: never;
|
13
|
+
alt?: never;
|
14
|
+
};
|
15
|
+
type WithIcon = {
|
16
|
+
src?: never;
|
17
|
+
initials?: never;
|
18
|
+
icon: IconProps["svg"];
|
19
|
+
alt?: never;
|
20
|
+
};
|
21
|
+
type WithContent = WithImage | WithInitials | WithIcon;
|
22
|
+
export type Props = WithContent & {
|
23
|
+
squared?: boolean;
|
24
|
+
variant?: "solid" | "faded";
|
25
|
+
color?: "neutral" | "critical" | "positive" | "primary";
|
26
|
+
size?: G.Responsive<number>;
|
27
|
+
className?: G.ClassName;
|
28
|
+
attributes?: G.Attributes<"div", Props>;
|
29
|
+
};
|
30
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "./Avatar.js";
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from "react";
|
2
|
+
declare const _default: {
|
3
|
+
title: string;
|
4
|
+
};
|
5
|
+
export default _default;
|
6
|
+
export declare const content: () => React.JSX.Element;
|
7
|
+
export declare const size: () => React.JSX.Element;
|
8
|
+
export declare const squared: () => React.JSX.Element;
|
9
|
+
export declare const colors: () => React.JSX.Element;
|