@ankhorage/zora 0.8.1 → 0.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +91 -59
  3. package/dist/components/button/Button.d.ts +1 -1
  4. package/dist/components/button/Button.d.ts.map +1 -1
  5. package/dist/components/button/Button.js +3 -1
  6. package/dist/components/button/Button.js.map +1 -1
  7. package/dist/components/button/types.d.ts +2 -1
  8. package/dist/components/button/types.d.ts.map +1 -1
  9. package/dist/components/button/types.js.map +1 -1
  10. package/dist/components/card/Card.d.ts +1 -1
  11. package/dist/components/card/Card.d.ts.map +1 -1
  12. package/dist/components/card/Card.js +3 -1
  13. package/dist/components/card/Card.js.map +1 -1
  14. package/dist/components/card/types.d.ts +2 -1
  15. package/dist/components/card/types.d.ts.map +1 -1
  16. package/dist/components/card/types.js.map +1 -1
  17. package/dist/components/heading/Heading.d.ts +1 -1
  18. package/dist/components/heading/Heading.d.ts.map +1 -1
  19. package/dist/components/heading/Heading.js +3 -1
  20. package/dist/components/heading/Heading.js.map +1 -1
  21. package/dist/components/heading/types.d.ts +2 -2
  22. package/dist/components/heading/types.d.ts.map +1 -1
  23. package/dist/components/heading/types.js.map +1 -1
  24. package/dist/components/icon/Icon.d.ts +4 -2
  25. package/dist/components/icon/Icon.d.ts.map +1 -1
  26. package/dist/components/icon/Icon.js +3 -1
  27. package/dist/components/icon/Icon.js.map +1 -1
  28. package/dist/components/icon-button/IconButton.d.ts +1 -1
  29. package/dist/components/icon-button/IconButton.d.ts.map +1 -1
  30. package/dist/components/icon-button/IconButton.js +3 -1
  31. package/dist/components/icon-button/IconButton.js.map +1 -1
  32. package/dist/components/icon-button/types.d.ts +2 -1
  33. package/dist/components/icon-button/types.d.ts.map +1 -1
  34. package/dist/components/icon-button/types.js.map +1 -1
  35. package/dist/components/text/Text.d.ts +1 -1
  36. package/dist/components/text/Text.d.ts.map +1 -1
  37. package/dist/components/text/Text.js +3 -1
  38. package/dist/components/text/Text.js.map +1 -1
  39. package/dist/components/text/types.d.ts +2 -2
  40. package/dist/components/text/types.d.ts.map +1 -1
  41. package/dist/components/text/types.js.map +1 -1
  42. package/dist/patterns/panel/Panel.d.ts +1 -1
  43. package/dist/patterns/panel/Panel.d.ts.map +1 -1
  44. package/dist/patterns/panel/Panel.js +3 -1
  45. package/dist/patterns/panel/Panel.js.map +1 -1
  46. package/dist/patterns/panel/types.d.ts +2 -2
  47. package/dist/patterns/panel/types.d.ts.map +1 -1
  48. package/dist/patterns/panel/types.js.map +1 -1
  49. package/dist/theme/ZoraBaseProps.d.ts +18 -0
  50. package/dist/theme/ZoraBaseProps.d.ts.map +1 -0
  51. package/dist/theme/ZoraBaseProps.js +2 -0
  52. package/dist/theme/ZoraBaseProps.js.map +1 -0
  53. package/dist/theme/ZoraProvider.d.ts +4 -4
  54. package/dist/theme/ZoraProvider.d.ts.map +1 -1
  55. package/dist/theme/ZoraProvider.js +11 -6
  56. package/dist/theme/ZoraProvider.js.map +1 -1
  57. package/dist/theme/ZoraThemeRuntimeContext.d.ts +9 -0
  58. package/dist/theme/ZoraThemeRuntimeContext.d.ts.map +1 -0
  59. package/dist/theme/ZoraThemeRuntimeContext.js +10 -0
  60. package/dist/theme/ZoraThemeRuntimeContext.js.map +1 -0
  61. package/dist/theme/ZoraThemeScope.d.ts +9 -0
  62. package/dist/theme/ZoraThemeScope.d.ts.map +1 -0
  63. package/dist/theme/ZoraThemeScope.js +41 -0
  64. package/dist/theme/ZoraThemeScope.js.map +1 -0
  65. package/dist/theme/createZoraThemeConfig.d.ts +4 -0
  66. package/dist/theme/createZoraThemeConfig.d.ts.map +1 -0
  67. package/dist/theme/createZoraThemeConfig.js +23 -0
  68. package/dist/theme/createZoraThemeConfig.js.map +1 -0
  69. package/dist/theme/index.d.ts +7 -3
  70. package/dist/theme/index.d.ts.map +1 -1
  71. package/dist/theme/index.js +4 -2
  72. package/dist/theme/index.js.map +1 -1
  73. package/dist/theme/resolveZoraScopedThemeId.d.ts +6 -0
  74. package/dist/theme/resolveZoraScopedThemeId.d.ts.map +1 -0
  75. package/dist/theme/resolveZoraScopedThemeId.js +15 -0
  76. package/dist/theme/resolveZoraScopedThemeId.js.map +1 -0
  77. package/dist/theme/types.d.ts +21 -0
  78. package/dist/theme/types.d.ts.map +1 -0
  79. package/dist/theme/types.js +2 -0
  80. package/dist/theme/types.js.map +1 -0
  81. package/dist/theme/withZoraThemeScope.d.ts +4 -0
  82. package/dist/theme/withZoraThemeScope.d.ts.map +1 -0
  83. package/dist/theme/withZoraThemeScope.js +16 -0
  84. package/dist/theme/withZoraThemeScope.js.map +1 -0
  85. package/dist/theme/zoraDefaultTheme.d.ts +3 -0
  86. package/dist/theme/zoraDefaultTheme.d.ts.map +1 -0
  87. package/dist/theme/zoraDefaultTheme.js +8 -0
  88. package/dist/theme/zoraDefaultTheme.js.map +1 -0
  89. package/package.json +1 -1
  90. package/src/components/button/Button.tsx +11 -1
  91. package/src/components/button/types.ts +3 -4
  92. package/src/components/card/Card.tsx +6 -1
  93. package/src/components/card/types.ts +3 -1
  94. package/src/components/heading/Heading.tsx +6 -1
  95. package/src/components/heading/types.ts +3 -2
  96. package/src/components/icon/Icon.tsx +7 -2
  97. package/src/components/icon-button/IconButton.tsx +6 -1
  98. package/src/components/icon-button/types.ts +2 -1
  99. package/src/components/text/Text.tsx +6 -1
  100. package/src/components/text/types.ts +3 -2
  101. package/src/patterns/panel/Panel.tsx +4 -1
  102. package/src/patterns/panel/types.ts +2 -2
  103. package/src/theme/ZoraBaseProps.ts +20 -0
  104. package/src/theme/ZoraProvider.tsx +15 -8
  105. package/src/theme/ZoraThemeRuntimeContext.tsx +18 -0
  106. package/src/theme/ZoraThemeScope.tsx +74 -0
  107. package/src/theme/createZoraThemeConfig.test.ts +36 -0
  108. package/src/theme/createZoraThemeConfig.ts +27 -0
  109. package/src/theme/index.ts +15 -3
  110. package/src/theme/resolveZoraScopedThemeId.test.ts +47 -0
  111. package/src/theme/resolveZoraScopedThemeId.ts +25 -0
  112. package/src/theme/themeScopeStructure.test.ts +99 -0
  113. package/src/theme/types.ts +33 -0
  114. package/src/theme/withZoraThemeScope.tsx +25 -0
  115. package/src/theme/zoraDefaultTheme.ts +9 -0
  116. package/dist/internal/deepMerge.d.ts +0 -2
  117. package/dist/internal/deepMerge.d.ts.map +0 -1
  118. package/dist/internal/deepMerge.js +0 -20
  119. package/dist/internal/deepMerge.js.map +0 -1
  120. package/dist/theme/createZoraTheme.d.ts +0 -4
  121. package/dist/theme/createZoraTheme.d.ts.map +0 -1
  122. package/dist/theme/createZoraTheme.js +0 -6
  123. package/dist/theme/createZoraTheme.js.map +0 -1
  124. package/dist/theme/zoraTheme.d.ts +0 -3
  125. package/dist/theme/zoraTheme.d.ts.map +0 -1
  126. package/dist/theme/zoraTheme.js +0 -15
  127. package/dist/theme/zoraTheme.js.map +0 -1
  128. package/src/internal/deepMerge.ts +0 -23
  129. package/src/theme/createZoraTheme.test.ts +0 -25
  130. package/src/theme/createZoraTheme.ts +0 -10
  131. package/src/theme/zoraTheme.ts +0 -16
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA0BzC,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,OAAgB,EAChB,IAAgB,EAChB,KAAK,EACL,MAAM,EACN,MAAc,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,MAAM,GACP,EAAE,SAAS,4BAkCX"}
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;AAiFzC,eAAO,MAAM,IAAI,qBAAgC,CAAC"}
@@ -2,6 +2,7 @@ import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
  import { Text as ReactNativeText } from 'react-native';
