@atlaskit/ds-explorations 3.5.2 → 4.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 +370 -358
- package/README.md +4 -3
- package/afm-jira/tsconfig.json +24 -0
- package/dist/cjs/components/interaction-surface.partial.js +1 -1
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/internal/color-map.js +1 -1
- package/dist/es2019/components/interaction-surface.partial.js +1 -1
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/internal/color-map.js +1 -1
- package/dist/esm/components/interaction-surface.partial.js +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/internal/color-map.js +1 -1
- package/dist/types/components/interaction-surface.partial.d.ts +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/internal/color-map.d.ts +1 -1
- package/dist/types-ts4.5/components/interaction-surface.partial.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/internal/color-map.d.ts +1 -1
- package/docs/01-basic.tsx +11 -13
- package/examples/99-interactions.tsx +174 -176
- package/package.json +6 -10
- package/report.api.md +127 -126
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +540 -540
- package/scripts/__tests__/codegen.test.tsx +15 -17
- package/scripts/codegen-styles.tsx +25 -92
- package/scripts/color-codegen-template.tsx +69 -82
- package/scripts/color-map-template.tsx +24 -29
- package/scripts/dimension-codegen-template.tsx +32 -35
- package/scripts/interaction-codegen.tsx +61 -74
- package/scripts/misc-codegen-template.tsx +23 -25
- package/scripts/utils.tsx +30 -34
- package/src/components/__tests__/unit/interaction-suface.test.tsx +61 -62
- package/src/components/interaction-surface.partial.tsx +412 -416
- package/src/components/surface-provider.tsx +1 -1
- package/src/components/types.tsx +10 -10
- package/src/constants.tsx +9 -9
- package/src/index.tsx +0 -2
- package/src/internal/color-map.tsx +28 -28
- package/src/internal/role-to-element.tsx +21 -21
- package/tsconfig.app.json +44 -44
- package/tsconfig.dev.json +71 -83
- package/dist/cjs/components/text.partial.js +0 -280
- package/dist/cjs/internal/spacing-scale.js +0 -15
- package/dist/es2019/components/text.partial.js +0 -271
- package/dist/es2019/internal/spacing-scale.js +0 -9
- package/dist/esm/components/text.partial.js +0 -274
- package/dist/esm/internal/spacing-scale.js +0 -9
- package/dist/types/components/text.partial.d.ts +0 -157
- package/dist/types/internal/spacing-scale.d.ts +0 -9
- package/dist/types-ts4.5/components/text.partial.d.ts +0 -162
- package/dist/types-ts4.5/internal/spacing-scale.d.ts +0 -24
- package/examples/02-text-advanced.tsx +0 -30
- package/examples/02-text.tsx +0 -110
- package/examples/06-section-message.tsx +0 -82
- package/examples/07-comment.tsx +0 -51
- package/examples/08-lozenge.tsx +0 -34
- package/scripts/spacing-codegen-template.tsx +0 -66
- package/scripts/spacing-scale-template.tsx +0 -24
- package/scripts/typography-codegen-template.tsx +0 -72
- package/src/components/__tests__/unit/text.test.tsx +0 -64
- package/src/components/__tests__/vr-tests/__snapshots__/text-snapshot-test/text--default.png +0 -0
- package/src/components/__tests__/vr-tests/text-snapshot-test.vr.tsx +0 -6
- package/src/components/text.partial.tsx +0 -375
- package/src/internal/spacing-scale.tsx +0 -24
- package/text/package.json +0 -15
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["children"];
|
|
3
|
-
/** @jsx jsx */
|
|
4
|
-
import { createContext, Fragment, useContext } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/react';
|
|
6
|
-
import invariant from 'tiny-invariant';
|
|
7
|
-
import surfaceColorMap from '../internal/color-map';
|
|
8
|
-
import { useSurface } from './surface-provider';
|
|
9
|
-
var asAllowlist = ['span', 'div', 'p', 'strong'];
|
|
10
|
-
var textAlignMap = {
|
|
11
|
-
center: css({
|
|
12
|
-
textAlign: 'center'
|
|
13
|
-
}),
|
|
14
|
-
end: css({
|
|
15
|
-
textAlign: 'end'
|
|
16
|
-
}),
|
|
17
|
-
start: css({
|
|
18
|
-
textAlign: 'start'
|
|
19
|
-
})
|
|
20
|
-
};
|
|
21
|
-
var textTransformMap = {
|
|
22
|
-
none: css({
|
|
23
|
-
textTransform: 'none'
|
|
24
|
-
}),
|
|
25
|
-
lowercase: css({
|
|
26
|
-
textTransform: 'lowercase'
|
|
27
|
-
}),
|
|
28
|
-
uppercase: css({
|
|
29
|
-
textTransform: 'uppercase'
|
|
30
|
-
})
|
|
31
|
-
};
|
|
32
|
-
var verticalAlignMap = {
|
|
33
|
-
top: css({
|
|
34
|
-
verticalAlign: 'top'
|
|
35
|
-
}),
|
|
36
|
-
middle: css({
|
|
37
|
-
verticalAlign: 'middle'
|
|
38
|
-
}),
|
|
39
|
-
bottom: css({
|
|
40
|
-
verticalAlign: 'bottom'
|
|
41
|
-
})
|
|
42
|
-
};
|
|
43
|
-
var baseStyles = css({
|
|
44
|
-
boxSizing: 'border-box',
|
|
45
|
-
margin: "var(--ds-space-0, 0px)",
|
|
46
|
-
padding: "var(--ds-space-0, 0px)"
|
|
47
|
-
});
|
|
48
|
-
var truncateStyles = css({
|
|
49
|
-
overflow: 'hidden',
|
|
50
|
-
textOverflow: 'ellipsis',
|
|
51
|
-
whiteSpace: 'nowrap'
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
/**
|
|
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.
|
|
56
|
-
*/
|
|
57
|
-
var useColor = function useColor(colorProp) {
|
|
58
|
-
var surface = useSurface();
|
|
59
|
-
var inverseTextColor = surfaceColorMap[surface];
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Where the color of the surface is inverted we override the user choice
|
|
63
|
-
* as there is no valid choice that is not covered by the override.
|
|
64
|
-
*/
|
|
65
|
-
var color = inverseTextColor !== null && inverseTextColor !== void 0 ? inverseTextColor : colorProp;
|
|
66
|
-
return color;
|
|
67
|
-
};
|
|
68
|
-
var HasTextAncestorContext = /*#__PURE__*/createContext(false);
|
|
69
|
-
var useHasTextAncestor = function useHasTextAncestor() {
|
|
70
|
-
return useContext(HasTextAncestorContext);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* __Text__
|
|
75
|
-
*
|
|
76
|
-
* Text is a primitive component that has the Atlassian Design System's design guidelines baked in.
|
|
77
|
-
* This includes considerations for text attributes such as color, font size, font weight, and line height.
|
|
78
|
-
* It renders a `span` by default.
|
|
79
|
-
*
|
|
80
|
-
* @internal
|
|
81
|
-
*/
|
|
82
|
-
var Text = function Text(_ref) {
|
|
83
|
-
var children = _ref.children,
|
|
84
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
85
|
-
var _props$as = props.as,
|
|
86
|
-
Component = _props$as === void 0 ? 'span' : _props$as,
|
|
87
|
-
colorProp = props.color,
|
|
88
|
-
fontSize = props.fontSize,
|
|
89
|
-
fontWeight = props.fontWeight,
|
|
90
|
-
lineHeight = props.lineHeight,
|
|
91
|
-
_props$shouldTruncate = props.shouldTruncate,
|
|
92
|
-
shouldTruncate = _props$shouldTruncate === void 0 ? false : _props$shouldTruncate,
|
|
93
|
-
textAlign = props.textAlign,
|
|
94
|
-
textTransform = props.textTransform,
|
|
95
|
-
verticalAlign = props.verticalAlign,
|
|
96
|
-
testId = props.testId,
|
|
97
|
-
UNSAFE_style = props.UNSAFE_style,
|
|
98
|
-
id = props.id;
|
|
99
|
-
invariant(asAllowlist.includes(Component), "@atlaskit/ds-explorations: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
100
|
-
var color = useColor(colorProp);
|
|
101
|
-
var isWrapped = useHasTextAncestor();
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* If the text is already wrapped and applies no props we can just
|
|
105
|
-
* render the children directly as a fragment.
|
|
106
|
-
*/
|
|
107
|
-
if (isWrapped && Object.keys(props).length === 0) {
|
|
108
|
-
return jsx(Fragment, null, children);
|
|
109
|
-
}
|
|
110
|
-
var component = jsx(Component, {
|
|
111
|
-
style: UNSAFE_style,
|
|
112
|
-
css: [baseStyles, fontFamilyMap.sans, color && textColorMap[color], fontSize && fontSizeMap[fontSize], fontWeight && fontWeightMap[fontWeight], lineHeight && lineHeightMap[lineHeight], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], textTransform && textTransformMap[textTransform], verticalAlign && verticalAlignMap[verticalAlign]],
|
|
113
|
-
"data-testid": testId,
|
|
114
|
-
id: id
|
|
115
|
-
}, children);
|
|
116
|
-
return isWrapped ?
|
|
117
|
-
// no need to re-apply context if the text is already wrapped
|
|
118
|
-
component : jsx(HasTextAncestorContext.Provider, {
|
|
119
|
-
value: true
|
|
120
|
-
}, component);
|
|
121
|
-
};
|
|
122
|
-
export default Text;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
126
|
-
* @codegen <<SignedSource::c5a6cec604462dc4b48aaf1160b83e59>>
|
|
127
|
-
* @codegenId typography
|
|
128
|
-
* @codegenCommand yarn codegen-styles
|
|
129
|
-
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight"]
|
|
130
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-typography-adg3.tsx <<SignedSource::bf3349cf2247aa44fbac47c953fc03b5>>
|
|
131
|
-
*/
|
|
132
|
-
var fontSizeMap = {
|
|
133
|
-
'size.050': css({
|
|
134
|
-
fontSize: "var(--ds-font-size-050, 11px)"
|
|
135
|
-
}),
|
|
136
|
-
'size.075': css({
|
|
137
|
-
fontSize: "var(--ds-font-size-075, 12px)"
|
|
138
|
-
}),
|
|
139
|
-
'size.100': css({
|
|
140
|
-
fontSize: "var(--ds-font-size-100, 14px)"
|
|
141
|
-
}),
|
|
142
|
-
'size.200': css({
|
|
143
|
-
fontSize: "var(--ds-font-size-200, 16px)"
|
|
144
|
-
}),
|
|
145
|
-
'size.300': css({
|
|
146
|
-
fontSize: "var(--ds-font-size-300, 20px)"
|
|
147
|
-
}),
|
|
148
|
-
'size.400': css({
|
|
149
|
-
fontSize: "var(--ds-font-size-400, 24px)"
|
|
150
|
-
}),
|
|
151
|
-
'size.500': css({
|
|
152
|
-
fontSize: "var(--ds-font-size-500, 29px)"
|
|
153
|
-
}),
|
|
154
|
-
'size.600': css({
|
|
155
|
-
fontSize: "var(--ds-font-size-600, 35px)"
|
|
156
|
-
})
|
|
157
|
-
};
|
|
158
|
-
var fontWeightMap = {
|
|
159
|
-
bold: css({
|
|
160
|
-
fontWeight: "var(--ds-font-weight-bold, 700)"
|
|
161
|
-
}),
|
|
162
|
-
medium: css({
|
|
163
|
-
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
164
|
-
}),
|
|
165
|
-
regular: css({
|
|
166
|
-
fontWeight: "var(--ds-font-weight-regular, 400)"
|
|
167
|
-
}),
|
|
168
|
-
semibold: css({
|
|
169
|
-
fontWeight: "var(--ds-font-weight-semibold, 600)"
|
|
170
|
-
})
|
|
171
|
-
};
|
|
172
|
-
var fontFamilyMap = {
|
|
173
|
-
body: css({
|
|
174
|
-
fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
175
|
-
}),
|
|
176
|
-
'brand.body': css({
|
|
177
|
-
fontFamily: "var(--ds-font-family-brand-body, \"Charlie Text\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
178
|
-
}),
|
|
179
|
-
'brand.heading': css({
|
|
180
|
-
fontFamily: "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
181
|
-
}),
|
|
182
|
-
code: css({
|
|
183
|
-
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)"
|
|
184
|
-
}),
|
|
185
|
-
heading: css({
|
|
186
|
-
fontFamily: "var(--ds-font-family-heading, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
187
|
-
}),
|
|
188
|
-
monospace: css({
|
|
189
|
-
fontFamily: "var(--ds-font-family-monospace, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)"
|
|
190
|
-
}),
|
|
191
|
-
sans: css({
|
|
192
|
-
fontFamily: "var(--ds-font-family-sans, -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif)"
|
|
193
|
-
})
|
|
194
|
-
};
|
|
195
|
-
var lineHeightMap = {
|
|
196
|
-
'lineHeight.1': css({
|
|
197
|
-
lineHeight: "var(--ds-font-lineHeight-1, 1)"
|
|
198
|
-
}),
|
|
199
|
-
'lineHeight.100': css({
|
|
200
|
-
lineHeight: "var(--ds-font-lineHeight-100, 16px)"
|
|
201
|
-
}),
|
|
202
|
-
'lineHeight.200': css({
|
|
203
|
-
lineHeight: "var(--ds-font-lineHeight-200, 20px)"
|
|
204
|
-
}),
|
|
205
|
-
'lineHeight.300': css({
|
|
206
|
-
lineHeight: "var(--ds-font-lineHeight-300, 24px)"
|
|
207
|
-
}),
|
|
208
|
-
'lineHeight.400': css({
|
|
209
|
-
lineHeight: "var(--ds-font-lineHeight-400, 28px)"
|
|
210
|
-
}),
|
|
211
|
-
'lineHeight.500': css({
|
|
212
|
-
lineHeight: "var(--ds-font-lineHeight-500, 32px)"
|
|
213
|
-
}),
|
|
214
|
-
'lineHeight.600': css({
|
|
215
|
-
lineHeight: "var(--ds-font-lineHeight-600, 40px)"
|
|
216
|
-
})
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* @codegenEnd
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
224
|
-
* @codegen <<SignedSource::db9171c09481d187d83bb01192c16c41>>
|
|
225
|
-
* @codegenId colors
|
|
226
|
-
* @codegenCommand yarn codegen-styles
|
|
227
|
-
* @codegenParams ["text"]
|
|
228
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f27d1519d51cc4a85383a00907847774>>
|
|
229
|
-
*/
|
|
230
|
-
var textColorMap = {
|
|
231
|
-
'color.text': css({
|
|
232
|
-
color: "var(--ds-text, #172B4D)"
|
|
233
|
-
}),
|
|
234
|
-
disabled: css({
|
|
235
|
-
color: "var(--ds-text-disabled, #A5ADBA)"
|
|
236
|
-
}),
|
|
237
|
-
inverse: css({
|
|
238
|
-
color: "var(--ds-text-inverse, #FFFFFF)"
|
|
239
|
-
}),
|
|
240
|
-
selected: css({
|
|
241
|
-
color: "var(--ds-text-selected, #0052CC)"
|
|
242
|
-
}),
|
|
243
|
-
brand: css({
|
|
244
|
-
color: "var(--ds-text-brand, #0065FF)"
|
|
245
|
-
}),
|
|
246
|
-
danger: css({
|
|
247
|
-
color: "var(--ds-text-danger, #DE350B)"
|
|
248
|
-
}),
|
|
249
|
-
warning: css({
|
|
250
|
-
color: "var(--ds-text-warning, #974F0C)"
|
|
251
|
-
}),
|
|
252
|
-
'warning.inverse': css({
|
|
253
|
-
color: "var(--ds-text-warning-inverse, #172B4D)"
|
|
254
|
-
}),
|
|
255
|
-
success: css({
|
|
256
|
-
color: "var(--ds-text-success, #006644)"
|
|
257
|
-
}),
|
|
258
|
-
discovery: css({
|
|
259
|
-
color: "var(--ds-text-discovery, #403294)"
|
|
260
|
-
}),
|
|
261
|
-
information: css({
|
|
262
|
-
color: "var(--ds-text-information, #0052CC)"
|
|
263
|
-
}),
|
|
264
|
-
subtlest: css({
|
|
265
|
-
color: "var(--ds-text-subtlest, #7A869A)"
|
|
266
|
-
}),
|
|
267
|
-
subtle: css({
|
|
268
|
-
color: "var(--ds-text-subtle, #42526E)"
|
|
269
|
-
})
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* @codegenEnd
|
|
274
|
-
*/
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
*
|
|
4
|
-
* Internal codegen of the spacing scale values. Only used for internal examples.
|
|
5
|
-
*
|
|
6
|
-
* @codegen <<SignedSource::33634cd9767c59b9aaaf64fc6f44f852>>
|
|
7
|
-
* @codegenCommand yarn codegen-styles
|
|
8
|
-
*/
|
|
9
|
-
export var spacingScale = ['space.0', 'space.025', 'space.050', 'space.075', 'space.100', 'space.150', 'space.200', 'space.250', 'space.300', 'space.400', 'space.500', 'space.600', 'space.800', 'space.1000'];
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { type FC, type ReactNode } from 'react';
|
|
3
|
-
import type { BasePrimitiveProps } from './types';
|
|
4
|
-
declare const asAllowlist: readonly ["span", "div", "p", "strong"];
|
|
5
|
-
type AsElement = (typeof asAllowlist)[number];
|
|
6
|
-
export interface TextProps extends BasePrimitiveProps {
|
|
7
|
-
/**
|
|
8
|
-
* HTML tag to be rendered. Defaults to `span`.
|
|
9
|
-
*/
|
|
10
|
-
as?: AsElement;
|
|
11
|
-
/**
|
|
12
|
-
* Elements rendered within the Text element
|
|
13
|
-
*/
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Text color
|
|
17
|
-
*/
|
|
18
|
-
color?: TextColor;
|
|
19
|
-
/**
|
|
20
|
-
* The HTML id attribute https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
21
|
-
*/
|
|
22
|
-
id?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Font size https://developer.mozilla.org/en-US/docs/Web/CSS/font-size
|
|
25
|
-
*/
|
|
26
|
-
fontSize?: FontSize;
|
|
27
|
-
/**
|
|
28
|
-
* Font weight https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
|
|
29
|
-
*/
|
|
30
|
-
fontWeight?: FontWeight;
|
|
31
|
-
/**
|
|
32
|
-
* Line height https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
|
|
33
|
-
*/
|
|
34
|
-
lineHeight?: LineHeight;
|
|
35
|
-
/**
|
|
36
|
-
* Truncates text with an ellipsis when text overflows its parent container
|
|
37
|
-
* (i.e. `width` has been set on parent that is shorter than text length).
|
|
38
|
-
*/
|
|
39
|
-
shouldTruncate?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Text align https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
|
|
42
|
-
*/
|
|
43
|
-
textAlign?: TextAlign;
|
|
44
|
-
/**
|
|
45
|
-
* Text transform https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform
|
|
46
|
-
*/
|
|
47
|
-
textTransform?: TextTransform;
|
|
48
|
-
/**
|
|
49
|
-
* Vertical align https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align
|
|
50
|
-
*/
|
|
51
|
-
verticalAlign?: VerticalAlign;
|
|
52
|
-
}
|
|
53
|
-
type TextAlign = keyof typeof textAlignMap;
|
|
54
|
-
declare const textAlignMap: {
|
|
55
|
-
center: import("@emotion/react").SerializedStyles;
|
|
56
|
-
end: import("@emotion/react").SerializedStyles;
|
|
57
|
-
start: import("@emotion/react").SerializedStyles;
|
|
58
|
-
};
|
|
59
|
-
type TextTransform = keyof typeof textTransformMap;
|
|
60
|
-
declare const textTransformMap: {
|
|
61
|
-
none: import("@emotion/react").SerializedStyles;
|
|
62
|
-
lowercase: import("@emotion/react").SerializedStyles;
|
|
63
|
-
uppercase: import("@emotion/react").SerializedStyles;
|
|
64
|
-
};
|
|
65
|
-
type VerticalAlign = keyof typeof verticalAlignMap;
|
|
66
|
-
declare const verticalAlignMap: {
|
|
67
|
-
top: import("@emotion/react").SerializedStyles;
|
|
68
|
-
middle: import("@emotion/react").SerializedStyles;
|
|
69
|
-
bottom: import("@emotion/react").SerializedStyles;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* __Text__
|
|
73
|
-
*
|
|
74
|
-
* Text is a primitive component that has the Atlassian Design System's design guidelines baked in.
|
|
75
|
-
* This includes considerations for text attributes such as color, font size, font weight, and line height.
|
|
76
|
-
* It renders a `span` by default.
|
|
77
|
-
*
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
declare const Text: FC<TextProps>;
|
|
81
|
-
export default Text;
|
|
82
|
-
/**
|
|
83
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
84
|
-
* @codegen <<SignedSource::c5a6cec604462dc4b48aaf1160b83e59>>
|
|
85
|
-
* @codegenId typography
|
|
86
|
-
* @codegenCommand yarn codegen-styles
|
|
87
|
-
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight"]
|
|
88
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-typography-adg3.tsx <<SignedSource::bf3349cf2247aa44fbac47c953fc03b5>>
|
|
89
|
-
*/
|
|
90
|
-
declare const fontSizeMap: {
|
|
91
|
-
'size.050': import("@emotion/react").SerializedStyles;
|
|
92
|
-
'size.075': import("@emotion/react").SerializedStyles;
|
|
93
|
-
'size.100': import("@emotion/react").SerializedStyles;
|
|
94
|
-
'size.200': import("@emotion/react").SerializedStyles;
|
|
95
|
-
'size.300': import("@emotion/react").SerializedStyles;
|
|
96
|
-
'size.400': import("@emotion/react").SerializedStyles;
|
|
97
|
-
'size.500': import("@emotion/react").SerializedStyles;
|
|
98
|
-
'size.600': import("@emotion/react").SerializedStyles;
|
|
99
|
-
};
|
|
100
|
-
export type FontSize = keyof typeof fontSizeMap;
|
|
101
|
-
declare const fontWeightMap: {
|
|
102
|
-
bold: import("@emotion/react").SerializedStyles;
|
|
103
|
-
medium: import("@emotion/react").SerializedStyles;
|
|
104
|
-
regular: import("@emotion/react").SerializedStyles;
|
|
105
|
-
semibold: import("@emotion/react").SerializedStyles;
|
|
106
|
-
};
|
|
107
|
-
export type FontWeight = keyof typeof fontWeightMap;
|
|
108
|
-
declare const fontFamilyMap: {
|
|
109
|
-
body: import("@emotion/react").SerializedStyles;
|
|
110
|
-
'brand.body': import("@emotion/react").SerializedStyles;
|
|
111
|
-
'brand.heading': import("@emotion/react").SerializedStyles;
|
|
112
|
-
code: import("@emotion/react").SerializedStyles;
|
|
113
|
-
heading: import("@emotion/react").SerializedStyles;
|
|
114
|
-
monospace: import("@emotion/react").SerializedStyles;
|
|
115
|
-
sans: import("@emotion/react").SerializedStyles;
|
|
116
|
-
};
|
|
117
|
-
export type FontFamily = keyof typeof fontFamilyMap;
|
|
118
|
-
declare const lineHeightMap: {
|
|
119
|
-
'lineHeight.1': import("@emotion/react").SerializedStyles;
|
|
120
|
-
'lineHeight.100': import("@emotion/react").SerializedStyles;
|
|
121
|
-
'lineHeight.200': import("@emotion/react").SerializedStyles;
|
|
122
|
-
'lineHeight.300': import("@emotion/react").SerializedStyles;
|
|
123
|
-
'lineHeight.400': import("@emotion/react").SerializedStyles;
|
|
124
|
-
'lineHeight.500': import("@emotion/react").SerializedStyles;
|
|
125
|
-
'lineHeight.600': import("@emotion/react").SerializedStyles;
|
|
126
|
-
};
|
|
127
|
-
export type LineHeight = keyof typeof lineHeightMap;
|
|
128
|
-
/**
|
|
129
|
-
* @codegenEnd
|
|
130
|
-
*/
|
|
131
|
-
/**
|
|
132
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
133
|
-
* @codegen <<SignedSource::db9171c09481d187d83bb01192c16c41>>
|
|
134
|
-
* @codegenId colors
|
|
135
|
-
* @codegenCommand yarn codegen-styles
|
|
136
|
-
* @codegenParams ["text"]
|
|
137
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f27d1519d51cc4a85383a00907847774>>
|
|
138
|
-
*/
|
|
139
|
-
declare const textColorMap: {
|
|
140
|
-
readonly 'color.text': import("@emotion/react").SerializedStyles;
|
|
141
|
-
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
142
|
-
readonly inverse: import("@emotion/react").SerializedStyles;
|
|
143
|
-
readonly selected: import("@emotion/react").SerializedStyles;
|
|
144
|
-
readonly brand: import("@emotion/react").SerializedStyles;
|
|
145
|
-
readonly danger: import("@emotion/react").SerializedStyles;
|
|
146
|
-
readonly warning: import("@emotion/react").SerializedStyles;
|
|
147
|
-
readonly 'warning.inverse': import("@emotion/react").SerializedStyles;
|
|
148
|
-
readonly success: import("@emotion/react").SerializedStyles;
|
|
149
|
-
readonly discovery: import("@emotion/react").SerializedStyles;
|
|
150
|
-
readonly information: import("@emotion/react").SerializedStyles;
|
|
151
|
-
readonly subtlest: import("@emotion/react").SerializedStyles;
|
|
152
|
-
readonly subtle: import("@emotion/react").SerializedStyles;
|
|
153
|
-
};
|
|
154
|
-
export type TextColor = keyof typeof textColorMap;
|
|
155
|
-
/**
|
|
156
|
-
* @codegenEnd
|
|
157
|
-
*/
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
*
|
|
4
|
-
* Internal codegen of the spacing scale values. Only used for internal examples.
|
|
5
|
-
*
|
|
6
|
-
* @codegen <<SignedSource::33634cd9767c59b9aaaf64fc6f44f852>>
|
|
7
|
-
* @codegenCommand yarn codegen-styles
|
|
8
|
-
*/
|
|
9
|
-
export declare const spacingScale: readonly ["space.0", "space.025", "space.050", "space.075", "space.100", "space.150", "space.200", "space.250", "space.300", "space.400", "space.500", "space.600", "space.800", "space.1000"];
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { type FC, type ReactNode } from 'react';
|
|
3
|
-
import type { BasePrimitiveProps } from './types';
|
|
4
|
-
declare const asAllowlist: readonly [
|
|
5
|
-
"span",
|
|
6
|
-
"div",
|
|
7
|
-
"p",
|
|
8
|
-
"strong"
|
|
9
|
-
];
|
|
10
|
-
type AsElement = (typeof asAllowlist)[number];
|
|
11
|
-
export interface TextProps extends BasePrimitiveProps {
|
|
12
|
-
/**
|
|
13
|
-
* HTML tag to be rendered. Defaults to `span`.
|
|
14
|
-
*/
|
|
15
|
-
as?: AsElement;
|
|
16
|
-
/**
|
|
17
|
-
* Elements rendered within the Text element
|
|
18
|
-
*/
|
|
19
|
-
children: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* Text color
|
|
22
|
-
*/
|
|
23
|
-
color?: TextColor;
|
|
24
|
-
/**
|
|
25
|
-
* The HTML id attribute https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
|
|
26
|
-
*/
|
|
27
|
-
id?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Font size https://developer.mozilla.org/en-US/docs/Web/CSS/font-size
|
|
30
|
-
*/
|
|
31
|
-
fontSize?: FontSize;
|
|
32
|
-
/**
|
|
33
|
-
* Font weight https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
|
|
34
|
-
*/
|
|
35
|
-
fontWeight?: FontWeight;
|
|
36
|
-
/**
|
|
37
|
-
* Line height https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
|
|
38
|
-
*/
|
|
39
|
-
lineHeight?: LineHeight;
|
|
40
|
-
/**
|
|
41
|
-
* Truncates text with an ellipsis when text overflows its parent container
|
|
42
|
-
* (i.e. `width` has been set on parent that is shorter than text length).
|
|
43
|
-
*/
|
|
44
|
-
shouldTruncate?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Text align https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
|
|
47
|
-
*/
|
|
48
|
-
textAlign?: TextAlign;
|
|
49
|
-
/**
|
|
50
|
-
* Text transform https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform
|
|
51
|
-
*/
|
|
52
|
-
textTransform?: TextTransform;
|
|
53
|
-
/**
|
|
54
|
-
* Vertical align https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align
|
|
55
|
-
*/
|
|
56
|
-
verticalAlign?: VerticalAlign;
|
|
57
|
-
}
|
|
58
|
-
type TextAlign = keyof typeof textAlignMap;
|
|
59
|
-
declare const textAlignMap: {
|
|
60
|
-
center: import("@emotion/react").SerializedStyles;
|
|
61
|
-
end: import("@emotion/react").SerializedStyles;
|
|
62
|
-
start: import("@emotion/react").SerializedStyles;
|
|
63
|
-
};
|
|
64
|
-
type TextTransform = keyof typeof textTransformMap;
|
|
65
|
-
declare const textTransformMap: {
|
|
66
|
-
none: import("@emotion/react").SerializedStyles;
|
|
67
|
-
lowercase: import("@emotion/react").SerializedStyles;
|
|
68
|
-
uppercase: import("@emotion/react").SerializedStyles;
|
|
69
|
-
};
|
|
70
|
-
type VerticalAlign = keyof typeof verticalAlignMap;
|
|
71
|
-
declare const verticalAlignMap: {
|
|
72
|
-
top: import("@emotion/react").SerializedStyles;
|
|
73
|
-
middle: import("@emotion/react").SerializedStyles;
|
|
74
|
-
bottom: import("@emotion/react").SerializedStyles;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* __Text__
|
|
78
|
-
*
|
|
79
|
-
* Text is a primitive component that has the Atlassian Design System's design guidelines baked in.
|
|
80
|
-
* This includes considerations for text attributes such as color, font size, font weight, and line height.
|
|
81
|
-
* It renders a `span` by default.
|
|
82
|
-
*
|
|
83
|
-
* @internal
|
|
84
|
-
*/
|
|
85
|
-
declare const Text: FC<TextProps>;
|
|
86
|
-
export default Text;
|
|
87
|
-
/**
|
|
88
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
89
|
-
* @codegen <<SignedSource::c5a6cec604462dc4b48aaf1160b83e59>>
|
|
90
|
-
* @codegenId typography
|
|
91
|
-
* @codegenCommand yarn codegen-styles
|
|
92
|
-
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight"]
|
|
93
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-typography-adg3.tsx <<SignedSource::bf3349cf2247aa44fbac47c953fc03b5>>
|
|
94
|
-
*/
|
|
95
|
-
declare const fontSizeMap: {
|
|
96
|
-
'size.050': import("@emotion/react").SerializedStyles;
|
|
97
|
-
'size.075': import("@emotion/react").SerializedStyles;
|
|
98
|
-
'size.100': import("@emotion/react").SerializedStyles;
|
|
99
|
-
'size.200': import("@emotion/react").SerializedStyles;
|
|
100
|
-
'size.300': import("@emotion/react").SerializedStyles;
|
|
101
|
-
'size.400': import("@emotion/react").SerializedStyles;
|
|
102
|
-
'size.500': import("@emotion/react").SerializedStyles;
|
|
103
|
-
'size.600': import("@emotion/react").SerializedStyles;
|
|
104
|
-
};
|
|
105
|
-
export type FontSize = keyof typeof fontSizeMap;
|
|
106
|
-
declare const fontWeightMap: {
|
|
107
|
-
bold: import("@emotion/react").SerializedStyles;
|
|
108
|
-
medium: import("@emotion/react").SerializedStyles;
|
|
109
|
-
regular: import("@emotion/react").SerializedStyles;
|
|
110
|
-
semibold: import("@emotion/react").SerializedStyles;
|
|
111
|
-
};
|
|
112
|
-
export type FontWeight = keyof typeof fontWeightMap;
|
|
113
|
-
declare const fontFamilyMap: {
|
|
114
|
-
body: import("@emotion/react").SerializedStyles;
|
|
115
|
-
'brand.body': import("@emotion/react").SerializedStyles;
|
|
116
|
-
'brand.heading': import("@emotion/react").SerializedStyles;
|
|
117
|
-
code: import("@emotion/react").SerializedStyles;
|
|
118
|
-
heading: import("@emotion/react").SerializedStyles;
|
|
119
|
-
monospace: import("@emotion/react").SerializedStyles;
|
|
120
|
-
sans: import("@emotion/react").SerializedStyles;
|
|
121
|
-
};
|
|
122
|
-
export type FontFamily = keyof typeof fontFamilyMap;
|
|
123
|
-
declare const lineHeightMap: {
|
|
124
|
-
'lineHeight.1': import("@emotion/react").SerializedStyles;
|
|
125
|
-
'lineHeight.100': import("@emotion/react").SerializedStyles;
|
|
126
|
-
'lineHeight.200': import("@emotion/react").SerializedStyles;
|
|
127
|
-
'lineHeight.300': import("@emotion/react").SerializedStyles;
|
|
128
|
-
'lineHeight.400': import("@emotion/react").SerializedStyles;
|
|
129
|
-
'lineHeight.500': import("@emotion/react").SerializedStyles;
|
|
130
|
-
'lineHeight.600': import("@emotion/react").SerializedStyles;
|
|
131
|
-
};
|
|
132
|
-
export type LineHeight = keyof typeof lineHeightMap;
|
|
133
|
-
/**
|
|
134
|
-
* @codegenEnd
|
|
135
|
-
*/
|
|
136
|
-
/**
|
|
137
|
-
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
138
|
-
* @codegen <<SignedSource::db9171c09481d187d83bb01192c16c41>>
|
|
139
|
-
* @codegenId colors
|
|
140
|
-
* @codegenCommand yarn codegen-styles
|
|
141
|
-
* @codegenParams ["text"]
|
|
142
|
-
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::f27d1519d51cc4a85383a00907847774>>
|
|
143
|
-
*/
|
|
144
|
-
declare const textColorMap: {
|
|
145
|
-
readonly 'color.text': import("@emotion/react").SerializedStyles;
|
|
146
|
-
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
147
|
-
readonly inverse: import("@emotion/react").SerializedStyles;
|
|
148
|
-
readonly selected: import("@emotion/react").SerializedStyles;
|
|
149
|
-
readonly brand: import("@emotion/react").SerializedStyles;
|
|
150
|
-
readonly danger: import("@emotion/react").SerializedStyles;
|
|
151
|
-
readonly warning: import("@emotion/react").SerializedStyles;
|
|
152
|
-
readonly 'warning.inverse': import("@emotion/react").SerializedStyles;
|
|
153
|
-
readonly success: import("@emotion/react").SerializedStyles;
|
|
154
|
-
readonly discovery: import("@emotion/react").SerializedStyles;
|
|
155
|
-
readonly information: import("@emotion/react").SerializedStyles;
|
|
156
|
-
readonly subtlest: import("@emotion/react").SerializedStyles;
|
|
157
|
-
readonly subtle: import("@emotion/react").SerializedStyles;
|
|
158
|
-
};
|
|
159
|
-
export type TextColor = keyof typeof textColorMap;
|
|
160
|
-
/**
|
|
161
|
-
* @codegenEnd
|
|
162
|
-
*/
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
*
|
|
4
|
-
* Internal codegen of the spacing scale values. Only used for internal examples.
|
|
5
|
-
*
|
|
6
|
-
* @codegen <<SignedSource::33634cd9767c59b9aaaf64fc6f44f852>>
|
|
7
|
-
* @codegenCommand yarn codegen-styles
|
|
8
|
-
*/
|
|
9
|
-
export declare const spacingScale: readonly [
|
|
10
|
-
"space.0",
|
|
11
|
-
"space.025",
|
|
12
|
-
"space.050",
|
|
13
|
-
"space.075",
|
|
14
|
-
"space.100",
|
|
15
|
-
"space.150",
|
|
16
|
-
"space.200",
|
|
17
|
-
"space.250",
|
|
18
|
-
"space.300",
|
|
19
|
-
"space.400",
|
|
20
|
-
"space.500",
|
|
21
|
-
"space.600",
|
|
22
|
-
"space.800",
|
|
23
|
-
"space.1000"
|
|
24
|
-
];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
4
|
-
|
|
5
|
-
import Text from '../src/components/text.partial';
|
|
6
|
-
|
|
7
|
-
const boxStyles = xcss({
|
|
8
|
-
display: 'flex',
|
|
9
|
-
paddingBlock: 'space.400',
|
|
10
|
-
paddingInline: 'space.400',
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export default () => {
|
|
15
|
-
return (
|
|
16
|
-
<Inline space="space.100">
|
|
17
|
-
<Box xcss={boxStyles} backgroundColor="color.background.information">
|
|
18
|
-
<Text>
|
|
19
|
-
<Text>Text that deletes its redundant wrapping</Text>
|
|
20
|
-
</Text>
|
|
21
|
-
</Box>
|
|
22
|
-
<Box xcss={boxStyles} backgroundColor="color.background.information">
|
|
23
|
-
<Text fontWeight="semibold">Text on information</Text>
|
|
24
|
-
</Box>
|
|
25
|
-
<Box xcss={boxStyles} backgroundColor="color.background.brand.bold">
|
|
26
|
-
<Text fontWeight="semibold">Text on brand bold</Text>
|
|
27
|
-
</Box>
|
|
28
|
-
</Inline>
|
|
29
|
-
);
|
|
30
|
-
};
|