@pickle-ui/react 0.0.0-stage → 1.0.0-beta.4
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/README.md +490 -2
- package/dist/components/Alert.d.ts +38 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/components/Alert.js +54 -0
- package/dist/components/Alert.js.map +1 -0
- package/dist/components/AlertDialog.d.ts +41 -0
- package/dist/components/AlertDialog.d.ts.map +1 -0
- package/dist/components/AlertDialog.js +47 -0
- package/dist/components/AlertDialog.js.map +1 -0
- package/dist/components/Avatar.d.ts +18 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar.js +34 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Badge.d.ts +12 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +37 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Button.d.ts +19 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +66 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Card.d.ts +27 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +34 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Dialog.d.ts +38 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog.js +41 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/Flex.d.ts +22 -0
- package/dist/components/Flex.d.ts.map +1 -0
- package/dist/components/Flex.js +20 -0
- package/dist/components/Flex.js.map +1 -0
- package/dist/components/Grid.d.ts +66 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/Grid.js +63 -0
- package/dist/components/Grid.js.map +1 -0
- package/dist/components/Group.d.ts +20 -0
- package/dist/components/Group.d.ts.map +1 -0
- package/dist/components/Group.js +43 -0
- package/dist/components/Group.js.map +1 -0
- package/dist/components/Menu.d.ts +53 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/Menu.js +78 -0
- package/dist/components/Menu.js.map +1 -0
- package/dist/components/Popover.d.ts +27 -0
- package/dist/components/Popover.d.ts.map +1 -0
- package/dist/components/Popover.js +34 -0
- package/dist/components/Popover.js.map +1 -0
- package/dist/components/Progress.d.ts +23 -0
- package/dist/components/Progress.d.ts.map +1 -0
- package/dist/components/Progress.js +26 -0
- package/dist/components/Progress.js.map +1 -0
- package/dist/components/ScrollArea.d.ts +32 -0
- package/dist/components/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea.js +36 -0
- package/dist/components/ScrollArea.js.map +1 -0
- package/dist/components/Separator.d.ts +7 -0
- package/dist/components/Separator.d.ts.map +1 -0
- package/dist/components/Separator.js +8 -0
- package/dist/components/Separator.js.map +1 -0
- package/dist/components/Sidebar.d.ts +35 -0
- package/dist/components/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar.js +45 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/Spinner.d.ts +11 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +13 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Table.d.ts +32 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Table.js +37 -0
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Text.d.ts +14 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/Text.js +50 -0
- package/dist/components/Text.js.map +1 -0
- package/dist/components/Toast.d.ts +39 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +97 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/Tooltip.d.ts +18 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +22 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/XStack.d.ts +6 -0
- package/dist/components/XStack.d.ts.map +1 -0
- package/dist/components/XStack.js +8 -0
- package/dist/components/XStack.js.map +1 -0
- package/dist/components/YStack.d.ts +6 -0
- package/dist/components/YStack.d.ts.map +1 -0
- package/dist/components/YStack.js +8 -0
- package/dist/components/YStack.js.map +1 -0
- package/dist/components/_internal/VisuallyHiddenInput.d.ts +11 -0
- package/dist/components/_internal/VisuallyHiddenInput.d.ts.map +1 -0
- package/dist/components/_internal/VisuallyHiddenInput.js +105 -0
- package/dist/components/_internal/VisuallyHiddenInput.js.map +1 -0
- package/dist/components/_internal/dialog-styles.d.ts +15 -0
- package/dist/components/_internal/dialog-styles.d.ts.map +1 -0
- package/dist/components/_internal/dialog-styles.js +27 -0
- package/dist/components/_internal/dialog-styles.js.map +1 -0
- package/dist/components/_internal/layout.d.ts +46 -0
- package/dist/components/_internal/layout.d.ts.map +1 -0
- package/dist/components/_internal/layout.js +72 -0
- package/dist/components/_internal/layout.js.map +1 -0
- package/dist/components/form/Checkbox.d.ts +19 -0
- package/dist/components/form/Checkbox.d.ts.map +1 -0
- package/dist/components/form/Checkbox.js +27 -0
- package/dist/components/form/Checkbox.js.map +1 -0
- package/dist/components/form/ColorPicker.d.ts +25 -0
- package/dist/components/form/ColorPicker.d.ts.map +1 -0
- package/dist/components/form/ColorPicker.js +14 -0
- package/dist/components/form/ColorPicker.js.map +1 -0
- package/dist/components/form/ColorPickerPrimitive.d.ts +65 -0
- package/dist/components/form/ColorPickerPrimitive.d.ts.map +1 -0
- package/dist/components/form/ColorPickerPrimitive.js +486 -0
- package/dist/components/form/ColorPickerPrimitive.js.map +1 -0
- package/dist/components/form/Combobox.d.ts +86 -0
- package/dist/components/form/Combobox.d.ts.map +1 -0
- package/dist/components/form/Combobox.js +198 -0
- package/dist/components/form/Combobox.js.map +1 -0
- package/dist/components/form/Form.context.d.ts +28 -0
- package/dist/components/form/Form.context.d.ts.map +1 -0
- package/dist/components/form/Form.context.js +56 -0
- package/dist/components/form/Form.context.js.map +1 -0
- package/dist/components/form/Form.d.ts +68 -0
- package/dist/components/form/Form.d.ts.map +1 -0
- package/dist/components/form/Form.js +32 -0
- package/dist/components/form/Form.js.map +1 -0
- package/dist/components/form/FormCheckbox.d.ts +10 -0
- package/dist/components/form/FormCheckbox.d.ts.map +1 -0
- package/dist/components/form/FormCheckbox.js +24 -0
- package/dist/components/form/FormCheckbox.js.map +1 -0
- package/dist/components/form/FormCombobox.d.ts +28 -0
- package/dist/components/form/FormCombobox.d.ts.map +1 -0
- package/dist/components/form/FormCombobox.js +50 -0
- package/dist/components/form/FormCombobox.js.map +1 -0
- package/dist/components/form/FormDescription.d.ts +7 -0
- package/dist/components/form/FormDescription.d.ts.map +1 -0
- package/dist/components/form/FormDescription.js +9 -0
- package/dist/components/form/FormDescription.js.map +1 -0
- package/dist/components/form/FormError.d.ts +7 -0
- package/dist/components/form/FormError.d.ts.map +1 -0
- package/dist/components/form/FormError.js +9 -0
- package/dist/components/form/FormError.js.map +1 -0
- package/dist/components/form/FormField.d.ts +13 -0
- package/dist/components/form/FormField.d.ts.map +1 -0
- package/dist/components/form/FormField.js +45 -0
- package/dist/components/form/FormField.js.map +1 -0
- package/dist/components/form/FormInput.d.ts +8 -0
- package/dist/components/form/FormInput.d.ts.map +1 -0
- package/dist/components/form/FormInput.js +17 -0
- package/dist/components/form/FormInput.js.map +1 -0
- package/dist/components/form/FormInputGroup.d.ts +7 -0
- package/dist/components/form/FormInputGroup.d.ts.map +1 -0
- package/dist/components/form/FormInputGroup.js +30 -0
- package/dist/components/form/FormInputGroup.js.map +1 -0
- package/dist/components/form/FormLabel.d.ts +7 -0
- package/dist/components/form/FormLabel.d.ts.map +1 -0
- package/dist/components/form/FormLabel.js +9 -0
- package/dist/components/form/FormLabel.js.map +1 -0
- package/dist/components/form/FormRadioGroup.d.ts +14 -0
- package/dist/components/form/FormRadioGroup.d.ts.map +1 -0
- package/dist/components/form/FormRadioGroup.js +25 -0
- package/dist/components/form/FormRadioGroup.js.map +1 -0
- package/dist/components/form/FormRoot.d.ts +10 -0
- package/dist/components/form/FormRoot.d.ts.map +1 -0
- package/dist/components/form/FormRoot.js +10 -0
- package/dist/components/form/FormRoot.js.map +1 -0
- package/dist/components/form/FormSelect.d.ts +19 -0
- package/dist/components/form/FormSelect.d.ts.map +1 -0
- package/dist/components/form/FormSelect.js +34 -0
- package/dist/components/form/FormSelect.js.map +1 -0
- package/dist/components/form/FormSwitch.d.ts +10 -0
- package/dist/components/form/FormSwitch.d.ts.map +1 -0
- package/dist/components/form/FormSwitch.js +24 -0
- package/dist/components/form/FormSwitch.js.map +1 -0
- package/dist/components/form/FormTextarea.d.ts +8 -0
- package/dist/components/form/FormTextarea.d.ts.map +1 -0
- package/dist/components/form/FormTextarea.js +13 -0
- package/dist/components/form/FormTextarea.js.map +1 -0
- package/dist/components/form/Input.d.ts +14 -0
- package/dist/components/form/Input.d.ts.map +1 -0
- package/dist/components/form/Input.js +22 -0
- package/dist/components/form/Input.js.map +1 -0
- package/dist/components/form/InputGroup.d.ts +26 -0
- package/dist/components/form/InputGroup.d.ts.map +1 -0
- package/dist/components/form/InputGroup.js +58 -0
- package/dist/components/form/InputGroup.js.map +1 -0
- package/dist/components/form/RadioGroup.d.ts +23 -0
- package/dist/components/form/RadioGroup.d.ts.map +1 -0
- package/dist/components/form/RadioGroup.js +30 -0
- package/dist/components/form/RadioGroup.js.map +1 -0
- package/dist/components/form/Select.d.ts +42 -0
- package/dist/components/form/Select.d.ts.map +1 -0
- package/dist/components/form/Select.js +68 -0
- package/dist/components/form/Select.js.map +1 -0
- package/dist/components/form/Slider.d.ts +37 -0
- package/dist/components/form/Slider.d.ts.map +1 -0
- package/dist/components/form/Slider.js +35 -0
- package/dist/components/form/Slider.js.map +1 -0
- package/dist/components/form/Switch.d.ts +23 -0
- package/dist/components/form/Switch.d.ts.map +1 -0
- package/dist/components/form/Switch.js +21 -0
- package/dist/components/form/Switch.js.map +1 -0
- package/dist/components/form/Textarea.d.ts +16 -0
- package/dist/components/form/Textarea.d.ts.map +1 -0
- package/dist/components/form/Textarea.js +12 -0
- package/dist/components/form/Textarea.js.map +1 -0
- package/dist/entries/alert-dialog.d.ts +3 -0
- package/dist/entries/alert-dialog.d.ts.map +1 -0
- package/dist/entries/alert-dialog.js +2 -0
- package/dist/entries/alert-dialog.js.map +1 -0
- package/dist/entries/alert.d.ts +3 -0
- package/dist/entries/alert.d.ts.map +1 -0
- package/dist/entries/alert.js +2 -0
- package/dist/entries/alert.js.map +1 -0
- package/dist/entries/avatar.d.ts +3 -0
- package/dist/entries/avatar.d.ts.map +1 -0
- package/dist/entries/avatar.js +2 -0
- package/dist/entries/avatar.js.map +1 -0
- package/dist/entries/badge.d.ts +3 -0
- package/dist/entries/badge.d.ts.map +1 -0
- package/dist/entries/badge.js +2 -0
- package/dist/entries/badge.js.map +1 -0
- package/dist/entries/button.d.ts +3 -0
- package/dist/entries/button.d.ts.map +1 -0
- package/dist/entries/button.js +2 -0
- package/dist/entries/button.js.map +1 -0
- package/dist/entries/card.d.ts +3 -0
- package/dist/entries/card.d.ts.map +1 -0
- package/dist/entries/card.js +2 -0
- package/dist/entries/card.js.map +1 -0
- package/dist/entries/checkbox.d.ts +3 -0
- package/dist/entries/checkbox.d.ts.map +1 -0
- package/dist/entries/checkbox.js +2 -0
- package/dist/entries/checkbox.js.map +1 -0
- package/dist/entries/cn.d.ts +3 -0
- package/dist/entries/cn.d.ts.map +1 -0
- package/dist/entries/cn.js +2 -0
- package/dist/entries/cn.js.map +1 -0
- package/dist/entries/color-picker.d.ts +3 -0
- package/dist/entries/color-picker.d.ts.map +1 -0
- package/dist/entries/color-picker.js +2 -0
- package/dist/entries/color-picker.js.map +1 -0
- package/dist/entries/combobox.d.ts +3 -0
- package/dist/entries/combobox.d.ts.map +1 -0
- package/dist/entries/combobox.js +2 -0
- package/dist/entries/combobox.js.map +1 -0
- package/dist/entries/dialog.d.ts +3 -0
- package/dist/entries/dialog.d.ts.map +1 -0
- package/dist/entries/dialog.js +2 -0
- package/dist/entries/dialog.js.map +1 -0
- package/dist/entries/flex.d.ts +3 -0
- package/dist/entries/flex.d.ts.map +1 -0
- package/dist/entries/flex.js +2 -0
- package/dist/entries/flex.js.map +1 -0
- package/dist/entries/form.d.ts +3 -0
- package/dist/entries/form.d.ts.map +1 -0
- package/dist/entries/form.js +2 -0
- package/dist/entries/form.js.map +1 -0
- package/dist/entries/grid.d.ts +3 -0
- package/dist/entries/grid.d.ts.map +1 -0
- package/dist/entries/grid.js +2 -0
- package/dist/entries/grid.js.map +1 -0
- package/dist/entries/group.d.ts +3 -0
- package/dist/entries/group.d.ts.map +1 -0
- package/dist/entries/group.js +2 -0
- package/dist/entries/group.js.map +1 -0
- package/dist/entries/input-group.d.ts +3 -0
- package/dist/entries/input-group.d.ts.map +1 -0
- package/dist/entries/input-group.js +2 -0
- package/dist/entries/input-group.js.map +1 -0
- package/dist/entries/input.d.ts +3 -0
- package/dist/entries/input.d.ts.map +1 -0
- package/dist/entries/input.js +2 -0
- package/dist/entries/input.js.map +1 -0
- package/dist/entries/menu.d.ts +3 -0
- package/dist/entries/menu.d.ts.map +1 -0
- package/dist/entries/menu.js +2 -0
- package/dist/entries/menu.js.map +1 -0
- package/dist/entries/popover.d.ts +3 -0
- package/dist/entries/popover.d.ts.map +1 -0
- package/dist/entries/popover.js +2 -0
- package/dist/entries/popover.js.map +1 -0
- package/dist/entries/progress.d.ts +3 -0
- package/dist/entries/progress.d.ts.map +1 -0
- package/dist/entries/progress.js +2 -0
- package/dist/entries/progress.js.map +1 -0
- package/dist/entries/radio-group.d.ts +3 -0
- package/dist/entries/radio-group.d.ts.map +1 -0
- package/dist/entries/radio-group.js +2 -0
- package/dist/entries/radio-group.js.map +1 -0
- package/dist/entries/scroll-area.d.ts +3 -0
- package/dist/entries/scroll-area.d.ts.map +1 -0
- package/dist/entries/scroll-area.js +2 -0
- package/dist/entries/scroll-area.js.map +1 -0
- package/dist/entries/select.d.ts +3 -0
- package/dist/entries/select.d.ts.map +1 -0
- package/dist/entries/select.js +2 -0
- package/dist/entries/select.js.map +1 -0
- package/dist/entries/separator.d.ts +3 -0
- package/dist/entries/separator.d.ts.map +1 -0
- package/dist/entries/separator.js +2 -0
- package/dist/entries/separator.js.map +1 -0
- package/dist/entries/sidebar.d.ts +3 -0
- package/dist/entries/sidebar.d.ts.map +1 -0
- package/dist/entries/sidebar.js +2 -0
- package/dist/entries/sidebar.js.map +1 -0
- package/dist/entries/slider.d.ts +3 -0
- package/dist/entries/slider.d.ts.map +1 -0
- package/dist/entries/slider.js +2 -0
- package/dist/entries/slider.js.map +1 -0
- package/dist/entries/spinner.d.ts +3 -0
- package/dist/entries/spinner.d.ts.map +1 -0
- package/dist/entries/spinner.js +2 -0
- package/dist/entries/spinner.js.map +1 -0
- package/dist/entries/switch.d.ts +3 -0
- package/dist/entries/switch.d.ts.map +1 -0
- package/dist/entries/switch.js +2 -0
- package/dist/entries/switch.js.map +1 -0
- package/dist/entries/table.d.ts +3 -0
- package/dist/entries/table.d.ts.map +1 -0
- package/dist/entries/table.js +2 -0
- package/dist/entries/table.js.map +1 -0
- package/dist/entries/text.d.ts +3 -0
- package/dist/entries/text.d.ts.map +1 -0
- package/dist/entries/text.js +2 -0
- package/dist/entries/text.js.map +1 -0
- package/dist/entries/textarea.d.ts +3 -0
- package/dist/entries/textarea.d.ts.map +1 -0
- package/dist/entries/textarea.js +2 -0
- package/dist/entries/textarea.js.map +1 -0
- package/dist/entries/theme.d.ts +3 -0
- package/dist/entries/theme.d.ts.map +1 -0
- package/dist/entries/theme.js +2 -0
- package/dist/entries/theme.js.map +1 -0
- package/dist/entries/toast.d.ts +3 -0
- package/dist/entries/toast.d.ts.map +1 -0
- package/dist/entries/toast.js +2 -0
- package/dist/entries/toast.js.map +1 -0
- package/dist/entries/tooltip.d.ts +3 -0
- package/dist/entries/tooltip.d.ts.map +1 -0
- package/dist/entries/tooltip.js +2 -0
- package/dist/entries/tooltip.js.map +1 -0
- package/dist/entries/x-stack.d.ts +3 -0
- package/dist/entries/x-stack.d.ts.map +1 -0
- package/dist/entries/x-stack.js +2 -0
- package/dist/entries/x-stack.js.map +1 -0
- package/dist/entries/y-stack.d.ts +3 -0
- package/dist/entries/y-stack.d.ts.map +1 -0
- package/dist/entries/y-stack.js +2 -0
- package/dist/entries/y-stack.js.map +1 -0
- package/dist/hooks/use-as-ref.d.ts +4 -0
- package/dist/hooks/use-as-ref.d.ts.map +1 -0
- package/dist/hooks/use-as-ref.js +11 -0
- package/dist/hooks/use-as-ref.js.map +1 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +4 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/hooks/use-isomorphic-layout-effect.js +4 -0
- package/dist/hooks/use-isomorphic-layout-effect.js.map +1 -0
- package/dist/hooks/use-lazy-ref.d.ts +4 -0
- package/dist/hooks/use-lazy-ref.d.ts.map +1 -0
- package/dist/hooks/use-lazy-ref.js +10 -0
- package/dist/hooks/use-lazy-ref.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/color.d.ts +42 -0
- package/dist/lib/color.d.ts.map +1 -0
- package/dist/lib/color.js +140 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/compose-refs.d.ts +14 -0
- package/dist/lib/compose-refs.d.ts.map +1 -0
- package/dist/lib/compose-refs.js +57 -0
- package/dist/lib/compose-refs.js.map +1 -0
- package/dist/lib/theme.d.ts +40 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +82 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +18 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +2 -0
- package/dist/test-setup.js.map +1 -0
- package/package.json +107 -4
- package/src/base.css +99 -0
- package/src/components/Alert.stories.tsx +124 -0
- package/src/components/Alert.test.tsx +76 -0
- package/src/components/Alert.tsx +133 -0
- package/src/components/AlertDialog.stories.tsx +184 -0
- package/src/components/AlertDialog.test.tsx +142 -0
- package/src/components/AlertDialog.tsx +164 -0
- package/src/components/Avatar.stories.tsx +92 -0
- package/src/components/Avatar.test.tsx +26 -0
- package/src/components/Avatar.tsx +96 -0
- package/src/components/Badge.stories.tsx +52 -0
- package/src/components/Badge.test.tsx +35 -0
- package/src/components/Badge.tsx +65 -0
- package/src/components/Button.stories.tsx +171 -0
- package/src/components/Button.test.tsx +112 -0
- package/src/components/Button.tsx +114 -0
- package/src/components/Card.stories.tsx +62 -0
- package/src/components/Card.test.tsx +23 -0
- package/src/components/Card.tsx +129 -0
- package/src/components/Dialog.stories.tsx +133 -0
- package/src/components/Dialog.test.tsx +95 -0
- package/src/components/Dialog.tsx +147 -0
- package/src/components/Flex.stories.tsx +70 -0
- package/src/components/Flex.test.tsx +53 -0
- package/src/components/Flex.tsx +59 -0
- package/src/components/Grid.stories.tsx +70 -0
- package/src/components/Grid.test.tsx +46 -0
- package/src/components/Grid.tsx +114 -0
- package/src/components/Group.stories.tsx +130 -0
- package/src/components/Group.test.tsx +57 -0
- package/src/components/Group.tsx +92 -0
- package/src/components/Menu.stories.tsx +139 -0
- package/src/components/Menu.test.tsx +103 -0
- package/src/components/Menu.tsx +290 -0
- package/src/components/Popover.stories.tsx +72 -0
- package/src/components/Popover.tsx +117 -0
- package/src/components/Progress.stories.tsx +105 -0
- package/src/components/Progress.test.tsx +28 -0
- package/src/components/Progress.tsx +111 -0
- package/src/components/ScrollArea.stories.tsx +66 -0
- package/src/components/ScrollArea.test.tsx +32 -0
- package/src/components/ScrollArea.tsx +160 -0
- package/src/components/Separator.stories.tsx +39 -0
- package/src/components/Separator.test.tsx +24 -0
- package/src/components/Separator.tsx +27 -0
- package/src/components/Sidebar.stories.tsx +87 -0
- package/src/components/Sidebar.tsx +166 -0
- package/src/components/Spinner.stories.tsx +36 -0
- package/src/components/Spinner.test.tsx +25 -0
- package/src/components/Spinner.tsx +31 -0
- package/src/components/Table.stories.tsx +76 -0
- package/src/components/Table.tsx +151 -0
- package/src/components/Text.stories.tsx +148 -0
- package/src/components/Text.test.tsx +106 -0
- package/src/components/Text.tsx +85 -0
- package/src/components/Toast.stories.tsx +166 -0
- package/src/components/Toast.test.tsx +97 -0
- package/src/components/Toast.tsx +270 -0
- package/src/components/Tooltip.stories.tsx +116 -0
- package/src/components/Tooltip.test.tsx +51 -0
- package/src/components/Tooltip.tsx +80 -0
- package/src/components/XStack.stories.tsx +64 -0
- package/src/components/XStack.test.tsx +33 -0
- package/src/components/XStack.tsx +19 -0
- package/src/components/YStack.stories.tsx +65 -0
- package/src/components/YStack.test.tsx +31 -0
- package/src/components/YStack.tsx +19 -0
- package/src/components/_internal/Story.tsx +161 -0
- package/src/components/_internal/VisuallyHiddenInput.tsx +164 -0
- package/src/components/_internal/dialog-styles.ts +57 -0
- package/src/components/_internal/layout.ts +103 -0
- package/src/components/form/Checkbox.stories.tsx +78 -0
- package/src/components/form/Checkbox.test.tsx +107 -0
- package/src/components/form/Checkbox.tsx +95 -0
- package/src/components/form/ColorPicker.stories.tsx +160 -0
- package/src/components/form/ColorPicker.test.tsx +45 -0
- package/src/components/form/ColorPicker.tsx +55 -0
- package/src/components/form/ColorPickerPrimitive.test.tsx +14 -0
- package/src/components/form/ColorPickerPrimitive.tsx +1283 -0
- package/src/components/form/Combobox.stories.tsx +378 -0
- package/src/components/form/Combobox.test.tsx +334 -0
- package/src/components/form/Combobox.tsx +667 -0
- package/src/components/form/Form.context.ts +114 -0
- package/src/components/form/Form.stories.tsx +226 -0
- package/src/components/form/Form.test.tsx +293 -0
- package/src/components/form/Form.tsx +50 -0
- package/src/components/form/FormCheckbox.tsx +50 -0
- package/src/components/form/FormCombobox.tsx +92 -0
- package/src/components/form/FormDescription.tsx +21 -0
- package/src/components/form/FormError.tsx +21 -0
- package/src/components/form/FormField.tsx +109 -0
- package/src/components/form/FormInput.tsx +41 -0
- package/src/components/form/FormInputGroup.tsx +47 -0
- package/src/components/form/FormLabel.tsx +24 -0
- package/src/components/form/FormRadioGroup.tsx +46 -0
- package/src/components/form/FormRoot.tsx +41 -0
- package/src/components/form/FormSelect.tsx +60 -0
- package/src/components/form/FormSwitch.tsx +50 -0
- package/src/components/form/FormTextarea.tsx +34 -0
- package/src/components/form/Input.stories.tsx +114 -0
- package/src/components/form/Input.test.tsx +62 -0
- package/src/components/form/Input.tsx +93 -0
- package/src/components/form/InputGroup.stories.tsx +162 -0
- package/src/components/form/InputGroup.tsx +149 -0
- package/src/components/form/RadioGroup.stories.tsx +68 -0
- package/src/components/form/RadioGroup.test.tsx +171 -0
- package/src/components/form/RadioGroup.tsx +127 -0
- package/src/components/form/Select.stories.tsx +115 -0
- package/src/components/form/Select.test.tsx +115 -0
- package/src/components/form/Select.tsx +293 -0
- package/src/components/form/Slider.stories.tsx +121 -0
- package/src/components/form/Slider.test.tsx +33 -0
- package/src/components/form/Slider.tsx +200 -0
- package/src/components/form/Switch.stories.tsx +62 -0
- package/src/components/form/Switch.test.tsx +29 -0
- package/src/components/form/Switch.tsx +81 -0
- package/src/components/form/Textarea.stories.tsx +71 -0
- package/src/components/form/Textarea.test.tsx +31 -0
- package/src/components/form/Textarea.tsx +46 -0
- package/src/entries/alert-dialog.ts +11 -0
- package/src/entries/alert.ts +8 -0
- package/src/entries/avatar.ts +7 -0
- package/src/entries/badge.ts +2 -0
- package/src/entries/button.ts +2 -0
- package/src/entries/card.ts +10 -0
- package/src/entries/checkbox.ts +5 -0
- package/src/entries/cn.ts +2 -0
- package/src/entries/color-picker.ts +13 -0
- package/src/entries/combobox.ts +20 -0
- package/src/entries/dialog.ts +11 -0
- package/src/entries/entries.test.ts +65 -0
- package/src/entries/flex.ts +2 -0
- package/src/entries/form.ts +16 -0
- package/src/entries/grid.ts +2 -0
- package/src/entries/group.ts +6 -0
- package/src/entries/input-group.ts +8 -0
- package/src/entries/input.ts +2 -0
- package/src/entries/menu.ts +17 -0
- package/src/entries/popover.ts +10 -0
- package/src/entries/progress.ts +8 -0
- package/src/entries/radio-group.ts +5 -0
- package/src/entries/scroll-area.ts +10 -0
- package/src/entries/select.ts +12 -0
- package/src/entries/separator.ts +2 -0
- package/src/entries/sidebar.ts +13 -0
- package/src/entries/slider.ts +7 -0
- package/src/entries/spinner.ts +2 -0
- package/src/entries/switch.ts +2 -0
- package/src/entries/table.ts +11 -0
- package/src/entries/text.ts +2 -0
- package/src/entries/textarea.ts +2 -0
- package/src/entries/theme.ts +8 -0
- package/src/entries/toast.ts +2 -0
- package/src/entries/tooltip.ts +7 -0
- package/src/entries/x-stack.ts +2 -0
- package/src/entries/y-stack.ts +2 -0
- package/src/hooks/use-as-ref.ts +15 -0
- package/src/hooks/use-isomorphic-layout-effect.ts +6 -0
- package/src/hooks/use-lazy-ref.ts +13 -0
- package/src/index.ts +38 -0
- package/src/lib/color.test.ts +148 -0
- package/src/lib/color.ts +193 -0
- package/src/lib/compose-refs.ts +63 -0
- package/src/lib/theme.test.ts +64 -0
- package/src/lib/theme.ts +143 -0
- package/src/lib/utils.ts +25 -0
- package/src/public-api.test.ts +74 -0
- package/src/styles.css +2 -0
- package/src/test-setup.ts +1 -0
- package/src/theme.css +195 -0
package/README.md
CHANGED
|
@@ -1,3 +1,491 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pickle UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A React component library built with Base UI and Tailwind CSS v4.
|
|
4
|
+
|
|
5
|
+
Browse every component in the [Storybook](https://ugogo.github.io/pickle-ui/).
|
|
6
|
+
|
|
7
|
+
## Use Pickle UI
|
|
8
|
+
|
|
9
|
+
Install Pickle with its peer dependencies. React Hook Form is only used by
|
|
10
|
+
the `Form` components, but it is declared as a peer so your package manager
|
|
11
|
+
expects it:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @pickle-ui/react tailwindcss react-hook-form
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Pickle requires Tailwind CSS v4 and React 18 or 19.
|
|
18
|
+
|
|
19
|
+
To match Pickle's Storybook typography, install Geist and JetBrains Mono:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @fontsource-variable/geist @fontsource/jetbrains-mono
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load the fonts and your application stylesheet from the application entry
|
|
26
|
+
point:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import '@fontsource-variable/geist/wght.css';
|
|
30
|
+
import '@fontsource/jetbrains-mono/latin-400.css';
|
|
31
|
+
import './app.css';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Create `app.css`:
|
|
35
|
+
|
|
36
|
+
```css
|
|
37
|
+
@import 'tailwindcss';
|
|
38
|
+
@import '@pickle-ui/react/styles.css';
|
|
39
|
+
|
|
40
|
+
@theme {
|
|
41
|
+
--font-sans: 'Geist Variable', ui-sans-serif, system-ui, sans-serif;
|
|
42
|
+
--font-heading: var(--font-sans);
|
|
43
|
+
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@layer base {
|
|
47
|
+
body {
|
|
48
|
+
@apply bg-background text-foreground;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
html {
|
|
52
|
+
@apply font-sans antialiased;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The font packages are optional. Omit their imports and the `@theme` block to
|
|
58
|
+
use Tailwind's system font stacks.
|
|
59
|
+
|
|
60
|
+
You do not need to add Pickle to your Tailwind `@source` list: the stylesheet
|
|
61
|
+
declares its own component sources, so every class Pickle uses is generated
|
|
62
|
+
alongside yours.
|
|
63
|
+
|
|
64
|
+
Import components from `@pickle-ui/react`:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { Button } from '@pickle-ui/react';
|
|
68
|
+
|
|
69
|
+
export function App() {
|
|
70
|
+
return <Button>Click me</Button>;
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For smaller bundles, import only the components you need via subpath exports:
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { Button } from '@pickle-ui/react/button';
|
|
78
|
+
import { Form } from '@pickle-ui/react/form';
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Subpaths use the same named exports as the root entry (for example `Button` from
|
|
82
|
+
`@pickle-ui/react/button`, not a default export).
|
|
83
|
+
|
|
84
|
+
| Subpath | Exports |
|
|
85
|
+
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
|
|
86
|
+
| `@pickle-ui/react/alert` | `Alert` with `Icon`, `Title`, `Description`, `Action` |
|
|
87
|
+
| `@pickle-ui/react/alert-dialog` | `AlertDialog` with `Trigger`, `Content`, `Header`, `Title`, `Description`, `Footer`, `Close` |
|
|
88
|
+
| `@pickle-ui/react/avatar` | `Avatar` with `Image`, `Fallback`, `Group` |
|
|
89
|
+
| `@pickle-ui/react/badge` | `Badge`, `badgeVariants` |
|
|
90
|
+
| `@pickle-ui/react/button` | `Button`, `buttonVariants` |
|
|
91
|
+
| `@pickle-ui/react/card` | `Card` with `Header`, `Title`, `Description`, `Action`, `Content`, `Footer` |
|
|
92
|
+
| `@pickle-ui/react/checkbox` | `Checkbox` with `Label` |
|
|
93
|
+
| `@pickle-ui/react/color-picker` | `ColorPicker` with `Trigger`, `Content`, `Area`, `HueSlider`, `AlphaSlider`, `Swatch`, `Input`, … |
|
|
94
|
+
| `@pickle-ui/react/combobox` | `Combobox` with `Input`, `Content`, `List`, `Item`, `Chips`, … |
|
|
95
|
+
| `@pickle-ui/react/dialog` | `Dialog` with `Trigger`, `Content`, `Header`, `Title`, `Description`, `Footer`, `Close` |
|
|
96
|
+
| `@pickle-ui/react/flex`, `@pickle-ui/react/grid` | `Flex`, `Grid` layout primitives |
|
|
97
|
+
| `@pickle-ui/react/x-stack`, `@pickle-ui/react/y-stack` | `XStack`, `YStack` row and column shorthands |
|
|
98
|
+
| `@pickle-ui/react/form` | `Form` with `Field`, `Label`, `Description`, `Error`, `Button` and every React Hook Form-bound control |
|
|
99
|
+
| `@pickle-ui/react/group` | `Group` with `Separator`, `Text`, for attached button and input groups |
|
|
100
|
+
| `@pickle-ui/react/input` | `Input` |
|
|
101
|
+
| `@pickle-ui/react/input-group` | `InputGroup` with `Input`, `Addon`, `Button`, `Text` |
|
|
102
|
+
| `@pickle-ui/react/menu` | `Menu` with `Trigger`, `Content`, `Item`, `CheckboxItem`, `RadioGroup`, `Sub`, `Shortcut`, … |
|
|
103
|
+
| `@pickle-ui/react/popover` | `Popover` with `Trigger`, `Content`, `Header`, `Title`, `Description`, `Anchor` |
|
|
104
|
+
| `@pickle-ui/react/progress` | `Progress` with `Label`, `Value`, `Track`, `Indicator` |
|
|
105
|
+
| `@pickle-ui/react/radio-group` | `RadioGroup` with `Item` |
|
|
106
|
+
| `@pickle-ui/react/scroll-area` | `ScrollArea` with `Viewport`, `Scrollbar`, `Thumb`, `Corner` |
|
|
107
|
+
| `@pickle-ui/react/select` | `Select` with `Trigger`, `Value`, `Content`, `Item`, `Group`, … |
|
|
108
|
+
| `@pickle-ui/react/separator` | `Separator` |
|
|
109
|
+
| `@pickle-ui/react/sidebar` | `Sidebar` with `Header`, `Content`, `Footer`, `Group`, `Menu`, … |
|
|
110
|
+
| `@pickle-ui/react/slider` | `Slider` with `Label`, `Value`, `Marks` |
|
|
111
|
+
| `@pickle-ui/react/spinner` | `Spinner` |
|
|
112
|
+
| `@pickle-ui/react/switch` | `Switch` with `Label` |
|
|
113
|
+
| `@pickle-ui/react/table` | `Table` with `Header`, `Body`, `Footer`, `Row`, `Head`, `Cell`, `Caption` |
|
|
114
|
+
| `@pickle-ui/react/text` | `Text`, `textVariants` for headings and body copy |
|
|
115
|
+
| `@pickle-ui/react/textarea` | `Textarea`, growing with its content |
|
|
116
|
+
| `@pickle-ui/react/toast` | `Toast` with `Provider`, `useToast` and the `manager` for toasts outside React |
|
|
117
|
+
| `@pickle-ui/react/tooltip` | `Tooltip` with `Trigger`, `Content`, `Provider` |
|
|
118
|
+
| `@pickle-ui/react/cn` | `cn` class helper, `SlotClassNames` type |
|
|
119
|
+
| `@pickle-ui/react/theme` | `createTheme`, `themeToCss` |
|
|
120
|
+
|
|
121
|
+
Interactive components and their parts take Base UI's `render` prop to swap
|
|
122
|
+
the element they render, for example
|
|
123
|
+
`<Button render={<a href="/docs" />}>Docs</Button>` or
|
|
124
|
+
`<Popover.Trigger render={<Button variant="outline" />}>Edit</Popover.Trigger>`.
|
|
125
|
+
`Text` and the layout primitives take `as` to change their tag. Parts are
|
|
126
|
+
reached through their component (`Popover.Title`), never imported under their
|
|
127
|
+
own names.
|
|
128
|
+
Icons are plain SVG children: any icon library works, and buttons, badges and
|
|
129
|
+
input addons size and space the SVG for you.
|
|
130
|
+
|
|
131
|
+
Pickle supplies its component styles, light theme, and `.dark` theme. Add the
|
|
132
|
+
`dark` class to an ancestor to enable dark mode:
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
<div className="dark">
|
|
136
|
+
<App />
|
|
137
|
+
</div>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Pickle only reacts to that class, never to `prefers-color-scheme` on its own,
|
|
141
|
+
so you decide how the scheme is chosen. To follow the system preference, mirror
|
|
142
|
+
the media query onto the root element:
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
const media = window.matchMedia('(prefers-color-scheme: dark)');
|
|
146
|
+
const sync = () =>
|
|
147
|
+
document.documentElement.classList.toggle('dark', media.matches);
|
|
148
|
+
sync();
|
|
149
|
+
media.addEventListener('change', sync);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Use `Form` as a React Hook Form-only compound API. Pass the return value from
|
|
153
|
+
`useForm` to the `form` prop; form-aware controls read that provider and either
|
|
154
|
+
inherit the nearest `Form.Field` name or accept their own `name` prop.
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
import { useForm } from 'react-hook-form';
|
|
158
|
+
import { Form } from '@pickle-ui/react/form';
|
|
159
|
+
|
|
160
|
+
type SignUpValues = {
|
|
161
|
+
email: string;
|
|
162
|
+
role: string;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export function SignUpForm() {
|
|
166
|
+
const form = useForm<SignUpValues>({
|
|
167
|
+
defaultValues: { email: '', role: 'designer' },
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<Form form={form} onSubmit={(values) => console.log(values)}>
|
|
172
|
+
<Form.Field label="Email" name="email">
|
|
173
|
+
<Form.Input autoComplete="email" />
|
|
174
|
+
</Form.Field>
|
|
175
|
+
|
|
176
|
+
<Form.Field label="Role" name="role">
|
|
177
|
+
<Form.Select>
|
|
178
|
+
<Form.Select.Trigger>
|
|
179
|
+
<Form.Select.Value placeholder="Select a role" />
|
|
180
|
+
</Form.Select.Trigger>
|
|
181
|
+
<Form.Select.Content>
|
|
182
|
+
<Form.Select.Item value="designer">Designer</Form.Select.Item>
|
|
183
|
+
<Form.Select.Item value="engineer">Engineer</Form.Select.Item>
|
|
184
|
+
</Form.Select.Content>
|
|
185
|
+
</Form.Select>
|
|
186
|
+
</Form.Field>
|
|
187
|
+
|
|
188
|
+
<Form.Button type="submit">Save</Form.Button>
|
|
189
|
+
</Form>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Theming
|
|
195
|
+
|
|
196
|
+
Pickle is styled with Tailwind utilities that resolve to a small set of CSS
|
|
197
|
+
variables. There are four ways to customize components, from the broadest to
|
|
198
|
+
the most targeted.
|
|
199
|
+
|
|
200
|
+
### 1. Override the design tokens
|
|
201
|
+
|
|
202
|
+
Every color, radius, and font in Pickle reads from a variable declared in
|
|
203
|
+
`@pickle-ui/react/styles.css`. Redefine the ones you need after the import; the
|
|
204
|
+
cascade does the rest, and `.dark` overrides work the same way:
|
|
205
|
+
|
|
206
|
+
```css
|
|
207
|
+
@import 'tailwindcss';
|
|
208
|
+
@import '@pickle-ui/react/styles.css';
|
|
209
|
+
|
|
210
|
+
:root {
|
|
211
|
+
--primary: oklch(0.55 0.18 145);
|
|
212
|
+
--primary-foreground: white;
|
|
213
|
+
--radius: 0.75rem;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.dark {
|
|
217
|
+
--primary: oklch(0.8 0.16 145);
|
|
218
|
+
--primary-foreground: oklch(0.2 0.05 145);
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Each token is also exposed as a Tailwind color (`bg-primary`,
|
|
223
|
+
`text-muted-foreground`, `border-sidebar-border`, …) so your own markup can
|
|
224
|
+
share Pickle's palette.
|
|
225
|
+
|
|
226
|
+
`@pickle-ui/react/styles.css` is the sum of two files you can also import on their
|
|
227
|
+
own:
|
|
228
|
+
|
|
229
|
+
- `@pickle-ui/react/theme.css` holds the tokens only: the Tailwind theme mapping and
|
|
230
|
+
the light and dark values. Import it to share Pickle's palette in a project
|
|
231
|
+
that does not use the components.
|
|
232
|
+
- `@pickle-ui/react/base.css` holds everything else: animation and variant plugins,
|
|
233
|
+
the `.dark` variant, the `Text` type scale, shared utilities, and element
|
|
234
|
+
resets. Import it with a token set of your own instead of `theme.css`.
|
|
235
|
+
|
|
236
|
+
Tokens follow one naming rule: `--x` is a fill and `--x-foreground` is the text
|
|
237
|
+
placed on that fill. Status colors (`destructive`, `info`, `success`,
|
|
238
|
+
`warning`) add a `-subtle` pair for tinted surfaces such as badges and
|
|
239
|
+
alerts: `--x-subtle` is the tint and `--x-subtle-foreground` is the readable
|
|
240
|
+
text on it, which also works as colored text on a neutral surface.
|
|
241
|
+
|
|
242
|
+
| Token | Used for |
|
|
243
|
+
| --------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
244
|
+
| `--background`, `--foreground` | Page background and default text. |
|
|
245
|
+
| `--card`, `--card-foreground` | `Card` surface and text. |
|
|
246
|
+
| `--popover`, `--popover-foreground` | Floating surfaces: `Popover`, `Select`, `Combobox`, outline buttons. |
|
|
247
|
+
| `--primary`, `--primary-foreground` | Solid primary actions and the text on them. |
|
|
248
|
+
| `--secondary`, `--secondary-foreground` | Secondary buttons and badges. |
|
|
249
|
+
| `--muted`, `--muted-foreground` | Subdued backgrounds and secondary text. |
|
|
250
|
+
| `--accent`, `--accent-foreground` | Hover and highlighted rows (menu items, ghost buttons). |
|
|
251
|
+
| `--destructive`, `--info`, `--success`, `--warning` | Solid status fills, borders, and rings. Each has a `-foreground` for the text on the fill. |
|
|
252
|
+
| `--destructive-subtle`, `--info-subtle`, … | Tinted status surfaces. Each has a `-subtle-foreground` for the text on the tint. |
|
|
253
|
+
| `--border`, `--input`, `--ring` | Default borders, form control borders, focus rings. |
|
|
254
|
+
| `--sidebar-*` | The `Sidebar` surface, text, borders, and accents. |
|
|
255
|
+
| `--chart-1` … `--chart-5` | Categorical chart colors. |
|
|
256
|
+
| `--radius` | Base radius. `rounded-sm` through `rounded-2xl` derive from it. |
|
|
257
|
+
| `--text-h1` … `--text-code` | `Text` sizes (`h1`–`h4`, `lead`, `body`, `small`, `code`), each with a `--line-height`. |
|
|
258
|
+
| `--font-sans`, `--font-heading`, `--font-mono` | Font stacks. Declare them in your `@theme` block. |
|
|
259
|
+
|
|
260
|
+
Pickle avoids raw Tailwind palette colors on themed surfaces, so changing
|
|
261
|
+
a token updates every component that depends on it.
|
|
262
|
+
|
|
263
|
+
The `--text-*` sizes are Tailwind theme variables, so you can set them from
|
|
264
|
+
`:root` or from your own `@theme` block. Their line heights are ratios, so
|
|
265
|
+
`--text-h1: 2.25rem` scales the line height with it. `--text-body` also sizes
|
|
266
|
+
`Dialog` and `AlertDialog` descriptions; the compact copy in `Alert`, `Toast`
|
|
267
|
+
and `Card.Description` keeps `text-sm`.
|
|
268
|
+
|
|
269
|
+
### 1b. Generate a theme from a brand color
|
|
270
|
+
|
|
271
|
+
`createTheme` derives the brand-dependent tokens (`--primary`,
|
|
272
|
+
`--primary-foreground`, `--ring`, and their sidebar counterparts) for both
|
|
273
|
+
schemes from one color, picking a readable foreground automatically. Radius
|
|
274
|
+
and fonts pass through. Everything else keeps the defaults from `theme.css`.
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
import { createTheme, themeToCss } from '@pickle-ui/react/theme';
|
|
278
|
+
|
|
279
|
+
const theme = createTheme({
|
|
280
|
+
fonts: { sans: 'Inter, sans-serif' },
|
|
281
|
+
primary: '#16a34a',
|
|
282
|
+
primaryDark: '#4ade80', // optional, defaults to a lighter primary
|
|
283
|
+
radius: '0.5rem',
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
themeToCss(theme);
|
|
287
|
+
// :root { --primary: oklch(…); --primary-foreground: oklch(1 0 0); … }
|
|
288
|
+
// .dark { … }
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Write that string to a stylesheet at build time, or apply a scheme at runtime
|
|
292
|
+
by spreading its variables as inline styles:
|
|
293
|
+
|
|
294
|
+
```tsx
|
|
295
|
+
<div className="dark" style={theme.dark}>
|
|
296
|
+
<App />
|
|
297
|
+
</div>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### 2. Pass `className`
|
|
301
|
+
|
|
302
|
+
Every component accepts `className`, merged with `tailwind-merge` so your
|
|
303
|
+
utilities win over Pickle's defaults without specificity tricks:
|
|
304
|
+
|
|
305
|
+
```tsx
|
|
306
|
+
<Button className="rounded-full px-6">Get started</Button>
|
|
307
|
+
<Card.Title className="text-2xl">Overview</Card.Title>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
The same `cn` helper Pickle uses internally is exported, so you can compose
|
|
311
|
+
conditional classes the same way:
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import { cn } from '@pickle-ui/react/cn';
|
|
315
|
+
|
|
316
|
+
<Badge className={cn('uppercase', isNew && 'animate-pulse')}>New</Badge>;
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Components that render several parts from one props object also take a
|
|
320
|
+
`classNames` object keyed by slot, so you can reach an inner part without
|
|
321
|
+
global CSS. Keys match the suffix of the part's `data-slot` attribute:
|
|
322
|
+
|
|
323
|
+
```tsx
|
|
324
|
+
<Checkbox
|
|
325
|
+
classNames={{ indicator: 'bg-success', label: 'text-muted-foreground' }}
|
|
326
|
+
label="Remember me"
|
|
327
|
+
/>
|
|
328
|
+
|
|
329
|
+
<Slider classNames={{ thumb: 'size-6', track: 'h-2' }} defaultValue={40} />
|
|
330
|
+
|
|
331
|
+
<Input className="w-64" classNames={{ input: 'font-mono' }} />
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
| Component | Slots |
|
|
335
|
+
| ----------------- | ---------------------------------------- |
|
|
336
|
+
| `Button` | `loadingIndicator` |
|
|
337
|
+
| `Checkbox` | `field`, `indicator`, `label` |
|
|
338
|
+
| `Combobox.Chip` | `remove` |
|
|
339
|
+
| `Combobox.Item` | `indicator` |
|
|
340
|
+
| `Input` | `input` (`className` styles the wrapper) |
|
|
341
|
+
| `RadioGroup.Item` | `indicator`, `label` |
|
|
342
|
+
| `Select.Item` | `indicator` |
|
|
343
|
+
| `Select.Trigger` | `icon` |
|
|
344
|
+
| `Slider` | `control`, `indicator`, `thumb`, `track` |
|
|
345
|
+
| `Switch` | `field`, `label`, `thumb` |
|
|
346
|
+
|
|
347
|
+
The `SlotClassNames<'a' | 'b'>` type is exported for wrappers that forward
|
|
348
|
+
these props.
|
|
349
|
+
|
|
350
|
+
### 3. Reuse the variant functions
|
|
351
|
+
|
|
352
|
+
Components built on variants export their `class-variance-authority` function
|
|
353
|
+
(`buttonVariants`, `badgeVariants`, `textVariants`, `groupVariants`,
|
|
354
|
+
`inputGroupAddonVariants`). Apply Pickle's styling to any element, or extend a
|
|
355
|
+
variant without wrapping the component:
|
|
356
|
+
|
|
357
|
+
```tsx
|
|
358
|
+
import { buttonVariants } from '@pickle-ui/react/button';
|
|
359
|
+
import { cn } from '@pickle-ui/react/cn';
|
|
360
|
+
|
|
361
|
+
<a className={buttonVariants({ variant: 'outline', size: 'sm' })} href="/docs">
|
|
362
|
+
Docs
|
|
363
|
+
</a>;
|
|
364
|
+
|
|
365
|
+
<button
|
|
366
|
+
className={cn(
|
|
367
|
+
buttonVariants({ variant: 'ghost' }),
|
|
368
|
+
'text-info-subtle-foreground',
|
|
369
|
+
)}
|
|
370
|
+
>
|
|
371
|
+
Info
|
|
372
|
+
</button>;
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Merge them with `@pickle-ui/react/cn`. A stock `tailwind-merge` reads `text-h1` …
|
|
376
|
+
`text-code` from `textVariants` as colors and drops them next to one, so a
|
|
377
|
+
`cn` of your own must declare them as font sizes:
|
|
378
|
+
|
|
379
|
+
```ts
|
|
380
|
+
const twMerge = extendTailwindMerge({
|
|
381
|
+
extend: {
|
|
382
|
+
theme: {
|
|
383
|
+
text: ['body', 'code', 'h1', 'h2', 'h3', 'h4', 'lead', 'small'],
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
});
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### 4. Target `data-slot` in CSS
|
|
390
|
+
|
|
391
|
+
Every rendered part carries a stable `data-slot` attribute (`button`, `card`,
|
|
392
|
+
`card-title`, `select-item`, `checkbox-indicator`, …). Use it for global rules
|
|
393
|
+
or to reach parts that do not take their own `className`.
|
|
394
|
+
|
|
395
|
+
Parts with visual variants also expose the resolved value as a data
|
|
396
|
+
attribute, defaults included, so a rule can target one variant or size. The
|
|
397
|
+
attribute sits on the slot listed here:
|
|
398
|
+
|
|
399
|
+
| Component | `data-slot` | Attributes |
|
|
400
|
+
| --------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
401
|
+
| `Button`, `Badge` | `button`, `badge` | `data-variant`, `data-size` |
|
|
402
|
+
| `Alert`, `Menu.Item` | `alert`, `menu-item` | `data-variant` |
|
|
403
|
+
| `Text` | `text` | `data-variant`, plus `data-tone`, `data-weight` and `data-truncate` when set |
|
|
404
|
+
| `Dialog.Content`, `AlertDialog.Content` | `dialog-content`, `alert-dialog-content` | `data-size` |
|
|
405
|
+
| `Input`, `Textarea` | `input-control`, `textarea-control` (wrappers) | `data-size` |
|
|
406
|
+
| `Checkbox` | `checkbox` | `data-size` |
|
|
407
|
+
| `RadioGroup.Item` | `radio` | `data-size` |
|
|
408
|
+
| `Group` | `group` | `data-orientation` |
|
|
409
|
+
| `InputGroup.Addon` | `input-group-addon` | `data-align` |
|
|
410
|
+
| `Toast.Provider` | `toast-viewport` | `data-position` |
|
|
411
|
+
|
|
412
|
+
Write these rules in `@layer utilities`. Pickle styles parts with utility
|
|
413
|
+
classes, and Tailwind orders its layers `theme, base, components, utilities`,
|
|
414
|
+
so a rule in `@layer components` loses to them:
|
|
415
|
+
|
|
416
|
+
```css
|
|
417
|
+
@layer utilities {
|
|
418
|
+
[data-slot='card'] {
|
|
419
|
+
@apply shadow-lg;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
[data-slot='button'][data-size='md'] {
|
|
423
|
+
@apply h-9;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
[data-slot='button'][data-variant='default'] {
|
|
427
|
+
@apply border-indigo-600 bg-indigo-600 hover:bg-indigo-600/90;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
[data-slot='checkbox-indicator'] svg {
|
|
431
|
+
stroke-width: 3;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
A global rule like these wins over a `className` on a single instance too; mark
|
|
437
|
+
the one-off utility important (`className="shadow-none!"`) to beat it.
|
|
438
|
+
|
|
439
|
+
`data-slot` names and these data attribute values are part of the public API
|
|
440
|
+
and follow the component and prop names in kebab-case, so renaming one is a
|
|
441
|
+
breaking change.
|
|
442
|
+
|
|
443
|
+
## Upgrading from 0.x
|
|
444
|
+
|
|
445
|
+
The next major release renames a few styling APIs. Search your code for these
|
|
446
|
+
and update them:
|
|
447
|
+
|
|
448
|
+
- **Package name.** `pickle-ui` is now published as `@pickle-ui/react`.
|
|
449
|
+
Replace the dependency and every import, stylesheets included:
|
|
450
|
+
`pickle-ui/button` becomes `@pickle-ui/react/button` and
|
|
451
|
+
`pickle-ui/styles.css` becomes `@pickle-ui/react/styles.css`.
|
|
452
|
+
- **Status tokens.** `--destructive-foreground`, `--info-foreground`,
|
|
453
|
+
`--success-foreground` and `--warning-foreground` now hold the text color for
|
|
454
|
+
a solid fill (white, or amber-950 for warning). Tinted text such as
|
|
455
|
+
`text-destructive-foreground` on a badge becomes
|
|
456
|
+
`text-destructive-subtle-foreground`, and tinted backgrounds like
|
|
457
|
+
`bg-destructive/8` become `bg-destructive-subtle`, which already adapts to
|
|
458
|
+
dark mode.
|
|
459
|
+
- **Chart palette.** The light `--chart-1` … `--chart-5` values changed to
|
|
460
|
+
match the dark hues (blue, emerald, amber, purple, rose). Override them if
|
|
461
|
+
your charts relied on the previous colors.
|
|
462
|
+
- **Slot class props.** `labelClassName` on `Checkbox`, `Switch` and
|
|
463
|
+
`RadioGroup.Item` becomes `classNames={{ label }}`; `thumbClassName` and
|
|
464
|
+
`trackClassName` on `Slider` become `classNames={{ thumb, track }}`.
|
|
465
|
+
- **Stylesheet.** `@pickle-ui/react/styles.css` is unchanged as the entry point. It is
|
|
466
|
+
now split into `@pickle-ui/react/theme.css` and `@pickle-ui/react/base.css`, and no longer
|
|
467
|
+
depends on the `shadcn` package.
|
|
468
|
+
|
|
469
|
+
## Development
|
|
470
|
+
|
|
471
|
+
This package lives in the `packages/react` folder of the Pickle UI monorepo.
|
|
472
|
+
Run these from the repository root:
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
pnpm install
|
|
476
|
+
pnpm run dev # Storybook on http://localhost:6006, theme toggle in the toolbar
|
|
477
|
+
pnpm run build
|
|
478
|
+
pnpm run typecheck
|
|
479
|
+
pnpm run test
|
|
480
|
+
pnpm run lint
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
## Releasing
|
|
484
|
+
|
|
485
|
+
Run the manually dispatched `Release` GitHub Actions workflow and choose a
|
|
486
|
+
patch, minor, or major bump. The workflow publishes the npm package, version
|
|
487
|
+
commit, tag, and GitHub Release.
|
|
488
|
+
|
|
489
|
+
## License
|
|
490
|
+
|
|
491
|
+
MIT
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type TextProps } from './Text.js';
|
|
4
|
+
declare const alertVariants: (props?: ({
|
|
5
|
+
variant?: "destructive" | "default" | "info" | "success" | "warning" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type AlertActionProps = React.ComponentProps<'div'>;
|
|
8
|
+
type AlertDescriptionProps = Omit<TextProps, 'as' | 'tone' | 'variant'>;
|
|
9
|
+
type AlertIconProps = React.ComponentProps<'div'>;
|
|
10
|
+
type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants>;
|
|
11
|
+
type AlertTitleProps = Omit<TextProps, 'as' | 'tone' | 'variant'>;
|
|
12
|
+
declare function AlertAction({ className, ...props }: AlertActionProps): React.JSX.Element;
|
|
13
|
+
declare function AlertDescription({ className, ...props }: AlertDescriptionProps): React.JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* Leading icon slot. Pass an SVG as children; it is sized and tinted to match
|
|
16
|
+
* the alert's `variant`. The wrapper is hidden from assistive technology by
|
|
17
|
+
* default since the title carries the meaning.
|
|
18
|
+
*/
|
|
19
|
+
declare function AlertIcon({ className, ...props }: AlertIconProps): React.JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* An inline message that draws attention to contextual information.
|
|
22
|
+
*
|
|
23
|
+
* The alert has no live-region role by default, so static notices are not
|
|
24
|
+
* announced on page load. When the alert appears in response to a user action,
|
|
25
|
+
* pass `role="alert"` for urgent messages (failures) or `role="status"` for
|
|
26
|
+
* polite ones (confirmations, info).
|
|
27
|
+
*/
|
|
28
|
+
declare function AlertRoot({ className, variant, ...props }: AlertProps): React.JSX.Element;
|
|
29
|
+
declare function AlertTitle({ className, ...props }: AlertTitleProps): React.JSX.Element;
|
|
30
|
+
declare const Alert: typeof AlertRoot & {
|
|
31
|
+
Action: typeof AlertAction;
|
|
32
|
+
Description: typeof AlertDescription;
|
|
33
|
+
Icon: typeof AlertIcon;
|
|
34
|
+
Title: typeof AlertTitle;
|
|
35
|
+
};
|
|
36
|
+
export { Alert, AlertAction, AlertDescription, AlertIcon, AlertTitle };
|
|
37
|
+
export type { AlertActionProps, AlertDescriptionProps, AlertIconProps, AlertProps, AlertTitleProps, };
|
|
38
|
+
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/components/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAA,MAAM,aAAa;;8EAoBlB,CAAC;AAEF,KAAK,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AACpD,KAAK,qBAAqB,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AACxE,KAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAClD,KAAK,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAC3C,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AACrC,KAAK,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAElE,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,qBAW7D;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,qBAcvE;AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,qBAYzD;AAED;;;;;;;GAOG;AACH,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,OAAmB,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,qBAS1E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,qBAa3D;AAED,QAAA,MAAM,KAAK;;;;;CAKT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACvE,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,eAAe,GAChB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../lib/utils.js';
|
|
4
|
+
import { Text } from './Text.js';
|
|
5
|
+
const alertVariants = cva('relative grid w-full grid-cols-[1fr] items-start gap-x-3 gap-y-0.5 rounded-xl border px-3.5 py-3 text-sm has-[>[data-slot=alert-action]]:grid-cols-[1fr_auto] has-[>[data-slot=alert-icon]]:grid-cols-[auto_1fr] has-[>[data-slot=alert-icon]]:has-[>[data-slot=alert-action]]:grid-cols-[auto_1fr_auto]', {
|
|
6
|
+
defaultVariants: {
|
|
7
|
+
variant: 'default',
|
|
8
|
+
},
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: 'bg-card text-card-foreground *:data-[slot=alert-icon]:text-muted-foreground',
|
|
12
|
+
destructive: 'border-destructive/32 bg-destructive-subtle text-foreground *:data-[slot=alert-icon]:text-destructive',
|
|
13
|
+
info: 'border-info/32 bg-info-subtle text-foreground *:data-[slot=alert-icon]:text-info',
|
|
14
|
+
success: 'border-success/32 bg-success-subtle text-foreground *:data-[slot=alert-icon]:text-success',
|
|
15
|
+
warning: 'border-warning/32 bg-warning-subtle text-foreground *:data-[slot=alert-icon]:text-warning',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
function AlertAction({ className, ...props }) {
|
|
20
|
+
return (_jsx("div", { className: cn('col-start-2 row-span-2 row-start-1 flex items-center gap-1.5 self-center [[data-slot=alert-icon]~&]:col-start-3', className), "data-slot": "alert-action", ...props }));
|
|
21
|
+
}
|
|
22
|
+
function AlertDescription({ className, ...props }) {
|
|
23
|
+
return (_jsx(Text, { as: "div", className: cn('col-start-1 flex flex-col gap-2 text-sm [[data-slot=alert-icon]~&]:col-start-2', className), "data-slot": "alert-description", tone: "muted", variant: "body", ...props }));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Leading icon slot. Pass an SVG as children; it is sized and tinted to match
|
|
27
|
+
* the alert's `variant`. The wrapper is hidden from assistive technology by
|
|
28
|
+
* default since the title carries the meaning.
|
|
29
|
+
*/
|
|
30
|
+
function AlertIcon({ className, ...props }) {
|
|
31
|
+
return (_jsx("div", { "aria-hidden": true, className: cn("col-start-1 row-start-1 flex h-5 items-center [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), "data-slot": "alert-icon", ...props }));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* An inline message that draws attention to contextual information.
|
|
35
|
+
*
|
|
36
|
+
* The alert has no live-region role by default, so static notices are not
|
|
37
|
+
* announced on page load. When the alert appears in response to a user action,
|
|
38
|
+
* pass `role="alert"` for urgent messages (failures) or `role="status"` for
|
|
39
|
+
* polite ones (confirmations, info).
|
|
40
|
+
*/
|
|
41
|
+
function AlertRoot({ className, variant = 'default', ...props }) {
|
|
42
|
+
return (_jsx("div", { className: cn(alertVariants({ variant }), className), "data-slot": "alert", "data-variant": variant, ...props }));
|
|
43
|
+
}
|
|
44
|
+
function AlertTitle({ className, ...props }) {
|
|
45
|
+
return (_jsx(Text, { as: "div", className: cn('col-start-1 text-sm leading-5 font-medium [[data-slot=alert-icon]~&]:col-start-2', className), "data-slot": "alert-title", variant: "body", ...props }));
|
|
46
|
+
}
|
|
47
|
+
const Alert = Object.assign(AlertRoot, {
|
|
48
|
+
Action: AlertAction,
|
|
49
|
+
Description: AlertDescription,
|
|
50
|
+
Icon: AlertIcon,
|
|
51
|
+
Title: AlertTitle,
|
|
52
|
+
});
|
|
53
|
+
export { Alert, AlertAction, AlertDescription, AlertIcon, AlertTitle };
|
|
54
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../src/components/Alert.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAE9C,MAAM,aAAa,GAAG,GAAG,CACvB,0SAA0S,EAC1S;IACE,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EACL,6EAA6E;YAC/E,WAAW,EACT,uGAAuG;YACzG,IAAI,EAAE,kFAAkF;YACxF,OAAO,EACL,2FAA2F;YAC7F,OAAO,EACL,2FAA2F;SAC9F;KACF;CACF,CACF,CAAC;AASF,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB;IAC5D,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,iHAAiH,EACjH,SAAS,CACV,eACS,cAAc,KACpB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IACtE,OAAO,CACL,KAAC,IAAI,IACH,EAAE,EAAC,KAAK,EACR,SAAS,EAAE,EAAE,CACX,gFAAgF,EAChF,SAAS,CACV,eACS,mBAAmB,EAC7B,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,MAAM,KACV,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkB;IACxD,OAAO,CACL,mCAEE,SAAS,EAAE,EAAE,CACX,iIAAiI,EACjI,SAAS,CACV,eACS,YAAY,KAClB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,KAAK,EAAc;IACzE,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,eAC1C,OAAO,kBACH,OAAO,KACjB,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAmB;IAC1D,OAAO,CACL,KAAC,IAAI,IACH,EAAE,EAAC,KAAK,EACR,SAAS,EAAE,EAAE,CACX,kFAAkF,EAClF,SAAS,CACV,eACS,aAAa,EACvB,OAAO,EAAC,MAAM,KACV,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;IACrC,MAAM,EAAE,WAAW;IACnB,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,UAAU;CAClB,CAAC,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type DialogSize } from './_internal/dialog-styles.js';
|
|
4
|
+
type AlertDialogCloseProps = React.ComponentProps<typeof AlertDialogPrimitive.Close>;
|
|
5
|
+
type AlertDialogContentProps = React.ComponentProps<typeof AlertDialogPrimitive.Popup> & {
|
|
6
|
+
/** Maximum width of the dialog. Defaults to `md`. */
|
|
7
|
+
size?: DialogSize;
|
|
8
|
+
};
|
|
9
|
+
type AlertDialogDescriptionProps = React.ComponentProps<typeof AlertDialogPrimitive.Description>;
|
|
10
|
+
type AlertDialogFooterProps = React.ComponentProps<'div'>;
|
|
11
|
+
type AlertDialogHeaderProps = React.ComponentProps<'div'>;
|
|
12
|
+
type AlertDialogProps = React.ComponentProps<typeof AlertDialogPrimitive.Root> & {
|
|
13
|
+
/**
|
|
14
|
+
* Keeps the dialog open when the backdrop is clicked, so it only closes
|
|
15
|
+
* through `AlertDialog.Close` or Escape. Defaults to `false`: a backdrop
|
|
16
|
+
* click closes the dialog.
|
|
17
|
+
*/
|
|
18
|
+
disablePointerDismissal?: boolean;
|
|
19
|
+
};
|
|
20
|
+
type AlertDialogTitleProps = React.ComponentProps<typeof AlertDialogPrimitive.Title>;
|
|
21
|
+
type AlertDialogTriggerProps = React.ComponentProps<typeof AlertDialogPrimitive.Trigger>;
|
|
22
|
+
declare function AlertDialogClose({ ...props }: AlertDialogCloseProps): React.JSX.Element;
|
|
23
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialogContentProps): React.JSX.Element;
|
|
24
|
+
declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): React.JSX.Element;
|
|
25
|
+
declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): React.JSX.Element;
|
|
26
|
+
declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): React.JSX.Element;
|
|
27
|
+
declare function AlertDialogRoot({ disablePointerDismissal, ...props }: AlertDialogProps): React.JSX.Element;
|
|
28
|
+
declare function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): React.JSX.Element;
|
|
29
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialogTriggerProps): React.JSX.Element;
|
|
30
|
+
declare const AlertDialog: typeof AlertDialogRoot & {
|
|
31
|
+
Close: typeof AlertDialogClose;
|
|
32
|
+
Content: typeof AlertDialogContent;
|
|
33
|
+
Description: typeof AlertDialogDescription;
|
|
34
|
+
Footer: typeof AlertDialogFooter;
|
|
35
|
+
Header: typeof AlertDialogHeader;
|
|
36
|
+
Title: typeof AlertDialogTitle;
|
|
37
|
+
Trigger: typeof AlertDialogTrigger;
|
|
38
|
+
};
|
|
39
|
+
export { AlertDialog };
|
|
40
|
+
export type { AlertDialogCloseProps, AlertDialogContentProps, AlertDialogDescriptionProps, AlertDialogFooterProps, AlertDialogHeaderProps, AlertDialogProps, AlertDialogTitleProps, AlertDialogTriggerProps, };
|
|
41
|
+
//# sourceMappingURL=AlertDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../src/components/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAElF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAML,KAAK,UAAU,EAGhB,MAAM,2BAA2B,CAAC;AAEnC,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAC/C,OAAO,oBAAoB,CAAC,KAAK,CAClC,CAAC;AACF,KAAK,uBAAuB,GAAG,KAAK,CAAC,cAAc,CACjD,OAAO,oBAAoB,CAAC,KAAK,CAClC,GAAG;IACF,qDAAqD;IACrD,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AACF,KAAK,2BAA2B,GAAG,KAAK,CAAC,cAAc,CACrD,OAAO,oBAAoB,CAAC,WAAW,CACxC,CAAC;AACF,KAAK,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC1D,KAAK,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC1D,KAAK,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAC1C,OAAO,oBAAoB,CAAC,IAAI,CACjC,GAAG;IACF;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AACF,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAC/C,OAAO,oBAAoB,CAAC,KAAK,CAClC,CAAC;AACF,KAAK,uBAAuB,GAAG,KAAK,CAAC,cAAc,CACjD,OAAO,oBAAoB,CAAC,OAAO,CACpC,CAAC;AAEF,iBAAS,gBAAgB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,qBAI5D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,IAAW,EACX,GAAG,KAAK,EACT,EAAE,uBAAuB,qBAmBzB;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,2BAA2B,qBAQ7B;AAED,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,qBAQzE;AAED,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,qBAQzE;AAED,iBAAS,eAAe,CAAC,EACvB,uBAA+B,EAC/B,GAAG,KAAK,EACT,EAAE,gBAAgB,qBAUlB;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,qBAQvE;AAED,iBAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,qBAIhE;AAED,QAAA,MAAM,WAAW;;;;;;;;CAQf,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EACV,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GACxB,CAAC"}
|