@payfit/unity-components 0.0.0-alpha.6 → 0.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/anchor/Anchor.d.ts +1 -1
- package/dist/cjs/components/app-layout/AppLayout.d.ts +6 -1
- package/dist/cjs/components/app-layout/AppLayout.js +1 -1
- package/dist/cjs/components/app-menu/AppMenu.d.ts +9 -0
- package/dist/cjs/components/app-menu/AppMenu.js +1 -0
- package/dist/cjs/components/app-menu/parts/AppMenu.context.d.ts +9 -0
- package/dist/cjs/components/app-menu/parts/AppMenu.context.js +1 -0
- package/dist/cjs/components/app-menu/parts/AppMenuFooter.d.ts +31 -0
- package/dist/cjs/components/app-menu/parts/AppMenuFooter.js +1 -0
- package/dist/cjs/components/app-menu/parts/AppMenuHeader.d.ts +9 -0
- package/dist/cjs/components/app-menu/parts/AppMenuHeader.js +1 -0
- package/dist/cjs/components/app-menu/parts/AppMenuNavContent.d.ts +5 -0
- package/dist/cjs/components/app-menu/parts/AppMenuNavContent.js +1 -0
- package/dist/cjs/components/avatar/Avatar.context.d.ts +1 -1
- package/dist/cjs/components/avatar/parts/AvatarFallback.d.ts +1 -1
- package/dist/cjs/components/avatar/parts/AvatarFallback.js +1 -1
- package/dist/cjs/components/avatar/parts/AvatarPair.d.ts +20 -0
- package/dist/cjs/components/avatar/utils.d.ts +1 -0
- package/dist/cjs/components/avatar/utils.js +1 -0
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.context.d.ts +1 -1
- package/dist/cjs/components/button/Button.d.ts +2 -1
- package/dist/cjs/components/checkbox/Checkbox.d.ts +225 -0
- package/dist/cjs/components/checkbox/Checkbox.js +1 -0
- package/dist/cjs/components/checkbox/parts/CheckboxIndicator.d.ts +13 -0
- package/dist/cjs/components/checkbox/parts/CheckboxIndicator.js +1 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.d.ts +74 -0
- package/dist/cjs/components/checkbox-field/CheckboxField.js +1 -0
- package/dist/cjs/components/checkbox-group/CheckboxGroup.d.ts +65 -0
- package/dist/cjs/components/checkbox-group/CheckboxGroup.js +1 -0
- package/dist/cjs/components/checkbox-group-field/CheckboxGroupField.d.ts +79 -0
- package/dist/cjs/components/checkbox-group-field/CheckboxGroupField.js +1 -0
- package/dist/cjs/components/date-picker/DatePicker.d.ts +67 -0
- package/dist/cjs/components/date-picker/DatePicker.js +1 -0
- package/dist/cjs/components/date-picker/hooks/useMonthsList.d.ts +4 -0
- package/dist/cjs/components/date-picker/hooks/useMonthsList.js +1 -0
- package/dist/cjs/components/date-picker/hooks/useYearsList.d.ts +10 -0
- package/dist/cjs/components/date-picker/hooks/useYearsList.js +1 -0
- package/dist/cjs/components/date-picker/parts/DateCalendar.d.ts +9 -0
- package/dist/cjs/components/date-picker/parts/DateCalendar.js +1 -0
- package/dist/cjs/components/date-picker/parts/DateInput.d.ts +155 -0
- package/dist/cjs/components/date-picker/parts/DateInput.js +1 -0
- package/dist/cjs/components/date-picker/parts/DateSegmentSelect.d.ts +15 -0
- package/dist/cjs/components/date-picker/parts/DateSegmentSelect.js +1 -0
- package/dist/cjs/components/date-picker/utils.d.ts +12 -0
- package/dist/cjs/components/date-picker-field/DatePickerField.d.ts +83 -0
- package/dist/cjs/components/date-picker-field/DatePickerField.js +1 -0
- package/dist/cjs/components/dialog/Dialog.d.ts +1 -1
- package/dist/cjs/components/dialog/parts/DialogActions/DialogButton.d.ts +1 -1
- package/dist/cjs/components/dialog/parts/DialogActions.d.ts +1 -1
- package/dist/cjs/components/dialog/parts/DialogTitle.d.ts +1 -1
- package/dist/cjs/components/form/Form.context.d.ts +1 -1
- package/dist/cjs/components/form/Form.context.js +1 -1
- package/dist/cjs/components/form/Form.js +1 -1
- package/dist/cjs/components/form-field/FormField.context.d.ts +32 -14
- package/dist/cjs/components/form-field/FormField.context.js +1 -0
- package/dist/cjs/components/form-field/FormField.d.ts +40 -16
- package/dist/cjs/components/form-field/FormField.js +1 -0
- package/dist/cjs/components/form-field/parts/FormContextualLink.js +1 -0
- package/dist/cjs/components/form-field/parts/FormControl.d.ts +7 -0
- package/dist/cjs/components/form-field/parts/FormControl.js +1 -0
- package/dist/cjs/components/form-field/parts/FormFeedbackText.js +1 -0
- package/dist/cjs/components/form-field/parts/FormHelperText.d.ts +1 -1
- package/dist/cjs/components/form-field/parts/FormHelperText.js +1 -0
- package/dist/cjs/components/form-field/parts/FormLabel.d.ts +3 -3
- package/dist/cjs/components/form-field/parts/FormLabel.js +1 -0
- package/dist/cjs/components/form-field/utils/isFieldRequired.d.ts +8 -0
- package/dist/cjs/components/form-field/utils/isFieldRequired.js +1 -0
- package/dist/cjs/components/full-page-loader/FullPageLoader.d.ts +13 -0
- package/dist/cjs/components/full-page-loader/FullPageLoader.js +1 -0
- package/dist/cjs/components/icon/Icon.d.ts +1 -1
- package/dist/cjs/components/icon-button/CircularIconButton.d.ts +1 -1
- package/dist/cjs/components/icon-button/IconButton.d.ts +1 -1
- package/dist/cjs/components/index.d.ts +4 -0
- package/dist/cjs/components/input/Input.d.ts +48 -0
- package/dist/cjs/components/input/Input.js +1 -0
- package/dist/cjs/components/label/Label.d.ts +17 -0
- package/dist/cjs/components/label/Label.js +1 -0
- package/dist/cjs/components/link/Link.d.ts +10 -0
- package/dist/cjs/components/link/Link.js +1 -1
- package/dist/cjs/components/menu/Menu.d.ts +1 -1
- package/dist/cjs/components/menu/parts/MenuContent.d.ts +1 -1
- package/dist/cjs/components/menu/parts/MenuHeader.d.ts +1 -1
- package/dist/cjs/components/menu/parts/MenuItem.d.ts +2 -2
- package/dist/cjs/components/menu/parts/MenuSeparator.d.ts +1 -1
- package/dist/cjs/components/menu/parts/MenuTrigger.d.ts +1 -1
- package/dist/cjs/components/nav/Nav.d.ts +1 -1
- package/dist/cjs/components/nav/parts/NavGroup.d.ts +1 -1
- package/dist/cjs/components/nav/parts/NavItem.d.ts +1 -1
- package/dist/cjs/components/select/Select.d.ts +52 -0
- package/dist/cjs/components/select/Select.js +1 -0
- package/dist/cjs/components/select/parts/SearchInput.d.ts +2 -0
- package/dist/cjs/components/select/parts/SearchInput.js +1 -0
- package/dist/cjs/components/select/parts/SelectButton.d.ts +8 -0
- package/dist/cjs/components/select/parts/SelectButton.js +1 -0
- package/dist/cjs/components/select/parts/SelectOption.context.d.ts +8 -0
- package/dist/cjs/components/select/parts/SelectOption.context.js +1 -0
- package/dist/cjs/components/select/parts/SelectOption.d.ts +6 -0
- package/dist/cjs/components/select/parts/SelectOption.js +1 -0
- package/dist/cjs/components/select/parts/SelectOptionGroup.d.ts +12 -0
- package/dist/cjs/components/select/parts/SelectOptionGroup.js +1 -0
- package/dist/cjs/components/select/parts/SelectOptionHelper.d.ts +4 -0
- package/dist/cjs/components/select/parts/SelectOptionHelper.js +1 -0
- package/dist/cjs/components/select-field/SelectField.d.ts +50 -0
- package/dist/cjs/components/select-field/SelectField.js +1 -0
- package/dist/cjs/components/spinner/Spinner.d.ts +2 -2
- package/dist/cjs/components/spinner/Spinner.js +1 -1
- package/dist/cjs/components/spinner/dynamic-content.d.ts +1 -1
- package/dist/cjs/components/stepper/Stepper.context.d.ts +1 -1
- package/dist/cjs/components/tabs/Tabs.context.d.ts +1 -1
- package/dist/cjs/components/tabs/parts/NavigationButton.d.ts +1 -1
- package/dist/cjs/components/tabs/parts/Tab.d.ts +3 -1
- package/dist/cjs/components/text/Text.d.ts +1 -1
- package/dist/cjs/components/text-area/TextArea.d.ts +220 -0
- package/dist/cjs/components/text-area/TextArea.js +1 -0
- package/dist/cjs/components/text-field/TextField.d.ts +63 -0
- package/dist/cjs/components/text-field/TextField.js +1 -0
- package/dist/cjs/components/toast/Toast.context.d.ts +1 -1
- package/dist/cjs/components/toast/ToastManager.d.ts +1 -1
- package/dist/cjs/components/toast/UnityToast.d.ts +1 -1
- package/dist/cjs/components/toast/parts/ToastAction.d.ts +1 -1
- package/dist/cjs/components/toast/parts/ToastContent.d.ts +1 -1
- package/dist/cjs/components/toast/parts/ToastTitle.d.ts +1 -1
- package/dist/cjs/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/cjs/docs/blocks/Cards.d.ts +7 -7
- package/dist/cjs/hooks/use-form.d.ts +5 -5
- package/dist/cjs/hooks/use-form.js +1 -0
- package/dist/cjs/hooks/use-resizable.d.ts +13 -0
- package/dist/cjs/hooks/use-resizable.js +1 -0
- package/dist/cjs/index.d.ts +30 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/providers/router/RouterProvider.d.ts +1 -1
- package/dist/cjs/providers/router/integrations/UnityReactRouterV5Provider.d.ts +1 -1
- package/dist/esm/components/anchor/Anchor.d.mts +1 -1
- package/dist/esm/components/app-layout/AppLayout.d.mts +6 -1
- package/dist/esm/components/app-layout/AppLayout.mjs +35 -23
- package/dist/esm/components/app-menu/AppMenu.d.mts +9 -0
- package/dist/esm/components/app-menu/AppMenu.mjs +14 -0
- package/dist/esm/components/app-menu/parts/AppMenu.context.d.mts +9 -0
- package/dist/esm/components/app-menu/parts/AppMenu.context.mjs +25 -0
- package/dist/esm/components/app-menu/parts/AppMenuFooter.d.mts +31 -0
- package/dist/esm/components/app-menu/parts/AppMenuFooter.mjs +224 -0
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.mts +9 -0
- package/dist/esm/components/app-menu/parts/AppMenuHeader.mjs +41 -0
- package/dist/esm/components/app-menu/parts/AppMenuNavContent.d.mts +5 -0
- package/dist/esm/components/app-menu/parts/AppMenuNavContent.mjs +23 -0
- package/dist/esm/components/avatar/Avatar.context.d.mts +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.d.mts +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.mjs +9 -8
- package/dist/esm/components/avatar/parts/AvatarPair.d.mts +20 -0
- package/dist/esm/components/avatar/utils.d.mts +1 -0
- package/dist/esm/components/avatar/utils.mjs +4 -0
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.d.mts +1 -1
- package/dist/esm/components/button/Button.d.mts +2 -1
- package/dist/esm/components/checkbox/Checkbox.d.mts +225 -0
- package/dist/esm/components/checkbox/Checkbox.mjs +146 -0
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.d.mts +13 -0
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.mjs +146 -0
- package/dist/esm/components/checkbox-field/CheckboxField.d.mts +74 -0
- package/dist/esm/components/checkbox-field/CheckboxField.mjs +61 -0
- package/dist/esm/components/checkbox-group/CheckboxGroup.d.mts +65 -0
- package/dist/esm/components/checkbox-group/CheckboxGroup.mjs +66 -0
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.mts +79 -0
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.mjs +54 -0
- package/dist/esm/components/date-picker/DatePicker.d.mts +67 -0
- package/dist/esm/components/date-picker/DatePicker.mjs +163 -0
- package/dist/esm/components/date-picker/hooks/useMonthsList.d.mts +4 -0
- package/dist/esm/components/date-picker/hooks/useMonthsList.mjs +26 -0
- package/dist/esm/components/date-picker/hooks/useYearsList.d.mts +10 -0
- package/dist/esm/components/date-picker/hooks/useYearsList.mjs +33 -0
- package/dist/esm/components/date-picker/parts/DateCalendar.d.mts +9 -0
- package/dist/esm/components/date-picker/parts/DateCalendar.mjs +172 -0
- package/dist/esm/components/date-picker/parts/DateInput.d.mts +155 -0
- package/dist/esm/components/date-picker/parts/DateInput.mjs +124 -0
- package/dist/esm/components/date-picker/parts/DateSegmentSelect.d.mts +15 -0
- package/dist/esm/components/date-picker/parts/DateSegmentSelect.mjs +69 -0
- package/dist/esm/components/date-picker/utils.d.mts +12 -0
- package/dist/esm/components/date-picker-field/DatePickerField.d.mts +83 -0
- package/dist/esm/components/date-picker-field/DatePickerField.mjs +73 -0
- package/dist/esm/components/dialog/Dialog.d.mts +1 -1
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.d.mts +1 -1
- package/dist/esm/components/dialog/parts/DialogActions.d.mts +1 -1
- package/dist/esm/components/dialog/parts/DialogTitle.d.mts +1 -1
- package/dist/esm/components/form/Form.context.d.mts +1 -1
- package/dist/esm/components/form/Form.context.mjs +21 -14
- package/dist/esm/components/form/Form.mjs +1 -1
- package/dist/esm/components/form-field/FormField.context.d.mts +32 -14
- package/dist/esm/components/form-field/FormField.context.mjs +81 -0
- package/dist/esm/components/form-field/FormField.d.mts +40 -16
- package/dist/esm/components/form-field/FormField.mjs +60 -0
- package/dist/esm/components/form-field/parts/FormContextualLink.mjs +35 -0
- package/dist/esm/components/form-field/parts/FormControl.d.mts +7 -0
- package/dist/esm/components/form-field/parts/FormControl.mjs +50 -0
- package/dist/esm/components/form-field/parts/FormFeedbackText.mjs +25 -0
- package/dist/esm/components/form-field/parts/FormHelperText.d.mts +1 -1
- package/dist/esm/components/form-field/parts/FormHelperText.mjs +25 -0
- package/dist/esm/components/form-field/parts/FormLabel.d.mts +3 -3
- package/dist/esm/components/form-field/parts/FormLabel.mjs +30 -0
- package/dist/esm/components/form-field/utils/isFieldRequired.d.mts +8 -0
- package/dist/esm/components/form-field/utils/isFieldRequired.mjs +23 -0
- package/dist/esm/components/full-page-loader/FullPageLoader.d.mts +13 -0
- package/dist/esm/components/full-page-loader/FullPageLoader.mjs +26 -0
- package/dist/esm/components/icon/Icon.d.mts +1 -1
- package/dist/esm/components/icon-button/CircularIconButton.d.mts +1 -1
- package/dist/esm/components/icon-button/IconButton.d.mts +1 -1
- package/dist/esm/components/index.d.mts +4 -0
- package/dist/esm/components/input/Input.d.mts +48 -0
- package/dist/esm/components/input/Input.mjs +148 -0
- package/dist/esm/components/label/Label.d.mts +17 -0
- package/dist/esm/components/label/Label.mjs +56 -0
- package/dist/esm/components/link/Link.d.mts +10 -0
- package/dist/esm/components/link/Link.mjs +26 -24
- package/dist/esm/components/menu/Menu.d.mts +1 -1
- package/dist/esm/components/menu/parts/MenuContent.d.mts +1 -1
- package/dist/esm/components/menu/parts/MenuHeader.d.mts +1 -1
- package/dist/esm/components/menu/parts/MenuItem.d.mts +2 -2
- package/dist/esm/components/menu/parts/MenuSeparator.d.mts +1 -1
- package/dist/esm/components/menu/parts/MenuTrigger.d.mts +1 -1
- package/dist/esm/components/nav/Nav.d.mts +1 -1
- package/dist/esm/components/nav/parts/NavGroup.d.mts +1 -1
- package/dist/esm/components/nav/parts/NavItem.d.mts +1 -1
- package/dist/esm/components/select/Select.d.mts +52 -0
- package/dist/esm/components/select/Select.mjs +63 -0
- package/dist/esm/components/select/parts/SearchInput.d.mts +2 -0
- package/dist/esm/components/select/parts/SearchInput.mjs +39 -0
- package/dist/esm/components/select/parts/SelectButton.d.mts +8 -0
- package/dist/esm/components/select/parts/SelectButton.mjs +87 -0
- package/dist/esm/components/select/parts/SelectOption.context.d.mts +8 -0
- package/dist/esm/components/select/parts/SelectOption.context.mjs +24 -0
- package/dist/esm/components/select/parts/SelectOption.d.mts +6 -0
- package/dist/esm/components/select/parts/SelectOption.mjs +63 -0
- package/dist/esm/components/select/parts/SelectOptionGroup.d.mts +12 -0
- package/dist/esm/components/select/parts/SelectOptionGroup.mjs +26 -0
- package/dist/esm/components/select/parts/SelectOptionHelper.d.mts +4 -0
- package/dist/esm/components/select/parts/SelectOptionHelper.mjs +20 -0
- package/dist/esm/components/select-field/SelectField.d.mts +50 -0
- package/dist/esm/components/select-field/SelectField.mjs +65 -0
- package/dist/esm/components/spinner/Spinner.d.mts +2 -2
- package/dist/esm/components/spinner/Spinner.mjs +34 -27
- package/dist/esm/components/spinner/dynamic-content.d.mts +1 -1
- package/dist/esm/components/stepper/Stepper.context.d.mts +1 -1
- package/dist/esm/components/tabs/Tabs.context.d.mts +1 -1
- package/dist/esm/components/tabs/parts/NavigationButton.d.mts +1 -1
- package/dist/esm/components/tabs/parts/Tab.d.mts +3 -1
- package/dist/esm/components/text/Text.d.mts +1 -1
- package/dist/esm/components/text-area/TextArea.d.mts +220 -0
- package/dist/esm/components/text-area/TextArea.mjs +163 -0
- package/dist/esm/components/text-field/TextField.d.mts +63 -0
- package/dist/esm/components/text-field/TextField.mjs +78 -0
- package/dist/esm/components/toast/Toast.context.d.mts +1 -1
- package/dist/esm/components/toast/ToastManager.d.mts +1 -1
- package/dist/esm/components/toast/UnityToast.d.mts +1 -1
- package/dist/esm/components/toast/parts/ToastAction.d.mts +1 -1
- package/dist/esm/components/toast/parts/ToastContent.d.mts +1 -1
- package/dist/esm/components/toast/parts/ToastTitle.d.mts +1 -1
- package/dist/esm/components/tooltip/Tooltip.d.mts +1 -1
- package/dist/esm/docs/blocks/Cards.d.mts +7 -7
- package/dist/esm/hooks/use-form.d.mts +5 -5
- package/dist/esm/hooks/use-form.mjs +32 -0
- package/dist/esm/hooks/use-resizable.d.mts +13 -0
- package/dist/esm/hooks/use-resizable.mjs +51 -0
- package/dist/esm/index.d.mts +30 -0
- package/dist/esm/index.mjs +175 -109
- package/dist/esm/providers/router/RouterProvider.d.mts +1 -1
- package/dist/esm/providers/router/integrations/UnityReactRouterV5Provider.d.mts +1 -1
- package/i18n/en-GB.json +14 -3
- package/i18n/es-ES.json +14 -3
- package/i18n/fr-FR.json +14 -3
- package/package.json +21 -18
- package/dist/cjs/components/form-field/parts/FormInput.d.ts +0 -15
- package/dist/cjs/components/spinner/Spinner.module.css.js +0 -1
- package/dist/esm/components/form-field/parts/FormInput.d.mts +0 -15
- package/dist/esm/components/spinner/Spinner.module.css.mjs +0 -10
- package/dist/style.css +0 -1
|
@@ -80,5 +80,5 @@ declare const Text: import('react').ForwardRefExoticComponent<HTMLAttributes<HTM
|
|
|
80
80
|
className?: string;
|
|
81
81
|
} & {
|
|
82
82
|
children?: import('react').ReactNode | undefined;
|
|
83
|
-
} & import('react').RefAttributes<
|
|
83
|
+
} & import('react').RefAttributes<HTMLElement>>;
|
|
84
84
|
export { Text };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { TextAreaProps as AriaTextAreaProps } from 'react-aria-components';
|
|
2
|
+
export declare const textArea: import('tailwind-variants').TVReturnType<{
|
|
3
|
+
isInvalid: {
|
|
4
|
+
true: {
|
|
5
|
+
base: string;
|
|
6
|
+
inputWrapper: string;
|
|
7
|
+
input: string;
|
|
8
|
+
state: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
isReadOnly: {
|
|
12
|
+
true: {
|
|
13
|
+
base: string;
|
|
14
|
+
inputWrapper: string;
|
|
15
|
+
input: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
isDisabled: {
|
|
19
|
+
true: {
|
|
20
|
+
base: string;
|
|
21
|
+
inputWrapper: string;
|
|
22
|
+
input: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
base: string;
|
|
27
|
+
inputWrapper: string;
|
|
28
|
+
input: string;
|
|
29
|
+
state: string;
|
|
30
|
+
resizeHandle: string;
|
|
31
|
+
}, undefined, import('tailwind-variants/dist/config').TVConfig<{
|
|
32
|
+
isInvalid: {
|
|
33
|
+
true: {
|
|
34
|
+
base: string;
|
|
35
|
+
inputWrapper: string;
|
|
36
|
+
input: string;
|
|
37
|
+
state: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
isReadOnly: {
|
|
41
|
+
true: {
|
|
42
|
+
base: string;
|
|
43
|
+
inputWrapper: string;
|
|
44
|
+
input: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
isDisabled: {
|
|
48
|
+
true: {
|
|
49
|
+
base: string;
|
|
50
|
+
inputWrapper: string;
|
|
51
|
+
input: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
isInvalid: {
|
|
56
|
+
true: {
|
|
57
|
+
base: string;
|
|
58
|
+
inputWrapper: string;
|
|
59
|
+
input: string;
|
|
60
|
+
state: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
isReadOnly: {
|
|
64
|
+
true: {
|
|
65
|
+
base: string;
|
|
66
|
+
inputWrapper: string;
|
|
67
|
+
input: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
isDisabled: {
|
|
71
|
+
true: {
|
|
72
|
+
base: string;
|
|
73
|
+
inputWrapper: string;
|
|
74
|
+
input: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}>, {
|
|
78
|
+
isInvalid: {
|
|
79
|
+
true: {
|
|
80
|
+
base: string;
|
|
81
|
+
inputWrapper: string;
|
|
82
|
+
input: string;
|
|
83
|
+
state: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
isReadOnly: {
|
|
87
|
+
true: {
|
|
88
|
+
base: string;
|
|
89
|
+
inputWrapper: string;
|
|
90
|
+
input: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
isDisabled: {
|
|
94
|
+
true: {
|
|
95
|
+
base: string;
|
|
96
|
+
inputWrapper: string;
|
|
97
|
+
input: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
}, {
|
|
101
|
+
base: string;
|
|
102
|
+
inputWrapper: string;
|
|
103
|
+
input: string;
|
|
104
|
+
state: string;
|
|
105
|
+
resizeHandle: string;
|
|
106
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
107
|
+
isInvalid: {
|
|
108
|
+
true: {
|
|
109
|
+
base: string;
|
|
110
|
+
inputWrapper: string;
|
|
111
|
+
input: string;
|
|
112
|
+
state: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
isReadOnly: {
|
|
116
|
+
true: {
|
|
117
|
+
base: string;
|
|
118
|
+
inputWrapper: string;
|
|
119
|
+
input: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
isDisabled: {
|
|
123
|
+
true: {
|
|
124
|
+
base: string;
|
|
125
|
+
inputWrapper: string;
|
|
126
|
+
input: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
}, {
|
|
130
|
+
base: string;
|
|
131
|
+
inputWrapper: string;
|
|
132
|
+
input: string;
|
|
133
|
+
state: string;
|
|
134
|
+
resizeHandle: string;
|
|
135
|
+
}, undefined, import('tailwind-variants/dist/config').TVConfig<{
|
|
136
|
+
isInvalid: {
|
|
137
|
+
true: {
|
|
138
|
+
base: string;
|
|
139
|
+
inputWrapper: string;
|
|
140
|
+
input: string;
|
|
141
|
+
state: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
isReadOnly: {
|
|
145
|
+
true: {
|
|
146
|
+
base: string;
|
|
147
|
+
inputWrapper: string;
|
|
148
|
+
input: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
isDisabled: {
|
|
152
|
+
true: {
|
|
153
|
+
base: string;
|
|
154
|
+
inputWrapper: string;
|
|
155
|
+
input: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
}, {
|
|
159
|
+
isInvalid: {
|
|
160
|
+
true: {
|
|
161
|
+
base: string;
|
|
162
|
+
inputWrapper: string;
|
|
163
|
+
input: string;
|
|
164
|
+
state: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
isReadOnly: {
|
|
168
|
+
true: {
|
|
169
|
+
base: string;
|
|
170
|
+
inputWrapper: string;
|
|
171
|
+
input: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
isDisabled: {
|
|
175
|
+
true: {
|
|
176
|
+
base: string;
|
|
177
|
+
inputWrapper: string;
|
|
178
|
+
input: string;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
}>, unknown, unknown, undefined>>;
|
|
182
|
+
export interface TextAreaProps extends AriaTextAreaProps {
|
|
183
|
+
/** Whether the field is in an invalid state */
|
|
184
|
+
isInvalid?: boolean;
|
|
185
|
+
/** Whether the field is in a loading state */
|
|
186
|
+
isLoading?: boolean;
|
|
187
|
+
/** Whether the field is disabled */
|
|
188
|
+
isDisabled?: boolean;
|
|
189
|
+
/** Whether the field is read-only */
|
|
190
|
+
isReadOnly?: boolean;
|
|
191
|
+
/** Whether the textarea is resizable */
|
|
192
|
+
isResizable?: boolean;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The `TextArea` component displays a styled, single HTML `<textarea>` field that follows the Unity design system language. It supports multiple states out of the box and can be used as a controlled or uncontrolled component. It is also compatible with the `Form` and `FormField` component as a form control.
|
|
196
|
+
* @param {TextAreaProps} props - Regular props from the `<textarea>` HTML element, plus state-related props
|
|
197
|
+
* @see {@link TextAreaProps} for all available props
|
|
198
|
+
* @example
|
|
199
|
+
* ```tsx
|
|
200
|
+
* import { Input } from '@payfit/unity-components'
|
|
201
|
+
*
|
|
202
|
+
* function Example() {
|
|
203
|
+
* const [value, setValue] = useState()
|
|
204
|
+
*
|
|
205
|
+
* const handleTextChange = (e) => {
|
|
206
|
+
* setValue(e.target.value)
|
|
207
|
+
* }
|
|
208
|
+
*
|
|
209
|
+
* return (
|
|
210
|
+
* <TextArea
|
|
211
|
+
* id="my-text-area"
|
|
212
|
+
* isResizable cols={50} rows={5} onChange={handleTextChange}
|
|
213
|
+
* >
|
|
214
|
+
* {value}
|
|
215
|
+
* </TextArea>
|
|
216
|
+
* }
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
declare const TextArea: import('react').ForwardRefExoticComponent<TextAreaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
220
|
+
export { TextArea };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v } from "react";
|
|
3
|
+
import { TextArea as w } from "react-aria-components";
|
|
4
|
+
import { useIntl as A } from "react-intl";
|
|
5
|
+
import { tv as M } from "tailwind-variants";
|
|
6
|
+
import { useResizable as z } from "../../hooks/use-resizable.mjs";
|
|
7
|
+
import { Icon as L } from "../icon/Icon.mjs";
|
|
8
|
+
import { Spinner as T } from "../spinner/Spinner.mjs";
|
|
9
|
+
const D = M({
|
|
10
|
+
slots: {
|
|
11
|
+
base: "uy-flex uy-border uy-rounded-100 focus-within:uy-outline-none focus-within:uy-ring-2 focus-within:uy-ring-utility-focus-ring focus-within:uy-ring-offset-2 active:uy-border-border-form-active uy-overflow-hidden uy-relative",
|
|
12
|
+
inputWrapper: "uy-flex uy-gap-50 uy-flex-grow uy-pt-100 uy-pb-100 uy-pl-150 uy-pr-150 uy-rounded-100",
|
|
13
|
+
input: "uy-flex-grow uy-flex-shrink uy-outline-none uy-typography-body placeholder:uy-text-content-neutral-lowest uy-resize-none",
|
|
14
|
+
state: "uy-flex uy-gap-50 uy-flex-shrink-0 uy-basis-250",
|
|
15
|
+
resizeHandle: "uy-absolute uy-bottom-25 uy-right-25 uy-w-100 uy-h-100 uy-cursor-se-resize uy-flex uy-items-center uy-justify-center"
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
isInvalid: {
|
|
19
|
+
true: {
|
|
20
|
+
base: "uy-border-border-form-error uy-bg-surface-form-error",
|
|
21
|
+
inputWrapper: "uy-bg-surface-form-error",
|
|
22
|
+
input: "uy-bg-surface-form-error",
|
|
23
|
+
state: "uy-text-content-form-error"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
isReadOnly: {
|
|
27
|
+
true: {
|
|
28
|
+
base: "uy-border-border-form-disabled uy-bg-surface-form-disabled",
|
|
29
|
+
inputWrapper: "uy-border-border-form-disabled uy-bg-surface-form-disabled",
|
|
30
|
+
input: "uy-bg-surface-form-disabled uy-text-content-form-readonly"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
isDisabled: {
|
|
34
|
+
true: {
|
|
35
|
+
base: "uy-border-border-form-disabled uy-bg-surface-form-disabled",
|
|
36
|
+
inputWrapper: "uy-bg-surface-form-disabled uy-text-content-form-disabled",
|
|
37
|
+
input: "uy-bg-surface-form-disabled uy-text-content-form-disabled"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
compoundVariants: [
|
|
42
|
+
{
|
|
43
|
+
isInvalid: !1,
|
|
44
|
+
isDisabled: !1,
|
|
45
|
+
isReadOnly: !1,
|
|
46
|
+
className: {
|
|
47
|
+
base: "uy-border-border-form-enabled uy-bg-surface-form-enabled",
|
|
48
|
+
inputWrapper: "uy-border-border-form-enabled uy-bg-surface-form-enabled",
|
|
49
|
+
input: "uy-text-content-form-enabled uy-bg-surface-form-enabled",
|
|
50
|
+
state: "uy-text-content-neutral-disabled"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
isInvalid: !1,
|
|
56
|
+
isDisabled: !1,
|
|
57
|
+
isReadOnly: !1
|
|
58
|
+
}
|
|
59
|
+
}), N = v(
|
|
60
|
+
({
|
|
61
|
+
isInvalid: n,
|
|
62
|
+
isLoading: s,
|
|
63
|
+
isDisabled: o,
|
|
64
|
+
isReadOnly: t,
|
|
65
|
+
isResizable: i = !1,
|
|
66
|
+
...l
|
|
67
|
+
}, f) => {
|
|
68
|
+
const a = A(), { containerRef: d, handleResizeStart: m } = z({
|
|
69
|
+
isDisabled: !i || o || t
|
|
70
|
+
});
|
|
71
|
+
console.log("[TEXTAREA | userProps]", l), console.log("[TEXTAREA | ref]", f);
|
|
72
|
+
const { base: c, inputWrapper: p, input: g, state: x, resizeHandle: h } = D({
|
|
73
|
+
isInvalid: n,
|
|
74
|
+
isDisabled: o,
|
|
75
|
+
isReadOnly: t
|
|
76
|
+
});
|
|
77
|
+
return /* @__PURE__ */ r("div", { ref: d, className: c(), children: [
|
|
78
|
+
/* @__PURE__ */ r("div", { className: p(), children: [
|
|
79
|
+
/* @__PURE__ */ e(
|
|
80
|
+
w,
|
|
81
|
+
{
|
|
82
|
+
...l,
|
|
83
|
+
ref: f,
|
|
84
|
+
className: g(),
|
|
85
|
+
"aria-busy": s
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ r("div", { className: x(), children: [
|
|
89
|
+
s && /* @__PURE__ */ e(
|
|
90
|
+
T,
|
|
91
|
+
{
|
|
92
|
+
color: "inherit",
|
|
93
|
+
size: "small",
|
|
94
|
+
label: a.formatMessage({
|
|
95
|
+
id: "unity:component:form-field:form-input:spinner:label",
|
|
96
|
+
defaultMessage: "Loading"
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
n && /* @__PURE__ */ e(
|
|
101
|
+
L,
|
|
102
|
+
{
|
|
103
|
+
src: "WarningCircleOutlined",
|
|
104
|
+
color: "content.form.invalid",
|
|
105
|
+
alt: a.formatMessage({
|
|
106
|
+
id: "unity:component:form-field:form-input:error:alt",
|
|
107
|
+
defaultMessage: "Error"
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] })
|
|
112
|
+
] }),
|
|
113
|
+
i && !o && !t && /* @__PURE__ */ e(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className: h(),
|
|
117
|
+
onMouseDown: m,
|
|
118
|
+
role: "button",
|
|
119
|
+
tabIndex: 0,
|
|
120
|
+
"aria-label": a.formatMessage({
|
|
121
|
+
id: "unity:component:form-field:textarea:resize-handle:label",
|
|
122
|
+
defaultMessage: "Resize textarea"
|
|
123
|
+
}),
|
|
124
|
+
onKeyDown: (u) => {
|
|
125
|
+
var y, b;
|
|
126
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), (b = (y = d.current) == null ? void 0 : y.querySelector("textarea")) == null || b.focus());
|
|
127
|
+
},
|
|
128
|
+
children: /* @__PURE__ */ r(
|
|
129
|
+
"svg",
|
|
130
|
+
{
|
|
131
|
+
role: "presentation",
|
|
132
|
+
width: "8",
|
|
133
|
+
height: "8",
|
|
134
|
+
viewBox: "0 0 8 8",
|
|
135
|
+
fill: "none",
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ e(
|
|
138
|
+
"path",
|
|
139
|
+
{
|
|
140
|
+
d: "M0.72774 8L0 7.28745L7.27226 0L8 0.712547L0.72774 8Z",
|
|
141
|
+
fill: "#8B8D98"
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ e(
|
|
145
|
+
"path",
|
|
146
|
+
{
|
|
147
|
+
d: "M4.73172 8L4 7.27073L7.26828 4L8 4.72927L4.73172 8Z",
|
|
148
|
+
fill: "#8B8D98"
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] });
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
N.displayName = "TextArea";
|
|
160
|
+
export {
|
|
161
|
+
N as TextArea,
|
|
162
|
+
D as textArea
|
|
163
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ForwardedRef, HTMLAttributes, JSX, ReactNode } from 'react';
|
|
2
|
+
import { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
+
import { infer as ZodInfer } from 'zod';
|
|
4
|
+
import { Schema } from '../../hooks/use-form.types.mjs';
|
|
5
|
+
import { InputProps } from '../input/Input.mjs';
|
|
6
|
+
import { LabelProps } from '../label/Label.mjs';
|
|
7
|
+
import { TextAreaProps } from '../text-area/TextArea.mjs';
|
|
8
|
+
interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Pick<LabelProps, 'isRequired' | 'requiredVariant'> {
|
|
9
|
+
/** The name of the field, which should match the form schema. */
|
|
10
|
+
name: TName;
|
|
11
|
+
/** The label for the text field. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** If true, the text field will be a multi-line text area. */
|
|
14
|
+
multiline?: boolean;
|
|
15
|
+
/** The default value of the text field. */
|
|
16
|
+
defaultValue?: HTMLAttributes<HTMLInputElement>['defaultValue'];
|
|
17
|
+
/** Helper text to display below the text field. */
|
|
18
|
+
helperText?: ReactNode;
|
|
19
|
+
/** Feedback text to display below the text field. */
|
|
20
|
+
feedbackText?: ReactNode;
|
|
21
|
+
/** A contextual link to display below the text field. */
|
|
22
|
+
contextualLink?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
interface TextFieldWithInputProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends FieldProps<TFieldValues, TName>, Omit<InputProps, 'name'> {
|
|
25
|
+
multiline?: false;
|
|
26
|
+
type?: 'text' | 'password' | 'email' | 'tel' | 'url' | 'search';
|
|
27
|
+
}
|
|
28
|
+
interface TextFieldWithTextAreaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends FieldProps<TFieldValues, TName>, Omit<TextAreaProps, 'name'> {
|
|
29
|
+
multiline?: true;
|
|
30
|
+
type?: never;
|
|
31
|
+
}
|
|
32
|
+
export type TextFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = TextFieldWithInputProps<TFieldValues, TName> | TextFieldWithTextAreaProps<TFieldValues, TName>;
|
|
33
|
+
type TextFieldComponent = (<TSchema extends Schema>(props: TextFieldProps<ZodInfer<TSchema>> & {
|
|
34
|
+
ref?: ForwardedRef<HTMLInputElement | HTMLTextAreaElement>;
|
|
35
|
+
}) => JSX.Element) & {
|
|
36
|
+
displayName?: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The `TextField` component renders a full field that can accept text input, supporting single-line and multi-line text fields, and integrates with the `Form` component automatically.
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* const schema = z.object({
|
|
43
|
+
* name: z.string(),
|
|
44
|
+
* email: z.string().email()
|
|
45
|
+
* })
|
|
46
|
+
*
|
|
47
|
+
* function MyForm() {
|
|
48
|
+
* const { Form } = useUnityForm(schema)
|
|
49
|
+
*
|
|
50
|
+
* return (
|
|
51
|
+
* <Form action={handleSubmit}>
|
|
52
|
+
* <TextField<typeof schema>
|
|
53
|
+
* name="name" // Only "name" | "email" allowed
|
|
54
|
+
* label="Name"
|
|
55
|
+
* />
|
|
56
|
+
* </Form>
|
|
57
|
+
* )
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
* @note The schema type parameter is needed to ensure type safety with the form's schema. If you omit it, the `name` prop will not be type-safe.
|
|
61
|
+
*/
|
|
62
|
+
declare const TextField: TextFieldComponent;
|
|
63
|
+
export { TextField };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as B, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I } from "react";
|
|
3
|
+
import { useFormContext as g } from "react-hook-form";
|
|
4
|
+
import { tv as j } from "tailwind-variants";
|
|
5
|
+
import { FormField as k } from "../form-field/FormField.mjs";
|
|
6
|
+
import { FormControl as L } from "../form-field/parts/FormControl.mjs";
|
|
7
|
+
import { FormFeedbackText as N } from "../form-field/parts/FormFeedbackText.mjs";
|
|
8
|
+
import { FormHelperText as P } from "../form-field/parts/FormHelperText.mjs";
|
|
9
|
+
import { FormLabel as v } from "../form-field/parts/FormLabel.mjs";
|
|
10
|
+
import { Input as w } from "../input/Input.mjs";
|
|
11
|
+
import { TextArea as A } from "../text-area/TextArea.mjs";
|
|
12
|
+
const H = j({
|
|
13
|
+
base: "uy-flex uy-flex-col uy-gap-100"
|
|
14
|
+
});
|
|
15
|
+
function R({
|
|
16
|
+
name: t,
|
|
17
|
+
label: e,
|
|
18
|
+
defaultValue: r,
|
|
19
|
+
helperText: m,
|
|
20
|
+
feedbackText: l,
|
|
21
|
+
contextualLink: c,
|
|
22
|
+
multiline: i,
|
|
23
|
+
isRequired: p,
|
|
24
|
+
isInvalid: a,
|
|
25
|
+
isLoading: f,
|
|
26
|
+
isDisabled: d,
|
|
27
|
+
isReadOnly: u,
|
|
28
|
+
requiredVariant: x,
|
|
29
|
+
...n
|
|
30
|
+
}, s) {
|
|
31
|
+
const { control: F, setValue: C } = g(), T = {
|
|
32
|
+
isRequired: p,
|
|
33
|
+
isInvalid: a,
|
|
34
|
+
isLoading: f,
|
|
35
|
+
isDisabled: d,
|
|
36
|
+
isReadOnly: u
|
|
37
|
+
}, h = !i, { onClearButtonPress: y } = h ? n : {}, b = y ?? (() => {
|
|
38
|
+
C(t, "");
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ B(
|
|
41
|
+
k,
|
|
42
|
+
{
|
|
43
|
+
control: F,
|
|
44
|
+
name: t,
|
|
45
|
+
className: H(),
|
|
46
|
+
...T,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ o(v, { requiredVariant: x, children: e }),
|
|
49
|
+
m && /* @__PURE__ */ o(P, { children: m }),
|
|
50
|
+
/* @__PURE__ */ o(L, { children: i ? /* @__PURE__ */ o(
|
|
51
|
+
A,
|
|
52
|
+
{
|
|
53
|
+
ref: s,
|
|
54
|
+
defaultValue: r,
|
|
55
|
+
...n
|
|
56
|
+
}
|
|
57
|
+
) : /* @__PURE__ */ o(
|
|
58
|
+
w,
|
|
59
|
+
{
|
|
60
|
+
ref: s,
|
|
61
|
+
defaultValue: r,
|
|
62
|
+
onClearButtonPress: b,
|
|
63
|
+
...n
|
|
64
|
+
}
|
|
65
|
+
) }),
|
|
66
|
+
/* @__PURE__ */ o(N, { children: l }),
|
|
67
|
+
c
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
const S = I(function(e, r) {
|
|
73
|
+
return R(e, r);
|
|
74
|
+
});
|
|
75
|
+
S.displayName = "TextField";
|
|
76
|
+
export {
|
|
77
|
+
S as TextField
|
|
78
|
+
};
|
|
@@ -3,6 +3,6 @@ type ToastContextValue = {
|
|
|
3
3
|
inline: boolean;
|
|
4
4
|
};
|
|
5
5
|
export declare const ToastContext: import('react').Context<ToastContextValue>;
|
|
6
|
-
export declare function ToastProvider({ inline, children, }: PropsWithChildren<ToastContextValue>): JSX.Element;
|
|
6
|
+
export declare function ToastProvider({ inline, children, }: PropsWithChildren<ToastContextValue>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function useToastContext(): ToastContextValue;
|
|
8
8
|
export {};
|
|
@@ -3,5 +3,5 @@ interface ToastOptions {
|
|
|
3
3
|
duration: number;
|
|
4
4
|
}
|
|
5
5
|
declare const TOAST_CONFIG: Record<UnityToastProps['variant'], ToastOptions>;
|
|
6
|
-
declare const ToastManager: () => JSX.Element;
|
|
6
|
+
declare const ToastManager: () => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { ToastManager, TOAST_CONFIG };
|
|
@@ -49,7 +49,7 @@ export interface UnityToastProps extends Required<Pick<VariantProps<typeof unity
|
|
|
49
49
|
* - `ToastAction`(optional): The action on the toast
|
|
50
50
|
*/
|
|
51
51
|
declare const UnityToast: {
|
|
52
|
-
({ children, onClose, variant, inline, }: PropsWithChildren<UnityToastProps>): JSX.Element;
|
|
52
|
+
({ children, onClose, variant, inline, }: PropsWithChildren<UnityToastProps>): import("react/jsx-runtime").JSX.Element;
|
|
53
53
|
displayName: string;
|
|
54
54
|
};
|
|
55
55
|
export { UnityToast };
|
|
@@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
export interface ToastActionProps {
|
|
3
3
|
onPress: () => void;
|
|
4
4
|
}
|
|
5
|
-
declare function ToastAction({ children, onPress, }: PropsWithChildren<ToastActionProps>): JSX.Element;
|
|
5
|
+
declare function ToastAction({ children, onPress, }: PropsWithChildren<ToastActionProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare namespace ToastAction {
|
|
7
7
|
var displayName: string;
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
declare function ToastContent({ children }: PropsWithChildren<object>): JSX.Element | null;
|
|
2
|
+
declare function ToastContent({ children }: PropsWithChildren<object>): import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
declare namespace ToastContent {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
declare function ToastTitle({ children }: PropsWithChildren<object>): JSX.Element;
|
|
2
|
+
declare function ToastTitle({ children }: PropsWithChildren<object>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare namespace ToastTitle {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
@@ -3,5 +3,5 @@ interface TooltipProps {
|
|
|
3
3
|
title: string;
|
|
4
4
|
children: ReactElement;
|
|
5
5
|
}
|
|
6
|
-
declare function Tooltip({ title, children }: TooltipProps): JSX.Element;
|
|
6
|
+
declare function Tooltip({ title, children }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default Tooltip;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
type CardProps = React.PropsWithChildren
|
|
1
|
+
import { PropsWithChildren, default as React } from 'react';
|
|
2
|
+
type CardProps = React.PropsWithChildren;
|
|
3
3
|
export declare const Card: React.FC<CardProps>;
|
|
4
4
|
export declare const CardWithCover: React.FC<CardProps & {
|
|
5
5
|
coverSrc: string;
|
|
6
6
|
coverAlt: string;
|
|
7
7
|
}>;
|
|
8
|
-
export declare const CardHeader: React.FC
|
|
9
|
-
export declare const CardTitle: React.FC
|
|
10
|
-
export declare const CardContent: React.FC
|
|
11
|
-
export declare const CardActions: React.FC
|
|
12
|
-
export declare const Link: React.FC<React.ComponentProps<"a"
|
|
8
|
+
export declare const CardHeader: React.FC<PropsWithChildren>;
|
|
9
|
+
export declare const CardTitle: React.FC<PropsWithChildren>;
|
|
10
|
+
export declare const CardContent: React.FC<PropsWithChildren>;
|
|
11
|
+
export declare const CardActions: React.FC<PropsWithChildren>;
|
|
12
|
+
export declare const Link: React.FC<PropsWithChildren<React.ComponentProps<"a">>>;
|
|
13
13
|
type CardGridProps = {
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
cols?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
1
|
+
import { JSX, PropsWithChildren } from 'react';
|
|
2
2
|
import { UseFormProps as UseHookFormProps, UseFormReturn as UseHookFormReturn } from 'react-hook-form';
|
|
3
3
|
import { infer as ZodInfer } from 'zod';
|
|
4
4
|
import { FormFieldProps } from '../components/form-field/FormField.mjs';
|
|
@@ -7,12 +7,12 @@ import { Schema } from './use-form.types.mjs';
|
|
|
7
7
|
export type UseUnityFormReturn<TSchema extends Schema> = {
|
|
8
8
|
methods: UseHookFormReturn<ZodInfer<TSchema>>;
|
|
9
9
|
Form: (props: Omit<FormProps<TSchema>, 'form' | 'schema'>) => JSX.Element;
|
|
10
|
-
FormField: (props: Omit<FormFieldProps<ZodInfer<TSchema>>, 'control'
|
|
10
|
+
FormField: (props: PropsWithChildren<Omit<FormFieldProps<ZodInfer<TSchema>>, 'control'>>) => JSX.Element;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A hook to create `Form` and `FormField` components that are bound to a specific schema definition and form controller. The resulting components will have full type-safety based on the provided schema type.
|
|
14
|
-
* @param schema
|
|
15
|
-
* @param options
|
|
14
|
+
* @param `schema` a Zod schema definition to validate the form data, {@link [Zod](https://zod.dev)}
|
|
15
|
+
* @param `options` the options to pass to the `react-hook-form` hook. See the official documentation for more details. {@link [React Hook Form](https://react-hook-form.com/api/useform)}
|
|
16
16
|
* @returns an object containing the bounded `Form` and `FormField` components, as well as the form controller methods {@link UseUnityFormReturn}
|
|
17
17
|
* @example
|
|
18
18
|
* ```tsx
|
|
@@ -35,7 +35,7 @@ export type UseUnityFormReturn<TSchema extends Schema> = {
|
|
|
35
35
|
* // ...
|
|
36
36
|
* </FormField>
|
|
37
37
|
* // Type Error: "baz" is not assignable to "foo" | "bar".
|
|
38
|
-
* <
|
|
38
|
+
* <FormField name="baz" type="text">
|
|
39
39
|
* // ...
|
|
40
40
|
* </FormField>
|
|
41
41
|
* </Form>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as n } from "react";
|
|
3
|
+
import { zodResolver as l } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useForm as c } from "react-hook-form";
|
|
5
|
+
import { FormField as u } from "../components/form-field/FormField.mjs";
|
|
6
|
+
import { Form as s } from "../components/form/Form.mjs";
|
|
7
|
+
function v(m, i = {
|
|
8
|
+
mode: "onTouched",
|
|
9
|
+
reValidateMode: "onChange"
|
|
10
|
+
}) {
|
|
11
|
+
const r = c({
|
|
12
|
+
...i,
|
|
13
|
+
resolver: l(m)
|
|
14
|
+
}), d = n(() => {
|
|
15
|
+
const o = (e) => /* @__PURE__ */ t(s, { ...e, form: r, schema: m, children: e.children });
|
|
16
|
+
return o.displayName = "FormWithSchema", o;
|
|
17
|
+
}, [r, m]), F = n(() => {
|
|
18
|
+
const o = (e) => (
|
|
19
|
+
// @ts-expect-error: REACT-18-MIGRATION
|
|
20
|
+
/* @__PURE__ */ t(u, { ...e, control: r.control, children: e.children })
|
|
21
|
+
);
|
|
22
|
+
return o.displayName = "FormFieldWithSchema", o;
|
|
23
|
+
}, [r]);
|
|
24
|
+
return {
|
|
25
|
+
methods: r,
|
|
26
|
+
Form: d,
|
|
27
|
+
FormField: F
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
v as useUnityForm
|
|
32
|
+
};
|