@ankhorage/zora 10.0.0 → 12.0.0
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/CHANGELOG.md +20 -0
- package/README.md +2 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -0
- package/dist/constants.js.map +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/{components/date-picker → features/date-picker/adapters/inbound}/DatePicker.d.ts +1 -1
- package/dist/features/date-picker/adapters/inbound/DatePicker.d.ts.map +1 -0
- package/dist/{components/date-picker → features/date-picker/adapters/inbound}/DatePicker.js +23 -26
- package/dist/features/date-picker/adapters/inbound/DatePicker.js.map +1 -0
- package/dist/features/date-picker/datePickerMeta.d.ts +83 -0
- package/dist/features/date-picker/datePickerMeta.d.ts.map +1 -0
- package/dist/features/date-picker/datePickerMeta.js +57 -0
- package/dist/features/date-picker/datePickerMeta.js.map +1 -0
- package/dist/features/date-picker/public.d.ts +3 -0
- package/dist/features/date-picker/public.d.ts.map +1 -0
- package/dist/features/date-picker/public.js +2 -0
- package/dist/features/date-picker/public.js.map +1 -0
- package/dist/features/date-picker/utils/localDate.d.ts +5 -0
- package/dist/features/date-picker/utils/localDate.d.ts.map +1 -0
- package/dist/features/date-picker/utils/localDate.js +27 -0
- package/dist/features/date-picker/utils/localDate.js.map +1 -0
- package/dist/features/form/adapters/inbound/Form.d.ts +5 -0
- package/dist/features/form/adapters/inbound/Form.d.ts.map +1 -0
- package/dist/features/form/adapters/inbound/Form.js +18 -0
- package/dist/features/form/adapters/inbound/Form.js.map +1 -0
- package/dist/{components/form → features/form/adapters/inbound}/FormActions.d.ts +1 -1
- package/dist/features/form/adapters/inbound/FormActions.d.ts.map +1 -0
- package/dist/{components/form → features/form/adapters/inbound}/FormActions.js +3 -3
- package/dist/features/form/adapters/inbound/FormActions.js.map +1 -0
- package/dist/features/form/adapters/inbound/FormError.d.ts +5 -0
- package/dist/features/form/adapters/inbound/FormError.d.ts.map +1 -0
- package/dist/features/form/adapters/inbound/FormError.js +18 -0
- package/dist/features/form/adapters/inbound/FormError.js.map +1 -0
- package/dist/features/form/adapters/inbound/FormField.d.ts +5 -0
- package/dist/features/form/adapters/inbound/FormField.d.ts.map +1 -0
- package/dist/{patterns/form-field → features/form/adapters/inbound}/FormField.js +5 -4
- package/dist/features/form/adapters/inbound/FormField.js.map +1 -0
- package/dist/features/form/formActionsMeta.d.ts +9 -0
- package/dist/features/form/formActionsMeta.d.ts.map +1 -0
- package/dist/features/form/formActionsMeta.js +9 -0
- package/dist/features/form/formActionsMeta.js.map +1 -0
- package/dist/features/form/formErrorMeta.d.ts +32 -0
- package/dist/features/form/formErrorMeta.d.ts.map +1 -0
- package/dist/features/form/formErrorMeta.js +19 -0
- package/dist/features/form/formErrorMeta.js.map +1 -0
- package/dist/{components/form/meta.d.ts → features/form/formFieldMeta.d.ts} +28 -39
- package/dist/features/form/formFieldMeta.d.ts.map +1 -0
- package/dist/features/form/formFieldMeta.js +35 -0
- package/dist/features/form/formFieldMeta.js.map +1 -0
- package/dist/features/form/formMeta.d.ts +61 -0
- package/dist/features/form/formMeta.d.ts.map +1 -0
- package/dist/features/form/formMeta.js +34 -0
- package/dist/features/form/formMeta.js.map +1 -0
- package/dist/features/form/public.d.ts +8 -0
- package/dist/features/form/public.d.ts.map +1 -0
- package/dist/features/form/public.js +7 -0
- package/dist/features/form/public.js.map +1 -0
- package/dist/{components → features}/form/useFormController.d.ts +1 -1
- package/dist/features/form/useFormController.d.ts.map +1 -0
- package/dist/{components → features}/form/useFormController.js +1 -1
- package/dist/features/form/useFormController.js.map +1 -0
- package/dist/{components/form → features/form/utils}/validation.d.ts +1 -1
- package/dist/features/form/utils/validation.d.ts.map +1 -0
- package/dist/{components/form → features/form/utils}/validation.js +2 -4
- package/dist/features/form/utils/validation.js.map +1 -0
- package/dist/{patterns/hero → features/hero/adapters/inbound}/Hero.d.ts +1 -1
- package/dist/features/hero/adapters/inbound/Hero.d.ts.map +1 -0
- package/dist/{patterns/hero → features/hero/adapters/inbound}/Hero.js +5 -6
- package/dist/features/hero/adapters/inbound/Hero.js.map +1 -0
- package/dist/{patterns/hero/meta.d.ts → features/hero/heroMeta.d.ts} +1 -1
- package/dist/features/hero/heroMeta.d.ts.map +1 -0
- package/dist/{patterns/hero/meta.js → features/hero/heroMeta.js} +1 -1
- package/dist/features/hero/heroMeta.js.map +1 -0
- package/dist/features/hero/public.d.ts +3 -0
- package/dist/features/hero/public.d.ts.map +1 -0
- package/dist/features/hero/public.js +2 -0
- package/dist/features/hero/public.js.map +1 -0
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/boxMeta.d.ts +1 -1
- package/dist/features/layout/containerMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/stackMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/{patterns/missing-element → features/missing-element/adapters/inbound}/MissingElement.d.ts +1 -1
- package/dist/features/missing-element/adapters/inbound/MissingElement.d.ts.map +1 -0
- package/dist/{patterns/missing-element → features/missing-element/adapters/inbound}/MissingElement.js +5 -5
- package/dist/features/missing-element/adapters/inbound/MissingElement.js.map +1 -0
- package/dist/{patterns/missing-element/meta.d.ts → features/missing-element/missingElementMeta.d.ts} +1 -1
- package/dist/features/missing-element/missingElementMeta.d.ts.map +1 -0
- package/dist/{patterns/missing-element/meta.js → features/missing-element/missingElementMeta.js} +1 -1
- package/dist/features/missing-element/missingElementMeta.js.map +1 -0
- package/dist/features/missing-element/public.d.ts +3 -0
- package/dist/features/missing-element/public.d.ts.map +1 -0
- package/dist/features/missing-element/public.js +2 -0
- package/dist/features/missing-element/public.js.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/Skeleton.d.ts +1 -1
- package/dist/features/skeleton/adapters/inbound/Skeleton.d.ts.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/Skeleton.js +3 -3
- package/dist/features/skeleton/adapters/inbound/Skeleton.js.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonCard.d.ts +1 -1
- package/dist/features/skeleton/adapters/inbound/SkeletonCard.d.ts.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonCard.js +4 -4
- package/dist/features/skeleton/adapters/inbound/SkeletonCard.js.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonList.d.ts +1 -1
- package/dist/features/skeleton/adapters/inbound/SkeletonList.d.ts.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonList.js +2 -2
- package/dist/features/skeleton/adapters/inbound/SkeletonList.js.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonText.d.ts +1 -1
- package/dist/features/skeleton/adapters/inbound/SkeletonText.d.ts.map +1 -0
- package/dist/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonText.js +2 -2
- package/dist/features/skeleton/adapters/inbound/SkeletonText.js.map +1 -0
- package/dist/features/skeleton/public.d.ts +6 -0
- package/dist/features/skeleton/public.d.ts.map +1 -0
- package/dist/features/skeleton/public.js +5 -0
- package/dist/features/skeleton/public.js.map +1 -0
- package/dist/features/skeleton/skeletonMeta.d.ts +178 -0
- package/dist/features/skeleton/skeletonMeta.d.ts.map +1 -0
- package/dist/features/skeleton/skeletonMeta.js +84 -0
- package/dist/features/skeleton/skeletonMeta.js.map +1 -0
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/{components/time-picker → features/time-picker/adapters/inbound}/TimePicker.d.ts +1 -1
- package/dist/features/time-picker/adapters/inbound/TimePicker.d.ts.map +1 -0
- package/dist/{components/time-picker → features/time-picker/adapters/inbound}/TimePicker.js +8 -11
- package/dist/features/time-picker/adapters/inbound/TimePicker.js.map +1 -0
- package/dist/features/time-picker/public.d.ts +3 -0
- package/dist/features/time-picker/public.d.ts.map +1 -0
- package/dist/features/time-picker/public.js +2 -0
- package/dist/features/time-picker/public.js.map +1 -0
- package/dist/features/time-picker/timePickerMeta.d.ts +90 -0
- package/dist/features/time-picker/timePickerMeta.d.ts.map +1 -0
- package/dist/features/time-picker/timePickerMeta.js +64 -0
- package/dist/features/time-picker/timePickerMeta.js.map +1 -0
- package/dist/features/uploader/adapters/inbound/Uploader.d.ts.map +1 -1
- package/dist/features/uploader/adapters/inbound/Uploader.js +1 -1
- package/dist/features/uploader/adapters/inbound/Uploader.js.map +1 -1
- package/dist/index.d.ts +7 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/layout/screen/meta.d.ts +1 -1
- package/dist/layout/screen-section/meta.d.ts +1 -1
- package/dist/metadata/allowedChildren.d.ts +3 -3
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +8 -1
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +2 -2
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +9 -6
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/auth/AuthForm.d.ts +21 -0
- package/dist/patterns/auth/AuthForm.d.ts.map +1 -0
- package/dist/patterns/auth/AuthForm.js +19 -0
- package/dist/patterns/auth/AuthForm.js.map +1 -0
- package/dist/patterns/auth/AuthFormField.d.ts +16 -0
- package/dist/patterns/auth/AuthFormField.d.ts.map +1 -0
- package/dist/patterns/auth/AuthFormField.js +38 -0
- package/dist/patterns/auth/AuthFormField.js.map +1 -0
- package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.js +2 -2
- package/dist/patterns/auth/ForgotPasswordForm.js.map +1 -1
- package/dist/patterns/auth/OtpForm.d.ts.map +1 -1
- package/dist/patterns/auth/OtpForm.js +2 -2
- package/dist/patterns/auth/OtpForm.js.map +1 -1
- package/dist/patterns/auth/SignInForm.d.ts.map +1 -1
- package/dist/patterns/auth/SignInForm.js +2 -2
- package/dist/patterns/auth/SignInForm.js.map +1 -1
- package/dist/patterns/auth/SignUpForm.d.ts.map +1 -1
- package/dist/patterns/auth/SignUpForm.js +2 -2
- package/dist/patterns/auth/SignUpForm.js.map +1 -1
- package/dist/patterns/auth/types.d.ts +1 -1
- package/dist/patterns/auth/types.d.ts.map +1 -1
- package/dist/patterns/auth/types.js.map +1 -1
- package/dist/patterns/auth/utils.d.ts +1 -1
- package/dist/patterns/auth/utils.d.ts.map +1 -1
- package/dist/patterns/auth/utils.js.map +1 -1
- package/dist/patterns/inspector-field/InspectorField.js +1 -1
- package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
- package/dist/patterns/message-bubble/meta.d.ts +1 -1
- package/dist/patterns/notice/meta.d.ts +1 -1
- package/dist/patterns/panel/meta.d.ts +1 -1
- package/dist/patterns/reader/meta.d.ts +2 -2
- package/dist/patterns/scanner/meta.d.ts +2 -2
- package/dist/registry.js +6 -6
- package/dist/registry.js.map +1 -1
- package/dist/{components/date-picker/types.d.ts → types/date-picker.d.ts} +6 -6
- package/dist/types/date-picker.d.ts.map +1 -0
- package/dist/types/date-picker.js +2 -0
- package/dist/types/date-picker.js.map +1 -0
- package/dist/{components/form/types.d.ts → types/form.d.ts} +12 -28
- package/dist/types/form.d.ts.map +1 -0
- package/dist/types/form.js +2 -0
- package/dist/types/form.js.map +1 -0
- package/dist/{patterns/hero/types.d.ts → types/hero.d.ts} +3 -3
- package/dist/types/hero.d.ts.map +1 -0
- package/dist/types/hero.js +2 -0
- package/dist/types/hero.js.map +1 -0
- package/dist/{patterns/missing-element/types.d.ts → types/missing-element.d.ts} +2 -2
- package/dist/types/missing-element.d.ts.map +1 -0
- package/dist/types/missing-element.js +2 -0
- package/dist/types/missing-element.js.map +1 -0
- package/dist/{components/skeleton/types.d.ts → types/skeleton.d.ts} +3 -3
- package/dist/types/skeleton.d.ts.map +1 -0
- package/dist/types/skeleton.js +2 -0
- package/dist/types/skeleton.js.map +1 -0
- package/dist/{components/time-picker/types.d.ts → types/time-picker.d.ts} +2 -2
- package/dist/types/time-picker.d.ts.map +1 -0
- package/dist/types/time-picker.js +2 -0
- package/dist/types/time-picker.js.map +1 -0
- package/package.json +2 -1
- package/src/audit.test.ts +2 -4
- package/src/constants.ts +4 -0
- package/src/featureManifest.test.ts +19 -0
- package/src/features/bottom-sheet/public.test.ts +2 -2
- package/src/features/data-table/adapters/inbound/DataTable.tsx +1 -1
- package/src/{components/date-picker → features/date-picker/adapters/inbound}/DatePicker.tsx +41 -32
- package/src/features/date-picker/datePickerMeta.ts +58 -0
- package/src/features/date-picker/public.test.ts +15 -0
- package/src/features/date-picker/public.ts +2 -0
- package/src/features/date-picker/utils/localDate.test.ts +18 -0
- package/src/features/date-picker/utils/localDate.ts +29 -0
- package/src/features/form/adapters/inbound/Form.tsx +39 -0
- package/src/{components/form → features/form/adapters/inbound}/FormActions.tsx +4 -4
- package/src/features/form/adapters/inbound/FormError.tsx +22 -0
- package/src/{patterns/form-field → features/form/adapters/inbound}/FormField.tsx +6 -4
- package/src/{components/date-picker/meta.ts → features/form/formActionsMeta.ts} +3 -4
- package/src/features/form/formErrorMeta.ts +19 -0
- package/src/features/form/formFieldMeta.ts +35 -0
- package/src/features/form/formMeta.ts +34 -0
- package/src/{components/form/index.ts → features/form/public.ts} +6 -7
- package/src/{components → features}/form/useFormController.ts +2 -2
- package/src/{components/form → features/form/utils}/validation.test.ts +4 -1
- package/src/{components/form → features/form/utils}/validation.ts +4 -8
- package/src/{patterns/hero → features/hero/adapters/inbound}/Hero.tsx +6 -7
- package/src/features/hero/public.ts +2 -0
- package/src/{patterns → features}/missing-element/MissingElement.test.ts +6 -4
- package/src/{patterns/missing-element → features/missing-element/adapters/inbound}/MissingElement.tsx +6 -6
- package/src/features/missing-element/public.ts +2 -0
- package/src/{components/skeleton → features/skeleton/adapters/inbound}/Skeleton.tsx +4 -4
- package/src/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonCard.tsx +5 -5
- package/src/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonList.tsx +3 -3
- package/src/{components/skeleton → features/skeleton/adapters/inbound}/SkeletonText.tsx +3 -3
- package/src/features/skeleton/public.test.ts +24 -0
- package/src/features/skeleton/public.ts +13 -0
- package/src/features/skeleton/skeletonMeta.ts +88 -0
- package/src/{components/time-picker → features/time-picker/adapters/inbound}/TimePicker.tsx +9 -12
- package/src/features/time-picker/public.test.ts +14 -0
- package/src/features/time-picker/public.ts +2 -0
- package/src/features/time-picker/timePickerMeta.ts +65 -0
- package/src/features/uploader/adapters/inbound/Uploader.tsx +1 -1
- package/src/index.ts +58 -45
- package/src/interactionPolicy.test.ts +3 -3
- package/src/metadata/allowedChildren.ts +8 -1
- package/src/metadata/componentMeta.test.ts +24 -1
- package/src/metadata/componentMeta.ts +14 -11
- package/src/patterns/auth/AuthForm.tsx +68 -0
- package/src/patterns/auth/AuthFormField.tsx +81 -0
- package/src/patterns/auth/ForgotPasswordForm.tsx +3 -2
- package/src/patterns/auth/OtpForm.tsx +3 -2
- package/src/patterns/auth/SignInForm.tsx +3 -2
- package/src/patterns/auth/SignUpForm.tsx +3 -2
- package/src/patterns/auth/types.ts +1 -1
- package/src/patterns/auth/utils.ts +1 -1
- package/src/patterns/inspector-field/InspectorField.tsx +1 -1
- package/src/registry.ts +6 -6
- package/src/theme/themeScopeStructure.test.ts +5 -7
- package/src/{components/date-picker/types.ts → types/date-picker.ts} +5 -5
- package/src/{components/form/types.ts → types/form.ts} +12 -36
- package/src/{patterns/hero/types.ts → types/hero.ts} +2 -2
- package/src/{patterns/missing-element/types.ts → types/missing-element.ts} +1 -1
- package/src/{components/skeleton/types.ts → types/skeleton.ts} +2 -2
- package/src/{components/time-picker/types.ts → types/time-picker.ts} +1 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +0 -1
- package/dist/components/date-picker/DatePicker.js.map +0 -1
- package/dist/components/date-picker/index.d.ts +0 -3
- package/dist/components/date-picker/index.d.ts.map +0 -1
- package/dist/components/date-picker/index.js +0 -2
- package/dist/components/date-picker/index.js.map +0 -1
- package/dist/components/date-picker/meta.d.ts +0 -9
- package/dist/components/date-picker/meta.d.ts.map +0 -1
- package/dist/components/date-picker/meta.js +0 -9
- package/dist/components/date-picker/meta.js.map +0 -1
- package/dist/components/date-picker/types.d.ts.map +0 -1
- package/dist/components/date-picker/types.js +0 -2
- package/dist/components/date-picker/types.js.map +0 -1
- package/dist/components/form/Form.d.ts +0 -7
- package/dist/components/form/Form.d.ts.map +0 -1
- package/dist/components/form/Form.js +0 -34
- package/dist/components/form/Form.js.map +0 -1
- package/dist/components/form/FormActions.d.ts.map +0 -1
- package/dist/components/form/FormActions.js.map +0 -1
- package/dist/components/form/FormError.d.ts +0 -7
- package/dist/components/form/FormError.d.ts.map +0 -1
- package/dist/components/form/FormError.js +0 -21
- package/dist/components/form/FormError.js.map +0 -1
- package/dist/components/form/FormField.d.ts +0 -7
- package/dist/components/form/FormField.d.ts.map +0 -1
- package/dist/components/form/FormField.js +0 -81
- package/dist/components/form/FormField.js.map +0 -1
- package/dist/components/form/index.d.ts +0 -8
- package/dist/components/form/index.d.ts.map +0 -1
- package/dist/components/form/index.js +0 -7
- package/dist/components/form/index.js.map +0 -1
- package/dist/components/form/meta.d.ts.map +0 -1
- package/dist/components/form/meta.js +0 -94
- package/dist/components/form/meta.js.map +0 -1
- package/dist/components/form/types.d.ts.map +0 -1
- package/dist/components/form/types.js +0 -2
- package/dist/components/form/types.js.map +0 -1
- package/dist/components/form/useFormController.d.ts.map +0 -1
- package/dist/components/form/useFormController.js.map +0 -1
- package/dist/components/form/validation.d.ts.map +0 -1
- package/dist/components/form/validation.js.map +0 -1
- package/dist/components/skeleton/Skeleton.d.ts.map +0 -1
- package/dist/components/skeleton/Skeleton.js.map +0 -1
- package/dist/components/skeleton/SkeletonCard.d.ts.map +0 -1
- package/dist/components/skeleton/SkeletonCard.js.map +0 -1
- package/dist/components/skeleton/SkeletonList.d.ts.map +0 -1
- package/dist/components/skeleton/SkeletonList.js.map +0 -1
- package/dist/components/skeleton/SkeletonText.d.ts.map +0 -1
- package/dist/components/skeleton/SkeletonText.js.map +0 -1
- package/dist/components/skeleton/index.d.ts +0 -6
- package/dist/components/skeleton/index.d.ts.map +0 -1
- package/dist/components/skeleton/index.js +0 -5
- package/dist/components/skeleton/index.js.map +0 -1
- package/dist/components/skeleton/meta.d.ts +0 -33
- package/dist/components/skeleton/meta.d.ts.map +0 -1
- package/dist/components/skeleton/meta.js +0 -33
- package/dist/components/skeleton/meta.js.map +0 -1
- package/dist/components/skeleton/types.d.ts.map +0 -1
- package/dist/components/skeleton/types.js +0 -2
- package/dist/components/skeleton/types.js.map +0 -1
- package/dist/components/time-picker/TimePicker.d.ts.map +0 -1
- package/dist/components/time-picker/TimePicker.js.map +0 -1
- package/dist/components/time-picker/index.d.ts +0 -3
- package/dist/components/time-picker/index.d.ts.map +0 -1
- package/dist/components/time-picker/index.js +0 -2
- package/dist/components/time-picker/index.js.map +0 -1
- package/dist/components/time-picker/meta.d.ts +0 -9
- package/dist/components/time-picker/meta.d.ts.map +0 -1
- package/dist/components/time-picker/meta.js +0 -9
- package/dist/components/time-picker/meta.js.map +0 -1
- package/dist/components/time-picker/types.d.ts.map +0 -1
- package/dist/components/time-picker/types.js +0 -2
- package/dist/components/time-picker/types.js.map +0 -1
- package/dist/patterns/form-field/FormField.d.ts +0 -4
- package/dist/patterns/form-field/FormField.d.ts.map +0 -1
- package/dist/patterns/form-field/FormField.js.map +0 -1
- package/dist/patterns/form-field/index.d.ts +0 -2
- package/dist/patterns/form-field/index.d.ts.map +0 -1
- package/dist/patterns/form-field/index.js +0 -2
- package/dist/patterns/form-field/index.js.map +0 -1
- package/dist/patterns/form-field/types.d.ts +0 -9
- package/dist/patterns/form-field/types.d.ts.map +0 -1
- package/dist/patterns/form-field/types.js +0 -2
- package/dist/patterns/form-field/types.js.map +0 -1
- package/dist/patterns/hero/Hero.d.ts.map +0 -1
- package/dist/patterns/hero/Hero.js.map +0 -1
- package/dist/patterns/hero/index.d.ts +0 -3
- package/dist/patterns/hero/index.d.ts.map +0 -1
- package/dist/patterns/hero/index.js +0 -2
- package/dist/patterns/hero/index.js.map +0 -1
- package/dist/patterns/hero/meta.d.ts.map +0 -1
- package/dist/patterns/hero/meta.js.map +0 -1
- package/dist/patterns/hero/types.d.ts.map +0 -1
- package/dist/patterns/hero/types.js +0 -2
- package/dist/patterns/hero/types.js.map +0 -1
- package/dist/patterns/missing-element/MissingElement.d.ts.map +0 -1
- package/dist/patterns/missing-element/MissingElement.js.map +0 -1
- package/dist/patterns/missing-element/index.d.ts +0 -3
- package/dist/patterns/missing-element/index.d.ts.map +0 -1
- package/dist/patterns/missing-element/index.js +0 -2
- package/dist/patterns/missing-element/index.js.map +0 -1
- package/dist/patterns/missing-element/meta.d.ts.map +0 -1
- package/dist/patterns/missing-element/meta.js.map +0 -1
- package/dist/patterns/missing-element/types.d.ts.map +0 -1
- package/dist/patterns/missing-element/types.js +0 -2
- package/dist/patterns/missing-element/types.js.map +0 -1
- package/src/components/date-picker/index.ts +0 -2
- package/src/components/form/Form.tsx +0 -74
- package/src/components/form/FormError.tsx +0 -34
- package/src/components/form/FormField.tsx +0 -157
- package/src/components/form/meta.ts +0 -98
- package/src/components/skeleton/index.ts +0 -13
- package/src/components/skeleton/meta.ts +0 -37
- package/src/components/time-picker/index.ts +0 -2
- package/src/components/time-picker/meta.ts +0 -10
- package/src/patterns/form-field/index.ts +0 -1
- package/src/patterns/form-field/types.ts +0 -16
- package/src/patterns/hero/index.ts +0 -2
- package/src/patterns/missing-element/index.ts +0 -2
- /package/src/{patterns/hero/meta.ts → features/hero/heroMeta.ts} +0 -0
- /package/src/{patterns/missing-element/meta.ts → features/missing-element/missingElementMeta.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/date-picker/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/date-picker/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["export type { DatePickerProps, DatePickerValue } from '../../types/date-picker';\nexport { DatePicker } from './adapters/inbound/DatePicker';\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*** Parse a calendar date without applying a UTC offset. */
|
|
2
|
+
export declare function parseLocalDate(value: string | null | undefined): Date | undefined;
|
|
3
|
+
/*** Serialize a Date as a local calendar date suitable for manifest state. */
|
|
4
|
+
export declare function formatLocalDate(value: Date): string;
|
|
5
|
+
//# sourceMappingURL=localDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localDate.d.ts","sourceRoot":"","sources":["../../../../src/features/date-picker/utils/localDate.ts"],"names":[],"mappings":"AAEA,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAiBjF;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAKnD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const LOCAL_DATE_PATTERN = /^(\d{4})-(\d{2})-(\d{2})$/u;
|
|
2
|
+
/*** Parse a calendar date without applying a UTC offset. */
|
|
3
|
+
export function parseLocalDate(value) {
|
|
4
|
+
if (!value)
|
|
5
|
+
return undefined;
|
|
6
|
+
const match = LOCAL_DATE_PATTERN.exec(value);
|
|
7
|
+
if (!match)
|
|
8
|
+
return undefined;
|
|
9
|
+
const year = Number(match[1]);
|
|
10
|
+
const month = Number(match[2]);
|
|
11
|
+
const day = Number(match[3]);
|
|
12
|
+
const parsed = new Date(year, month - 1, day);
|
|
13
|
+
parsed.setFullYear(year);
|
|
14
|
+
return parsed.getFullYear() === year &&
|
|
15
|
+
parsed.getMonth() === month - 1 &&
|
|
16
|
+
parsed.getDate() === day
|
|
17
|
+
? parsed
|
|
18
|
+
: undefined;
|
|
19
|
+
}
|
|
20
|
+
/*** Serialize a Date as a local calendar date suitable for manifest state. */
|
|
21
|
+
export function formatLocalDate(value) {
|
|
22
|
+
const year = String(value.getFullYear()).padStart(4, '0');
|
|
23
|
+
const month = String(value.getMonth() + 1).padStart(2, '0');
|
|
24
|
+
const day = String(value.getDate()).padStart(2, '0');
|
|
25
|
+
return `${year}-${month}-${day}`;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=localDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localDate.js","sourceRoot":"","sources":["../../../../src/features/date-picker/utils/localDate.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AAExD,4DAA4D;AAC5D,MAAM,UAAU,cAAc,CAAC,KAAgC;IAC7D,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE7B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEzB,OAAO,MAAM,CAAC,WAAW,EAAE,KAAK,IAAI;QAClC,MAAM,CAAC,QAAQ,EAAE,KAAK,KAAK,GAAG,CAAC;QAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,GAAG;QACxB,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,KAAW;IACzC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACrD,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;AACnC,CAAC","sourcesContent":["const LOCAL_DATE_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})$/u;\n\n/*** Parse a calendar date without applying a UTC offset. */\nexport function parseLocalDate(value: string | null | undefined): Date | undefined {\n if (!value) return undefined;\n\n const match = LOCAL_DATE_PATTERN.exec(value);\n if (!match) return undefined;\n\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const parsed = new Date(year, month - 1, day);\n parsed.setFullYear(year);\n\n return parsed.getFullYear() === year &&\n parsed.getMonth() === month - 1 &&\n parsed.getDate() === day\n ? parsed\n : undefined;\n}\n\n/*** Serialize a Date as a local calendar date suitable for manifest state. */\nexport function formatLocalDate(value: Date): string {\n const year = String(value.getFullYear()).padStart(4, '0');\n const month = String(value.getMonth() + 1).padStart(2, '0');\n const day = String(value.getDate()).padStart(2, '0');\n return `${year}-${month}-${day}`;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FormProps } from '../../../../types/form';
|
|
3
|
+
/*** Composes explicit form fields, form errors, and submit actions. */
|
|
4
|
+
export declare const Form: (props: FormProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=Form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAkCxD,uEAAuE;AACvE,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
3
|
+
import { Stack } from '../../../layout/public';
|
|
4
|
+
import { FormActions } from './FormActions';
|
|
5
|
+
function FormInner({ themeId: _themeId, mode: _mode, children, onSubmit, loading = false, disabled = false, submitLabel = 'Submit', actions, testID, interactionPolicy, }) {
|
|
6
|
+
return (<Stack gap="m" testID={testID}>
|
|
7
|
+
{children}
|
|
8
|
+
<FormActions disabled={disabled} interactionPolicy={interactionPolicy} loading={loading} onSubmit={() => {
|
|
9
|
+
if (interactionPolicy !== 'passive')
|
|
10
|
+
void onSubmit?.();
|
|
11
|
+
}} submitLabel={submitLabel}>
|
|
12
|
+
{actions}
|
|
13
|
+
</FormActions>
|
|
14
|
+
</Stack>);
|
|
15
|
+
}
|
|
16
|
+
/*** Composes explicit form fields, form errors, and submit actions. */
|
|
17
|
+
export const Form = withZoraThemeScope(FormInner);
|
|
18
|
+
//# sourceMappingURL=Form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,SAAS,SAAS,CAAC,EACjB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,WAAW,GAAG,QAAQ,EACtB,OAAO,EACP,MAAM,EACN,iBAAiB,GACP;IACV,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC5B;MAAA,CAAC,QAAQ,CACT;MAAA,CAAC,WAAW,CACV,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,GAAG,EAAE;YACb,IAAI,iBAAiB,KAAK,SAAS;gBAAE,KAAK,QAAQ,EAAE,EAAE,CAAC;QACzD,CAAC,CAAC,CACF,WAAW,CAAC,CAAC,WAAW,CAAC,CAEzB;QAAA,CAAC,OAAO,CACV;MAAA,EAAE,WAAW,CACf;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { FormProps } from '../../../../types/form';\nimport { Stack } from '../../../layout/public';\nimport { FormActions } from './FormActions';\n\nfunction FormInner({\n themeId: _themeId,\n mode: _mode,\n children,\n onSubmit,\n loading = false,\n disabled = false,\n submitLabel = 'Submit',\n actions,\n testID,\n interactionPolicy,\n}: FormProps) {\n return (\n <Stack gap=\"m\" testID={testID}>\n {children}\n <FormActions\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n loading={loading}\n onSubmit={() => {\n if (interactionPolicy !== 'passive') void onSubmit?.();\n }}\n submitLabel={submitLabel}\n >\n {actions}\n </FormActions>\n </Stack>\n );\n}\n\n/*** Composes explicit form fields, form errors, and submit actions. */\nexport const Form = withZoraThemeScope(FormInner);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormActions.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/FormActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA+B/D;;GAEG;AACH,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
3
|
+
import { Button } from '../../../button/public';
|
|
4
|
+
import { Box, Stack } from '../../../layout/public';
|
|
5
5
|
function FormActionsInner({ themeId: _themeId, mode: _mode, submitLabel = 'Submit', loading = false, disabled = false, onSubmit, children, testID, interactionPolicy, }) {
|
|
6
6
|
return (<Stack gap="s" testID={testID}>
|
|
7
7
|
<Button disabled={disabled} fullWidth interactionPolicy={interactionPolicy} loading={loading} onPress={onSubmit}>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormActions.js","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/FormActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,WAAW,GAAG,QAAQ,EACtB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,iBAAiB,GACA;IACjB,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC5B;MAAA,CAAC,MAAM,CACL,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,SAAS,CACT,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,OAAO,CAAC,CAAC,QAAQ,CAAC,CAElB;QAAA,CAAC,WAAW,CACd;MAAA,EAAE,MAAM,CACR;MAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC1C;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { FormActionsProps } from '../../../../types/form';\nimport { Button } from '../../../button/public';\nimport { Box, Stack } from '../../../layout/public';\n\nfunction FormActionsInner({\n themeId: _themeId,\n mode: _mode,\n submitLabel = 'Submit',\n loading = false,\n disabled = false,\n onSubmit,\n children,\n testID,\n interactionPolicy,\n}: FormActionsProps) {\n return (\n <Stack gap=\"s\" testID={testID}>\n <Button\n disabled={disabled}\n fullWidth\n interactionPolicy={interactionPolicy}\n loading={loading}\n onPress={onSubmit}\n >\n {submitLabel}\n </Button>\n {children ? <Box>{children}</Box> : null}\n </Stack>\n );\n}\n\n/***\n * Standard submit/action area for forms.\n */\nexport const FormActions = withZoraThemeScope(FormActionsInner);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FormErrorProps } from '../../../../types/form';
|
|
3
|
+
/*** Displays a form-level validation or submission error. */
|
|
4
|
+
export declare const FormError: (props: FormErrorProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=FormError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormError.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/FormError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAgB7D,6DAA6D;AAC7D,eAAO,MAAM,SAAS,sDAAqC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
3
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
4
|
+
import { Box } from '../../../layout/public';
|
|
5
|
+
import { Text } from '../../../typography/public';
|
|
6
|
+
function FormErrorInner({ themeId: _themeId, mode: _mode, error, testID }) {
|
|
7
|
+
const { theme } = useZoraTheme();
|
|
8
|
+
if (!error)
|
|
9
|
+
return null;
|
|
10
|
+
return (<Box borderColor={theme.colors.error} borderWidth={1} p="s" radius="m" testID={testID}>
|
|
11
|
+
<Text color="error" variant="bodySmall">
|
|
12
|
+
{error}
|
|
13
|
+
</Text>
|
|
14
|
+
</Box>);
|
|
15
|
+
}
|
|
16
|
+
/*** Displays a form-level validation or submission error. */
|
|
17
|
+
export const FormError = withZoraThemeScope(FormErrorInner);
|
|
18
|
+
//# sourceMappingURL=FormError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormError.js","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/FormError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAkB;IACvF,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,CACL,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACpF;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACrC;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { useZoraTheme } from '../../../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { FormErrorProps } from '../../../../types/form';\nimport { Box } from '../../../layout/public';\nimport { Text } from '../../../typography/public';\n\nfunction FormErrorInner({ themeId: _themeId, mode: _mode, error, testID }: FormErrorProps) {\n const { theme } = useZoraTheme();\n if (!error) return null;\n return (\n <Box borderColor={theme.colors.error} borderWidth={1} p=\"s\" radius=\"m\" testID={testID}>\n <Text color=\"error\" variant=\"bodySmall\">\n {error}\n </Text>\n </Box>\n );\n}\n\n/*** Displays a form-level validation or submission error. */\nexport const FormError = withZoraThemeScope(FormErrorInner);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FormFieldProps } from '../../../../types/form';
|
|
3
|
+
/*** Groups one form control with its label, description, helper text, and field error. */
|
|
4
|
+
export declare const FormField: (props: FormFieldProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=FormField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/FormField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAoC7D,0FAA0F;AAC1F,eAAO,MAAM,SAAS,sDAAqC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Field } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
function FormFieldInner({ themeId: _themeId, mode: _mode, label, description, helperText, children, ...props }) {
|
|
3
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
4
|
+
import { Stack } from '../../../layout/public';
|
|
5
|
+
import { Text } from '../../../typography/public';
|
|
6
|
+
function FormFieldInner({ themeId: _themeId, mode: _mode, label, description, helperText, children, interactionPolicy: _interactionPolicy, ...props }) {
|
|
7
7
|
return (<Field {...props} helperText={helperText} label={<Stack gap="xs">
|
|
8
8
|
<Text variant="label" weight="semiBold">
|
|
9
9
|
{label}
|
|
@@ -15,5 +15,6 @@ function FormFieldInner({ themeId: _themeId, mode: _mode, label, description, he
|
|
|
15
15
|
{children}
|
|
16
16
|
</Field>);
|
|
17
17
|
}
|
|
18
|
+
/*** Groups one form control with its label, description, helper text, and field error. */
|
|
18
19
|
export const FormField = withZoraThemeScope(FormFieldInner);
|
|
19
20
|
//# sourceMappingURL=FormField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../../../src/features/form/adapters/inbound/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,SAAS,cAAc,CAAC,EACtB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,KAAK,EACO;IACf,OAAO,CACL,CAAC,KAAK,CACJ,IAAI,KAAK,CAAC,CACV,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CACb;UAAA,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CACrC;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACxC;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,KAAK,CACT,CAAC,CAED;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { Field } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { FormFieldProps } from '../../../../types/form';\nimport { Stack } from '../../../layout/public';\nimport { Text } from '../../../typography/public';\n\nfunction FormFieldInner({\n themeId: _themeId,\n mode: _mode,\n label,\n description,\n helperText,\n children,\n interactionPolicy: _interactionPolicy,\n ...props\n}: FormFieldProps) {\n return (\n <Field\n {...props}\n helperText={helperText}\n label={\n <Stack gap=\"xs\">\n <Text variant=\"label\" weight=\"semiBold\">\n {label}\n </Text>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n }\n >\n {children}\n </Field>\n );\n}\n\n/*** Groups one form control with its label, description, helper text, and field error. */\nexport const FormField = withZoraThemeScope(FormFieldInner);\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const formActionsMeta: {
|
|
2
|
+
readonly name: "FormActions";
|
|
3
|
+
readonly category: "component";
|
|
4
|
+
readonly directManifestNode: false;
|
|
5
|
+
readonly allowedChildren: readonly [];
|
|
6
|
+
readonly note: "Internal form action helper.";
|
|
7
|
+
readonly props: {};
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=formActionsMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formActionsMeta.d.ts","sourceRoot":"","sources":["../../../src/features/form/formActionsMeta.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe;;;;;;;CAOU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formActionsMeta.js","sourceRoot":"","sources":["../../../src/features/form/formActionsMeta.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,8BAA8B;IACpC,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nexport const formActionsMeta = {\n name: 'FormActions',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Internal form action helper.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const formErrorMeta: {
|
|
2
|
+
readonly name: "FormError";
|
|
3
|
+
readonly category: "component";
|
|
4
|
+
readonly directManifestNode: true;
|
|
5
|
+
readonly allowedChildren: readonly [];
|
|
6
|
+
readonly blueprint: {
|
|
7
|
+
readonly label: "Form error";
|
|
8
|
+
readonly defaultProps: {
|
|
9
|
+
readonly error: "Unable to submit the form.";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly bindings: {
|
|
13
|
+
readonly props: {
|
|
14
|
+
readonly error: {
|
|
15
|
+
readonly label: "Error";
|
|
16
|
+
readonly description: "Global form or submission error.";
|
|
17
|
+
readonly value: {
|
|
18
|
+
readonly type: "unknown";
|
|
19
|
+
};
|
|
20
|
+
readonly acceptsFallback: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
readonly props: {
|
|
25
|
+
readonly error: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly category: "Content";
|
|
28
|
+
readonly label: "Error";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=formErrorMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formErrorMeta.d.ts","sourceRoot":"","sources":["../../../src/features/form/formErrorMeta.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const formErrorMeta = {
|
|
2
|
+
name: 'FormError',
|
|
3
|
+
category: 'component',
|
|
4
|
+
directManifestNode: true,
|
|
5
|
+
allowedChildren: [],
|
|
6
|
+
blueprint: { label: 'Form error', defaultProps: { error: 'Unable to submit the form.' } },
|
|
7
|
+
bindings: {
|
|
8
|
+
props: {
|
|
9
|
+
error: {
|
|
10
|
+
label: 'Error',
|
|
11
|
+
description: 'Global form or submission error.',
|
|
12
|
+
value: { type: 'unknown' },
|
|
13
|
+
acceptsFallback: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
props: { error: { type: 'string', category: 'Content', label: 'Error' } },
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=formErrorMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formErrorMeta.js","sourceRoot":"","sources":["../../../src/features/form/formErrorMeta.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,4BAA4B,EAAE,EAAE;IACzF,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,kCAAkC;gBAC/C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC1B,eAAe,EAAE,IAAI;aACtB;SACF;KACF;IACD,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;CACrC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nexport const formErrorMeta = {\n name: 'FormError',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Form error', defaultProps: { error: 'Unable to submit the form.' } },\n bindings: {\n props: {\n error: {\n label: 'Error',\n description: 'Global form or submission error.',\n value: { type: 'unknown' },\n acceptsFallback: true,\n },\n },\n },\n props: { error: { type: 'string', category: 'Content', label: 'Error' } },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,51 +1,35 @@
|
|
|
1
|
-
export declare const formMeta: {
|
|
2
|
-
readonly name: "Form";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Form orchestration component; not represented as a manifest node in v1.";
|
|
7
|
-
readonly events: {
|
|
8
|
-
readonly submit: {
|
|
9
|
-
readonly label: "Submit";
|
|
10
|
-
readonly eventType: "form.submit";
|
|
11
|
-
readonly description: "Emitted when the form submits its current values.";
|
|
12
|
-
readonly payloadFields: readonly [{
|
|
13
|
-
readonly path: "payload.values";
|
|
14
|
-
readonly type: "record";
|
|
15
|
-
readonly label: "Values";
|
|
16
|
-
readonly description: "Submitted form values keyed by field name.";
|
|
17
|
-
}];
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
readonly props: {};
|
|
21
|
-
};
|
|
22
|
-
export declare const formActionsMeta: {
|
|
23
|
-
readonly name: "FormActions";
|
|
24
|
-
readonly category: "component";
|
|
25
|
-
readonly directManifestNode: false;
|
|
26
|
-
readonly allowedChildren: readonly [];
|
|
27
|
-
readonly note: "Form helper component; not represented as a manifest node in v1.";
|
|
28
|
-
readonly props: {};
|
|
29
|
-
};
|
|
30
|
-
export declare const formErrorMeta: {
|
|
31
|
-
readonly name: "FormError";
|
|
32
|
-
readonly category: "component";
|
|
33
|
-
readonly directManifestNode: false;
|
|
34
|
-
readonly allowedChildren: readonly [];
|
|
35
|
-
readonly note: "Form helper component; not represented as a manifest node in v1.";
|
|
36
|
-
readonly props: {};
|
|
37
|
-
};
|
|
38
1
|
export declare const formFieldMeta: {
|
|
39
2
|
readonly name: "FormField";
|
|
40
3
|
readonly category: "component";
|
|
41
4
|
readonly directManifestNode: true;
|
|
42
|
-
readonly allowedChildren: readonly ["TextInput"];
|
|
5
|
+
readonly allowedChildren: readonly ["Checkbox", "CheckboxGroup", "RadioGroup", "TextInput"];
|
|
43
6
|
readonly blueprint: {
|
|
44
7
|
readonly label: "Form field";
|
|
45
8
|
readonly defaultProps: {
|
|
46
9
|
readonly label: "Label";
|
|
47
10
|
};
|
|
48
11
|
};
|
|
12
|
+
readonly bindings: {
|
|
13
|
+
readonly props: {
|
|
14
|
+
readonly errorText: {
|
|
15
|
+
readonly label: "Error text";
|
|
16
|
+
readonly description: "Field-level validation error.";
|
|
17
|
+
readonly value: {
|
|
18
|
+
readonly type: "unknown";
|
|
19
|
+
};
|
|
20
|
+
readonly acceptsFallback: true;
|
|
21
|
+
};
|
|
22
|
+
readonly disabled: {
|
|
23
|
+
readonly label: "Disabled";
|
|
24
|
+
readonly description: "Whether the field is disabled.";
|
|
25
|
+
readonly value: {
|
|
26
|
+
readonly type: "boolean";
|
|
27
|
+
};
|
|
28
|
+
readonly acceptsFallback: true;
|
|
29
|
+
readonly acceptsTransforms: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
49
33
|
readonly props: {
|
|
50
34
|
readonly label: {
|
|
51
35
|
readonly type: "string";
|
|
@@ -63,6 +47,11 @@ export declare const formFieldMeta: {
|
|
|
63
47
|
readonly category: "Content";
|
|
64
48
|
readonly label: "Helper text";
|
|
65
49
|
};
|
|
50
|
+
readonly errorText: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly category: "Validation";
|
|
53
|
+
readonly label: "Error text";
|
|
54
|
+
};
|
|
66
55
|
readonly required: {
|
|
67
56
|
readonly type: "boolean";
|
|
68
57
|
readonly category: "Validation";
|
|
@@ -89,4 +78,4 @@ export declare const formFieldMeta: {
|
|
|
89
78
|
};
|
|
90
79
|
};
|
|
91
80
|
};
|
|
92
|
-
//# sourceMappingURL=
|
|
81
|
+
//# sourceMappingURL=formFieldMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formFieldMeta.d.ts","sourceRoot":"","sources":["../../../src/features/form/formFieldMeta.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCY,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const formFieldMeta = {
|
|
2
|
+
name: 'FormField',
|
|
3
|
+
category: 'component',
|
|
4
|
+
directManifestNode: true,
|
|
5
|
+
allowedChildren: ['Checkbox', 'CheckboxGroup', 'RadioGroup', 'TextInput'],
|
|
6
|
+
blueprint: { label: 'Form field', defaultProps: { label: 'Label' } },
|
|
7
|
+
bindings: {
|
|
8
|
+
props: {
|
|
9
|
+
errorText: {
|
|
10
|
+
label: 'Error text',
|
|
11
|
+
description: 'Field-level validation error.',
|
|
12
|
+
value: { type: 'unknown' },
|
|
13
|
+
acceptsFallback: true,
|
|
14
|
+
},
|
|
15
|
+
disabled: {
|
|
16
|
+
label: 'Disabled',
|
|
17
|
+
description: 'Whether the field is disabled.',
|
|
18
|
+
value: { type: 'boolean' },
|
|
19
|
+
acceptsFallback: true,
|
|
20
|
+
acceptsTransforms: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
label: { type: 'string', category: 'Content', label: 'Label', default: 'Label' },
|
|
26
|
+
description: { type: 'string', category: 'Content', label: 'Description' },
|
|
27
|
+
helperText: { type: 'string', category: 'Content', label: 'Helper text' },
|
|
28
|
+
errorText: { type: 'string', category: 'Validation', label: 'Error text' },
|
|
29
|
+
required: { type: 'boolean', category: 'Validation', label: 'Required', default: false },
|
|
30
|
+
invalid: { type: 'boolean', category: 'Validation', label: 'Invalid', default: false },
|
|
31
|
+
disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
|
|
32
|
+
readOnly: { type: 'boolean', category: 'State', label: 'Read-only', default: false },
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=formFieldMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formFieldMeta.js","sourceRoot":"","sources":["../../../src/features/form/formFieldMeta.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,CAAC;IACzE,SAAS,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IACpE,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,SAAS,EAAE;gBACT,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,+BAA+B;gBAC5C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC1B,eAAe,EAAE,IAAI;aACtB;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,gCAAgC;gBAC7C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC1B,eAAe,EAAE,IAAI;gBACrB,iBAAiB,EAAE,IAAI;aACxB;SACF;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;QAChF,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE;QAC1E,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE;QACzE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;QAC1E,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE;QACxF,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;QACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE;QACnF,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE;KACrF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nexport const formFieldMeta = {\n name: 'FormField',\n category: 'component',\n directManifestNode: true,\n allowedChildren: ['Checkbox', 'CheckboxGroup', 'RadioGroup', 'TextInput'],\n blueprint: { label: 'Form field', defaultProps: { label: 'Label' } },\n bindings: {\n props: {\n errorText: {\n label: 'Error text',\n description: 'Field-level validation error.',\n value: { type: 'unknown' },\n acceptsFallback: true,\n },\n disabled: {\n label: 'Disabled',\n description: 'Whether the field is disabled.',\n value: { type: 'boolean' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n },\n props: {\n label: { type: 'string', category: 'Content', label: 'Label', default: 'Label' },\n description: { type: 'string', category: 'Content', label: 'Description' },\n helperText: { type: 'string', category: 'Content', label: 'Helper text' },\n errorText: { type: 'string', category: 'Validation', label: 'Error text' },\n required: { type: 'boolean', category: 'Validation', label: 'Required', default: false },\n invalid: { type: 'boolean', category: 'Validation', label: 'Invalid', default: false },\n disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },\n readOnly: { type: 'boolean', category: 'State', label: 'Read-only', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare const formMeta: {
|
|
2
|
+
readonly name: "Form";
|
|
3
|
+
readonly category: "component";
|
|
4
|
+
readonly directManifestNode: true;
|
|
5
|
+
readonly allowedChildren: readonly ["FormError", "FormField"];
|
|
6
|
+
readonly blueprint: {
|
|
7
|
+
readonly label: "Form";
|
|
8
|
+
readonly defaultProps: {
|
|
9
|
+
readonly submitLabel: "Submit";
|
|
10
|
+
readonly loading: false;
|
|
11
|
+
readonly disabled: false;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly bindings: {
|
|
15
|
+
readonly events: {
|
|
16
|
+
readonly submit: {
|
|
17
|
+
readonly label: "Submit";
|
|
18
|
+
readonly description: "Runs when the form is submitted.";
|
|
19
|
+
readonly payload: {
|
|
20
|
+
readonly eventType: "form.submit";
|
|
21
|
+
readonly fields: readonly [];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly events: {
|
|
27
|
+
readonly submit: {
|
|
28
|
+
readonly label: "Submit";
|
|
29
|
+
readonly eventType: "form.submit";
|
|
30
|
+
readonly description: "Emitted when the form is submitted.";
|
|
31
|
+
readonly payloadFields: readonly [];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly slots: {
|
|
35
|
+
readonly actions: {
|
|
36
|
+
readonly label: "Actions";
|
|
37
|
+
readonly allowedChildren: readonly ["Button", "ButtonGroup"];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
readonly props: {
|
|
41
|
+
readonly submitLabel: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly category: "Content";
|
|
44
|
+
readonly label: "Submit label";
|
|
45
|
+
readonly default: "Submit";
|
|
46
|
+
};
|
|
47
|
+
readonly loading: {
|
|
48
|
+
readonly type: "boolean";
|
|
49
|
+
readonly category: "State";
|
|
50
|
+
readonly label: "Loading";
|
|
51
|
+
readonly default: false;
|
|
52
|
+
};
|
|
53
|
+
readonly disabled: {
|
|
54
|
+
readonly type: "boolean";
|
|
55
|
+
readonly category: "State";
|
|
56
|
+
readonly label: "Disabled";
|
|
57
|
+
readonly default: false;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=formMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formMeta.d.ts","sourceRoot":"","sources":["../../../src/features/form/formMeta.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCiB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const formMeta = {
|
|
2
|
+
name: 'Form',
|
|
3
|
+
category: 'component',
|
|
4
|
+
directManifestNode: true,
|
|
5
|
+
allowedChildren: ['FormError', 'FormField'],
|
|
6
|
+
blueprint: {
|
|
7
|
+
label: 'Form',
|
|
8
|
+
defaultProps: { submitLabel: 'Submit', loading: false, disabled: false },
|
|
9
|
+
},
|
|
10
|
+
bindings: {
|
|
11
|
+
events: {
|
|
12
|
+
submit: {
|
|
13
|
+
label: 'Submit',
|
|
14
|
+
description: 'Runs when the form is submitted.',
|
|
15
|
+
payload: { eventType: 'form.submit', fields: [] },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
events: {
|
|
20
|
+
submit: {
|
|
21
|
+
label: 'Submit',
|
|
22
|
+
eventType: 'form.submit',
|
|
23
|
+
description: 'Emitted when the form is submitted.',
|
|
24
|
+
payloadFields: [],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
slots: { actions: { label: 'Actions', allowedChildren: ['Button', 'ButtonGroup'] } },
|
|
28
|
+
props: {
|
|
29
|
+
submitLabel: { type: 'string', category: 'Content', label: 'Submit label', default: 'Submit' },
|
|
30
|
+
loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },
|
|
31
|
+
disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=formMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formMeta.js","sourceRoot":"","sources":["../../../src/features/form/formMeta.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IAC3C,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;KACzE;IACD,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,kCAAkC;gBAC/C,OAAO,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,EAAE;aAClD;SACF;KACF;IACD,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,qCAAqC;YAClD,aAAa,EAAE,EAAE;SAClB;KACF;IACD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE;IACpF,KAAK,EAAE;QACL,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9F,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;QACjF,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE;KACpF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nexport const formMeta = {\n name: 'Form',\n category: 'component',\n directManifestNode: true,\n allowedChildren: ['FormError', 'FormField'],\n blueprint: {\n label: 'Form',\n defaultProps: { submitLabel: 'Submit', loading: false, disabled: false },\n },\n bindings: {\n events: {\n submit: {\n label: 'Submit',\n description: 'Runs when the form is submitted.',\n payload: { eventType: 'form.submit', fields: [] },\n },\n },\n },\n events: {\n submit: {\n label: 'Submit',\n eventType: 'form.submit',\n description: 'Emitted when the form is submitted.',\n payloadFields: [],\n },\n },\n slots: { actions: { label: 'Actions', allowedChildren: ['Button', 'ButtonGroup'] } },\n props: {\n submitLabel: { type: 'string', category: 'Content', label: 'Submit label', default: 'Submit' },\n loading: { type: 'boolean', category: 'State', label: 'Loading', default: false },\n disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { FormActionsProps, FormErrorProps, FormErrors, FormFieldConfig, FormFieldInputType, FormFieldProps, FormProps, FormValidationErrors, FormValidationResult, FormValues, UseFormControllerOptions, UseFormControllerResult, ValidationRule, } from '../../types/form';
|
|
2
|
+
export { Form } from './adapters/inbound/Form';
|
|
3
|
+
export { FormActions } from './adapters/inbound/FormActions';
|
|
4
|
+
export { FormError } from './adapters/inbound/FormError';
|
|
5
|
+
export { FormField } from './adapters/inbound/FormField';
|
|
6
|
+
export { useFormController } from './useFormController';
|
|
7
|
+
export { hasRequiredRule, validateField, validateFields, validateValue } from './utils/validation';
|
|
8
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/form/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,wBAAwB,EACxB,uBAAuB,EACvB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Form } from './adapters/inbound/Form';
|
|
2
|
+
export { FormActions } from './adapters/inbound/FormActions';
|
|
3
|
+
export { FormError } from './adapters/inbound/FormError';
|
|
4
|
+
export { FormField } from './adapters/inbound/FormField';
|
|
5
|
+
export { useFormController } from './useFormController';
|
|
6
|
+
export { hasRequiredRule, validateField, validateFields, validateValue } from './utils/validation';
|
|
7
|
+
//# sourceMappingURL=public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/form/public.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export type {\n FormActionsProps,\n FormErrorProps,\n FormErrors,\n FormFieldConfig,\n FormFieldInputType,\n FormFieldProps,\n FormProps,\n FormValidationErrors,\n FormValidationResult,\n FormValues,\n UseFormControllerOptions,\n UseFormControllerResult,\n ValidationRule,\n} from '../../types/form';\nexport { Form } from './adapters/inbound/Form';\nexport { FormActions } from './adapters/inbound/FormActions';\nexport { FormError } from './adapters/inbound/FormError';\nexport { FormField } from './adapters/inbound/FormField';\nexport { useFormController } from './useFormController';\nexport { hasRequiredRule, validateField, validateFields, validateValue } from './utils/validation';\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { UseFormControllerOptions, UseFormControllerResult } from '
|
|
1
|
+
import type { UseFormControllerOptions, UseFormControllerResult } from '../../types/form';
|
|
2
2
|
export declare function useFormController<TName extends string = string>({ fields, initialValues, values: controlledValues, errors: externalErrors, onChange, onSubmit, validateOnChange, }: UseFormControllerOptions<TName>): UseFormControllerResult<TName>;
|
|
3
3
|
//# sourceMappingURL=useFormController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormController.d.ts","sourceRoot":"","sources":["../../../src/features/form/useFormController.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAe1B,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,EAC/D,MAAM,EACN,aAAa,EACb,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,cAAc,EACtB,QAAQ,EACR,QAAQ,EACR,gBAAwB,GACzB,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CA4ElE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { validateFields } from './validation';
|
|
2
|
+
import { validateFields } from './utils/validation';
|
|
3
3
|
function createInitialValues(fields, initialValues) {
|
|
4
4
|
const values = fields.reduce((nextValues, field) => {
|
|
5
5
|
nextValues[field.name] = initialValues?.[field.name] ?? '';
|