@pickle-ui/react 0.0.0-stage → 1.0.0-beta.3
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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { type ComponentMatrixCellProps, Story } from '../_internal/Story';
|
|
4
|
+
import { Switch, type SwitchProps } from './Switch';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
component: Switch,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
title: 'components/form/Switch',
|
|
12
|
+
} satisfies Meta<typeof Switch>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type StoryDefinition = StoryObj;
|
|
16
|
+
|
|
17
|
+
const STATE_COLUMNS: {
|
|
18
|
+
key: string;
|
|
19
|
+
label: string;
|
|
20
|
+
props: Partial<SwitchProps>;
|
|
21
|
+
}[] = [
|
|
22
|
+
{ key: 'unchecked', label: 'Unchecked', props: {} },
|
|
23
|
+
{ key: 'checked', label: 'Checked', props: { defaultChecked: true } },
|
|
24
|
+
{
|
|
25
|
+
key: 'focus',
|
|
26
|
+
label: 'Focus',
|
|
27
|
+
props: { className: 'pseudo-focus-visible', defaultChecked: true },
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: 'invalid',
|
|
31
|
+
label: 'Invalid',
|
|
32
|
+
props: { 'aria-invalid': true, defaultChecked: true },
|
|
33
|
+
},
|
|
34
|
+
{ key: 'disabled', label: 'Disabled', props: { disabled: true } },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const STATE_PROPS = Object.fromEntries(
|
|
38
|
+
STATE_COLUMNS.map((state) => [state.key, state.props]),
|
|
39
|
+
) as Record<string, Partial<SwitchProps>>;
|
|
40
|
+
|
|
41
|
+
function SwitchStateCell({ column }: ComponentMatrixCellProps) {
|
|
42
|
+
return <Switch label={column.label} {...STATE_PROPS[column.key]} />;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const All: StoryDefinition = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<Story.Layout className="max-w-5xl" title="Switch">
|
|
48
|
+
<Story.Section title="States">
|
|
49
|
+
<Story.Matrix
|
|
50
|
+
Cell={SwitchStateCell}
|
|
51
|
+
cellWidth="9rem"
|
|
52
|
+
columns={STATE_COLUMNS}
|
|
53
|
+
rows={[{ key: 'switch', label: 'Switch' }]}
|
|
54
|
+
/>
|
|
55
|
+
</Story.Section>
|
|
56
|
+
|
|
57
|
+
<Story.Section title="Label">
|
|
58
|
+
<Switch defaultChecked id="story-switch-label" label="Notifications" />
|
|
59
|
+
</Story.Section>
|
|
60
|
+
</Story.Layout>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import { Switch } from './Switch';
|
|
5
|
+
|
|
6
|
+
describe('Switch', () => {
|
|
7
|
+
it('renders a switch wired to its label', () => {
|
|
8
|
+
render(<Switch label="Notifications" />);
|
|
9
|
+
expect(
|
|
10
|
+
screen.getByRole('switch', { name: 'Notifications' }),
|
|
11
|
+
).toBeInTheDocument();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('applies classNames to the field, thumb, and label slots', () => {
|
|
15
|
+
const { container } = render(
|
|
16
|
+
<Switch
|
|
17
|
+
classNames={{ field: 'field-x', label: 'label-x', thumb: 'thumb-x' }}
|
|
18
|
+
label="Notifications"
|
|
19
|
+
/>,
|
|
20
|
+
);
|
|
21
|
+
expect(container.querySelector('[data-slot="switch-field"]')).toHaveClass(
|
|
22
|
+
'field-x',
|
|
23
|
+
);
|
|
24
|
+
expect(container.querySelector('[data-slot="switch-thumb"]')).toHaveClass(
|
|
25
|
+
'thumb-x',
|
|
26
|
+
);
|
|
27
|
+
expect(screen.getByText('Notifications')).toHaveClass('label-x');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
|
|
6
|
+
import { cn, type SlotClassNames } from '@/lib/utils';
|
|
7
|
+
|
|
8
|
+
type SwitchControlProps = React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
9
|
+
classNames?: SlotClassNames<'thumb'>;
|
|
10
|
+
};
|
|
11
|
+
type SwitchLabelContent = Exclude<React.ReactNode, boolean | null | undefined>;
|
|
12
|
+
type SwitchLabelProps = Omit<React.ComponentProps<'label'>, 'htmlFor'> & {
|
|
13
|
+
htmlFor: string;
|
|
14
|
+
};
|
|
15
|
+
type SwitchProps = Omit<SwitchControlProps, 'classNames'> & {
|
|
16
|
+
classNames?: SlotClassNames<'field' | 'label' | 'thumb'>;
|
|
17
|
+
label: SwitchLabelContent;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function SwitchControl({
|
|
21
|
+
className,
|
|
22
|
+
classNames,
|
|
23
|
+
...props
|
|
24
|
+
}: SwitchControlProps) {
|
|
25
|
+
return (
|
|
26
|
+
<SwitchPrimitive.Root
|
|
27
|
+
className={cn(
|
|
28
|
+
'focus-visible:ring-ring focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 items-center rounded-full p-px transition-[background-color,box-shadow] duration-200 outline-none [--thumb-size:--spacing(4)] focus-visible:ring-2 focus-visible:ring-offset-1 data-disabled:cursor-not-allowed data-disabled:opacity-64',
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
data-slot="switch"
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<SwitchPrimitive.Thumb
|
|
35
|
+
className={cn(
|
|
36
|
+
'bg-background pointer-events-none block aspect-square h-full origin-left rounded-(--thumb-size) shadow-sm/5 ring-0 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]',
|
|
37
|
+
classNames?.thumb,
|
|
38
|
+
)}
|
|
39
|
+
data-slot="switch-thumb"
|
|
40
|
+
/>
|
|
41
|
+
</SwitchPrimitive.Root>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function SwitchLabel({ className, htmlFor, ...props }: SwitchLabelProps) {
|
|
46
|
+
return (
|
|
47
|
+
<label
|
|
48
|
+
className={cn(
|
|
49
|
+
'flex items-center gap-2 text-sm leading-none font-medium group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
|
|
50
|
+
className,
|
|
51
|
+
)}
|
|
52
|
+
data-slot="switch-label"
|
|
53
|
+
htmlFor={htmlFor}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function SwitchRoot({ classNames, id, label, ...props }: SwitchProps) {
|
|
60
|
+
const generatedId = React.useId();
|
|
61
|
+
const switchId = id ?? generatedId;
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
className={cn('flex items-center gap-2', classNames?.field)}
|
|
66
|
+
data-slot="switch-field"
|
|
67
|
+
>
|
|
68
|
+
<SwitchControl classNames={classNames} id={switchId} {...props} />
|
|
69
|
+
<SwitchLabel className={classNames?.label} htmlFor={switchId}>
|
|
70
|
+
{label}
|
|
71
|
+
</SwitchLabel>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const Switch = Object.assign(SwitchRoot, {
|
|
77
|
+
Label: SwitchLabel,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export { Switch, SwitchControl, SwitchLabel };
|
|
81
|
+
export type { SwitchControlProps, SwitchLabelProps, SwitchProps };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { type ComponentMatrixCellProps, Story } from '../_internal/Story';
|
|
4
|
+
import { Textarea, type TextareaProps } from './Textarea';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
component: Textarea,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
title: 'components/form/Textarea',
|
|
12
|
+
} satisfies Meta<typeof Textarea>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type StoryDefinition = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
const STATE_COLUMNS = [
|
|
18
|
+
{ key: 'empty', label: 'Empty' },
|
|
19
|
+
{ key: 'filled', label: 'Filled' },
|
|
20
|
+
{ key: 'focus', label: 'Focus' },
|
|
21
|
+
{ key: 'disabled', label: 'Disabled' },
|
|
22
|
+
{ key: 'invalid', label: 'Invalid' },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const SIZE_ROWS = [
|
|
26
|
+
{ key: 'sm', label: 'Small' },
|
|
27
|
+
{ key: 'md', label: 'Medium' },
|
|
28
|
+
{ key: 'lg', label: 'Large' },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
function TextareaMatrixCell({ column, row }: ComponentMatrixCellProps) {
|
|
32
|
+
const isInvalid = column.key === 'invalid';
|
|
33
|
+
const textarea = (
|
|
34
|
+
<Textarea
|
|
35
|
+
aria-invalid={isInvalid || undefined}
|
|
36
|
+
aria-label={`${row.label} ${column.label}`}
|
|
37
|
+
defaultValue={
|
|
38
|
+
column.key === 'filled' || column.key === 'focus'
|
|
39
|
+
? 'Pickle UI grows this field with its content, line after line.'
|
|
40
|
+
: undefined
|
|
41
|
+
}
|
|
42
|
+
disabled={column.key === 'disabled'}
|
|
43
|
+
placeholder={isInvalid ? 'Tell us a bit more' : 'Write a message'}
|
|
44
|
+
size={row.key as NonNullable<TextareaProps['size']>}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// The focus ring is styled on the wrapper via :has(:focus-visible), so the
|
|
49
|
+
// pseudo-state class goes on an ancestor to reach the inner <textarea>.
|
|
50
|
+
return column.key === 'focus' ? (
|
|
51
|
+
<div className="pseudo-focus-visible-all w-full">{textarea}</div>
|
|
52
|
+
) : (
|
|
53
|
+
textarea
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const All: StoryDefinition = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<Story.Layout className="max-w-6xl" title="Textarea">
|
|
60
|
+
<Story.Section title="Sizes and states">
|
|
61
|
+
<Story.Matrix
|
|
62
|
+
Cell={TextareaMatrixCell}
|
|
63
|
+
cellClassName="justify-stretch"
|
|
64
|
+
cellWidth="16rem"
|
|
65
|
+
columns={STATE_COLUMNS}
|
|
66
|
+
rows={SIZE_ROWS}
|
|
67
|
+
/>
|
|
68
|
+
</Story.Section>
|
|
69
|
+
</Story.Layout>
|
|
70
|
+
),
|
|
71
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import { Textarea } from './Textarea';
|
|
5
|
+
|
|
6
|
+
describe('Textarea', () => {
|
|
7
|
+
it('styles the control wrapper with className and the textarea with classNames.textarea', () => {
|
|
8
|
+
const { container } = render(
|
|
9
|
+
<Textarea
|
|
10
|
+
aria-label="Message"
|
|
11
|
+
className="control-x"
|
|
12
|
+
classNames={{ textarea: 'textarea-x' }}
|
|
13
|
+
/>,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
expect(
|
|
17
|
+
container.querySelector('[data-slot="textarea-control"]'),
|
|
18
|
+
).toHaveClass('control-x');
|
|
19
|
+
expect(screen.getByRole('textbox', { name: 'Message' })).toHaveClass(
|
|
20
|
+
'textarea-x',
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('forwards native textarea props', () => {
|
|
25
|
+
render(<Textarea aria-label="Bio" defaultValue="Hello" rows={6} />);
|
|
26
|
+
|
|
27
|
+
const textarea = screen.getByRole('textbox', { name: 'Bio' });
|
|
28
|
+
expect(textarea).toHaveValue('Hello');
|
|
29
|
+
expect(textarea).toHaveAttribute('rows', '6');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn, type SlotClassNames } from '@/lib/utils';
|
|
4
|
+
|
|
5
|
+
type TextareaProps = React.ComponentProps<'textarea'> & {
|
|
6
|
+
/** Class overrides for the inner `textarea`; `className` styles the control wrapper. */
|
|
7
|
+
classNames?: SlotClassNames<'textarea'>;
|
|
8
|
+
size?: 'lg' | 'md' | 'sm';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Grows with its content (`field-sizing: content`) from three lines. Set
|
|
13
|
+
* `rows` or a height class on `classNames.textarea` to change the minimum.
|
|
14
|
+
* The control takes the width of its container, never the width of its text.
|
|
15
|
+
*/
|
|
16
|
+
function Textarea({
|
|
17
|
+
className,
|
|
18
|
+
classNames,
|
|
19
|
+
size = 'md',
|
|
20
|
+
...props
|
|
21
|
+
}: TextareaProps) {
|
|
22
|
+
return (
|
|
23
|
+
<span
|
|
24
|
+
className={cn(
|
|
25
|
+
'border-input bg-background text-foreground ring-ring/24 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 relative inline-flex w-full rounded-lg border text-base shadow-xs/5 transition-shadow [contain:inline-size] not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:ring-[3px] has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none sm:text-sm dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]',
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
data-size={size}
|
|
29
|
+
data-slot="textarea-control"
|
|
30
|
+
>
|
|
31
|
+
<textarea
|
|
32
|
+
className={cn(
|
|
33
|
+
'placeholder:text-muted-foreground/72 field-sizing-content min-h-17.5 w-full resize-none rounded-[inherit] px-[calc(--spacing(3)-1px)] py-2 outline-none',
|
|
34
|
+
size === 'sm' && 'min-h-16 px-[calc(--spacing(2.5)-1px)]',
|
|
35
|
+
size === 'lg' && 'min-h-18',
|
|
36
|
+
classNames?.textarea,
|
|
37
|
+
)}
|
|
38
|
+
data-slot="textarea"
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
</span>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { Textarea };
|
|
46
|
+
export type { TextareaProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { AlertDialog } from '../components/AlertDialog';
|
|
2
|
+
export type {
|
|
3
|
+
AlertDialogCloseProps,
|
|
4
|
+
AlertDialogContentProps,
|
|
5
|
+
AlertDialogDescriptionProps,
|
|
6
|
+
AlertDialogFooterProps,
|
|
7
|
+
AlertDialogHeaderProps,
|
|
8
|
+
AlertDialogProps,
|
|
9
|
+
AlertDialogTitleProps,
|
|
10
|
+
AlertDialogTriggerProps,
|
|
11
|
+
} from '../components/AlertDialog';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ColorPicker } from '../components/form/ColorPicker';
|
|
2
|
+
export type {
|
|
3
|
+
ColorPickerAlphaSliderProps,
|
|
4
|
+
ColorPickerAreaProps,
|
|
5
|
+
ColorPickerContentProps,
|
|
6
|
+
ColorPickerEyeDropperProps,
|
|
7
|
+
ColorPickerFormatSelectProps,
|
|
8
|
+
ColorPickerHueSliderProps,
|
|
9
|
+
ColorPickerInputProps,
|
|
10
|
+
ColorPickerProps,
|
|
11
|
+
ColorPickerSwatchProps,
|
|
12
|
+
ColorPickerTriggerProps,
|
|
13
|
+
} from '../components/form/ColorPicker';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { Combobox } from '../components/form/Combobox';
|
|
2
|
+
export type {
|
|
3
|
+
ComboboxChipProps,
|
|
4
|
+
ComboboxChipsInputProps,
|
|
5
|
+
ComboboxChipsProps,
|
|
6
|
+
ComboboxClearProps,
|
|
7
|
+
ComboboxCollectionProps,
|
|
8
|
+
ComboboxContentProps,
|
|
9
|
+
ComboboxEmptyProps,
|
|
10
|
+
ComboboxGroupLabelProps,
|
|
11
|
+
ComboboxGroupProps,
|
|
12
|
+
ComboboxInputProps,
|
|
13
|
+
ComboboxItemProps,
|
|
14
|
+
ComboboxListProps,
|
|
15
|
+
ComboboxProps,
|
|
16
|
+
ComboboxSeparatorProps,
|
|
17
|
+
ComboboxStatusProps,
|
|
18
|
+
ComboboxTriggerProps,
|
|
19
|
+
ComboboxValueProps,
|
|
20
|
+
} from '../components/form/Combobox';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Dialog } from '../components/Dialog';
|
|
2
|
+
export type {
|
|
3
|
+
DialogCloseProps,
|
|
4
|
+
DialogContentProps,
|
|
5
|
+
DialogDescriptionProps,
|
|
6
|
+
DialogFooterProps,
|
|
7
|
+
DialogHeaderProps,
|
|
8
|
+
DialogProps,
|
|
9
|
+
DialogTitleProps,
|
|
10
|
+
DialogTriggerProps,
|
|
11
|
+
} from '../components/Dialog';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { readdirSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
|
|
6
|
+
const entriesDir = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const repoRoot = join(entriesDir, '../..');
|
|
8
|
+
const distEntriesDir = join(repoRoot, 'dist/entries');
|
|
9
|
+
|
|
10
|
+
const entryNames = readdirSync(entriesDir)
|
|
11
|
+
.filter((file) => file.endsWith('.ts') && !file.endsWith('.test.ts'))
|
|
12
|
+
.map((file) => file.replace(/\.ts$/, ''))
|
|
13
|
+
.sort();
|
|
14
|
+
|
|
15
|
+
function readDistEntryNames() {
|
|
16
|
+
try {
|
|
17
|
+
return readdirSync(distEntriesDir)
|
|
18
|
+
.filter((file) => file.endsWith('.js'))
|
|
19
|
+
.map((file) => file.replace(/\.js$/, ''))
|
|
20
|
+
.sort();
|
|
21
|
+
} catch {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe('component entry points', () => {
|
|
27
|
+
it.each(entryNames)('imports %s without throwing', async (name) => {
|
|
28
|
+
const moduleUrl = pathToFileURL(join(entriesDir, `${name}.ts`)).href;
|
|
29
|
+
const module = await import(moduleUrl);
|
|
30
|
+
|
|
31
|
+
expect(Object.keys(module).length).toBeGreaterThan(0);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('ships a compiled file for each entry after build', () => {
|
|
35
|
+
const distEntries = readDistEntryNames();
|
|
36
|
+
|
|
37
|
+
if (distEntries.length === 0) {
|
|
38
|
+
expect(
|
|
39
|
+
entryNames.length,
|
|
40
|
+
'run pnpm run build before checking dist entry points',
|
|
41
|
+
).toBeGreaterThan(0);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
expect(distEntries).toEqual(entryNames);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('imports compiled package subpaths after build', async () => {
|
|
49
|
+
const distEntries = readDistEntryNames();
|
|
50
|
+
|
|
51
|
+
if (distEntries.length === 0) {
|
|
52
|
+
expect(
|
|
53
|
+
entryNames.length,
|
|
54
|
+
'run pnpm run build before checking package subpath imports',
|
|
55
|
+
).toBeGreaterThan(0);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
for (const name of distEntries) {
|
|
60
|
+
const module = await import(`@pickle-ui/react/${name}`);
|
|
61
|
+
|
|
62
|
+
expect(Object.keys(module).length).toBeGreaterThan(0);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { Form } from '../components/form/Form';
|
|
2
|
+
export type {
|
|
3
|
+
FormCheckboxProps,
|
|
4
|
+
FormComboboxProps,
|
|
5
|
+
FormDescriptionProps,
|
|
6
|
+
FormErrorProps,
|
|
7
|
+
FormFieldProps,
|
|
8
|
+
FormInputGroupProps,
|
|
9
|
+
FormInputProps,
|
|
10
|
+
FormLabelProps,
|
|
11
|
+
FormProps,
|
|
12
|
+
FormRadioGroupProps,
|
|
13
|
+
FormSelectProps,
|
|
14
|
+
FormSwitchProps,
|
|
15
|
+
FormTextareaProps,
|
|
16
|
+
} from '../components/form/Form';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { Menu } from '../components/Menu';
|
|
2
|
+
export type {
|
|
3
|
+
MenuCheckboxItemProps,
|
|
4
|
+
MenuContentProps,
|
|
5
|
+
MenuGroupLabelProps,
|
|
6
|
+
MenuGroupProps,
|
|
7
|
+
MenuItemProps,
|
|
8
|
+
MenuProps,
|
|
9
|
+
MenuRadioGroupProps,
|
|
10
|
+
MenuRadioItemProps,
|
|
11
|
+
MenuSeparatorProps,
|
|
12
|
+
MenuShortcutProps,
|
|
13
|
+
MenuSubContentProps,
|
|
14
|
+
MenuSubProps,
|
|
15
|
+
MenuSubTriggerProps,
|
|
16
|
+
MenuTriggerProps,
|
|
17
|
+
} from '../components/Menu';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ScrollArea } from '../components/ScrollArea';
|
|
2
|
+
export type {
|
|
3
|
+
ScrollAreaContentProps,
|
|
4
|
+
ScrollAreaCornerProps,
|
|
5
|
+
ScrollAreaProps,
|
|
6
|
+
ScrollAreaRootProps,
|
|
7
|
+
ScrollAreaScrollbarProps,
|
|
8
|
+
ScrollAreaThumbProps,
|
|
9
|
+
ScrollAreaViewportProps,
|
|
10
|
+
} from '../components/ScrollArea';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Select } from '../components/form/Select';
|
|
2
|
+
export type {
|
|
3
|
+
SelectContentProps,
|
|
4
|
+
SelectGroupLabelProps,
|
|
5
|
+
SelectGroupProps,
|
|
6
|
+
SelectItemProps,
|
|
7
|
+
SelectLabelProps,
|
|
8
|
+
SelectProps,
|
|
9
|
+
SelectSeparatorProps,
|
|
10
|
+
SelectTriggerProps,
|
|
11
|
+
SelectValueProps,
|
|
12
|
+
} from '../components/form/Select';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { Sidebar } from '../components/Sidebar';
|
|
2
|
+
export type {
|
|
3
|
+
SidebarContentProps,
|
|
4
|
+
SidebarFooterProps,
|
|
5
|
+
SidebarGroupLabelProps,
|
|
6
|
+
SidebarGroupProps,
|
|
7
|
+
SidebarHeaderProps,
|
|
8
|
+
SidebarMenuItemProps,
|
|
9
|
+
SidebarMenuLinkProps,
|
|
10
|
+
SidebarMenuListProps,
|
|
11
|
+
SidebarMenuProps,
|
|
12
|
+
SidebarProps,
|
|
13
|
+
} from '../components/Sidebar';
|