braid-design-system 31.0.0 → 31.2.2

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 (106) hide show
  1. package/.nvmrc +1 -1
  2. package/CHANGELOG.md +58 -0
  3. package/color-mode/index.ts +9 -0
  4. package/css/atoms.docs.tsx +26 -20
  5. package/css/colorModeStyle.docs.tsx +81 -0
  6. package/css/index.ts +5 -1
  7. package/lib/components/Alert/Alert.css.ts +19 -0
  8. package/lib/components/Alert/Alert.docs.tsx +17 -5
  9. package/lib/components/Alert/Alert.tsx +61 -30
  10. package/lib/components/Badge/Badge.tsx +11 -31
  11. package/lib/components/Box/BackgroundContext.tsx +34 -17
  12. package/lib/components/Box/Box.docs.tsx +34 -14
  13. package/lib/components/Box/Box.playroom.tsx +37 -0
  14. package/lib/components/Box/Box.tsx +38 -7
  15. package/lib/components/Box/BoxRenderer.tsx +28 -9
  16. package/lib/components/Box/ColoredBox.tsx +168 -13
  17. package/lib/components/BraidPortal/BraidPortal.tsx +4 -1
  18. package/lib/components/BraidProvider/BraidProvider.tsx +11 -3
  19. package/lib/components/BraidProvider/VanillaThemeContainer.tsx +24 -0
  20. package/lib/components/Button/Button.css.ts +38 -5
  21. package/lib/components/Button/Button.screenshots.tsx +4 -1
  22. package/lib/components/Button/Button.tsx +102 -70
  23. package/lib/components/Card/Card.tsx +2 -13
  24. package/lib/components/Checkbox/Checkbox.screenshots.tsx +17 -8
  25. package/lib/components/Divider/Divider.css.ts +45 -4
  26. package/lib/components/Divider/Divider.tsx +20 -14
  27. package/lib/components/Dropdown/Dropdown.docs.tsx +0 -1
  28. package/lib/components/FieldLabel/FieldLabel.docs.tsx +1 -1
  29. package/lib/components/FieldMessage/FieldMessage.screenshots.tsx +6 -0
  30. package/lib/components/Heading/Heading.docs.tsx +6 -4
  31. package/lib/components/Heading/Heading.screenshots.tsx +4 -1
  32. package/lib/components/Loader/Loader.css.ts +3 -4
  33. package/lib/components/Loader/Loader.screenshots.tsx +4 -1
  34. package/lib/components/Loader/Loader.tsx +27 -30
  35. package/lib/components/MenuItem/MenuItemLink.tsx +9 -2
  36. package/lib/components/MenuItem/useMenuItem.tsx +4 -4
  37. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.tsx +3 -1
  38. package/lib/components/MenuRenderer/testHelper.tsx +5 -2
  39. package/lib/components/Pagination/Pagination.css.ts +17 -3
  40. package/lib/components/Pagination/Pagination.tsx +6 -5
  41. package/lib/components/Rating/Rating.css.ts +16 -3
  42. package/lib/components/Rating/Rating.screenshots.tsx +4 -1
  43. package/lib/components/Rating/Rating.tsx +6 -1
  44. package/lib/components/Tabs/Tab.tsx +6 -2
  45. package/lib/components/Tabs/Tabs.css.ts +9 -1
  46. package/lib/components/Tabs/Tabs.tsx +4 -1
  47. package/lib/components/Text/Text.docs.tsx +4 -0
  48. package/lib/components/Text/Text.screenshots.tsx +8 -1
  49. package/lib/components/TextField/TextField.docs.tsx +0 -1
  50. package/lib/components/TextLink/TextLink.css.ts +139 -0
  51. package/lib/components/TextLink/TextLink.docs.tsx +1 -1
  52. package/lib/components/TextLink/TextLink.screenshots.tsx +3 -1
  53. package/lib/components/TextLink/TextLink.tsx +45 -37
  54. package/lib/components/Textarea/Highlight/Highlight.tsx +1 -1
  55. package/lib/components/Textarea/Textarea.docs.tsx +0 -1
  56. package/lib/components/Toggle/Toggle.css.ts +34 -7
  57. package/lib/components/Toggle/Toggle.tsx +8 -3
  58. package/lib/components/iconButtons/IconButton.css.ts +0 -32
  59. package/lib/components/iconButtons/IconButton.tsx +26 -48
  60. package/lib/components/icons/IconTip/IconTip.docs.tsx +20 -0
  61. package/lib/components/icons/IconTip/IconTip.tsx +12 -0
  62. package/lib/components/icons/IconTip/IconTipSvg.tsx +21 -0
  63. package/lib/components/icons/IconZoomIn/IconZoomIn.docs.tsx +20 -0
  64. package/lib/components/icons/IconZoomIn/IconZoomIn.tsx +12 -0
  65. package/lib/components/icons/IconZoomIn/IconZoomInSvg.tsx +20 -0
  66. package/lib/components/icons/IconZoomOut/IconZoomOut.docs.tsx +20 -0
  67. package/lib/components/icons/IconZoomOut/IconZoomOut.tsx +12 -0
  68. package/lib/components/icons/IconZoomOut/IconZoomOutSvg.tsx +20 -0
  69. package/lib/components/icons/Icons.screenshots.tsx +2 -2
  70. package/lib/components/icons/index.ts +3 -0
  71. package/lib/components/index.ts +3 -1
  72. package/lib/components/private/Field/Field.css.ts +2 -1
  73. package/lib/components/private/Field/Field.tsx +4 -6
  74. package/lib/components/private/InlineField/InlineField.css.ts +6 -6
  75. package/lib/components/private/InlineField/StyledInput.tsx +14 -9
  76. package/lib/components/private/Keyline/Keyline.css.ts +70 -0
  77. package/lib/components/private/Keyline/Keyline.tsx +38 -0
  78. package/lib/components/private/Placeholder/Placeholder.css.ts +44 -12
  79. package/lib/components/private/Placeholder/Placeholder.tsx +7 -3
  80. package/lib/components/private/touchable/debugTouchable.ts +7 -7
  81. package/lib/components/private/touchable/virtualTouchable.css.ts +12 -12
  82. package/lib/components/useToast/Toast.tsx +2 -8
  83. package/lib/css/atoms/atomicProperties.ts +7 -2
  84. package/lib/css/atoms/sprinkles.css.ts +24 -0
  85. package/lib/css/colorModeStyle.ts +33 -0
  86. package/lib/css/reset/reset.css.ts +12 -8
  87. package/lib/hooks/typography/index.ts +8 -61
  88. package/lib/hooks/typography/typography.css.ts +95 -93
  89. package/lib/hooks/useIcon/index.ts +4 -2
  90. package/lib/playroom/FrameComponent.tsx +50 -17
  91. package/lib/playroom/components.ts +1 -0
  92. package/lib/playroom/useScope.ts +44 -1
  93. package/lib/stories/all.stories.tsx +61 -30
  94. package/lib/themes/baseTokens/apac.ts +8 -0
  95. package/lib/themes/catho/tokens.ts +23 -6
  96. package/lib/themes/docs/tokens.ts +8 -0
  97. package/lib/themes/makeBraidTheme.ts +4 -1
  98. package/lib/themes/occ/tokens.ts +25 -5
  99. package/lib/themes/seekAnz/tokens.ts +25 -5
  100. package/lib/themes/tokenType.ts +8 -0
  101. package/lib/themes/wireframe/tokens.ts +22 -5
  102. package/package.json +2 -2
  103. package/sku.config.js +1 -0
  104. package/sku.routes.js +2 -0
  105. package/tsconfig.json +1 -0
  106. package/lib/components/Card/Card.css.ts +0 -6
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { Box, BoxProps } from '../../Box/Box';
3
+ import { useBackgroundLightness } from '../../Box/BackgroundContext';
4
+ import * as styles from './Keyline.css';
5
+
6
+ interface KeylineProps {
7
+ tone: 'promote' | 'info' | 'positive' | 'caution' | 'critical' | 'formAccent';
8
+ borderRadius?: BoxProps['borderRadius'];
9
+ }
10
+
11
+ export const Keyline = ({ tone, borderRadius }: KeylineProps) => {
12
+ const backgroundLightness = useBackgroundLightness();
13
+
14
+ return (
15
+ <Box
16
+ component="span"
17
+ position="absolute"
18
+ top={0}
19
+ bottom={0}
20
+ left={0}
21
+ overflow="hidden"
22
+ borderRadius={borderRadius}
23
+ className={[styles.noRadiusOnRight, styles.largestWidth]}
24
+ >
25
+ <Box
26
+ component="span"
27
+ height="full"
28
+ display="inlineBlock"
29
+ paddingLeft="xxsmall"
30
+ className={[
31
+ styles.tone[tone],
32
+ styles.lightMode[backgroundLightness.lightMode],
33
+ styles.darkMode[backgroundLightness.darkMode],
34
+ ]}
35
+ />
36
+ </Box>
37
+ );
38
+ };
@@ -1,20 +1,52 @@
1
- import { createTheme, style } from '@vanilla-extract/css';
1
+ import {
2
+ assignVars,
3
+ createThemeContract,
4
+ style,
5
+ styleVariants,
6
+ } from '@vanilla-extract/css';
7
+ import { colorModeStyle } from '../../../css/colorModeStyle';
2
8
 
