@atlaskit/ds-explorations 0.0.2 → 0.1.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 +27 -0
- package/dist/cjs/components/box.partial.js +217 -82
- package/dist/cjs/components/inline.partial.js +120 -0
- package/dist/cjs/components/stack.partial.js +112 -0
- package/dist/cjs/components/text.partial.js +92 -34
- package/dist/cjs/components/types.js +5 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/index.js +34 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +200 -82
- package/dist/es2019/components/inline.partial.js +107 -0
- package/dist/es2019/components/stack.partial.js +102 -0
- package/dist/es2019/components/text.partial.js +80 -34
- package/dist/es2019/components/types.js +1 -0
- package/dist/es2019/constants.js +2 -0
- package/dist/es2019/index.js +4 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +212 -82
- package/dist/esm/components/inline.partial.js +106 -0
- package/dist/esm/components/stack.partial.js +101 -0
- package/dist/esm/components/text.partial.js +89 -33
- package/dist/esm/components/types.js +1 -0
- package/dist/esm/constants.js +2 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +87 -26
- package/dist/types/components/inline.partial.d.ts +52 -0
- package/dist/types/components/stack.partial.d.ts +47 -0
- package/dist/types/components/text.partial.d.ts +63 -15
- package/dist/types/components/types.d.ts +13 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/index.d.ts +4 -2
- package/examples/00-basic.tsx +18 -1
- package/examples/01-box.tsx +126 -2
- package/examples/02-text.tsx +55 -2
- package/examples/03-stack.tsx +125 -0
- package/examples/04-inline.tsx +134 -0
- package/examples/{03-badge.tsx → 05-badge.tsx} +4 -4
- package/examples/{04-section-message.tsx → 06-section-message.tsx} +5 -5
- package/examples/{05-comment.tsx → 07-comment.tsx} +10 -8
- package/examples/08-lozenge.tsx +29 -0
- package/package.json +2 -2
- package/report.api.md +457 -4
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +80 -47
- package/scripts/codegen-styles.tsx +5 -1
- package/scripts/color-codegen-template.tsx +33 -11
- package/scripts/spacing-codegen-template.tsx +9 -1
- package/src/components/__tests__/unit/box.test.tsx +20 -0
- package/src/components/__tests__/unit/inline.test.tsx +43 -0
- package/src/components/__tests__/unit/stack.test.tsx +31 -0
- package/src/components/__tests__/unit/text.test.tsx +17 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-basic-example-should-match-production-example-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-alignment-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-block-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-inline-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-color-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-border-color-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-border-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-sizes-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-weights-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-line-heights-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-testing-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/box-snapshot-test.tsx +33 -0
- package/src/components/__tests__/visual-regression/inline-snapshot-test.tsx +28 -0
- package/src/components/__tests__/visual-regression/stack-snapshot-test.tsx +28 -0
- package/src/components/__tests__/visual-regression/text-snapshot-test.tsx +31 -0
- package/src/components/box.partial.tsx +253 -116
- package/src/components/inline.partial.tsx +117 -0
- package/src/components/stack.partial.tsx +101 -0
- package/src/components/text.partial.tsx +109 -35
- package/src/components/types.tsx +15 -0
- package/src/constants.tsx +2 -0
- package/src/index.tsx +4 -1
- package/dist/cjs/components/inline.js +0 -45
- package/dist/cjs/components/stack.js +0 -33
- package/dist/es2019/components/inline.js +0 -31
- package/dist/es2019/components/stack.js +0 -22
- package/dist/esm/components/inline.js +0 -30
- package/dist/esm/components/stack.js +0 -21
- package/dist/types/components/inline.d.ts +0 -19
- package/dist/types/components/stack.d.ts +0 -16
- package/src/components/inline.tsx +0 -49
- package/src/components/stack.tsx +0 -30
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { forwardRef, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
5
|
+
|
|
6
|
+
import { GlobalSpacingToken, SPACING_SCALE } from '../constants';
|
|
7
|
+
|
|
8
|
+
import { BasePrimitiveProps } from './types';
|
|
9
|
+
|
|
10
|
+
interface StackProps extends BasePrimitiveProps {
|
|
11
|
+
/**
|
|
12
|
+
* Used to align children along the cross axis.
|
|
13
|
+
*/
|
|
14
|
+
alignItems?: FlexAlignItems;
|
|
15
|
+
/**
|
|
16
|
+
* Used to align children along the main axis.
|
|
17
|
+
*/
|
|
18
|
+
justifyContent?: FlexJustifyContent;
|
|
19
|
+
/**
|
|
20
|
+
* Token representing gap between children.
|
|
21
|
+
*/
|
|
22
|
+
gap: GlobalSpacingToken;
|
|
23
|
+
/**
|
|
24
|
+
* Elements to be rendered inside the Stack.
|
|
25
|
+
*/
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type FlexAlignItems = keyof typeof flexAlignItemsMap;
|
|
30
|
+
const flexAlignItemsMap = {
|
|
31
|
+
center: css({ alignItems: 'center' }),
|
|
32
|
+
baseline: css({ alignItems: 'baseline' }),
|
|
33
|
+
flexStart: css({ alignItems: 'flex-start' }),
|
|
34
|
+
flexEnd: css({ alignItems: 'flex-end' }),
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type FlexJustifyContent = keyof typeof flexJustifyContentMap;
|
|
38
|
+
const flexJustifyContentMap = {
|
|
39
|
+
center: css({ justifyContent: 'center' }),
|
|
40
|
+
flexStart: css({ justifyContent: 'flex-start' }),
|
|
41
|
+
flexEnd: css({ justifyContent: 'flex-end' }),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const baseStyles = css({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
boxSizing: 'border-box',
|
|
47
|
+
flexDirection: 'column',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* __Stack__
|
|
52
|
+
*
|
|
53
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
54
|
+
* Renders a `div` by default.
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
const Stack = forwardRef<HTMLDivElement, StackProps>(
|
|
58
|
+
({ gap, alignItems, justifyContent, children, testId }, ref) => {
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
css={[
|
|
62
|
+
baseStyles,
|
|
63
|
+
gap && gapMap[gap],
|
|
64
|
+
alignItems && flexAlignItemsMap[alignItems],
|
|
65
|
+
justifyContent && flexJustifyContentMap[justifyContent],
|
|
66
|
+
]}
|
|
67
|
+
data-testid={testId}
|
|
68
|
+
ref={ref}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
},
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
export default Stack;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
80
|
+
* @codegen <<SignedSource::ac3192fbc453a94ab5e720d0273556ef>>
|
|
81
|
+
* @codegenId spacing
|
|
82
|
+
* @codegenCommand yarn codegen-styles
|
|
83
|
+
* @codegenParams ["gap"]
|
|
84
|
+
*/
|
|
85
|
+
const gapMap = {
|
|
86
|
+
'sp-0': css({ gap: SPACING_SCALE['sp-0'] }),
|
|
87
|
+
'sp-25': css({ gap: SPACING_SCALE['sp-25'] }),
|
|
88
|
+
'sp-50': css({ gap: SPACING_SCALE['sp-50'] }),
|
|
89
|
+
'sp-75': css({ gap: SPACING_SCALE['sp-75'] }),
|
|
90
|
+
'sp-100': css({ gap: SPACING_SCALE['sp-100'] }),
|
|
91
|
+
'sp-200': css({ gap: SPACING_SCALE['sp-200'] }),
|
|
92
|
+
'sp-300': css({ gap: SPACING_SCALE['sp-300'] }),
|
|
93
|
+
'sp-400': css({ gap: SPACING_SCALE['sp-400'] }),
|
|
94
|
+
'sp-500': css({ gap: SPACING_SCALE['sp-500'] }),
|
|
95
|
+
'sp-600': css({ gap: SPACING_SCALE['sp-600'] }),
|
|
96
|
+
'sp-800': css({ gap: SPACING_SCALE['sp-800'] }),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @codegenEnd
|
|
101
|
+
*/
|
|
@@ -1,33 +1,91 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { CSSProperties, FC, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { css, jsx } from '@emotion/core';
|
|
5
5
|
|
|
6
6
|
import { token } from '@atlaskit/tokens';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import { BasePrimitiveProps } from './types';
|
|
9
|
+
|
|
10
|
+
interface TextProps extends BasePrimitiveProps {
|
|
11
|
+
/**
|
|
12
|
+
* HTML tag to be rendered. Defaults to `span`.
|
|
13
|
+
*/
|
|
14
|
+
as?:
|
|
15
|
+
| 'span'
|
|
16
|
+
| 'h1'
|
|
17
|
+
| 'h2'
|
|
18
|
+
| 'h3'
|
|
19
|
+
| 'h4'
|
|
20
|
+
| 'h5'
|
|
21
|
+
| 'h6'
|
|
22
|
+
| 'label'
|
|
23
|
+
| 'a'
|
|
24
|
+
| 'ul'
|
|
25
|
+
| 'ol'
|
|
26
|
+
| 'p';
|
|
27
|
+
/**
|
|
28
|
+
* Elements rendered within the Text element
|
|
29
|
+
*/
|
|
9
30
|
children: ReactNode;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Text color
|
|
33
|
+
*/
|
|
34
|
+
color?: [TextColor, string];
|
|
35
|
+
/**
|
|
36
|
+
* Font size https://developer.mozilla.org/en-US/docs/Web/CSS/font-size
|
|
37
|
+
*/
|
|
38
|
+
fontSize?: FontSize;
|
|
39
|
+
/**
|
|
40
|
+
* Font weight https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
|
|
41
|
+
*/
|
|
42
|
+
fontWeight?: FontWeight;
|
|
43
|
+
/**
|
|
44
|
+
* Line height https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
|
|
45
|
+
*/
|
|
46
|
+
lineHeight?: LineHeight;
|
|
47
|
+
/**
|
|
48
|
+
* Text align https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
|
|
49
|
+
*/
|
|
50
|
+
textAlign?: TextAlign;
|
|
51
|
+
/**
|
|
52
|
+
* For use with `a` link tags.
|
|
53
|
+
*/
|
|
54
|
+
href?: string;
|
|
14
55
|
}
|
|
15
56
|
|
|
16
|
-
// These values are pulled from @atlaskit/theme
|
|
17
|
-
const fontSize = 14;
|
|
18
|
-
const fontSizeExtraSmall = 11;
|
|
19
|
-
const fontSizeSmall = 12;
|
|
20
57
|
const fontFamily = `-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif`;
|
|
21
58
|
|
|
59
|
+
type FontSize = keyof typeof fontSizeMap;
|
|
22
60
|
const fontSizeMap = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
61
|
+
'11': css({ fontSize: '11px' }),
|
|
62
|
+
'12': css({ fontSize: '12px' }),
|
|
63
|
+
'14': css({ fontSize: '14px' }),
|
|
26
64
|
};
|
|
27
65
|
|
|
66
|
+
type FontWeight = keyof typeof fontWeightMap;
|
|
67
|
+
// NOTE: can't use numbers as keys or Constellation won't build. Weird one.
|
|
28
68
|
const fontWeightMap = {
|
|
29
|
-
400: css({ fontWeight: 400 }),
|
|
30
|
-
500: css({ fontWeight: 500 }),
|
|
69
|
+
'400': css({ fontWeight: 400 }),
|
|
70
|
+
'500': css({ fontWeight: 500 }),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
type LineHeight = keyof typeof lineHeightMap;
|
|
74
|
+
const lineHeightMap = {
|
|
75
|
+
'12px': css({ lineHeight: '12px' }),
|
|
76
|
+
'16px': css({ lineHeight: '16px' }),
|
|
77
|
+
'20px': css({ lineHeight: '20px' }),
|
|
78
|
+
'24px': css({ lineHeight: '24px' }),
|
|
79
|
+
'28px': css({ lineHeight: '28px' }),
|
|
80
|
+
'32px': css({ lineHeight: '32px' }),
|
|
81
|
+
'40px': css({ lineHeight: '40px' }),
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
type TextAlign = keyof typeof textAlignMap;
|
|
85
|
+
const textAlignMap = {
|
|
86
|
+
center: css({ textAlign: 'center' }),
|
|
87
|
+
end: css({ textAlign: 'end' }),
|
|
88
|
+
start: css({ textAlign: 'start' }),
|
|
31
89
|
};
|
|
32
90
|
|
|
33
91
|
const baseStyles = css({
|
|
@@ -37,79 +95,95 @@ const baseStyles = css({
|
|
|
37
95
|
/**
|
|
38
96
|
* __Text__
|
|
39
97
|
*
|
|
40
|
-
*
|
|
98
|
+
* Text is a primitive component that has the Atlassian Design System's design guidelines baked in.
|
|
99
|
+
* This includes considerations for text attributes such as color, font size, font weight, and line height.
|
|
100
|
+
* It renders a `span` by default.
|
|
41
101
|
*
|
|
42
102
|
* @internal
|
|
43
103
|
*/
|
|
44
|
-
|
|
104
|
+
const Text: FC<TextProps> = ({
|
|
45
105
|
as: Component = 'span',
|
|
46
106
|
children,
|
|
47
|
-
color,
|
|
107
|
+
color: colorTuple,
|
|
48
108
|
fontSize,
|
|
49
109
|
fontWeight,
|
|
50
|
-
|
|
110
|
+
lineHeight,
|
|
111
|
+
textAlign,
|
|
112
|
+
href,
|
|
113
|
+
testId,
|
|
114
|
+
UNSAFE_style,
|
|
115
|
+
}: TextProps) => {
|
|
116
|
+
const [color, fallback] = colorTuple || [];
|
|
51
117
|
return (
|
|
52
118
|
<Component
|
|
119
|
+
style={{
|
|
120
|
+
...UNSAFE_style,
|
|
121
|
+
...(fallback && ({ '--ds-co-fb': fallback } as CSSProperties)),
|
|
122
|
+
}}
|
|
53
123
|
css={[
|
|
54
124
|
baseStyles,
|
|
55
125
|
color && textColorMap[color],
|
|
56
126
|
fontSize && fontSizeMap[fontSize],
|
|
57
127
|
fontWeight && fontWeightMap[fontWeight],
|
|
128
|
+
lineHeight && lineHeightMap[lineHeight],
|
|
129
|
+
textAlign && textAlignMap[textAlign],
|
|
58
130
|
]}
|
|
131
|
+
href={href}
|
|
132
|
+
data-testid={testId}
|
|
59
133
|
>
|
|
60
134
|
{children}
|
|
61
135
|
</Component>
|
|
62
136
|
);
|
|
63
|
-
}
|
|
137
|
+
};
|
|
64
138
|
|
|
65
139
|
export default Text;
|
|
66
140
|
|
|
67
141
|
/**
|
|
68
142
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
69
|
-
* @codegen <<SignedSource::
|
|
143
|
+
* @codegen <<SignedSource::85a0a0bc073c7af8fd63101d6c88d59e>>
|
|
70
144
|
* @codegenId colors
|
|
71
145
|
* @codegenCommand yarn codegen-styles
|
|
72
146
|
* @codegenParams ["text"]
|
|
73
147
|
*/
|
|
74
148
|
const textColorMap = {
|
|
75
|
-
|
|
76
|
-
color: token('color.text', '
|
|
149
|
+
'color.text': css({
|
|
150
|
+
color: token('color.text', 'var(--ds-co-fb)'),
|
|
77
151
|
}),
|
|
78
152
|
subtle: css({
|
|
79
|
-
color: token('color.text.subtle', '
|
|
153
|
+
color: token('color.text.subtle', 'var(--ds-co-fb)'),
|
|
80
154
|
}),
|
|
81
155
|
subtlest: css({
|
|
82
|
-
color: token('color.text.subtlest', '
|
|
156
|
+
color: token('color.text.subtlest', 'var(--ds-co-fb)'),
|
|
83
157
|
}),
|
|
84
158
|
disabled: css({
|
|
85
|
-
color: token('color.text.disabled', '
|
|
159
|
+
color: token('color.text.disabled', 'var(--ds-co-fb)'),
|
|
86
160
|
}),
|
|
87
161
|
inverse: css({
|
|
88
|
-
color: token('color.text.inverse', '
|
|
162
|
+
color: token('color.text.inverse', 'var(--ds-co-fb)'),
|
|
89
163
|
}),
|
|
90
164
|
brand: css({
|
|
91
|
-
color: token('color.text.brand', '
|
|
165
|
+
color: token('color.text.brand', 'var(--ds-co-fb)'),
|
|
92
166
|
}),
|
|
93
167
|
selected: css({
|
|
94
|
-
color: token('color.text.selected', '
|
|
168
|
+
color: token('color.text.selected', 'var(--ds-co-fb)'),
|
|
95
169
|
}),
|
|
96
170
|
danger: css({
|
|
97
|
-
color: token('color.text.danger', '
|
|
171
|
+
color: token('color.text.danger', 'var(--ds-co-fb)'),
|
|
98
172
|
}),
|
|
99
173
|
warning: css({
|
|
100
|
-
color: token('color.text.warning', '
|
|
174
|
+
color: token('color.text.warning', 'var(--ds-co-fb)'),
|
|
101
175
|
}),
|
|
102
176
|
'warning.inverse': css({
|
|
103
|
-
color: token('color.text.warning.inverse', '
|
|
177
|
+
color: token('color.text.warning.inverse', 'var(--ds-co-fb)'),
|
|
104
178
|
}),
|
|
105
179
|
success: css({
|
|
106
|
-
color: token('color.text.success', '
|
|
180
|
+
color: token('color.text.success', 'var(--ds-co-fb)'),
|
|
107
181
|
}),
|
|
108
182
|
discovery: css({
|
|
109
|
-
color: token('color.text.discovery', '
|
|
183
|
+
color: token('color.text.discovery', 'var(--ds-co-fb)'),
|
|
110
184
|
}),
|
|
111
185
|
information: css({
|
|
112
|
-
color: token('color.text.information', '
|
|
186
|
+
color: token('color.text.information', 'var(--ds-co-fb)'),
|
|
113
187
|
}),
|
|
114
188
|
};
|
|
115
189
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface BasePrimitiveProps {
|
|
4
|
+
/**
|
|
5
|
+
* A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
6
|
+
*/
|
|
7
|
+
testId?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Inline styles to be applied to the primitive.
|
|
11
|
+
* 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.
|
|
12
|
+
* Effectively equivalent to the standard `style` prop but marked with a special name so we can rationalise its usage IN THE FUTURE.
|
|
13
|
+
*/
|
|
14
|
+
UNSAFE_style?: CSSProperties;
|
|
15
|
+
}
|
package/src/constants.tsx
CHANGED
package/src/index.tsx
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export default
|
|
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';
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = require("react");
|
|
11
|
-
|
|
12
|
-
var _core = require("@emotion/core");
|
|
13
|
-
|
|
14
|
-
var _box = _interopRequireDefault(require("./box.partial"));
|
|
15
|
-
|
|
16
|
-
/** @jsx jsx */
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* __Inline__
|
|
20
|
-
*
|
|
21
|
-
* A Inline {description}.
|
|
22
|
-
*
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
|
-
function Inline(_ref) {
|
|
26
|
-
var as = _ref.as,
|
|
27
|
-
gap = _ref.gap,
|
|
28
|
-
separator = _ref.separator,
|
|
29
|
-
children = _ref.children,
|
|
30
|
-
alignItems = _ref.alignItems;
|
|
31
|
-
|
|
32
|
-
var childCount = _react.Children.count(children);
|
|
33
|
-
|
|
34
|
-
return (0, _core.jsx)(_box.default, {
|
|
35
|
-
as: as,
|
|
36
|
-
flexDirection: "row",
|
|
37
|
-
alignItems: alignItems,
|
|
38
|
-
gap: gap
|
|
39
|
-
}, _react.Children.map(children, function (child, index) {
|
|
40
|
-
return (0, _core.jsx)(_react.Fragment, null, child, separator && index !== childCount - 1 && (0, _core.jsx)(_react.Fragment, null, separator));
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var _default = Inline;
|
|
45
|
-
exports.default = _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _core = require("@emotion/core");
|
|
11
|
-
|
|
12
|
-
var _box = _interopRequireDefault(require("./box.partial"));
|
|
13
|
-
|
|
14
|
-
/** @jsx jsx */
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* __Stack__
|
|
18
|
-
*
|
|
19
|
-
* A Stack {description}.
|
|
20
|
-
*
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
function Stack(_ref) {
|
|
24
|
-
var gap = _ref.gap,
|
|
25
|
-
children = _ref.children;
|
|
26
|
-
return (0, _core.jsx)(_box.default, {
|
|
27
|
-
flexDirection: "column",
|
|
28
|
-
gap: gap
|
|
29
|
-
}, children);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var _default = Stack;
|
|
33
|
-
exports.default = _default;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { Children, Fragment } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/core';
|
|
4
|
-
import Box from './box.partial';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* __Inline__
|
|
8
|
-
*
|
|
9
|
-
* A Inline {description}.
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
function Inline({
|
|
14
|
-
as,
|
|
15
|
-
gap,
|
|
16
|
-
separator,
|
|
17
|
-
children,
|
|
18
|
-
alignItems
|
|
19
|
-
}) {
|
|
20
|
-
const childCount = Children.count(children);
|
|
21
|
-
return jsx(Box, {
|
|
22
|
-
as: as,
|
|
23
|
-
flexDirection: "row",
|
|
24
|
-
alignItems: alignItems,
|
|
25
|
-
gap: gap
|
|
26
|
-
}, Children.map(children, (child, index) => {
|
|
27
|
-
return jsx(Fragment, null, child, separator && index !== childCount - 1 && jsx(Fragment, null, separator));
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default Inline;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import Box from './box.partial';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* __Stack__
|
|
7
|
-
*
|
|
8
|
-
* A Stack {description}.
|
|
9
|
-
*
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
function Stack({
|
|
13
|
-
gap,
|
|
14
|
-
children
|
|
15
|
-
}) {
|
|
16
|
-
return jsx(Box, {
|
|
17
|
-
flexDirection: "column",
|
|
18
|
-
gap: gap
|
|
19
|
-
}, children);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default Stack;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { Children, Fragment } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/core';
|
|
4
|
-
import Box from './box.partial';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* __Inline__
|
|
8
|
-
*
|
|
9
|
-
* A Inline {description}.
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
function Inline(_ref) {
|
|
14
|
-
var as = _ref.as,
|
|
15
|
-
gap = _ref.gap,
|
|
16
|
-
separator = _ref.separator,
|
|
17
|
-
children = _ref.children,
|
|
18
|
-
alignItems = _ref.alignItems;
|
|
19
|
-
var childCount = Children.count(children);
|
|
20
|
-
return jsx(Box, {
|
|
21
|
-
as: as,
|
|
22
|
-
flexDirection: "row",
|
|
23
|
-
alignItems: alignItems,
|
|
24
|
-
gap: gap
|
|
25
|
-
}, Children.map(children, function (child, index) {
|
|
26
|
-
return jsx(Fragment, null, child, separator && index !== childCount - 1 && jsx(Fragment, null, separator));
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default Inline;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
import Box from './box.partial';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* __Stack__
|
|
7
|
-
*
|
|
8
|
-
* A Stack {description}.
|
|
9
|
-
*
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
function Stack(_ref) {
|
|
13
|
-
var gap = _ref.gap,
|
|
14
|
-
children = _ref.children;
|
|
15
|
-
return jsx(Box, {
|
|
16
|
-
flexDirection: "column",
|
|
17
|
-
gap: gap
|
|
18
|
-
}, children);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default Stack;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { GlobalSpacingToken } from '../constants';
|
|
4
|
-
import { BoxProps } from './box.partial';
|
|
5
|
-
interface InlineProps {
|
|
6
|
-
as?: 'ul' | 'ol';
|
|
7
|
-
gap?: GlobalSpacingToken;
|
|
8
|
-
separator?: string;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* __Inline__
|
|
13
|
-
*
|
|
14
|
-
* A Inline {description}.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
declare function Inline({ as, gap, separator, children, alignItems, }: InlineProps & Partial<Pick<BoxProps, 'alignItems' | 'justifyContent'>>): JSX.Element;
|
|
19
|
-
export default Inline;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { GlobalSpacingToken } from '../constants';
|
|
4
|
-
interface StackProps {
|
|
5
|
-
gap: GlobalSpacingToken;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* __Stack__
|
|
10
|
-
*
|
|
11
|
-
* A Stack {description}.
|
|
12
|
-
*
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
declare function Stack({ gap, children }: StackProps): JSX.Element;
|
|
16
|
-
export default Stack;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { Children, Fragment, ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
import { jsx } from '@emotion/core';
|
|
5
|
-
|
|
6
|
-
import { GlobalSpacingToken } from '../constants';
|
|
7
|
-
|
|
8
|
-
import Box, { BoxProps } from './box.partial';
|
|
9
|
-
|
|
10
|
-
interface InlineProps {
|
|
11
|
-
as?: 'ul' | 'ol';
|
|
12
|
-
gap?: GlobalSpacingToken;
|
|
13
|
-
separator?: string;
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* __Inline__
|
|
19
|
-
*
|
|
20
|
-
* A Inline {description}.
|
|
21
|
-
*
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
function Inline({
|
|
25
|
-
as,
|
|
26
|
-
gap,
|
|
27
|
-
separator,
|
|
28
|
-
children,
|
|
29
|
-
alignItems,
|
|
30
|
-
}: InlineProps & Partial<Pick<BoxProps, 'alignItems' | 'justifyContent'>>) {
|
|
31
|
-
const childCount = Children.count(children);
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Box as={as} flexDirection="row" alignItems={alignItems} gap={gap}>
|
|
35
|
-
{Children.map(children, (child, index) => {
|
|
36
|
-
return (
|
|
37
|
-
<Fragment>
|
|
38
|
-
{child}
|
|
39
|
-
{separator && index !== childCount - 1 && (
|
|
40
|
-
<Fragment>{separator}</Fragment>
|
|
41
|
-
)}
|
|
42
|
-
</Fragment>
|
|
43
|
-
);
|
|
44
|
-
})}
|
|
45
|
-
</Box>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default Inline;
|
package/src/components/stack.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
import { jsx } from '@emotion/core';
|
|
5
|
-
|
|
6
|
-
import { GlobalSpacingToken } from '../constants';
|
|
7
|
-
|
|
8
|
-
import Box from './box.partial';
|
|
9
|
-
|
|
10
|
-
interface StackProps {
|
|
11
|
-
gap: GlobalSpacingToken;
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* __Stack__
|
|
17
|
-
*
|
|
18
|
-
* A Stack {description}.
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
function Stack({ gap, children }: StackProps) {
|
|
23
|
-
return (
|
|
24
|
-
<Box flexDirection="column" gap={gap}>
|
|
25
|
-
{children}
|
|
26
|
-
</Box>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default Stack;
|