@a-type/ui 2.8.13 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/colorMode.js +2 -3
- package/dist/cjs/colorMode.js.map +1 -1
- package/dist/cjs/colors.stories.js +3 -3
- package/dist/cjs/colors.stories.js.map +1 -1
- package/dist/cjs/components/actions/ActionBar.js +1 -1
- package/dist/cjs/components/actions/ActionBar.stories.js +2 -2
- package/dist/cjs/components/actions/ActionBar.stories.js.map +1 -1
- package/dist/cjs/components/box/Box.d.ts +5 -2
- package/dist/cjs/components/box/Box.js +12 -10
- package/dist/cjs/components/box/Box.js.map +1 -1
- package/dist/cjs/components/box/Box.stories.d.ts +3 -8
- package/dist/cjs/components/box/Box.stories.js +25 -10
- package/dist/cjs/components/box/Box.stories.js.map +1 -1
- package/dist/cjs/components/button/Button.d.ts +5 -6
- package/dist/cjs/components/button/Button.js +25 -37
- package/dist/cjs/components/button/Button.js.map +1 -1
- package/dist/cjs/components/button/Button.stories.d.ts +8 -2
- package/dist/cjs/components/button/Button.stories.js +18 -6
- package/dist/cjs/components/button/Button.stories.js.map +1 -1
- package/dist/cjs/components/button/classes.d.ts +4 -13
- package/dist/cjs/components/button/classes.js +21 -40
- package/dist/cjs/components/button/classes.js.map +1 -1
- package/dist/cjs/components/camera/Camera.js +4 -4
- package/dist/cjs/components/camera/Camera.js.map +1 -1
- package/dist/cjs/components/card/Card.js +6 -6
- package/dist/cjs/components/card/Card.js.map +1 -1
- package/dist/cjs/components/card/Card.stories.js +7 -7
- package/dist/cjs/components/card/Card.stories.js.map +1 -1
- package/dist/cjs/components/checkbox/Checkbox.js +3 -3
- package/dist/cjs/components/checkbox/Checkbox.js.map +1 -1
- package/dist/cjs/components/chip/Chip.d.ts +3 -2
- package/dist/cjs/components/chip/Chip.js +2 -5
- package/dist/cjs/components/chip/Chip.js.map +1 -1
- package/dist/cjs/components/chip/Chip.stories.d.ts +20 -0
- package/dist/cjs/components/chip/Chip.stories.js +36 -0
- package/dist/cjs/components/chip/Chip.stories.js.map +1 -0
- package/dist/cjs/components/colorPicker/ColorPicker.js +2 -1
- package/dist/cjs/components/colorPicker/ColorPicker.js.map +1 -1
- package/dist/cjs/components/colorPicker/ColorPicker.stories.d.ts +15 -0
- package/dist/cjs/components/colorPicker/ColorPicker.stories.js +21 -0
- package/dist/cjs/components/colorPicker/ColorPicker.stories.js.map +1 -0
- package/dist/cjs/components/contextMenu/contextMenu.js +2 -2
- package/dist/cjs/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/cjs/components/datePicker/DatePicker.d.ts +3 -1
- package/dist/cjs/components/datePicker/DatePicker.js +7 -7
- package/dist/cjs/components/datePicker/DatePicker.js.map +1 -1
- package/dist/cjs/components/dialog/Dialog.js +4 -5
- package/dist/cjs/components/dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.d.ts +6 -3
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js +15 -9
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.stories.d.ts +2 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.stories.js +2 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.stories.js.map +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownTriggerContext.d.ts +5 -0
- package/dist/cjs/components/dropdownMenu/DropdownTriggerContext.js +15 -0
- package/dist/cjs/components/dropdownMenu/DropdownTriggerContext.js.map +1 -0
- package/dist/cjs/components/editableText/EditableText.js +1 -1
- package/dist/cjs/components/editableText/EditableText.js.map +1 -1
- package/dist/cjs/components/emojiPicker/EmojiPicker.d.ts +2 -2
- package/dist/cjs/components/emojiPicker/EmojiPicker.js +4 -4
- package/dist/cjs/components/emojiPicker/EmojiPicker.js.map +1 -1
- package/dist/cjs/components/emojiPicker/EmojiPicker.stories.d.ts +1 -1
- package/dist/cjs/components/forms/CheckboxField.js +1 -1
- package/dist/cjs/components/forms/CheckboxField.js.map +1 -1
- package/dist/cjs/components/forms/FieldLabel.d.ts +1 -0
- package/dist/cjs/components/forms/FieldLabel.js +7 -0
- package/dist/cjs/components/forms/FieldLabel.js.map +1 -0
- package/dist/cjs/components/forms/Form.js +1 -2
- package/dist/cjs/components/forms/Form.js.map +1 -1
- package/dist/cjs/components/forms/NumberStepperField.js +2 -2
- package/dist/cjs/components/forms/NumberStepperField.js.map +1 -1
- package/dist/cjs/components/forms/TextField.d.ts +0 -1
- package/dist/cjs/components/forms/TextField.js +5 -5
- package/dist/cjs/components/forms/TextField.js.map +1 -1
- package/dist/cjs/components/horizontalList/HorizontalList.js +2 -2
- package/dist/cjs/components/horizontalList/HorizontalList.js.map +1 -1
- package/dist/cjs/components/imageUploader/ImageUploader.js +6 -7
- package/dist/cjs/components/imageUploader/ImageUploader.js.map +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/layouts/PageNav.js +1 -1
- package/dist/cjs/components/layouts/PageNav.js.map +1 -1
- package/dist/cjs/components/layouts/layouts.stories.js +2 -2
- package/dist/cjs/components/layouts/layouts.stories.js.map +1 -1
- package/dist/cjs/components/masonry/masonry.stories.js +1 -1
- package/dist/cjs/components/masonry/masonry.stories.js.map +1 -1
- package/dist/cjs/components/navBar/NavBar.d.ts +1 -1
- package/dist/cjs/components/navBar/NavBar.js +6 -10
- package/dist/cjs/components/navBar/NavBar.js.map +1 -1
- package/dist/cjs/components/note/Note.d.ts +3 -1
- package/dist/cjs/components/note/Note.js +2 -2
- package/dist/cjs/components/note/Note.js.map +1 -1
- package/dist/cjs/components/numberStepper/NumberStepper.js +2 -2
- package/dist/cjs/components/numberStepper/NumberStepper.js.map +1 -1
- package/dist/cjs/components/peek/Peek.js +1 -1
- package/dist/cjs/components/peek/Peek.js.map +1 -1
- package/dist/cjs/components/popover/Popover.js +1 -1
- package/dist/cjs/components/popover/Popover.js.map +1 -1
- package/dist/cjs/components/progress/Progress.d.ts +3 -2
- package/dist/cjs/components/progress/Progress.js +9 -3
- package/dist/cjs/components/progress/Progress.js.map +1 -1
- package/dist/cjs/components/progress/Progress.stories.d.ts +2 -2
- package/dist/cjs/components/richEditor/index.js +1 -1
- package/dist/cjs/components/richEditor/index.js.map +1 -1
- package/dist/cjs/components/select/Select.js +4 -4
- package/dist/cjs/components/select/Select.js.map +1 -1
- package/dist/cjs/components/skeletons/TextSkeleton.stories.js +1 -1
- package/dist/cjs/components/skeletons/TextSkeleton.stories.js.map +1 -1
- package/dist/cjs/components/slider/Slider.d.ts +3 -2
- package/dist/cjs/components/slider/Slider.js +9 -5
- package/dist/cjs/components/slider/Slider.js.map +1 -1
- package/dist/cjs/components/slider/Slider.stories.d.ts +1 -1
- package/dist/cjs/components/switch/Switch.js +2 -2
- package/dist/cjs/components/switch/Switch.js.map +1 -1
- package/dist/cjs/components/tabs/tabs.js +4 -4
- package/dist/cjs/components/tabs/tabs.js.map +1 -1
- package/dist/cjs/components/tabs/tabs.stories.d.ts +1 -0
- package/dist/cjs/components/tabs/tabs.stories.js +7 -1
- package/dist/cjs/components/tabs/tabs.stories.js.map +1 -1
- package/dist/cjs/components/toggleGroup/toggleGroup.js +2 -2
- package/dist/cjs/components/toggleGroup/toggleGroup.js.map +1 -1
- package/dist/cjs/components/viewport/Viewport.stories.js +1 -1
- package/dist/cjs/components/viewport/Viewport.stories.js.map +1 -1
- package/dist/cjs/components/viewport/ViewportZoomControls.js +1 -1
- package/dist/cjs/components/viewport/ViewportZoomControls.js.map +1 -1
- package/dist/cjs/themes.stories.js +10 -14
- package/dist/cjs/themes.stories.js.map +1 -1
- package/dist/cjs/uno/logic/color.d.ts +29 -0
- package/dist/cjs/uno/logic/color.js +61 -0
- package/dist/cjs/uno/logic/color.js.map +1 -0
- package/dist/cjs/uno/preflights/_util.d.ts +2 -0
- package/dist/cjs/uno/preflights/_util.js +12 -0
- package/dist/cjs/uno/preflights/_util.js.map +1 -0
- package/dist/cjs/uno/preflights/base.d.ts +2 -0
- package/dist/cjs/uno/preflights/base.js +19 -0
- package/dist/cjs/uno/preflights/base.js.map +1 -0
- package/dist/cjs/uno/preflights/colors.d.ts +1 -0
- package/dist/cjs/uno/preflights/colors.js +167 -0
- package/dist/cjs/uno/preflights/colors.js.map +1 -0
- package/dist/cjs/uno/preflights/customization.d.ts +10 -0
- package/dist/cjs/uno/preflights/customization.js +30 -0
- package/dist/cjs/uno/preflights/customization.js.map +1 -0
- package/dist/cjs/uno/preflights/dark.d.ts +1 -0
- package/dist/cjs/uno/preflights/dark.js +51 -0
- package/dist/cjs/uno/preflights/dark.js.map +1 -0
- package/dist/cjs/uno/preflights/globals.d.ts +2 -0
- package/dist/cjs/uno/preflights/globals.js +58 -0
- package/dist/cjs/uno/preflights/globals.js.map +1 -0
- package/dist/cjs/uno/preflights/index.d.ts +3 -0
- package/dist/cjs/uno/preflights/index.js +20 -0
- package/dist/cjs/uno/preflights/index.js.map +1 -0
- package/dist/cjs/uno/preflights/layers.d.ts +2 -0
- package/dist/cjs/uno/preflights/layers.js +9 -0
- package/dist/cjs/uno/preflights/layers.js.map +1 -0
- package/dist/cjs/uno/rules/anchor.d.ts +2 -0
- package/dist/cjs/uno/rules/anchor.js +25 -0
- package/dist/cjs/uno/rules/anchor.js.map +1 -0
- package/dist/cjs/uno/rules/color.d.ts +2 -0
- package/dist/cjs/uno/rules/color.js +153 -0
- package/dist/cjs/uno/rules/color.js.map +1 -0
- package/dist/cjs/uno/rules/index.d.ts +1 -0
- package/dist/cjs/uno/rules/index.js +17 -0
- package/dist/cjs/uno/rules/index.js.map +1 -0
- package/dist/cjs/uno/rules/overflow.d.ts +2 -0
- package/dist/cjs/uno/rules/overflow.js +44 -0
- package/dist/cjs/uno/rules/overflow.js.map +1 -0
- package/dist/cjs/uno/rules/shadow.d.ts +2 -0
- package/dist/cjs/uno/rules/shadow.js +19 -0
- package/dist/cjs/uno/rules/shadow.js.map +1 -0
- package/dist/cjs/uno/rules/util.d.ts +2 -0
- package/dist/cjs/uno/rules/util.js +34 -0
- package/dist/cjs/uno/rules/util.js.map +1 -0
- package/dist/cjs/uno/shortcuts/index.d.ts +2 -0
- package/dist/cjs/uno/shortcuts/index.js +22 -0
- package/dist/cjs/uno/shortcuts/index.js.map +1 -0
- package/dist/cjs/uno/theme/animations.d.ts +3 -0
- package/dist/cjs/uno/theme/animations.js +213 -0
- package/dist/cjs/uno/theme/animations.js.map +1 -0
- package/dist/cjs/uno/theme/borders.d.ts +3 -0
- package/dist/cjs/uno/theme/borders.js +19 -0
- package/dist/cjs/uno/theme/borders.js.map +1 -0
- package/dist/cjs/uno/theme/colors.d.ts +55 -0
- package/dist/cjs/uno/theme/colors.js +29 -0
- package/dist/cjs/uno/theme/colors.js.map +1 -0
- package/dist/cjs/uno/theme/index.d.ts +2 -0
- package/dist/cjs/uno/theme/index.js +36 -0
- package/dist/cjs/uno/theme/index.js.map +1 -0
- package/dist/cjs/uno/theme/shadows.d.ts +2 -0
- package/dist/cjs/uno/theme/shadows.js +18 -0
- package/dist/cjs/uno/theme/shadows.js.map +1 -0
- package/dist/cjs/uno/theme/sizes.d.ts +3 -0
- package/dist/cjs/uno/theme/sizes.js +17 -0
- package/dist/cjs/uno/theme/sizes.js.map +1 -0
- package/dist/cjs/uno/theme/spacing.d.ts +2 -0
- package/dist/cjs/uno/theme/spacing.js +12 -0
- package/dist/cjs/uno/theme/spacing.js.map +1 -0
- package/dist/cjs/uno/theme/typography.d.ts +3 -0
- package/dist/cjs/uno/theme/typography.js +27 -0
- package/dist/cjs/uno/theme/typography.js.map +1 -0
- package/dist/cjs/uno/uno.preset.d.ts +2 -17
- package/dist/cjs/uno/uno.preset.js +14 -937
- package/dist/cjs/uno/uno.preset.js.map +1 -1
- package/dist/cjs/uno/variants/index.d.ts +2 -0
- package/dist/cjs/uno/variants/index.js +16 -0
- package/dist/cjs/uno/variants/index.js.map +1 -0
- package/dist/cjs/utilities.stories.js +1 -1
- package/dist/cjs/utilities.stories.js.map +1 -1
- package/dist/css/main.css +13 -1216
- package/dist/esm/colorMode.js +2 -3
- package/dist/esm/colorMode.js.map +1 -1
- package/dist/esm/colors.stories.js +3 -3
- package/dist/esm/colors.stories.js.map +1 -1
- package/dist/esm/components/actions/ActionBar.js +1 -1
- package/dist/esm/components/actions/ActionBar.stories.js +2 -2
- package/dist/esm/components/actions/ActionBar.stories.js.map +1 -1
- package/dist/esm/components/box/Box.d.ts +5 -2
- package/dist/esm/components/box/Box.js +12 -10
- package/dist/esm/components/box/Box.js.map +1 -1
- package/dist/esm/components/box/Box.stories.d.ts +3 -8
- package/dist/esm/components/box/Box.stories.js +24 -9
- package/dist/esm/components/box/Box.stories.js.map +1 -1
- package/dist/esm/components/button/Button.d.ts +5 -6
- package/dist/esm/components/button/Button.js +26 -5
- package/dist/esm/components/button/Button.js.map +1 -1
- package/dist/esm/components/button/Button.stories.d.ts +8 -2
- package/dist/esm/components/button/Button.stories.js +17 -5
- package/dist/esm/components/button/Button.stories.js.map +1 -1
- package/dist/esm/components/button/classes.d.ts +4 -13
- package/dist/esm/components/button/classes.js +21 -39
- package/dist/esm/components/button/classes.js.map +1 -1
- package/dist/esm/components/camera/Camera.js +4 -4
- package/dist/esm/components/camera/Camera.js.map +1 -1
- package/dist/esm/components/card/Card.js +6 -6
- package/dist/esm/components/card/Card.js.map +1 -1
- package/dist/esm/components/card/Card.stories.js +7 -7
- package/dist/esm/components/card/Card.stories.js.map +1 -1
- package/dist/esm/components/checkbox/Checkbox.js +3 -3
- package/dist/esm/components/checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/chip/Chip.d.ts +2 -1
- package/dist/esm/components/chip/Chip.js +2 -5
- package/dist/esm/components/chip/Chip.js.map +1 -1
- package/dist/esm/components/chip/Chip.stories.d.ts +20 -0
- package/dist/esm/components/chip/Chip.stories.js +33 -0
- package/dist/esm/components/chip/Chip.stories.js.map +1 -0
- package/dist/esm/components/colorPicker/ColorPicker.js +2 -1
- package/dist/esm/components/colorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/components/colorPicker/ColorPicker.stories.d.ts +15 -0
- package/dist/esm/components/colorPicker/ColorPicker.stories.js +18 -0
- package/dist/esm/components/colorPicker/ColorPicker.stories.js.map +1 -0
- package/dist/esm/components/contextMenu/contextMenu.js +2 -2
- package/dist/esm/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/esm/components/datePicker/DatePicker.d.ts +3 -1
- package/dist/esm/components/datePicker/DatePicker.js +7 -7
- package/dist/esm/components/datePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/dialog/Dialog.js +4 -5
- package/dist/esm/components/dialog/Dialog.js.map +1 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.d.ts +6 -3
- package/dist/esm/components/dropdownMenu/DropdownMenu.js +13 -8
- package/dist/esm/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.stories.d.ts +2 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.stories.js +2 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.stories.js.map +1 -1
- package/dist/esm/components/dropdownMenu/DropdownTriggerContext.d.ts +5 -0
- package/dist/esm/components/dropdownMenu/DropdownTriggerContext.js +11 -0
- package/dist/esm/components/dropdownMenu/DropdownTriggerContext.js.map +1 -0
- package/dist/esm/components/editableText/EditableText.js +1 -1
- package/dist/esm/components/editableText/EditableText.js.map +1 -1
- package/dist/esm/components/emojiPicker/EmojiPicker.d.ts +2 -2
- package/dist/esm/components/emojiPicker/EmojiPicker.js +4 -4
- package/dist/esm/components/emojiPicker/EmojiPicker.js.map +1 -1
- package/dist/esm/components/emojiPicker/EmojiPicker.stories.d.ts +1 -1
- package/dist/esm/components/forms/CheckboxField.js +1 -1
- package/dist/esm/components/forms/CheckboxField.js.map +1 -1
- package/dist/esm/components/forms/FieldLabel.d.ts +1 -0
- package/dist/esm/components/forms/FieldLabel.js +4 -0
- package/dist/esm/components/forms/FieldLabel.js.map +1 -0
- package/dist/esm/components/forms/Form.js +1 -2
- package/dist/esm/components/forms/Form.js.map +1 -1
- package/dist/esm/components/forms/NumberStepperField.js +1 -1
- package/dist/esm/components/forms/NumberStepperField.js.map +1 -1
- package/dist/esm/components/forms/TextField.d.ts +0 -1
- package/dist/esm/components/forms/TextField.js +2 -2
- package/dist/esm/components/forms/TextField.js.map +1 -1
- package/dist/esm/components/horizontalList/HorizontalList.js +2 -2
- package/dist/esm/components/horizontalList/HorizontalList.js.map +1 -1
- package/dist/esm/components/imageUploader/ImageUploader.js +6 -7
- package/dist/esm/components/imageUploader/ImageUploader.js.map +1 -1
- package/dist/esm/components/input/Input.js +1 -1
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/layouts/PageNav.js +1 -1
- package/dist/esm/components/layouts/PageNav.js.map +1 -1
- package/dist/esm/components/layouts/layouts.stories.js +2 -2
- package/dist/esm/components/layouts/layouts.stories.js.map +1 -1
- package/dist/esm/components/masonry/masonry.stories.js +1 -1
- package/dist/esm/components/masonry/masonry.stories.js.map +1 -1
- package/dist/esm/components/navBar/NavBar.d.ts +1 -1
- package/dist/esm/components/navBar/NavBar.js +6 -10
- package/dist/esm/components/navBar/NavBar.js.map +1 -1
- package/dist/esm/components/note/Note.d.ts +3 -1
- package/dist/esm/components/note/Note.js +2 -2
- package/dist/esm/components/note/Note.js.map +1 -1
- package/dist/esm/components/numberStepper/NumberStepper.js +2 -2
- package/dist/esm/components/numberStepper/NumberStepper.js.map +1 -1
- package/dist/esm/components/peek/Peek.js +1 -1
- package/dist/esm/components/peek/Peek.js.map +1 -1
- package/dist/esm/components/popover/Popover.js +1 -1
- package/dist/esm/components/popover/Popover.js.map +1 -1
- package/dist/esm/components/progress/Progress.d.ts +3 -2
- package/dist/esm/components/progress/Progress.js +6 -3
- package/dist/esm/components/progress/Progress.js.map +1 -1
- package/dist/esm/components/progress/Progress.stories.d.ts +2 -2
- package/dist/esm/components/richEditor/index.js +1 -1
- package/dist/esm/components/richEditor/index.js.map +1 -1
- package/dist/esm/components/select/Select.js +4 -4
- package/dist/esm/components/select/Select.js.map +1 -1
- package/dist/esm/components/skeletons/TextSkeleton.stories.js +1 -1
- package/dist/esm/components/skeletons/TextSkeleton.stories.js.map +1 -1
- package/dist/esm/components/slider/Slider.d.ts +3 -2
- package/dist/esm/components/slider/Slider.js +6 -5
- package/dist/esm/components/slider/Slider.js.map +1 -1
- package/dist/esm/components/slider/Slider.stories.d.ts +1 -1
- package/dist/esm/components/switch/Switch.js +2 -2
- package/dist/esm/components/switch/Switch.js.map +1 -1
- package/dist/esm/components/tabs/tabs.js +4 -4
- package/dist/esm/components/tabs/tabs.js.map +1 -1
- package/dist/esm/components/tabs/tabs.stories.d.ts +1 -0
- package/dist/esm/components/tabs/tabs.stories.js +6 -0
- package/dist/esm/components/tabs/tabs.stories.js.map +1 -1
- package/dist/esm/components/toggleGroup/toggleGroup.js +2 -2
- package/dist/esm/components/toggleGroup/toggleGroup.js.map +1 -1
- package/dist/esm/components/viewport/Viewport.stories.js +1 -1
- package/dist/esm/components/viewport/Viewport.stories.js.map +1 -1
- package/dist/esm/components/viewport/ViewportZoomControls.js +1 -1
- package/dist/esm/components/viewport/ViewportZoomControls.js.map +1 -1
- package/dist/esm/themes.stories.js +10 -14
- package/dist/esm/themes.stories.js.map +1 -1
- package/dist/esm/uno/logic/color.d.ts +29 -0
- package/dist/esm/uno/logic/color.js +53 -0
- package/dist/esm/uno/logic/color.js.map +1 -0
- package/dist/esm/uno/preflights/_util.d.ts +2 -0
- package/dist/esm/uno/preflights/_util.js +9 -0
- package/dist/esm/uno/preflights/_util.js.map +1 -0
- package/dist/esm/uno/preflights/base.d.ts +2 -0
- package/dist/esm/uno/preflights/base.js +16 -0
- package/dist/esm/uno/preflights/base.js.map +1 -0
- package/dist/esm/uno/preflights/colors.d.ts +1 -0
- package/dist/esm/uno/preflights/colors.js +164 -0
- package/dist/esm/uno/preflights/colors.js.map +1 -0
- package/dist/esm/uno/preflights/customization.d.ts +10 -0
- package/dist/esm/uno/preflights/customization.js +26 -0
- package/dist/esm/uno/preflights/customization.js.map +1 -0
- package/dist/esm/uno/preflights/dark.d.ts +1 -0
- package/dist/esm/uno/preflights/dark.js +48 -0
- package/dist/esm/uno/preflights/dark.js.map +1 -0
- package/dist/esm/uno/preflights/globals.d.ts +2 -0
- package/dist/esm/uno/preflights/globals.js +55 -0
- package/dist/esm/uno/preflights/globals.js.map +1 -0
- package/dist/esm/uno/preflights/index.d.ts +3 -0
- package/dist/esm/uno/preflights/index.js +16 -0
- package/dist/esm/uno/preflights/index.js.map +1 -0
- package/dist/esm/uno/preflights/layers.d.ts +2 -0
- package/dist/esm/uno/preflights/layers.js +6 -0
- package/dist/esm/uno/preflights/layers.js.map +1 -0
- package/dist/esm/uno/rules/anchor.d.ts +2 -0
- package/dist/esm/uno/rules/anchor.js +22 -0
- package/dist/esm/uno/rules/anchor.js.map +1 -0
- package/dist/esm/uno/rules/color.d.ts +2 -0
- package/dist/esm/uno/rules/color.js +150 -0
- package/dist/esm/uno/rules/color.js.map +1 -0
- package/dist/esm/uno/rules/index.d.ts +1 -0
- package/dist/esm/uno/rules/index.js +14 -0
- package/dist/esm/uno/rules/index.js.map +1 -0
- package/dist/esm/uno/rules/overflow.d.ts +2 -0
- package/dist/esm/uno/rules/overflow.js +41 -0
- package/dist/esm/uno/rules/overflow.js.map +1 -0
- package/dist/esm/uno/rules/shadow.d.ts +2 -0
- package/dist/esm/uno/rules/shadow.js +16 -0
- package/dist/esm/uno/rules/shadow.js.map +1 -0
- package/dist/esm/uno/rules/util.d.ts +2 -0
- package/dist/esm/uno/rules/util.js +31 -0
- package/dist/esm/uno/rules/util.js.map +1 -0
- package/dist/esm/uno/shortcuts/index.d.ts +2 -0
- package/dist/esm/uno/shortcuts/index.js +19 -0
- package/dist/esm/uno/shortcuts/index.js.map +1 -0
- package/dist/esm/uno/theme/animations.d.ts +3 -0
- package/dist/esm/uno/theme/animations.js +210 -0
- package/dist/esm/uno/theme/animations.js.map +1 -0
- package/dist/esm/uno/theme/borders.d.ts +3 -0
- package/dist/esm/uno/theme/borders.js +16 -0
- package/dist/esm/uno/theme/borders.js.map +1 -0
- package/dist/esm/uno/theme/colors.d.ts +55 -0
- package/dist/esm/uno/theme/colors.js +26 -0
- package/dist/esm/uno/theme/colors.js.map +1 -0
- package/dist/esm/uno/theme/index.d.ts +2 -0
- package/dist/esm/uno/theme/index.js +33 -0
- package/dist/esm/uno/theme/index.js.map +1 -0
- package/dist/esm/uno/theme/shadows.d.ts +2 -0
- package/dist/esm/uno/theme/shadows.js +15 -0
- package/dist/esm/uno/theme/shadows.js.map +1 -0
- package/dist/esm/uno/theme/sizes.d.ts +3 -0
- package/dist/esm/uno/theme/sizes.js +14 -0
- package/dist/esm/uno/theme/sizes.js.map +1 -0
- package/dist/esm/uno/theme/spacing.d.ts +2 -0
- package/dist/esm/uno/theme/spacing.js +9 -0
- package/dist/esm/uno/theme/spacing.js.map +1 -0
- package/dist/esm/uno/theme/typography.d.ts +3 -0
- package/dist/esm/uno/theme/typography.js +24 -0
- package/dist/esm/uno/theme/typography.js.map +1 -0
- package/dist/esm/uno/uno.preset.d.ts +2 -17
- package/dist/esm/uno/uno.preset.js +14 -937
- package/dist/esm/uno/uno.preset.js.map +1 -1
- package/dist/esm/uno/variants/index.d.ts +2 -0
- package/dist/esm/uno/variants/index.js +13 -0
- package/dist/esm/uno/variants/index.js.map +1 -0
- package/dist/esm/utilities.stories.js +1 -1
- package/dist/esm/utilities.stories.js.map +1 -1
- package/package.json +9 -9
- package/src/colorMode.ts +2 -3
- package/src/colors.stories.tsx +6 -6
- package/src/components/actions/ActionBar.stories.tsx +2 -2
- package/src/components/actions/ActionBar.tsx +1 -1
- package/src/components/box/Box.stories.tsx +74 -19
- package/src/components/box/Box.tsx +23 -13
- package/src/components/button/Button.stories.tsx +45 -11
- package/src/components/button/Button.tsx +45 -12
- package/src/components/button/classes.tsx +65 -59
- package/src/components/camera/Camera.tsx +7 -4
- package/src/components/card/Card.stories.tsx +9 -9
- package/src/components/card/Card.tsx +12 -9
- package/src/components/checkbox/Checkbox.tsx +6 -5
- package/src/components/chip/Chip.stories.tsx +58 -0
- package/src/components/chip/Chip.tsx +8 -13
- package/src/components/colorPicker/ColorPicker.stories.tsx +21 -0
- package/src/components/colorPicker/ColorPicker.tsx +2 -1
- package/src/components/contextMenu/contextMenu.tsx +6 -4
- package/src/components/datePicker/DatePicker.tsx +17 -13
- package/src/components/dialog/Dialog.tsx +10 -9
- package/src/components/dropdownMenu/DropdownMenu.stories.tsx +5 -2
- package/src/components/dropdownMenu/DropdownMenu.tsx +30 -15
- package/src/components/dropdownMenu/DropdownTriggerContext.tsx +19 -0
- package/src/components/editableText/EditableText.tsx +3 -3
- package/src/components/emojiPicker/EmojiPicker.tsx +5 -5
- package/src/components/forms/CheckboxField.tsx +1 -1
- package/src/components/forms/FieldLabel.tsx +6 -0
- package/src/components/forms/Form.tsx +1 -3
- package/src/components/forms/NumberStepperField.tsx +1 -5
- package/src/components/forms/TextField.tsx +2 -5
- package/src/components/horizontalList/HorizontalList.tsx +3 -3
- package/src/components/imageUploader/ImageUploader.tsx +12 -7
- package/src/components/input/Input.tsx +1 -1
- package/src/components/layouts/PageNav.tsx +1 -1
- package/src/components/layouts/layouts.stories.tsx +2 -2
- package/src/components/masonry/masonry.stories.tsx +2 -1
- package/src/components/navBar/NavBar.tsx +12 -19
- package/src/components/note/Note.tsx +15 -7
- package/src/components/numberStepper/NumberStepper.tsx +3 -3
- package/src/components/peek/Peek.tsx +1 -1
- package/src/components/popover/Popover.tsx +1 -1
- package/src/components/progress/Progress.tsx +13 -6
- package/src/components/richEditor/index.tsx +1 -1
- package/src/components/select/Select.tsx +6 -6
- package/src/components/skeletons/TextSkeleton.stories.tsx +1 -1
- package/src/components/slider/Slider.tsx +14 -10
- package/src/components/switch/Switch.tsx +8 -2
- package/src/components/tabs/tabs.stories.tsx +22 -0
- package/src/components/tabs/tabs.tsx +14 -7
- package/src/components/toggleGroup/toggleGroup.tsx +6 -4
- package/src/components/viewport/Viewport.stories.tsx +1 -1
- package/src/components/viewport/ViewportZoomControls.tsx +3 -3
- package/src/themes.stories.tsx +43 -29
- package/src/uno/logic/color.ts +99 -0
- package/src/uno/preflights/_util.ts +10 -0
- package/src/uno/preflights/base.ts +17 -0
- package/src/uno/preflights/colors.ts +165 -0
- package/src/uno/preflights/customization.ts +44 -0
- package/src/uno/preflights/dark.ts +49 -0
- package/src/uno/preflights/globals.ts +55 -0
- package/src/uno/preflights/index.ts +21 -0
- package/src/uno/preflights/layers.ts +7 -0
- package/src/uno/rules/anchor.ts +22 -0
- package/src/uno/rules/color.ts +153 -0
- package/src/uno/rules/index.ts +13 -0
- package/src/uno/rules/overflow.ts +45 -0
- package/src/uno/rules/shadow.ts +16 -0
- package/src/uno/rules/util.ts +31 -0
- package/src/uno/shortcuts/index.ts +21 -0
- package/src/uno/theme/animations.ts +211 -0
- package/src/uno/theme/borders.ts +17 -0
- package/src/uno/theme/colors.ts +35 -0
- package/src/uno/theme/index.ts +33 -0
- package/src/uno/theme/shadows.ts +15 -0
- package/src/uno/theme/sizes.ts +15 -0
- package/src/uno/theme/spacing.ts +9 -0
- package/src/uno/theme/typography.ts +24 -0
- package/src/uno/uno.preset.ts +21 -1036
- package/src/uno/variants/index.ts +12 -0
- package/src/utilities.stories.tsx +4 -2
- package/dist/cjs/uno/colors.d.ts +0 -65
- package/dist/cjs/uno/colors.js +0 -138
- package/dist/cjs/uno/colors.js.map +0 -1
- package/dist/cjs/uno/shadows.d.ts +0 -6
- package/dist/cjs/uno/shadows.js +0 -20
- package/dist/cjs/uno/shadows.js.map +0 -1
- package/dist/esm/uno/colors.d.ts +0 -65
- package/dist/esm/uno/colors.js +0 -131
- package/dist/esm/uno/colors.js.map +0 -1
- package/dist/esm/uno/shadows.d.ts +0 -6
- package/dist/esm/uno/shadows.js +0 -17
- package/dist/esm/uno/shadows.js.map +0 -1
- package/src/uno/colors.ts +0 -154
- package/src/uno/shadows.ts +0 -15
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
-
import
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
3
|
import { AnimatePresence, motion } from 'motion/react';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ButtonHTMLAttributes,
|
|
6
|
+
Children,
|
|
7
|
+
memo,
|
|
8
|
+
ReactNode,
|
|
9
|
+
Ref,
|
|
10
|
+
useCallback,
|
|
11
|
+
useState,
|
|
12
|
+
} from 'react';
|
|
5
13
|
import { withClassName } from '../../hooks.js';
|
|
6
14
|
import useMergedRef from '../../hooks/useMergedRef.js';
|
|
15
|
+
import { PaletteName } from '../../uno/logic/color.js';
|
|
16
|
+
import { DropdownMenuTriggerIcon } from '../dropdownMenu/DropdownMenu.js';
|
|
17
|
+
import { useIsDropdownTrigger } from '../dropdownMenu/DropdownTriggerContext.js';
|
|
7
18
|
import { IconLoadingProvider } from '../icon/IconLoadingContext.js';
|
|
8
19
|
import { Icon } from '../icon/index.js';
|
|
9
20
|
import { Spinner } from '../spinner/index.js';
|
|
10
21
|
import { getButtonClassName } from './classes.js';
|
|
11
22
|
|
|
12
23
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
|
-
color?:
|
|
24
|
+
color?: PaletteName;
|
|
25
|
+
emphasis?:
|
|
14
26
|
| 'primary'
|
|
15
27
|
| 'default'
|
|
16
28
|
| 'ghost'
|
|
17
|
-
| 'destructive'
|
|
18
|
-
| 'ghostDestructive'
|
|
19
|
-
| 'ghostAccent'
|
|
20
|
-
| 'accent'
|
|
21
29
|
| 'contrast'
|
|
30
|
+
| 'light'
|
|
22
31
|
| 'unstyled';
|
|
23
|
-
|
|
24
|
-
* icon and icon-small are deprecated.
|
|
25
|
-
*/
|
|
26
|
-
size?: 'default' | 'small' | 'icon' | 'icon-small';
|
|
32
|
+
size?: 'default' | 'small';
|
|
27
33
|
toggled?: boolean;
|
|
28
34
|
toggleMode?: 'color-and-indicator' | 'color' | 'indicator' | 'state-only';
|
|
29
35
|
align?: 'start' | 'stretch' | 'end';
|
|
@@ -38,6 +44,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
38
44
|
export function ButtonRoot({
|
|
39
45
|
className,
|
|
40
46
|
color,
|
|
47
|
+
emphasis = 'default',
|
|
41
48
|
size,
|
|
42
49
|
toggled,
|
|
43
50
|
toggleMode = 'color-and-indicator',
|
|
@@ -58,6 +65,12 @@ export function ButtonRoot({
|
|
|
58
65
|
const isSubmitLoading = props.type === 'submit' && isFormSubmitting;
|
|
59
66
|
const isLoading = loading || isSubmitLoading;
|
|
60
67
|
|
|
68
|
+
const childArray = Children.toArray(children);
|
|
69
|
+
const iconChildCount = childArray.filter(isIconChild).length;
|
|
70
|
+
const hasLabelChild = childArray.length > iconChildCount;
|
|
71
|
+
|
|
72
|
+
const isDropdownTrigger = useIsDropdownTrigger();
|
|
73
|
+
|
|
61
74
|
const finalRef = useMergedRef(useAnnotateWithChildParts(), ref);
|
|
62
75
|
|
|
63
76
|
const buttonProps = {
|
|
@@ -68,10 +81,14 @@ export function ButtonRoot({
|
|
|
68
81
|
'data-focus': visuallyFocused,
|
|
69
82
|
'data-size': size,
|
|
70
83
|
'data-loading': isLoading,
|
|
84
|
+
'data-has-label': hasLabelChild || undefined,
|
|
85
|
+
'data-icon-count': iconChildCount > 0 ? iconChildCount : undefined,
|
|
86
|
+
'data-dropdown-trigger': isDropdownTrigger ? true : undefined,
|
|
71
87
|
tabIndex: visuallyDisabled ? -1 : undefined,
|
|
72
|
-
className:
|
|
88
|
+
className: clsx(
|
|
73
89
|
getButtonClassName({
|
|
74
90
|
color,
|
|
91
|
+
emphasis,
|
|
75
92
|
size,
|
|
76
93
|
toggleable:
|
|
77
94
|
toggled !== undefined &&
|
|
@@ -119,6 +136,11 @@ export function ButtonRoot({
|
|
|
119
136
|
<ButtonToggleIndicator value={toggled} />
|
|
120
137
|
)}
|
|
121
138
|
{children}
|
|
139
|
+
{isDropdownTrigger && (
|
|
140
|
+
<DropdownMenuTriggerIcon asChild>
|
|
141
|
+
<Icon name="chevron" />
|
|
142
|
+
</DropdownMenuTriggerIcon>
|
|
143
|
+
)}
|
|
122
144
|
</Comp>
|
|
123
145
|
</IconLoadingProvider>
|
|
124
146
|
);
|
|
@@ -198,3 +220,14 @@ function applyPartAttributes(button: HTMLButtonElement) {
|
|
|
198
220
|
button.setAttribute('data-has-label', String(registry.label > 0));
|
|
199
221
|
button.setAttribute('data-icon-count', String(registry.icon));
|
|
200
222
|
}
|
|
223
|
+
|
|
224
|
+
function isIconChild(child: ReactNode): boolean {
|
|
225
|
+
if (typeof child !== 'object' || child === null) return false;
|
|
226
|
+
if ('type' in child) {
|
|
227
|
+
const type = (child as any).type;
|
|
228
|
+
if (type === ButtonIcon) return true;
|
|
229
|
+
if (type === Icon) return true;
|
|
230
|
+
if (typeof type === 'function' && type.displayName === 'Icon') return true;
|
|
231
|
+
}
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
@@ -1,80 +1,86 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
+
import { PaletteName } from '../../uno/logic/color.js';
|
|
2
3
|
import { type ButtonProps } from './Button.jsx';
|
|
3
4
|
|
|
4
|
-
const sizeMap = {
|
|
5
|
-
default: 'default',
|
|
6
|
-
small: 'small',
|
|
7
|
-
icon: 'default',
|
|
8
|
-
'icon-small': 'small',
|
|
9
|
-
} satisfies Record<string, 'default' | 'small'>;
|
|
10
|
-
|
|
11
5
|
export function getButtonClassName({
|
|
12
6
|
color,
|
|
13
|
-
|
|
7
|
+
emphasis = 'default',
|
|
8
|
+
size = 'default',
|
|
14
9
|
toggleable,
|
|
15
10
|
align,
|
|
16
11
|
disableIconMode,
|
|
17
12
|
}: {
|
|
18
|
-
color?:
|
|
13
|
+
color?: PaletteName;
|
|
14
|
+
emphasis?: ButtonProps['emphasis'];
|
|
19
15
|
size?: ButtonProps['size'];
|
|
20
16
|
toggleable?: boolean;
|
|
21
17
|
align?: ButtonProps['align'];
|
|
22
18
|
disableIconMode?: boolean;
|
|
23
19
|
}) {
|
|
24
|
-
|
|
20
|
+
if (emphasis === 'unstyled') {
|
|
21
|
+
return clsx(
|
|
22
|
+
'layer-components:(p-0 m-0 border-none bg-transparent appearance-none)',
|
|
23
|
+
'layer-components:(cursor-pointer)',
|
|
24
|
+
'layer-components:focus:outline-off',
|
|
25
|
+
);
|
|
26
|
+
}
|
|
25
27
|
|
|
26
28
|
return clsx(
|
|
27
|
-
|
|
28
|
-
'layer-components:
|
|
29
|
+
color && `palette-${color}`,
|
|
30
|
+
'layer-components:(px-4 py-2)',
|
|
31
|
+
'layer-components:(leading-none text-md font-inherit font-bold select-none)',
|
|
32
|
+
'layer-components:(border-solid border-thin border-color rounded-lg)',
|
|
33
|
+
'layer-components:(cursor-pointer)',
|
|
34
|
+
'layer-components:(flex flex-row gap-sm items-center)',
|
|
35
|
+
'layer-components:(relative overflow-visible whitespace-nowrap)',
|
|
36
|
+
'layer-components:(transition-all duration-200)',
|
|
37
|
+
'layer-components:(shadow-sm ring-bg)',
|
|
38
|
+
'layer-components:(color-contrast)',
|
|
39
|
+
|
|
40
|
+
emphasis === 'ghost' && 'layer-variants:(shadow-none border-none)',
|
|
41
|
+
emphasis === 'contrast' && 'layer-variants:(border-bg hover:bg-gray-ink)',
|
|
42
|
+
|
|
43
|
+
{
|
|
44
|
+
'layer-components:bg-main': emphasis === 'primary',
|
|
45
|
+
'layer-components:(bg-main-light color-main-ink)': emphasis === 'light',
|
|
46
|
+
'layer-components:bg-white layer-variants:focus-visible:bg-white':
|
|
47
|
+
emphasis === 'default',
|
|
48
|
+
'layer-components:(bg-transparent aria-pressed:bg-main-wash)':
|
|
49
|
+
emphasis === 'ghost',
|
|
50
|
+
'layer-components:(bg-black)': emphasis === 'contrast',
|
|
51
|
+
},
|
|
52
|
+
color === 'gray' && '[--l-saturation:0] hov',
|
|
53
|
+
|
|
54
|
+
{
|
|
55
|
+
'layer-components:(px-4 py-1 text-sm rounded-md)': size === 'small',
|
|
56
|
+
'layer-components:[&[data-has-icon=true][data-has-label=false]]:(p-2.35 text-sm rounded-lg)':
|
|
57
|
+
size === 'default' && !disableIconMode,
|
|
58
|
+
'layer-components:[&[data-has-icon=true][data-has-label=false]]:(p-2 text-xs rounded-lg -m-y-0.5)':
|
|
59
|
+
size === 'small' && !disableIconMode,
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
'layer-components:hover:(bg-main bg-lighten-2 ring-4)',
|
|
63
|
+
|
|
29
64
|
'layer-components:focus:outline-off',
|
|
30
|
-
'layer-components:focus-visible:(
|
|
31
|
-
'layer-components:[&[data-focus=true]]:(
|
|
32
|
-
|
|
33
|
-
'layer-components:
|
|
34
|
-
'layer-components:[&[data-disabled=true]]:(opacity-50 cursor-default bg-[var(--bg)] shadow-none)',
|
|
35
|
-
colors[color ?? 'default'],
|
|
36
|
-
`btn-color-${color ?? 'default'}`,
|
|
37
|
-
sizes[size ?? 'default'],
|
|
38
|
-
disableIconMode ? '' : iconModeSizes[size ?? 'default'],
|
|
39
|
-
`size-${size ?? 'default'}`,
|
|
40
|
-
toggleable && toggledClass,
|
|
41
|
-
align && aligns[align],
|
|
42
|
-
// compound variants
|
|
43
|
-
color === 'ghost' &&
|
|
44
|
-
toggleable &&
|
|
45
|
-
'layer-variants:[aria-pressed="true"]:[--bg:var(--color-primary-wash)]',
|
|
46
|
-
);
|
|
47
|
-
}
|
|
65
|
+
'layer-components:focus-visible:(outline-off ring-accent ring-6)',
|
|
66
|
+
'layer-components:[&[data-focus=true]]:(ring-6 ring-accent outline-off)',
|
|
67
|
+
|
|
68
|
+
'layer-components:active:(bg-darken-1 ring-8)',
|
|
48
69
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
accent: `layer-variants:[&.btn-color-accent]:([--bg-neutral:var(--color-accent-wash)] [--bg:var(--color-accent-light)] shadow-sm color-black border-accent-dark)`,
|
|
52
|
-
default: `layer-variants:[&.btn-color-default]:([--bg-neutral:var(--color-white)] [--bg:var(--color-gray)] bg-lighten-1 shadow-sm color-black border-gray-dark focus-visible:bg-lighten-1 hover:bg-lighten-1)`,
|
|
53
|
-
ghost: `layer-variants:[&.btn-color-ghost]:([--bg-neutral:transparent] [--bg:oklch(from_var(--color-gray)_l_c_h/50%)] color-dark-blend)`,
|
|
54
|
-
destructive: `layer-variants:[&.btn-color-destructive]:([--bg:var(--color-attention)] shadow-sm border-attention-dark color-black)`,
|
|
55
|
-
ghostDestructive: `layer-variants:[&.btn-color-ghostDestructive]:([--bg-neutral:transparent] [--bg:var(--color-attention-light)] color-attention-dark hover:(color-black) focus-visible:(color-black))`,
|
|
56
|
-
ghostAccent: `layer-variants:[&.btn-color-ghostAccent]:([--bg-neutral:transparent] [--bg:var(--color-accent-light)] color-accent-dark hover:color-black focus-visible:color-black)`,
|
|
57
|
-
contrast: `layer-variants:[&.btn-color-contrast]:([--bg:var(--color-black)] color-white border-black hover:bg-lighten-1 focus-visible:bg-lighten-1 active:bg-lighten-1)`,
|
|
58
|
-
unstyled: `layer-variants:(bg-transparent hover:(bg-transparent) focus:(bg-transparent) active:(bg-transparent) color-inherit border-transparent shadow-none hover:(shadow-none) focus:(shadow-none) active:(shadow-none) p-0 items-start font-inherit font-normal rounded-none text-size-inherit transition-none)`,
|
|
59
|
-
};
|
|
60
|
-
export const buttonColorClasses = colors;
|
|
70
|
+
'layer-components:disabled:(opacity-50 cursor-default shadow-none ring-none)',
|
|
71
|
+
'layer-components:[&[data-disabled=true]]:(opacity-50 cursor-default shadow-none)',
|
|
61
72
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
const iconModeSizes = {
|
|
67
|
-
default:
|
|
68
|
-
'layer-variants:[&[data-has-icon=true][data-has-label=false]]:(p-2.35 text-sm rounded-lg)',
|
|
69
|
-
small:
|
|
70
|
-
'layer-variants:[&.size-small[data-has-icon=true][data-has-label=false]]:(p-2 text-xs rounded-lg -m-y-0.5)',
|
|
71
|
-
};
|
|
73
|
+
{
|
|
74
|
+
'layer-variants:[&[aria-pressed=false]]:[&:not(:hover)]:bg-transparent':
|
|
75
|
+
toggleable,
|
|
76
|
+
},
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
{
|
|
79
|
+
'layer-components:self-start': align === 'start',
|
|
80
|
+
'layer-components:self-stretch': align === 'stretch',
|
|
81
|
+
'layer-components:self-end': align === 'end',
|
|
82
|
+
},
|
|
75
83
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
end: 'self-end',
|
|
80
|
-
};
|
|
84
|
+
`size-${size ?? 'default'}`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -217,7 +217,7 @@ const StyledShutterButton = withClassName(
|
|
|
217
217
|
'absolute bottom-3 left-1/2 -translate-x-1/2 w-16 h-16 bg-white rounded-full cursor-pointer border-2 border-black border-solid ring-2 ring-white opacity-80',
|
|
218
218
|
'hover:bg-gray-wash hover:opacity-100',
|
|
219
219
|
'focus-visible:bg-lighten-1',
|
|
220
|
-
'focus:ring-
|
|
220
|
+
'focus:ring-accent focus:outline-none focus:opacity-100',
|
|
221
221
|
'sm:w-8 sm:h-8',
|
|
222
222
|
);
|
|
223
223
|
|
|
@@ -244,7 +244,7 @@ export const CameraDeviceSelector = (props: CameraDeviceSelectorProps) => {
|
|
|
244
244
|
if (devices.length === 2) {
|
|
245
245
|
return (
|
|
246
246
|
<Button
|
|
247
|
-
|
|
247
|
+
emphasis="ghost"
|
|
248
248
|
className="absolute bottom-2 left-2 color-white"
|
|
249
249
|
onClick={swapCamera}
|
|
250
250
|
>
|
|
@@ -259,7 +259,10 @@ export const CameraDeviceSelector = (props: CameraDeviceSelectorProps) => {
|
|
|
259
259
|
onValueChange={selectDeviceId}
|
|
260
260
|
>
|
|
261
261
|
<Select.Trigger asChild>
|
|
262
|
-
<Button
|
|
262
|
+
<Button
|
|
263
|
+
emphasis="ghost"
|
|
264
|
+
className="absolute bottom-2 left-2 color-white"
|
|
265
|
+
>
|
|
263
266
|
<Icon name="refresh" />
|
|
264
267
|
</Button>
|
|
265
268
|
</Select.Trigger>
|
|
@@ -279,7 +282,7 @@ export const CameraFullscreenButton = (props: ButtonProps) => {
|
|
|
279
282
|
return (
|
|
280
283
|
<Button
|
|
281
284
|
{...props}
|
|
282
|
-
|
|
285
|
+
emphasis="ghost"
|
|
283
286
|
className="absolute top-2 right-2 color-white"
|
|
284
287
|
onClick={() => setFullscreen(!fullscreen)}
|
|
285
288
|
>
|
|
@@ -51,7 +51,7 @@ export const Default: Story = {
|
|
|
51
51
|
</Button>
|
|
52
52
|
</CardActions>
|
|
53
53
|
<CardMenu>
|
|
54
|
-
<Button size="small"
|
|
54
|
+
<Button size="small" emphasis="ghost">
|
|
55
55
|
<Icon name="dots" />
|
|
56
56
|
</Button>
|
|
57
57
|
</CardMenu>
|
|
@@ -68,7 +68,7 @@ export const Default: Story = {
|
|
|
68
68
|
<CardFooter>
|
|
69
69
|
<CardActions>
|
|
70
70
|
<Button size="small">Button</Button>
|
|
71
|
-
<Button size="small"
|
|
71
|
+
<Button size="small" emphasis="ghost">
|
|
72
72
|
<Icon name="placeholder" />
|
|
73
73
|
</Button>
|
|
74
74
|
</CardActions>
|
|
@@ -89,7 +89,7 @@ export const Compact: Story = {
|
|
|
89
89
|
<CardFooter>
|
|
90
90
|
<CardActions>
|
|
91
91
|
<Button size="small">Button</Button>
|
|
92
|
-
<Button size="small"
|
|
92
|
+
<Button size="small" emphasis="ghost">
|
|
93
93
|
<Icon name="placeholder" />
|
|
94
94
|
</Button>
|
|
95
95
|
</CardActions>
|
|
@@ -108,7 +108,7 @@ export const NonInteractive: Story = {
|
|
|
108
108
|
<CardFooter>
|
|
109
109
|
<CardActions>
|
|
110
110
|
<Button size="small">Button</Button>
|
|
111
|
-
<Button
|
|
111
|
+
<Button emphasis="ghost">
|
|
112
112
|
<Icon name="placeholder" />
|
|
113
113
|
</Button>
|
|
114
114
|
</CardActions>
|
|
@@ -129,7 +129,7 @@ export const AsChild: Story = {
|
|
|
129
129
|
<CardFooter>
|
|
130
130
|
<CardActions>
|
|
131
131
|
<Button size="small">Button</Button>
|
|
132
|
-
<Button
|
|
132
|
+
<Button emphasis="ghost">
|
|
133
133
|
<Icon name="placeholder" />
|
|
134
134
|
</Button>
|
|
135
135
|
</CardActions>
|
|
@@ -150,7 +150,7 @@ export const AsChildNonInteractive: Story = {
|
|
|
150
150
|
<CardFooter>
|
|
151
151
|
<CardActions>
|
|
152
152
|
<Button size="small">Button</Button>
|
|
153
|
-
<Button
|
|
153
|
+
<Button emphasis="ghost">
|
|
154
154
|
<Icon name="placeholder" />
|
|
155
155
|
</Button>
|
|
156
156
|
</CardActions>
|
|
@@ -249,7 +249,7 @@ export const VisuallyFocused: Story = {
|
|
|
249
249
|
<CardFooter>
|
|
250
250
|
<CardActions>
|
|
251
251
|
<Button size="small">Button</Button>
|
|
252
|
-
<Button
|
|
252
|
+
<Button emphasis="ghost">
|
|
253
253
|
<Icon name="placeholder" />
|
|
254
254
|
</Button>
|
|
255
255
|
</CardActions>
|
|
@@ -270,7 +270,7 @@ export const CardsInBox: Story = {
|
|
|
270
270
|
<CardFooter>
|
|
271
271
|
<CardActions>
|
|
272
272
|
<Button size="small">Button</Button>
|
|
273
|
-
<Button
|
|
273
|
+
<Button emphasis="ghost">
|
|
274
274
|
<Icon name="placeholder" />
|
|
275
275
|
</Button>
|
|
276
276
|
</CardActions>
|
|
@@ -284,7 +284,7 @@ export const CardsInBox: Story = {
|
|
|
284
284
|
<CardFooter>
|
|
285
285
|
<CardActions>
|
|
286
286
|
<Button size="small">Button</Button>
|
|
287
|
-
<Button
|
|
287
|
+
<Button emphasis="ghost">
|
|
288
288
|
<Icon name="placeholder" />
|
|
289
289
|
</Button>
|
|
290
290
|
</CardActions>
|
|
@@ -8,7 +8,7 @@ import { SlotDiv } from '../utility/SlotDiv.js';
|
|
|
8
8
|
|
|
9
9
|
export const CardRoot = withClassName(
|
|
10
10
|
withProps(Box, { container: 'reset' }),
|
|
11
|
-
'layer-components:(flex flex-col border-light rounded-lg text-lg overflow-hidden h-max-content relative bg-wash bg-darken-
|
|
11
|
+
'layer-components:(flex flex-col border-light rounded-lg text-lg overflow-hidden h-max-content relative bg-wash bg-darken-0.5 color-black shadow-sm)',
|
|
12
12
|
'layer-variants:[&[data-borderless=true]]:(border-none shadow-md)',
|
|
13
13
|
);
|
|
14
14
|
|
|
@@ -41,10 +41,13 @@ export function CardMain({
|
|
|
41
41
|
!!compact && 'layer-variants:(pb-0)',
|
|
42
42
|
isInteractive &&
|
|
43
43
|
classNames(
|
|
44
|
-
'layer-components:cursor-pointer
|
|
45
|
-
'layer-components:
|
|
46
|
-
'layer-components:
|
|
47
|
-
'layer-components:
|
|
44
|
+
'layer-components:cursor-pointer',
|
|
45
|
+
'layer-components:hover:(bg-black/10 color-black)',
|
|
46
|
+
'layer-components:focus:outline-none',
|
|
47
|
+
'layer-components:focus-visible:(outline-none bg-black/10 ring-inset ring-4 ring-accent)',
|
|
48
|
+
'layer-components:[&[data-visually-focused=true]]:(bg-black/10 ring-inset ring-4 ring-accent)',
|
|
49
|
+
'layer-components:disabled:(cursor-default)',
|
|
50
|
+
'layer-components:[&[data-visually-disabled=true]]:(cursor-default)',
|
|
48
51
|
),
|
|
49
52
|
className,
|
|
50
53
|
)}
|
|
@@ -59,14 +62,14 @@ export function CardMain({
|
|
|
59
62
|
|
|
60
63
|
export const CardTitle = withClassName(
|
|
61
64
|
'div',
|
|
62
|
-
'layer-components:(flex flex-col gap-1 mt-0 bg-white py-2 px-3 rounded-lg rounded-bl-none rounded-tr-none w-auto mr-auto border border-solid border-gray-dark-
|
|
65
|
+
'layer-components:(flex flex-col gap-1 mt-0 bg-white py-2 px-3 rounded-lg rounded-bl-none rounded-tr-none w-auto mr-auto border border-solid border-gray-dark/50 border-t-none border-l-none text-md max-h-80px overflow-hidden text-ellipsis max-w-full text-inherit font-semibold relative z-1 transition-colors)',
|
|
63
66
|
'layer-components:[[data-compact=true]_&]:(py-1 text-sm)',
|
|
64
67
|
'layer-components:[[data-interactive=true]:hover>&]:(bg-darken-2)',
|
|
65
68
|
);
|
|
66
69
|
|
|
67
70
|
const CardContentRoot = withClassName(
|
|
68
71
|
'div',
|
|
69
|
-
'layer-components:(flex flex-col gap-1 px-2 py-1 bg-
|
|
72
|
+
'layer-components:(flex flex-col gap-1 px-2 py-1 bg-white/80 color-black rounded-md mx-2 my-0.5 border border-solid border-gray-dark/50 text-xs relative z-1)',
|
|
70
73
|
'layer-variants:[[data-compact=true]_&]:(py-0 px-1 my-0 text-xs)',
|
|
71
74
|
'layer-variants:[&[data-unstyled=true]]:(p-0 [background:unset] border-none)',
|
|
72
75
|
);
|
|
@@ -90,12 +93,12 @@ export const CardFooter = withClassName(
|
|
|
90
93
|
|
|
91
94
|
export const CardActions = withClassName(
|
|
92
95
|
'div',
|
|
93
|
-
'layer-components:(ml-0 mr-auto flex flex-row gap-2 items-center bg-white rounded-lg p-0 border border-solid border-gray-dark
|
|
96
|
+
'layer-components:(ml-0 mr-auto flex flex-row gap-2 items-center bg-white/50 rounded-lg p-0 border border-solid border-gray-dark/50)',
|
|
94
97
|
);
|
|
95
98
|
|
|
96
99
|
export const CardMenu = withClassName(
|
|
97
100
|
'div',
|
|
98
|
-
'layer-components:(mr-0 ml-auto my-auto flex flex-row gap-1 items-center bg-
|
|
101
|
+
'layer-components:(mr-0 ml-auto my-auto flex flex-row gap-1 items-center bg-white/50 py-0.5 rounded-lg p-0)',
|
|
99
102
|
);
|
|
100
103
|
|
|
101
104
|
export const cardGridColumns = {
|
|
@@ -25,12 +25,13 @@ export function CheckboxRoot({
|
|
|
25
25
|
<CheckboxPrimitive.Root
|
|
26
26
|
{...props}
|
|
27
27
|
className={classNames(
|
|
28
|
-
'layer-components:(w-28px h-28px flex-shrink-0 relative bg-white border-default transition rounded-lg shadow-sm)',
|
|
29
|
-
'layer-components:focus-visible:(outline-off ring-4 ring-
|
|
28
|
+
'layer-components:(w-28px h-28px flex-shrink-0 relative bg-white border border-default transition-all rounded-lg shadow-sm cursor-pointer)',
|
|
29
|
+
'layer-components:focus-visible:(outline-off ring-4 ring-accent)',
|
|
30
30
|
checkedMode === 'faded'
|
|
31
|
-
? 'layer-components:[&[data-state=checked]]:(bg-
|
|
32
|
-
: 'layer-components:[&[data-state=checked]]:(bg-
|
|
33
|
-
'layer-components:[&:hover:not(:disabled)]:
|
|
31
|
+
? 'layer-components:[&[data-state=checked]]:(bg-main animate-checkbox-fade animate-forwards)'
|
|
32
|
+
: 'layer-components:[&[data-state=checked]]:(bg-main border-main-ink)',
|
|
33
|
+
'layer-components:[&:hover:not(:disabled)]:(bg-lighten-2 ring-bg ring-2)',
|
|
34
|
+
'layer-components:[&:active:not(:disabled)]:(bg-darken-1 ring-4)',
|
|
34
35
|
'layer-components:[&:disabled]:(bg-transparent border-gray-light shadow-none)',
|
|
35
36
|
className,
|
|
36
37
|
)}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Box } from '../box/Box.js';
|
|
3
|
+
import { Button } from '../button/Button.js';
|
|
4
|
+
import { Chip } from './Chip.js';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/Chip',
|
|
8
|
+
component: Chip,
|
|
9
|
+
argTypes: {},
|
|
10
|
+
args: {
|
|
11
|
+
children: 'Chip',
|
|
12
|
+
},
|
|
13
|
+
parameters: {
|
|
14
|
+
controls: { expanded: true },
|
|
15
|
+
},
|
|
16
|
+
} satisfies Meta<typeof Chip>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof Chip>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
render(args) {
|
|
24
|
+
return <Chip {...args} />;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const Colors: Story = {
|
|
29
|
+
render() {
|
|
30
|
+
return (
|
|
31
|
+
<div style={{ display: 'flex', gap: '12px' }}>
|
|
32
|
+
<Chip color="gray">Gray</Chip>
|
|
33
|
+
<Chip color="primary">Primary</Chip>
|
|
34
|
+
<Chip color="accent">Accent</Chip>
|
|
35
|
+
<Chip color="attention">Attention</Chip>
|
|
36
|
+
<Chip color="success">Success</Chip>
|
|
37
|
+
<Chip color="lemon">Lemon</Chip>
|
|
38
|
+
<Chip color="leek">Leek</Chip>
|
|
39
|
+
<Chip color="tomato">Tomato</Chip>
|
|
40
|
+
<Chip color="blueberry">Blueberry</Chip>
|
|
41
|
+
<Chip color="eggplant">Eggplant</Chip>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const AsButton: Story = {
|
|
48
|
+
render() {
|
|
49
|
+
return (
|
|
50
|
+
<Box gap items="center">
|
|
51
|
+
<Button asChild>
|
|
52
|
+
<Chip color="primary">Clickable Chip</Chip>
|
|
53
|
+
</Button>
|
|
54
|
+
<Chip>Non-clickable Chip</Chip>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import { Slot } from '@radix-ui/react-slot';
|
|
2
2
|
import classNames from 'clsx';
|
|
3
3
|
import { HTMLAttributes, Ref } from 'react';
|
|
4
|
+
import { PaletteName } from '../../uno/logic/color.js';
|
|
4
5
|
|
|
5
6
|
export interface ChipProps extends HTMLAttributes<HTMLElement> {
|
|
6
|
-
color?:
|
|
7
|
+
color?: PaletteName;
|
|
7
8
|
asChild?: boolean;
|
|
8
9
|
ref?: Ref<any>;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export function Chip({
|
|
12
|
-
className,
|
|
13
|
-
color = 'neutral',
|
|
14
|
-
asChild,
|
|
15
|
-
ref,
|
|
16
|
-
...rest
|
|
17
|
-
}: ChipProps) {
|
|
12
|
+
export function Chip({ className, color, asChild, ref, ...rest }: ChipProps) {
|
|
18
13
|
const Component = asChild ? Slot : 'div';
|
|
19
14
|
return (
|
|
20
15
|
<Component
|
|
21
16
|
ref={ref}
|
|
22
17
|
className={classNames(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
18
|
+
color && `palette-${color}`,
|
|
19
|
+
'layer-composed:(inline-flex flex-row gap-1 items-center whitespace-nowrap)',
|
|
20
|
+
'layer-composed:(bg-main-wash color-contrast border-light border-solid border rounded-lg)',
|
|
21
|
+
'layer-composed:(px-sm py-xs text-xs)',
|
|
28
22
|
className,
|
|
29
23
|
)}
|
|
24
|
+
role={rest.onClick ? 'button' : undefined}
|
|
30
25
|
{...rest}
|
|
31
26
|
/>
|
|
32
27
|
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ColorPicker } from './ColorPicker.js';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/ColorPicker',
|
|
6
|
+
component: ColorPicker,
|
|
7
|
+
argTypes: {},
|
|
8
|
+
parameters: {
|
|
9
|
+
controls: { expanded: true },
|
|
10
|
+
},
|
|
11
|
+
} satisfies Meta<typeof ColorPicker>;
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof ColorPicker>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
render(args) {
|
|
19
|
+
return <ColorPicker {...args} />;
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -32,13 +32,14 @@ export function ColorPicker({ value, onChange, showSalt }: ColorPickerProps) {
|
|
|
32
32
|
'leek',
|
|
33
33
|
'blueberry',
|
|
34
34
|
'eggplant',
|
|
35
|
+
'salt',
|
|
35
36
|
].includes(value || '')
|
|
36
37
|
? (value as ThemeName)
|
|
37
38
|
: 'lemon';
|
|
38
39
|
|
|
39
40
|
return (
|
|
40
41
|
<Select value={resolvedValue} onValueChange={onChange}>
|
|
41
|
-
<SelectTrigger>
|
|
42
|
+
<SelectTrigger className="layer-composed:p-sm">
|
|
42
43
|
<SelectValue />
|
|
43
44
|
</SelectTrigger>
|
|
44
45
|
<SelectContent className="z-[calc(var(--z-dialog)+1)]">
|
|
@@ -23,7 +23,7 @@ export const ContextMenuContent = function Content({
|
|
|
23
23
|
'layer-components:transform-origin-[var(--radix-context-menu-transform-origin)]',
|
|
24
24
|
'layer-components:[&[data-state=open]]:animate-popover-in',
|
|
25
25
|
'layer-components:[&[data-state=closed]]:animate-popover-out',
|
|
26
|
-
'layer-components:(max-h-[var(--radix-context-menu-content-available-height)] overflow-y-auto)',
|
|
26
|
+
'layer-components:(max-h-[var(--radix-context-menu-content-available-height)] overflow-y-auto overflow-unstable)',
|
|
27
27
|
'important:motion-reduce:animate-none',
|
|
28
28
|
className,
|
|
29
29
|
)}
|
|
@@ -42,13 +42,15 @@ export const ContextMenuContent = function Content({
|
|
|
42
42
|
|
|
43
43
|
export const ContextMenuArrow = withClassName(
|
|
44
44
|
ContextMenuPrimitive.Arrow,
|
|
45
|
-
'layer-components:
|
|
45
|
+
'layer-components:arrow',
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
export const ContextMenuItem = withClassName(
|
|
49
49
|
ContextMenuPrimitive.Item,
|
|
50
|
-
'
|
|
51
|
-
'layer-components:(
|
|
50
|
+
'palette-gray',
|
|
51
|
+
'layer-components:(flex items-center overflow-hidden min-h-touch py-sm px-2 relative pl-25px select-none outline-none cursor-pointer)',
|
|
52
|
+
'layer-components:hover:bg-main-light layer-components:[&[data-highlighted=true]]:bg-main-light',
|
|
53
|
+
'layer-components:[&[data-disabled=true]]:(opacity-50 cursor-default) layer-components:disabled:(opacity-50 cursor-default))',
|
|
52
54
|
);
|
|
53
55
|
|
|
54
56
|
export const ContextMenuTrigger = withClassName(
|