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
@@ -107,7 +107,10 @@ const makeWebFonts = (tokens: TreatTheme) => {
107
107
  const makeRuntimeTokens = (tokens: TreatTheme) => ({
108
108
  name: tokens.name,
109
109
  displayName: tokens.displayName,
110
- background: tokens.color.background.body,
110
+ background: {
111
+ lightMode: tokens.color.background.body,
112
+ darkMode: tokens.color.background.bodyDark,
113
+ },
111
114
  webFonts: makeWebFonts(tokens),
112
115
  space: {
113
116
  grid: tokens.grid,
@@ -1,5 +1,5 @@
1
1
  import { BraidTokens } from '../tokenType';
2
- import { darken, lighten, mix, tint } from 'polished';
2
+ import { darken, desaturate, lighten, tint } from 'polished';
3
3
  import {
4
4
  findClosestAccessibleLighterColor,
5
5
  getAccessibleVariant,
@@ -30,6 +30,18 @@ const brandAccentLight = findClosestAccessibleLighterColor(
30
30
  );
31
31
  const formAccentLight = findClosestAccessibleLighterColor(formAccent, neutral);
32
32
  const criticalLight = findClosestAccessibleLighterColor(critical, neutral);
33
+ const cautionLight = findClosestAccessibleLighterColor(caution, neutral);
34
+ const infoLight = findClosestAccessibleLighterColor(info, neutral);
35
+ const linkLight = findClosestAccessibleLighterColor(link, neutral);
36
+ const linkLightVisited = findClosestAccessibleLighterColor(
37
+ linkVisited,
38
+ neutral,
39
+ );
40
+ const positiveLight = findClosestAccessibleLighterColor(
41
+ desaturate(0.5, positive),
42
+ neutral,
43
+ );
44
+ const promoteLight = findClosestAccessibleLighterColor(promote, neutral);
33
45
 
34
46
  const getActiveColor = (x: string) =>
35
47
  isLight(x) ? darken(0.1, x) : darken(0.05, x);
@@ -185,7 +197,7 @@ const tokens: BraidTokens = {
185
197
  brandAccent,
186
198
  brandAccentLight,
187
199
  caution,
188
- cautionLight: mix(0.6, caution, getLightVariant(caution)),
200
+ cautionLight,
189
201
  critical,
190
202
  criticalLight,
191
203
  field: '#dddddd',
@@ -193,14 +205,14 @@ const tokens: BraidTokens = {
193
205
  formAccent,
194
206
  formAccentLight,
195
207
  info,
196
- infoLight: mix(0.3, info, getLightVariant(info)),
208
+ infoLight,
197
209
  neutral: black,
198
210
  neutralInverted: white,
199
211
  neutralLight: '#dddddd',
200
212
  positive,
201
- positiveLight: mix(0.3, positive, getLightVariant(positive)),
213
+ positiveLight,
202
214
  promote,
203
- promoteLight: mix(0.3, promote, getLightVariant(promote)),
215
+ promoteLight,
204
216
  },
205
217
  },
206
218
  focusRingSize: 2,
@@ -217,24 +229,31 @@ const tokens: BraidTokens = {
217
229
  brandAccent,
218
230
  brandAccentLight,
219
231
  caution: getAccessibleVariant(caution, caution),
232
+ cautionLight,
220
233
  critical: getAccessibleVariant(critical),
221
234
  criticalLight,
222
235
  formAccent,
223
236
  formAccentLight,
224
237
  info: getAccessibleVariant(info),
238
+ infoLight,
225
239
  link,
226
240
  linkHover: link,
241
+ linkLight,
227
242
  linkVisited,
243
+ linkLightVisited,
228
244
  neutral: black,
229
245
  neutralInverted: white,
230
246
  positive: getAccessibleVariant(positive),
247
+ positiveLight,
231
248
  promote: getAccessibleVariant(promote),
249
+ promoteLight,
232
250
  rating: '#f36e23',
233
251
  secondary,
234
252
  secondaryInverted: 'hsla(0, 0%, 100%, 0.65)',
235
253
  },
236
254
  background: {
237
255
  body: '#f5f5f8',
256
+ bodyDark: 'black',
238
257
  brand,
239
258
  brandAccent,
240
259
  brandAccentActive: getActiveColor(brandAccent),
@@ -271,6 +290,7 @@ const tokens: BraidTokens = {
271
290
  promote,
272
291
  promoteLight: getLightVariant(promote),
273
292
  surface: white,
293
+ surfaceDark: '#222',
274
294
  },
275
295
  },
276
296
  };
@@ -1,4 +1,4 @@
1
- import { darken, mix, rgba, lighten, tint } from 'polished';
1
+ import { darken, rgba, lighten, tint, desaturate } from 'polished';
2
2
  import {
3
3
  findClosestAccessibleLighterColor,
4
4
  getAccessibleVariant,
@@ -30,6 +30,18 @@ const brandAccentLight = findClosestAccessibleLighterColor(
30
30
  );
31
31
  const formAccentLight = findClosestAccessibleLighterColor(formAccent, neutral);
32
32
  const criticalLight = findClosestAccessibleLighterColor(critical, neutral);
33
+ const cautionLight = findClosestAccessibleLighterColor(caution, neutral);
34
+ const infoLight = findClosestAccessibleLighterColor(info, neutral);
35
+ const linkLight = findClosestAccessibleLighterColor(link, neutral);
36
+ const linkLightVisited = findClosestAccessibleLighterColor(
37
+ linkVisited,
38
+ neutral,
39
+ );
40
+ const positiveLight = findClosestAccessibleLighterColor(
41
+ desaturate(0.5, positive),
42
+ neutral,
43
+ );
44
+ const promoteLight = findClosestAccessibleLighterColor(promote, neutral);
33
45
 
34
46
  const getActiveColor = (x: string) =>
35
47
  isLight(x) ? darken(0.1, x) : darken(0.05, x);
@@ -186,7 +198,7 @@ const tokens: BraidTokens = {
186
198
  brandAccent,
187
199
  brandAccentLight,
188
200
  caution,
189
- cautionLight: mix(0.6, caution, getLightVariant(caution)),
201
+ cautionLight,
190
202
  critical,
191
203
  criticalLight,
192
204
  field: '#898989',
@@ -194,14 +206,14 @@ const tokens: BraidTokens = {
194
206
  formAccent,
195
207
  formAccentLight,
196
208
  info,
197
- infoLight: mix(0.3, info, getLightVariant(info)),
209
+ infoLight,
198
210
  neutral: black,
199
211
  neutralLight: '#d6d6d6',
200
212
  neutralInverted: white,
201
213
  positive,
202
- positiveLight: mix(0.3, positive, getLightVariant(positive)),
214
+ positiveLight,
203
215
  promote,
204
- promoteLight: mix(0.3, promote, getLightVariant(promote)),
216
+ promoteLight,
205
217
  },
206
218
  },
207
219
  focusRingSize: 2,
@@ -218,24 +230,31 @@ const tokens: BraidTokens = {
218
230
  brandAccent,
219
231
  brandAccentLight,
220
232
  caution: getAccessibleVariant(caution, caution),
233
+ cautionLight,
221
234
  critical: getAccessibleVariant(critical),
222
235
  criticalLight,
223
236
  formAccent,
224
237
  formAccentLight,
225
238
  info: getAccessibleVariant(info),
239
+ infoLight,
226
240
  link,
227
241
  linkHover: link,
242
+ linkLight,
228
243
  linkVisited,
244
+ linkLightVisited,
229
245
  neutral: black,
230
246
  neutralInverted: white,
231
247
  positive: getAccessibleVariant(positive),
248
+ positiveLight,
232
249
  promote: getAccessibleVariant(promote),
250
+ promoteLight,
233
251
  rating: '#f57c00',
234
252
  secondary,
235
253
  secondaryInverted: 'hsla(0, 0%, 100%, 0.65)',
236
254
  },
237
255
  background: {
238
256
  body: '#eee',
257
+ bodyDark: 'black',
239
258
  brand,
240
259
  brandAccent,
241
260
  brandAccentActive: getActiveColor(brandAccent),
@@ -272,6 +291,7 @@ const tokens: BraidTokens = {
272
291
  promote,
273
292
  promoteLight: getLightVariant(promote),
274
293
  surface: white,
294
+ surfaceDark: '#333',
275
295
  },
276
296
  },
277
297
  };
@@ -105,18 +105,24 @@ export interface BraidTokens {
105
105
  foreground: {
106
106
  brandAccentLight: string;
107
107
  brandAccent: string;
108
+ cautionLight: string;
108
109
  caution: string;
109
110
  criticalLight: string;
110
111
  critical: string;
111
112
  formAccentLight: string;
112
113
  formAccent: string;
114
+ infoLight: string;
113
115
  info: string;
116
+ linkLight: string;
114
117
  link: string;
115
118
  linkHover: string;
116
119
  linkVisited: string;
120
+ linkLightVisited: string;
117
121
  neutral: string;
118
122
  neutralInverted: string;
123
+ positiveLight: string;
119
124
  positive: string;
125
+ promoteLight: string;
120
126
  promote: string;
121
127
  rating: string;
122
128
  secondary: string;
@@ -124,6 +130,7 @@ export interface BraidTokens {
124
130
  };
125
131
  background: {
126
132
  body: string;
133
+ bodyDark: string;
127
134
  brand: string;
128
135
  brandAccent: string;
129
136
  brandAccentActive: string;
@@ -160,6 +167,7 @@ export interface BraidTokens {
160
167
  promote: string;
161
168
  promoteLight: string;
162
169
  surface: string;
170
+ surfaceDark: string;
163
171
  };
164
172
  };
165
173
  }
@@ -1,4 +1,4 @@
1
- import { darken, lighten, mix, tint } from 'polished';
1
+ import { darken, lighten, tint } from 'polished';
2
2
  import {
3
3
  findClosestAccessibleLighterColor,
4
4
  getAccessibleVariant,
@@ -29,6 +29,15 @@ const brandAccentLight = findClosestAccessibleLighterColor(
29
29
  );
30
30
  const formAccentLight = findClosestAccessibleLighterColor(formAccent, neutral);
31
31
  const criticalLight = findClosestAccessibleLighterColor(critical, neutral);
32
+ const cautionLight = findClosestAccessibleLighterColor(caution, neutral);
33
+ const infoLight = findClosestAccessibleLighterColor(info, neutral);
34
+ const linkLight = findClosestAccessibleLighterColor(link, neutral);
35
+ const linkLightVisited = findClosestAccessibleLighterColor(
36
+ linkVisited,
37
+ neutral,
38
+ );
39
+ const positiveLight = findClosestAccessibleLighterColor(positive, neutral);
40
+ const promoteLight = findClosestAccessibleLighterColor(promote, neutral);
32
41
 
33
42
  const getActiveColor = (x: string) =>
34
43
  isLight(x) ? darken(0.1, x) : darken(0.05, x);
@@ -184,7 +193,7 @@ const tokens: BraidTokens = {
184
193
  brandAccent,
185
194
  brandAccentLight,
186
195
  caution,
187
- cautionLight: mix(0.6, caution, getLightVariant(caution)),
196
+ cautionLight,
188
197
  critical,
189
198
  criticalLight,
190
199
  field: '#333',
@@ -192,14 +201,14 @@ const tokens: BraidTokens = {
192
201
  formAccent,
193
202
  formAccentLight,
194
203
  info,
195
- infoLight: mix(0.3, info, getLightVariant(info)),
204
+ infoLight,
196
205
  neutral: black,
197
206
  neutralInverted: white,
198
207
  neutralLight: '#777',
199
208
  positive,
200
- positiveLight: mix(0.3, positive, getLightVariant(positive)),
209
+ positiveLight,
201
210
  promote,
202
- promoteLight: mix(0.3, promote, getLightVariant(promote)),
211
+ promoteLight,
203
212
  },
204
213
  },
205
214
  focusRingSize: 2,
@@ -216,24 +225,31 @@ const tokens: BraidTokens = {
216
225
  brandAccent,
217
226
  brandAccentLight,
218
227
  caution: getAccessibleVariant(caution, caution),
228
+ cautionLight,
219
229
  critical: getAccessibleVariant(critical),
220
230
  criticalLight,
221
231
  formAccent,
222
232
  formAccentLight,
223
233
  info: getAccessibleVariant(info),
234
+ infoLight,
224
235
  link,
225
236
  linkHover: link,
237
+ linkLight,
238
+ linkLightVisited,
226
239
  linkVisited,
227
240
  neutral: black,
228
241
  neutralInverted: white,
229
242
  positive: getAccessibleVariant(positive),
243
+ positiveLight,
230
244
  promote: getAccessibleVariant(promote),
245
+ promoteLight,
231
246
  rating: black,
232
247
  secondary,
233
248
  secondaryInverted: 'hsla(0, 0%, 100%, 0.65)',
234
249
  },
235
250
  background: {
236
251
  body: 'whitesmoke',
252
+ bodyDark: 'black',
237
253
  brand: black,
238
254
  brandAccent,
239
255
  brandAccentActive: getActiveColor(brandAccent),
@@ -270,6 +286,7 @@ const tokens: BraidTokens = {
270
286
  promote,
271
287
  promoteLight: getLightVariant(promote),
272
288
  surface: white,
289
+ surfaceDark: '#222',
273
290
  },
274
291
  },
275
292
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "31.0.0",
3
+ "version": "31.2.2",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "main": "lib/components/index.ts",
6
6
  "sideEffects": [
@@ -159,7 +159,7 @@
159
159
  "workerpool": "^6.1.5"
160
160
  },
161
161
  "volta": {
162
- "node": "12.14.1",
162
+ "node": "16.13.0",
163
163
  "yarn": "1.21.1"
164
164
  }
165
165
  }
package/sku.config.js CHANGED
@@ -18,6 +18,7 @@ const entries = Boolean(process.env.DEBUG_IE)
18
18
  module.exports = {
19
19
  srcPaths: [
20
20
  'lib',
21
+ 'color-mode',
21
22
  'codemod/src',
22
23
  'css',
23
24
  'themes',
package/sku.routes.js CHANGED
@@ -21,6 +21,8 @@ const getPages = (relativePath) => {
21
21
  return source.match(/('.*')(?=:)/g).map((x) => x.split("'")[1]);
22
22
  };
23
23
 
24
+ // TODO: COLORMODE RELEASE
25
+ // Remove `colorModeStyle` from `undocumentedExports.json`
24
26
  const cssNames = getExports('css/index.ts', 'css');
25
27
  const componentNames = getExports('lib/components/index.ts');
26
28
  const iconNames = getExports('lib/components/icons/index.ts');
package/tsconfig.json CHANGED
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "include": [
19
19
  "/home/runner/work/braid-design-system/braid-design-system/lib",
20
+ "/home/runner/work/braid-design-system/braid-design-system/color-mode",
20
21
  "/home/runner/work/braid-design-system/braid-design-system/codemod/src",
21
22
  "/home/runner/work/braid-design-system/braid-design-system/css",
22
23
  "/home/runner/work/braid-design-system/braid-design-system/themes",
@@ -1,6 +0,0 @@
1
- import { style } from '@vanilla-extract/css';
2
-
3
- export const toneKeyline = style({
4
- borderTopRightRadius: '0 !important',
5
- borderBottomRightRadius: '0 !important',
6
- });