haze-ui 1.12.0 → 1.12.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 -24
- package/dist/components/Checkbox/Checkbox.js +13 -20
- package/dist/components/Checkbox/CheckboxCore.js +23 -0
- package/dist/components/ColorPicker/ColorPicker.js +13 -42
- package/dist/components/ColorPicker/ColorPickerCore.js +36 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +17 -35
- package/dist/components/DateRangePicker/DateRangePickerCore.js +31 -0
- package/dist/components/Datepicker/Datepicker.js +15 -39
- package/dist/components/Datepicker/DatepickerCore.js +42 -0
- package/dist/components/Input/Input.js +11 -22
- package/dist/components/Input/InputCore.js +26 -0
- package/dist/components/NumberInput/NumberInput.js +16 -53
- package/dist/components/NumberInput/NumberInputCore.js +56 -0
- package/dist/components/OTPInput/OTPInput.js +11 -45
- package/dist/components/OTPInput/OTPInputCore.js +43 -0
- package/dist/components/PasswordInput/PasswordInput.js +14 -29
- package/dist/components/PasswordInput/PasswordInputCore.js +30 -0
- package/dist/components/Radio/RadioGroup.js +12 -21
- package/dist/components/Radio/RadioGroupCore.js +24 -0
- package/dist/components/Rating/Rating.js +14 -46
- package/dist/components/Rating/RatingCore.js +48 -0
- package/dist/components/Segmented/Segmented.js +12 -37
- package/dist/components/Segmented/SegmentedCore.js +39 -0
- package/dist/components/Select/Select.js +12 -23
- package/dist/components/Select/SelectCore.js +27 -0
- package/dist/components/Slider/Slider.js +10 -15
- package/dist/components/Slider/SliderCore.js +19 -0
- package/dist/components/Switch/Switch.js +11 -38
- package/dist/components/Switch/SwitchCore.js +42 -0
- package/dist/components/TagInput/TagInput.js +18 -72
- package/dist/components/TagInput/TagInputCore.js +68 -0
- package/dist/components/Textarea/Textarea.js +11 -22
- package/dist/components/Textarea/TextareaCore.js +26 -0
- package/dist/components/TimePicker/TimePicker.js +10 -15
- package/dist/components/TimePicker/TimePickerCore.js +18 -0
- package/dist/css/checkbox.css +1 -1
- package/dist/css/color-picker.css +1 -1
- package/dist/css/date-range-picker.css +1 -1
- package/dist/css/datepicker.css +1 -1
- package/dist/css/input.css +1 -1
- package/dist/css/number-input.css +1 -1
- package/dist/css/otp-input.css +1 -1
- package/dist/css/password-input.css +1 -1
- package/dist/css/radio.css +1 -1
- package/dist/css/rating.css +1 -1
- package/dist/css/segmented.css +1 -1
- package/dist/css/select.css +1 -1
- package/dist/css/slider.css +1 -1
- package/dist/css/switch.css +1 -1
- package/dist/css/tag-input.css +1 -1
- package/dist/css/textarea.css +1 -1
- package/dist/css/time-picker.css +1 -1
- package/dist/form/FormItem.js +32 -32
- package/dist/haze-ui.css +17 -17
- package/dist/index.js +138 -122
- package/dist/types/components/Checkbox/CheckboxCore.d.ts +12 -0
- package/dist/types/components/Checkbox/index.d.ts +2 -0
- package/dist/types/components/ColorPicker/ColorPickerCore.d.ts +8 -0
- package/dist/types/components/ColorPicker/index.d.ts +2 -0
- package/dist/types/components/DateRangePicker/DateRangePickerCore.d.ts +11 -0
- package/dist/types/components/DateRangePicker/index.d.ts +2 -0
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +12 -0
- package/dist/types/components/Datepicker/index.d.ts +2 -0
- package/dist/types/components/Input/InputCore.d.ts +13 -0
- package/dist/types/components/Input/index.d.ts +2 -0
- package/dist/types/components/NumberInput/NumberInputCore.d.ts +15 -0
- package/dist/types/components/NumberInput/index.d.ts +2 -0
- package/dist/types/components/OTPInput/OTPInputCore.d.ts +8 -0
- package/dist/types/components/OTPInput/index.d.ts +2 -0
- package/dist/types/components/PasswordInput/PasswordInputCore.d.ts +9 -0
- package/dist/types/components/PasswordInput/index.d.ts +2 -0
- package/dist/types/components/Radio/RadioContext.d.ts +1 -2
- package/dist/types/components/Radio/RadioGroupCore.d.ts +10 -0
- package/dist/types/components/Radio/index.d.ts +2 -0
- package/dist/types/components/Rating/RatingCore.d.ts +9 -0
- package/dist/types/components/Rating/index.d.ts +2 -0
- package/dist/types/components/Segmented/Segmented.d.ts +1 -6
- package/dist/types/components/Segmented/SegmentedCore.d.ts +15 -0
- package/dist/types/components/Segmented/index.d.ts +2 -0
- package/dist/types/components/Select/SelectCore.d.ts +13 -0
- package/dist/types/components/Select/index.d.ts +2 -0
- package/dist/types/components/Slider/SliderCore.d.ts +11 -0
- package/dist/types/components/Slider/index.d.ts +2 -0
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Switch/SwitchCore.d.ts +12 -0
- package/dist/types/components/Switch/index.d.ts +2 -0
- package/dist/types/components/TagInput/TagInputCore.d.ts +20 -0
- package/dist/types/components/TagInput/index.d.ts +2 -0
- package/dist/types/components/Textarea/TextareaCore.d.ts +12 -0
- package/dist/types/components/Textarea/index.d.ts +2 -0
- package/dist/types/components/TimePicker/TimePickerCore.d.ts +9 -0
- package/dist/types/components/TimePicker/index.d.ts +2 -0
- package/dist/types/form/FormItem.d.ts +23 -12
- package/dist/types/form/index.d.ts +1 -2
- package/dist/types/index.d.ts +35 -35
- package/package.json +15 -15
- package/dist/form/useFormControl.js +0 -54
- package/dist/types/form/useFormControl.d.ts +0 -32
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Control } from 'react-use-control';
|
|
2
|
-
import type { FieldPath, FormInstance, Name, PathValueOf } from 'react-f0rm';
|
|
3
|
-
export type { FormInstance, PathValueOf };
|
|
4
|
-
/**
|
|
5
|
-
* Bind a react-f0rm field to haze-ui's Control system.
|
|
6
|
-
*
|
|
7
|
-
* The returned handle can be passed to any control-prop of a haze-ui
|
|
8
|
-
* component (`value`, `checked`, ...) exactly like a local control:
|
|
9
|
-
*
|
|
10
|
-
* ```tsx
|
|
11
|
-
* const form = useForm({initialValues: {email: ''}});
|
|
12
|
-
* const email = useFormControl(form, 'email');
|
|
13
|
-
* return <Input value={email} />;
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* How it works: the handle carries a `[form value, dispatch → form]` state
|
|
17
|
-
* pair — the form owns the state, the handle only forwards it. Reads return
|
|
18
|
-
* `getValueByPath` at render time (kept fresh by a `useValueByPath`
|
|
19
|
-
* subscription that re-renders this component on own-field changes — and
|
|
20
|
-
* only those, so sibling fields stay isolated); writes go through
|
|
21
|
-
* `setValueByPath`, accepting either a plain value or a functional updater
|
|
22
|
-
* that is evaluated against the live form value.
|
|
23
|
-
*
|
|
24
|
-
* The handle's identity is stable across re-renders, including own-field
|
|
25
|
-
* value changes.
|
|
26
|
-
*
|
|
27
|
-
* @param form react-f0rm form instance
|
|
28
|
-
* @param name field path — dotted string ('user.email', 'tags[0]') or
|
|
29
|
-
* segments array (['user', 0, 'name'])
|
|
30
|
-
* @return a `Control` bound to the field's value
|
|
31
|
-
*/
|
|
32
|
-
export declare function useFormControl<TValues extends Record<string, any> = any, P extends FieldPath<TValues> | Name = Name>(form: FormInstance<TValues>, name: P): Control<PathValueOf<TValues, P>>;
|