4
4
  import { useZoraTheme } from '../../theme/useZoraTheme';
5
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
5
6
  import { resolveTextStyle } from './resolveTextRecipe';
6
7
  function resolveTextContent({ children, text, i18nKey, }) {
7
8
  if (children !== undefined) {
@@ -15,7 +16,7 @@ function resolveTextContent({ children, text, i18nKey, }) {
15
16
  }
16
17
  return i18nKey;
17
18
  }
18
- export function Text({ children, text, i18nKey, variant = 'body', tone = 'default', align, weight, italic = false, numberOfLines, ellipsizeMode, selectable, accessibilityLabel, accessibilityHint, accessibilityRole, nativeID, testID, }) {
19
+ function TextInner({ themeId: _themeId, mode: _mode, children, text, i18nKey, variant = 'body', tone = 'default', align, weight, italic = false, numberOfLines, ellipsizeMode, selectable, accessibilityLabel, accessibilityHint, accessibilityRole, nativeID, testID, }) {
19
20
  const { theme } = useZoraTheme();
20
21
  const { breakpoint } = useResponsiveRuntime();
21
22
  const content = resolveTextContent({ children, text, i18nKey });
@@ -36,4 +37,5 @@ export function Text({ children, text, i18nKey, variant = 'body', tone = 'defaul
36
37
  {content}
37
38
  </ReactNativeText>);
38
39
  }
40
+ export const Text = withZoraThemeScope(TextInner);
39
41
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,SAAS,kBAAkB,CAAC,EAC1B,QAAQ,EACR,IAAI,EACJ,OAAO,GAKR;IACC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,OAAO,GAAG,MAAM,EAChB,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,MAAM,EACN,MAAM,GAAG,KAAK,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,MAAM,GACI;IACV,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAChE,MAAM,eAAe,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC;IACzE,MAAM,aAAa,GAAG,gBAAgB,CAAC;QACrC,KAAK;QACL,UAAU;QACV,OAAO,EAAE,eAAe;QACxB,IAAI;QACJ,KAAK;QACL,MAAM;QACN,MAAM;KACP,CAAC,CAAC;IAEH,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,CAAC,eAAe,CACd,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,aAAa,CAAC,CAErB;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';\nimport React from 'react';\nimport { Text as ReactNativeText } from 'react-native';\n\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { resolveTextStyle } from './resolveTextRecipe';\nimport type { TextProps } from './types';\n\nfunction resolveTextContent({\n children,\n text,\n i18nKey,\n}: {\n children: TextProps['children'];\n text: TextProps['text'];\n i18nKey: TextProps['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\nexport function Text({\n children,\n text,\n i18nKey,\n variant = 'body',\n tone = 'default',\n align,\n weight,\n italic = false,\n numberOfLines,\n ellipsizeMode,\n selectable,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole,\n nativeID,\n testID,\n}: TextProps) {\n const { theme } = useZoraTheme();\n const { breakpoint } = useResponsiveRuntime();\n const content = resolveTextContent({ children, text, i18nKey });\n const resolvedVariant = resolveResponsive(variant, breakpoint) ?? 'body';\n const resolvedStyle = resolveTextStyle({\n theme,\n breakpoint,\n variant: resolvedVariant,\n tone,\n align,\n weight,\n italic,\n });\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}\n ellipsizeMode={ellipsizeMode}\n nativeID={nativeID}\n numberOfLines={numberOfLines}\n selectable={selectable}\n testID={testID}\n style={resolvedStyle}\n >\n {content}\n </ReactNativeText>\n );\n}\n"]}
1
+ {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../src/components/text/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,SAAS,kBAAkB,CAAC,EAC1B,QAAQ,EACR,IAAI,EACJ,OAAO,GAKR;IACC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,SAAS,CAAC,EACjB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,OAAO,GAAG,MAAM,EAChB,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,MAAM,EACN,MAAM,GAAG,KAAK,EACd,aAAa,EACb,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,MAAM,GACI;IACV,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAChE,MAAM,eAAe,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC;IACzE,MAAM,aAAa,GAAG,gBAAgB,CAAC;QACrC,KAAK;QACL,UAAU;QACV,OAAO,EAAE,eAAe;QACxB,IAAI;QACJ,KAAK;QACL,MAAM;QACN,MAAM;KACP,CAAC,CAAC;IAEH,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,CAAC,eAAe,CACd,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,aAAa,CAAC,CAErB;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';\nimport React from 'react';\nimport { Text as ReactNativeText } from 'react-native';\n\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { resolveTextStyle } from './resolveTextRecipe';\nimport type { TextProps } from './types';\n\nfunction resolveTextContent({\n children,\n text,\n i18nKey,\n}: {\n children: TextProps['children'];\n text: TextProps['text'];\n i18nKey: TextProps['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 TextInner({\n themeId: _themeId,\n mode: _mode,\n children,\n text,\n i18nKey,\n variant = 'body',\n tone = 'default',\n align,\n weight,\n italic = false,\n numberOfLines,\n ellipsizeMode,\n selectable,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole,\n nativeID,\n testID,\n}: TextProps) {\n const { theme } = useZoraTheme();\n const { breakpoint } = useResponsiveRuntime();\n const content = resolveTextContent({ children, text, i18nKey });\n const resolvedVariant = resolveResponsive(variant, breakpoint) ?? 'body';\n const resolvedStyle = resolveTextStyle({\n theme,\n breakpoint,\n variant: resolvedVariant,\n tone,\n align,\n weight,\n italic,\n });\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}\n ellipsizeMode={ellipsizeMode}\n nativeID={nativeID}\n numberOfLines={numberOfLines}\n selectable={selectable}\n testID={testID}\n style={resolvedStyle}\n >\n {content}\n </ReactNativeText>\n );\n}\n\nexport const Text = withZoraThemeScope(TextInner);\n"]}
@@ -1,11 +1,12 @@
1
1
  import type { Responsive } from '@ankhorage/surface';
