@atlaskit/ds-explorations 2.1.0 → 2.1.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 +12 -0
- package/box/package.json +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +20 -20
- package/dist/types/components/inline.partial.d.ts +4 -4
- package/dist/types/components/interaction-surface.partial.d.ts +1 -1
- package/dist/types/components/stack.partial.d.ts +4 -4
- package/dist/types/components/text.partial.d.ts +9 -9
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/internal/color-map.d.ts +9 -9
- package/dist/types/internal/role-to-element.d.ts +3 -3
- package/dist/types-ts4.5/components/box.partial.d.ts +355 -0
- package/dist/types-ts4.5/components/inline.partial.d.ts +108 -0
- package/dist/types-ts4.5/components/interaction-surface.partial.d.ts +49 -0
- package/dist/types-ts4.5/components/stack.partial.d.ts +92 -0
- package/dist/types-ts4.5/components/surface-provider.d.ts +15 -0
- package/dist/types-ts4.5/components/text.partial.d.ts +156 -0
- package/dist/types-ts4.5/components/types.d.ts +13 -0
- package/dist/types-ts4.5/constants.d.ts +12 -0
- package/dist/types-ts4.5/index.d.ts +9 -0
- package/dist/types-ts4.5/internal/color-map.d.ts +36 -0
- package/dist/types-ts4.5/internal/role-to-element.d.ts +32 -0
- package/dist/types-ts4.5/internal/spacing-scale.d.ts +24 -0
- package/inline/package.json +2 -2
- package/package.json +6 -5
- package/stack/package.json +2 -2
- package/text/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +622 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC, 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::9f746e797b8b5262d58b40dfecb39e6d>>
|
|
90
|
+
* @codegenId typography
|
|
91
|
+
* @codegenCommand yarn codegen-styles
|
|
92
|
+
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight"]
|
|
93
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-typography.tsx <<SignedSource::e6bf70c53b8eecdb84ae4c79966537e3>>
|
|
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
|
+
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.100': import("@emotion/react").SerializedStyles;
|
|
120
|
+
'lineHeight.200': import("@emotion/react").SerializedStyles;
|
|
121
|
+
'lineHeight.300': import("@emotion/react").SerializedStyles;
|
|
122
|
+
'lineHeight.400': import("@emotion/react").SerializedStyles;
|
|
123
|
+
'lineHeight.500': import("@emotion/react").SerializedStyles;
|
|
124
|
+
'lineHeight.600': import("@emotion/react").SerializedStyles;
|
|
125
|
+
};
|
|
126
|
+
export type LineHeight = keyof typeof lineHeightMap;
|
|
127
|
+
/**
|
|
128
|
+
* @codegenEnd
|
|
129
|
+
*/
|
|
130
|
+
/**
|
|
131
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
132
|
+
* @codegen <<SignedSource::3780858df77f5fe0c6e0f39a4c989741>>
|
|
133
|
+
* @codegenId colors
|
|
134
|
+
* @codegenCommand yarn codegen-styles
|
|
135
|
+
* @codegenParams ["text"]
|
|
136
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
137
|
+
*/
|
|
138
|
+
declare const textColorMap: {
|
|
139
|
+
readonly 'color.text': import("@emotion/react").SerializedStyles;
|
|
140
|
+
readonly disabled: import("@emotion/react").SerializedStyles;
|
|
141
|
+
readonly inverse: import("@emotion/react").SerializedStyles;
|
|
142
|
+
readonly selected: import("@emotion/react").SerializedStyles;
|
|
143
|
+
readonly brand: import("@emotion/react").SerializedStyles;
|
|
144
|
+
readonly danger: import("@emotion/react").SerializedStyles;
|
|
145
|
+
readonly warning: import("@emotion/react").SerializedStyles;
|
|
146
|
+
readonly 'warning.inverse': import("@emotion/react").SerializedStyles;
|
|
147
|
+
readonly success: import("@emotion/react").SerializedStyles;
|
|
148
|
+
readonly discovery: import("@emotion/react").SerializedStyles;
|
|
149
|
+
readonly information: import("@emotion/react").SerializedStyles;
|
|
150
|
+
readonly subtlest: import("@emotion/react").SerializedStyles;
|
|
151
|
+
readonly subtle: import("@emotion/react").SerializedStyles;
|
|
152
|
+
};
|
|
153
|
+
export type TextColor = keyof typeof textColorMap;
|
|
154
|
+
/**
|
|
155
|
+
* @codegenEnd
|
|
156
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
export interface BasePrimitiveProps {
|
|
3
|
+
/**
|
|
4
|
+
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
5
|
+
*/
|
|
6
|
+
testId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Inline styles to be applied to the primitive.
|
|
9
|
+
* Marked as "unsafe" because any CSS properties can be provided here without any extra control or validation, including those that would be better managed by the primitive itself via props.
|
|
10
|
+
* Effectively equivalent to the standard `style` prop but marked with a special name so we can rationalise its usage IN THE FUTURE.
|
|
11
|
+
*/
|
|
12
|
+
UNSAFE_style?: CSSProperties;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const LAYERS: {
|
|
2
|
+
readonly card: 100;
|
|
3
|
+
readonly navigation: 200;
|
|
4
|
+
readonly dialog: 300;
|
|
5
|
+
readonly layer: 400;
|
|
6
|
+
readonly blanket: 500;
|
|
7
|
+
readonly modal: 510;
|
|
8
|
+
readonly flag: 600;
|
|
9
|
+
readonly spotlight: 700;
|
|
10
|
+
readonly tooltip: 800;
|
|
11
|
+
};
|
|
12
|
+
export type Layer = keyof typeof LAYERS;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as UNSAFE_Box } from './components/box.partial';
|
|
2
|
+
export { default as UNSAFE_Text } from './components/text.partial';
|
|
3
|
+
export { default as UNSAFE_Inline } from './components/inline.partial';
|
|
4
|
+
export { default as UNSAFE_Stack } from './components/stack.partial';
|
|
5
|
+
export { default as UNSAFE_InteractionSurface } from './components/interaction-surface.partial';
|
|
6
|
+
export type { BoxProps as UNSAFE_BoxProps } from './components/box.partial';
|
|
7
|
+
export type { TextProps as UNSAFE_TextProps } from './components/text.partial';
|
|
8
|
+
export type { InlineProps as UNSAFE_InlineProps } from './components/inline.partial';
|
|
9
|
+
export type { StackProps as UNSAFE_StackProps } from './components/stack.partial';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* The color map is used to map a background color token to a matching text color that will meet contrast.
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::d168519874a16bbb92cfbfd4747a39b4>>
|
|
7
|
+
* @codegenCommand yarn codegen-styles
|
|
8
|
+
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-light.tsx <<SignedSource::10aa7e87eca39e4d6594a764e78e0698>>
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: {
|
|
11
|
+
readonly 'neutral.bold': "inverse";
|
|
12
|
+
readonly 'neutral.bold.hovered': "inverse";
|
|
13
|
+
readonly 'neutral.bold.pressed': "inverse";
|
|
14
|
+
readonly 'selected.bold': "inverse";
|
|
15
|
+
readonly 'selected.bold.hovered': "inverse";
|
|
16
|
+
readonly 'selected.bold.pressed': "inverse";
|
|
17
|
+
readonly 'brand.bold': "inverse";
|
|
18
|
+
readonly 'brand.bold.hovered': "inverse";
|
|
19
|
+
readonly 'brand.bold.pressed': "inverse";
|
|
20
|
+
readonly 'danger.bold': "inverse";
|
|
21
|
+
readonly 'danger.bold.hovered': "inverse";
|
|
22
|
+
readonly 'danger.bold.pressed': "inverse";
|
|
23
|
+
readonly 'warning.bold': "warning.inverse";
|
|
24
|
+
readonly 'warning.bold.hovered': "warning.inverse";
|
|
25
|
+
readonly 'warning.bold.pressed': "warning.inverse";
|
|
26
|
+
readonly 'success.bold': "inverse";
|
|
27
|
+
readonly 'success.bold.hovered': "inverse";
|
|
28
|
+
readonly 'success.bold.pressed': "inverse";
|
|
29
|
+
readonly 'discovery.bold': "inverse";
|
|
30
|
+
readonly 'discovery.bold.hovered': "inverse";
|
|
31
|
+
readonly 'discovery.bold.pressed': "inverse";
|
|
32
|
+
readonly 'information.bold': "inverse";
|
|
33
|
+
readonly 'information.bold.hovered': "inverse";
|
|
34
|
+
readonly 'information.bold.pressed': "inverse";
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Adapted straight from react-mui, with a small change.
|
|
4
|
+
* @see https://www.unpkg.com/browse/react-gui@0.2.1/src/modules/getAccessibilityElementWithSideEffect.js
|
|
5
|
+
*/
|
|
6
|
+
declare const roleToElementType: {
|
|
7
|
+
readonly article: "article";
|
|
8
|
+
readonly banner: "header";
|
|
9
|
+
readonly blockquote: "blockquote";
|
|
10
|
+
readonly button: "button";
|
|
11
|
+
readonly code: "code";
|
|
12
|
+
readonly complementary: "aside";
|
|
13
|
+
readonly contentinfo: "footer";
|
|
14
|
+
readonly deletion: "del";
|
|
15
|
+
readonly emphasis: "em";
|
|
16
|
+
readonly figure: "figure";
|
|
17
|
+
readonly insertion: "ins";
|
|
18
|
+
readonly form: "form";
|
|
19
|
+
readonly link: "a";
|
|
20
|
+
readonly list: "ul";
|
|
21
|
+
readonly listitem: "li";
|
|
22
|
+
readonly main: "main";
|
|
23
|
+
readonly navigation: "nav";
|
|
24
|
+
readonly region: "section";
|
|
25
|
+
readonly strong: "strong";
|
|
26
|
+
readonly presentation: "div";
|
|
27
|
+
readonly group: "fieldset";
|
|
28
|
+
};
|
|
29
|
+
type RoleMap = typeof roleToElementType;
|
|
30
|
+
export type Role = keyof RoleMap;
|
|
31
|
+
export type SupportedElements = RoleMap[Role] & keyof JSX.IntrinsicElements;
|
|
32
|
+
export default roleToElementType;
|
|
@@ -0,0 +1,24 @@
|
|
|
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::885d6c601dfa9fccaf33a7bd461ef59d>>
|
|
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
|
+
];
|
package/inline/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/components/inline.partial.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/components/inline.partial.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/ds-explorations",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "An experimental package for exploration and validation of spacing / typography foundations.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"atlassian": {
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
"module:es2019": "dist/es2019/index.js",
|
|
23
23
|
"types": "dist/types/index.d.ts",
|
|
24
24
|
"typesVersions": {
|
|
25
|
-
">=4.
|
|
25
|
+
">=4.5 <4.9": {
|
|
26
26
|
"*": [
|
|
27
|
-
"dist/types-ts4.
|
|
27
|
+
"dist/types-ts4.5/*",
|
|
28
|
+
"dist/types-ts4.5/index.d.ts"
|
|
28
29
|
]
|
|
29
30
|
}
|
|
30
31
|
},
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"./inline": "./src/components/inline.partial.tsx"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@atlaskit/tokens": "^1.
|
|
42
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
42
43
|
"@babel/runtime": "^7.0.0",
|
|
43
44
|
"@emotion/react": "^11.7.1",
|
|
44
45
|
"tiny-invariant": "^1.2.0"
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"prettier": "^2.8.0",
|
|
70
71
|
"react-dom": "^16.8.0",
|
|
71
72
|
"ts-node": "^10.9.1",
|
|
72
|
-
"typescript": "4.
|
|
73
|
+
"typescript": "~4.9.5",
|
|
73
74
|
"wait-for-expect": "^1.2.0"
|
|
74
75
|
},
|
|
75
76
|
"techstack": {
|
package/stack/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/components/stack.partial.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/components/stack.partial.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/text/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/components/text.partial.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/components/text.partial.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|