@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DrawerProps as SurfaceDrawerProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
+
export interface DrawerProps extends ZoraBaseProps, Pick<Omit<SurfaceDrawerProps, 'mode' | 'themeId'>, 'closeOnBackdrop' | 'onDismiss' | 'position' | 'visible'> {
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
title?: React.ReactNode;
|
|
6
7
|
description?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,WACf,SACE,aAAa,EACb,IAAI,CACF,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC,EAC5C,iBAAiB,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CACzD;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/drawer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DrawerProps as SurfaceDrawerProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nexport interface DrawerProps
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/drawer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { DrawerProps as SurfaceDrawerProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface DrawerProps\n extends\n ZoraBaseProps,\n Pick<\n Omit<SurfaceDrawerProps, 'mode' | 'themeId'>,\n 'closeOnBackdrop' | 'onDismiss' | 'position' | 'visible'\n > {\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n footer?: React.ReactNode;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FormProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const Form: <TName extends string = string>(props: FormProps<TName>) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=Form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/components/form/Form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/components/form/Form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA0DzC,eAAO,MAAM,IAAI,GAvDE,KAAK,SAAS,MAAM,gEAuDU,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Box, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
3
4
|
import { FormActions } from './FormActions';
|
|
4
5
|
import { FormError } from './FormError';
|
|
5
6
|
import { FormField } from './FormField';
|
|
6
7
|
import { useFormController } from './useFormController';
|
|
7
|
-
|
|
8
|
+
function FormInner({ themeId: _themeId, mode: _mode, fields, values, onChange, onSubmit, errors, error, loading = false, disabled = false, submitLabel = 'Submit', actions, footer, validateOnChange = false, testID, }) {
|
|
8
9
|
const controller = useFormController({
|
|
9
10
|
fields,
|
|
10
11
|
values,
|
|
@@ -24,4 +25,5 @@ export function Form({ fields, values, onChange, onSubmit, errors, error, loadin
|
|
|
24
25
|
{footer ? <Box>{footer}</Box> : null}
|
|
25
26
|
</Stack>);
|
|
26
27
|
}
|
|
28
|
+
export const Form = withZoraThemeScope(FormInner);
|
|
27
29
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../src/components/form/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAA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AC,IAAI,CAAC,CAChB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,KAAK,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CACrC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CACnC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAC1B,CACH,CAAC,CACF;MAAA,CAAC,WAAW,CACV,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,GAAG,EAAE;YACb,KAAK,UAAU,CAAC,YAAY,EAAE,CAAC;QACjC,CAAC,CAAC,CACF,WAAW,CAAC,CAAC,WAAW,CAAC,CAEzB;QAAA,CAAC,OAAO,CACV;MAAA,EAAE,WAAW,CACb;MAAA,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CACtC;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { Box, Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { FormActions } from './FormActions';\nimport { FormError } from './FormError';\nimport { FormField } from './FormField';\nimport type { FormProps } from './types';\nimport { useFormController } from './useFormController';\n\nfunction FormInner<TName extends string = string>({\n themeId: _themeId,\n mode: _mode,\n fields,\n values,\n onChange,\n onSubmit,\n errors,\n error,\n loading = false,\n disabled = false,\n submitLabel = 'Submit',\n actions,\n footer,\n validateOnChange = false,\n testID,\n}: FormProps<TName>) {\n const controller = useFormController({\n fields,\n values,\n errors,\n onChange,\n onSubmit,\n validateOnChange,\n });\n\n return (\n <Stack gap=\"m\" testID={testID}>\n <FormError error={error} />\n {fields.map((field) => (\n <FormField\n key={field.name}\n disabled={disabled}\n error={controller.errors[field.name]}\n field={field}\n loading={loading}\n onChange={controller.setFieldValue}\n value={values[field.name]}\n />\n ))}\n <FormActions\n disabled={disabled}\n loading={loading}\n onSubmit={() => {\n void controller.handleSubmit();\n }}\n submitLabel={submitLabel}\n >\n {actions}\n </FormActions>\n {footer ? <Box>{footer}</Box> : null}\n </Stack>\n );\n}\n\nexport const Form = withZoraThemeScope(FormInner);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FormActionsProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const FormActions: (props: FormActionsProps) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=FormActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormActions.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormActions.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsBhD,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Box, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
3
4
|
import { Button } from '../button';
|
|
4
|
-
|
|
5
|
+
function FormActionsInner({ themeId: _themeId, mode: _mode, submitLabel = 'Submit', loading = false, disabled = false, onSubmit, children, testID, }) {
|
|
5
6
|
return (<Stack gap="s" testID={testID}>
|
|
6
7
|
<Button disabled={disabled} fullWidth loading={loading} onPress={onSubmit}>
|
|
7
8
|
{submitLabel}
|
|
@@ -9,4 +10,5 @@ export function FormActions({ submitLabel = 'Submit', loading = false, disabled
|
|
|
9
10
|
{children ? <Box>{children}</Box> : null}
|
|
10
11
|
</Stack>);
|
|
11
12
|
}
|
|
13
|
+
export const FormActions = withZoraThemeScope(FormActionsInner);
|
|
12
14
|
//# sourceMappingURL=FormActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormActions.js","sourceRoot":"","sources":["../../../src/components/form/FormActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"FormActions.js","sourceRoot":"","sources":["../../../src/components/form/FormActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,WAAW,GAAG,QAAQ,EACtB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,QAAQ,EACR,MAAM,GACW;IACjB,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC5B;MAAA,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CACxE;QAAA,CAAC,WAAW,CACd;MAAA,EAAE,MAAM,CACR;MAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC1C;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { Box, Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { Button } from '../button';\nimport type { FormActionsProps } from './types';\n\nfunction FormActionsInner({\n themeId: _themeId,\n mode: _mode,\n submitLabel = 'Submit',\n loading = false,\n disabled = false,\n onSubmit,\n children,\n testID,\n}: FormActionsProps) {\n return (\n <Stack gap=\"s\" testID={testID}>\n <Button disabled={disabled} fullWidth loading={loading} onPress={onSubmit}>\n {submitLabel}\n </Button>\n {children ? <Box>{children}</Box> : null}\n </Stack>\n );\n}\n\nexport const FormActions = withZoraThemeScope(FormActionsInner);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FormErrorProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const FormError: (props: FormErrorProps) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=FormError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormError.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormError.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormError.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormError.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkB9C,eAAO,MAAM,SAAS,sDAAqC,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { Box
|
|
1
|
+
import { Box } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
3
5
|
import { Text } from '../text';
|
|
4
|
-
|
|
5
|
-
const { theme } =
|
|
6
|
+
function FormErrorInner({ themeId: _themeId, mode: _mode, error, testID }) {
|
|
7
|
+
const { theme } = useZoraTheme();
|
|
6
8
|
if (!error) {
|
|
7
9
|
return null;
|
|
8
10
|
}
|
|
@@ -12,4 +14,5 @@ export function FormError({ error, testID }) {
|
|
|
12
14
|
</Text>
|
|
13
15
|
</Box>);
|
|
14
16
|
}
|
|
17
|
+
export const FormError = withZoraThemeScope(FormErrorInner);
|
|
15
18
|
//# sourceMappingURL=FormError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormError.js","sourceRoot":"","sources":["../../../src/components/form/FormError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"FormError.js","sourceRoot":"","sources":["../../../src/components/form/FormError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAkB;IACvF,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IAEjC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACpF;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CACrC;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { Box } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { Text } from '../text';\nimport type { FormErrorProps } from './types';\n\nfunction FormErrorInner({ themeId: _themeId, mode: _mode, error, testID }: FormErrorProps) {\n const { theme } = useZoraTheme();\n\n if (!error) {\n return null;\n }\n\n return (\n <Box borderColor={theme.colors.error} borderWidth={1} p=\"s\" radius=\"m\" testID={testID}>\n <Text tone=\"danger\" variant=\"bodySmall\">\n {error}\n </Text>\n </Box>\n );\n}\n\nexport const FormError = withZoraThemeScope(FormErrorInner);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { FormFieldProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const FormField: <TName extends string = string>(props: FormFieldProps<TName>) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=FormField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../src/components/form/FormField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAA0C,cAAc,EAAE,MAAM,SAAS,CAAC;AA+ItF,eAAO,MAAM,SAAS,GA/DE,KAAK,SAAS,MAAM,qEA+De,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Field, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
3
4
|
import { Input } from '../input';
|
|
4
5
|
import { Text } from '../text';
|
|
5
6
|
import { hasRequiredRule } from './validation';
|
|
@@ -58,18 +59,19 @@ function renderLabel(label, description) {
|
|
|
58
59
|
</Text>) : null}
|
|
59
60
|
</Stack>);
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
function FormFieldInner(props) {
|
|
62
63
|
if (!isControlFieldProps(props)) {
|
|
63
|
-
const { label, description, helperText, children, ...fieldProps } = props;
|
|
64
|
+
const { themeId: _themeId, mode: _mode, label, description, helperText, children, ...fieldProps } = props;
|
|
64
65
|
return (<Field {...fieldProps} helperText={helperText} label={renderLabel(label, description)}>
|
|
65
66
|
{children}
|
|
66
67
|
</Field>);
|
|
67
68
|
}
|
|
68
|
-
const { field, value, error, disabled = false, loading = false, onChange, testID } = props;
|
|
69
|
+
const { themeId: _themeId, mode: _mode, field, value, error, disabled = false, loading = false, onChange, testID, } = props;
|
|
69
70
|
const fieldDisabled = disabled || loading || field.disabled;
|
|
70
71
|
const required = field.required ?? hasRequiredRule(field.rules);
|
|
71
72
|
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}>
|
|
72
73
|
<Input accessibilityLabel={typeof field.label === 'string' ? field.label : undefined} autoCapitalize={resolveAutoCapitalize(field)} autoComplete={field.autoComplete} disabled={fieldDisabled} 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}/>
|
|
73
74
|
</Field>);
|
|
74
75
|
}
|
|
76
|
+
export const FormField = withZoraThemeScope(FormFieldInner);
|
|
75
77
|
//# sourceMappingURL=FormField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../src/components/form/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,SAAS,mBAAmB,CAC1B,KAA4B;IAE5B,OAAO,OAAO,IAAI,KAAK,CAAC;AAC1B,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAsB;IACjD,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,YAAY,CAAC;IAC5B,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QACpD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QACzB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK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C9E,cAAc,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAC7C,YAAY,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CACjC,QAAQ,CAAC,CAAC,aAAa,CAAC,CACxB,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,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["import { Field, Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { Input } from '../input';\nimport { Text } from '../text';\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 tone=\"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 ...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 } = 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 <Input\n accessibilityLabel={typeof field.label === 'string' ? field.label : undefined}\n autoCapitalize={resolveAutoCapitalize(field)}\n autoComplete={field.autoComplete}\n disabled={fieldDisabled}\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\nexport const FormField = withZoraThemeScope(FormFieldInner);\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FieldProps as SurfaceFieldProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
4
|
import type { InputProps } from '../input';
|
|
4
5
|
export type ValidationRule = {
|
|
5
6
|
kind: 'required';
|
|
@@ -40,34 +41,31 @@ export interface FormFieldConfig<TName extends string = string> {
|
|
|
40
41
|
disabled?: boolean;
|
|
41
42
|
testID?: string;
|
|
42
43
|
}
|
|
43
|
-
export interface FormFieldWrapperProps extends Pick<SurfaceFieldProps, 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'
|
|
44
|
+
export interface FormFieldWrapperProps extends ZoraBaseProps, Pick<Omit<SurfaceFieldProps, 'mode' | 'themeId'>, 'children' | 'disabled' | 'errorText' | 'invalid' | 'readOnly' | 'required'> {
|
|
44
45
|
label: React.ReactNode;
|
|
45
46
|
description?: React.ReactNode;
|
|
46
47
|
helperText?: React.ReactNode;
|
|
47
48
|
}
|
|
48
|
-
export interface FormFieldControlProps<TName extends string = string> {
|
|
49
|
+
export interface FormFieldControlProps<TName extends string = string> extends ZoraBaseProps {
|
|
49
50
|
field: FormFieldConfig<TName>;
|
|
50
51
|
value: FormFieldValue;
|
|
51
52
|
onChange: (name: TName, value: FormFieldValue) => void;
|
|
52
53
|
error?: React.ReactNode;
|
|
53
54
|
disabled?: boolean;
|
|
54
55
|
loading?: boolean;
|
|
55
|
-
testID?: string;
|
|
56
56
|
}
|
|
57
57
|
export type FormFieldProps<TName extends string = string> = FormFieldControlProps<TName> | FormFieldWrapperProps;
|
|
58
|
-
export interface FormActionsProps {
|
|
58
|
+
export interface FormActionsProps extends ZoraBaseProps {
|
|
59
59
|
submitLabel?: React.ReactNode;
|
|
60
60
|
loading?: boolean;
|
|
61
61
|
disabled?: boolean;
|
|
62
62
|
onSubmit?: () => void;
|
|
63
63
|
children?: React.ReactNode;
|
|
64
|
-
testID?: string;
|
|
65
64
|
}
|
|
66
|
-
export interface FormErrorProps {
|
|
65
|
+
export interface FormErrorProps extends ZoraBaseProps {
|
|
67
66
|
error?: React.ReactNode;
|
|
68
|
-
testID?: string;
|
|
69
67
|
}
|
|
70
|
-
export interface FormProps<TName extends string = string> {
|
|
68
|
+
export interface FormProps<TName extends string = string> extends ZoraBaseProps {
|
|
71
69
|
fields: readonly FormFieldConfig<TName>[];
|
|
72
70
|
values: FormValues<TName>;
|
|
73
71
|
onChange: (values: FormValues<TName>) => void;
|
|
@@ -80,7 +78,6 @@ export interface FormProps<TName extends string = string> {
|
|
|
80
78
|
actions?: React.ReactNode;
|
|
81
79
|
footer?: React.ReactNode;
|
|
82
80
|
validateOnChange?: boolean;
|
|
83
|
-
testID?: string;
|
|
84
81
|
}
|
|
85
82
|
export interface FormValidationResult<TName extends string = string> {
|
|
86
83
|
errors: FormValidationErrors<TName>;
|
|
@@ -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,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CA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,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,uBAAuB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM;IACpE,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1B,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC/C,aAAa,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,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 { InputProps } from '../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?: InputProps['autoCapitalize'];\n autoComplete?: InputProps['autoComplete'];\n keyboardType?: InputProps['keyboardType'];\n maxLength?: InputProps['maxLength'];\n readOnly?: boolean;\n required?: boolean;\n secureTextEntry?: boolean;\n textContentType?: InputProps['textContentType'];\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface FormFieldWrapperProps
|
|
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 { InputProps } from '../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?: InputProps['autoCapitalize'];\n autoComplete?: InputProps['autoComplete'];\n keyboardType?: InputProps['keyboardType'];\n maxLength?: InputProps['maxLength'];\n readOnly?: boolean;\n required?: boolean;\n secureTextEntry?: boolean;\n textContentType?: InputProps['textContentType'];\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface 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>\n | 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,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { HeadingProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const Heading: (props: HeadingProps) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAmF5C,eAAO,MAAM,OAAO,oDAAmC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Text as ReactNativeText } from 'react-native';
|
|
4
4
|
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import { resolveHeadingRecipe, resolveHeadingSizeFromLevel } from './resolveHeadingRecipe';
|
|
6
7
|
function resolveHeadingContent({ children, text, i18nKey, }) {
|
|
7
8
|
if (children !== undefined) {
|
|
@@ -15,7 +16,7 @@ function resolveHeadingContent({ children, text, i18nKey, }) {
|
|
|
15
16
|
}
|
|
16
17
|
return i18nKey;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
function HeadingInner({ themeId: _themeId, mode: _mode, children, text, i18nKey, level = 2, size, tone = 'default', align, weight, italic = false, numberOfLines, ellipsizeMode, selectable, accessibilityLabel, accessibilityHint, accessibilityRole = 'header', nativeID, testID, }) {
|
|
19
20
|
const { theme } = useZoraTheme();
|
|
20
21
|
const { breakpoint } = useResponsiveRuntime();
|
|
21
22
|
const content = resolveHeadingContent({ children, text, i18nKey });
|
|
@@ -37,4 +38,5 @@ export function Heading({ children, text, i18nKey, level = 2, size, tone = 'defa
|
|
|
37
38
|
{content}
|
|
38
39
|
</ReactNativeText>);
|
|
39
40
|
}
|
|
41
|
+
export const Heading = withZoraThemeScope(HeadingInner);
|
|
40
42
|
//# sourceMappingURL=Heading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAG3F,SAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,IAAI,EACJ,OAAO,GAKR;IACC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,YAAY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,KAAK,EAAE,UAAU,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAE7D,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,CAAC,eAAe,CACd,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE;YACjC,KAAK,EAAE,aAAa;YACpB,MAAM;YACN,KAAK;YACL,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC,CAEH;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';\nimport React from 'react';\nimport { Text as ReactNativeText } from 'react-native';\n\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { resolveHeadingRecipe, resolveHeadingSizeFromLevel } from './resolveHeadingRecipe';\nimport type { HeadingProps } from './types';\n\nfunction resolveHeadingContent({\n children,\n text,\n i18nKey,\n}: {\n children: HeadingProps['children'];\n text: HeadingProps['text'];\n i18nKey: HeadingProps['i18nKey'];\n}): React.ReactNode {\n if (children !== undefined) {\n return children;\n }\n\n if (text !== undefined) {\n return text;\n }\n\n if (!i18nKey) {\n return null;\n }\n\n return i18nKey;\n}\n\nfunction HeadingInner({\n themeId: _themeId,\n mode: _mode,\n children,\n text,\n i18nKey,\n level = 2,\n size,\n tone = 'default',\n align,\n weight,\n italic = false,\n numberOfLines,\n ellipsizeMode,\n selectable,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'header',\n nativeID,\n testID,\n}: HeadingProps) {\n const { theme } = useZoraTheme();\n const { breakpoint } = useResponsiveRuntime();\n const content = resolveHeadingContent({ children, text, i18nKey });\n const resolvedSize = resolveResponsive(size, breakpoint) ?? resolveHeadingSizeFromLevel(level);\n const resolvedTone = resolveResponsive(tone, breakpoint) ?? 'default';\n const resolvedAlign = resolveResponsive(align, breakpoint);\n const resolvedWeight = resolveResponsive(weight, breakpoint);\n\n if (content === null || content === undefined) {\n return null;\n }\n\n return (\n <ReactNativeText\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole}\n ellipsizeMode={ellipsizeMode}\n nativeID={nativeID}\n numberOfLines={numberOfLines}\n selectable={selectable}\n testID={testID}\n style={resolveHeadingRecipe(theme, {\n align: resolvedAlign,\n italic,\n level,\n size: resolvedSize,\n tone: resolvedTone,\n weight: resolvedWeight,\n })}\n >\n {content}\n </ReactNativeText>\n );\n}\n\nexport const Heading = withZoraThemeScope(HeadingInner);\n"]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Responsive } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { AccessibilityRole, TextStyle } from 'react-native';
|
|
4
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
5
|
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
6
|
export type HeadingSize = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
6
7
|
export type HeadingTone = 'default' | 'muted' | 'subtle' | 'inverse' | 'primary' | 'danger' | 'success' | 'warning';
|
|
7
8
|
export type HeadingAlign = NonNullable<TextStyle['textAlign']>;
|
|
8
9
|
export type HeadingWeight = 'regular' | 'medium' | 'semiBold' | 'bold';
|
|
9
|
-
export interface HeadingProps {
|
|
10
|
+
export interface HeadingProps extends ZoraBaseProps {
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
text?: string;
|
|
12
13
|
i18nKey?: string;
|
|
@@ -23,6 +24,5 @@ export interface HeadingProps {
|
|
|
23
24
|
accessibilityHint?: string;
|
|
24
25
|
accessibilityRole?: AccessibilityRole;
|
|
25
26
|
nativeID?: string;
|
|
26
|
-
testID?: string;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/heading/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9E,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,OAAO,GACP,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG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AAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/heading/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Responsive } from '@ankhorage/surface';\nimport type React from 'react';\nimport type { AccessibilityRole, TextStyle } from 'react-native';\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type HeadingSize = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport type HeadingTone =\n | 'default'\n | 'muted'\n | 'subtle'\n | 'inverse'\n | 'primary'\n | 'danger'\n | 'success'\n | 'warning';\n\nexport type HeadingAlign = NonNullable<TextStyle['textAlign']>;\n\nexport type HeadingWeight = 'regular' | 'medium' | 'semiBold' | 'bold';\n\nexport interface HeadingProps {\n children?: React.ReactNode;\n text?: string;\n i18nKey?: string;\n level?: HeadingLevel;\n size?: Responsive<HeadingSize>;\n tone?: Responsive<HeadingTone>;\n align?: Responsive<HeadingAlign>;\n weight?: Responsive<HeadingWeight>;\n italic?: boolean;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n selectable?: boolean;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n accessibilityRole?: AccessibilityRole;\n nativeID?: string;\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/heading/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Responsive } from '@ankhorage/surface';\nimport type React from 'react';\nimport type { AccessibilityRole, TextStyle } from 'react-native';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type HeadingSize = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport type HeadingTone =\n | 'default'\n | 'muted'\n | 'subtle'\n | 'inverse'\n | 'primary'\n | 'danger'\n | 'success'\n | 'warning';\n\nexport type HeadingAlign = NonNullable<TextStyle['textAlign']>;\n\nexport type HeadingWeight = 'regular' | 'medium' | 'semiBold' | 'bold';\n\nexport interface HeadingProps extends ZoraBaseProps {\n children?: React.ReactNode;\n text?: string;\n i18nKey?: string;\n level?: HeadingLevel;\n size?: Responsive<HeadingSize>;\n tone?: Responsive<HeadingTone>;\n align?: Responsive<HeadingAlign>;\n weight?: Responsive<HeadingWeight>;\n italic?: boolean;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n selectable?: boolean;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n accessibilityRole?: AccessibilityRole;\n nativeID?: string;\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type IconProps as SurfaceIconProps } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
+
export interface IconProps extends ZoraBaseProps, Omit<SurfaceIconProps, 'mode' | 'themeId'> {
|
|
5
|
+
}
|
|
6
|
+
export declare const Icon: (props: IconProps) => React.ReactElement | null;
|
|
5
7
|
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAAG;AAM/F,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Icon as SurfaceIcon } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
|
+
function IconInner({ themeId: _themeId, mode: _mode, ...props }) {
|
|
4
5
|
return <SurfaceIcon {...props}/>;
|
|
5
6
|
}
|
|
7
|
+
export const Icon = withZoraThemeScope(IconInner);
|
|
6
8
|
//# sourceMappingURL=Icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAsC,MAAM,oBAAoB,CAAC;AAC7F,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAsC,MAAM,oBAAoB,CAAC;AAC7F,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKpE,SAAS,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAa;IACxE,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { Icon as SurfaceIcon, type IconProps as SurfaceIconProps } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface IconProps extends ZoraBaseProps, Omit<SurfaceIconProps, 'mode' | 'themeId'> {}\n\nfunction IconInner({ themeId: _themeId, mode: _mode, ...props }: IconProps) {\n return <SurfaceIcon {...props} />;\n}\n\nexport const Icon = withZoraThemeScope(IconInner);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IconButtonProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const IconButton: (props: IconButtonProps) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA0B/C,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IconButton as SurfaceIconButton } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { resolveButtonRecipe } from '../../internal/recipes';
|
|
4
|
-
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
+
function IconButtonInner({ themeId: _themeId, mode: _mode, icon, label, emphasis = 'ghost', tone = 'neutral', size = 'm', ...props }) {
|
|
5
6
|
const recipe = resolveButtonRecipe({ emphasis, tone, size });
|
|
6
7
|
return (<SurfaceIconButton {...props} icon={icon} accessibilityLabel={label} size={recipe.size} tone={recipe.tone} variant={recipe.variant}/>);
|
|
7
8
|
}
|
|
9
|
+
export const IconButton = withZoraThemeScope(IconButtonInner);
|
|
8
10
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../src/components/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,eAAe,CAAC,EACvB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,GAAG,OAAO,EAClB,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,GAAG,EACV,GAAG,KAAK,EACQ;IAChB,MAAM,MAAM,GAAG,mBAAmB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7D,OAAO,CACL,CAAC,iBAAiB,CAChB,IAAI,KAAK,CAAC,CACV,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAC1B,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EACxB,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import { IconButton as SurfaceIconButton } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { resolveButtonRecipe } from '../../internal/recipes';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { IconButtonProps } from './types';\n\nfunction IconButtonInner({\n themeId: _themeId,\n mode: _mode,\n icon,\n label,\n emphasis = 'ghost',\n tone = 'neutral',\n size = 'm',\n ...props\n}: IconButtonProps) {\n const recipe = resolveButtonRecipe({ emphasis, tone, size });\n\n return (\n <SurfaceIconButton\n {...props}\n icon={icon}\n accessibilityLabel={label}\n size={recipe.size}\n tone={recipe.tone}\n variant={recipe.variant}\n />\n );\n}\n\nexport const IconButton = withZoraThemeScope(IconButtonInner);\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
2
|
import type { ZoraControlSize, ZoraEmphasis, ZoraTone } from '../../internal/recipes';
|
|
3
|
-
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
+
export interface IconButtonProps extends ZoraBaseProps {
|
|
4
5
|
icon: ButtonIconSpec;
|
|
5
6
|
label: string;
|
|
6
7
|
emphasis?: ZoraEmphasis;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\n\nimport type { ZoraControlSize, ZoraEmphasis, ZoraTone } from '../../internal/recipes';\n\nexport interface IconButtonProps {\n icon: ButtonIconSpec;\n label: string;\n emphasis?: ZoraEmphasis;\n tone?: ZoraTone;\n size?: ZoraControlSize;\n disabled?: boolean;\n loading?: boolean;\n onPress?: () => void;\n testID?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/icon-button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\n\nimport type { ZoraControlSize, ZoraEmphasis, ZoraTone } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface IconButtonProps extends ZoraBaseProps {\n icon: ButtonIconSpec;\n label: string;\n emphasis?: ZoraEmphasis;\n tone?: ZoraTone;\n size?: ZoraControlSize;\n disabled?: boolean;\n loading?: boolean;\n onPress?: () => void;\n testID?: string;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { InputProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const Input: (props: InputProps) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/input/Input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/input/Input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA0C1C,eAAO,MAAM,KAAK,kDAAiC,CAAC"}
|