@ankhorage/zora 0.9.0 → 0.11.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 +12 -0
- package/README.md +80 -34
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/Badge.d.ts.map +1 -1
- package/dist/components/badge/Badge.js +3 -1
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/badge/types.d.ts +2 -1
- package/dist/components/badge/types.d.ts.map +1 -1
- package/dist/components/badge/types.js.map +1 -1
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +3 -1
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/types.d.ts +2 -1
- package/dist/components/button/types.d.ts.map +1 -1
- package/dist/components/button/types.js.map +1 -1
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +3 -1
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/card/types.d.ts +2 -1
- package/dist/components/card/types.d.ts.map +1 -1
- package/dist/components/card/types.js.map +1 -1
- package/dist/components/checkbox/Checkbox.d.ts +4 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.js +8 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.js +3 -1
- package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +2 -3
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/types.d.ts +5 -2
- package/dist/components/checkbox/types.d.ts.map +1 -1
- package/dist/components/checkbox/types.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +3 -1
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/types.d.ts +2 -1
- package/dist/components/drawer/types.d.ts.map +1 -1
- package/dist/components/drawer/types.js.map +1 -1
- package/dist/components/form/Form.d.ts +1 -1
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/form/Form.js +3 -1
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/form/FormActions.d.ts +1 -1
- package/dist/components/form/FormActions.d.ts.map +1 -1
- package/dist/components/form/FormActions.js +3 -1
- package/dist/components/form/FormActions.js.map +1 -1
- package/dist/components/form/FormError.d.ts +1 -1
- package/dist/components/form/FormError.d.ts.map +1 -1
- package/dist/components/form/FormError.js +6 -3
- package/dist/components/form/FormError.js.map +1 -1
- package/dist/components/form/FormField.d.ts +1 -1
- package/dist/components/form/FormField.d.ts.map +1 -1
- package/dist/components/form/FormField.js +5 -3
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/types.d.ts +6 -9
- package/dist/components/form/types.d.ts.map +1 -1
- package/dist/components/form/types.js.map +1 -1
- package/dist/components/heading/Heading.d.ts +1 -1
- package/dist/components/heading/Heading.d.ts.map +1 -1
- package/dist/components/heading/Heading.js +3 -1
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/heading/types.d.ts +2 -2
- package/dist/components/heading/types.d.ts.map +1 -1
- package/dist/components/heading/types.js.map +1 -1
- package/dist/components/icon/Icon.d.ts +4 -2
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/Icon.js +3 -1
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon-button/IconButton.d.ts +1 -1
- package/dist/components/icon-button/IconButton.d.ts.map +1 -1
- package/dist/components/icon-button/IconButton.js +3 -1
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/icon-button/types.d.ts +2 -1
- package/dist/components/icon-button/types.d.ts.map +1 -1
- package/dist/components/icon-button/types.js.map +1 -1
- package/dist/components/input/Input.d.ts +1 -1
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +5 -2
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input/types.d.ts +2 -1
- package/dist/components/input/types.d.ts.map +1 -1
- package/dist/components/input/types.js.map +1 -1
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +3 -1
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/types.d.ts +2 -1
- package/dist/components/modal/types.d.ts.map +1 -1
- package/dist/components/modal/types.js.map +1 -1
- package/dist/components/radio/Radio.d.ts +4 -0
- package/dist/components/radio/Radio.d.ts.map +1 -0
- package/dist/components/radio/Radio.js +8 -0
- package/dist/components/radio/Radio.js.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +1 -1
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +3 -1
- package/dist/components/radio/RadioGroup.js.map +1 -1
- package/dist/components/radio/index.d.ts +2 -3
- package/dist/components/radio/index.d.ts.map +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/types.d.ts +5 -2
- package/dist/components/radio/types.d.ts.map +1 -1
- package/dist/components/radio/types.js.map +1 -1
- package/dist/components/select/Select.d.ts +1 -1
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +6 -3
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/types.d.ts +2 -2
- package/dist/components/select/types.d.ts.map +1 -1
- package/dist/components/select/types.js.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +6 -3
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/types.d.ts +2 -2
- package/dist/components/tabs/types.d.ts.map +1 -1
- package/dist/components/tabs/types.js.map +1 -1
- package/dist/components/text/Text.d.ts +1 -1
- package/dist/components/text/Text.d.ts.map +1 -1
- package/dist/components/text/Text.js +3 -1
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/text/types.d.ts +2 -2
- package/dist/components/text/types.d.ts.map +1 -1
- package/dist/components/text/types.js.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +1 -1
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +5 -2
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea/types.d.ts +2 -1
- package/dist/components/textarea/types.d.ts.map +1 -1
- package/dist/components/textarea/types.js.map +1 -1
- package/dist/components/toolbar/Toolbar.d.ts +1 -1
- package/dist/components/toolbar/Toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/Toolbar.js +3 -1
- package/dist/components/toolbar/Toolbar.js.map +1 -1
- package/dist/components/toolbar/ToolbarAction.d.ts +1 -1
- package/dist/components/toolbar/ToolbarAction.d.ts.map +1 -1
- package/dist/components/toolbar/ToolbarAction.js +3 -1
- package/dist/components/toolbar/ToolbarAction.js.map +1 -1
- package/dist/components/toolbar/types.d.ts +3 -4
- package/dist/components/toolbar/types.d.ts.map +1 -1
- package/dist/components/toolbar/types.js.map +1 -1
- package/dist/foundation/Box.d.ts +7 -0
- package/dist/foundation/Box.d.ts.map +1 -0
- package/dist/foundation/Box.js +8 -0
- package/dist/foundation/Box.js.map +1 -0
- package/dist/foundation/Center.d.ts +7 -0
- package/dist/foundation/Center.d.ts.map +1 -0
- package/dist/foundation/Center.js +8 -0
- package/dist/foundation/Center.js.map +1 -0
- package/dist/foundation/Container.d.ts +7 -0
- package/dist/foundation/Container.d.ts.map +1 -0
- package/dist/foundation/Container.js +8 -0
- package/dist/foundation/Container.js.map +1 -0
- package/dist/foundation/Divider.d.ts +7 -0
- package/dist/foundation/Divider.d.ts.map +1 -0
- package/dist/foundation/Divider.js +8 -0
- package/dist/foundation/Divider.js.map +1 -0
- package/dist/foundation/Grid.d.ts +7 -0
- package/dist/foundation/Grid.d.ts.map +1 -0
- package/dist/foundation/Grid.js +8 -0
- package/dist/foundation/Grid.js.map +1 -0
- package/dist/foundation/Inline.d.ts +7 -0
- package/dist/foundation/Inline.d.ts.map +1 -0
- package/dist/foundation/Inline.js +8 -0
- package/dist/foundation/Inline.js.map +1 -0
- package/dist/foundation/Show.d.ts +7 -0
- package/dist/foundation/Show.d.ts.map +1 -0
- package/dist/foundation/Show.js +8 -0
- package/dist/foundation/Show.js.map +1 -0
- package/dist/foundation/Spacer.d.ts +7 -0
- package/dist/foundation/Spacer.d.ts.map +1 -0
- package/dist/foundation/Spacer.js +8 -0
- package/dist/foundation/Spacer.js.map +1 -0
- package/dist/foundation/Stack.d.ts +7 -0
- package/dist/foundation/Stack.d.ts.map +1 -0
- package/dist/foundation/Stack.js +8 -0
- package/dist/foundation/Stack.js.map +1 -0
- package/dist/foundation/Surface.d.ts +8 -0
- package/dist/foundation/Surface.d.ts.map +1 -0
- package/dist/foundation/Surface.js +8 -0
- package/dist/foundation/Surface.js.map +1 -0
- package/dist/foundation/index.d.ts +20 -2
- package/dist/foundation/index.d.ts.map +1 -1
- package/dist/foundation/index.js +10 -1
- package/dist/foundation/index.js.map +1 -1
- package/dist/layout/app-shell/AppShell.d.ts +1 -1
- package/dist/layout/app-shell/AppShell.d.ts.map +1 -1
- package/dist/layout/app-shell/AppShell.js +3 -1
- package/dist/layout/app-shell/AppShell.js.map +1 -1
- package/dist/layout/app-shell/types.d.ts +2 -2
- package/dist/layout/app-shell/types.d.ts.map +1 -1
- package/dist/layout/app-shell/types.js.map +1 -1
- package/dist/layout/auth-layout/AuthLayout.d.ts +1 -1
- package/dist/layout/auth-layout/AuthLayout.d.ts.map +1 -1
- package/dist/layout/auth-layout/AuthLayout.js +3 -1
- package/dist/layout/auth-layout/AuthLayout.js.map +1 -1
- package/dist/layout/auth-layout/types.d.ts +2 -2
- package/dist/layout/auth-layout/types.d.ts.map +1 -1
- package/dist/layout/auth-layout/types.js.map +1 -1
- package/dist/layout/page/Page.d.ts +1 -1
- package/dist/layout/page/Page.d.ts.map +1 -1
- package/dist/layout/page/Page.js +3 -1
- package/dist/layout/page/Page.js.map +1 -1
- package/dist/layout/page/types.d.ts +2 -2
- package/dist/layout/page/types.d.ts.map +1 -1
- package/dist/layout/page/types.js.map +1 -1
- package/dist/layout/page-header/PageHeader.d.ts +1 -1
- package/dist/layout/page-header/PageHeader.d.ts.map +1 -1
- package/dist/layout/page-header/PageHeader.js +3 -1
- package/dist/layout/page-header/PageHeader.js.map +1 -1
- package/dist/layout/page-header/types.d.ts +2 -2
- package/dist/layout/page-header/types.d.ts.map +1 -1
- package/dist/layout/page-header/types.js.map +1 -1
- package/dist/layout/page-section/PageSection.d.ts +1 -1
- package/dist/layout/page-section/PageSection.d.ts.map +1 -1
- package/dist/layout/page-section/PageSection.js +3 -1
- package/dist/layout/page-section/PageSection.js.map +1 -1
- package/dist/layout/page-section/types.d.ts +2 -2
- package/dist/layout/page-section/types.d.ts.map +1 -1
- package/dist/layout/page-section/types.js.map +1 -1
- package/dist/layout/settings-layout/SettingsLayout.d.ts +1 -1
- package/dist/layout/settings-layout/SettingsLayout.d.ts.map +1 -1
- package/dist/layout/settings-layout/SettingsLayout.js +3 -1
- package/dist/layout/settings-layout/SettingsLayout.js.map +1 -1
- package/dist/layout/settings-layout/types.d.ts +2 -2
- package/dist/layout/settings-layout/types.d.ts.map +1 -1
- package/dist/layout/settings-layout/types.js.map +1 -1
- package/dist/layout/sidebar-layout/SidebarLayout.d.ts +1 -1
- package/dist/layout/sidebar-layout/SidebarLayout.d.ts.map +1 -1
- package/dist/layout/sidebar-layout/SidebarLayout.js +3 -1
- package/dist/layout/sidebar-layout/SidebarLayout.js.map +1 -1
- package/dist/layout/sidebar-layout/types.d.ts +2 -2
- package/dist/layout/sidebar-layout/types.d.ts.map +1 -1
- package/dist/layout/sidebar-layout/types.js.map +1 -1
- package/dist/layout/topbar-layout/TopbarLayout.d.ts +1 -1
- package/dist/layout/topbar-layout/TopbarLayout.d.ts.map +1 -1
- package/dist/layout/topbar-layout/TopbarLayout.js +3 -1
- package/dist/layout/topbar-layout/TopbarLayout.js.map +1 -1
- package/dist/layout/topbar-layout/types.d.ts +2 -2
- package/dist/layout/topbar-layout/types.d.ts.map +1 -1
- package/dist/layout/topbar-layout/types.js.map +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.d.ts +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.js +3 -1
- package/dist/patterns/auth/ForgotPasswordForm.js.map +1 -1
- package/dist/patterns/auth/OtpForm.d.ts +1 -1
- package/dist/patterns/auth/OtpForm.d.ts.map +1 -1
- package/dist/patterns/auth/OtpForm.js +3 -1
- package/dist/patterns/auth/OtpForm.js.map +1 -1
- package/dist/patterns/auth/SignInForm.d.ts +1 -1
- package/dist/patterns/auth/SignInForm.d.ts.map +1 -1
- package/dist/patterns/auth/SignInForm.js +3 -1
- package/dist/patterns/auth/SignInForm.js.map +1 -1
- package/dist/patterns/auth/SignUpForm.d.ts +1 -1
- package/dist/patterns/auth/SignUpForm.d.ts.map +1 -1
- package/dist/patterns/auth/SignUpForm.js +3 -1
- package/dist/patterns/auth/SignUpForm.js.map +1 -1
- package/dist/patterns/auth/types.d.ts +2 -2
- package/dist/patterns/auth/types.d.ts.map +1 -1
- package/dist/patterns/auth/types.js.map +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.d.ts +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.d.ts.map +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.js +3 -1
- package/dist/patterns/collection-editor/CollectionEditor.js.map +1 -1
- package/dist/patterns/collection-editor/types.d.ts +2 -2
- package/dist/patterns/collection-editor/types.d.ts.map +1 -1
- package/dist/patterns/collection-editor/types.js.map +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js +3 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +1 -1
- package/dist/patterns/confirm-dialog/types.d.ts +2 -2
- package/dist/patterns/confirm-dialog/types.d.ts.map +1 -1
- package/dist/patterns/confirm-dialog/types.js.map +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.d.ts +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.d.ts.map +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.js +3 -1
- package/dist/patterns/disclosure-section/DisclosureSection.js.map +1 -1
- package/dist/patterns/disclosure-section/types.d.ts +2 -2
- package/dist/patterns/disclosure-section/types.d.ts.map +1 -1
- package/dist/patterns/disclosure-section/types.js.map +1 -1
- package/dist/patterns/empty-state/EmptyState.d.ts +1 -1
- package/dist/patterns/empty-state/EmptyState.d.ts.map +1 -1
- package/dist/patterns/empty-state/EmptyState.js +3 -1
- package/dist/patterns/empty-state/EmptyState.js.map +1 -1
- package/dist/patterns/empty-state/types.d.ts +2 -2
- package/dist/patterns/empty-state/types.d.ts.map +1 -1
- package/dist/patterns/empty-state/types.js.map +1 -1
- package/dist/patterns/form-field/FormField.d.ts +1 -1
- package/dist/patterns/form-field/FormField.d.ts.map +1 -1
- package/dist/patterns/form-field/FormField.js +3 -1
- package/dist/patterns/form-field/FormField.js.map +1 -1
- package/dist/patterns/form-field/types.d.ts +2 -1
- package/dist/patterns/form-field/types.d.ts.map +1 -1
- package/dist/patterns/form-field/types.js.map +1 -1
- package/dist/patterns/inspector-field/InspectorField.d.ts +1 -1
- package/dist/patterns/inspector-field/InspectorField.d.ts.map +1 -1
- package/dist/patterns/inspector-field/InspectorField.js +3 -1
- package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
- package/dist/patterns/inspector-field/types.d.ts +2 -2
- package/dist/patterns/inspector-field/types.d.ts.map +1 -1
- package/dist/patterns/inspector-field/types.js.map +1 -1
- package/dist/patterns/notice/Notice.d.ts +1 -1
- package/dist/patterns/notice/Notice.d.ts.map +1 -1
- package/dist/patterns/notice/Notice.js +3 -1
- package/dist/patterns/notice/Notice.js.map +1 -1
- package/dist/patterns/notice/types.d.ts +2 -2
- package/dist/patterns/notice/types.d.ts.map +1 -1
- package/dist/patterns/notice/types.js.map +1 -1
- package/dist/patterns/panel/Panel.d.ts +1 -1
- package/dist/patterns/panel/Panel.d.ts.map +1 -1
- package/dist/patterns/panel/Panel.js +3 -1
- package/dist/patterns/panel/Panel.js.map +1 -1
- package/dist/patterns/panel/types.d.ts +2 -2
- package/dist/patterns/panel/types.d.ts.map +1 -1
- package/dist/patterns/panel/types.js.map +1 -1
- package/dist/patterns/responsive-panel/ResponsivePanel.d.ts +1 -1
- package/dist/patterns/responsive-panel/ResponsivePanel.d.ts.map +1 -1
- package/dist/patterns/responsive-panel/ResponsivePanel.js +3 -1
- package/dist/patterns/responsive-panel/ResponsivePanel.js.map +1 -1
- package/dist/patterns/responsive-panel/types.d.ts +2 -2
- package/dist/patterns/responsive-panel/types.d.ts.map +1 -1
- package/dist/patterns/responsive-panel/types.js.map +1 -1
- package/dist/patterns/section-header/SectionHeader.d.ts +1 -1
- package/dist/patterns/section-header/SectionHeader.d.ts.map +1 -1
- package/dist/patterns/section-header/SectionHeader.js +3 -1
- package/dist/patterns/section-header/SectionHeader.js.map +1 -1
- package/dist/patterns/section-header/types.d.ts +2 -2
- package/dist/patterns/section-header/types.d.ts.map +1 -1
- package/dist/patterns/section-header/types.js.map +1 -1
- package/dist/patterns/settings-row/SettingsRow.d.ts +1 -1
- package/dist/patterns/settings-row/SettingsRow.d.ts.map +1 -1
- package/dist/patterns/settings-row/SettingsRow.js +3 -1
- package/dist/patterns/settings-row/SettingsRow.js.map +1 -1
- package/dist/patterns/settings-row/types.d.ts +2 -2
- package/dist/patterns/settings-row/types.d.ts.map +1 -1
- package/dist/patterns/settings-row/types.js.map +1 -1
- package/dist/patterns/switch-field/SwitchField.d.ts +1 -1
- package/dist/patterns/switch-field/SwitchField.d.ts.map +1 -1
- package/dist/patterns/switch-field/SwitchField.js +3 -1
- package/dist/patterns/switch-field/SwitchField.js.map +1 -1
- package/dist/patterns/switch-field/types.d.ts +2 -2
- package/dist/patterns/switch-field/types.d.ts.map +1 -1
- package/dist/patterns/switch-field/types.js.map +1 -1
- package/dist/patterns/tile-grid/PaletteItem.d.ts +1 -1
- package/dist/patterns/tile-grid/PaletteItem.d.ts.map +1 -1
- package/dist/patterns/tile-grid/PaletteItem.js +6 -3
- package/dist/patterns/tile-grid/PaletteItem.js.map +1 -1
- package/dist/patterns/tile-grid/TileGrid.d.ts +1 -1
- package/dist/patterns/tile-grid/TileGrid.d.ts.map +1 -1
- package/dist/patterns/tile-grid/TileGrid.js +3 -1
- package/dist/patterns/tile-grid/TileGrid.js.map +1 -1
- package/dist/patterns/tile-grid/types.d.ts +3 -4
- package/dist/patterns/tile-grid/types.d.ts.map +1 -1
- package/dist/patterns/tile-grid/types.js.map +1 -1
- package/dist/patterns/tree-view/TreeItem.d.ts +3 -2
- package/dist/patterns/tree-view/TreeItem.d.ts.map +1 -1
- package/dist/patterns/tree-view/TreeItem.js +4 -2
- package/dist/patterns/tree-view/TreeItem.js.map +1 -1
- package/dist/patterns/tree-view/TreeView.d.ts +1 -1
- package/dist/patterns/tree-view/TreeView.d.ts.map +1 -1
- package/dist/patterns/tree-view/TreeView.js +3 -1
- package/dist/patterns/tree-view/TreeView.js.map +1 -1
- package/dist/patterns/tree-view/types.d.ts +2 -2
- package/dist/patterns/tree-view/types.d.ts.map +1 -1
- package/dist/patterns/tree-view/types.js.map +1 -1
- package/dist/theme/ZoraBaseProps.d.ts +18 -0
- package/dist/theme/ZoraBaseProps.d.ts.map +1 -0
- package/dist/theme/ZoraBaseProps.js +2 -0
- package/dist/theme/ZoraBaseProps.js.map +1 -0
- package/dist/theme/ZoraProvider.d.ts.map +1 -1
- package/dist/theme/ZoraProvider.js +8 -4
- package/dist/theme/ZoraProvider.js.map +1 -1
- package/dist/theme/ZoraThemeRuntimeContext.d.ts +9 -0
- package/dist/theme/ZoraThemeRuntimeContext.d.ts.map +1 -0
- package/dist/theme/ZoraThemeRuntimeContext.js +10 -0
- package/dist/theme/ZoraThemeRuntimeContext.js.map +1 -0
- package/dist/theme/ZoraThemeScope.d.ts +9 -0
- package/dist/theme/ZoraThemeScope.d.ts.map +1 -0
- package/dist/theme/ZoraThemeScope.js +41 -0
- package/dist/theme/ZoraThemeScope.js.map +1 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/resolveZoraScopedThemeId.d.ts +6 -0
- package/dist/theme/resolveZoraScopedThemeId.d.ts.map +1 -0
- package/dist/theme/resolveZoraScopedThemeId.js +15 -0
- package/dist/theme/resolveZoraScopedThemeId.js.map +1 -0
- package/dist/theme/withZoraThemeScope.d.ts +4 -0
- package/dist/theme/withZoraThemeScope.d.ts.map +1 -0
- package/dist/theme/withZoraThemeScope.js +16 -0
- package/dist/theme/withZoraThemeScope.js.map +1 -0
- package/package.json +1 -1
- package/src/components/badge/Badge.tsx +12 -1
- package/src/components/badge/types.ts +5 -4
- package/src/components/button/Button.tsx +11 -1
- package/src/components/button/types.ts +3 -4
- package/src/components/card/Card.tsx +6 -1
- package/src/components/card/types.ts +3 -1
- package/src/components/checkbox/Checkbox.tsx +11 -0
- package/src/components/checkbox/CheckboxGroup.tsx +6 -1
- package/src/components/checkbox/index.ts +2 -3
- package/src/components/checkbox/types.ts +13 -5
- package/src/components/drawer/Drawer.tsx +13 -1
- package/src/components/drawer/types.ts +9 -4
- package/src/components/form/Form.tsx +6 -1
- package/src/components/form/FormActions.tsx +6 -1
- package/src/components/form/FormError.tsx +7 -3
- package/src/components/form/FormField.tsx +24 -3
- package/src/components/form/types.ts +12 -12
- package/src/components/heading/Heading.tsx +6 -1
- package/src/components/heading/types.ts +3 -2
- package/src/components/icon/Icon.tsx +7 -2
- package/src/components/icon-button/IconButton.tsx +6 -1
- package/src/components/icon-button/types.ts +2 -1
- package/src/components/input/Input.tsx +13 -2
- package/src/components/input/types.ts +8 -4
- package/src/components/modal/Modal.tsx +6 -1
- package/src/components/modal/types.ts +5 -4
- package/src/components/radio/Radio.tsx +11 -0
- package/src/components/radio/RadioGroup.tsx +6 -1
- package/src/components/radio/index.ts +2 -3
- package/src/components/radio/types.ts +12 -5
- package/src/components/select/Select.tsx +9 -3
- package/src/components/select/types.ts +3 -2
- package/src/components/tabs/Tabs.tsx +9 -3
- package/src/components/tabs/types.ts +2 -2
- package/src/components/text/Text.tsx +6 -1
- package/src/components/text/types.ts +3 -2
- package/src/components/textarea/Textarea.tsx +13 -2
- package/src/components/textarea/types.ts +8 -4
- package/src/components/toolbar/Toolbar.tsx +6 -1
- package/src/components/toolbar/ToolbarAction.tsx +9 -1
- package/src/components/toolbar/types.ts +4 -4
- package/src/foundation/Box.tsx +13 -0
- package/src/foundation/Center.tsx +16 -0
- package/src/foundation/Container.tsx +17 -0
- package/src/foundation/Divider.tsx +17 -0
- package/src/foundation/Grid.tsx +13 -0
- package/src/foundation/Inline.tsx +16 -0
- package/src/foundation/Show.tsx +13 -0
- package/src/foundation/Spacer.tsx +16 -0
- package/src/foundation/Stack.tsx +13 -0
- package/src/foundation/Surface.tsx +20 -0
- package/src/foundation/index.test.ts +2 -2
- package/src/foundation/index.ts +20 -25
- package/src/layout/app-shell/AppShell.tsx +6 -1
- package/src/layout/app-shell/types.ts +3 -2
- package/src/layout/auth-layout/AuthLayout.tsx +6 -1
- package/src/layout/auth-layout/types.ts +3 -2
- package/src/layout/page/Page.tsx +12 -1
- package/src/layout/page/types.ts +2 -2
- package/src/layout/page-header/PageHeader.tsx +6 -1
- package/src/layout/page-header/types.ts +3 -2
- package/src/layout/page-section/PageSection.tsx +12 -1
- package/src/layout/page-section/types.ts +3 -2
- package/src/layout/settings-layout/SettingsLayout.tsx +6 -1
- package/src/layout/settings-layout/types.ts +3 -2
- package/src/layout/sidebar-layout/SidebarLayout.tsx +6 -1
- package/src/layout/sidebar-layout/types.ts +3 -2
- package/src/layout/topbar-layout/TopbarLayout.tsx +11 -1
- package/src/layout/topbar-layout/types.ts +3 -2
- package/src/patterns/auth/ForgotPasswordForm.tsx +6 -1
- package/src/patterns/auth/OtpForm.tsx +6 -1
- package/src/patterns/auth/SignInForm.tsx +6 -1
- package/src/patterns/auth/SignUpForm.tsx +6 -1
- package/src/patterns/auth/types.ts +2 -2
- package/src/patterns/collection-editor/CollectionEditor.tsx +6 -1
- package/src/patterns/collection-editor/types.ts +3 -2
- package/src/patterns/confirm-dialog/ConfirmDialog.tsx +6 -1
- package/src/patterns/confirm-dialog/types.ts +2 -2
- package/src/patterns/disclosure-section/DisclosureSection.tsx +6 -1
- package/src/patterns/disclosure-section/types.ts +3 -2
- package/src/patterns/empty-state/EmptyState.tsx +6 -1
- package/src/patterns/empty-state/types.ts +2 -2
- package/src/patterns/form-field/FormField.tsx +12 -1
- package/src/patterns/form-field/types.ts +9 -4
- package/src/patterns/inspector-field/InspectorField.tsx +11 -1
- package/src/patterns/inspector-field/types.ts +3 -2
- package/src/patterns/notice/Notice.tsx +6 -1
- package/src/patterns/notice/types.ts +2 -2
- package/src/patterns/panel/Panel.tsx +4 -1
- package/src/patterns/panel/types.ts +2 -2
- package/src/patterns/responsive-panel/ResponsivePanel.tsx +6 -1
- package/src/patterns/responsive-panel/types.ts +3 -2
- package/src/patterns/section-header/SectionHeader.tsx +6 -1
- package/src/patterns/section-header/types.ts +3 -2
- package/src/patterns/settings-row/SettingsRow.tsx +6 -1
- package/src/patterns/settings-row/types.ts +3 -2
- package/src/patterns/switch-field/SwitchField.tsx +6 -1
- package/src/patterns/switch-field/types.ts +3 -2
- package/src/patterns/tile-grid/PaletteItem.tsx +9 -3
- package/src/patterns/tile-grid/TileGrid.tsx +6 -1
- package/src/patterns/tile-grid/types.ts +4 -4
- package/src/patterns/tree-view/TreeItem.tsx +10 -3
- package/src/patterns/tree-view/TreeView.tsx +6 -1
- package/src/patterns/tree-view/types.ts +3 -2
- package/src/theme/ZoraBaseProps.ts +20 -0
- package/src/theme/ZoraProvider.tsx +9 -4
- package/src/theme/ZoraThemeRuntimeContext.tsx +18 -0
- package/src/theme/ZoraThemeScope.tsx +74 -0
- package/src/theme/index.ts +4 -0
- package/src/theme/resolveZoraScopedThemeId.test.ts +47 -0
- package/src/theme/resolveZoraScopedThemeId.ts +25 -0
- package/src/theme/themeScopeStructure.test.ts +220 -0
- package/src/theme/withZoraThemeScope.tsx +26 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ZoraBaseProps } from './ZoraBaseProps';
|
|
3
|
+
export declare function withZoraThemeScope<P extends ZoraBaseProps>(Component: (props: P) => React.ReactElement | null): (props: P) => React.ReactElement | null;
|
|
4
|
+
//# sourceMappingURL=withZoraThemeScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withZoraThemeScope.d.ts","sourceRoot":"","sources":["../../src/theme/withZoraThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,aAAa,EACxD,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,GACjD,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAkBzC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ZoraThemeScope } from './ZoraThemeScope';
|
|
3
|
+
export function withZoraThemeScope(Component) {
|
|
4
|
+
const Wrapped = (props) => {
|
|
5
|
+
if (props.mode === undefined && props.themeId === undefined) {
|
|
6
|
+
return React.createElement(Component, props);
|
|
7
|
+
}
|
|
8
|
+
return (<ZoraThemeScope mode={props.mode} themeId={props.themeId}>
|
|
9
|
+
{React.createElement(Component, props)}
|
|
10
|
+
</ZoraThemeScope>);
|
|
11
|
+
};
|
|
12
|
+
const name = Component.displayName ?? (Component.name || 'Component');
|
|
13
|
+
Wrapped.displayName = `withZoraThemeScope(${name})`;
|
|
14
|
+
return Wrapped;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=withZoraThemeScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withZoraThemeScope.js","sourceRoot":"","sources":["../../src/theme/withZoraThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,kBAAkB,CAChC,SAAkD;IAElD,MAAM,OAAO,GAAG,CAAC,KAAQ,EAAE,EAAE;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC5D,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,CACL,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvD;QAAA,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CACxC;MAAA,EAAE,cAAc,CAAC,CAClB,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,IAAI,GACP,SAAsC,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,WAAW,CAAC,CAAC;IACxF,OAAoC,CAAC,WAAW,GAAG,sBAAsB,IAAI,GAAG,CAAC;IAElF,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ZoraBaseProps } from './ZoraBaseProps';\nimport { ZoraThemeScope } from './ZoraThemeScope';\n\nexport function withZoraThemeScope<P extends ZoraBaseProps>(\n Component: (props: P) => React.ReactElement | null,\n): (props: P) => React.ReactElement | null {\n const Wrapped = (props: P) => {\n if (props.mode === undefined && props.themeId === undefined) {\n return React.createElement(Component, props);\n }\n\n return (\n <ZoraThemeScope mode={props.mode} themeId={props.themeId}>\n {React.createElement(Component, props)}\n </ZoraThemeScope>\n );\n };\n\n const name =\n (Component as { displayName?: string }).displayName ?? (Component.name || 'Component');\n (Wrapped as { displayName?: string }).displayName = `withZoraThemeScope(${name})`;\n\n return Wrapped;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -2,9 +2,18 @@ import { Badge as SurfaceBadge } from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { resolveBadgeRecipe } from '../../internal/recipes';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import type { BadgeProps } from './types';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
function BadgeInner({
|
|
9
|
+
themeId: _themeId,
|
|
10
|
+
mode: _mode,
|
|
11
|
+
children,
|
|
12
|
+
tone,
|
|
13
|
+
emphasis,
|
|
14
|
+
size,
|
|
15
|
+
...props
|
|
16
|
+
}: BadgeProps) {
|
|
8
17
|
const recipe = resolveBadgeRecipe({ tone, emphasis, size });
|
|
9
18
|
|
|
10
19
|
return (
|
|
@@ -17,3 +26,5 @@ export function Badge({ children, tone, emphasis, size, ...props }: BadgeProps)
|
|
|
17
26
|
/>
|
|
18
27
|
);
|
|
19
28
|
}
|
|
29
|
+
|
|
30
|
+
export const Badge = withZoraThemeScope(BadgeInner);
|
|
@@ -2,11 +2,12 @@ import type { BadgeProps as SurfaceBadgeProps } from '@ankhorage/surface';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ZoraBadgeEmphasis, ZoraControlSize, ZoraTone } from '../../internal/recipes';
|
|
5
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
6
|
|
|
6
|
-
export interface BadgeProps
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
> {
|
|
7
|
+
export interface BadgeProps
|
|
8
|
+
extends
|
|
9
|
+
ZoraBaseProps,
|
|
10
|
+
Omit<SurfaceBadgeProps, 'content' | 'size' | 'tone' | 'variant' | 'mode' | 'themeId'> {
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
tone?: ZoraTone;
|
|
12
13
|
emphasis?: ZoraBadgeEmphasis;
|
|
@@ -2,12 +2,22 @@ import { Button as SurfaceButton } from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { resolveButtonRecipe } from '../../internal/recipes';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import type { ButtonProps } from './types';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
function ButtonInner({
|
|
9
|
+
themeId: _themeId,
|
|
10
|
+
mode: _mode,
|
|
11
|
+
tone,
|
|
12
|
+
emphasis,
|
|
13
|
+
size,
|
|
14
|
+
...props
|
|
15
|
+
}: ButtonProps) {
|
|
8
16
|
const recipe = resolveButtonRecipe({ tone, emphasis, size });
|
|
9
17
|
|
|
10
18
|
return (
|
|
11
19
|
<SurfaceButton {...props} size={recipe.size} tone={recipe.tone} variant={recipe.variant} />
|
|
12
20
|
);
|
|
13
21
|
}
|
|
22
|
+
|
|
23
|
+
export const Button = withZoraThemeScope(ButtonInner);
|
|
@@ -2,11 +2,10 @@ import type { ButtonIconSpec, ButtonProps as SurfaceButtonProps } from '@ankhora
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ZoraControlSize, ZoraEmphasis, ZoraTone } from '../../internal/recipes';
|
|
5
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
6
|
|
|
6
|
-
export interface ButtonProps
|
|
7
|
-
SurfaceButtonProps,
|
|
8
|
-
'children' | 'size' | 'tone' | 'variant'
|
|
9
|
-
> {
|
|
7
|
+
export interface ButtonProps
|
|
8
|
+
extends ZoraBaseProps, Omit<SurfaceButtonProps, 'children' | 'size' | 'tone' | 'variant'> {
|
|
10
9
|
children?: React.ReactNode;
|
|
11
10
|
tone?: ZoraTone;
|
|
12
11
|
emphasis?: ZoraEmphasis;
|
|
@@ -2,11 +2,14 @@ import { Box, Card as SurfaceCard, Stack } from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { resolveCardVariant } from '../../internal/recipes';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import { Heading } from '../heading';
|
|
6
7
|
import { Text } from '../text';
|
|
7
8
|
import type { CardProps } from './types';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
function CardInner({
|
|
11
|
+
themeId: _themeId,
|
|
12
|
+
mode: _mode,
|
|
10
13
|
children,
|
|
11
14
|
title,
|
|
12
15
|
description,
|
|
@@ -65,3 +68,5 @@ export function Card({
|
|
|
65
68
|
</SurfaceCard>
|
|
66
69
|
);
|
|
67
70
|
}
|
|
71
|
+
|
|
72
|
+
export const Card = withZoraThemeScope(CardInner);
|
|
@@ -2,8 +2,10 @@ import type { CardProps as SurfaceCardProps } from '@ankhorage/surface';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { ZoraCardTone } from '../../internal/recipes';
|
|
5
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
6
|
|
|
6
|
-
export interface CardProps
|
|
7
|
+
export interface CardProps
|
|
8
|
+
extends ZoraBaseProps, Omit<SurfaceCardProps, 'children' | 'p' | 'radius' | 'variant'> {
|
|
7
9
|
children?: React.ReactNode;
|
|
8
10
|
title?: React.ReactNode;
|
|
9
11
|
description?: React.ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Checkbox as SurfaceCheckbox } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
+
import type { CheckboxProps } from './types';
|
|
6
|
+
|
|
7
|
+
function CheckboxInner({ themeId: _themeId, mode: _mode, ...props }: CheckboxProps) {
|
|
8
|
+
return <SurfaceCheckbox {...props} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Checkbox = withZoraThemeScope(CheckboxInner);
|
|
@@ -2,10 +2,13 @@ import { Checkbox, Stack } from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import { Text } from '../text';
|
|
6
7
|
import type { CheckboxGroupOption, CheckboxGroupProps } from './types';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
function CheckboxGroupInner<TValue extends string>({
|
|
10
|
+
themeId: _themeId,
|
|
11
|
+
mode: _mode,
|
|
9
12
|
value,
|
|
10
13
|
onValueChange,
|
|
11
14
|
options,
|
|
@@ -53,6 +56,8 @@ export function CheckboxGroup<TValue extends string>({
|
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
58
|
|
|
59
|
+
export const CheckboxGroup = withZoraThemeScope(CheckboxGroupInner);
|
|
60
|
+
|
|
56
61
|
function CheckboxGroupItem<TValue extends string>({
|
|
57
62
|
option,
|
|
58
63
|
checked,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
+
export { Checkbox } from './Checkbox';
|
|
1
2
|
export { CheckboxGroup } from './CheckboxGroup';
|
|
2
|
-
export type { CheckboxGroupOption, CheckboxGroupProps } from './types';
|
|
3
|
-
export type { CheckboxProps } from '@ankhorage/surface';
|
|
4
|
-
export { Checkbox } from '@ankhorage/surface';
|
|
3
|
+
export type { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps } from './types';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type { CheckboxProps } from '@ankhorage/surface';
|
|
1
|
+
import type { CheckboxProps as SurfaceCheckboxProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
|
+
|
|
6
|
+
export interface CheckboxProps
|
|
7
|
+
extends ZoraBaseProps, Omit<SurfaceCheckboxProps, 'mode' | 'themeId'> {}
|
|
8
|
+
|
|
4
9
|
export interface CheckboxGroupOption<TValue extends string> {
|
|
5
10
|
value: TValue;
|
|
6
11
|
label: React.ReactNode;
|
|
@@ -9,10 +14,13 @@ export interface CheckboxGroupOption<TValue extends string> {
|
|
|
9
14
|
testID?: string;
|
|
10
15
|
}
|
|
11
16
|
|
|
12
|
-
export interface CheckboxGroupProps<TValue extends string>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
export interface CheckboxGroupProps<TValue extends string>
|
|
18
|
+
extends
|
|
19
|
+
ZoraBaseProps,
|
|
20
|
+
Pick<
|
|
21
|
+
Omit<SurfaceCheckboxProps, 'mode' | 'themeId'>,
|
|
22
|
+
'tone' | 'size' | 'invalid' | 'readOnly' | 'disabled'
|
|
23
|
+
> {
|
|
16
24
|
value: readonly TValue[];
|
|
17
25
|
onValueChange: (value: TValue[]) => void;
|
|
18
26
|
options: readonly CheckboxGroupOption<TValue>[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box, Drawer as SurfaceDrawer, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
5
|
import { Heading } from '../heading';
|
|
5
6
|
import { Text } from '../text';
|
|
6
7
|
import type { DrawerProps } from './types';
|
|
@@ -17,7 +18,16 @@ function useStableCallback(callback: (() => void) | undefined): (() => void) | u
|
|
|
17
18
|
}, []);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
function DrawerInner({
|
|
22
|
+
themeId: _themeId,
|
|
23
|
+
mode: _mode,
|
|
24
|
+
children,
|
|
25
|
+
title,
|
|
26
|
+
description,
|
|
27
|
+
footer,
|
|
28
|
+
onDismiss,
|
|
29
|
+
...props
|
|
30
|
+
}: DrawerProps) {
|
|
21
31
|
const hasHeader = title != null || description != null;
|
|
22
32
|
const stableOnDismiss = useStableCallback(onDismiss);
|
|
23
33
|
|
|
@@ -40,3 +50,5 @@ export function Drawer({ children, title, description, footer, onDismiss, ...pro
|
|
|
40
50
|
</SurfaceDrawer>
|
|
41
51
|
);
|
|
42
52
|
}
|
|
53
|
+
|
|
54
|
+
export const Drawer = withZoraThemeScope(DrawerInner);
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { DrawerProps as SurfaceDrawerProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
|
+
|
|
6
|
+
export interface DrawerProps
|
|
7
|
+
extends
|
|
8
|
+
ZoraBaseProps,
|
|
9
|
+
Pick<
|
|
10
|
+
Omit<SurfaceDrawerProps, 'mode' | 'themeId'>,
|
|
11
|
+
'closeOnBackdrop' | 'onDismiss' | 'position' | 'visible'
|
|
12
|
+
> {
|
|
8
13
|
children?: React.ReactNode;
|
|
9
14
|
title?: React.ReactNode;
|
|
10
15
|
description?: React.ReactNode;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Box, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
5
|
import { FormActions } from './FormActions';
|
|
5
6
|
import { FormError } from './FormError';
|
|
6
7
|
import { FormField } from './FormField';
|
|
7
8
|
import type { FormProps } from './types';
|
|
8
9
|
import { useFormController } from './useFormController';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
function FormInner<TName extends string = string>({
|
|
12
|
+
themeId: _themeId,
|
|
13
|
+
mode: _mode,
|
|
11
14
|
fields,
|
|
12
15
|
values,
|
|
13
16
|
onChange,
|
|
@@ -59,3 +62,5 @@ export function Form<TName extends string = string>({
|
|
|
59
62
|
</Stack>
|
|
60
63
|
);
|
|
61
64
|
}
|
|
65
|
+
|
|
66
|
+
export const Form = withZoraThemeScope(FormInner);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Box, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
5
|
import { Button } from '../button';
|
|
5
6
|
import type { FormActionsProps } from './types';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
function FormActionsInner({
|
|
9
|
+
themeId: _themeId,
|
|
10
|
+
mode: _mode,
|
|
8
11
|
submitLabel = 'Submit',
|
|
9
12
|
loading = false,
|
|
10
13
|
disabled = false,
|
|
@@ -21,3 +24,5 @@ export function FormActions({
|
|
|
21
24
|
</Stack>
|
|
22
25
|
);
|
|
23
26
|
}
|
|
27
|
+
|
|
28
|
+
export const FormActions = withZoraThemeScope(FormActionsInner);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Box
|
|
1
|
+
import { Box } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
6
|
import { Text } from '../text';
|
|
5
7
|
import type { FormErrorProps } from './types';
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
const { theme } =
|
|
9
|
+
function FormErrorInner({ themeId: _themeId, mode: _mode, error, testID }: FormErrorProps) {
|
|
10
|
+
const { theme } = useZoraTheme();
|
|
9
11
|
|
|
10
12
|
if (!error) {
|
|
11
13
|
return null;
|
|
@@ -19,3 +21,5 @@ export function FormError({ error, testID }: FormErrorProps) {
|
|
|
19
21
|
</Box>
|
|
20
22
|
);
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
export const FormError = withZoraThemeScope(FormErrorInner);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Field, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
5
|
import { Input } from '../input';
|
|
5
6
|
import { Text } from '../text';
|
|
6
7
|
import type { FormFieldConfig, FormFieldControlProps, FormFieldProps } from './types';
|
|
@@ -83,9 +84,17 @@ function renderLabel(label: React.ReactNode, description: React.ReactNode | unde
|
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
function FormFieldInner<TName extends string = string>(props: FormFieldProps<TName>) {
|
|
87
88
|
if (!isControlFieldProps(props)) {
|
|
88
|
-
const {
|
|
89
|
+
const {
|
|
90
|
+
themeId: _themeId,
|
|
91
|
+
mode: _mode,
|
|
92
|
+
label,
|
|
93
|
+
description,
|
|
94
|
+
helperText,
|
|
95
|
+
children,
|
|
96
|
+
...fieldProps
|
|
97
|
+
} = props;
|
|
89
98
|
|
|
90
99
|
return (
|
|
91
100
|
<Field {...fieldProps} helperText={helperText} label={renderLabel(label, description)}>
|
|
@@ -94,7 +103,17 @@ export function FormField<TName extends string = string>(props: FormFieldProps<T
|
|
|
94
103
|
);
|
|
95
104
|
}
|
|
96
105
|
|
|
97
|
-
const {
|
|
106
|
+
const {
|
|
107
|
+
themeId: _themeId,
|
|
108
|
+
mode: _mode,
|
|
109
|
+
field,
|
|
110
|
+
value,
|
|
111
|
+
error,
|
|
112
|
+
disabled = false,
|
|
113
|
+
loading = false,
|
|
114
|
+
onChange,
|
|
115
|
+
testID,
|
|
116
|
+
} = props;
|
|
98
117
|
const fieldDisabled = disabled || loading || field.disabled;
|
|
99
118
|
const required = field.required ?? hasRequiredRule(field.rules);
|
|
100
119
|
|
|
@@ -127,3 +146,5 @@ export function FormField<TName extends string = string>(props: FormFieldProps<T
|
|
|
127
146
|
</Field>
|
|
128
147
|
);
|
|
129
148
|
}
|
|
149
|
+
|
|
150
|
+
export const FormField = withZoraThemeScope(FormFieldInner);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
5
|
import type { InputProps } from '../input';
|
|
5
6
|
|
|
6
7
|
export type ValidationRule =
|
|
@@ -36,44 +37,44 @@ export interface FormFieldConfig<TName extends string = string> {
|
|
|
36
37
|
testID?: string;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
export interface FormFieldWrapperProps
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
export interface FormFieldWrapperProps
|
|
41
|
+
extends
|
|
42
|
+
ZoraBaseProps,
|
|
43
|
+
Pick<
|
|
44
|
+
Omit<SurfaceFieldProps, 'mode' | 'themeId'>,
|
|
45
|
+
'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'
|
|
46
|
+
> {
|
|
43
47
|
label: React.ReactNode;
|
|
44
48
|
description?: React.ReactNode;
|
|
45
49
|
helperText?: React.ReactNode;
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
export interface FormFieldControlProps<TName extends string = string> {
|
|
52
|
+
export interface FormFieldControlProps<TName extends string = string> extends ZoraBaseProps {
|
|
49
53
|
field: FormFieldConfig<TName>;
|
|
50
54
|
value: FormFieldValue;
|
|
51
55
|
onChange: (name: TName, value: FormFieldValue) => void;
|
|
52
56
|
error?: React.ReactNode;
|
|
53
57
|
disabled?: boolean;
|
|
54
58
|
loading?: boolean;
|
|
55
|
-
testID?: string;
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
export type FormFieldProps<TName extends string = string> =
|
|
59
62
|
| FormFieldControlProps<TName>
|
|
60
63
|
| FormFieldWrapperProps;
|
|
61
64
|
|
|
62
|
-
export interface FormActionsProps {
|
|
65
|
+
export interface FormActionsProps extends ZoraBaseProps {
|
|
63
66
|
submitLabel?: React.ReactNode;
|
|
64
67
|
loading?: boolean;
|
|
65
68
|
disabled?: boolean;
|
|
66
69
|
onSubmit?: () => void;
|
|
67
70
|
children?: React.ReactNode;
|
|
68
|
-
testID?: string;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
export interface FormErrorProps {
|
|
73
|
+
export interface FormErrorProps extends ZoraBaseProps {
|
|
72
74
|
error?: React.ReactNode;
|
|
73
|
-
testID?: string;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
export interface FormProps<TName extends string = string> {
|
|
77
|
+
export interface FormProps<TName extends string = string> extends ZoraBaseProps {
|
|
77
78
|
fields: readonly FormFieldConfig<TName>[];
|
|
78
79
|
values: FormValues<TName>;
|
|
79
80
|
onChange: (values: FormValues<TName>) => void;
|
|
@@ -86,7 +87,6 @@ export interface FormProps<TName extends string = string> {
|
|
|
86
87
|
actions?: React.ReactNode;
|
|
87
88
|
footer?: React.ReactNode;
|
|
88
89
|
validateOnChange?: boolean;
|
|
89
|
-
testID?: string;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
export interface FormValidationResult<TName extends string = string> {
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { Text as ReactNativeText } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
6
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
7
|
import { resolveHeadingRecipe, resolveHeadingSizeFromLevel } from './resolveHeadingRecipe';
|
|
7
8
|
import type { HeadingProps } from './types';
|
|
8
9
|
|
|
@@ -30,7 +31,9 @@ function resolveHeadingContent({
|
|
|
30
31
|
return i18nKey;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
function HeadingInner({
|
|
35
|
+
themeId: _themeId,
|
|
36
|
+
mode: _mode,
|
|
34
37
|
children,
|
|
35
38
|
text,
|
|
36
39
|
i18nKey,
|
|
@@ -84,3 +87,5 @@ export function Heading({
|
|
|
84
87
|
</ReactNativeText>
|
|
85
88
|
);
|
|
86
89
|
}
|
|
90
|
+
|
|
91
|
+
export const Heading = withZoraThemeScope(HeadingInner);
|
|
@@ -2,6 +2,8 @@ import type { Responsive } from '@ankhorage/surface';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { AccessibilityRole, TextStyle } from 'react-native';
|
|
4
4
|
|
|
5
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
6
|
+
|
|
5
7
|
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
8
|
|
|
7
9
|
export type HeadingSize = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
@@ -20,7 +22,7 @@ export type HeadingAlign = NonNullable<TextStyle['textAlign']>;
|
|
|
20
22
|
|
|
21
23
|
export type HeadingWeight = 'regular' | 'medium' | 'semiBold' | 'bold';
|
|
22
24
|
|
|
23
|
-
export interface HeadingProps {
|
|
25
|
+
export interface HeadingProps extends ZoraBaseProps {
|
|
24
26
|
children?: React.ReactNode;
|
|
25
27
|
text?: string;
|
|
26
28
|
i18nKey?: string;
|
|
@@ -37,5 +39,4 @@ export interface HeadingProps {
|
|
|
37
39
|
accessibilityHint?: string;
|
|
38
40
|
accessibilityRole?: AccessibilityRole;
|
|
39
41
|
nativeID?: string;
|
|
40
|
-
testID?: string;
|
|
41
42
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { Icon as SurfaceIcon, type IconProps as SurfaceIconProps } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
+
export interface IconProps extends ZoraBaseProps, Omit<SurfaceIconProps, 'mode' | 'themeId'> {}
|
|
8
|
+
|
|
9
|
+
function IconInner({ themeId: _themeId, mode: _mode, ...props }: IconProps) {
|
|
7
10
|
return <SurfaceIcon {...props} />;
|
|
8
11
|
}
|
|
12
|
+
|
|
13
|
+
export const Icon = withZoraThemeScope(IconInner);
|
|
@@ -2,9 +2,12 @@ import { IconButton as SurfaceIconButton } from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { resolveButtonRecipe } from '../../internal/recipes';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import type { IconButtonProps } from './types';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
function IconButtonInner({
|
|
9
|
+
themeId: _themeId,
|
|
10
|
+
mode: _mode,
|
|
8
11
|
icon,
|
|
9
12
|
label,
|
|
10
13
|
emphasis = 'ghost',
|
|
@@ -25,3 +28,5 @@ export function IconButton({
|
|
|
25
28
|
/>
|
|
26
29
|
);
|
|
27
30
|
}
|
|
31
|
+
|
|
32
|
+
export const IconButton = withZoraThemeScope(IconButtonInner);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
2
|
|
|
3
3
|
import type { ZoraControlSize, ZoraEmphasis, ZoraTone } from '../../internal/recipes';
|
|
4
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
5
|
|
|
5
|
-
export interface IconButtonProps {
|
|
6
|
+
export interface IconButtonProps extends ZoraBaseProps {
|
|
6
7
|
icon: ButtonIconSpec;
|
|
7
8
|
label: string;
|
|
8
9
|
emphasis?: ZoraEmphasis;
|
|
@@ -2,10 +2,19 @@ import * as Surface from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { resolveIconSize } from '../../internal/recipes';
|
|
5
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
6
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
7
|
import type { InputProps } from './types';
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
function InputInner({
|
|
10
|
+
themeId: _themeId,
|
|
11
|
+
mode: _mode,
|
|
12
|
+
size = 'l',
|
|
13
|
+
leadingIcon,
|
|
14
|
+
trailingIcon,
|
|
15
|
+
...props
|
|
16
|
+
}: InputProps) {
|
|
17
|
+
const { theme } = useZoraTheme();
|
|
9
18
|
const iconSize = resolveIconSize(size);
|
|
10
19
|
const iconColor = theme.semantics.content.muted;
|
|
11
20
|
|
|
@@ -36,3 +45,5 @@ export function Input({ size = 'l', leadingIcon, trailingIcon, ...props }: Input
|
|
|
36
45
|
/>
|
|
37
46
|
);
|
|
38
47
|
}
|
|
48
|
+
|
|
49
|
+
export const Input = withZoraThemeScope(InputInner);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type * as Surface from '@ankhorage/surface';
|
|
2
2
|
|
|
3
3
|
import type { ZoraControlSize } from '../../internal/recipes';
|
|
4
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
5
|
|
|
5
|
-
export interface InputProps
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export interface InputProps
|
|
7
|
+
extends
|
|
8
|
+
ZoraBaseProps,
|
|
9
|
+
Omit<
|
|
10
|
+
Surface.TextInputProps,
|
|
11
|
+
'leadingAccessory' | 'size' | 'trailingAccessory' | 'mode' | 'themeId'
|
|
12
|
+
> {
|
|
9
13
|
size?: ZoraControlSize;
|
|
10
14
|
leadingIcon?: Surface.ButtonIconSpec;
|
|
11
15
|
trailingIcon?: Surface.ButtonIconSpec;
|
|
@@ -2,6 +2,7 @@ import { Box, Modal as SurfaceModal, Stack } from '@ankhorage/surface';
|
|
|
2
2
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { resolveDialogWidth } from '../../internal/recipes';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import { Heading } from '../heading';
|
|
6
7
|
import { Text } from '../text';
|
|
7
8
|
import type { ModalProps } from './types';
|
|
@@ -18,7 +19,9 @@ function useStableCallback(callback: (() => void) | undefined): (() => void) | u
|
|
|
18
19
|
}, []);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
function ModalInner({
|
|
23
|
+
themeId: _themeId,
|
|
24
|
+
mode: _mode,
|
|
22
25
|
children,
|
|
23
26
|
title,
|
|
24
27
|
description,
|
|
@@ -51,3 +54,5 @@ export function Modal({
|
|
|
51
54
|
</SurfaceModal>
|
|
52
55
|
);
|
|
53
56
|
}
|
|
57
|
+
|
|
58
|
+
export const Modal = withZoraThemeScope(ModalInner);
|