@atlaskit/primitives 1.17.0 → 1.19.0
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 +20 -0
- package/constellation/text/code.mdx +5 -3
- package/constellation/xcss/usage.mdx +1 -1
- package/dist/cjs/components/text.js +17 -10
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/xcss/style-maps.partial.js +6 -6
- package/dist/cjs/xcss/xcss.js +2 -2
- package/dist/es2019/components/text.js +17 -10
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/xcss/style-maps.partial.js +6 -6
- package/dist/es2019/xcss/xcss.js +1 -1
- package/dist/esm/components/text.js +17 -10
- package/dist/esm/index.js +1 -1
- package/dist/esm/xcss/style-maps.partial.js +6 -6
- package/dist/esm/xcss/xcss.js +1 -1
- package/dist/types/components/text.d.ts +5 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/responsive/index.d.ts +1 -1
- package/dist/types/xcss/style-maps.partial.d.ts +1 -1
- package/dist/types/xcss/xcss.d.ts +1622 -0
- package/dist/types-ts4.5/components/text.d.ts +5 -3
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/responsive/index.d.ts +1 -1
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +1 -1
- package/dist/types-ts4.5/xcss/xcss.d.ts +1622 -0
- package/package.json +2 -2
- package/extract-react-types/text-props.tsx +0 -47
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 1.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#66702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66702) [`5b6bbaf2d5fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5b6bbaf2d5fc) - Added `maxLines` prop to `Text` component, allowing truncation at a certain number of lines. This prop replaces `shouldTruncate` prop.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#67698](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67698) [`175c07b58c52`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/175c07b58c52) - Export tokensMap object
|
|
12
|
+
|
|
13
|
+
## 1.18.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#67463](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67463) [`adf1c3ebf0fd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/adf1c3ebf0fd) - Fixed an issue with `Text` where text could render incorrectly if a typography token theme was not present on a page.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 1.17.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
title: Text
|
|
3
3
|
description: Text is a token-backed typography component to display body and UI text.
|
|
4
4
|
order: 1
|
|
5
|
+
props:
|
|
6
|
+
packageName: '@atlaskit/primitives'
|
|
7
|
+
exports:
|
|
8
|
+
- Text
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
@@ -12,8 +16,6 @@ import { CodeDocsHeader } from '@af/design-system-docs-ui';
|
|
|
12
16
|
directoryName="primitives"
|
|
13
17
|
/>
|
|
14
18
|
|
|
15
|
-
import ERTText from '!!extract-react-types-loader!../../extract-react-types/text-props';
|
|
16
|
-
|
|
17
19
|
## Props
|
|
18
20
|
|
|
19
|
-
<
|
|
21
|
+
<TSMorphProps exportName="Text" packageName="@atlaskit/primitives" />
|
|
@@ -6,7 +6,7 @@ order: 0
|
|
|
6
6
|
|
|
7
7
|
import { MediaQueriesTable } from '@af/design-system-docs-ui';
|
|
8
8
|
|
|
9
|
-
XCSS is an Atlassian Design System styling API that natively integrates with Atlassian's [design tokens](/tokens) and [primitives](/components/primitives).
|
|
9
|
+
XCSS is an Atlassian Design System styling API that natively integrates with Atlassian's [design tokens](/tokens) and [primitives](/components/primitives/overview).
|
|
10
10
|
|
|
11
11
|
The XCSS utility behaves similarly to the `css` utility in libraries like `styled-components`, `@compiled` or `@emotion`. If you've used these libraries, XCSS will feel familiar, with a few additional features and constraints.
|
|
12
12
|
|
|
@@ -40,11 +40,16 @@ var textAlignMap = {
|
|
|
40
40
|
textAlign: 'start'
|
|
41
41
|
})
|
|
42
42
|
};
|
|
43
|
-
var
|
|
43
|
+
var truncationStyles = (0, _react2.css)({
|
|
44
|
+
display: '-webkit-box',
|
|
44
45
|
overflow: 'hidden',
|
|
45
|
-
|
|
46
|
-
whiteSpace: 'nowrap'
|
|
46
|
+
WebkitBoxOrient: 'vertical'
|
|
47
47
|
});
|
|
48
|
+
var wordBreakMap = {
|
|
49
|
+
breakAll: (0, _react2.css)({
|
|
50
|
+
wordBreak: 'break-all'
|
|
51
|
+
})
|
|
52
|
+
};
|
|
48
53
|
|
|
49
54
|
/**
|
|
50
55
|
* Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
|
|
@@ -93,14 +98,13 @@ var Text = function Text(_ref) {
|
|
|
93
98
|
Component = 'span';
|
|
94
99
|
}
|
|
95
100
|
}
|
|
101
|
+
(0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
96
102
|
|
|
97
|
-
// Remove the ability to bypass typescript errors for
|
|
98
|
-
var
|
|
99
|
-
if ('
|
|
100
|
-
|
|
101
|
-
shouldTruncate = (_props$shouldTruncate = props.shouldTruncate) !== null && _props$shouldTruncate !== void 0 ? _props$shouldTruncate : false;
|
|
103
|
+
// Remove the ability to bypass typescript errors for maxLines
|
|
104
|
+
var maxLines;
|
|
105
|
+
if ('maxLines' in props && variant.includes('body')) {
|
|
106
|
+
maxLines = props.maxLines;
|
|
102
107
|
}
|
|
103
|
-
(0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
104
108
|
var color = useColor(colorProp);
|
|
105
109
|
var isWrapped = useHasTextAncestor();
|
|
106
110
|
|
|
@@ -112,7 +116,10 @@ var Text = function Text(_ref) {
|
|
|
112
116
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
113
117
|
}
|
|
114
118
|
var component = (0, _react2.jsx)(Component, {
|
|
115
|
-
css: [resetStyles, variant && variantStyles[variant], color && _styleMaps.textColorStylesMap[color],
|
|
119
|
+
css: [resetStyles, variant && variantStyles[variant], color && _styleMaps.textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
120
|
+
style: {
|
|
121
|
+
WebkitLineClamp: maxLines
|
|
122
|
+
},
|
|
116
123
|
"data-testid": testId,
|
|
117
124
|
id: id
|
|
118
125
|
}, children);
|
package/dist/cjs/index.js
CHANGED
|
@@ -64,6 +64,12 @@ Object.defineProperty(exports, "media", {
|
|
|
64
64
|
return _responsive.media;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
+
Object.defineProperty(exports, "tokensMap", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _xcss.tokensMap;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
67
73
|
Object.defineProperty(exports, "xcss", {
|
|
68
74
|
enumerable: true,
|
|
69
75
|
get: function get() {
|
|
@@ -496,7 +496,7 @@ var borderRadiusMap = exports.borderRadiusMap = {
|
|
|
496
496
|
|
|
497
497
|
/**
|
|
498
498
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
499
|
-
* @codegen <<SignedSource::
|
|
499
|
+
* @codegen <<SignedSource::badcf0eda5c0c2a7dca4428cc42a5db9>>
|
|
500
500
|
* @codegenId typography
|
|
501
501
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
502
502
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -537,13 +537,13 @@ var lineHeightMap = exports.lineHeightMap = {
|
|
|
537
537
|
'font.lineHeight.600': "var(--ds-font-lineHeight-600, 40px)"
|
|
538
538
|
};
|
|
539
539
|
var bodyTextMap = exports.bodyTextMap = {
|
|
540
|
-
body: "var(--ds-font-body, normal 400 14px/20px
|
|
541
|
-
'body.large': "var(--ds-font-body-large, normal 400 16px/24px
|
|
542
|
-
'body.small': "var(--ds-font-body-small, normal 400 11px/16px
|
|
540
|
+
body: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
541
|
+
'body.large': "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
542
|
+
'body.small': "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
543
543
|
};
|
|
544
544
|
var uiTextMap = exports.uiTextMap = {
|
|
545
|
-
ui: "var(--ds-font-ui, normal 400 14px/1
|
|
546
|
-
'ui.small': "var(--ds-font-ui-small, normal 400 11px/1
|
|
545
|
+
ui: "var(--ds-font-ui, normal 400 14px/1 ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
546
|
+
'ui.small': "var(--ds-font-ui-small, normal 400 11px/1 ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
547
547
|
};
|
|
548
548
|
|
|
549
549
|
/**
|
package/dist/cjs/xcss/xcss.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.parseXcss = void 0;
|
|
7
|
+
exports.tokensMap = exports.parseXcss = void 0;
|
|
8
8
|
exports.xcss = xcss;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -15,7 +15,7 @@ var _styleMaps = require("./style-maps.partial");
|
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
17
17
|
|
|
18
|
-
var tokensMap = {
|
|
18
|
+
var tokensMap = exports.tokensMap = {
|
|
19
19
|
backgroundColor: _styleMaps.backgroundColorMap,
|
|
20
20
|
blockSize: _styleMaps.dimensionMap,
|
|
21
21
|
borderBlockColor: _styleMaps.borderColorMap,
|
|
@@ -32,11 +32,16 @@ const textAlignMap = {
|
|
|
32
32
|
textAlign: 'start'
|
|
33
33
|
})
|
|
34
34
|
};
|
|
35
|
-
const
|
|
35
|
+
const truncationStyles = css({
|
|
36
|
+
display: '-webkit-box',
|
|
36
37
|
overflow: 'hidden',
|
|
37
|
-
|
|
38
|
-
whiteSpace: 'nowrap'
|
|
38
|
+
WebkitBoxOrient: 'vertical'
|
|
39
39
|
});
|
|
40
|
+
const wordBreakMap = {
|
|
41
|
+
breakAll: css({
|
|
42
|
+
wordBreak: 'break-all'
|
|
43
|
+
})
|
|
44
|
+
};
|
|
40
45
|
|
|
41
46
|
/**
|
|
42
47
|
* Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
|
|
@@ -85,14 +90,13 @@ const Text = ({
|
|
|
85
90
|
Component = 'span';
|
|
86
91
|
}
|
|
87
92
|
}
|
|
93
|
+
invariant(asAllowlist.includes(Component), `@atlaskit/primitives: Text received an invalid "as" value of "${Component}"`);
|
|
88
94
|
|
|
89
|
-
// Remove the ability to bypass typescript errors for
|
|
90
|
-
let
|
|
91
|
-
if ('
|
|
92
|
-
|
|
93
|
-
shouldTruncate = (_props$shouldTruncate = props.shouldTruncate) !== null && _props$shouldTruncate !== void 0 ? _props$shouldTruncate : false;
|
|
95
|
+
// Remove the ability to bypass typescript errors for maxLines
|
|
96
|
+
let maxLines;
|
|
97
|
+
if ('maxLines' in props && variant.includes('body')) {
|
|
98
|
+
maxLines = props.maxLines;
|
|
94
99
|
}
|
|
95
|
-
invariant(asAllowlist.includes(Component), `@atlaskit/primitives: Text received an invalid "as" value of "${Component}"`);
|
|
96
100
|
const color = useColor(colorProp);
|
|
97
101
|
const isWrapped = useHasTextAncestor();
|
|
98
102
|
|
|
@@ -104,7 +108,10 @@ const Text = ({
|
|
|
104
108
|
return jsx(Fragment, null, children);
|
|
105
109
|
}
|
|
106
110
|
const component = jsx(Component, {
|
|
107
|
-
css: [resetStyles, variant && variantStyles[variant], color && textColorStylesMap[color],
|
|
111
|
+
css: [resetStyles, variant && variantStyles[variant], color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
112
|
+
style: {
|
|
113
|
+
WebkitLineClamp: maxLines
|
|
114
|
+
},
|
|
108
115
|
"data-testid": testId,
|
|
109
116
|
id: id
|
|
110
117
|
}, children);
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as Box } from './components/box';
|
|
2
2
|
export { default as Inline } from './components/inline';
|
|
3
|
-
export { xcss } from './xcss/xcss';
|
|
3
|
+
export { xcss, tokensMap } from './xcss/xcss';
|
|
4
4
|
export { default as Stack } from './components/stack';
|
|
5
5
|
export { default as Flex } from './components/flex';
|
|
6
6
|
export { default as Grid } from './components/grid';
|
|
@@ -484,7 +484,7 @@ export const borderRadiusMap = {
|
|
|
484
484
|
*/
|
|
485
485
|
/**
|
|
486
486
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
487
|
-
* @codegen <<SignedSource::
|
|
487
|
+
* @codegen <<SignedSource::badcf0eda5c0c2a7dca4428cc42a5db9>>
|
|
488
488
|
* @codegenId typography
|
|
489
489
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
490
490
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -525,13 +525,13 @@ export const lineHeightMap = {
|
|
|
525
525
|
'font.lineHeight.600': "var(--ds-font-lineHeight-600, 40px)"
|
|
526
526
|
};
|
|
527
527
|
export const bodyTextMap = {
|
|
528
|
-
body: "var(--ds-font-body, normal 400 14px/20px
|
|
529
|
-
'body.large': "var(--ds-font-body-large, normal 400 16px/24px
|
|
530
|
-
'body.small': "var(--ds-font-body-small, normal 400 11px/16px
|
|
528
|
+
body: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
529
|
+
'body.large': "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
530
|
+
'body.small': "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
531
531
|
};
|
|
532
532
|
export const uiTextMap = {
|
|
533
|
-
ui: "var(--ds-font-ui, normal 400 14px/1
|
|
534
|
-
'ui.small': "var(--ds-font-ui-small, normal 400 11px/1
|
|
533
|
+
ui: "var(--ds-font-ui, normal 400 14px/1 ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
534
|
+
'ui.small': "var(--ds-font-ui-small, normal 400 11px/1 ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
535
535
|
};
|
|
536
536
|
|
|
537
537
|
/**
|
package/dist/es2019/xcss/xcss.js
CHANGED
|
@@ -4,7 +4,7 @@ import { css as cssEmotion } from '@emotion/react';
|
|
|
4
4
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
5
|
|
|
6
6
|
import { allSpaceMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, layerMap, opacityMap, positiveSpaceMap, shadowMap, textColorMap } from './style-maps.partial';
|
|
7
|
-
const tokensMap = {
|
|
7
|
+
export const tokensMap = {
|
|
8
8
|
backgroundColor: backgroundColorMap,
|
|
9
9
|
blockSize: dimensionMap,
|
|
10
10
|
borderBlockColor: borderColorMap,
|
|
@@ -34,11 +34,16 @@ var textAlignMap = {
|
|
|
34
34
|
textAlign: 'start'
|
|
35
35
|
})
|
|
36
36
|
};
|
|
37
|
-
var
|
|
37
|
+
var truncationStyles = css({
|
|
38
|
+
display: '-webkit-box',
|
|
38
39
|
overflow: 'hidden',
|
|
39
|
-
|
|
40
|
-
whiteSpace: 'nowrap'
|
|
40
|
+
WebkitBoxOrient: 'vertical'
|
|
41
41
|
});
|
|
42
|
+
var wordBreakMap = {
|
|
43
|
+
breakAll: css({
|
|
44
|
+
wordBreak: 'break-all'
|
|
45
|
+
})
|
|
46
|
+
};
|
|
42
47
|
|
|
43
48
|
/**
|
|
44
49
|
* Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
|
|
@@ -87,14 +92,13 @@ var Text = function Text(_ref) {
|
|
|
87
92
|
Component = 'span';
|
|
88
93
|
}
|
|
89
94
|
}
|
|
95
|
+
invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
90
96
|
|
|
91
|
-
// Remove the ability to bypass typescript errors for
|
|
92
|
-
var
|
|
93
|
-
if ('
|
|
94
|
-
|
|
95
|
-
shouldTruncate = (_props$shouldTruncate = props.shouldTruncate) !== null && _props$shouldTruncate !== void 0 ? _props$shouldTruncate : false;
|
|
97
|
+
// Remove the ability to bypass typescript errors for maxLines
|
|
98
|
+
var maxLines;
|
|
99
|
+
if ('maxLines' in props && variant.includes('body')) {
|
|
100
|
+
maxLines = props.maxLines;
|
|
96
101
|
}
|
|
97
|
-
invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
98
102
|
var color = useColor(colorProp);
|
|
99
103
|
var isWrapped = useHasTextAncestor();
|
|
100
104
|
|
|
@@ -106,7 +110,10 @@ var Text = function Text(_ref) {
|
|
|
106
110
|
return jsx(Fragment, null, children);
|
|
107
111
|
}
|
|
108
112
|
var component = jsx(Component, {
|
|
109
|
-
css: [resetStyles, variant && variantStyles[variant], color && textColorStylesMap[color],
|
|
113
|
+
css: [resetStyles, variant && variantStyles[variant], color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
114
|
+
style: {
|
|
115
|
+
WebkitLineClamp: maxLines
|
|
116
|
+
},
|
|
110
117
|
"data-testid": testId,
|
|
111
118
|
id: id
|
|
112
119
|
}, children);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as Box } from './components/box';
|
|
2
2
|
export { default as Inline } from './components/inline';
|
|
3
|
-
export { xcss } from './xcss/xcss';
|
|
3
|
+
export { xcss, tokensMap } from './xcss/xcss';
|
|
4
4
|
export { default as Stack } from './components/stack';
|
|
5
5
|
export { default as Flex } from './components/flex';
|
|
6
6
|
export { default as Grid } from './components/grid';
|
|
@@ -484,7 +484,7 @@ export var borderRadiusMap = {
|
|
|
484
484
|
*/
|
|
485
485
|
/**
|
|
486
486
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
487
|
-
* @codegen <<SignedSource::
|
|
487
|
+
* @codegen <<SignedSource::badcf0eda5c0c2a7dca4428cc42a5db9>>
|
|
488
488
|
* @codegenId typography
|
|
489
489
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
490
490
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
@@ -525,13 +525,13 @@ export var lineHeightMap = {
|
|
|
525
525
|
'font.lineHeight.600': "var(--ds-font-lineHeight-600, 40px)"
|
|
526
526
|
};
|
|
527
527
|
export var bodyTextMap = {
|
|
528
|
-
body: "var(--ds-font-body, normal 400 14px/20px
|
|
529
|
-
'body.large': "var(--ds-font-body-large, normal 400 16px/24px
|
|
530
|
-
'body.small': "var(--ds-font-body-small, normal 400 11px/16px
|
|
528
|
+
body: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
529
|
+
'body.large': "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
530
|
+
'body.small': "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
531
531
|
};
|
|
532
532
|
export var uiTextMap = {
|
|
533
|
-
ui: "var(--ds-font-ui, normal 400 14px/1
|
|
534
|
-
'ui.small': "var(--ds-font-ui-small, normal 400 11px/1
|
|
533
|
+
ui: "var(--ds-font-ui, normal 400 14px/1 ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
534
|
+
'ui.small': "var(--ds-font-ui-small, normal 400 11px/1 ui-sans-serif, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
535
535
|
};
|
|
536
536
|
|
|
537
537
|
/**
|
package/dist/esm/xcss/xcss.js
CHANGED
|
@@ -7,7 +7,7 @@ import { css as cssEmotion } from '@emotion/react';
|
|
|
7
7
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
8
8
|
|
|
9
9
|
import { allSpaceMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, layerMap, opacityMap, positiveSpaceMap, shadowMap, textColorMap } from './style-maps.partial';
|
|
10
|
-
var tokensMap = {
|
|
10
|
+
export var tokensMap = {
|
|
11
11
|
backgroundColor: backgroundColorMap,
|
|
12
12
|
blockSize: dimensionMap,
|
|
13
13
|
borderBlockColor: borderColorMap,
|
|
@@ -10,18 +10,20 @@ type TextPropsBody = {
|
|
|
10
10
|
*/
|
|
11
11
|
variant?: BodyText;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* The number of lines to limit the provided text to. Text will be truncated with an ellipsis.
|
|
14
|
+
*
|
|
15
|
+
* When `maxLines={1}`, `wordBreak` defaults to `break-all` to match the behaviour of `text-overflow: ellipsis`.
|
|
15
16
|
*
|
|
16
17
|
* Only available for `body` text variants.
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
maxLines?: number;
|
|
19
20
|
};
|
|
20
21
|
type TextPropsUi = {
|
|
21
22
|
/**
|
|
22
23
|
* Text variant
|
|
23
24
|
*/
|
|
24
25
|
variant: UiText;
|
|
26
|
+
maxLines?: never;
|
|
25
27
|
};
|
|
26
28
|
type TextPropsBase = {
|
|
27
29
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { default as Box } from './components/box';
|
|
|
3
3
|
export type { BoxProps } from './components/box';
|
|
4
4
|
export { default as Inline } from './components/inline';
|
|
5
5
|
export type { InlineProps } from './components/inline';
|
|
6
|
-
export { xcss } from './xcss/xcss';
|
|
6
|
+
export { xcss, tokensMap } from './xcss/xcss';
|
|
7
7
|
export type { XCSS } from './xcss/xcss';
|
|
8
8
|
export { default as Stack } from './components/stack';
|
|
9
9
|
export type { StackProps } from './components/stack';
|
|
@@ -16,4 +16,4 @@ export type { BleedProps } from './components/bleed';
|
|
|
16
16
|
export { default as Text } from './components/text';
|
|
17
17
|
export type { TextProps } from './components/text';
|
|
18
18
|
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
19
|
-
export type { Breakpoint } from './responsive';
|
|
19
|
+
export type { Breakpoint, MediaQuery } from './responsive';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { media, UNSAFE_media } from './media-helper';
|
|
2
2
|
export { UNSAFE_buildAboveMediaQueryCSS } from './build-media-query-css';
|
|
3
3
|
export { UNSAFE_BREAKPOINTS_ORDERED_LIST, UNSAFE_BREAKPOINTS_CONFIG, } from './constants';
|
|
4
|
-
export type { Breakpoint, ResponsiveObject, ResponsiveCSSObject, } from './types';
|
|
4
|
+
export type { Breakpoint, ResponsiveObject, ResponsiveCSSObject, MediaQuery, } from './types';
|
|
5
5
|
export { UNSAFE_useMediaQuery } from './use-media-query';
|
|
6
6
|
export { Show } from './show';
|
|
7
7
|
export { Hide } from './hide';
|
|
@@ -515,7 +515,7 @@ export type BorderRadius = keyof typeof borderRadiusMap;
|
|
|
515
515
|
*/
|
|
516
516
|
/**
|
|
517
517
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
518
|
-
* @codegen <<SignedSource::
|
|
518
|
+
* @codegen <<SignedSource::badcf0eda5c0c2a7dca4428cc42a5db9>>
|
|
519
519
|
* @codegenId typography
|
|
520
520
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
521
521
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|