Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/neat-heading-authoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ankhorage/zora': patch
---

Classify Heading content and semantics for instance authoring while keeping visual presentation under component theme authority.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# ZORA

![license: MIT](././paradox/badges/license.svg) ![npm: v2.9.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
![license: MIT](././paradox/badges/license.svg) ![npm: v2.9.2](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)

Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.

Expand Down
4 changes: 3 additions & 1 deletion docs/authoring-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ A prop participates in authoring only when its schema has `authoring` metadata.
{ authority: 'theme', scope: 'global' | 'component' | 'pattern' }
```

Instance authority is reserved for legitimate per-node content or behavior. Theme authority prevents visual design props from becoming unrelated per-instance overrides. Internal or technical props have no `authoring` property. There is no `system` authority.
Instance authority is reserved for legitimate per-node content, behavior, or semantics. For example, a Heading owns its text, semantic level, translation key, and optional line clamp per instance. Its size, color, emphasis, alignment, weight, and italic presentation remain component-theme concerns.

Theme authority prevents visual design props from becoming unrelated per-instance overrides. Internal or technical props have no `authoring` property. There is no `system` authority.

## Theme recipe direction

Expand Down
6 changes: 3 additions & 3 deletions paradox/badges/npm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion paradox/paradox.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"id": "npm",
"label": "npm",
"value": "v2.9.1",
"value": "v2.9.2",
"color": "cb3837"
},
{
Expand Down
16 changes: 16 additions & 0 deletions src/components/heading/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,53 +22,69 @@ export const headingMeta = {
category: 'Content',
label: 'Text',
default: 'Heading',
authoring: { authority: 'instance' },
},
i18nKey: {
type: 'string',
category: 'Content',
label: 'i18n key',
authoring: { authority: 'instance' },
},
level: {
type: 'enum',
category: 'Semantics',
label: 'Level',
enum: [1, 2, 3, 4, 5, 6],
default: 2,
authoring: { authority: 'instance' },
},
size: {
type: 'enum',
category: 'Typography',
label: 'Size',
enum: ['display', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
authoring: { authority: 'theme', scope: 'component' },
},
color: {
type: 'enum',
category: 'Style',
label: 'Color',
enum: ZORA_COLORS,
authoring: { authority: 'theme', scope: 'component' },
},
emphasis: {
type: 'enum',
category: 'Style',
label: 'Emphasis',
enum: ZORA_EMPHASES,
authoring: { authority: 'theme', scope: 'component' },
},
align: {
type: 'enum',
category: 'Layout',
label: 'Align',
enum: ['auto', 'left', 'right', 'center', 'justify'],
authoring: { authority: 'theme', scope: 'component' },
},
weight: {
type: 'enum',
category: 'Typography',
label: 'Weight',
enum: ['regular', 'medium', 'semiBold', 'bold'],
authoring: { authority: 'theme', scope: 'component' },
},
italic: {
type: 'boolean',
category: 'Typography',
label: 'Italic',
default: false,
authoring: { authority: 'theme', scope: 'component' },
},
numberOfLines: {
type: 'number',
category: 'Layout',
label: 'Line clamp',
authoring: { authority: 'instance' },
},
},
} as const satisfies ZoraComponentMeta;
13 changes: 13 additions & 0 deletions src/metadata/authoringMeta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ describe('ZORA component prop authoring authority', () => {
authority: 'instance',
});
expect(ZORA_COMPONENT_META.Card.props.title?.authoring).toEqual({ authority: 'instance' });
expect(ZORA_COMPONENT_META.Heading.props.text?.authoring).toEqual({ authority: 'instance' });
expect(ZORA_COMPONENT_META.Heading.props.level?.authoring).toEqual({ authority: 'instance' });
expect(ZORA_COMPONENT_META.Text.props.text?.authoring).toEqual({ authority: 'instance' });
expect(ZORA_COMPONENT_META.Panel.props.description?.authoring).toEqual({
authority: 'instance',
Expand All @@ -39,6 +41,10 @@ describe('ZORA component prop authoring authority', () => {
authority: 'theme',
scope: 'component',
});
expect(ZORA_COMPONENT_META.Heading.props.size?.authoring).toEqual({
authority: 'theme',
scope: 'component',
});
expect(ZORA_COMPONENT_META.Text.props.variant?.authoring).toEqual({
authority: 'theme',
scope: 'component',
Expand All @@ -49,6 +55,13 @@ describe('ZORA component prop authoring authority', () => {
});
});

test('keeps Heading blueprint content useful before instance editing', () => {
expect(ZORA_COMPONENT_META.Heading.blueprint?.defaultProps).toEqual({
text: 'Heading',
level: 2,
});
});

test('treats absent authoring metadata as not authorable', () => {
expect(ZORA_COMPONENT_META.Progress.props.value?.authoring).toBeUndefined();
});
Expand Down
Loading