@ankhorage/zora 2.11.0 → 2.13.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -2
  3. package/dist/components/button/Button.d.ts.map +1 -1
  4. package/dist/components/button/Button.js +4 -2
  5. package/dist/components/button/Button.js.map +1 -1
  6. package/dist/components/button/meta.d.ts +3 -6
  7. package/dist/components/button/meta.d.ts.map +1 -1
  8. package/dist/components/button/meta.js +9 -15
  9. package/dist/components/button/meta.js.map +1 -1
  10. package/dist/components/button/resolveButtonThemeRecipe.d.ts +9 -0
  11. package/dist/components/button/resolveButtonThemeRecipe.d.ts.map +1 -0
  12. package/dist/components/button/resolveButtonThemeRecipe.js +30 -0
  13. package/dist/components/button/resolveButtonThemeRecipe.js.map +1 -0
  14. package/dist/components/button/themeRecipeMeta.d.ts +4 -10
  15. package/dist/components/button/themeRecipeMeta.d.ts.map +1 -1
  16. package/dist/components/button/themeRecipeMeta.js +5 -10
  17. package/dist/components/button/themeRecipeMeta.js.map +1 -1
  18. package/dist/components/card/Card.d.ts.map +1 -1
  19. package/dist/components/card/Card.js +8 -4
  20. package/dist/components/card/Card.js.map +1 -1
  21. package/dist/components/card/meta.d.ts +22 -3
  22. package/dist/components/card/meta.d.ts.map +1 -1
  23. package/dist/components/card/meta.js +14 -15
  24. package/dist/components/card/meta.js.map +1 -1
  25. package/dist/components/card/resolveCardThemeRecipe.d.ts +15 -0
  26. package/dist/components/card/resolveCardThemeRecipe.d.ts.map +1 -0
  27. package/dist/components/card/resolveCardThemeRecipe.js +22 -0
  28. package/dist/components/card/resolveCardThemeRecipe.js.map +1 -0
  29. package/dist/components/card/themeRecipeMeta.d.ts +1 -1
  30. package/dist/components/card/themeRecipeMeta.js +1 -1
  31. package/dist/components/card/themeRecipeMeta.js.map +1 -1
  32. package/dist/components/card/types.d.ts +2 -0
  33. package/dist/components/card/types.d.ts.map +1 -1
  34. package/dist/components/card/types.js.map +1 -1
  35. package/dist/components/heading/Heading.d.ts.map +1 -1
  36. package/dist/components/heading/Heading.js +14 -15
  37. package/dist/components/heading/Heading.js.map +1 -1
  38. package/dist/components/heading/meta.d.ts +6 -1
  39. package/dist/components/heading/meta.d.ts.map +1 -1
  40. package/dist/components/heading/meta.js +13 -22
  41. package/dist/components/heading/meta.js.map +1 -1
  42. package/dist/components/heading/resolveHeadingThemeRecipe.d.ts +11 -0
  43. package/dist/components/heading/resolveHeadingThemeRecipe.d.ts.map +1 -0
  44. package/dist/components/heading/resolveHeadingThemeRecipe.js +46 -0
  45. package/dist/components/heading/resolveHeadingThemeRecipe.js.map +1 -0
  46. package/dist/components/heading/themeRecipeMeta.d.ts +39 -0
  47. package/dist/components/heading/themeRecipeMeta.d.ts.map +1 -0
  48. package/dist/components/heading/themeRecipeMeta.js +32 -0
  49. package/dist/components/heading/themeRecipeMeta.js.map +1 -0
  50. package/dist/components/image/meta.d.ts +24 -3
  51. package/dist/components/image/meta.d.ts.map +1 -1
  52. package/dist/components/image/meta.js +18 -3
  53. package/dist/components/image/meta.js.map +1 -1
  54. package/dist/components/text/Text.d.ts +0 -1
  55. package/dist/components/text/Text.d.ts.map +1 -1
  56. package/dist/components/text/Text.js +14 -16
  57. package/dist/components/text/Text.js.map +1 -1
  58. package/dist/components/text/meta.d.ts +6 -5
  59. package/dist/components/text/meta.d.ts.map +1 -1
  60. package/dist/components/text/meta.js +13 -25
  61. package/dist/components/text/meta.js.map +1 -1
  62. package/dist/components/text/resolveTextThemeRecipe.d.ts +11 -0
  63. package/dist/components/text/resolveTextThemeRecipe.d.ts.map +1 -0
  64. package/dist/components/text/resolveTextThemeRecipe.js +46 -0
  65. package/dist/components/text/resolveTextThemeRecipe.js.map +1 -0
  66. package/dist/components/text/themeRecipeMeta.d.ts +15 -7
  67. package/dist/components/text/themeRecipeMeta.d.ts.map +1 -1
  68. package/dist/components/text/themeRecipeMeta.js +12 -11
  69. package/dist/components/text/themeRecipeMeta.js.map +1 -1
  70. package/dist/metadata/bindableComponentMeta.d.ts +22 -7
  71. package/dist/metadata/bindableComponentMeta.d.ts.map +1 -1
  72. package/dist/metadata/bindableComponentMeta.js +3 -13
  73. package/dist/metadata/bindableComponentMeta.js.map +1 -1
  74. package/dist/metadata/themeRecipeMeta.d.ts.map +1 -1
  75. package/dist/metadata/themeRecipeMeta.js +2 -0
  76. package/dist/metadata/themeRecipeMeta.js.map +1 -1
  77. package/dist/metadata/themeRecipeTypes.d.ts +3 -3
  78. package/dist/metadata/themeRecipeTypes.d.ts.map +1 -1
  79. package/dist/metadata/themeRecipeTypes.js.map +1 -1
  80. package/dist/metadata/types.d.ts +4 -2
  81. package/dist/metadata/types.d.ts.map +1 -1
  82. package/dist/metadata/types.js.map +1 -1
  83. package/dist/patterns/panel/Panel.d.ts +0 -2
  84. package/dist/patterns/panel/Panel.d.ts.map +1 -1
  85. package/dist/patterns/panel/Panel.js +6 -4
  86. package/dist/patterns/panel/Panel.js.map +1 -1
  87. package/dist/patterns/panel/meta.d.ts +22 -3
  88. package/dist/patterns/panel/meta.d.ts.map +1 -1
  89. package/dist/patterns/panel/meta.js +14 -15
  90. package/dist/patterns/panel/meta.js.map +1 -1
  91. package/dist/patterns/panel/themeRecipeMeta.d.ts +1 -1
  92. package/dist/patterns/panel/themeRecipeMeta.js +1 -1
  93. package/dist/patterns/panel/themeRecipeMeta.js.map +1 -1
  94. package/dist/patterns/panel/types.d.ts +2 -0
  95. package/dist/patterns/panel/types.d.ts.map +1 -1
  96. package/dist/patterns/panel/types.js.map +1 -1
  97. package/dist/theme/ZoraProvider.d.ts +4 -12
  98. package/dist/theme/ZoraProvider.d.ts.map +1 -1
  99. package/dist/theme/ZoraProvider.js +5 -14
  100. package/dist/theme/ZoraProvider.js.map +1 -1
  101. package/dist/theme/ZoraThemeRuntimeContext.d.ts +1 -2
  102. package/dist/theme/ZoraThemeRuntimeContext.d.ts.map +1 -1
  103. package/dist/theme/ZoraThemeRuntimeContext.js +0 -1
  104. package/dist/theme/ZoraThemeRuntimeContext.js.map +1 -1
  105. package/dist/theme/ZoraThemeScope.d.ts.map +1 -1
  106. package/dist/theme/ZoraThemeScope.js +4 -10
  107. package/dist/theme/ZoraThemeScope.js.map +1 -1
  108. package/dist/theme/resolveZoraThemeRecipe.d.ts +16 -0
  109. package/dist/theme/resolveZoraThemeRecipe.d.ts.map +1 -0
  110. package/dist/theme/resolveZoraThemeRecipe.js +56 -0
  111. package/dist/theme/resolveZoraThemeRecipe.js.map +1 -0
  112. package/dist/theme/useZoraTheme.d.ts +1 -1
  113. package/dist/theme/useZoraThemeRecipe.d.ts +2 -0
  114. package/dist/theme/useZoraThemeRecipe.d.ts.map +1 -0
  115. package/dist/theme/useZoraThemeRecipe.js +7 -0
  116. package/dist/theme/useZoraThemeRecipe.js.map +1 -0
  117. package/package.json +4 -4
  118. package/src/components/button/Button.tsx +4 -2
  119. package/src/components/button/meta.ts +10 -15
  120. package/src/components/button/resolveButtonThemeRecipe.test.ts +25 -0
  121. package/src/components/button/resolveButtonThemeRecipe.ts +41 -0
  122. package/src/components/button/themeRecipeMeta.ts +5 -10
  123. package/src/components/card/Card.tsx +13 -7
  124. package/src/components/card/meta.ts +15 -15
  125. package/src/components/card/resolveCardThemeRecipe.test.ts +28 -0
  126. package/src/components/card/resolveCardThemeRecipe.ts +33 -0
  127. package/src/components/card/themeRecipeMeta.ts +1 -1
  128. package/src/components/card/types.ts +2 -0
  129. package/src/components/contentFallback.test.ts +4 -4
  130. package/src/components/heading/Heading.tsx +18 -28
  131. package/src/components/heading/meta.ts +14 -22
  132. package/src/components/heading/resolveHeadingThemeRecipe.ts +55 -0
  133. package/src/components/heading/themeRecipeMeta.ts +33 -0
  134. package/src/components/image/meta.ts +18 -3
  135. package/src/components/text/Text.tsx +16 -25
  136. package/src/components/text/meta.ts +14 -25
  137. package/src/components/text/resolveTextThemeRecipe.ts +48 -0
  138. package/src/components/text/themeRecipeMeta.ts +12 -11
  139. package/src/metadata/authoringMeta.test.ts +18 -44
  140. package/src/metadata/bindableComponentMeta.test.ts +13 -0
  141. package/src/metadata/bindableComponentMeta.ts +4 -13
  142. package/src/metadata/componentMeta.test.ts +14 -0
  143. package/src/metadata/themeRecipeMeta.test.ts +41 -39
  144. package/src/metadata/themeRecipeMeta.ts +2 -0
  145. package/src/metadata/themeRecipeTypes.ts +3 -3
  146. package/src/metadata/types.ts +11 -24
  147. package/src/patterns/panel/Panel.tsx +14 -4
  148. package/src/patterns/panel/meta.ts +15 -15
  149. package/src/patterns/panel/themeRecipeMeta.ts +1 -1
  150. package/src/patterns/panel/types.ts +2 -0
  151. package/src/theme/ZoraProvider.tsx +10 -13
  152. package/src/theme/ZoraThemeRuntimeContext.tsx +1 -3
  153. package/src/theme/ZoraThemeScope.tsx +5 -25
  154. package/src/theme/resolveZoraThemeRecipe.test.ts +72 -0
  155. package/src/theme/resolveZoraThemeRecipe.ts +91 -0
  156. package/src/theme/themeConfigScope.test.ts +25 -0
  157. package/src/theme/useZoraThemeRecipe.ts +7 -0