3
- export const [lightTheme, vars] = createTheme(
4
- {
9
+ const vars = createThemeContract({
10
+ background: null,
11
+ borderColor: null,
12
+ labelColor: null,
13
+ lineColor: null,
14
+ });
15
+
16
+ const lightContextVars = {
17
+ vars: assignVars(vars, {
5
18
  background: 'hsla(0, 0%, 20%, 0.08)',
6
19
  borderColor: 'hsla(0, 0%, 20%, 0.3)',
7
20
  labelColor: 'hsla(0, 0%, 20%, 0.4)',
8
21
  lineColor: 'hsla(0, 0%, 20%, 0.1)',
9
- },
10
- 'lightTheme',
11
- );
12
-
13
- export const darkTheme = createTheme(vars, {
14
- background: 'hsla(0, 0%, 100%, 0.35)',
15
- borderColor: 'hsla(0, 0%, 100%, 0.8)',
16
- labelColor: 'hsla(0, 0%, 100%, 0.8)',
17
- lineColor: 'hsla(0, 0%, 100%, 0.4)',
22
+ }),
23
+ };
24
+
25
+ const darkContextVars = {
26
+ vars: assignVars(vars, {
27
+ background: 'hsla(0, 0%, 100%, 0.05)',
28
+ borderColor: 'hsla(0, 0%, 100%, 0.4)',
29
+ labelColor: 'hsla(0, 0%, 100%, 0.6)',
30
+ lineColor: 'hsla(0, 0%, 100%, 0.2)',
31
+ }),
32
+ };
33
+
34
+ export const lightTheme = styleVariants({
35
+ light: colorModeStyle({
36
+ lightMode: lightContextVars,
37
+ }),
38
+ dark: colorModeStyle({
39
+ lightMode: darkContextVars,
40
+ }),
41
+ });
42
+
43
+ export const darkTheme = styleVariants({
44
+ light: colorModeStyle({
45
+ darkMode: lightContextVars,
46
+ }),
47
+ dark: colorModeStyle({
48
+ darkMode: darkContextVars,
49
+ }),
18
50
  });
19
51
 
20
52
  const borderWidth = '2px';
@@ -21,8 +21,7 @@ export const Placeholder = ({
21
21
  height = 120,
22
22
  shape = 'rectangle',
23
23
  }: PlaceholderProps) => {
24
- const theme =
25
- useBackgroundLightness() === 'light' ? styles.lightTheme : styles.darkTheme;
24
+ const lightness = useBackgroundLightness();
26
25
 
27
26
  return (
28
27
  <Box
@@ -32,7 +31,12 @@ export const Placeholder = ({
32
31
  alignItems="center"
33
32
  justifyContent="center"
34
33
  borderRadius={shape === 'round' ? 'full' : undefined}
35
- className={[wireframe.vanillaTheme, theme, styles.box]}
34
+ className={[
35
+ wireframe.vanillaTheme,
36
+ styles.lightTheme[lightness.lightMode],
37
+ styles.darkTheme[lightness.darkMode],
38
+ styles.box,
39
+ ]}
36
40
  style={{
37
41
  width: resolveToPxIfUnitless(width),
38
42
  height: resolveToPxIfUnitless(height),
@@ -1,13 +1,13 @@
1
- import { Style } from 'sku/treat';
1
+ import type { StyleRule } from '@vanilla-extract/css';
2
2
 
3
- type SelectorMap = Style['selectors'];
4
-
5
- export const debugTouchable = ({ after = false } = {}): SelectorMap =>
3
+ export const debugTouchable = ({ after = false } = {}): StyleRule =>
6
4
  process.env.NODE_ENV === 'production'
7
5
  ? {}
8
6
  : {
9
- [`[data-braid-debug] &${after ? ':after' : ''}`]: {
10
- background: 'red',
11
- opacity: 0.2,
7
+ selectors: {
8
+ [`[data-braid-debug] &${after ? ':after' : ''}`]: {
9
+ background: 'red',
10
+ opacity: 0.2,
11
+ },
12
12
  },
13
13
  };
@@ -3,19 +3,19 @@ import { style } from '@vanilla-extract/css';
3
3
  import { debugTouchable } from './debugTouchable';
4
4
  import { virtualTouchableRules } from './virtualTouchableRules';
5
5
 
6
- export const virtualTouchable = style({
7
- position: 'relative',
8
- ':after': {
9
- content: '""',
10
- position: 'absolute',
11
- left: -10,
12
- right: -10,
13
- ...virtualTouchableRules,
14
- },
15
- selectors: {
16
- ...debugTouchable({ after: true }),
6
+ export const virtualTouchable = style([
7
+ {
8
+ position: 'relative',
9
+ ':after': {
10
+ content: '""',
11
+ position: 'absolute',
12
+ left: -10,
13
+ right: -10,
14
+ ...virtualTouchableRules,
15
+ },
17
16
  },
18
- });
17
+ debugTouchable({ after: true }),
18
+ ]);
19
19
 
20
20
  export const yAxisOnly = style({
21
21
  ':after': {
@@ -12,6 +12,7 @@ import { IconPositive, IconCritical } from '../icons';
12
12
  import { ClearButton } from '../iconButtons/ClearButton/ClearButton';
13
13
  import { useTimeout } from './useTimeout';
14
14
  import { InternalToast, ToastAction } from './ToastTypes';
15
+ import { Keyline } from '../private/Keyline/Keyline';
15
16
  import * as styles from './Toast.css';
16
17
 
17
18
  const toneToIcon = {
@@ -154,14 +155,7 @@ const Toast = React.forwardRef<HTMLDivElement, ToastProps>(
154
155
  </Box>
155
156
  </Column>
156
157
  </Columns>
157
- <Box
158
- background={tone}
159
- paddingLeft="xxsmall"
160
- position="absolute"
161
- left={0}
162
- top={0}
163
- bottom={0}
164
- />
158
+ <Keyline tone={tone} borderRadius={borderRadius} />
165
159
  </Box>
166
160
  </ContentBlock>
167
161
  </Box>
@@ -48,7 +48,6 @@ export const pseudoProperties = {
48
48
  export type PseudoProperties = keyof typeof pseudoProperties;
49
49
 
50
50
  export const unresponsiveProperties = {
51
- background: vars.backgroundColor,
52
51
  overflow: ['hidden', 'scroll', 'visible', 'auto'],
53
52
  userSelect: ['none'],
54
53
  outline: ['none'],
@@ -64,7 +63,6 @@ export const unresponsiveProperties = {
64
63
  modal: 300,
65
64
  notification: 400,
66
65
  },
67
- boxShadow,
68
66
  cursor: ['default', 'pointer'],
69
67
  pointerEvents: ['none'],
70
68
  top: [0],
@@ -82,8 +80,15 @@ export const unresponsiveProperties = {
82
80
 
83
81
  export type UnresponsiveProperties = keyof typeof unresponsiveProperties;
84
82
 
83
+ export const colorProperties = {
84
+ background: vars.backgroundColor,
85
+ boxShadow,
86
+ } as const;
87
+
85
88
  export type Background = keyof typeof vars.backgroundColor;
86
89
 
90
+ export type ColorProperties = keyof typeof colorProperties;
91
+
87
92
  export const responsiveProperties = {
88
93
  display: {
89
94
  none: 'none',
@@ -1,3 +1,4 @@
1
+ import { style } from '@vanilla-extract/css';
1
2
  import {
2
3
  ConditionalValue,
3
4
  RequiredConditionalValue,
@@ -12,6 +13,7 @@ import {
12
13
  responsiveProperties,
13
14
  unresponsiveProperties,
14
15
  pseudoProperties,
16
+ colorProperties,
15
17
  } from './atomicProperties';
16
18
 
17
19
  const unresponsiveAtomicProperties = defineProperties({
@@ -28,6 +30,21 @@ const pseudoAtomicProperties = defineProperties({
28
30
  properties: pseudoProperties,
29
31
  });
30
32
 
33
+ export const darkMode = style({});
34
+ export const colorModeSelectors = {
35
+ light: `html:not(${darkMode}) &`,
36
+ dark: `html${darkMode} &`,
37
+ };
38
+
39
+ const colorAtomicProperties = defineProperties({
40
+ defaultCondition: 'lightMode',
41
+ conditions: {
42
+ lightMode: { selector: colorModeSelectors.light },
43
+ darkMode: { selector: colorModeSelectors.dark },
44
+ },
45
+ properties: colorProperties,
46
+ });
47
+
31
48
  const responsiveAtomicProperties = defineProperties({
32
49
  defaultCondition: 'mobile',
33
50
  conditions: {
@@ -58,6 +75,7 @@ export const sprinkles = createSprinkles(
58
75
  unresponsiveAtomicProperties,
59
76
  responsiveAtomicProperties,
60
77
  pseudoAtomicProperties,
78
+ colorAtomicProperties,
61
79
  );
62
80
 
63
81
  export type OptionalResponsiveValue<Value extends string | number> =
@@ -74,3 +92,9 @@ export const normalizeResponsiveValue = createNormalizeValueFn(
74
92
  responsiveAtomicProperties,
75
93
  );
76
94
  export const mapResponsiveValue = createMapValueFn(responsiveAtomicProperties);
95
+
96
+ export type ColorModeValue<Value extends string | number> = ConditionalValue<
97
+ typeof colorAtomicProperties,
98
+ Value
99
+ >;
100
+ export const mapColorModeValue = createMapValueFn(colorAtomicProperties);
@@ -0,0 +1,33 @@
1
+ import { StyleRule } from '@vanilla-extract/css';
2
+ import { colorModeSelectors } from './atoms/sprinkles.css';
3
+
4
+ type CSSProps = Omit<StyleRule, 'selectors' | '@media' | '@supports'>;
5
+
6
+ const makeSelector = (
7
+ mode: keyof typeof colorModeSelectors,
8
+ styles?: CSSProps,
9
+ ) =>
10
+ !styles || Object.keys(styles).length === 0
11
+ ? {}
12
+ : {
13
+ [colorModeSelectors[mode]]: styles,
14
+ };
15
+
16
+ interface ColorModeStyle {
17
+ lightMode?: CSSProps;
18
+ darkMode?: CSSProps;
19
+ }
20
+
21
+ export const colorModeStyle = ({
22
+ lightMode,
23
+ darkMode,
24
+ }: ColorModeStyle): StyleRule => ({
25
+ ...(lightMode || darkMode
26
+ ? {
27
+ selectors: {
28
+ ...makeSelector('light', lightMode),
29
+ ...makeSelector('dark', darkMode),
30
+ },
31
+ }
32
+ : {}),
33
+ });
@@ -48,14 +48,20 @@ const appearance = style({
48
48
  appearance: 'none',
49
49
  });
50
50
 
51
- const field = style([block, appearance]);
52
-
53
- // Custom reset rules
54
- const mark = style({
51
+ const transparent = style({
55
52
  backgroundColor: 'transparent',
56
- color: 'inherit',
57
53
  });
58
54
 
55
+ const field = style([block, appearance, transparent]);
56
+
57
+ // Custom reset rules
58
+ const mark = style([
59
+ transparent,
60
+ {
61
+ color: 'inherit',
62
+ },
63
+ ]);
64
+
59
65
  const select = style([
60
66
  field,
61
67
  style({
@@ -84,9 +90,7 @@ const input = style([
84
90
  }),
85
91
  ]);
86
92
 
87
- const button = style({
88
- background: 'none',
89
- });
93
+ const button = style([transparent]);
90
94
 
91
95
  const a = style({
92
96
  textDecoration: 'none',
@@ -1,25 +1,17 @@
1
1
  import clsx from 'clsx';
2
2
  import type { StyleRule } from '@vanilla-extract/css';
3
- import assert from 'assert';
4
-
5
- import {
6
- useBackground,
7
- useBackgroundLightness,
8
- } from '../../components/Box/BackgroundContext';
9
- import { BoxProps } from '../../components/Box/Box';
10
- import { useDefaultTextProps } from '../../components/private/defaultTextProps';
11
3
  import { vars } from '../../themes/vars.css';
12
4
  import { responsiveStyle } from '../../css/responsiveStyle';
13
5
  import * as styles from './typography.css';
6
+ import * as linkStyles from '../../components/TextLink/TextLink.css';
14
7
 
15
- type TextTone = keyof typeof styles.tone | 'neutral';
8
+ type TextTone = keyof typeof styles.tone;
16
9
 
17
10
  export interface UseTextProps {
18
11
  weight?: keyof typeof styles.fontWeight;
19
12
  size?: keyof typeof styles.text;
20
13
  tone?: TextTone;
21
14
  baseline: boolean;
22
- backgroundContext?: BoxProps['background'];
23
15
  }
24
16
 
25
17
  export const globalTextStyle = ({
@@ -46,9 +38,8 @@ export function useText({
46
38
  size = 'standard',
47
39
  tone = 'neutral',
48
40
  baseline,
49
- backgroundContext,
50
41
  }: UseTextProps) {
51
- const textTone = useTextTone({ tone, backgroundContext });
42
+ const textTone = useTextTone({ tone });
52
43
 
53
44
  return clsx(
54
45
  styles.fontFamily,
@@ -65,7 +56,6 @@ interface UseHeadingProps {
65
56
  weight?: HeadingWeight;
66
57
  level: HeadingLevel;
67
58
  baseline: boolean;
68
- backgroundContext?: BoxProps['background'];
69
59
  }
70
60
 
71
61
  export const globalHeadingStyle = ({
@@ -91,9 +81,8 @@ export function useHeading({
91
81
  weight = 'regular',
92
82
  level,
93
83
  baseline,
94
- backgroundContext,
95
84
  }: UseHeadingProps) {
96
- const textTone = useTextTone({ tone: 'neutral', backgroundContext });
85
+ const textTone = useTextTone({ tone: 'neutral' });
97
86
 
98
87
  return clsx(
99
88
  styles.fontFamily,
@@ -111,52 +100,10 @@ export function useWeight(weight: keyof typeof styles.fontWeight) {
111
100
  return styles.fontWeight[weight];
112
101
  }
113
102
 
114
- const neutralToneOverrideForBackground: Partial<
115
- Record<NonNullable<BoxProps['background']>, keyof typeof styles.tone>
116
- > = {
117
- criticalLight: 'critical',
118
- criticalSoft: 'critical',
119
- criticalSoftActive: 'critical',
120
- criticalSoftHover: 'critical',
121
- caution: 'caution',
122
- cautionLight: 'caution',
123
- positiveLight: 'positive',
124
- infoLight: 'info',
125
- promoteLight: 'promote',
126
- };
127
-
128
- export function useTextTone({
129
- tone: toneProp,
130
- backgroundContext: backgroundContextOverride,
131
- }: {
132
- tone: TextTone;
133
- backgroundContext?: BoxProps['background'];
134
- }) {
135
- const backgroundContext = useBackground();
136
- const background = backgroundContextOverride || backgroundContext;
137
- const backgroundLightness = useBackgroundLightness(background);
138
- const { tone } = useDefaultTextProps({ tone: toneProp });
139
-
140
- if (tone === 'neutral' && background in neutralToneOverrideForBackground) {
141
- const toneOverride =
142
- neutralToneOverrideForBackground[
143
- background as keyof typeof neutralToneOverrideForBackground
144
- ];
145
-
146
- assert(toneOverride, `Tone override not found for tone: ${tone}`);
147
-
148
- return styles.tone[toneOverride];
149
- }
150
-
151
- if (tone !== 'neutral') {
152
- return tone in styles.invertableTone
153
- ? styles.invertableTone[tone as keyof typeof styles.invertableTone][
154
- backgroundLightness
155
- ]
156
- : styles.tone[tone];
157
- }
158
-
159
- return styles.invertableTone.neutral[backgroundLightness];
103
+ export function useTextTone({ tone }: { tone: TextTone }) {
104
+ return tone !== 'neutral' && tone !== 'secondary'
105
+ ? `${styles.tone[tone]} ${linkStyles.inheritLinkColor}`
106
+ : styles.tone[tone];
160
107
  }
161
108
 
162
109
  export const touchableText = styles.touchable;