2
2
  import type React from 'react';
3
3
  import type { AccessibilityRole, TextStyle } from 'react-native';
4
+ import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
4
5
  export type TextVariant = 'body' | 'lead' | 'bodySmall' | 'caption' | 'label' | 'eyebrow' | 'code';
5
6
  export type TextTone = 'default' | 'muted' | 'subtle' | 'inverse' | 'primary' | 'danger' | 'success' | 'warning';
6
7
  export type TextWeight = 'regular' | 'medium' | 'semiBold' | 'bold';
7
8
  export type TextAlign = NonNullable<TextStyle['textAlign']>;
8
- export interface TextProps {
9
+ export interface TextProps extends ZoraBaseProps {
9
10
  children?: React.ReactNode;
10
11
  text?: string;
11
12
  i18nKey?: string;
@@ -21,6 +22,5 @@ export interface TextProps {
21
22
  accessibilityHint?: string;
22
23
  accessibilityRole?: AccessibilityRole;
23
24
  nativeID?: string;
24
- testID?: string;
25
25
  }
26
26
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/text/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEnG,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,OAAO,GACP,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAE5D,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC5B,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/text/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEnG,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,OAAO,GACP,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAE5D,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC5B,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/text/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Responsive } from '@ankhorage/surface';\nimport type React from 'react';\nimport type { AccessibilityRole, TextStyle } from 'react-native';\n\nexport type TextVariant = 'body' | 'lead' | 'bodySmall' | 'caption' | 'label' | 'eyebrow' | 'code';\n\nexport type TextTone =\n | 'default'\n | 'muted'\n | 'subtle'\n | 'inverse'\n | 'primary'\n | 'danger'\n | 'success'\n | 'warning';\n\nexport type TextWeight = 'regular' | 'medium' | 'semiBold' | 'bold';\n\nexport type TextAlign = NonNullable<TextStyle['textAlign']>;\n\nexport interface TextProps {\n children?: React.ReactNode;\n text?: string;\n i18nKey?: string;\n variant?: Responsive<TextVariant>;\n tone?: Responsive<TextTone>;\n align?: Responsive<TextAlign>;\n weight?: Responsive<TextWeight>;\n italic?: boolean;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n selectable?: boolean;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n accessibilityRole?: AccessibilityRole;\n nativeID?: string;\n testID?: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/text/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Responsive } from '@ankhorage/surface';\nimport type React from 'react';\nimport type { AccessibilityRole, TextStyle } from 'react-native';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type TextVariant = 'body' | 'lead' | 'bodySmall' | 'caption' | 'label' | 'eyebrow' | 'code';\n\nexport type TextTone =\n | 'default'\n | 'muted'\n | 'subtle'\n | 'inverse'\n | 'primary'\n | 'danger'\n | 'success'\n | 'warning';\n\nexport type TextWeight = 'regular' | 'medium' | 'semiBold' | 'bold';\n\nexport type TextAlign = NonNullable<TextStyle['textAlign']>;\n\nexport interface TextProps extends ZoraBaseProps {\n children?: React.ReactNode;\n text?: string;\n i18nKey?: string;\n variant?: Responsive<TextVariant>;\n tone?: Responsive<TextTone>;\n align?: Responsive<TextAlign>;\n weight?: Responsive<TextWeight>;\n italic?: boolean;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n selectable?: boolean;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n accessibilityRole?: AccessibilityRole;\n nativeID?: string;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { PanelProps } from './types';
3
- export declare function Panel(props: PanelProps): React.JSX.Element;
3
+ export declare const Panel: React.FC<PanelProps>;
4
4
  //# sourceMappingURL=Panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../src/patterns/panel/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,qBAEtC"}
1
+ {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../../../src/patterns/panel/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C,eAAO,MAAM,KAAK,sBAAiC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Card } from '../../components/card';
3
- export function Panel(props) {
3
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
4
+ function PanelInner({ themeId: _themeId, mode: _mode, ...props }) {
4
5
  return <Card {...props}/>;
5
6
  }
7
+ export const Panel = withZoraThemeScope(PanelInner);
6
8
  //# sourceMappingURL=Panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.js","sourceRoot":"","sources":["../../../src/patterns/panel/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC7B,CAAC","sourcesContent":["import React from 'react';\n\nimport { Card } from '../../components/card';\nimport type { PanelProps } from './types';\n\nexport function Panel(props: PanelProps) {\n return <Card {...props} />;\n}\n"]}
1
+ {"version":3,"file":"Panel.js","sourceRoot":"","sources":["../../../src/patterns/panel/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAc;IAC1E,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Card } from '../../components/card';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PanelProps } from './types';\n\nfunction PanelInner({ themeId: _themeId, mode: _mode, ...props }: PanelProps) {\n return <Card {...props} />;\n}\n\nexport const Panel = withZoraThemeScope(PanelInner);\n"]}
@@ -1,6 +1,7 @@
1
1
  import type React from 'react';
2
2
  import type { ZoraCardTone } from '../../internal/recipes';
3
- export interface PanelProps {
3
+ import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
4
+ export interface PanelProps extends ZoraBaseProps {
4
5
  title?: React.ReactNode;
5
6
  description?: React.ReactNode;
6
7
  eyebrow?: React.ReactNode;
@@ -9,6 +10,5 @@ export interface PanelProps {
9
10
  children?: React.ReactNode;
10
11
  tone?: ZoraCardTone;
11
12
  compact?: boolean;
12
- testID?: string;
13
13
  }
14
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/panel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/panel/types.ts"],"names":[],"mappings":"AAAA,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,UAAW,SAAQ,aAAa;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/panel/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraCardTone } from '../../internal/recipes';\n\nexport interface PanelProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n footer?: React.ReactNode;\n children?: React.ReactNode;\n tone?: ZoraCardTone;\n compact?: boolean;\n testID?: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/panel/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ZoraCardTone } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface PanelProps extends ZoraBaseProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n eyebrow?: React.ReactNode;\n actions?: React.ReactNode;\n footer?: React.ReactNode;\n children?: React.ReactNode;\n tone?: ZoraCardTone;\n compact?: boolean;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import type { ZoraThemeId, ZoraThemeMode } from './types';
2
+ export interface ZoraBaseProps {
3
+ /**
4
+ * Overrides the active ZORA theme for this component and its subtree.
5
+ * If omitted, the nearest parent theme is inherited.
6
+ *
7
+ * Plan 2: theme registries are not available yet. Only the inherited theme id
8
+ * is valid; unknown ids throw in dev/test and warn+fallback in production.
9
+ */
10
+ themeId?: ZoraThemeId;
11
+ /**
12
+ * Overrides the light/dark mode for this component and its subtree.
13
+ * If omitted, the nearest parent mode is inherited.
14
+ */
15
+ mode?: ZoraThemeMode;
16
+ testID?: string;
17
+ }
18
+ //# sourceMappingURL=ZoraBaseProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoraBaseProps.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraBaseProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ZoraBaseProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoraBaseProps.js","sourceRoot":"","sources":["../../src/theme/ZoraBaseProps.ts"],"names":[],"mappings":"","sourcesContent":["import type { ZoraThemeId, ZoraThemeMode } from './types';\n\nexport interface ZoraBaseProps {\n /**\n * Overrides the active ZORA theme for this component and its subtree.\n * If omitted, the nearest parent theme is inherited.\n *\n * Plan 2: theme registries are not available yet. Only the inherited theme id\n * is valid; unknown ids throw in dev/test and warn+fallback in production.\n */\n themeId?: ZoraThemeId;\n\n /**\n * Overrides the light/dark mode for this component and its subtree.\n * If omitted, the nearest parent mode is inherited.\n */\n mode?: ZoraThemeMode;\n\n testID?: string;\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { type ZoraThemeOverride } from './createZoraTheme';
2
+ import type { ZoraTheme, ZoraThemeMode } from './types';
3
3
  export interface ZoraProviderProps {
4
4
  children: React.ReactNode;
5
- initialConfig?: ZoraThemeOverride;
6
- initialMode?: 'light' | 'dark';
5
+ theme?: ZoraTheme;
6
+ initialMode?: ZoraThemeMode;
7
7
  }
8
- export declare function ZoraProvider({ children, initialConfig, initialMode, }: ZoraProviderProps): React.JSX.Element;
8
+ export declare function ZoraProvider({ children, theme, initialMode, }: ZoraProviderProps): React.JSX.Element;
9
9
  //# sourceMappingURL=ZoraProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZoraProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE5E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAChC;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,aAAa,EACb,WAAqB,GACtB,EAAE,iBAAiB,qBAMnB"}
1
+ {"version":3,"file":"ZoraProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,KAAwB,EACxB,WAAqB,GACtB,EAAE,iBAAiB,qBAUnB"}
@@ -1,9 +1,14 @@
1
- import { ResponsiveProvider, ThemeProvider } from '@ankhorage/surface';
1
+ import { ThemeProvider } from '@ankhorage/surface';
2
2
  import React from 'react';
3
- import { createZoraTheme } from './createZoraTheme';
4
- export function ZoraProvider({ children, initialConfig, initialMode = 'light', }) {
5
- return (<ThemeProvider initialConfig={createZoraTheme(initialConfig)} initialMode={initialMode}>
6
- <ResponsiveProvider>{children}</ResponsiveProvider>
7
- </ThemeProvider>);
3
+ import { createZoraThemeConfig } from './createZoraThemeConfig';
4
+ import { zoraDefaultTheme } from './zoraDefaultTheme';
5
+ import { ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';
6
+ export function ZoraProvider({ children, theme = zoraDefaultTheme, initialMode = 'light', }) {
7
+ const runtimeValue = React.useMemo(() => ({ sourceTheme: theme, themeId: theme.id }), [theme]);
8
+ return (<ZoraThemeRuntimeContext.Provider value={runtimeValue}>
9
+ <ThemeProvider initialConfig={createZoraThemeConfig(theme)} initialMode={initialMode}>
10
+ {children}
11
+ </ThemeProvider>
12
+ </ZoraThemeRuntimeContext.Provider>);
8
13
  }
9
14
  //# sourceMappingURL=ZoraProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZoraProvider.js","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAA0B,MAAM,mBAAmB,CAAC;AAQ5E,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,aAAa,EACb,WAAW,GAAG,OAAO,GACH;IAClB,OAAO,CACL,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CACrF;MAAA,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CACpD;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { ResponsiveProvider, ThemeProvider } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { createZoraTheme, type ZoraThemeOverride } from './createZoraTheme';\n\nexport interface ZoraProviderProps {\n children: React.ReactNode;\n initialConfig?: ZoraThemeOverride;\n initialMode?: 'light' | 'dark';\n}\n\nexport function ZoraProvider({\n children,\n initialConfig,\n initialMode = 'light',\n}: ZoraProviderProps) {\n return (\n <ThemeProvider initialConfig={createZoraTheme(initialConfig)} initialMode={initialMode}>\n <ResponsiveProvider>{children}</ResponsiveProvider>\n </ThemeProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"ZoraProvider.js","sourceRoot":"","sources":["../../src/theme/ZoraProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAQpE,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,KAAK,GAAG,gBAAgB,EACxB,WAAW,GAAG,OAAO,GACH;IAClB,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/F,OAAO,CACL,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACpD;MAAA,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CACnF;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,aAAa,CACjB;IAAA,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CACpC,CAAC;AACJ,CAAC","sourcesContent":["import { ThemeProvider } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { createZoraThemeConfig } from './createZoraThemeConfig';\nimport type { ZoraTheme, ZoraThemeMode } from './types';\nimport { zoraDefaultTheme } from './zoraDefaultTheme';\nimport { ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';\n\nexport interface ZoraProviderProps {\n children: React.ReactNode;\n theme?: ZoraTheme;\n initialMode?: ZoraThemeMode;\n}\n\nexport function ZoraProvider({\n children,\n theme = zoraDefaultTheme,\n initialMode = 'light',\n}: ZoraProviderProps) {\n const runtimeValue = React.useMemo(() => ({ sourceTheme: theme, themeId: theme.id }), [theme]);\n\n return (\n <ZoraThemeRuntimeContext.Provider value={runtimeValue}>\n <ThemeProvider initialConfig={createZoraThemeConfig(theme)} initialMode={initialMode}>\n {children}\n </ThemeProvider>\n </ZoraThemeRuntimeContext.Provider>\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { ZoraTheme, ZoraThemeId } from './types';
2
+ interface ZoraThemeRuntime {
3
+ sourceTheme: ZoraTheme;
4
+ themeId: ZoraThemeId;
5
+ }
6
+ export declare const ZoraThemeRuntimeContext: import("react").Context<ZoraThemeRuntime>;
7
+ export declare function useZoraThemeRuntime(): ZoraThemeRuntime;
8
+ export {};
9
+ //# sourceMappingURL=ZoraThemeRuntimeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoraThemeRuntimeContext.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraThemeRuntimeContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtD,UAAU,gBAAgB;IACxB,WAAW,EAAE,SAAS,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,uBAAuB,2CAGlC,CAAC;AAEH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD"}
@@ -0,0 +1,10 @@
1
+ import { createContext, useContext } from 'react';
2
+ import { zoraDefaultTheme } from './zoraDefaultTheme';
3
+ export const ZoraThemeRuntimeContext = createContext({
4
+ sourceTheme: zoraDefaultTheme,
5
+ themeId: zoraDefaultTheme.id,
6
+ });
7
+ export function useZoraThemeRuntime() {
8
+ return useContext(ZoraThemeRuntimeContext);
9
+ }
10
+ //# sourceMappingURL=ZoraThemeRuntimeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoraThemeRuntimeContext.js","sourceRoot":"","sources":["../../src/theme/ZoraThemeRuntimeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAmB;IACrE,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,gBAAgB,CAAC,EAAE;CAC7B,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { createContext, useContext } from 'react';\n\nimport type { ZoraTheme, ZoraThemeId } from './types';\nimport { zoraDefaultTheme } from './zoraDefaultTheme';\n\ninterface ZoraThemeRuntime {\n sourceTheme: ZoraTheme;\n themeId: ZoraThemeId;\n}\n\nexport const ZoraThemeRuntimeContext = createContext<ZoraThemeRuntime>({\n sourceTheme: zoraDefaultTheme,\n themeId: zoraDefaultTheme.id,\n});\n\nexport function useZoraThemeRuntime(): ZoraThemeRuntime {\n return useContext(ZoraThemeRuntimeContext);\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ZoraThemeId, ZoraThemeMode } from './types';
3
+ export interface ZoraThemeScopeProps {
4
+ children: React.ReactNode;
5
+ themeId?: ZoraThemeId;
6
+ mode?: ZoraThemeMode;
7
+ }
8
+ export declare function ZoraThemeScope({ children, themeId, mode }: ZoraThemeScopeProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
9
+ //# sourceMappingURL=ZoraThemeScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoraThemeScope.d.ts","sourceRoot":"","sources":["../../src/theme/ZoraThemeScope.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAmDD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,mBAAmB,mSAU9E"}
@@ -0,0 +1,41 @@
1
+ import { createTheme, ThemeContext, useFontContext, useTheme } from '@ankhorage/surface';
2
+ import React, { useMemo } from 'react';
3
+ import { createZoraThemeConfig } from './createZoraThemeConfig';
4
+ import { resolveZoraScopedThemeId } from './resolveZoraScopedThemeId';
5
+ import { useZoraThemeRuntime, ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';
6
+ function ZoraThemeScopeInner({ children, themeId, mode }) {
7
+ const parentSurface = useTheme();
8
+ const parentRuntime = useZoraThemeRuntime();
9
+ const { activeFontId } = useFontContext();
10
+ const scopedThemeId = resolveZoraScopedThemeId({
11
+ desiredThemeId: themeId,
12
+ inheritedThemeId: parentRuntime.themeId,
13
+ });
14
+ const scopedMode = mode ?? parentSurface.mode;
15
+ // Plan 2: there is no multi-theme registry yet. Keep the active theme seed inherited.
16
+ const surfaceConfig = useMemo(() => createZoraThemeConfig(parentRuntime.sourceTheme), [parentRuntime.sourceTheme]);
17
+ const scopedTheme = useMemo(() => createTheme(surfaceConfig, scopedMode, activeFontId), [surfaceConfig, scopedMode, activeFontId]);
18
+ const scopedSurfaceValue = useMemo(() => ({
19
+ theme: scopedTheme,
20
+ mode: scopedMode,
21
+ setMode: parentSurface.setMode,
22
+ setThemeConfig: parentSurface.setThemeConfig,
23
+ _hasProvider: true,
24
+ }), [parentSurface.setMode, parentSurface.setThemeConfig, scopedMode, scopedTheme]);
25
+ const scopedRuntimeValue = useMemo(() => ({
26
+ sourceTheme: parentRuntime.sourceTheme,
27
+ themeId: scopedThemeId,
28
+ }), [parentRuntime.sourceTheme, scopedThemeId]);
29
+ return (<ZoraThemeRuntimeContext.Provider value={scopedRuntimeValue}>
30
+ <ThemeContext.Provider value={scopedSurfaceValue}>{children}</ThemeContext.Provider>
31
+ </ZoraThemeRuntimeContext.Provider>);
32
+ }
33
+ export function ZoraThemeScope({ children, themeId, mode }) {
34
+ if (mode === undefined && themeId === undefined) {
35
+ return children;
36
+ }
37
+ return (<ZoraThemeScopeInner mode={mode} themeId={themeId}>
38
+ {children}
39
+ </ZoraThemeScopeInner>);
40
+ }
41
+ //# sourceMappingURL=ZoraThemeScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoraThemeScope.js","sourceRoot":"","sources":["../../src/theme/ZoraThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAQzF,SAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAuB;IAC3E,MAAM,aAAa,GAAG,QAAQ,EAAE,CAAC;IACjC,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;IAC5C,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAE1C,MAAM,aAAa,GAAG,wBAAwB,CAAC;QAC7C,cAAc,EAAE,OAAO;QACvB,gBAAgB,EAAE,aAAa,CAAC,OAAO;KACxC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC;IAE9C,sFAAsF;IACtF,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC,WAAW,CAAC,EACtD,CAAC,aAAa,CAAC,WAAW,CAAC,CAC5B,CAAC;IAEF,MAAM,WAAW,GAAG,OAAO,CACzB,GAAG,EAAE,CAAC,WAAW,CAAC,aAAa,EAAE,UAAU,EAAE,YAAY,CAAC,EAC1D,CAAC,aAAa,EAAE,UAAU,EAAE,YAAY,CAAC,CAC1C,CAAC;IAEF,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,aAAa,CAAC,OAAO;QAC9B,cAAc,EAAE,aAAa,CAAC,cAAc;QAC5C,YAAY,EAAE,IAAI;KACnB,CAAC,EACF,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,cAAc,EAAE,UAAU,EAAE,WAAW,CAAC,CAC/E,CAAC;IAEF,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC;QACL,WAAW,EAAE,aAAa,CAAC,WAAW;QACtC,OAAO,EAAE,aAAa;KACvB,CAAC,EACF,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,CAC3C,CAAC;IAEF,OAAO,CACL,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAC1D;MAAA,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CACrF;IAAA,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAuB;IAC7E,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,CACL,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAChD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAmB,CAAC,CACvB,CAAC;AACJ,CAAC","sourcesContent":["import { createTheme, ThemeContext, useFontContext, useTheme } from '@ankhorage/surface';\nimport React, { useMemo } from 'react';\n\nimport { createZoraThemeConfig } from './createZoraThemeConfig';\nimport { resolveZoraScopedThemeId } from './resolveZoraScopedThemeId';\nimport type { ZoraThemeId, ZoraThemeMode } from './types';\nimport { useZoraThemeRuntime, ZoraThemeRuntimeContext } from './ZoraThemeRuntimeContext';\n\nexport interface ZoraThemeScopeProps {\n children: React.ReactNode;\n themeId?: ZoraThemeId;\n mode?: ZoraThemeMode;\n}\n\nfunction ZoraThemeScopeInner({ children, themeId, mode }: ZoraThemeScopeProps) {\n const parentSurface = useTheme();\n const parentRuntime = useZoraThemeRuntime();\n const { activeFontId } = useFontContext();\n\n const scopedThemeId = resolveZoraScopedThemeId({\n desiredThemeId: themeId,\n inheritedThemeId: parentRuntime.themeId,\n });\n\n const scopedMode = mode ?? parentSurface.mode;\n\n // Plan 2: there is no multi-theme registry yet. Keep the active theme seed inherited.\n const surfaceConfig = useMemo(\n () => createZoraThemeConfig(parentRuntime.sourceTheme),\n [parentRuntime.sourceTheme],\n );\n\n const scopedTheme = useMemo(\n () => createTheme(surfaceConfig, scopedMode, activeFontId),\n [surfaceConfig, scopedMode, activeFontId],\n );\n\n const scopedSurfaceValue = useMemo(\n () => ({\n theme: scopedTheme,\n mode: scopedMode,\n setMode: parentSurface.setMode,\n setThemeConfig: parentSurface.setThemeConfig,\n _hasProvider: true,\n }),\n [parentSurface.setMode, parentSurface.setThemeConfig, scopedMode, scopedTheme],\n );\n\n const scopedRuntimeValue = useMemo(\n () => ({\n sourceTheme: parentRuntime.sourceTheme,\n themeId: scopedThemeId,\n }),\n [parentRuntime.sourceTheme, scopedThemeId],\n );\n\n return (\n <ZoraThemeRuntimeContext.Provider value={scopedRuntimeValue}>\n <ThemeContext.Provider value={scopedSurfaceValue}>{children}</ThemeContext.Provider>\n </ZoraThemeRuntimeContext.Provider>\n );\n}\n\nexport function ZoraThemeScope({ children, themeId, mode }: ZoraThemeScopeProps) {\n if (mode === undefined && themeId === undefined) {\n return children;\n }\n\n return (\n <ZoraThemeScopeInner mode={mode} themeId={themeId}>\n {children}\n </ZoraThemeScopeInner>\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ThemeConfig } from '@ankhorage/surface';
2
+ import type { ZoraTheme } from './types';
3
+ export declare function createZoraThemeConfig(theme?: ZoraTheme): ThemeConfig;
4
+ //# sourceMappingURL=createZoraThemeConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createZoraThemeConfig.d.ts","sourceRoot":"","sources":["../../src/theme/createZoraThemeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAgB,SAAS,EAAiB,MAAM,SAAS,CAAC;AAStE,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,SAA4B,GAAG,WAAW,CAetF"}
@@ -0,0 +1,23 @@
1
+ import { zoraDefaultTheme } from './zoraDefaultTheme';
2
+ function resolveModePrimaryColor(primaryColor, _mode) {
3
+ // Intentionally conservative in Plan 1: mode-specific primary derivation
4
+ // (OKLCH/lightness scale, etc.) comes in later theme-engine work.
5
+ return primaryColor;
6
+ }
7
+ export function createZoraThemeConfig(theme = zoraDefaultTheme) {
8
+ return {
9
+ id: theme.id,
10
+ name: theme.name ?? theme.id,
11
+ light: {
12
+ primaryColor: resolveModePrimaryColor(theme.primaryColor, 'light'),
13
+ harmony: theme.harmony,
14
+ systemTone: theme.tone,
15
+ },
16
+ dark: {
17
+ primaryColor: resolveModePrimaryColor(theme.primaryColor, 'dark'),
18
+ harmony: theme.harmony,
19
+ systemTone: theme.tone,
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=createZoraThemeConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createZoraThemeConfig.js","sourceRoot":"","sources":["../../src/theme/createZoraThemeConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,SAAS,uBAAuB,CAAC,YAA0B,EAAE,KAAoB;IAC/E,yEAAyE;IACzE,kEAAkE;IAClE,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,QAAmB,gBAAgB;IACvE,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE;QAC5B,KAAK,EAAE;YACL,YAAY,EAAE,uBAAuB,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC;YAClE,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,IAAI;SACvB;QACD,IAAI,EAAE;YACJ,YAAY,EAAE,uBAAuB,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC;YACjE,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,IAAI;SACvB;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { ThemeConfig } from '@ankhorage/surface';\n\nimport type { ZoraHexColor, ZoraTheme, ZoraThemeMode } from './types';\nimport { zoraDefaultTheme } from './zoraDefaultTheme';\n\nfunction resolveModePrimaryColor(primaryColor: ZoraHexColor, _mode: ZoraThemeMode): ZoraHexColor {\n // Intentionally conservative in Plan 1: mode-specific primary derivation\n // (OKLCH/lightness scale, etc.) comes in later theme-engine work.\n return primaryColor;\n}\n\nexport function createZoraThemeConfig(theme: ZoraTheme = zoraDefaultTheme): ThemeConfig {\n return {\n id: theme.id,\n name: theme.name ?? theme.id,\n light: {\n primaryColor: resolveModePrimaryColor(theme.primaryColor, 'light'),\n harmony: theme.harmony,\n systemTone: theme.tone,\n },\n dark: {\n primaryColor: resolveModePrimaryColor(theme.primaryColor, 'dark'),\n harmony: theme.harmony,\n systemTone: theme.tone,\n },\n };\n}\n"]}
@@ -1,7 +1,11 @@
1
- export type { ZoraThemeOverride } from './createZoraTheme';
2
- export { createZoraTheme } from './createZoraTheme';
1
+ export { createZoraThemeConfig } from './createZoraThemeConfig';
2
+ export type { ZoraColorHarmony, ZoraColorTone, ZoraComputedTheme, ZoraHexColor, ZoraTheme, ZoraThemeId, ZoraThemeMode, } from './types';
3
3
  export { useZoraTheme } from './useZoraTheme';
4
+ export { withZoraThemeScope } from './withZoraThemeScope';
5
+ export type { ZoraBaseProps } from './ZoraBaseProps';
6
+ export { zoraDefaultTheme } from './zoraDefaultTheme';
4
7
  export type { ZoraProviderProps } from './ZoraProvider';
5
8
  export { ZoraProvider } from './ZoraProvider';
6
- export { zoraTheme } from './zoraTheme';
9
+ export type { ZoraThemeScopeProps } from './ZoraThemeScope';
10
+ export { ZoraThemeScope } from './ZoraThemeScope';
7
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,7 @@
1
- export { createZoraTheme } from './createZoraTheme';
1
+ export { createZoraThemeConfig } from './createZoraThemeConfig';
2
2
  export { useZoraTheme } from './useZoraTheme';
3
+ export { withZoraThemeScope } from './withZoraThemeScope';
4
+ export { zoraDefaultTheme } from './zoraDefaultTheme';
3
5
  export { ZoraProvider } from './ZoraProvider';
4
- export { zoraTheme } from './zoraTheme';
6
+ export { ZoraThemeScope } from './ZoraThemeScope';
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { ZoraThemeOverride } from './createZoraTheme';\nexport { createZoraTheme } from './createZoraTheme';\nexport { useZoraTheme } from './useZoraTheme';\nexport type { ZoraProviderProps } from './ZoraProvider';\nexport { ZoraProvider } from './ZoraProvider';\nexport { zoraTheme } from './zoraTheme';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAUhE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { createZoraThemeConfig } from './createZoraThemeConfig';\nexport type {\n ZoraColorHarmony,\n ZoraColorTone,\n ZoraComputedTheme,\n ZoraHexColor,\n ZoraTheme,\n ZoraThemeId,\n ZoraThemeMode,\n} from './types';\nexport { useZoraTheme } from './useZoraTheme';\nexport { withZoraThemeScope } from './withZoraThemeScope';\nexport type { ZoraBaseProps } from './ZoraBaseProps';\nexport { zoraDefaultTheme } from './zoraDefaultTheme';\nexport type { ZoraProviderProps } from './ZoraProvider';\nexport { ZoraProvider } from './ZoraProvider';\nexport type { ZoraThemeScopeProps } from './ZoraThemeScope';\nexport { ZoraThemeScope } from './ZoraThemeScope';\n"]}
@@ -0,0 +1,6 @@
1
+ import type { ZoraThemeId } from './types';
2
+ export declare function resolveZoraScopedThemeId({ desiredThemeId, inheritedThemeId, }: {
3
+ desiredThemeId: ZoraThemeId | undefined;
4
+ inheritedThemeId: ZoraThemeId;
5
+ }): ZoraThemeId;
6
+ //# sourceMappingURL=resolveZoraScopedThemeId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveZoraScopedThemeId.d.ts","sourceRoot":"","sources":["../../src/theme/resolveZoraScopedThemeId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,wBAAwB,CAAC,EACvC,cAAc,EACd,gBAAgB,GACjB,EAAE;IACD,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,gBAAgB,EAAE,WAAW,CAAC;CAC/B,GAAG,WAAW,CAgBd"}
@@ -0,0 +1,15 @@
1
+ export function resolveZoraScopedThemeId({ desiredThemeId, inheritedThemeId, }) {
2
+ if (desiredThemeId === undefined || desiredThemeId === inheritedThemeId) {
3
+ return inheritedThemeId;
4
+ }
5
+ const message = [
6
+ `Unknown ZORA theme id '${desiredThemeId}'.`,
7
+ 'Theme registries are not available yet; register the theme before using themeId scopes.',
8
+ ].join(' ');
9
+ if (process.env.NODE_ENV === 'production') {
10
+ console.warn(message);
11
+ return inheritedThemeId;
12
+ }
13
+ throw new Error(message);
14
+ }
15
+ //# sourceMappingURL=resolveZoraScopedThemeId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveZoraScopedThemeId.js","sourceRoot":"","sources":["../../src/theme/resolveZoraScopedThemeId.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,wBAAwB,CAAC,EACvC,cAAc,EACd,gBAAgB,GAIjB;IACC,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,gBAAgB,EAAE,CAAC;QACxE,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM,OAAO,GAAG;QACd,0BAA0B,cAAc,IAAI;QAC5C,yFAAyF;KAC1F,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEZ,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC1C,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import type { ZoraThemeId } from './types';\n\nexport function resolveZoraScopedThemeId({\n desiredThemeId,\n inheritedThemeId,\n}: {\n desiredThemeId: ZoraThemeId | undefined;\n inheritedThemeId: ZoraThemeId;\n}): ZoraThemeId {\n if (desiredThemeId === undefined || desiredThemeId === inheritedThemeId) {\n return inheritedThemeId;\n }\n\n const message = [\n `Unknown ZORA theme id '${desiredThemeId}'.`,\n 'Theme registries are not available yet; register the theme before using themeId scopes.',\n ].join(' ');\n\n if (process.env.NODE_ENV === 'production') {\n console.warn(message);\n return inheritedThemeId;\n }\n\n throw new Error(message);\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import type { ThemeConfig } from '@ankhorage/surface';
2
+ export type ZoraThemeId = string;
3
+ export type ZoraThemeMode = 'light' | 'dark';
4
+ export type ZoraHexColor = `#${string}`;
5
+ export type ZoraColorHarmony = 'monochromatic' | 'analogous' | 'complementary' | 'splitComplementary' | 'triadic' | 'tetradic';
6
+ export type ZoraColorTone = 'neutral' | 'pastel' | 'earth' | 'jewel' | 'fluorescent';
7
+ export interface ZoraTheme {
8
+ id: ZoraThemeId;
9
+ name?: string;
10
+ primaryColor: ZoraHexColor;
11
+ harmony: ZoraColorHarmony;
12
+ tone: ZoraColorTone;
13
+ }
14
+ export interface ZoraComputedTheme {
15
+ id: ZoraThemeId;
16
+ name: string;
17
+ mode: ZoraThemeMode;
18
+ source: ZoraTheme;
19
+ surfaceConfig: ThemeConfig;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG,IAAI,MAAM,EAAE,CAAC;AAExC,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,WAAW,GACX,eAAe,GACf,oBAAoB,GACpB,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAErF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,WAAW,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,WAAW,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,aAAa,EAAE,WAAW,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/theme/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ThemeConfig } from '@ankhorage/surface';\n\nexport type ZoraThemeId = string;\n\nexport type ZoraThemeMode = 'light' | 'dark';\n\nexport type ZoraHexColor = `#${string}`;\n\nexport type ZoraColorHarmony =\n | 'monochromatic'\n | 'analogous'\n | 'complementary'\n | 'splitComplementary'\n | 'triadic'\n | 'tetradic';\n\nexport type ZoraColorTone = 'neutral' | 'pastel' | 'earth' | 'jewel' | 'fluorescent';\n\nexport interface ZoraTheme {\n id: ZoraThemeId;\n name?: string;\n primaryColor: ZoraHexColor;\n harmony: ZoraColorHarmony;\n tone: ZoraColorTone;\n}\n\nexport interface ZoraComputedTheme {\n id: ZoraThemeId;\n name: string;\n mode: ZoraThemeMode;\n source: ZoraTheme;\n surfaceConfig: ThemeConfig;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { ZoraBaseProps } from './ZoraBaseProps';
3
+ export declare function withZoraThemeScope<P extends ZoraBaseProps>(Component: React.ComponentType<P>): React.FC<P>;
4
+ //# sourceMappingURL=withZoraThemeScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withZoraThemeScope.d.ts","sourceRoot":"","sources":["../../src/theme/withZoraThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,aAAa,EACxD,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAiBb"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { ZoraThemeScope } from './ZoraThemeScope';
3
+ export function withZoraThemeScope(Component) {
4
+ const Wrapped = (props) => {
5
+ if (props.mode === undefined && props.themeId === undefined) {
6
+ return <Component {...props}/>;
7
+ }
8
+ return (<ZoraThemeScope mode={props.mode} themeId={props.themeId}>
9
+ <Component {...props}/>
10
+ </ZoraThemeScope>);
11
+ };
12
+ const name = Component.displayName ?? (Component.name || 'Component');
13
+ Wrapped.displayName = `withZoraThemeScope(${name})`;
14
+ return Wrapped;
15
+ }
16
+ //# sourceMappingURL=withZoraThemeScope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withZoraThemeScope.js","sourceRoot":"","sources":["../../src/theme/withZoraThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,kBAAkB,CAChC,SAAiC;IAEjC,MAAM,OAAO,GAAgB,CAAC,KAAK,EAAE,EAAE;QACrC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC5D,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;QAClC,CAAC;QAED,OAAO,CACL,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvD;QAAA,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,EACvB;MAAA,EAAE,cAAc,CAAC,CAClB,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,WAAW,CAAC,CAAC;IACtE,OAAO,CAAC,WAAW,GAAG,sBAAsB,IAAI,GAAG,CAAC;IAEpD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ZoraBaseProps } from './ZoraBaseProps';\nimport { ZoraThemeScope } from './ZoraThemeScope';\n\nexport function withZoraThemeScope<P extends ZoraBaseProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> {\n const Wrapped: React.FC<P> = (props) => {\n if (props.mode === undefined && props.themeId === undefined) {\n return <Component {...props} />;\n }\n\n return (\n <ZoraThemeScope mode={props.mode} themeId={props.themeId}>\n <Component {...props} />\n </ZoraThemeScope>\n );\n };\n\n const name = Component.displayName ?? (Component.name || 'Component');\n Wrapped.displayName = `withZoraThemeScope(${name})`;\n\n return Wrapped;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { ZoraTheme } from './types';
2
+ export declare const zoraDefaultTheme: ZoraTheme;
3
+ //# sourceMappingURL=zoraDefaultTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoraDefaultTheme.d.ts","sourceRoot":"","sources":["../../src/theme/zoraDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,gBAAgB,EAAE,SAM9B,CAAC"}
@@ -0,0 +1,8 @@
1
+ export const zoraDefaultTheme = {
2
+ id: 'zora',
3
+ name: 'ZORA',
4
+ primaryColor: '#0f766e',
5
+ harmony: 'analogous',
6
+ tone: 'jewel',
7
+ };
8
+ //# sourceMappingURL=zoraDefaultTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoraDefaultTheme.js","sourceRoot":"","sources":["../../src/theme/zoraDefaultTheme.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,WAAW;IACpB,IAAI,EAAE,OAAO;CACd,CAAC","sourcesContent":["import type { ZoraTheme } from './types';\n\nexport const zoraDefaultTheme: ZoraTheme = {\n id: 'zora',\n name: 'ZORA',\n primaryColor: '#0f766e',\n harmony: 'analogous',\n tone: 'jewel',\n};\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "0.8.1",
4
+ "version": "0.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": {
@@ -2,12 +2,22 @@ import { Button as SurfaceButton } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
 
4
4
  import { resolveButtonRecipe } from '../../internal/recipes';
5
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
5
6
  import type { ButtonProps } from './types';
6
7
 
7
- export function Button({ tone, emphasis, size, ...props }: ButtonProps) {
8
+ function ButtonInner({
9
+ themeId: _themeId,
10
+ mode: _mode,
11
+ tone,
12
+ emphasis,
13
+ size,
14
+ ...props
15
+ }: ButtonProps) {
8
16
  const recipe = resolveButtonRecipe({ tone, emphasis, size });
9
17
 
10
18
  return (
11
19
  <SurfaceButton {...props} size={recipe.size} tone={recipe.tone} variant={recipe.variant} />
12
20
  );
13
21
  }
22
+
23
+ export const Button = withZoraThemeScope(ButtonInner);