@@ -11,5 +11,7 @@ export interface CardProps extends ZoraBaseProps, Omit<SurfaceCardProps, 'childr
11
11
  footer?: React.ReactNode;
12
12
  tone?: ZoraCardTone;
13
13
  compact?: boolean;
14
+ padding?: string;
15
+ radius?: string;
14
16
  }
15
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,SACf,SAAQ,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE,U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E,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/card/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CardProps as SurfaceCardProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraCardTone } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface CardProps\n extends ZoraBaseProps, Omit<SurfaceCardProps, 'children' | 'p' | 'radius' | 'variant'> {\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n footer?: React.ReactNode;\n tone?: ZoraCardTone;\n compact?: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/card/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CardProps as SurfaceCardProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraCardTone } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface CardProps\n extends ZoraBaseProps, Omit<SurfaceCardProps, 'children' | 'p' | 'radius' | 'variant'> {\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n footer?: React.ReactNode;\n tone?: ZoraCardTone;\n compact?: boolean;\n padding?: string;\n radius?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAyG5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,oDAAmC,CAAC"}
1
+ {"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA6F5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,oDAAmC,CAAC"}
@@ -2,8 +2,10 @@ import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
  import { Platform, Text as ReactNativeText } from 'react-native';
4
4
  import { useZoraTheme } from '../../theme/useZoraTheme';
5
+ import { useZoraThemeRecipe } from '../../theme/useZoraThemeRecipe';
5
6
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
7
  import { resolveHeadingRecipe, resolveHeadingSizeFromLevel } from './resolveHeadingRecipe';
8
+ import { resolveHeadingThemeRecipe } from './resolveHeadingThemeRecipe';
7
9
  const headingLayoutStyle = {
8
10
  flexShrink: 1,
9
11
  maxWidth: '100%',
@@ -17,34 +19,31 @@ const headingLayoutStyle = {
17
19
  : null),
18
20
  };
19
21
  function resolveHeadingContent({ children, text, i18nKey, }) {
20
- if (children !== undefined) {
22
+ if (children !== undefined)
21
23
  return children;
22
- }
23
- if (text !== undefined) {
24
+ if (text !== undefined)
24
25
  return text;
25
- }
26
- if (!i18nKey) {
26
+ if (i18nKey === undefined || i18nKey === '')
27
27
  return null;
28
- }
29
28
  return i18nKey;
30
29
  }
31
- function HeadingInner({ themeId: _themeId, mode: _mode, children, text, i18nKey, level = 2, size, color, emphasis = 'default', align, weight, italic = false, numberOfLines, ellipsizeMode, selectable, style, accessibilityLabel, accessibilityHint, accessibilityRole, nativeID, testID, interactionPolicy: _interactionPolicy, }) {
30
+ function HeadingInner({ themeId: _themeId, mode: _mode, children, text, i18nKey, level = 2, size, color, emphasis, align, weight, italic, numberOfLines, ellipsizeMode, selectable, style, accessibilityLabel, accessibilityHint, accessibilityRole, nativeID, testID, interactionPolicy: _interactionPolicy, }) {
32
31
  const { theme } = useZoraTheme();
33
32
  const { breakpoint } = useResponsiveRuntime();
33
+ const themeRecipe = resolveHeadingThemeRecipe(useZoraThemeRecipe('Heading'));
34
34
  const content = resolveHeadingContent({ children, text, i18nKey });
35
- const resolvedSize = resolveResponsive(size, breakpoint) ?? resolveHeadingSizeFromLevel(level);
36
- const resolvedColor = resolveResponsive(color, breakpoint);
37
- const resolvedEmphasis = resolveResponsive(emphasis, breakpoint) ?? 'default';
38
- const resolvedAlign = resolveResponsive(align, breakpoint);
39
- const resolvedWeight = resolveResponsive(weight, breakpoint);
40
- if (content === null || content === undefined) {
35
+ const resolvedSize = resolveResponsive(size ?? themeRecipe.size, breakpoint) ?? resolveHeadingSizeFromLevel(level);
36
+ const resolvedColor = resolveResponsive(color ?? themeRecipe.color, breakpoint);
37
+ const resolvedEmphasis = resolveResponsive(emphasis ?? themeRecipe.emphasis, breakpoint) ?? 'default';
38
+ const resolvedAlign = resolveResponsive(align ?? themeRecipe.align, breakpoint);
39
+ const resolvedWeight = resolveResponsive(weight ?? themeRecipe.weight, breakpoint);
40
+ if (content === null)
41
41
  return null;
42
- }
43
42
  return (<ReactNativeText accessibilityHint={accessibilityHint} accessibilityLabel={accessibilityLabel} accessibilityRole={accessibilityRole ?? 'header'} ellipsizeMode={ellipsizeMode} nativeID={nativeID} numberOfLines={numberOfLines} selectable={selectable} testID={testID} style={[
44
43
  headingLayoutStyle,
45
44
  resolveHeadingRecipe(theme, {
46
45
  align: resolvedAlign,
47
- italic,
46
+ italic: italic ?? themeRecipe.italic ?? false,
48
47
  level,
49
48
  size: resolvedSize,
50
49
  color: resolvedColor,
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,eAAe,EAAkB,M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F,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';\nimport React from 'react';\nimport { Platform, Text as ReactNativeText, type TextStyle } from 'react-native';\n\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { resolveHeadingRecipe, resolveHeadingSizeFromLevel } from './resolveHeadingRecipe';\nimport type { HeadingProps } from './types';\n\nconst headingLayoutStyle = {\n flexShrink: 1,\n maxWidth: '100%',\n minWidth: 0,\n ...(Platform.OS === 'web'\n ? {\n overflowWrap: 'break-word',\n whiteSpace: 'normal',\n wordBreak: 'normal',\n }\n : null),\n} as unknown as TextStyle;\n\nfunction resolveHeadingContent({\n children,\n text,\n i18nKey,\n}: {\n children: HeadingProps['children'];\n text: HeadingProps['text'];\n i18nKey: HeadingProps['i18nKey'];\n}): React.ReactNode {\n if (children !== undefined) {\n return children;\n }\n\n if (text !== undefined) {\n return text;\n }\n\n if (!i18nKey) {\n return null;\n }\n\n return i18nKey;\n}\n\nfunction HeadingInner({\n themeId: _themeId,\n mode: _mode,\n children,\n text,\n i18nKey,\n level = 2,\n size,\n color,\n emphasis = 'default',\n align,\n weight,\n italic = false,\n numberOfLines,\n ellipsizeMode,\n selectable,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole,\n nativeID,\n testID,\n interactionPolicy: _interactionPolicy,\n}: HeadingProps) {\n const { theme } = useZoraTheme();\n const { breakpoint } = useResponsiveRuntime();\n const content = resolveHeadingContent({ children, text, i18nKey });\n const resolvedSize = resolveResponsive(size, breakpoint) ?? resolveHeadingSizeFromLevel(level);\n const resolvedColor = resolveResponsive(color, breakpoint);\n const resolvedEmphasis = resolveResponsive(emphasis, breakpoint) ?? 'default';\n const resolvedAlign = resolveResponsive(align, breakpoint);\n const resolvedWeight = resolveResponsive(weight, breakpoint);\n\n if (content === null || content === undefined) {\n return null;\n }\n\n return (\n <ReactNativeText\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole ?? 'header'}\n ellipsizeMode={ellipsizeMode}\n nativeID={nativeID}\n numberOfLines={numberOfLines}\n selectable={selectable}\n testID={testID}\n style={[\n headingLayoutStyle,\n resolveHeadingRecipe(theme, {\n align: resolvedAlign,\n italic,\n level,\n size: resolvedSize,\n color: resolvedColor,\n emphasis: resolvedEmphasis,\n weight: resolvedWeight,\n }),\n style,\n ]}\n >\n {content}\n </ReactNativeText>\n );\n}\n\n/***\n * Structured title primitive for accessible page, section, and card headings.\n *\n * `Heading` gives consumers a ZORA-owned title API with semantic levels,\n * responsive sizes, and theme-aware emphasis while preserving header semantics.\n *\n * @example Section title\n * ```tsx\n * <Heading level={2} size=\"xl\">Account settings</Heading>\n * ```\n */\nexport const Heading = withZoraThemeScope(HeadingInner);\n"]}
1
+ {"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../src/components/heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,eAAe,EAAkB,MAAM,cAAc,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGx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A,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';\nimport React from 'react';\nimport { Platform, Text as ReactNativeText, type TextStyle } from 'react-native';\n\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { useZoraThemeRecipe } from '../../theme/useZoraThemeRecipe';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { resolveHeadingRecipe, resolveHeadingSizeFromLevel } from './resolveHeadingRecipe';\nimport { resolveHeadingThemeRecipe } from './resolveHeadingThemeRecipe';\nimport type { HeadingProps } from './types';\n\nconst headingLayoutStyle = {\n flexShrink: 1,\n maxWidth: '100%',\n minWidth: 0,\n ...(Platform.OS === 'web'\n ? {\n overflowWrap: 'break-word',\n whiteSpace: 'normal',\n wordBreak: 'normal',\n }\n : null),\n} as unknown as TextStyle;\n\nfunction resolveHeadingContent({\n children,\n text,\n i18nKey,\n}: Pick<HeadingProps, 'children' | 'text' | 'i18nKey'>) {\n if (children !== undefined) return children;\n if (text !== undefined) return text;\n if (i18nKey === undefined || i18nKey === '') return null;\n return i18nKey;\n}\n\nfunction HeadingInner({\n themeId: _themeId,\n mode: _mode,\n children,\n text,\n i18nKey,\n level = 2,\n size,\n color,\n emphasis,\n align,\n weight,\n italic,\n numberOfLines,\n ellipsizeMode,\n selectable,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole,\n nativeID,\n testID,\n interactionPolicy: _interactionPolicy,\n}: HeadingProps) {\n const { theme } = useZoraTheme();\n const { breakpoint } = useResponsiveRuntime();\n const themeRecipe = resolveHeadingThemeRecipe(useZoraThemeRecipe('Heading'));\n const content = resolveHeadingContent({ children, text, i18nKey });\n const resolvedSize =\n resolveResponsive(size ?? themeRecipe.size, breakpoint) ?? resolveHeadingSizeFromLevel(level);\n const resolvedColor = resolveResponsive(color ?? themeRecipe.color, breakpoint);\n const resolvedEmphasis =\n resolveResponsive(emphasis ?? themeRecipe.emphasis, breakpoint) ?? 'default';\n const resolvedAlign = resolveResponsive(align ?? themeRecipe.align, breakpoint);\n const resolvedWeight = resolveResponsive(weight ?? themeRecipe.weight, breakpoint);\n\n if (content === null) return null;\n\n return (\n <ReactNativeText\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole ?? 'header'}\n ellipsizeMode={ellipsizeMode}\n nativeID={nativeID}\n numberOfLines={numberOfLines}\n selectable={selectable}\n testID={testID}\n style={[\n headingLayoutStyle,\n resolveHeadingRecipe(theme, {\n align: resolvedAlign,\n italic: italic ?? themeRecipe.italic ?? false,\n level,\n size: resolvedSize,\n color: resolvedColor,\n emphasis: resolvedEmphasis,\n weight: resolvedWeight,\n }),\n style,\n ]}\n >\n {content}\n </ReactNativeText>\n );\n}\n\n/***\n * Structured title primitive for accessible page, section, and card headings.\n *\n * `Heading` gives consumers a ZORA-owned title API with semantic levels,\n * responsive sizes, and theme-aware emphasis while preserving header semantics.\n *\n * @example Section title\n * ```tsx\n * <Heading level={2} size=\"xl\">Account settings</Heading>\n * ```\n */\nexport const Heading = withZoraThemeScope(HeadingInner);\n"]}
@@ -52,6 +52,7 @@ export declare const headingMeta: {
52
52
  readonly authoring: {
53
53
  readonly authority: "theme";
54
54
  readonly scope: "component";
55
+ readonly allowInstanceOverride: true;
55
56
  };
56
57
  };
57
58
  readonly color: {
@@ -62,6 +63,7 @@ export declare const headingMeta: {
62
63
  readonly authoring: {
63
64
  readonly authority: "theme";
64
65
  readonly scope: "component";
66
+ readonly allowInstanceOverride: true;
65
67
  };
66
68
  };
67
69
  readonly emphasis: {
@@ -72,6 +74,7 @@ export declare const headingMeta: {
72
74
  readonly authoring: {
73
75
  readonly authority: "theme";
74
76
  readonly scope: "component";
77
+ readonly allowInstanceOverride: true;
75
78
  };
76
79
  };
77
80
  readonly align: {
@@ -82,6 +85,7 @@ export declare const headingMeta: {
82
85
  readonly authoring: {
83
86
  readonly authority: "theme";
84
87
  readonly scope: "component";
88
+ readonly allowInstanceOverride: true;
85
89
  };
86
90
  };
87
91
  readonly weight: {
@@ -92,16 +96,17 @@ export declare const headingMeta: {
92
96
  readonly authoring: {
93
97
  readonly authority: "theme";
94
98
  readonly scope: "component";
99
+ readonly allowInstanceOverride: true;
95
100
  };
96
101
  };
97
102
  readonly italic: {
98
103
  readonly type: "boolean";
99
104
  readonly category: "Typography";
100
105
  readonly label: "Italic";
101
- readonly default: false;
102
106
  readonly authoring: {
103
107
  readonly authority: "theme";
104
108
  readonly scope: "component";
109
+ readonly allowInstanceOverride: true;
105
110
  };
106
111
  };
107
112
  readonly numberOfLines: {
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/heading/meta.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFc,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/heading/meta.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEc,CAAC"}
@@ -1,19 +1,16 @@
1
1
  import { ZORA_COLORS, ZORA_EMPHASES } from '../../internal/colorModel';
2
+ const themeAuthoring = {
3
+ authority: 'theme',
4
+ scope: 'component',
5
+ allowInstanceOverride: true,
6
+ };
2
7
  export const headingMeta = {
3
8
  name: 'Heading',
4
9
  category: 'component',
5
10
  directManifestNode: true,
6
11
  allowedChildren: [],
7
- blueprint: {
8
- label: 'Heading',
9
- defaultProps: {
10
- text: 'Heading',
11
- level: 2,
12
- },
13
- },
14
- i18n: {
15
- fields: [{ keyProp: 'i18nKey', defaultTextProp: 'text' }],
16
- },
12
+ blueprint: { label: 'Heading', defaultProps: { text: 'Heading', level: 2 } },
13
+ i18n: { fields: [{ keyProp: 'i18nKey', defaultTextProp: 'text' }] },
17
14
  props: {
18
15
  text: {
19
16
  type: 'string',
@@ -41,43 +38,37 @@ export const headingMeta = {
41
38
  category: 'Typography',
42
39
  label: 'Size',
43
40
  enum: ['display', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
44
- authoring: { authority: 'theme', scope: 'component' },
41
+ authoring: themeAuthoring,
45
42
  },
46
43
  color: {
47
44
  type: 'enum',
48
45
  category: 'Style',
49
46
  label: 'Color',
50
47
  enum: ZORA_COLORS,
51
- authoring: { authority: 'theme', scope: 'component' },
48
+ authoring: themeAuthoring,
52
49
  },
53
50
  emphasis: {
54
51
  type: 'enum',
55
52
  category: 'Style',
56
53
  label: 'Emphasis',
57
54
  enum: ZORA_EMPHASES,
58
- authoring: { authority: 'theme', scope: 'component' },
55
+ authoring: themeAuthoring,
59
56
  },
60
57
  align: {
61
58
  type: 'enum',
62
59
  category: 'Layout',
63
60
  label: 'Align',
64
61
  enum: ['auto', 'left', 'right', 'center', 'justify'],
65
- authoring: { authority: 'theme', scope: 'component' },
62
+ authoring: themeAuthoring,
66
63
  },
67
64
  weight: {
68
65
  type: 'enum',
69
66
  category: 'Typography',
70
67
  label: 'Weight',
71
68
  enum: ['regular', 'medium', 'semiBold', 'bold'],
72
- authoring: { authority: 'theme', scope: 'component' },
73
- },
74
- italic: {
75
- type: 'boolean',
76
- category: 'Typography',
77
- label: 'Italic',
78
- default: false,
79
- authoring: { authority: 'theme', scope: 'component' },
69
+ authoring: themeAuthoring,
80
70
  },
71
+ italic: { type: 'boolean', category: 'Typography', label: 'Italic', authoring: themeAuthoring },
81
72
  numberOfLines: {
82
73
  type: 'number',
83
74
  category: 'Layout',
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/heading/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC;SACT;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC;KAC1D;IACD,KAAK,EAAE;QACL,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACxB,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,CA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QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,YAAY;YACnB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import { ZORA_COLORS, ZORA_EMPHASES } from '../../internal/colorModel';\nimport type { ZoraComponentMeta } from '../../metadata';\n\nexport const headingMeta = {\n name: 'Heading',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Heading',\n defaultProps: {\n text: 'Heading',\n level: 2,\n },\n },\n i18n: {\n fields: [{ keyProp: 'i18nKey', defaultTextProp: 'text' }],\n },\n props: {\n text: {\n type: 'string',\n category: 'Content',\n label: 'Text',\n default: 'Heading',\n authoring: { authority: 'instance' },\n },\n i18nKey: {\n type: 'string',\n category: 'Content',\n label: 'i18n key',\n authoring: { authority: 'instance' },\n },\n level: {\n type: 'enum',\n category: 'Semantics',\n label: 'Level',\n enum: [1, 2, 3, 4, 5, 6],\n default: 2,\n authoring: { authority: 'instance' },\n },\n size: {\n type: 'enum',\n category: 'Typography',\n label: 'Size',\n enum: ['display', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n authoring: { authority: 'theme', scope: 'component' },\n },\n color: {\n type: 'enum',\n category: 'Style',\n label: 'Color',\n enum: ZORA_COLORS,\n authoring: { authority: 'theme', scope: 'component' },\n },\n emphasis: {\n type: 'enum',\n category: 'Style',\n label: 'Emphasis',\n enum: ZORA_EMPHASES,\n authoring: { authority: 'theme', scope: 'component' },\n },\n align: {\n type: 'enum',\n category: 'Layout',\n label: 'Align',\n enum: ['auto', 'left', 'right', 'center', 'justify'],\n authoring: { authority: 'theme', scope: 'component' },\n },\n weight: {\n type: 'enum',\n category: 'Typography',\n label: 'Weight',\n enum: ['regular', 'medium', 'semiBold', 'bold'],\n authoring: { authority: 'theme', scope: 'component' },\n },\n italic: {\n type: 'boolean',\n category: 'Typography',\n label: 'Italic',\n default: false,\n authoring: { authority: 'theme', scope: 'component' },\n },\n numberOfLines: {\n type: 'number',\n category: 'Layout',\n label: 'Line clamp',\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/heading/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,cAAc,GAAG;IACrB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,WAAW;IAClB,qBAAqB,EAAE,IAAI;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC5E,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,EAAE;IACnE,KAAK,EAAE;QACL,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,WAAW;YACrB,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAA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AE,YAAY;YACnB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import { ZORA_COLORS, ZORA_EMPHASES } from '../../internal/colorModel';\nimport type { ZoraComponentMeta } from '../../metadata';\n\nconst themeAuthoring = {\n authority: 'theme',\n scope: 'component',\n allowInstanceOverride: true,\n} as const;\n\nexport const headingMeta = {\n name: 'Heading',\n category: 'component',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Heading', defaultProps: { text: 'Heading', level: 2 } },\n i18n: { fields: [{ keyProp: 'i18nKey', defaultTextProp: 'text' }] },\n props: {\n text: {\n type: 'string',\n category: 'Content',\n label: 'Text',\n default: 'Heading',\n authoring: { authority: 'instance' },\n },\n i18nKey: {\n type: 'string',\n category: 'Content',\n label: 'i18n key',\n authoring: { authority: 'instance' },\n },\n level: {\n type: 'enum',\n category: 'Semantics',\n label: 'Level',\n enum: [1, 2, 3, 4, 5, 6],\n default: 2,\n authoring: { authority: 'instance' },\n },\n size: {\n type: 'enum',\n category: 'Typography',\n label: 'Size',\n enum: ['display', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n authoring: themeAuthoring,\n },\n color: {\n type: 'enum',\n category: 'Style',\n label: 'Color',\n enum: ZORA_COLORS,\n authoring: themeAuthoring,\n },\n emphasis: {\n type: 'enum',\n category: 'Style',\n label: 'Emphasis',\n enum: ZORA_EMPHASES,\n authoring: themeAuthoring,\n },\n align: {\n type: 'enum',\n category: 'Layout',\n label: 'Align',\n enum: ['auto', 'left', 'right', 'center', 'justify'],\n authoring: themeAuthoring,\n },\n weight: {\n type: 'enum',\n category: 'Typography',\n label: 'Weight',\n enum: ['regular', 'medium', 'semiBold', 'bold'],\n authoring: themeAuthoring,\n },\n italic: { type: 'boolean', category: 'Typography', label: 'Italic', authoring: themeAuthoring },\n numberOfLines: {\n type: 'number',\n category: 'Layout',\n label: 'Line clamp',\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
@@ -0,0 +1,11 @@
1
+ import type { ThemeRecipeOverrideValue } from '@ankhorage/contracts';
2
+ import type { HeadingAlign, HeadingSize, HeadingWeight } from './types';
3
+ export declare function resolveHeadingThemeRecipe(fields: Readonly<Record<string, ThemeRecipeOverrideValue>>): {
4
+ size: HeadingSize | undefined;
5
+ color: "primary" | "secondary" | "tertiary" | "quaternary" | "neutral" | "success" | "warning" | "error" | "info" | "danger" | undefined;
6
+ emphasis: "default" | "muted" | "subtle" | "inverse" | undefined;
7
+ align: HeadingAlign | undefined;
8
+ weight: HeadingWeight | undefined;
9
+ italic: boolean | undefined;
10
+ };
11
+ //# sourceMappingURL=resolveHeadingThemeRecipe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveHeadingThemeRecipe.d.ts","sourceRoot":"","sources":["../../../src/components/heading/resolveHeadingThemeRecipe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,KAAK,EACV,YAAY,EAGZ,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;;;;;;;EAU3D"}
@@ -0,0 +1,46 @@
1
+ export function resolveHeadingThemeRecipe(fields) {
2
+ return {
3
+ size: readSize(fields.size),
4
+ color: readColor(fields.color),
5
+ emphasis: readEmphasis(fields.emphasis),
6
+ align: readAlign(fields.align),
7
+ weight: readWeight(fields.weight),
8
+ italic: typeof fields.italic === 'boolean' ? fields.italic : undefined,
9
+ };
10
+ }
11
+ function readSize(value) {
12
+ if (value === 'display' || value === 'h1' || value === 'h2' || value === 'h3')
13
+ return value;
14
+ if (value === 'h4' || value === 'h5' || value === 'h6')
15
+ return value;
16
+ return undefined;
17
+ }
18
+ function readColor(value) {
19
+ if (typeof value !== 'string')
20
+ return undefined;
21
+ if (value === 'primary' || value === 'secondary' || value === 'tertiary')
22
+ return value;
23
+ if (value === 'quaternary' || value === 'neutral' || value === 'danger')
24
+ return value;
25
+ if (value === 'success' || value === 'warning' || value === 'error' || value === 'info')
26
+ return value;
27
+ return undefined;
28
+ }
29
+ function readEmphasis(value) {
30
+ if (value === 'default' || value === 'muted' || value === 'subtle' || value === 'inverse')
31
+ return value;
32
+ return undefined;
33
+ }
34
+ function readAlign(value) {
35
+ if (value === 'auto' || value === 'left' || value === 'right')
36
+ return value;
37
+ if (value === 'center' || value === 'justify')
38
+ return value;
39
+ return undefined;
40
+ }
41
+ function readWeight(value) {
42
+ if (value === 'regular' || value === 'medium' || value === 'semiBold' || value === 'bold')
43
+ return value;
44
+ return undefined;
45
+ }
46
+ //# sourceMappingURL=resolveHeadingThemeRecipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveHeadingThemeRecipe.js","sourceRoot":"","sources":["../../../src/components/heading/resolveHeadingThemeRecipe.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,yBAAyB,CACvC,MAA0D;IAE1D,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QAC3B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;QAC9B,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;QAC9B,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;QACjC,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KACvE,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAA2C;IAC3D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IA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ACf,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { ThemeRecipeOverrideValue } from '@ankhorage/contracts';\n\nimport type {\n HeadingAlign,\n HeadingColor,\n HeadingEmphasis,\n HeadingSize,\n HeadingWeight,\n} from './types';\n\nexport function resolveHeadingThemeRecipe(\n fields: Readonly<Record<string, ThemeRecipeOverrideValue>>,\n) {\n return {\n size: readSize(fields.size),\n color: readColor(fields.color),\n emphasis: readEmphasis(fields.emphasis),\n align: readAlign(fields.align),\n weight: readWeight(fields.weight),\n italic: typeof fields.italic === 'boolean' ? fields.italic : undefined,\n };\n}\n\nfunction readSize(value: ThemeRecipeOverrideValue | undefined): HeadingSize | undefined {\n if (value === 'display' || value === 'h1' || value === 'h2' || value === 'h3') return value;\n if (value === 'h4' || value === 'h5' || value === 'h6') return value;\n return undefined;\n}\n\nfunction readColor(value: ThemeRecipeOverrideValue | undefined): HeadingColor | undefined {\n if (typeof value !== 'string') return undefined;\n if (value === 'primary' || value === 'secondary' || value === 'tertiary') return value;\n if (value === 'quaternary' || value === 'neutral' || value === 'danger') return value;\n if (value === 'success' || value === 'warning' || value === 'error' || value === 'info')\n return value;\n return undefined;\n}\n\nfunction readEmphasis(value: ThemeRecipeOverrideValue | undefined): HeadingEmphasis | undefined {\n if (value === 'default' || value === 'muted' || value === 'subtle' || value === 'inverse')\n return value;\n return undefined;\n}\n\nfunction readAlign(value: ThemeRecipeOverrideValue | undefined): HeadingAlign | undefined {\n if (value === 'auto' || value === 'left' || value === 'right') return value;\n if (value === 'center' || value === 'justify') return value;\n return undefined;\n}\n\nfunction readWeight(value: ThemeRecipeOverrideValue | undefined): HeadingWeight | undefined {\n if (value === 'regular' || value === 'medium' || value === 'semiBold' || value === 'bold')\n return value;\n return undefined;\n}\n"]}
@@ -0,0 +1,39 @@
1
+ export declare const headingThemeRecipeMeta: {
2
+ readonly name: "Heading";
3
+ readonly kind: "component";
4
+ readonly description: "Maps Heading presentation defaults without replacing semantic heading levels.";
5
+ readonly fields: {
6
+ readonly size: {
7
+ readonly type: "choice";
8
+ readonly label: "Size";
9
+ readonly options: readonly ["display", "h1", "h2", "h3", "h4", "h5", "h6"];
10
+ };
11
+ readonly color: {
12
+ readonly type: "choice";
13
+ readonly label: "Color";
14
+ readonly options: readonly ["primary", "secondary", "tertiary", "quaternary", "neutral", "success", "warning", "error", "info", "danger"];
15
+ };
16
+ readonly emphasis: {
17
+ readonly type: "choice";
18
+ readonly label: "Emphasis";
19
+ readonly options: readonly ["default", "muted", "subtle", "inverse"];
20
+ readonly default: "default";
21
+ };
22
+ readonly align: {
23
+ readonly type: "choice";
24
+ readonly label: "Align";
25
+ readonly options: readonly ["auto", "left", "right", "center", "justify"];
26
+ };
27
+ readonly weight: {
28
+ readonly type: "choice";
29
+ readonly label: "Weight";
30
+ readonly options: readonly ["regular", "medium", "semiBold", "bold"];
31
+ };
32
+ readonly italic: {
33
+ readonly type: "boolean";
34
+ readonly label: "Italic";
35
+ readonly default: false;
36
+ };
37
+ };
38
+ };
39
+ //# sourceMappingURL=themeRecipeMeta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeRecipeMeta.d.ts","sourceRoot":"","sources":["../../../src/components/heading/themeRecipeMeta.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BK,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ZORA_COLORS, ZORA_EMPHASES } from '../../internal/colorModel';
2
+ export const headingThemeRecipeMeta = {
3
+ name: 'Heading',
4
+ kind: 'component',
5
+ description: 'Maps Heading presentation defaults without replacing semantic heading levels.',
6
+ fields: {
7
+ size: {
8
+ type: 'choice',
9
+ label: 'Size',
10
+ options: ['display', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
11
+ },
12
+ color: { type: 'choice', label: 'Color', options: ZORA_COLORS },
13
+ emphasis: {
14
+ type: 'choice',
15
+ label: 'Emphasis',
16
+ options: ZORA_EMPHASES,
17
+ default: 'default',
18
+ },
19
+ align: {
20
+ type: 'choice',
21
+ label: 'Align',
22
+ options: ['auto', 'left', 'right', 'center', 'justify'],
23
+ },
24
+ weight: {
25
+ type: 'choice',
26
+ label: 'Weight',
27
+ options: ['regular', 'medium', 'semiBold', 'bold'],
28
+ },
29
+ italic: { type: 'boolean', label: 'Italic', default: false },
30
+ },
31
+ };
32
+ //# sourceMappingURL=themeRecipeMeta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeRecipeMeta.js","sourceRoot":"","sources":["../../../src/components/heading/themeRecipeMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGvE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,+EAA+E;IAC5F,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;SACzD;QACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE;QAC/D,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,SAAS;SACnB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC;SACxD;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC;SACnD;QACD,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;KAC7D;CACqC,CAAC","sourcesContent":["import { ZORA_COLORS, ZORA_EMPHASES } from '../../internal/colorModel';\nimport type { ZoraThemeRecipeMeta } from '../../metadata/themeRecipeTypes';\n\nexport const headingThemeRecipeMeta = {\n name: 'Heading',\n kind: 'component',\n description: 'Maps Heading presentation defaults without replacing semantic heading levels.',\n fields: {\n size: {\n type: 'choice',\n label: 'Size',\n options: ['display', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n },\n color: { type: 'choice', label: 'Color', options: ZORA_COLORS },\n emphasis: {\n type: 'choice',\n label: 'Emphasis',\n options: ZORA_EMPHASES,\n default: 'default',\n },\n align: {\n type: 'choice',\n label: 'Align',\n options: ['auto', 'left', 'right', 'center', 'justify'],\n },\n weight: {\n type: 'choice',\n label: 'Weight',\n options: ['regular', 'medium', 'semiBold', 'bold'],\n },\n italic: { type: 'boolean', label: 'Italic', default: false },\n },\n} as const satisfies ZoraThemeRecipeMeta;\n"]}
@@ -1,9 +1,30 @@
1
1
  export declare const imageMeta: {
2
2
  readonly name: "Image";
3
3
  readonly category: "component";
4
- readonly directManifestNode: false;
4
+ readonly description: "Displays an image from the app media registry or a resolved runtime source.";
5
+ readonly directManifestNode: true;
5
6
  readonly allowedChildren: readonly [];
6
- readonly note: "Media component; not represented as a manifest node in v1.";
7
- readonly props: {};
7
+ readonly blueprint: {
8
+ readonly label: "Image";
9
+ };
10
+ readonly props: {
11
+ readonly source: {
12
+ readonly type: "media";
13
+ readonly category: "Content";
14
+ readonly label: "Source";
15
+ readonly mediaKinds: readonly ["image"];
16
+ readonly authoring: {
17
+ readonly authority: "instance";
18
+ };
19
+ };
20
+ readonly alt: {
21
+ readonly type: "string";
22
+ readonly category: "Accessibility";
23
+ readonly label: "Alt text";
24
+ readonly authoring: {
25
+ readonly authority: "instance";
26
+ };
27
+ };
28
+ };
8
29
  };
9
30
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/image/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;CAOgB,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/image/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBgB,CAAC"}
@@ -1,9 +1,24 @@
1
1
  export const imageMeta = {
2
2
  name: 'Image',
3
3
  category: 'component',
4
- directManifestNode: false,
4
+ description: 'Displays an image from the app media registry or a resolved runtime source.',
5
+ directManifestNode: true,
5
6
  allowedChildren: [],
6
- note: 'Media component; not represented as a manifest node in v1.',
7
- props: {},
7
+ blueprint: { label: 'Image' },
8
+ props: {
9
+ source: {
10
+ type: 'media',
11
+ category: 'Content',
12
+ label: 'Source',
13
+ mediaKinds: ['image'],
14
+ authoring: { authority: 'instance' },
15
+ },
16
+ alt: {
17
+ type: 'string',
18
+ category: 'Accessibility',
19
+ label: 'Alt text',
20
+ authoring: { authority: 'instance' },
21
+ },
22
+ },
8
23
  };
9
24
  //# sourceMappingURL=meta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/image/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,4DAA4D;IAClE,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const imageMeta = {\n name: 'Image',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Media component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/image/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,6EAA6E;IAC1F,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7B,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,QAAQ;YACf,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const imageMeta = {\n name: 'Image',\n category: 'component',\n description: 'Displays an image from the app media registry or a resolved runtime source.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Image' },\n props: {\n source: {\n type: 'media',\n category: 'Content',\n label: 'Source',\n mediaKinds: ['image'],\n authoring: { authority: 'instance' },\n },\n alt: {\n type: 'string',\n category: 'Accessibility',\n label: 'Alt text',\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
@@ -6,7 +6,6 @@ import type { TextProps } from './types';
6
6
  * `Text` owns normal body, caption, label, code, and supporting-copy variants so
7
7
  * consumers do not need to import lower-level Surface typography directly.
8
8
  *
9
-
10
9
  * @example Muted supporting copy
11
10
  * ```tsx
12
11
  * <Text variant="bodySmall" emphasis="muted">Updated just now</Text>
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAkGzC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAwFzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
@@ -2,8 +2,10 @@ import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
  import { Platform, Text as ReactNativeText } from 'react-native';
4
4
  import { useZoraTheme } from '../../theme/useZoraTheme';
5
+ import { useZoraThemeRecipe } from '../../theme/useZoraThemeRecipe';
5
6
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
7
  import { resolveTextStyle } from './resolveTextRecipe';
8
+ import { resolveTextThemeRecipe } from './resolveTextThemeRecipe';
7
9
  const textLayoutStyle = {
8
10
  flexShrink: 1,
9
11
  maxWidth: '100%',
@@ -17,35 +19,32 @@ const textLayoutStyle = {
17
19
  : null),
18
20
  };
19
21
  function resolveTextContent({ children, text, i18nKey, }) {
20
- if (children !== undefined) {
22
+ if (children !== undefined)
21
23
  return children;
22
- }
23
- if (text !== undefined) {
24
+ if (text !== undefined)
24
25
  return text;
25
- }
26
- if (!i18nKey) {
26
+ if (i18nKey === undefined || i18nKey === '')
27
27
  return null;
28
- }
29
28
  return i18nKey;
30
29
  }
31
- function TextInner({ themeId: _themeId, mode: _mode, children, text, i18nKey, variant = 'body', color, emphasis = 'default', align, weight, italic = false, numberOfLines, ellipsizeMode, selectable, style, accessibilityLabel, accessibilityHint, accessibilityRole, nativeID, testID, interactionPolicy: _interactionPolicy, }) {
30
+ function TextInner({ themeId: _themeId, mode: _mode, children, text, i18nKey, variant, color, emphasis, align, weight, italic, numberOfLines, ellipsizeMode, selectable, style, accessibilityLabel, accessibilityHint, accessibilityRole, nativeID, testID, interactionPolicy: _interactionPolicy, }) {
32
31
  const { theme } = useZoraTheme();
33
32
  const { breakpoint } = useResponsiveRuntime();
33
+ const themeRecipe = resolveTextThemeRecipe(useZoraThemeRecipe('Text'));
34
34
  const content = resolveTextContent({ children, text, i18nKey });
35
- const resolvedVariant = resolveResponsive(variant, breakpoint) ?? 'body';
35
+ const resolvedVariant = resolveResponsive(variant ?? themeRecipe.variant, breakpoint) ?? 'body';
36
36
  const resolvedStyle = resolveTextStyle({
37
37
  theme,
38
38
  breakpoint,
39
39
  variant: resolvedVariant,
40
- color,
41
- emphasis,
42
- align,
43
- weight,
44
- italic,
40
+ color: color ?? themeRecipe.color,
41
+ emphasis: emphasis ?? themeRecipe.emphasis,
42
+ align: align ?? themeRecipe.align,
43
+ weight: weight ?? themeRecipe.weight,
44
+ italic: italic ?? themeRecipe.italic ?? false,
45
45
  });
46
- if (content === null || content === undefined) {
46
+ if (content === null || content === undefined)
47
47
  return null;
48
- }
49
48
  return (<ReactNativeText accessibilityHint={accessibilityHint} accessibilityLabel={accessibilityLabel} accessibilityRole={accessibilityRole} ellipsizeMode={ellipsizeMode} nativeID={nativeID} numberOfLines={numberOfLines} selectable={selectable} testID={testID} style={[textLayoutStyle, resolvedStyle, style]}>
50
49
  {content}
51
50
  </ReactNativeText>);
@@ -56,7 +55,6 @@ function TextInner({ themeId: _themeId, mode: _mode, children, text, i18nKey, va
56
55
  * `Text` owns normal body, caption, label, code, and supporting-copy variants so
57
56
  * consumers do not need to import lower-level Surface typography directly.
58
57
  *
59
-
60
58
  * @example Muted supporting copy
61
59
  * ```tsx
62
60
  * <Text variant="bodySmall" emphasis="muted">Updated just now</Text>