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