@ankhorage/zora 8.0.0 → 9.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 +6 -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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- bb78e49: Move EmptyState and progress nodes to feature owners, add form and feedback manifest nodes, and replace the Input and Textarea APIs with TextInput configurations.
|
|
8
|
+
|
|
3
9
|
## 8.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# ZORA
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Field } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { TextInput } from '../../features/form/text-input/public';
|
|
3
4
|
import { Stack } from '../../features/layout/public';
|
|
4
5
|
import { Text } from '../../features/typography/public';
|
|
5
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
|
-
import { Input } from '../input';
|
|
7
7
|
import { hasRequiredRule } from './validation';
|
|
8
8
|
function isControlFieldProps(props) {
|
|
9
9
|
return 'field' in props;
|
|
@@ -71,7 +71,7 @@ function FormFieldInner(props) {
|
|
|
71
71
|
const fieldDisabled = disabled || loading || field.disabled;
|
|
72
72
|
const required = field.required ?? hasRequiredRule(field.rules);
|
|
73
73
|
return (<Field disabled={fieldDisabled} errorText={error} helperText={field.helperText} invalid={Boolean(error)} label={renderLabel(field.label, field.description)} readOnly={field.readOnly} required={required} testID={testID ?? field.testID}>
|
|
74
|
-
<
|
|
74
|
+
<TextInput accessibilityLabel={typeof field.label === 'string' ? field.label : undefined} autoCapitalize={resolveAutoCapitalize(field)} autoComplete={field.autoComplete} disabled={fieldDisabled} interactionPolicy={interactionPolicy} invalid={Boolean(error)} keyboardType={resolveKeyboardType(field)} maxLength={field.maxLength} onChangeText={(nextValue) => onChange(field.name, nextValue)} placeholder={field.placeholder} readOnly={field.readOnly} secureTextEntry={field.secureTextEntry ?? field.type === 'password'} textContentType={resolveTextContentType(field)} value={value}/>
|
|
75
75
|
</Field>);
|
|
76
76
|
}
|
|
77
77
|
/***
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../src/components/form/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,o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AO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAC9E,cAAc,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAC7C,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CACjC,QAAQ,CAAC,CAAC,aAAa,CAAC,CACxB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CACxB,YAAY,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CACzC,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3B,YAAY,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAC7D,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,eAAe,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CACpE,eAAe,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAC/C,KAAK,CAAC,CAAC,KAAK,CAAC,EAEjB;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { Field } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { TextInput } from '../../features/form/text-input/public';\nimport { Stack } from '../../features/layout/public';\nimport { Text } from '../../features/typography/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { FormFieldConfig, FormFieldControlProps, FormFieldProps } from './types';\nimport { hasRequiredRule } from './validation';\n\nfunction isControlFieldProps<TName extends string>(\n props: FormFieldProps<TName>,\n): props is FormFieldControlProps<TName> {\n return 'field' in props;\n}\n\nfunction resolveKeyboardType(field: FormFieldConfig) {\n if (field.keyboardType) {\n return field.keyboardType;\n }\n\n if (field.type === 'email') {\n return 'email-address';\n }\n\n if (field.type === 'number' || field.type === 'otp') {\n return 'number-pad';\n }\n\n if (field.type === 'tel') {\n return 'phone-pad';\n }\n\n if (field.type === 'url') {\n return 'url';\n }\n\n return undefined;\n}\n\nfunction resolveAutoCapitalize(field: FormFieldConfig) {\n if (field.autoCapitalize) {\n return field.autoCapitalize;\n }\n\n if (['email', 'password', 'url'].includes(field.type ?? 'text')) {\n return 'none';\n }\n\n return undefined;\n}\n\nfunction resolveTextContentType(field: FormFieldConfig) {\n if (field.textContentType) {\n return field.textContentType;\n }\n\n if (field.type === 'email') {\n return 'emailAddress';\n }\n\n if (field.type === 'password') {\n return 'password';\n }\n\n if (field.type === 'otp') {\n return 'oneTimeCode';\n }\n\n return undefined;\n}\n\nfunction renderLabel(label: React.ReactNode, description: React.ReactNode | undefined) {\n return (\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\nfunction FormFieldInner<TName extends string = string>(props: FormFieldProps<TName>) {\n if (!isControlFieldProps(props)) {\n const {\n themeId: _themeId,\n mode: _mode,\n label,\n description,\n helperText,\n children,\n interactionPolicy: _interactionPolicy,\n ...fieldProps\n } = props;\n\n return (\n <Field {...fieldProps} helperText={helperText} label={renderLabel(label, description)}>\n {children}\n </Field>\n );\n }\n\n const {\n themeId: _themeId,\n mode: _mode,\n field,\n value,\n error,\n disabled = false,\n loading = false,\n onChange,\n testID,\n interactionPolicy,\n } = props;\n const fieldDisabled = disabled || loading || field.disabled;\n const required = field.required ?? hasRequiredRule(field.rules);\n\n return (\n <Field\n disabled={fieldDisabled}\n errorText={error}\n helperText={field.helperText}\n invalid={Boolean(error)}\n label={renderLabel(field.label, field.description)}\n readOnly={field.readOnly}\n required={required}\n testID={testID ?? field.testID}\n >\n <TextInput\n accessibilityLabel={typeof field.label === 'string' ? field.label : undefined}\n autoCapitalize={resolveAutoCapitalize(field)}\n autoComplete={field.autoComplete}\n disabled={fieldDisabled}\n interactionPolicy={interactionPolicy}\n invalid={Boolean(error)}\n keyboardType={resolveKeyboardType(field)}\n maxLength={field.maxLength}\n onChangeText={(nextValue) => onChange(field.name, nextValue)}\n placeholder={field.placeholder}\n readOnly={field.readOnly}\n secureTextEntry={field.secureTextEntry ?? field.type === 'password'}\n textContentType={resolveTextContentType(field)}\n value={value}\n />\n </Field>\n );\n}\n\n/***\n * Connects a controlled form value to a labeled input field with error handling.\n */\nexport const FormField = withZoraThemeScope(FormFieldInner);\n"]}
|
|
@@ -39,7 +39,7 @@ export declare const formFieldMeta: {
|
|
|
39
39
|
readonly name: "FormField";
|
|
40
40
|
readonly category: "component";
|
|
41
41
|
readonly directManifestNode: true;
|
|
42
|
-
readonly allowedChildren: readonly ["
|
|
42
|
+
readonly allowedChildren: readonly ["TextInput"];
|
|
43
43
|
readonly blueprint: {
|
|
44
44
|
readonly label: "Form field";
|
|
45
45
|
readonly defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/form/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,yEAAyE;IAC/E,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,aAAa;YACxB,WAAW,EAAE,mDAAmD;YAChE,aAAa,EAAE;gBACb;oBACE,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,QAAQ;oBACd,KAAK,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K,EAAE,UAAU;YACjB,OAAO,EAAE,KAAK;SACf;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,KAAK;SACf;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const formMeta = {\n name: 'Form',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Form orchestration component; not represented as a manifest node in v1.',\n events: {\n submit: {\n label: 'Submit',\n eventType: 'form.submit',\n description: 'Emitted when the form submits its current values.',\n payloadFields: [\n {\n path: 'payload.values',\n type: 'record',\n label: 'Values',\n description: 'Submitted form values keyed by field name.',\n },\n ],\n },\n },\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const formActionsMeta = {\n name: 'FormActions',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Form helper component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const formErrorMeta = {\n name: 'FormError',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Form helper component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const formFieldMeta = {\n name: 'FormField',\n category: 'component',\n directManifestNode: true,\n allowedChildren: ['TextInput'],\n blueprint: {\n label: 'Form field',\n defaultProps: {\n label: 'Label',\n },\n },\n props: {\n label: {\n type: 'string',\n category: 'Content',\n label: 'Label',\n default: 'Label',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n },\n helperText: {\n type: 'string',\n category: 'Content',\n label: 'Helper text',\n },\n required: {\n type: 'boolean',\n category: 'Validation',\n label: 'Required',\n default: false,\n },\n invalid: {\n type: 'boolean',\n category: 'Validation',\n label: 'Invalid',\n default: false,\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n },\n readOnly: {\n type: 'boolean',\n category: 'State',\n label: 'Read-only',\n default: false,\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
-
import type {
|
|
4
|
+
import type { TextInputProps } from '../../types/text-input';
|
|
5
5
|
export type ValidationRule = {
|
|
6
6
|
kind: 'required';
|
|
7
7
|
message?: string;
|
|
@@ -30,14 +30,14 @@ export interface FormFieldConfig<TName extends string = string> {
|
|
|
30
30
|
type?: FormFieldInputType;
|
|
31
31
|
placeholder?: string;
|
|
32
32
|
rules?: readonly ValidationRule[];
|
|
33
|
-
autoCapitalize?:
|
|
34
|
-
autoComplete?:
|
|
35
|
-
keyboardType?:
|
|
36
|
-
maxLength?:
|
|
33
|
+
autoCapitalize?: TextInputProps['autoCapitalize'];
|
|
34
|
+
autoComplete?: TextInputProps['autoComplete'];
|
|
35
|
+
keyboardType?: TextInputProps['keyboardType'];
|
|
36
|
+
maxLength?: TextInputProps['maxLength'];
|
|
37
37
|
readOnly?: boolean;
|
|
38
38
|
required?: boolean;
|
|
39
39
|
secureTextEntry?: boolean;
|
|
40
|
-
textContentType?:
|
|
40
|
+
textContentType?: TextInputProps['textContentType'];
|
|
41
41
|
disabled?: boolean;
|
|
42
42
|
testID?: string;
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources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AE,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5D,QAAQ,EAAE,MAAM,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5C,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\nimport type {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/form/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\nimport type { TextInputProps } from '../../types/text-input';\n\nexport type ValidationRule =\n | { kind: 'required'; message?: string }\n | { kind: 'email'; message?: string }\n | { kind: 'minLength'; value: number; message?: string }\n | { kind: 'pattern'; value: string; message?: string };\n\nexport type FormFieldValue = string;\nexport type FormValues<TName extends string = string> = Record<TName, FormFieldValue>;\nexport type FormErrors<TName extends string = string> = Partial<Record<TName, React.ReactNode>>;\nexport type FormValidationErrors<TName extends string = string> = Partial<Record<TName, string>>;\n\nexport type FormFieldInputType = 'email' | 'number' | 'otp' | 'password' | 'tel' | 'text' | 'url';\n\nexport interface FormFieldConfig<TName extends string = string> {\n name: TName;\n label: React.ReactNode;\n description?: React.ReactNode;\n helperText?: React.ReactNode;\n type?: FormFieldInputType;\n placeholder?: string;\n rules?: readonly ValidationRule[];\n autoCapitalize?: TextInputProps['autoCapitalize'];\n autoComplete?: TextInputProps['autoComplete'];\n keyboardType?: TextInputProps['keyboardType'];\n maxLength?: TextInputProps['maxLength'];\n readOnly?: boolean;\n required?: boolean;\n secureTextEntry?: boolean;\n textContentType?: TextInputProps['textContentType'];\n disabled?: boolean;\n testID?: string;\n}\n\ninterface FormFieldWrapperProps\n extends\n ZoraBaseProps,\n Pick<\n Omit<SurfaceFieldProps, 'mode' | 'themeId'>,\n 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'\n > {\n label: React.ReactNode;\n description?: React.ReactNode;\n helperText?: React.ReactNode;\n}\n\nexport interface FormFieldControlProps<TName extends string = string> extends ZoraBaseProps {\n field: FormFieldConfig<TName>;\n value: FormFieldValue;\n onChange: (name: TName, value: FormFieldValue) => void;\n error?: React.ReactNode;\n disabled?: boolean;\n loading?: boolean;\n}\n\nexport type FormFieldProps<TName extends string = string> =\n FormFieldControlProps<TName> | FormFieldWrapperProps;\n\nexport interface FormActionsProps extends ZoraBaseProps {\n submitLabel?: React.ReactNode;\n loading?: boolean;\n disabled?: boolean;\n onSubmit?: () => void;\n children?: React.ReactNode;\n}\n\nexport interface FormErrorProps extends ZoraBaseProps {\n error?: React.ReactNode;\n}\n\nexport interface FormProps<TName extends string = string> extends ZoraBaseProps {\n fields: readonly FormFieldConfig<TName>[];\n values: FormValues<TName>;\n onChange: (values: FormValues<TName>) => void;\n onSubmit: (values: FormValues<TName>) => void | Promise<void>;\n errors?: FormErrors<TName>;\n error?: React.ReactNode;\n loading?: boolean;\n disabled?: boolean;\n submitLabel?: React.ReactNode;\n actions?: React.ReactNode;\n footer?: React.ReactNode;\n validateOnChange?: boolean;\n}\n\nexport interface FormValidationResult<TName extends string = string> {\n errors: FormValidationErrors<TName>;\n valid: boolean;\n}\n\nexport interface UseFormControllerOptions<TName extends string = string> {\n fields: readonly FormFieldConfig<TName>[];\n initialValues?: Partial<FormValues<TName>>;\n values?: FormValues<TName>;\n errors?: FormErrors<TName>;\n onChange?: (values: FormValues<TName>) => void;\n onSubmit?: (values: FormValues<TName>) => void | Promise<void>;\n validateOnChange?: boolean;\n}\n\nexport interface UseFormControllerResult<TName extends string = string> {\n values: FormValues<TName>;\n errors: FormErrors<TName>;\n setValues: (values: FormValues<TName>) => void;\n setFieldValue: (name: TName, value: FormFieldValue) => void;\n validate: () => FormValidationResult<TName>;\n handleSubmit: () => Promise<void>;\n reset: () => void;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TextInput } from '../../features/form/text-input/public';
|
|
2
3
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
3
|
-
import { Input } from '../input';
|
|
4
4
|
function SearchBarInner({ themeId: _themeId, mode: _mode, testID, value, onValueChange, placeholder = 'Search', onSubmit, onClear, clearable = true, size = 'l', disabled, readOnly, interactionPolicy, }) {
|
|
5
5
|
const passive = interactionPolicy === 'passive';
|
|
6
6
|
const trailingAction = clearable && value.length > 0
|
|
@@ -15,7 +15,7 @@ function SearchBarInner({ themeId: _themeId, mode: _mode, testID, value, onValue
|
|
|
15
15
|
},
|
|
16
16
|
}
|
|
17
17
|
: undefined;
|
|
18
|
-
return (<
|
|
18
|
+
return (<TextInput disabled={disabled} interactionPolicy={interactionPolicy} leadingIcon={{ name: 'search-outline' }} onChangeText={onValueChange} onSubmitEditing={onSubmit ? (passive ? undefined : () => onSubmit(value)) : undefined} placeholder={placeholder} readOnly={readOnly} returnKeyType="search" size={size} testID={testID} trailingAction={trailingAction} value={value}/>);
|
|
19
19
|
}
|
|
20
20
|
/***
|
|
21
21
|
* Search input with leading icon and optional trailing action.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../src/components/search-bar/SearchBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../src/components/search-bar/SearchBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAgC,MAAM,uC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CAAC,CAAC,MAAM,CAAC,CACf,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { TextInput, type TextInputTrailingAction } from '../../features/form/text-input/public';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SearchBarProps } from './types';\n\nfunction SearchBarInner({\n themeId: _themeId,\n mode: _mode,\n testID,\n value,\n onValueChange,\n placeholder = 'Search',\n onSubmit,\n onClear,\n clearable = true,\n size = 'l',\n disabled,\n readOnly,\n interactionPolicy,\n}: SearchBarProps) {\n const passive = interactionPolicy === 'passive';\n\n const trailingAction: TextInputTrailingAction | undefined =\n clearable && value.length > 0\n ? {\n icon: { name: 'close-circle' },\n label: 'Clear search',\n onPress: () => {\n if (passive) return;\n\n onValueChange('');\n onClear?.();\n },\n }\n : undefined;\n\n return (\n <TextInput\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n leadingIcon={{ name: 'search-outline' }}\n onChangeText={onValueChange}\n onSubmitEditing={onSubmit ? (passive ? undefined : () => onSubmit(value)) : undefined}\n placeholder={placeholder}\n readOnly={readOnly}\n returnKeyType=\"search\"\n size={size}\n testID={testID}\n trailingAction={trailingAction}\n value={value}\n />\n );\n}\n\n/***\n * Search input with leading icon and optional trailing action.\n */\nexport const SearchBar = withZoraThemeScope(SearchBarInner);\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const activityIndicatorMeta: {
|
|
2
|
+
readonly name: "ActivityIndicator";
|
|
3
|
+
readonly category: "component";
|
|
4
|
+
readonly directManifestNode: true;
|
|
5
|
+
readonly allowedChildren: readonly [];
|
|
6
|
+
readonly blueprint: {
|
|
7
|
+
readonly label: "Activity indicator";
|
|
8
|
+
readonly defaultProps: {
|
|
9
|
+
readonly size: "small";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly props: {
|
|
13
|
+
readonly size: {
|
|
14
|
+
readonly type: "enum";
|
|
15
|
+
readonly category: "Style";
|
|
16
|
+
readonly label: "Size";
|
|
17
|
+
readonly enum: readonly ["small", "large"];
|
|
18
|
+
};
|
|
19
|
+
readonly color: {
|
|
20
|
+
readonly type: "color";
|
|
21
|
+
readonly category: "Style";
|
|
22
|
+
readonly label: "Color";
|
|
23
|
+
};
|
|
24
|
+
readonly animating: {
|
|
25
|
+
readonly type: "boolean";
|
|
26
|
+
readonly category: "State";
|
|
27
|
+
readonly label: "Animating";
|
|
28
|
+
readonly default: true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=activityIndicatorMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityIndicatorMeta.d.ts","sourceRoot":"","sources":["../../../src/features/activity-indicator/activityIndicatorMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWI,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const activityIndicatorMeta = {
|
|
2
|
+
name: 'ActivityIndicator',
|
|
3
|
+
category: 'component',
|
|
4
|
+
directManifestNode: true,
|
|
5
|
+
allowedChildren: [],
|
|
6
|
+
blueprint: { label: 'Activity indicator', defaultProps: { size: 'small' } },
|
|
7
|
+
props: {
|
|
8
|
+
size: { type: 'enum', category: 'Style', label: 'Size', enum: ['small', 'large'] },
|
|
9
|
+
color: { type: 'color', category: 'Style', label: 'Color' },
|
|
10
|
+
animating: { type: 'boolean', category: 'State', label: 'Animating', default: true },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=activityIndicatorMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityIndicatorMeta.js","sourceRoot":"","sources":["../../../src/features/activity-indicator/activityIndicatorMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAC3E,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;QAClF,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QAC3D,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE;KACrF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const activityIndicatorMeta = {\n name: 'ActivityIndicator',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Activity indicator', defaultProps: { size: 'small' } },\n props: {\n size: { type: 'enum', category: 'Style', label: 'Size', enum: ['small', 'large'] },\n color: { type: 'color', category: 'Style', label: 'Color' },\n animating: { type: 'boolean', category: 'State', label: 'Animating', default: true },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ActivityIndicatorProps } from '../../../../types/activity-indicator';
|
|
3
|
+
/*** Native activity indicator exposed as a serializable ZORA feedback node. */
|
|
4
|
+
export declare const ActivityIndicator: (props: ActivityIndicatorProps) => React.ReactElement | null;
|
|
5
|
+
//# sourceMappingURL=ActivityIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/features/activity-indicator/adapters/inbound/ActivityIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAcnF,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,8DAA6C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityIndicator as ReactNativeActivityIndicator } from 'react-native';
|
|
3
|
+
import { useZoraTheme } from '../../../../theme/useZoraTheme';
|
|
4
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
5
|
+
/*** Render native loading feedback with a semantic ZORA fallback color. */
|
|
6
|
+
function ActivityIndicatorInner({ themeId: _themeId, mode: _mode, color, ...props }) {
|
|
7
|
+
const { theme } = useZoraTheme();
|
|
8
|
+
return <ReactNativeActivityIndicator {...props} color={color ?? theme.semantics.content.muted}/>;
|
|
9
|
+
}
|
|
10
|
+
/*** Native activity indicator exposed as a serializable ZORA feedback node. */
|
|
11
|
+
export const ActivityIndicator = withZoraThemeScope(ActivityIndicatorInner);
|
|
12
|
+
//# sourceMappingURL=ActivityIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActivityIndicator.js","sourceRoot":"","sources":["../../../../../src/features/activity-indicator/adapters/inbound/ActivityIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,IAAI,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,2EAA2E;AAC3E,SAAS,sBAAsB,CAAC,EAC9B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,GAAG,KAAK,EACe;IACvB,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IAEjC,OAAO,CAAC,4BAA4B,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAG,CAAC;AACpG,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { ActivityIndicator as ReactNativeActivityIndicator } from 'react-native';\n\nimport { useZoraTheme } from '../../../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { ActivityIndicatorProps } from '../../../../types/activity-indicator';\n\n/*** Render native loading feedback with a semantic ZORA fallback color. */\nfunction ActivityIndicatorInner({\n themeId: _themeId,\n mode: _mode,\n color,\n ...props\n}: ActivityIndicatorProps) {\n const { theme } = useZoraTheme();\n\n return <ReactNativeActivityIndicator {...props} color={color ?? theme.semantics.content.muted} />;\n}\n\n/*** Native activity indicator exposed as a serializable ZORA feedback node. */\nexport const ActivityIndicator = withZoraThemeScope(ActivityIndicatorInner);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/activity-indicator/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/activity-indicator/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["export type { ActivityIndicatorProps } from '../../types/activity-indicator';\nexport { ActivityIndicator } from './adapters/inbound/ActivityIndicator';\n"]}
|
|
@@ -2,7 +2,7 @@ export declare const bottomSheetMeta: {
|
|
|
2
2
|
readonly name: "BottomSheet";
|
|
3
3
|
readonly category: "layout";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "
|
|
5
|
+
readonly allowedChildren: readonly ["ActivityIndicator", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly description: "Controlled presentation through the shared single-sheet host. Bind dismiss to clear open.";
|
|
7
7
|
readonly events: {
|
|
8
8
|
readonly dismiss: {
|
|
@@ -2,7 +2,7 @@ export declare const cardMeta: {
|
|
|
2
2
|
readonly name: "Card";
|
|
3
3
|
readonly category: "component";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "
|
|
5
|
+
readonly allowedChildren: readonly ["ActivityIndicator", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Card";
|
|
8
8
|
readonly defaultProps: {
|
|
@@ -2,7 +2,7 @@ export declare const mediaCardMeta: {
|
|
|
2
2
|
readonly name: "MediaCard";
|
|
3
3
|
readonly category: "component";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "
|
|
5
|
+
readonly allowedChildren: readonly ["ActivityIndicator", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly events: {
|
|
7
7
|
readonly press: {
|
|
8
8
|
readonly label: "Press";
|
|
@@ -3,7 +3,7 @@ export declare const postCardMeta: {
|
|
|
3
3
|
readonly category: "pattern";
|
|
4
4
|
readonly description: "Social/content post card with author identity, body, media, actions, and comment previews.";
|
|
5
5
|
readonly directManifestNode: true;
|
|
6
|
-
readonly allowedChildren: readonly ["Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "
|
|
6
|
+
readonly allowedChildren: readonly ["ActivityIndicator", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "IconButton", "SplashScreen", "Uploader", "FlatList", "SectionList", "BottomSheet", "ProductCard", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
7
7
|
readonly blueprint: {
|
|
8
8
|
readonly label: "Post card";
|
|
9
9
|
readonly icon: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../../src/features/data-table/adapters/inbound/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../../src/features/data-table/adapters/inbound/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAKV,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAQtC;;GAEG;AACH,eAAO,MAAM,SAAS,GAuVE,IAAI,SAAS,MAAM,2DAvVgB,CAAC"}
|
|
@@ -3,11 +3,11 @@ import { ScrollView } from 'react-native';
|
|
|
3
3
|
import { DropdownMenu } from '../../../../components/menu';
|
|
4
4
|
import { SkeletonList } from '../../../../components/skeleton';
|
|
5
5
|
import { Show } from '../../../../foundation';
|
|
6
|
-
import { EmptyState } from '../../../../patterns/empty-state';
|
|
7
6
|
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
8
7
|
import { Button } from '../../../button/public';
|
|
9
8
|
import { IconButton } from '../../../button/public';
|
|
10
9
|
import { Card } from '../../../card/public';
|
|
10
|
+
import { EmptyState } from '../../../empty-state/public';
|
|
11
11
|
import { Box, Stack } from '../../../layout/public';
|
|
12
12
|
import { Text } from '../../../typography/public';
|
|
13
13
|
import { resolveDataTableRowKey } from '../../utils/resolveDataTableRowKey';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.js","sourceRoot":"","sources":["../../../../../src/features/data-table/adapters/inbound/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAmB,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAU1E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD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AI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,EAAG,CAAC;IAC1E,CAAC;IAED,MAAM,UAAU,GAAyB;QACvC,GAAG,KAAK;QACR,OAAO;QACP,gBAAgB;QAChB,UAAU;QACV,iBAAiB;QACjB,OAAO;QACP,WAAW;QACX,IAAI;QACJ,MAAM;KACP,CAAC;IAEF,OAAO,CACL,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClB;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAG,CAAC,CACnF;QAAA,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,EACnC;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { InteractionPolicy } from '@ankhorage/surface';\nimport React from 'react';\nimport { ScrollView, type ViewStyle } from 'react-native';\n\nimport { DropdownMenu, type MenuAction } from '../../../../components/menu';\nimport { SkeletonList } from '../../../../components/skeleton';\nimport { Show } from '../../../../foundation';\nimport { EmptyState } from '../../../../patterns/empty-state';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n DataTableCellContext,\n DataTableColumn,\n DataTableColumnAlign,\n DataTableDensity,\n DataTableProps,\n DataTableRowAction,\n DataTableSortDirection,\n} from '../../../../types/data-table';\nimport { Button } from '../../../button/public';\nimport { IconButton } from '../../../button/public';\nimport { Card } from '../../../card/public';\nimport { Box, Stack } from '../../../layout/public';\nimport { Text, type TextAlign } from '../../../typography/public';\nimport { resolveDataTableRowKey } from '../../utils/resolveDataTableRowKey';\n/***\n * Displays structured tabular data with responsive desktop/mobile layouts.\n */\nexport const DataTable = withZoraThemeScope(DataTableInner);\n\nfunction resolveTextAlign(align: DataTableColumnAlign | undefined): TextAlign {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'right';\n case 'start':\n default:\n return 'left';\n }\n}\n\nfunction resolveCellJustify(align: DataTableColumnAlign | undefined): ViewStyle['alignItems'] {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'flex-end';\n case 'start':\n default:\n return 'flex-start';\n }\n}\n\nfunction resolveCellStyle<TRow extends object>(column: DataTableColumn<TRow>): ViewStyle {\n return {\n alignItems: resolveCellJustify(column.align),\n flexGrow: column.width === undefined ? 1 : 0,\n flexShrink: 0,\n minWidth: column.minWidth ?? 140,\n width: column.width,\n };\n}\n\nfunction resolveRowPadding(density: DataTableDensity) {\n return density === 'compact'\n ? { px: 'm' as const, py: 's' as const }\n : { px: 'm' as const, py: 'm' as const };\n}\n\nfunction resolveAccessorValue<TRow extends object>(row: TRow, column: DataTableColumn<TRow>) {\n if (column.accessor === undefined) {\n return undefined;\n }\n\n return row[column.accessor];\n}\n\nfunction renderDefaultCell(value: unknown): React.ReactNode {\n if (value === null || value === undefined) {\n return '—';\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toLocaleDateString();\n }\n\n return '—';\n}\n\nfunction createCellContext<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n): DataTableCellContext<TRow> {\n return {\n column,\n row,\n rowIndex,\n value: resolveAccessorValue(row, column),\n };\n}\n\nfunction renderCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n const context = createCellContext(column, row, rowIndex);\n return column.renderCell ? column.renderCell(context) : renderDefaultCell(context.value);\n}\n\nfunction renderTableCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n if (column.renderCell) {\n return column.renderCell(createCellContext(column, row, rowIndex));\n }\n\n return (\n <Text align={resolveTextAlign(column.align)} variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n );\n}\n\nfunction resolveNextSortDirection(\n current: DataTableSortDirection | undefined,\n): DataTableSortDirection {\n return current === 'asc' ? 'desc' : 'asc';\n}\n\nfunction mapRowActions<TRow extends object>(\n row: TRow,\n actions: readonly DataTableRowAction<TRow>[],\n): readonly MenuAction[] {\n return actions.map((action) => ({\n description: action.description,\n disabled: action.disabled,\n icon: action.icon,\n id: action.id,\n intent: action.intent,\n onPress: action.onPress ? () => action.onPress?.(row) : undefined,\n title: action.title,\n }));\n}\n\nfunction renderRowActions<TRow extends object>({\n row,\n rowIndex,\n rowActions,\n testID,\n interactionPolicy,\n}: {\n row: TRow;\n rowIndex: number;\n rowActions: DataTableProps<TRow>['rowActions'];\n testID?: string;\n interactionPolicy?: InteractionPolicy;\n}): React.ReactNode {\n const actions = rowActions?.(row, rowIndex) ?? [];\n\n if (actions.length === 0) {\n return null;\n }\n\n return (\n <DropdownMenu\n actions={mapRowActions(row, actions)}\n interactionPolicy={interactionPolicy}\n testID={testID ? `${testID}-row-actions-${rowIndex}` : undefined}\n trigger={\n <IconButton\n icon={{ name: 'ellipsis-horizontal' }}\n label=\"Row actions\"\n size=\"s\"\n variant=\"ghost\"\n />\n }\n />\n );\n}\n\nfunction DataTableHeader<TRow extends object>({\n columns,\n sort,\n onSortChange,\n density,\n interactionPolicy,\n}: Pick<DataTableProps<TRow>, 'columns' | 'density' | 'onSortChange' | 'sort'> & {\n interactionPolicy?: InteractionPolicy;\n}) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n const passive = interactionPolicy === 'passive';\n\n return (\n <Box bg=\"subtle\" borderColor=\"border\" borderWidth={1} radius=\"m\">\n <Stack direction=\"row\" align=\"center\">\n {columns.map((column) => {\n const currentDirection = sort?.columnId === column.id ? sort.direction : undefined;\n const sortable = Boolean(column.sortable && onSortChange);\n const directionLabel =\n currentDirection === undefined ? '' : currentDirection === 'asc' ? ' ↑' : ' ↓';\n\n return (\n <Box key={column.id} px={padding.px} py={padding.py} style={resolveCellStyle(column)}>\n {sortable ? (\n <Button\n color=\"primary\"\n interactionPolicy={interactionPolicy}\n onPress={() => {\n if (passive) return;\n\n onSortChange?.({\n columnId: column.id,\n direction: resolveNextSortDirection(currentDirection),\n });\n }}\n size=\"s\"\n variant=\"ghost\"\n >\n {column.header}\n {directionLabel}\n </Button>\n ) : (\n <Text\n align={resolveTextAlign(column.align)}\n emphasis=\"muted\"\n variant=\"caption\"\n weight=\"semiBold\"\n >\n {column.header}\n </Text>\n )}\n </Box>\n );\n })}\n <Box px={padding.px} py={padding.py} style={{ minWidth: 56, width: 56 }}>\n <Text align=\"right\" emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n Actions\n </Text>\n </Box>\n </Stack>\n </Box>\n );\n}\n\nfunction DataTableDesktop<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n sort,\n onSortChange,\n density,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n\n return (\n <ScrollView horizontal showsHorizontalScrollIndicator={false}>\n <Box minWidth={720} style={{ width: '100%' }}>\n <Stack gap=\"xs\">\n <DataTableHeader\n columns={columns}\n density={density}\n interactionPolicy={interactionPolicy}\n onSortChange={onSortChange}\n sort={sort}\n />\n <Stack gap=\"xs\">\n {rows.map((row, rowIndex) => (\n <Box\n bg=\"surface\"\n borderColor=\"border\"\n borderWidth={1}\n key={resolveDataTableRowKey(row, rowIndex, rowKey, rowId)}\n radius=\"m\"\n testID={testID ? `${testID}-row-${rowIndex}` : undefined}\n >\n <Stack direction=\"row\" align=\"center\">\n {columns.map((column) => (\n <Box\n key={column.id}\n px={padding.px}\n py={padding.py}\n style={resolveCellStyle(column)}\n >\n {renderTableCell(column, row, rowIndex)}\n </Box>\n ))}\n <Box\n px={padding.px}\n py={padding.py}\n style={{ alignItems: 'flex-end', minWidth: 56, width: 56 }}\n >\n {renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy })}\n </Box>\n </Stack>\n </Box>\n ))}\n </Stack>\n </Stack>\n </Box>\n </ScrollView>\n );\n}\n\nfunction DataTableMobile<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const [primaryColumn, ...detailColumns] = columns;\n\n return (\n <Stack gap=\"s\">\n {rows.map((row, rowIndex) => {\n const title = primaryColumn\n ? renderCell(primaryColumn, row, rowIndex)\n : `Row ${rowIndex + 1}`;\n const actions = renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy });\n\n return (\n <Card\n actions={actions}\n compact\n interactionPolicy={interactionPolicy}\n key={resolveDataTableRowKey(row, rowIndex, rowKey, rowId)}\n testID={testID ? `${testID}-card-${rowIndex}` : undefined}\n title={title}\n >\n <Stack gap=\"s\">\n {detailColumns.map((column) => (\n <Stack gap=\"xxs\" key={column.id}>\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {column.header}\n </Text>\n {column.renderCell ? (\n renderCell(column, row, rowIndex)\n ) : (\n <Text variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n )}\n </Stack>\n ))}\n </Stack>\n </Card>\n );\n })}\n </Stack>\n );\n}\n\nfunction DataTableInner<TRow extends object>({\n themeId: _themeId,\n mode: _mode,\n rows,\n loading = false,\n loadingRows = 5,\n emptyTitle = 'No data',\n emptyDescription = 'There are no rows to display.',\n testID,\n density = 'comfortable',\n interactionPolicy,\n ...props\n}: DataTableProps<TRow>) {\n if (loading) {\n return <SkeletonList rows={loadingRows} variant=\"card\" testID={testID} />;\n }\n\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} />;\n }\n\n const tableProps: DataTableProps<TRow> = {\n ...props,\n density,\n emptyDescription,\n emptyTitle,\n interactionPolicy,\n loading,\n loadingRows,\n rows,\n testID,\n };\n\n return (\n <Box testID={testID}>\n <Show when={{ base: false, md: true }} fallback={<DataTableMobile {...tableProps} />}>\n <DataTableDesktop {...tableProps} />\n </Show>\n </Box>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DataTable.js","sourceRoot":"","sources":["../../../../../src/features/data-table/adapters/inbound/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAmB,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAU1E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAkB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAE5D,SAAS,gBAAgB,CAAC,KAAuC;IAC/D,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,KAAK;YACR,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO,CAAC;QACb;YACE,OAAO,MAAM,CAAC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,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAG,CAAC,CACnF;QAAA,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,EACnC;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { InteractionPolicy } from '@ankhorage/surface';\nimport React from 'react';\nimport { ScrollView, type ViewStyle } from 'react-native';\n\nimport { DropdownMenu, type MenuAction } from '../../../../components/menu';\nimport { SkeletonList } from '../../../../components/skeleton';\nimport { Show } from '../../../../foundation';\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n DataTableCellContext,\n DataTableColumn,\n DataTableColumnAlign,\n DataTableDensity,\n DataTableProps,\n DataTableRowAction,\n DataTableSortDirection,\n} from '../../../../types/data-table';\nimport { Button } from '../../../button/public';\nimport { IconButton } from '../../../button/public';\nimport { Card } from '../../../card/public';\nimport { EmptyState } from '../../../empty-state/public';\nimport { Box, Stack } from '../../../layout/public';\nimport { Text, type TextAlign } from '../../../typography/public';\nimport { resolveDataTableRowKey } from '../../utils/resolveDataTableRowKey';\n/***\n * Displays structured tabular data with responsive desktop/mobile layouts.\n */\nexport const DataTable = withZoraThemeScope(DataTableInner);\n\nfunction resolveTextAlign(align: DataTableColumnAlign | undefined): TextAlign {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'right';\n case 'start':\n default:\n return 'left';\n }\n}\n\nfunction resolveCellJustify(align: DataTableColumnAlign | undefined): ViewStyle['alignItems'] {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'flex-end';\n case 'start':\n default:\n return 'flex-start';\n }\n}\n\nfunction resolveCellStyle<TRow extends object>(column: DataTableColumn<TRow>): ViewStyle {\n return {\n alignItems: resolveCellJustify(column.align),\n flexGrow: column.width === undefined ? 1 : 0,\n flexShrink: 0,\n minWidth: column.minWidth ?? 140,\n width: column.width,\n };\n}\n\nfunction resolveRowPadding(density: DataTableDensity) {\n return density === 'compact'\n ? { px: 'm' as const, py: 's' as const }\n : { px: 'm' as const, py: 'm' as const };\n}\n\nfunction resolveAccessorValue<TRow extends object>(row: TRow, column: DataTableColumn<TRow>) {\n if (column.accessor === undefined) {\n return undefined;\n }\n\n return row[column.accessor];\n}\n\nfunction renderDefaultCell(value: unknown): React.ReactNode {\n if (value === null || value === undefined) {\n return '—';\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toLocaleDateString();\n }\n\n return '—';\n}\n\nfunction createCellContext<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n): DataTableCellContext<TRow> {\n return {\n column,\n row,\n rowIndex,\n value: resolveAccessorValue(row, column),\n };\n}\n\nfunction renderCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n const context = createCellContext(column, row, rowIndex);\n return column.renderCell ? column.renderCell(context) : renderDefaultCell(context.value);\n}\n\nfunction renderTableCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n if (column.renderCell) {\n return column.renderCell(createCellContext(column, row, rowIndex));\n }\n\n return (\n <Text align={resolveTextAlign(column.align)} variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n );\n}\n\nfunction resolveNextSortDirection(\n current: DataTableSortDirection | undefined,\n): DataTableSortDirection {\n return current === 'asc' ? 'desc' : 'asc';\n}\n\nfunction mapRowActions<TRow extends object>(\n row: TRow,\n actions: readonly DataTableRowAction<TRow>[],\n): readonly MenuAction[] {\n return actions.map((action) => ({\n description: action.description,\n disabled: action.disabled,\n icon: action.icon,\n id: action.id,\n intent: action.intent,\n onPress: action.onPress ? () => action.onPress?.(row) : undefined,\n title: action.title,\n }));\n}\n\nfunction renderRowActions<TRow extends object>({\n row,\n rowIndex,\n rowActions,\n testID,\n interactionPolicy,\n}: {\n row: TRow;\n rowIndex: number;\n rowActions: DataTableProps<TRow>['rowActions'];\n testID?: string;\n interactionPolicy?: InteractionPolicy;\n}): React.ReactNode {\n const actions = rowActions?.(row, rowIndex) ?? [];\n\n if (actions.length === 0) {\n return null;\n }\n\n return (\n <DropdownMenu\n actions={mapRowActions(row, actions)}\n interactionPolicy={interactionPolicy}\n testID={testID ? `${testID}-row-actions-${rowIndex}` : undefined}\n trigger={\n <IconButton\n icon={{ name: 'ellipsis-horizontal' }}\n label=\"Row actions\"\n size=\"s\"\n variant=\"ghost\"\n />\n }\n />\n );\n}\n\nfunction DataTableHeader<TRow extends object>({\n columns,\n sort,\n onSortChange,\n density,\n interactionPolicy,\n}: Pick<DataTableProps<TRow>, 'columns' | 'density' | 'onSortChange' | 'sort'> & {\n interactionPolicy?: InteractionPolicy;\n}) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n const passive = interactionPolicy === 'passive';\n\n return (\n <Box bg=\"subtle\" borderColor=\"border\" borderWidth={1} radius=\"m\">\n <Stack direction=\"row\" align=\"center\">\n {columns.map((column) => {\n const currentDirection = sort?.columnId === column.id ? sort.direction : undefined;\n const sortable = Boolean(column.sortable && onSortChange);\n const directionLabel =\n currentDirection === undefined ? '' : currentDirection === 'asc' ? ' ↑' : ' ↓';\n\n return (\n <Box key={column.id} px={padding.px} py={padding.py} style={resolveCellStyle(column)}>\n {sortable ? (\n <Button\n color=\"primary\"\n interactionPolicy={interactionPolicy}\n onPress={() => {\n if (passive) return;\n\n onSortChange?.({\n columnId: column.id,\n direction: resolveNextSortDirection(currentDirection),\n });\n }}\n size=\"s\"\n variant=\"ghost\"\n >\n {column.header}\n {directionLabel}\n </Button>\n ) : (\n <Text\n align={resolveTextAlign(column.align)}\n emphasis=\"muted\"\n variant=\"caption\"\n weight=\"semiBold\"\n >\n {column.header}\n </Text>\n )}\n </Box>\n );\n })}\n <Box px={padding.px} py={padding.py} style={{ minWidth: 56, width: 56 }}>\n <Text align=\"right\" emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n Actions\n </Text>\n </Box>\n </Stack>\n </Box>\n );\n}\n\nfunction DataTableDesktop<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n sort,\n onSortChange,\n density,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n\n return (\n <ScrollView horizontal showsHorizontalScrollIndicator={false}>\n <Box minWidth={720} style={{ width: '100%' }}>\n <Stack gap=\"xs\">\n <DataTableHeader\n columns={columns}\n density={density}\n interactionPolicy={interactionPolicy}\n onSortChange={onSortChange}\n sort={sort}\n />\n <Stack gap=\"xs\">\n {rows.map((row, rowIndex) => (\n <Box\n bg=\"surface\"\n borderColor=\"border\"\n borderWidth={1}\n key={resolveDataTableRowKey(row, rowIndex, rowKey, rowId)}\n radius=\"m\"\n testID={testID ? `${testID}-row-${rowIndex}` : undefined}\n >\n <Stack direction=\"row\" align=\"center\">\n {columns.map((column) => (\n <Box\n key={column.id}\n px={padding.px}\n py={padding.py}\n style={resolveCellStyle(column)}\n >\n {renderTableCell(column, row, rowIndex)}\n </Box>\n ))}\n <Box\n px={padding.px}\n py={padding.py}\n style={{ alignItems: 'flex-end', minWidth: 56, width: 56 }}\n >\n {renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy })}\n </Box>\n </Stack>\n </Box>\n ))}\n </Stack>\n </Stack>\n </Box>\n </ScrollView>\n );\n}\n\nfunction DataTableMobile<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const [primaryColumn, ...detailColumns] = columns;\n\n return (\n <Stack gap=\"s\">\n {rows.map((row, rowIndex) => {\n const title = primaryColumn\n ? renderCell(primaryColumn, row, rowIndex)\n : `Row ${rowIndex + 1}`;\n const actions = renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy });\n\n return (\n <Card\n actions={actions}\n compact\n interactionPolicy={interactionPolicy}\n key={resolveDataTableRowKey(row, rowIndex, rowKey, rowId)}\n testID={testID ? `${testID}-card-${rowIndex}` : undefined}\n title={title}\n >\n <Stack gap=\"s\">\n {detailColumns.map((column) => (\n <Stack gap=\"xxs\" key={column.id}>\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {column.header}\n </Text>\n {column.renderCell ? (\n renderCell(column, row, rowIndex)\n ) : (\n <Text variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n )}\n </Stack>\n ))}\n </Stack>\n </Card>\n );\n })}\n </Stack>\n );\n}\n\nfunction DataTableInner<TRow extends object>({\n themeId: _themeId,\n mode: _mode,\n rows,\n loading = false,\n loadingRows = 5,\n emptyTitle = 'No data',\n emptyDescription = 'There are no rows to display.',\n testID,\n density = 'comfortable',\n interactionPolicy,\n ...props\n}: DataTableProps<TRow>) {\n if (loading) {\n return <SkeletonList rows={loadingRows} variant=\"card\" testID={testID} />;\n }\n\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} />;\n }\n\n const tableProps: DataTableProps<TRow> = {\n ...props,\n density,\n emptyDescription,\n emptyTitle,\n interactionPolicy,\n loading,\n loadingRows,\n rows,\n testID,\n };\n\n return (\n <Box testID={testID}>\n <Show when={{ base: false, md: true }} fallback={<DataTableMobile {...tableProps} />}>\n <DataTableDesktop {...tableProps} />\n </Show>\n </Box>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../../src/features/empty-state/adapters/inbound/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA0DrE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
|
|
3
|
+
import { Button } from '../../../button/public';
|
|
4
|
+
import { Card } from '../../../card/public';
|
|
5
|
+
import { Stack } from '../../../layout/public';
|
|
6
6
|
function EmptyStateInner({ themeId: _themeId, mode: _mode, interactionPolicy, title, description, eyebrow, primaryAction, secondaryAction, footer, testID, }) {
|
|
7
7
|
return (<Card compact description={description} eyebrow={eyebrow} interactionPolicy={interactionPolicy} testID={testID} title={title} tone="subtle">
|
|
8
8
|
<Stack gap="m">
|