@atlaskit/ds-explorations 1.6.0 → 1.6.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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/components/box.partial.js +81 -4
- package/dist/cjs/components/inline.partial.js +3 -0
- package/dist/cjs/components/text.partial.js +1 -1
- package/dist/cjs/constants.js +18 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +79 -3
- package/dist/es2019/components/inline.partial.js +3 -0
- package/dist/es2019/components/text.partial.js +1 -1
- package/dist/es2019/constants.js +11 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +80 -4
- package/dist/esm/components/inline.partial.js +3 -0
- package/dist/esm/components/text.partial.js +1 -1
- package/dist/esm/constants.js +11 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +64 -43
- package/dist/types/components/inline.partial.d.ts +1 -0
- package/dist/types/components/text.partial.d.ts +14 -14
- package/dist/types/constants.d.ts +12 -0
- package/examples/01-box.tsx +54 -0
- package/package.json +2 -2
- package/report.api.md +89 -56
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +3 -3
- package/scripts/codegen-styles.tsx +19 -0
- package/scripts/color-codegen-template.tsx +25 -14
- package/scripts/misc-codegen-template.tsx +43 -0
- package/scripts/utils.tsx +23 -1
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-layer-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-shadow-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/box-snapshot-test.tsx +2 -0
- package/src/components/box.partial.tsx +76 -7
- package/src/components/inline.partial.tsx +1 -0
- package/src/components/text.partial.tsx +2 -2
- package/src/constants.tsx +13 -0
- package/tmp/api-report-tmp.d.ts +89 -56
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType, FC, ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { Layer } from '../constants';
|
|
3
4
|
import type { BasePrimitiveProps } from './types';
|
|
4
|
-
declare type
|
|
5
|
-
export declare type BoxProps<T extends ElementType = 'div'> = Omit<ComponentPropsWithoutRef<T>, PropsToOmit> & BasePrimitiveProps & BoxPropsBase<T>;
|
|
5
|
+
export declare type BoxProps<T extends ElementType = 'div'> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className' | 'style'> & BasePrimitiveProps & BoxPropsBase<T>;
|
|
6
6
|
declare type BoxPropsBase<T extends ElementType> = {
|
|
7
7
|
/**
|
|
8
8
|
* The DOM element to render as the Box. Defaults to `div`.
|
|
@@ -28,6 +28,10 @@ declare type BoxPropsBase<T extends ElementType> = {
|
|
|
28
28
|
* Token representing background color with a fallback.
|
|
29
29
|
*/
|
|
30
30
|
backgroundColor?: BackgroundColor;
|
|
31
|
+
/**
|
|
32
|
+
* Token representing shadow with a fallback
|
|
33
|
+
*/
|
|
34
|
+
shadow?: Shadow;
|
|
31
35
|
/**
|
|
32
36
|
* Defines border style.
|
|
33
37
|
*/
|
|
@@ -44,6 +48,10 @@ declare type BoxPropsBase<T extends ElementType> = {
|
|
|
44
48
|
* Defines border radius.
|
|
45
49
|
*/
|
|
46
50
|
borderRadius?: BorderRadius;
|
|
51
|
+
/**
|
|
52
|
+
* Used for providing a z-index.
|
|
53
|
+
*/
|
|
54
|
+
layer?: Layer;
|
|
47
55
|
/**
|
|
48
56
|
* Defines the main axis direction.
|
|
49
57
|
* @deprecated
|
|
@@ -146,6 +154,8 @@ declare const flexAlignItemsMap: {
|
|
|
146
154
|
baseline: import("@emotion/react").SerializedStyles;
|
|
147
155
|
flexStart: import("@emotion/react").SerializedStyles;
|
|
148
156
|
flexEnd: import("@emotion/react").SerializedStyles;
|
|
157
|
+
start: import("@emotion/react").SerializedStyles;
|
|
158
|
+
end: import("@emotion/react").SerializedStyles;
|
|
149
159
|
};
|
|
150
160
|
/**
|
|
151
161
|
* @experimental - this is likely to be removed
|
|
@@ -155,6 +165,8 @@ declare const flexJustifyContentMap: {
|
|
|
155
165
|
center: import("@emotion/react").SerializedStyles;
|
|
156
166
|
flexStart: import("@emotion/react").SerializedStyles;
|
|
157
167
|
flexEnd: import("@emotion/react").SerializedStyles;
|
|
168
|
+
start: import("@emotion/react").SerializedStyles;
|
|
169
|
+
end: import("@emotion/react").SerializedStyles;
|
|
158
170
|
};
|
|
159
171
|
declare type Display = keyof typeof displayMap;
|
|
160
172
|
declare const displayMap: {
|
|
@@ -166,6 +178,7 @@ declare const displayMap: {
|
|
|
166
178
|
declare type Position = keyof typeof positionMap;
|
|
167
179
|
declare const positionMap: {
|
|
168
180
|
absolute: import("@emotion/react").SerializedStyles;
|
|
181
|
+
fixed: import("@emotion/react").SerializedStyles;
|
|
169
182
|
relative: import("@emotion/react").SerializedStyles;
|
|
170
183
|
static: import("@emotion/react").SerializedStyles;
|
|
171
184
|
};
|
|
@@ -270,57 +283,65 @@ export declare type PaddingInline = keyof typeof paddingInlineMap;
|
|
|
270
283
|
*/
|
|
271
284
|
/**
|
|
272
285
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
273
|
-
* @codegen <<SignedSource::
|
|
286
|
+
* @codegen <<SignedSource::f8adab4246a66543cd1350e53abf9293>>
|
|
274
287
|
* @codegenId colors
|
|
275
288
|
* @codegenCommand yarn codegen-styles
|
|
276
|
-
* @codegenParams ["border", "background"]
|
|
289
|
+
* @codegenParams ["border", "background", "shadow"]
|
|
277
290
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
278
291
|
*/
|
|
279
292
|
declare const borderColorMap: {
|
|
280
|
-
'color.border': import("@emotion/react").SerializedStyles;
|
|
281
|
-
bold: import("@emotion/react").SerializedStyles;
|
|
282
|
-
inverse: import("@emotion/react").SerializedStyles;
|
|
283
|
-
focused: import("@emotion/react").SerializedStyles;
|
|
284
|
-
input: import("@emotion/react").SerializedStyles;
|
|
285
|
-
disabled: import("@emotion/react").SerializedStyles;
|
|
286
|
-
brand: import("@emotion/react").SerializedStyles;
|
|
287
|
-
selected: import("@emotion/react").SerializedStyles;
|
|
288
|
-
danger: import("@emotion/react").SerializedStyles;
|
|
289
|
-
warning: import("@emotion/react").SerializedStyles;
|
|
290
|
-
success: import("@emotion/react").SerializedStyles;
|
|
291
|
-
discovery: import("@emotion/react").SerializedStyles;
|
|
292
|
-
information: import("@emotion/react").SerializedStyles;
|
|
293
|
+
readonly 'color.border': import("@emotion/react").SerializedStyles;
|
|
294
|
+
readonly bold: import("@emotion/react").SerializedStyles;
|
|
295
|
+
readonly inverse: import("@emotion/react").SerializedStyles;
|
|
296
|
+
readonly focused: import("@emotion/react").SerializedStyles;
|
|
297
|
+
readonly input: import("@emotion/react").SerializedStyles;
|
|
298
|
+
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
299
|
+
readonly brand: import("@emotion/react").SerializedStyles;
|
|
300
|
+
readonly selected: import("@emotion/react").SerializedStyles;
|
|
301
|
+
readonly danger: import("@emotion/react").SerializedStyles;
|
|
302
|
+
readonly warning: import("@emotion/react").SerializedStyles;
|
|
303
|
+
readonly success: import("@emotion/react").SerializedStyles;
|
|
304
|
+
readonly discovery: import("@emotion/react").SerializedStyles;
|
|
305
|
+
readonly information: import("@emotion/react").SerializedStyles;
|
|
293
306
|
};
|
|
294
307
|
export declare type BorderColor = keyof typeof borderColorMap;
|
|
295
308
|
declare const backgroundColorMap: {
|
|
296
|
-
disabled: import("@emotion/react").SerializedStyles;
|
|
297
|
-
'inverse.subtle': import("@emotion/react").SerializedStyles;
|
|
298
|
-
input: import("@emotion/react").SerializedStyles;
|
|
299
|
-
neutral: import("@emotion/react").SerializedStyles;
|
|
300
|
-
'neutral.subtle': import("@emotion/react").SerializedStyles;
|
|
301
|
-
'neutral.bold': import("@emotion/react").SerializedStyles;
|
|
302
|
-
'brand.bold': import("@emotion/react").SerializedStyles;
|
|
303
|
-
selected: import("@emotion/react").SerializedStyles;
|
|
304
|
-
'selected.bold': import("@emotion/react").SerializedStyles;
|
|
305
|
-
danger: import("@emotion/react").SerializedStyles;
|
|
306
|
-
'danger.bold': import("@emotion/react").SerializedStyles;
|
|
307
|
-
warning: import("@emotion/react").SerializedStyles;
|
|
308
|
-
'warning.bold': import("@emotion/react").SerializedStyles;
|
|
309
|
-
success: import("@emotion/react").SerializedStyles;
|
|
310
|
-
'success.bold': import("@emotion/react").SerializedStyles;
|
|
311
|
-
discovery: import("@emotion/react").SerializedStyles;
|
|
312
|
-
'discovery.bold': import("@emotion/react").SerializedStyles;
|
|
313
|
-
information: import("@emotion/react").SerializedStyles;
|
|
314
|
-
'information.bold': import("@emotion/react").SerializedStyles;
|
|
315
|
-
'color.blanket': import("@emotion/react").SerializedStyles;
|
|
316
|
-
'color.blanket.selected': import("@emotion/react").SerializedStyles;
|
|
317
|
-
'color.blanket.danger': import("@emotion/react").SerializedStyles;
|
|
318
|
-
'elevation.surface': import("@emotion/react").SerializedStyles;
|
|
319
|
-
'elevation.surface.sunken': import("@emotion/react").SerializedStyles;
|
|
320
|
-
'elevation.surface.raised': import("@emotion/react").SerializedStyles;
|
|
321
|
-
'elevation.surface.overlay': import("@emotion/react").SerializedStyles;
|
|
309
|
+
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
310
|
+
readonly 'inverse.subtle': import("@emotion/react").SerializedStyles;
|
|
311
|
+
readonly input: import("@emotion/react").SerializedStyles;
|
|
312
|
+
readonly neutral: import("@emotion/react").SerializedStyles;
|
|
313
|
+
readonly 'neutral.subtle': import("@emotion/react").SerializedStyles;
|
|
314
|
+
readonly 'neutral.bold': import("@emotion/react").SerializedStyles;
|
|
315
|
+
readonly 'brand.bold': import("@emotion/react").SerializedStyles;
|
|
316
|
+
readonly selected: import("@emotion/react").SerializedStyles;
|
|
317
|
+
readonly 'selected.bold': import("@emotion/react").SerializedStyles;
|
|
318
|
+
readonly danger: import("@emotion/react").SerializedStyles;
|
|
319
|
+
readonly 'danger.bold': import("@emotion/react").SerializedStyles;
|
|
320
|
+
readonly warning: import("@emotion/react").SerializedStyles;
|
|
321
|
+
readonly 'warning.bold': import("@emotion/react").SerializedStyles;
|
|
322
|
+
readonly success: import("@emotion/react").SerializedStyles;
|
|
323
|
+
readonly 'success.bold': import("@emotion/react").SerializedStyles;
|
|
324
|
+
readonly discovery: import("@emotion/react").SerializedStyles;
|
|
325
|
+
readonly 'discovery.bold': import("@emotion/react").SerializedStyles;
|
|
326
|
+
readonly information: import("@emotion/react").SerializedStyles;
|
|
327
|
+
readonly 'information.bold': import("@emotion/react").SerializedStyles;
|
|
328
|
+
readonly 'color.blanket': import("@emotion/react").SerializedStyles;
|
|
329
|
+
readonly 'color.blanket.selected': import("@emotion/react").SerializedStyles;
|
|
330
|
+
readonly 'color.blanket.danger': import("@emotion/react").SerializedStyles;
|
|
331
|
+
readonly 'elevation.surface': import("@emotion/react").SerializedStyles;
|
|
332
|
+
readonly 'elevation.surface.sunken': import("@emotion/react").SerializedStyles;
|
|
333
|
+
readonly 'elevation.surface.raised': import("@emotion/react").SerializedStyles;
|
|
334
|
+
readonly 'elevation.surface.overlay': import("@emotion/react").SerializedStyles;
|
|
322
335
|
};
|
|
323
336
|
export declare type BackgroundColor = keyof typeof backgroundColorMap;
|
|
337
|
+
declare const shadowMap: {
|
|
338
|
+
readonly raised: import("@emotion/react").SerializedStyles;
|
|
339
|
+
readonly overflow: import("@emotion/react").SerializedStyles;
|
|
340
|
+
readonly 'overflow.spread': import("@emotion/react").SerializedStyles;
|
|
341
|
+
readonly 'overflow.perimeter': import("@emotion/react").SerializedStyles;
|
|
342
|
+
readonly overlay: import("@emotion/react").SerializedStyles;
|
|
343
|
+
};
|
|
344
|
+
export declare type Shadow = keyof typeof shadowMap;
|
|
324
345
|
/**
|
|
325
346
|
* @codegenEnd
|
|
326
347
|
*/
|
|
@@ -45,6 +45,7 @@ declare const flexJustifyContentMap: {
|
|
|
45
45
|
flexEnd: import("@emotion/react").SerializedStyles;
|
|
46
46
|
start: import("@emotion/react").SerializedStyles;
|
|
47
47
|
end: import("@emotion/react").SerializedStyles;
|
|
48
|
+
spaceBetween: import("@emotion/react").SerializedStyles;
|
|
48
49
|
};
|
|
49
50
|
declare type FlexWrap = keyof typeof flexWrapMap;
|
|
50
51
|
declare const flexWrapMap: {
|
|
@@ -104,26 +104,26 @@ declare const Text: FC<TextProps>;
|
|
|
104
104
|
export default Text;
|
|
105
105
|
/**
|
|
106
106
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
107
|
-
* @codegen <<SignedSource::
|
|
107
|
+
* @codegen <<SignedSource::920426feace841166c6f4ffdc49ae26d>>
|
|
108
108
|
* @codegenId colors
|
|
109
109
|
* @codegenCommand yarn codegen-styles
|
|
110
110
|
* @codegenParams ["text"]
|
|
111
111
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::07ef29d58a2b23af8b098515466d7e22>>
|
|
112
112
|
*/
|
|
113
113
|
declare const textColorMap: {
|
|
114
|
-
'color.text': import("@emotion/react").SerializedStyles;
|
|
115
|
-
subtle: import("@emotion/react").SerializedStyles;
|
|
116
|
-
subtlest: import("@emotion/react").SerializedStyles;
|
|
117
|
-
disabled: import("@emotion/react").SerializedStyles;
|
|
118
|
-
inverse: import("@emotion/react").SerializedStyles;
|
|
119
|
-
brand: import("@emotion/react").SerializedStyles;
|
|
120
|
-
selected: import("@emotion/react").SerializedStyles;
|
|
121
|
-
danger: import("@emotion/react").SerializedStyles;
|
|
122
|
-
warning: import("@emotion/react").SerializedStyles;
|
|
123
|
-
'warning.inverse': import("@emotion/react").SerializedStyles;
|
|
124
|
-
success: import("@emotion/react").SerializedStyles;
|
|
125
|
-
discovery: import("@emotion/react").SerializedStyles;
|
|
126
|
-
information: import("@emotion/react").SerializedStyles;
|
|
114
|
+
readonly 'color.text': import("@emotion/react").SerializedStyles;
|
|
115
|
+
readonly subtle: import("@emotion/react").SerializedStyles;
|
|
116
|
+
readonly subtlest: import("@emotion/react").SerializedStyles;
|
|
117
|
+
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
118
|
+
readonly inverse: import("@emotion/react").SerializedStyles;
|
|
119
|
+
readonly brand: import("@emotion/react").SerializedStyles;
|
|
120
|
+
readonly selected: import("@emotion/react").SerializedStyles;
|
|
121
|
+
readonly danger: import("@emotion/react").SerializedStyles;
|
|
122
|
+
readonly warning: import("@emotion/react").SerializedStyles;
|
|
123
|
+
readonly 'warning.inverse': import("@emotion/react").SerializedStyles;
|
|
124
|
+
readonly success: import("@emotion/react").SerializedStyles;
|
|
125
|
+
readonly discovery: import("@emotion/react").SerializedStyles;
|
|
126
|
+
readonly information: import("@emotion/react").SerializedStyles;
|
|
127
127
|
};
|
|
128
128
|
export declare type TextColor = keyof typeof textColorMap;
|
|
129
129
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const LAYERS: {
|
|
2
|
+
readonly card: 100;
|
|
3
|
+
readonly navigation: 200;
|
|
4
|
+
readonly dialog: 300;
|
|
5
|
+
readonly layer: 400;
|
|
6
|
+
readonly blanket: 500;
|
|
7
|
+
readonly modal: 510;
|
|
8
|
+
readonly flag: 600;
|
|
9
|
+
readonly spotlight: 700;
|
|
10
|
+
readonly tooltip: 800;
|
|
11
|
+
};
|
|
12
|
+
export declare type Layer = keyof typeof LAYERS;
|
package/examples/01-box.tsx
CHANGED
|
@@ -113,6 +113,60 @@ export default () => {
|
|
|
113
113
|
))}
|
|
114
114
|
</Inline>
|
|
115
115
|
</Stack>
|
|
116
|
+
|
|
117
|
+
<Stack gap="scale.200" testId="box-with-shadow">
|
|
118
|
+
<Heading level="h600">shadow</Heading>
|
|
119
|
+
<Inline gap="scale.200" alignItems="center">
|
|
120
|
+
{(['raised', 'overflow', 'overlay'] as const).map((shadow) => (
|
|
121
|
+
<Box
|
|
122
|
+
key={shadow}
|
|
123
|
+
backgroundColor="elevation.surface"
|
|
124
|
+
shadow={shadow}
|
|
125
|
+
padding="scale.400"
|
|
126
|
+
>
|
|
127
|
+
<Box justifyContent="center">
|
|
128
|
+
<Text color="color.text">{shadow}</Text>
|
|
129
|
+
</Box>
|
|
130
|
+
</Box>
|
|
131
|
+
))}
|
|
132
|
+
</Inline>
|
|
133
|
+
</Stack>
|
|
134
|
+
|
|
135
|
+
<Stack gap="scale.200" testId="box-with-layer">
|
|
136
|
+
<Heading level="h600">layer</Heading>
|
|
137
|
+
<Box alignItems="center" UNSAFE_style={{ width: 800, height: 650 }}>
|
|
138
|
+
{(
|
|
139
|
+
[
|
|
140
|
+
'card',
|
|
141
|
+
'navigation',
|
|
142
|
+
'dialog',
|
|
143
|
+
'layer',
|
|
144
|
+
'blanket',
|
|
145
|
+
'modal',
|
|
146
|
+
'flag',
|
|
147
|
+
'spotlight',
|
|
148
|
+
'tooltip',
|
|
149
|
+
] as const
|
|
150
|
+
).map((layer, index) => (
|
|
151
|
+
<Box
|
|
152
|
+
key={layer}
|
|
153
|
+
backgroundColor="elevation.surface"
|
|
154
|
+
layer={layer}
|
|
155
|
+
shadow="overlay"
|
|
156
|
+
padding="scale.400"
|
|
157
|
+
position="absolute"
|
|
158
|
+
UNSAFE_style={{
|
|
159
|
+
top: index * 64,
|
|
160
|
+
left: index * 64,
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
<Box justifyContent="center">
|
|
164
|
+
<Text color="color.text">{layer}</Text>
|
|
165
|
+
</Box>
|
|
166
|
+
</Box>
|
|
167
|
+
))}
|
|
168
|
+
</Box>
|
|
169
|
+
</Stack>
|
|
116
170
|
</Stack>
|
|
117
171
|
);
|
|
118
172
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/ds-explorations",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "An experimental package for exploration and validation of spacing / typography foundations.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"atlassian": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"./inline": "./src/components/inline.partial.tsx"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@atlaskit/tokens": "^0.
|
|
42
|
+
"@atlaskit/tokens": "^0.12.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1",
|
|
45
45
|
"tiny-invariant": "^1.2.0"
|
package/report.api.md
CHANGED
|
@@ -39,32 +39,32 @@ type BackgroundColor = keyof typeof backgroundColorMap;
|
|
|
39
39
|
|
|
40
40
|
// @public (undocumented)
|
|
41
41
|
const backgroundColorMap: {
|
|
42
|
-
disabled: SerializedStyles;
|
|
43
|
-
'inverse.subtle': SerializedStyles;
|
|
44
|
-
input: SerializedStyles;
|
|
45
|
-
neutral: SerializedStyles;
|
|
46
|
-
'neutral.subtle': SerializedStyles;
|
|
47
|
-
'neutral.bold': SerializedStyles;
|
|
48
|
-
'brand.bold': SerializedStyles;
|
|
49
|
-
selected: SerializedStyles;
|
|
50
|
-
'selected.bold': SerializedStyles;
|
|
51
|
-
danger: SerializedStyles;
|
|
52
|
-
'danger.bold': SerializedStyles;
|
|
53
|
-
warning: SerializedStyles;
|
|
54
|
-
'warning.bold': SerializedStyles;
|
|
55
|
-
success: SerializedStyles;
|
|
56
|
-
'success.bold': SerializedStyles;
|
|
57
|
-
discovery: SerializedStyles;
|
|
58
|
-
'discovery.bold': SerializedStyles;
|
|
59
|
-
information: SerializedStyles;
|
|
60
|
-
'information.bold': SerializedStyles;
|
|
61
|
-
'color.blanket': SerializedStyles;
|
|
62
|
-
'color.blanket.selected': SerializedStyles;
|
|
63
|
-
'color.blanket.danger': SerializedStyles;
|
|
64
|
-
'elevation.surface': SerializedStyles;
|
|
65
|
-
'elevation.surface.sunken': SerializedStyles;
|
|
66
|
-
'elevation.surface.raised': SerializedStyles;
|
|
67
|
-
'elevation.surface.overlay': SerializedStyles;
|
|
42
|
+
readonly disabled: SerializedStyles;
|
|
43
|
+
readonly 'inverse.subtle': SerializedStyles;
|
|
44
|
+
readonly input: SerializedStyles;
|
|
45
|
+
readonly neutral: SerializedStyles;
|
|
46
|
+
readonly 'neutral.subtle': SerializedStyles;
|
|
47
|
+
readonly 'neutral.bold': SerializedStyles;
|
|
48
|
+
readonly 'brand.bold': SerializedStyles;
|
|
49
|
+
readonly selected: SerializedStyles;
|
|
50
|
+
readonly 'selected.bold': SerializedStyles;
|
|
51
|
+
readonly danger: SerializedStyles;
|
|
52
|
+
readonly 'danger.bold': SerializedStyles;
|
|
53
|
+
readonly warning: SerializedStyles;
|
|
54
|
+
readonly 'warning.bold': SerializedStyles;
|
|
55
|
+
readonly success: SerializedStyles;
|
|
56
|
+
readonly 'success.bold': SerializedStyles;
|
|
57
|
+
readonly discovery: SerializedStyles;
|
|
58
|
+
readonly 'discovery.bold': SerializedStyles;
|
|
59
|
+
readonly information: SerializedStyles;
|
|
60
|
+
readonly 'information.bold': SerializedStyles;
|
|
61
|
+
readonly 'color.blanket': SerializedStyles;
|
|
62
|
+
readonly 'color.blanket.selected': SerializedStyles;
|
|
63
|
+
readonly 'color.blanket.danger': SerializedStyles;
|
|
64
|
+
readonly 'elevation.surface': SerializedStyles;
|
|
65
|
+
readonly 'elevation.surface.sunken': SerializedStyles;
|
|
66
|
+
readonly 'elevation.surface.raised': SerializedStyles;
|
|
67
|
+
readonly 'elevation.surface.overlay': SerializedStyles;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
// @public (undocumented)
|
|
@@ -103,19 +103,19 @@ type BorderColor = keyof typeof borderColorMap;
|
|
|
103
103
|
|
|
104
104
|
// @public
|
|
105
105
|
const borderColorMap: {
|
|
106
|
-
'color.border': SerializedStyles;
|
|
107
|
-
bold: SerializedStyles;
|
|
108
|
-
inverse: SerializedStyles;
|
|
109
|
-
focused: SerializedStyles;
|
|
110
|
-
input: SerializedStyles;
|
|
111
|
-
disabled: SerializedStyles;
|
|
112
|
-
brand: SerializedStyles;
|
|
113
|
-
selected: SerializedStyles;
|
|
114
|
-
danger: SerializedStyles;
|
|
115
|
-
warning: SerializedStyles;
|
|
116
|
-
success: SerializedStyles;
|
|
117
|
-
discovery: SerializedStyles;
|
|
118
|
-
information: SerializedStyles;
|
|
106
|
+
readonly 'color.border': SerializedStyles;
|
|
107
|
+
readonly bold: SerializedStyles;
|
|
108
|
+
readonly inverse: SerializedStyles;
|
|
109
|
+
readonly focused: SerializedStyles;
|
|
110
|
+
readonly input: SerializedStyles;
|
|
111
|
+
readonly disabled: SerializedStyles;
|
|
112
|
+
readonly brand: SerializedStyles;
|
|
113
|
+
readonly selected: SerializedStyles;
|
|
114
|
+
readonly danger: SerializedStyles;
|
|
115
|
+
readonly warning: SerializedStyles;
|
|
116
|
+
readonly success: SerializedStyles;
|
|
117
|
+
readonly discovery: SerializedStyles;
|
|
118
|
+
readonly information: SerializedStyles;
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
// @public (undocumented)
|
|
@@ -164,10 +164,12 @@ type BoxPropsBase<T extends ElementType> = {
|
|
|
164
164
|
children?: ReactNode;
|
|
165
165
|
className?: string;
|
|
166
166
|
backgroundColor?: BackgroundColor;
|
|
167
|
+
shadow?: Shadow;
|
|
167
168
|
borderStyle?: BorderStyle;
|
|
168
169
|
borderWidth?: BorderWidth;
|
|
169
170
|
borderColor?: BorderColor;
|
|
170
171
|
borderRadius?: BorderRadius;
|
|
172
|
+
layer?: Layer;
|
|
171
173
|
flexDirection?: FlexDirection;
|
|
172
174
|
alignItems?: FlexAlignItems;
|
|
173
175
|
justifyContent?: FlexJustifyContent;
|
|
@@ -229,6 +231,8 @@ const flexAlignItemsMap: {
|
|
|
229
231
|
baseline: SerializedStyles;
|
|
230
232
|
flexStart: SerializedStyles;
|
|
231
233
|
flexEnd: SerializedStyles;
|
|
234
|
+
start: SerializedStyles;
|
|
235
|
+
end: SerializedStyles;
|
|
232
236
|
};
|
|
233
237
|
|
|
234
238
|
// @public (undocumented)
|
|
@@ -274,6 +278,8 @@ const flexJustifyContentMap: {
|
|
|
274
278
|
center: SerializedStyles;
|
|
275
279
|
flexStart: SerializedStyles;
|
|
276
280
|
flexEnd: SerializedStyles;
|
|
281
|
+
start: SerializedStyles;
|
|
282
|
+
end: SerializedStyles;
|
|
277
283
|
};
|
|
278
284
|
|
|
279
285
|
// @public (undocumented)
|
|
@@ -284,6 +290,7 @@ const flexJustifyContentMap_2: {
|
|
|
284
290
|
flexEnd: SerializedStyles;
|
|
285
291
|
start: SerializedStyles;
|
|
286
292
|
end: SerializedStyles;
|
|
293
|
+
spaceBetween: SerializedStyles;
|
|
287
294
|
};
|
|
288
295
|
|
|
289
296
|
// @public (undocumented)
|
|
@@ -358,6 +365,22 @@ interface InteractionSurfaceProps extends BasePrimitiveProps {
|
|
|
358
365
|
children: ReactNode;
|
|
359
366
|
}
|
|
360
367
|
|
|
368
|
+
// @public (undocumented)
|
|
369
|
+
type Layer = keyof typeof LAYERS;
|
|
370
|
+
|
|
371
|
+
// @public (undocumented)
|
|
372
|
+
const LAYERS: {
|
|
373
|
+
readonly card: 100;
|
|
374
|
+
readonly navigation: 200;
|
|
375
|
+
readonly dialog: 300;
|
|
376
|
+
readonly layer: 400;
|
|
377
|
+
readonly blanket: 500;
|
|
378
|
+
readonly modal: 510;
|
|
379
|
+
readonly flag: 600;
|
|
380
|
+
readonly spotlight: 700;
|
|
381
|
+
readonly tooltip: 800;
|
|
382
|
+
};
|
|
383
|
+
|
|
361
384
|
// @public (undocumented)
|
|
362
385
|
type LineHeight = keyof typeof lineHeightMap;
|
|
363
386
|
|
|
@@ -450,13 +473,11 @@ type Position = keyof typeof positionMap;
|
|
|
450
473
|
// @public (undocumented)
|
|
451
474
|
const positionMap: {
|
|
452
475
|
absolute: SerializedStyles;
|
|
476
|
+
fixed: SerializedStyles;
|
|
453
477
|
relative: SerializedStyles;
|
|
454
478
|
static: SerializedStyles;
|
|
455
479
|
};
|
|
456
480
|
|
|
457
|
-
// @public (undocumented)
|
|
458
|
-
type PropsToOmit = 'as' | 'className' | 'style';
|
|
459
|
-
|
|
460
481
|
// @public (undocumented)
|
|
461
482
|
type RowGap = keyof typeof rowGapMap;
|
|
462
483
|
|
|
@@ -478,6 +499,18 @@ const rowGapMap: {
|
|
|
478
499
|
'scale.800': SerializedStyles;
|
|
479
500
|
};
|
|
480
501
|
|
|
502
|
+
// @public (undocumented)
|
|
503
|
+
type Shadow = keyof typeof shadowMap;
|
|
504
|
+
|
|
505
|
+
// @public (undocumented)
|
|
506
|
+
const shadowMap: {
|
|
507
|
+
readonly raised: SerializedStyles;
|
|
508
|
+
readonly overflow: SerializedStyles;
|
|
509
|
+
readonly 'overflow.spread': SerializedStyles;
|
|
510
|
+
readonly 'overflow.perimeter': SerializedStyles;
|
|
511
|
+
readonly overlay: SerializedStyles;
|
|
512
|
+
};
|
|
513
|
+
|
|
481
514
|
// @public (undocumented)
|
|
482
515
|
type TextAlign = keyof typeof textAlignMap;
|
|
483
516
|
|
|
@@ -493,19 +526,19 @@ type TextColor = keyof typeof textColorMap;
|
|
|
493
526
|
|
|
494
527
|
// @public
|
|
495
528
|
const textColorMap: {
|
|
496
|
-
'color.text': SerializedStyles;
|
|
497
|
-
subtle: SerializedStyles;
|
|
498
|
-
subtlest: SerializedStyles;
|
|
499
|
-
disabled: SerializedStyles;
|
|
500
|
-
inverse: SerializedStyles;
|
|
501
|
-
brand: SerializedStyles;
|
|
502
|
-
selected: SerializedStyles;
|
|
503
|
-
danger: SerializedStyles;
|
|
504
|
-
warning: SerializedStyles;
|
|
505
|
-
'warning.inverse': SerializedStyles;
|
|
506
|
-
success: SerializedStyles;
|
|
507
|
-
discovery: SerializedStyles;
|
|
508
|
-
information: SerializedStyles;
|
|
529
|
+
readonly 'color.text': SerializedStyles;
|
|
530
|
+
readonly subtle: SerializedStyles;
|
|
531
|
+
readonly subtlest: SerializedStyles;
|
|
532
|
+
readonly disabled: SerializedStyles;
|
|
533
|
+
readonly inverse: SerializedStyles;
|
|
534
|
+
readonly brand: SerializedStyles;
|
|
535
|
+
readonly selected: SerializedStyles;
|
|
536
|
+
readonly danger: SerializedStyles;
|
|
537
|
+
readonly warning: SerializedStyles;
|
|
538
|
+
readonly 'warning.inverse': SerializedStyles;
|
|
539
|
+
readonly success: SerializedStyles;
|
|
540
|
+
readonly discovery: SerializedStyles;
|
|
541
|
+
readonly information: SerializedStyles;
|
|
509
542
|
};
|
|
510
543
|
|
|
511
544
|
// @public (undocumented)
|
|
@@ -524,7 +557,7 @@ export const UNSAFE_Box: BoxComponent;
|
|
|
524
557
|
// @public (undocumented)
|
|
525
558
|
export type UNSAFE_BoxProps<T extends ElementType = 'div'> = Omit<
|
|
526
559
|
ComponentPropsWithoutRef<T>,
|
|
527
|
-
|
|
560
|
+
'as' | 'className' | 'style'
|
|
528
561
|
> &
|
|
529
562
|
BasePrimitiveProps &
|
|
530
563
|
BoxPropsBase<T>;
|
|
@@ -80,7 +80,7 @@ exports[`@atlaskit/design-system-explorations bg styles are generated correctly
|
|
|
80
80
|
'elevation.surface.overlay': css({
|
|
81
81
|
backgroundColor: token('elevation.surface.overlay', '#FFFFFF'),
|
|
82
82
|
}),
|
|
83
|
-
};
|
|
83
|
+
} as const;
|
|
84
84
|
|
|
85
85
|
export type BackgroundColor = keyof typeof backgroundColorMap;
|
|
86
86
|
"
|
|
@@ -127,7 +127,7 @@ exports[`@atlaskit/design-system-explorations border styles are generated correc
|
|
|
127
127
|
information: css({
|
|
128
128
|
borderColor: token('color.border.information', '#0065FF'),
|
|
129
129
|
}),
|
|
130
|
-
};
|
|
130
|
+
} as const;
|
|
131
131
|
|
|
132
132
|
export type BorderColor = keyof typeof borderColorMap;
|
|
133
133
|
"
|
|
@@ -353,7 +353,7 @@ exports[`@atlaskit/design-system-explorations text styles are generated correctl
|
|
|
353
353
|
information: css({
|
|
354
354
|
color: token('color.text.information', '#0052CC'),
|
|
355
355
|
}),
|
|
356
|
-
};
|
|
356
|
+
} as const;
|
|
357
357
|
|
|
358
358
|
export type TextColor = keyof typeof textColorMap;
|
|
359
359
|
"
|
|
@@ -8,6 +8,7 @@ import { createColorStylesFromTemplate } from './color-codegen-template';
|
|
|
8
8
|
import { createColorMapTemplate } from './color-map-template';
|
|
9
9
|
import { createDimensionStylesFromTemplate } from './dimension-codegen-template';
|
|
10
10
|
import { createInteractionStylesFromTemplate } from './interaction-codegen';
|
|
11
|
+
import { createStylesFromTemplate } from './misc-codegen-template';
|
|
11
12
|
import { createSpacingStylesFromTemplate } from './spacing-codegen-template';
|
|
12
13
|
import { createSpacingScaleTemplate } from './spacing-scale-template';
|
|
13
14
|
|
|
@@ -86,6 +87,24 @@ Promise.all(
|
|
|
86
87
|
}),
|
|
87
88
|
);
|
|
88
89
|
})
|
|
90
|
+
.then(() => {
|
|
91
|
+
// generate other values
|
|
92
|
+
return Promise.all(
|
|
93
|
+
[{ target: 'box.partial.tsx' }].map(({ target }) => {
|
|
94
|
+
const targetPath = join(__dirname, '../', 'src', 'components', target);
|
|
95
|
+
|
|
96
|
+
const source = createPartialSignedArtifact(
|
|
97
|
+
(options) => options.map(createStylesFromTemplate).join('\n'),
|
|
98
|
+
'yarn codegen-styles',
|
|
99
|
+
{ id: 'misc', absoluteFilePath: targetPath },
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
return writeFile(targetPath, source).then(() =>
|
|
103
|
+
console.log(`${targetPath} written!`),
|
|
104
|
+
);
|
|
105
|
+
}),
|
|
106
|
+
);
|
|
107
|
+
})
|
|
89
108
|
.then(() => {
|
|
90
109
|
const targetPath = join(
|
|
91
110
|
__dirname,
|