@atlaskit/ds-explorations 0.1.5 → 1.1.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 (98) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/box/package.json +15 -0
  3. package/dist/cjs/components/box.partial.js +182 -205
  4. package/dist/cjs/components/inline.partial.js +28 -34
  5. package/dist/cjs/components/interaction-surface.partial.js +32 -1
  6. package/dist/cjs/components/stack.partial.js +28 -36
  7. package/dist/cjs/components/text.partial.js +117 -86
  8. package/dist/cjs/index.js +1 -9
  9. package/dist/cjs/internal/color-map.js +6 -5
  10. package/dist/cjs/internal/spacing-scale.js +17 -0
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/components/box.partial.js +181 -189
  13. package/dist/es2019/components/inline.partial.js +27 -28
  14. package/dist/es2019/components/interaction-surface.partial.js +32 -1
  15. package/dist/es2019/components/stack.partial.js +27 -28
  16. package/dist/es2019/components/text.partial.js +74 -36
  17. package/dist/es2019/index.js +1 -2
  18. package/dist/es2019/internal/color-map.js +4 -3
  19. package/dist/es2019/internal/spacing-scale.js +9 -0
  20. package/dist/es2019/version.json +1 -1
  21. package/dist/esm/components/box.partial.js +181 -201
  22. package/dist/esm/components/inline.partial.js +27 -33
  23. package/dist/esm/components/interaction-surface.partial.js +32 -1
  24. package/dist/esm/components/stack.partial.js +27 -33
  25. package/dist/esm/components/text.partial.js +79 -47
  26. package/dist/esm/index.js +1 -2
  27. package/dist/esm/internal/color-map.js +4 -3
  28. package/dist/esm/internal/spacing-scale.js +9 -0
  29. package/dist/esm/version.json +1 -1
  30. package/dist/types/components/box.partial.d.ts +109 -21
  31. package/dist/types/components/inline.partial.d.ts +25 -3
  32. package/dist/types/components/interaction-surface.partial.d.ts +3 -0
  33. package/dist/types/components/stack.partial.d.ts +24 -2
  34. package/dist/types/components/text.partial.d.ts +9 -3
  35. package/dist/types/index.d.ts +0 -1
  36. package/dist/types/internal/color-map.d.ts +11 -9
  37. package/dist/types/internal/spacing-scale.d.ts +9 -0
  38. package/dist/types-ts4.0/components/box.partial.d.ts +109 -27
  39. package/dist/types-ts4.0/components/inline.partial.d.ts +25 -3
  40. package/dist/types-ts4.0/components/interaction-surface.partial.d.ts +3 -0
  41. package/dist/types-ts4.0/components/stack.partial.d.ts +24 -2
  42. package/dist/types-ts4.0/components/text.partial.d.ts +9 -6
  43. package/dist/types-ts4.0/index.d.ts +0 -1
  44. package/dist/types-ts4.0/internal/color-map.d.ts +11 -9
  45. package/dist/types-ts4.0/internal/spacing-scale.d.ts +22 -0
  46. package/examples/00-basic.tsx +4 -4
  47. package/examples/01-box.tsx +29 -46
  48. package/examples/02-text-advanced.tsx +38 -0
  49. package/examples/02-text.tsx +73 -62
  50. package/examples/03-stack.tsx +36 -75
  51. package/examples/04-inline.tsx +34 -76
  52. package/examples/05-badge.tsx +2 -2
  53. package/examples/06-section-message.tsx +7 -7
  54. package/examples/07-comment.tsx +4 -6
  55. package/examples/08-lozenge.tsx +9 -5
  56. package/examples/99-interactions.tsx +20 -20
  57. package/examples/config.jsonc +11 -0
  58. package/package.json +5 -2
  59. package/report.api.md +188 -48
  60. package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +52 -64
  61. package/scripts/codegen-styles.tsx +34 -6
  62. package/scripts/color-codegen-template.tsx +10 -15
  63. package/scripts/color-map-template.tsx +1 -1
  64. package/scripts/spacing-codegen-template.tsx +42 -12
  65. package/scripts/spacing-scale-template.tsx +40 -0
  66. package/scripts/utils.tsx +1 -3
  67. package/src/components/__tests__/unit/box.test.tsx +8 -11
  68. package/src/components/__tests__/unit/inline.test.tsx +3 -3
  69. package/src/components/__tests__/unit/interaction-suface.test.tsx +1 -1
  70. package/src/components/__tests__/unit/stack.test.tsx +2 -2
  71. package/src/components/__tests__/unit/text.test.tsx +32 -1
  72. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-block-should-match-snapshot-1-snap.png +2 -2
  73. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-inline-should-match-snapshot-1-snap.png +2 -2
  74. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-should-match-snapshot-1-snap.png +2 -2
  75. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-color-should-match-snapshot-1-snap.png +2 -2
  76. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-border-color-should-match-snapshot-1-snap.png +2 -2
  77. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +2 -2
  78. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +2 -2
  79. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +2 -2
  80. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +2 -2
  81. package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-line-heights-should-match-snapshot-1-snap.png +2 -2
  82. package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-testing-should-match-snapshot-1-snap.png +2 -2
  83. package/src/components/box.partial.tsx +293 -160
  84. package/src/components/inline.partial.tsx +44 -17
  85. package/src/components/interaction-surface.partial.tsx +2 -1
  86. package/src/components/stack.partial.tsx +43 -16
  87. package/src/components/text.partial.tsx +82 -41
  88. package/src/index.tsx +0 -1
  89. package/src/internal/color-map.tsx +4 -3
  90. package/src/internal/spacing-scale.tsx +22 -0
  91. package/text/package.json +15 -0
  92. package/tmp/api-report-tmp.d.ts +177 -43
  93. package/dist/cjs/constants.js +0 -21
  94. package/dist/es2019/constants.js +0 -14
  95. package/dist/esm/constants.js +0 -14
  96. package/dist/types/constants.d.ts +0 -15
  97. package/dist/types-ts4.0/constants.d.ts +0 -15
  98. package/src/constants.tsx +0 -16
