@atlaskit/primitives 19.0.0 → 19.0.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 +35 -0
- package/codemods/compiled-fork-stage1/transform.tsx +178 -17
- package/components/flex/package.json +17 -0
- package/constellation/pressable/usage.mdx +2 -0
- package/dist/cjs/compiled/components/anchor.js +1 -1
- package/dist/cjs/compiled/components/box.compiled.css +1 -1
- package/dist/cjs/compiled/components/box.js +3 -3
- package/dist/cjs/compiled/components/pressable.js +1 -1
- package/dist/cjs/compiled/components/text.js +2 -0
- package/dist/cjs/components/anchor.js +1 -1
- package/dist/cjs/components/box.js +4 -2
- package/dist/cjs/components/pressable.js +1 -1
- package/dist/cjs/responsive/build-media-query-css.js +14 -71
- package/dist/cjs/responsive/constants.js +2 -0
- package/dist/cjs/responsive/hide.js +4 -3
- package/dist/cjs/responsive/media-helper.js +8 -37
- package/dist/cjs/responsive/media.js +31 -0
- package/dist/cjs/responsive/show.js +4 -3
- package/dist/cjs/responsive/unsafe-build-above-media-query-css.js +43 -0
- package/dist/cjs/responsive/unsafe-build-below-media-query-css.js +45 -0
- package/dist/cjs/utils/has-text-ancestor-context.js +1 -0
- package/dist/cjs/utils/surface-context.js +13 -0
- package/dist/cjs/utils/surface-provider.js +10 -10
- package/dist/cjs/xcss/style-maps.partial.js +27 -7
- package/dist/cjs/xcss/xcss.js +2 -0
- package/dist/es2019/compiled/components/anchor.js +1 -1
- package/dist/es2019/compiled/components/box.compiled.css +1 -1
- package/dist/es2019/compiled/components/box.js +2 -2
- package/dist/es2019/compiled/components/pressable.js +1 -1
- package/dist/es2019/compiled/components/text.js +2 -0
- package/dist/es2019/components/anchor.js +1 -1
- package/dist/es2019/components/box.js +3 -1
- package/dist/es2019/components/pressable.js +1 -1
- package/dist/es2019/responsive/build-media-query-css.js +2 -75
- package/dist/es2019/responsive/constants.js +2 -0
- package/dist/es2019/responsive/hide.js +2 -1
- package/dist/es2019/responsive/media-helper.js +3 -37
- package/dist/es2019/responsive/media.js +25 -0
- package/dist/es2019/responsive/show.js +2 -1
- package/dist/es2019/responsive/unsafe-build-above-media-query-css.js +38 -0
- package/dist/es2019/responsive/unsafe-build-below-media-query-css.js +42 -0
- package/dist/es2019/utils/has-text-ancestor-context.js +1 -0
- package/dist/es2019/utils/surface-context.js +7 -0
- package/dist/es2019/utils/surface-provider.js +4 -9
- package/dist/es2019/xcss/style-maps.partial.js +27 -7
- package/dist/es2019/xcss/xcss.js +2 -0
- package/dist/esm/compiled/components/anchor.js +1 -1
- package/dist/esm/compiled/components/box.compiled.css +1 -1
- package/dist/esm/compiled/components/box.js +2 -2
- package/dist/esm/compiled/components/pressable.js +1 -1
- package/dist/esm/compiled/components/text.js +2 -0
- package/dist/esm/components/anchor.js +1 -1
- package/dist/esm/components/box.js +3 -1
- package/dist/esm/components/pressable.js +1 -1
- package/dist/esm/responsive/build-media-query-css.js +2 -68
- package/dist/esm/responsive/constants.js +2 -0
- package/dist/esm/responsive/hide.js +2 -1
- package/dist/esm/responsive/media-helper.js +3 -37
- package/dist/esm/responsive/media.js +25 -0
- package/dist/esm/responsive/show.js +2 -1
- package/dist/esm/responsive/unsafe-build-above-media-query-css.js +37 -0
- package/dist/esm/responsive/unsafe-build-below-media-query-css.js +39 -0
- package/dist/esm/utils/has-text-ancestor-context.js +1 -0
- package/dist/esm/utils/surface-context.js +7 -0
- package/dist/esm/utils/surface-provider.js +4 -9
- package/dist/esm/xcss/style-maps.partial.js +27 -7
- package/dist/esm/xcss/xcss.js +2 -0
- package/dist/types/responsive/build-media-query-css.d.ts +2 -63
- package/dist/types/responsive/media-helper.d.ts +1 -35
- package/dist/types/responsive/media.d.ts +25 -0
- package/dist/types/responsive/types.d.ts +1 -1
- package/dist/types/responsive/unsafe-build-above-media-query-css.d.ts +33 -0
- package/dist/types/responsive/unsafe-build-below-media-query-css.d.ts +32 -0
- package/dist/types/utils/surface-context.d.ts +8 -0
- package/dist/types/utils/surface-provider.d.ts +1 -7
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/types/xcss/style-maps.partial.d.ts +26 -6
- package/dist/types-ts4.5/responsive/build-media-query-css.d.ts +2 -63
- package/dist/types-ts4.5/responsive/media-helper.d.ts +1 -35
- package/dist/types-ts4.5/responsive/media.d.ts +25 -0
- package/dist/types-ts4.5/responsive/types.d.ts +1 -1
- package/dist/types-ts4.5/responsive/unsafe-build-above-media-query-css.d.ts +33 -0
- package/dist/types-ts4.5/responsive/unsafe-build-below-media-query-css.d.ts +32 -0
- package/dist/types-ts4.5/utils/surface-context.d.ts +8 -0
- package/dist/types-ts4.5/utils/surface-provider.d.ts +1 -7
- package/dist/types-ts4.5/utils/types.d.ts +1 -1
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +26 -6
- package/package.json +21 -45
- package/primitives.docs.tsx +359 -356
- package/scripts/capitalize.tsx +2 -0
- package/scripts/color-codegen-template.tsx +3 -6
- package/scripts/compose.tsx +4 -0
- package/scripts/elevation-codegen-template.tsx +3 -6
- package/scripts/generate-type-defs.tsx +12 -0
- package/scripts/inverse-color-map-template.tsx +4 -1
- package/scripts/is-accent.tsx +1 -0
- package/scripts/is-hovered.tsx +1 -0
- package/scripts/is-pressed.tsx +1 -0
- package/scripts/pick.tsx +4 -0
- package/scripts/shape-codegen-template.tsx +3 -1
- package/scripts/spacing-codegen-template.tsx +2 -1
- package/scripts/text-codegen-template.tsx +3 -1
- package/scripts/typography-codegen-template.tsx +3 -1
- package/scripts/utils.tsx +7 -25
- package/offerings.json +0 -298
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 19.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`71fee8de88abc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/71fee8de88abc) -
|
|
8
|
+
Added new design tokens to support the Lozenge / Tag / Badge visual uplift:
|
|
9
|
+
|
|
10
|
+
**15 new `color.border.*.subtle` tokens** for decorative borders that do not need to meet 3:1
|
|
11
|
+
contrast requirements:
|
|
12
|
+
- 5 semantic: `danger`, `warning`, `success`, `discovery`, `information` (no `neutral.subtle` —
|
|
13
|
+
the default `color.border` already serves this case)
|
|
14
|
+
- 10 accent: `red`, `orange`, `yellow`, `lime`, `green`, `teal`, `blue`, `purple`, `magenta`,
|
|
15
|
+
`gray`
|
|
16
|
+
- Light theme maps to Color300; dark theme maps to Color800 (DarkNeutral400 for `accent.gray`)
|
|
17
|
+
|
|
18
|
+
**5 new `color.background.*.subtle` tokens** for non-interactive elements (e.g. semantic badges,
|
|
19
|
+
status pills, callout chips):
|
|
20
|
+
- `danger`, `success`, `discovery`, `information` — light theme maps to Color300, dark theme maps
|
|
21
|
+
to Color800
|
|
22
|
+
- `warning` — light theme maps to Orange250, dark theme maps to Orange850 (different stops because
|
|
23
|
+
Orange300 is already used by `warning.bold`)
|
|
24
|
+
|
|
25
|
+
Note: `color.background.*.subtle` is intentionally non-interactive only — no `.hovered` or
|
|
26
|
+
`.pressed` variants are provided. For interactive surfaces, use `color.background.<semantic>.bold`
|
|
27
|
+
or `color.background.<semantic>.subtler` instead.
|
|
28
|
+
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
|
|
31
|
+
## 19.0.1
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [`79f04a5184ece`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/79f04a5184ece) -
|
|
36
|
+
Apply a couple of minor fixes to the stage 1 codemod transform
|
|
37
|
+
|
|
3
38
|
## 19.0.0
|
|
4
39
|
|
|
5
40
|
### Major Changes
|
|
@@ -6,6 +6,11 @@ import type {
|
|
|
6
6
|
VariableDeclaration,
|
|
7
7
|
} from 'jscodeshift';
|
|
8
8
|
|
|
9
|
+
// ImportSpecifier with importKind property (exists at runtime but not in type definitions)
|
|
10
|
+
type ImportSpecifierWithKind = ImportSpecifier & {
|
|
11
|
+
importKind?: 'type' | 'value' | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
9
14
|
const ANCHOR_PRESSABLE_XCSS_PROPS = [
|
|
10
15
|
'backgroundColor',
|
|
11
16
|
'padding',
|
|
@@ -92,10 +97,21 @@ function transform(file: FileInfo, { jscodeshift: j }: API): string {
|
|
|
92
97
|
path.node.specifiers?.filter(
|
|
93
98
|
(specifier) => j.ImportSpecifier.check(specifier) && specifier.imported.name === 'xcss',
|
|
94
99
|
) ?? [];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
|
|
101
|
+
// Separate type and value specifiers
|
|
102
|
+
const typeSpecifiers: ImportSpecifier[] = [];
|
|
103
|
+
const valueSpecifiers: ImportSpecifier[] = [];
|
|
104
|
+
|
|
105
|
+
path.node.specifiers?.forEach((specifier) => {
|
|
106
|
+
if (j.ImportSpecifier.check(specifier) && specifier.imported.name !== 'xcss') {
|
|
107
|
+
const specifierWithKind = specifier as ImportSpecifierWithKind;
|
|
108
|
+
if (specifierWithKind.importKind === 'type') {
|
|
109
|
+
typeSpecifiers.push(specifier);
|
|
110
|
+
} else {
|
|
111
|
+
valueSpecifiers.push(specifier);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
99
115
|
|
|
100
116
|
// Find components that use xcss
|
|
101
117
|
const componentsUsingXcss = new Set<string>();
|
|
@@ -118,25 +134,40 @@ function transform(file: FileInfo, { jscodeshift: j }: API): string {
|
|
|
118
134
|
}
|
|
119
135
|
});
|
|
120
136
|
|
|
121
|
-
// Split specifiers based on xcss usage
|
|
122
|
-
const
|
|
137
|
+
// Split value specifiers based on xcss usage
|
|
138
|
+
const valueSpecifiersToKeep = valueSpecifiers.filter(
|
|
123
139
|
(specifier) =>
|
|
124
140
|
j.ImportSpecifier.check(specifier) && componentsUsingXcss.has(specifier.imported.name),
|
|
125
141
|
);
|
|
126
|
-
const
|
|
142
|
+
const valueSpecifiersToMove = valueSpecifiers.filter(
|
|
127
143
|
(specifier) =>
|
|
128
144
|
j.ImportSpecifier.check(specifier) && !componentsUsingXcss.has(specifier.imported.name),
|
|
129
145
|
);
|
|
130
146
|
|
|
131
|
-
if (
|
|
132
|
-
//
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
);
|
|
147
|
+
if (valueSpecifiersToMove.length > 0) {
|
|
148
|
+
// Check if there's an existing compiled import to merge into
|
|
149
|
+
const existingCompiledImports = root.find(j.ImportDeclaration, {
|
|
150
|
+
source: { value: '@atlaskit/primitives/compiled' },
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
if (existingCompiledImports.length > 0) {
|
|
154
|
+
// Merge into first existing compiled import
|
|
155
|
+
const firstCompiledImport = existingCompiledImports.get(0);
|
|
156
|
+
const existingSpecifiers = firstCompiledImport.node.specifiers || [];
|
|
157
|
+
firstCompiledImport.node.specifiers = [...existingSpecifiers, ...valueSpecifiersToMove];
|
|
158
|
+
} else {
|
|
159
|
+
// Create new import for components that don't use xcss
|
|
160
|
+
path.insertAfter(
|
|
161
|
+
j.importDeclaration(
|
|
162
|
+
valueSpecifiersToMove,
|
|
163
|
+
j.literal('@atlaskit/primitives/compiled'),
|
|
164
|
+
),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
136
167
|
}
|
|
137
168
|
|
|
138
|
-
// Update original import to include xcss
|
|
139
|
-
path.node.specifiers = [...xcssSpecifiers, ...
|
|
169
|
+
// Update original import to include xcss, value specifiers, then type specifiers
|
|
170
|
+
path.node.specifiers = [...xcssSpecifiers, ...valueSpecifiersToKeep, ...typeSpecifiers];
|
|
140
171
|
});
|
|
141
172
|
|
|
142
173
|
return root.toSource({ quote: 'single' });
|
|
@@ -230,14 +261,144 @@ function transform(file: FileInfo, { jscodeshift: j }: API): string {
|
|
|
230
261
|
}
|
|
231
262
|
|
|
232
263
|
// Find all import declarations from '@atlaskit/primitives'
|
|
233
|
-
root.find(j.ImportDeclaration, {
|
|
234
|
-
|
|
264
|
+
const primitivesImports = root.find(j.ImportDeclaration, {
|
|
265
|
+
source: { value: '@atlaskit/primitives' },
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// Collect all value specifiers to move to compiled
|
|
269
|
+
const valueSpecifiersToMove: ImportSpecifier[] = [];
|
|
270
|
+
const typeSpecifiersToKeep: ImportSpecifier[] = [];
|
|
271
|
+
const importsToRemove: Parameters<Parameters<typeof primitivesImports.forEach>[0]>[0][] = [];
|
|
272
|
+
|
|
273
|
+
primitivesImports.forEach((path) => {
|
|
274
|
+
// Handle type-only imports - keep them in @atlaskit/primitives
|
|
235
275
|
if (path.node.importKind === 'type') {
|
|
236
276
|
return;
|
|
237
277
|
}
|
|
238
|
-
|
|
278
|
+
|
|
279
|
+
// Separate type and value specifiers
|
|
280
|
+
const typeSpecs: ImportSpecifier[] = [];
|
|
281
|
+
const valueSpecs: ImportSpecifier[] = [];
|
|
282
|
+
|
|
283
|
+
path.node.specifiers?.forEach((specifier) => {
|
|
284
|
+
if (j.ImportSpecifier.check(specifier)) {
|
|
285
|
+
// Check if this is a type import specifier
|
|
286
|
+
const specifierWithKind = specifier as ImportSpecifierWithKind;
|
|
287
|
+
const isTypeSpec = specifierWithKind.importKind === 'type';
|
|
288
|
+
if (isTypeSpec) {
|
|
289
|
+
typeSpecs.push(specifier);
|
|
290
|
+
} else {
|
|
291
|
+
valueSpecs.push(specifier);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// If there are type specifiers, keep them in a separate type import
|
|
297
|
+
if (typeSpecs.length > 0) {
|
|
298
|
+
typeSpecifiersToKeep.push(...typeSpecs);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Collect value specifiers to move
|
|
302
|
+
if (valueSpecs.length > 0) {
|
|
303
|
+
valueSpecifiersToMove.push(...valueSpecs);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Mark this import for removal if it had value specifiers
|
|
307
|
+
if (valueSpecs.length > 0) {
|
|
308
|
+
importsToRemove.push(path);
|
|
309
|
+
}
|
|
239
310
|
});
|
|
240
311
|
|
|
312
|
+
// Remove imports that had value specifiers (type-only imports stay)
|
|
313
|
+
importsToRemove.forEach((path) => {
|
|
314
|
+
j(path).remove();
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// If we have type specifiers to keep, create/update a type import
|
|
318
|
+
if (typeSpecifiersToKeep.length > 0) {
|
|
319
|
+
// Check for existing imports from @atlaskit/primitives (not type-only, as we want inline type syntax)
|
|
320
|
+
const existingPrimitivesImports = root
|
|
321
|
+
.find(j.ImportDeclaration, {
|
|
322
|
+
source: { value: '@atlaskit/primitives' },
|
|
323
|
+
})
|
|
324
|
+
.filter((path) => path.node.importKind !== 'type');
|
|
325
|
+
|
|
326
|
+
if (existingPrimitivesImports.length > 0) {
|
|
327
|
+
// Merge type specifiers into first existing import (will use inline type syntax)
|
|
328
|
+
const firstImport = existingPrimitivesImports.get(0);
|
|
329
|
+
const existingSpecifiers = firstImport.node.specifiers || [];
|
|
330
|
+
firstImport.node.specifiers = [...existingSpecifiers, ...typeSpecifiersToKeep];
|
|
331
|
+
} else {
|
|
332
|
+
// Create new import with inline type syntax (regular import, not type-only)
|
|
333
|
+
// The specifiers already have importKind: 'type' which will produce inline type syntax
|
|
334
|
+
const allImports = root.find(j.ImportDeclaration);
|
|
335
|
+
if (allImports.length > 0) {
|
|
336
|
+
allImports
|
|
337
|
+
.at(0)
|
|
338
|
+
.insertBefore(
|
|
339
|
+
j.importDeclaration(typeSpecifiersToKeep, j.literal('@atlaskit/primitives')),
|
|
340
|
+
);
|
|
341
|
+
} else {
|
|
342
|
+
root
|
|
343
|
+
.get()
|
|
344
|
+
.node.program.body.unshift(
|
|
345
|
+
j.importDeclaration(typeSpecifiersToKeep, j.literal('@atlaskit/primitives')),
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Merge value specifiers into existing compiled import or create new one
|
|
352
|
+
if (valueSpecifiersToMove.length > 0) {
|
|
353
|
+
// Find compiled imports again after removals
|
|
354
|
+
const currentCompiledImports = root.find(j.ImportDeclaration, {
|
|
355
|
+
source: { value: '@atlaskit/primitives/compiled' },
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
if (currentCompiledImports.length > 0) {
|
|
359
|
+
// Collect all specifiers from all existing compiled imports
|
|
360
|
+
const allExistingSpecifiers: ImportSpecifier[] = [];
|
|
361
|
+
currentCompiledImports.forEach((path) => {
|
|
362
|
+
const specifiers = path.node.specifiers || [];
|
|
363
|
+
specifiers.forEach((spec) => {
|
|
364
|
+
if (j.ImportSpecifier.check(spec)) {
|
|
365
|
+
allExistingSpecifiers.push(spec);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
// Merge all specifiers into first existing compiled import
|
|
371
|
+
const firstCompiledImport = currentCompiledImports.get(0);
|
|
372
|
+
firstCompiledImport.node.specifiers = [...allExistingSpecifiers, ...valueSpecifiersToMove];
|
|
373
|
+
|
|
374
|
+
// Remove the other compiled imports (keep only the first one)
|
|
375
|
+
if (currentCompiledImports.length > 1) {
|
|
376
|
+
currentCompiledImports.forEach((path, index) => {
|
|
377
|
+
if (index > 0) {
|
|
378
|
+
j(path).remove();
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
} else {
|
|
383
|
+
// Create new compiled import after the last import
|
|
384
|
+
const allImports = root.find(j.ImportDeclaration);
|
|
385
|
+
if (allImports.length > 0) {
|
|
386
|
+
allImports
|
|
387
|
+
.at(-1)
|
|
388
|
+
.insertAfter(
|
|
389
|
+
j.importDeclaration(valueSpecifiersToMove, j.literal('@atlaskit/primitives/compiled')),
|
|
390
|
+
);
|
|
391
|
+
} else {
|
|
392
|
+
// No imports at all, add at the beginning
|
|
393
|
+
root
|
|
394
|
+
.get()
|
|
395
|
+
.node.program.body.unshift(
|
|
396
|
+
j.importDeclaration(valueSpecifiersToMove, j.literal('@atlaskit/primitives/compiled')),
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
241
402
|
// Find existing cssMap import or alias
|
|
242
403
|
let cssMapName = 'cssMap';
|
|
243
404
|
const cssMapImport = root.find(j.ImportDeclaration, {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/primitives/components/flex",
|
|
3
|
+
"main": "../../dist/cjs/components/flex.js",
|
|
4
|
+
"module": "../../dist/esm/components/flex.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/components/flex.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/components/flex.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../../dist/types-ts4.5/components/flex.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -15,6 +15,8 @@ to an HTML `<button>`, but with Atlassian focus styles, analytics events, and st
|
|
|
15
15
|
For example, you could use pressable to make a colored square button that opens a color picker, or a
|
|
16
16
|
basic card that shows more details when selected.
|
|
17
17
|
|
|
18
|
+
## Parts
|
|
19
|
+
|
|
18
20
|

|
|
19
21
|
|
|
20
22
|
1. **Pressable area:** For accessibility this should be a minimum of 24 by 24 pixels, unless exempt
|
|
@@ -70,7 +70,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
70
70
|
action: 'clicked',
|
|
71
71
|
componentName: componentName || 'Anchor',
|
|
72
72
|
packageName: "@atlaskit/primitives",
|
|
73
|
-
packageVersion: "19.0.
|
|
73
|
+
packageVersion: "19.0.1",
|
|
74
74
|
analyticsData: analyticsContext,
|
|
75
75
|
actionSubject: 'link'
|
|
76
76
|
});
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
._bfhk16zl{background-color:var(--ds-background-accent-teal-subtle-pressed,#b1e4f7)}
|
|
57
57
|
._bfhk1773{background-color:var(--ds-background-accent-yellow-subtler,#f5e989)}
|
|
58
58
|
._bfhk1856{background-color:var(--ds-background-brand-bold,#1868db)}
|
|
59
|
+
._bfhk187o{background-color:var(--ds-background-disabled,#0515240f)}
|
|
59
60
|
._bfhk18ah{background-color:var(--ds-background-accent-purple-subtle,#c97cf4)}
|
|
60
61
|
._bfhk18j9{background-color:var(--ds-background-accent-gray-subtle,#8c8f97)}
|
|
61
62
|
._bfhk18ut{background-color:var(--ds-background-accent-gray-subtlest-pressed,#b7b9be)}
|
|
@@ -159,7 +160,6 @@
|
|
|
159
160
|
._bfhkattl{background-color:var(--ds-background-accent-purple-subtler-hovered,#e3bdfa)}
|
|
160
161
|
._bfhkaxpp{background-color:var(--ds-background-accent-orange-subtle-pressed,#fbd779)}
|
|
161
162
|
._bfhkbq5w{background-color:var(--ds-background-accent-lime-subtle,#94c748)}
|
|
162
|
-
._bfhkby5v{background-color:var(--ds-background-disabled,#17171708)}
|
|
163
163
|
._bfhkbyip{background-color:var(--ds-background-accent-gray-bolder-hovered,#505258)}
|
|
164
164
|
._bfhkc3uk{background-color:var(--ds-background-accent-magenta-bolder,#ae4787)}
|
|
165
165
|
._bfhkchd4{background-color:var(--ds-elevation-surface-current,#fff)}
|
|
@@ -13,7 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
16
|
-
var
|
|
16
|
+
var _surfaceContext = require("../../utils/surface-context");
|
|
17
17
|
var _excluded = ["as", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "style", "testId", "xcss"],
|
|
18
18
|
_excluded2 = ["className"];
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -144,7 +144,7 @@ var backgroundColorMap = {
|
|
|
144
144
|
'color.background.accent.gray.bolder': "_bfhk1i45",
|
|
145
145
|
'color.background.accent.gray.bolder.hovered': "_bfhkbyip",
|
|
146
146
|
'color.background.accent.gray.bolder.pressed': "_bfhk1van",
|
|
147
|
-
'color.background.disabled': "
|
|
147
|
+
'color.background.disabled': "_bfhk187o",
|
|
148
148
|
'color.background.input': "_bfhk1j9a",
|
|
149
149
|
'color.background.input.hovered': "_bfhkl4ek",
|
|
150
150
|
'color.background.input.pressed': "_bfhkr01l",
|
|
@@ -346,7 +346,7 @@ var Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
346
346
|
"data-testid": testId
|
|
347
347
|
}), children);
|
|
348
348
|
if (backgroundColor) {
|
|
349
|
-
return /*#__PURE__*/React.createElement(
|
|
349
|
+
return /*#__PURE__*/React.createElement(_surfaceContext.SurfaceContext.Provider, {
|
|
350
350
|
value: backgroundColor
|
|
351
351
|
}, node);
|
|
352
352
|
}
|
|
@@ -61,7 +61,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
61
61
|
action: 'clicked',
|
|
62
62
|
componentName: componentName || 'Pressable',
|
|
63
63
|
packageName: "@atlaskit/primitives",
|
|
64
|
-
packageVersion: "19.0.
|
|
64
|
+
packageVersion: "19.0.1",
|
|
65
65
|
analyticsData: analyticsContext,
|
|
66
66
|
actionSubject: 'button'
|
|
67
67
|
});
|
|
@@ -105,7 +105,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
105
105
|
action: 'clicked',
|
|
106
106
|
componentName: componentName || 'Anchor',
|
|
107
107
|
packageName: "@atlaskit/primitives",
|
|
108
|
-
packageVersion: "19.0.
|
|
108
|
+
packageVersion: "19.0.1",
|
|
109
109
|
analyticsData: analyticsContext,
|
|
110
110
|
actionSubject: 'link'
|
|
111
111
|
});
|
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
|
-
var
|
|
12
|
+
var _surfaceContext = require("../utils/surface-context");
|
|
13
13
|
var _styleMaps = require("../xcss/style-maps.partial");
|
|
14
14
|
var _xcss = require("../xcss/xcss");
|
|
15
15
|
var _excluded = ["as", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "style", "testId", "xcss"],
|
|
@@ -87,13 +87,15 @@ var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
87
87
|
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd], resolvedStyles.emotion],
|
|
88
88
|
"data-testid": testId
|
|
89
89
|
}), children);
|
|
90
|
-
return backgroundColor ? (0, _react2.jsx)(
|
|
90
|
+
return backgroundColor ? (0, _react2.jsx)(_surfaceContext.SurfaceContext.Provider, {
|
|
91
91
|
value: backgroundColor
|
|
92
92
|
}, node) : node;
|
|
93
93
|
}
|
|
94
94
|
// @ts-ignore This typescript error has been surpessed while locally enrolling `@atlaskit/primitives` into Jira
|
|
95
95
|
// The return type of `BoxComponent` does not match the return type of `forwardRef` in React 18
|
|
96
96
|
);
|
|
97
|
+
|
|
98
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
97
99
|
var _default = exports.default = Box;
|
|
98
100
|
var baseStyles = (0, _react2.css)({
|
|
99
101
|
boxSizing: 'border-box',
|
|
@@ -97,7 +97,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
97
97
|
action: 'clicked',
|
|
98
98
|
componentName: componentName || 'Pressable',
|
|
99
99
|
packageName: "@atlaskit/primitives",
|
|
100
|
-
packageVersion: "19.0.
|
|
100
|
+
packageVersion: "19.0.1",
|
|
101
101
|
analyticsData: analyticsContext,
|
|
102
102
|
actionSubject: 'button'
|
|
103
103
|
});
|
|
@@ -1,76 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* A map to build optional `display:none` for consumption on a div.
|
|
22
|
-
* ```ts
|
|
23
|
-
* const hideMediaQueries = buildAboveMediaQueryCSS({ display: 'none' });
|
|
24
|
-
*
|
|
25
|
-
* const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
|
|
26
|
-
* return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* This roughly builds a map that will look roughly like this (if done manually):
|
|
31
|
-
* ```ts
|
|
32
|
-
* {
|
|
33
|
-
* xxs: css({ '@media all': { display: 'none' } }),
|
|
34
|
-
* xs: css({ '@media (min-width: 30rem)': { display: 'none' } }),
|
|
35
|
-
* sm: css({ '@media (min-width: 48rem)': { display: 'none' } }),
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
var UNSAFE_buildAboveMediaQueryCSS = exports.UNSAFE_buildAboveMediaQueryCSS = function UNSAFE_buildAboveMediaQueryCSS(input) {
|
|
40
|
-
return _constants.UNSAFE_BREAKPOINTS_ORDERED_LIST.reduce(function (acc, breakpoint) {
|
|
41
|
-
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, breakpoint, (0, _react.css)((0, _defineProperty2.default)({}, _mediaHelper.media.above[breakpoint], typeof input === 'function' ? input(breakpoint) : input))));
|
|
42
|
-
}, {});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Build a map of breakpoints to css with media queries and nested styles.
|
|
47
|
-
*
|
|
48
|
-
* @internal Not intended to be used outside of DST at this stage.
|
|
49
|
-
* @experimental Not intended to be used outside of DST at this stage.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* A map to build optional `display:none` for consumption on a div.
|
|
53
|
-
* ```ts
|
|
54
|
-
* const hideMediaQueries = buildBelowMediaQueryCSS({ display: 'none' });
|
|
55
|
-
*
|
|
56
|
-
* const Component = ({ hideAtBreakpoints: ('xs' | 'sm')[], children: ReactNode }) => {
|
|
57
|
-
* return <div css={hideAtBreakpoints.map(b => hideMediaQueries[b])}>{children}</div>;
|
|
58
|
-
* }
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* This roughly builds a map that will look roughly like this (if done manually):
|
|
62
|
-
* ```ts
|
|
63
|
-
* {
|
|
64
|
-
* xs: css({ '@media not all and (min-width: 30rem)': { display: 'none' } }),
|
|
65
|
-
* sm: css({ '@media not all and (min-width: 48rem)': { display: 'none' } }),
|
|
66
|
-
* }
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
var UNSAFE_buildBelowMediaQueryCSS = exports.UNSAFE_buildBelowMediaQueryCSS = function UNSAFE_buildBelowMediaQueryCSS(input) {
|
|
70
|
-
return _constants.UNSAFE_BREAKPOINTS_ORDERED_LIST.reduce(function (acc, breakpoint) {
|
|
71
|
-
if (breakpoint === 'xxs') {
|
|
72
|
-
return acc;
|
|
73
|
-
}
|
|
74
|
-
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, breakpoint, (0, _react.css)((0, _defineProperty2.default)({}, _mediaHelper.UNSAFE_media.below[breakpoint], typeof input === 'function' ? input(breakpoint) : input))));
|
|
75
|
-
}, {});
|
|
76
|
-
};
|
|
6
|
+
Object.defineProperty(exports, "UNSAFE_buildAboveMediaQueryCSS", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _unsafeBuildAboveMediaQueryCss.UNSAFE_buildAboveMediaQueryCSS;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "UNSAFE_buildBelowMediaQueryCSS", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _unsafeBuildBelowMediaQueryCss.UNSAFE_buildBelowMediaQueryCSS;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _unsafeBuildAboveMediaQueryCss = require("./unsafe-build-above-media-query-css");
|
|
19
|
+
var _unsafeBuildBelowMediaQueryCss = require("./unsafe-build-below-media-query-css");
|
|
@@ -65,6 +65,7 @@ var UNSAFE_BREAKPOINTS_CONFIG = exports.UNSAFE_BREAKPOINTS_CONFIG = {
|
|
|
65
65
|
*
|
|
66
66
|
* @experimental Unsafe for consumption outside of the design system itself.
|
|
67
67
|
*/
|
|
68
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
68
69
|
var UNSAFE_BREAKPOINTS_ORDERED_LIST = exports.UNSAFE_BREAKPOINTS_ORDERED_LIST = Object.keys(UNSAFE_BREAKPOINTS_CONFIG);
|
|
69
70
|
|
|
70
71
|
/**
|
|
@@ -72,4 +73,5 @@ var UNSAFE_BREAKPOINTS_ORDERED_LIST = exports.UNSAFE_BREAKPOINTS_ORDERED_LIST =
|
|
|
72
73
|
* 1. It is the default value for shorthands, eg. `<GridItem span={6} />` maps to `{ [SMALLEST_BREAKPOINT]: props.span }`
|
|
73
74
|
* 2. It's omitted in `media.below` as there's nothing below `0px`.
|
|
74
75
|
*/
|
|
76
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
75
77
|
var SMALLEST_BREAKPOINT = exports.SMALLEST_BREAKPOINT = UNSAFE_BREAKPOINTS_ORDERED_LIST[0];
|
|
@@ -8,7 +8,8 @@ exports.Hide = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _xcss = require("../xcss/xcss");
|
|
11
|
-
var
|
|
11
|
+
var _unsafeBuildAboveMediaQueryCss = require("./unsafe-build-above-media-query-css");
|
|
12
|
+
var _unsafeBuildBelowMediaQueryCss = require("./unsafe-build-below-media-query-css");
|
|
12
13
|
/**
|
|
13
14
|
* @jsxRuntime classic
|
|
14
15
|
* @jsx jsx
|
|
@@ -16,10 +17,10 @@ var _buildMediaQueryCss = require("./build-media-query-css");
|
|
|
16
17
|
|
|
17
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
18
19
|
|
|
19
|
-
var hideAboveQueries = (0,
|
|
20
|
+
var hideAboveQueries = (0, _unsafeBuildAboveMediaQueryCss.UNSAFE_buildAboveMediaQueryCSS)({
|
|
20
21
|
display: 'none'
|
|
21
22
|
});
|
|
22
|
-
var hideBelowQueries = (0,
|
|
23
|
+
var hideBelowQueries = (0, _unsafeBuildBelowMediaQueryCss.UNSAFE_buildBelowMediaQueryCSS)({
|
|
23
24
|
display: 'none'
|
|
24
25
|
});
|
|
25
26
|
/**
|
|
@@ -3,44 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* This means that you should avoid multiple breakpoints taking effect at the same time,
|
|
12
|
-
* eg. ```{ [media.above.xs]: { color: 'red' }, [media.above.sm]: { color: 'green' }}```.
|
|
13
|
-
* Instead, make sure that only one breakpoint can take effect at a time,
|
|
14
|
-
* e.g, ```{ [media.only.xs]: { color: 'red' }, [media.above.sm]: { color: 'green' }}```.
|
|
15
|
-
* For more details, please see <https://compiledcssinjs.com/docs/atomic-css#selector-specificity>.
|
|
16
|
-
*/
|
|
17
|
-
var media = exports.media = {
|
|
18
|
-
above: {
|
|
19
|
-
xxs: '@media all',
|
|
20
|
-
xs: '@media (min-width: 30rem)',
|
|
21
|
-
sm: '@media (min-width: 48rem)',
|
|
22
|
-
md: '@media (min-width: 64rem)',
|
|
23
|
-
lg: '@media (min-width: 90rem)',
|
|
24
|
-
xl: '@media (min-width: 110.5rem)'
|
|
25
|
-
},
|
|
26
|
-
only: {
|
|
27
|
-
xxs: '@media (min-width: 0rem) and (max-width: 29.99rem)',
|
|
28
|
-
xs: '@media (min-width: 30rem) and (max-width: 47.99rem)',
|
|
29
|
-
sm: '@media (min-width: 48rem) and (max-width: 63.99rem)',
|
|
30
|
-
md: '@media (min-width: 64rem) and (max-width: 89.99rem)',
|
|
31
|
-
lg: '@media (min-width: 90rem) and (max-width: 110.49rem)',
|
|
32
|
-
xl: '@media (min-width: 110.5rem)'
|
|
33
|
-
},
|
|
34
|
-
below: {
|
|
35
|
-
xs: '@media not all and (min-width: 30rem)',
|
|
36
|
-
sm: '@media not all and (min-width: 48rem)',
|
|
37
|
-
md: '@media not all and (min-width: 64rem)',
|
|
38
|
-
lg: '@media not all and (min-width: 90rem)',
|
|
39
|
-
xl: '@media not all and (min-width: 110.5rem)'
|
|
6
|
+
exports.UNSAFE_media = void 0;
|
|
7
|
+
Object.defineProperty(exports, "media", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _media.media;
|
|
40
11
|
}
|
|
41
|
-
};
|
|
42
|
-
|
|
12
|
+
});
|
|
13
|
+
var _media = require("./media");
|
|
43
14
|
/**
|
|
44
15
|
* Keep `UNSAFE_media` for backwards compatibility.
|
|
45
16
|
*/
|
|
46
|
-
var UNSAFE_media = exports.UNSAFE_media = media;
|
|
17
|
+
var UNSAFE_media = exports.UNSAFE_media = _media.media;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.media = void 0;
|
|
7
|
+
var media = exports.media = {
|
|
8
|
+
above: {
|
|
9
|
+
xxs: '@media all',
|
|
10
|
+
xs: '@media (min-width: 30rem)',
|
|
11
|
+
sm: '@media (min-width: 48rem)',
|
|
12
|
+
md: '@media (min-width: 64rem)',
|
|
13
|
+
lg: '@media (min-width: 90rem)',
|
|
14
|
+
xl: '@media (min-width: 110.5rem)'
|
|
15
|
+
},
|
|
16
|
+
only: {
|
|
17
|
+
xxs: '@media (min-width: 0rem) and (max-width: 29.99rem)',
|
|
18
|
+
xs: '@media (min-width: 30rem) and (max-width: 47.99rem)',
|
|
19
|
+
sm: '@media (min-width: 48rem) and (max-width: 63.99rem)',
|
|
20
|
+
md: '@media (min-width: 64rem) and (max-width: 89.99rem)',
|
|
21
|
+
lg: '@media (min-width: 90rem) and (max-width: 110.49rem)',
|
|
22
|
+
xl: '@media (min-width: 110.5rem)'
|
|
23
|
+
},
|
|
24
|
+
below: {
|
|
25
|
+
xs: '@media not all and (min-width: 30rem)',
|
|
26
|
+
sm: '@media not all and (min-width: 48rem)',
|
|
27
|
+
md: '@media not all and (min-width: 64rem)',
|
|
28
|
+
lg: '@media not all and (min-width: 90rem)',
|
|
29
|
+
xl: '@media not all and (min-width: 110.5rem)'
|
|
30
|
+
}
|
|
31
|
+
};
|