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