@@ -1,28 +1,40 @@
1
1
  /** @jsx jsx */
2
- import { CSSProperties, ElementType, forwardRef, HTMLAttributes } from 'react';
2
+ import {
3
+ ComponentPropsWithoutRef,
4
+ ComponentPropsWithRef,
5
+ ElementType,
6
+ FC,
7
+ forwardRef,
8
+ ReactElement,
9
+ } from 'react';
3
10
 
4
11
  import { css, jsx } from '@emotion/react';
5
12
 
6
13
  import { token } from '@atlaskit/tokens';
7
14
 
8
- import { GlobalSpacingToken, SPACING_SCALE } from '../constants';
9
-
10
15
  import { SurfaceContext } from './surface-provider';
11
16
  import type { BasePrimitiveProps, NonTextChildren } from './types';
12
17
 
13
- export interface BoxProps<T extends HTMLElement = HTMLElement>
14
- extends Omit<HTMLAttributes<T>, 'style' | 'as' | 'className'>,
15
- BasePrimitiveProps {
18
+ type PropsToOmit = 'as' | 'className' | 'style';
19
+
20
+ export type BoxProps<T extends ElementType = 'div'> = Omit<
21
+ ComponentPropsWithoutRef<T>,
22
+ PropsToOmit
23
+ > &
24
+ BasePrimitiveProps &
25
+ BoxPropsBase<T>;
26
+
27
+ type BoxPropsBase<T extends ElementType> = {
16
28
  /**
17
29
  * The DOM element to render as the Box. Defaults to `div`.
18
30
  */
19
- as?: ElementType;
31
+ as?: T;
20
32
  /**
21
33
  * Elements to be rendered inside the Box.
22
34
  */
23
- children?: NonTextChildren | boolean | null | undefined;
35
+ children?: NonTextChildren | boolean | null;
24
36
  /**
25
- * The html className attribute.
37
+ * The HTML className attribute.
26
38
  *
27
39
  * Before using this prop please ensure:
28
40
  * - The styles cannot otherwise be achieved through `Box` directly.
@@ -36,7 +48,7 @@ export interface BoxProps<T extends HTMLElement = HTMLElement>
36
48
  /**
37
49
  * Token representing background color with a fallback.
38
50
  */
39
- backgroundColor?: [BackgroundColor, string];
51
+ backgroundColor?: BackgroundColor;
40
52
  /**
41
53
  * Defines border style.
42
54
  */
@@ -48,7 +60,7 @@ export interface BoxProps<T extends HTMLElement = HTMLElement>
48
60
  /**
49
61
  * Token representing border color with a fallback.
50
62
  */
51
- borderColor?: [BorderColor, string];
63
+ borderColor?: BorderColor;
52
64
  /**
53
65
  * Defines border radius.
54
66
  */
@@ -75,23 +87,23 @@ export interface BoxProps<T extends HTMLElement = HTMLElement>
75
87
  * @see paddingBlock
76
88
  * @see paddingInline
77
89
  */
78
- padding?: GlobalSpacingToken;
90
+ padding?: Padding;
79
91
  /**
80
92
  * Token representing CSS `padding-block`.
81
93
  */
82
- paddingBlock?: GlobalSpacingToken;
94
+ paddingBlock?: PaddingBlock;
83
95
  /**
84
96
  * Token representing CSS `padding-inline`.
85
97
  */
86
- paddingInline?: GlobalSpacingToken;
98
+ paddingInline?: PaddingInline;
87
99
  /**
88
100
  * Token representing width.
89
101
  */
90
- width?: GlobalSpacingToken;
102
+ width?: Width;
91
103
  /**
92
104
  * Token representing height.
93
105
  */
94
- height?: GlobalSpacingToken;
106
+ height?: Height;
95
107
  /**
96
108
  * Defines display type and layout. Defaults to `flex`.
97
109
  */
@@ -99,8 +111,17 @@ export interface BoxProps<T extends HTMLElement = HTMLElement>
99
111
  /**
100
112
  * CSS position property.
101
113
  */
102
- position?: keyof typeof positionMap;
103
- }
114
+ position?: Position;
115
+ ref?: ComponentPropsWithRef<T>['ref'];
116
+ };
117
+
118
+ // Without this type annotation on Box we don't get autocomplete for props due to forwardRef types
119
+ type BoxComponent<T extends ElementType = 'div'> = (<
120
+ T extends ElementType = 'div'
121
+ >(
122
+ props: BoxProps<T>,
123
+ ) => ReactElement | null) &
124
+ FC<BoxProps<T>>;
104
125
 
