@atlaskit/primitives 0.0.1
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 +7 -0
- package/LICENSE.md +13 -0
- package/README.md +9 -0
- package/box/package.json +15 -0
- package/dist/cjs/components/box.js +13 -0
- package/dist/cjs/components/inline.partial.js +13 -0
- package/dist/cjs/components/internal/box.partial.js +605 -0
- package/dist/cjs/components/stack.partial.js +13 -0
- package/dist/cjs/components/types.js +5 -0
- package/dist/cjs/constants.js +18 -0
- package/dist/cjs/index.js +26 -0
- package/dist/cjs/internal/color-map.js +42 -0
- package/dist/cjs/version.json +5 -0
- package/dist/es2019/components/box.js +1 -0
- package/dist/es2019/components/inline.partial.js +2 -0
- package/dist/es2019/components/internal/box.partial.js +597 -0
- package/dist/es2019/components/stack.partial.js +2 -0
- package/dist/es2019/components/types.js +1 -0
- package/dist/es2019/constants.js +11 -0
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/internal/color-map.js +35 -0
- package/dist/es2019/version.json +5 -0
- package/dist/esm/components/box.js +1 -0
- package/dist/esm/components/inline.partial.js +2 -0
- package/dist/esm/components/internal/box.partial.js +600 -0
- package/dist/esm/components/stack.partial.js +2 -0
- package/dist/esm/components/types.js +1 -0
- package/dist/esm/constants.js +11 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/internal/color-map.js +35 -0
- package/dist/esm/version.json +5 -0
- package/dist/types/components/box.d.ts +1 -0
- package/dist/types/components/inline.partial.d.ts +1 -0
- package/dist/types/components/internal/box.partial.d.ts +348 -0
- package/dist/types/components/stack.partial.d.ts +1 -0
- package/dist/types/components/types.d.ts +13 -0
- package/dist/types/constants.d.ts +12 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/internal/color-map.d.ts +36 -0
- package/inline/package.json +15 -0
- package/package.json +89 -0
- package/report.api.md +43 -0
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +181 -0
- package/scripts/__tests__/codegen.test.tsx +20 -0
- package/scripts/codegen-styles.tsx +124 -0
- package/scripts/color-codegen-template.tsx +111 -0
- package/scripts/color-map-template.tsx +52 -0
- package/scripts/dimension-codegen-template.tsx +63 -0
- package/scripts/misc-codegen-template.tsx +43 -0
- package/scripts/spacing-codegen-template.tsx +84 -0
- package/scripts/utils.tsx +55 -0
- package/stack/package.json +15 -0
- package/tmp/api-report-tmp.d.ts +19 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* The color map is used to map a background color token to a matching text color that will meet contrast.
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::d168519874a16bbb92cfbfd4747a39b4>>
|
|
7
|
+
* @codegenCommand yarn codegen-styles
|
|
8
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
9
|
+
*/
|
|
10
|
+
export default {
|
|
11
|
+
'neutral.bold': 'inverse',
|
|
12
|
+
'neutral.bold.hovered': 'inverse',
|
|
13
|
+
'neutral.bold.pressed': 'inverse',
|
|
14
|
+
'selected.bold': 'inverse',
|
|
15
|
+
'selected.bold.hovered': 'inverse',
|
|
16
|
+
'selected.bold.pressed': 'inverse',
|
|
17
|
+
'brand.bold': 'inverse',
|
|
18
|
+
'brand.bold.hovered': 'inverse',
|
|
19
|
+
'brand.bold.pressed': 'inverse',
|
|
20
|
+
'danger.bold': 'inverse',
|
|
21
|
+
'danger.bold.hovered': 'inverse',
|
|
22
|
+
'danger.bold.pressed': 'inverse',
|
|
23
|
+
'warning.bold': 'warning.inverse',
|
|
24
|
+
'warning.bold.hovered': 'warning.inverse',
|
|
25
|
+
'warning.bold.pressed': 'warning.inverse',
|
|
26
|
+
'success.bold': 'inverse',
|
|
27
|
+
'success.bold.hovered': 'inverse',
|
|
28
|
+
'success.bold.pressed': 'inverse',
|
|
29
|
+
'discovery.bold': 'inverse',
|
|
30
|
+
'discovery.bold.hovered': 'inverse',
|
|
31
|
+
'discovery.bold.pressed': 'inverse',
|
|
32
|
+
'information.bold': 'inverse',
|
|
33
|
+
'information.bold.hovered': 'inverse',
|
|
34
|
+
'information.bold.pressed': 'inverse'
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Box } from '@atlaskit/ds-explorations/box';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Inline } from '@atlaskit/ds-explorations/inline';
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType, FC, ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { Layer } from '../../constants';
|
|
4
|
+
import type { BasePrimitiveProps } from '../types';
|
|
5
|
+
export declare type BoxProps<T extends ElementType = 'div'> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className' | 'style'> & BasePrimitiveProps & BoxPropsBase<T>;
|
|
6
|
+
declare type BoxPropsBase<T extends ElementType> = {
|
|
7
|
+
/**
|
|
8
|
+
* The DOM element to render as the Box. Defaults to `div`.
|
|
9
|
+
*/
|
|
10
|
+
as?: T;
|
|
11
|
+
/**
|
|
12
|
+
* Elements to be rendered inside the Box.
|
|
13
|
+
*/
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The HTML className attribute.
|
|
17
|
+
*
|
|
18
|
+
* Before using this prop please ensure:
|
|
19
|
+
* - The styles cannot otherwise be achieved through `Box` directly.
|
|
20
|
+
* - The use case needs custom styles that cannot be designed or implemented differently
|
|
21
|
+
*
|
|
22
|
+
* Ensure you're using the `@atlaskit/eslint-plugin-design-system` with this prop to prevent unbounded usage.
|
|
23
|
+
*
|
|
24
|
+
* @see `@atlaskit/eslint-plugin-design-system`
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Token representing background color with a fallback.
|
|
29
|
+
*/
|
|
30
|
+
backgroundColor?: BackgroundColor;
|
|
31
|
+
/**
|
|
32
|
+
* Token representing shadow with a fallback
|
|
33
|
+
*/
|
|
34
|
+
shadow?: Shadow;
|
|
35
|
+
/**
|
|
36
|
+
* Defines border style.
|
|
37
|
+
*/
|
|
38
|
+
borderStyle?: BorderStyle;
|
|
39
|
+
/**
|
|
40
|
+
* Defines border width.
|
|
41
|
+
*/
|
|
42
|
+
borderWidth?: BorderWidth;
|
|
43
|
+
/**
|
|
44
|
+
* Token representing border color with a fallback.
|
|
45
|
+
*/
|
|
46
|
+
borderColor?: BorderColor;
|
|
47
|
+
/**
|
|
48
|
+
* Defines border radius.
|
|
49
|
+
*/
|
|
50
|
+
borderRadius?: BorderRadius;
|
|
51
|
+
/**
|
|
52
|
+
* Used for providing a z-index.
|
|
53
|
+
*/
|
|
54
|
+
layer?: Layer;
|
|
55
|
+
/**
|
|
56
|
+
* Defines the main axis direction.
|
|
57
|
+
* @deprecated
|
|
58
|
+
*/
|
|
59
|
+
flexDirection?: FlexDirection;
|
|
60
|
+
/**
|
|
61
|
+
* Used to align children along the cross axis.
|
|
62
|
+
* @deprecated
|
|
63
|
+
*/
|
|
64
|
+
alignItems?: FlexAlignItems;
|
|
65
|
+
/**
|
|
66
|
+
* Used to align children along the main axis.
|
|
67
|
+
* @deprecated
|
|
68
|
+
*/
|
|
69
|
+
justifyContent?: FlexJustifyContent;
|
|
70
|
+
/**
|
|
71
|
+
* Defines what happens if content overflows the box.
|
|
72
|
+
*/
|
|
73
|
+
overflow?: Overflow;
|
|
74
|
+
/**
|
|
75
|
+
* Shorthand for `paddingBlock` and `paddingInline` together.
|
|
76
|
+
*
|
|
77
|
+
* @see paddingBlock
|
|
78
|
+
* @see paddingInline
|
|
79
|
+
*/
|
|
80
|
+
padding?: Padding;
|
|
81
|
+
/**
|
|
82
|
+
* Token representing CSS `paddingBlock`.
|
|
83
|
+
*/
|
|
84
|
+
paddingBlock?: PaddingBlock;
|
|
85
|
+
/**
|
|
86
|
+
* Token representing CSS `paddingInline`.
|
|
87
|
+
*/
|
|
88
|
+
paddingInline?: PaddingInline;
|
|
89
|
+
/**
|
|
90
|
+
* Token representing width.
|
|
91
|
+
* @experimental The existing tokens will be replaced to better reflect dimensions.
|
|
92
|
+
*/
|
|
93
|
+
width?: Width;
|
|
94
|
+
/**
|
|
95
|
+
* Token representing height.
|
|
96
|
+
* @experimental The existing tokens will be replaced to better reflect dimensions.
|
|
97
|
+
*/
|
|
98
|
+
height?: Height;
|
|
99
|
+
/**
|
|
100
|
+
* Defines display type and layout. Defaults to `flex`.
|
|
101
|
+
*/
|
|
102
|
+
display?: Display;
|
|
103
|
+
/**
|
|
104
|
+
* CSS position property.
|
|
105
|
+
*/
|
|
106
|
+
position?: Position;
|
|
107
|
+
ref?: ComponentPropsWithRef<T>['ref'];
|
|
108
|
+
};
|
|
109
|
+
declare type BoxComponent<T extends ElementType = 'div'> = (<T extends ElementType = 'div'>(props: BoxProps<T>) => ReactElement | null) & FC<BoxProps<T>>;
|
|
110
|
+
/**
|
|
111
|
+
* __Box__
|
|
112
|
+
*
|
|
113
|
+
* Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
|
|
114
|
+
* Renders a `div` by default.
|
|
115
|
+
*
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
export declare const Box: BoxComponent;
|
|
119
|
+
export default Box;
|
|
120
|
+
declare type BorderStyle = keyof typeof borderStyleMap;
|
|
121
|
+
declare const borderStyleMap: {
|
|
122
|
+
none: import("@emotion/react").SerializedStyles;
|
|
123
|
+
solid: import("@emotion/react").SerializedStyles;
|
|
124
|
+
dashed: import("@emotion/react").SerializedStyles;
|
|
125
|
+
dotted: import("@emotion/react").SerializedStyles;
|
|
126
|
+
};
|
|
127
|
+
declare type BorderWidth = keyof typeof borderWidthMap;
|
|
128
|
+
declare const borderWidthMap: {
|
|
129
|
+
'0px': import("@emotion/react").SerializedStyles;
|
|
130
|
+
'1px': import("@emotion/react").SerializedStyles;
|
|
131
|
+
'2px': import("@emotion/react").SerializedStyles;
|
|
132
|
+
'3px': import("@emotion/react").SerializedStyles;
|
|
133
|
+
};
|
|
134
|
+
declare type BorderRadius = keyof typeof borderRadiusMap;
|
|
135
|
+
declare const borderRadiusMap: {
|
|
136
|
+
normal: import("@emotion/react").SerializedStyles;
|
|
137
|
+
rounded: import("@emotion/react").SerializedStyles;
|
|
138
|
+
badge: import("@emotion/react").SerializedStyles;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* @experimental - this is likely to be removed
|
|
142
|
+
*/
|
|
143
|
+
declare type FlexDirection = keyof typeof flexDirectionMap;
|
|
144
|
+
declare const flexDirectionMap: {
|
|
145
|
+
column: import("@emotion/react").SerializedStyles;
|
|
146
|
+
row: import("@emotion/react").SerializedStyles;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* @experimental - this is likely to be removed
|
|
150
|
+
*/
|
|
151
|
+
declare type FlexAlignItems = keyof typeof flexAlignItemsMap;
|
|
152
|
+
declare const flexAlignItemsMap: {
|
|
153
|
+
center: import("@emotion/react").SerializedStyles;
|
|
154
|
+
baseline: import("@emotion/react").SerializedStyles;
|
|
155
|
+
flexStart: import("@emotion/react").SerializedStyles;
|
|
156
|
+
flexEnd: import("@emotion/react").SerializedStyles;
|
|
157
|
+
start: import("@emotion/react").SerializedStyles;
|
|
158
|
+
end: import("@emotion/react").SerializedStyles;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* @experimental - this is likely to be removed
|
|
162
|
+
*/
|
|
163
|
+
declare type FlexJustifyContent = keyof typeof flexJustifyContentMap;
|
|
164
|
+
declare const flexJustifyContentMap: {
|
|
165
|
+
center: import("@emotion/react").SerializedStyles;
|
|
166
|
+
flexStart: import("@emotion/react").SerializedStyles;
|
|
167
|
+
flexEnd: import("@emotion/react").SerializedStyles;
|
|
168
|
+
start: import("@emotion/react").SerializedStyles;
|
|
169
|
+
end: import("@emotion/react").SerializedStyles;
|
|
170
|
+
};
|
|
171
|
+
declare type Display = keyof typeof displayMap;
|
|
172
|
+
declare const displayMap: {
|
|
173
|
+
block: import("@emotion/react").SerializedStyles;
|
|
174
|
+
inline: import("@emotion/react").SerializedStyles;
|
|
175
|
+
flex: import("@emotion/react").SerializedStyles;
|
|
176
|
+
inlineFlex: import("@emotion/react").SerializedStyles;
|
|
177
|
+
inlineBlock: import("@emotion/react").SerializedStyles;
|
|
178
|
+
};
|
|
179
|
+
declare type Position = keyof typeof positionMap;
|
|
180
|
+
declare const positionMap: {
|
|
181
|
+
absolute: import("@emotion/react").SerializedStyles;
|
|
182
|
+
fixed: import("@emotion/react").SerializedStyles;
|
|
183
|
+
relative: import("@emotion/react").SerializedStyles;
|
|
184
|
+
static: import("@emotion/react").SerializedStyles;
|
|
185
|
+
};
|
|
186
|
+
declare type Overflow = keyof typeof overflowMap;
|
|
187
|
+
declare const overflowMap: {
|
|
188
|
+
auto: import("@emotion/react").SerializedStyles;
|
|
189
|
+
hidden: import("@emotion/react").SerializedStyles;
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
193
|
+
* @codegen <<SignedSource::327e769aaa3da9422a919a0ca9490070>>
|
|
194
|
+
* @codegenId dimensions
|
|
195
|
+
* @codegenCommand yarn codegen-styles
|
|
196
|
+
* @codegenParams ["width", "height"]
|
|
197
|
+
*/
|
|
198
|
+
declare const widthMap: {
|
|
199
|
+
'100%': import("@emotion/react").SerializedStyles;
|
|
200
|
+
'size.100': import("@emotion/react").SerializedStyles;
|
|
201
|
+
'size.1000': import("@emotion/react").SerializedStyles;
|
|
202
|
+
'size.200': import("@emotion/react").SerializedStyles;
|
|
203
|
+
'size.300': import("@emotion/react").SerializedStyles;
|
|
204
|
+
'size.400': import("@emotion/react").SerializedStyles;
|
|
205
|
+
'size.500': import("@emotion/react").SerializedStyles;
|
|
206
|
+
'size.600': import("@emotion/react").SerializedStyles;
|
|
207
|
+
};
|
|
208
|
+
export declare type Width = keyof typeof widthMap;
|
|
209
|
+
declare const heightMap: {
|
|
210
|
+
'100%': import("@emotion/react").SerializedStyles;
|
|
211
|
+
'size.100': import("@emotion/react").SerializedStyles;
|
|
212
|
+
'size.1000': import("@emotion/react").SerializedStyles;
|
|
213
|
+
'size.200': import("@emotion/react").SerializedStyles;
|
|
214
|
+
'size.300': import("@emotion/react").SerializedStyles;
|
|
215
|
+
'size.400': import("@emotion/react").SerializedStyles;
|
|
216
|
+
'size.500': import("@emotion/react").SerializedStyles;
|
|
217
|
+
'size.600': import("@emotion/react").SerializedStyles;
|
|
218
|
+
};
|
|
219
|
+
export declare type Height = keyof typeof heightMap;
|
|
220
|
+
/**
|
|
221
|
+
* @codegenEnd
|
|
222
|
+
*/
|
|
223
|
+
/**
|
|
224
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
225
|
+
* @codegen <<SignedSource::9226f2e37dcce3e8b61fc00cc67f8893>>
|
|
226
|
+
* @codegenId spacing
|
|
227
|
+
* @codegenCommand yarn codegen-styles
|
|
228
|
+
* @codegenParams ["padding", "paddingBlock", "paddingInline"]
|
|
229
|
+
* @codegenDependency ../../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::b0b8f1a822ed84e0407ad83e6fda5a1c>>
|
|
230
|
+
*/
|
|
231
|
+
declare const paddingMap: {
|
|
232
|
+
'space.0': import("@emotion/react").SerializedStyles;
|
|
233
|
+
'space.025': import("@emotion/react").SerializedStyles;
|
|
234
|
+
'space.050': import("@emotion/react").SerializedStyles;
|
|
235
|
+
'space.075': import("@emotion/react").SerializedStyles;
|
|
236
|
+
'space.100': import("@emotion/react").SerializedStyles;
|
|
237
|
+
'space.1000': import("@emotion/react").SerializedStyles;
|
|
238
|
+
'space.150': import("@emotion/react").SerializedStyles;
|
|
239
|
+
'space.200': import("@emotion/react").SerializedStyles;
|
|
240
|
+
'space.250': import("@emotion/react").SerializedStyles;
|
|
241
|
+
'space.300': import("@emotion/react").SerializedStyles;
|
|
242
|
+
'space.400': import("@emotion/react").SerializedStyles;
|
|
243
|
+
'space.500': import("@emotion/react").SerializedStyles;
|
|
244
|
+
'space.600': import("@emotion/react").SerializedStyles;
|
|
245
|
+
'space.800': import("@emotion/react").SerializedStyles;
|
|
246
|
+
};
|
|
247
|
+
export declare type Padding = keyof typeof paddingMap;
|
|
248
|
+
declare const paddingBlockMap: {
|
|
249
|
+
'space.0': import("@emotion/react").SerializedStyles;
|
|
250
|
+
'space.025': import("@emotion/react").SerializedStyles;
|
|
251
|
+
'space.050': import("@emotion/react").SerializedStyles;
|
|
252
|
+
'space.075': import("@emotion/react").SerializedStyles;
|
|
253
|
+
'space.100': import("@emotion/react").SerializedStyles;
|
|
254
|
+
'space.1000': import("@emotion/react").SerializedStyles;
|
|
255
|
+
'space.150': import("@emotion/react").SerializedStyles;
|
|
256
|
+
'space.200': import("@emotion/react").SerializedStyles;
|
|
257
|
+
'space.250': import("@emotion/react").SerializedStyles;
|
|
258
|
+
'space.300': import("@emotion/react").SerializedStyles;
|
|
259
|
+
'space.400': import("@emotion/react").SerializedStyles;
|
|
260
|
+
'space.500': import("@emotion/react").SerializedStyles;
|
|
261
|
+
'space.600': import("@emotion/react").SerializedStyles;
|
|
262
|
+
'space.800': import("@emotion/react").SerializedStyles;
|
|
263
|
+
};
|
|
264
|
+
export declare type PaddingBlock = keyof typeof paddingBlockMap;
|
|
265
|
+
declare const paddingInlineMap: {
|
|
266
|
+
'space.0': import("@emotion/react").SerializedStyles;
|
|
267
|
+
'space.025': import("@emotion/react").SerializedStyles;
|
|
268
|
+
'space.050': import("@emotion/react").SerializedStyles;
|
|
269
|
+
'space.075': import("@emotion/react").SerializedStyles;
|
|
270
|
+
'space.100': import("@emotion/react").SerializedStyles;
|
|
271
|
+
'space.1000': import("@emotion/react").SerializedStyles;
|
|
272
|
+
'space.150': import("@emotion/react").SerializedStyles;
|
|
273
|
+
'space.200': import("@emotion/react").SerializedStyles;
|
|
274
|
+
'space.250': import("@emotion/react").SerializedStyles;
|
|
275
|
+
'space.300': import("@emotion/react").SerializedStyles;
|
|
276
|
+
'space.400': import("@emotion/react").SerializedStyles;
|
|
277
|
+
'space.500': import("@emotion/react").SerializedStyles;
|
|
278
|
+
'space.600': import("@emotion/react").SerializedStyles;
|
|
279
|
+
'space.800': import("@emotion/react").SerializedStyles;
|
|
280
|
+
};
|
|
281
|
+
export declare type PaddingInline = keyof typeof paddingInlineMap;
|
|
282
|
+
/**
|
|
283
|
+
* @codegenEnd
|
|
284
|
+
*/
|
|
285
|
+
/**
|
|
286
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
287
|
+
* @codegen <<SignedSource::997d215fff7bb2f824f7a0f600fe892e>>
|
|
288
|
+
* @codegenId colors
|
|
289
|
+
* @codegenCommand yarn codegen-styles
|
|
290
|
+
* @codegenParams ["border", "background", "shadow"]
|
|
291
|
+
* @codegenDependency ../../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
292
|
+
*/
|
|
293
|
+
declare const borderColorMap: {
|
|
294
|
+
readonly 'color.border': import("@emotion/react").SerializedStyles;
|
|
295
|
+
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
296
|
+
readonly focused: import("@emotion/react").SerializedStyles;
|
|
297
|
+
readonly input: import("@emotion/react").SerializedStyles;
|
|
298
|
+
readonly inverse: import("@emotion/react").SerializedStyles;
|
|
299
|
+
readonly selected: import("@emotion/react").SerializedStyles;
|
|
300
|
+
readonly brand: 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;
|
|
306
|
+
readonly bold: import("@emotion/react").SerializedStyles;
|
|
307
|
+
};
|
|
308
|
+
export declare type BorderColor = keyof typeof borderColorMap;
|
|
309
|
+
declare const backgroundColorMap: {
|
|
310
|
+
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
311
|
+
readonly input: import("@emotion/react").SerializedStyles;
|
|
312
|
+
readonly 'inverse.subtle': import("@emotion/react").SerializedStyles;
|
|
313
|
+
readonly neutral: import("@emotion/react").SerializedStyles;
|
|
314
|
+
readonly 'neutral.subtle': import("@emotion/react").SerializedStyles;
|
|
315
|
+
readonly 'neutral.bold': import("@emotion/react").SerializedStyles;
|
|
316
|
+
readonly selected: import("@emotion/react").SerializedStyles;
|
|
317
|
+
readonly 'selected.bold': import("@emotion/react").SerializedStyles;
|
|
318
|
+
readonly 'brand.bold': import("@emotion/react").SerializedStyles;
|
|
319
|
+
readonly danger: import("@emotion/react").SerializedStyles;
|
|
320
|
+
readonly 'danger.bold': import("@emotion/react").SerializedStyles;
|
|
321
|
+
readonly warning: import("@emotion/react").SerializedStyles;
|
|
322
|
+
readonly 'warning.bold': import("@emotion/react").SerializedStyles;
|
|
323
|
+
readonly success: import("@emotion/react").SerializedStyles;
|
|
324
|
+
readonly 'success.bold': import("@emotion/react").SerializedStyles;
|
|
325
|
+
readonly discovery: import("@emotion/react").SerializedStyles;
|
|
326
|
+
readonly 'discovery.bold': import("@emotion/react").SerializedStyles;
|
|
327
|
+
readonly information: import("@emotion/react").SerializedStyles;
|
|
328
|
+
readonly 'information.bold': import("@emotion/react").SerializedStyles;
|
|
329
|
+
readonly 'color.blanket': import("@emotion/react").SerializedStyles;
|
|
330
|
+
readonly 'color.blanket.selected': import("@emotion/react").SerializedStyles;
|
|
331
|
+
readonly 'color.blanket.danger': import("@emotion/react").SerializedStyles;
|
|
332
|
+
readonly 'elevation.surface': import("@emotion/react").SerializedStyles;
|
|
333
|
+
readonly 'elevation.surface.overlay': import("@emotion/react").SerializedStyles;
|
|
334
|
+
readonly 'elevation.surface.raised': import("@emotion/react").SerializedStyles;
|
|
335
|
+
readonly 'elevation.surface.sunken': import("@emotion/react").SerializedStyles;
|
|
336
|
+
};
|
|
337
|
+
export declare type BackgroundColor = keyof typeof backgroundColorMap;
|
|
338
|
+
declare const shadowMap: {
|
|
339
|
+
readonly overflow: import("@emotion/react").SerializedStyles;
|
|
340
|
+
readonly 'overflow.perimeter': import("@emotion/react").SerializedStyles;
|
|
341
|
+
readonly 'overflow.spread': import("@emotion/react").SerializedStyles;
|
|
342
|
+
readonly overlay: import("@emotion/react").SerializedStyles;
|
|
343
|
+
readonly raised: import("@emotion/react").SerializedStyles;
|
|
344
|
+
};
|
|
345
|
+
export declare type Shadow = keyof typeof shadowMap;
|
|
346
|
+
/**
|
|
347
|
+
* @codegenEnd
|
|
348
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Stack } from '@atlaskit/ds-explorations/stack';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
export interface BasePrimitiveProps {
|
|
3
|
+
/**
|
|
4
|
+
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
5
|
+
*/
|
|
6
|
+
testId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Inline styles to be applied to the primitive.
|
|
9
|
+
* Marked as "unsafe" because any CSS properties can be provided here without any extra control or validation, including those that would be better managed by the primitive itself via props.
|
|
10
|
+
* Effectively equivalent to the standard `style` prop but marked with a special name so we can rationalise its usage IN THE FUTURE.
|
|
11
|
+
*/
|
|
12
|
+
UNSAFE_style?: CSSProperties;
|
|
13
|
+
}
|
|
@@ -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;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly 'neutral.bold': "inverse";
|
|
3
|
+
readonly 'neutral.bold.hovered': "inverse";
|
|
4
|
+
readonly 'neutral.bold.pressed': "inverse";
|
|
5
|
+
readonly 'selected.bold': "inverse";
|
|
6
|
+
readonly 'selected.bold.hovered': "inverse";
|
|
7
|
+
readonly 'selected.bold.pressed': "inverse";
|
|
8
|
+
readonly 'brand.bold': "inverse";
|
|
9
|
+
readonly 'brand.bold.hovered': "inverse";
|
|
10
|
+
readonly 'brand.bold.pressed': "inverse";
|
|
11
|
+
readonly 'danger.bold': "inverse";
|
|
12
|
+
readonly 'danger.bold.hovered': "inverse";
|
|
13
|
+
readonly 'danger.bold.pressed': "inverse";
|
|
14
|
+
readonly 'warning.bold': "warning.inverse";
|
|
15
|
+
readonly 'warning.bold.hovered': "warning.inverse";
|
|
16
|
+
readonly 'warning.bold.pressed': "warning.inverse";
|
|
17
|
+
readonly 'success.bold': "inverse";
|
|
18
|
+
readonly 'success.bold.hovered': "inverse";
|
|
19
|
+
readonly 'success.bold.pressed': "inverse";
|
|
20
|
+
readonly 'discovery.bold': "inverse";
|
|
21
|
+
readonly 'discovery.bold.hovered': "inverse";
|
|
22
|
+
readonly 'discovery.bold.pressed': "inverse";
|
|
23
|
+
readonly 'information.bold': "inverse";
|
|
24
|
+
readonly 'information.bold.hovered': "inverse";
|
|
25
|
+
readonly 'information.bold.pressed': "inverse";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
29
|
+
*
|
|
30
|
+
* The color map is used to map a background color token to a matching text color that will meet contrast.
|
|
31
|
+
*
|
|
32
|
+
* @codegen <<SignedSource::d168519874a16bbb92cfbfd4747a39b4>>
|
|
33
|
+
* @codegenCommand yarn codegen-styles
|
|
34
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
35
|
+
*/
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/primitives/inline",
|
|
3
|
+
"main": "../dist/cjs/components/inline.partial.js",
|
|
4
|
+
"module": "../dist/esm/components/inline.partial.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/components/inline.partial.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/components/inline.partial.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/components/inline.partial.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/primitives",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
8
|
+
"homepage": "https://atlassian.design/components/primitives",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
},
|
|
12
|
+
"atlassian": {
|
|
13
|
+
"team": "Design System Team",
|
|
14
|
+
"inPublicMirror": false,
|
|
15
|
+
"releaseModel": "continuous",
|
|
16
|
+
"website": {
|
|
17
|
+
"category": "Components",
|
|
18
|
+
"name": "Primitives",
|
|
19
|
+
"status": {
|
|
20
|
+
"type": "alpha"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"codegen-styles": "ts-node --project ../../../tsconfig.node.json ./scripts/codegen-styles"
|
|
26
|
+
},
|
|
27
|
+
"main": "dist/cjs/index.js",
|
|
28
|
+
"module": "dist/esm/index.js",
|
|
29
|
+
"module:es2019": "dist/es2019/index.js",
|
|
30
|
+
"types": "dist/types/index.d.ts",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"atlaskit:src": "src/index.tsx",
|
|
33
|
+
"af:exports": {
|
|
34
|
+
".": "./src/index.tsx",
|
|
35
|
+
"./box": "./src/components/box.tsx",
|
|
36
|
+
"./stack": "./src/components/stack.partial.tsx",
|
|
37
|
+
"./inline": "./src/components/inline.partial.tsx"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@atlaskit/ds-explorations": "^2.0.1",
|
|
41
|
+
"@atlaskit/tokens": "^1.0.0",
|
|
42
|
+
"@babel/runtime": "^7.0.0",
|
|
43
|
+
"@emotion/react": "^11.7.1"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@af/codegen": "*",
|
|
50
|
+
"@atlaskit/docs": "*",
|
|
51
|
+
"@atlaskit/ds-lib": "*",
|
|
52
|
+
"@atlaskit/ssr": "*",
|
|
53
|
+
"@atlaskit/visual-regression": "*",
|
|
54
|
+
"@atlaskit/webdriver-runner": "*",
|
|
55
|
+
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
56
|
+
"@testing-library/react": "^12.1.5",
|
|
57
|
+
"prettier": "^2.7.0",
|
|
58
|
+
"react-dom": "^16.8.0",
|
|
59
|
+
"ts-node": "^10.9.1",
|
|
60
|
+
"typescript": "4.5.5",
|
|
61
|
+
"wait-for-expect": "^1.2.0"
|
|
62
|
+
},
|
|
63
|
+
"techstack": {
|
|
64
|
+
"@atlassian/frontend": {
|
|
65
|
+
"import-structure": [
|
|
66
|
+
"atlassian-conventions"
|
|
67
|
+
],
|
|
68
|
+
"circular-dependencies": "file-and-folder-level"
|
|
69
|
+
},
|
|
70
|
+
"@repo/internal": {
|
|
71
|
+
"design-system": "v1",
|
|
72
|
+
"dom-events": "use-bind-event-listener",
|
|
73
|
+
"analytics": "analytics-next",
|
|
74
|
+
"ui-components": [
|
|
75
|
+
"lite-mode"
|
|
76
|
+
],
|
|
77
|
+
"deprecation": "no-deprecated-imports",
|
|
78
|
+
"styling": [
|
|
79
|
+
"static",
|
|
80
|
+
"emotion"
|
|
81
|
+
],
|
|
82
|
+
"design-tokens": [
|
|
83
|
+
"color",
|
|
84
|
+
"spacing"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
89
|
+
}
|
package/report.api.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
|
+
|
|
3
|
+
## API Report File for "@atlaskit/primitives"
|
|
4
|
+
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
12
|
+
|
|
13
|
+
### Main Entry Types
|
|
14
|
+
|
|
15
|
+
<!--SECTION START: Main Entry Types-->
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { default as Box } from '@atlaskit/ds-explorations/box';
|
|
19
|
+
import { default as Inline } from '@atlaskit/ds-explorations/inline';
|
|
20
|
+
import { default as Stack } from '@atlaskit/ds-explorations/stack';
|
|
21
|
+
|
|
22
|
+
export { Box };
|
|
23
|
+
|
|
24
|
+
export { Inline };
|
|
25
|
+
|
|
26
|
+
export { Stack };
|
|
27
|
+
|
|
28
|
+
// (No @packageDocumentation comment for this package)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<!--SECTION END: Main Entry Types-->
|
|
32
|
+
|
|
33
|
+
### Peer Dependencies
|
|
34
|
+
|
|
35
|
+
<!--SECTION START: Peer Dependencies-->
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
<!--SECTION END: Peer Dependencies-->
|