@ankhorage/zora 8.0.0 → 9.0.1
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 +12 -0
- package/README.md +1 -1
- package/dist/components/form/FormField.js +2 -2
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/meta.d.ts +1 -1
- package/dist/components/form/meta.js +1 -1
- package/dist/components/form/meta.js.map +1 -1
- package/dist/components/form/types.d.ts +6 -6
- package/dist/components/form/types.d.ts.map +1 -1
- package/dist/components/form/types.js.map +1 -1
- package/dist/components/search-bar/SearchBar.js +2 -2
- package/dist/components/search-bar/SearchBar.js.map +1 -1
- package/dist/features/activity-indicator/activityIndicatorMeta.d.ts +32 -0
- package/dist/features/activity-indicator/activityIndicatorMeta.d.ts.map +1 -0
- package/dist/features/activity-indicator/activityIndicatorMeta.js +13 -0
- package/dist/features/activity-indicator/activityIndicatorMeta.js.map +1 -0
- package/dist/features/activity-indicator/adapters/inbound/ActivityIndicator.d.ts +5 -0
- package/dist/features/activity-indicator/adapters/inbound/ActivityIndicator.d.ts.map +1 -0
- package/dist/features/activity-indicator/adapters/inbound/ActivityIndicator.js +12 -0
- package/dist/features/activity-indicator/adapters/inbound/ActivityIndicator.js.map +1 -0
- package/dist/features/activity-indicator/public.d.ts +3 -0
- package/dist/features/activity-indicator/public.d.ts.map +1 -0
- package/dist/features/activity-indicator/public.js +2 -0
- package/dist/features/activity-indicator/public.js.map +1 -0
- 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/{patterns/empty-state → features/empty-state/adapters/inbound}/EmptyState.d.ts +1 -1
- package/dist/features/empty-state/adapters/inbound/EmptyState.d.ts.map +1 -0
- package/dist/{patterns/empty-state → features/empty-state/adapters/inbound}/EmptyState.js +4 -4
- package/dist/features/empty-state/adapters/inbound/EmptyState.js.map +1 -0
- package/dist/{patterns/empty-state/meta.d.ts → features/empty-state/emptyStateMeta.d.ts} +1 -1
- package/dist/features/empty-state/emptyStateMeta.d.ts.map +1 -0
- package/dist/{patterns/empty-state/meta.js → features/empty-state/emptyStateMeta.js} +1 -1
- package/dist/features/empty-state/emptyStateMeta.js.map +1 -0
- package/dist/features/empty-state/public.d.ts +3 -0
- package/dist/features/empty-state/public.d.ts.map +1 -0
- package/dist/features/empty-state/public.js +2 -0
- package/dist/features/empty-state/public.js.map +1 -0
- package/dist/{components/checkbox → features/form/checkbox/adapters/inbound}/Checkbox.d.ts +1 -1
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.d.ts.map +1 -0
- package/dist/{components/checkbox → features/form/checkbox/adapters/inbound}/Checkbox.js +1 -1
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js.map +1 -0
- package/dist/{components/checkbox → features/form/checkbox/adapters/inbound}/CheckboxGroup.d.ts +1 -1
- package/dist/features/form/checkbox/adapters/inbound/CheckboxGroup.d.ts.map +1 -0
- package/dist/{components/checkbox → features/form/checkbox/adapters/inbound}/CheckboxGroup.js +3 -3
- package/dist/features/form/checkbox/adapters/inbound/CheckboxGroup.js.map +1 -0
- package/dist/features/form/checkbox/checkboxMeta.d.ts +67 -0
- package/dist/features/form/checkbox/checkboxMeta.d.ts.map +1 -0
- package/dist/features/form/checkbox/checkboxMeta.js +28 -0
- package/dist/features/form/checkbox/checkboxMeta.js.map +1 -0
- package/dist/features/form/checkbox/public.d.ts +4 -0
- package/dist/features/form/checkbox/public.d.ts.map +1 -0
- package/dist/features/form/checkbox/public.js +3 -0
- package/dist/features/form/checkbox/public.js.map +1 -0
- package/dist/{components/radio → features/form/radio/adapters/inbound}/Radio.d.ts +1 -1
- package/dist/features/form/radio/adapters/inbound/Radio.d.ts.map +1 -0
- package/dist/{components/radio → features/form/radio/adapters/inbound}/Radio.js +1 -1
- package/dist/features/form/radio/adapters/inbound/Radio.js.map +1 -0
- package/dist/{components/radio → features/form/radio/adapters/inbound}/RadioGroup.d.ts +1 -1
- package/dist/features/form/radio/adapters/inbound/RadioGroup.d.ts.map +1 -0
- package/dist/{components/radio → features/form/radio/adapters/inbound}/RadioGroup.js +5 -5
- package/dist/features/form/radio/adapters/inbound/RadioGroup.js.map +1 -0
- package/dist/{components/radio → features/form/radio/adapters/inbound}/RadioOptionControl.d.ts +1 -1
- package/dist/features/form/radio/adapters/inbound/RadioOptionControl.d.ts.map +1 -0
- package/dist/{components/radio → features/form/radio/adapters/inbound}/RadioOptionControl.js +4 -4
- package/dist/features/form/radio/adapters/inbound/RadioOptionControl.js.map +1 -0
- package/dist/features/form/radio/public.d.ts +4 -0
- package/dist/features/form/radio/public.d.ts.map +1 -0
- package/dist/features/form/radio/public.js +3 -0
- package/dist/features/form/radio/public.js.map +1 -0
- package/dist/{components/radio/meta.d.ts → features/form/radio/radioMeta.d.ts} +28 -4
- package/dist/features/form/radio/radioMeta.d.ts.map +1 -0
- package/dist/{components/radio/meta.js → features/form/radio/radioMeta.js} +9 -5
- package/dist/features/form/radio/radioMeta.js.map +1 -0
- package/dist/features/form/radio/themeRecipeMeta.d.ts.map +1 -0
- package/dist/{components → features/form}/radio/themeRecipeMeta.js +1 -1
- package/dist/features/form/radio/themeRecipeMeta.js.map +1 -0
- package/dist/features/form/radio/utils/handleRadioOptionKeyDown.d.ts.map +1 -0
- package/dist/{components/radio → features/form/radio/utils}/handleRadioOptionKeyDown.js +1 -1
- package/dist/features/form/radio/utils/handleRadioOptionKeyDown.js.map +1 -0
- package/dist/{components/radio → features/form/radio/utils}/resolveRadioGroupThemeRecipe.d.ts +2 -2
- package/dist/features/form/radio/utils/resolveRadioGroupThemeRecipe.d.ts.map +1 -0
- package/dist/features/form/radio/utils/resolveRadioGroupThemeRecipe.js.map +1 -0
- package/dist/{components/radio → features/form/radio/utils}/resolveRadioOptionColors.d.ts +1 -1
- package/dist/features/form/radio/utils/resolveRadioOptionColors.d.ts.map +1 -0
- package/dist/features/form/radio/utils/resolveRadioOptionColors.js.map +1 -0
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts +14 -0
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -0
- package/dist/{components/input/Input.js → features/form/text-input/adapters/inbound/TextInput.js} +9 -10
- package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -0
- package/dist/features/form/text-input/public.d.ts +3 -0
- package/dist/features/form/text-input/public.d.ts.map +1 -0
- package/dist/features/form/text-input/public.js +2 -0
- package/dist/features/form/text-input/public.js.map +1 -0
- package/dist/{components/input/meta.d.ts → features/form/text-input/textInputMeta.d.ts} +16 -4
- package/dist/features/form/text-input/textInputMeta.d.ts.map +1 -0
- package/dist/{components/input/meta.js → features/form/text-input/textInputMeta.js} +16 -4
- package/dist/features/form/text-input/textInputMeta.js.map +1 -0
- 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/{components/progress → features/progress/adapters/inbound}/Progress.d.ts +1 -1
- package/dist/features/progress/adapters/inbound/Progress.d.ts.map +1 -0
- package/dist/{components/progress → features/progress/adapters/inbound}/Progress.js +5 -5
- package/dist/features/progress/adapters/inbound/Progress.js.map +1 -0
- package/dist/{components/progress → features/progress/adapters/inbound}/ProgressRing.d.ts +1 -1
- package/dist/features/progress/adapters/inbound/ProgressRing.d.ts.map +1 -0
- package/dist/{components/progress → features/progress/adapters/inbound}/ProgressRing.js +7 -7
- package/dist/features/progress/adapters/inbound/ProgressRing.js.map +1 -0
- package/dist/{components/progress/meta.d.ts → features/progress/progressMeta.d.ts} +1 -1
- package/dist/features/progress/progressMeta.d.ts.map +1 -0
- package/dist/{components/progress/meta.js → features/progress/progressMeta.js} +1 -1
- package/dist/features/progress/progressMeta.js.map +1 -0
- package/dist/features/progress/public.d.ts +4 -0
- package/dist/features/progress/public.d.ts.map +1 -0
- package/dist/features/progress/public.js +3 -0
- package/dist/features/progress/public.js.map +1 -0
- package/dist/features/progress/utils/resolveProgressFraction.d.ts.map +1 -0
- package/dist/features/progress/utils/resolveProgressFraction.js.map +1 -0
- package/dist/features/progress/utils/resolveProgressRingGeometry.d.ts.map +1 -0
- package/dist/features/progress/utils/resolveProgressRingGeometry.js.map +1 -0
- package/dist/features/splash-screen/splashScreenMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- 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 +6 -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 +2 -2
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +9 -76
- package/dist/metadata/bindableComponentMeta.d.ts.map +1 -1
- package/dist/metadata/bindableComponentMeta.js +7 -62
- package/dist/metadata/bindableComponentMeta.js.map +1 -1
- package/dist/metadata/componentMeta.js +8 -8
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/metadata/themeRecipeMeta.js +1 -1
- package/dist/metadata/themeRecipeMeta.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/ReaderSurface.js +1 -1
- package/dist/patterns/reader/ReaderSurface.js.map +1 -1
- package/dist/patterns/reader/meta.d.ts +2 -2
- package/dist/patterns/scanner/meta.d.ts +2 -2
- package/dist/patterns/theme-composer/ThemeComposer.js +3 -3
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/registry.js +8 -8
- package/dist/registry.js.map +1 -1
- package/dist/types/activity-indicator.d.ts +6 -0
- package/dist/types/activity-indicator.d.ts.map +1 -0
- package/dist/types/activity-indicator.js +2 -0
- package/dist/types/activity-indicator.js.map +1 -0
- package/dist/{components/checkbox/types.d.ts → types/checkbox.d.ts} +2 -2
- package/dist/types/checkbox.d.ts.map +1 -0
- package/dist/types/checkbox.js +2 -0
- package/dist/types/checkbox.js.map +1 -0
- package/dist/{patterns/empty-state/types.d.ts → types/empty-state.d.ts} +3 -3
- package/dist/types/empty-state.d.ts.map +1 -0
- package/dist/types/empty-state.js +2 -0
- package/dist/types/empty-state.js.map +1 -0
- package/dist/{components/progress/types.d.ts → types/progress.d.ts} +3 -3
- package/dist/types/progress.d.ts.map +1 -0
- package/dist/{components/progress/types.js → types/progress.js} +1 -1
- package/dist/types/progress.js.map +1 -0
- package/dist/{components/radio/types.d.ts → types/radio.d.ts} +3 -3
- package/dist/types/radio.d.ts.map +1 -0
- package/dist/types/radio.js +2 -0
- package/dist/types/radio.js.map +1 -0
- package/dist/types/text-input.d.ts +22 -0
- package/dist/types/text-input.d.ts.map +1 -0
- package/dist/types/text-input.js +2 -0
- package/dist/types/text-input.js.map +1 -0
- package/package.json +1 -1
- package/src/audit.test.ts +1 -1
- package/src/components/form/FormField.tsx +2 -2
- package/src/components/form/meta.ts +1 -1
- package/src/components/form/types.ts +6 -6
- package/src/components/search-bar/SearchBar.tsx +3 -3
- package/src/features/activity-indicator/activityIndicatorMeta.ts +14 -0
- package/src/features/activity-indicator/adapters/inbound/ActivityIndicator.tsx +21 -0
- package/src/features/activity-indicator/public.ts +2 -0
- package/src/features/data-table/adapters/inbound/DataTable.tsx +1 -1
- package/src/{patterns/empty-state → features/empty-state/adapters/inbound}/EmptyState.tsx +5 -5
- package/src/features/empty-state/public.ts +2 -0
- package/src/{components/checkbox → features/form/checkbox/adapters/inbound}/Checkbox.tsx +2 -2
- package/src/{components/checkbox → features/form/checkbox/adapters/inbound}/CheckboxGroup.tsx +4 -4
- package/src/features/form/checkbox/checkboxMeta.ts +30 -0
- package/src/features/form/checkbox/public.ts +7 -0
- package/src/{components/radio → features/form/radio/adapters/inbound}/Radio.tsx +2 -2
- package/src/{components/radio → features/form/radio/adapters/inbound}/RadioGroup.test.ts +3 -3
- package/src/{components/radio → features/form/radio/adapters/inbound}/RadioGroup.tsx +6 -6
- package/src/{components/radio → features/form/radio/adapters/inbound}/RadioOptionControl.tsx +5 -5
- package/src/features/form/radio/public.ts +3 -0
- package/src/{components/radio/meta.ts → features/form/radio/radioMeta.ts} +9 -5
- package/src/{components → features/form}/radio/themeRecipeMeta.ts +2 -2
- package/src/{components/radio → features/form/radio/utils}/handleRadioOptionKeyDown.test.ts +1 -1
- package/src/{components/radio → features/form/radio/utils}/handleRadioOptionKeyDown.ts +1 -1
- package/src/{components/radio → features/form/radio/utils}/resolveRadioGroupThemeRecipe.ts +2 -2
- package/src/{components/radio → features/form/radio/utils}/resolveRadioOptionColors.ts +1 -1
- package/src/{components/input/Input.tsx → features/form/text-input/adapters/inbound/TextInput.tsx} +10 -11
- package/src/features/form/text-input/public.ts +2 -0
- package/src/{components/input/meta.ts → features/form/text-input/textInputMeta.ts} +16 -4
- package/src/{components/progress → features/progress/adapters/inbound}/Progress.tsx +5 -5
- package/src/{components/progress → features/progress/adapters/inbound}/ProgressRing.test.ts +9 -6
- package/src/{components/progress → features/progress/adapters/inbound}/ProgressRing.tsx +7 -7
- package/src/features/progress/public.ts +3 -0
- package/src/features/uploader/adapters/inbound/Uploader.tsx +1 -1
- package/src/index.ts +34 -12
- package/src/interactionPolicy.test.ts +2 -2
- package/src/metadata/allowedChildren.ts +2 -2
- package/src/metadata/bindableComponentMeta.test.ts +1 -1
- package/src/metadata/bindableComponentMeta.ts +7 -62
- package/src/metadata/componentMeta.test.ts +5 -2
- package/src/metadata/componentMeta.ts +8 -8
- package/src/metadata/themeRecipeMeta.ts +1 -1
- package/src/patterns/reader/ReaderSurface.tsx +1 -1
- package/src/patterns/theme-composer/ThemeComposer.tsx +3 -3
- package/src/registry.ts +8 -8
- package/src/showcaseCoverage.test.ts +1 -2
- package/src/theme/themeScopeStructure.test.ts +12 -14
- package/src/types/activity-indicator.ts +8 -0
- package/src/{components/checkbox/types.ts → types/checkbox.ts} +1 -1
- package/src/{patterns/empty-state/types.ts → types/empty-state.ts} +2 -2
- package/src/{components/progress/types.ts → types/progress.ts} +2 -2
- package/src/{components/radio/types.ts → types/radio.ts} +2 -2
- package/src/{components/input/types.ts → types/text-input.ts} +7 -7
- package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/Checkbox.js.map +0 -1
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +0 -1
- package/dist/components/checkbox/CheckboxGroup.js.map +0 -1
- package/dist/components/checkbox/index.d.ts +0 -4
- package/dist/components/checkbox/index.d.ts.map +0 -1
- package/dist/components/checkbox/index.js +0 -3
- package/dist/components/checkbox/index.js.map +0 -1
- package/dist/components/checkbox/meta.d.ts +0 -17
- package/dist/components/checkbox/meta.d.ts.map +0 -1
- package/dist/components/checkbox/meta.js +0 -17
- package/dist/components/checkbox/meta.js.map +0 -1
- package/dist/components/checkbox/types.d.ts.map +0 -1
- package/dist/components/checkbox/types.js +0 -2
- package/dist/components/checkbox/types.js.map +0 -1
- package/dist/components/input/Input.d.ts +0 -15
- package/dist/components/input/Input.d.ts.map +0 -1
- package/dist/components/input/Input.js.map +0 -1
- package/dist/components/input/index.d.ts +0 -3
- package/dist/components/input/index.d.ts.map +0 -1
- package/dist/components/input/index.js +0 -2
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/input/meta.d.ts.map +0 -1
- package/dist/components/input/meta.js.map +0 -1
- package/dist/components/input/types.d.ts +0 -22
- package/dist/components/input/types.d.ts.map +0 -1
- package/dist/components/input/types.js +0 -2
- package/dist/components/input/types.js.map +0 -1
- package/dist/components/progress/Progress.d.ts.map +0 -1
- package/dist/components/progress/Progress.js.map +0 -1
- package/dist/components/progress/ProgressRing.d.ts.map +0 -1
- package/dist/components/progress/ProgressRing.js.map +0 -1
- package/dist/components/progress/index.d.ts +0 -4
- package/dist/components/progress/index.d.ts.map +0 -1
- package/dist/components/progress/index.js +0 -3
- package/dist/components/progress/index.js.map +0 -1
- package/dist/components/progress/meta.d.ts.map +0 -1
- package/dist/components/progress/meta.js.map +0 -1
- package/dist/components/progress/resolveProgressFraction.d.ts.map +0 -1
- package/dist/components/progress/resolveProgressFraction.js.map +0 -1
- package/dist/components/progress/resolveProgressRingGeometry.d.ts.map +0 -1
- package/dist/components/progress/resolveProgressRingGeometry.js.map +0 -1
- package/dist/components/progress/types.d.ts.map +0 -1
- package/dist/components/progress/types.js.map +0 -1
- package/dist/components/radio/Radio.d.ts.map +0 -1
- package/dist/components/radio/Radio.js.map +0 -1
- package/dist/components/radio/RadioGroup.d.ts.map +0 -1
- package/dist/components/radio/RadioGroup.js.map +0 -1
- package/dist/components/radio/RadioOptionControl.d.ts.map +0 -1
- package/dist/components/radio/RadioOptionControl.js.map +0 -1
- package/dist/components/radio/handleRadioOptionKeyDown.d.ts.map +0 -1
- package/dist/components/radio/handleRadioOptionKeyDown.js.map +0 -1
- package/dist/components/radio/index.d.ts +0 -4
- package/dist/components/radio/index.d.ts.map +0 -1
- package/dist/components/radio/index.js +0 -3
- package/dist/components/radio/index.js.map +0 -1
- package/dist/components/radio/meta.d.ts.map +0 -1
- package/dist/components/radio/meta.js.map +0 -1
- package/dist/components/radio/resolveRadioGroupThemeRecipe.d.ts.map +0 -1
- package/dist/components/radio/resolveRadioGroupThemeRecipe.js.map +0 -1
- package/dist/components/radio/resolveRadioOptionColors.d.ts.map +0 -1
- package/dist/components/radio/resolveRadioOptionColors.js.map +0 -1
- package/dist/components/radio/themeRecipeMeta.d.ts.map +0 -1
- package/dist/components/radio/themeRecipeMeta.js.map +0 -1
- package/dist/components/radio/types.d.ts.map +0 -1
- package/dist/components/radio/types.js +0 -2
- package/dist/components/radio/types.js.map +0 -1
- package/dist/components/textarea/Textarea.d.ts +0 -9
- package/dist/components/textarea/Textarea.d.ts.map +0 -1
- package/dist/components/textarea/Textarea.js +0 -18
- package/dist/components/textarea/Textarea.js.map +0 -1
- package/dist/components/textarea/index.d.ts +0 -3
- package/dist/components/textarea/index.d.ts.map +0 -1
- package/dist/components/textarea/index.js +0 -2
- package/dist/components/textarea/index.js.map +0 -1
- package/dist/components/textarea/meta.d.ts +0 -45
- package/dist/components/textarea/meta.d.ts.map +0 -1
- package/dist/components/textarea/meta.js +0 -45
- package/dist/components/textarea/meta.js.map +0 -1
- package/dist/components/textarea/types.d.ts +0 -9
- package/dist/components/textarea/types.d.ts.map +0 -1
- package/dist/components/textarea/types.js +0 -2
- package/dist/components/textarea/types.js.map +0 -1
- package/dist/patterns/empty-state/EmptyState.d.ts.map +0 -1
- package/dist/patterns/empty-state/EmptyState.js.map +0 -1
- package/dist/patterns/empty-state/index.d.ts +0 -3
- package/dist/patterns/empty-state/index.d.ts.map +0 -1
- package/dist/patterns/empty-state/index.js +0 -2
- package/dist/patterns/empty-state/index.js.map +0 -1
- package/dist/patterns/empty-state/meta.d.ts.map +0 -1
- package/dist/patterns/empty-state/meta.js.map +0 -1
- package/dist/patterns/empty-state/types.d.ts.map +0 -1
- package/dist/patterns/empty-state/types.js +0 -2
- package/dist/patterns/empty-state/types.js.map +0 -1
- package/src/components/checkbox/index.ts +0 -3
- package/src/components/checkbox/meta.ts +0 -19
- package/src/components/input/index.ts +0 -2
- package/src/components/progress/index.ts +0 -3
- package/src/components/radio/index.ts +0 -3
- package/src/components/textarea/Textarea.tsx +0 -46
- package/src/components/textarea/index.ts +0 -2
- package/src/components/textarea/meta.ts +0 -46
- package/src/components/textarea/types.ts +0 -16
- package/src/patterns/empty-state/index.ts +0 -2
- /package/dist/{components → features/form}/radio/themeRecipeMeta.d.ts +0 -0
- /package/dist/{components/radio → features/form/radio/utils}/handleRadioOptionKeyDown.d.ts +0 -0
- /package/dist/{components/radio → features/form/radio/utils}/resolveRadioGroupThemeRecipe.js +0 -0
- /package/dist/{components/radio → features/form/radio/utils}/resolveRadioOptionColors.js +0 -0
- /package/dist/{components/progress → features/progress/utils}/resolveProgressFraction.d.ts +0 -0
- /package/dist/{components/progress → features/progress/utils}/resolveProgressFraction.js +0 -0
- /package/dist/{components/progress → features/progress/utils}/resolveProgressRingGeometry.d.ts +0 -0
- /package/dist/{components/progress → features/progress/utils}/resolveProgressRingGeometry.js +0 -0
- /package/src/{patterns/empty-state/meta.ts → features/empty-state/emptyStateMeta.ts} +0 -0
- /package/src/{components/radio → features/form/radio/utils}/resolveRadioOptionColors.test.ts +0 -0
- /package/src/{components/progress/meta.ts → features/progress/progressMeta.ts} +0 -0
- /package/src/{components/progress → features/progress/utils}/resolveProgressFraction.test.ts +0 -0
- /package/src/{components/progress → features/progress/utils}/resolveProgressFraction.ts +0 -0
- /package/src/{components/progress → features/progress/utils}/resolveProgressRingGeometry.test.ts +0 -0
- /package/src/{components/progress → features/progress/utils}/resolveProgressRingGeometry.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../../../../src/features/empty-state/adapters/inbound/EmptyState.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,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,KAAK,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AK,CAAC,CAAC,eAAe,CAAC,KAAK,IAAI,SAAS,CAAC,CAE1C;gBAAA,CAAC,eAAe,CAAC,KAAK,CACxB;cAAA,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,EAAE,KAAK,CAAC,CACT,CAAC,CAAC,CAAC,IAAI,CACR;QAAA,CAAC,MAAM,CACT;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { EmptyStateProps } from '../../../../types/empty-state';\nimport { Button } from '../../../button/public';\nimport { Card } from '../../../card/public';\nimport { Stack } from '../../../layout/public';\n\nfunction EmptyStateInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n title,\n description,\n eyebrow,\n primaryAction,\n secondaryAction,\n footer,\n testID,\n}: EmptyStateProps) {\n return (\n <Card\n compact\n description={description}\n eyebrow={eyebrow}\n interactionPolicy={interactionPolicy}\n testID={testID}\n title={title}\n tone=\"subtle\"\n >\n <Stack gap=\"m\">\n {primaryAction || secondaryAction ? (\n <Stack direction={{ base: 'column', md: 'row' }} gap=\"s\">\n {primaryAction ? (\n <Button\n interactionPolicy={interactionPolicy}\n variant={primaryAction.variant}\n onPress={primaryAction.onPress}\n color={primaryAction.color}\n >\n {primaryAction.label}\n </Button>\n ) : null}\n {secondaryAction ? (\n <Button\n interactionPolicy={interactionPolicy}\n variant={secondaryAction.variant ?? 'soft'}\n onPress={secondaryAction.onPress}\n color={secondaryAction.color ?? 'neutral'}\n >\n {secondaryAction.label}\n </Button>\n ) : null}\n </Stack>\n ) : null}\n {footer}\n </Stack>\n </Card>\n );\n}\n\n/***\n * Reusable fallback state for empty lists, missing data, or first-run experiences.\n *\n * `EmptyState` combines concise copy with optional primary and secondary actions\n * so apps can guide users without custom card and button wiring.\n *\n \n * @example Empty project list\n * ```tsx\n * <EmptyState title=\"No projects yet\" primaryAction={{ label: 'Create project', onPress }} />\n * ```\n */\nexport const EmptyState = withZoraThemeScope(EmptyStateInner);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emptyStateMeta.d.ts","sourceRoot":"","sources":["../../../src/features/empty-state/emptyStateMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emptyStateMeta.js","sourceRoot":"","sources":["../../../src/features/empty-state/emptyStateMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,SAAS;IACnB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,aAAa;QACpB,YAAY,EAAE;YACZ,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,6BAA6B;SAC3C;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,kBAAkB;SAC5B;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,6BAA6B;SACvC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,SAAS;SACjB;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const emptyStateMeta = {\n name: 'EmptyState',\n category: 'pattern',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Empty state',\n defaultProps: {\n title: 'Nothing here yet',\n description: 'Try adding your first item.',\n },\n },\n props: {\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Nothing here yet',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n default: 'Try adding your first item.',\n },\n eyebrow: {\n type: 'string',\n category: 'Content',\n label: 'Eyebrow',\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/empty-state/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/empty-state/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["export type { EmptyStateAction, EmptyStateProps } from '../../types/empty-state';\nexport { EmptyState } from './adapters/inbound/EmptyState';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/checkbox/adapters/inbound/Checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAWnE;;;;GAIG;AACH,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Checkbox as SurfaceCheckbox } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { withZoraThemeScope } from '
|
|
3
|
+
import { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';
|
|
4
4
|
function CheckboxInner({ themeId: _themeId, mode: _mode, interactionPolicy, ...props }) {
|
|
5
5
|
return <SurfaceCheckbox {...props} interactionPolicy={interactionPolicy}/>;
|
|
6
6
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../../../src/features/form/checkbox/adapters/inbound/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,SAAS,aAAa,CAAC,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,iBAAiB,EACjB,GAAG,KAAK,EACM;IACd,OAAO,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EAAG,CAAC;AAC9E,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Checkbox as SurfaceCheckbox } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';\nimport type { CheckboxProps } from '../../../../../types/checkbox';\n\nfunction CheckboxInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n ...props\n}: CheckboxProps) {\n return <SurfaceCheckbox {...props} interactionPolicy={interactionPolicy} />;\n}\n\n/***\n * Binary selection control for toggling a value on or off.\n *\n \n */\nexport const Checkbox = withZoraThemeScope(CheckboxInner);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/checkbox/adapters/inbound/CheckboxGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAuB,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAwD7F;;GAEG;AACH,eAAO,MAAM,aAAa,GAvDE,MAAM,SAAS,MAAM,iEAuDkB,CAAC"}
|
package/dist/{components/checkbox → features/form/checkbox/adapters/inbound}/CheckboxGroup.js
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Checkbox } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';
|
|
5
|
+
import { Stack } from '../../../../layout/public';
|
|
6
|
+
import { Text } from '../../../../typography/public';
|
|
7
7
|
function CheckboxGroupInner({ themeId: _themeId, mode: _mode, value, onValueChange, options, orientation = 'vertical', gap = 's', color = 'primary', size = 'm', invalid = false, readOnly = false, disabled = false, testID, interactionPolicy, }) {
|
|
8
8
|
const selectedValues = new Set(value);
|
|
9
9
|
const isHorizontal = orientation === 'horizontal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.js","sourceRoot":"","sources":["../../../../../../src/features/form/checkbox/adapters/inbound/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,SAAS,kBAAkB,CAAwB,EACjD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,aAAa,EACb,OAAO,EACP,WAAW,GAAG,UA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AAI,CACb;QAAA,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAC1B;QAAA,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CACpB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CACtC;YAAA,CAAC,MAAM,CAAC,WAAW,CACrB;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,QAAQ,CAAC,CACZ,CAAC;AACJ,CAAC","sourcesContent":["import { Checkbox } from '@ankhorage/surface';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';\nimport type { CheckboxGroupOption, CheckboxGroupProps } from '../../../../../types/checkbox';\nimport { Stack } from '../../../../layout/public';\nimport { Text } from '../../../../typography/public';\n\nfunction CheckboxGroupInner<TValue extends string>({\n themeId: _themeId,\n mode: _mode,\n value,\n onValueChange,\n options,\n orientation = 'vertical',\n gap = 's',\n color = 'primary',\n size = 'm',\n invalid = false,\n readOnly = false,\n disabled = false,\n testID,\n interactionPolicy,\n}: CheckboxGroupProps<TValue>) {\n const selectedValues = new Set(value);\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <View\n testID={testID}\n style={{\n flexDirection: isHorizontal ? 'row' : 'column',\n flexWrap: isHorizontal ? 'wrap' : 'nowrap',\n }}\n >\n <Stack\n direction={isHorizontal ? 'row' : 'column'}\n gap={gap}\n wrap={isHorizontal ? 'wrap' : 'nowrap'}\n >\n {options.map((option) => (\n <CheckboxGroupItem\n key={option.value}\n option={option}\n checked={selectedValues.has(option.value)}\n disabled={disabled || option.disabled === true}\n invalid={invalid}\n readOnly={readOnly}\n size={size}\n color={color}\n value={value}\n onValueChange={onValueChange}\n interactionPolicy={interactionPolicy}\n />\n ))}\n </Stack>\n </View>\n );\n}\n\n/***\n * Renders a group of checkboxes for multi-select values.\n */\nexport const CheckboxGroup = withZoraThemeScope(CheckboxGroupInner);\n\nfunction CheckboxGroupItem<TValue extends string>({\n option,\n checked,\n disabled,\n invalid,\n readOnly,\n size,\n color,\n value,\n onValueChange,\n interactionPolicy,\n}: {\n option: CheckboxGroupOption<TValue>;\n checked: boolean;\n disabled: boolean;\n invalid: boolean;\n readOnly: boolean;\n size: NonNullable<CheckboxGroupProps<TValue>['size']>;\n color: NonNullable<CheckboxGroupProps<TValue>['color']>;\n value: readonly TValue[];\n onValueChange: (value: TValue[]) => void;\n interactionPolicy: CheckboxGroupProps<TValue>['interactionPolicy'];\n}) {\n const passive = interactionPolicy === 'passive';\n\n return (\n <Checkbox\n interactionPolicy={interactionPolicy}\n checked={checked}\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n size={size}\n color={color}\n testID={option.testID}\n onCheckedChange={(nextChecked) => {\n if (passive) return;\n const nextValue = nextChecked\n ? [...value, option.value]\n : value.filter((currentValue) => currentValue !== option.value);\n\n onValueChange(nextValue);\n }}\n >\n <Stack gap=\"xs\">\n <Text>{option.label}</Text>\n {option.description ? (\n <Text emphasis=\"muted\" variant=\"caption\">\n {option.description}\n </Text>\n ) : null}\n </Stack>\n </Checkbox>\n );\n}\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const checkboxMeta: {
|
|
2
|
+
readonly name: "Checkbox";
|
|
3
|
+
readonly category: "component";
|
|
4
|
+
readonly directManifestNode: true;
|
|
5
|
+
readonly allowedChildren: readonly [];
|
|
6
|
+
readonly blueprint: {
|
|
7
|
+
readonly label: "Checkbox";
|
|
8
|
+
readonly defaultProps: {
|
|
9
|
+
readonly label: "Option";
|
|
10
|
+
readonly checked: false;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
readonly props: {
|
|
14
|
+
readonly label: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly category: "Content";
|
|
17
|
+
readonly label: "Label";
|
|
18
|
+
};
|
|
19
|
+
readonly checked: {
|
|
20
|
+
readonly type: "boolean";
|
|
21
|
+
readonly category: "State";
|
|
22
|
+
readonly label: "Checked";
|
|
23
|
+
readonly default: false;
|
|
24
|
+
};
|
|
25
|
+
readonly disabled: {
|
|
26
|
+
readonly type: "boolean";
|
|
27
|
+
readonly category: "State";
|
|
28
|
+
readonly label: "Disabled";
|
|
29
|
+
readonly default: false;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const checkboxGroupMeta: {
|
|
34
|
+
readonly name: "CheckboxGroup";
|
|
35
|
+
readonly category: "component";
|
|
36
|
+
readonly directManifestNode: true;
|
|
37
|
+
readonly allowedChildren: readonly [];
|
|
38
|
+
readonly blueprint: {
|
|
39
|
+
readonly label: "Checkbox group";
|
|
40
|
+
readonly defaultProps: {
|
|
41
|
+
readonly value: readonly [];
|
|
42
|
+
readonly options: readonly [{
|
|
43
|
+
readonly value: "option-a";
|
|
44
|
+
readonly label: "First option";
|
|
45
|
+
}];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly props: {
|
|
49
|
+
readonly value: {
|
|
50
|
+
readonly type: "array";
|
|
51
|
+
readonly category: "State";
|
|
52
|
+
readonly label: "Value";
|
|
53
|
+
};
|
|
54
|
+
readonly options: {
|
|
55
|
+
readonly type: "array";
|
|
56
|
+
readonly category: "Content";
|
|
57
|
+
readonly label: "Options";
|
|
58
|
+
};
|
|
59
|
+
readonly disabled: {
|
|
60
|
+
readonly type: "boolean";
|
|
61
|
+
readonly category: "State";
|
|
62
|
+
readonly label: "Disabled";
|
|
63
|
+
readonly default: false;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=checkboxMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkboxMeta.d.ts","sourceRoot":"","sources":["../../../../src/features/form/checkbox/checkboxMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWa,CAAC;AAEvC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcQ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const checkboxMeta = {
|
|
2
|
+
name: 'Checkbox',
|
|
3
|
+
category: 'component',
|
|
4
|
+
directManifestNode: true,
|
|
5
|
+
allowedChildren: [],
|
|
6
|
+
blueprint: { label: 'Checkbox', defaultProps: { label: 'Option', checked: false } },
|
|
7
|
+
props: {
|
|
8
|
+
label: { type: 'string', category: 'Content', label: 'Label' },
|
|
9
|
+
checked: { type: 'boolean', category: 'State', label: 'Checked', default: false },
|
|
10
|
+
disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export const checkboxGroupMeta = {
|
|
14
|
+
name: 'CheckboxGroup',
|
|
15
|
+
category: 'component',
|
|
16
|
+
directManifestNode: true,
|
|
17
|
+
allowedChildren: [],
|
|
18
|
+
blueprint: {
|
|
19
|
+
label: 'Checkbox group',
|
|
20
|
+
defaultProps: { value: [], options: [{ value: 'option-a', label: 'First option' }] },
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
value: { type: 'array', category: 'State', label: 'Value' },
|
|
24
|
+
options: { type: 'array', category: 'Content', label: 'Options' },
|
|
25
|
+
disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=checkboxMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkboxMeta.js","sourceRoot":"","sources":["../../../../src/features/form/checkbox/checkboxMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,e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\nexport const checkboxMeta = {\n name: 'Checkbox',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Checkbox', defaultProps: { label: 'Option', checked: false } },\n props: {\n label: { type: 'string', category: 'Content', label: 'Label' },\n checked: { type: 'boolean', category: 'State', label: 'Checked', default: false },\n disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n\nexport const checkboxGroupMeta = {\n name: 'CheckboxGroup',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Checkbox group',\n defaultProps: { value: [], options: [{ value: 'option-a', label: 'First option' }] },\n },\n props: {\n value: { type: 'array', category: 'State', label: 'Value' },\n options: { type: 'array', category: 'Content', label: 'Options' },\n disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/features/form/checkbox/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/features/form/checkbox/public.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC","sourcesContent":["export type {\n CheckboxGroupOption,\n CheckboxGroupProps,\n CheckboxProps,\n} from '../../../types/checkbox';\nexport { Checkbox } from './adapters/inbound/Checkbox';\nexport { CheckboxGroup } from './adapters/inbound/CheckboxGroup';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/radio/adapters/inbound/Radio.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAM7D;;GAEG;AACH,eAAO,MAAM,KAAK,kDAAiC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Radio as SurfaceRadio } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { withZoraThemeScope } from '
|
|
3
|
+
import { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';
|
|
4
4
|
function RadioInner({ themeId: _themeId, mode: _mode, interactionPolicy, ...props }) {
|
|
5
5
|
return <SurfaceRadio {...props} interactionPolicy={interactionPolicy}/>;
|
|
6
6
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../../../../src/features/form/radio/adapters/inbound/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,SAAS,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,KAAK,EAAc;IAC7F,OAAO,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EAAG,CAAC;AAC3E,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { Radio as SurfaceRadio } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';\nimport type { RadioProps } from '../../../../../types/radio';\n\nfunction RadioInner({ themeId: _themeId, mode: _mode, interactionPolicy, ...props }: RadioProps) {\n return <SurfaceRadio {...props} interactionPolicy={interactionPolicy} />;\n}\n\n/***\n * Single-choice selection control used within a radio group.\n */\nexport const Radio = withZoraThemeScope(RadioInner);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { RadioGroupProps } from '
|
|
2
|
+
import type { RadioGroupProps } from '../../../../../types/radio';
|
|
3
3
|
/*** Present one controlled single-choice group as inline radios or icon radio options. */
|
|
4
4
|
export declare const RadioGroup: <TValue extends string>(props: RadioGroupProps<TValue>) => React.ReactElement | null;
|
|
5
5
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/radio/adapters/inbound/RadioGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAMlE,0FAA0F;AAC1F,eAAO,MAAM,UAAU,GAGE,MAAM,SAAS,MAAM,8DAHe,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Radio } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useZoraThemeRecipe } from '../../../../../theme/useZoraThemeRecipe';
|
|
5
|
+
import { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';
|
|
6
|
+
import { Stack } from '../../../../layout/public';
|
|
7
|
+
import { Text } from '../../../../typography/public';
|
|
8
|
+
import { resolveRadioGroupThemeRecipe } from '../../utils/resolveRadioGroupThemeRecipe';
|
|
8
9
|
import { RadioOptionControl } from './RadioOptionControl';
|
|
9
|
-
import { resolveRadioGroupThemeRecipe } from './resolveRadioGroupThemeRecipe';
|
|
10
10
|
/*** Present one controlled single-choice group as inline radios or icon radio options. */
|
|
11
11
|
export const RadioGroup = withZoraThemeScope(RadioGroupInner);
|
|
12
12
|
/*** Resolve shared presentation once and preserve a single interaction boundary per option. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../../../src/features/form/radio/adapters/inbound/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,0FAA0F;AAC1F,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAE9D,+FAA+F;AAC/F,SAAS,eAAe,CAAwB,EAC9C,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,GAAG,KAAK,EACgB;IACxB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACvE,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;YAAE,aAAa,CAAC,IAAI,CA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,CAAC,kBAAkB,IAAI,YAAY,CAAC,CACjD,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH,CAAC;IACJ,CAAC;IACD,OAAO,CACL,CAAC,KAAK,CACJ,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACtB,eAAe,CAAC,CAAC,QAAQ,CAAC,CAE1B;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CACb;QAAA,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAC1B;QAAA,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CACpB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CACtC;YAAA,CAAC,MAAM,CAAC,WAAW,CACrB;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC","sourcesContent":["import { Radio } from '@ankhorage/surface';\nimport React from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { useZoraThemeRecipe } from '../../../../../theme/useZoraThemeRecipe';\nimport { withZoraThemeScope } from '../../../../../theme/withZoraThemeScope';\nimport type { RadioGroupProps } from '../../../../../types/radio';\nimport { Stack } from '../../../../layout/public';\nimport { Text } from '../../../../typography/public';\nimport { resolveRadioGroupThemeRecipe } from '../../utils/resolveRadioGroupThemeRecipe';\nimport { RadioOptionControl } from './RadioOptionControl';\n\n/*** Present one controlled single-choice group as inline radios or icon radio options. */\nexport const RadioGroup = withZoraThemeScope(RadioGroupInner);\n\n/*** Resolve shared presentation once and preserve a single interaction boundary per option. */\nfunction RadioGroupInner<TValue extends string>({\n themeId: _themeId,\n mode: _mode,\n ...props\n}: RadioGroupProps<TValue>) {\n const [localValue, setLocalValue] = React.useState(props.defaultValue);\n const onValueChange = (next: TValue) => {\n if (props.value === undefined) setLocalValue(next);\n props.onValueChange?.(next);\n };\n const selectedProps = { ...props, value: props.value ?? localValue, onValueChange };\n const themeFields = useZoraThemeRecipe('RadioGroup');\n const recipe = resolveRadioGroupThemeRecipe({ ...props, themeFields });\n if (props.presentation !== 'card') return <RadioGroupInline {...selectedProps} {...recipe} />;\n const columns =\n props.columns ?? (props.orientation === 'horizontal' ? Math.max(1, props.options.length) : 1);\n const rows = Array.from({ length: Math.ceil(props.options.length / columns) }, (_, index) =>\n props.options.slice(index * columns, (index + 1) * columns),\n );\n return (\n <View testID={props.testID} accessibilityRole=\"radiogroup\">\n <Stack gap={recipe.gap}>\n {rows.map((options, index) => (\n <Stack key={index} direction=\"row\" gap={recipe.gap}>\n {options.map((option) => (\n <View key={option.value} style={styles.option}>\n <RadioGroupItem {...selectedProps} {...recipe} option={option} />\n </View>\n ))}\n {Array.from({ length: columns - options.length }, (_, slot) => (\n <View key={`empty-${slot}`} style={styles.option} />\n ))}\n </Stack>\n ))}\n </Stack>\n </View>\n );\n}\n\n/*** Preserve ordinary radio wrapping independently of the icon-option grid. */\nfunction RadioGroupInline<TValue extends string>(props: RadioGroupProps<TValue>) {\n return (\n <View testID={props.testID} accessibilityRole=\"radiogroup\">\n <Stack\n direction={props.orientation === 'horizontal' ? 'row' : 'column'}\n gap={props.gap}\n wrap=\"wrap\"\n >\n {props.options.map((option) => (\n <RadioGroupItem key={option.value} {...props} option={option} />\n ))}\n </Stack>\n </View>\n );\n}\n\n/*** Delegate icon options to their composed radio boundary and ordinary options to Surface Radio. */\nfunction RadioGroupItem<TValue extends string>(\n props: RadioGroupProps<TValue> & {\n option: RadioGroupProps<TValue>['options'][number];\n },\n) {\n const { option, value, onValueChange, interactionPolicy, color, size } = props;\n const checked = value === option.value;\n const inactive = props.disabled === true || option.disabled === true;\n const readOnly = props.readOnly === true;\n const invalid = props.invalid === true;\n const onSelect = () => {\n if (!inactive && !readOnly && interactionPolicy !== 'passive' && !checked)\n onValueChange?.(option.value);\n };\n if (props.presentation === 'card') {\n return (\n <RadioOptionControl\n {...props}\n checked={checked}\n disabled={inactive}\n readOnly={readOnly}\n invalid={invalid}\n layout={props.contentOrientation ?? 'horizontal'}\n onSelect={onSelect}\n />\n );\n }\n return (\n <Radio\n checked={checked}\n disabled={inactive}\n readOnly={readOnly}\n invalid={invalid}\n interactionPolicy={interactionPolicy}\n color={color}\n size={size}\n testID={option.testID}\n onCheckedChange={onSelect}\n >\n <Stack gap=\"xs\">\n <Text>{option.label}</Text>\n {option.description ? (\n <Text emphasis=\"muted\" variant=\"caption\">\n {option.description}\n </Text>\n ) : null}\n </Stack>\n </Radio>\n );\n}\n\nconst styles = StyleSheet.create({ option: { flex: 1, minWidth: 0 } });\n"]}
|
package/dist/{components/radio → features/form/radio/adapters/inbound}/RadioOptionControl.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { RadioGroupProps } from '
|
|
2
|
+
import type { RadioGroupProps } from '../../../../../types/radio';
|
|
3
3
|
/*** Render a selectable icon radio option with one accessible radio target and a trailing check. */
|
|
4
4
|
export declare function RadioOptionControl<TValue extends string>(props: RadioOptionControlProps<TValue>): React.JSX.Element;
|
|
5
5
|
interface RadioOptionControlProps<TValue extends string> extends Pick<RadioGroupProps<TValue>, 'color' | 'size' | 'interactionPolicy'> {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioOptionControl.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/radio/adapters/inbound/RadioOptionControl.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AASlE,oGAAoG;AACpG,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,MAAM,EAAE,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,qBAuC/F;AAqCD,UAAU,uBAAuB,CAAC,MAAM,SAAS,MAAM,CAAE,SAAQ,IAAI,CACnE,eAAe,CAAC,MAAM,CAAC,EACvB,OAAO,GAAG,MAAM,GAAG,mBAAmB,CACvC;IACC,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
package/dist/{components/radio → features/form/radio/adapters/inbound}/RadioOptionControl.js
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useTheme } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Platform, Pressable, StyleSheet, View } from 'react-native';
|
|
4
|
-
import { Icon } from '
|
|
5
|
-
import { Text } from '
|
|
6
|
-
import { handleRadioOptionKeyDown, } from '
|
|
7
|
-
import { resolveRadioOptionColors } from '
|
|
4
|
+
import { Icon } from '../../../../icon/public';
|
|
5
|
+
import { Text } from '../../../../typography/public';
|
|
6
|
+
import { handleRadioOptionKeyDown, } from '../../utils/handleRadioOptionKeyDown';
|
|
7
|
+
import { resolveRadioOptionColors } from '../../utils/resolveRadioOptionColors';
|
|
8
8
|
/*** Render a selectable icon radio option with one accessible radio target and a trailing check. */
|
|
9
9
|
export function RadioOptionControl(props) {
|
|
10
10
|
const { theme } = useTheme();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioOptionControl.js","sourceRoot":"","sources":["../../../../../../src/features/form/radio/adapters/inbound/RadioOptionControl.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EACL,wBAAwB,GAEzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,oGAAoG;AACpG,MAAM,UAAU,kBAAkB,CAAwB,KAAsC;IAC9F,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnF,MAAM,MAAM,GAAG,wBAAwB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,aAAa,GACjB,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,IAAI,iBAAiB,KAAK,SAAS;QAChF,CAAC,CAAC;YACE,SAAS,EAAE,CAAC,KAAqD,EAAE,EAAE,CACnE,wBAAwB,CAAC,KAAK,EAAE,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AE,CAAC,CAAC,EAAE,CAAC;KACrD;CACF,CAAC,CAAC","sourcesContent":["import { useTheme } from '@ankhorage/surface';\nimport React from 'react';\nimport { Platform, Pressable, StyleSheet, View } from 'react-native';\n\nimport type { RadioGroupProps } from '../../../../../types/radio';\nimport { Icon } from '../../../../icon/public';\nimport { Text } from '../../../../typography/public';\nimport {\n handleRadioOptionKeyDown,\n type RadioOptionKeyboardTarget,\n} from '../../utils/handleRadioOptionKeyDown';\nimport { resolveRadioOptionColors } from '../../utils/resolveRadioOptionColors';\n\n/*** Render a selectable icon radio option with one accessible radio target and a trailing check. */\nexport function RadioOptionControl<TValue extends string>(props: RadioOptionControlProps<TValue>) {\n const { theme } = useTheme();\n const { option, checked, disabled, readOnly, interactionPolicy, onSelect } = props;\n const colors = resolveRadioOptionColors(theme, props);\n const [focused, setFocused] = React.useState(false);\n const keyboardProps =\n Platform.OS === 'web' && !readOnly && !disabled && interactionPolicy !== 'passive'\n ? {\n onKeyDown: (event: React.KeyboardEvent<RadioOptionKeyboardTarget>) =>\n handleRadioOptionKeyDown(event, onSelect),\n }\n : {};\n const controlStyle = {\n flex: 1,\n width: '100%' as const,\n minHeight: props.size === 'l' ? 84 : 44,\n borderWidth: checked || focused ? 2 : 1,\n borderColor: focused ? theme.semantics.border.focus : checked ? colors.accent : colors.border,\n borderRadius: theme.radii.l,\n backgroundColor: colors.surface,\n };\n return (\n <Pressable\n {...keyboardProps}\n accessibilityRole=\"radio\"\n accessibilityState={{ checked, disabled }}\n aria-checked={checked}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n disabled={disabled}\n onPress={readOnly || interactionPolicy === 'passive' ? undefined : onSelect}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n testID={option.testID}\n style={controlStyle}\n >\n {(state) => <RadioOptionControlBody {...props} pressed={state.pressed} />}\n </Pressable>\n );\n}\n\n/*** Arrange the icon, label and passive indicator within the native radio press target. */\nfunction RadioOptionControlBody<TValue extends string>(\n props: RadioOptionControlProps<TValue> & { pressed: boolean },\n) {\n const { theme } = useTheme();\n const colors = resolveRadioOptionColors(theme, props);\n const contentStyle = {\n padding: props.size === 's' ? theme.spacing.s : props.size === 'm' ? 12 : theme.spacing.m,\n gap:\n props.layout === 'vertical' || !props.option.iconSource ? theme.spacing.s : theme.spacing.m,\n ...(!props.option.iconSource ? { flexDirection: 'row-reverse' as const } : {}),\n opacity: props.disabled ? 0.5 : props.pressed ? 0.7 : 1,\n };\n return (\n <View\n style={[\n styles.content,\n props.layout === 'vertical' ? styles.vertical : styles.horizontal,\n contentStyle,\n ]}\n >\n <RadioOptionControlContent {...props} />\n {props.option.iconSource || props.checked ? (\n <View style={props.layout === 'vertical' ? styles.corner : undefined}>\n <RadioOptionControlIndicator\n checked={props.checked}\n accent={colors.accent}\n onAccent={colors.onAccent}\n />\n </View>\n ) : null}\n </View>\n );\n}\n\ninterface RadioOptionControlProps<TValue extends string> extends Pick<\n RadioGroupProps<TValue>,\n 'color' | 'size' | 'interactionPolicy'\n> {\n option: RadioGroupProps<TValue>['options'][number];\n checked: boolean;\n disabled: boolean;\n readOnly: boolean;\n invalid: boolean;\n layout: 'horizontal' | 'vertical';\n onSelect: () => void;\n}\n\n/*** Keep decoration passive while allowing labels to wrap at narrow widths and large text sizes. */\nfunction RadioOptionControlContent<TValue extends string>({\n option,\n layout,\n size,\n color,\n invalid,\n disabled,\n}: RadioOptionControlProps<TValue>) {\n const { theme } = useTheme();\n const colors = resolveRadioOptionColors(theme, { color, invalid, disabled });\n return (\n <>\n {option.iconSource ? (\n <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\">\n <Icon source={option.iconSource} size={size === 'l' ? 36 : 28} color={colors.accent} />\n </View>\n ) : null}\n <View style={layout === 'horizontal' ? styles.label : styles.centerLabel}>\n <Text\n variant={size === 'l' ? 'body' : 'bodySmall'}\n weight=\"semiBold\"\n align={layout === 'vertical' || !option.iconSource ? 'center' : 'left'}\n >\n {option.label}\n </Text>\n {option.description ? (\n <Text\n emphasis=\"muted\"\n variant=\"bodySmall\"\n align={layout === 'vertical' || !option.iconSource ? 'center' : 'left'}\n >\n {option.description}\n </Text>\n ) : null}\n </View>\n </>\n );\n}\n\n/*** Draw a passive check using themed geometry without requiring an application media asset. */\nfunction RadioOptionControlIndicator({\n checked,\n accent,\n onAccent,\n}: {\n checked: boolean;\n accent: string;\n onAccent: string;\n}) {\n const indicatorStyle = { backgroundColor: checked ? accent : 'transparent' };\n return (\n <View\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={[styles.indicator, indicatorStyle]}\n >\n {checked ? <View style={[styles.check, { borderColor: onAccent }]} /> : null}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n content: { gap: 16, flex: 1, minWidth: 0 },\n horizontal: { flexDirection: 'row', alignItems: 'center' },\n vertical: {\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n paddingTop: 24,\n },\n label: { flex: 1, minWidth: 0, gap: 4 },\n centerLabel: { alignSelf: 'stretch', gap: 4 },\n corner: { position: 'absolute', right: 8, top: 8 },\n indicator: {\n width: 24,\n height: 24,\n borderRadius: 12,\n alignItems: 'center',\n justifyContent: 'center',\n },\n check: {\n width: 7,\n height: 12,\n borderRightWidth: 2.5,\n borderBottomWidth: 2.5,\n transform: [{ rotate: '45deg' }, { translateY: -2 }],\n },\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/features/form/radio/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/features/form/radio/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["export type { RadioGroupOption, RadioGroupProps, RadioProps } from '../../../types/radio';\nexport { Radio } from './adapters/inbound/Radio';\nexport { RadioGroup } from './adapters/inbound/RadioGroup';\n"]}
|
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
export declare const radioMeta: {
|
|
2
2
|
readonly name: "Radio";
|
|
3
3
|
readonly category: "component";
|
|
4
|
-
readonly directManifestNode:
|
|
4
|
+
readonly directManifestNode: true;
|
|
5
5
|
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly
|
|
7
|
-
|
|
6
|
+
readonly blueprint: {
|
|
7
|
+
readonly label: "Radio";
|
|
8
|
+
readonly defaultProps: {
|
|
9
|
+
readonly label: "Option";
|
|
10
|
+
readonly checked: false;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
readonly props: {
|
|
14
|
+
readonly label: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly category: "Content";
|
|
17
|
+
readonly label: "Label";
|
|
18
|
+
};
|
|
19
|
+
readonly checked: {
|
|
20
|
+
readonly type: "boolean";
|
|
21
|
+
readonly category: "State";
|
|
22
|
+
readonly label: "Checked";
|
|
23
|
+
readonly default: false;
|
|
24
|
+
};
|
|
25
|
+
readonly disabled: {
|
|
26
|
+
readonly type: "boolean";
|
|
27
|
+
readonly category: "State";
|
|
28
|
+
readonly label: "Disabled";
|
|
29
|
+
readonly default: false;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
8
32
|
};
|
|
9
33
|
export declare const radioGroupMeta: {
|
|
10
34
|
readonly name: "RadioGroup";
|
|
@@ -248,4 +272,4 @@ export declare const radioGroupMeta: {
|
|
|
248
272
|
};
|
|
249
273
|
};
|
|
250
274
|
};
|
|
251
|
-
//# sourceMappingURL=
|
|
275
|
+
//# sourceMappingURL=radioMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radioMeta.d.ts","sourceRoot":"","sources":["../../../../src/features/form/radio/radioMeta.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWgB,CAAC;AAEvC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+LW,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZORA_COLORS } from '
|
|
1
|
+
import { ZORA_COLORS } from '../../../internal/colorModel';
|
|
2
2
|
const themeAuthoring = {
|
|
3
3
|
authority: 'theme',
|
|
4
4
|
scope: 'component',
|
|
@@ -7,10 +7,14 @@ const themeAuthoring = {
|
|
|
7
7
|
export const radioMeta = {
|
|
8
8
|
name: 'Radio',
|
|
9
9
|
category: 'component',
|
|
10
|
-
directManifestNode:
|
|
10
|
+
directManifestNode: true,
|
|
11
11
|
allowedChildren: [],
|
|
12
|
-
|
|
13
|
-
props: {
|
|
12
|
+
blueprint: { label: 'Radio', defaultProps: { label: 'Option', checked: false } },
|
|
13
|
+
props: {
|
|
14
|
+
label: { type: 'string', category: 'Content', label: 'Label' },
|
|
15
|
+
checked: { type: 'boolean', category: 'State', label: 'Checked', default: false },
|
|
16
|
+
disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },
|
|
17
|
+
},
|
|
14
18
|
};
|
|
15
19
|
export const radioGroupMeta = {
|
|
16
20
|
name: 'RadioGroup',
|
|
@@ -203,4 +207,4 @@ export const radioGroupMeta = {
|
|
|
203
207
|
},
|
|
204
208
|
},
|
|
205
209
|
};
|
|
206
|
-
//# sourceMappingURL=
|
|
210
|
+
//# sourceMappingURL=radioMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radioMeta.js","sourceRoot":"","sources":["../../../../src/features/form/radio/radioMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,cAAc,GAAG;IACrB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,WAAW;IAClB,qBAAqB,EAAE,IAAI;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAChF,KAAK,EAAE;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE;QAC9D,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;AAEvC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,WAAW;IACrB,WAAW,EACT,wFAAwF;IAC1F,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,oBAAoB;QA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E,OAAO;YACjB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC;YACtB,SAAS,EAAE,cAAc;SAC1B;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;YACrB,SAAS,EAAE,cAAc;SAC1B;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import { ZORA_COLORS } from '../../../internal/colorModel';\nimport type { ZoraComponentMeta } from '../../../metadata';\n\nconst themeAuthoring = {\n authority: 'theme',\n scope: 'component',\n allowInstanceOverride: true,\n} as const;\n\nexport const radioMeta = {\n name: 'Radio',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Radio', defaultProps: { label: 'Option', checked: false } },\n props: {\n label: { type: 'string', category: 'Content', label: 'Label' },\n checked: { type: 'boolean', category: 'State', label: 'Checked', default: false },\n disabled: { type: 'boolean', category: 'State', label: 'Disabled', default: false },\n },\n} as const satisfies ZoraComponentMeta;\n\nexport const radioGroupMeta = {\n name: 'RadioGroup',\n category: 'component',\n description:\n 'Single-choice group with inline or card presentation while preserving radio semantics.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Radio button group',\n defaultProps: {\n defaultValue: 'option-b',\n options: [\n { value: 'option-a', label: 'First option', description: 'Supporting detail' },\n { value: 'option-b', label: 'Second option', description: 'Supporting detail' },\n { value: 'option-c', label: 'Third option', description: 'Supporting detail' },\n ],\n orientation: 'vertical',\n presentation: 'card',\n invalid: false,\n readOnly: false,\n disabled: false,\n },\n },\n bindings: {\n props: {\n value: {\n label: 'Value',\n description: 'Currently selected option value.',\n value: { type: 'string' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n disabled: {\n label: 'Disabled',\n description: 'Whether the complete radio group is disabled.',\n value: { type: 'boolean' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n events: {\n valueChange: {\n label: 'Value change',\n description: 'Runs when the selected radio value changes.',\n payload: {\n eventType: 'radioGroup.valueChange',\n fields: [{ path: 'value', type: 'string', label: 'Value' }],\n },\n },\n },\n },\n events: {\n valueChange: {\n label: 'Value change',\n eventType: 'radioGroup.valueChange',\n description: 'Emitted when the selected radio value changes.',\n payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],\n },\n },\n props: {\n defaultValue: {\n type: 'string',\n category: 'State',\n label: 'Initial value',\n authoring: { authority: 'instance' },\n },\n value: {\n type: 'string',\n category: 'State',\n label: 'Value',\n authoring: { authority: 'instance' },\n },\n options: {\n type: 'array',\n category: 'Content',\n label: 'Options',\n itemSchema: [\n {\n key: 'value',\n schema: {\n type: 'string',\n category: 'Content',\n label: 'Value',\n },\n },\n {\n key: 'label',\n schema: {\n type: 'string',\n category: 'Content',\n label: 'Label',\n },\n },\n {\n key: 'description',\n schema: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n },\n },\n {\n key: 'iconSource',\n schema: { type: 'media', category: 'Content', label: 'Icon', mediaKinds: ['image'] },\n },\n {\n key: 'disabled',\n schema: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n },\n },\n ],\n authoring: { authority: 'instance' },\n },\n orientation: {\n type: 'enum',\n category: 'Layout',\n label: 'Orientation',\n enum: ['horizontal', 'vertical'],\n default: 'vertical',\n authoring: { authority: 'instance' },\n },\n gap: {\n type: 'enum',\n category: 'Layout',\n label: 'Gap',\n enum: ['xs', 's', 'm', 'l'],\n authoring: themeAuthoring,\n },\n presentation: {\n type: 'enum',\n category: 'Style',\n label: 'Presentation',\n enum: ['inline', 'card'],\n default: 'inline',\n authoring: { authority: 'instance' },\n },\n contentOrientation: {\n type: 'enum',\n category: 'Layout',\n label: 'Option content orientation',\n enum: ['horizontal', 'vertical'],\n default: 'horizontal',\n authoring: { authority: 'instance' },\n },\n columns: {\n type: 'enum',\n category: 'Layout',\n label: 'Option columns',\n enum: [1, 2, 3, 4],\n authoring: { authority: 'instance' },\n },\n color: {\n type: 'enum',\n category: 'Style',\n label: 'Color',\n enum: [...ZORA_COLORS],\n authoring: themeAuthoring,\n },\n size: {\n type: 'enum',\n category: 'Style',\n label: 'Size',\n enum: ['s', 'm', 'l'],\n authoring: themeAuthoring,\n },\n invalid: {\n type: 'boolean',\n category: 'State',\n label: 'Invalid',\n default: false,\n authoring: { authority: 'instance' },\n },\n readOnly: {\n type: 'boolean',\n category: 'State',\n label: 'Read only',\n default: false,\n authoring: { authority: 'instance' },\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeRecipeMeta.d.ts","sourceRoot":"","sources":["../../../../src/features/form/radio/themeRecipeMeta.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;CAwBE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeRecipeMeta.js","sourceRoot":"","sources":["../../../../src/features/form/radio/themeRecipeMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,8EAA8E;IAC3F,MAAM,EAAE;QACN,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;YAC9B,OAAO,EAAE,GAAG;SACb;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,SAAS;SACnB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;YACxB,OAAO,EAAE,GAAG;SACb;KACF;CACqC,CAAC","sourcesContent":["import { ZORA_COLORS } from '../../../internal/colorModel';\nimport type { ZoraThemeRecipeMeta } from '../../../metadata/themeRecipeTypes';\n\nexport const radioGroupThemeRecipeMeta = {\n name: 'RadioGroup',\n kind: 'component',\n description: 'Maps shared selection-control presentation choices into RadioGroup defaults.',\n fields: {\n gap: {\n type: 'choice',\n label: 'Gap',\n options: ['xs', 's', 'm', 'l'],\n default: 's',\n },\n color: {\n type: 'choice',\n label: 'Color',\n options: ZORA_COLORS,\n default: 'primary',\n },\n size: {\n type: 'choice',\n label: 'Size',\n options: ['s', 'm', 'l'],\n default: 'm',\n },\n },\n} as const satisfies ZoraThemeRecipeMeta;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleRadioOptionKeyDown.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/radio/utils/handleRadioOptionKeyDown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,wGAAwG;AACxG,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,aAAa,CAAC,yBAAyB,CAAC,EAC/C,MAAM,EAAE,MAAM,IAAI,GACjB,IAAI,CAkBN;AAED,+FAA+F;AAC/F,MAAM,WAAW,yBAAyB;IACxC,OAAO,CACL,QAAQ,EAAE,MAAM,GACf;QAAE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,yBAAyB,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IACvF,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DIRECTION_MODIFIERS } from '
|
|
1
|
+
import { DIRECTION_MODIFIERS } from '../../../../constants/keyboard';
|
|
2
2
|
/*** Support Space and directional navigation for web radio options without affecting native presses. */
|
|
3
3
|
export function handleRadioOptionKeyDown(event, select) {
|
|
4
4
|
if (event.key === ' ') {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleRadioOptionKeyDown.js","sourceRoot":"","sources":["../../../../../src/features/form/radio/utils/handleRadioOptionKeyDown.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,wGAAwG;AACxG,MAAM,UAAU,wBAAwB,CACtC,KAA+C,EAC/C,MAAkB;IAElB,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;QACtB,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,EAAE,CAAC;QACT,OAAO;IACT,CAAC;IACD,MAAM,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO;IACpC,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAChF,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM,CAC5D,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACnD,IAAI,KAAK,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC9C,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;AAChB,CAAC","sourcesContent":["import type { KeyboardEvent } from 'react';\n\nimport { DIRECTION_MODIFIERS } from '../../../../constants/keyboard';\n\n/*** Support Space and directional navigation for web radio options without affecting native presses. */\nexport function handleRadioOptionKeyDown(\n event: KeyboardEvent<RadioOptionKeyboardTarget>,\n select: () => void,\n): void {\n if (event.key === ' ') {\n event.preventDefault();\n select();\n return;\n }\n const direction = DIRECTION_MODIFIERS.get(event.key);\n if (direction === undefined) return;\n const group = event.currentTarget.closest('[role=\"radiogroup\"]');\n const options = Array.from(group?.querySelectorAll('[role=\"radio\"]') ?? []).filter(\n (option) => option.getAttribute('aria-disabled') !== 'true',\n );\n const index = options.indexOf(event.currentTarget);\n if (index < 0 || options.length === 0) return;\n event.preventDefault();\n const next = options.at((index + direction + options.length) % options.length);\n next?.focus();\n next?.click();\n}\n\n/** Minimal web target contract keeps the native build independent of DOM ambient libraries. */\nexport interface RadioOptionKeyboardTarget {\n closest(\n selector: string,\n ): { querySelectorAll(selector: string): ArrayLike<RadioOptionKeyboardTarget> } | null;\n getAttribute(name: string): string | null;\n focus(): void;\n click(): void;\n}\n"]}
|
package/dist/{components/radio → features/form/radio/utils}/resolveRadioGroupThemeRecipe.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThemeRecipeOverrideValue } from '@ankhorage/contracts';
|
|
2
|
-
import type { ZoraColor } from '
|
|
3
|
-
import type { RadioGroupProps } from '
|
|
2
|
+
import type { ZoraColor } from '../../../../internal/colorModel';
|
|
3
|
+
import type { RadioGroupProps } from '../../../../types/radio';
|
|
4
4
|
type RadioGroupGap = NonNullable<RadioGroupProps<string>['gap']>;
|
|
5
5
|
type RadioGroupSize = NonNullable<RadioGroupProps<string>['size']>;
|
|
6
6
|
/***
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRadioGroupThemeRecipe.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/radio/utils/resolveRadioGroupThemeRecipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,KAAK,aAAa,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACjE,KAAK,cAAc,GAAG,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnE;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC;CAC1E;;;;EAMA"}
|