@ankhorage/zora 27.9.0 → 27.10.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 +18 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +16 -1
- package/dist/capabilities/index.js.map +3 -3
- package/dist/features/form/select/composition/SelectTrigger.d.ts.map +1 -1
- package/dist/features/form/select/composition/SelectTrigger.js +1 -1
- package/dist/features/form/select/composition/SelectTrigger.js.map +1 -1
- package/dist/features/form/select/selectMeta.d.ts +19 -0
- package/dist/features/form/select/selectMeta.d.ts.map +1 -1
- package/dist/features/form/select/selectMeta.js +15 -0
- package/dist/features/form/select/selectMeta.js.map +1 -1
- package/dist/features/theme/application/use-cases/compileZoraTheme.d.ts +1 -1
- package/dist/features/theme/application/use-cases/compileZoraTheme.d.ts.map +1 -1
- package/dist/features/theme/application/use-cases/compileZoraTheme.js.map +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.d.ts +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.d.ts.map +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.js +1 -1
- package/dist/features/theme/application/use-cases/createZoraThemeConfig.js.map +1 -1
- package/dist/features/theme/public.d.ts +4 -4
- package/dist/features/theme/public.d.ts.map +1 -1
- package/dist/features/theme/public.js +3 -3
- package/dist/features/theme/public.js.map +1 -1
- package/dist/features/theme/zoraDefaultTheme.d.ts +1 -1
- package/dist/features/theme/zoraDefaultTheme.d.ts.map +1 -1
- package/dist/features/theme/zoraDefaultTheme.js.map +1 -1
- package/dist/types/select.d.ts +5 -0
- package/dist/types/select.d.ts.map +1 -1
- package/dist/types/select.js.map +1 -1
- package/package.json +19 -5
- package/src/features/form/select/composition/SelectTrigger.tsx +2 -0
- package/src/features/form/select/public.test.ts +54 -0
- package/src/features/form/select/selectMeta.ts +15 -0
- package/src/features/theme/application/use-cases/compileZoraTheme.ts +1 -1
- package/src/features/theme/application/use-cases/createZoraThemeConfig.ts +2 -2
- package/src/features/theme/public.ts +4 -4
- package/src/features/theme/themeModuleResolution.test.ts +26 -21
- package/src/features/theme/zoraDefaultTheme.ts +1 -1
- package/src/types/select.ts +6 -0
- package/web-dist/chunks/{Accordion-h4928ex8.js → Accordion-0jkpvxwd.js} +1 -1
- package/web-dist/chunks/{Accordion-g45xga4b.js → Accordion-0pbcs0xf.js} +1 -1
- package/web-dist/chunks/{Accordion-8y13469y.js → Accordion-1andv7gg.js} +2 -2
- package/web-dist/chunks/{Accordion-zexve9d3.js → Accordion-27rxpbvf.js} +1 -1
- package/web-dist/chunks/{Accordion-waxb6x73.js → Accordion-3s7zeagv.js} +18 -2
- package/web-dist/chunks/{Accordion-70hh6g1f.js → Accordion-45tbe5v0.js} +1 -1
- package/web-dist/chunks/{Accordion-qw6tzn3f.js → Accordion-7e0mb55z.js} +2 -2
- package/web-dist/chunks/{Accordion-zvpkhqb7.js → Accordion-8rkwd0wx.js} +2 -0
- package/web-dist/chunks/{Accordion-818avkay.js → Accordion-8wq38d9b.js} +2 -2
- package/web-dist/chunks/{Accordion-wdby2v5r.js → Accordion-b991pn6e.js} +5 -1
- package/web-dist/chunks/{Accordion-zyah4pvq.js → Accordion-f6k281sv.js} +1 -1
- package/web-dist/chunks/{Accordion-qx45gtx9.js → Accordion-fjnb7anx.js} +1 -1
- package/web-dist/chunks/{Accordion-8ahdjt13.js → Accordion-ga82tcs9.js} +2 -2
- package/web-dist/chunks/{Accordion-jmhn8mm5.js → Accordion-hha54x4c.js} +2 -2
- package/web-dist/chunks/{Accordion-tkxddb2c.js → Accordion-hrxdchkq.js} +2 -2
- package/web-dist/chunks/{Accordion-bednnpzh.js → Accordion-jr0201qc.js} +4 -4
- package/web-dist/chunks/{Accordion-zxergnck.js → Accordion-m7jt3c87.js} +1 -1
- package/web-dist/chunks/{Accordion-ajgffs75.js → Accordion-mxad79vq.js} +10 -4
- package/web-dist/chunks/{Accordion-ea0ag7wf.js → Accordion-pkbvsn5y.js} +1 -1
- package/web-dist/chunks/{Accordion-0yn2b3ha.js → Accordion-q6xnm1k4.js} +3 -3
- package/web-dist/chunks/{Accordion-t11cptjk.js → Accordion-r6mc7qtj.js} +1 -1
- package/web-dist/chunks/{Accordion-7qb7741m.js → Accordion-w9vbdg9r.js} +2 -2
- package/web-dist/chunks/{Accordion-gjeaevge.js → Accordion-xp2t3pkj.js} +1 -1
- package/web-dist/chunks/{Accordion-zymf1mp8.js → Accordion-ztcmb44y.js} +5 -2
- package/web-dist/components/accordion/Accordion.js +3 -3
- package/web-dist/components/accordion-item/AccordionItem.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +7 -7
- package/web-dist/components/app-header/AppHeader.js +7 -7
- package/web-dist/components/auth-screen/AuthScreen.js +6 -6
- package/web-dist/components/avatar/Avatar.js +3 -3
- package/web-dist/components/avatar-group/AvatarGroup.js +3 -3
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +8 -8
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +4 -4
- package/web-dist/components/button/Button.js +3 -3
- package/web-dist/components/button-group/ButtonGroup.js +3 -3
- package/web-dist/components/calendar/Calendar.js +4 -4
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +8 -8
- package/web-dist/components/card/Card.js +7 -7
- package/web-dist/components/chat-list-item/ChatListItem.js +4 -4
- package/web-dist/components/chip/Chip.js +3 -3
- package/web-dist/components/chip-group/ChipGroup.js +3 -3
- package/web-dist/components/collection-editor/CollectionEditor.js +7 -7
- package/web-dist/components/color-hue-scale/ColorHueScale.js +3 -3
- package/web-dist/components/color-picker/ColorPicker.js +3 -3
- package/web-dist/components/color-tone/ColorTone.js +3 -3
- package/web-dist/components/color-wheel/ColorWheel.js +3 -3
- package/web-dist/components/content-rail/ContentRail.js +3 -3
- package/web-dist/components/data-table/DataTable.js +11 -11
- package/web-dist/components/date-picker/DatePicker.js +5 -5
- package/web-dist/components/empty-state/EmptyState.js +8 -8
- package/web-dist/components/explorer/Explorer.js +4 -4
- package/web-dist/components/file-explorer/FileExplorer.js +4 -4
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +6 -6
- package/web-dist/components/form/Form.js +4 -4
- package/web-dist/components/form-actions/FormActions.js +4 -4
- package/web-dist/components/form-error/FormError.js +4 -4
- package/web-dist/components/game/Game.js +1 -1
- package/web-dist/components/game-entity/GameEntity.js +1 -1
- package/web-dist/components/game-field/GameField.js +1 -1
- package/web-dist/components/game-input-zone/GameInputZone.js +1 -1
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +1 -1
- package/web-dist/components/game-overlay/GameOverlay.js +1 -1
- package/web-dist/components/hero/Hero.js +7 -7
- package/web-dist/components/icon/Icon.js +2 -2
- package/web-dist/components/icon-button/IconButton.js +3 -3
- package/web-dist/components/image/Image.js +3 -3
- package/web-dist/components/matrix-grid/MatrixGrid.js +1 -1
- package/web-dist/components/media-card/MediaCard.js +7 -7
- package/web-dist/components/media-explorer/MediaExplorer.js +4 -4
- package/web-dist/components/message-bubble/MessageBubble.js +4 -4
- package/web-dist/components/metric-card/MetricCard.js +7 -7
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +6 -6
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +6 -6
- package/web-dist/components/otp-form/OtpForm.js +6 -6
- package/web-dist/components/pagination/Pagination.js +3 -3
- package/web-dist/components/palette-item/PaletteItem.js +7 -7
- package/web-dist/components/popover-menu/PopoverMenu.js +4 -4
- package/web-dist/components/post-card/PostCard.js +7 -7
- package/web-dist/components/product-card/ProductCard.js +7 -7
- package/web-dist/components/radio/Radio.js +3 -3
- package/web-dist/components/radio-group/RadioGroup.js +3 -3
- package/web-dist/components/rating/Rating.js +2 -2
- package/web-dist/components/reader/Reader.js +8 -8
- package/web-dist/components/scan-overlay/ScanOverlay.js +8 -8
- package/web-dist/components/search-input/SearchInput.js +4 -4
- package/web-dist/components/select/Select.js +6 -4
- package/web-dist/components/select/Select.types-0.d.ts +6 -0
- package/web-dist/components/selectable-item/SelectableItem.js +1 -1
- package/web-dist/components/selection-provider/SelectionProvider.js +1 -1
- package/web-dist/components/sign-in-form/SignInForm.js +6 -6
- package/web-dist/components/sign-up-form/SignUpForm.js +6 -6
- package/web-dist/components/skeleton/Skeleton.js +8 -8
- package/web-dist/components/skeleton-card/SkeletonCard.js +8 -8
- package/web-dist/components/skeleton-list/SkeletonList.js +8 -8
- package/web-dist/components/skeleton-text/SkeletonText.js +8 -8
- package/web-dist/components/text-input/TextInput.js +4 -4
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +3 -3
- package/web-dist/components/time-picker/TimePicker.js +4 -4
- package/web-dist/components/timeline/Timeline.js +3 -3
- package/web-dist/components/toolbar/Toolbar.js +7 -7
- package/web-dist/components/tree-item/TreeItem.js +5 -5
- package/web-dist/components/uploader/Uploader.js +7 -7
- package/web-dist/manifest.json +365 -365
- /package/web-dist/chunks/{Accordion-6y42ws4p.js → Accordion-yskcfahv.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EAAE,EACnD,YAAY,EACZ,OAAO,EACP,KAAK,GACN,EAAE,kBAAkB,CAAC,MAAM,CAAC,+
|
|
1
|
+
{"version":3,"file":"SelectTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EAAE,EACnD,YAAY,EACZ,OAAO,EACP,KAAK,GACN,EAAE,kBAAkB,CAAC,MAAM,CAAC,+BAiB5B;AAED,UAAU,kBAAkB,CAAC,MAAM,SAAS,MAAM;IAChD,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B"}
|
|
@@ -2,7 +2,7 @@ import { Button } from '../../../button/public';
|
|
|
2
2
|
const SELECT_CHEVRON_ICON = { name: 'chevron-down' };
|
|
3
3
|
/*** Renders the shared Select trigger with the resolved option label or placeholder. */
|
|
4
4
|
export function SelectTrigger({ displayLabel, onPress, props, }) {
|
|
5
|
-
return (<Button color={props.invalid ? 'danger' : 'neutral'} disabled={props.disabled} fullWidth interactionPolicy={props.interactionPolicy} onPress={props.readOnly ? undefined : onPress} testID={props.testID ? `${props.testID}-trigger` : undefined} trailingIcon={SELECT_CHEVRON_ICON} variant="outline">
|
|
5
|
+
return (<Button color={props.invalid ? 'danger' : 'neutral'} disabled={props.disabled} fullWidth interactionPolicy={props.interactionPolicy} leadingIcon={props.leadingIcon} labelWeight={props.labelWeight ?? 'semiBold'} onPress={props.readOnly ? undefined : onPress} testID={props.testID ? `${props.testID}-trigger` : undefined} trailingIcon={SELECT_CHEVRON_ICON} variant="outline">
|
|
6
6
|
{displayLabel ?? props.placeholder ?? 'Select'}
|
|
7
7
|
</Button>);
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTrigger.js","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,cAAc,EAAW,CAAC;AAE9D,wFAAwF;AACxF,MAAM,UAAU,aAAa,CAAwB,EACnD,YAAY,EACZ,OAAO,EACP,KAAK,GACsB;IAC3B,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAC5C,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,SAAS,CACT,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAC9C,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAC7D,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,OAAO,CAAC,SAAS,CAEjB;MAAA,CAAC,YAAY,IAAI,KAAK,CAAC,WAAW,IAAI,QAAQ,CAChD;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import type { SelectProps } from '../../../../types/select';\nimport { Button } from '../../../button/public';\n\nconst SELECT_CHEVRON_ICON = { name: 'chevron-down' } as const;\n\n/*** Renders the shared Select trigger with the resolved option label or placeholder. */\nexport function SelectTrigger<TValue extends string>({\n displayLabel,\n onPress,\n props,\n}: SelectTriggerProps<TValue>) {\n return (\n <Button\n color={props.invalid ? 'danger' : 'neutral'}\n disabled={props.disabled}\n fullWidth\n interactionPolicy={props.interactionPolicy}\n onPress={props.readOnly ? undefined : onPress}\n testID={props.testID ? `${props.testID}-trigger` : undefined}\n trailingIcon={SELECT_CHEVRON_ICON}\n variant=\"outline\"\n >\n {displayLabel ?? props.placeholder ?? 'Select'}\n </Button>\n );\n}\n\ninterface SelectTriggerProps<TValue extends string> {\n displayLabel: string | undefined;\n onPress: () => void;\n props: SelectProps<TValue>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SelectTrigger.js","sourceRoot":"","sources":["../../../../../src/features/form/select/composition/SelectTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,cAAc,EAAW,CAAC;AAE9D,wFAAwF;AACxF,MAAM,UAAU,aAAa,CAAwB,EACnD,YAAY,EACZ,OAAO,EACP,KAAK,GACsB;IAC3B,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAC5C,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,SAAS,CACT,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,IAAI,UAAU,CAAC,CAC7C,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAC9C,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAC7D,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,OAAO,CAAC,SAAS,CAEjB;MAAA,CAAC,YAAY,IAAI,KAAK,CAAC,WAAW,IAAI,QAAQ,CAChD;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC","sourcesContent":["import type { SelectProps } from '../../../../types/select';\nimport { Button } from '../../../button/public';\n\nconst SELECT_CHEVRON_ICON = { name: 'chevron-down' } as const;\n\n/*** Renders the shared Select trigger with the resolved option label or placeholder. */\nexport function SelectTrigger<TValue extends string>({\n displayLabel,\n onPress,\n props,\n}: SelectTriggerProps<TValue>) {\n return (\n <Button\n color={props.invalid ? 'danger' : 'neutral'}\n disabled={props.disabled}\n fullWidth\n interactionPolicy={props.interactionPolicy}\n leadingIcon={props.leadingIcon}\n labelWeight={props.labelWeight ?? 'semiBold'}\n onPress={props.readOnly ? undefined : onPress}\n testID={props.testID ? `${props.testID}-trigger` : undefined}\n trailingIcon={SELECT_CHEVRON_ICON}\n variant=\"outline\"\n >\n {displayLabel ?? props.placeholder ?? 'Select'}\n </Button>\n );\n}\n\ninterface SelectTriggerProps<TValue extends string> {\n displayLabel: string | undefined;\n onPress: () => void;\n props: SelectProps<TValue>;\n}\n"]}
|
|
@@ -154,6 +154,25 @@ export declare const selectMeta: {
|
|
|
154
154
|
readonly authority: "instance";
|
|
155
155
|
};
|
|
156
156
|
};
|
|
157
|
+
readonly leadingIcon: {
|
|
158
|
+
readonly type: "media";
|
|
159
|
+
readonly category: "Content";
|
|
160
|
+
readonly label: "Leading SVG icon";
|
|
161
|
+
readonly mediaKinds: readonly ["image"];
|
|
162
|
+
readonly authoring: {
|
|
163
|
+
readonly authority: "instance";
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
readonly labelWeight: {
|
|
167
|
+
readonly type: "string";
|
|
168
|
+
readonly category: "Style";
|
|
169
|
+
readonly label: "Label weight";
|
|
170
|
+
readonly enum: readonly ["semiBold", "bold"];
|
|
171
|
+
readonly default: "semiBold";
|
|
172
|
+
readonly authoring: {
|
|
173
|
+
readonly authority: "instance";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
157
176
|
readonly required: {
|
|
158
177
|
readonly type: "boolean";
|
|
159
178
|
readonly category: "State";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectMeta.d.ts","sourceRoot":"","sources":["../../../../src/features/form/select/selectMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"selectMeta.d.ts","sourceRoot":"","sources":["../../../../src/features/form/select/selectMeta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKe,CAAC"}
|
|
@@ -119,6 +119,21 @@ export const selectMeta = {
|
|
|
119
119
|
default: 'Select',
|
|
120
120
|
authoring: { authority: 'instance' },
|
|
121
121
|
},
|
|
122
|
+
leadingIcon: {
|
|
123
|
+
type: 'media',
|
|
124
|
+
category: 'Content',
|
|
125
|
+
label: 'Leading SVG icon',
|
|
126
|
+
mediaKinds: ['image'],
|
|
127
|
+
authoring: { authority: 'instance' },
|
|
128
|
+
},
|
|
129
|
+
labelWeight: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
category: 'Style',
|
|
132
|
+
label: 'Label weight',
|
|
133
|
+
enum: ['semiBold', 'bold'],
|
|
134
|
+
default: 'semiBold',
|
|
135
|
+
authoring: { authority: 'instance' },
|
|
136
|
+
},
|
|
122
137
|
required: {
|
|
123
138
|
type: 'boolean',
|
|
124
139
|
category: 'State',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectMeta.js","sourceRoot":"","sources":["../../../../src/features/form/select/selectMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,WAAW;IACrB,WAAW,EACT,sGAAsG;IACxG,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE;YACZ,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,QAAQ;YACrB,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE;gBAC5C,EAAE,KAAK,EAAE,UAAU,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E,SAAS;YACnB,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../../types/authoring';\n\nexport const selectMeta = {\n name: 'Select',\n category: 'component',\n description:\n 'Single-value form selection with Popover presentation on web and BottomSheet presentation on native.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Select',\n defaultProps: {\n label: 'Option',\n placeholder: 'Select',\n defaultValue: 'option-b',\n options: [\n { value: 'option-a', label: 'First option' },\n { value: 'option-b', label: 'Second option' },\n { value: 'option-c', label: 'Third option' },\n ],\n disabled: false,\n readOnly: false,\n invalid: false,\n },\n },\n bindings: {\n props: {\n value: {\n label: 'Value',\n description: 'Currently selected option value.',\n value: { type: 'string' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n disabled: {\n label: 'Disabled',\n description: 'Whether the select is disabled.',\n value: { type: 'boolean' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n events: {\n valueChange: {\n label: 'Value change',\n description: 'Runs when the selected option value changes.',\n payload: {\n eventType: 'select.valueChange',\n fields: [{ path: 'value', type: 'string', label: 'Value' }],\n },\n },\n },\n },\n events: {\n valueChange: {\n label: 'Value change',\n eventType: 'select.valueChange',\n description: 'Emitted when the selected option value changes.',\n payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],\n },\n },\n props: {\n defaultValue: {\n type: 'string',\n category: 'State',\n label: 'Initial value',\n authoring: { authority: 'instance' },\n },\n value: {\n type: 'string',\n category: 'State',\n label: 'Value',\n authoring: { authority: 'instance' },\n },\n options: {\n type: 'array',\n category: 'Content',\n label: 'Options',\n itemSchema: [\n {\n key: 'value',\n schema: { type: 'string', category: 'Content', label: 'Value' },\n },\n {\n key: 'label',\n schema: { type: 'string', category: 'Content', label: 'Label' },\n },\n {\n key: 'disabled',\n schema: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n },\n },\n ],\n authoring: { authority: 'instance' },\n },\n label: {\n type: 'string',\n category: 'Content',\n label: 'Label',\n authoring: { authority: 'instance' },\n },\n helperText: {\n type: 'string',\n category: 'Content',\n label: 'Helper text',\n authoring: { authority: 'instance' },\n },\n errorText: {\n type: 'string',\n category: 'Content',\n label: 'Error text',\n authoring: { authority: 'instance' },\n },\n placeholder: {\n type: 'string',\n category: 'Content',\n label: 'Placeholder',\n default: 'Select',\n authoring: { authority: 'instance' },\n },\n required: {\n type: 'boolean',\n category: 'State',\n label: 'Required',\n default: false,\n authoring: { authority: 'instance' },\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n authoring: { authority: 'instance' },\n },\n readOnly: {\n type: 'boolean',\n category: 'State',\n label: 'Read only',\n default: false,\n authoring: { authority: 'instance' },\n },\n invalid: {\n type: 'boolean',\n category: 'State',\n label: 'Invalid',\n default: false,\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
1
|
+
{"version":3,"file":"selectMeta.js","sourceRoot":"","sources":["../../../../src/features/form/select/selectMeta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,WAAW;IACrB,WAAW,EACT,sGAAsG;IACxG,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,QAAQ;QACf,YAAY,EAAE;YACZ,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,QAAQ;YACrB,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE;gBAC5C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE;gBAC7C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE;aAC7C;YACD,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,kCAAkC;gBAC/C,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,eAAe,EAAE,IAAI;gBACrB,iBAAiB,EAAE,IAAI;aACxB;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,iCAAiC;gBAC9C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC1B,eAAe,EAAE,IAAI;gBACrB,iBAAiB,EAAE,IAAI;aACxB;SACF;QACD,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,KAAK,EAAE,cAAc;gBACrB,WAAW,EAAE,8CAA8C;gB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E;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../../types/authoring';\n\nexport const selectMeta = {\n name: 'Select',\n category: 'component',\n description:\n 'Single-value form selection with Popover presentation on web and BottomSheet presentation on native.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Select',\n defaultProps: {\n label: 'Option',\n placeholder: 'Select',\n defaultValue: 'option-b',\n options: [\n { value: 'option-a', label: 'First option' },\n { value: 'option-b', label: 'Second option' },\n { value: 'option-c', label: 'Third option' },\n ],\n disabled: false,\n readOnly: false,\n invalid: false,\n },\n },\n bindings: {\n props: {\n value: {\n label: 'Value',\n description: 'Currently selected option value.',\n value: { type: 'string' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n disabled: {\n label: 'Disabled',\n description: 'Whether the select is disabled.',\n value: { type: 'boolean' },\n acceptsFallback: true,\n acceptsTransforms: true,\n },\n },\n events: {\n valueChange: {\n label: 'Value change',\n description: 'Runs when the selected option value changes.',\n payload: {\n eventType: 'select.valueChange',\n fields: [{ path: 'value', type: 'string', label: 'Value' }],\n },\n },\n },\n },\n events: {\n valueChange: {\n label: 'Value change',\n eventType: 'select.valueChange',\n description: 'Emitted when the selected option value changes.',\n payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],\n },\n },\n props: {\n defaultValue: {\n type: 'string',\n category: 'State',\n label: 'Initial value',\n authoring: { authority: 'instance' },\n },\n value: {\n type: 'string',\n category: 'State',\n label: 'Value',\n authoring: { authority: 'instance' },\n },\n options: {\n type: 'array',\n category: 'Content',\n label: 'Options',\n itemSchema: [\n {\n key: 'value',\n schema: { type: 'string', category: 'Content', label: 'Value' },\n },\n {\n key: 'label',\n schema: { type: 'string', category: 'Content', label: 'Label' },\n },\n {\n key: 'disabled',\n schema: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n },\n },\n ],\n authoring: { authority: 'instance' },\n },\n label: {\n type: 'string',\n category: 'Content',\n label: 'Label',\n authoring: { authority: 'instance' },\n },\n helperText: {\n type: 'string',\n category: 'Content',\n label: 'Helper text',\n authoring: { authority: 'instance' },\n },\n errorText: {\n type: 'string',\n category: 'Content',\n label: 'Error text',\n authoring: { authority: 'instance' },\n },\n placeholder: {\n type: 'string',\n category: 'Content',\n label: 'Placeholder',\n default: 'Select',\n authoring: { authority: 'instance' },\n },\n leadingIcon: {\n type: 'media',\n category: 'Content',\n label: 'Leading SVG icon',\n mediaKinds: ['image'],\n authoring: { authority: 'instance' },\n },\n labelWeight: {\n type: 'string',\n category: 'Style',\n label: 'Label weight',\n enum: ['semiBold', 'bold'],\n default: 'semiBold',\n authoring: { authority: 'instance' },\n },\n required: {\n type: 'boolean',\n category: 'State',\n label: 'Required',\n default: false,\n authoring: { authority: 'instance' },\n },\n disabled: {\n type: 'boolean',\n category: 'State',\n label: 'Disabled',\n default: false,\n authoring: { authority: 'instance' },\n },\n readOnly: {\n type: 'boolean',\n category: 'State',\n label: 'Read only',\n default: false,\n authoring: { authority: 'instance' },\n },\n invalid: {\n type: 'boolean',\n category: 'State',\n label: 'Invalid',\n default: false,\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ThemeConfig } from '@ankhorage/contracts';
|
|
2
|
-
import type { ZoraComputedTheme, ZoraThemeCompilationOptions } from '
|
|
2
|
+
import type { ZoraComputedTheme, ZoraThemeCompilationOptions } from '#zora/types/theme';
|
|
3
3
|
/***
|
|
4
4
|
* Compile canonical theme source into Color Theory evidence and resolved Surface themes.
|
|
5
5
|
* This function is pure and does not mount React or reproduce owner algorithms.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileZoraTheme.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/compileZoraTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EACV,iBAAiB,EAGjB,2BAA2B,EAK5B,MAAM,
|
|
1
|
+
{"version":3,"file":"compileZoraTheme.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/compileZoraTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EACV,iBAAiB,EAGjB,2BAA2B,EAK5B,MAAM,mBAAmB,CAAC;AAO3B;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE,2BAAgC,GACxC,iBAAiB,CAYnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileZoraTheme.js","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/compileZoraTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAaxD,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAC/C,MAAM,k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,CAAC,aAAa,EAAE,SAAS,CAAC;SACnC;KACF,CAAC;IAEF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,UAAU,GAAG,GAAG,IAAI,qBAAqB,MAAM,CAAC,EAAE,EAAE,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,GAAG,IAAI,eAAe,MAAM,CAAC,EAAE,EAAE;YACvC,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,kBAAkB;YACzB,MAAM,EAAE,CAAC,GAAG,IAAI,uBAAuB,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;SACpE,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,8EAA8E;AAC9E,SAAS,YAAY,CAAC,IAAa,EAAE,KAAc;IACjD,OAAO,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { generateThemeModeColors, selectColorSwatchStep } from '@ankhorage/color-theory';\nimport type { ThemeConfig } from '@ankhorage/contracts';\nimport { createTheme } from '@ankhorage/surface/theme';\nimport { isDeepEqual } from '@ankhorage/utility/object';\n\nimport type {\n ZoraComputedTheme,\n ZoraComputedThemeMode,\n ZoraThemeCompilationDiagnostic,\n ZoraThemeCompilationOptions,\n ZoraThemeMode,\n ZoraThemeProvenanceEntry,\n ZoraThemeSelectionResult,\n ZoraThemeSelectionTarget,\n} from '../../../../types/theme.ts';\n\nconst CONTRACTS_OWNER = '@ankhorage/contracts';\nconst COLOR_THEORY_OWNER = '@ankhorage/color-theory';\nconst SURFACE_OWNER = '@ankhorage/surface';\nconst ZORA_OWNER = '@ankhorage/zora';\n\n/***\n * Compile canonical theme source into Color Theory evidence and resolved Surface themes.\n * This function is pure and does not mount React or reproduce owner algorithms.\n */\nexport function compileZoraTheme(\n themeConfig: ThemeConfig,\n options: ZoraThemeCompilationOptions = {},\n): ZoraComputedTheme {\n const light = compileMode(themeConfig, 'light', options.selectionTargets?.light ?? []);\n const dark = compileMode(themeConfig, 'dark', options.selectionTargets?.dark ?? []);\n const diagnostics = [...light.diagnostics, ...dark.diagnostics];\n\n return {\n themeConfig,\n light,\n dark,\n diagnostics,\n provenance: createRootProvenance(themeConfig),\n };\n}\n\n/*** Compile one canonical mode and compare the independent owner results. */\nfunction compileMode(\n themeConfig: ThemeConfig,\n mode: ZoraThemeMode,\n targets: readonly ZoraThemeSelectionTarget[],\n): ZoraComputedThemeMode {\n const modeConfig = mode === 'light' ? themeConfig.light : themeConfig.dark;\n const generated = generateThemeModeColors(modeConfig);\n const surfaceTheme = createTheme(themeConfig, mode);\n const { diagnostics, selections } = resolveSelections(generated, mode, targets);\n\n if (!outputsAgree(generated, surfaceTheme.colorDiagnostics.generated)) {\n diagnostics.push({\n code: 'generated-output-divergence',\n message: 'Surface and Color Theory returned different generated color evidence.',\n mode,\n path: `${mode}.generated`,\n severity: 'error',\n });\n }\n\n return {\n mode,\n generated,\n surfaceTheme,\n selections,\n diagnostics,\n provenance: createModeProvenance(mode, targets),\n };\n}\n\n/*** Resolve measurable swatch targets without substituting unavailable roles. */\nfunction resolveSelections(\n generated: ZoraComputedThemeMode['generated'],\n mode: ZoraThemeMode,\n targets: readonly ZoraThemeSelectionTarget[],\n): {\n diagnostics: ZoraThemeCompilationDiagnostic[];\n selections: ZoraThemeSelectionResult[];\n} {\n const diagnostics: ZoraThemeCompilationDiagnostic[] = [];\n const selections = targets.map((request) => {\n const swatch = generated.swatches[request.swatch];\n const result = swatch\n ? selectColorSwatchStep(swatch, request.target, request.contexts, request.tiePolicy)\n : null;\n\n if (!swatch) diagnostics.push(createMissingSwatchDiagnostic(mode, request));\n else if (!result?.selected) diagnostics.push(createUnresolvedTargetDiagnostic(mode, request));\n\n return { request, result };\n });\n\n return { diagnostics, selections };\n}\n\n/*** Describe a requested swatch that the selected harmony does not generate. */\nfunction createMissingSwatchDiagnostic(\n mode: ZoraThemeMode,\n request: ZoraThemeSelectionTarget,\n): ZoraThemeCompilationDiagnostic {\n return {\n code: 'missing-target-swatch',\n message: `The selected harmony does not generate the '${request.swatch}' swatch.`,\n mode,\n path: `${mode}.selectionTargets.${request.id}`,\n severity: 'error',\n };\n}\n\n/*** Describe a measurable target that has no passing swatch candidate. */\nfunction createUnresolvedTargetDiagnostic(\n mode: ZoraThemeMode,\n request: ZoraThemeSelectionTarget,\n): ZoraThemeCompilationDiagnostic {\n return {\n code: 'unresolved-selection-target',\n message: `No '${request.swatch}' step satisfies selection target '${request.id}'.`,\n mode,\n path: `${mode}.selectionTargets.${request.id}`,\n severity: 'error',\n };\n}\n\n/*** Record direct source and Surface-owned default provenance. */\nfunction createRootProvenance(themeConfig: ThemeConfig): ZoraThemeProvenanceEntry[] {\n return [\n { path: 'themeConfig', origin: 'direct', owner: CONTRACTS_OWNER },\n {\n path: 'themeConfig.tokens',\n origin: themeConfig.tokens ? 'direct' : 'defaulted',\n owner: themeConfig.tokens ? CONTRACTS_OWNER : SURFACE_OWNER,\n },\n ];\n}\n\n/*** Record the owner transformation chain for one compiled mode. */\nfunction createModeProvenance(\n mode: ZoraThemeMode,\n targets: readonly ZoraThemeSelectionTarget[],\n): ZoraThemeProvenanceEntry[] {\n const inputPath = `themeConfig.${mode}`;\n const entries: ZoraThemeProvenanceEntry[] = [\n { path: inputPath, origin: 'direct', owner: CONTRACTS_OWNER },\n {\n path: `${mode}.generated`,\n origin: 'derived',\n owner: COLOR_THEORY_OWNER,\n inputs: [inputPath],\n },\n {\n path: `${mode}.surfaceTheme`,\n origin: 'derived',\n owner: SURFACE_OWNER,\n inputs: ['themeConfig', inputPath],\n },\n ];\n\n for (const target of targets) {\n const targetPath = `${mode}.selectionTargets.${target.id}`;\n entries.push({ path: targetPath, origin: 'direct', owner: ZORA_OWNER });\n entries.push({\n path: `${mode}.selections.${target.id}`,\n origin: 'derived',\n owner: COLOR_THEORY_OWNER,\n inputs: [`${mode}.generated.swatches.${target.swatch}`, targetPath],\n });\n }\n\n return entries;\n}\n\n/*** Compare deterministic owner result records for divergence diagnostics. */\nfunction outputsAgree(left: unknown, right: unknown): boolean {\n return isDeepEqual(left, right);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compileZoraTheme.js","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/compileZoraTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAaxD,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAC/C,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AACrD,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAC3C,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAErC;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,WAAwB,EACxB,UAAuC,EAAE;IAEzC,MAAM,KAAK,GAAG,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACvF,MAAM,IAAI,GAAG,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,gBAAgB,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IACpF,MAAM,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;IAEhE,OAAO;QACL,WAAW;QACX,KAAK;QACL,IAAI;QACJ,WAAW;QACX,UAAU,EAAE,oBAAoB,CAAC,WAAW,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,SAAS,WAAW,CAClB,WAA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AAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { generateThemeModeColors, selectColorSwatchStep } from '@ankhorage/color-theory';\nimport type { ThemeConfig } from '@ankhorage/contracts';\nimport { createTheme } from '@ankhorage/surface/theme';\nimport { isDeepEqual } from '@ankhorage/utility/object';\n\nimport type {\n ZoraComputedTheme,\n ZoraComputedThemeMode,\n ZoraThemeCompilationDiagnostic,\n ZoraThemeCompilationOptions,\n ZoraThemeMode,\n ZoraThemeProvenanceEntry,\n ZoraThemeSelectionResult,\n ZoraThemeSelectionTarget,\n} from '#zora/types/theme';\n\nconst CONTRACTS_OWNER = '@ankhorage/contracts';\nconst COLOR_THEORY_OWNER = '@ankhorage/color-theory';\nconst SURFACE_OWNER = '@ankhorage/surface';\nconst ZORA_OWNER = '@ankhorage/zora';\n\n/***\n * Compile canonical theme source into Color Theory evidence and resolved Surface themes.\n * This function is pure and does not mount React or reproduce owner algorithms.\n */\nexport function compileZoraTheme(\n themeConfig: ThemeConfig,\n options: ZoraThemeCompilationOptions = {},\n): ZoraComputedTheme {\n const light = compileMode(themeConfig, 'light', options.selectionTargets?.light ?? []);\n const dark = compileMode(themeConfig, 'dark', options.selectionTargets?.dark ?? []);\n const diagnostics = [...light.diagnostics, ...dark.diagnostics];\n\n return {\n themeConfig,\n light,\n dark,\n diagnostics,\n provenance: createRootProvenance(themeConfig),\n };\n}\n\n/*** Compile one canonical mode and compare the independent owner results. */\nfunction compileMode(\n themeConfig: ThemeConfig,\n mode: ZoraThemeMode,\n targets: readonly ZoraThemeSelectionTarget[],\n): ZoraComputedThemeMode {\n const modeConfig = mode === 'light' ? themeConfig.light : themeConfig.dark;\n const generated = generateThemeModeColors(modeConfig);\n const surfaceTheme = createTheme(themeConfig, mode);\n const { diagnostics, selections } = resolveSelections(generated, mode, targets);\n\n if (!outputsAgree(generated, surfaceTheme.colorDiagnostics.generated)) {\n diagnostics.push({\n code: 'generated-output-divergence',\n message: 'Surface and Color Theory returned different generated color evidence.',\n mode,\n path: `${mode}.generated`,\n severity: 'error',\n });\n }\n\n return {\n mode,\n generated,\n surfaceTheme,\n selections,\n diagnostics,\n provenance: createModeProvenance(mode, targets),\n };\n}\n\n/*** Resolve measurable swatch targets without substituting unavailable roles. */\nfunction resolveSelections(\n generated: ZoraComputedThemeMode['generated'],\n mode: ZoraThemeMode,\n targets: readonly ZoraThemeSelectionTarget[],\n): {\n diagnostics: ZoraThemeCompilationDiagnostic[];\n selections: ZoraThemeSelectionResult[];\n} {\n const diagnostics: ZoraThemeCompilationDiagnostic[] = [];\n const selections = targets.map((request) => {\n const swatch = generated.swatches[request.swatch];\n const result = swatch\n ? selectColorSwatchStep(swatch, request.target, request.contexts, request.tiePolicy)\n : null;\n\n if (!swatch) diagnostics.push(createMissingSwatchDiagnostic(mode, request));\n else if (!result?.selected) diagnostics.push(createUnresolvedTargetDiagnostic(mode, request));\n\n return { request, result };\n });\n\n return { diagnostics, selections };\n}\n\n/*** Describe a requested swatch that the selected harmony does not generate. */\nfunction createMissingSwatchDiagnostic(\n mode: ZoraThemeMode,\n request: ZoraThemeSelectionTarget,\n): ZoraThemeCompilationDiagnostic {\n return {\n code: 'missing-target-swatch',\n message: `The selected harmony does not generate the '${request.swatch}' swatch.`,\n mode,\n path: `${mode}.selectionTargets.${request.id}`,\n severity: 'error',\n };\n}\n\n/*** Describe a measurable target that has no passing swatch candidate. */\nfunction createUnresolvedTargetDiagnostic(\n mode: ZoraThemeMode,\n request: ZoraThemeSelectionTarget,\n): ZoraThemeCompilationDiagnostic {\n return {\n code: 'unresolved-selection-target',\n message: `No '${request.swatch}' step satisfies selection target '${request.id}'.`,\n mode,\n path: `${mode}.selectionTargets.${request.id}`,\n severity: 'error',\n };\n}\n\n/*** Record direct source and Surface-owned default provenance. */\nfunction createRootProvenance(themeConfig: ThemeConfig): ZoraThemeProvenanceEntry[] {\n return [\n { path: 'themeConfig', origin: 'direct', owner: CONTRACTS_OWNER },\n {\n path: 'themeConfig.tokens',\n origin: themeConfig.tokens ? 'direct' : 'defaulted',\n owner: themeConfig.tokens ? CONTRACTS_OWNER : SURFACE_OWNER,\n },\n ];\n}\n\n/*** Record the owner transformation chain for one compiled mode. */\nfunction createModeProvenance(\n mode: ZoraThemeMode,\n targets: readonly ZoraThemeSelectionTarget[],\n): ZoraThemeProvenanceEntry[] {\n const inputPath = `themeConfig.${mode}`;\n const entries: ZoraThemeProvenanceEntry[] = [\n { path: inputPath, origin: 'direct', owner: CONTRACTS_OWNER },\n {\n path: `${mode}.generated`,\n origin: 'derived',\n owner: COLOR_THEORY_OWNER,\n inputs: [inputPath],\n },\n {\n path: `${mode}.surfaceTheme`,\n origin: 'derived',\n owner: SURFACE_OWNER,\n inputs: ['themeConfig', inputPath],\n },\n ];\n\n for (const target of targets) {\n const targetPath = `${mode}.selectionTargets.${target.id}`;\n entries.push({ path: targetPath, origin: 'direct', owner: ZORA_OWNER });\n entries.push({\n path: `${mode}.selections.${target.id}`,\n origin: 'derived',\n owner: COLOR_THEORY_OWNER,\n inputs: [`${mode}.generated.swatches.${target.swatch}`, targetPath],\n });\n }\n\n return entries;\n}\n\n/*** Compare deterministic owner result records for divergence diagnostics. */\nfunction outputsAgree(left: unknown, right: unknown): boolean {\n return isDeepEqual(left, right);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ThemeConfig } from '@ankhorage/contracts';
|
|
2
|
-
import type { ZoraTheme } from '
|
|
2
|
+
import type { ZoraTheme } from '#zora/types/theme';
|
|
3
3
|
/*** Convert the concise ZORA design seed into canonical persisted theme source. */
|
|
4
4
|
export declare function createZoraThemeConfig(theme?: ZoraTheme): ThemeConfig;
|
|
5
5
|
//# sourceMappingURL=createZoraThemeConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createZoraThemeConfig.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/createZoraThemeConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"createZoraThemeConfig.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/createZoraThemeConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,SAA4B,GAAG,WAAW,CAetF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseHexColorOrThrow } from '@ankhorage/color-theory';
|
|
2
|
-
import { zoraDefaultTheme } from
|
|
2
|
+
import { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';
|
|
3
3
|
/*** Convert the concise ZORA design seed into canonical persisted theme source. */
|
|
4
4
|
export function createZoraThemeConfig(theme = zoraDefaultTheme) {
|
|
5
5
|
const primaryColor = parseHexColorOrThrow(theme.primaryColor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createZoraThemeConfig.js","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/createZoraThemeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"createZoraThemeConfig.js","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/createZoraThemeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,mFAAmF;AACnF,MAAM,UAAU,qBAAqB,CAAC,QAAmB,gBAAgB;IACvE,MAAM,YAAY,GAAG,oBAAoB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAE9D,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE;YACL,YAAY;YACZ,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB;QACD,IAAI,EAAE;YACJ,YAAY;YACZ,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { parseHexColorOrThrow } from '@ankhorage/color-theory';\nimport type { ThemeConfig } from '@ankhorage/contracts';\n\nimport { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';\nimport type { ZoraTheme } from '#zora/types/theme';\n\n/*** Convert the concise ZORA design seed into canonical persisted theme source. */\nexport function createZoraThemeConfig(theme: ZoraTheme = zoraDefaultTheme): ThemeConfig {\n const primaryColor = parseHexColorOrThrow(theme.primaryColor);\n\n return {\n id: theme.id,\n name: theme.name,\n light: {\n primaryColor,\n harmony: theme.harmony,\n },\n dark: {\n primaryColor,\n harmony: theme.harmony,\n },\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { compileZoraTheme } from '#zora/theme/application/use-cases/compileZoraTheme';
|
|
2
|
+
export { createZoraThemeConfig } from '#zora/theme/application/use-cases/createZoraThemeConfig';
|
|
3
|
+
export { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';
|
|
4
|
+
export type { ZoraComputedTheme, ZoraComputedThemeMode, ZoraTheme, ZoraThemeCompilationDiagnostic, ZoraThemeCompilationDiagnosticCode, ZoraThemeCompilationOptions, ZoraThemeId, ZoraThemeMode, ZoraThemeProvenanceEntry, ZoraThemeSelectionResult, ZoraThemeSelectionTarget, ZoraThemeSwatchRole, ZoraThemeValueOrigin, } from '#zora/types/theme';
|
|
5
5
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/theme/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/theme/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { compileZoraTheme } from
|
|
2
|
-
export { createZoraThemeConfig } from
|
|
3
|
-
export { zoraDefaultTheme } from
|
|
1
|
+
export { compileZoraTheme } from '#zora/theme/application/use-cases/compileZoraTheme';
|
|
2
|
+
export { createZoraThemeConfig } from '#zora/theme/application/use-cases/createZoraThemeConfig';
|
|
3
|
+
export { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';
|
|
4
4
|
//# sourceMappingURL=public.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/theme/public.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/theme/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export { compileZoraTheme } from '#zora/theme/application/use-cases/compileZoraTheme';\nexport { createZoraThemeConfig } from '#zora/theme/application/use-cases/createZoraThemeConfig';\nexport { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';\nexport type {\n ZoraComputedTheme,\n ZoraComputedThemeMode,\n ZoraTheme,\n ZoraThemeCompilationDiagnostic,\n ZoraThemeCompilationDiagnosticCode,\n ZoraThemeCompilationOptions,\n ZoraThemeId,\n ZoraThemeMode,\n ZoraThemeProvenanceEntry,\n ZoraThemeSelectionResult,\n ZoraThemeSelectionTarget,\n ZoraThemeSwatchRole,\n ZoraThemeValueOrigin,\n} from '#zora/types/theme';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoraDefaultTheme.d.ts","sourceRoot":"","sources":["../../../src/features/theme/zoraDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"zoraDefaultTheme.d.ts","sourceRoot":"","sources":["../../../src/features/theme/zoraDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,eAAO,MAAM,gBAAgB,EAAE,SAM9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoraDefaultTheme.js","sourceRoot":"","sources":["../../../src/features/theme/zoraDefaultTheme.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,iBAAiB;IAC9B,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,WAAW;CACrB,CAAC","sourcesContent":["import type { ZoraTheme } from '
|
|
1
|
+
{"version":3,"file":"zoraDefaultTheme.js","sourceRoot":"","sources":["../../../src/features/theme/zoraDefaultTheme.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,iBAAiB;IAC9B,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,WAAW;CACrB,CAAC","sourcesContent":["import type { ZoraTheme } from '#zora/types/theme';\n\nexport const zoraDefaultTheme: ZoraTheme = {\n id: 'zora',\n name: 'ZORA',\n appCategory: 'developer_tools',\n primaryColor: '#0f766e',\n harmony: 'analogous',\n};\n"]}
|
package/dist/types/select.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ButtonIconSpec, ButtonLabelWeight } from '@ankhorage/surface';
|
|
1
2
|
import type { ZoraBaseProps } from './base';
|
|
2
3
|
export interface SelectOption<TValue extends string = string> {
|
|
3
4
|
value: TValue;
|
|
@@ -13,6 +14,10 @@ export interface SelectProps<TValue extends string = string> extends ZoraBasePro
|
|
|
13
14
|
helperText?: string;
|
|
14
15
|
errorText?: string;
|
|
15
16
|
placeholder?: string;
|
|
17
|
+
/** Optional Surface icon source rendered before the trigger label. */
|
|
18
|
+
leadingIcon?: ButtonIconSpec;
|
|
19
|
+
/** Optional Surface Button label emphasis; defaults to semiBold. */
|
|
20
|
+
labelWeight?: ButtonLabelWeight;
|
|
16
21
|
required?: boolean;
|
|
17
22
|
disabled?: boolean;
|
|
18
23
|
readOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/types/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,WAAW,YAAY,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAA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KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,oEAAoE;IACpE,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/types/select.ts"],"names":[],"mappings":"","sourcesContent":["import type { ZoraBaseProps } from './base';\n\nexport interface SelectOption<TValue extends string = string> {\n value: TValue;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps<TValue extends string = string> extends ZoraBaseProps {\n value?: TValue;\n defaultValue?: TValue;\n options: readonly SelectOption<TValue>[];\n onValueChange?: (value: TValue) => void;\n label?: string;\n helperText?: string;\n errorText?: string;\n placeholder?: string;\n required?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n testID?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/types/select.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec, ButtonLabelWeight } from '@ankhorage/surface';\n\nimport type { ZoraBaseProps } from './base';\n\nexport interface SelectOption<TValue extends string = string> {\n value: TValue;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps<TValue extends string = string> extends ZoraBaseProps {\n value?: TValue;\n defaultValue?: TValue;\n options: readonly SelectOption<TValue>[];\n onValueChange?: (value: TValue) => void;\n label?: string;\n helperText?: string;\n errorText?: string;\n placeholder?: string;\n /** Optional Surface icon source rendered before the trigger label. */\n leadingIcon?: ButtonIconSpec;\n /** Optional Surface Button label emphasis; defaults to semiBold. */\n labelWeight?: ButtonLabelWeight;\n required?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n testID?: string;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "27.
|
|
4
|
+
"version": "27.10.0",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@ankhorage/capability": "^0.2.3",
|
|
45
45
|
"@ankhorage/color-theory": "^0.3.4",
|
|
46
|
-
"@ankhorage/contracts": "^26.
|
|
46
|
+
"@ankhorage/contracts": "^26.17.0",
|
|
47
47
|
"@ankhorage/game": "^0.1.4",
|
|
48
48
|
"@ankhorage/graph": "^0.4.0",
|
|
49
49
|
"@ankhorage/grid-view": "^0.5.0",
|
|
50
50
|
"@ankhorage/reader": "^0.1.3",
|
|
51
|
-
"@ankhorage/runtime": "^5.5.
|
|
52
|
-
"@ankhorage/surface": "^9.
|
|
51
|
+
"@ankhorage/runtime": "^5.5.12",
|
|
52
|
+
"@ankhorage/surface": "^9.6.3",
|
|
53
53
|
"@ankhorage/utility": "^1.10.1",
|
|
54
54
|
"expo-document-picker": "~57.0.3",
|
|
55
55
|
"expo-image-picker": "~57.0.20"
|
|
@@ -63,6 +63,20 @@
|
|
|
63
63
|
"CHANGELOG.md",
|
|
64
64
|
"LICENSE"
|
|
65
65
|
],
|
|
66
|
+
"imports": {
|
|
67
|
+
"#zora/theme/*": {
|
|
68
|
+
"types": "./dist/features/theme/*.d.ts",
|
|
69
|
+
"react-native": "./src/features/theme/*.ts",
|
|
70
|
+
"browser": "./src/features/theme/*.ts",
|
|
71
|
+
"import": "./dist/features/theme/*.js",
|
|
72
|
+
"default": "./dist/features/theme/*.js"
|
|
73
|
+
},
|
|
74
|
+
"#zora/types/*": {
|
|
75
|
+
"types": "./dist/types/*.d.ts",
|
|
76
|
+
"import": "./dist/types/*.js",
|
|
77
|
+
"default": "./dist/types/*.js"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
66
80
|
"exports": {
|
|
67
81
|
".": {
|
|
68
82
|
"react-native": "./src/index.ts",
|
|
@@ -168,7 +182,7 @@
|
|
|
168
182
|
"version-packages": "ankhorage-changeset version"
|
|
169
183
|
},
|
|
170
184
|
"devDependencies": {
|
|
171
|
-
"@ankhorage/devtools": "^2.10.
|
|
185
|
+
"@ankhorage/devtools": "^2.10.15",
|
|
172
186
|
"@ankhorage/paradox": "^0.6.0",
|
|
173
187
|
"@react-native-vector-icons/fontawesome": "^14.0.0",
|
|
174
188
|
"@react-native-vector-icons/fontawesome5": "^14.0.0",
|
|
@@ -15,6 +15,8 @@ export function SelectTrigger<TValue extends string>({
|
|
|
15
15
|
disabled={props.disabled}
|
|
16
16
|
fullWidth
|
|
17
17
|
interactionPolicy={props.interactionPolicy}
|
|
18
|
+
leadingIcon={props.leadingIcon}
|
|
19
|
+
labelWeight={props.labelWeight ?? 'semiBold'}
|
|
18
20
|
onPress={props.readOnly ? undefined : onPress}
|
|
19
21
|
testID={props.testID ? `${props.testID}-trigger` : undefined}
|
|
20
22
|
trailingIcon={SELECT_CHEVRON_ICON}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { expect, test } from 'bun:test';
|
|
2
2
|
|
|
3
|
+
import type { SelectProps } from '../../../types/select';
|
|
3
4
|
import { selectMeta } from './selectMeta';
|
|
4
5
|
|
|
5
6
|
test('Select is a direct manifest node with valueChange payload', () => {
|
|
@@ -10,6 +11,36 @@ test('Select is a direct manifest node with valueChange payload', () => {
|
|
|
10
11
|
]);
|
|
11
12
|
});
|
|
12
13
|
|
|
14
|
+
test('Select registers the optional leading icon as instance-owned media metadata', () => {
|
|
15
|
+
expect(selectMeta.props.leadingIcon).toEqual({
|
|
16
|
+
type: 'media',
|
|
17
|
+
category: 'Content',
|
|
18
|
+
label: 'Leading SVG icon',
|
|
19
|
+
mediaKinds: ['image'],
|
|
20
|
+
authoring: { authority: 'instance' },
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('Select registers optional trigger label emphasis as serializable metadata', () => {
|
|
25
|
+
expect(selectMeta.props.labelWeight).toEqual({
|
|
26
|
+
type: 'string',
|
|
27
|
+
category: 'Style',
|
|
28
|
+
label: 'Label weight',
|
|
29
|
+
enum: ['semiBold', 'bold'],
|
|
30
|
+
default: 'semiBold',
|
|
31
|
+
authoring: { authority: 'instance' },
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('Select is exported through its public component entrypoint', async () => {
|
|
36
|
+
const publicEntry = await Bun.file('src/features/form/select/public.ts').text();
|
|
37
|
+
|
|
38
|
+
expect(publicEntry).toContain(
|
|
39
|
+
"export type { SelectOption, SelectProps } from '../../../types/select';",
|
|
40
|
+
);
|
|
41
|
+
expect(publicEntry).toContain("export { Select } from './adapters/inbound/Select';");
|
|
42
|
+
});
|
|
43
|
+
|
|
13
44
|
test('Select uses web Popover and native BottomSheetFlatList presentation', async () => {
|
|
14
45
|
const [neutral, web, native] = await Promise.all([
|
|
15
46
|
Bun.file('src/features/form/select/adapters/inbound/Select.tsx').text(),
|
|
@@ -23,3 +54,26 @@ test('Select uses web Popover and native BottomSheetFlatList presentation', asyn
|
|
|
23
54
|
expect(native).toContain("contentMode: 'direct'");
|
|
24
55
|
expect(`${neutral}\n${web}\n${native}`).not.toContain('@react-native-picker/picker');
|
|
25
56
|
});
|
|
57
|
+
|
|
58
|
+
test('Select supports default weight, bold emphasis, SVG icons, and their combination', async () => {
|
|
59
|
+
const props: SelectProps = {
|
|
60
|
+
options: [{ label: 'Workspace', value: 'workspace' }],
|
|
61
|
+
};
|
|
62
|
+
const svgIcon = {
|
|
63
|
+
source:
|
|
64
|
+
'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3C/svg%3E',
|
|
65
|
+
} as const;
|
|
66
|
+
const configurations = [
|
|
67
|
+
props,
|
|
68
|
+
{ ...props, labelWeight: 'bold' },
|
|
69
|
+
{ ...props, leadingIcon: svgIcon },
|
|
70
|
+
{ ...props, labelWeight: 'bold', leadingIcon: svgIcon },
|
|
71
|
+
] satisfies readonly SelectProps[];
|
|
72
|
+
const selectTrigger = await Bun.file(
|
|
73
|
+
'src/features/form/select/composition/SelectTrigger.tsx',
|
|
74
|
+
).text();
|
|
75
|
+
|
|
76
|
+
expect(configurations).toHaveLength(4);
|
|
77
|
+
expect(selectTrigger).toContain("labelWeight={props.labelWeight ?? 'semiBold'}");
|
|
78
|
+
expect(selectTrigger).toContain('leadingIcon={props.leadingIcon}');
|
|
79
|
+
});
|
|
@@ -122,6 +122,21 @@ export const selectMeta = {
|
|
|
122
122
|
default: 'Select',
|
|
123
123
|
authoring: { authority: 'instance' },
|
|
124
124
|
},
|
|
125
|
+
leadingIcon: {
|
|
126
|
+
type: 'media',
|
|
127
|
+
category: 'Content',
|
|
128
|
+
label: 'Leading SVG icon',
|
|
129
|
+
mediaKinds: ['image'],
|
|
130
|
+
authoring: { authority: 'instance' },
|
|
131
|
+
},
|
|
132
|
+
labelWeight: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
category: 'Style',
|
|
135
|
+
label: 'Label weight',
|
|
136
|
+
enum: ['semiBold', 'bold'],
|
|
137
|
+
default: 'semiBold',
|
|
138
|
+
authoring: { authority: 'instance' },
|
|
139
|
+
},
|
|
125
140
|
required: {
|
|
126
141
|
type: 'boolean',
|
|
127
142
|
category: 'State',
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
ZoraThemeProvenanceEntry,
|
|
13
13
|
ZoraThemeSelectionResult,
|
|
14
14
|
ZoraThemeSelectionTarget,
|
|
15
|
-
} from '
|
|
15
|
+
} from '#zora/types/theme';
|
|
16
16
|
|
|
17
17
|
const CONTRACTS_OWNER = '@ankhorage/contracts';
|
|
18
18
|
const COLOR_THEORY_OWNER = '@ankhorage/color-theory';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseHexColorOrThrow } from '@ankhorage/color-theory';
|
|
2
2
|
import type { ThemeConfig } from '@ankhorage/contracts';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';
|
|
5
|
+
import type { ZoraTheme } from '#zora/types/theme';
|
|
6
6
|
|
|
7
7
|
/*** Convert the concise ZORA design seed into canonical persisted theme source. */
|
|
8
8
|
export function createZoraThemeConfig(theme: ZoraTheme = zoraDefaultTheme): ThemeConfig {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { compileZoraTheme } from '#zora/theme/application/use-cases/compileZoraTheme';
|
|
2
|
+
export { createZoraThemeConfig } from '#zora/theme/application/use-cases/createZoraThemeConfig';
|
|
3
|
+
export { zoraDefaultTheme } from '#zora/theme/zoraDefaultTheme';
|
|
1
4
|
export type {
|
|
2
5
|
ZoraComputedTheme,
|
|
3
6
|
ZoraComputedThemeMode,
|
|
@@ -12,7 +15,4 @@ export type {
|
|
|
12
15
|
ZoraThemeSelectionTarget,
|
|
13
16
|
ZoraThemeSwatchRole,
|
|
14
17
|
ZoraThemeValueOrigin,
|
|
15
|
-
} from '
|
|
16
|
-
export { compileZoraTheme } from './application/use-cases/compileZoraTheme.ts';
|
|
17
|
-
export { createZoraThemeConfig } from './application/use-cases/createZoraThemeConfig.ts';
|
|
18
|
-
export { zoraDefaultTheme } from './zoraDefaultTheme.ts';
|
|
18
|
+
} from '#zora/types/theme';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
3
|
|
|
4
4
|
import { expect, test } from 'bun:test';
|
|
5
|
-
import * as ts from 'typescript';
|
|
6
5
|
|
|
7
6
|
const themeRoot = import.meta.dir;
|
|
8
7
|
const sourceModules = [
|
|
@@ -12,30 +11,36 @@ const sourceModules = [
|
|
|
12
11
|
'zoraDefaultTheme.ts',
|
|
13
12
|
] as const;
|
|
14
13
|
|
|
15
|
-
test('keeps theme source imports resolvable
|
|
16
|
-
const
|
|
17
|
-
readonly
|
|
14
|
+
test('keeps theme source imports resolvable through package-owned conditional targets', () => {
|
|
15
|
+
const packageJson = JSON.parse(readFileSync('package.json', 'utf8')) as {
|
|
16
|
+
readonly imports?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
18
17
|
};
|
|
19
|
-
|
|
18
|
+
const themeTargets = packageJson.imports?.['#zora/theme/*'];
|
|
19
|
+
const typeTargets = packageJson.imports?.['#zora/types/*'];
|
|
20
|
+
|
|
21
|
+
expect(themeTargets).toEqual({
|
|
22
|
+
types: './dist/features/theme/*.d.ts',
|
|
23
|
+
'react-native': './src/features/theme/*.ts',
|
|
24
|
+
browser: './src/features/theme/*.ts',
|
|
25
|
+
import: './dist/features/theme/*.js',
|
|
26
|
+
default: './dist/features/theme/*.js',
|
|
27
|
+
});
|
|
28
|
+
expect(typeTargets).toEqual({
|
|
29
|
+
types: './dist/types/*.d.ts',
|
|
30
|
+
import: './dist/types/*.js',
|
|
31
|
+
default: './dist/types/*.js',
|
|
32
|
+
});
|
|
20
33
|
|
|
21
34
|
for (const modulePath of sourceModules) {
|
|
22
35
|
const filename = resolve(themeRoot, modulePath);
|
|
23
36
|
const source = readFileSync(filename, 'utf8');
|
|
24
|
-
const
|
|
37
|
+
const sourceImports = [
|
|
38
|
+
...source.matchAll(/\bfrom\s+['"](#zora\/(?:theme|types)\/[^'"]+)['"]/gu),
|
|
39
|
+
];
|
|
25
40
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
expect(
|
|
41
|
+
expect(sourceImports.length, modulePath).toBeGreaterThan(0);
|
|
42
|
+
for (const [, specifier] of sourceImports) {
|
|
43
|
+
expect(specifier, modulePath).toMatch(/^#zora\/(?:theme|types)\//u);
|
|
29
44
|
}
|
|
30
|
-
|
|
31
|
-
const emitted = ts.transpileModule(source, {
|
|
32
|
-
fileName: filename,
|
|
33
|
-
compilerOptions: {
|
|
34
|
-
module: ts.ModuleKind.ESNext,
|
|
35
|
-
rewriteRelativeImportExtensions: true,
|
|
36
|
-
target: ts.ScriptTarget.ES2022,
|
|
37
|
-
},
|
|
38
|
-
}).outputText;
|
|
39
|
-
expect(emitted).not.toMatch(/\bfrom\s+['"][^'"]+\.ts['"]/u);
|
|
40
45
|
}
|
|
41
46
|
});
|
package/src/types/select.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ButtonIconSpec, ButtonLabelWeight } from '@ankhorage/surface';
|
|
2
|
+
|
|
1
3
|
import type { ZoraBaseProps } from './base';
|
|
2
4
|
|
|
3
5
|
export interface SelectOption<TValue extends string = string> {
|
|
@@ -15,6 +17,10 @@ export interface SelectProps<TValue extends string = string> extends ZoraBasePro
|
|
|
15
17
|
helperText?: string;
|
|
16
18
|
errorText?: string;
|
|
17
19
|
placeholder?: string;
|
|
20
|
+
/** Optional Surface icon source rendered before the trigger label. */
|
|
21
|
+
leadingIcon?: ButtonIconSpec;
|
|
22
|
+
/** Optional Surface Button label emphasis; defaults to semiBold. */
|
|
23
|
+
labelWeight?: ButtonLabelWeight;
|
|
18
24
|
required?: boolean;
|
|
19
25
|
disabled?: boolean;
|
|
20
26
|
readOnly?: boolean;
|