@atlaskit/primitives 16.4.0 → 16.4.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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 16.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0d73beb2f9401`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d73beb2f9401) -
|
|
8
|
+
Added `fontVariantNumeric` as an allowed property to Text's `xcss` prop to allow for tabular
|
|
9
|
+
numbers and slashed zeros. This is only available to the Compiled version of the Text component.
|
|
10
|
+
|
|
3
11
|
## 16.4.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -14,7 +14,7 @@ import TextSpacing from '../../examples/constellation/text/text-spacing';
|
|
|
14
14
|
import TextTruncation from '../../examples/constellation/text/text-truncation';
|
|
15
15
|
import TextCustomization from '../../examples/constellation/text/text-customization';
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Size
|
|
18
18
|
|
|
19
19
|
Use a Text component for main content. Text typically appears after headings or subheadings as
|
|
20
20
|
detailed descriptions and messages, but also as standalone text in components.
|
|
@@ -94,4 +94,11 @@ If truncation cannot be avoided, for example when displaying user-generated cont
|
|
|
94
94
|
A restricted set of styles can be customized using the `xcss` prop, using
|
|
95
95
|
[cssMap](/components/css/overview#cssmap).
|
|
96
96
|
|
|
97
|
+
The allowed customizations are:
|
|
98
|
+
|
|
99
|
+
- font modifications via `fontVariantNumeric: 'tabular-nums'` and
|
|
100
|
+
`fontVariantNumeric: 'slashed-zero'`
|
|
101
|
+
- strikethrough via `textDecorationLine`
|
|
102
|
+
- line breaks via `overflowWrap`
|
|
103
|
+
|
|
97
104
|
<Example Component={TextCustomization} packageName="@atlaskit/primitives" />
|
|
@@ -47,7 +47,7 @@ type TextPropsBase<T extends ElementType = 'span'> = {
|
|
|
47
47
|
/**
|
|
48
48
|
* Bounded style overrides.
|
|
49
49
|
*/
|
|
50
|
-
xcss?: StrictXCSSProp<'overflowWrap' | 'textDecorationLine', never>;
|
|
50
|
+
xcss?: StrictXCSSProp<'overflowWrap' | 'textDecorationLine' | 'fontVariantNumeric', never>;
|
|
51
51
|
/**
|
|
52
52
|
* Forwarded ref.
|
|
53
53
|
*/
|
|
@@ -52,7 +52,7 @@ type TextPropsBase<T extends ElementType = 'span'> = {
|
|
|
52
52
|
/**
|
|
53
53
|
* Bounded style overrides.
|
|
54
54
|
*/
|
|
55
|
-
xcss?: StrictXCSSProp<'overflowWrap' | 'textDecorationLine', never>;
|
|
55
|
+
xcss?: StrictXCSSProp<'overflowWrap' | 'textDecorationLine' | 'fontVariantNumeric', never>;
|
|
56
56
|
/**
|
|
57
57
|
* Forwarded ref.
|
|
58
58
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "16.4.
|
|
3
|
+
"version": "16.4.1",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -137,8 +137,7 @@
|
|
|
137
137
|
"@atlaskit/css": "^0.17.0",
|
|
138
138
|
"@atlaskit/ds-lib": "^5.3.0",
|
|
139
139
|
"@atlaskit/interaction-context": "^3.1.0",
|
|
140
|
-
"@atlaskit/
|
|
141
|
-
"@atlaskit/tokens": "^8.3.0",
|
|
140
|
+
"@atlaskit/tokens": "^8.4.0",
|
|
142
141
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
143
142
|
"@babel/runtime": "^7.0.0",
|
|
144
143
|
"@compiled/react": "^0.18.6",
|
|
@@ -178,7 +177,6 @@
|
|
|
178
177
|
"@atlaskit/tooltip": "^20.10.0",
|
|
179
178
|
"@atlassian/analytics-bridge": "^0.7.0",
|
|
180
179
|
"@atlassian/codegen": "^0.1.0",
|
|
181
|
-
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
182
180
|
"@atlassian/ssr-tests": "workspace:^",
|
|
183
181
|
"@testing-library/react": "^13.4.0",
|
|
184
182
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -32,19 +32,19 @@ const templateFiles = readdirSync(join(__dirname, 'codegen-file-templates'), {
|
|
|
32
32
|
// Output paths for partial codegen
|
|
33
33
|
const primitivesOutputs = [
|
|
34
34
|
join(__dirname, '../src/xcss/style-maps.partial.tsx'),
|
|
35
|
-
join(
|
|
36
|
-
__dirname,
|
|
37
|
-
'../../css/codemods/0.5.2-primitives-emotion-to-compiled/style-maps.partial.tsx',
|
|
38
|
-
),
|
|
35
|
+
join(__dirname, '../../css/codemods/0.5.2-primitives-emotion-to-compiled/style-maps.partial.tsx'),
|
|
39
36
|
];
|
|
40
37
|
|
|
41
|
-
const forgeOutputPath = join(
|
|
38
|
+
const forgeOutputPath = join(
|
|
39
|
+
__dirname,
|
|
40
|
+
'../../../forge/forge-ui/src/components/UIKit/tokens.partial.tsx',
|
|
41
|
+
);
|
|
42
42
|
|
|
43
43
|
// Generate partial sections for @atlaskit/primitives style-maps
|
|
44
44
|
const primitivesSourceFns = [
|
|
45
45
|
// width, height, minWidth, maxWidth, minHeight, maxHeight
|
|
46
|
-
...primitivesOutputs.map(
|
|
47
|
-
() =>
|
|
46
|
+
...primitivesOutputs.map(
|
|
47
|
+
(outputPath) => () =>
|
|
48
48
|
createPartialSignedArtifact(
|
|
49
49
|
(options) => options.map(createStylesFromFileTemplate).join('\n'),
|
|
50
50
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -56,8 +56,8 @@ const primitivesSourceFns = [
|
|
|
56
56
|
),
|
|
57
57
|
),
|
|
58
58
|
// padding*, gap*, inset*
|
|
59
|
-
...primitivesOutputs.map(
|
|
60
|
-
() =>
|
|
59
|
+
...primitivesOutputs.map(
|
|
60
|
+
(outputPath) => () =>
|
|
61
61
|
createPartialSignedArtifact(
|
|
62
62
|
createSpacingStylesFromTemplate,
|
|
63
63
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -69,8 +69,8 @@ const primitivesSourceFns = [
|
|
|
69
69
|
),
|
|
70
70
|
),
|
|
71
71
|
// text color, background-color, border-color
|
|
72
|
-
...primitivesOutputs.map(
|
|
73
|
-
() =>
|
|
72
|
+
...primitivesOutputs.map(
|
|
73
|
+
(outputPath) => () =>
|
|
74
74
|
createPartialSignedArtifact(
|
|
75
75
|
(options) => options.map(createColorStylesFromTemplate).join('\n'),
|
|
76
76
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -82,8 +82,8 @@ const primitivesSourceFns = [
|
|
|
82
82
|
),
|
|
83
83
|
),
|
|
84
84
|
// inverse color map
|
|
85
|
-
...primitivesOutputs.map(
|
|
86
|
-
() =>
|
|
85
|
+
...primitivesOutputs.map(
|
|
86
|
+
(outputPath) => () =>
|
|
87
87
|
createPartialSignedArtifact(
|
|
88
88
|
createInverseColorMapTemplate,
|
|
89
89
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -95,8 +95,8 @@ const primitivesSourceFns = [
|
|
|
95
95
|
),
|
|
96
96
|
),
|
|
97
97
|
// elevation (opacity, shadow, surface)
|
|
98
|
-
...primitivesOutputs.map(
|
|
99
|
-
() =>
|
|
98
|
+
...primitivesOutputs.map(
|
|
99
|
+
(outputPath) => () =>
|
|
100
100
|
createPartialSignedArtifact(
|
|
101
101
|
(options) => options.map(createElevationStylesFromTemplate).join('\n'),
|
|
102
102
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -108,8 +108,8 @@ const primitivesSourceFns = [
|
|
|
108
108
|
),
|
|
109
109
|
),
|
|
110
110
|
// border-width, border-radius
|
|
111
|
-
...primitivesOutputs.map(
|
|
112
|
-
() =>
|
|
111
|
+
...primitivesOutputs.map(
|
|
112
|
+
(outputPath) => () =>
|
|
113
113
|
createPartialSignedArtifact(
|
|
114
114
|
(options) => options.map(createShapeStylesFromTemplate).join('\n'),
|
|
115
115
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -121,8 +121,8 @@ const primitivesSourceFns = [
|
|
|
121
121
|
),
|
|
122
122
|
),
|
|
123
123
|
// border-color, border-radius, border-width, layer
|
|
124
|
-
...primitivesOutputs.map(
|
|
125
|
-
() =>
|
|
124
|
+
...primitivesOutputs.map(
|
|
125
|
+
(outputPath) => () =>
|
|
126
126
|
createPartialSignedArtifact(
|
|
127
127
|
(options) => options.map(createStylesFromFileTemplate).join('\n'),
|
|
128
128
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -134,8 +134,8 @@ const primitivesSourceFns = [
|
|
|
134
134
|
),
|
|
135
135
|
),
|
|
136
136
|
// font*, lineheight
|
|
137
|
-
...primitivesOutputs.map(
|
|
138
|
-
() =>
|
|
137
|
+
...primitivesOutputs.map(
|
|
138
|
+
(outputPath) => () =>
|
|
139
139
|
createPartialSignedArtifact(
|
|
140
140
|
createTypographyStylesFromTemplate,
|
|
141
141
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -147,8 +147,8 @@ const primitivesSourceFns = [
|
|
|
147
147
|
),
|
|
148
148
|
),
|
|
149
149
|
// font and weight map for text primitive
|
|
150
|
-
...primitivesOutputs.map(
|
|
151
|
-
() =>
|
|
150
|
+
...primitivesOutputs.map(
|
|
151
|
+
(outputPath) => () =>
|
|
152
152
|
createPartialSignedArtifact(
|
|
153
153
|
createTextStylesFromTemplate,
|
|
154
154
|
'yarn workspace @atlaskit/primitives codegen-styles',
|
|
@@ -163,11 +163,11 @@ const primitivesSourceFns = [
|
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* Generate Forge UI Kit tokens using partial codegen
|
|
166
|
-
*
|
|
166
|
+
*
|
|
167
167
|
* Note: Forge uses a SINGLE codegen block (@codegen-start:forge-tokens) with all tokens,
|
|
168
168
|
* unlike Primitives which uses separate blocks per category. This allows Forge to mix
|
|
169
169
|
* generated token maps with manual utility functions in one file.
|
|
170
|
-
*
|
|
170
|
+
*
|
|
171
171
|
* @see https://developer.atlassian.com/platform/forge/ui-kit/components/xcss/
|
|
172
172
|
*/
|
|
173
173
|
const generateForgeTokensContent = (): string => {
|