@atlaskit/ds-explorations 0.0.1 → 0.1.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 +28 -0
- package/LICENSE +13 -0
- package/dist/cjs/components/box.partial.js +495 -0
- 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 +169 -0
- package/dist/cjs/components/types.js +5 -0
- package/dist/cjs/constants.js +20 -0
- package/dist/cjs/index.js +34 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +470 -0
- 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 +148 -0
- package/dist/es2019/components/types.js +1 -0
- package/dist/es2019/constants.js +13 -0
- package/dist/es2019/index.js +4 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +479 -0
- 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 +158 -0
- package/dist/esm/components/types.js +1 -0
- package/dist/esm/constants.js +13 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +186 -0
- 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 +101 -0
- package/dist/types/components/types.d.ts +13 -0
- package/dist/types/constants.d.ts +14 -0
- package/dist/types/index.d.ts +4 -2
- package/docs/01-basic.tsx +19 -0
- package/examples/00-basic.tsx +18 -1
- package/examples/01-box.tsx +131 -0
- package/examples/02-text.tsx +60 -0
- package/examples/03-stack.tsx +125 -0
- package/examples/04-inline.tsx +134 -0
- package/examples/05-badge.tsx +23 -0
- package/examples/06-section-message.tsx +84 -0
- package/examples/07-comment.tsx +55 -0
- package/examples/08-lozenge.tsx +29 -0
- package/package.json +20 -1
- package/report.api.md +463 -0
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +193 -0
- package/scripts/__tests__/codegen.test.tsx +20 -0
- package/scripts/codegen-styles.tsx +47 -0
- package/scripts/color-codegen-template.tsx +105 -0
- package/scripts/spacing-codegen-template.tsx +52 -0
- package/scripts/utils.tsx +22 -0
- 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 +456 -0
- package/src/components/inline.partial.tsx +117 -0
- package/src/components/stack.partial.tsx +101 -0
- package/src/components/text.partial.tsx +194 -0
- package/src/components/types.tsx +15 -0
- package/src/constants.tsx +15 -0
- package/src/index.tsx +4 -1
- package/tsconfig.json +3 -1
- package/dist/cjs/components/box.js +0 -27
- package/dist/cjs/components/inline.js +0 -29
- package/dist/cjs/components/stack.js +0 -29
- package/dist/cjs/components/text.js +0 -25
- package/dist/es2019/components/box.js +0 -18
- package/dist/es2019/components/inline.js +0 -18
- package/dist/es2019/components/stack.js +0 -18
- package/dist/es2019/components/text.js +0 -17
- package/dist/esm/components/box.js +0 -18
- package/dist/esm/components/inline.js +0 -17
- package/dist/esm/components/stack.js +0 -17
- package/dist/esm/components/text.js +0 -16
- package/dist/types/components/box.d.ts +0 -15
- package/dist/types/components/inline.d.ts +0 -14
- package/dist/types/components/stack.d.ts +0 -14
- package/dist/types/components/text.d.ts +0 -13
- package/src/components/box.tsx +0 -22
- package/src/components/inline.tsx +0 -23
- package/src/components/stack.tsx +0 -23
- package/src/components/text.tsx +0 -19
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Children, forwardRef, Fragment } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
|
+
import { SPACING_SCALE } from '../constants';
|
|
5
|
+
import Text from './text.partial';
|
|
6
|
+
var flexAlignItemsMap = {
|
|
7
|
+
center: css({
|
|
8
|
+
alignItems: 'center'
|
|
9
|
+
}),
|
|
10
|
+
baseline: css({
|
|
11
|
+
alignItems: 'baseline'
|
|
12
|
+
}),
|
|
13
|
+
flexStart: css({
|
|
14
|
+
alignItems: 'flex-start'
|
|
15
|
+
}),
|
|
16
|
+
flexEnd: css({
|
|
17
|
+
alignItems: 'flex-end'
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
var flexJustifyContentMap = {
|
|
21
|
+
center: css({
|
|
22
|
+
justifyContent: 'center'
|
|
23
|
+
}),
|
|
24
|
+
flexStart: css({
|
|
25
|
+
justifyContent: 'flex-start'
|
|
26
|
+
}),
|
|
27
|
+
flexEnd: css({
|
|
28
|
+
justifyContent: 'flex-end'
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
var baseStyles = css({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
boxSizing: 'border-box',
|
|
34
|
+
flexDirection: 'row'
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* __Inline__
|
|
38
|
+
*
|
|
39
|
+
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
40
|
+
* Renders a `div` by default.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
var Inline = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
45
|
+
var gap = _ref.gap,
|
|
46
|
+
alignItems = _ref.alignItems,
|
|
47
|
+
justifyContent = _ref.justifyContent,
|
|
48
|
+
divider = _ref.divider,
|
|
49
|
+
children = _ref.children,
|
|
50
|
+
testId = _ref.testId;
|
|
51
|
+
var dividerComponent = typeof divider === 'string' ? jsx(Text, null, divider) : divider;
|
|
52
|
+
return jsx("div", {
|
|
53
|
+
css: [baseStyles, gap && gapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent]],
|
|
54
|
+
"data-testid": testId,
|
|
55
|
+
ref: ref
|
|
56
|
+
}, Children.map(children, function (child, index) {
|
|
57
|
+
return jsx(Fragment, null, divider && index > 0 ? dividerComponent : null, child);
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
export default Inline;
|
|
61
|
+
/**
|
|
62
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
63
|
+
* @codegen <<SignedSource::ac3192fbc453a94ab5e720d0273556ef>>
|
|
64
|
+
* @codegenId spacing
|
|
65
|
+
* @codegenCommand yarn codegen-styles
|
|
66
|
+
* @codegenParams ["gap"]
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
var gapMap = {
|
|
70
|
+
'sp-0': css({
|
|
71
|
+
gap: SPACING_SCALE['sp-0']
|
|
72
|
+
}),
|
|
73
|
+
'sp-25': css({
|
|
74
|
+
gap: SPACING_SCALE['sp-25']
|
|
75
|
+
}),
|
|
76
|
+
'sp-50': css({
|
|
77
|
+
gap: SPACING_SCALE['sp-50']
|
|
78
|
+
}),
|
|
79
|
+
'sp-75': css({
|
|
80
|
+
gap: SPACING_SCALE['sp-75']
|
|
81
|
+
}),
|
|
82
|
+
'sp-100': css({
|
|
83
|
+
gap: SPACING_SCALE['sp-100']
|
|
84
|
+
}),
|
|
85
|
+
'sp-200': css({
|
|
86
|
+
gap: SPACING_SCALE['sp-200']
|
|
87
|
+
}),
|
|
88
|
+
'sp-300': css({
|
|
89
|
+
gap: SPACING_SCALE['sp-300']
|
|
90
|
+
}),
|
|
91
|
+
'sp-400': css({
|
|
92
|
+
gap: SPACING_SCALE['sp-400']
|
|
93
|
+
}),
|
|
94
|
+
'sp-500': css({
|
|
95
|
+
gap: SPACING_SCALE['sp-500']
|
|
96
|
+
}),
|
|
97
|
+
'sp-600': css({
|
|
98
|
+
gap: SPACING_SCALE['sp-600']
|
|
99
|
+
}),
|
|
100
|
+
'sp-800': css({
|
|
101
|
+
gap: SPACING_SCALE['sp-800']
|
|
102
|
+
})
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* @codegenEnd
|
|
106
|
+
*/
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
|
+
import { SPACING_SCALE } from '../constants';
|
|
5
|
+
var flexAlignItemsMap = {
|
|
6
|
+
center: css({
|
|
7
|
+
alignItems: 'center'
|
|
8
|
+
}),
|
|
9
|
+
baseline: css({
|
|
10
|
+
alignItems: 'baseline'
|
|
11
|
+
}),
|
|
12
|
+
flexStart: css({
|
|
13
|
+
alignItems: 'flex-start'
|
|
14
|
+
}),
|
|
15
|
+
flexEnd: css({
|
|
16
|
+
alignItems: 'flex-end'
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
var flexJustifyContentMap = {
|
|
20
|
+
center: css({
|
|
21
|
+
justifyContent: 'center'
|
|
22
|
+
}),
|
|
23
|
+
flexStart: css({
|
|
24
|
+
justifyContent: 'flex-start'
|
|
25
|
+
}),
|
|
26
|
+
flexEnd: css({
|
|
27
|
+
justifyContent: 'flex-end'
|
|
28
|
+
})
|
|
29
|
+
};
|
|
30
|
+
var baseStyles = css({
|
|
31
|
+
display: 'flex',
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
flexDirection: 'column'
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* __Stack__
|
|
37
|
+
*
|
|
38
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
39
|
+
* Renders a `div` by default.
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
var Stack = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
44
|
+
var gap = _ref.gap,
|
|
45
|
+
alignItems = _ref.alignItems,
|
|
46
|
+
justifyContent = _ref.justifyContent,
|
|
47
|
+
children = _ref.children,
|
|
48
|
+
testId = _ref.testId;
|
|
49
|
+
return jsx("div", {
|
|
50
|
+
css: [baseStyles, gap && gapMap[gap], alignItems && flexAlignItemsMap[alignItems], justifyContent && flexJustifyContentMap[justifyContent]],
|
|
51
|
+
"data-testid": testId,
|
|
52
|
+
ref: ref
|
|
53
|
+
}, children);
|
|
54
|
+
});
|
|
55
|
+
export default Stack;
|
|
56
|
+
/**
|
|
57
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
58
|
+
* @codegen <<SignedSource::ac3192fbc453a94ab5e720d0273556ef>>
|
|
59
|
+
* @codegenId spacing
|
|
60
|
+
* @codegenCommand yarn codegen-styles
|
|
61
|
+
* @codegenParams ["gap"]
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
var gapMap = {
|
|
65
|
+
'sp-0': css({
|
|
66
|
+
gap: SPACING_SCALE['sp-0']
|
|
67
|
+
}),
|
|
68
|
+
'sp-25': css({
|
|
69
|
+
gap: SPACING_SCALE['sp-25']
|
|
70
|
+
}),
|
|
71
|
+
'sp-50': css({
|
|
72
|
+
gap: SPACING_SCALE['sp-50']
|
|
73
|
+
}),
|
|
74
|
+
'sp-75': css({
|
|
75
|
+
gap: SPACING_SCALE['sp-75']
|
|
76
|
+
}),
|
|
77
|
+
'sp-100': css({
|
|
78
|
+
gap: SPACING_SCALE['sp-100']
|
|
79
|
+
}),
|
|
80
|
+
'sp-200': css({
|
|
81
|
+
gap: SPACING_SCALE['sp-200']
|
|
82
|
+
}),
|
|
83
|
+
'sp-300': css({
|
|
84
|
+
gap: SPACING_SCALE['sp-300']
|
|
85
|
+
}),
|
|
86
|
+
'sp-400': css({
|
|
87
|
+
gap: SPACING_SCALE['sp-400']
|
|
88
|
+
}),
|
|
89
|
+
'sp-500': css({
|
|
90
|
+
gap: SPACING_SCALE['sp-500']
|
|
91
|
+
}),
|
|
92
|
+
'sp-600': css({
|
|
93
|
+
gap: SPACING_SCALE['sp-600']
|
|
94
|
+
}),
|
|
95
|
+
'sp-800': css({
|
|
96
|
+
gap: SPACING_SCALE['sp-800']
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* @codegenEnd
|
|
101
|
+
*/
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { css, jsx } from '@emotion/core';
|
|
10
|
+
var fontFamily = "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif";
|
|
11
|
+
var fontSizeMap = {
|
|
12
|
+
'11': css({
|
|
13
|
+
fontSize: '11px'
|
|
14
|
+
}),
|
|
15
|
+
'12': css({
|
|
16
|
+
fontSize: '12px'
|
|
17
|
+
}),
|
|
18
|
+
'14': css({
|
|
19
|
+
fontSize: '14px'
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
// NOTE: can't use numbers as keys or Constellation won't build. Weird one.
|
|
23
|
+
var fontWeightMap = {
|
|
24
|
+
'400': css({
|
|
25
|
+
fontWeight: 400
|
|
26
|
+
}),
|
|
27
|
+
'500': css({
|
|
28
|
+
fontWeight: 500
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
var lineHeightMap = {
|
|
32
|
+
'12px': css({
|
|
33
|
+
lineHeight: '12px'
|
|
34
|
+
}),
|
|
35
|
+
'16px': css({
|
|
36
|
+
lineHeight: '16px'
|
|
37
|
+
}),
|
|
38
|
+
'20px': css({
|
|
39
|
+
lineHeight: '20px'
|
|
40
|
+
}),
|
|
41
|
+
'24px': css({
|
|
42
|
+
lineHeight: '24px'
|
|
43
|
+
}),
|
|
44
|
+
'28px': css({
|
|
45
|
+
lineHeight: '28px'
|
|
46
|
+
}),
|
|
47
|
+
'32px': css({
|
|
48
|
+
lineHeight: '32px'
|
|
49
|
+
}),
|
|
50
|
+
'40px': css({
|
|
51
|
+
lineHeight: '40px'
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
var textAlignMap = {
|
|
55
|
+
center: css({
|
|
56
|
+
textAlign: 'center'
|
|
57
|
+
}),
|
|
58
|
+
end: css({
|
|
59
|
+
textAlign: 'end'
|
|
60
|
+
}),
|
|
61
|
+
start: css({
|
|
62
|
+
textAlign: 'start'
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
var baseStyles = css({
|
|
66
|
+
fontFamily: fontFamily
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* __Text__
|
|
70
|
+
*
|
|
71
|
+
* Text is a primitive component that has the Atlassian Design System's design guidelines baked in.
|
|
72
|
+
* This includes considerations for text attributes such as color, font size, font weight, and line height.
|
|
73
|
+
* It renders a `span` by default.
|
|
74
|
+
*
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
var Text = function Text(_ref) {
|
|
79
|
+
var _ref$as = _ref.as,
|
|
80
|
+
Component = _ref$as === void 0 ? 'span' : _ref$as,
|
|
81
|
+
children = _ref.children,
|
|
82
|
+
colorTuple = _ref.color,
|
|
83
|
+
fontSize = _ref.fontSize,
|
|
84
|
+
fontWeight = _ref.fontWeight,
|
|
85
|
+
lineHeight = _ref.lineHeight,
|
|
86
|
+
textAlign = _ref.textAlign,
|
|
87
|
+
href = _ref.href,
|
|
88
|
+
testId = _ref.testId,
|
|
89
|
+
UNSAFE_style = _ref.UNSAFE_style;
|
|
90
|
+
|
|
91
|
+
var _ref2 = colorTuple || [],
|
|
92
|
+
_ref3 = _slicedToArray(_ref2, 2),
|
|
93
|
+
color = _ref3[0],
|
|
94
|
+
fallback = _ref3[1];
|
|
95
|
+
|
|
96
|
+
return jsx(Component, {
|
|
97
|
+
style: _objectSpread(_objectSpread({}, UNSAFE_style), fallback && {
|
|
98
|
+
'--ds-co-fb': fallback
|
|
99
|
+
}),
|
|
100
|
+
css: [baseStyles, color && textColorMap[color], fontSize && fontSizeMap[fontSize], fontWeight && fontWeightMap[fontWeight], lineHeight && lineHeightMap[lineHeight], textAlign && textAlignMap[textAlign]],
|
|
101
|
+
href: href,
|
|
102
|
+
"data-testid": testId
|
|
103
|
+
}, children);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default Text;
|
|
107
|
+
/**
|
|
108
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
109
|
+
* @codegen <<SignedSource::85a0a0bc073c7af8fd63101d6c88d59e>>
|
|
110
|
+
* @codegenId colors
|
|
111
|
+
* @codegenCommand yarn codegen-styles
|
|
112
|
+
* @codegenParams ["text"]
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
var textColorMap = {
|
|
116
|
+
'color.text': css({
|
|
117
|
+
color: "var(--ds-text, var(--ds-co-fb))"
|
|
118
|
+
}),
|
|
119
|
+
subtle: css({
|
|
120
|
+
color: "var(--ds-text-subtle, var(--ds-co-fb))"
|
|
121
|
+
}),
|
|
122
|
+
subtlest: css({
|
|
123
|
+
color: "var(--ds-text-subtlest, var(--ds-co-fb))"
|
|
124
|
+
}),
|
|
125
|
+
disabled: css({
|
|
126
|
+
color: "var(--ds-text-disabled, var(--ds-co-fb))"
|
|
127
|
+
}),
|
|
128
|
+
inverse: css({
|
|
129
|
+
color: "var(--ds-text-inverse, var(--ds-co-fb))"
|
|
130
|
+
}),
|
|
131
|
+
brand: css({
|
|
132
|
+
color: "var(--ds-text-brand, var(--ds-co-fb))"
|
|
133
|
+
}),
|
|
134
|
+
selected: css({
|
|
135
|
+
color: "var(--ds-text-selected, var(--ds-co-fb))"
|
|
136
|
+
}),
|
|
137
|
+
danger: css({
|
|
138
|
+
color: "var(--ds-text-danger, var(--ds-co-fb))"
|
|
139
|
+
}),
|
|
140
|
+
warning: css({
|
|
141
|
+
color: "var(--ds-text-warning, var(--ds-co-fb))"
|
|
142
|
+
}),
|
|
143
|
+
'warning.inverse': css({
|
|
144
|
+
color: "var(--ds-text-warning-inverse, var(--ds-co-fb))"
|
|
145
|
+
}),
|
|
146
|
+
success: css({
|
|
147
|
+
color: "var(--ds-text-success, var(--ds-co-fb))"
|
|
148
|
+
}),
|
|
149
|
+
discovery: css({
|
|
150
|
+
color: "var(--ds-text-discovery, var(--ds-co-fb))"
|
|
151
|
+
}),
|
|
152
|
+
information: css({
|
|
153
|
+
color: "var(--ds-text-information, var(--ds-co-fb))"
|
|
154
|
+
})
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* @codegenEnd
|
|
158
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/index.js
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';
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { GlobalSpacingToken } from '../constants';
|
|
4
|
+
import { BasePrimitiveProps } from './types';
|
|
5
|
+
export interface BoxProps extends Omit<HTMLAttributes<HTMLElement>, 'style'>, BasePrimitiveProps {
|
|
6
|
+
/**
|
|
7
|
+
* The DOM element to render as the Box. Defaults to `div`.
|
|
8
|
+
*/
|
|
9
|
+
as?: ElementType;
|
|
10
|
+
/**
|
|
11
|
+
* Elements to be rendered inside the Box.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Token representing background color with a fallback.
|
|
16
|
+
*/
|
|
17
|
+
backgroundColor?: [BackgroundColor, string];
|
|
18
|
+
/**
|
|
19
|
+
* Defines border style.
|
|
20
|
+
*/
|
|
21
|
+
borderStyle?: BorderStyle;
|
|
22
|
+
/**
|
|
23
|
+
* Defines border width.
|
|
24
|
+
*/
|
|
25
|
+
borderWidth?: BorderWidth;
|
|
26
|
+
/**
|
|
27
|
+
* Token representing border color with a fallback.
|
|
28
|
+
*/
|
|
29
|
+
borderColor?: [BorderColor, string];
|
|
30
|
+
/**
|
|
31
|
+
* Defines border radius.
|
|
32
|
+
*/
|
|
33
|
+
borderRadius?: BorderRadius;
|
|
34
|
+
/**
|
|
35
|
+
* Defines the main axis direction.
|
|
36
|
+
*/
|
|
37
|
+
flexDirection?: FlexDirection;
|
|
38
|
+
/**
|
|
39
|
+
* Used to align children along the cross axis.
|
|
40
|
+
*/
|
|
41
|
+
alignItems?: FlexAlignItems;
|
|
42
|
+
/**
|
|
43
|
+
* Used to align children along the main axis.
|
|
44
|
+
*/
|
|
45
|
+
justifyContent?: FlexJustifyContent;
|
|
46
|
+
/**
|
|
47
|
+
* Shorthand for `paddingBlock` and `paddingInline` together.
|
|
48
|
+
*
|
|
49
|
+
* @see paddingBlock
|
|
50
|
+
* @see paddingInline
|
|
51
|
+
*/
|
|
52
|
+
padding?: GlobalSpacingToken;
|
|
53
|
+
/**
|
|
54
|
+
* Token representing CSS `padding-block`.
|
|
55
|
+
*/
|
|
56
|
+
paddingBlock?: GlobalSpacingToken;
|
|
57
|
+
/**
|
|
58
|
+
* Token representing CSS `padding-inline`.
|
|
59
|
+
*/
|
|
60
|
+
paddingInline?: GlobalSpacingToken;
|
|
61
|
+
/**
|
|
62
|
+
* Token representing width.
|
|
63
|
+
*/
|
|
64
|
+
width?: GlobalSpacingToken;
|
|
65
|
+
/**
|
|
66
|
+
* Token representing height.
|
|
67
|
+
*/
|
|
68
|
+
height?: GlobalSpacingToken;
|
|
69
|
+
/**
|
|
70
|
+
* Defines display type and layout. Defaults to `flex`.
|
|
71
|
+
*/
|
|
72
|
+
display?: Display;
|
|
73
|
+
}
|
|
74
|
+
declare type BorderStyle = keyof typeof borderStyleMap;
|
|
75
|
+
declare const borderStyleMap: {
|
|
76
|
+
none: import("@emotion/utils").SerializedStyles;
|
|
77
|
+
solid: import("@emotion/utils").SerializedStyles;
|
|
78
|
+
dashed: import("@emotion/utils").SerializedStyles;
|
|
79
|
+
dotted: import("@emotion/utils").SerializedStyles;
|
|
80
|
+
};
|
|
81
|
+
declare type BorderWidth = keyof typeof borderWidthMap;
|
|
82
|
+
declare const borderWidthMap: {
|
|
83
|
+
'0px': import("@emotion/utils").SerializedStyles;
|
|
84
|
+
'1px': import("@emotion/utils").SerializedStyles;
|
|
85
|
+
'2px': import("@emotion/utils").SerializedStyles;
|
|
86
|
+
'3px': import("@emotion/utils").SerializedStyles;
|
|
87
|
+
};
|
|
88
|
+
declare type BorderRadius = keyof typeof borderRadiusMap;
|
|
89
|
+
declare const borderRadiusMap: {
|
|
90
|
+
normal: import("@emotion/utils").SerializedStyles;
|
|
91
|
+
rounded: import("@emotion/utils").SerializedStyles;
|
|
92
|
+
badge: import("@emotion/utils").SerializedStyles;
|
|
93
|
+
};
|
|
94
|
+
declare type FlexDirection = keyof typeof flexDirectionMap;
|
|
95
|
+
declare const flexDirectionMap: {
|
|
96
|
+
column: import("@emotion/utils").SerializedStyles;
|
|
97
|
+
row: import("@emotion/utils").SerializedStyles;
|
|
98
|
+
};
|
|
99
|
+
declare type FlexAlignItems = keyof typeof flexAlignItemsMap;
|
|
100
|
+
declare const flexAlignItemsMap: {
|
|
101
|
+
center: import("@emotion/utils").SerializedStyles;
|
|
102
|
+
baseline: import("@emotion/utils").SerializedStyles;
|
|
103
|
+
flexStart: import("@emotion/utils").SerializedStyles;
|
|
104
|
+
flexEnd: import("@emotion/utils").SerializedStyles;
|
|
105
|
+
};
|
|
106
|
+
declare type FlexJustifyContent = keyof typeof flexJustifyContentMap;
|
|
107
|
+
declare const flexJustifyContentMap: {
|
|
108
|
+
center: import("@emotion/utils").SerializedStyles;
|
|
109
|
+
flexStart: import("@emotion/utils").SerializedStyles;
|
|
110
|
+
flexEnd: import("@emotion/utils").SerializedStyles;
|
|
111
|
+
};
|
|
112
|
+
declare type Display = keyof typeof displayMap;
|
|
113
|
+
declare const displayMap: {
|
|
114
|
+
block: import("@emotion/utils").SerializedStyles;
|
|
115
|
+
inline: import("@emotion/utils").SerializedStyles;
|
|
116
|
+
flex: import("@emotion/utils").SerializedStyles;
|
|
117
|
+
inlineFlex: import("@emotion/utils").SerializedStyles;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* __Box__
|
|
121
|
+
*
|
|
122
|
+
* Box is a primitive component that has the design decisions of the Atlassian Design System baked in.
|
|
123
|
+
* Renders a `div` by default.
|
|
124
|
+
*
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
declare const Box: import("react").ForwardRefExoticComponent<BoxProps & import("react").RefAttributes<HTMLElement>>;
|
|
128
|
+
export default Box;
|
|
129
|
+
/**
|
|
130
|
+
* @codegenEnd
|
|
131
|
+
*/
|
|
132
|
+
/**
|
|
133
|
+
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
134
|
+
* @codegen <<SignedSource::e3f27406477352f51168b4108558f051>>
|
|
135
|
+
* @codegenId colors
|
|
136
|
+
* @codegenCommand yarn codegen-styles
|
|
137
|
+
* @codegenParams ["border", "background"]
|
|
138
|
+
*/
|
|
139
|
+
declare const borderColorMap: {
|
|
140
|
+
'color.border': import("@emotion/utils").SerializedStyles;
|
|
141
|
+
bold: import("@emotion/utils").SerializedStyles;
|
|
142
|
+
inverse: import("@emotion/utils").SerializedStyles;
|
|
143
|
+
focused: import("@emotion/utils").SerializedStyles;
|
|
144
|
+
input: import("@emotion/utils").SerializedStyles;
|
|
145
|
+
disabled: import("@emotion/utils").SerializedStyles;
|
|
146
|
+
brand: import("@emotion/utils").SerializedStyles;
|
|
147
|
+
selected: import("@emotion/utils").SerializedStyles;
|
|
148
|
+
danger: import("@emotion/utils").SerializedStyles;
|
|
149
|
+
warning: import("@emotion/utils").SerializedStyles;
|
|
150
|
+
success: import("@emotion/utils").SerializedStyles;
|
|
151
|
+
discovery: import("@emotion/utils").SerializedStyles;
|
|
152
|
+
information: import("@emotion/utils").SerializedStyles;
|
|
153
|
+
};
|
|
154
|
+
declare type BorderColor = keyof typeof borderColorMap;
|
|
155
|
+
declare const backgroundColorMap: {
|
|
156
|
+
disabled: import("@emotion/utils").SerializedStyles;
|
|
157
|
+
'inverse.subtle': import("@emotion/utils").SerializedStyles;
|
|
158
|
+
input: import("@emotion/utils").SerializedStyles;
|
|
159
|
+
neutral: import("@emotion/utils").SerializedStyles;
|
|
160
|
+
'neutral.subtle': import("@emotion/utils").SerializedStyles;
|
|
161
|
+
'neutral.bold': import("@emotion/utils").SerializedStyles;
|
|
162
|
+
'brand.bold': import("@emotion/utils").SerializedStyles;
|
|
163
|
+
selected: import("@emotion/utils").SerializedStyles;
|
|
164
|
+
'selected.bold': import("@emotion/utils").SerializedStyles;
|
|
165
|
+
danger: import("@emotion/utils").SerializedStyles;
|
|
166
|
+
'danger.bold': import("@emotion/utils").SerializedStyles;
|
|
167
|
+
warning: import("@emotion/utils").SerializedStyles;
|
|
168
|
+
'warning.bold': import("@emotion/utils").SerializedStyles;
|
|
169
|
+
success: import("@emotion/utils").SerializedStyles;
|
|
170
|
+
'success.bold': import("@emotion/utils").SerializedStyles;
|
|
171
|
+
discovery: import("@emotion/utils").SerializedStyles;
|
|
172
|
+
'discovery.bold': import("@emotion/utils").SerializedStyles;
|
|
173
|
+
information: import("@emotion/utils").SerializedStyles;
|
|
174
|
+
'information.bold': import("@emotion/utils").SerializedStyles;
|
|
175
|
+
'color.blanket': import("@emotion/utils").SerializedStyles;
|
|
176
|
+
'color.blanket.selected': import("@emotion/utils").SerializedStyles;
|
|
177
|
+
'color.blanket.danger': import("@emotion/utils").SerializedStyles;
|
|
178
|
+
'elevation.surface': import("@emotion/utils").SerializedStyles;
|
|
179
|
+
'elevation.surface.sunken': import("@emotion/utils").SerializedStyles;
|
|
180
|
+
'elevation.surface.raised': import("@emotion/utils").SerializedStyles;
|
|
181
|
+
'elevation.surface.overlay': import("@emotion/utils").SerializedStyles;
|
|
182
|
+
};
|
|
183
|
+
declare type BackgroundColor = keyof typeof backgroundColorMap;
|
|
184
|
+
/**
|
|
185
|
+
* @codegenEnd
|
|
186
|
+
*/
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { GlobalSpacingToken } from '../constants';
|
|
4
|
+
import { BasePrimitiveProps } from './types';
|
|
5
|
+
interface InlineProps extends BasePrimitiveProps {
|
|
6
|
+
/**
|
|
7
|
+
* Used to align children along the cross axis.
|
|
8
|
+
*/
|
|
9
|
+
alignItems?: FlexAlignItems;
|
|
10
|
+
/**
|
|
11
|
+
* Used to align children along the main axis.
|
|
12
|
+
*/
|
|
13
|
+
justifyContent?: FlexJustifyContent;
|
|
14
|
+
/**
|
|
15
|
+
* Token representing gap between children.
|
|
16
|
+
*/
|
|
17
|
+
gap: GlobalSpacingToken;
|
|
18
|
+
/**
|
|
19
|
+
* Renders a divider between children.
|
|
20
|
+
* If a string is provided it will automatically be wrapped in a `<Text>` component.
|
|
21
|
+
*/
|
|
22
|
+
divider?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Elements to be rendered inside the Inline.
|
|
25
|
+
*/
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare type FlexAlignItems = keyof typeof flexAlignItemsMap;
|
|
29
|
+
declare const flexAlignItemsMap: {
|
|
30
|
+
center: import("@emotion/utils").SerializedStyles;
|
|
31
|
+
baseline: import("@emotion/utils").SerializedStyles;
|
|
32
|
+
flexStart: import("@emotion/utils").SerializedStyles;
|
|
33
|
+
flexEnd: import("@emotion/utils").SerializedStyles;
|
|
34
|
+
};
|
|
35
|
+
declare type FlexJustifyContent = keyof typeof flexJustifyContentMap;
|
|
36
|
+
declare const flexJustifyContentMap: {
|
|
37
|
+
center: import("@emotion/utils").SerializedStyles;
|
|
38
|
+
flexStart: import("@emotion/utils").SerializedStyles;
|
|
39
|
+
flexEnd: import("@emotion/utils").SerializedStyles;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* __Inline__
|
|
43
|
+
*
|
|
44
|
+
* Inline is a primitive component based on flexbox that manages the horizontal layout of direct children.
|
|
45
|
+
* Renders a `div` by default.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
declare const Inline: import("react").ForwardRefExoticComponent<InlineProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
+
export default Inline;
|
|
50
|
+
/**
|
|
51
|
+
* @codegenEnd
|
|
52
|
+
*/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { GlobalSpacingToken } from '../constants';
|
|
4
|
+
import { BasePrimitiveProps } from './types';
|
|
5
|
+
interface StackProps extends BasePrimitiveProps {
|
|
6
|
+
/**
|
|
7
|
+
* Used to align children along the cross axis.
|
|
8
|
+
*/
|
|
9
|
+
alignItems?: FlexAlignItems;
|
|
10
|
+
/**
|
|
11
|
+
* Used to align children along the main axis.
|
|
12
|
+
*/
|
|
13
|
+
justifyContent?: FlexJustifyContent;
|
|
14
|
+
/**
|
|
15
|
+
* Token representing gap between children.
|
|
16
|
+
*/
|
|
17
|
+
gap: GlobalSpacingToken;
|
|
18
|
+
/**
|
|
19
|
+
* Elements to be rendered inside the Stack.
|
|
20
|
+
*/
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare type FlexAlignItems = keyof typeof flexAlignItemsMap;
|
|
24
|
+
declare const flexAlignItemsMap: {
|
|
25
|
+
center: import("@emotion/utils").SerializedStyles;
|
|
26
|
+
baseline: import("@emotion/utils").SerializedStyles;
|
|
27
|
+
flexStart: import("@emotion/utils").SerializedStyles;
|
|
28
|
+
flexEnd: import("@emotion/utils").SerializedStyles;
|
|
29
|
+
};
|
|
30
|
+
declare type FlexJustifyContent = keyof typeof flexJustifyContentMap;
|
|
31
|
+
declare const flexJustifyContentMap: {
|
|
32
|
+
center: import("@emotion/utils").SerializedStyles;
|
|
33
|
+
flexStart: import("@emotion/utils").SerializedStyles;
|
|
34
|
+
flexEnd: import("@emotion/utils").SerializedStyles;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* __Stack__
|
|
38
|
+
*
|
|
39
|
+
* Stack is a primitive component based on flexbox that manages the vertical layout of direct children.
|
|
40
|
+
* Renders a `div` by default.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
declare const Stack: import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
|
+
export default Stack;
|
|
45
|
+
/**
|
|
46
|
+
* @codegenEnd
|
|
47
|
+
*/
|