@atlaskit/primitives 1.1.0 → 1.2.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 +13 -0
- package/constellation/box/examples.mdx +2 -2
- package/constellation/inline/usage.mdx +1 -0
- package/constellation/overview/index.mdx +1 -1
- package/constellation/responsive/usage.mdx +0 -7
- package/constellation/xcss/examples.mdx +8 -1
- package/dist/cjs/xcss/style-maps.partial.js +4 -2
- package/dist/es2019/xcss/style-maps.partial.js +4 -2
- package/dist/esm/xcss/style-maps.partial.js +4 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/xcss/style-maps.partial.d.ts +3 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +3 -1
- package/package.json +4 -1
- package/report.api.md +3 -1
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +2 -0
- package/scripts/color-codegen-template.tsx +2 -1
- package/tmp/api-report-tmp.d.ts +3 -1
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9a88d718e48`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a88d718e48) - This package is now onboarded onto the product push model.
|
|
8
|
+
|
|
9
|
+
## 1.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`37e0d67942b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/37e0d67942b) - - Add missing `xcss` type export for `TextColor`
|
|
14
|
+
- Fixes a bug where the `xcss` function did not accept `color.link` or `color.link.pressed` token values for text color
|
|
15
|
+
|
|
3
16
|
## 1.1.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -21,7 +21,7 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
|
21
21
|
## Basic
|
|
22
22
|
|
|
23
23
|
Box is a general-purpose container that allows for controlled use of design tokens. Use the given props to configure display behaviour and styling that aligns with the Atlassian Design System.
|
|
24
|
-
[To learn more about styling primitive components visit our xcss documentation.](/components/primitives/xcss/usage)
|
|
24
|
+
[To learn more about styling primitive components visit our `xcss` documentation.](/components/primitives/xcss/usage)
|
|
25
25
|
|
|
26
26
|
<Example Component={BoxBasic} packageName="@atlaskit/primitives/box" />
|
|
27
27
|
|
|
@@ -41,7 +41,7 @@ The nomenclature used by these props follows [logical properties](https://develo
|
|
|
41
41
|
|
|
42
42
|
## xcss
|
|
43
43
|
|
|
44
|
-
Box exposes an `xcss` prop. This prop accepts `xcss` function calls that contain a subset of permitted styles. When used with `Box`, xcss accepts most CSS properties, and when a token exists, the rule accepts that token as a value.
|
|
44
|
+
Box exposes an `xcss` prop. This prop accepts `xcss` function calls that contain a subset of permitted styles. When used with `Box`, `xcss` accepts most CSS properties, and when a token exists, the rule accepts that token as a value.
|
|
45
45
|
For more information on xcss, see the dedicated [xcss documentation](/components/primitives/xcss).
|
|
46
46
|
|
|
47
47
|
<Example Component={BoxXcss} packageName="@atlaskit/primitives/box" />
|
|
@@ -32,6 +32,7 @@ The various Inline props can then be used to customize the spacing and styling o
|
|
|
32
32
|
- `rowSpace`
|
|
33
33
|
- `separator`
|
|
34
34
|
|
|
35
|
+
## Related
|
|
35
36
|
- [Learn more about the Primitives](/components/primitives/overview)
|
|
36
37
|
- [Learn more about the Box primitive](/components/primitives/box/usage)
|
|
37
38
|
- [Learn more about the Stack primitive](/components/primitives/stack/usage)
|
|
@@ -76,4 +76,4 @@ The ESLint rule <a href="/components/eslint-plugin-design-system/usage#use-primi
|
|
|
76
76
|
- [Learn more about the Stack primitive](/components/primitives/stack/usage)
|
|
77
77
|
- [Learn more about the Grid primitive](/components/primitives/grid/examples)
|
|
78
78
|
- [Learn more about the Bleed primitive](/components/primitives/bleed/examples)
|
|
79
|
-
- [Learn more about the
|
|
79
|
+
- [Learn more about the Flex primitive](/components/primitives/flex/examples)
|
|
@@ -41,10 +41,3 @@ const customStyles = css({
|
|
|
41
41
|
[media.above.xl]: { marginBlock: token('space.150') },
|
|
42
42
|
});
|
|
43
43
|
```
|
|
44
|
-
|
|
45
|
-
### `media.below` usage
|
|
46
|
-
|
|
47
|
-
This is intentionally excluded at the moment as we're shipping our opinion that teams should design mobile-first.
|
|
48
|
-
We understand this will not scale and we're open to change, but we'd like to change this with feedback.
|
|
49
|
-
|
|
50
|
-
If we do add it back, we'd suggest codebases prefer a single approach (eg. `above` or `below`) and use that consistently. Mixing them results in confusion (though they can be safely used together and can result in better CSS performance when done correctly).
|
|
@@ -7,6 +7,7 @@ order: 1
|
|
|
7
7
|
import xcssBasic from '../../examples/constellation/xcss/basic';
|
|
8
8
|
import xcssInteractive from '../../examples/constellation/xcss/interactivity';
|
|
9
9
|
import xcssResponsive from '../../examples/constellation/xcss/responsiveness';
|
|
10
|
+
import xcssConditional from '../../examples/constellation/xcss/conditional-styles';
|
|
10
11
|
|
|
11
12
|
import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
12
13
|
|
|
@@ -31,6 +32,12 @@ To enable interactivity, use familiar selectors like `:hover` and `:focus-visibl
|
|
|
31
32
|
|
|
32
33
|
## Responsiveness
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
`xcss` also accepts a subset of media queries at [predefined breakpoints](/components/primitives/responsive/breakpoints/examples).
|
|
35
36
|
|
|
36
37
|
<Example Component={xcssResponsive} packageName="@atlaskit/primitives/xcss" />
|
|
38
|
+
|
|
39
|
+
## Conditional styles
|
|
40
|
+
|
|
41
|
+
To achieve conditional styles, it is usually simpler to apply conditional behavior at the `xcss` object level, rather than applying conditional behavior to individual properties.
|
|
42
|
+
|
|
43
|
+
<Example Component={xcssConditional} packageName="@atlaskit/primitives/xcss" />
|
|
@@ -60,7 +60,7 @@ exports.spaceMap = spaceMap;
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
63
|
-
* @codegen <<SignedSource::
|
|
63
|
+
* @codegen <<SignedSource::0de38f66a11617229ed4985ae2051e3e>>
|
|
64
64
|
* @codegenId colors
|
|
65
65
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
66
66
|
* @codegenParams ["border", "background", "shadow", "text", "fill"]
|
|
@@ -250,7 +250,9 @@ var textColorMap = {
|
|
|
250
250
|
'color.text.discovery': "var(--ds-text-discovery, #403294)",
|
|
251
251
|
'color.text.information': "var(--ds-text-information, #0052CC)",
|
|
252
252
|
'color.text.subtlest': "var(--ds-text-subtlest, #7A869A)",
|
|
253
|
-
'color.text.subtle': "var(--ds-text-subtle, #42526E)"
|
|
253
|
+
'color.text.subtle': "var(--ds-text-subtle, #42526E)",
|
|
254
|
+
'color.link': "var(--ds-link, #0052CC)",
|
|
255
|
+
'color.link.pressed': "var(--ds-link-pressed, #0747A6)"
|
|
254
256
|
};
|
|
255
257
|
exports.textColorMap = textColorMap;
|
|
256
258
|
var fillMap = {
|
|
@@ -48,7 +48,7 @@ export const spaceMap = {
|
|
|
48
48
|
*/
|
|
49
49
|
/**
|
|
50
50
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
51
|
-
* @codegen <<SignedSource::
|
|
51
|
+
* @codegen <<SignedSource::0de38f66a11617229ed4985ae2051e3e>>
|
|
52
52
|
* @codegenId colors
|
|
53
53
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
54
54
|
* @codegenParams ["border", "background", "shadow", "text", "fill"]
|
|
@@ -235,7 +235,9 @@ export const textColorMap = {
|
|
|
235
235
|
'color.text.discovery': "var(--ds-text-discovery, #403294)",
|
|
236
236
|
'color.text.information': "var(--ds-text-information, #0052CC)",
|
|
237
237
|
'color.text.subtlest': "var(--ds-text-subtlest, #7A869A)",
|
|
238
|
-
'color.text.subtle': "var(--ds-text-subtle, #42526E)"
|
|
238
|
+
'color.text.subtle': "var(--ds-text-subtle, #42526E)",
|
|
239
|
+
'color.link': "var(--ds-link, #0052CC)",
|
|
240
|
+
'color.link.pressed': "var(--ds-link-pressed, #0747A6)"
|
|
239
241
|
};
|
|
240
242
|
export const fillMap = {
|
|
241
243
|
'color.icon': "var(--ds-icon, #505F79)",
|
|
@@ -49,7 +49,7 @@ export var spaceMap = {
|
|
|
49
49
|
*/
|
|
50
50
|
/**
|
|
51
51
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
52
|
-
* @codegen <<SignedSource::
|
|
52
|
+
* @codegen <<SignedSource::0de38f66a11617229ed4985ae2051e3e>>
|
|
53
53
|
* @codegenId colors
|
|
54
54
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
55
55
|
* @codegenParams ["border", "background", "shadow", "text", "fill"]
|
|
@@ -236,7 +236,9 @@ export var textColorMap = {
|
|
|
236
236
|
'color.text.discovery': "var(--ds-text-discovery, #403294)",
|
|
237
237
|
'color.text.information': "var(--ds-text-information, #0052CC)",
|
|
238
238
|
'color.text.subtlest': "var(--ds-text-subtlest, #7A869A)",
|
|
239
|
-
'color.text.subtle': "var(--ds-text-subtle, #42526E)"
|
|
239
|
+
'color.text.subtle': "var(--ds-text-subtle, #42526E)",
|
|
240
|
+
'color.link': "var(--ds-link, #0052CC)",
|
|
241
|
+
'color.link.pressed': "var(--ds-link-pressed, #0747A6)"
|
|
240
242
|
};
|
|
241
243
|
export var fillMap = {
|
|
242
244
|
'color.icon': "var(--ds-icon, #505F79)",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Dimension, BackgroundColor, Space, BorderColor, BorderRadius, BorderWidth, Layer, Shadow, } from './xcss/style-maps.partial';
|
|
1
|
+
export type { Dimension, BackgroundColor, Space, BorderColor, BorderRadius, BorderWidth, Layer, TextColor, Shadow, } from './xcss/style-maps.partial';
|
|
2
2
|
export { default as Box } from './components/box';
|
|
3
3
|
export type { BoxProps } from './components/box';
|
|
4
4
|
export { default as Inline } from './components/inline';
|
|
@@ -50,7 +50,7 @@ export type Space = keyof typeof spaceMap;
|
|
|
50
50
|
*/
|
|
51
51
|
/**
|
|
52
52
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
53
|
-
* @codegen <<SignedSource::
|
|
53
|
+
* @codegen <<SignedSource::0de38f66a11617229ed4985ae2051e3e>>
|
|
54
54
|
* @codegenId colors
|
|
55
55
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
56
56
|
* @codegenParams ["border", "background", "shadow", "text", "fill"]
|
|
@@ -241,6 +241,8 @@ export declare const textColorMap: {
|
|
|
241
241
|
readonly 'color.text.information': "var(--ds-text-information)";
|
|
242
242
|
readonly 'color.text.subtlest': "var(--ds-text-subtlest)";
|
|
243
243
|
readonly 'color.text.subtle': "var(--ds-text-subtle)";
|
|
244
|
+
readonly 'color.link': "var(--ds-link)";
|
|
245
|
+
readonly 'color.link.pressed': "var(--ds-link-pressed)";
|
|
244
246
|
};
|
|
245
247
|
export type TextColor = keyof typeof textColorMap;
|
|
246
248
|
export declare const fillMap: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Dimension, BackgroundColor, Space, BorderColor, BorderRadius, BorderWidth, Layer, Shadow, } from './xcss/style-maps.partial';
|
|
1
|
+
export type { Dimension, BackgroundColor, Space, BorderColor, BorderRadius, BorderWidth, Layer, TextColor, Shadow, } from './xcss/style-maps.partial';
|
|
2
2
|
export { default as Box } from './components/box';
|
|
3
3
|
export type { BoxProps } from './components/box';
|
|
4
4
|
export { default as Inline } from './components/inline';
|
|
@@ -50,7 +50,7 @@ export type Space = keyof typeof spaceMap;
|
|
|
50
50
|
*/
|
|
51
51
|
/**
|
|
52
52
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
53
|
-
* @codegen <<SignedSource::
|
|
53
|
+
* @codegen <<SignedSource::0de38f66a11617229ed4985ae2051e3e>>
|
|
54
54
|
* @codegenId colors
|
|
55
55
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
56
56
|
* @codegenParams ["border", "background", "shadow", "text", "fill"]
|
|
@@ -241,6 +241,8 @@ export declare const textColorMap: {
|
|
|
241
241
|
readonly 'color.text.information': "var(--ds-text-information)";
|
|
242
242
|
readonly 'color.text.subtlest': "var(--ds-text-subtlest)";
|
|
243
243
|
readonly 'color.text.subtle': "var(--ds-text-subtle)";
|
|
244
|
+
readonly 'color.link': "var(--ds-link)";
|
|
245
|
+
readonly 'color.link.pressed': "var(--ds-link-pressed)";
|
|
244
246
|
};
|
|
245
247
|
export type TextColor = keyof typeof textColorMap;
|
|
246
248
|
export declare const fillMap: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
|
+
"productPushConsumption": [
|
|
20
|
+
"jira"
|
|
21
|
+
],
|
|
19
22
|
"inPublicMirror": false,
|
|
20
23
|
"releaseModel": "continuous",
|
|
21
24
|
"website": {
|
package/report.api.md
CHANGED
|
@@ -887,7 +887,7 @@ export type StackProps<T extends ElementType = 'div'> = {
|
|
|
887
887
|
} & BasePrimitiveProps;
|
|
888
888
|
|
|
889
889
|
// @public (undocumented)
|
|
890
|
-
type TextColor = keyof typeof textColorMap;
|
|
890
|
+
export type TextColor = keyof typeof textColorMap;
|
|
891
891
|
|
|
892
892
|
// @public (undocumented)
|
|
893
893
|
const textColorMap: {
|
|
@@ -924,6 +924,8 @@ const textColorMap: {
|
|
|
924
924
|
readonly 'color.text.information': 'var(--ds-text-information)';
|
|
925
925
|
readonly 'color.text.subtlest': 'var(--ds-text-subtlest)';
|
|
926
926
|
readonly 'color.text.subtle': 'var(--ds-text-subtle)';
|
|
927
|
+
readonly 'color.link': 'var(--ds-link)';
|
|
928
|
+
readonly 'color.link.pressed': 'var(--ds-link-pressed)';
|
|
927
929
|
};
|
|
928
930
|
|
|
929
931
|
// @public (undocumented)
|
|
@@ -512,6 +512,8 @@ exports[`@atlaskit/primitives text styles are generated correctly 1`] = `
|
|
|
512
512
|
'color.text.information': token('color.text.information', '#0052CC'),
|
|
513
513
|
'color.text.subtlest': token('color.text.subtlest', '#7A869A'),
|
|
514
514
|
'color.text.subtle': token('color.text.subtle', '#42526E'),
|
|
515
|
+
'color.link': token('color.link', '#0052CC'),
|
|
516
|
+
'color.link.pressed': token('color.link.pressed', '#0747A6'),
|
|
515
517
|
} as const;
|
|
516
518
|
|
|
517
519
|
export type TextColor = keyof typeof textColorMap;
|
|
@@ -25,7 +25,8 @@ const tokenStyles = {
|
|
|
25
25
|
prefix: 'color.text.',
|
|
26
26
|
cssProperty: 'color',
|
|
27
27
|
filterFn: <T extends Token>(t: T) =>
|
|
28
|
-
t.token.startsWith(tokenStyles.text.prefix)
|
|
28
|
+
t.token.startsWith(tokenStyles.text.prefix) ||
|
|
29
|
+
t.token.startsWith('color.link'),
|
|
29
30
|
},
|
|
30
31
|
background: {
|
|
31
32
|
objectName: 'backgroundColor',
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -599,7 +599,7 @@ export type StackProps<T extends ElementType = 'div'> = {
|
|
|
599
599
|
} & BasePrimitiveProps;
|
|
600
600
|
|
|
601
601
|
// @public (undocumented)
|
|
602
|
-
type TextColor = keyof typeof textColorMap;
|
|
602
|
+
export type TextColor = keyof typeof textColorMap;
|
|
603
603
|
|
|
604
604
|
// @public (undocumented)
|
|
605
605
|
const textColorMap: {
|
|
@@ -636,6 +636,8 @@ const textColorMap: {
|
|
|
636
636
|
readonly 'color.text.information': "var(--ds-text-information)";
|
|
637
637
|
readonly 'color.text.subtlest': "var(--ds-text-subtlest)";
|
|
638
638
|
readonly 'color.text.subtle': "var(--ds-text-subtle)";
|
|
639
|
+
readonly 'color.link': "var(--ds-link)";
|
|
640
|
+
readonly 'color.link.pressed': "var(--ds-link-pressed)";
|
|
639
641
|
};
|
|
640
642
|
|
|
641
643
|
// @public (undocumented)
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED