@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.
- package/CHANGELOG.md +28 -0
- package/box/package.json +15 -0
- package/dist/cjs/components/box.partial.js +182 -205
- package/dist/cjs/components/inline.partial.js +28 -34
- package/dist/cjs/components/interaction-surface.partial.js +32 -1
- package/dist/cjs/components/stack.partial.js +28 -36
- package/dist/cjs/components/text.partial.js +117 -86
- package/dist/cjs/index.js +1 -9
- package/dist/cjs/internal/color-map.js +6 -5
- package/dist/cjs/internal/spacing-scale.js +17 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +181 -189
- package/dist/es2019/components/inline.partial.js +27 -28
- package/dist/es2019/components/interaction-surface.partial.js +32 -1
- package/dist/es2019/components/stack.partial.js +27 -28
- package/dist/es2019/components/text.partial.js +74 -36
- package/dist/es2019/index.js +1 -2
- package/dist/es2019/internal/color-map.js +4 -3
- package/dist/es2019/internal/spacing-scale.js +9 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +181 -201
- package/dist/esm/components/inline.partial.js +27 -33
- package/dist/esm/components/interaction-surface.partial.js +32 -1
- package/dist/esm/components/stack.partial.js +27 -33
- package/dist/esm/components/text.partial.js +79 -47
- package/dist/esm/index.js +1 -2
- package/dist/esm/internal/color-map.js +4 -3
- package/dist/esm/internal/spacing-scale.js +9 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +109 -21
- package/dist/types/components/inline.partial.d.ts +25 -3
- package/dist/types/components/interaction-surface.partial.d.ts +3 -0
- package/dist/types/components/stack.partial.d.ts +24 -2
- package/dist/types/components/text.partial.d.ts +9 -3
- package/dist/types/index.d.ts +0 -1
- package/dist/types/internal/color-map.d.ts +11 -9
- package/dist/types/internal/spacing-scale.d.ts +9 -0
- package/dist/types-ts4.0/components/box.partial.d.ts +109 -27
- package/dist/types-ts4.0/components/inline.partial.d.ts +25 -3
- package/dist/types-ts4.0/components/interaction-surface.partial.d.ts +3 -0
- package/dist/types-ts4.0/components/stack.partial.d.ts +24 -2
- package/dist/types-ts4.0/components/text.partial.d.ts +9 -6
- package/dist/types-ts4.0/index.d.ts +0 -1
- package/dist/types-ts4.0/internal/color-map.d.ts +11 -9
- package/dist/types-ts4.0/internal/spacing-scale.d.ts +22 -0
- package/examples/00-basic.tsx +4 -4
- package/examples/01-box.tsx +29 -46
- package/examples/02-text-advanced.tsx +38 -0
- package/examples/02-text.tsx +73 -62
- package/examples/03-stack.tsx +36 -75
- package/examples/04-inline.tsx +34 -76
- package/examples/05-badge.tsx +2 -2
- package/examples/06-section-message.tsx +7 -7
- package/examples/07-comment.tsx +4 -6
- package/examples/08-lozenge.tsx +9 -5
- package/examples/99-interactions.tsx +20 -20
- package/examples/config.jsonc +11 -0
- package/package.json +5 -2
- package/report.api.md +188 -48
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +52 -64
- package/scripts/codegen-styles.tsx +34 -6
- package/scripts/color-codegen-template.tsx +10 -15
- package/scripts/color-map-template.tsx +1 -1
- package/scripts/spacing-codegen-template.tsx +42 -12
- package/scripts/spacing-scale-template.tsx +40 -0
- package/scripts/utils.tsx +1 -3
- package/src/components/__tests__/unit/box.test.tsx +8 -11
- package/src/components/__tests__/unit/inline.test.tsx +3 -3
- package/src/components/__tests__/unit/interaction-suface.test.tsx +1 -1
- package/src/components/__tests__/unit/stack.test.tsx +2 -2
- package/src/components/__tests__/unit/text.test.tsx +32 -1
- 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
- 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
- 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
- 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
- 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
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +2 -2
- 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
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-testing-should-match-snapshot-1-snap.png +2 -2
- package/src/components/box.partial.tsx +293 -160
- package/src/components/inline.partial.tsx +44 -17
- package/src/components/interaction-surface.partial.tsx +2 -1
- package/src/components/stack.partial.tsx +43 -16
- package/src/components/text.partial.tsx +82 -41
- package/src/index.tsx +0 -1
- package/src/internal/color-map.tsx +4 -3
- package/src/internal/spacing-scale.tsx +22 -0
- package/text/package.json +15 -0
- package/tmp/api-report-tmp.d.ts +177 -43
- package/dist/cjs/constants.js +0 -21
- package/dist/es2019/constants.js +0 -14
- package/dist/esm/constants.js +0 -14
- package/dist/types/constants.d.ts +0 -15
- package/dist/types-ts4.0/constants.d.ts +0 -15
- package/src/constants.tsx +0 -16
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import {
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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?:
|
|
31
|
+
as?: T;
|
|
20
32
|
/**
|
|
21
33
|
* Elements to be rendered inside the Box.
|
|
22
34
|
*/
|
|
23
|
-
children?: NonTextChildren | boolean | null
|
|
35
|
+
children?: NonTextChildren | boolean | null;
|
|
24
36
|
/**
|
|
25
|
-
* The
|
|
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?:
|
|
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?:
|
|
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?:
|
|
90
|
+
padding?: Padding;
|
|
79
91
|
/**
|
|
80
92
|
* Token representing CSS `padding-block`.
|
|
81
93
|
*/
|
|
82
|
-
paddingBlock?:
|
|
94
|
+
paddingBlock?: PaddingBlock;
|
|
83
95
|
/**
|
|
84
96
|
* Token representing CSS `padding-inline`.
|
|
85
97
|
*/
|
|
86
|
-
paddingInline?:
|
|
98
|
+
paddingInline?: PaddingInline;
|
|
87
99
|
/**
|
|
88
100
|
* Token representing width.
|
|
89
101
|
*/
|
|
90
|
-
width?:
|
|
102
|
+
width?: Width;
|
|
91
103
|
/**
|
|
92
104
|
* Token representing height.
|
|
93
105
|
*/
|
|
94
|
-
height?:
|
|
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?:
|
|
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
|
|
114
|
-
(
|
|
134
|
+
export const Box: BoxComponent = forwardRef(
|
|
135
|
+
<T extends ElementType = 'div'>(
|
|
115
136
|
{
|
|
116
137
|
children,
|
|
117
|
-
as
|
|
138
|
+
as,
|
|
118
139
|
className,
|
|
119
140
|
display = 'flex',
|
|
120
141
|
flexDirection,
|
|
121
142
|
alignItems,
|
|
122
143
|
justifyContent,
|
|
123
|
-
backgroundColor
|
|
124
|
-
borderColor
|
|
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
|
|
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
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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::
|
|
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
|
-
'
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
'
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
'
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
'
|
|
285
|
-
|
|
286
|
-
|
|
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
|
-
'
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
'
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
'
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
'
|
|
300
|
-
|
|
301
|
-
|
|
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
|
-
'
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
'
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
'
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
'
|
|
315
|
-
|
|
316
|
-
|
|
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
|
-
'
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
'
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
'
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
'
|
|
330
|
-
|
|
331
|
-
|
|
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
|
-
'
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
'
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
'
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
'
|
|
345
|
-
|
|
346
|
-
|
|
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::
|
|
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', '
|
|
507
|
+
borderColor: token('color.border', '#091e4221'),
|
|
363
508
|
}),
|
|
364
509
|
bold: css({
|
|
365
|
-
borderColor: token('color.border.bold', '
|
|
510
|
+
borderColor: token('color.border.bold', '#344563'),
|
|
366
511
|
}),
|
|
367
512
|
inverse: css({
|
|
368
|
-
borderColor: token('color.border.inverse', '
|
|
513
|
+
borderColor: token('color.border.inverse', '#FFFFFF'),
|
|
369
514
|
}),
|
|
370
515
|
focused: css({
|
|
371
|
-
borderColor: token('color.border.focused', '
|
|
516
|
+
borderColor: token('color.border.focused', '#4C9AFF'),
|
|
372
517
|
}),
|
|
373
518
|
input: css({
|
|
374
|
-
borderColor: token('color.border.input', '
|
|
519
|
+
borderColor: token('color.border.input', '#FAFBFC'),
|
|
375
520
|
}),
|
|
376
521
|
disabled: css({
|
|
377
|
-
borderColor: token('color.border.disabled', '
|
|
522
|
+
borderColor: token('color.border.disabled', '#FAFBFC'),
|
|
378
523
|
}),
|
|
379
524
|
brand: css({
|
|
380
|
-
borderColor: token('color.border.brand', '
|
|
525
|
+
borderColor: token('color.border.brand', '#0052CC'),
|
|
381
526
|
}),
|
|
382
527
|
selected: css({
|
|
383
|
-
borderColor: token('color.border.selected', '
|
|
528
|
+
borderColor: token('color.border.selected', '#0052CC'),
|
|
384
529
|
}),
|
|
385
530
|
danger: css({
|
|
386
|
-
borderColor: token('color.border.danger', '
|
|
531
|
+
borderColor: token('color.border.danger', '#FF5630'),
|
|
387
532
|
}),
|
|
388
533
|
warning: css({
|
|
389
|
-
borderColor: token('color.border.warning', '
|
|
534
|
+
borderColor: token('color.border.warning', '#FFC400'),
|
|
390
535
|
}),
|
|
391
536
|
success: css({
|
|
392
|
-
borderColor: token('color.border.success', '
|
|
537
|
+
borderColor: token('color.border.success', '#00875A'),
|
|
393
538
|
}),
|
|
394
539
|
discovery: css({
|
|
395
|
-
borderColor: token('color.border.discovery', '
|
|
540
|
+
borderColor: token('color.border.discovery', '#998DD9'),
|
|
396
541
|
}),
|
|
397
542
|
information: css({
|
|
398
|
-
borderColor: token('color.border.information', '
|
|
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', '
|
|
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', '
|
|
557
|
+
backgroundColor: token('color.background.input', '#FAFBFC'),
|
|
416
558
|
}),
|
|
417
559
|
neutral: css({
|
|
418
|
-
backgroundColor: token('color.background.neutral', '
|
|
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', '
|
|
566
|
+
backgroundColor: token('color.background.neutral.bold', '#42526E'),
|
|
428
567
|
}),
|
|
429
568
|
'brand.bold': css({
|
|
430
|
-
backgroundColor: token('color.background.brand.bold', '
|
|
569
|
+
backgroundColor: token('color.background.brand.bold', '#0052CC'),
|
|
431
570
|
}),
|
|
432
571
|
selected: css({
|
|
433
|
-
backgroundColor: token('color.background.selected', '
|
|
572
|
+
backgroundColor: token('color.background.selected', '#DEEBFF'),
|
|
434
573
|
}),
|
|
435
574
|
'selected.bold': css({
|
|
436
|
-
backgroundColor: token('color.background.selected.bold', '
|
|
575
|
+
backgroundColor: token('color.background.selected.bold', '#0052CC'),
|
|
437
576
|
}),
|
|
438
577
|
danger: css({
|
|
439
|
-
backgroundColor: token('color.background.danger', '
|
|
578
|
+
backgroundColor: token('color.background.danger', '#FFEBE6'),
|
|
440
579
|
}),
|
|
441
580
|
'danger.bold': css({
|
|
442
|
-
backgroundColor: token('color.background.danger.bold', '
|
|
581
|
+
backgroundColor: token('color.background.danger.bold', '#DE350B'),
|
|
443
582
|
}),
|
|
444
583
|
warning: css({
|
|
445
|
-
backgroundColor: token('color.background.warning', '
|
|
584
|
+
backgroundColor: token('color.background.warning', '#FFFAE6'),
|
|
446
585
|
}),
|
|
447
586
|
'warning.bold': css({
|
|
448
|
-
backgroundColor: token('color.background.warning.bold', '
|
|
587
|
+
backgroundColor: token('color.background.warning.bold', '#FFAB00'),
|
|
449
588
|
}),
|
|
450
589
|
success: css({
|
|
451
|
-
backgroundColor: token('color.background.success', '
|
|
590
|
+
backgroundColor: token('color.background.success', '#E3FCEF'),
|
|
452
591
|
}),
|
|
453
592
|
'success.bold': css({
|
|
454
|
-
backgroundColor: token('color.background.success.bold', '
|
|
593
|
+
backgroundColor: token('color.background.success.bold', '#00875A'),
|
|
455
594
|
}),
|
|
456
595
|
discovery: css({
|
|
457
|
-
backgroundColor: token('color.background.discovery', '
|
|
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', '
|
|
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', '
|
|
608
|
+
backgroundColor: token('color.blanket', '#091e4289'),
|
|
476
609
|
}),
|
|
477
610
|
'color.blanket.selected': css({
|
|
478
|
-
backgroundColor: token('color.blanket.selected', '
|
|
611
|
+
backgroundColor: token('color.blanket.selected', '#388BFF14'),
|
|
479
612
|
}),
|
|
480
613
|
'color.blanket.danger': css({
|
|
481
|
-
backgroundColor: token('color.blanket.danger', '
|
|
614
|
+
backgroundColor: token('color.blanket.danger', '#EF5C4814'),
|
|
482
615
|
}),
|
|
483
616
|
'elevation.surface': css({
|
|
484
|
-
backgroundColor: token('elevation.surface', '
|
|
617
|
+
backgroundColor: token('elevation.surface', '#FFFFFF'),
|
|
485
618
|
}),
|
|
486
619
|
'elevation.surface.sunken': css({
|
|
487
|
-
backgroundColor: token('elevation.surface.sunken', '
|
|
620
|
+
backgroundColor: token('elevation.surface.sunken', '#F4F5F7'),
|
|
488
621
|
}),
|
|
489
622
|
'elevation.surface.raised': css({
|
|
490
|
-
backgroundColor: token('elevation.surface.raised', '
|
|
623
|
+
backgroundColor: token('elevation.surface.raised', '#FFFFFF'),
|
|
491
624
|
}),
|
|
492
625
|
'elevation.surface.overlay': css({
|
|
493
|
-
backgroundColor: token('elevation.surface.overlay', '
|
|
626
|
+
backgroundColor: token('elevation.surface.overlay', '#FFFFFF'),
|
|
494
627
|
}),
|
|
495
628
|
};
|
|
496
629
|
|