@pickle-ui/react-native 1.0.0-beta.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -10
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +24 -21
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Flex.d.ts +25 -0
- package/dist/components/Flex.d.ts.map +1 -0
- package/dist/components/Flex.js +24 -0
- package/dist/components/Flex.js.map +1 -0
- package/dist/components/Grid.d.ts +36 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/Grid.js +68 -0
- package/dist/components/Grid.js.map +1 -0
- package/dist/components/Separator.d.ts +11 -0
- package/dist/components/Separator.d.ts.map +1 -0
- package/dist/components/Separator.js +12 -0
- package/dist/components/Separator.js.map +1 -0
- package/dist/components/Spinner.d.ts +14 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +41 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/XStack.d.ts +4 -0
- package/dist/components/XStack.d.ts.map +1 -0
- package/dist/components/XStack.js +6 -0
- package/dist/components/XStack.js.map +1 -0
- package/dist/components/YStack.d.ts +4 -0
- package/dist/components/YStack.d.ts.map +1 -0
- package/dist/components/YStack.js +6 -0
- package/dist/components/YStack.js.map +1 -0
- package/dist/components/_internal/InputFrame.d.ts +13 -0
- package/dist/components/_internal/InputFrame.d.ts.map +1 -0
- package/dist/components/_internal/InputFrame.js +14 -0
- package/dist/components/_internal/InputFrame.js.map +1 -0
- package/dist/components/_internal/StoryItem.d.ts +6 -0
- package/dist/components/_internal/StoryItem.d.ts.map +1 -0
- package/dist/components/_internal/StoryItem.js +9 -0
- package/dist/components/_internal/StoryItem.js.map +1 -0
- package/dist/components/_internal/layout.d.ts +79 -0
- package/dist/components/_internal/layout.d.ts.map +1 -0
- package/dist/components/_internal/layout.js +73 -0
- package/dist/components/_internal/layout.js.map +1 -0
- package/dist/components/_internal/useControllableState.d.ts +7 -0
- package/dist/components/_internal/useControllableState.d.ts.map +1 -0
- package/dist/components/_internal/useControllableState.js +17 -0
- package/dist/components/_internal/useControllableState.js.map +1 -0
- package/dist/components/form/Checkbox.d.ts +26 -0
- package/dist/components/form/Checkbox.d.ts.map +1 -0
- package/dist/components/form/Checkbox.js +41 -0
- package/dist/components/form/Checkbox.js.map +1 -0
- package/dist/components/form/Form.context.d.ts +34 -0
- package/dist/components/form/Form.context.d.ts.map +1 -0
- package/dist/components/form/Form.context.js +53 -0
- package/dist/components/form/Form.context.js.map +1 -0
- package/dist/components/form/Form.d.ts +33 -0
- package/dist/components/form/Form.d.ts.map +1 -0
- package/dist/components/form/Form.js +36 -0
- package/dist/components/form/Form.js.map +1 -0
- package/dist/components/form/FormCheckbox.d.ts +7 -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/FormDescription.d.ts +4 -0
- package/dist/components/form/FormDescription.d.ts.map +1 -0
- package/dist/components/form/FormDescription.js +7 -0
- package/dist/components/form/FormDescription.js.map +1 -0
- package/dist/components/form/FormError.d.ts +5 -0
- package/dist/components/form/FormError.d.ts.map +1 -0
- package/dist/components/form/FormError.js +8 -0
- package/dist/components/form/FormError.js.map +1 -0
- package/dist/components/form/FormField.d.ts +17 -0
- package/dist/components/form/FormField.d.ts.map +1 -0
- package/dist/components/form/FormField.js +36 -0
- package/dist/components/form/FormField.js.map +1 -0
- package/dist/components/form/FormInput.d.ts +10 -0
- package/dist/components/form/FormInput.d.ts.map +1 -0
- package/dist/components/form/FormInput.js +36 -0
- package/dist/components/form/FormInput.js.map +1 -0
- package/dist/components/form/FormInputGroup.d.ts +8 -0
- package/dist/components/form/FormInputGroup.d.ts.map +1 -0
- package/dist/components/form/FormInputGroup.js +18 -0
- package/dist/components/form/FormInputGroup.js.map +1 -0
- package/dist/components/form/FormLabel.d.ts +4 -0
- package/dist/components/form/FormLabel.d.ts.map +1 -0
- package/dist/components/form/FormLabel.js +7 -0
- package/dist/components/form/FormLabel.js.map +1 -0
- package/dist/components/form/FormRadioGroup.d.ts +11 -0
- package/dist/components/form/FormRadioGroup.d.ts.map +1 -0
- package/dist/components/form/FormRadioGroup.js +24 -0
- package/dist/components/form/FormRadioGroup.js.map +1 -0
- package/dist/components/form/FormRoot.d.ts +13 -0
- package/dist/components/form/FormRoot.d.ts.map +1 -0
- package/dist/components/form/FormRoot.js +19 -0
- package/dist/components/form/FormRoot.js.map +1 -0
- package/dist/components/form/FormTextarea.d.ts +7 -0
- package/dist/components/form/FormTextarea.d.ts.map +1 -0
- package/dist/components/form/FormTextarea.js +27 -0
- package/dist/components/form/FormTextarea.js.map +1 -0
- package/dist/components/form/Input.d.ts +17 -0
- package/dist/components/form/Input.d.ts.map +1 -0
- package/dist/components/form/Input.js +32 -0
- package/dist/components/form/Input.js.map +1 -0
- package/dist/components/form/InputGroup.context.d.ts +10 -0
- package/dist/components/form/InputGroup.context.d.ts.map +1 -0
- package/dist/components/form/InputGroup.context.js +8 -0
- package/dist/components/form/InputGroup.context.js.map +1 -0
- package/dist/components/form/InputGroup.d.ts +31 -0
- package/dist/components/form/InputGroup.d.ts.map +1 -0
- package/dist/components/form/InputGroup.js +123 -0
- package/dist/components/form/InputGroup.js.map +1 -0
- package/dist/components/form/RadioGroup.d.ts +29 -0
- package/dist/components/form/RadioGroup.d.ts.map +1 -0
- package/dist/components/form/RadioGroup.js +42 -0
- package/dist/components/form/RadioGroup.js.map +1 -0
- package/dist/components/form/Textarea.d.ts +19 -0
- package/dist/components/form/Textarea.d.ts.map +1 -0
- package/dist/components/form/Textarea.js +26 -0
- package/dist/components/form/Textarea.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/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/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/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/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/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/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/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/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/src/components/Button.tsx +24 -21
- package/src/components/Flex.stories.tsx +58 -0
- package/src/components/Flex.test.tsx +57 -0
- package/src/components/Flex.tsx +52 -0
- package/src/components/Grid.stories.tsx +55 -0
- package/src/components/Grid.test.tsx +140 -0
- package/src/components/Grid.tsx +166 -0
- package/src/components/Separator.stories.tsx +39 -0
- package/src/components/Separator.test.tsx +25 -0
- package/src/components/Separator.tsx +30 -0
- package/src/components/Spinner.stories.tsx +35 -0
- package/src/components/Spinner.test.tsx +30 -0
- package/src/components/Spinner.tsx +75 -0
- package/src/components/XStack.stories.tsx +46 -0
- package/src/components/XStack.test.tsx +13 -0
- package/src/components/XStack.tsx +7 -0
- package/src/components/YStack.stories.tsx +46 -0
- package/src/components/YStack.test.tsx +13 -0
- package/src/components/YStack.tsx +7 -0
- package/src/components/_internal/InputFrame.tsx +50 -0
- package/src/components/_internal/StoryItem.tsx +24 -0
- package/src/components/_internal/layout.ts +103 -0
- package/src/components/_internal/useControllableState.ts +25 -0
- package/src/components/form/Checkbox.stories.tsx +67 -0
- package/src/components/form/Checkbox.test.tsx +88 -0
- package/src/components/form/Checkbox.tsx +141 -0
- package/src/components/form/Form.context.ts +91 -0
- package/src/components/form/Form.stories.tsx +152 -0
- package/src/components/form/Form.test.tsx +195 -0
- package/src/components/form/Form.tsx +51 -0
- package/src/components/form/FormCheckbox.tsx +42 -0
- package/src/components/form/FormDescription.tsx +14 -0
- package/src/components/form/FormError.tsx +17 -0
- package/src/components/form/FormField.tsx +82 -0
- package/src/components/form/FormInput.tsx +70 -0
- package/src/components/form/FormInputGroup.tsx +30 -0
- package/src/components/form/FormLabel.tsx +17 -0
- package/src/components/form/FormRadioGroup.tsx +48 -0
- package/src/components/form/FormRoot.tsx +41 -0
- package/src/components/form/FormTextarea.tsx +56 -0
- package/src/components/form/Input.stories.tsx +105 -0
- package/src/components/form/Input.test.tsx +76 -0
- package/src/components/form/Input.tsx +81 -0
- package/src/components/form/InputGroup.context.ts +11 -0
- package/src/components/form/InputGroup.stories.tsx +129 -0
- package/src/components/form/InputGroup.test.tsx +95 -0
- package/src/components/form/InputGroup.tsx +266 -0
- package/src/components/form/RadioGroup.stories.tsx +62 -0
- package/src/components/form/RadioGroup.test.tsx +98 -0
- package/src/components/form/RadioGroup.tsx +151 -0
- package/src/components/form/Textarea.stories.tsx +61 -0
- package/src/components/form/Textarea.test.tsx +35 -0
- package/src/components/form/Textarea.tsx +74 -0
- package/src/entries/checkbox.ts +2 -0
- package/src/entries/flex.ts +2 -0
- package/src/entries/form.ts +13 -0
- package/src/entries/grid.ts +2 -0
- package/src/entries/input-group.ts +8 -0
- package/src/entries/input.ts +2 -0
- package/src/entries/radio-group.ts +5 -0
- package/src/entries/separator.ts +2 -0
- package/src/entries/spinner.ts +2 -0
- package/src/entries/textarea.ts +2 -0
- package/src/entries/x-stack.ts +2 -0
- package/src/entries/y-stack.ts +2 -0
- package/src/index.ts +12 -0
- package/dist/components/_internal/Spinner.d.ts +0 -9
- package/dist/components/_internal/Spinner.d.ts.map +0 -1
- package/dist/components/_internal/Spinner.js +0 -31
- package/dist/components/_internal/Spinner.js.map +0 -1
- package/src/components/_internal/Spinner.tsx +0 -49
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type InputProps } from './Input';
|
|
2
|
+
export type FormInputProps = Omit<InputProps, 'defaultValue' | 'invalid' | 'value'> & {
|
|
3
|
+
name?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* An `Input` bound to the field's value. The return key submits the form,
|
|
7
|
+
* like Enter on the web, unless `onSubmitEditing` is set.
|
|
8
|
+
*/
|
|
9
|
+
export declare function FormInput({ name: nameProp, onBlur, onChangeText, onSubmitEditing, ref, ...props }: FormInputProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=FormInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormInput.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAGjD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,cAAc,GAAG,SAAS,GAAG,OAAO,CACrC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAItB;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EACZ,eAAe,EACf,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,+BAoChB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { use, useImperativeHandle, useRef } from 'react';
|
|
3
|
+
import { useController } from 'react-hook-form';
|
|
4
|
+
import { FormFieldContext, FormInputGroupContext, FormSubmitContext, useFormControlProps, useFormMethods, useRequiredFieldName, } from './Form.context';
|
|
5
|
+
import { Input } from './Input';
|
|
6
|
+
import { InputGroup } from './InputGroup';
|
|
7
|
+
/**
|
|
8
|
+
* An `Input` bound to the field's value. The return key submits the form,
|
|
9
|
+
* like Enter on the web, unless `onSubmitEditing` is set.
|
|
10
|
+
*/
|
|
11
|
+
export function FormInput({ name: nameProp, onBlur, onChangeText, onSubmitEditing, ref, ...props }) {
|
|
12
|
+
const name = useRequiredFieldName(nameProp, 'Form.Input');
|
|
13
|
+
const { control } = useFormMethods();
|
|
14
|
+
const { field } = useController({ control, name });
|
|
15
|
+
const controlProps = useFormControlProps();
|
|
16
|
+
const fieldContext = use(FormFieldContext);
|
|
17
|
+
const isInsideInputGroup = use(FormInputGroupContext);
|
|
18
|
+
const submit = use(FormSubmitContext);
|
|
19
|
+
const inputRef = useRef(null);
|
|
20
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
21
|
+
const InputComponent = isInsideInputGroup ? InputGroup.Input : Input;
|
|
22
|
+
return (_jsx(InputComponent, { ...controlProps, ...props, onBlur: (event) => {
|
|
23
|
+
field.onBlur();
|
|
24
|
+
onBlur?.(event);
|
|
25
|
+
}, onChangeText: (text) => {
|
|
26
|
+
field.onChange(text);
|
|
27
|
+
onChangeText?.(text);
|
|
28
|
+
}, onSubmitEditing: onSubmitEditing ?? submit, ref: (node) => {
|
|
29
|
+
inputRef.current = node;
|
|
30
|
+
// React Hook Form focuses the first invalid field after a submit,
|
|
31
|
+
// and the field's label focuses its input when pressed.
|
|
32
|
+
field.ref(node);
|
|
33
|
+
fieldContext?.setControl(node);
|
|
34
|
+
}, value: field.value ?? '' }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=FormInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormInput.js","sourceRoot":"","sources":["../../../src/components/form/FormInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EACZ,eAAe,EACf,GAAG,EACH,GAAG,KAAK,EACO;IACf,MAAM,IAAI,GAAG,oBAAoB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAC1D,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,mBA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* An `InputGroup` whose `Form.Input` renders `InputGroup.Input`, framed as
|
|
5
|
+
* invalid while the field has an error.
|
|
6
|
+
*/
|
|
7
|
+
export declare function FormInputGroup({ children, ...props }: FormInputGroupProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=FormInputGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormInputGroup.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormInputGroup.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAgBzE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, isValidElement } from 'react';
|
|
3
|
+
import { FormInputGroupContext, useFormControlProps } from './Form.context';
|
|
4
|
+
import { FormInput } from './FormInput';
|
|
5
|
+
import { InputGroup } from './InputGroup';
|
|
6
|
+
import { InputGroupStateContext } from './InputGroup.context';
|
|
7
|
+
/**
|
|
8
|
+
* An `InputGroup` whose `Form.Input` renders `InputGroup.Input`, framed as
|
|
9
|
+
* invalid while the field has an error.
|
|
10
|
+
*/
|
|
11
|
+
export function FormInputGroup({ children, ...props }) {
|
|
12
|
+
const { invalid } = useFormControlProps();
|
|
13
|
+
const disabled = Children.toArray(children).some((child) => isValidElement(child) &&
|
|
14
|
+
child.type === FormInput &&
|
|
15
|
+
Boolean(child.props.disabled));
|
|
16
|
+
return (_jsx(FormInputGroupContext, { value: true, children: _jsx(InputGroupStateContext, { value: { disabled, invalid }, children: _jsx(InputGroup, { ...props, children: children }) }) }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FormInputGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormInputGroup.js","sourceRoot":"","sources":["../../../src/components/form/FormInputGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAuB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAI9D;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuB;IACxE,MAAM,EAAE,OAAO,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC9C,CAAC,KAAK,EAAE,EAAE,CACR,cAAc,CAAiB,KAAK,CAAC;QACrC,KAAK,CAAC,IAAI,KAAK,SAAS;QACxB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAChC,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,IAAC,KAAK,kBAC1B,KAAC,sBAAsB,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAClD,KAAC,UAAU,OAAK,KAAK,YAAG,QAAQ,GAAc,GACvB,GACH,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormLabel.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC;AAE/D,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAUhE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { cn } from '../../lib/cn';
|
|
4
|
+
export function FormLabel({ className, ...props }) {
|
|
5
|
+
return (_jsx(Text, { className: cn('text-foreground text-sm leading-none font-medium', className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=FormLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormLabel.js","sourceRoot":"","sources":["../../../src/components/form/FormLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIlC,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkB;IAC/D,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CACX,kDAAkD,EAClD,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RadioGroupProps } from './RadioGroup';
|
|
2
|
+
export type FormRadioGroupProps = Omit<RadioGroupProps, 'value'> & {
|
|
3
|
+
name?: string;
|
|
4
|
+
};
|
|
5
|
+
/** A `RadioGroup` bound to the field's value. */
|
|
6
|
+
declare function FormRadioGroupRoot({ name: nameProp, onValueChange, ...props }: FormRadioGroupProps): import("react").JSX.Element;
|
|
7
|
+
declare const FormRadioGroup: typeof FormRadioGroupRoot & {
|
|
8
|
+
Item: typeof import("./RadioGroup").RadioGroupItem;
|
|
9
|
+
};
|
|
10
|
+
export { FormRadioGroup };
|
|
11
|
+
//# sourceMappingURL=FormRadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormRadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormRadioGroup.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,iDAAiD;AACjD,iBAAS,kBAAkB,CAAC,EAC1B,IAAI,EAAE,QAAQ,EACd,aAAa,EACb,GAAG,KAAK,EACT,EAAE,mBAAmB,+BAuBrB;AAED,QAAA,MAAM,cAAc;;CAElB,CAAC;AAEH,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useController } from 'react-hook-form';
|
|
3
|
+
import { useFormControlProps, useFormMethods, useRequiredFieldName, } from './Form.context';
|
|
4
|
+
import { RadioGroup } from './RadioGroup';
|
|
5
|
+
/** A `RadioGroup` bound to the field's value. */
|
|
6
|
+
function FormRadioGroupRoot({ name: nameProp, onValueChange, ...props }) {
|
|
7
|
+
const name = useRequiredFieldName(nameProp, 'Form.RadioGroup');
|
|
8
|
+
const { control } = useFormMethods();
|
|
9
|
+
const { field } = useController({
|
|
10
|
+
control,
|
|
11
|
+
defaultValue: props.defaultValue,
|
|
12
|
+
name,
|
|
13
|
+
});
|
|
14
|
+
const { accessibilityLabel, 'aria-labelledby': labelledBy } = useFormControlProps();
|
|
15
|
+
return (_jsx(RadioGroup, { accessibilityLabel: accessibilityLabel, "aria-labelledby": labelledBy, ...props, onValueChange: (value) => {
|
|
16
|
+
field.onChange(value);
|
|
17
|
+
onValueChange?.(value);
|
|
18
|
+
}, value: field.value }));
|
|
19
|
+
}
|
|
20
|
+
const FormRadioGroup = Object.assign(FormRadioGroupRoot, {
|
|
21
|
+
Item: RadioGroup.Item,
|
|
22
|
+
});
|
|
23
|
+
export { FormRadioGroup };
|
|
24
|
+
//# sourceMappingURL=FormRadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormRadioGroup.js","sourceRoot":"","sources":["../../../src/components/form/FormRadioGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAMhE,iDAAiD;AACjD,SAAS,kBAAkB,CAAC,EAC1B,IAAI,EAAE,QAAQ,EACd,aAAa,EACb,GAAG,KAAK,EACY;IACpB,MAAM,IAAI,GAAG,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IAC/D,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC;QAC9B,OAAO;QACP,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,IAAI;KACL,CAAC,CAAC;IACH,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,GACzD,mBAAmB,EAAE,CAAC;IAExB,OAAO,CACL,KAAC,UAAU,IACT,kBAAkB,EAAE,kBAAkB,qBACrB,UAAU,KACvB,KAAK,EACT,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YACvB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACtB,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,EACD,KAAK,EAAE,KAAK,CAAC,KAAK,GAClB,CACH,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IACvD,IAAI,EAAE,UAAU,CAAC,IAAI;CACtB,CAAC,CAAC;AAEH,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FieldValues, type SubmitHandler, type UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
export type FormProps<FormValues extends FieldValues = FieldValues> = React.ComponentProps<typeof View> & {
|
|
4
|
+
form: UseFormReturn<FormValues>;
|
|
5
|
+
onSubmit?: SubmitHandler<FormValues>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* React Native has no `<form>`, so the root shares a submit action:
|
|
9
|
+
* `Form.Button` and the return key in `Form.Input` call it, like a submit
|
|
10
|
+
* button and Enter on the web.
|
|
11
|
+
*/
|
|
12
|
+
export declare function FormRoot<FormValues extends FieldValues = FieldValues>({ className, form, onSubmit, ...props }: FormProps<FormValues>): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=FormRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormRoot.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormRoot.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAKpC,MAAM,MAAM,SAAS,CAAC,UAAU,SAAS,WAAW,GAAG,WAAW,IAChE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IAClC,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACtC,CAAC;AAEJ;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,UAAU,SAAS,WAAW,GAAG,WAAW,EAAE,EACrE,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,UAAU,CAAC,+BAYvB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { FormProvider, } from 'react-hook-form';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { cn } from '../../lib/cn';
|
|
6
|
+
import { FormSubmitContext } from './Form.context';
|
|
7
|
+
/**
|
|
8
|
+
* React Native has no `<form>`, so the root shares a submit action:
|
|
9
|
+
* `Form.Button` and the return key in `Form.Input` call it, like a submit
|
|
10
|
+
* button and Enter on the web.
|
|
11
|
+
*/
|
|
12
|
+
export function FormRoot({ className, form, onSubmit, ...props }) {
|
|
13
|
+
const submit = useCallback(() => {
|
|
14
|
+
if (onSubmit)
|
|
15
|
+
void form.handleSubmit(onSubmit)();
|
|
16
|
+
}, [form, onSubmit]);
|
|
17
|
+
return (_jsx(FormProvider, { ...form, children: _jsx(FormSubmitContext, { value: submit, children: _jsx(View, { className: cn('gap-6', className), ...props }) }) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=FormRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormRoot.js","sourceRoot":"","sources":["../../../src/components/form/FormRoot.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAEL,YAAY,GAGb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAQnD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAA+C,EACrE,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACc;IACtB,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,IAAI,QAAQ;YAAE,KAAK,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;IACnD,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,KAAC,YAAY,OAAK,IAAI,YACpB,KAAC,iBAAiB,IAAC,KAAK,EAAE,MAAM,YAC9B,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,GACpC,GACP,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TextareaProps } from './Textarea';
|
|
2
|
+
export type FormTextareaProps = Omit<TextareaProps, 'defaultValue' | 'invalid' | 'value'> & {
|
|
3
|
+
name?: string;
|
|
4
|
+
};
|
|
5
|
+
/** A `Textarea` bound to the field's value. */
|
|
6
|
+
export declare function FormTextarea({ name: nameProp, onBlur, onChangeText, ref, ...props }: FormTextareaProps): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=FormTextarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormTextarea.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormTextarea.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,aAAa,EACb,cAAc,GAAG,SAAS,GAAG,OAAO,CACrC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAItB,+CAA+C;AAC/C,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EACZ,GAAG,EACH,GAAG,KAAK,EACT,EAAE,iBAAiB,+BA6BnB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { use, useImperativeHandle, useRef } from 'react';
|
|
3
|
+
import { useController } from 'react-hook-form';
|
|
4
|
+
import { FormFieldContext, useFormControlProps, useFormMethods, useRequiredFieldName, } from './Form.context';
|
|
5
|
+
import { Textarea } from './Textarea';
|
|
6
|
+
/** A `Textarea` bound to the field's value. */
|
|
7
|
+
export function FormTextarea({ name: nameProp, onBlur, onChangeText, ref, ...props }) {
|
|
8
|
+
const name = useRequiredFieldName(nameProp, 'Form.Textarea');
|
|
9
|
+
const { control } = useFormMethods();
|
|
10
|
+
const { field } = useController({ control, name });
|
|
11
|
+
const controlProps = useFormControlProps();
|
|
12
|
+
const fieldContext = use(FormFieldContext);
|
|
13
|
+
const inputRef = useRef(null);
|
|
14
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
15
|
+
return (_jsx(Textarea, { ...controlProps, ...props, onBlur: (event) => {
|
|
16
|
+
field.onBlur();
|
|
17
|
+
onBlur?.(event);
|
|
18
|
+
}, onChangeText: (text) => {
|
|
19
|
+
field.onChange(text);
|
|
20
|
+
onChangeText?.(text);
|
|
21
|
+
}, ref: (node) => {
|
|
22
|
+
inputRef.current = node;
|
|
23
|
+
field.ref(node);
|
|
24
|
+
fieldContext?.setControl(node);
|
|
25
|
+
}, value: field.value ?? '' }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=FormTextarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormTextarea.js","sourceRoot":"","sources":["../../../src/components/form/FormTextarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAC;AAS1D,+CAA+C;AAC/C,MAAM,UAAU,YAAY,CAAC,EAC3B,IAAI,EAAE,Q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
/** Class overrides for the inner `TextInput`; `className` styles the control around it. */
|
|
4
|
+
classNames?: {
|
|
5
|
+
input?: string;
|
|
6
|
+
};
|
|
7
|
+
/** Dims the field and stops editing, like the web's `disabled`. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Marks the value as invalid, like the web's `aria-invalid`. */
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
size?: 'lg' | 'md' | 'sm';
|
|
12
|
+
/** Renders the bare `TextInput`, without the border and background. */
|
|
13
|
+
unstyled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** A single-line text field, like `Input` in @pickle-ui/react. */
|
|
16
|
+
export declare function Input({ className, classNames, disabled, editable, invalid, onBlur, onFocus, size, unstyled, ...props }: InputProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/form/Input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAczC,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAChE,2FAA2F;IAC3F,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,kEAAkE;AAClE,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,UAAU,EACV,QAAgB,EAChB,QAAe,EACf,OAAe,EACf,MAAM,EACN,OAAO,EACP,IAAW,EACX,QAAgB,EAChB,GAAG,KAAK,EACT,EAAE,UAAU,+BAyCZ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { TextInput } from 'react-native';
|
|
4
|
+
import { cn } from '../../lib/cn';
|
|
5
|
+
import { InputFrame } from '../_internal/InputFrame';
|
|
6
|
+
// Same heights as `Button` for the same size, so they line up side by side,
|
|
7
|
+
// and the web's paddings minus the 1pt border.
|
|
8
|
+
const heightClasses = { lg: 'h-9', md: 'h-8', sm: 'h-7' };
|
|
9
|
+
const paddingClasses = {
|
|
10
|
+
lg: 'px-[13px]',
|
|
11
|
+
md: 'px-[11px]',
|
|
12
|
+
sm: 'px-[9px]',
|
|
13
|
+
};
|
|
14
|
+
/** A single-line text field, like `Input` in @pickle-ui/react. */
|
|
15
|
+
export function Input({ className, classNames, disabled = false, editable = true, invalid = false, onBlur, onFocus, size = 'md', unstyled = false, ...props }) {
|
|
16
|
+
const [focused, setFocused] = useState(false);
|
|
17
|
+
// The web's 14px from `sm` up: the 16px it uses on phones only stops iOS
|
|
18
|
+
// Safari zooming into a focused field, which native apps don't do.
|
|
19
|
+
// `text-[14px]` sets the size without `text-sm`'s line height, which
|
|
20
|
+
// pushes a single-line field's text off center on iOS.
|
|
21
|
+
const input = (_jsx(TextInput, { accessibilityState: { disabled }, className: cn('text-foreground flex-1 text-[14px] outline-none', paddingClasses[size], unstyled ? cn(heightClasses[size], disabled && 'opacity-64') : 'h-full', unstyled ? className : classNames?.input), editable: editable && !disabled, onBlur: (event) => {
|
|
22
|
+
setFocused(false);
|
|
23
|
+
onBlur?.(event);
|
|
24
|
+
}, onFocus: (event) => {
|
|
25
|
+
setFocused(true);
|
|
26
|
+
onFocus?.(event);
|
|
27
|
+
}, placeholderTextColorClassName: "accent-muted-foreground/72", ...props }));
|
|
28
|
+
if (unstyled)
|
|
29
|
+
return input;
|
|
30
|
+
return (_jsx(InputFrame, { className: cn(heightClasses[size], className), disabled: disabled, focused: focused, invalid: invalid, children: input }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/components/form/Input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,4EAA4E;AAC5E,+CAA+C;AAC/C,MAAM,aAAa,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAW,CAAC;AACnE,MAAM,cAAc,GAAG;IACrB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,UAAU;CACN,CAAC;AAcX,kEAAkE;AAClE,MAAM,UAAU,KAAK,CAAC,EACpB,SAAS,EACT,UAAU,EACV,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,IAAI,EACf,OAAO,GAAG,KAAK,EACf,MAAM,EACN,OAAO,EACP,IAAI,GAAG,IAAI,EACX,QAAQ,GAAG,KAAK,EAChB,GAAG,KAAK,EACG;IACX,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,yEAAyE;IACzE,mEAAmE;IACnE,qEAAqE;IACrE,uDAAuD;IACvD,MAAM,KAAK,GAAG,CACZ,KAAC,SAAS,IACR,kBAAkB,EAAE,EAAE,QAAQ,EAAE,EAChC,SAAS,EAAE,EAAE,CACX,iDAAiD,EACjD,cAAc,CAAC,IAAI,CAAC,EACpB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EACvE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CACzC,EACD,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,EAC/B,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,UAAU,CAAC,KAAK,CAAC,CAAC;YAClB,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,EACD,6BAA6B,EAAC,4BAA4B,KACtD,KAAK,GACT,CACH,CAAC;IAEF,IAAI,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE3B,OAAO,CACL,KAAC,UAAU,IACT,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAC7C,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,YAEf,KAAK,GACK,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lets a wrapper mark the frame `disabled` or `invalid` when its input isn't
|
|
3
|
+
* a direct `InputGroup.Input` child, like `Form.InputGroup` does with
|
|
4
|
+
* `Form.Input`, whose invalid state comes from the form.
|
|
5
|
+
*/
|
|
6
|
+
export declare const InputGroupStateContext: import("react").Context<{
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
} | null>;
|
|
10
|
+
//# sourceMappingURL=InputGroup.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.context.d.ts","sourceRoot":"","sources":["../../../src/components/form/InputGroup.context.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;eACtB,OAAO;cACR,OAAO;SACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Lets a wrapper mark the frame `disabled` or `invalid` when its input isn't
|
|
4
|
+
* a direct `InputGroup.Input` child, like `Form.InputGroup` does with
|
|
5
|
+
* `Form.Input`, whose invalid state comes from the form.
|
|
6
|
+
*/
|
|
7
|
+
export const InputGroupStateContext = createContext(null);
|
|
8
|
+
//# sourceMappingURL=InputGroup.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.context.js","sourceRoot":"","sources":["../../../src/components/form/InputGroup.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAGhD,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { type ButtonProps } from '../Button';
|
|
4
|
+
import { type InputProps } from './Input';
|
|
5
|
+
type InputGroupAlign = 'block-end' | 'block-start' | 'inline-end' | 'inline-start';
|
|
6
|
+
export type InputGroupAddonProps = React.ComponentProps<typeof Pressable> & {
|
|
7
|
+
align?: InputGroupAlign;
|
|
8
|
+
/** Text is wrapped in a label; other children, such as icons, render as they are. */
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type InputGroupButtonProps = ButtonProps & {
|
|
12
|
+
align?: InputGroupAlign;
|
|
13
|
+
};
|
|
14
|
+
export type InputGroupInputProps = Omit<InputProps, 'unstyled'>;
|
|
15
|
+
export type InputGroupProps = React.ComponentProps<typeof View>;
|
|
16
|
+
export type InputGroupTextProps = React.ComponentProps<typeof Text>;
|
|
17
|
+
/** Pressing an addon focuses the field, like clicking it on the web. */
|
|
18
|
+
declare function InputGroupAddon({ align, children, className, ...props }: InputGroupAddonProps): import("react").JSX.Element;
|
|
19
|
+
declare function InputGroupButton({ align, className, size, variant, ...props }: InputGroupButtonProps): import("react").JSX.Element;
|
|
20
|
+
declare function InputGroupInput({ className, onBlur, onFocus, ref, ...props }: InputGroupInputProps): import("react").JSX.Element;
|
|
21
|
+
/** Places addons around the input and frames the group like an `Input`. */
|
|
22
|
+
declare function InputGroupRoot({ children, className, ...props }: InputGroupProps): import("react").JSX.Element;
|
|
23
|
+
declare function InputGroupText({ className, ...props }: InputGroupTextProps): import("react").JSX.Element;
|
|
24
|
+
declare const InputGroup: typeof InputGroupRoot & {
|
|
25
|
+
Addon: typeof InputGroupAddon;
|
|
26
|
+
Button: typeof InputGroupButton;
|
|
27
|
+
Input: typeof InputGroupInput;
|
|
28
|
+
Text: typeof InputGroupText;
|
|
29
|
+
};
|
|
30
|
+
export { InputGroup };
|
|
31
|
+
//# sourceMappingURL=InputGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../src/components/form/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,IAAI,EAAkB,IAAI,EAAE,MAAM,cAAc,CAAC;AAIrE,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAGjD,KAAK,eAAe,GAChB,WAAW,GACX,aAAa,GACb,YAAY,GACZ,cAAc,CAAC;AA6BnB,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1E,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,eAAe,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC;AAEpE,wEAAwE;AACxE,iBAAS,eAAe,CAAC,EACvB,KAAsB,EACtB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,+BAuBtB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAoB,EACpB,SAAS,EACT,IAAgB,EAChB,OAAiB,EACjB,GAAG,KAAK,EACT,EAAE,qBAAqB,+BAMvB;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,MAAM,EACN,OAAO,EACP,GAAG,EACH,GAAG,KAAK,EACT,EAAE,oBAAoB,+BA6BtB;AAED,2EAA2E;AAC3E,iBAAS,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BAoDzE;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAQnE;AA+CD,QAAA,MAAM,UAAU;;;;;CAKd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, createContext, isValidElement, use, useImperativeHandle, useMemo, useRef, useState, } from 'react';
|
|
3
|
+
import { Pressable, Text, View } from 'react-native';
|
|
4
|
+
import { cn } from '../../lib/cn';
|
|
5
|
+
import { InputFrame } from '../_internal/InputFrame';
|
|
6
|
+
import { Button } from '../Button';
|
|
7
|
+
import { Input } from './Input';
|
|
8
|
+
import { InputGroupStateContext } from './InputGroup.context';
|
|
9
|
+
// The web's addon paddings minus the 1pt border. Addons holding a button sit
|
|
10
|
+
// closer to the edge, like the web's `has-[>button]` margins.
|
|
11
|
+
const addonClasses = {
|
|
12
|
+
'block-end': 'w-full justify-start px-[11px] pb-[11px]',
|
|
13
|
+
'block-start': 'w-full justify-start px-[11px] pt-[11px]',
|
|
14
|
+
'inline-end': 'pe-[11px]',
|
|
15
|
+
'inline-start': 'ps-[11px]',
|
|
16
|
+
};
|
|
17
|
+
const buttonAddonClasses = {
|
|
18
|
+
'block-end': '',
|
|
19
|
+
'block-start': '',
|
|
20
|
+
'inline-end': 'pe-[3px]',
|
|
21
|
+
'inline-start': 'ps-[3px]',
|
|
22
|
+
};
|
|
23
|
+
const InputGroupContext = createContext(null);
|
|
24
|
+
/** Pressing an addon focuses the field, like clicking it on the web. */
|
|
25
|
+
function InputGroupAddon({ align = 'inline-start', children, className, ...props }) {
|
|
26
|
+
const group = useInputGroup('Addon');
|
|
27
|
+
return (_jsx(Pressable, { accessible: false, className: cn('flex-row items-center justify-center gap-2', addonClasses[align], className), onPress: group.focusInput, ...props, children: Children.map(children, (child) => typeof child === 'string' || typeof child === 'number' ? (_jsx(Text, { className: "text-foreground text-[14px]", children: child })) : (child)) }));
|
|
28
|
+
}
|
|
29
|
+
function InputGroupButton({ align = 'inline-end', className, size = 'icon-xs', variant = 'ghost', ...props }) {
|
|
30
|
+
return (_jsx(InputGroupAddon, { align: align, className: buttonAddonClasses[align], children: _jsx(Button, { className: className, size: size, variant: variant, ...props }) }));
|
|
31
|
+
}
|
|
32
|
+
function InputGroupInput({ className, onBlur, onFocus, ref, ...props }) {
|
|
33
|
+
const group = useInputGroup('Input');
|
|
34
|
+
const inputRef = useRef(null);
|
|
35
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
36
|
+
return (_jsx(Input, { className: cn(group.hasInlineStart && 'ps-2', group.hasInlineEnd && 'pe-2', className), onBlur: (event) => {
|
|
37
|
+
group.setFocused(false);
|
|
38
|
+
onBlur?.(event);
|
|
39
|
+
}, onFocus: (event) => {
|
|
40
|
+
group.setFocused(true);
|
|
41
|
+
onFocus?.(event);
|
|
42
|
+
}, ref: (node) => {
|
|
43
|
+
inputRef.current = node;
|
|
44
|
+
// The group focuses the input when an addon is pressed.
|
|
45
|
+
group.setInput(node);
|
|
46
|
+
}, unstyled: true, ...props }));
|
|
47
|
+
}
|
|
48
|
+
/** Places addons around the input and frames the group like an `Input`. */
|
|
49
|
+
function InputGroupRoot({ children, className, ...props }) {
|
|
50
|
+
const [focused, setFocused] = useState(false);
|
|
51
|
+
const inputRef = useRef(null);
|
|
52
|
+
const state = use(InputGroupStateContext);
|
|
53
|
+
const sorted = sortChildren(children);
|
|
54
|
+
const { parts } = sorted;
|
|
55
|
+
const disabled = sorted.disabled || Boolean(state?.disabled);
|
|
56
|
+
const invalid = sorted.invalid || Boolean(state?.invalid);
|
|
57
|
+
const hasInlineEnd = parts['inline-end'].length > 0;
|
|
58
|
+
const hasInlineStart = parts['inline-start'].length > 0;
|
|
59
|
+
const context = useMemo(() => ({
|
|
60
|
+
focusInput: () => inputRef.current?.focus(),
|
|
61
|
+
hasInlineEnd,
|
|
62
|
+
hasInlineStart,
|
|
63
|
+
setFocused,
|
|
64
|
+
setInput: (input) => {
|
|
65
|
+
inputRef.current = input;
|
|
66
|
+
},
|
|
67
|
+
}), [hasInlineEnd, hasInlineStart]);
|
|
68
|
+
const hasBlock = parts['block-start'].length > 0 || parts['block-end'].length > 0;
|
|
69
|
+
const row = [
|
|
70
|
+
...parts['inline-start'],
|
|
71
|
+
...parts.field,
|
|
72
|
+
...parts['inline-end'],
|
|
73
|
+
];
|
|
74
|
+
return (_jsx(InputGroupContext, { value: context, children: _jsx(InputFrame, { className: cn(hasBlock ? 'flex-col' : 'h-8 items-center', className), disabled: disabled, focused: focused, invalid: invalid, role: "group", ...props, children: hasBlock ? (_jsxs(_Fragment, { children: [parts['block-start'], _jsx(View, { className: "flex-row items-center", children: row }), parts['block-end']] })) : (row) }) }));
|
|
75
|
+
}
|
|
76
|
+
function InputGroupText({ className, ...props }) {
|
|
77
|
+
return (_jsx(Text, { className: cn('text-muted-foreground text-[14px]', className), numberOfLines: 1, ...props }));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Splits the group's direct children by `align`, since React Native has no
|
|
81
|
+
* CSS `order`, and reads `disabled` and `invalid` from its inputs.
|
|
82
|
+
*/
|
|
83
|
+
function sortChildren(children) {
|
|
84
|
+
const parts = {
|
|
85
|
+
'block-end': [],
|
|
86
|
+
'block-start': [],
|
|
87
|
+
field: [],
|
|
88
|
+
'inline-end': [],
|
|
89
|
+
'inline-start': [],
|
|
90
|
+
};
|
|
91
|
+
let disabled = false;
|
|
92
|
+
let invalid = false;
|
|
93
|
+
for (const child of Children.toArray(children)) {
|
|
94
|
+
if (isValidElement(child) &&
|
|
95
|
+
(child.type === InputGroupAddon || child.type === InputGroupButton)) {
|
|
96
|
+
const fallback = child.type === InputGroupButton ? 'inline-end' : 'inline-start';
|
|
97
|
+
parts[child.props.align ?? fallback].push(child);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if (isValidElement(child) &&
|
|
101
|
+
child.type === InputGroupInput) {
|
|
102
|
+
disabled || (disabled = Boolean(child.props.disabled));
|
|
103
|
+
invalid || (invalid = Boolean(child.props.invalid));
|
|
104
|
+
}
|
|
105
|
+
parts.field.push(child);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return { disabled, invalid, parts };
|
|
109
|
+
}
|
|
110
|
+
function useInputGroup(part) {
|
|
111
|
+
const group = use(InputGroupContext);
|
|
112
|
+
if (!group)
|
|
113
|
+
throw new Error(`InputGroup.${part} must be inside an InputGroup.`);
|
|
114
|
+
return group;
|
|
115
|
+
}
|
|
116
|
+
const InputGroup = Object.assign(InputGroupRoot, {
|
|
117
|
+
Addon: InputGroupAddon,
|
|
118
|
+
Button: InputGroupButton,
|
|
119
|
+
Input: InputGroupInput,
|
|
120
|
+
Text: InputGroupText,
|
|
121
|
+
});
|
|
122
|
+
export { InputGroup };
|
|
123
|
+
//# sourceMappingURL=InputGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.js","sourceRoot":"","sources":["../../../src/components/form/InputGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,cAAc,EAEd,GAAG,EACH,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,IAAI,EAAkB,IAAI,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAoB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAU9D,6EAA6E;AAC7E,8DAA8D;AAC9D,MAAM,YAAY,GAAG;IACnB,WAAW,EAAE,0CAA0C;IACvD,aAAa,EAAE,0CAA0C;IACzD,YAAY,EAAE,WAAW;IACzB,cAAc,EAAE,WAAW;CACnB,CAAC;AACX,MAAM,kBAAkB,GAAG;IACzB,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,EAAE;IACjB,YAAY,EAAE,UAAU;IACxB,cAAc,EAAE,UAAU;CAClB,CAAC;AAUX,MAAM,iBAAiB,GAAG,aAAa,CAAgC,IAAI,CAAC,CAAC;AAgB7E,wEAAwE;AACxE,SAAS,eAAe,CAAC,EACvB,KAAK,GAAG,cAAc,EACtB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACa;IACrB,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CA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AAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,KAAK,GAAG,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK;QACR,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,gCAAgC,CAAC,CAAC;IACtE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE;IAC/C,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAC,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Pressable, View } from 'react-native';
|
|
2
|
+
export type RadioGroupItemProps = Omit<React.ComponentProps<typeof Pressable>, 'children' | 'disabled'> & {
|
|
3
|
+
/** Class overrides for the row around the circle and label, the dot and the label. */
|
|
4
|
+
classNames?: {
|
|
5
|
+
field?: string;
|
|
6
|
+
indicator?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
};
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Marks the choice as invalid, like the web's `aria-invalid`. */
|
|
11
|
+
invalid?: boolean;
|
|
12
|
+
/** Text next to the circle; pressing it selects the item and names it. */
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
size?: 'md' | 'sm';
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
export type RadioGroupProps = React.ComponentProps<typeof View> & {
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
onValueChange?: (value: string) => void;
|
|
21
|
+
value?: string;
|
|
22
|
+
};
|
|
23
|
+
declare function RadioGroupItem({ accessibilityState, className, classNames, disabled: disabledProp, invalid, label, size, value, ...props }: RadioGroupItemProps): import("react").JSX.Element;
|
|
24
|
+
declare function RadioGroupRoot({ className, defaultValue, disabled, onValueChange, value: valueProp, ...props }: RadioGroupProps): import("react").JSX.Element;
|
|
25
|
+
declare const RadioGroup: typeof RadioGroupRoot & {
|
|
26
|
+
Item: typeof RadioGroupItem;
|
|
27
|
+
};
|
|
28
|
+
export { RadioGroup, RadioGroupItem };
|
|
29
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/form/RadioGroup.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAQ,IAAI,EAAE,MAAM,cAAc,CAAC;AAuBrD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACtC,UAAU,GAAG,UAAU,CACxB,GAAG;IACF,sFAAsF;IACtF,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,iBAAS,cAAc,CAAC,EACtB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EAAE,YAAoB,EAC9B,OAAe,EACf,KAAK,EACL,IAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,+BAwDrB;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,YAAY,EACZ,QAAgB,EAChB,aAAa,EACb,KAAK,EAAE,SAAS,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,+BAuBjB;AAED,QAAA,MAAM,UAAU;;CAEd,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, use, useMemo } from 'react';
|
|
3
|
+
import { Pressable, Text, View } from 'react-native';
|
|
4
|
+
import { cn } from '../../lib/cn';
|
|
5
|
+
import { useControllableState } from '../_internal/useControllableState';
|
|
6
|
+
// Same sizes as `RadioGroup` in @pickle-ui/react. `hitSlop` stretches the
|
|
7
|
+
// circle to a 44pt touch target, vertically only when a label widens it.
|
|
8
|
+
const controlClasses = { md: 'size-4', sm: 'size-3.5' };
|
|
9
|
+
const indicatorClasses = { md: 'size-2', sm: 'size-1.5' };
|
|
10
|
+
const controlHitSlop = { md: 14, sm: 15 };
|
|
11
|
+
const fieldHitSlop = {
|
|
12
|
+
md: { bottom: 14, top: 14 },
|
|
13
|
+
sm: { bottom: 15, top: 15 },
|
|
14
|
+
};
|
|
15
|
+
const RadioGroupContext = createContext(null);
|
|
16
|
+
function RadioGroupItem({ accessibilityState, className, classNames, disabled: disabledProp = false, invalid = false, label, size = 'md', value, ...props }) {
|
|
17
|
+
const group = use(RadioGroupContext);
|
|
18
|
+
if (!group)
|
|
19
|
+
throw new Error('RadioGroup.Item must be inside a RadioGroup.');
|
|
20
|
+
const checked = group.value === value;
|
|
21
|
+
const disabled = group.disabled || disabledProp;
|
|
22
|
+
return (_jsxs(Pressable, { accessibilityState: { ...accessibilityState, checked, disabled }, "aria-checked": checked, "aria-disabled": disabled, className: label
|
|
23
|
+
? cn('flex-row items-center gap-2', classNames?.field)
|
|
24
|
+
: 'self-start', disabled: disabled, hitSlop: label ? fieldHitSlop[size] : controlHitSlop[size], onPress: () => group.onSelect(value), role: "radio", ...props, children: [_jsx(View, { className: cn('border-input bg-background items-center justify-center rounded-full border', controlClasses[size], checked && 'border-primary', invalid && 'border-destructive', disabled && 'opacity-50', className), children: checked ? (_jsx(View, { className: cn('bg-primary rounded-full', indicatorClasses[size], classNames?.indicator) })) : null }), label ? (_jsx(Text, { className: cn('text-sm leading-none font-medium', disabled ? 'text-muted-foreground' : 'text-foreground', classNames?.label), children: label })) : null] }));
|
|
25
|
+
}
|
|
26
|
+
function RadioGroupRoot({ className, defaultValue, disabled = false, onValueChange, value: valueProp, ...props }) {
|
|
27
|
+
const [value, setValue] = useControllableState(valueProp, defaultValue, onValueChange);
|
|
28
|
+
const context = useMemo(() => ({
|
|
29
|
+
disabled,
|
|
30
|
+
onSelect: (next) => {
|
|
31
|
+
if (next !== value)
|
|
32
|
+
setValue(next);
|
|
33
|
+
},
|
|
34
|
+
value,
|
|
35
|
+
}), [disabled, setValue, value]);
|
|
36
|
+
return (_jsx(RadioGroupContext, { value: context, children: _jsx(View, { className: cn('gap-2', className), role: "radiogroup", ...props }) }));
|
|
37
|
+
}
|
|
38
|
+
const RadioGroup = Object.assign(RadioGroupRoot, {
|
|
39
|
+
Item: RadioGroupItem,
|
|
40
|
+
});
|
|
41
|
+
export { RadioGroup, RadioGroupItem };
|
|
42
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/components/form/RadioGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,OAAO,C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