@a-type/ui 3.1.1 → 4.0.0-beta.2
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/components/actions/ActionBar.d.ts +1 -1
- package/dist/cjs/components/actions/ActionBar.js +2 -2
- package/dist/cjs/components/actions/ActionBar.js.map +1 -1
- package/dist/cjs/components/actions/ActionButton.d.ts +3 -3
- package/dist/cjs/components/actions/ActionButton.js +2 -2
- package/dist/cjs/components/actions/ActionButton.js.map +1 -1
- package/dist/cjs/components/avatar/Avatar.d.ts +4 -2
- package/dist/cjs/components/avatar/Avatar.js +4 -14
- package/dist/cjs/components/avatar/Avatar.js.map +1 -1
- package/dist/cjs/components/box/Box.stories.js +1 -1
- package/dist/cjs/components/box/Box.stories.js.map +1 -1
- package/dist/cjs/components/button/Button.d.ts +7 -7
- package/dist/cjs/components/button/Button.js +7 -12
- package/dist/cjs/components/button/Button.js.map +1 -1
- package/dist/cjs/components/button/Button.stories.d.ts +1 -1
- package/dist/cjs/components/button/ConfirmedButton.js +1 -2
- package/dist/cjs/components/button/ConfirmedButton.js.map +1 -1
- package/dist/cjs/components/camera/Camera.d.ts +4 -4
- package/dist/cjs/components/camera/Camera.js +6 -7
- package/dist/cjs/components/camera/Camera.js.map +1 -1
- package/dist/cjs/components/card/Card.d.ts +8 -2
- package/dist/cjs/components/card/Card.js +21 -9
- package/dist/cjs/components/card/Card.js.map +1 -1
- package/dist/cjs/components/card/Card.stories.js +3 -3
- package/dist/cjs/components/card/Card.stories.js.map +1 -1
- package/dist/cjs/components/checkbox/Checkbox.d.ts +3 -3
- package/dist/cjs/components/checkbox/Checkbox.js +5 -38
- 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 +3 -4
- package/dist/cjs/components/chip/Chip.js.map +1 -1
- package/dist/cjs/components/chip/Chip.stories.d.ts +6 -1
- package/dist/cjs/components/chip/Chip.stories.js +9 -3
- package/dist/cjs/components/chip/Chip.stories.js.map +1 -1
- package/dist/cjs/components/collapsible/Collapsible.d.ts +9 -9
- package/dist/cjs/components/collapsible/Collapsible.js +15 -38
- package/dist/cjs/components/collapsible/Collapsible.js.map +1 -1
- package/dist/cjs/components/collapsible/Collapsible.stories.d.ts +1 -1
- package/dist/cjs/components/colorMode/ColorModeToggle.d.ts +4 -2
- package/dist/cjs/components/colorMode/ColorModeToggle.js +8 -9
- package/dist/cjs/components/colorMode/ColorModeToggle.js.map +1 -1
- package/dist/cjs/components/colorPicker/ColorPicker.d.ts +4 -3
- package/dist/cjs/components/colorPicker/ColorPicker.js +8 -4
- package/dist/cjs/components/colorPicker/ColorPicker.js.map +1 -1
- package/dist/cjs/components/contextMenu/contextMenu.d.ts +11 -12
- package/dist/cjs/components/contextMenu/contextMenu.js +9 -42
- package/dist/cjs/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/cjs/components/contextMenu/contextMenu.stories.d.ts +22 -0
- package/dist/cjs/components/contextMenu/contextMenu.stories.js +22 -0
- package/dist/cjs/components/contextMenu/contextMenu.stories.js.map +1 -0
- package/dist/cjs/components/dialog/Dialog.d.ts +27 -22
- package/dist/cjs/components/dialog/Dialog.js +109 -80
- package/dist/cjs/components/dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/dialog/Dialog.stories.d.ts +8 -8
- package/dist/cjs/components/dialog/Dialog.stories.js +6 -6
- package/dist/cjs/components/dialog/Dialog.stories.js.map +1 -1
- package/dist/cjs/components/divider/Divider.js +2 -1
- package/dist/cjs/components/divider/Divider.js.map +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.d.ts +26 -21
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js +22 -19
- package/dist/cjs/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/cjs/components/dropdownMenu/DropdownMenu.stories.d.ts +3 -26
- package/dist/cjs/components/dropdownMenu/DropdownMenu.stories.js +6 -2
- package/dist/cjs/components/dropdownMenu/DropdownMenu.stories.js.map +1 -1
- package/dist/cjs/components/forms/EmojiField.d.ts +3 -2
- package/dist/cjs/components/forms/EmojiField.js +1 -1
- package/dist/cjs/components/forms/EmojiField.js.map +1 -1
- package/dist/cjs/components/forms/FormikForm.d.ts +2 -2
- package/dist/cjs/components/forms/FormikForm.stories.d.ts +2 -2
- package/dist/cjs/components/forms/SubmitButton.d.ts +1 -1
- package/dist/cjs/components/forms/SubmitButton.js +14 -2
- package/dist/cjs/components/forms/SubmitButton.js.map +1 -1
- package/dist/cjs/components/forms/TextField.js.map +1 -1
- package/dist/cjs/components/forms/ToggleGroupField.d.ts +3 -2
- package/dist/cjs/components/forms/ToggleGroupField.js +9 -2
- package/dist/cjs/components/forms/ToggleGroupField.js.map +1 -1
- package/dist/cjs/components/horizontalList/HorizontalList.d.ts +1 -3
- package/dist/cjs/components/horizontalList/HorizontalList.js +3 -3
- package/dist/cjs/components/horizontalList/HorizontalList.js.map +1 -1
- package/dist/cjs/components/horizontalList/HorizontalList.stories.js +1 -1
- package/dist/cjs/components/horizontalList/HorizontalList.stories.js.map +1 -1
- package/dist/cjs/components/icon/Icon.d.ts +7 -3
- package/dist/cjs/components/icon/Icon.js +14 -2
- package/dist/cjs/components/icon/Icon.js.map +1 -1
- package/dist/cjs/components/icon/Icon.stories.d.ts +28 -0
- package/dist/cjs/components/icon/Icon.stories.js +34 -0
- package/dist/cjs/components/icon/Icon.stories.js.map +1 -0
- package/dist/cjs/components/imageUploader/ImageUploader.js +1 -1
- package/dist/cjs/components/imageUploader/ImageUploader.js.map +1 -1
- package/dist/cjs/components/index.d.ts +1 -1
- package/dist/cjs/components/index.js +1 -4
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/input/Input.d.ts +1 -2
- package/dist/cjs/components/input/Input.js +4 -5
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/input/Input.stories.d.ts +1 -1
- package/dist/cjs/components/layouts/layouts.stories.js +6 -6
- package/dist/cjs/components/layouts/layouts.stories.js.map +1 -1
- package/dist/cjs/components/lightbox/Lightbox.d.ts +18 -16
- package/dist/cjs/components/lightbox/Lightbox.js +10 -43
- package/dist/cjs/components/lightbox/Lightbox.js.map +1 -1
- package/dist/cjs/components/lightbox/Lightbox.stories.d.ts +9 -7
- package/dist/cjs/components/marquee/marquee.stories.js +1 -1
- package/dist/cjs/components/marquee/marquee.stories.js.map +1 -1
- package/dist/cjs/components/navBar/NavBar.d.ts +9 -9
- package/dist/cjs/components/navBar/NavBar.js +5 -7
- package/dist/cjs/components/navBar/NavBar.js.map +1 -1
- package/dist/cjs/components/popover/Popover.d.ts +19 -13
- package/dist/cjs/components/popover/Popover.js +23 -50
- package/dist/cjs/components/popover/Popover.js.map +1 -1
- package/dist/cjs/components/popover/Popover.stories.d.ts +3 -23
- package/dist/cjs/components/popover/Popover.stories.js +7 -2
- package/dist/cjs/components/popover/Popover.stories.js.map +1 -1
- package/dist/cjs/components/progress/Progress.d.ts +22 -6
- package/dist/cjs/components/progress/Progress.js +17 -42
- package/dist/cjs/components/progress/Progress.js.map +1 -1
- package/dist/cjs/components/progress/Progress.stories.d.ts +13 -3
- package/dist/cjs/components/progress/Progress.stories.js +7 -2
- package/dist/cjs/components/progress/Progress.stories.js.map +1 -1
- package/dist/cjs/components/pwaInstall/PwaInstall.d.ts +3 -3
- package/dist/cjs/components/pwaInstall/PwaInstall.js +6 -4
- package/dist/cjs/components/pwaInstall/PwaInstall.js.map +1 -1
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.d.ts +1 -2
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.stories.js +1 -1
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.stories.js.map +1 -1
- package/dist/cjs/components/scrollArea/ScrollArea.d.ts +23 -28
- package/dist/cjs/components/scrollArea/ScrollArea.js +26 -56
- package/dist/cjs/components/scrollArea/ScrollArea.js.map +1 -1
- package/dist/cjs/components/scrollArea/ScrollArea.stories.d.ts +13 -10
- package/dist/cjs/components/scrollArea/ScrollArea.stories.js +16 -12
- package/dist/cjs/components/scrollArea/ScrollArea.stories.js.map +1 -1
- package/dist/cjs/components/select/Select.d.ts +37 -46
- package/dist/cjs/components/select/Select.js +37 -83
- package/dist/cjs/components/select/Select.js.map +1 -1
- package/dist/cjs/components/select/Select.stories.d.ts +15 -11
- package/dist/cjs/components/select/Select.stories.js +23 -2
- package/dist/cjs/components/select/Select.stories.js.map +1 -1
- package/dist/cjs/components/slider/Slider.d.ts +36 -13
- package/dist/cjs/components/slider/Slider.js +26 -41
- package/dist/cjs/components/slider/Slider.js.map +1 -1
- package/dist/cjs/components/slider/Slider.stories.d.ts +16 -7
- package/dist/cjs/components/slider/Slider.stories.js +23 -10
- package/dist/cjs/components/slider/Slider.stories.js.map +1 -1
- package/dist/cjs/components/switch/Switch.d.ts +4 -4
- package/dist/cjs/components/switch/Switch.js +3 -3
- package/dist/cjs/components/switch/Switch.js.map +1 -1
- package/dist/cjs/components/switch/Switch.stories.d.ts +27 -0
- package/dist/cjs/components/switch/Switch.stories.js +24 -0
- package/dist/cjs/components/switch/Switch.stories.js.map +1 -0
- package/dist/cjs/components/tabs/tabs.d.ts +16 -12
- package/dist/cjs/components/tabs/tabs.js +12 -47
- package/dist/cjs/components/tabs/tabs.js.map +1 -1
- package/dist/cjs/components/tabs/tabs.stories.js +3 -3
- package/dist/cjs/components/tabs/tabs.stories.js.map +1 -1
- package/dist/cjs/components/textArea/TextArea.d.ts +4 -4
- package/dist/cjs/components/textArea/TextArea.js +6 -8
- package/dist/cjs/components/textArea/TextArea.js.map +1 -1
- package/dist/cjs/components/textArea/TextArea.stories.d.ts +1 -1
- package/dist/cjs/components/toggleGroup/toggleGroup.d.ts +5 -6
- package/dist/cjs/components/toggleGroup/toggleGroup.js +6 -38
- package/dist/cjs/components/toggleGroup/toggleGroup.js.map +1 -1
- package/dist/cjs/components/toggleGroup/toggleGroup.stories.d.ts +17 -0
- package/dist/cjs/components/toggleGroup/toggleGroup.stories.js +21 -0
- package/dist/cjs/components/toggleGroup/toggleGroup.stories.js.map +1 -0
- package/dist/cjs/components/tooltip/Tooltip.d.ts +12 -9
- package/dist/cjs/components/tooltip/Tooltip.js +12 -43
- package/dist/cjs/components/tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/tooltip/Tooltip.stories.d.ts +2 -20
- package/dist/cjs/components/tooltip/Tooltip.stories.js +14 -5
- package/dist/cjs/components/tooltip/Tooltip.stories.js.map +1 -1
- package/dist/cjs/components/utility/ArrowSvg.d.ts +1 -0
- package/dist/cjs/components/utility/ArrowSvg.js +9 -0
- package/dist/cjs/components/utility/ArrowSvg.js.map +1 -0
- package/dist/cjs/components/utility/HideWhileKeyboardOpen.d.ts +1 -2
- package/dist/cjs/components/utility/HideWhileKeyboardOpen.js +3 -4
- package/dist/cjs/components/utility/HideWhileKeyboardOpen.js.map +1 -1
- package/dist/cjs/components/utility/SlotDiv.d.ts +3 -4
- package/dist/cjs/components/utility/SlotDiv.js +9 -7
- package/dist/cjs/components/utility/SlotDiv.js.map +1 -1
- package/dist/cjs/hooks/useTitleBarColor.stories.js +1 -1
- package/dist/cjs/hooks/useTitleBarColor.stories.js.map +1 -1
- package/dist/cjs/hooks/useVisualViewportOffset.js +31 -10
- package/dist/cjs/hooks/useVisualViewportOffset.js.map +1 -1
- package/dist/cjs/hooks/withClassName.d.ts +2 -2
- package/dist/cjs/hooks/withClassName.js.map +1 -1
- package/dist/cjs/themes.stories.js +2 -2
- package/dist/cjs/themes.stories.js.map +1 -1
- package/dist/cjs/uno/preflights/globals.js +29 -25
- package/dist/cjs/uno/preflights/globals.js.map +1 -1
- package/dist/cjs/uno/rules/util.js +18 -8
- package/dist/cjs/uno/rules/util.js.map +1 -1
- package/dist/cjs/uno/theme/animations.js +0 -74
- package/dist/cjs/uno/theme/animations.js.map +1 -1
- package/dist/css/main.css +9 -42
- package/dist/esm/components/actions/ActionBar.js +2 -2
- package/dist/esm/components/actions/ActionBar.js.map +1 -1
- package/dist/esm/components/actions/ActionButton.d.ts +3 -3
- package/dist/esm/components/actions/ActionButton.js +2 -2
- package/dist/esm/components/actions/ActionButton.js.map +1 -1
- package/dist/esm/components/avatar/Avatar.d.ts +4 -2
- package/dist/esm/components/avatar/Avatar.js +4 -14
- package/dist/esm/components/avatar/Avatar.js.map +1 -1
- package/dist/esm/components/box/Box.stories.js +1 -1
- package/dist/esm/components/box/Box.stories.js.map +1 -1
- package/dist/esm/components/button/Button.d.ts +7 -7
- package/dist/esm/components/button/Button.js +7 -12
- package/dist/esm/components/button/Button.js.map +1 -1
- package/dist/esm/components/button/Button.stories.d.ts +1 -1
- package/dist/esm/components/button/ConfirmedButton.js +1 -2
- package/dist/esm/components/button/ConfirmedButton.js.map +1 -1
- package/dist/esm/components/camera/Camera.d.ts +4 -4
- package/dist/esm/components/camera/Camera.js +6 -7
- package/dist/esm/components/camera/Camera.js.map +1 -1
- package/dist/esm/components/card/Card.d.ts +8 -2
- package/dist/esm/components/card/Card.js +21 -9
- package/dist/esm/components/card/Card.js.map +1 -1
- package/dist/esm/components/card/Card.stories.js +3 -3
- package/dist/esm/components/card/Card.stories.js.map +1 -1
- package/dist/esm/components/checkbox/Checkbox.d.ts +3 -3
- package/dist/esm/components/checkbox/Checkbox.js +5 -5
- package/dist/esm/components/checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/chip/Chip.d.ts +3 -2
- package/dist/esm/components/chip/Chip.js +3 -4
- package/dist/esm/components/chip/Chip.js.map +1 -1
- package/dist/esm/components/chip/Chip.stories.d.ts +6 -1
- package/dist/esm/components/chip/Chip.stories.js +9 -3
- package/dist/esm/components/chip/Chip.stories.js.map +1 -1
- package/dist/esm/components/collapsible/Collapsible.d.ts +9 -9
- package/dist/esm/components/collapsible/Collapsible.js +15 -5
- package/dist/esm/components/collapsible/Collapsible.js.map +1 -1
- package/dist/esm/components/collapsible/Collapsible.stories.d.ts +1 -1
- package/dist/esm/components/colorMode/ColorModeToggle.d.ts +4 -2
- package/dist/esm/components/colorMode/ColorModeToggle.js +8 -9
- package/dist/esm/components/colorMode/ColorModeToggle.js.map +1 -1
- package/dist/esm/components/colorPicker/ColorPicker.d.ts +4 -3
- package/dist/esm/components/colorPicker/ColorPicker.js +9 -5
- package/dist/esm/components/colorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/components/contextMenu/contextMenu.d.ts +11 -12
- package/dist/esm/components/contextMenu/contextMenu.js +9 -9
- package/dist/esm/components/contextMenu/contextMenu.js.map +1 -1
- package/dist/esm/components/contextMenu/contextMenu.stories.d.ts +22 -0
- package/dist/esm/components/contextMenu/contextMenu.stories.js +19 -0
- package/dist/esm/components/contextMenu/contextMenu.stories.js.map +1 -0
- package/dist/esm/components/dialog/Dialog.d.ts +27 -22
- package/dist/esm/components/dialog/Dialog.js +110 -49
- package/dist/esm/components/dialog/Dialog.js.map +1 -1
- package/dist/esm/components/dialog/Dialog.stories.d.ts +8 -8
- package/dist/esm/components/dialog/Dialog.stories.js +6 -6
- package/dist/esm/components/dialog/Dialog.stories.js.map +1 -1
- package/dist/esm/components/divider/Divider.js +2 -1
- package/dist/esm/components/divider/Divider.js.map +1 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.d.ts +26 -21
- package/dist/esm/components/dropdownMenu/DropdownMenu.js +22 -19
- package/dist/esm/components/dropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.stories.d.ts +3 -26
- package/dist/esm/components/dropdownMenu/DropdownMenu.stories.js +5 -1
- package/dist/esm/components/dropdownMenu/DropdownMenu.stories.js.map +1 -1
- package/dist/esm/components/forms/EmojiField.d.ts +3 -2
- package/dist/esm/components/forms/EmojiField.js +1 -1
- package/dist/esm/components/forms/EmojiField.js.map +1 -1
- package/dist/esm/components/forms/FormikForm.d.ts +2 -2
- package/dist/esm/components/forms/FormikForm.stories.d.ts +2 -2
- package/dist/esm/components/forms/SubmitButton.d.ts +1 -1
- package/dist/esm/components/forms/SubmitButton.js +14 -2
- package/dist/esm/components/forms/SubmitButton.js.map +1 -1
- package/dist/esm/components/forms/TextField.js.map +1 -1
- package/dist/esm/components/forms/ToggleGroupField.d.ts +3 -2
- package/dist/esm/components/forms/ToggleGroupField.js +9 -2
- package/dist/esm/components/forms/ToggleGroupField.js.map +1 -1
- package/dist/esm/components/horizontalList/HorizontalList.d.ts +1 -3
- package/dist/esm/components/horizontalList/HorizontalList.js +4 -4
- package/dist/esm/components/horizontalList/HorizontalList.js.map +1 -1
- package/dist/esm/components/horizontalList/HorizontalList.stories.js +1 -1
- package/dist/esm/components/horizontalList/HorizontalList.stories.js.map +1 -1
- package/dist/esm/components/icon/Icon.d.ts +7 -3
- package/dist/esm/components/icon/Icon.js +14 -2
- package/dist/esm/components/icon/Icon.js.map +1 -1
- package/dist/esm/components/icon/Icon.stories.d.ts +28 -0
- package/dist/esm/components/icon/Icon.stories.js +31 -0
- package/dist/esm/components/icon/Icon.stories.js.map +1 -0
- package/dist/esm/components/imageUploader/ImageUploader.js +1 -1
- package/dist/esm/components/imageUploader/ImageUploader.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/input/Input.d.ts +1 -2
- package/dist/esm/components/input/Input.js +4 -5
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/input/Input.stories.d.ts +1 -1
- package/dist/esm/components/layouts/layouts.stories.js +4 -4
- package/dist/esm/components/layouts/layouts.stories.js.map +1 -1
- package/dist/esm/components/lightbox/Lightbox.d.ts +18 -16
- package/dist/esm/components/lightbox/Lightbox.js +6 -6
- package/dist/esm/components/lightbox/Lightbox.js.map +1 -1
- package/dist/esm/components/lightbox/Lightbox.stories.d.ts +9 -7
- package/dist/esm/components/marquee/marquee.stories.js +1 -1
- package/dist/esm/components/marquee/marquee.stories.js.map +1 -1
- package/dist/esm/components/navBar/NavBar.d.ts +9 -9
- package/dist/esm/components/navBar/NavBar.js +5 -7
- package/dist/esm/components/navBar/NavBar.js.map +1 -1
- package/dist/esm/components/popover/Popover.d.ts +19 -13
- package/dist/esm/components/popover/Popover.js +18 -13
- package/dist/esm/components/popover/Popover.js.map +1 -1
- package/dist/esm/components/popover/Popover.stories.d.ts +3 -23
- package/dist/esm/components/popover/Popover.stories.js +6 -1
- package/dist/esm/components/popover/Popover.stories.js.map +1 -1
- package/dist/esm/components/progress/Progress.d.ts +22 -6
- package/dist/esm/components/progress/Progress.js +16 -9
- package/dist/esm/components/progress/Progress.js.map +1 -1
- package/dist/esm/components/progress/Progress.stories.d.ts +13 -3
- package/dist/esm/components/progress/Progress.stories.js +6 -1
- package/dist/esm/components/progress/Progress.stories.js.map +1 -1
- package/dist/esm/components/pwaInstall/PwaInstall.d.ts +3 -3
- package/dist/esm/components/pwaInstall/PwaInstall.js +6 -4
- package/dist/esm/components/pwaInstall/PwaInstall.js.map +1 -1
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.d.ts +1 -2
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.stories.js +1 -1
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.stories.js.map +1 -1
- package/dist/esm/components/scrollArea/ScrollArea.d.ts +23 -28
- package/dist/esm/components/scrollArea/ScrollArea.js +25 -21
- package/dist/esm/components/scrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/components/scrollArea/ScrollArea.stories.d.ts +13 -10
- package/dist/esm/components/scrollArea/ScrollArea.stories.js +13 -12
- package/dist/esm/components/scrollArea/ScrollArea.stories.js.map +1 -1
- package/dist/esm/components/select/Select.d.ts +37 -46
- package/dist/esm/components/select/Select.js +32 -77
- package/dist/esm/components/select/Select.js.map +1 -1
- package/dist/esm/components/select/Select.stories.d.ts +15 -11
- package/dist/esm/components/select/Select.stories.js +22 -1
- package/dist/esm/components/select/Select.stories.js.map +1 -1
- package/dist/esm/components/slider/Slider.d.ts +36 -13
- package/dist/esm/components/slider/Slider.js +23 -7
- package/dist/esm/components/slider/Slider.js.map +1 -1
- package/dist/esm/components/slider/Slider.stories.d.ts +16 -7
- package/dist/esm/components/slider/Slider.stories.js +22 -9
- package/dist/esm/components/slider/Slider.stories.js.map +1 -1
- package/dist/esm/components/switch/Switch.d.ts +4 -4
- package/dist/esm/components/switch/Switch.js +3 -3
- package/dist/esm/components/switch/Switch.js.map +1 -1
- package/dist/esm/components/switch/Switch.stories.d.ts +27 -0
- package/dist/esm/components/switch/Switch.stories.js +21 -0
- package/dist/esm/components/switch/Switch.stories.js.map +1 -0
- package/dist/esm/components/tabs/tabs.d.ts +16 -12
- package/dist/esm/components/tabs/tabs.js +10 -12
- package/dist/esm/components/tabs/tabs.js.map +1 -1
- package/dist/esm/components/tabs/tabs.stories.js +3 -3
- package/dist/esm/components/tabs/tabs.stories.js.map +1 -1
- package/dist/esm/components/textArea/TextArea.d.ts +4 -4
- package/dist/esm/components/textArea/TextArea.js +7 -9
- package/dist/esm/components/textArea/TextArea.js.map +1 -1
- package/dist/esm/components/textArea/TextArea.stories.d.ts +1 -1
- package/dist/esm/components/toggleGroup/toggleGroup.d.ts +5 -6
- package/dist/esm/components/toggleGroup/toggleGroup.js +4 -3
- package/dist/esm/components/toggleGroup/toggleGroup.js.map +1 -1
- package/dist/esm/components/toggleGroup/toggleGroup.stories.d.ts +17 -0
- package/dist/esm/components/toggleGroup/toggleGroup.stories.js +18 -0
- package/dist/esm/components/toggleGroup/toggleGroup.stories.js.map +1 -0
- package/dist/esm/components/tooltip/Tooltip.d.ts +12 -9
- package/dist/esm/components/tooltip/Tooltip.js +11 -9
- package/dist/esm/components/tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/tooltip/Tooltip.stories.d.ts +2 -20
- package/dist/esm/components/tooltip/Tooltip.stories.js +14 -5
- package/dist/esm/components/tooltip/Tooltip.stories.js.map +1 -1
- package/dist/esm/components/utility/ArrowSvg.d.ts +1 -0
- package/dist/esm/components/utility/ArrowSvg.js +6 -0
- package/dist/esm/components/utility/ArrowSvg.js.map +1 -0
- package/dist/esm/components/utility/HideWhileKeyboardOpen.d.ts +1 -2
- package/dist/esm/components/utility/HideWhileKeyboardOpen.js +3 -4
- package/dist/esm/components/utility/HideWhileKeyboardOpen.js.map +1 -1
- package/dist/esm/components/utility/SlotDiv.d.ts +3 -4
- package/dist/esm/components/utility/SlotDiv.js +9 -7
- package/dist/esm/components/utility/SlotDiv.js.map +1 -1
- package/dist/esm/hooks/useTitleBarColor.stories.js +1 -1
- package/dist/esm/hooks/useTitleBarColor.stories.js.map +1 -1
- package/dist/esm/hooks/useVisualViewportOffset.js +31 -10
- package/dist/esm/hooks/useVisualViewportOffset.js.map +1 -1
- package/dist/esm/hooks/withClassName.d.ts +2 -2
- package/dist/esm/hooks/withClassName.js +2 -2
- package/dist/esm/hooks/withClassName.js.map +1 -1
- package/dist/esm/themes.stories.js +2 -2
- package/dist/esm/themes.stories.js.map +1 -1
- package/dist/esm/uno/preflights/globals.js +29 -25
- package/dist/esm/uno/preflights/globals.js.map +1 -1
- package/dist/esm/uno/rules/util.js +18 -8
- package/dist/esm/uno/rules/util.js.map +1 -1
- package/dist/esm/uno/theme/animations.js +0 -74
- package/dist/esm/uno/theme/animations.js.map +1 -1
- package/package.json +1 -21
- package/src/components/actions/ActionBar.tsx +13 -9
- package/src/components/actions/ActionButton.tsx +2 -4
- package/src/components/avatar/Avatar.tsx +24 -40
- package/src/components/box/Box.stories.tsx +1 -1
- package/src/components/button/Button.tsx +13 -21
- package/src/components/button/ConfirmedButton.tsx +3 -7
- package/src/components/camera/Camera.tsx +23 -21
- package/src/components/card/Card.stories.tsx +22 -15
- package/src/components/card/Card.tsx +57 -40
- package/src/components/checkbox/Checkbox.tsx +13 -9
- package/src/components/chip/Chip.stories.tsx +13 -6
- package/src/components/chip/Chip.tsx +6 -7
- package/src/components/collapsible/Collapsible.tsx +29 -18
- package/src/components/colorMode/ColorModeToggle.tsx +13 -12
- package/src/components/colorPicker/ColorPicker.tsx +33 -27
- package/src/components/contextMenu/contextMenu.stories.tsx +39 -0
- package/src/components/contextMenu/contextMenu.tsx +33 -32
- package/src/components/dialog/Dialog.stories.tsx +15 -37
- package/src/components/dialog/Dialog.tsx +219 -102
- package/src/components/divider/Divider.tsx +5 -1
- package/src/components/dropdownMenu/DropdownMenu.stories.tsx +63 -5
- package/src/components/dropdownMenu/DropdownMenu.tsx +86 -47
- package/src/components/forms/EmojiField.tsx +18 -15
- package/src/components/forms/SubmitButton.tsx +2 -2
- package/src/components/forms/TextField.tsx +2 -2
- package/src/components/forms/ToggleGroupField.tsx +9 -1
- package/src/components/horizontalList/HorizontalList.stories.tsx +2 -2
- package/src/components/horizontalList/HorizontalList.tsx +10 -18
- package/src/components/icon/Icon.stories.tsx +47 -0
- package/src/components/icon/Icon.tsx +30 -17
- package/src/components/imageUploader/ImageUploader.tsx +8 -9
- package/src/components/index.ts +1 -1
- package/src/components/input/Input.tsx +3 -7
- package/src/components/layouts/layouts.stories.tsx +10 -16
- package/src/components/lightbox/Lightbox.tsx +25 -13
- package/src/components/marquee/marquee.stories.tsx +5 -3
- package/src/components/navBar/NavBar.tsx +9 -17
- package/src/components/popover/Popover.stories.tsx +25 -7
- package/src/components/popover/Popover.tsx +90 -38
- package/src/components/progress/Progress.stories.tsx +15 -3
- package/src/components/progress/Progress.tsx +65 -11
- package/src/components/pwaInstall/PwaInstall.tsx +21 -22
- package/src/components/pwaInstall/PwaInstallTrigger.stories.tsx +5 -4
- package/src/components/pwaInstall/PwaInstallTrigger.tsx +1 -1
- package/src/components/scrollArea/ScrollArea.stories.tsx +86 -45
- package/src/components/scrollArea/ScrollArea.tsx +108 -96
- package/src/components/select/Select.stories.tsx +39 -10
- package/src/components/select/Select.tsx +158 -218
- package/src/components/slider/Slider.stories.tsx +40 -15
- package/src/components/slider/Slider.tsx +60 -30
- package/src/components/switch/Switch.stories.tsx +24 -0
- package/src/components/switch/Switch.tsx +9 -8
- package/src/components/tabs/tabs.stories.tsx +7 -13
- package/src/components/tabs/tabs.tsx +35 -28
- package/src/components/textArea/TextArea.tsx +17 -25
- package/src/components/toggleGroup/toggleGroup.stories.tsx +27 -0
- package/src/components/toggleGroup/toggleGroup.tsx +10 -8
- package/src/components/tooltip/Tooltip.stories.tsx +20 -10
- package/src/components/tooltip/Tooltip.tsx +72 -30
- package/src/components/utility/ArrowSvg.tsx +15 -0
- package/src/components/utility/HideWhileKeyboardOpen.tsx +3 -8
- package/src/components/utility/SlotDiv.tsx +10 -10
- package/src/hooks/useTitleBarColor.stories.tsx +1 -3
- package/src/hooks/useVisualViewportOffset.ts +34 -11
- package/src/hooks/withClassName.tsx +3 -3
- package/src/themes.stories.tsx +10 -20
- package/src/uno/preflights/globals.ts +25 -21
- package/src/uno/rules/util.ts +18 -8
- package/src/uno/theme/animations.ts +0 -74
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRender, UseRenderRenderProp } from '@base-ui/react/use-render';
|
|
2
2
|
import classNames from 'clsx';
|
|
3
3
|
import {
|
|
4
4
|
CSSProperties,
|
|
@@ -23,16 +23,23 @@ export const CardRoot = withClassName(
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
export function CardMain({
|
|
26
|
-
asChild,
|
|
27
26
|
className,
|
|
28
27
|
compact,
|
|
29
28
|
nonInteractive,
|
|
30
29
|
ref,
|
|
31
30
|
style,
|
|
32
31
|
children,
|
|
32
|
+
visuallyDisabled,
|
|
33
|
+
visuallyFocused,
|
|
34
|
+
render,
|
|
33
35
|
...rest
|
|
34
36
|
}: {
|
|
35
|
-
|
|
37
|
+
render?: UseRenderRenderProp<{
|
|
38
|
+
visuallyFocused?: boolean;
|
|
39
|
+
visuallyDisabled?: boolean;
|
|
40
|
+
interactive?: boolean;
|
|
41
|
+
compact?: boolean;
|
|
42
|
+
}>;
|
|
36
43
|
className?: string;
|
|
37
44
|
onClick?: (ev: MouseEvent) => void;
|
|
38
45
|
children?: ReactNode;
|
|
@@ -44,42 +51,46 @@ export function CardMain({
|
|
|
44
51
|
style?: CSSProperties;
|
|
45
52
|
ref?: Ref<any>;
|
|
46
53
|
}) {
|
|
47
|
-
const isInteractive = !nonInteractive && (!!
|
|
48
|
-
const Comp = asChild ? Slot : isInteractive ? 'button' : 'div';
|
|
54
|
+
const isInteractive = !nonInteractive && (!!render || !!rest.onClick);
|
|
49
55
|
|
|
50
56
|
const scaleStyles = useGroupScaleStyles(style);
|
|
51
57
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
58
|
+
const rootProps = {
|
|
59
|
+
...rest,
|
|
60
|
+
className: classNames(
|
|
61
|
+
'layer-components:(flex flex-col items-start gap-1 transition pb-xs flex-1 min-h-40px bg-transparent)',
|
|
62
|
+
'layer-components:(border-none text-start text-inherit text-sm relative z-1 p-0 font-inherit outline-none rounded-t-md)',
|
|
63
|
+
!!compact && 'layer-variants:(pb-0)',
|
|
64
|
+
isInteractive &&
|
|
65
|
+
classNames(
|
|
66
|
+
'layer-components:cursor-pointer',
|
|
67
|
+
'layer-components:hover:(bg-black/10 color-black)',
|
|
68
|
+
'layer-components:focus:outline-none',
|
|
69
|
+
'layer-components:focus-visible:(outline-none bg-black/10 ring-inset ring-4 ring-accent)',
|
|
70
|
+
'layer-components:data-[visually-focused]:(bg-black/10 ring-inset ring-4 ring-accent)',
|
|
71
|
+
'layer-components:disabled:(cursor-default)',
|
|
72
|
+
'layer-components:data-[visually-disabled]:(cursor-default)',
|
|
73
|
+
),
|
|
74
|
+
className,
|
|
75
|
+
),
|
|
76
|
+
style: scaleStyles,
|
|
77
|
+
children,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const root = useRender({
|
|
81
|
+
defaultTagName: isInteractive ? 'button' : 'div',
|
|
82
|
+
props: rootProps,
|
|
83
|
+
ref,
|
|
84
|
+
render,
|
|
85
|
+
state: {
|
|
86
|
+
interactive: !!isInteractive,
|
|
87
|
+
compact: !!compact,
|
|
88
|
+
visuallyFocused: !!visuallyFocused,
|
|
89
|
+
visuallyDisabled: !!visuallyDisabled,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return <GroupScaleLayer>{root}</GroupScaleLayer>;
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
export const CardTitle = withClassName(
|
|
@@ -87,21 +98,27 @@ export const CardTitle = withClassName(
|
|
|
87
98
|
'layer-components:(flex flex-col gap-1 my-xs mx-xs py-xs px-sm w-auto max-h-80px max-w-full relative z-1)',
|
|
88
99
|
'layer-components:(bg-white rounded-md border border-solid border-gray-dark transition-colors)',
|
|
89
100
|
'layer-components:(text-md overflow-hidden text-ellipsis text-inherit font-semibold)',
|
|
90
|
-
'layer-components:[[data-compact
|
|
101
|
+
'layer-components:[[data-compact]_&]:(text-sm)',
|
|
91
102
|
);
|
|
92
103
|
|
|
93
104
|
const CardContentRoot = withClassName(
|
|
94
105
|
'div',
|
|
95
106
|
'layer-components:(flex flex-col gap-1 px-2 py-1 bg-white/80 color-black rounded-sm mx-2 my-0.5 border border-solid border-gray-dark/50 text-xs relative z-1)',
|
|
96
|
-
'layer-variants:[[data-compact
|
|
97
|
-
'layer-variants:[&[data-unstyled
|
|
107
|
+
'layer-variants:[[data-compact]_&]:(py-0 px-sm my-0 text-xs)',
|
|
108
|
+
'layer-variants:[&[data-unstyled]]:(p-0 [background:unset] border-none)',
|
|
98
109
|
);
|
|
99
110
|
export interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
100
111
|
unstyled?: boolean;
|
|
101
112
|
ref?: Ref<HTMLDivElement>;
|
|
102
113
|
}
|
|
103
114
|
export function CardContent({ unstyled, ref, ...rest }: CardContentProps) {
|
|
104
|
-
return
|
|
115
|
+
return (
|
|
116
|
+
<CardContentRoot
|
|
117
|
+
ref={ref}
|
|
118
|
+
data-unstyled={unstyled || undefined}
|
|
119
|
+
{...rest}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
105
122
|
}
|
|
106
123
|
|
|
107
124
|
export const CardImage = withClassName(
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import {
|
|
4
|
+
Checkbox as BaseCheckbox,
|
|
5
|
+
CheckboxIndicatorProps,
|
|
6
|
+
CheckboxRootProps,
|
|
7
|
+
} from '@base-ui/react/checkbox';
|
|
4
8
|
import classNames from 'clsx';
|
|
5
9
|
import { Ref } from 'react';
|
|
6
10
|
import { Icon } from '../icon/Icon.js';
|
|
7
11
|
|
|
8
|
-
export interface CheckboxProps extends
|
|
12
|
+
export interface CheckboxProps extends CheckboxRootProps {
|
|
9
13
|
/**
|
|
10
14
|
* The checked visual state. Prominent mode means the checked version is visually
|
|
11
15
|
* emphasized to the user. Faded means the checked version is visually de-emphasized.
|
|
@@ -22,14 +26,14 @@ export function CheckboxRoot({
|
|
|
22
26
|
...props
|
|
23
27
|
}: CheckboxProps) {
|
|
24
28
|
return (
|
|
25
|
-
<
|
|
29
|
+
<BaseCheckbox.Root
|
|
26
30
|
{...props}
|
|
27
31
|
className={classNames(
|
|
28
|
-
'layer-components:(w-28px h-28px flex-shrink-0 relative bg-white border border-default transition-all rounded-lg shadow-sm cursor-pointer)',
|
|
32
|
+
'layer-components:(block w-28px h-28px flex-shrink-0 relative bg-white border border-default transition-all rounded-lg shadow-sm cursor-pointer)',
|
|
29
33
|
'layer-components:focus-visible:(outline-off ring-4 ring-accent)',
|
|
30
34
|
checkedMode === 'faded'
|
|
31
|
-
? 'layer-components:
|
|
32
|
-
: 'layer-components:
|
|
35
|
+
? 'layer-components:data-[checked]:(bg-main animate-checkbox-fade animate-forwards)'
|
|
36
|
+
: 'layer-components:data-[checked]:(bg-main border-main-ink)',
|
|
33
37
|
'layer-components:[&:hover:not(:disabled)]:(bg-lighten-2 ring-bg ring-2)',
|
|
34
38
|
'layer-components:[&:active:not(:disabled)]:(bg-darken-1 ring-4)',
|
|
35
39
|
'layer-components:[&:disabled]:(bg-transparent border-gray-light shadow-none)',
|
|
@@ -43,14 +47,14 @@ export function CheckboxIndicator({
|
|
|
43
47
|
children,
|
|
44
48
|
className,
|
|
45
49
|
...props
|
|
46
|
-
}:
|
|
50
|
+
}: CheckboxIndicatorProps) {
|
|
47
51
|
return (
|
|
48
|
-
<
|
|
52
|
+
<BaseCheckbox.Indicator
|
|
49
53
|
className={classNames('absolute center color-black', className)}
|
|
50
54
|
{...props}
|
|
51
55
|
>
|
|
52
56
|
{children ?? <Icon name="check" size={16} />}
|
|
53
|
-
</
|
|
57
|
+
</BaseCheckbox.Indicator>
|
|
54
58
|
);
|
|
55
59
|
}
|
|
56
60
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { paletteNames } from '../../uno/index.js';
|
|
2
3
|
import { Box } from '../box/Box.js';
|
|
3
4
|
import { Button } from '../button/Button.js';
|
|
4
5
|
import { Chip } from './Chip.js';
|
|
@@ -6,7 +7,12 @@ import { Chip } from './Chip.js';
|
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Components/Chip',
|
|
8
9
|
component: Chip,
|
|
9
|
-
argTypes: {
|
|
10
|
+
argTypes: {
|
|
11
|
+
color: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: paletteNames,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
10
16
|
args: {
|
|
11
17
|
children: 'Chip',
|
|
12
18
|
},
|
|
@@ -45,13 +51,14 @@ export const Colors: Story = {
|
|
|
45
51
|
};
|
|
46
52
|
|
|
47
53
|
export const AsButton: Story = {
|
|
48
|
-
render() {
|
|
54
|
+
render(args) {
|
|
49
55
|
return (
|
|
50
56
|
<Box gap items="center">
|
|
51
|
-
<Button
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
<Button
|
|
58
|
+
{...args}
|
|
59
|
+
render={<Chip color="primary">Clickable Chip</Chip>}
|
|
60
|
+
/>
|
|
61
|
+
<Chip {...args}>Non-clickable Chip</Chip>
|
|
55
62
|
</Box>
|
|
56
63
|
);
|
|
57
64
|
},
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UseRenderRenderProp } from '@base-ui/react/use-render';
|
|
2
2
|
import classNames from 'clsx';
|
|
3
3
|
import { HTMLAttributes, Ref } from 'react';
|
|
4
4
|
import { PaletteName } from '../../uno/index.js';
|
|
5
|
+
import { SlotDiv } from '../utility/SlotDiv.js';
|
|
5
6
|
|
|
6
7
|
export interface ChipProps extends HTMLAttributes<HTMLElement> {
|
|
7
8
|
color?: PaletteName;
|
|
8
|
-
|
|
9
|
+
render?: UseRenderRenderProp;
|
|
9
10
|
ref?: Ref<any>;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export function Chip({ className, color,
|
|
13
|
-
const Component = asChild ? Slot : 'div';
|
|
13
|
+
export function Chip({ className, color, ...rest }: ChipProps) {
|
|
14
14
|
return (
|
|
15
|
-
<
|
|
16
|
-
ref={ref}
|
|
15
|
+
<SlotDiv
|
|
17
16
|
className={classNames(
|
|
18
17
|
color && `palette-${color}`,
|
|
19
|
-
'layer-composed:(inline-flex flex-row gap-1 items-center whitespace-nowrap)',
|
|
18
|
+
'layer-composed:(inline-flex flex-row gap-1 items-center whitespace-nowrap font-normal)',
|
|
20
19
|
'layer-composed:(bg-main-wash color-contrast border-light border-solid border rounded-lg)',
|
|
21
20
|
'layer-composed:(px-sm py-xs text-xs)',
|
|
22
21
|
className,
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
Collapsible as BaseCollapsible,
|
|
4
|
+
CollapsiblePanelProps,
|
|
5
|
+
CollapsibleRootProps,
|
|
6
|
+
} from '@base-ui/react/collapsible';
|
|
3
7
|
import { Ref } from 'react';
|
|
4
8
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
5
9
|
|
|
6
|
-
export const CollapsibleRoot =
|
|
10
|
+
export const CollapsibleRoot = BaseCollapsible.Root;
|
|
7
11
|
const CollapsibleContentBase = withClassName(
|
|
8
|
-
|
|
9
|
-
'overflow-hidden',
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
12
|
+
BaseCollapsible.Panel,
|
|
13
|
+
'overflow-hidden transition-all',
|
|
14
|
+
'data-[vertical]:h-[--collapsible-panel-height] data-[horizontal]:w-[--collapsible-panel-width]',
|
|
15
|
+
'data-[both]:(h-[--collapsible-panel-height] w-[--collapsible-panel-width])',
|
|
16
|
+
'data-[starting-style]:data-[vertical]:(h-0)',
|
|
17
|
+
'data-[starting-style]:data-[both]:(h-0 w-0)',
|
|
18
|
+
'data-[ending-style]:data-[vertical]:(h-0)',
|
|
19
|
+
'data-[ending-style]:data-[both]:(h-0 w-0)',
|
|
20
|
+
'data-[starting-style]:data-[horizontal]:(w-0)',
|
|
21
|
+
'data-[ending-style]:data-[horizontal]:(w-0)',
|
|
22
|
+
'data-[hidden]:[&:not([hidden="until-found"])]:(hidden)',
|
|
13
23
|
);
|
|
14
24
|
// specifically removing className... it's causing problems?
|
|
15
25
|
export const CollapsibleContent = function CollapsibleContent({
|
|
@@ -17,28 +27,29 @@ export const CollapsibleContent = function CollapsibleContent({
|
|
|
17
27
|
horizontal,
|
|
18
28
|
both,
|
|
19
29
|
...props
|
|
20
|
-
}:
|
|
30
|
+
}: CollapsiblePanelProps & {
|
|
21
31
|
horizontal?: boolean;
|
|
22
32
|
both?: boolean;
|
|
23
33
|
ref?: Ref<HTMLDivElement>;
|
|
24
34
|
}) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
const extraProps: any = {};
|
|
36
|
+
if (horizontal) {
|
|
37
|
+
extraProps['data-horizontal'] = true;
|
|
38
|
+
} else if (both) {
|
|
39
|
+
extraProps['data-both'] = true;
|
|
40
|
+
} else {
|
|
41
|
+
extraProps['data-vertical'] = true;
|
|
42
|
+
}
|
|
43
|
+
return <CollapsibleContentBase {...extraProps} {...props} ref={ref} />;
|
|
33
44
|
};
|
|
34
|
-
export const CollapsibleTrigger =
|
|
45
|
+
export const CollapsibleTrigger = BaseCollapsible.Trigger;
|
|
35
46
|
|
|
36
47
|
export const CollapsibleSimple = ({
|
|
37
48
|
horizontal,
|
|
38
49
|
both,
|
|
39
50
|
children,
|
|
40
51
|
...props
|
|
41
|
-
}:
|
|
52
|
+
}: CollapsibleRootProps & {
|
|
42
53
|
horizontal?: boolean;
|
|
43
54
|
both?: boolean;
|
|
44
55
|
}) => (
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ToggleGroupProps } from '@base-ui/react/toggle-group';
|
|
2
2
|
import { setColorMode, useColorMode } from '../../colorMode.js';
|
|
3
3
|
import { Icon } from '../icon/Icon.js';
|
|
4
4
|
import { ToggleGroup } from '../toggleGroup/toggleGroup.js';
|
|
5
5
|
|
|
6
6
|
export interface ColorModeToggleProps
|
|
7
|
-
extends Omit<
|
|
7
|
+
extends Omit<ToggleGroupProps, 'type' | 'onValueChange' | 'value'> {
|
|
8
|
+
value?: 'light' | 'dark' | 'system';
|
|
9
|
+
onValueChange?: (value: 'light' | 'dark' | 'system', event: any) => void;
|
|
10
|
+
}
|
|
8
11
|
|
|
9
12
|
export function ColorModeToggle({
|
|
10
13
|
value: userValue,
|
|
@@ -14,19 +17,17 @@ export function ColorModeToggle({
|
|
|
14
17
|
}: ColorModeToggleProps) {
|
|
15
18
|
const colorMode = useColorMode();
|
|
16
19
|
const value = userValue ?? colorMode;
|
|
17
|
-
const onValueChange = (value: string) => {
|
|
18
|
-
if (userOnValueChange) {
|
|
19
|
-
userOnValueChange(value);
|
|
20
|
-
} else {
|
|
21
|
-
setColorMode(value as 'light' | 'dark' | 'system');
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
20
|
|
|
25
21
|
return (
|
|
26
22
|
<ToggleGroup
|
|
27
|
-
value={value}
|
|
28
|
-
onValueChange={
|
|
29
|
-
|
|
23
|
+
value={[value]}
|
|
24
|
+
onValueChange={([value], ev) => {
|
|
25
|
+
if (userOnValueChange) {
|
|
26
|
+
userOnValueChange(value, ev);
|
|
27
|
+
} else {
|
|
28
|
+
setColorMode(value as 'light' | 'dark' | 'system');
|
|
29
|
+
}
|
|
30
|
+
}}
|
|
30
31
|
className={className}
|
|
31
32
|
{...rest}
|
|
32
33
|
>
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { SelectTriggerProps } from '@
|
|
1
|
+
import { SelectTriggerProps } from '@base-ui/react/select';
|
|
2
2
|
import classNames, { clsx } from 'clsx';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
5
5
|
import { PaletteName, paletteNames } from '../../uno/index.js';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
SelectContent,
|
|
9
|
-
SelectItem,
|
|
10
|
-
SelectTrigger,
|
|
11
|
-
SelectValue,
|
|
12
|
-
} from '../select/Select.js';
|
|
6
|
+
import { Button } from '../button/index.js';
|
|
7
|
+
import { Select } from '../select/Select.js';
|
|
13
8
|
|
|
14
9
|
export interface ColorPickerProps
|
|
15
10
|
extends Omit<SelectTriggerProps, 'value' | 'onChange' | 'color'> {
|
|
@@ -23,47 +18,53 @@ export function ColorPicker({
|
|
|
23
18
|
onChange,
|
|
24
19
|
showGray,
|
|
25
20
|
className,
|
|
21
|
+
nativeButton: _,
|
|
26
22
|
...rest
|
|
27
23
|
}: ColorPickerProps) {
|
|
28
24
|
const resolvedValue =
|
|
29
25
|
value && paletteNames.includes(value) ? (value as PaletteName) : 'lemon';
|
|
30
26
|
|
|
31
27
|
return (
|
|
32
|
-
<Select
|
|
33
|
-
|
|
28
|
+
<Select
|
|
29
|
+
value={resolvedValue}
|
|
30
|
+
onValueChange={(v) => {
|
|
31
|
+
onChange(v as PaletteName);
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<Select.Trigger
|
|
34
35
|
className={clsx('layer-composed:p-sm', className)}
|
|
35
|
-
{...rest}
|
|
36
|
+
{...(rest as any)}
|
|
36
37
|
>
|
|
37
|
-
<
|
|
38
|
-
</
|
|
39
|
-
<
|
|
40
|
-
<
|
|
38
|
+
<Button.Icon render={<ColorSwatch value={resolvedValue} />} />
|
|
39
|
+
</Select.Trigger>
|
|
40
|
+
<Select.Content className="z-[calc(var(--z-dialog)+1)]">
|
|
41
|
+
<Select.Item value="lemon">
|
|
41
42
|
<ColorSwatch value="lemon" />
|
|
42
43
|
<ItemLabel>Lemon</ItemLabel>
|
|
43
|
-
</
|
|
44
|
-
<
|
|
44
|
+
</Select.Item>
|
|
45
|
+
<Select.Item value="tomato">
|
|
45
46
|
<ColorSwatch value="tomato" />
|
|
46
47
|
<ItemLabel>Tomato</ItemLabel>
|
|
47
|
-
</
|
|
48
|
-
<
|
|
48
|
+
</Select.Item>
|
|
49
|
+
<Select.Item value="leek">
|
|
49
50
|
<ColorSwatch value="leek" />
|
|
50
51
|
<ItemLabel>Leek</ItemLabel>
|
|
51
|
-
</
|
|
52
|
-
<
|
|
52
|
+
</Select.Item>
|
|
53
|
+
<Select.Item value="blueberry">
|
|
53
54
|
<ColorSwatch value="blueberry" />
|
|
54
55
|
<ItemLabel>Blueberry</ItemLabel>
|
|
55
|
-
</
|
|
56
|
-
<
|
|
56
|
+
</Select.Item>
|
|
57
|
+
<Select.Item value="eggplant">
|
|
57
58
|
<ColorSwatch value="eggplant" />
|
|
58
59
|
<ItemLabel>Eggplant</ItemLabel>
|
|
59
|
-
</
|
|
60
|
+
</Select.Item>
|
|
60
61
|
{showGray && (
|
|
61
|
-
<
|
|
62
|
+
<Select.Item value="gray">
|
|
62
63
|
<ColorSwatch value="gray" />
|
|
63
64
|
<ItemLabel>Salt</ItemLabel>
|
|
64
|
-
</
|
|
65
|
+
</Select.Item>
|
|
65
66
|
)}
|
|
66
|
-
</
|
|
67
|
+
</Select.Content>
|
|
67
68
|
</Select>
|
|
68
69
|
);
|
|
69
70
|
}
|
|
@@ -73,16 +74,21 @@ const ItemLabel = withClassName('span', 'sr-only');
|
|
|
73
74
|
export function ColorSwatch({
|
|
74
75
|
value,
|
|
75
76
|
children,
|
|
77
|
+
className,
|
|
78
|
+
...rest
|
|
76
79
|
}: {
|
|
77
80
|
value: PaletteName;
|
|
78
81
|
children?: ReactNode;
|
|
82
|
+
className?: string;
|
|
79
83
|
}) {
|
|
80
84
|
return (
|
|
81
85
|
<div
|
|
82
86
|
className={classNames(
|
|
83
87
|
'bg-main w-16px h-16px rounded-sm',
|
|
84
88
|
`palette-${value ?? 'lemon'}`,
|
|
89
|
+
className,
|
|
85
90
|
)}
|
|
91
|
+
{...rest}
|
|
86
92
|
>
|
|
87
93
|
{children}
|
|
88
94
|
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button } from '../button/index.js';
|
|
3
|
+
import { ContextMenu } from './contextMenu.js';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/ContextMenu',
|
|
7
|
+
component: ContextMenu,
|
|
8
|
+
argTypes: {},
|
|
9
|
+
parameters: {
|
|
10
|
+
controls: { expanded: true },
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<typeof ContextMenu>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof ContextMenu>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
render(args) {
|
|
20
|
+
return (
|
|
21
|
+
<ContextMenu {...args}>
|
|
22
|
+
<ContextMenu.Trigger>
|
|
23
|
+
<Button>Right Click Me</Button>
|
|
24
|
+
</ContextMenu.Trigger>
|
|
25
|
+
<ContextMenu.Content>
|
|
26
|
+
<ContextMenu.Item onSelect={() => alert('Item 1 selected')}>
|
|
27
|
+
Item 1
|
|
28
|
+
</ContextMenu.Item>
|
|
29
|
+
<ContextMenu.Item onSelect={() => alert('Item 2 selected')}>
|
|
30
|
+
Item 2
|
|
31
|
+
</ContextMenu.Item>
|
|
32
|
+
<ContextMenu.Item onSelect={() => alert('Item 3 selected')}>
|
|
33
|
+
Item 3
|
|
34
|
+
</ContextMenu.Item>
|
|
35
|
+
</ContextMenu.Content>
|
|
36
|
+
</ContextMenu>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
ContextMenu as BaseContextMenu,
|
|
3
|
+
ContextMenuPopupProps,
|
|
4
|
+
} from '@base-ui/react/context-menu';
|
|
2
5
|
import classNames from 'clsx';
|
|
3
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
4
6
|
import { withClassName } from '../../hooks/withClassName.js';
|
|
5
7
|
import { GroupScaleReset } from '../../systems/GroupScale.js';
|
|
6
8
|
|
|
7
|
-
export const ContextMenuRoot =
|
|
9
|
+
export const ContextMenuRoot = BaseContextMenu.Root;
|
|
8
10
|
|
|
9
11
|
export const ContextMenuContent = function Content({
|
|
10
12
|
ref,
|
|
11
13
|
className,
|
|
12
14
|
onClick,
|
|
13
15
|
...props
|
|
14
|
-
}:
|
|
16
|
+
}: ContextMenuPopupProps & {
|
|
15
17
|
ref?: React.Ref<HTMLDivElement>;
|
|
16
18
|
}) {
|
|
17
19
|
return (
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onClick
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
<BaseContextMenu.Portal>
|
|
21
|
+
<BaseContextMenu.Positioner alignOffset={-10}>
|
|
22
|
+
<GroupScaleReset>
|
|
23
|
+
<BaseContextMenu.Popup
|
|
24
|
+
className={classNames(
|
|
25
|
+
'layer-components:(min-w-120px bg-white rounded-md overflow-hidden border-gray-dark border shadow-md z-menu)',
|
|
26
|
+
'layer-components:transform-origin-[var(--transform-origin)]',
|
|
27
|
+
'layer-components:data-[starting-style]:(opacity-0 scale-95)',
|
|
28
|
+
'layer-components:data-[ending-style]:(opacity-0 scale-95)',
|
|
29
|
+
'layer-components:(overflow-y-auto overflow-unstable)',
|
|
30
|
+
'important:motion-reduce:animate-none',
|
|
31
|
+
'layer-components:(max-h-[--available-height] max-w-[--available-width])',
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
onClick={(ev) => {
|
|
35
|
+
ev.stopPropagation();
|
|
36
|
+
onClick?.(ev);
|
|
37
|
+
}}
|
|
38
|
+
ref={ref}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
</GroupScaleReset>
|
|
42
|
+
</BaseContextMenu.Positioner>
|
|
43
|
+
</BaseContextMenu.Portal>
|
|
40
44
|
);
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
export const ContextMenuArrow = withClassName(
|
|
44
|
-
|
|
48
|
+
BaseContextMenu.Arrow,
|
|
45
49
|
'layer-components:arrow',
|
|
46
50
|
);
|
|
47
51
|
|
|
48
52
|
export const ContextMenuItem = withClassName(
|
|
49
|
-
|
|
53
|
+
BaseContextMenu.Item,
|
|
50
54
|
'palette-gray',
|
|
51
55
|
'layer-components:(flex items-center overflow-hidden min-h-touch-large py-sm px-2 relative pl-25px select-none outline-none cursor-pointer)',
|
|
52
56
|
'layer-components:hover:bg-main-light layer-components:[&[data-highlighted=true]]:bg-main-light',
|
|
53
57
|
'layer-components:[&[data-disabled=true]]:(opacity-50 cursor-default) layer-components:disabled:(opacity-50 cursor-default))',
|
|
54
58
|
);
|
|
55
59
|
|
|
56
|
-
export const ContextMenuTrigger = withClassName(
|
|
57
|
-
ContextMenuPrimitive.Trigger,
|
|
58
|
-
'',
|
|
59
|
-
);
|
|
60
|
+
export const ContextMenuTrigger = withClassName(BaseContextMenu.Trigger, '');
|
|
60
61
|
|
|
61
62
|
export const ContextMenu = Object.assign(ContextMenuRoot, {
|
|
62
63
|
Content: ContextMenuContent,
|