@ankhorage/surface 9.1.116 → 9.3.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 (100) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/features/badge/adapters/inbound/Badge.d.ts.map +1 -1
  4. package/dist/features/badge/adapters/inbound/Badge.js +1 -1
  5. package/dist/features/badge/adapters/inbound/Badge.js.map +1 -1
  6. package/dist/features/button/adapters/inbound/Button.js +1 -2
  7. package/dist/features/button/adapters/inbound/Button.js.map +1 -1
  8. package/dist/features/icon/adapters/inbound/Icon.d.ts.map +1 -1
  9. package/dist/features/icon/adapters/inbound/Icon.js +9 -1
  10. package/dist/features/icon/adapters/inbound/Icon.js.map +1 -1
  11. package/dist/features/tabs/adapters/inbound/Tab.d.ts.map +1 -1
  12. package/dist/features/tabs/adapters/inbound/Tab.js +14 -2
  13. package/dist/features/tabs/adapters/inbound/Tab.js.map +1 -1
  14. package/dist/features/tabs/adapters/inbound/TabPanel.d.ts +1 -1
  15. package/dist/features/tabs/adapters/inbound/TabPanel.d.ts.map +1 -1
  16. package/dist/features/tabs/adapters/inbound/TabPanel.js +8 -3
  17. package/dist/features/tabs/adapters/inbound/TabPanel.js.map +1 -1
  18. package/dist/features/tabs/adapters/inbound/Tabs.d.ts +1 -1
  19. package/dist/features/tabs/adapters/inbound/Tabs.d.ts.map +1 -1
  20. package/dist/features/tabs/adapters/inbound/Tabs.js +2 -2
  21. package/dist/features/tabs/adapters/inbound/Tabs.js.map +1 -1
  22. package/dist/features/tabs/composition/useTabsController.d.ts +1 -1
  23. package/dist/features/tabs/composition/useTabsController.d.ts.map +1 -1
  24. package/dist/features/tabs/composition/useTabsController.js +3 -2
  25. package/dist/features/tabs/composition/useTabsController.js.map +1 -1
  26. package/dist/features/tabs/public.d.ts +1 -1
  27. package/dist/features/tabs/public.d.ts.map +1 -1
  28. package/dist/features/tabs/public.js.map +1 -1
  29. package/dist/features/theme/adapters/inbound/ThemeProvider.d.ts.map +1 -1
  30. package/dist/features/theme/adapters/inbound/ThemeProvider.js +1 -0
  31. package/dist/features/theme/adapters/inbound/ThemeProvider.js.map +1 -1
  32. package/dist/features/theme/adapters/inbound/ThemeRuntimeContext.d.ts.map +1 -1
  33. package/dist/features/theme/adapters/inbound/ThemeRuntimeContext.js +1 -0
  34. package/dist/features/theme/adapters/inbound/ThemeRuntimeContext.js.map +1 -1
  35. package/dist/features/theme/adapters/inbound/ThemeScope.d.ts +2 -2
  36. package/dist/features/theme/adapters/inbound/ThemeScope.d.ts.map +1 -1
  37. package/dist/features/theme/adapters/inbound/ThemeScope.js +5 -4
  38. package/dist/features/theme/adapters/inbound/ThemeScope.js.map +1 -1
  39. package/dist/features/theme/application/use-cases/createTheme.d.ts +2 -2
  40. package/dist/features/theme/application/use-cases/createTheme.d.ts.map +1 -1
  41. package/dist/features/theme/application/use-cases/createTheme.js +6 -3
  42. package/dist/features/theme/application/use-cases/createTheme.js.map +1 -1
  43. package/dist/features/theme/domain/projectInvertedTheme.d.ts +4 -0
  44. package/dist/features/theme/domain/projectInvertedTheme.d.ts.map +1 -0
  45. package/dist/features/theme/domain/projectInvertedTheme.js +178 -0
  46. package/dist/features/theme/domain/projectInvertedTheme.js.map +1 -0
  47. package/dist/features/theme/domain/resolveInverseSurface.d.ts +10 -0
  48. package/dist/features/theme/domain/resolveInverseSurface.d.ts.map +1 -0
  49. package/dist/features/theme/domain/resolveInverseSurface.js +31 -0
  50. package/dist/features/theme/domain/resolveInverseSurface.js.map +1 -0
  51. package/dist/features/typography/adapters/inbound/Text.d.ts +1 -1
  52. package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -1
  53. package/dist/features/typography/adapters/inbound/Text.js +2 -1
  54. package/dist/features/typography/adapters/inbound/Text.js.map +1 -1
  55. package/dist/index.d.ts +1 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/internal/resolvers/resolveInteractiveColors.d.ts.map +1 -1
  59. package/dist/internal/resolvers/resolveInteractiveColors.js +10 -2
  60. package/dist/internal/resolvers/resolveInteractiveColors.js.map +1 -1
  61. package/dist/internal/resolvers/resolveTextColor.d.ts.map +1 -1
  62. package/dist/internal/resolvers/resolveTextColor.js +2 -1
  63. package/dist/internal/resolvers/resolveTextColor.js.map +1 -1
  64. package/dist/types/tabs.d.ts +3 -0
  65. package/dist/types/tabs.d.ts.map +1 -1
  66. package/dist/types/tabs.js.map +1 -1
  67. package/dist/types/theme.d.ts +3 -0
  68. package/dist/types/theme.d.ts.map +1 -1
  69. package/dist/types/theme.js.map +1 -1
  70. package/dist/types/typography.d.ts +1 -0
  71. package/dist/types/typography.d.ts.map +1 -1
  72. package/dist/types/typography.js.map +1 -1
  73. package/package.json +2 -2
  74. package/src/features/badge/adapters/inbound/Badge.tsx +1 -6
  75. package/src/features/button/adapters/inbound/Button.tsx +1 -3
  76. package/src/features/icon/adapters/inbound/Icon.tsx +12 -1
  77. package/src/features/icon/adapters/inbound/PortableIcon.test.tsx +32 -0
  78. package/src/features/tabs/adapters/inbound/Tab.tsx +23 -1
  79. package/src/features/tabs/adapters/inbound/TabPanel.tsx +8 -2
  80. package/src/features/tabs/adapters/inbound/Tabs.presentation.test.tsx +70 -1
  81. package/src/features/tabs/adapters/inbound/Tabs.tsx +2 -1
  82. package/src/features/tabs/composition/useTabsController.ts +7 -2
  83. package/src/features/tabs/public.ts +7 -1
  84. package/src/features/theme/adapters/inbound/ThemeProvider.tsx +1 -0
  85. package/src/features/theme/adapters/inbound/ThemeRuntimeContext.tsx +1 -0
  86. package/src/features/theme/adapters/inbound/ThemeScope.test.tsx +38 -7
  87. package/src/features/theme/adapters/inbound/ThemeScope.tsx +7 -6
  88. package/src/features/theme/application/use-cases/createTheme.ts +6 -2
  89. package/src/features/theme/domain/projectInvertedTheme.ts +300 -0
  90. package/src/features/theme/domain/resolveInverseSurface.ts +55 -0
  91. package/src/features/typography/adapters/inbound/Text.tsx +2 -0
  92. package/src/index.ts +7 -1
  93. package/src/internal/resolvers/resolveInteractiveColors.test.ts +1 -1
  94. package/src/internal/resolvers/resolveInteractiveColors.ts +12 -2
  95. package/src/internal/resolvers/resolveTextColor.test.ts +5 -0
  96. package/src/internal/resolvers/resolveTextColor.ts +2 -1
  97. package/src/invertedThemeAcceptance.test.ts +204 -0
  98. package/src/types/tabs.ts +4 -0
  99. package/src/types/theme.ts +3 -0
  100. package/src/types/typography.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ankhorage/surface
2
2
 
3
+ ## 9.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5ad50dd: Add an attached tab presentation variant that keeps the active tab and panel on one semantic surface across light, dark, and inverted polarity.
8
+
9
+ ## 9.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5c2f97d: Add inherited inverted surface polarity with contrast-safe semantic projection
14
+
3
15
  ## 9.1.116
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/surface
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v9.1.116](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v9.3.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Cross-platform UI foundation for React Native and React Native Web. Provides theming, layout primitives, and core building blocks for modern apps.
9
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../src/features/badge/adapters/inbound/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAK1D,4DAA4D;AAC5D,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,OAAgB,EAChB,KAAiB,EACjB,IAAU,EACV,MAAM,GACP,EAAE,UAAU,qBA2BZ"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../../src/features/badge/adapters/inbound/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAK1D,4DAA4D;AAC5D,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,OAAgB,EAChB,KAAiB,EACjB,IAAU,EACV,MAAM,GACP,EAAE,UAAU,qBAsBZ"}
@@ -13,7 +13,7 @@ export function Badge({ content, variant = 'soft', color = 'primary', size = 's'
13
13
  state: { disabled: false, focused: false, hovered: false, pressed: false },
14
14
  });
