@ankhorage/zora 1.2.0 → 1.4.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 +207 -0
- package/dist/components/app-bar/meta.d.ts +9 -0
- package/dist/components/app-bar/meta.d.ts.map +1 -0
- package/dist/components/app-bar/meta.js +9 -0
- package/dist/components/app-bar/meta.js.map +1 -0
- package/dist/components/avatar/meta.d.ts +9 -0
- package/dist/components/avatar/meta.d.ts.map +1 -0
- package/dist/components/avatar/meta.js +9 -0
- package/dist/components/avatar/meta.js.map +1 -0
- package/dist/components/avatar-group/meta.d.ts +9 -0
- package/dist/components/avatar-group/meta.d.ts.map +1 -0
- package/dist/components/avatar-group/meta.js +9 -0
- package/dist/components/avatar-group/meta.js.map +1 -0
- package/dist/components/badge/meta.d.ts +9 -0
- package/dist/components/badge/meta.d.ts.map +1 -0
- package/dist/components/badge/meta.js +9 -0
- package/dist/components/badge/meta.js.map +1 -0
- package/dist/components/button/meta.d.ts +45 -0
- package/dist/components/button/meta.d.ts.map +1 -0
- package/dist/components/button/meta.js +45 -0
- package/dist/components/button/meta.js.map +1 -0
- package/dist/components/card/meta.d.ts +44 -0
- package/dist/components/card/meta.d.ts.map +1 -0
- package/dist/components/card/meta.js +45 -0
- package/dist/components/card/meta.js.map +1 -0
- package/dist/components/checkbox/meta.d.ts +17 -0
- package/dist/components/checkbox/meta.d.ts.map +1 -0
- package/dist/components/checkbox/meta.js +17 -0
- package/dist/components/checkbox/meta.js.map +1 -0
- package/dist/components/chip/meta.d.ts +9 -0
- package/dist/components/chip/meta.d.ts.map +1 -0
- package/dist/components/chip/meta.js +9 -0
- package/dist/components/chip/meta.js.map +1 -0
- package/dist/components/chip-group/meta.d.ts +9 -0
- package/dist/components/chip-group/meta.d.ts.map +1 -0
- package/dist/components/chip-group/meta.js +9 -0
- package/dist/components/chip-group/meta.js.map +1 -0
- package/dist/components/drawer/meta.d.ts +9 -0
- package/dist/components/drawer/meta.d.ts.map +1 -0
- package/dist/components/drawer/meta.js +9 -0
- package/dist/components/drawer/meta.js.map +1 -0
- package/dist/components/form/meta.d.ts +79 -0
- package/dist/components/form/meta.d.ts.map +1 -0
- package/dist/components/form/meta.js +79 -0
- package/dist/components/form/meta.js.map +1 -0
- package/dist/components/heading/meta.d.ts +69 -0
- package/dist/components/heading/meta.d.ts.map +1 -0
- package/dist/components/heading/meta.js +66 -0
- package/dist/components/heading/meta.js.map +1 -0
- package/dist/components/icon/meta.d.ts +9 -0
- package/dist/components/icon/meta.d.ts.map +1 -0
- package/dist/components/icon/meta.js +9 -0
- package/dist/components/icon/meta.js.map +1 -0
- package/dist/components/icon-button/meta.d.ts +9 -0
- package/dist/components/icon-button/meta.d.ts.map +1 -0
- package/dist/components/icon-button/meta.js +9 -0
- package/dist/components/icon-button/meta.js.map +1 -0
- package/dist/components/image/meta.d.ts +9 -0
- package/dist/components/image/meta.d.ts.map +1 -0
- package/dist/components/image/meta.js +9 -0
- package/dist/components/image/meta.js.map +1 -0
- package/dist/components/input/meta.d.ts +45 -0
- package/dist/components/input/meta.d.ts.map +1 -0
- package/dist/components/input/meta.js +45 -0
- package/dist/components/input/meta.js.map +1 -0
- package/dist/components/media-card/meta.d.ts +9 -0
- package/dist/components/media-card/meta.d.ts.map +1 -0
- package/dist/components/media-card/meta.js +9 -0
- package/dist/components/media-card/meta.js.map +1 -0
- package/dist/components/metric-card/meta.d.ts +9 -0
- package/dist/components/metric-card/meta.d.ts.map +1 -0
- package/dist/components/metric-card/meta.js +9 -0
- package/dist/components/metric-card/meta.js.map +1 -0
- package/dist/components/modal/meta.d.ts +9 -0
- package/dist/components/modal/meta.d.ts.map +1 -0
- package/dist/components/modal/meta.js +9 -0
- package/dist/components/modal/meta.js.map +1 -0
- package/dist/components/navigation-item/meta.d.ts +9 -0
- package/dist/components/navigation-item/meta.d.ts.map +1 -0
- package/dist/components/navigation-item/meta.js +9 -0
- package/dist/components/navigation-item/meta.js.map +1 -0
- package/dist/components/navigation-list/meta.d.ts +9 -0
- package/dist/components/navigation-list/meta.d.ts.map +1 -0
- package/dist/components/navigation-list/meta.js +9 -0
- package/dist/components/navigation-list/meta.js.map +1 -0
- package/dist/components/progress/meta.d.ts +9 -0
- package/dist/components/progress/meta.d.ts.map +1 -0
- package/dist/components/progress/meta.js +9 -0
- package/dist/components/progress/meta.js.map +1 -0
- package/dist/components/radio/meta.d.ts +17 -0
- package/dist/components/radio/meta.d.ts.map +1 -0
- package/dist/components/radio/meta.js +17 -0
- package/dist/components/radio/meta.js.map +1 -0
- package/dist/components/rating/meta.d.ts +9 -0
- package/dist/components/rating/meta.d.ts.map +1 -0
- package/dist/components/rating/meta.js +9 -0
- package/dist/components/rating/meta.js.map +1 -0
- package/dist/components/search-bar/meta.d.ts +9 -0
- package/dist/components/search-bar/meta.d.ts.map +1 -0
- package/dist/components/search-bar/meta.js +9 -0
- package/dist/components/search-bar/meta.js.map +1 -0
- package/dist/components/select/meta.d.ts +9 -0
- package/dist/components/select/meta.d.ts.map +1 -0
- package/dist/components/select/meta.js +9 -0
- package/dist/components/select/meta.js.map +1 -0
- package/dist/components/tabs/meta.d.ts +9 -0
- package/dist/components/tabs/meta.d.ts.map +1 -0
- package/dist/components/tabs/meta.js +9 -0
- package/dist/components/tabs/meta.js.map +1 -0
- package/dist/components/text/meta.d.ts +71 -0
- package/dist/components/text/meta.d.ts.map +1 -0
- package/dist/components/text/meta.js +68 -0
- package/dist/components/text/meta.js.map +1 -0
- package/dist/components/textarea/meta.d.ts +45 -0
- package/dist/components/textarea/meta.d.ts.map +1 -0
- package/dist/components/textarea/meta.js +45 -0
- package/dist/components/textarea/meta.js.map +1 -0
- package/dist/components/toolbar/meta.d.ts +17 -0
- package/dist/components/toolbar/meta.d.ts.map +1 -0
- package/dist/components/toolbar/meta.js +17 -0
- package/dist/components/toolbar/meta.js.map +1 -0
- package/dist/foundation/meta.d.ts +93 -0
- package/dist/foundation/meta.d.ts.map +1 -0
- package/dist/foundation/meta.js +84 -0
- package/dist/foundation/meta.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/app-shell/meta.d.ts +9 -0
- package/dist/layout/app-shell/meta.d.ts.map +1 -0
- package/dist/layout/app-shell/meta.js +9 -0
- package/dist/layout/app-shell/meta.js.map +1 -0
- package/dist/layout/auth-layout/meta.d.ts +33 -0
- package/dist/layout/auth-layout/meta.d.ts.map +1 -0
- package/dist/layout/auth-layout/meta.js +34 -0
- package/dist/layout/auth-layout/meta.js.map +1 -0
- package/dist/layout/page/meta.d.ts +19 -0
- package/dist/layout/page/meta.d.ts.map +1 -0
- package/dist/layout/page/meta.js +20 -0
- package/dist/layout/page/meta.js.map +1 -0
- package/dist/layout/page-header/meta.d.ts +38 -0
- package/dist/layout/page-header/meta.d.ts.map +1 -0
- package/dist/layout/page-header/meta.js +38 -0
- package/dist/layout/page-header/meta.js.map +1 -0
- package/dist/layout/page-section/meta.d.ts +28 -0
- package/dist/layout/page-section/meta.d.ts.map +1 -0
- package/dist/layout/page-section/meta.js +29 -0
- package/dist/layout/page-section/meta.js.map +1 -0
- package/dist/layout/settings-layout/meta.d.ts +9 -0
- package/dist/layout/settings-layout/meta.d.ts.map +1 -0
- package/dist/layout/settings-layout/meta.js +9 -0
- package/dist/layout/settings-layout/meta.js.map +1 -0
- package/dist/layout/sidebar-layout/meta.d.ts +9 -0
- package/dist/layout/sidebar-layout/meta.d.ts.map +1 -0
- package/dist/layout/sidebar-layout/meta.js +9 -0
- package/dist/layout/sidebar-layout/meta.js.map +1 -0
- package/dist/layout/topbar-layout/meta.d.ts +9 -0
- package/dist/layout/topbar-layout/meta.d.ts.map +1 -0
- package/dist/layout/topbar-layout/meta.js +9 -0
- package/dist/layout/topbar-layout/meta.js.map +1 -0
- package/dist/metadata/allowedChildren.d.ts +4 -0
- package/dist/metadata/allowedChildren.d.ts.map +1 -0
- package/dist/metadata/allowedChildren.js +26 -0
- package/dist/metadata/allowedChildren.js.map +1 -0
- package/dist/metadata/componentMeta.d.ts +3 -0
- package/dist/metadata/componentMeta.d.ts.map +1 -0
- package/dist/metadata/componentMeta.js +141 -0
- package/dist/metadata/componentMeta.js.map +1 -0
- package/dist/metadata/index.d.ts +3 -0
- package/dist/metadata/index.d.ts.map +1 -0
- package/dist/metadata/index.js +2 -0
- package/dist/metadata/index.js.map +1 -0
- package/dist/metadata/types.d.ts +49 -0
- package/dist/metadata/types.d.ts.map +1 -0
- package/dist/metadata/types.js +2 -0
- package/dist/metadata/types.js.map +1 -0
- package/dist/patterns/auth/meta.d.ts +33 -0
- package/dist/patterns/auth/meta.d.ts.map +1 -0
- package/dist/patterns/auth/meta.js +34 -0
- package/dist/patterns/auth/meta.js.map +1 -0
- package/dist/patterns/collection-editor/meta.d.ts +9 -0
- package/dist/patterns/collection-editor/meta.d.ts.map +1 -0
- package/dist/patterns/collection-editor/meta.js +9 -0
- package/dist/patterns/collection-editor/meta.js.map +1 -0
- package/dist/patterns/confirm-dialog/meta.d.ts +9 -0
- package/dist/patterns/confirm-dialog/meta.d.ts.map +1 -0
- package/dist/patterns/confirm-dialog/meta.js +9 -0
- package/dist/patterns/confirm-dialog/meta.js.map +1 -0
- package/dist/patterns/disclosure-section/meta.d.ts +9 -0
- package/dist/patterns/disclosure-section/meta.d.ts.map +1 -0
- package/dist/patterns/disclosure-section/meta.js +9 -0
- package/dist/patterns/disclosure-section/meta.js.map +1 -0
- package/dist/patterns/empty-state/meta.d.ts +33 -0
- package/dist/patterns/empty-state/meta.d.ts.map +1 -0
- package/dist/patterns/empty-state/meta.js +33 -0
- package/dist/patterns/empty-state/meta.js.map +1 -0
- package/dist/patterns/filter-bar/meta.d.ts +9 -0
- package/dist/patterns/filter-bar/meta.d.ts.map +1 -0
- package/dist/patterns/filter-bar/meta.js +9 -0
- package/dist/patterns/filter-bar/meta.js.map +1 -0
- package/dist/patterns/image-preview/meta.d.ts +9 -0
- package/dist/patterns/image-preview/meta.d.ts.map +1 -0
- package/dist/patterns/image-preview/meta.js +9 -0
- package/dist/patterns/image-preview/meta.js.map +1 -0
- package/dist/patterns/image-upload-field/meta.d.ts +9 -0
- package/dist/patterns/image-upload-field/meta.d.ts.map +1 -0
- package/dist/patterns/image-upload-field/meta.js +9 -0
- package/dist/patterns/image-upload-field/meta.js.map +1 -0
- package/dist/patterns/inspector-field/meta.d.ts +9 -0
- package/dist/patterns/inspector-field/meta.d.ts.map +1 -0
- package/dist/patterns/inspector-field/meta.js +9 -0
- package/dist/patterns/inspector-field/meta.js.map +1 -0
- package/dist/patterns/list/meta.d.ts +25 -0
- package/dist/patterns/list/meta.d.ts.map +1 -0
- package/dist/patterns/list/meta.js +26 -0
- package/dist/patterns/list/meta.js.map +1 -0
- package/dist/patterns/notice/meta.d.ts +34 -0
- package/dist/patterns/notice/meta.d.ts.map +1 -0
- package/dist/patterns/notice/meta.js +35 -0
- package/dist/patterns/notice/meta.js.map +1 -0
- package/dist/patterns/panel/meta.d.ts +44 -0
- package/dist/patterns/panel/meta.d.ts.map +1 -0
- package/dist/patterns/panel/meta.js +45 -0
- package/dist/patterns/panel/meta.js.map +1 -0
- package/dist/patterns/responsive-panel/meta.d.ts +9 -0
- package/dist/patterns/responsive-panel/meta.d.ts.map +1 -0
- package/dist/patterns/responsive-panel/meta.js +9 -0
- package/dist/patterns/responsive-panel/meta.js.map +1 -0
- package/dist/patterns/section-header/meta.d.ts +33 -0
- package/dist/patterns/section-header/meta.d.ts.map +1 -0
- package/dist/patterns/section-header/meta.js +33 -0
- package/dist/patterns/section-header/meta.js.map +1 -0
- package/dist/patterns/selection/SelectableItem.d.ts +4 -0
- package/dist/patterns/selection/SelectableItem.d.ts.map +1 -0
- package/dist/patterns/selection/SelectableItem.js +72 -0
- package/dist/patterns/selection/SelectableItem.js.map +1 -0
- package/dist/patterns/selection/SelectionProvider.d.ts +5 -0
- package/dist/patterns/selection/SelectionProvider.d.ts.map +1 -0
- package/dist/patterns/selection/SelectionProvider.js +64 -0
- package/dist/patterns/selection/SelectionProvider.js.map +1 -0
- package/dist/patterns/selection/index.d.ts +4 -0
- package/dist/patterns/selection/index.d.ts.map +1 -0
- package/dist/patterns/selection/index.js +3 -0
- package/dist/patterns/selection/index.js.map +1 -0
- package/dist/patterns/selection/meta.d.ts +17 -0
- package/dist/patterns/selection/meta.d.ts.map +1 -0
- package/dist/patterns/selection/meta.js +18 -0
- package/dist/patterns/selection/meta.js.map +1 -0
- package/dist/patterns/selection/resolveSelectionNextIds.d.ts +15 -0
- package/dist/patterns/selection/resolveSelectionNextIds.d.ts.map +1 -0
- package/dist/patterns/selection/resolveSelectionNextIds.js +44 -0
- package/dist/patterns/selection/resolveSelectionNextIds.js.map +1 -0
- package/dist/patterns/selection/types.d.ts +38 -0
- package/dist/patterns/selection/types.d.ts.map +1 -0
- package/dist/patterns/selection/types.js +2 -0
- package/dist/patterns/selection/types.js.map +1 -0
- package/dist/patterns/settings-row/meta.d.ts +39 -0
- package/dist/patterns/settings-row/meta.d.ts.map +1 -0
- package/dist/patterns/settings-row/meta.js +39 -0
- package/dist/patterns/settings-row/meta.js.map +1 -0
- package/dist/patterns/switch-field/meta.d.ts +9 -0
- package/dist/patterns/switch-field/meta.d.ts.map +1 -0
- package/dist/patterns/switch-field/meta.js +9 -0
- package/dist/patterns/switch-field/meta.js.map +1 -0
- package/dist/patterns/theme-composer/meta.d.ts +9 -0
- package/dist/patterns/theme-composer/meta.d.ts.map +1 -0
- package/dist/patterns/theme-composer/meta.js +9 -0
- package/dist/patterns/theme-composer/meta.js.map +1 -0
- package/dist/patterns/tile-grid/meta.d.ts +17 -0
- package/dist/patterns/tile-grid/meta.d.ts.map +1 -0
- package/dist/patterns/tile-grid/meta.js +18 -0
- package/dist/patterns/tile-grid/meta.js.map +1 -0
- package/dist/patterns/timeline/meta.d.ts +9 -0
- package/dist/patterns/timeline/meta.d.ts.map +1 -0
- package/dist/patterns/timeline/meta.js +9 -0
- package/dist/patterns/timeline/meta.js.map +1 -0
- package/dist/patterns/tree-view/meta.d.ts +17 -0
- package/dist/patterns/tree-view/meta.d.ts.map +1 -0
- package/dist/patterns/tree-view/meta.js +18 -0
- package/dist/patterns/tree-view/meta.js.map +1 -0
- package/dist/patterns/zora-drawer-content/meta.d.ts +9 -0
- package/dist/patterns/zora-drawer-content/meta.d.ts.map +1 -0
- package/dist/patterns/zora-drawer-content/meta.js +9 -0
- package/dist/patterns/zora-drawer-content/meta.js.map +1 -0
- package/dist/patterns/zora-tab-bar/meta.d.ts +9 -0
- package/dist/patterns/zora-tab-bar/meta.d.ts.map +1 -0
- package/dist/patterns/zora-tab-bar/meta.js +9 -0
- package/dist/patterns/zora-tab-bar/meta.js.map +1 -0
- package/package.json +1 -1
- package/src/components/app-bar/meta.ts +10 -0
- package/src/components/avatar/meta.ts +10 -0
- package/src/components/avatar-group/meta.ts +10 -0
- package/src/components/badge/meta.ts +10 -0
- package/src/components/button/meta.ts +46 -0
- package/src/components/card/meta.ts +46 -0
- package/src/components/checkbox/meta.ts +19 -0
- package/src/components/chip/meta.ts +10 -0
- package/src/components/chip-group/meta.ts +10 -0
- package/src/components/drawer/meta.ts +10 -0
- package/src/components/form/meta.ts +83 -0
- package/src/components/heading/meta.ts +67 -0
- package/src/components/icon/meta.ts +10 -0
- package/src/components/icon-button/meta.ts +10 -0
- package/src/components/image/meta.ts +10 -0
- package/src/components/input/meta.ts +46 -0
- package/src/components/media-card/meta.ts +10 -0
- package/src/components/metric-card/meta.ts +10 -0
- package/src/components/modal/meta.ts +10 -0
- package/src/components/navigation-item/meta.ts +10 -0
- package/src/components/navigation-list/meta.ts +10 -0
- package/src/components/progress/meta.ts +10 -0
- package/src/components/radio/meta.ts +19 -0
- package/src/components/rating/meta.ts +10 -0
- package/src/components/search-bar/meta.ts +10 -0
- package/src/components/select/meta.ts +10 -0
- package/src/components/tabs/meta.ts +10 -0
- package/src/components/text/meta.ts +69 -0
- package/src/components/textarea/meta.ts +46 -0
- package/src/components/toolbar/meta.ts +19 -0
- package/src/foundation/meta.ts +85 -0
- package/src/index.ts +22 -0
- package/src/layout/app-shell/meta.ts +10 -0
- package/src/layout/auth-layout/meta.ts +35 -0
- package/src/layout/page/meta.ts +21 -0
- package/src/layout/page-header/meta.ts +39 -0
- package/src/layout/page-section/meta.ts +30 -0
- package/src/layout/settings-layout/meta.ts +10 -0
- package/src/layout/sidebar-layout/meta.ts +10 -0
- package/src/layout/topbar-layout/meta.ts +10 -0
- package/src/metadata/allowedChildren.ts +27 -0
- package/src/metadata/componentMeta.test.ts +204 -0
- package/src/metadata/componentMeta.ts +147 -0
- package/src/metadata/index.ts +13 -0
- package/src/metadata/types.ts +74 -0
- package/src/patterns/auth/meta.ts +39 -0
- package/src/patterns/collection-editor/meta.ts +10 -0
- package/src/patterns/confirm-dialog/meta.ts +10 -0
- package/src/patterns/disclosure-section/meta.ts +10 -0
- package/src/patterns/empty-state/meta.ts +34 -0
- package/src/patterns/filter-bar/meta.ts +10 -0
- package/src/patterns/image-preview/meta.ts +10 -0
- package/src/patterns/image-upload-field/meta.ts +10 -0
- package/src/patterns/inspector-field/meta.ts +10 -0
- package/src/patterns/list/meta.ts +30 -0
- package/src/patterns/notice/meta.ts +36 -0
- package/src/patterns/panel/meta.ts +46 -0
- package/src/patterns/responsive-panel/meta.ts +10 -0
- package/src/patterns/section-header/meta.ts +34 -0
- package/src/patterns/selection/SelectableItem.tsx +93 -0
- package/src/patterns/selection/SelectionProvider.tsx +102 -0
- package/src/patterns/selection/index.ts +10 -0
- package/src/patterns/selection/meta.ts +21 -0
- package/src/patterns/selection/resolveSelectionNextIds.test.ts +61 -0
- package/src/patterns/selection/resolveSelectionNextIds.ts +71 -0
- package/src/patterns/selection/types.ts +43 -0
- package/src/patterns/settings-row/meta.ts +40 -0
- package/src/patterns/switch-field/meta.ts +10 -0
- package/src/patterns/theme-composer/meta.ts +10 -0
- package/src/patterns/tile-grid/meta.ts +21 -0
- package/src/patterns/timeline/meta.ts +10 -0
- package/src/patterns/tree-view/meta.ts +21 -0
- package/src/patterns/zora-drawer-content/meta.ts +10 -0
- package/src/patterns/zora-tab-bar/meta.ts +10 -0
- package/src/showcaseCoverage.test.ts +3 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { appBarMeta } from '../components/app-bar/meta';
|
|
2
|
+
import { avatarMeta } from '../components/avatar/meta';
|
|
3
|
+
import { avatarGroupMeta } from '../components/avatar-group/meta';
|
|
4
|
+
import { badgeMeta } from '../components/badge/meta';
|
|
5
|
+
import { buttonMeta } from '../components/button/meta';
|
|
6
|
+
import { cardMeta } from '../components/card/meta';
|
|
7
|
+
import { checkboxGroupMeta, checkboxMeta } from '../components/checkbox/meta';
|
|
8
|
+
import { chipMeta } from '../components/chip/meta';
|
|
9
|
+
import { chipGroupMeta } from '../components/chip-group/meta';
|
|
10
|
+
import { drawerMeta } from '../components/drawer/meta';
|
|
11
|
+
import { formActionsMeta, formErrorMeta, formFieldMeta, formMeta } from '../components/form/meta';
|
|
12
|
+
import { headingMeta } from '../components/heading/meta';
|
|
13
|
+
import { iconMeta } from '../components/icon/meta';
|
|
14
|
+
import { iconButtonMeta } from '../components/icon-button/meta';
|
|
15
|
+
import { imageMeta } from '../components/image/meta';
|
|
16
|
+
import { inputMeta } from '../components/input/meta';
|
|
17
|
+
import { mediaCardMeta } from '../components/media-card/meta';
|
|
18
|
+
import { metricCardMeta } from '../components/metric-card/meta';
|
|
19
|
+
import { modalMeta } from '../components/modal/meta';
|
|
20
|
+
import { navigationItemMeta } from '../components/navigation-item/meta';
|
|
21
|
+
import { navigationListMeta } from '../components/navigation-list/meta';
|
|
22
|
+
import { progressMeta } from '../components/progress/meta';
|
|
23
|
+
import { radioGroupMeta, radioMeta } from '../components/radio/meta';
|
|
24
|
+
import { ratingMeta } from '../components/rating/meta';
|
|
25
|
+
import { searchBarMeta } from '../components/search-bar/meta';
|
|
26
|
+
import { selectMeta } from '../components/select/meta';
|
|
27
|
+
import { tabsMeta } from '../components/tabs/meta';
|
|
28
|
+
import { textMeta } from '../components/text/meta';
|
|
29
|
+
import { textareaMeta } from '../components/textarea/meta';
|
|
30
|
+
import { toolbarActionMeta, toolbarMeta } from '../components/toolbar/meta';
|
|
31
|
+
import { foundationMetas } from '../foundation/meta';
|
|
32
|
+
import { appShellMeta } from '../layout/app-shell/meta';
|
|
33
|
+
import { authLayoutMeta } from '../layout/auth-layout/meta';
|
|
34
|
+
import { pageMeta } from '../layout/page/meta';
|
|
35
|
+
import { pageHeaderMeta } from '../layout/page-header/meta';
|
|
36
|
+
import { pageSectionMeta } from '../layout/page-section/meta';
|
|
37
|
+
import { settingsLayoutMeta } from '../layout/settings-layout/meta';
|
|
38
|
+
import { sidebarLayoutMeta } from '../layout/sidebar-layout/meta';
|
|
39
|
+
import { topbarLayoutMeta } from '../layout/topbar-layout/meta';
|
|
40
|
+
import {
|
|
41
|
+
forgotPasswordFormMeta,
|
|
42
|
+
otpFormMeta,
|
|
43
|
+
signInFormMeta,
|
|
44
|
+
signUpFormMeta,
|
|
45
|
+
} from '../patterns/auth/meta';
|
|
46
|
+
import { collectionEditorMeta } from '../patterns/collection-editor/meta';
|
|
47
|
+
import { confirmDialogMeta } from '../patterns/confirm-dialog/meta';
|
|
48
|
+
import { disclosureSectionMeta } from '../patterns/disclosure-section/meta';
|
|
49
|
+
import { emptyStateMeta } from '../patterns/empty-state/meta';
|
|
50
|
+
import { filterBarMeta } from '../patterns/filter-bar/meta';
|
|
51
|
+
import { imagePreviewMeta } from '../patterns/image-preview/meta';
|
|
52
|
+
import { imageUploadFieldMeta } from '../patterns/image-upload-field/meta';
|
|
53
|
+
import { inspectorFieldMeta } from '../patterns/inspector-field/meta';
|
|
54
|
+
import { listMeta, listRowMeta, listSectionMeta } from '../patterns/list/meta';
|
|
55
|
+
import { noticeMeta } from '../patterns/notice/meta';
|
|
56
|
+
import { panelMeta } from '../patterns/panel/meta';
|
|
57
|
+
import { responsivePanelMeta } from '../patterns/responsive-panel/meta';
|
|
58
|
+
import { sectionHeaderMeta } from '../patterns/section-header/meta';
|
|
59
|
+
import { selectableItemMeta, selectionProviderMeta } from '../patterns/selection/meta';
|
|
60
|
+
import { settingsRowMeta } from '../patterns/settings-row/meta';
|
|
61
|
+
import { switchFieldMeta } from '../patterns/switch-field/meta';
|
|
62
|
+
import { themeComposerMeta } from '../patterns/theme-composer/meta';
|
|
63
|
+
import { paletteItemMeta, tileGridMeta } from '../patterns/tile-grid/meta';
|
|
64
|
+
import { timelineMeta } from '../patterns/timeline/meta';
|
|
65
|
+
import { treeItemMeta, treeViewMeta } from '../patterns/tree-view/meta';
|
|
66
|
+
import { zoraDrawerContentMeta } from '../patterns/zora-drawer-content/meta';
|
|
67
|
+
import { zoraTabBarMeta } from '../patterns/zora-tab-bar/meta';
|
|
68
|
+
import type { ZoraComponentMetaRegistry } from './types';
|
|
69
|
+
|
|
70
|
+
export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = {
|
|
71
|
+
...foundationMetas,
|
|
72
|
+
AppBar: appBarMeta,
|
|
73
|
+
Avatar: avatarMeta,
|
|
74
|
+
AvatarGroup: avatarGroupMeta,
|
|
75
|
+
Badge: badgeMeta,
|
|
76
|
+
Button: buttonMeta,
|
|
77
|
+
Card: cardMeta,
|
|
78
|
+
Checkbox: checkboxMeta,
|
|
79
|
+
CheckboxGroup: checkboxGroupMeta,
|
|
80
|
+
Chip: chipMeta,
|
|
81
|
+
ChipGroup: chipGroupMeta,
|
|
82
|
+
Drawer: drawerMeta,
|
|
83
|
+
Form: formMeta,
|
|
84
|
+
FormActions: formActionsMeta,
|
|
85
|
+
FormError: formErrorMeta,
|
|
86
|
+
FormField: formFieldMeta,
|
|
87
|
+
Heading: headingMeta,
|
|
88
|
+
Icon: iconMeta,
|
|
89
|
+
IconButton: iconButtonMeta,
|
|
90
|
+
Image: imageMeta,
|
|
91
|
+
Input: inputMeta,
|
|
92
|
+
MediaCard: mediaCardMeta,
|
|
93
|
+
MetricCard: metricCardMeta,
|
|
94
|
+
Modal: modalMeta,
|
|
95
|
+
NavigationItem: navigationItemMeta,
|
|
96
|
+
NavigationList: navigationListMeta,
|
|
97
|
+
Progress: progressMeta,
|
|
98
|
+
Radio: radioMeta,
|
|
99
|
+
RadioGroup: radioGroupMeta,
|
|
100
|
+
Rating: ratingMeta,
|
|
101
|
+
SearchBar: searchBarMeta,
|
|
102
|
+
Select: selectMeta,
|
|
103
|
+
Tabs: tabsMeta,
|
|
104
|
+
Text: textMeta,
|
|
105
|
+
Textarea: textareaMeta,
|
|
106
|
+
Toolbar: toolbarMeta,
|
|
107
|
+
ToolbarAction: toolbarActionMeta,
|
|
108
|
+
AppShell: appShellMeta,
|
|
109
|
+
AuthLayout: authLayoutMeta,
|
|
110
|
+
Page: pageMeta,
|
|
111
|
+
PageHeader: pageHeaderMeta,
|
|
112
|
+
PageSection: pageSectionMeta,
|
|
113
|
+
SettingsLayout: settingsLayoutMeta,
|
|
114
|
+
SidebarLayout: sidebarLayoutMeta,
|
|
115
|
+
TopbarLayout: topbarLayoutMeta,
|
|
116
|
+
ForgotPasswordForm: forgotPasswordFormMeta,
|
|
117
|
+
OtpForm: otpFormMeta,
|
|
118
|
+
SignInForm: signInFormMeta,
|
|
119
|
+
SignUpForm: signUpFormMeta,
|
|
120
|
+
CollectionEditor: collectionEditorMeta,
|
|
121
|
+
ConfirmDialog: confirmDialogMeta,
|
|
122
|
+
DisclosureSection: disclosureSectionMeta,
|
|
123
|
+
EmptyState: emptyStateMeta,
|
|
124
|
+
FilterBar: filterBarMeta,
|
|
125
|
+
ImagePreview: imagePreviewMeta,
|
|
126
|
+
ImageUploadField: imageUploadFieldMeta,
|
|
127
|
+
InspectorField: inspectorFieldMeta,
|
|
128
|
+
List: listMeta,
|
|
129
|
+
ListRow: listRowMeta,
|
|
130
|
+
ListSection: listSectionMeta,
|
|
131
|
+
Notice: noticeMeta,
|
|
132
|
+
Panel: panelMeta,
|
|
133
|
+
ResponsivePanel: responsivePanelMeta,
|
|
134
|
+
SectionHeader: sectionHeaderMeta,
|
|
135
|
+
SelectableItem: selectableItemMeta,
|
|
136
|
+
SelectionProvider: selectionProviderMeta,
|
|
137
|
+
SettingsRow: settingsRowMeta,
|
|
138
|
+
SwitchField: switchFieldMeta,
|
|
139
|
+
ThemeComposer: themeComposerMeta,
|
|
140
|
+
PaletteItem: paletteItemMeta,
|
|
141
|
+
TileGrid: tileGridMeta,
|
|
142
|
+
Timeline: timelineMeta,
|
|
143
|
+
TreeItem: treeItemMeta,
|
|
144
|
+
TreeView: treeViewMeta,
|
|
145
|
+
ZoraDrawerContent: zoraDrawerContentMeta,
|
|
146
|
+
ZoraTabBar: zoraTabBarMeta,
|
|
147
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ZORA_COMPONENT_META } from './componentMeta';
|
|
2
|
+
export type {
|
|
3
|
+
ZoraComponentBlueprint,
|
|
4
|
+
ZoraComponentCategory,
|
|
5
|
+
ZoraComponentI18nMeta,
|
|
6
|
+
ZoraComponentMeta,
|
|
7
|
+
ZoraComponentMetaRegistry,
|
|
8
|
+
ZoraComponentPropArrayItemSchema,
|
|
9
|
+
ZoraComponentPropSchema,
|
|
10
|
+
ZoraComponentPropType,
|
|
11
|
+
ZoraComponentPropValue,
|
|
12
|
+
ZoraComponentSlotMeta,
|
|
13
|
+
} from './types';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export type ZoraComponentCategory = 'foundation' | 'component' | 'pattern' | 'layout';
|
|
2
|
+
|
|
3
|
+
export type ZoraComponentPropType =
|
|
4
|
+
| 'string'
|
|
5
|
+
| 'number'
|
|
6
|
+
| 'boolean'
|
|
7
|
+
| 'enum'
|
|
8
|
+
| 'color'
|
|
9
|
+
| 'spacing'
|
|
10
|
+
| 'radius'
|
|
11
|
+
| 'shadow'
|
|
12
|
+
| 'typographySize'
|
|
13
|
+
| 'typographyWeight'
|
|
14
|
+
| 'action'
|
|
15
|
+
| 'imageAsset'
|
|
16
|
+
| 'array';
|
|
17
|
+
|
|
18
|
+
export type ZoraComponentPropValue =
|
|
19
|
+
| string
|
|
20
|
+
| number
|
|
21
|
+
| boolean
|
|
22
|
+
| null
|
|
23
|
+
| readonly ZoraComponentPropValue[]
|
|
24
|
+
| { readonly [key: string]: ZoraComponentPropValue };
|
|
25
|
+
|
|
26
|
+
export interface ZoraComponentPropArrayItemSchema {
|
|
27
|
+
key: string;
|
|
28
|
+
schema: ZoraComponentPropSchema;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ZoraComponentPropSchema {
|
|
32
|
+
type: ZoraComponentPropType;
|
|
33
|
+
category: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
enum?: readonly (string | number)[];
|
|
36
|
+
default?: ZoraComponentPropValue;
|
|
37
|
+
itemSchema?: readonly ZoraComponentPropArrayItemSchema[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ZoraComponentBlueprint {
|
|
41
|
+
label: string;
|
|
42
|
+
icon?: {
|
|
43
|
+
name: string;
|
|
44
|
+
provider?: string;
|
|
45
|
+
};
|
|
46
|
+
defaultProps?: Readonly<Record<string, ZoraComponentPropValue>>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ZoraComponentI18nMeta {
|
|
50
|
+
fields: readonly {
|
|
51
|
+
keyProp: string;
|
|
52
|
+
defaultTextProp: string;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ZoraComponentSlotMeta {
|
|
57
|
+
label?: string;
|
|
58
|
+
allowedChildren?: readonly string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ZoraComponentMeta {
|
|
62
|
+
name: string;
|
|
63
|
+
category: ZoraComponentCategory;
|
|
64
|
+
description?: string;
|
|
65
|
+
directManifestNode: boolean;
|
|
66
|
+
allowedChildren: readonly string[];
|
|
67
|
+
blueprint?: ZoraComponentBlueprint;
|
|
68
|
+
i18n?: ZoraComponentI18nMeta;
|
|
69
|
+
slots?: Readonly<Record<string, ZoraComponentSlotMeta>>;
|
|
70
|
+
note?: string;
|
|
71
|
+
props: Readonly<Record<string, ZoraComponentPropSchema>>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type ZoraComponentMetaRegistry = Readonly<Record<string, ZoraComponentMeta>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
const AUTH_NOTE = 'Auth pattern component; not represented as a manifest node in v1.';
|
|
4
|
+
|
|
5
|
+
export const forgotPasswordFormMeta = {
|
|
6
|
+
name: 'ForgotPasswordForm',
|
|
7
|
+
category: 'pattern',
|
|
8
|
+
directManifestNode: false,
|
|
9
|
+
allowedChildren: [],
|
|
10
|
+
note: AUTH_NOTE,
|
|
11
|
+
props: {},
|
|
12
|
+
} as const satisfies ZoraComponentMeta;
|
|
13
|
+
|
|
14
|
+
export const otpFormMeta = {
|
|
15
|
+
name: 'OtpForm',
|
|
16
|
+
category: 'pattern',
|
|
17
|
+
directManifestNode: false,
|
|
18
|
+
allowedChildren: [],
|
|
19
|
+
note: AUTH_NOTE,
|
|
20
|
+
props: {},
|
|
21
|
+
} as const satisfies ZoraComponentMeta;
|
|
22
|
+
|
|
23
|
+
export const signInFormMeta = {
|
|
24
|
+
name: 'SignInForm',
|
|
25
|
+
category: 'pattern',
|
|
26
|
+
directManifestNode: false,
|
|
27
|
+
allowedChildren: [],
|
|
28
|
+
note: AUTH_NOTE,
|
|
29
|
+
props: {},
|
|
30
|
+
} as const satisfies ZoraComponentMeta;
|
|
31
|
+
|
|
32
|
+
export const signUpFormMeta = {
|
|
33
|
+
name: 'SignUpForm',
|
|
34
|
+
category: 'pattern',
|
|
35
|
+
directManifestNode: false,
|
|
36
|
+
allowedChildren: [],
|
|
37
|
+
note: AUTH_NOTE,
|
|
38
|
+
props: {},
|
|
39
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const collectionEditorMeta = {
|
|
4
|
+
name: 'CollectionEditor',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Specialized editing pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const confirmDialogMeta = {
|
|
4
|
+
name: 'ConfirmDialog',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Dialog pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const disclosureSectionMeta = {
|
|
4
|
+
name: 'DisclosureSection',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Disclosure pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const emptyStateMeta = {
|
|
4
|
+
name: 'EmptyState',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: true,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
blueprint: {
|
|
9
|
+
label: 'Empty state',
|
|
10
|
+
defaultProps: {
|
|
11
|
+
title: 'Nothing here yet',
|
|
12
|
+
description: 'Try adding your first item.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
title: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
category: 'Content',
|
|
19
|
+
label: 'Title',
|
|
20
|
+
default: 'Nothing here yet',
|
|
21
|
+
},
|
|
22
|
+
description: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
category: 'Content',
|
|
25
|
+
label: 'Description',
|
|
26
|
+
default: 'Try adding your first item.',
|
|
27
|
+
},
|
|
28
|
+
eyebrow: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
category: 'Content',
|
|
31
|
+
label: 'Eyebrow',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const filterBarMeta = {
|
|
4
|
+
name: 'FilterBar',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Filtering pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const imagePreviewMeta = {
|
|
4
|
+
name: 'ImagePreview',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Media pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const imageUploadFieldMeta = {
|
|
4
|
+
name: 'ImageUploadField',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Media upload pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const inspectorFieldMeta = {
|
|
4
|
+
name: 'InspectorField',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Inspector pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
const LIST_NOTE = 'List pattern component; not represented as a manifest node in v1.';
|
|
4
|
+
|
|
5
|
+
export const listMeta = {
|
|
6
|
+
name: 'List',
|
|
7
|
+
category: 'pattern',
|
|
8
|
+
directManifestNode: false,
|
|
9
|
+
allowedChildren: [],
|
|
10
|
+
note: LIST_NOTE,
|
|
11
|
+
props: {},
|
|
12
|
+
} as const satisfies ZoraComponentMeta;
|
|
13
|
+
|
|
14
|
+
export const listRowMeta = {
|
|
15
|
+
name: 'ListRow',
|
|
16
|
+
category: 'pattern',
|
|
17
|
+
directManifestNode: false,
|
|
18
|
+
allowedChildren: [],
|
|
19
|
+
note: LIST_NOTE,
|
|
20
|
+
props: {},
|
|
21
|
+
} as const satisfies ZoraComponentMeta;
|
|
22
|
+
|
|
23
|
+
export const listSectionMeta = {
|
|
24
|
+
name: 'ListSection',
|
|
25
|
+
category: 'pattern',
|
|
26
|
+
directManifestNode: false,
|
|
27
|
+
allowedChildren: [],
|
|
28
|
+
note: LIST_NOTE,
|
|
29
|
+
props: {},
|
|
30
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
|
|
3
|
+
|
|
4
|
+
export const noticeMeta = {
|
|
5
|
+
name: 'Notice',
|
|
6
|
+
category: 'pattern',
|
|
7
|
+
directManifestNode: true,
|
|
8
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
9
|
+
blueprint: {
|
|
10
|
+
label: 'Notice',
|
|
11
|
+
defaultProps: {
|
|
12
|
+
title: 'Notice',
|
|
13
|
+
tone: 'primary',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
title: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
category: 'Content',
|
|
20
|
+
label: 'Title',
|
|
21
|
+
default: 'Notice',
|
|
22
|
+
},
|
|
23
|
+
description: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
category: 'Content',
|
|
26
|
+
label: 'Description',
|
|
27
|
+
},
|
|
28
|
+
tone: {
|
|
29
|
+
type: 'enum',
|
|
30
|
+
category: 'Style',
|
|
31
|
+
label: 'Tone',
|
|
32
|
+
enum: ['primary', 'neutral', 'danger', 'success', 'warning'],
|
|
33
|
+
default: 'primary',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
|
|
3
|
+
|
|
4
|
+
export const panelMeta = {
|
|
5
|
+
name: 'Panel',
|
|
6
|
+
category: 'pattern',
|
|
7
|
+
directManifestNode: true,
|
|
8
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
9
|
+
blueprint: {
|
|
10
|
+
label: 'Panel',
|
|
11
|
+
defaultProps: {
|
|
12
|
+
title: 'Panel',
|
|
13
|
+
tone: 'default',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
title: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
category: 'Content',
|
|
20
|
+
label: 'Title',
|
|
21
|
+
},
|
|
22
|
+
description: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
category: 'Content',
|
|
25
|
+
label: 'Description',
|
|
26
|
+
},
|
|
27
|
+
eyebrow: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
category: 'Content',
|
|
30
|
+
label: 'Eyebrow',
|
|
31
|
+
},
|
|
32
|
+
tone: {
|
|
33
|
+
type: 'enum',
|
|
34
|
+
category: 'Style',
|
|
35
|
+
label: 'Tone',
|
|
36
|
+
enum: ['default', 'subtle', 'outline'],
|
|
37
|
+
default: 'default',
|
|
38
|
+
},
|
|
39
|
+
compact: {
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
category: 'Layout',
|
|
42
|
+
label: 'Compact',
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const responsivePanelMeta = {
|
|
4
|
+
name: 'ResponsivePanel',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: false,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
note: 'Responsive panel pattern; not represented as a manifest node in v1.',
|
|
9
|
+
props: {},
|
|
10
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const sectionHeaderMeta = {
|
|
4
|
+
name: 'SectionHeader',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
directManifestNode: true,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
blueprint: {
|
|
9
|
+
label: 'Section header',
|
|
10
|
+
defaultProps: {
|
|
11
|
+
title: 'Section title',
|
|
12
|
+
description: 'Short description.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
title: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
category: 'Content',
|
|
19
|
+
label: 'Title',
|
|
20
|
+
default: 'Section title',
|
|
21
|
+
},
|
|
22
|
+
description: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
category: 'Content',
|
|
25
|
+
label: 'Description',
|
|
26
|
+
default: 'Short description.',
|
|
27
|
+
},
|
|
28
|
+
eyebrow: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
category: 'Content',
|
|
31
|
+
label: 'Eyebrow',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ButtonBase } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { GestureResponderEvent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { useSelection } from './SelectionProvider';
|
|
6
|
+
import type { SelectableItemProps, SelectableItemState, SelectionTrigger } from './types';
|
|
7
|
+
|
|
8
|
+
function resolveTrigger(trigger: SelectionTrigger | undefined): SelectionTrigger {
|
|
9
|
+
return trigger ?? 'manual';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function isRenderProp(
|
|
13
|
+
children: SelectableItemProps['children'],
|
|
14
|
+
): children is (state: SelectableItemState) => React.ReactNode {
|
|
15
|
+
return typeof children === 'function';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function SelectableItem({ id, trigger, disabled = false, children }: SelectableItemProps) {
|
|
19
|
+
const selection = useSelection();
|
|
20
|
+
const resolvedTrigger = resolveTrigger(trigger);
|
|
21
|
+
const resolvedDisabled = selection.disabled || disabled;
|
|
22
|
+
const selected = selection.isSelected(id);
|
|
23
|
+
|
|
24
|
+
const select = React.useCallback(() => {
|
|
25
|
+
if (resolvedDisabled) return;
|
|
26
|
+
selection.select(id);
|
|
27
|
+
}, [id, resolvedDisabled, selection]);
|
|
28
|
+
|
|
29
|
+
const toggle = React.useCallback(() => {
|
|
30
|
+
if (resolvedDisabled) return;
|
|
31
|
+
selection.toggle(id);
|
|
32
|
+
}, [id, resolvedDisabled, selection]);
|
|
33
|
+
|
|
34
|
+
const clear = React.useCallback(() => {
|
|
35
|
+
if (selection.disabled) return;
|
|
36
|
+
selection.clear();
|
|
37
|
+
}, [selection]);
|
|
38
|
+
|
|
39
|
+
const itemState = React.useMemo<SelectableItemState>(() => {
|
|
40
|
+
return {
|
|
41
|
+
id,
|
|
42
|
+
selected,
|
|
43
|
+
disabled: resolvedDisabled,
|
|
44
|
+
mode: selection.mode,
|
|
45
|
+
select,
|
|
46
|
+
toggle,
|
|
47
|
+
clear,
|
|
48
|
+
};
|
|
49
|
+
}, [clear, id, resolvedDisabled, select, selected, selection.mode, toggle]);
|
|
50
|
+
|
|
51
|
+
// IMPORTANT:
|
|
52
|
+
// Do not pass `children` directly into ButtonBase. ButtonBase also supports function children,
|
|
53
|
+
// but its function signature receives interaction state, not SelectableItemState.
|
|
54
|
+
const content = isRenderProp(children) ? children(itemState) : children;
|
|
55
|
+
|
|
56
|
+
if (resolvedTrigger === 'manual') {
|
|
57
|
+
return <>{content}</>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const handlePress = (event: GestureResponderEvent) => {
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
if (resolvedDisabled) return;
|
|
63
|
+
if (selection.mode === 'single') {
|
|
64
|
+
selection.select(id);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
selection.toggle(id);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const handleLongPress = (event: GestureResponderEvent) => {
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
if (resolvedDisabled) return;
|
|
74
|
+
if (selection.mode === 'single') {
|
|
75
|
+
selection.select(id);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
selection.toggle(id);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<ButtonBase
|
|
84
|
+
accessibilityRole="button"
|
|
85
|
+
accessibilityState={{ disabled: resolvedDisabled, selected }}
|
|
86
|
+
disabled={resolvedDisabled}
|
|
87
|
+
onLongPress={resolvedTrigger === 'longPress' ? handleLongPress : undefined}
|
|
88
|
+
onPress={resolvedTrigger === 'press' ? handlePress : undefined}
|
|
89
|
+
>
|
|
90
|
+
{content}
|
|
91
|
+
</ButtonBase>
|
|
92
|
+
);
|
|
93
|
+
}
|