105
126
  /**
106
127
  * __Box__
@@ -110,18 +131,18 @@ export interface BoxProps<T extends HTMLElement = HTMLElement>
110
131
  *
111
132
  * @internal
112
133
  */
113
- const Box = forwardRef<HTMLElement, BoxProps>(
114
- (
134
+ export const Box: BoxComponent = forwardRef(
135
+ <T extends ElementType = 'div'>(
115
136
  {
116
137
  children,
117
- as: Component = 'div',
138
+ as,
118
139
  className,
119
140
  display = 'flex',
120
141
  flexDirection,
121
142
  alignItems,
122
143
  justifyContent,
123
- backgroundColor: backgroundColorTuple,
124
- borderColor: borderColorTuple,
144
+ backgroundColor,
145
+ borderColor,
125
146
  borderStyle,
126
147
  borderWidth,
127
148
  borderRadius,
@@ -135,23 +156,13 @@ const Box = forwardRef<HTMLElement, BoxProps>(
135
156
  UNSAFE_style,
136
157
  testId,
137
158
  ...htmlAttributes
138
- },
139
- ref,
159
+ }: BoxProps<T>,
160
+ ref?: ComponentPropsWithRef<T>['ref'],
140
161
  ) => {
141
- const [backgroundColor, backgroundColorFallback] =
142
- backgroundColorTuple || [];
143
- const [borderColor, borderColorFallback] = borderColorTuple || [];
144
-
162
+ const Component = as || 'div';
145
163
  const node = (
146
164
  <Component
147
- style={{
148
- ...UNSAFE_style,
149
- ...(backgroundColorFallback &&
150
- ({ '--ds-bg-fb': backgroundColorFallback } as CSSProperties)),
151
- ...(borderColorFallback &&
152
- ({ '--ds-bo-fb': borderColorFallback } as CSSProperties)),
153
- }}
154
- // @ts-ignore
165
+ style={UNSAFE_style}
155
166
  ref={ref}
156
167
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
157
168
  {...htmlAttributes}
@@ -171,6 +182,7 @@ const Box = forwardRef<HTMLElement, BoxProps>(
171
182
  borderWidth && borderWidthMap[borderWidth],
172
183
  borderRadius && borderRadiusMap[borderRadius],
173
184
  flexDirection && flexDirectionMap[flexDirection],
185
+ overflow && overflowMap[overflow],
174
186
  width && widthMap[width],
175
187
  height && heightMap[height],
176
188
  ]}
@@ -247,155 +259,288 @@ const displayMap = {
247
259
  inlineFlex: css({ display: 'inline-flex' }),
248
260
  };
249
261
 
250
- const baseStyles = css({
251
- boxSizing: 'border-box',
252
- appearance: 'none',
253
- border: 'none',
254
- });
262
+ type Position = keyof typeof positionMap;
263
+ const positionMap = {
264
+ absolute: css({ position: 'absolute' }),
265
+ relative: css({ position: 'relative' }),
266
+ static: css({ position: 'static' }),
267
+ };
255
268
 
256
269
  type Overflow = keyof typeof overflowMap;
257
270
  const overflowMap = {
258
271
  auto: css({ overflow: 'auto' }),
259
272
  };
260
273
 
261
- const positionMap = {
262
- absolute: css({ position: 'absolute' }),
263
- relative: css({ position: 'relative' }),
264
- static: css({ position: 'static' }),
265
- };
274
+ const baseStyles = css({
275
+ boxSizing: 'border-box',
276
+ appearance: 'none',
277
+ border: 'none',
278
+ });
266
279
 
267
280
  /**
268
281
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
269
- * @codegen <<SignedSource::57b4c7c177fdfae3f7cd4f00287fd30e>>
282
+ * @codegen <<SignedSource::af3861211bc952f699f2ee08458af9a1>>
270
283
  * @codegenId spacing
271
284
  * @codegenCommand yarn codegen-styles
272
285
  * @codegenParams ["padding", "paddingBlock", "paddingInline", "width", "height"]
286
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
273
287
  */
274
288
  const paddingMap = {
275
- 'sp-0': css({ padding: SPACING_SCALE['sp-0'] }),
276
- 'sp-25': css({ padding: SPACING_SCALE['sp-25'] }),
277
- 'sp-50': css({ padding: SPACING_SCALE['sp-50'] }),
278
- 'sp-75': css({ padding: SPACING_SCALE['sp-75'] }),
279
- 'sp-100': css({ padding: SPACING_SCALE['sp-100'] }),
280
- 'sp-150': css({ padding: SPACING_SCALE['sp-150'] }),
281
- 'sp-200': css({ padding: SPACING_SCALE['sp-200'] }),
282
- 'sp-300': css({ padding: SPACING_SCALE['sp-300'] }),
283
- 'sp-400': css({ padding: SPACING_SCALE['sp-400'] }),
284
- 'sp-500': css({ padding: SPACING_SCALE['sp-500'] }),
285
- 'sp-600': css({ padding: SPACING_SCALE['sp-600'] }),
286
- 'sp-800': css({ padding: SPACING_SCALE['sp-800'] }),
289
+ 'scale.0': css({
290
+ padding: token('spacing.scale.0', '0'),
291
+ }),
292
+ 'scale.025': css({
293
+ padding: token('spacing.scale.025', '0.125rem'),
294
+ }),
295
+ 'scale.050': css({
296
+ padding: token('spacing.scale.050', '0.25rem'),
297
+ }),
298
+ 'scale.075': css({
299
+ padding: token('spacing.scale.075', '0.375rem'),
300
+ }),
301
+ 'scale.100': css({
302
+ padding: token('spacing.scale.100', '0.5rem'),
303
+ }),
304
+ 'scale.150': css({
305
+ padding: token('spacing.scale.150', '0.75rem'),
306
+ }),
307
+ 'scale.200': css({
308
+ padding: token('spacing.scale.200', '1rem'),
309
+ }),
310
+ 'scale.250': css({
311
+ padding: token('spacing.scale.250', '1.25rem'),
312
+ }),
313
+ 'scale.300': css({
314
+ padding: token('spacing.scale.300', '1.5rem'),
315
+ }),
316
+ 'scale.400': css({
317
+ padding: token('spacing.scale.400', '2rem'),
318
+ }),
319
+ 'scale.500': css({
320
+ padding: token('spacing.scale.500', '2.5rem'),
321
+ }),
322
+ 'scale.600': css({
323
+ padding: token('spacing.scale.600', '3rem'),
324
+ }),
287
325
  };
288
326
 
327
+ export type Padding = keyof typeof paddingMap;
328
+
289
329
  const paddingBlockMap = {
290
- 'sp-0': css({ paddingBlock: SPACING_SCALE['sp-0'] }),
291
- 'sp-25': css({ paddingBlock: SPACING_SCALE['sp-25'] }),
292
- 'sp-50': css({ paddingBlock: SPACING_SCALE['sp-50'] }),
293
- 'sp-75': css({ paddingBlock: SPACING_SCALE['sp-75'] }),
294
- 'sp-100': css({ paddingBlock: SPACING_SCALE['sp-100'] }),
295
- 'sp-150': css({ paddingBlock: SPACING_SCALE['sp-150'] }),
296
- 'sp-200': css({ paddingBlock: SPACING_SCALE['sp-200'] }),
297
- 'sp-300': css({ paddingBlock: SPACING_SCALE['sp-300'] }),
298
- 'sp-400': css({ paddingBlock: SPACING_SCALE['sp-400'] }),
299
- 'sp-500': css({ paddingBlock: SPACING_SCALE['sp-500'] }),
300
- 'sp-600': css({ paddingBlock: SPACING_SCALE['sp-600'] }),
301
- 'sp-800': css({ paddingBlock: SPACING_SCALE['sp-800'] }),
330
+ 'scale.0': css({
331
+ paddingBlock: token('spacing.scale.0', '0'),
332
+ }),
333
+ 'scale.025': css({
334
+ paddingBlock: token('spacing.scale.025', '0.125rem'),
335
+ }),
336
+ 'scale.050': css({
337
+ paddingBlock: token('spacing.scale.050', '0.25rem'),
338
+ }),
339
+ 'scale.075': css({
340
+ paddingBlock: token('spacing.scale.075', '0.375rem'),
341
+ }),
342
+ 'scale.100': css({
343
+ paddingBlock: token('spacing.scale.100', '0.5rem'),
344
+ }),
345
+ 'scale.150': css({
346
+ paddingBlock: token('spacing.scale.150', '0.75rem'),
347
+ }),
348
+ 'scale.200': css({
349
+ paddingBlock: token('spacing.scale.200', '1rem'),
350
+ }),
351
+ 'scale.250': css({
352
+ paddingBlock: token('spacing.scale.250', '1.25rem'),
353
+ }),
354
+ 'scale.300': css({
355
+ paddingBlock: token('spacing.scale.300', '1.5rem'),
356
+ }),
357
+ 'scale.400': css({
358
+ paddingBlock: token('spacing.scale.400', '2rem'),
359
+ }),
360
+ 'scale.500': css({
361
+ paddingBlock: token('spacing.scale.500', '2.5rem'),
362
+ }),
363
+ 'scale.600': css({
364
+ paddingBlock: token('spacing.scale.600', '3rem'),
365
+ }),
302
366
  };
303
367
 
368
+ export type PaddingBlock = keyof typeof paddingBlockMap;
369
+
304
370
  const paddingInlineMap = {
305
- 'sp-0': css({ paddingInline: SPACING_SCALE['sp-0'] }),
306
- 'sp-25': css({ paddingInline: SPACING_SCALE['sp-25'] }),
307
- 'sp-50': css({ paddingInline: SPACING_SCALE['sp-50'] }),
308
- 'sp-75': css({ paddingInline: SPACING_SCALE['sp-75'] }),
309
- 'sp-100': css({ paddingInline: SPACING_SCALE['sp-100'] }),
310
- 'sp-150': css({ paddingInline: SPACING_SCALE['sp-150'] }),
311
- 'sp-200': css({ paddingInline: SPACING_SCALE['sp-200'] }),
312
- 'sp-300': css({ paddingInline: SPACING_SCALE['sp-300'] }),
313
- 'sp-400': css({ paddingInline: SPACING_SCALE['sp-400'] }),
314
- 'sp-500': css({ paddingInline: SPACING_SCALE['sp-500'] }),
315
- 'sp-600': css({ paddingInline: SPACING_SCALE['sp-600'] }),
316
- 'sp-800': css({ paddingInline: SPACING_SCALE['sp-800'] }),
371
+ 'scale.0': css({
372
+ paddingInline: token('spacing.scale.0', '0'),
373
+ }),
374
+ 'scale.025': css({
375
+ paddingInline: token('spacing.scale.025', '0.125rem'),
376
+ }),
377
+ 'scale.050': css({
378
+ paddingInline: token('spacing.scale.050', '0.25rem'),
379
+ }),
380
+ 'scale.075': css({
381
+ paddingInline: token('spacing.scale.075', '0.375rem'),
382
+ }),
383
+ 'scale.100': css({
384
+ paddingInline: token('spacing.scale.100', '0.5rem'),
385
+ }),
386
+ 'scale.150': css({
387
+ paddingInline: token('spacing.scale.150', '0.75rem'),
388
+ }),
389
+ 'scale.200': css({
390
+ paddingInline: token('spacing.scale.200', '1rem'),
391
+ }),
392
+ 'scale.250': css({
393
+ paddingInline: token('spacing.scale.250', '1.25rem'),
394
+ }),
395
+ 'scale.300': css({
396
+ paddingInline: token('spacing.scale.300', '1.5rem'),
397
+ }),
398
+ 'scale.400': css({
399
+ paddingInline: token('spacing.scale.400', '2rem'),
400
+ }),
401
+ 'scale.500': css({
402
+ paddingInline: token('spacing.scale.500', '2.5rem'),
403
+ }),
404
+ 'scale.600': css({
405
+ paddingInline: token('spacing.scale.600', '3rem'),
406
+ }),
317
407
  };
318
408
 
409
+ export type PaddingInline = keyof typeof paddingInlineMap;
410
+
319
411
  const widthMap = {
320
- 'sp-0': css({ width: SPACING_SCALE['sp-0'] }),
321
- 'sp-25': css({ width: SPACING_SCALE['sp-25'] }),
322
- 'sp-50': css({ width: SPACING_SCALE['sp-50'] }),
323
- 'sp-75': css({ width: SPACING_SCALE['sp-75'] }),
324
- 'sp-100': css({ width: SPACING_SCALE['sp-100'] }),
325
- 'sp-150': css({ width: SPACING_SCALE['sp-150'] }),
326
- 'sp-200': css({ width: SPACING_SCALE['sp-200'] }),
327
- 'sp-300': css({ width: SPACING_SCALE['sp-300'] }),
328
- 'sp-400': css({ width: SPACING_SCALE['sp-400'] }),
329
- 'sp-500': css({ width: SPACING_SCALE['sp-500'] }),
330
- 'sp-600': css({ width: SPACING_SCALE['sp-600'] }),
331
- 'sp-800': css({ width: SPACING_SCALE['sp-800'] }),
412
+ 'scale.0': css({
413
+ width: token('spacing.scale.0', '0'),
414
+ }),
415
+ 'scale.025': css({
416
+ width: token('spacing.scale.025', '0.125rem'),
417
+ }),
418
+ 'scale.050': css({
419
+ width: token('spacing.scale.050', '0.25rem'),
420
+ }),
421
+ 'scale.075': css({
422
+ width: token('spacing.scale.075', '0.375rem'),
423
+ }),
424
+ 'scale.100': css({
425
+ width: token('spacing.scale.100', '0.5rem'),
426
+ }),
427
+ 'scale.150': css({
428
+ width: token('spacing.scale.150', '0.75rem'),
429
+ }),
430
+ 'scale.200': css({
431
+ width: token('spacing.scale.200', '1rem'),
432
+ }),
433
+ 'scale.250': css({
434
+ width: token('spacing.scale.250', '1.25rem'),
435
+ }),
436
+ 'scale.300': css({
437
+ width: token('spacing.scale.300', '1.5rem'),
438
+ }),
439
+ 'scale.400': css({
440
+ width: token('spacing.scale.400', '2rem'),
441
+ }),
442
+ 'scale.500': css({
443
+ width: token('spacing.scale.500', '2.5rem'),
444
+ }),
445
+ 'scale.600': css({
446
+ width: token('spacing.scale.600', '3rem'),
447
+ }),
332
448
  };
333
449
 
450
+ export type Width = keyof typeof widthMap;
451
+
334
452
  const heightMap = {
335
- 'sp-0': css({ height: SPACING_SCALE['sp-0'] }),
336
- 'sp-25': css({ height: SPACING_SCALE['sp-25'] }),
337
- 'sp-50': css({ height: SPACING_SCALE['sp-50'] }),
338
- 'sp-75': css({ height: SPACING_SCALE['sp-75'] }),
339
- 'sp-100': css({ height: SPACING_SCALE['sp-100'] }),
340
- 'sp-150': css({ height: SPACING_SCALE['sp-150'] }),
341
- 'sp-200': css({ height: SPACING_SCALE['sp-200'] }),
342
- 'sp-300': css({ height: SPACING_SCALE['sp-300'] }),
343
- 'sp-400': css({ height: SPACING_SCALE['sp-400'] }),
344
- 'sp-500': css({ height: SPACING_SCALE['sp-500'] }),
345
- 'sp-600': css({ height: SPACING_SCALE['sp-600'] }),
346
- 'sp-800': css({ height: SPACING_SCALE['sp-800'] }),
453
+ 'scale.0': css({
454
+ height: token('spacing.scale.0', '0'),
455
+ }),
456
+ 'scale.025': css({
457
+ height: token('spacing.scale.025', '0.125rem'),
458
+ }),
459
+ 'scale.050': css({
460
+ height: token('spacing.scale.050', '0.25rem'),
461
+ }),
462
+ 'scale.075': css({
463
+ height: token('spacing.scale.075', '0.375rem'),
464
+ }),
465
+ 'scale.100': css({
466
+ height: token('spacing.scale.100', '0.5rem'),
467
+ }),
468
+ 'scale.150': css({
469
+ height: token('spacing.scale.150', '0.75rem'),
470
+ }),
471
+ 'scale.200': css({
472
+ height: token('spacing.scale.200', '1rem'),
473
+ }),
474
+ 'scale.250': css({
475
+ height: token('spacing.scale.250', '1.25rem'),
476
+ }),
477
+ 'scale.300': css({
478
+ height: token('spacing.scale.300', '1.5rem'),
479
+ }),
480
+ 'scale.400': css({
481
+ height: token('spacing.scale.400', '2rem'),
482
+ }),
483
+ 'scale.500': css({
484
+ height: token('spacing.scale.500', '2.5rem'),
485
+ }),
486
+ 'scale.600': css({
487
+ height: token('spacing.scale.600', '3rem'),
488
+ }),
347
489
  };
348
490
 
491
+ export type Height = keyof typeof heightMap;
492
+
349
493
  /**
350
494
  * @codegenEnd
351
495
  */
352
496
 
353
497
  /**
354
498
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
355
- * @codegen <<SignedSource::ebb55786a54803214357d0eef0cac448>>
499
+ * @codegen <<SignedSource::781636715c2bee941d6836a5a90fed5b>>
356
500
  * @codegenId colors
357
501
  * @codegenCommand yarn codegen-styles
358
502
  * @codegenParams ["border", "background"]
503
+ * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
359
504
  */
360
505
  const borderColorMap = {
361
506
  'color.border': css({
362
- borderColor: token('color.border', 'var(--ds-bo-fb)'),
507
+ borderColor: token('color.border', '#091e4221'),
363
508
  }),
364
509
  bold: css({
365
- borderColor: token('color.border.bold', 'var(--ds-bo-fb)'),
510
+ borderColor: token('color.border.bold', '#344563'),
366
511
  }),
367
512
  inverse: css({
368
- borderColor: token('color.border.inverse', 'var(--ds-bo-fb)'),
513
+ borderColor: token('color.border.inverse', '#FFFFFF'),
369
514
  }),
370
515
  focused: css({
371
- borderColor: token('color.border.focused', 'var(--ds-bo-fb)'),
516
+ borderColor: token('color.border.focused', '#4C9AFF'),
372
517
  }),
373
518
  input: css({
374
- borderColor: token('color.border.input', 'var(--ds-bo-fb)'),
519
+ borderColor: token('color.border.input', '#FAFBFC'),
375
520
  }),
376
521
  disabled: css({
377
- borderColor: token('color.border.disabled', 'var(--ds-bo-fb)'),
522
+ borderColor: token('color.border.disabled', '#FAFBFC'),
378
523
  }),
379
524
  brand: css({
380
- borderColor: token('color.border.brand', 'var(--ds-bo-fb)'),
525
+ borderColor: token('color.border.brand', '#0052CC'),
381
526
  }),
382
527
  selected: css({
383
- borderColor: token('color.border.selected', 'var(--ds-bo-fb)'),
528
+ borderColor: token('color.border.selected', '#0052CC'),
384
529
  }),
385
530
  danger: css({
386
- borderColor: token('color.border.danger', 'var(--ds-bo-fb)'),
531
+ borderColor: token('color.border.danger', '#FF5630'),
387
532
  }),
388
533
  warning: css({
389
- borderColor: token('color.border.warning', 'var(--ds-bo-fb)'),
534
+ borderColor: token('color.border.warning', '#FFC400'),
390
535
  }),
391
536
  success: css({
392
- borderColor: token('color.border.success', 'var(--ds-bo-fb)'),
537
+ borderColor: token('color.border.success', '#00875A'),
393
538
  }),
394
539
  discovery: css({
395
- borderColor: token('color.border.discovery', 'var(--ds-bo-fb)'),
540
+ borderColor: token('color.border.discovery', '#998DD9'),
396
541
  }),
397
542
  information: css({
398
- borderColor: token('color.border.information', 'var(--ds-bo-fb)'),
543
+ borderColor: token('color.border.information', '#0065FF'),
399
544
  }),
400
545
  };
401
546
 
@@ -403,94 +548,82 @@ export type BorderColor = keyof typeof borderColorMap;
403
548
 
404
549
  const backgroundColorMap = {
405
550
  disabled: css({
406
- backgroundColor: token('color.background.disabled', 'var(--ds-bg-fb)'),
551
+ backgroundColor: token('color.background.disabled', '#091e4289'),
407
552
  }),
408
553
  'inverse.subtle': css({
409
- backgroundColor: token(
410
- 'color.background.inverse.subtle',
411
- 'var(--ds-bg-fb)',
412
- ),
554
+ backgroundColor: token('color.background.inverse.subtle', '#00000029'),
413
555
  }),
414
556
  input: css({
415
- backgroundColor: token('color.background.input', 'var(--ds-bg-fb)'),
557
+ backgroundColor: token('color.background.input', '#FAFBFC'),
416
558
  }),
417
559
  neutral: css({
418
- backgroundColor: token('color.background.neutral', 'var(--ds-bg-fb)'),
560
+ backgroundColor: token('color.background.neutral', '#DFE1E6'),
419
561
  }),
420
562
  'neutral.subtle': css({
421
- backgroundColor: token(
422
- 'color.background.neutral.subtle',
423
- 'var(--ds-bg-fb)',
424
- ),
563
+ backgroundColor: token('color.background.neutral.subtle', 'transparent'),
425
564
  }),
426
565
  'neutral.bold': css({
427
- backgroundColor: token('color.background.neutral.bold', 'var(--ds-bg-fb)'),
566
+ backgroundColor: token('color.background.neutral.bold', '#42526E'),
428
567
  }),
429
568
  'brand.bold': css({
430
- backgroundColor: token('color.background.brand.bold', 'var(--ds-bg-fb)'),
569
+ backgroundColor: token('color.background.brand.bold', '#0052CC'),
431
570
  }),
432
571
  selected: css({
433
- backgroundColor: token('color.background.selected', 'var(--ds-bg-fb)'),
572
+ backgroundColor: token('color.background.selected', '#DEEBFF'),
434
573
  }),
435
574
  'selected.bold': css({
436
- backgroundColor: token('color.background.selected.bold', 'var(--ds-bg-fb)'),
575
+ backgroundColor: token('color.background.selected.bold', '#0052CC'),
437
576
  }),
438
577
  danger: css({
439
- backgroundColor: token('color.background.danger', 'var(--ds-bg-fb)'),
578
+ backgroundColor: token('color.background.danger', '#FFEBE6'),
440
579
  }),
441
580
  'danger.bold': css({
442
- backgroundColor: token('color.background.danger.bold', 'var(--ds-bg-fb)'),
581
+ backgroundColor: token('color.background.danger.bold', '#DE350B'),
443
582
  }),
444
583
  warning: css({
445
- backgroundColor: token('color.background.warning', 'var(--ds-bg-fb)'),
584
+ backgroundColor: token('color.background.warning', '#FFFAE6'),
446
585
  }),
447
586
  'warning.bold': css({
448
- backgroundColor: token('color.background.warning.bold', 'var(--ds-bg-fb)'),
587
+ backgroundColor: token('color.background.warning.bold', '#FFAB00'),
449
588
  }),
450
589
  success: css({
451
- backgroundColor: token('color.background.success', 'var(--ds-bg-fb)'),
590
+ backgroundColor: token('color.background.success', '#E3FCEF'),
452
591
  }),
453
592
  'success.bold': css({
454
- backgroundColor: token('color.background.success.bold', 'var(--ds-bg-fb)'),
593
+ backgroundColor: token('color.background.success.bold', '#00875A'),
455
594
  }),
456
595
  discovery: css({
457
- backgroundColor: token('color.background.discovery', 'var(--ds-bg-fb)'),
596
+ backgroundColor: token('color.background.discovery', '#EAE6FF'),
458
597
  }),
459
598
  'discovery.bold': css({
460
- backgroundColor: token(
461
- 'color.background.discovery.bold',
462
- 'var(--ds-bg-fb)',
463
- ),
599
+ backgroundColor: token('color.background.discovery.bold', '#5243AA'),
464
600
  }),
465
601
  information: css({
466
- backgroundColor: token('color.background.information', 'var(--ds-bg-fb)'),
602
+ backgroundColor: token('color.background.information', '#DEEBFF'),
467
603
  }),
468
604
  'information.bold': css({
469
- backgroundColor: token(
470
- 'color.background.information.bold',
471
- 'var(--ds-bg-fb)',
472
- ),
605
+ backgroundColor: token('color.background.information.bold', '#0052CC'),
473
606
  }),
474
607
  'color.blanket': css({
475
- backgroundColor: token('color.blanket', 'var(--ds-bg-fb)'),
608
+ backgroundColor: token('color.blanket', '#091e4289'),
476
609
  }),
477
610
  'color.blanket.selected': css({
478
- backgroundColor: token('color.blanket.selected', 'var(--ds-bg-fb)'),
611
+ backgroundColor: token('color.blanket.selected', '#388BFF14'),
479
612
  }),
480
613
  'color.blanket.danger': css({
481
- backgroundColor: token('color.blanket.danger', 'var(--ds-bg-fb)'),
614
+ backgroundColor: token('color.blanket.danger', '#EF5C4814'),
482
615
  }),
483
616
  'elevation.surface': css({
484
- backgroundColor: token('elevation.surface', 'var(--ds-bg-fb)'),
617
+ backgroundColor: token('elevation.surface', '#FFFFFF'),
485
618
  }),
486
619
  'elevation.surface.sunken': css({
487
- backgroundColor: token('elevation.surface.sunken', 'var(--ds-bg-fb)'),
620
+ backgroundColor: token('elevation.surface.sunken', '#F4F5F7'),
488
621
  }),
489
622
  'elevation.surface.raised': css({
490
- backgroundColor: token('elevation.surface.raised', 'var(--ds-bg-fb)'),
623
+ backgroundColor: token('elevation.surface.raised', '#FFFFFF'),
491
624
  }),
492
625
  'elevation.surface.overlay': css({
493
- backgroundColor: token('elevation.surface.overlay', 'var(--ds-bg-fb)'),
626
+ backgroundColor: token('elevation.surface.overlay', '#FFFFFF'),
494
627
  }),
495
628
  };
496
629