15
15
  return (<View px={Math.max(theme.spacing.xs, controlSize.paddingHorizontal - 4)} py={Math.max(4, controlSize.paddingVertical - 2)} radius={controlSize.borderRadius} style={resolveBadgeStyle(colors.backgroundColor, colors.borderColor, variant)} testID={testID}>
16
- <Text color={color} emphasis={variant === 'solid' ? 'inverse' : 'default'} variant="bodySmall" weight="medium">
16
+ <Text style={{ color: colors.contentColor }} variant="bodySmall" weight="medium">
17
17
  {content}
18
18
  </Text>
19
19
  </View>);
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../src/features/badge/adapters/inbound/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAA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KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CACtD,OAAO,CAAC,WAAW,CACnB,MAAM,CAAC,QAAQ,CAEf;QAAA,CAAC,OAAO,CACV;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,SAAS,iBAAiB,CACxB,eAAuB,EACvB,WAAmB,EACnB,OAA2C;IAE3C,OAAO;QACL,SAAS,EAAE,YAAY;QACvB,eAAe;QACf,WAAW;QACX,WAAW,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport type { ViewStyle } from 'react-native';\n\nimport { resolveButtonColors, resolveControlSize } from '../../../../internal/resolvers';\nimport type { BadgeProps } from '../../../../types/badge';\nimport { View } from '../../../layout/public';\nimport { useTheme } from '../../../theme/runtime';\nimport { Text } from '../../../typography/public';\n\n/*** Renders compact semantic status or metadata content. */\nexport function Badge({\n content,\n variant = 'soft',\n color = 'primary',\n size = 's',\n testID,\n}: BadgeProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n const colors = resolveButtonColors(theme, {\n variant,\n color,\n state: { disabled: false, focused: false, hovered: false, pressed: false },\n });\n\n return (\n <View\n px={Math.max(theme.spacing.xs, controlSize.paddingHorizontal - 4)}\n py={Math.max(4, controlSize.paddingVertical - 2)}\n radius={controlSize.borderRadius}\n style={resolveBadgeStyle(colors.backgroundColor, colors.borderColor, variant)}\n testID={testID}\n >\n <Text\n color={color}\n emphasis={variant === 'solid' ? 'inverse' : 'default'}\n variant=\"bodySmall\"\n weight=\"medium\"\n >\n {content}\n </Text>\n </View>\n );\n}\n\n/*** Resolves the visual container style for one badge variant. */\nfunction resolveBadgeStyle(\n backgroundColor: string,\n borderColor: string,\n variant: NonNullable<BadgeProps['variant']>,\n): ViewStyle {\n return {\n alignSelf: 'flex-start',\n backgroundColor,\n borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n };\n}\n"]}
1
+ {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../src/features/badge/adapters/inbound/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzF,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,4DAA4D;AAC5D,MAAM,UAAU,KAAK,CAAC,EACpB,OAAO,EACP,OAAO,GAAG,MAAM,EAChB,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,MAAM,GACK;IACX,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE;QACxC,OAAO;QACP,KAAK;QACL,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;KAC3E,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,IAAI,CACH,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,WAAW,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAClE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CACjD,MAAM,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CACjC,KAAK,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAC9E,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAC9E;QAAA,CAAC,OAAO,CACV;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,SAAS,iBAAiB,CACxB,eAAuB,EACvB,WAAmB,EACnB,OAA2C;IAE3C,OAAO;QACL,SAAS,EAAE,YAAY;QACvB,eAAe;QACf,WAAW;QACX,WAAW,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport type { ViewStyle } from 'react-native';\n\nimport { resolveButtonColors, resolveControlSize } from '../../../../internal/resolvers';\nimport type { BadgeProps } from '../../../../types/badge';\nimport { View } from '../../../layout/public';\nimport { useTheme } from '../../../theme/runtime';\nimport { Text } from '../../../typography/public';\n\n/*** Renders compact semantic status or metadata content. */\nexport function Badge({\n content,\n variant = 'soft',\n color = 'primary',\n size = 's',\n testID,\n}: BadgeProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n const colors = resolveButtonColors(theme, {\n variant,\n color,\n state: { disabled: false, focused: false, hovered: false, pressed: false },\n });\n\n return (\n <View\n px={Math.max(theme.spacing.xs, controlSize.paddingHorizontal - 4)}\n py={Math.max(4, controlSize.paddingVertical - 2)}\n radius={controlSize.borderRadius}\n style={resolveBadgeStyle(colors.backgroundColor, colors.borderColor, variant)}\n testID={testID}\n >\n <Text style={{ color: colors.contentColor }} variant=\"bodySmall\" weight=\"medium\">\n {content}\n </Text>\n </View>\n );\n}\n\n/*** Resolves the visual container style for one badge variant. */\nfunction resolveBadgeStyle(\n backgroundColor: string,\n borderColor: string,\n variant: NonNullable<BadgeProps['variant']>,\n): ViewStyle {\n return {\n alignSelf: 'flex-start',\n backgroundColor,\n borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n };\n}\n"]}
@@ -19,14 +19,13 @@ export function Button({ children, variant = 'solid', color = 'primary', size =
19
19
  /*** Renders Button content after interaction colors have been resolved. */
20
20
  function ButtonContent({ children, color, controlSize, fullWidth, leadingIcon, loading, size, state, theme, trailingIcon, variant, }) {
21
21
  const colors = resolveButtonColors(theme, { variant, color, state });
22
- const muted = colors.contentColor === theme.semantics.content.muted;
23
22
  const iconSize = resolveIconSize(theme, size);
24
23
  return (<View px={controlSize.paddingHorizontal} py={controlSize.paddingVertical} radius={controlSize.borderRadius} style={resolveButtonContentStyle(controlSize, colors, fullWidth, variant)}>
25
24
  {loading ? (<ActivityIndicator color={colors.contentColor} size="small"/>) : (<>
26
25
  {leadingIcon ? (<ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'leading')}>
27
26
  <Icon {...leadingIcon} color={colors.contentColor} size={iconSize}/>
28
27
  </ReactNativeView>) : null}
29
- <Text color={muted ? undefined : color} emphasis={muted ? 'muted' : variant === 'solid' ? 'inverse' : 'default'} variant={controlSize.textVariant} weight="semiBold">
28
+ <Text style={{ color: colors.contentColor }} variant={controlSize.textVariant} weight="semiBold">
30
29
  {children}
31
30
  </Text>
32
31
  {trailingIcon ? (<ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'trailing')}>
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/features/button/adapters/inbound/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,IAAI,IAAI,eAAe,EAAkB,MAAM,cAAc,CAAC;AAE1F,OAAO,EACL,mBAAm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MAA8C,EAC9C,SAAkB,EAClB,OAA4C;IAE5C,OAAO;QACL,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KACtC,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,SAAS,qBAAqB,CAAC,OAAe,EAAE,QAAgC;IAC9E,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AACrF,CAAC","sourcesContent":["import React from 'react';\nimport { ActivityIndicator, View as ReactNativeView, type ViewStyle } from 'react-native';\n\nimport {\n resolveButtonColors,\n resolveControlSize,\n resolveIconSize,\n} from '../../../../internal/resolvers';\nimport type { ButtonProps } from '../../../../types/button';\nimport type { InteractionState } from '../../../../types/pressable';\nimport type { SurfaceTheme } from '../../../../types/theme';\nimport { Icon } from '../../../icon/public';\nimport { View } from '../../../layout/public';\nimport { Pressable } from '../../../pressable/public';\nimport { useTheme } from '../../../theme/runtime';\nimport { Text } from '../../../typography/public';\n\n/*** Renders the primary Surface action control with semantic visual states. */\nexport function Button({\n children,\n variant = 'solid',\n color = 'primary',\n size = 'm',\n disabled = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n fullWidth = false,\n onPress,\n testID,\n ...props\n}: ButtonProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n\n return (\n <Pressable\n {...props}\n disabled={disabled || loading}\n onPress={onPress}\n style={resolvePressableStyle(fullWidth)}\n testID={testID}\n >\n {(state) => (\n <ButtonContent\n color={color}\n controlSize={controlSize}\n fullWidth={fullWidth}\n leadingIcon={leadingIcon}\n loading={loading}\n size={size}\n state={state}\n theme={theme}\n trailingIcon={trailingIcon}\n variant={variant}\n >\n {children}\n </ButtonContent>\n )}\n </Pressable>\n );\n}\n\n/*** Renders Button content after interaction colors have been resolved. */\nfunction ButtonContent({\n children,\n color,\n controlSize,\n fullWidth,\n leadingIcon,\n loading,\n size,\n state,\n theme,\n trailingIcon,\n variant,\n}: ButtonContentProps) {\n const colors = resolveButtonColors(theme, { variant, color, state });\n const muted = colors.contentColor === theme.semantics.content.muted;\n const iconSize = resolveIconSize(theme, size);\n\n return (\n <View\n px={controlSize.paddingHorizontal}\n py={controlSize.paddingVertical}\n radius={controlSize.borderRadius}\n style={resolveButtonContentStyle(controlSize, colors, fullWidth, variant)}\n >\n {loading ? (\n <ActivityIndicator color={colors.contentColor} size=\"small\" />\n ) : (\n <>\n {leadingIcon ? (\n <ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'leading')}>\n <Icon {...leadingIcon} color={colors.contentColor} size={iconSize} />\n </ReactNativeView>\n ) : null}\n <Text\n color={muted ? undefined : color}\n emphasis={muted ? 'muted' : variant === 'solid' ? 'inverse' : 'default'}\n variant={controlSize.textVariant}\n weight=\"semiBold\"\n >\n {children}\n </Text>\n {trailingIcon ? (\n <ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'trailing')}>\n <Icon {...trailingIcon} color={colors.contentColor} size={iconSize} />\n </ReactNativeView>\n ) : null}\n </>\n )}\n </View>\n );\n}\n\n/*** Resolves the outer Pressable layout style. */\nfunction resolvePressableStyle(fullWidth: boolean): ViewStyle {\n return { alignSelf: fullWidth ? 'stretch' : 'flex-start' };\n}\n\n/*** Resolves the themed Button content container style. */\nfunction resolveButtonContentStyle(\n controlSize: ReturnType<typeof resolveControlSize>,\n colors: ReturnType<typeof resolveButtonColors>,\n fullWidth: boolean,\n variant: NonNullable<ButtonProps['variant']>,\n): ViewStyle {\n return {\n alignItems: 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n flexDirection: 'row',\n justifyContent: 'center',\n minHeight: controlSize.minHeight,\n opacity: colors.opacity,\n width: fullWidth ? '100%' : undefined,\n };\n}\n\n/*** Resolves spacing around a leading or trailing Button icon. */\nfunction resolveAccessoryStyle(spacing: number, position: 'leading' | 'trailing'): ViewStyle {\n return position === 'leading' ? { marginRight: spacing } : { marginLeft: spacing };\n}\n\ninterface ButtonContentProps {\n children: ButtonProps['children'];\n color: NonNullable<ButtonProps['color']>;\n controlSize: ReturnType<typeof resolveControlSize>;\n fullWidth: boolean;\n leadingIcon: ButtonProps['leadingIcon'];\n loading: boolean;\n size: NonNullable<ButtonProps['size']>;\n state: InteractionState;\n theme: SurfaceTheme;\n trailingIcon: ButtonProps['trailingIcon'];\n variant: NonNullable<ButtonProps['variant']>;\n}\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../src/features/button/adapters/inbound/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,IAAI,IAAI,eAAe,EAAkB,MAAM,cAAc,CAAC;AAE1F,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GAChB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,+EAA+E;AAC/E,MAAM,UAAU,MAAM,CAAC,EACr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,EAAE,OAAO,EAAE,CAAC;AACrF,CAAC","sourcesContent":["import React from 'react';\nimport { ActivityIndicator, View as ReactNativeView, type ViewStyle } from 'react-native';\n\nimport {\n resolveButtonColors,\n resolveControlSize,\n resolveIconSize,\n} from '../../../../internal/resolvers';\nimport type { ButtonProps } from '../../../../types/button';\nimport type { InteractionState } from '../../../../types/pressable';\nimport type { SurfaceTheme } from '../../../../types/theme';\nimport { Icon } from '../../../icon/public';\nimport { View } from '../../../layout/public';\nimport { Pressable } from '../../../pressable/public';\nimport { useTheme } from '../../../theme/runtime';\nimport { Text } from '../../../typography/public';\n\n/*** Renders the primary Surface action control with semantic visual states. */\nexport function Button({\n children,\n variant = 'solid',\n color = 'primary',\n size = 'm',\n disabled = false,\n loading = false,\n leadingIcon,\n trailingIcon,\n fullWidth = false,\n onPress,\n testID,\n ...props\n}: ButtonProps) {\n const { theme } = useTheme();\n const controlSize = resolveControlSize(theme, size);\n\n return (\n <Pressable\n {...props}\n disabled={disabled || loading}\n onPress={onPress}\n style={resolvePressableStyle(fullWidth)}\n testID={testID}\n >\n {(state) => (\n <ButtonContent\n color={color}\n controlSize={controlSize}\n fullWidth={fullWidth}\n leadingIcon={leadingIcon}\n loading={loading}\n size={size}\n state={state}\n theme={theme}\n trailingIcon={trailingIcon}\n variant={variant}\n >\n {children}\n </ButtonContent>\n )}\n </Pressable>\n );\n}\n\n/*** Renders Button content after interaction colors have been resolved. */\nfunction ButtonContent({\n children,\n color,\n controlSize,\n fullWidth,\n leadingIcon,\n loading,\n size,\n state,\n theme,\n trailingIcon,\n variant,\n}: ButtonContentProps) {\n const colors = resolveButtonColors(theme, { variant, color, state });\n const iconSize = resolveIconSize(theme, size);\n\n return (\n <View\n px={controlSize.paddingHorizontal}\n py={controlSize.paddingVertical}\n radius={controlSize.borderRadius}\n style={resolveButtonContentStyle(controlSize, colors, fullWidth, variant)}\n >\n {loading ? (\n <ActivityIndicator color={colors.contentColor} size=\"small\" />\n ) : (\n <>\n {leadingIcon ? (\n <ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'leading')}>\n <Icon {...leadingIcon} color={colors.contentColor} size={iconSize} />\n </ReactNativeView>\n ) : null}\n <Text\n style={{ color: colors.contentColor }}\n variant={controlSize.textVariant}\n weight=\"semiBold\"\n >\n {children}\n </Text>\n {trailingIcon ? (\n <ReactNativeView style={resolveAccessoryStyle(theme.spacing.s, 'trailing')}>\n <Icon {...trailingIcon} color={colors.contentColor} size={iconSize} />\n </ReactNativeView>\n ) : null}\n </>\n )}\n </View>\n );\n}\n\n/*** Resolves the outer Pressable layout style. */\nfunction resolvePressableStyle(fullWidth: boolean): ViewStyle {\n return { alignSelf: fullWidth ? 'stretch' : 'flex-start' };\n}\n\n/*** Resolves the themed Button content container style. */\nfunction resolveButtonContentStyle(\n controlSize: ReturnType<typeof resolveControlSize>,\n colors: ReturnType<typeof resolveButtonColors>,\n fullWidth: boolean,\n variant: NonNullable<ButtonProps['variant']>,\n): ViewStyle {\n return {\n alignItems: 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderWidth: variant === 'solid' ? 0 : 1,\n flexDirection: 'row',\n justifyContent: 'center',\n minHeight: controlSize.minHeight,\n opacity: colors.opacity,\n width: fullWidth ? '100%' : undefined,\n };\n}\n\n/*** Resolves spacing around a leading or trailing Button icon. */\nfunction resolveAccessoryStyle(spacing: number, position: 'leading' | 'trailing'): ViewStyle {\n return position === 'leading' ? { marginRight: spacing } : { marginLeft: spacing };\n}\n\ninterface ButtonContentProps {\n children: ButtonProps['children'];\n color: NonNullable<ButtonProps['color']>;\n controlSize: ReturnType<typeof resolveControlSize>;\n fullWidth: boolean;\n leadingIcon: ButtonProps['leadingIcon'];\n loading: boolean;\n size: NonNullable<ButtonProps['size']>;\n state: InteractionState;\n theme: SurfaceTheme;\n trailingIcon: ButtonProps['trailingIcon'];\n variant: NonNullable<ButtonProps['variant']>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKxD,iFAAiF;AACjF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAOpC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/Icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMxD,iFAAiF;AACjF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAUpC"}
@@ -1,3 +1,5 @@
1
+ import { SURFACE_COLORS } from '../../../../constants/surfaceColor';
2
+ import { resolveTextColor } from '../../../../internal/resolvers/resolveTextColor';
1
3
  import { useTheme } from '../../../theme/runtime';
2
4
  import { resolveToken } from '../../../theme/utils/resolveToken';
3
5
  import { PortableIcon } from './PortableIcon';
@@ -7,7 +9,13 @@ export function Icon(props) {
7
9
  const size = props.size ?? 'm';
8
10
  const color = props.color ?? 'text';
9
11
  const resolvedSize = typeof size === 'number' ? size : resolveToken(theme.spacing, size);
10
- const resolvedColor = resolveToken(theme.colors, color);
12
+ const resolvedColor = typeof color === 'string' && isSurfaceColor(color)
13
+ ? resolveTextColor(theme, 'default', color)
14
+ : resolveToken(theme.colors, color);
11
15
  return <PortableIcon {...props} color={resolvedColor} size={resolvedSize}/>;
12
16
  }
17
+ /*** Distinguish semantic color roles from raw icon colors and other tokens. */
18
+ function isSurfaceColor(value) {
19
+ return SURFACE_COLORS.some((role) => role === value);
20
+ }
13
21
  //# sourceMappingURL=Icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/Icon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,iFAAiF;AACjF,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC;IACpC,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACxD,OAAO,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,EAAG,CAAC;AAC/E,CAAC","sourcesContent":["import type { IconProps } from '../../../../types/icon';\nimport { useTheme } from '../../../theme/runtime';\nimport { resolveToken } from '../../../theme/utils/resolveToken';\nimport { PortableIcon } from './PortableIcon';\n\n/*** Renders a theme-aware font or SVG icon through the portable icon adapter. */\nexport function Icon(props: IconProps) {\n const { theme } = useTheme();\n const size = props.size ?? 'm';\n const color = props.color ?? 'text';\n const resolvedSize = typeof size === 'number' ? size : resolveToken(theme.spacing, size);\n const resolvedColor = resolveToken(theme.colors, color);\n return <PortableIcon {...props} color={resolvedColor} size={resolvedSize} />;\n}\n"]}
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAGnF,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,iFAAiF;AACjF,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC;IACpC,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzF,MAAM,aAAa,GACjB,OAAO,KAAK,KAAK,QAAQ,IAAI,cAAc,CAAC,KAAK,CAAC;QAChD,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC;QAC3C,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACxC,OAAO,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,EAAG,CAAC;AAC/E,CAAC;AAED,+EAA+E;AAC/E,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import { SURFACE_COLORS } from '../../../../constants/surfaceColor';\nimport { resolveTextColor } from '../../../../internal/resolvers/resolveTextColor';\nimport type { IconProps } from '../../../../types/icon';\nimport type { SurfaceColor } from '../../../../types/surfaceColor';\nimport { useTheme } from '../../../theme/runtime';\nimport { resolveToken } from '../../../theme/utils/resolveToken';\nimport { PortableIcon } from './PortableIcon';\n\n/*** Renders a theme-aware font or SVG icon through the portable icon adapter. */\nexport function Icon(props: IconProps) {\n const { theme } = useTheme();\n const size = props.size ?? 'm';\n const color = props.color ?? 'text';\n const resolvedSize = typeof size === 'number' ? size : resolveToken(theme.spacing, size);\n const resolvedColor =\n typeof color === 'string' && isSurfaceColor(color)\n ? resolveTextColor(theme, 'default', color)\n : resolveToken(theme.colors, color);\n return <PortableIcon {...props} color={resolvedColor} size={resolvedSize} />;\n}\n\n/*** Distinguish semantic color roles from raw icon colors and other tokens. */\nfunction isSurfaceColor(value: string): value is SurfaceColor {\n return SURFACE_COLORS.some((role) => role === value);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOvD,oEAAoE;AACpE,wBAAgB,GAAG,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,iBAA6B,EAC7B,MAAM,EACN,QAAQ,GACT,EAAE,QAAQ,qBAkCV"}
1
+ {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOvD,oEAAoE;AACpE,wBAAgB,GAAG,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,QAAgB,EAChB,iBAA6B,EAC7B,MAAM,EACN,QAAQ,GACT,EAAE,QAAQ,qBAuCV"}
@@ -8,15 +8,19 @@ import { useTabsContext } from '../../composition/useTabsContext';
8
8
  /*** Renders one accessible selectable tab inside a Tabs context. */
9
9
  export function Tab({ value, children, disabled = false, interactionPolicy = 'enabled', testID, trailing, }) {
10
10
  const { theme } = useTheme();
11
- const { activeValue, getPanelId, getTabId, setActiveValue, setFocusedValue } = useTabsContext();
11
+ const { activeValue, getPanelId, getTabId, setActiveValue, setFocusedValue, variant } = useTabsContext();
12
12
  const pressableRef = useTabRegistration({ disabled, value });
13
13
  const selected = activeValue === value;
14
14
  const passive = interactionPolicy === 'passive';
15
15
  const onPress = passive || disabled ? undefined : () => setActiveValue(value);
16
16
  return (<Pressable accessibilityLabel={undefined} accessibilityRole="tab" accessibilityState={{ disabled, selected }} aria-controls={getPanelId(value)} disabled={disabled} nativeID={getTabId(value)} onBlur={() => setFocusedValue(undefined)} onFocus={() => setFocusedValue(value)} onPress={onPress} ref={pressableRef} testID={testID}>
17
17
  <View px="m" py="s" style={resolveTabStyle({
18
+ activeBackground: theme.semantics.surface.subtle,
18
19
  borderColor: selected ? 'transparent' : theme.semantics.border.default,
19
20
  disabled,
21
+ radius: theme.radii.s,
22
+ selected,
23
+ variant,
20
24
  })}>
21
25
  {renderTabContent(children, trailing, selected)}
22
26
  </View>
@@ -35,7 +39,15 @@ function renderTabContent(children, trailing, selected) {
35
39
  </View>);
36
40
  }
37
41
  /*** Resolves active and disabled visual state without inline JSX styles. */
38
- function resolveTabStyle({ borderColor, disabled, }) {
42
+ function resolveTabStyle({ activeBackground, borderColor, disabled, radius, selected, variant, }) {
43
+ if (variant === 'attached') {
44
+ return {
45
+ backgroundColor: selected ? activeBackground : 'transparent',
46
+ borderTopLeftRadius: selected ? radius : 0,
47
+ borderTopRightRadius: selected ? radius : 0,
48
+ opacity: disabled ? 0.64 : 1,
49
+ };
50
+ }
39
51
  return { borderBottomColor: borderColor, borderBottomWidth: 2, opacity: disabled ? 0.64 : 1 };
40
52
  }
41
53
  //# sourceMappingURL=Tab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO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AAC,CACR,CAAC;AACJ,CAAC;AAED,4EAA4E;AAC5E,SAAS,eAAe,CAAC,EACvB,WAAW,EACX,QAAQ,GAIT;IACC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAChG,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, type ViewStyle } from 'react-native';\n\nimport type { TabProps } from '../../../../types/tabs';\nimport { View } from '../../../layout/public';\nimport { useTheme } from '../../../theme/runtime';\nimport { Text } from '../../../typography/public';\nimport { useTabRegistration } from '../../composition/useTabRegistration';\nimport { useTabsContext } from '../../composition/useTabsContext';\n\n/*** Renders one accessible selectable tab inside a Tabs context. */\nexport function Tab({\n value,\n children,\n disabled = false,\n interactionPolicy = 'enabled',\n testID,\n trailing,\n}: TabProps) {\n const { theme } = useTheme();\n const { activeValue, getPanelId, getTabId, setActiveValue, setFocusedValue } = useTabsContext();\n const pressableRef = useTabRegistration({ disabled, value });\n const selected = activeValue === value;\n const passive = interactionPolicy === 'passive';\n const onPress = passive || disabled ? undefined : () => setActiveValue(value);\n\n return (\n <Pressable\n accessibilityLabel={undefined}\n accessibilityRole=\"tab\"\n accessibilityState={{ disabled, selected }}\n aria-controls={getPanelId(value)}\n disabled={disabled}\n nativeID={getTabId(value)}\n onBlur={() => setFocusedValue(undefined)}\n onFocus={() => setFocusedValue(value)}\n onPress={onPress}\n ref={pressableRef}\n testID={testID}\n >\n <View\n px=\"m\"\n py=\"s\"\n style={resolveTabStyle({\n borderColor: selected ? 'transparent' : theme.semantics.border.default,\n disabled,\n })}\n >\n {renderTabContent(children, trailing, selected)}\n </View>\n </Pressable>\n );\n}\n\n/*** Renders the canonical tab label with optional trailing content. */\nfunction renderTabContent(\n children: React.ReactNode,\n trailing: React.ReactNode,\n selected: boolean,\n): React.ReactNode {\n const label = (\n <Text color={selected ? 'primary' : undefined} variant=\"label\" weight=\"medium\">\n {children}\n </Text>\n );\n if (trailing === undefined) return label;\n return (\n <View align=\"center\" direction=\"row\" gap=\"xs\">\n {label}\n {trailing}\n </View>\n );\n}\n\n/*** Resolves active and disabled visual state without inline JSX styles. */\nfunction resolveTabStyle({\n borderColor,\n disabled,\n}: {\n borderColor: string;\n disabled: boolean;\n}): ViewStyle {\n return { borderBottomColor: borderColor, borderBottomWidth: 2, opacity: disabled ? 0.64 : 1 };\n}\n"]}
1
+ {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAC;AAGzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,oEAAoE;AACpE,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,iBAAiB,GAAG,SAAS,EAC7B,MAAM,EACN,QAAQ,GACC;IACT,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,GACnF,cAAc,EAAE,CAAC;IACnB,MAAM,YAAY,GAAG,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,WAAW,KAAK,KAAK,CAAC;IACvC,MAAM,OAAO,GAAG,iBAAiB,KAAK,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,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, type ViewStyle } from 'react-native';\n\nimport type { TabProps } from '../../../../types/tabs';\nimport { View } from '../../../layout/public';\nimport { useTheme } from '../../../theme/runtime';\nimport { Text } from '../../../typography/public';\nimport { useTabRegistration } from '../../composition/useTabRegistration';\nimport { useTabsContext } from '../../composition/useTabsContext';\n\n/*** Renders one accessible selectable tab inside a Tabs context. */\nexport function Tab({\n value,\n children,\n disabled = false,\n interactionPolicy = 'enabled',\n testID,\n trailing,\n}: TabProps) {\n const { theme } = useTheme();\n const { activeValue, getPanelId, getTabId, setActiveValue, setFocusedValue, variant } =\n useTabsContext();\n const pressableRef = useTabRegistration({ disabled, value });\n const selected = activeValue === value;\n const passive = interactionPolicy === 'passive';\n const onPress = passive || disabled ? undefined : () => setActiveValue(value);\n\n return (\n <Pressable\n accessibilityLabel={undefined}\n accessibilityRole=\"tab\"\n accessibilityState={{ disabled, selected }}\n aria-controls={getPanelId(value)}\n disabled={disabled}\n nativeID={getTabId(value)}\n onBlur={() => setFocusedValue(undefined)}\n onFocus={() => setFocusedValue(value)}\n onPress={onPress}\n ref={pressableRef}\n testID={testID}\n >\n <View\n px=\"m\"\n py=\"s\"\n style={resolveTabStyle({\n activeBackground: theme.semantics.surface.subtle,\n borderColor: selected ? 'transparent' : theme.semantics.border.default,\n disabled,\n radius: theme.radii.s,\n selected,\n variant,\n })}\n >\n {renderTabContent(children, trailing, selected)}\n </View>\n </Pressable>\n );\n}\n\n/*** Renders the canonical tab label with optional trailing content. */\nfunction renderTabContent(\n children: React.ReactNode,\n trailing: React.ReactNode,\n selected: boolean,\n): React.ReactNode {\n const label = (\n <Text color={selected ? 'primary' : undefined} variant=\"label\" weight=\"medium\">\n {children}\n </Text>\n );\n if (trailing === undefined) return label;\n return (\n <View align=\"center\" direction=\"row\" gap=\"xs\">\n {label}\n {trailing}\n </View>\n );\n}\n\n/*** Resolves active and disabled visual state without inline JSX styles. */\nfunction resolveTabStyle({\n activeBackground,\n borderColor,\n disabled,\n radius,\n selected,\n variant,\n}: {\n activeBackground: string;\n borderColor: string;\n disabled: boolean;\n radius: number;\n selected: boolean;\n variant: 'line' | 'attached';\n}): ViewStyle {\n if (variant === 'attached') {\n return {\n backgroundColor: selected ? activeBackground : 'transparent',\n borderTopLeftRadius: selected ? radius : 0,\n borderTopRightRadius: selected ? radius : 0,\n opacity: disabled ? 0.64 : 1,\n };\n }\n\n return { borderBottomColor: borderColor, borderBottomWidth: 2, opacity: disabled ? 0.64 : 1 };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { TabPanelProps } from '../../../../types/tabs';
3
3
  /*** Renders the active content panel with the supplied View layout and tab accessibility linkage. */
4
- export declare function TabPanel({ value, children, testID, ...layoutProps }: TabPanelProps): React.JSX.Element | null;
4
+ export declare function TabPanel({ value, children, testID, style, ...layoutProps }: TabPanelProps): React.JSX.Element | null;
5
5
  //# sourceMappingURL=TabPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabPanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAM5D,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,EAAE,aAAa,4BAgBlF"}
1
+ {"version":3,"file":"TabPanel.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAO5D,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,EAAE,aAAa,4BAqBzF"}
@@ -1,13 +1,18 @@
1
1
  import React from 'react';
2
2
  import { View } from '../../../layout/public';
3
+ import { useTheme } from '../../../theme/runtime';
3
4
  import { useTabsContext } from '../../composition/useTabsContext';
4
5
  const TAB_PANEL_ROLE = 'tabpanel';
5
6
  /*** Renders the active content panel with the supplied View layout and tab accessibility linkage. */
6
- export function TabPanel({ value, children, testID, ...layoutProps }) {
7
- const { activeValue, getPanelId, getTabId } = useTabsContext();
7
+ export function TabPanel({ value, children, testID, style, ...layoutProps }) {
8
+ const { theme } = useTheme();
9
+ const { activeValue, getPanelId, getTabId, variant } = useTabsContext();
8
10
  if (activeValue !== value)
9
11
  return null;
10
- return (<View {...layoutProps} accessibilityLabelledBy={getTabId(value)} accessibilityRole={TAB_PANEL_ROLE} nativeID={getPanelId(value)} testID={testID}>
12
+ return (<View {...layoutProps} accessibilityLabelledBy={getTabId(value)} accessibilityRole={TAB_PANEL_ROLE} nativeID={getPanelId(value)} style={[
13
+ style,
14
+ variant === 'attached' ? { backgroundColor: theme.semantics.surface.subtle } : undefined,
15
+ ]} testID={testID}>
11
16
  {children}
12
17
  </View>);
13
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TabPanel.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,cAAc,GAAG,UAAoE,CAAC;AAE5F,qGAAqG;AACrG,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,EAAiB;IACjF,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAC;IAE/D,IAAI,WAAW,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,CAAC,IAAI,CACH,IAAI,WAAW,CAAC,CAChB,uBAAuB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CACzC,iBAAiB,CAAC,CAAC,cAAc,CAAC,CAClC,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAC5B,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TabPanelProps } from '../../../../types/tabs';\nimport { View } from '../../../layout/public';\nimport { useTabsContext } from '../../composition/useTabsContext';\n\nconst TAB_PANEL_ROLE = 'tabpanel' as React.ComponentProps<typeof View>['accessibilityRole'];\n\n/*** Renders the active content panel with the supplied View layout and tab accessibility linkage. */\nexport function TabPanel({ value, children, testID, ...layoutProps }: TabPanelProps) {\n const { activeValue, getPanelId, getTabId } = useTabsContext();\n\n if (activeValue !== value) return null;\n\n return (\n <View\n {...layoutProps}\n accessibilityLabelledBy={getTabId(value)}\n accessibilityRole={TAB_PANEL_ROLE}\n nativeID={getPanelId(value)}\n testID={testID}\n >\n {children}\n </View>\n );\n}\n"]}
1
+ {"version":3,"file":"TabPanel.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/TabPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,cAAc,GAAG,UAAoE,CAAC;AAE5F,qGAAqG;AACrG,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,EAAiB;IACxF,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IAExE,IAAI,WAAW,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO,CACL,CAAC,IAAI,CACH,IAAI,WAAW,CAAC,CAChB,uBAAuB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CACzC,iBAAiB,CAAC,CAAC,cAAc,CAAC,CAClC,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAC5B,KAAK,CAAC,CAAC;YACL,KAAK;YACL,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;SACzF,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TabPanelProps } from '../../../../types/tabs';\nimport { View } from '../../../layout/public';\nimport { useTheme } from '../../../theme/runtime';\nimport { useTabsContext } from '../../composition/useTabsContext';\n\nconst TAB_PANEL_ROLE = 'tabpanel' as React.ComponentProps<typeof View>['accessibilityRole'];\n\n/*** Renders the active content panel with the supplied View layout and tab accessibility linkage. */\nexport function TabPanel({ value, children, testID, style, ...layoutProps }: TabPanelProps) {\n const { theme } = useTheme();\n const { activeValue, getPanelId, getTabId, variant } = useTabsContext();\n\n if (activeValue !== value) return null;\n\n return (\n <View\n {...layoutProps}\n accessibilityLabelledBy={getTabId(value)}\n accessibilityRole={TAB_PANEL_ROLE}\n nativeID={getPanelId(value)}\n style={[\n style,\n variant === 'attached' ? { backgroundColor: theme.semantics.surface.subtle } : undefined,\n ]}\n testID={testID}\n >\n {children}\n </View>\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import type { TabsProps } from '../../../../types/tabs';
3
3
  /*** Provides accessible tab selection and forwards View layout to the tab container. */
4
- export declare function Tabs({ children, defaultValue, onValueChange, testID, value, ...layoutProps }: TabsProps): React.JSX.Element;
4
+ export declare function Tabs({ children, defaultValue, onValueChange, testID, value, variant, ...layoutProps }: TabsProps): React.JSX.Element;
5
5
  //# sourceMappingURL=Tabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKxD,wFAAwF;AACxF,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,EACL,GAAG,WAAW,EACf,EAAE,SAAS,qBAUX"}
1
+ {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKxD,wFAAwF;AACxF,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,EACL,OAAO,EACP,GAAG,WAAW,EACf,EAAE,SAAS,qBAUX"}
@@ -3,8 +3,8 @@ import { View } from '../../../layout/public';
3
3
  import { TabsContext } from '../../composition/TabsContext';
4
4
  import { useTabsController } from '../../composition/useTabsController';
5
5
  /*** Provides accessible tab selection and forwards View layout to the tab container. */
6
- export function Tabs({ children, defaultValue, onValueChange, testID, value, ...layoutProps }) {
7
- const contextValue = useTabsController({ defaultValue, onValueChange, testID, value });
6
+ export function Tabs({ children, defaultValue, onValueChange, testID, value, variant, ...layoutProps }) {
7
+ const contextValue = useTabsController({ defaultValue, onValueChange, testID, value, variant });
8
8
  return (<TabsContext value={contextValue}>
9
9
  <View {...layoutProps} testID={testID}>
10
10
  {children}
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,wFAAwF;AACxF,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,EACL,GAAG,WAAW,EACJ;IACV,MAAM,YAAY,GAAG,iBAAiB,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAEvF,OAAO,CACL,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAC/B;MAAA,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACpC;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TabsProps } from '../../../../types/tabs';\nimport { View } from '../../../layout/public';\nimport { TabsContext } from '../../composition/TabsContext';\nimport { useTabsController } from '../../composition/useTabsController';\n\n/*** Provides accessible tab selection and forwards View layout to the tab container. */\nexport function Tabs({\n children,\n defaultValue,\n onValueChange,\n testID,\n value,\n ...layoutProps\n}: TabsProps) {\n const contextValue = useTabsController({ defaultValue, onValueChange, testID, value });\n\n return (\n <TabsContext value={contextValue}>\n <View {...layoutProps} testID={testID}>\n {children}\n </View>\n </TabsContext>\n );\n}\n"]}
1
+ {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../../../src/features/tabs/adapters/inbound/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,wFAAwF;AACxF,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,EACL,OAAO,EACP,GAAG,WAAW,EACJ;IACV,MAAM,YAAY,GAAG,iBAAiB,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAEhG,OAAO,CACL,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAC/B;MAAA,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACpC;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TabsProps } from '../../../../types/tabs';\nimport { View } from '../../../layout/public';\nimport { TabsContext } from '../../composition/TabsContext';\nimport { useTabsController } from '../../composition/useTabsController';\n\n/*** Provides accessible tab selection and forwards View layout to the tab container. */\nexport function Tabs({\n children,\n defaultValue,\n onValueChange,\n testID,\n value,\n variant,\n ...layoutProps\n}: TabsProps) {\n const contextValue = useTabsController({ defaultValue, onValueChange, testID, value, variant });\n\n return (\n <TabsContext value={contextValue}>\n <View {...layoutProps} testID={testID}>\n {children}\n </View>\n </TabsContext>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { TabsContextValue, TabsProps } from '../../../types/tabs';
2
2
  /*** Owns controlled state, registration, focus state, and ids for one Tabs instance. */
3
- export declare function useTabsController({ defaultValue, onValueChange, testID, value, }: Pick<TabsProps, 'defaultValue' | 'onValueChange' | 'testID' | 'value'>): TabsContextValue;
3
+ export declare function useTabsController({ defaultValue, onValueChange, testID, value, variant, }: Pick<TabsProps, 'defaultValue' | 'onValueChange' | 'testID' | 'value' | 'variant'>): TabsContextValue;
4
4
  //# sourceMappingURL=useTabsController.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTabsController.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsController.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGxF,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,GACN,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG,gBAAgB,CA0C3F"}
1
+ {"version":3,"file":"useTabsController.d.ts","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsController.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGxF,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,EACL,OAAgB,GACjB,EAAE,IAAI,CACL,SAAS,EACT,cAAc,GAAG,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAClE,GAAG,gBAAgB,CA2CnB"}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useControllableState } from '../../../internal/useControllableState';
3
3
  import { resolveTabElementId } from '../utils/resolveTabElementId';
4
4
  /*** Owns controlled state, registration, focus state, and ids for one Tabs instance. */
5
- export function useTabsController({ defaultValue, onValueChange, testID, value, }) {
5
+ export function useTabsController({ defaultValue, onValueChange, testID, value, variant = 'line', }) {
6
6
  const [activeValue, setActiveValue] = useControllableState({
7
7
  defaultValue,
8
8
  onChange: (nextValue) => {
@@ -38,6 +38,7 @@ export function useTabsController({ defaultValue, onValueChange, testID, value,
38
38
  setFocusedValue,
39
39
  tabs,
40
40
  unregisterTab,
41
- }), [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab]);
41
+ variant,
42
+ }), [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab, variant]);
42
43
  }
43
44
  //# sourceMappingURL=useTabsController.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTabsController.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,EAChC,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,GACkE;IACvE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,oBAAoB,CAAqB;QAC7E,YAAY;QACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;YACtB,IAAI,SAAS,KAAK,SAAS;gBAAE,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1D,CAAC;QACD,KAAK;KACN,CAAC,CAAC;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACtF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAA6B,EAAE,CAAC,CAAC;IAEvE,MAAM,WAAW,GAAG,KAAK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AE,MAAM,EAAE,QAAQ,CAAC;QAChF,QAAQ,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC;QAC5E,WAAW;QACX,cAAc,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;QAChE,eAAe;QACf,IAAI;QACJ,aAAa;KACd,CAAC,EACF,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CACtF,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { useControllableState } from '../../../internal/useControllableState';\nimport type { TabRegistration, TabsContextValue, TabsProps } from '../../../types/tabs';\nimport { resolveTabElementId } from '../utils/resolveTabElementId';\n\n/*** Owns controlled state, registration, focus state, and ids for one Tabs instance. */\nexport function useTabsController({\n defaultValue,\n onValueChange,\n testID,\n value,\n}: Pick<TabsProps, 'defaultValue' | 'onValueChange' | 'testID' | 'value'>): TabsContextValue {\n const [activeValue, setActiveValue] = useControllableState<string | undefined>({\n defaultValue,\n onChange: (nextValue) => {\n if (nextValue !== undefined) onValueChange?.(nextValue);\n },\n value,\n });\n const [focusedValue, setFocusedValue] = React.useState<string | undefined>(undefined);\n const [tabs, setTabs] = React.useState<readonly TabRegistration[]>([]);\n\n const registerTab = React.useCallback((tab: TabRegistration) => {\n setTabs((current) =>\n current.some((entry) => entry.value === tab.value)\n ? current.map((entry) => (entry.value === tab.value ? tab : entry))\n : [...current, tab],\n );\n }, []);\n const unregisterTab = React.useCallback((valueToRemove: string) => {\n setTabs((current) => current.filter((entry) => entry.value !== valueToRemove));\n }, []);\n\n React.useEffect(() => {\n if (activeValue !== undefined) return;\n const firstEnabledTab = tabs.find((entry) => !entry.disabled);\n if (firstEnabledTab) setActiveValue(firstEnabledTab.value);\n }, [activeValue, setActiveValue, tabs]);\n\n return React.useMemo(\n () => ({\n activeValue,\n focusedValue,\n getPanelId: (tabValue: string) => resolveTabElementId('panel', testID, tabValue),\n getTabId: (tabValue: string) => resolveTabElementId('tab', testID, tabValue),\n registerTab,\n setActiveValue: (nextValue: string) => setActiveValue(nextValue),\n setFocusedValue,\n tabs,\n unregisterTab,\n }),\n [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab],\n );\n}\n"]}
1
+ {"version":3,"file":"useTabsController.js","sourceRoot":"","sources":["../../../../src/features/tabs/composition/useTabsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,EAChC,YAAY,EACZ,aAAa,EACb,MAAM,EACN,KAAK,EACL,OAAO,GAAG,MAAM,GAIjB;IACC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,oBAAoB,CAAqB;QAC7E,YAAY;QACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;YACtB,IAAI,SAAS,KAAK,SAAS;gBAAE,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1D,CAAC;QACD,KAAK;KACN,CAAC,CAAC;IACH,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACtF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAA6B,EAAE,CAAC,CAAC;IAEvE,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAoB,EAAE,EAAE;QAC7D,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAClB,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC;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c,CAAC,SAAS,CAAC;QAChE,eAAe;QACf,IAAI;QACJ,aAAa;QACb,OAAO;KACR,CAAC,EACF,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAC/F,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { useControllableState } from '../../../internal/useControllableState';\nimport type { TabRegistration, TabsContextValue, TabsProps } from '../../../types/tabs';\nimport { resolveTabElementId } from '../utils/resolveTabElementId';\n\n/*** Owns controlled state, registration, focus state, and ids for one Tabs instance. */\nexport function useTabsController({\n defaultValue,\n onValueChange,\n testID,\n value,\n variant = 'line',\n}: Pick<\n TabsProps,\n 'defaultValue' | 'onValueChange' | 'testID' | 'value' | 'variant'\n>): TabsContextValue {\n const [activeValue, setActiveValue] = useControllableState<string | undefined>({\n defaultValue,\n onChange: (nextValue) => {\n if (nextValue !== undefined) onValueChange?.(nextValue);\n },\n value,\n });\n const [focusedValue, setFocusedValue] = React.useState<string | undefined>(undefined);\n const [tabs, setTabs] = React.useState<readonly TabRegistration[]>([]);\n\n const registerTab = React.useCallback((tab: TabRegistration) => {\n setTabs((current) =>\n current.some((entry) => entry.value === tab.value)\n ? current.map((entry) => (entry.value === tab.value ? tab : entry))\n : [...current, tab],\n );\n }, []);\n const unregisterTab = React.useCallback((valueToRemove: string) => {\n setTabs((current) => current.filter((entry) => entry.value !== valueToRemove));\n }, []);\n\n React.useEffect(() => {\n if (activeValue !== undefined) return;\n const firstEnabledTab = tabs.find((entry) => !entry.disabled);\n if (firstEnabledTab) setActiveValue(firstEnabledTab.value);\n }, [activeValue, setActiveValue, tabs]);\n\n return React.useMemo(\n () => ({\n activeValue,\n focusedValue,\n getPanelId: (tabValue: string) => resolveTabElementId('panel', testID, tabValue),\n getTabId: (tabValue: string) => resolveTabElementId('tab', testID, tabValue),\n registerTab,\n setActiveValue: (nextValue: string) => setActiveValue(nextValue),\n setFocusedValue,\n tabs,\n unregisterTab,\n variant,\n }),\n [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab, variant],\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- export type { TabListProps, TabPanelProps, TabProps, TabsProps } from '../../types/tabs';
1
+ export type { TabListProps, TabPanelProps, TabProps, TabsProps, TabsVariant, } from '../../types/tabs';
2
2
  export { Tab } from './adapters/inbound/Tab';
3
3
  export { TabList } from './adapters/inbound/TabList';
4
4
  export { TabPanel } from './adapters/inbound/TabPanel';
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/tabs/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/tabs/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/tabs/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export type { TabListProps, TabPanelProps, TabProps, TabsProps } from '../../types/tabs';\nexport { Tab } from './adapters/inbound/Tab';\nexport { TabList } from './adapters/inbound/TabList';\nexport { TabPanel } from './adapters/inbound/TabPanel';\nexport { Tabs } from './adapters/inbound/Tabs';\n"]}
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/tabs/public.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export type {\n TabListProps,\n TabPanelProps,\n TabProps,\n TabsProps,\n TabsVariant,\n} from '../../types/tabs';\nexport { Tab } from './adapters/inbound/Tab';\nexport { TabList } from './adapters/inbound/TabList';\nexport { TabPanel } from './adapters/inbound/TabPanel';\nexport { Tabs } from './adapters/inbound/Tabs';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAKhF,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EACb,WAAqB,GACtB,EAAE,kBAAkB,+BA6BpB"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAKhF,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EACb,WAAqB,GACtB,EAAE,kBAAkB,+BA8BpB"}
@@ -15,6 +15,7 @@ export function ThemeProvider({ children, initialConfig, initialMode = 'light',
15
15
  const value = useMemo(() => ({
16
16
  theme,
17
17
  mode,
18
+ inverted: false,
18
19
  setThemeConfig: (nextConfig) => setConfig((previous) => deepMerge(previous, nextConfig)),
19
20
  setMode,
20
21
  }), [mode, theme]);
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,gGAAgG;AAChG,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EACb,WAAW,GAAG,OAAO,GACF;IACnB,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAc,GAAG,EAAE,CACrD,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CACpF,CAAC;IACF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAE1C,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,EAC7C,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,CAC7B,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,IAAI;QACJ,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxF,OAAO;KACR,CAAC,EACF,CAAC,IAAI,EAAE,KAAK,CAAC,CACd,CAAC;IAEF,OAAO,CACL,CAAC,kBAAkB,CACjB;MAAA,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAChC;QAAA,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAAE,eAAe,CAC9C;MAAA,EAAE,mBAAmB,CACvB;IAAA,EAAE,kBAAkB,CAAC,CACtB,CAAC;AACJ,CAAC","sourcesContent":["import type { ThemeConfig } from '@ankhorage/contracts';\nimport { deepMerge } from '@ankhorage/utility/object';\nimport { useMemo, useState } from 'react';\n\nimport { ResponsiveProvider } from '../../../../core/responsive/ResponsiveProvider';\nimport { OverlayProvider } from '../../../../internal/overlay/OverlayProvider';\nimport type { ThemeProviderProps, ThemeRuntime } from '../../../../types/theme';\nimport { useFontRuntime } from '../../../font/adapters/inbound/useFontRuntime';\nimport { createTheme } from '../../application/use-cases/createTheme';\nimport { ThemeRuntimeContext } from './ThemeRuntimeContext';\n\n/*** Install the app-level Surface theme together with global responsive and overlay runtime. */\nexport function ThemeProvider({\n children,\n initialConfig,\n initialMode = 'light',\n}: ThemeProviderProps) {\n const defaultTheme = useMemo(() => createTheme(), []);\n const [config, setConfig] = useState<ThemeConfig>(() =>\n initialConfig ? deepMerge(defaultTheme.config, initialConfig) : defaultTheme.config,\n );\n const [mode, setMode] = useState(initialMode);\n const { activeFontId } = useFontRuntime();\n\n const theme = useMemo(\n () => createTheme(config, mode, activeFontId),\n [activeFontId, config, mode],\n );\n const value = useMemo<ThemeRuntime>(\n () => ({\n theme,\n mode,\n setThemeConfig: (nextConfig) => setConfig((previous) => deepMerge(previous, nextConfig)),\n setMode,\n }),\n [mode, theme],\n );\n\n return (\n <ResponsiveProvider>\n <ThemeRuntimeContext value={value}>\n <OverlayProvider>{children}</OverlayProvider>\n </ThemeRuntimeContext>\n </ResponsiveProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,gGAAgG;AAChG,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EACb,WAAW,GAAG,OAAO,GACF;IACnB,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAc,GAAG,EAAE,CACrD,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CACpF,CAAC;IACF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAE1C,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,EAC7C,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,CAC7B,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,KAAK;QACL,IAAI;QACJ,QAAQ,EAAE,KAAK;QACf,cAAc,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACxF,OAAO;KACR,CAAC,EACF,CAAC,IAAI,EAAE,KAAK,CAAC,CACd,CAAC;IAEF,OAAO,CACL,CAAC,kBAAkB,CACjB;MAAA,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAChC;QAAA,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAAE,eAAe,CAC9C;MAAA,EAAE,mBAAmB,CACvB;IAAA,EAAE,kBAAkB,CAAC,CACtB,CAAC;AACJ,CAAC","sourcesContent":["import type { ThemeConfig } from '@ankhorage/contracts';\nimport { deepMerge } from '@ankhorage/utility/object';\nimport { useMemo, useState } from 'react';\n\nimport { ResponsiveProvider } from '../../../../core/responsive/ResponsiveProvider';\nimport { OverlayProvider } from '../../../../internal/overlay/OverlayProvider';\nimport type { ThemeProviderProps, ThemeRuntime } from '../../../../types/theme';\nimport { useFontRuntime } from '../../../font/adapters/inbound/useFontRuntime';\nimport { createTheme } from '../../application/use-cases/createTheme';\nimport { ThemeRuntimeContext } from './ThemeRuntimeContext';\n\n/*** Install the app-level Surface theme together with global responsive and overlay runtime. */\nexport function ThemeProvider({\n children,\n initialConfig,\n initialMode = 'light',\n}: ThemeProviderProps) {\n const defaultTheme = useMemo(() => createTheme(), []);\n const [config, setConfig] = useState<ThemeConfig>(() =>\n initialConfig ? deepMerge(defaultTheme.config, initialConfig) : defaultTheme.config,\n );\n const [mode, setMode] = useState(initialMode);\n const { activeFontId } = useFontRuntime();\n\n const theme = useMemo(\n () => createTheme(config, mode, activeFontId),\n [activeFontId, config, mode],\n );\n const value = useMemo<ThemeRuntime>(\n () => ({\n theme,\n mode,\n inverted: false,\n setThemeConfig: (nextConfig) => setConfig((previous) => deepMerge(previous, nextConfig)),\n setMode,\n }),\n [mode, theme],\n );\n\n return (\n <ResponsiveProvider>\n <ThemeRuntimeContext value={value}>\n <OverlayProvider>{children}</OverlayProvider>\n </ThemeRuntimeContext>\n </ResponsiveProvider>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeRuntimeContext.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeRuntimeContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK5D,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,uCAK9B,CAAC"}
1
+ {"version":3,"file":"ThemeRuntimeContext.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeRuntimeContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK5D,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,uCAM9B,CAAC"}
@@ -5,6 +5,7 @@ const defaultTheme = createTheme();
5
5
  export const ThemeRuntimeContext = createContext({
6
6
  theme: defaultTheme,
7
7
  mode: 'light',
8
+ inverted: false,
8
9
  setThemeConfig: () => undefined,
9
10
  setMode: () => undefined,
10
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeRuntimeContext.js","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeRuntimeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,MAAM,YAAY,GAAG,WAAW,EAAE,CAAC;AAEnC,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAe;IAC7D,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,OAAO;IACb,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;IAC/B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;CACzB,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport type { ThemeRuntime } from '../../../../types/theme';\nimport { createTheme } from '../../application/use-cases/createTheme';\n\nconst defaultTheme = createTheme();\n\n/*** Holds the active Surface theme runtime for component consumption. */\nexport const ThemeRuntimeContext = createContext<ThemeRuntime>({\n theme: defaultTheme,\n mode: 'light',\n setThemeConfig: () => undefined,\n setMode: () => undefined,\n});\n"]}
1
+ {"version":3,"file":"ThemeRuntimeContext.js","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeRuntimeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,MAAM,YAAY,GAAG,WAAW,EAAE,CAAC;AAEnC,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAe;IAC7D,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,KAAK;IACf,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;IAC/B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;CACzB,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\nimport type { ThemeRuntime } from '../../../../types/theme';\nimport { createTheme } from '../../application/use-cases/createTheme';\n\nconst defaultTheme = createTheme();\n\n/*** Holds the active Surface theme runtime for component consumption. */\nexport const ThemeRuntimeContext = createContext<ThemeRuntime>({\n theme: defaultTheme,\n mode: 'light',\n inverted: false,\n setThemeConfig: () => undefined,\n setMode: () => undefined,\n});\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ThemeScopeProps } from '../../../../types/theme';
2
- /*** Apply a nested Surface theme or mode override without remounting app-level providers. */
3
- export declare function ThemeScope({ children, themeConfig, mode }: ThemeScopeProps): import("react").JSX.Element;
2
+ /*** Apply nested theme, mode, or inherited surface-polarity overrides without remounting providers. */
3
+ export declare function ThemeScope({ children, themeConfig, mode, inverted }: ThemeScopeProps): import("react").JSX.Element;
4
4
  //# sourceMappingURL=ThemeScope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeScope.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeScope.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM7E,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,eAAe,+BAkB1E"}
1
+ {"version":3,"file":"ThemeScope.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeScope.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM7E,uGAAuG;AACvG,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAmBpF"}
@@ -4,14 +4,15 @@ import { useFontRuntime } from '../../../font/adapters/inbound/useFontRuntime';
4
4
  import { createTheme } from '../../application/use-cases/createTheme';
5
5
  import { ThemeRuntimeContext } from './ThemeRuntimeContext';
6
6
  import { useTheme } from './useTheme';
7
- /*** Apply a nested Surface theme or mode override without remounting app-level providers. */
8
- export function ThemeScope({ children, themeConfig, mode }) {
7
+ /*** Apply nested theme, mode, or inherited surface-polarity overrides without remounting providers. */
8
+ export function ThemeScope({ children, themeConfig, mode, inverted }) {
9
9
  const parent = useTheme();
10
10
  const { activeFontId } = useFontRuntime();
11
11
  const scopedMode = mode ?? parent.mode;
12
+ const scopedInverted = inverted ?? parent.inverted ?? false;
12
13
  const scopedConfig = useMemo(() => (themeConfig ? deepMerge(parent.theme.config, themeConfig) : parent.theme.config), [parent.theme.config, themeConfig]);
13
- const theme = useMemo(() => createTheme(scopedConfig, scopedMode, activeFontId), [activeFontId, scopedConfig, scopedMode]);
14
- const value = useMemo(() => ({ ...parent, theme, mode: scopedMode }), [parent, scopedMode, theme]);
14
+ const theme = useMemo(() => createTheme(scopedConfig, scopedMode, activeFontId, scopedInverted), [activeFontId, scopedConfig, scopedMode, scopedInverted]);
15
+ const value = useMemo(() => ({ ...parent, theme, mode: scopedMode, inverted: scopedInverted }), [parent, scopedMode, scopedInverted, theme]);
15
16
  return <ThemeRuntimeContext value={value}>{children}</ThemeRuntimeContext>;
16
17
  }
17
18
  //# sourceMappingURL=ThemeScope.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeScope.js","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,6FAA6F;AAC7F,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAmB;IACzE,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC;IACvC,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EACvF,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CACnC,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,EACzD,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,CAAC,CACzC,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAC9C,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAC5B,CAAC;IAEF,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import { deepMerge } from '@ankhorage/utility/object';\nimport { useMemo } from 'react';\n\nimport type { ThemeRuntime, ThemeScopeProps } from '../../../../types/theme';\nimport { useFontRuntime } from '../../../font/adapters/inbound/useFontRuntime';\nimport { createTheme } from '../../application/use-cases/createTheme';\nimport { ThemeRuntimeContext } from './ThemeRuntimeContext';\nimport { useTheme } from './useTheme';\n\n/*** Apply a nested Surface theme or mode override without remounting app-level providers. */\nexport function ThemeScope({ children, themeConfig, mode }: ThemeScopeProps) {\n const parent = useTheme();\n const { activeFontId } = useFontRuntime();\n const scopedMode = mode ?? parent.mode;\n const scopedConfig = useMemo(\n () => (themeConfig ? deepMerge(parent.theme.config, themeConfig) : parent.theme.config),\n [parent.theme.config, themeConfig],\n );\n const theme = useMemo(\n () => createTheme(scopedConfig, scopedMode, activeFontId),\n [activeFontId, scopedConfig, scopedMode],\n );\n const value = useMemo<ThemeRuntime>(\n () => ({ ...parent, theme, mode: scopedMode }),\n [parent, scopedMode, theme],\n );\n\n return <ThemeRuntimeContext value={value}>{children}</ThemeRuntimeContext>;\n}\n"]}
1
+ {"version":3,"file":"ThemeScope.js","sourceRoot":"","sources":["../../../../../src/features/theme/adapters/inbound/ThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,uGAAuG;AACvG,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAmB;IACnF,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC;IACvC,MAAM,cAAc,GAAG,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC;IAC5D,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EACvF,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CACnC,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,CAAC,EACzE,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC,CACzD,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,EACxE,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC,CAC5C,CAAC;IAEF,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import { deepMerge } from '@ankhorage/utility/object';\nimport { useMemo } from 'react';\n\nimport type { ThemeRuntime, ThemeScopeProps } from '../../../../types/theme';\nimport { useFontRuntime } from '../../../font/adapters/inbound/useFontRuntime';\nimport { createTheme } from '../../application/use-cases/createTheme';\nimport { ThemeRuntimeContext } from './ThemeRuntimeContext';\nimport { useTheme } from './useTheme';\n\n/*** Apply nested theme, mode, or inherited surface-polarity overrides without remounting providers. */\nexport function ThemeScope({ children, themeConfig, mode, inverted }: ThemeScopeProps) {\n const parent = useTheme();\n const { activeFontId } = useFontRuntime();\n const scopedMode = mode ?? parent.mode;\n const scopedInverted = inverted ?? parent.inverted ?? false;\n const scopedConfig = useMemo(\n () => (themeConfig ? deepMerge(parent.theme.config, themeConfig) : parent.theme.config),\n [parent.theme.config, themeConfig],\n );\n const theme = useMemo(\n () => createTheme(scopedConfig, scopedMode, activeFontId, scopedInverted),\n [activeFontId, scopedConfig, scopedMode, scopedInverted],\n );\n const value = useMemo<ThemeRuntime>(\n () => ({ ...parent, theme, mode: scopedMode, inverted: scopedInverted }),\n [parent, scopedMode, scopedInverted, theme],\n );\n\n return <ThemeRuntimeContext value={value}>{children}</ThemeRuntimeContext>;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ThemeConfig } from '@ankhorage/contracts';
2
2
  import type { SurfaceTheme } from '../../../../types/theme';
3
- /*** Resolve canonical persisted theme source into the complete Surface runtime theme. */
4
- export declare function createTheme(config?: ThemeConfig, mode?: 'light' | 'dark', activeFontId?: string | null): SurfaceTheme;
3
+ /*** Resolve canonical theme source into a normal or inverted Surface runtime theme. */
4
+ export declare function createTheme(config?: ThemeConfig, mode?: 'light' | 'dark', activeFontId?: string | null, inverted?: boolean): SurfaceTheme;
5
5
  //# sourceMappingURL=createTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTheme.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/createTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAWxE,yFAAyF;AACzF,wBAAgB,WAAW,CACzB,MAAM,GAAE,WAA4B,EACpC,IAAI,GAAE,OAAO,GAAG,MAAgB,EAChC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAC3B,YAAY,CAWd"}
1
+ {"version":3,"file":"createTheme.d.ts","sourceRoot":"","sources":["../../../../../src/features/theme/application/use-cases/createTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAYxE,uFAAuF;AACvF,wBAAgB,WAAW,CACzB,MAAM,GAAE,WAA4B,EACpC,IAAI,GAAE,OAAO,GAAG,MAAgB,EAChC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,EAC5B,QAAQ,UAAQ,GACf,YAAY,CAad"}
@@ -1,4 +1,5 @@
1
1
  import { generatePalette } from '../../domain/generatePalette';
2
+ import { projectInvertedTheme } from '../../domain/projectInvertedTheme';
2
3
  import { resolveGlobalTokens } from '../../utils/resolveGlobalTokens';
3
4
  const DEFAULT_CONFIG = {
4
5
  id: 'default',
@@ -6,8 +7,8 @@ const DEFAULT_CONFIG = {
6
7
  light: { primaryColor: '#3B82F6', harmony: 'monochromatic' },
7
8
  dark: { primaryColor: '#3B82F6', harmony: 'monochromatic' },
8
9
  };
9
- /*** Resolve canonical persisted theme source into the complete Surface runtime theme. */
10
- export function createTheme(config = DEFAULT_CONFIG, mode = 'light', activeFontId) {
10
+ /*** Resolve canonical theme source into a normal or inverted Surface runtime theme. */
11
+ export function createTheme(config = DEFAULT_CONFIG, mode = 'light', activeFontId, inverted = false) {
11
12
  const { colors, swatches, semantics, colorDiagnostics } = generatePalette(config, mode);
12
13
  const baseTheme = {
13
14
  ...resolveGlobalTokens(config.tokens),
@@ -16,8 +17,10 @@ export function createTheme(config = DEFAULT_CONFIG, mode = 'light', activeFontI
16
17
  semantics,
17
18
  colorDiagnostics,
18
19
  config,
20
+ inverted: false,
19
21
  };
20
- return activeFontId ? withActiveFont(baseTheme, activeFontId) : baseTheme;
22
+ const themed = activeFontId ? withActiveFont(baseTheme, activeFontId) : baseTheme;
23
+ return inverted ? projectInvertedTheme(themed) : themed;
21
24
  }
22
25
  /*** Return a theme with generated module font-family names without mutating the base theme. */
23
26
  function withActiveFont(theme, activeFontId) {