@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/SwitchField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,
|
|
1
|
+
{"version":3,"file":"SwitchField.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/SwitchField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,KAAK,EACL,aAAa,EACb,QAAQ,EACR,MAAM,GACW;IACjB,OAAO,CACL,CAAC,WAAW,CACV,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAC,EACxF,CACH,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { Switch } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { SettingsRow } from '../settings-row';\nimport type { SwitchFieldProps } from './types';\n\nfunction SwitchFieldInner({\n themeId: _themeId,\n mode: _mode,\n label,\n description,\n value,\n onValueChange,\n disabled,\n testID,\n}: SwitchFieldProps) {\n return (\n <SettingsRow\n title={label}\n description={description}\n disabled={disabled}\n testID={testID}\n control={<Switch checked={value} onCheckedChange={onValueChange} disabled={disabled} />}\n />\n );\n}\n\nexport const SwitchField = withZoraThemeScope(SwitchFieldInner);\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
|
+
export interface SwitchFieldProps extends ZoraBaseProps {
|
|
3
4
|
label: ReactNode;
|
|
4
5
|
description?: ReactNode;
|
|
5
6
|
value: boolean;
|
|
6
7
|
onValueChange: (value: boolean) => void;
|
|
7
8
|
disabled?: boolean;
|
|
8
|
-
testID?: string;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/switch-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/switch-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface SwitchFieldProps {\n label: ReactNode;\n description?: ReactNode;\n value: boolean;\n onValueChange: (value: boolean) => void;\n disabled?: boolean;\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/switch-field/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface SwitchFieldProps extends ZoraBaseProps {\n label: ReactNode;\n description?: ReactNode;\n value: boolean;\n onValueChange: (value: boolean) => void;\n disabled?: boolean;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PaletteItemProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const PaletteItem: (props: PaletteItemProps) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=PaletteItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaletteItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/PaletteItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PaletteItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/PaletteItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgDhD,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { Box
|
|
1
|
+
import { Box } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Card } from '../../components/card';
|
|
4
4
|
import { Heading } from '../../components/heading';
|
|
5
5
|
import { Text } from '../../components/text';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
7
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
8
|
+
function PaletteItemInner({ themeId: _themeId, mode: _mode, title, description, icon, badge, selected, disabled, onPress, testID, }) {
|
|
9
|
+
const { theme } = useZoraTheme();
|
|
8
10
|
return (<Card compact disabled={disabled} onPress={onPress} testID={testID} tone={selected ? 'default' : 'subtle'} style={selected
|
|
9
11
|
? {
|
|
10
12
|
borderColor: theme.colors.primary,
|
|
@@ -23,4 +25,5 @@ export function PaletteItem({ title, description, icon, badge, selected, disable
|
|
|
23
25
|
</Box>
|
|
24
26
|
</Card>);
|
|
25
27
|
}
|
|
28
|
+
export const PaletteItem = withZoraThemeScope(PaletteItemInner);
|
|
26
29
|
//# sourceMappingURL=PaletteItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaletteItem.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/PaletteItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"PaletteItem.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/PaletteItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,GACW;IACjB,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IAEjC,OAAO,CACL,CAAC,IAAI,CACH,OAAO,CACP,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CACtC,KAAK,CAAC,CACJ,QAAQ;YACN,CAAC,CAAC;gBACE,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;gBACjC,WAAW,EAAE,CAAC;aACf;YACH,CAAC,CAAC,SACN,CAAC,CAED;MAAA,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAC1C;QAAA,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CACvD;QAAA,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAC/B;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,OAAO,CACT;QAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CACjD;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;QAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC5C;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { Box } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Card } from '../../components/card';\nimport { Heading } from '../../components/heading';\nimport { Text } from '../../components/text';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PaletteItemProps } from './types';\n\nfunction PaletteItemInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n icon,\n badge,\n selected,\n disabled,\n onPress,\n testID,\n}: PaletteItemProps) {\n const { theme } = useZoraTheme();\n\n return (\n <Card\n compact\n disabled={disabled}\n onPress={onPress}\n testID={testID}\n tone={selected ? 'default' : 'subtle'}\n style={\n selected\n ? {\n borderColor: theme.colors.primary,\n borderWidth: 2,\n }\n : undefined\n }\n >\n <Box p=\"xs\" style={{ alignItems: 'center' }}>\n {icon ? <Box pb=\"s\">{/* Icon spec here */}</Box> : null}\n <Heading level={5} align=\"center\">\n {title}\n </Heading>\n {description ? (\n <Text align=\"center\" tone=\"muted\" variant=\"caption\">\n {description}\n </Text>\n ) : null}\n {badge ? <Box pt=\"xs\">{badge}</Box> : null}\n </Box>\n </Card>\n );\n}\n\nexport const PaletteItem = withZoraThemeScope(PaletteItemInner);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TileGridProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const TileGrid: (props: TileGridProps) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=TileGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileGrid.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TileGrid.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA4C7C,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
|
+
function TileGridInner({ themeId: _themeId, mode: _mode, children, columns = 'responsive', compact = false, testID, }) {
|
|
4
5
|
return (<Box testID={testID} style={{
|
|
5
6
|
flexDirection: 'row',
|
|
6
7
|
flexWrap: 'wrap',
|
|
@@ -23,4 +24,5 @@ export function TileGrid({ children, columns = 'responsive', compact = false, te
|
|
|
23
24
|
})}
|
|
24
25
|
</Box>);
|
|
25
26
|
}
|
|
27
|
+
export const TileGrid = withZoraThemeScope(TileGridInner);
|
|
26
28
|
//# sourceMappingURL=TileGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileGrid.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TileGrid.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,aAAa,CAAC,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,OAAO,GAAG,YAAY,EACtB,OAAO,GAAG,KAAK,EACf,MAAM,GACQ;IACd,OAAO,CACL,CAAC,GAAG,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,MAAM;YAChB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SACtB,CAAC,CAEF;MAAA,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YACtC,IAAI,CAAC,KAAK;gBAAE,OAAO,IAAI,CAAC;YAExB,OAAO,CACL,CAAC,GAAG,CACF,KAAK,CAAC,CACJ,OAAO,KAAK,YAAY;oBACtB,CAAC,CAAC;wBACE,SAAS,EAAE,KAAK;wBAChB,QAAQ,EAAE,CAAC;wBACX,QAAQ,EAAE,GAAG;qBACd;oBACH,CAAC,CAAC;wBACE,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO,GAAG;qBAElC,CAAC,CAED;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Box } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { TileGridProps } from './types';\n\nfunction TileGridInner({\n themeId: _themeId,\n mode: _mode,\n children,\n columns = 'responsive',\n compact = false,\n testID,\n}: TileGridProps) {\n return (\n <Box\n testID={testID}\n style={{\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: compact ? 8 : 16,\n }}\n >\n {React.Children.map(children, (child) => {\n if (!child) return null;\n\n return (\n <Box\n style={\n columns === 'responsive'\n ? {\n flexBasis: '30%',\n flexGrow: 1,\n minWidth: 120,\n }\n : {\n width: `${100 / columns}%`,\n }\n }\n >\n {child}\n </Box>\n );\n })}\n </Box>\n );\n}\n\nexport const TileGrid = withZoraThemeScope(TileGridInner);\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
+
export interface TileGridProps extends ZoraBaseProps {
|
|
4
5
|
children?: ReactNode;
|
|
5
6
|
columns?: number | 'responsive';
|
|
6
7
|
compact?: boolean;
|
|
7
|
-
testID?: string;
|
|
8
8
|
}
|
|
9
|
-
export interface PaletteItemProps {
|
|
9
|
+
export interface PaletteItemProps extends ZoraBaseProps {
|
|
10
10
|
title: ReactNode;
|
|
11
11
|
description?: ReactNode;
|
|
12
12
|
icon?: ButtonIconSpec;
|
|
@@ -14,6 +14,5 @@ export interface PaletteItemProps {
|
|
|
14
14
|
selected?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
onPress?: () => void;
|
|
17
|
-
testID?: string;
|
|
18
17
|
}
|
|
19
18
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,aAAa;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type { ReactNode } from 'react';\n\nexport interface TileGridProps {\n children?: ReactNode;\n columns?: number | 'responsive';\n compact?: boolean;\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type { ReactNode } from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface TileGridProps extends ZoraBaseProps {\n children?: ReactNode;\n columns?: number | 'responsive';\n compact?: boolean;\n}\n\nexport interface PaletteItemProps extends ZoraBaseProps {\n title: ReactNode;\n description?: ReactNode;\n icon?: ButtonIconSpec;\n badge?: ReactNode;\n selected?: boolean;\n disabled?: boolean;\n onPress?: () => void;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
2
3
|
import type { TreeItemNode, TreeItemRenderProps } from './types';
|
|
3
|
-
interface TreeItemProps<TId extends string = string> {
|
|
4
|
+
interface TreeItemProps<TId extends string = string> extends ZoraBaseProps {
|
|
4
5
|
node: TreeItemNode<TId>;
|
|
5
6
|
depth: number;
|
|
6
7
|
selectedId?: TId;
|
|
@@ -9,6 +10,6 @@ interface TreeItemProps<TId extends string = string> {
|
|
|
9
10
|
onToggleExpand: (id: TId) => void;
|
|
10
11
|
renderItem?: (props: TreeItemRenderProps<TId>) => React.ReactNode;
|
|
11
12
|
}
|
|
12
|
-
export declare
|
|
13
|
+
export declare const TreeItem: <TId extends string = string>(props: TreeItemProps<TId>) => React.ReactElement | null;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=TreeItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjE,UAAU,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjE,UAAU,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,aAAa;IACxE,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,SAAS,GAAG,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CACnE;AA2ED,eAAO,MAAM,QAAQ,GAzEE,GAAG,SAAS,MAAM,kEAyEgB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Box, Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { IconButton } from '../../components/icon-button';
|
|
4
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
5
|
import { SettingsRow } from '../settings-row';
|
|
5
|
-
|
|
6
|
+
function TreeItemInner({ themeId: _themeId, mode: _mode, node, depth, selectedId, expandedIds, onSelect, onToggleExpand, renderItem, testID, }) {
|
|
6
7
|
const hasChildren = node.children !== undefined && node.children.length > 0;
|
|
7
8
|
const isExpanded = expandedIds.includes(node.id);
|
|
8
9
|
const isSelected = selectedId === node.id;
|
|
@@ -21,11 +22,12 @@ export function TreeItem({ node, depth, selectedId, expandedIds, onSelect, onTog
|
|
|
21
22
|
{hasChildren ? (<IconButton icon={{ name: isExpanded ? 'chevron-down-outline' : 'chevron-forward-outline' }} label={isExpanded ? 'Collapse' : 'Expand'} onPress={() => onToggleExpand(node.id)} size="s" emphasis="ghost"/>) : null}
|
|
22
23
|
</Stack>} meta={node.meta} disabled={node.disabled}/>);
|
|
23
24
|
};
|
|
24
|
-
return (<Box>
|
|
25
|
+
return (<Box testID={testID}>
|
|
25
26
|
<Box style={{ paddingLeft: depth * 16 }}>{renderContent()}</Box>
|
|
26
27
|
{hasChildren && isExpanded ? (<Box>
|
|
27
28
|
{node.children?.map((child) => (<TreeItem key={child.id} depth={depth + 1} expandedIds={expandedIds} node={child} onSelect={onSelect} onToggleExpand={onToggleExpand} renderItem={renderItem} selectedId={selectedId}/>))}
|
|
28
29
|
</Box>) : null}
|
|
29
30
|
</Box>);
|
|
30
31
|
}
|
|
32
|
+
export const TreeItem = withZoraThemeScope(TreeItemInner);
|
|
31
33
|
//# sourceMappingURL=TreeItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItem.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAa9C,
|
|
1
|
+
{"version":3,"file":"TreeItem.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAa9C,SAAS,aAAa,CAA8B,EAClD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,IAAI,EACJ,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,UAAU,EACV,MAAM,GACa;IACnB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5E,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC,EAAE,CAAC;IAE1C,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC;gBAChB,IAAI;gBACJ,KAAK;gBACL,QAAQ,EAAE,UAAU;gBACpB,QAAQ,EAAE,UAAU;gBACpB,WAAW;aACZ,CAAC,CAAC;QACL,CAAC;QAED,OAAO,CACL,CAAC,WAAW,CACV,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,OAAO,CAAC,CACN,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAC5C;YAAA,CAAC,IAAI,CAAC,OAAO,CACb;YAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,UAAU,CACT,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAChF,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC1C,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CACvC,IAAI,CAAC,GAAG,CACR,QAAQ,CAAC,OAAO,EAChB,CACH,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,EAAE,KAAK,CACT,CAAC,CACD,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAChB,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EACxB,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAClB;MAAA,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,EAAE,GAAG,CAC/D;MAAA,CAAC,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC,CAC3B,CAAC,GAAG,CACF;UAAA,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC7B,CAAC,QAAQ,CACP,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CACd,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CACjB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,CAAC,CAAC,KAAK,CAAC,CACZ,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;QAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Box, Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { IconButton } from '../../components/icon-button';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\nimport { SettingsRow } from '../settings-row';\nimport type { TreeItemNode, TreeItemRenderProps } from './types';\n\ninterface TreeItemProps<TId extends string = string> extends ZoraBaseProps {\n node: TreeItemNode<TId>;\n depth: number;\n selectedId?: TId;\n expandedIds: readonly TId[];\n onSelect?: (id: TId) => void;\n onToggleExpand: (id: TId) => void;\n renderItem?: (props: TreeItemRenderProps<TId>) => React.ReactNode;\n}\n\nfunction TreeItemInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n node,\n depth,\n selectedId,\n expandedIds,\n onSelect,\n onToggleExpand,\n renderItem,\n testID,\n}: TreeItemProps<TId>) {\n const hasChildren = node.children !== undefined && node.children.length > 0;\n const isExpanded = expandedIds.includes(node.id);\n const isSelected = selectedId === node.id;\n\n const renderContent = () => {\n if (renderItem) {\n return renderItem({\n node,\n depth,\n selected: isSelected,\n expanded: isExpanded,\n hasChildren,\n });\n }\n\n return (\n <SettingsRow\n title={node.label}\n control={\n <Stack direction=\"row\" gap=\"xs\" align=\"center\">\n {node.actions}\n {hasChildren ? (\n <IconButton\n icon={{ name: isExpanded ? 'chevron-down-outline' : 'chevron-forward-outline' }}\n label={isExpanded ? 'Collapse' : 'Expand'}\n onPress={() => onToggleExpand(node.id)}\n size=\"s\"\n emphasis=\"ghost\"\n />\n ) : null}\n </Stack>\n }\n meta={node.meta}\n disabled={node.disabled}\n />\n );\n };\n\n return (\n <Box testID={testID}>\n <Box style={{ paddingLeft: depth * 16 }}>{renderContent()}</Box>\n {hasChildren && isExpanded ? (\n <Box>\n {node.children?.map((child) => (\n <TreeItem\n key={child.id}\n depth={depth + 1}\n expandedIds={expandedIds}\n node={child}\n onSelect={onSelect}\n onToggleExpand={onToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </Box>\n ) : null}\n </Box>\n );\n}\n\nexport const TreeItem = withZoraThemeScope(TreeItemInner);\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TreeViewProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const TreeView: <TId extends string = string>(props: TreeViewProps<TId>) => React.ReactElement | null;
|
|
4
4
|
//# sourceMappingURL=TreeView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiD7C,eAAO,MAAM,QAAQ,GA/CE,GAAG,SAAS,MAAM,kEA+CgB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Stack } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
3
4
|
import { TreeItem } from './TreeItem';
|
|
4
|
-
|
|
5
|
+
function TreeViewInner({ themeId: _themeId, mode: _mode, nodes, selectedId, expandedIds: controlledExpandedIds, defaultExpandedIds, onSelect, onExpandedChange, renderItem, testID, }) {
|
|
5
6
|
const [internalExpandedIds, setInternalExpandedIds] = React.useState(defaultExpandedIds ?? []);
|
|
6
7
|
const isControlled = controlledExpandedIds !== undefined;
|
|
7
8
|
const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;
|
|
@@ -17,4 +18,5 @@ export function TreeView({ nodes, selectedId, expandedIds: controlledExpandedIds
|
|
|
17
18
|
{nodes.map((node) => (<TreeItem key={node.id} depth={0} expandedIds={expandedIds} node={node} onSelect={onSelect} onToggleExpand={handleToggleExpand} renderItem={renderItem} selectedId={selectedId}/>))}
|
|
18
19
|
</Stack>);
|
|
19
20
|
}
|
|
21
|
+
export const TreeView = withZoraThemeScope(TreeViewInner);
|
|
20
22
|
//# sourceMappingURL=TreeView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,
|
|
1
|
+
{"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,SAAS,aAAa,CAA8B,EAClD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,UAAU,EACV,WAAW,EAAE,qBAAqB,EAClC,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,MAAM,GACa;IACnB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAClE,kBAAkB,IAAI,EAAE,CACzB,CAAC;IAEF,MAAM,YAAY,GAAG,qBAAqB,KAAK,SAAS,CAAC;IACzD,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAE/E,MAAM,kBAAkB,GAAG,CAAC,EAAO,EAAE,EAAE;QACrC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,EAAE,EAAE,CAAC,CAAC;QAE3F,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,gBAAgB,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC/B;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,CAAC,QAAQ,CACP,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACb,KAAK,CAAC,CAAC,CAAC,CAAC,CACT,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,kBAAkB,CAAC,CACnC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { TreeItem } from './TreeItem';\nimport type { TreeViewProps } from './types';\n\nfunction TreeViewInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n nodes,\n selectedId,\n expandedIds: controlledExpandedIds,\n defaultExpandedIds,\n onSelect,\n onExpandedChange,\n renderItem,\n testID,\n}: TreeViewProps<TId>) {\n const [internalExpandedIds, setInternalExpandedIds] = React.useState<readonly TId[]>(\n defaultExpandedIds ?? [],\n );\n\n const isControlled = controlledExpandedIds !== undefined;\n const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;\n\n const handleToggleExpand = (id: TId) => {\n const isExpanded = expandedIds.includes(id);\n const newIds = isExpanded ? expandedIds.filter((eid) => eid !== id) : [...expandedIds, id];\n\n if (!isControlled) {\n setInternalExpandedIds(newIds);\n }\n onExpandedChange?.(newIds);\n };\n\n return (\n <Stack gap=\"none\" testID={testID}>\n {nodes.map((node) => (\n <TreeItem\n key={node.id}\n depth={0}\n expandedIds={expandedIds}\n node={node}\n onSelect={onSelect}\n onToggleExpand={handleToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </Stack>\n );\n}\n\nexport const TreeView = withZoraThemeScope(TreeViewInner);\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
3
4
|
export interface TreeItemNode<TId extends string = string> {
|
|
4
5
|
id: TId;
|
|
5
6
|
label: ReactNode;
|
|
@@ -16,7 +17,7 @@ export interface TreeItemRenderProps<TId extends string = string> {
|
|
|
16
17
|
expanded: boolean;
|
|
17
18
|
hasChildren: boolean;
|
|
18
19
|
}
|
|
19
|
-
export interface TreeViewProps<TId extends string = string> {
|
|
20
|
+
export interface TreeViewProps<TId extends string = string> extends ZoraBaseProps {
|
|
20
21
|
nodes: readonly TreeItemNode<TId>[];
|
|
21
22
|
selectedId?: TId;
|
|
22
23
|
expandedIds?: readonly TId[];
|
|
@@ -24,6 +25,5 @@ export interface TreeViewProps<TId extends string = string> {
|
|
|
24
25
|
onSelect?: (id: TId) => void;
|
|
25
26
|
onExpandedChange?: (ids: readonly TId[]) => void;
|
|
26
27
|
renderItem?: (props: TreeItemRenderProps<TId>) => ReactNode;
|
|
27
|
-
testID?: string;
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,YAAY,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACvD,EAAE,EAAE,GAAG,CAAC;IACR,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IAC9D,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,YAAY,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IACvD,EAAE,EAAE,GAAG,CAAC;IACR,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM;IAC9D,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,aAAa;IAC/E,KAAK,EAAE,SAAS,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;IACpC,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;IAC7B,kBAAkB,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,GAAG,EAAE,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC;CAC7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type { ReactNode } from 'react';\n\nexport interface TreeItemNode<TId extends string = string> {\n id: TId;\n label: ReactNode;\n icon?: ButtonIconSpec;\n children?: readonly TreeItemNode<TId>[];\n disabled?: boolean;\n meta?: ReactNode;\n actions?: ReactNode;\n}\n\nexport interface TreeItemRenderProps<TId extends string = string> {\n node: TreeItemNode<TId>;\n depth: number;\n selected: boolean;\n expanded: boolean;\n hasChildren: boolean;\n}\n\nexport interface TreeViewProps<TId extends string = string> {\n nodes: readonly TreeItemNode<TId>[];\n selectedId?: TId;\n expandedIds?: readonly TId[];\n defaultExpandedIds?: readonly TId[];\n onSelect?: (id: TId) => void;\n onExpandedChange?: (ids: readonly TId[]) => void;\n renderItem?: (props: TreeItemRenderProps<TId>) => ReactNode;\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type { ReactNode } from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface TreeItemNode<TId extends string = string> {\n id: TId;\n label: ReactNode;\n icon?: ButtonIconSpec;\n children?: readonly TreeItemNode<TId>[];\n disabled?: boolean;\n meta?: ReactNode;\n actions?: ReactNode;\n}\n\nexport interface TreeItemRenderProps<TId extends string = string> {\n node: TreeItemNode<TId>;\n depth: number;\n selected: boolean;\n expanded: boolean;\n hasChildren: boolean;\n}\n\nexport interface TreeViewProps<TId extends string = string> extends ZoraBaseProps {\n nodes: readonly TreeItemNode<TId>[];\n selectedId?: TId;\n expandedIds?: readonly TId[];\n defaultExpandedIds?: readonly TId[];\n onSelect?: (id: TId) => void;\n onExpandedChange?: (ids: readonly TId[]) => void;\n renderItem?: (props: TreeItemRenderProps<TId>) => ReactNode;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ZoraThemeId, ZoraThemeMode } from './types';
|
|
2
|
+
export interface ZoraBaseProps {
|
|
3
|
+
/**
|
|
4
|
+
* Overrides the active ZORA theme for this component and its subtree.
|
|
5
|
+
* If omitted, the nearest parent theme is inherited.
|
|
6
|
+
*
|
|
7
|
+
* Plan 2: theme registries are not available yet. Only the inherited theme id
|
|
8
|
+
* is valid; unknown ids throw in dev/test and warn+fallback in production.
|
|
9
|
+
*/
|
|
10
|
+
themeId?: ZoraThemeId;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides the light/dark mode for this component and its subtree.
|
|
13
|
+
* If omitted, the nearest parent mode is inherited.
|
|
14
|
+
*/
|
|
15
|
+
mode?: ZoraThemeMode;
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ZoraBaseProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoraBaseProps.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraBaseProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoraBaseProps.js","sourceRoot":"","sources":["../../src/theme/ZoraBaseProps.ts"],"names":[],"mappings":"","sourcesContent":["import type { ZoraThemeId, ZoraThemeMode } from './types';\n\nexport interface ZoraBaseProps {\n /**\n * Overrides the active ZORA theme for this component and its subtree.\n * If omitted, the nearest parent theme is inherited.\n *\n * Plan 2: theme registries are not available yet. Only the inherited theme id\n * is valid; unknown ids throw in dev/test and warn+fallback in production.\n */\n themeId?: ZoraThemeId;\n\n /**\n * Overrides the light/dark mode for this component and its subtree.\n * If omitted, the nearest parent mode is inherited.\n */\n mode?: ZoraThemeMode;\n\n testID?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoraProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ZoraProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,KAAwB,EACxB,WAAqB,GACtB,EAAE,iBAAiB,qBAUnB"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThemeProvider } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { createZoraThemeConfig } from './createZoraThemeConfig';
|
|
4
4
|
import { zoraDefaultTheme } from './zoraDefaultTheme';
|
|
5
|
+
import { ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';
|
|
5
6
|
export function ZoraProvider({ children, theme = zoraDefaultTheme, initialMode = 'light', }) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const runtimeValue = React.useMemo(() => ({ sourceTheme: theme, themeId: theme.id }), [theme]);
|
|
8
|
+
return (<ZoraThemeRuntimeContext.Provider value={runtimeValue}>
|
|
9
|
+
<ThemeProvider initialConfig={createZoraThemeConfig(theme)} initialMode={initialMode}>
|
|
10
|
+
{children}
|
|
11
|
+
</ThemeProvider>
|
|
12
|
+
</ZoraThemeRuntimeContext.Provider>);
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=ZoraProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoraProvider.js","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ZoraProvider.js","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAQpE,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,KAAK,GAAG,gBAAgB,EACxB,WAAW,GAAG,OAAO,GACH;IAClB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/F,OAAO,CACL,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACpD;MAAA,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CACnF;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,aAAa,CACjB;IAAA,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CACpC,CAAC;AACJ,CAAC","sourcesContent":["import { ThemeProvider } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { createZoraThemeConfig } from './createZoraThemeConfig';\nimport type { ZoraTheme, ZoraThemeMode } from './types';\nimport { zoraDefaultTheme } from './zoraDefaultTheme';\nimport { ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';\n\nexport interface ZoraProviderProps {\n children: React.ReactNode;\n theme?: ZoraTheme;\n initialMode?: ZoraThemeMode;\n}\n\nexport function ZoraProvider({\n children,\n theme = zoraDefaultTheme,\n initialMode = 'light',\n}: ZoraProviderProps) {\n const runtimeValue = React.useMemo(() => ({ sourceTheme: theme, themeId: theme.id }), [theme]);\n\n return (\n <ZoraThemeRuntimeContext.Provider value={runtimeValue}>\n <ThemeProvider initialConfig={createZoraThemeConfig(theme)} initialMode={initialMode}>\n {children}\n </ThemeProvider>\n </ZoraThemeRuntimeContext.Provider>\n );\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ZoraTheme, ZoraThemeId } from './types';
|
|
2
|
+
interface ZoraThemeRuntime {
|
|
3
|
+
sourceTheme: ZoraTheme;
|
|
4
|
+
themeId: ZoraThemeId;
|
|
5
|
+
}
|
|
6
|
+
export declare const ZoraThemeRuntimeContext: import("react").Context<ZoraThemeRuntime>;
|
|
7
|
+
export declare function useZoraThemeRuntime(): ZoraThemeRuntime;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=ZoraThemeRuntimeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoraThemeRuntimeContext.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraThemeRuntimeContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtD,UAAU,gBAAgB;IACxB,WAAW,EAAE,SAAS,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,uBAAuB,2CAGlC,CAAC;AAEH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { zoraDefaultTheme } from './zoraDefaultTheme';
|
|
3
|
+
export const ZoraThemeRuntimeContext = createContext({
|
|
4
|
+
sourceTheme: zoraDefaultTheme,
|
|
5
|
+
themeId: zoraDefaultTheme.id,
|
|
6
|
+
});
|
|
7
|
+
export function useZoraThemeRuntime() {
|
|
8
|
+
return useContext(ZoraThemeRuntimeContext);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ZoraThemeRuntimeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoraThemeRuntimeContext.js","sourceRoot":"","sources":["../../src/theme/ZoraThemeRuntimeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAmB;IACrE,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,gBAAgB,CAAC,EAAE;CAC7B,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { createContext, useContext } from 'react';\n\nimport type { ZoraTheme, ZoraThemeId } from './types';\nimport { zoraDefaultTheme } from './zoraDefaultTheme';\n\ninterface ZoraThemeRuntime {\n sourceTheme: ZoraTheme;\n themeId: ZoraThemeId;\n}\n\nexport const ZoraThemeRuntimeContext = createContext<ZoraThemeRuntime>({\n sourceTheme: zoraDefaultTheme,\n themeId: zoraDefaultTheme.id,\n});\n\nexport function useZoraThemeRuntime(): ZoraThemeRuntime {\n return useContext(ZoraThemeRuntimeContext);\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ZoraThemeId, ZoraThemeMode } from './types';
|
|
3
|
+
export interface ZoraThemeScopeProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
themeId?: ZoraThemeId;
|
|
6
|
+
mode?: ZoraThemeMode;
|
|
7
|
+
}
|
|
8
|
+
export declare function ZoraThemeScope({ children, themeId, mode }: ZoraThemeScopeProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
9
|
+
//# sourceMappingURL=ZoraThemeScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoraThemeScope.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraThemeScope.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAmDD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,mBAAmB,mSAU9E"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createTheme, ThemeContext, useFontContext, useTheme } from '@ankhorage/surface';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { createZoraThemeConfig } from './createZoraThemeConfig';
|
|
4
|
+
import { resolveZoraScopedThemeId } from './resolveZoraScopedThemeId';
|
|
5
|
+
import { useZoraThemeRuntime, ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';
|
|
6
|
+
function ZoraThemeScopeInner({ children, themeId, mode }) {
|
|
7
|
+
const parentSurface = useTheme();
|
|
8
|
+
const parentRuntime = useZoraThemeRuntime();
|
|
9
|
+
const { activeFontId } = useFontContext();
|
|
10
|
+
const scopedThemeId = resolveZoraScopedThemeId({
|
|
11
|
+
desiredThemeId: themeId,
|
|
12
|
+
inheritedThemeId: parentRuntime.themeId,
|
|
13
|
+
});
|
|
14
|
+
const scopedMode = mode ?? parentSurface.mode;
|
|
15
|
+
// Plan 2: there is no multi-theme registry yet. Keep the active theme seed inherited.
|
|
16
|
+
const surfaceConfig = useMemo(() => createZoraThemeConfig(parentRuntime.sourceTheme), [parentRuntime.sourceTheme]);
|
|
17
|
+
const scopedTheme = useMemo(() => createTheme(surfaceConfig, scopedMode, activeFontId), [surfaceConfig, scopedMode, activeFontId]);
|
|
18
|
+
const scopedSurfaceValue = useMemo(() => ({
|
|
19
|
+
theme: scopedTheme,
|
|
20
|
+
mode: scopedMode,
|
|
21
|
+
setMode: parentSurface.setMode,
|
|
22
|
+
setThemeConfig: parentSurface.setThemeConfig,
|
|
23
|
+
_hasProvider: true,
|
|
24
|
+
}), [parentSurface.setMode, parentSurface.setThemeConfig, scopedMode, scopedTheme]);
|
|
25
|
+
const scopedRuntimeValue = useMemo(() => ({
|
|
26
|
+
sourceTheme: parentRuntime.sourceTheme,
|
|
27
|
+
themeId: scopedThemeId,
|
|
28
|
+
}), [parentRuntime.sourceTheme, scopedThemeId]);
|
|
29
|
+
return (<ZoraThemeRuntimeContext.Provider value={scopedRuntimeValue}>
|
|
30
|
+
<ThemeContext.Provider value={scopedSurfaceValue}>{children}</ThemeContext.Provider>
|
|
31
|
+
</ZoraThemeRuntimeContext.Provider>);
|
|
32
|
+
}
|
|
33
|
+
export function ZoraThemeScope({ children, themeId, mode }) {
|
|
34
|
+
if (mode === undefined && themeId === undefined) {
|
|
35
|
+
return children;
|
|
36
|
+
}
|
|
37
|
+
return (<ZoraThemeScopeInner mode={mode} themeId={themeId}>
|
|
38
|
+
{children}
|
|
39
|
+
</ZoraThemeScopeInner>);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ZoraThemeScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZoraThemeScope.js","sourceRoot":"","sources":["../../src/theme/ZoraThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAQzF,SAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAuB;IAC3E,MAAM,aAAa,GAAG,QAAQ,EAAE,CAAC;IACjC,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;IAC5C,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAE1C,MAAM,aAAa,GAAG,wBAAwB,CAAC;QAC7C,cAAc,EAAE,OAAO;QACvB,gBAAgB,EAAE,aAAa,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC;IAE9C,sFAAsF;IACtF,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC,WAAW,CAAC,EACtD,CAAC,aAAa,CAAC,WAAW,CAAC,CAC5B,CAAC;IAEF,MAAM,WAAW,GAAG,OAAO,CACzB,GAAG,EAAE,CAAC,WAAW,CAAC,aAAa,EAAE,UAAU,EAAE,YAAY,CAAC,EAC1D,CAAC,aAAa,EAAE,UAAU,EAAE,YAAY,CAAC,CAC1C,CAAC;IAEF,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,aAAa,CAAC,OAAO;QAC9B,cAAc,EAAE,aAAa,CAAC,cAAc;QAC5C,YAAY,EAAE,IAAI;KACnB,CAAC,EACF,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,cAAc,EAAE,UAAU,EAAE,WAAW,CAAC,CAC/E,CAAC;IAEF,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC;QACL,WAAW,EAAE,aAAa,CAAC,WAAW;QACtC,OAAO,EAAE,aAAa;KACvB,CAAC,EACF,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,CAC3C,CAAC;IAEF,OAAO,CACL,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAC1D;MAAA,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CACrF;IAAA,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAuB;IAC7E,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,CACL,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAChD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAmB,CAAC,CACvB,CAAC;AACJ,CAAC","sourcesContent":["import { createTheme, ThemeContext, useFontContext, useTheme } from '@ankhorage/surface';\nimport React, { useMemo } from 'react';\n\nimport { createZoraThemeConfig } from './createZoraThemeConfig';\nimport { resolveZoraScopedThemeId } from './resolveZoraScopedThemeId';\nimport type { ZoraThemeId, ZoraThemeMode } from './types';\nimport { useZoraThemeRuntime, ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';\n\nexport interface ZoraThemeScopeProps {\n children: React.ReactNode;\n themeId?: ZoraThemeId;\n mode?: ZoraThemeMode;\n}\n\nfunction ZoraThemeScopeInner({ children, themeId, mode }: ZoraThemeScopeProps) {\n const parentSurface = useTheme();\n const parentRuntime = useZoraThemeRuntime();\n const { activeFontId } = useFontContext();\n\n const scopedThemeId = resolveZoraScopedThemeId({\n desiredThemeId: themeId,\n inheritedThemeId: parentRuntime.themeId,\n });\n\n const scopedMode = mode ?? parentSurface.mode;\n\n // Plan 2: there is no multi-theme registry yet. Keep the active theme seed inherited.\n const surfaceConfig = useMemo(\n () => createZoraThemeConfig(parentRuntime.sourceTheme),\n [parentRuntime.sourceTheme],\n );\n\n const scopedTheme = useMemo(\n () => createTheme(surfaceConfig, scopedMode, activeFontId),\n [surfaceConfig, scopedMode, activeFontId],\n );\n\n const scopedSurfaceValue = useMemo(\n () => ({\n theme: scopedTheme,\n mode: scopedMode,\n setMode: parentSurface.setMode,\n setThemeConfig: parentSurface.setThemeConfig,\n _hasProvider: true,\n }),\n [parentSurface.setMode, parentSurface.setThemeConfig, scopedMode, scopedTheme],\n );\n\n const scopedRuntimeValue = useMemo(\n () => ({\n sourceTheme: parentRuntime.sourceTheme,\n themeId: scopedThemeId,\n }),\n [parentRuntime.sourceTheme, scopedThemeId],\n );\n\n return (\n <ZoraThemeRuntimeContext.Provider value={scopedRuntimeValue}>\n <ThemeContext.Provider value={scopedSurfaceValue}>{children}</ThemeContext.Provider>\n </ZoraThemeRuntimeContext.Provider>\n );\n}\n\nexport function ZoraThemeScope({ children, themeId, mode }: ZoraThemeScopeProps) {\n if (mode === undefined && themeId === undefined) {\n return children;\n }\n\n return (\n <ZoraThemeScopeInner mode={mode} themeId={themeId}>\n {children}\n </ZoraThemeScopeInner>\n );\n}\n"]}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export { createZoraThemeConfig } from './createZoraThemeConfig';
|
|
2
2
|
export type { ZoraColorHarmony, ZoraColorTone, ZoraComputedTheme, ZoraHexColor, ZoraTheme, ZoraThemeId, ZoraThemeMode, } from './types';
|
|
3
3
|
export { useZoraTheme } from './useZoraTheme';
|
|
4
|
+
export { withZoraThemeScope } from './withZoraThemeScope';
|
|
5
|
+
export type { ZoraBaseProps } from './ZoraBaseProps';
|
|
4
6
|
export { zoraDefaultTheme } from './zoraDefaultTheme';
|
|
5
7
|
export type { ZoraProviderProps } from './ZoraProvider';
|
|
6
8
|
export { ZoraProvider } from './ZoraProvider';
|
|
9
|
+
export type { ZoraThemeScopeProps } from './ZoraThemeScope';
|
|
10
|
+
export { ZoraThemeScope } from './ZoraThemeScope';
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/theme/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { createZoraThemeConfig } from './createZoraThemeConfig';
|
|
2
2
|
export { useZoraTheme } from './useZoraTheme';
|
|
3
|
+
export { withZoraThemeScope } from './withZoraThemeScope';
|
|
3
4
|
export { zoraDefaultTheme } from './zoraDefaultTheme';
|
|
4
5
|
export { ZoraProvider } from './ZoraProvider';
|
|
6
|
+
export { ZoraThemeScope } from './ZoraThemeScope';
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/dist/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAUhE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { createZoraThemeConfig } from './createZoraThemeConfig';\nexport type {\n ZoraColorHarmony,\n ZoraColorTone,\n ZoraComputedTheme,\n ZoraHexColor,\n ZoraTheme,\n ZoraThemeId,\n ZoraThemeMode,\n} from './types';\nexport { useZoraTheme } from './useZoraTheme';\nexport { zoraDefaultTheme } from './zoraDefaultTheme';\nexport type { ZoraProviderProps } from './ZoraProvider';\nexport { ZoraProvider } from './ZoraProvider';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAUhE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { createZoraThemeConfig } from './createZoraThemeConfig';\nexport type {\n ZoraColorHarmony,\n ZoraColorTone,\n ZoraComputedTheme,\n ZoraHexColor,\n ZoraTheme,\n ZoraThemeId,\n ZoraThemeMode,\n} from './types';\nexport { useZoraTheme } from './useZoraTheme';\nexport { withZoraThemeScope } from './withZoraThemeScope';\nexport type { ZoraBaseProps } from './ZoraBaseProps';\nexport { zoraDefaultTheme } from './zoraDefaultTheme';\nexport type { ZoraProviderProps } from './ZoraProvider';\nexport { ZoraProvider } from './ZoraProvider';\nexport type { ZoraThemeScopeProps } from './ZoraThemeScope';\nexport { ZoraThemeScope } from './ZoraThemeScope';\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ZoraThemeId } from './types';
|
|
2
|
+
export declare function resolveZoraScopedThemeId({ desiredThemeId, inheritedThemeId, }: {
|
|
3
|
+
desiredThemeId: ZoraThemeId | undefined;
|
|
4
|
+
inheritedThemeId: ZoraThemeId;
|
|
5
|
+
}): ZoraThemeId;
|
|
6
|
+
//# sourceMappingURL=resolveZoraScopedThemeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveZoraScopedThemeId.d.ts","sourceRoot":"","sources":["../../src/theme/resolveZoraScopedThemeId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,wBAAwB,CAAC,EACvC,cAAc,EACd,gBAAgB,GACjB,EAAE;IACD,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,gBAAgB,EAAE,WAAW,CAAC;CAC/B,GAAG,WAAW,CAgBd"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function resolveZoraScopedThemeId({ desiredThemeId, inheritedThemeId, }) {
|
|
2
|
+
if (desiredThemeId === undefined || desiredThemeId === inheritedThemeId) {
|
|
3
|
+
return inheritedThemeId;
|
|
4
|
+
}
|
|
5
|
+
const message = [
|
|
6
|
+
`Unknown ZORA theme id '${desiredThemeId}'.`,
|
|
7
|
+
'Theme registries are not available yet; register the theme before using themeId scopes.',
|
|
8
|
+
].join(' ');
|
|
9
|
+
if (process.env.NODE_ENV === 'production') {
|
|
10
|
+
console.warn(message);
|
|
11
|
+
return inheritedThemeId;
|
|
12
|
+
}
|
|
13
|
+
throw new Error(message);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=resolveZoraScopedThemeId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveZoraScopedThemeId.js","sourceRoot":"","sources":["../../src/theme/resolveZoraScopedThemeId.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,wBAAwB,CAAC,EACvC,cAAc,EACd,gBAAgB,GAIjB;IACC,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,gBAAgB,EAAE,CAAC;QACxE,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM,OAAO,GAAG;QACd,0BAA0B,cAAc,IAAI;QAC5C,yFAAyF;KAC1F,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEZ,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC1C,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import type { ZoraThemeId } from './types';\n\nexport function resolveZoraScopedThemeId({\n desiredThemeId,\n inheritedThemeId,\n}: {\n desiredThemeId: ZoraThemeId | undefined;\n inheritedThemeId: ZoraThemeId;\n}): ZoraThemeId {\n if (desiredThemeId === undefined || desiredThemeId === inheritedThemeId) {\n return inheritedThemeId;\n }\n\n const message = [\n `Unknown ZORA theme id '${desiredThemeId}'.`,\n 'Theme registries are not available yet; register the theme before using themeId scopes.',\n ].join(' ');\n\n if (process.env.NODE_ENV === 'production') {\n console.warn(message);\n return inheritedThemeId;\n }\n\n throw new Error(message);\n}\n"]}
|