@marigold/components 0.0.3 → 0.3.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 +174 -0
- package/dist/ActionGroup/ActionGroup.d.ts +8 -0
- package/dist/ActionGroup/ActionGroup.stories.d.ts +5 -0
- package/dist/ActionGroup/index.d.ts +1 -0
- package/dist/Alert/Alert.d.ts +22 -1
- package/dist/Alert/Alert.stories.d.ts +5 -0
- package/dist/Badge/Badge.d.ts +5 -0
- package/dist/Badge/Badge.stories.d.ts +5 -0
- package/dist/Box.d.ts +2 -0
- package/dist/Button/Button.d.ts +9 -6
- package/dist/Button/Button.stories.d.ts +5 -0
- package/dist/Card/Card.d.ts +14 -0
- package/dist/Card/Card.stories.d.ts +5 -0
- package/dist/Card/index.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts +15 -3
- package/dist/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/Checkbox/CheckboxIcons.d.ts +9 -0
- package/dist/Column/Column.d.ts +3 -1
- package/dist/Column/Column.stories.d.ts +5 -0
- package/dist/Columns/Columns.d.ts +2 -2
- package/dist/Columns/Columns.stories.d.ts +5 -0
- package/dist/Container/Container.stories.d.ts +5 -0
- package/dist/Dialog/Dialog.d.ts +12 -2
- package/dist/Dialog/Dialog.stories.d.ts +5 -0
- package/dist/Dialog/ModalDialog.d.ts +8 -0
- package/dist/Divider/Divider.d.ts +5 -0
- package/dist/Divider/Divider.stories.d.ts +5 -0
- package/dist/Field/Field.d.ts +5 -1
- package/dist/Field/Field.stories.d.ts +5 -0
- package/dist/Image/Image.d.ts +5 -0
- package/dist/Image/Image.stories.d.ts +5 -0
- package/dist/Inline/Inline.d.ts +7 -0
- package/dist/Inline/Inline.stories.d.ts +5 -0
- package/dist/Inline/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +5 -0
- package/dist/Input/Input.stories.d.ts +5 -0
- package/dist/Label/Label.d.ts +14 -2
- package/dist/Label/Label.stories.d.ts +5 -0
- package/dist/Link/Link.d.ts +10 -6
- package/dist/Link/Link.stories.d.ts +5 -0
- package/dist/Menu/Menu.d.ts +3 -0
- package/dist/Menu/Menu.stories.d.ts +5 -0
- package/dist/MenuItem/MenuItem.d.ts +5 -0
- package/dist/MenuItem/MenuItem.stories.d.ts +5 -0
- package/dist/Message/Message.d.ts +5 -0
- package/dist/Message/Message.stories.d.ts +5 -0
- package/dist/Provider/MarigoldProvider.d.ts +11 -0
- package/dist/Provider/index.d.ts +3 -0
- package/dist/Radio/Radio.d.ts +11 -4
- package/dist/Radio/Radio.stories.d.ts +5 -0
- package/dist/Radio/RadioIcon.d.ts +9 -0
- package/dist/Select/ListBox.d.ts +9 -0
- package/dist/Select/ListBoxSection.d.ts +9 -0
- package/dist/Select/Option.d.ts +9 -0
- package/dist/Select/Popover.d.ts +9 -0
- package/dist/Select/Select.d.ts +25 -4
- package/dist/Select/Select.stories.d.ts +5 -0
- package/dist/Slider/Slider.d.ts +5 -0
- package/dist/Slider/Slider.stories.d.ts +5 -0
- package/dist/Stack/Stack.d.ts +1 -3
- package/dist/Stack/Stack.stories.d.ts +5 -0
- package/dist/Text/Text.d.ts +17 -10
- package/dist/Text/Text.stories.d.ts +5 -0
- package/dist/Textarea/Textarea.d.ts +7 -1
- package/dist/Textarea/Textarea.stories.d.ts +5 -0
- package/dist/ValidationMessage/ValidationMessage.d.ts +5 -0
- package/dist/ValidationMessage/ValidationMessage.stories.d.ts +5 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.stories.d.ts +5 -0
- package/dist/VisuallyHidden/index.d.ts +1 -0
- package/dist/components.cjs.development.js +1075 -562
- package/dist/components.cjs.development.js.map +1 -1
- package/dist/components.cjs.production.min.js +1 -1
- package/dist/components.cjs.production.min.js.map +1 -1
- package/dist/components.esm.js +1012 -542
- package/dist/components.esm.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/theme.d.ts +23 -48
- package/package.json +21 -2
- package/src/ActionGroup/ActionGroup.stories.tsx +47 -0
- package/src/ActionGroup/ActionGroup.test.tsx +83 -0
- package/src/ActionGroup/ActionGroup.tsx +32 -0
- package/src/ActionGroup/index.ts +1 -0
- package/src/Alert/Alert.stories.tsx +32 -0
- package/src/Alert/Alert.test.tsx +5 -2
- package/src/Alert/Alert.tsx +27 -34
- package/src/Badge/Badge.stories.tsx +38 -0
- package/src/Badge/Badge.test.tsx +12 -16
- package/src/Badge/Badge.tsx +14 -3
- package/src/Box.ts +2 -0
- package/src/Button/Button.stories.tsx +57 -0
- package/src/Button/Button.test.tsx +76 -13
- package/src/Button/Button.tsx +61 -18
- package/src/Card/Card.stories.tsx +41 -0
- package/src/Card/Card.test.tsx +71 -0
- package/src/Card/Card.tsx +48 -0
- package/src/Card/index.ts +1 -0
- package/src/Checkbox/Checkbox.stories.tsx +78 -0
- package/src/Checkbox/Checkbox.test.tsx +138 -23
- package/src/Checkbox/Checkbox.tsx +81 -52
- package/src/Checkbox/CheckboxIcons.tsx +59 -0
- package/src/Column/Column.stories.tsx +33 -0
- package/src/Column/Column.test.tsx +8 -0
- package/src/Column/Column.tsx +12 -2
- package/src/Columns/Columns.stories.tsx +75 -0
- package/src/Columns/Columns.test.tsx +34 -23
- package/src/Columns/Columns.tsx +30 -30
- package/src/Container/Container.stories.tsx +14 -0
- package/src/Dialog/Dialog.stories.tsx +88 -0
- package/src/Dialog/Dialog.test.tsx +129 -18
- package/src/Dialog/Dialog.tsx +113 -15
- package/src/Dialog/ModalDialog.tsx +76 -0
- package/src/Divider/Divider.stories.tsx +30 -0
- package/src/Divider/Divider.test.tsx +13 -5
- package/src/Divider/Divider.tsx +12 -0
- package/src/Field/Field.stories.tsx +110 -0
- package/src/Field/Field.test.tsx +74 -33
- package/src/Field/Field.tsx +27 -20
- package/src/Image/Image.stories.tsx +34 -0
- package/src/Image/Image.test.tsx +4 -1
- package/src/Image/Image.tsx +13 -1
- package/src/Inline/Inline.stories.tsx +39 -0
- package/src/Inline/Inline.test.tsx +99 -0
- package/src/Inline/Inline.tsx +38 -0
- package/src/Inline/index.ts +1 -0
- package/src/Input/Input.stories.tsx +54 -0
- package/src/Input/Input.test.tsx +7 -3
- package/src/Input/Input.tsx +13 -1
- package/src/Label/Label.stories.tsx +41 -0
- package/src/Label/Label.test.tsx +40 -5
- package/src/Label/Label.tsx +54 -8
- package/src/Link/Link.stories.tsx +35 -0
- package/src/Link/Link.test.tsx +51 -21
- package/src/Link/Link.tsx +39 -13
- package/src/Menu/Menu.stories.tsx +62 -0
- package/src/Menu/Menu.test.tsx +11 -6
- package/src/Menu/Menu.tsx +22 -14
- package/src/MenuItem/MenuItem.stories.tsx +30 -0
- package/src/MenuItem/MenuItem.test.tsx +22 -13
- package/src/MenuItem/MenuItem.tsx +19 -10
- package/src/Message/Message.stories.tsx +30 -0
- package/src/Message/Message.test.tsx +4 -1
- package/src/Message/Message.tsx +18 -14
- package/src/Provider/MarigoldProvider.test.tsx +136 -0
- package/src/Provider/MarigoldProvider.tsx +47 -0
- package/src/Provider/index.ts +4 -0
- package/src/Radio/Radio.stories.tsx +78 -0
- package/src/Radio/Radio.test.tsx +129 -18
- package/src/Radio/Radio.tsx +62 -71
- package/src/Radio/RadioIcon.tsx +49 -0
- package/src/Select/ListBox.tsx +40 -0
- package/src/Select/ListBoxSection.tsx +40 -0
- package/src/Select/Option.tsx +48 -0
- package/src/Select/Popover.tsx +50 -0
- package/src/Select/Select.stories.tsx +81 -0
- package/src/Select/Select.test.tsx +317 -35
- package/src/Select/Select.tsx +162 -18
- package/src/Slider/Slider.stories.tsx +24 -0
- package/src/Slider/Slider.test.tsx +10 -6
- package/src/Slider/Slider.tsx +25 -13
- package/src/Stack/Stack.stories.tsx +57 -0
- package/src/Stack/Stack.test.tsx +93 -65
- package/src/Stack/Stack.tsx +27 -32
- package/src/Text/Text.stories.tsx +61 -0
- package/src/Text/Text.test.tsx +41 -36
- package/src/Text/Text.tsx +56 -31
- package/src/Textarea/Textarea.stories.tsx +64 -0
- package/src/Textarea/Textarea.test.tsx +11 -8
- package/src/Textarea/Textarea.tsx +41 -38
- package/src/ValidationMessage/ValidationMessage.stories.tsx +27 -0
- package/src/ValidationMessage/ValidationMessage.test.tsx +9 -4
- package/src/ValidationMessage/ValidationMessage.tsx +23 -12
- package/src/VisuallyHidden/VisuallyHidden.stories.tsx +19 -0
- package/src/VisuallyHidden/VisuallyHidden.test.tsx +10 -0
- package/src/VisuallyHidden/VisuallyHidden.tsx +1 -0
- package/src/VisuallyHidden/index.ts +1 -0
- package/src/index.ts +7 -2
- package/src/theme.ts +49 -48
- package/dist/Box/Box.d.ts +0 -45
- package/dist/Box/index.d.ts +0 -1
- package/dist/Heading/Heading.d.ts +0 -7
- package/dist/Heading/index.d.ts +0 -1
- package/dist/Hidden/Hidden.d.ts +0 -5
- package/dist/Hidden/index.d.ts +0 -1
- package/src/Alert/Alert.stories.mdx +0 -45
- package/src/Badge/Badge.stories.mdx +0 -43
- package/src/Box/Box.stories.mdx +0 -38
- package/src/Box/Box.test.tsx +0 -133
- package/src/Box/Box.tsx +0 -152
- package/src/Box/index.ts +0 -1
- package/src/Button/Button.stories.mdx +0 -176
- package/src/Checkbox/Checkbox.stories.mdx +0 -119
- package/src/Column/Column.stories.mdx +0 -74
- package/src/Columns/Columns.stories.mdx +0 -247
- package/src/Container/Container.stories.mdx +0 -36
- package/src/Dialog/Dialog.stories.mdx +0 -64
- package/src/Divider/Divider.stories.mdx +0 -43
- package/src/Field/Field.stories.mdx +0 -57
- package/src/Heading/Heading.stories.mdx +0 -91
- package/src/Heading/Heading.test.tsx +0 -77
- package/src/Heading/Heading.tsx +0 -19
- package/src/Heading/index.ts +0 -1
- package/src/Hidden/Hidden.stories.mdx +0 -64
- package/src/Hidden/Hidden.test.tsx +0 -24
- package/src/Hidden/Hidden.tsx +0 -16
- package/src/Hidden/index.ts +0 -1
- package/src/Image/Image.stories.mdx +0 -40
- package/src/Input/Input.stories.mdx +0 -45
- package/src/Label/Label.stories.mdx +0 -34
- package/src/Link/Link.stories.mdx +0 -38
- package/src/Menu/Menu.stories.mdx +0 -49
- package/src/MenuItem/MenuItem.stories.mdx +0 -32
- package/src/Message/Message.stories.mdx +0 -44
- package/src/Radio/Radio.stories.mdx +0 -100
- package/src/Select/Select.stories.mdx +0 -44
- package/src/Slider/Slider.stories.mdx +0 -58
- package/src/Stack/Stack.stories.mdx +0 -105
- package/src/Text/Text.stories.mdx +0 -60
- package/src/Textarea/Textarea.stories.mdx +0 -65
- package/src/ValidationMessage/ValidationMessage.stories.mdx +0 -36
|
@@ -4,9 +4,24 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var React__default = _interopDefault(React);
|
|
7
|
-
var icons = require('@marigold/icons');
|
|
8
|
-
var system = require('@marigold/system');
|
|
9
7
|
var flattenChildren = _interopDefault(require('react-keyed-flatten-children'));
|
|
8
|
+
var system = require('@marigold/system');
|
|
9
|
+
var icons = require('@marigold/icons');
|
|
10
|
+
var button = require('@react-aria/button');
|
|
11
|
+
var focus = require('@react-aria/focus');
|
|
12
|
+
var visuallyHidden = require('@react-aria/visually-hidden');
|
|
13
|
+
var checkbox = require('@react-aria/checkbox');
|
|
14
|
+
var toggle = require('@react-stately/toggle');
|
|
15
|
+
var overlays = require('@react-stately/overlays');
|
|
16
|
+
var overlays$1 = require('@react-aria/overlays');
|
|
17
|
+
var dialog = require('@react-aria/dialog');
|
|
18
|
+
var link = require('@react-aria/link');
|
|
19
|
+
var ssr = require('@react-aria/ssr');
|
|
20
|
+
var select = require('@react-stately/select');
|
|
21
|
+
var utils = require('@react-aria/utils');
|
|
22
|
+
var select$1 = require('@react-aria/select');
|
|
23
|
+
var listbox = require('@react-aria/listbox');
|
|
24
|
+
var collections = require('@react-stately/collections');
|
|
10
25
|
|
|
11
26
|
function _extends() {
|
|
12
27
|
_extends = Object.assign || function (target) {
|
|
@@ -41,547 +56,816 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
41
56
|
return target;
|
|
42
57
|
}
|
|
43
58
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
width = _ref.width,
|
|
53
|
-
minWidth = _ref.minWidth,
|
|
54
|
-
maxWidth = _ref.maxWidth,
|
|
55
|
-
position = _ref.position,
|
|
56
|
-
top = _ref.top,
|
|
57
|
-
bottom = _ref.bottom,
|
|
58
|
-
right = _ref.right,
|
|
59
|
-
left = _ref.left,
|
|
60
|
-
zIndex = _ref.zIndex,
|
|
61
|
-
p = _ref.p,
|
|
62
|
-
px = _ref.px,
|
|
63
|
-
py = _ref.py,
|
|
64
|
-
pt = _ref.pt,
|
|
65
|
-
pb = _ref.pb,
|
|
66
|
-
pl = _ref.pl,
|
|
67
|
-
pr = _ref.pr,
|
|
68
|
-
m = _ref.m,
|
|
69
|
-
mx = _ref.mx,
|
|
70
|
-
my = _ref.my,
|
|
71
|
-
mt = _ref.mt,
|
|
72
|
-
mb = _ref.mb,
|
|
73
|
-
ml = _ref.ml,
|
|
74
|
-
mr = _ref.mr,
|
|
75
|
-
flexDirection = _ref.flexDirection,
|
|
76
|
-
flexWrap = _ref.flexWrap,
|
|
77
|
-
flexShrink = _ref.flexShrink,
|
|
78
|
-
flexGrow = _ref.flexGrow,
|
|
79
|
-
alignItems = _ref.alignItems,
|
|
80
|
-
justifyContent = _ref.justifyContent,
|
|
81
|
-
bg = _ref.bg,
|
|
82
|
-
border = _ref.border,
|
|
83
|
-
borderRadius = _ref.borderRadius,
|
|
84
|
-
boxShadow = _ref.boxShadow,
|
|
85
|
-
opacity = _ref.opacity,
|
|
86
|
-
overflow = _ref.overflow,
|
|
87
|
-
transition = _ref.transition,
|
|
88
|
-
props = _objectWithoutPropertiesLoose(_ref, ["variant", "as", "children", "className", "display", "height", "width", "minWidth", "maxWidth", "position", "top", "bottom", "right", "left", "zIndex", "p", "px", "py", "pt", "pb", "pl", "pr", "m", "mx", "my", "mt", "mb", "ml", "mr", "flexDirection", "flexWrap", "flexShrink", "flexGrow", "alignItems", "justifyContent", "bg", "border", "borderRadius", "boxShadow", "opacity", "overflow", "transition"]);
|
|
89
|
-
|
|
90
|
-
var cn = system.useStyles({
|
|
91
|
-
element: as,
|
|
92
|
-
variant: variant,
|
|
93
|
-
className: className,
|
|
94
|
-
css: {
|
|
95
|
-
display: display,
|
|
96
|
-
height: height,
|
|
97
|
-
width: width,
|
|
98
|
-
minWidth: minWidth,
|
|
99
|
-
maxWidth: maxWidth,
|
|
100
|
-
position: position,
|
|
101
|
-
top: top,
|
|
102
|
-
bottom: bottom,
|
|
103
|
-
right: right,
|
|
104
|
-
left: left,
|
|
105
|
-
zIndex: zIndex,
|
|
106
|
-
p: p,
|
|
107
|
-
px: px,
|
|
108
|
-
py: py,
|
|
109
|
-
pt: pt,
|
|
110
|
-
pb: pb,
|
|
111
|
-
pl: pl,
|
|
112
|
-
pr: pr,
|
|
113
|
-
m: m,
|
|
114
|
-
mx: mx,
|
|
115
|
-
my: my,
|
|
116
|
-
mt: mt,
|
|
117
|
-
mb: mb,
|
|
118
|
-
ml: ml,
|
|
119
|
-
mr: mr,
|
|
120
|
-
flexDirection: flexDirection,
|
|
121
|
-
flexWrap: flexWrap,
|
|
122
|
-
flexShrink: flexShrink,
|
|
123
|
-
flexGrow: flexGrow,
|
|
124
|
-
alignItems: alignItems,
|
|
125
|
-
justifyContent: justifyContent,
|
|
126
|
-
bg: bg,
|
|
127
|
-
border: border,
|
|
128
|
-
borderRadius: borderRadius,
|
|
129
|
-
boxShadow: boxShadow,
|
|
130
|
-
opacity: opacity,
|
|
131
|
-
overflow: overflow,
|
|
132
|
-
transition: transition
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
return React.createElement(as, _extends({}, props, {
|
|
136
|
-
ref: ref,
|
|
137
|
-
className: cn
|
|
138
|
-
}), children);
|
|
139
|
-
});
|
|
59
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
60
|
+
if (!o) return;
|
|
61
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
62
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
63
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
64
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
65
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
66
|
+
}
|
|
140
67
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
68
|
+
function _arrayLikeToArray(arr, len) {
|
|
69
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
70
|
+
|
|
71
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
72
|
+
|
|
73
|
+
return arr2;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
77
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
78
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
79
|
+
|
|
80
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
81
|
+
if (it) o = it;
|
|
82
|
+
var i = 0;
|
|
83
|
+
return function () {
|
|
84
|
+
if (i >= o.length) return {
|
|
85
|
+
done: true
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
done: false,
|
|
89
|
+
value: o[i++]
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var _excluded = ["space", "align", "children"];
|
|
98
|
+
var ALIGNMENT = {
|
|
99
|
+
top: 'flex-start',
|
|
100
|
+
center: 'center',
|
|
101
|
+
bottom: 'flex-end'
|
|
102
|
+
};
|
|
103
|
+
var Inline = function Inline(_ref) {
|
|
104
|
+
var _ref$space = _ref.space,
|
|
105
|
+
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
106
|
+
_ref$align = _ref.align,
|
|
107
|
+
align = _ref$align === void 0 ? 'center' : _ref$align,
|
|
144
108
|
children = _ref.children,
|
|
145
|
-
|
|
146
|
-
props = _objectWithoutPropertiesLoose(_ref, ["variant", "children", "className"]);
|
|
109
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
147
110
|
|
|
148
|
-
|
|
111
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
112
|
+
display: "inline-flex",
|
|
149
113
|
css: {
|
|
150
|
-
|
|
151
|
-
|
|
114
|
+
'> * + *': {
|
|
115
|
+
pl: space
|
|
116
|
+
}
|
|
152
117
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
118
|
+
alignItems: ALIGNMENT[align]
|
|
119
|
+
}, props), React.Children.map(flattenChildren(children), function (child) {
|
|
120
|
+
return React__default.createElement(system.Box, null, React__default.cloneElement(child, {}, child.props.children));
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
157
123
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
124
|
+
var _excluded$1 = ["space", "align", "children"];
|
|
125
|
+
var ALIGNMENT$1 = {
|
|
126
|
+
left: 'flex-start',
|
|
127
|
+
center: 'center',
|
|
128
|
+
right: 'flex-end'
|
|
129
|
+
};
|
|
130
|
+
var Stack = function Stack(_ref) {
|
|
131
|
+
var _ref$space = _ref.space,
|
|
132
|
+
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
133
|
+
_ref$align = _ref.align,
|
|
134
|
+
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
135
|
+
children = _ref.children,
|
|
136
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
163
137
|
|
|
164
|
-
|
|
138
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
139
|
+
display: "flex",
|
|
140
|
+
flexDirection: "column",
|
|
141
|
+
alignItems: ALIGNMENT$1[align],
|
|
165
142
|
css: {
|
|
166
|
-
|
|
167
|
-
|
|
143
|
+
'> * + *': {
|
|
144
|
+
pt: space
|
|
145
|
+
}
|
|
168
146
|
}
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
className: iconClassName
|
|
174
|
-
});
|
|
147
|
+
}), React.Children.map(flattenChildren(children), function (child) {
|
|
148
|
+
return React__default.createElement(system.Box, null, React__default.cloneElement(child, {}, child.props.children));
|
|
149
|
+
}));
|
|
150
|
+
};
|
|
175
151
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
size: 12,
|
|
179
|
-
color: "#ffffff",
|
|
180
|
-
className: iconClassName
|
|
181
|
-
});
|
|
182
|
-
} else if (variant === 'error') {
|
|
183
|
-
icon = React__default.createElement(icons.Exclamation, {
|
|
184
|
-
size: 12,
|
|
185
|
-
color: "#ffffff",
|
|
186
|
-
className: iconClassName
|
|
187
|
-
});
|
|
188
|
-
}
|
|
152
|
+
var _excluded$2 = ["space", "verticalAlignment", "children"];
|
|
153
|
+
// ---------------
|
|
189
154
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
155
|
+
var ActionGroup = function ActionGroup(_ref) {
|
|
156
|
+
var _ref$space = _ref.space,
|
|
157
|
+
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
158
|
+
_ref$verticalAlignmen = _ref.verticalAlignment,
|
|
159
|
+
verticalAlignment = _ref$verticalAlignmen === void 0 ? false : _ref$verticalAlignmen,
|
|
160
|
+
children = _ref.children,
|
|
161
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
162
|
+
|
|
163
|
+
return verticalAlignment ? React__default.createElement(Stack, Object.assign({
|
|
164
|
+
space: space
|
|
165
|
+
}, props), children) : React__default.createElement(Inline, Object.assign({
|
|
166
|
+
space: space
|
|
167
|
+
}, props), children);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var _excluded$3 = ["variant", "children"];
|
|
171
|
+
var ICON_MAP = {
|
|
172
|
+
success: icons.Check,
|
|
173
|
+
warning: icons.Notification,
|
|
174
|
+
error: icons.Exclamation
|
|
175
|
+
}; // Component
|
|
176
|
+
// ---------------
|
|
177
|
+
|
|
178
|
+
var Alert = function Alert(_ref) {
|
|
179
|
+
var _ref$variant = _ref.variant,
|
|
180
|
+
variant = _ref$variant === void 0 ? 'success' : _ref$variant,
|
|
181
|
+
children = _ref.children,
|
|
182
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
183
|
+
|
|
184
|
+
var Icon = ICON_MAP[variant];
|
|
185
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
186
|
+
display: "flex",
|
|
187
|
+
variant: "alert." + variant
|
|
188
|
+
}), React__default.createElement(system.Box, {
|
|
193
189
|
display: "inline-block",
|
|
194
190
|
alignItems: "center",
|
|
195
191
|
width: "32px",
|
|
196
192
|
height: "32px",
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
193
|
+
bg: variant
|
|
194
|
+
}, React__default.createElement(system.Box, {
|
|
195
|
+
as: Icon,
|
|
196
|
+
size: 12,
|
|
197
|
+
color: "#fff",
|
|
198
|
+
bg: variant,
|
|
199
|
+
m: 10
|
|
200
|
+
})), React__default.createElement(system.Box, {
|
|
203
201
|
mx: "16px"
|
|
204
202
|
}, children));
|
|
205
203
|
};
|
|
206
204
|
|
|
205
|
+
var _excluded$4 = ["variant", "bgColor", "borderColor", "children"];
|
|
206
|
+
// ---------------
|
|
207
|
+
|
|
207
208
|
var Badge = function Badge(_ref) {
|
|
208
209
|
var _ref$variant = _ref.variant,
|
|
209
|
-
variant = _ref$variant === void 0 ? '
|
|
210
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
210
211
|
_ref$bgColor = _ref.bgColor,
|
|
211
212
|
bgColor = _ref$bgColor === void 0 ? 'transparent' : _ref$bgColor,
|
|
212
213
|
_ref$borderColor = _ref.borderColor,
|
|
213
214
|
borderColor = _ref$borderColor === void 0 ? 'transparent' : _ref$borderColor,
|
|
214
215
|
children = _ref.children,
|
|
215
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
216
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
216
217
|
|
|
217
|
-
return React__default.createElement(Box, Object.assign({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
}),
|
|
218
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
219
|
+
css: {
|
|
220
|
+
bg: bgColor,
|
|
221
|
+
borderColor: borderColor
|
|
222
|
+
},
|
|
224
223
|
variant: "badge." + variant
|
|
225
224
|
}, props), children);
|
|
226
225
|
};
|
|
227
226
|
|
|
228
|
-
var
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
var _excluded$5 = ["as", "variant", "size", "space", "disabled", "children", "className"];
|
|
228
|
+
// ---------------
|
|
229
|
+
|
|
230
|
+
var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
231
|
+
var _ref$as = _ref.as,
|
|
232
|
+
as = _ref$as === void 0 ? 'button' : _ref$as,
|
|
233
|
+
_ref$variant = _ref.variant,
|
|
234
|
+
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
235
|
+
_ref$size = _ref.size,
|
|
236
|
+
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
237
|
+
_ref$space = _ref.space,
|
|
238
|
+
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
239
|
+
disabled = _ref.disabled,
|
|
231
240
|
children = _ref.children,
|
|
232
|
-
|
|
241
|
+
className = _ref.className,
|
|
242
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
233
243
|
|
|
234
|
-
|
|
235
|
-
as:
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
244
|
+
var _useButton = button.useButton(_extends({}, props, {
|
|
245
|
+
elementType: typeof as === 'string' ? as : 'span',
|
|
246
|
+
isDisabled: disabled
|
|
247
|
+
}), ref),
|
|
248
|
+
buttonProps = _useButton.buttonProps;
|
|
249
|
+
|
|
250
|
+
return React__default.createElement(system.Box, Object.assign({}, buttonProps, props, {
|
|
251
|
+
as: as,
|
|
240
252
|
display: "inline-flex",
|
|
241
|
-
alignItems: "center"
|
|
242
|
-
|
|
253
|
+
alignItems: "center",
|
|
254
|
+
variant: ["button." + variant, "button." + size],
|
|
255
|
+
className: className,
|
|
256
|
+
ref: ref,
|
|
257
|
+
css: {
|
|
258
|
+
columnGap: space
|
|
259
|
+
}
|
|
260
|
+
}), children);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
var _excluded$6 = ["variant", "title", "width", "className", "children"];
|
|
264
|
+
// ---------------
|
|
265
|
+
|
|
266
|
+
var Card = function Card(_ref) {
|
|
267
|
+
var _ref$variant = _ref.variant,
|
|
268
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
269
|
+
title = _ref.title,
|
|
270
|
+
width = _ref.width,
|
|
271
|
+
className = _ref.className,
|
|
272
|
+
children = _ref.children,
|
|
273
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
274
|
+
|
|
275
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
276
|
+
variant: "card." + variant,
|
|
277
|
+
maxWidth: width,
|
|
278
|
+
className: className
|
|
279
|
+
}), title && React__default.createElement(system.Box, {
|
|
280
|
+
as: "h2",
|
|
281
|
+
variant: "text.h2",
|
|
282
|
+
pb: "small"
|
|
283
|
+
}, title), children);
|
|
243
284
|
};
|
|
244
285
|
|
|
245
|
-
var
|
|
286
|
+
var CheckboxIcon = function CheckboxIcon(_ref) {
|
|
246
287
|
var _ref$variant = _ref.variant,
|
|
247
|
-
variant = _ref$variant === void 0 ? '
|
|
288
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
289
|
+
_ref$checked = _ref.checked,
|
|
290
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
291
|
+
_ref$disabled = _ref.disabled,
|
|
292
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
293
|
+
_ref$error = _ref.error,
|
|
294
|
+
error = _ref$error === void 0 ? false : _ref$error;
|
|
295
|
+
var conditionalStates = disabled ? {
|
|
296
|
+
disabled: disabled
|
|
297
|
+
} : {
|
|
298
|
+
checked: checked,
|
|
299
|
+
error: error
|
|
300
|
+
};
|
|
301
|
+
return React__default.createElement(system.SVG, {
|
|
302
|
+
width: "16",
|
|
303
|
+
height: "32",
|
|
304
|
+
viewBox: "0 0 16 32",
|
|
305
|
+
fill: "none",
|
|
306
|
+
"aria-hidden": "true"
|
|
307
|
+
}, React__default.createElement(system.Box, {
|
|
308
|
+
as: "rect",
|
|
309
|
+
x: "0.5",
|
|
310
|
+
y: "8.5",
|
|
311
|
+
width: "15px",
|
|
312
|
+
height: "15px",
|
|
313
|
+
rx: "1.5",
|
|
314
|
+
variant: system.conditional("checkbox." + variant, conditionalStates)
|
|
315
|
+
}), checked && React__default.createElement(system.Box, {
|
|
316
|
+
__baseCSS: {
|
|
317
|
+
fill: 'gray00'
|
|
318
|
+
},
|
|
319
|
+
as: "path",
|
|
320
|
+
fillRule: "evenodd",
|
|
321
|
+
clipRule: "evenodd",
|
|
322
|
+
d: "M13.9571 12.8338L12.4085 11.2852L6.08699 17.6007L3.59887 15.1126L2.04163 16.6588L6.08682 20.704L13.9571 12.8338Z"
|
|
323
|
+
}));
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
var _excluded$7 = ["variant", "required", "color", "children"],
|
|
327
|
+
_excluded2 = ["required", "children"];
|
|
328
|
+
var LabelBase = function LabelBase(_ref) {
|
|
329
|
+
var _ref$variant = _ref.variant,
|
|
330
|
+
variant = _ref$variant === void 0 ? 'above' : _ref$variant,
|
|
331
|
+
_ref$color = _ref.color,
|
|
332
|
+
color = _ref$color === void 0 ? 'text' : _ref$color,
|
|
248
333
|
children = _ref.children,
|
|
249
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
334
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
250
335
|
|
|
251
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
336
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
252
337
|
as: "label",
|
|
338
|
+
__baseCSS: {
|
|
339
|
+
color: color
|
|
340
|
+
},
|
|
253
341
|
variant: "label." + variant
|
|
254
342
|
}), children);
|
|
255
343
|
};
|
|
344
|
+
var Label = function Label(_ref2) {
|
|
345
|
+
var required = _ref2.required,
|
|
346
|
+
children = _ref2.children,
|
|
347
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
256
348
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
props = _objectWithoutPropertiesLoose(_ref, ["id", "variant", "label", "required", "className"]);
|
|
265
|
-
|
|
266
|
-
var checkboxStyles = system.useStyles({
|
|
349
|
+
return required ? React__default.createElement(system.Box, {
|
|
350
|
+
as: "span",
|
|
351
|
+
display: "inline-flex",
|
|
352
|
+
alignItems: "center"
|
|
353
|
+
}, React__default.createElement(LabelBase, Object.assign({}, props), children), required && React__default.createElement(system.Box, {
|
|
354
|
+
as: icons.Required,
|
|
355
|
+
size: 16,
|
|
267
356
|
css: {
|
|
268
|
-
|
|
269
|
-
opacity: 0,
|
|
270
|
-
zIndex: -1,
|
|
271
|
-
width: 1,
|
|
272
|
-
height: 1,
|
|
273
|
-
overflow: 'hidden'
|
|
357
|
+
color: 'error'
|
|
274
358
|
}
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
359
|
+
})) : React__default.createElement(LabelBase, Object.assign({}, props), children);
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
var _excluded$8 = ["variant", "children", "className"];
|
|
363
|
+
// ---------------
|
|
364
|
+
|
|
365
|
+
var ValidationMessage = function ValidationMessage(_ref) {
|
|
366
|
+
var _ref$variant = _ref.variant,
|
|
367
|
+
variant = _ref$variant === void 0 ? 'error' : _ref$variant,
|
|
368
|
+
children = _ref.children,
|
|
369
|
+
className = _ref.className,
|
|
370
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
371
|
+
|
|
372
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
373
|
+
as: "span",
|
|
374
|
+
display: "flex",
|
|
375
|
+
alignItems: "center",
|
|
376
|
+
variant: "validation." + variant,
|
|
289
377
|
className: className
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
378
|
+
}, props), children);
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
var _excluded$9 = ["error"],
|
|
382
|
+
_excluded2$1 = ["label", "required", "labelVariant", "error", "errorMessage"];
|
|
383
|
+
|
|
384
|
+
var CheckboxInput = function CheckboxInput(_ref) {
|
|
385
|
+
var error = _ref.error,
|
|
386
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
387
|
+
|
|
388
|
+
var state = toggle.useToggleState(props);
|
|
389
|
+
var ref = React__default.useRef(null);
|
|
390
|
+
|
|
391
|
+
var _useCheckbox = checkbox.useCheckbox(props, state, ref),
|
|
392
|
+
inputProps = _useCheckbox.inputProps;
|
|
393
|
+
|
|
394
|
+
var _useFocusRing = focus.useFocusRing(),
|
|
395
|
+
focusProps = _useFocusRing.focusProps;
|
|
396
|
+
|
|
397
|
+
return React__default.createElement(system.Box, {
|
|
398
|
+
pr: "xsmall"
|
|
399
|
+
}, React__default.createElement(visuallyHidden.VisuallyHidden, null, React__default.createElement(system.Box, Object.assign({
|
|
400
|
+
as: "input",
|
|
294
401
|
type: "checkbox",
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
402
|
+
disabled: props.disabled
|
|
403
|
+
}, inputProps, focusProps, {
|
|
404
|
+
ref: ref
|
|
405
|
+
}, props))), React__default.createElement(CheckboxIcon, {
|
|
406
|
+
checked: props.checked,
|
|
407
|
+
variant: props.variant,
|
|
408
|
+
disabled: props.disabled,
|
|
409
|
+
error: error
|
|
302
410
|
}));
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
var Checkbox = function Checkbox(_ref2) {
|
|
414
|
+
var label = _ref2.label,
|
|
415
|
+
required = _ref2.required,
|
|
416
|
+
_ref2$labelVariant = _ref2.labelVariant,
|
|
417
|
+
labelVariant = _ref2$labelVariant === void 0 ? 'inline' : _ref2$labelVariant,
|
|
418
|
+
error = _ref2.error,
|
|
419
|
+
errorMessage = _ref2.errorMessage,
|
|
420
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);
|
|
421
|
+
|
|
422
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(system.Box, {
|
|
423
|
+
as: Label,
|
|
424
|
+
__baseCSS: {
|
|
425
|
+
':hover': {
|
|
426
|
+
cursor: props.disabled ? 'not-allowed' : 'pointer'
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
htmlFor: props.id,
|
|
430
|
+
required: required,
|
|
431
|
+
variant: "label." + labelVariant,
|
|
432
|
+
color: props.disabled ? 'disabled' : 'text'
|
|
433
|
+
}, React__default.createElement(system.Box, Object.assign({
|
|
434
|
+
as: CheckboxInput,
|
|
435
|
+
error: error
|
|
436
|
+
}, props)), label), error && errorMessage && React__default.createElement(ValidationMessage, null, React__default.createElement(icons.Exclamation, {
|
|
306
437
|
size: 16
|
|
307
|
-
})
|
|
438
|
+
}), errorMessage));
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
var _excluded$a = ["width", "children"];
|
|
442
|
+
|
|
443
|
+
var transform = function transform(width) {
|
|
444
|
+
if (Array.isArray(width)) {
|
|
445
|
+
return width.map(function (v) {
|
|
446
|
+
return v / 12 * 100 + "%";
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
return width / 12 * 100 + "%";
|
|
308
451
|
};
|
|
309
452
|
|
|
310
453
|
var Column = function Column(_ref) {
|
|
311
454
|
var _ref$width = _ref.width,
|
|
312
455
|
width = _ref$width === void 0 ? 12 : _ref$width,
|
|
313
456
|
children = _ref.children,
|
|
314
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
457
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
315
458
|
|
|
316
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
317
|
-
width: width
|
|
459
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
460
|
+
width: transform(width)
|
|
318
461
|
}), children);
|
|
319
462
|
};
|
|
320
463
|
|
|
464
|
+
var _excluded$b = ["space", "horizontalAlign", "verticalAlign", "className", "children"];
|
|
465
|
+
|
|
466
|
+
var useAlignment = function useAlignment(direction) {
|
|
467
|
+
switch (direction) {
|
|
468
|
+
case 'right':
|
|
469
|
+
return 'flex-end';
|
|
470
|
+
|
|
471
|
+
case 'bottom':
|
|
472
|
+
return 'flex-end';
|
|
473
|
+
|
|
474
|
+
case 'center':
|
|
475
|
+
return 'center';
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
return 'flex-start';
|
|
479
|
+
};
|
|
480
|
+
|
|
321
481
|
var Columns = function Columns(_ref) {
|
|
322
482
|
var _ref$space = _ref.space,
|
|
323
|
-
space = _ref$space === void 0 ?
|
|
483
|
+
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
324
484
|
_ref$horizontalAlign = _ref.horizontalAlign,
|
|
325
485
|
horizontalAlign = _ref$horizontalAlign === void 0 ? 'left' : _ref$horizontalAlign,
|
|
326
486
|
_ref$verticalAlign = _ref.verticalAlign,
|
|
327
487
|
verticalAlign = _ref$verticalAlign === void 0 ? 'top' : _ref$verticalAlign,
|
|
328
488
|
className = _ref.className,
|
|
329
489
|
children = _ref.children,
|
|
330
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
331
|
-
|
|
332
|
-
var columnItems = flattenChildren(children);
|
|
333
|
-
var childClassNames = system.useStyles({
|
|
334
|
-
css: {
|
|
335
|
-
p: space / 2 + "px"
|
|
336
|
-
}
|
|
337
|
-
}); // horizontal Alignment
|
|
338
|
-
|
|
339
|
-
var justify = 'flex-start';
|
|
490
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
340
491
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
492
|
+
var justifyContent = useAlignment(horizontalAlign);
|
|
493
|
+
var alignItems = useAlignment(verticalAlign);
|
|
494
|
+
/**
|
|
495
|
+
* transform space string to space value from theme
|
|
496
|
+
*/
|
|
346
497
|
|
|
498
|
+
var _useTheme = system.useTheme(),
|
|
499
|
+
css = _useTheme.css;
|
|
347
500
|
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
return React__default.createElement(Box, {
|
|
357
|
-
p: space + "px",
|
|
501
|
+
var spaceObject = css({
|
|
502
|
+
space: space
|
|
503
|
+
});
|
|
504
|
+
var spaceValue = Object.values(spaceObject)[0];
|
|
505
|
+
return React__default.createElement(system.Box, {
|
|
506
|
+
p: space,
|
|
358
507
|
display: "flex",
|
|
359
508
|
className: className
|
|
360
|
-
}, React__default.createElement(Box, Object.assign({
|
|
361
|
-
width: "calc(100% + " +
|
|
362
|
-
m: -
|
|
509
|
+
}, React__default.createElement(system.Box, Object.assign({
|
|
510
|
+
width: "calc(100% + " + spaceValue + "px)",
|
|
511
|
+
m: -spaceValue / 2 + "px",
|
|
363
512
|
display: "flex",
|
|
364
513
|
flexWrap: "wrap",
|
|
365
514
|
alignItems: alignItems,
|
|
366
|
-
justifyContent:
|
|
367
|
-
}, props), React.Children.map(
|
|
368
|
-
return React__default.cloneElement(child, {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
515
|
+
justifyContent: justifyContent
|
|
516
|
+
}, props), React.Children.map(flattenChildren(children), function (child) {
|
|
517
|
+
return React__default.cloneElement(child, {}, React__default.createElement(system.Box, {
|
|
518
|
+
css: {
|
|
519
|
+
p: spaceValue / 2 + "px"
|
|
520
|
+
}
|
|
372
521
|
}, child.props.children));
|
|
373
522
|
})));
|
|
374
523
|
};
|
|
375
524
|
|
|
525
|
+
var _excluded$c = ["as", "variant", "children", "className", "align", "color", "cursor", "outline", "userSelect"];
|
|
526
|
+
// ---------------
|
|
527
|
+
|
|
528
|
+
var Text = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
529
|
+
var _ref$as = _ref.as,
|
|
530
|
+
as = _ref$as === void 0 ? 'span' : _ref$as,
|
|
531
|
+
_ref$variant = _ref.variant,
|
|
532
|
+
variant = _ref$variant === void 0 ? 'body' : _ref$variant,
|
|
533
|
+
children = _ref.children,
|
|
534
|
+
className = _ref.className,
|
|
535
|
+
align = _ref.align,
|
|
536
|
+
color = _ref.color,
|
|
537
|
+
cursor = _ref.cursor,
|
|
538
|
+
outline = _ref.outline,
|
|
539
|
+
userSelect = _ref.userSelect,
|
|
540
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
541
|
+
|
|
542
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
543
|
+
as: as,
|
|
544
|
+
variant: "text." + variant,
|
|
545
|
+
css: {
|
|
546
|
+
textAlign: align,
|
|
547
|
+
color: color,
|
|
548
|
+
cursor: cursor,
|
|
549
|
+
outline: outline,
|
|
550
|
+
userSelect: userSelect
|
|
551
|
+
},
|
|
552
|
+
className: className,
|
|
553
|
+
ref: ref
|
|
554
|
+
}), children);
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
var _excluded$d = ["variant", "backdropVariant", "children"],
|
|
558
|
+
_excluded2$2 = ["isDismissable", "isOpen", "onClose"];
|
|
559
|
+
// ---------------
|
|
560
|
+
|
|
561
|
+
var ModalDialog = function ModalDialog(_ref) {
|
|
562
|
+
var variant = _ref.variant,
|
|
563
|
+
_ref$backdropVariant = _ref.backdropVariant,
|
|
564
|
+
backdropVariant = _ref$backdropVariant === void 0 ? 'backdrop' : _ref$backdropVariant,
|
|
565
|
+
children = _ref.children,
|
|
566
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
567
|
+
|
|
568
|
+
var isDismissable = props.isDismissable,
|
|
569
|
+
isOpen = props.isOpen,
|
|
570
|
+
onClose = props.onClose,
|
|
571
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded2$2); // Handle interacting outside the dialog and pressing
|
|
572
|
+
// the Escape key to close the modal.
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
var ref = React__default.useRef();
|
|
576
|
+
|
|
577
|
+
var _useOverlay = overlays$1.useOverlay({
|
|
578
|
+
isDismissable: isDismissable,
|
|
579
|
+
isOpen: isOpen,
|
|
580
|
+
onClose: onClose
|
|
581
|
+
}, ref),
|
|
582
|
+
overlayProps = _useOverlay.overlayProps,
|
|
583
|
+
underlayProps = _useOverlay.underlayProps; // Prevent scrolling while the modal is open, and hide content
|
|
584
|
+
// outside the modal from screen readers.
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
overlays$1.usePreventScroll();
|
|
588
|
+
|
|
589
|
+
var _useModal = overlays$1.useModal(),
|
|
590
|
+
modalProps = _useModal.modalProps;
|
|
591
|
+
|
|
592
|
+
var _useDialog = dialog.useDialog(props, ref),
|
|
593
|
+
dialogProps = _useDialog.dialogProps;
|
|
594
|
+
|
|
595
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
596
|
+
__baseCSS: {
|
|
597
|
+
display: 'grid',
|
|
598
|
+
placeItems: 'center',
|
|
599
|
+
position: 'fixed',
|
|
600
|
+
zIndex: 100,
|
|
601
|
+
top: 0,
|
|
602
|
+
left: 0,
|
|
603
|
+
bottom: 0,
|
|
604
|
+
right: 0
|
|
605
|
+
},
|
|
606
|
+
variant: "dialog." + backdropVariant
|
|
607
|
+
}, underlayProps), React__default.createElement(focus.FocusScope, {
|
|
608
|
+
contain: true,
|
|
609
|
+
restoreFocus: true,
|
|
610
|
+
autoFocus: true
|
|
611
|
+
}, React__default.createElement(system.Box, Object.assign({}, overlayProps, dialogProps, modalProps, {
|
|
612
|
+
ref: ref,
|
|
613
|
+
variant: variant ? "dialog." + variant : "dialog"
|
|
614
|
+
}, restProps), children)));
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
var _excluded$e = ["backdropVariant", "children", "className", "close", "isOpen", "title", "variant"];
|
|
618
|
+
// ---------------
|
|
619
|
+
|
|
376
620
|
var Dialog = function Dialog(_ref) {
|
|
377
|
-
var
|
|
621
|
+
var backdropVariant = _ref.backdropVariant,
|
|
378
622
|
children = _ref.children,
|
|
379
623
|
className = _ref.className,
|
|
380
|
-
|
|
624
|
+
close = _ref.close,
|
|
625
|
+
isOpen = _ref.isOpen,
|
|
626
|
+
title = _ref.title,
|
|
627
|
+
variant = _ref.variant,
|
|
628
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
381
629
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
630
|
+
var closeButtonRef = React__default.useRef(); // useButton ensures that focus management is handled correctly,
|
|
631
|
+
// across all browsers. Focus is restored to the button once the
|
|
632
|
+
// dialog closes.
|
|
633
|
+
|
|
634
|
+
var _useButton = button.useButton({
|
|
635
|
+
onPress: function onPress() {
|
|
636
|
+
return close();
|
|
637
|
+
}
|
|
638
|
+
}, closeButtonRef),
|
|
639
|
+
closeButtonProps = _useButton.buttonProps;
|
|
640
|
+
|
|
641
|
+
return React__default.createElement(overlays$1.OverlayContainer, null, React__default.createElement(ModalDialog, Object.assign({
|
|
642
|
+
variant: variant,
|
|
643
|
+
backdropVariant: backdropVariant,
|
|
644
|
+
isOpen: isOpen,
|
|
645
|
+
onClose: close,
|
|
646
|
+
isDismissable: true
|
|
647
|
+
}, props), React__default.createElement(system.Box, {
|
|
648
|
+
__baseCSS: {
|
|
649
|
+
display: 'flex',
|
|
650
|
+
justifyContent: 'space-between',
|
|
651
|
+
borderRadius: 'small',
|
|
652
|
+
pl: 'large',
|
|
653
|
+
pb: 'large'
|
|
654
|
+
},
|
|
387
655
|
className: className
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
}, React__default.createElement(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
656
|
+
}, React__default.createElement(system.Box, {
|
|
657
|
+
pt: "medium"
|
|
658
|
+
}, title && React__default.createElement(Text, {
|
|
659
|
+
as: "h4",
|
|
660
|
+
variant: "headline4"
|
|
661
|
+
}, title), children), React__default.createElement(system.Box, {
|
|
662
|
+
__baseCSS: {
|
|
663
|
+
display: 'flex',
|
|
664
|
+
justifyContent: 'flex-end',
|
|
665
|
+
alignItems: 'start',
|
|
666
|
+
paddingTop: 'xsmall',
|
|
667
|
+
paddingX: 'xsmall'
|
|
668
|
+
}
|
|
669
|
+
}, React__default.createElement(system.Box, Object.assign({
|
|
670
|
+
as: Button,
|
|
671
|
+
__baseCSS: {
|
|
672
|
+
color: 'text',
|
|
673
|
+
bg: 'transparent',
|
|
674
|
+
lineHeight: 'xsmall',
|
|
675
|
+
px: 'xxsmall',
|
|
676
|
+
':hover': {
|
|
677
|
+
color: 'text',
|
|
678
|
+
bg: 'transparent',
|
|
679
|
+
cursor: 'pointer'
|
|
680
|
+
},
|
|
681
|
+
':focus': {
|
|
682
|
+
outline: 0
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}, closeButtonProps, {
|
|
686
|
+
ref: closeButtonRef
|
|
687
|
+
}), React__default.createElement(icons.Close, {
|
|
398
688
|
size: 16
|
|
399
689
|
}))))));
|
|
690
|
+
}; // get the overlayTriggerState and openButton props for using the dialog component
|
|
691
|
+
|
|
692
|
+
var useDialogButtonProps = function useDialogButtonProps() {
|
|
693
|
+
var state = overlays.useOverlayTriggerState({});
|
|
694
|
+
var openButtonRef = React__default.useRef();
|
|
695
|
+
|
|
696
|
+
var _useButton2 = button.useButton({
|
|
697
|
+
onPress: function onPress() {
|
|
698
|
+
return state.open();
|
|
699
|
+
}
|
|
700
|
+
}, openButtonRef),
|
|
701
|
+
openButtonProps = _useButton2.buttonProps;
|
|
702
|
+
|
|
703
|
+
return {
|
|
704
|
+
state: state,
|
|
705
|
+
openButtonProps: openButtonProps,
|
|
706
|
+
openButtonRef: openButtonRef
|
|
707
|
+
};
|
|
400
708
|
};
|
|
401
709
|
|
|
710
|
+
var _excluded$f = ["variant"];
|
|
711
|
+
// ---------------
|
|
712
|
+
|
|
402
713
|
var Divider = function Divider(_ref) {
|
|
403
714
|
var _ref$variant = _ref.variant,
|
|
404
715
|
variant = _ref$variant === void 0 ? 'regular' : _ref$variant,
|
|
405
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
716
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
406
717
|
|
|
407
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
718
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
408
719
|
as: "hr",
|
|
409
720
|
variant: "divider." + variant
|
|
410
721
|
}));
|
|
411
722
|
};
|
|
412
723
|
|
|
724
|
+
var _excluded$g = ["variant", "type"];
|
|
725
|
+
// ---------------
|
|
726
|
+
|
|
413
727
|
var Input = function Input(_ref) {
|
|
414
728
|
var _ref$variant = _ref.variant,
|
|
415
|
-
variant = _ref$variant === void 0 ? '
|
|
729
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
416
730
|
_ref$type = _ref.type,
|
|
417
731
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
418
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
732
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
419
733
|
|
|
420
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
734
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
421
735
|
as: "input",
|
|
422
736
|
type: type,
|
|
423
737
|
variant: "input." + variant
|
|
424
738
|
}));
|
|
425
739
|
};
|
|
426
740
|
|
|
427
|
-
var
|
|
428
|
-
|
|
429
|
-
variant = _ref$variant === void 0 ? 'error' : _ref$variant,
|
|
430
|
-
children = _ref.children,
|
|
431
|
-
className = _ref.className,
|
|
432
|
-
props = _objectWithoutPropertiesLoose(_ref, ["variant", "children", "className"]);
|
|
433
|
-
|
|
434
|
-
var classNames = system.useStyles({
|
|
435
|
-
variant: "validation." + variant,
|
|
436
|
-
css: {
|
|
437
|
-
display: 'flex',
|
|
438
|
-
alignItems: 'center'
|
|
439
|
-
},
|
|
440
|
-
className: className
|
|
441
|
-
});
|
|
442
|
-
return React__default.createElement("span", Object.assign({
|
|
443
|
-
className: classNames
|
|
444
|
-
}, props), children);
|
|
445
|
-
};
|
|
741
|
+
var _excluded$h = ["type", "variant", "labelVariant", "htmlFor", "label", "required", "error", "errorMessage", "disabled"];
|
|
742
|
+
// ---------------
|
|
446
743
|
|
|
447
744
|
var Field = function Field(_ref) {
|
|
448
|
-
var _ref$
|
|
449
|
-
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
450
|
-
_ref$type = _ref.type,
|
|
745
|
+
var _ref$type = _ref.type,
|
|
451
746
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
452
|
-
_ref$
|
|
453
|
-
|
|
747
|
+
_ref$variant = _ref.variant,
|
|
748
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
749
|
+
_ref$labelVariant = _ref.labelVariant,
|
|
750
|
+
labelVariant = _ref$labelVariant === void 0 ? 'above' : _ref$labelVariant,
|
|
454
751
|
htmlFor = _ref.htmlFor,
|
|
455
752
|
label = _ref.label,
|
|
753
|
+
required = _ref.required,
|
|
456
754
|
error = _ref.error,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
return React__default.createElement("div", null, React__default.createElement(Label, {
|
|
469
|
-
className: labelClassName,
|
|
470
|
-
htmlFor: htmlFor
|
|
471
|
-
}, label, error ? React__default.createElement(icons.Required, {
|
|
472
|
-
size: 16,
|
|
473
|
-
className: errorClassName
|
|
474
|
-
}) : ''), React__default.createElement(Input, Object.assign({}, props, {
|
|
755
|
+
errorMessage = _ref.errorMessage,
|
|
756
|
+
disabled = _ref.disabled,
|
|
757
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
758
|
+
|
|
759
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Label, {
|
|
760
|
+
variant: labelVariant,
|
|
761
|
+
htmlFor: htmlFor,
|
|
762
|
+
required: required
|
|
763
|
+
}, label), React__default.createElement(Input, Object.assign({}, props, {
|
|
475
764
|
type: type,
|
|
476
|
-
id: htmlFor
|
|
477
|
-
|
|
765
|
+
id: htmlFor,
|
|
766
|
+
disabled: disabled,
|
|
767
|
+
variant: variant
|
|
768
|
+
})), error && errorMessage && React__default.createElement(ValidationMessage, null, React__default.createElement(icons.Exclamation, {
|
|
478
769
|
size: 16
|
|
479
|
-
}),
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
var Heading = function Heading(_ref) {
|
|
483
|
-
var _ref$as = _ref.as,
|
|
484
|
-
as = _ref$as === void 0 ? 'h2' : _ref$as,
|
|
485
|
-
_ref$variant = _ref.variant,
|
|
486
|
-
variant = _ref$variant === void 0 ? 'h2' : _ref$variant,
|
|
487
|
-
children = _ref.children,
|
|
488
|
-
props = _objectWithoutPropertiesLoose(_ref, ["as", "variant", "children"]);
|
|
489
|
-
|
|
490
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
491
|
-
as: as,
|
|
492
|
-
variant: "text." + variant
|
|
493
|
-
}), children);
|
|
770
|
+
}), errorMessage));
|
|
494
771
|
};
|
|
495
772
|
|
|
496
|
-
var
|
|
497
|
-
|
|
498
|
-
show = _ref$show === void 0 ? false : _ref$show,
|
|
499
|
-
children = _ref.children,
|
|
500
|
-
props = _objectWithoutPropertiesLoose(_ref, ["show", "children"]);
|
|
501
|
-
|
|
502
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
503
|
-
as: "span",
|
|
504
|
-
display: show ? 'display' : 'none'
|
|
505
|
-
}), children);
|
|
506
|
-
};
|
|
773
|
+
var _excluded$i = ["variant"];
|
|
774
|
+
// ---------------
|
|
507
775
|
|
|
508
776
|
var Image = function Image(_ref) {
|
|
509
777
|
var _ref$variant = _ref.variant,
|
|
510
778
|
variant = _ref$variant === void 0 ? 'fullWidth' : _ref$variant,
|
|
511
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
779
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
512
780
|
|
|
513
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
781
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
514
782
|
as: "img",
|
|
515
|
-
variant: "
|
|
783
|
+
variant: "image." + variant
|
|
516
784
|
}));
|
|
517
785
|
};
|
|
518
786
|
|
|
787
|
+
var _excluded$j = ["as", "variant", "children", "disabled"];
|
|
788
|
+
// ---------------
|
|
789
|
+
|
|
519
790
|
var Link = function Link(_ref) {
|
|
520
|
-
var _ref$
|
|
521
|
-
|
|
791
|
+
var _ref$as = _ref.as,
|
|
792
|
+
as = _ref$as === void 0 ? 'a' : _ref$as,
|
|
793
|
+
_ref$variant = _ref.variant,
|
|
794
|
+
variant = _ref$variant === void 0 ? 'link' : _ref$variant,
|
|
522
795
|
children = _ref.children,
|
|
523
|
-
|
|
796
|
+
disabled = _ref.disabled,
|
|
797
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
798
|
+
|
|
799
|
+
var ref = React.useRef();
|
|
524
800
|
|
|
525
|
-
|
|
526
|
-
as:
|
|
527
|
-
|
|
801
|
+
var _useLink = link.useLink(_extends({}, props, {
|
|
802
|
+
elementType: typeof as === 'string' ? as : 'span',
|
|
803
|
+
isDisabled: disabled
|
|
804
|
+
}), ref),
|
|
805
|
+
linkProps = _useLink.linkProps;
|
|
806
|
+
|
|
807
|
+
return React__default.createElement(Text, Object.assign({}, props, linkProps, {
|
|
808
|
+
as: as,
|
|
809
|
+
variant: variant,
|
|
810
|
+
ref: ref
|
|
528
811
|
}), children);
|
|
529
812
|
};
|
|
530
813
|
|
|
814
|
+
var _excluded$k = ["variant", "label", "onClick", "show", "children"];
|
|
815
|
+
// ---------------
|
|
816
|
+
|
|
531
817
|
var Menu = function Menu(_ref) {
|
|
532
818
|
var _ref$variant = _ref.variant,
|
|
533
|
-
variant = _ref$variant === void 0 ? '
|
|
819
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
534
820
|
_ref$label = _ref.label,
|
|
535
821
|
label = _ref$label === void 0 ? 'Menu' : _ref$label,
|
|
536
822
|
onClick = _ref.onClick,
|
|
537
823
|
_ref$show = _ref.show,
|
|
538
824
|
show = _ref$show === void 0 ? false : _ref$show,
|
|
539
825
|
children = _ref.children,
|
|
540
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
826
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
541
827
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
position: 'absolute',
|
|
545
|
-
minWidth: '120px',
|
|
546
|
-
display: 'block',
|
|
547
|
-
textAlign: 'left',
|
|
548
|
-
borderRadius: '2px'
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
return React__default.createElement(Box, Object.assign({
|
|
552
|
-
variant: "content." + variant
|
|
828
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
829
|
+
variant: "menu." + variant
|
|
553
830
|
}, props), React__default.createElement(Button, {
|
|
554
831
|
onClick: onClick,
|
|
555
832
|
variant: "menu"
|
|
556
|
-
}, label), show ? React__default.createElement(
|
|
557
|
-
|
|
833
|
+
}, label), show ? React__default.createElement(system.Box, {
|
|
834
|
+
display: "block",
|
|
835
|
+
position: "absolute",
|
|
836
|
+
minWidth: "120px",
|
|
837
|
+
borderRadius: "2px"
|
|
558
838
|
}, children) : null);
|
|
559
839
|
};
|
|
560
840
|
|
|
841
|
+
var _excluded$l = ["variant", "className", "children"];
|
|
842
|
+
// ---------------
|
|
843
|
+
|
|
561
844
|
var MenuItem = function MenuItem(_ref) {
|
|
562
845
|
var _ref$variant = _ref.variant,
|
|
563
|
-
variant = _ref$variant === void 0 ? '
|
|
846
|
+
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
564
847
|
className = _ref.className,
|
|
565
848
|
children = _ref.children,
|
|
566
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
849
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
567
850
|
|
|
568
|
-
|
|
569
|
-
variant: "
|
|
851
|
+
return React__default.createElement(system.Box, {
|
|
852
|
+
variant: "menuItem." + variant,
|
|
570
853
|
className: className
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
className: classNames
|
|
575
|
-
}), children);
|
|
854
|
+
}, React__default.createElement(Link, Object.assign({
|
|
855
|
+
variant: "menuItemLink"
|
|
856
|
+
}, props), children));
|
|
576
857
|
};
|
|
577
858
|
|
|
859
|
+
var _excluded$m = ["messageTitle", "variant", "className", "children"];
|
|
860
|
+
// ---------------
|
|
861
|
+
|
|
578
862
|
var Message = function Message(_ref) {
|
|
579
863
|
var messageTitle = _ref.messageTitle,
|
|
580
864
|
_ref$variant = _ref.variant,
|
|
581
865
|
variant = _ref$variant === void 0 ? 'info' : _ref$variant,
|
|
582
866
|
className = _ref.className,
|
|
583
867
|
children = _ref.children,
|
|
584
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
868
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
585
869
|
|
|
586
870
|
var icon = React__default.createElement(icons.Info, null);
|
|
587
871
|
|
|
@@ -593,259 +877,486 @@ var Message = function Message(_ref) {
|
|
|
593
877
|
icon = React__default.createElement(icons.Exclamation, null);
|
|
594
878
|
}
|
|
595
879
|
|
|
596
|
-
return React__default.createElement(Box, Object.assign({
|
|
880
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
597
881
|
display: "inline-block",
|
|
598
|
-
variant: "
|
|
882
|
+
variant: "message." + variant,
|
|
599
883
|
className: className
|
|
600
|
-
}, props), React__default.createElement(Box, {
|
|
884
|
+
}, props), React__default.createElement(system.Box, {
|
|
601
885
|
display: "flex",
|
|
602
886
|
alignItems: "center",
|
|
603
|
-
variant: "
|
|
604
|
-
}, icon, React__default.createElement(
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
}, messageTitle)), React__default.createElement(Box, {
|
|
612
|
-
className: system.useStyles({
|
|
613
|
-
css: {
|
|
614
|
-
color: 'black'
|
|
615
|
-
}
|
|
616
|
-
})
|
|
887
|
+
variant: "message.title"
|
|
888
|
+
}, icon, React__default.createElement(Text, {
|
|
889
|
+
as: "h4",
|
|
890
|
+
variant: "headline4"
|
|
891
|
+
}, messageTitle)), React__default.createElement(system.Box, {
|
|
892
|
+
css: {
|
|
893
|
+
color: 'black'
|
|
894
|
+
}
|
|
617
895
|
}, children));
|
|
618
896
|
};
|
|
619
897
|
|
|
620
|
-
|
|
621
|
-
var className = _ref.className,
|
|
622
|
-
variant = _ref.variant,
|
|
623
|
-
checked = _ref.checked;
|
|
624
|
-
var radioIconStyle = system.useStyles({
|
|
625
|
-
variant: "form." + variant,
|
|
626
|
-
css: {
|
|
627
|
-
ariaHidden: 'true',
|
|
628
|
-
mr: 2,
|
|
629
|
-
verticalAlign: 'middle',
|
|
630
|
-
':hover': {
|
|
631
|
-
cursor: 'pointer'
|
|
632
|
-
},
|
|
633
|
-
'input:disabled ~ &': {
|
|
634
|
-
color: 'muted',
|
|
635
|
-
cursor: 'not-allowed'
|
|
636
|
-
}
|
|
637
|
-
},
|
|
638
|
-
className: className
|
|
639
|
-
});
|
|
898
|
+
// ---------------
|
|
640
899
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
900
|
+
function MarigoldProvider(_ref) {
|
|
901
|
+
var theme = _ref.theme,
|
|
902
|
+
children = _ref.children;
|
|
903
|
+
var outer = system.useTheme();
|
|
904
|
+
var isTopLevel = outer.theme === system.__defaultTheme;
|
|
905
|
+
return React__default.createElement(system.ThemeProvider, {
|
|
906
|
+
theme: theme
|
|
907
|
+
}, isTopLevel ? React__default.createElement(React__default.Fragment, null, React__default.createElement(system.Global, null), React__default.createElement(overlays$1.OverlayProvider, null, children)) : children);
|
|
908
|
+
}
|
|
646
909
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
910
|
+
var RadioIcon = function RadioIcon(_ref) {
|
|
911
|
+
var _ref$variant = _ref.variant,
|
|
912
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
913
|
+
_ref$checked = _ref.checked,
|
|
914
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
915
|
+
_ref$disabled = _ref.disabled,
|
|
916
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
917
|
+
_ref$error = _ref.error,
|
|
918
|
+
error = _ref$error === void 0 ? false : _ref$error;
|
|
919
|
+
var conditionalStates = disabled ? {
|
|
920
|
+
disabled: disabled
|
|
921
|
+
} : {
|
|
922
|
+
checked: checked,
|
|
923
|
+
error: error
|
|
924
|
+
};
|
|
925
|
+
return React__default.createElement(system.SVG, {
|
|
926
|
+
width: "16",
|
|
927
|
+
height: "32",
|
|
928
|
+
viewBox: "0 0 16 32",
|
|
929
|
+
fill: "none",
|
|
930
|
+
"aria-hidden": "true"
|
|
931
|
+
}, React__default.createElement(system.Box, {
|
|
932
|
+
variant: system.conditional("radio." + variant, conditionalStates),
|
|
933
|
+
as: "circle",
|
|
934
|
+
cx: "8",
|
|
935
|
+
cy: "16",
|
|
936
|
+
r: "7.5"
|
|
937
|
+
}), checked && React__default.createElement("circle", {
|
|
938
|
+
fill: "white",
|
|
939
|
+
cx: "8",
|
|
940
|
+
cy: "16",
|
|
941
|
+
r: "3"
|
|
942
|
+
}));
|
|
650
943
|
};
|
|
651
944
|
|
|
652
|
-
var
|
|
653
|
-
|
|
654
|
-
_ref2$variant = _ref2.variant,
|
|
655
|
-
variant = _ref2$variant === void 0 ? 'radio' : _ref2$variant,
|
|
656
|
-
props = _objectWithoutPropertiesLoose(_ref2, ["className", "variant"]);
|
|
945
|
+
var _excluded$n = ["error"],
|
|
946
|
+
_excluded2$3 = ["label", "required", "labelVariant", "error", "errorMessage"];
|
|
657
947
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
return React__default.createElement(Box, {
|
|
669
|
-
display: "inline-block"
|
|
670
|
-
}, React__default.createElement("input", Object.assign({
|
|
948
|
+
var RadioInput = function RadioInput(_ref) {
|
|
949
|
+
var error = _ref.error,
|
|
950
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
951
|
+
|
|
952
|
+
var _useFocusRing = focus.useFocusRing(),
|
|
953
|
+
focusProps = _useFocusRing.focusProps;
|
|
954
|
+
|
|
955
|
+
return React__default.createElement(system.Box, {
|
|
956
|
+
pr: "xsmall"
|
|
957
|
+
}, React__default.createElement(visuallyHidden.VisuallyHidden, null, React__default.createElement("input", Object.assign({
|
|
671
958
|
type: "radio",
|
|
672
|
-
|
|
673
|
-
}, props)), React__default.createElement(RadioIcon, {
|
|
959
|
+
disabled: props.disabled
|
|
960
|
+
}, focusProps, props))), React__default.createElement(RadioIcon, {
|
|
961
|
+
variant: props.variant,
|
|
962
|
+
disabled: props.disabled,
|
|
674
963
|
checked: props.checked,
|
|
675
|
-
|
|
676
|
-
variant: variant
|
|
964
|
+
error: error
|
|
677
965
|
}));
|
|
678
966
|
};
|
|
679
967
|
|
|
680
|
-
var Radio = function Radio(
|
|
681
|
-
var label =
|
|
682
|
-
required =
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
968
|
+
var Radio = function Radio(_ref2) {
|
|
969
|
+
var label = _ref2.label,
|
|
970
|
+
required = _ref2.required,
|
|
971
|
+
_ref2$labelVariant = _ref2.labelVariant,
|
|
972
|
+
labelVariant = _ref2$labelVariant === void 0 ? 'inline' : _ref2$labelVariant,
|
|
973
|
+
error = _ref2.error,
|
|
974
|
+
errorMessage = _ref2.errorMessage,
|
|
975
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
976
|
+
|
|
977
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(system.Box, {
|
|
978
|
+
as: Label,
|
|
979
|
+
htmlFor: props.id,
|
|
980
|
+
required: required,
|
|
981
|
+
variant: "label." + labelVariant,
|
|
982
|
+
css: props.disabled ? {
|
|
983
|
+
color: 'disabled',
|
|
984
|
+
':hover': {
|
|
985
|
+
cursor: 'not-allowed'
|
|
986
|
+
}
|
|
987
|
+
} : {
|
|
988
|
+
color: 'text',
|
|
989
|
+
':hover': {
|
|
990
|
+
cursor: 'pointer'
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}, React__default.createElement(system.Box, Object.assign({
|
|
994
|
+
as: RadioInput,
|
|
995
|
+
error: error
|
|
996
|
+
}, props)), label), error && errorMessage && React__default.createElement(ValidationMessage, null, React__default.createElement(icons.Exclamation, {
|
|
997
|
+
size: 16
|
|
998
|
+
}), errorMessage));
|
|
694
999
|
};
|
|
695
1000
|
|
|
1001
|
+
var _excluded$o = ["variant", "className"];
|
|
1002
|
+
// ---------------
|
|
1003
|
+
|
|
696
1004
|
var Slider = function Slider(_ref) {
|
|
697
1005
|
var _ref$variant = _ref.variant,
|
|
698
|
-
variant = _ref$variant === void 0 ? '
|
|
1006
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
699
1007
|
className = _ref.className,
|
|
700
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
1008
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
701
1009
|
|
|
702
|
-
|
|
703
|
-
|
|
1010
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
1011
|
+
as: "input",
|
|
1012
|
+
type: "range",
|
|
704
1013
|
css: {
|
|
705
1014
|
verticalAlign: 'middle'
|
|
706
1015
|
},
|
|
1016
|
+
variant: "slider." + variant,
|
|
707
1017
|
className: className
|
|
708
|
-
});
|
|
709
|
-
return React__default.createElement("input", Object.assign({
|
|
710
|
-
type: "range",
|
|
711
|
-
className: classNames
|
|
712
1018
|
}, props));
|
|
713
1019
|
};
|
|
714
1020
|
|
|
715
|
-
var
|
|
716
|
-
var
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
props = _objectWithoutPropertiesLoose(_ref, ["variant", "children"]);
|
|
1021
|
+
var Option = function Option(_ref) {
|
|
1022
|
+
var item = _ref.item,
|
|
1023
|
+
state = _ref.state;
|
|
1024
|
+
var ref = React.useRef(null);
|
|
720
1025
|
|
|
721
|
-
var
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
1026
|
+
var _useState = React.useState(false),
|
|
1027
|
+
disabled = _useState[0],
|
|
1028
|
+
setDisabled = _useState[1];
|
|
1029
|
+
|
|
1030
|
+
var _useOption = listbox.useOption({
|
|
1031
|
+
key: item.key
|
|
1032
|
+
}, state, ref),
|
|
1033
|
+
optionProps = _useOption.optionProps,
|
|
1034
|
+
isSelected = _useOption.isSelected;
|
|
1035
|
+
|
|
1036
|
+
React.useEffect(function () {
|
|
1037
|
+
for (var _iterator = _createForOfIteratorHelperLoose(state.disabledKeys.values()), _step; !(_step = _iterator()).done;) {
|
|
1038
|
+
var key = _step.value;
|
|
1039
|
+
|
|
1040
|
+
if (key === item.key) {
|
|
1041
|
+
setDisabled(true);
|
|
1042
|
+
}
|
|
726
1043
|
}
|
|
727
|
-
});
|
|
728
|
-
return React__default.createElement(Box, {
|
|
729
|
-
|
|
730
|
-
},
|
|
731
|
-
|
|
732
|
-
variant:
|
|
733
|
-
}
|
|
734
|
-
className: iconStyles
|
|
735
|
-
}));
|
|
1044
|
+
}, [state.disabledKeys, item.key]);
|
|
1045
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
1046
|
+
as: "li"
|
|
1047
|
+
}, optionProps, {
|
|
1048
|
+
ref: ref,
|
|
1049
|
+
variant: isSelected ? 'select.option.selected' : disabled ? 'select.option.disabled' : 'select.option'
|
|
1050
|
+
}), item.rendered);
|
|
736
1051
|
};
|
|
737
1052
|
|
|
738
|
-
var
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1053
|
+
var ListBoxSection = function ListBoxSection(_ref) {
|
|
1054
|
+
var section = _ref.section,
|
|
1055
|
+
state = _ref.state;
|
|
1056
|
+
|
|
1057
|
+
var _useListBoxSection = listbox.useListBoxSection({
|
|
1058
|
+
heading: section.rendered,
|
|
1059
|
+
'aria-label': section['aria-label']
|
|
1060
|
+
}),
|
|
1061
|
+
itemProps = _useListBoxSection.itemProps,
|
|
1062
|
+
headingProps = _useListBoxSection.headingProps,
|
|
1063
|
+
groupProps = _useListBoxSection.groupProps;
|
|
1064
|
+
|
|
1065
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
1066
|
+
as: "li"
|
|
1067
|
+
}, itemProps, {
|
|
1068
|
+
css: {
|
|
1069
|
+
cursor: 'not-allowed'
|
|
1070
|
+
}
|
|
1071
|
+
}), section.rendered && React__default.createElement(system.Box, Object.assign({
|
|
1072
|
+
as: "span"
|
|
1073
|
+
}, headingProps, {
|
|
1074
|
+
variant: 'select.section'
|
|
1075
|
+
}), section.rendered), React__default.createElement(system.Box, Object.assign({
|
|
1076
|
+
as: "ul"
|
|
1077
|
+
}, groupProps), [].concat(section.childNodes).map(function (node) {
|
|
1078
|
+
return React__default.createElement(Option, {
|
|
1079
|
+
key: node.key,
|
|
1080
|
+
item: node,
|
|
1081
|
+
state: state
|
|
1082
|
+
});
|
|
1083
|
+
})));
|
|
1084
|
+
};
|
|
745
1085
|
|
|
746
|
-
|
|
747
|
-
var
|
|
748
|
-
var
|
|
749
|
-
|
|
1086
|
+
var ListBox = function ListBox(props) {
|
|
1087
|
+
var ref = React.useRef(null);
|
|
1088
|
+
var state = props.state,
|
|
1089
|
+
error = props.error;
|
|
750
1090
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
flexDirection = 'row';
|
|
754
|
-
alignItems = 'flex-start';
|
|
755
|
-
}
|
|
1091
|
+
var _useListBox = listbox.useListBox(props, state, ref),
|
|
1092
|
+
listBoxProps = _useListBox.listBoxProps;
|
|
756
1093
|
|
|
757
|
-
return React__default.createElement(Box, Object.assign({
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
1094
|
+
return React__default.createElement(system.Box, Object.assign({
|
|
1095
|
+
as: "ul",
|
|
1096
|
+
p: "none",
|
|
1097
|
+
css: {
|
|
1098
|
+
listStyle: 'none'
|
|
1099
|
+
}
|
|
1100
|
+
}, listBoxProps, {
|
|
1101
|
+
variant: error ? 'select.listbox.error' : 'select.listbox',
|
|
1102
|
+
ref: ref
|
|
1103
|
+
}), [].concat(state.collection).map(function (item) {
|
|
1104
|
+
return item.type === 'section' ? React__default.createElement(ListBoxSection, {
|
|
1105
|
+
key: item.key,
|
|
1106
|
+
section: item,
|
|
1107
|
+
state: state
|
|
1108
|
+
}) : React__default.createElement(Option, {
|
|
1109
|
+
key: item.key,
|
|
1110
|
+
item: item,
|
|
1111
|
+
state: state
|
|
1112
|
+
});
|
|
769
1113
|
}));
|
|
770
1114
|
};
|
|
771
1115
|
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
_ref$variant = _ref.variant,
|
|
776
|
-
variant = _ref$variant === void 0 ? 'body' : _ref$variant,
|
|
777
|
-
_ref$textColor = _ref.textColor,
|
|
778
|
-
textColor = _ref$textColor === void 0 ? 'inherit' : _ref$textColor,
|
|
1116
|
+
var _excluded$p = ["children", "className", "isOpen", "onClose"];
|
|
1117
|
+
var Popover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1118
|
+
var children = _ref.children,
|
|
779
1119
|
className = _ref.className,
|
|
780
|
-
|
|
781
|
-
|
|
1120
|
+
isOpen = _ref.isOpen,
|
|
1121
|
+
onClose = _ref.onClose,
|
|
1122
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
1123
|
+
|
|
1124
|
+
// Handle events that should cause the popup to close,
|
|
1125
|
+
var _useOverlay = overlays$1.useOverlay({
|
|
1126
|
+
isOpen: isOpen,
|
|
1127
|
+
onClose: onClose,
|
|
1128
|
+
shouldCloseOnBlur: true,
|
|
1129
|
+
isDismissable: true
|
|
1130
|
+
}, ref),
|
|
1131
|
+
overlayProps = _useOverlay.overlayProps; // Hide content outside the modal from screen readers.
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
var _useModal = overlays$1.useModal(),
|
|
1135
|
+
modalProps = _useModal.modalProps;
|
|
1136
|
+
|
|
1137
|
+
return React__default.createElement(overlays$1.OverlayContainer, null, React__default.createElement(focus.FocusScope, {
|
|
1138
|
+
restoreFocus: true
|
|
1139
|
+
}, React__default.createElement(system.Box, Object.assign({}, utils.mergeProps(overlayProps, otherProps, modalProps), {
|
|
1140
|
+
className: className,
|
|
1141
|
+
ref: ref
|
|
1142
|
+
}), children, React__default.createElement(overlays$1.DismissButton, {
|
|
1143
|
+
onDismiss: onClose
|
|
1144
|
+
}))));
|
|
1145
|
+
});
|
|
782
1146
|
|
|
783
|
-
|
|
784
|
-
|
|
1147
|
+
var _excluded$q = ["labelVariant", "placeholder", "disabled", "required", "error", "errorMessage", "width", "className"];
|
|
1148
|
+
// ---------------
|
|
1149
|
+
|
|
1150
|
+
var Select = function Select(_ref) {
|
|
1151
|
+
var _ref$labelVariant = _ref.labelVariant,
|
|
1152
|
+
labelVariant = _ref$labelVariant === void 0 ? 'above' : _ref$labelVariant,
|
|
1153
|
+
_ref$placeholder = _ref.placeholder,
|
|
1154
|
+
placeholder = _ref$placeholder === void 0 ? 'Select an option' : _ref$placeholder,
|
|
1155
|
+
disabled = _ref.disabled,
|
|
1156
|
+
required = _ref.required,
|
|
1157
|
+
error = _ref.error,
|
|
1158
|
+
errorMessage = _ref.errorMessage,
|
|
1159
|
+
width = _ref.width,
|
|
1160
|
+
className = _ref.className,
|
|
1161
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
1162
|
+
|
|
1163
|
+
var state = select.useSelectState(props);
|
|
1164
|
+
var overlayTriggerState = overlays.useOverlayTriggerState({});
|
|
1165
|
+
var triggerRef = React.useRef();
|
|
1166
|
+
var overlayRef = React.useRef(); // Get props for the overlay
|
|
1167
|
+
|
|
1168
|
+
var _useOverlayTrigger = overlays$1.useOverlayTrigger({
|
|
1169
|
+
type: 'listbox'
|
|
1170
|
+
}, overlayTriggerState, triggerRef),
|
|
1171
|
+
overlayProps = _useOverlayTrigger.overlayProps; // Get popover positioning props relative to the trigger
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
var _useOverlayPosition = overlays$1.useOverlayPosition({
|
|
1175
|
+
targetRef: triggerRef,
|
|
1176
|
+
overlayRef: overlayRef,
|
|
1177
|
+
placement: 'bottom',
|
|
1178
|
+
shouldFlip: false,
|
|
1179
|
+
isOpen: state.isOpen,
|
|
1180
|
+
onClose: state.close
|
|
1181
|
+
}),
|
|
1182
|
+
positionProps = _useOverlayPosition.overlayProps; // Get props for child elements from useSelect
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
var _useSelect = select$1.useSelect(props, state, triggerRef),
|
|
1186
|
+
labelProps = _useSelect.labelProps,
|
|
1187
|
+
triggerProps = _useSelect.triggerProps,
|
|
1188
|
+
valueProps = _useSelect.valueProps,
|
|
1189
|
+
menuProps = _useSelect.menuProps; // Get props for the button based on the trigger props from useSelect
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
var _useButton = button.useButton(triggerProps, triggerRef),
|
|
1193
|
+
buttonProps = _useButton.buttonProps;
|
|
1194
|
+
|
|
1195
|
+
var _useFocusRing = focus.useFocusRing(),
|
|
1196
|
+
focusProps = _useFocusRing.focusProps;
|
|
1197
|
+
|
|
1198
|
+
return React__default.createElement(system.Box, {
|
|
1199
|
+
position: "relative",
|
|
1200
|
+
display: "inline-block",
|
|
1201
|
+
width: width && width
|
|
1202
|
+
}, props.label && React__default.createElement(system.Box, null, React__default.createElement(Label, Object.assign({}, labelProps, {
|
|
1203
|
+
htmlFor: labelProps.id,
|
|
1204
|
+
variant: labelVariant
|
|
1205
|
+
}), required ? React__default.createElement(system.Box, {
|
|
1206
|
+
as: "span",
|
|
1207
|
+
display: "inline-flex",
|
|
1208
|
+
alignItems: "center"
|
|
1209
|
+
}, props.label, React__default.createElement(system.Box, {
|
|
1210
|
+
as: icons.Required,
|
|
1211
|
+
size: 16,
|
|
785
1212
|
css: {
|
|
786
|
-
color:
|
|
787
|
-
}
|
|
1213
|
+
color: 'error'
|
|
1214
|
+
}
|
|
1215
|
+
})) : props.label)), React__default.createElement(select$1.HiddenSelect, {
|
|
1216
|
+
state: state,
|
|
1217
|
+
triggerRef: triggerRef,
|
|
1218
|
+
label: props.label,
|
|
1219
|
+
name: props.name,
|
|
1220
|
+
isDisabled: disabled
|
|
1221
|
+
}), React__default.createElement(system.Box, Object.assign({
|
|
1222
|
+
as: "button"
|
|
1223
|
+
}, utils.mergeProps(buttonProps, focusProps), {
|
|
1224
|
+
ref: triggerRef,
|
|
1225
|
+
variant: error && state.isOpen && !disabled ? 'button.select.errorOpened' : error ? 'button.select.error' : state.isOpen && !disabled ? 'button.select.open' : 'button.select',
|
|
1226
|
+
disabled: disabled,
|
|
788
1227
|
className: className
|
|
789
|
-
})
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
},
|
|
1228
|
+
}), React__default.createElement(system.Box, Object.assign({
|
|
1229
|
+
as: "span"
|
|
1230
|
+
}, valueProps, {
|
|
1231
|
+
variant: disabled ? 'select.disabled' : 'select'
|
|
1232
|
+
}), state.selectedItem ? state.selectedItem.rendered : placeholder), state.isOpen && !disabled ? React__default.createElement(system.Box, {
|
|
1233
|
+
as: icons.ArrowUp,
|
|
1234
|
+
size: 16,
|
|
1235
|
+
css: {
|
|
1236
|
+
fill: 'text'
|
|
1237
|
+
}
|
|
1238
|
+
}) : React__default.createElement(system.Box, {
|
|
1239
|
+
as: icons.ArrowDown,
|
|
1240
|
+
size: 16,
|
|
1241
|
+
css: {
|
|
1242
|
+
fill: disabled ? 'disabled' : 'text'
|
|
1243
|
+
}
|
|
1244
|
+
})), state.isOpen && !disabled && React__default.createElement(system.Box, Object.assign({
|
|
1245
|
+
as: Popover
|
|
1246
|
+
}, overlayProps, positionProps, {
|
|
1247
|
+
css: {
|
|
1248
|
+
width: triggerRef.current && triggerRef.current.offsetWidth + 'px'
|
|
1249
|
+
},
|
|
1250
|
+
ref: overlayRef,
|
|
1251
|
+
isOpen: state.isOpen,
|
|
1252
|
+
onClose: state.close
|
|
1253
|
+
}), React__default.createElement(ListBox, Object.assign({
|
|
1254
|
+
error: error
|
|
1255
|
+
}, menuProps, {
|
|
1256
|
+
state: state
|
|
1257
|
+
}))), error && errorMessage && React__default.createElement(system.Box, {
|
|
1258
|
+
as: "span",
|
|
1259
|
+
display: "inline-flex",
|
|
1260
|
+
alignItems: "center"
|
|
1261
|
+
}, React__default.createElement(system.Box, {
|
|
1262
|
+
as: icons.Exclamation,
|
|
1263
|
+
size: 16,
|
|
1264
|
+
css: {
|
|
1265
|
+
color: 'error'
|
|
1266
|
+
}
|
|
1267
|
+
}), React__default.createElement(ValidationMessage, null, errorMessage)));
|
|
794
1268
|
};
|
|
795
1269
|
|
|
1270
|
+
var _excluded$r = ["variant", "htmlFor", "label", "error", "errorMessage", "required", "className", "children"];
|
|
1271
|
+
// ---------------
|
|
1272
|
+
|
|
796
1273
|
var Textarea = function Textarea(_ref) {
|
|
797
1274
|
var _ref$variant = _ref.variant,
|
|
798
|
-
variant = _ref$variant === void 0 ? '
|
|
1275
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
799
1276
|
_ref$htmlFor = _ref.htmlFor,
|
|
800
1277
|
htmlFor = _ref$htmlFor === void 0 ? 'textarea' : _ref$htmlFor,
|
|
801
1278
|
label = _ref.label,
|
|
1279
|
+
error = _ref.error,
|
|
802
1280
|
errorMessage = _ref.errorMessage,
|
|
803
|
-
|
|
804
|
-
required = _ref$required === void 0 ? false : _ref$required,
|
|
1281
|
+
required = _ref.required,
|
|
805
1282
|
_ref$className = _ref.className,
|
|
806
1283
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
807
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
1284
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
808
1285
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
});
|
|
814
|
-
var textareaClassNames = system.useStyles({
|
|
815
|
-
css: {
|
|
816
|
-
outlineColor: errorMessage && 'error'
|
|
817
|
-
},
|
|
818
|
-
className: className
|
|
819
|
-
});
|
|
820
|
-
return React__default.createElement(Box, null, label && React__default.createElement(Label, {
|
|
821
|
-
htmlFor: htmlFor
|
|
822
|
-
}, label, (errorMessage || required) && React__default.createElement(icons.Required, {
|
|
823
|
-
size: 16,
|
|
824
|
-
className: errorClassName
|
|
825
|
-
})), React__default.createElement(Box, Object.assign({
|
|
1286
|
+
return React__default.createElement(system.Box, null, label && React__default.createElement(Label, {
|
|
1287
|
+
htmlFor: htmlFor,
|
|
1288
|
+
required: required
|
|
1289
|
+
}, label), React__default.createElement(system.Box, Object.assign({
|
|
826
1290
|
as: "textarea"
|
|
827
1291
|
}, props, {
|
|
828
1292
|
display: "block",
|
|
829
1293
|
variant: "textarea." + variant,
|
|
830
|
-
|
|
831
|
-
|
|
1294
|
+
css: {
|
|
1295
|
+
outlineColor: error && 'error'
|
|
1296
|
+
},
|
|
1297
|
+
className: className
|
|
1298
|
+
})), error && errorMessage && React__default.createElement(ValidationMessage, null, React__default.createElement(icons.Exclamation, {
|
|
832
1299
|
size: 16
|
|
833
1300
|
}), errorMessage));
|
|
834
1301
|
};
|
|
835
1302
|
|
|
1303
|
+
var _excluded$s = ["children"];
|
|
836
1304
|
var Container = function Container(_ref) {
|
|
837
1305
|
var children = _ref.children,
|
|
838
|
-
props = _objectWithoutPropertiesLoose(_ref,
|
|
1306
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
839
1307
|
|
|
840
|
-
return React__default.createElement(Box, Object.assign({}, props, {
|
|
1308
|
+
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
841
1309
|
width: "100%"
|
|
842
1310
|
}), children);
|
|
843
1311
|
};
|
|
844
1312
|
|
|
1313
|
+
Object.defineProperty(exports, 'Box', {
|
|
1314
|
+
enumerable: true,
|
|
1315
|
+
get: function () {
|
|
1316
|
+
return system.Box;
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1319
|
+
Object.defineProperty(exports, 'ThemeProvider', {
|
|
1320
|
+
enumerable: true,
|
|
1321
|
+
get: function () {
|
|
1322
|
+
return system.ThemeProvider;
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
Object.defineProperty(exports, 'useTheme', {
|
|
1326
|
+
enumerable: true,
|
|
1327
|
+
get: function () {
|
|
1328
|
+
return system.useTheme;
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
Object.defineProperty(exports, 'VisuallyHidden', {
|
|
1332
|
+
enumerable: true,
|
|
1333
|
+
get: function () {
|
|
1334
|
+
return visuallyHidden.VisuallyHidden;
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
Object.defineProperty(exports, 'SSRProvider', {
|
|
1338
|
+
enumerable: true,
|
|
1339
|
+
get: function () {
|
|
1340
|
+
return ssr.SSRProvider;
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
Object.defineProperty(exports, 'Item', {
|
|
1344
|
+
enumerable: true,
|
|
1345
|
+
get: function () {
|
|
1346
|
+
return collections.Item;
|
|
1347
|
+
}
|
|
1348
|
+
});
|
|
1349
|
+
Object.defineProperty(exports, 'Section', {
|
|
1350
|
+
enumerable: true,
|
|
1351
|
+
get: function () {
|
|
1352
|
+
return collections.Section;
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
exports.ActionGroup = ActionGroup;
|
|
845
1356
|
exports.Alert = Alert;
|
|
846
1357
|
exports.Badge = Badge;
|
|
847
|
-
exports.Box = Box;
|
|
848
1358
|
exports.Button = Button;
|
|
1359
|
+
exports.Card = Card;
|
|
849
1360
|
exports.Checkbox = Checkbox;
|
|
850
1361
|
exports.Column = Column;
|
|
851
1362
|
exports.Columns = Columns;
|
|
@@ -853,12 +1364,13 @@ exports.Container = Container;
|
|
|
853
1364
|
exports.Dialog = Dialog;
|
|
854
1365
|
exports.Divider = Divider;
|
|
855
1366
|
exports.Field = Field;
|
|
856
|
-
exports.Heading = Heading;
|
|
857
|
-
exports.Hidden = Hidden;
|
|
858
1367
|
exports.Image = Image;
|
|
1368
|
+
exports.Inline = Inline;
|
|
859
1369
|
exports.Input = Input;
|
|
860
1370
|
exports.Label = Label;
|
|
1371
|
+
exports.LabelBase = LabelBase;
|
|
861
1372
|
exports.Link = Link;
|
|
1373
|
+
exports.MarigoldProvider = MarigoldProvider;
|
|
862
1374
|
exports.Menu = Menu;
|
|
863
1375
|
exports.MenuItem = MenuItem;
|
|
864
1376
|
exports.Message = Message;
|
|
@@ -869,4 +1381,5 @@ exports.Stack = Stack;
|
|
|
869
1381
|
exports.Text = Text;
|
|
870
1382
|
exports.Textarea = Textarea;
|
|
871
1383
|
exports.ValidationMessage = ValidationMessage;
|
|
1384
|
+
exports.useDialogButtonProps = useDialogButtonProps;
|
|
872
1385
|
//# sourceMappingURL=components.cjs.development.js.map
|