diff --git a/.changeset/neat-heading-authoring.md b/.changeset/neat-heading-authoring.md new file mode 100644 index 00000000..242d7c63 --- /dev/null +++ b/.changeset/neat-heading-authoring.md @@ -0,0 +1,5 @@ +--- +'@ankhorage/zora': patch +--- + +Classify Heading content and semantics for instance authoring while keeping visual presentation under component theme authority. diff --git a/README.md b/README.md index b609af4c..8b142916 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/authoring-metadata.md b/docs/authoring-metadata.md index 66a0e883..bf955566 100644 --- a/docs/authoring-metadata.md +++ b/docs/authoring-metadata.md @@ -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 diff --git a/paradox/badges/npm.svg b/paradox/badges/npm.svg index 3cdfc3df..8b33561c 100644 --- a/paradox/badges/npm.svg +++ b/paradox/badges/npm.svg @@ -1,7 +1,7 @@ - -npm: v2.9.1 + +npm: v2.9.2 npm -v2.9.1 +v2.9.2 diff --git a/paradox/paradox.json b/paradox/paradox.json index e1352efc..363323af 100644 --- a/paradox/paradox.json +++ b/paradox/paradox.json @@ -12,7 +12,7 @@ { "id": "npm", "label": "npm", - "value": "v2.9.1", + "value": "v2.9.2", "color": "cb3837" }, { diff --git a/src/components/heading/meta.ts b/src/components/heading/meta.ts index 886d4372..247171b7 100644 --- a/src/components/heading/meta.ts +++ b/src/components/heading/meta.ts @@ -22,11 +22,13 @@ 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', @@ -34,41 +36,55 @@ export const headingMeta = { 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; diff --git a/src/metadata/authoringMeta.test.ts b/src/metadata/authoringMeta.test.ts index 80aa519b..bf797bc7 100644 --- a/src/metadata/authoringMeta.test.ts +++ b/src/metadata/authoringMeta.test.ts @@ -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', @@ -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', @@ -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(); });