@marigold/components 0.2.0 → 0.3.3
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 +1 -2
- package/dist/ActionGroup/ActionGroup.stories.d.ts +5 -0
- package/dist/Alert/Alert.d.ts +7 -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 +5 -0
- package/dist/Button/Button.stories.d.ts +5 -0
- package/dist/Card/Card.d.ts +5 -0
- package/dist/Card/Card.stories.d.ts +5 -0
- package/dist/Checkbox/Checkbox.d.ts +10 -5
- package/dist/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/Checkbox/CheckboxIcons.d.ts +9 -9
- 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 +5 -2
- package/dist/Dialog/Dialog.stories.d.ts +5 -0
- package/dist/Dialog/ModalDialog.d.ts +4 -1
- package/dist/Divider/Divider.d.ts +7 -3
- package/dist/Divider/Divider.stories.d.ts +5 -0
- package/dist/Field/Field.d.ts +2 -0
- 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 +12 -1
- 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 -3
- package/dist/Provider/index.d.ts +1 -1
- package/dist/Radio/Radio.d.ts +9 -5
- package/dist/Radio/Radio.stories.d.ts +5 -0
- package/dist/Radio/RadioIcon.d.ts +9 -0
- package/dist/Select/ListBox.d.ts +1 -0
- package/dist/Select/ListBoxSection.d.ts +1 -0
- package/dist/Select/Option.d.ts +1 -0
- package/dist/Select/Select.d.ts +15 -1
- 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.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 +5 -0
- 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 +536 -580
- 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 +481 -535
- package/dist/components.esm.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/theme.d.ts +23 -48
- package/package.json +8 -4
- package/src/ActionGroup/ActionGroup.stories.tsx +47 -0
- package/src/ActionGroup/ActionGroup.test.tsx +36 -36
- package/src/ActionGroup/ActionGroup.tsx +17 -28
- package/src/Alert/Alert.stories.tsx +32 -0
- package/src/Alert/Alert.test.tsx +4 -1
- package/src/Alert/Alert.tsx +18 -3
- package/src/Badge/Badge.stories.tsx +38 -0
- package/src/Badge/Badge.test.tsx +5 -1
- package/src/Badge/Badge.tsx +13 -1
- package/src/Box.ts +2 -0
- package/src/Button/{Button.stories.mdx → Button.stories.tsx} +10 -17
- package/src/Button/Button.test.tsx +34 -11
- package/src/Button/Button.tsx +17 -3
- package/src/Card/{Card.stories.mdx → Card.stories.tsx} +9 -17
- package/src/Card/Card.test.tsx +8 -3
- package/src/Card/Card.tsx +13 -1
- package/src/Checkbox/{Checkbox.stories.mdx → Checkbox.stories.tsx} +31 -39
- package/src/Checkbox/Checkbox.test.tsx +77 -8
- package/src/Checkbox/Checkbox.tsx +70 -90
- package/src/Checkbox/CheckboxIcons.tsx +51 -41
- package/src/Column/Column.stories.tsx +33 -0
- package/src/Column/Column.tsx +0 -0
- 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/Container/Container.tsx +0 -0
- package/src/Dialog/{Dialog.stories.mdx → Dialog.stories.tsx} +33 -18
- package/src/Dialog/Dialog.test.tsx +91 -20
- package/src/Dialog/Dialog.tsx +63 -17
- package/src/Dialog/ModalDialog.tsx +33 -4
- 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.mdx → Field.stories.tsx} +33 -20
- package/src/Field/Field.test.tsx +55 -5
- package/src/Field/Field.tsx +10 -8
- 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.mdx → Input.stories.tsx} +10 -17
- package/src/Input/Input.test.tsx +7 -3
- package/src/Input/Input.tsx +13 -1
- package/src/Label/{Label.stories.mdx → Label.stories.tsx} +10 -21
- package/src/Label/Label.test.tsx +25 -4
- package/src/Label/Label.tsx +42 -9
- 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.mdx → Menu.stories.tsx} +13 -32
- package/src/Menu/Menu.test.tsx +7 -2
- package/src/Menu/Menu.tsx +10 -0
- package/src/MenuItem/MenuItem.stories.tsx +30 -0
- package/src/MenuItem/MenuItem.test.tsx +7 -2
- package/src/MenuItem/MenuItem.tsx +12 -0
- package/src/Message/Message.stories.tsx +30 -0
- package/src/Message/Message.test.tsx +4 -1
- package/src/Message/Message.tsx +17 -5
- package/src/Provider/MarigoldProvider.test.tsx +65 -55
- package/src/Provider/MarigoldProvider.tsx +37 -19
- package/src/Provider/index.ts +2 -1
- package/src/Radio/{Radio.stories.mdx → Radio.stories.tsx} +31 -39
- package/src/Radio/Radio.test.tsx +78 -9
- package/src/Radio/Radio.tsx +58 -87
- package/src/Radio/RadioIcon.tsx +49 -0
- package/src/Select/ListBox.tsx +1 -0
- package/src/Select/{Select.stories.mdx → Select.stories.tsx} +23 -20
- package/src/Select/Select.test.tsx +39 -1
- package/src/Select/Select.tsx +24 -13
- 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 +16 -7
- package/src/Stack/Stack.tsx +0 -0
- package/src/Text/{Text.stories.mdx → Text.stories.tsx} +20 -19
- package/src/Text/Text.test.tsx +2 -2
- package/src/Text/Text.tsx +12 -0
- package/src/Textarea/{Textarea.stories.mdx → Textarea.stories.tsx} +14 -24
- package/src/Textarea/Textarea.test.tsx +7 -3
- package/src/Textarea/Textarea.tsx +13 -1
- package/src/ValidationMessage/{ValidationMessage.stories.mdx → ValidationMessage.stories.tsx} +8 -17
- package/src/ValidationMessage/ValidationMessage.test.tsx +7 -2
- package/src/ValidationMessage/ValidationMessage.tsx +12 -0
- 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 +2 -2
- package/src/theme.ts +49 -48
- package/dist/Box/Box.d.ts +0 -47
- 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/dist/Radio/RadioIcons.d.ts +0 -9
- package/src/ActionGroup/ActionGroup.stories.mdx +0 -62
- package/src/Alert/Alert.stories.mdx +0 -35
- package/src/Badge/Badge.stories.mdx +0 -57
- package/src/Box/Box.stories.mdx +0 -334
- package/src/Box/Box.test.tsx +0 -133
- package/src/Box/Box.tsx +0 -165
- package/src/Box/index.ts +0 -1
- package/src/Column/Column.stories.mdx +0 -49
- package/src/Columns/Columns.stories.mdx +0 -65
- package/src/Container/Container.stories.mdx +0 -19
- package/src/Divider/Divider.stories.mdx +0 -37
- package/src/Heading/Heading.stories.mdx +0 -39
- 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 -39
- 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 -36
- package/src/Link/Link.stories.mdx +0 -45
- package/src/MenuItem/MenuItem.stories.mdx +0 -37
- package/src/Message/Message.stories.mdx +0 -44
- package/src/Radio/RadioIcons.tsx +0 -39
- package/src/Slider/Slider.stories.mdx +0 -31
- package/src/Stack/Stack.stories.mdx +0 -51
package/dist/components.esm.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { Children, forwardRef, useRef, useState, useEffect } from 'react';
|
|
2
2
|
import flattenChildren from 'react-keyed-flatten-children';
|
|
3
|
-
import {
|
|
4
|
-
export { ThemeProvider, useTheme } from '@marigold/system';
|
|
5
|
-
import { Check, Notification, Exclamation,
|
|
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
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';
|
|
7
12
|
import { useOverlayTriggerState } from '@react-stately/overlays';
|
|
8
13
|
import { useOverlay, usePreventScroll, useModal, OverlayContainer, OverlayProvider, DismissButton, useOverlayTrigger, useOverlayPosition } from '@react-aria/overlays';
|
|
9
14
|
import { useDialog } from '@react-aria/dialog';
|
|
10
|
-
import {
|
|
15
|
+
import { useSeparator } from '@react-aria/separator';
|
|
11
16
|
import { useLink } from '@react-aria/link';
|
|
12
17
|
export { SSRProvider } from '@react-aria/ssr';
|
|
13
18
|
import { useSelectState } from '@react-stately/select';
|
|
@@ -87,146 +92,97 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
87
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.");
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
var _excluded = ["
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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,
|
|
96
106
|
children = _ref.children,
|
|
97
|
-
className = _ref.className,
|
|
98
|
-
display = _ref.display,
|
|
99
|
-
height = _ref.height,
|
|
100
|
-
width = _ref.width,
|
|
101
|
-
minWidth = _ref.minWidth,
|
|
102
|
-
maxWidth = _ref.maxWidth,
|
|
103
|
-
position = _ref.position,
|
|
104
|
-
top = _ref.top,
|
|
105
|
-
bottom = _ref.bottom,
|
|
106
|
-
right = _ref.right,
|
|
107
|
-
left = _ref.left,
|
|
108
|
-
zIndex = _ref.zIndex,
|
|
109
|
-
p = _ref.p,
|
|
110
|
-
px = _ref.px,
|
|
111
|
-
py = _ref.py,
|
|
112
|
-
pt = _ref.pt,
|
|
113
|
-
pb = _ref.pb,
|
|
114
|
-
pl = _ref.pl,
|
|
115
|
-
pr = _ref.pr,
|
|
116
|
-
m = _ref.m,
|
|
117
|
-
mx = _ref.mx,
|
|
118
|
-
my = _ref.my,
|
|
119
|
-
mt = _ref.mt,
|
|
120
|
-
mb = _ref.mb,
|
|
121
|
-
ml = _ref.ml,
|
|
122
|
-
mr = _ref.mr,
|
|
123
|
-
flexDirection = _ref.flexDirection,
|
|
124
|
-
flexWrap = _ref.flexWrap,
|
|
125
|
-
flexShrink = _ref.flexShrink,
|
|
126
|
-
flexGrow = _ref.flexGrow,
|
|
127
|
-
alignItems = _ref.alignItems,
|
|
128
|
-
justifyContent = _ref.justifyContent,
|
|
129
|
-
bg = _ref.bg,
|
|
130
|
-
border = _ref.border,
|
|
131
|
-
borderRadius = _ref.borderRadius,
|
|
132
|
-
boxShadow = _ref.boxShadow,
|
|
133
|
-
opacity = _ref.opacity,
|
|
134
|
-
overflow = _ref.overflow,
|
|
135
|
-
transition = _ref.transition,
|
|
136
107
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
137
108
|
|
|
138
|
-
return React.createElement(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}, css),
|
|
182
|
-
className: className
|
|
183
|
-
}, props), children);
|
|
184
|
-
});
|
|
109
|
+
return React.createElement(Box, Object.assign({
|
|
110
|
+
display: "inline-flex",
|
|
111
|
+
css: {
|
|
112
|
+
'> * + *': {
|
|
113
|
+
pl: space
|
|
114
|
+
}
|
|
115
|
+
},
|
|
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
|
+
};
|
|
121
|
+
|
|
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);
|
|
135
|
+
|
|
136
|
+
return React.createElement(Box, Object.assign({}, props, {
|
|
137
|
+
display: "flex",
|
|
138
|
+
flexDirection: "column",
|
|
139
|
+
alignItems: ALIGNMENT$1[align],
|
|
140
|
+
css: {
|
|
141
|
+
'> * + *': {
|
|
142
|
+
pt: space
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}), Children.map(flattenChildren(children), function (child) {
|
|
146
|
+
return React.createElement(Box, null, React.cloneElement(child, {}, child.props.children));
|
|
147
|
+
}));
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
var _excluded$2 = ["space", "verticalAlignment", "children"];
|
|
151
|
+
// ---------------
|
|
185
152
|
|
|
186
|
-
var _excluded$1 = ["variant", "space", "verticalAlignment", "children", "className"];
|
|
187
153
|
var ActionGroup = function ActionGroup(_ref) {
|
|
188
|
-
var _ref$
|
|
189
|
-
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
190
|
-
_ref$space = _ref.space,
|
|
154
|
+
var _ref$space = _ref.space,
|
|
191
155
|
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
192
156
|
_ref$verticalAlignmen = _ref.verticalAlignment,
|
|
193
157
|
verticalAlignment = _ref$verticalAlignmen === void 0 ? false : _ref$verticalAlignmen,
|
|
194
158
|
children = _ref.children,
|
|
195
|
-
|
|
196
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
159
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
197
160
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
} : {
|
|
201
|
-
|
|
202
|
-
};
|
|
203
|
-
return React.createElement(Box, Object.assign({
|
|
204
|
-
variant: "actionGroup." + variant,
|
|
205
|
-
className: className
|
|
206
|
-
}, props), Children.map(flattenChildren(children), function (child, i) {
|
|
207
|
-
return child !== null && child !== undefined && React.createElement(Box, {
|
|
208
|
-
as: verticalAlignment ? 'div' : 'span',
|
|
209
|
-
css: i < Children.count(children) - 1 ? childStyle : undefined
|
|
210
|
-
}, child);
|
|
211
|
-
}));
|
|
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);
|
|
212
166
|
};
|
|
213
167
|
|
|
214
|
-
var _excluded$
|
|
168
|
+
var _excluded$3 = ["variant", "children"];
|
|
215
169
|
var ICON_MAP = {
|
|
216
170
|
success: Check,
|
|
217
171
|
warning: Notification,
|
|
218
172
|
error: Exclamation
|
|
219
|
-
};
|
|
173
|
+
}; // Component
|
|
174
|
+
// ---------------
|
|
175
|
+
|
|
220
176
|
var Alert = function Alert(_ref) {
|
|
221
177
|
var _ref$variant = _ref.variant,
|
|
222
178
|
variant = _ref$variant === void 0 ? 'success' : _ref$variant,
|
|
223
179
|
children = _ref.children,
|
|
224
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
180
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
225
181
|
|
|
226
182
|
var Icon = ICON_MAP[variant];
|
|
227
183
|
return React.createElement(Box, Object.assign({}, props, {
|
|
228
184
|
display: "flex",
|
|
229
|
-
variant: "
|
|
185
|
+
variant: "alert." + variant
|
|
230
186
|
}), React.createElement(Box, {
|
|
231
187
|
display: "inline-block",
|
|
232
188
|
alignItems: "center",
|
|
@@ -244,16 +200,18 @@ var Alert = function Alert(_ref) {
|
|
|
244
200
|
}, children));
|
|
245
201
|
};
|
|
246
202
|
|
|
247
|
-
var _excluded$
|
|
203
|
+
var _excluded$4 = ["variant", "bgColor", "borderColor", "children"];
|
|
204
|
+
// ---------------
|
|
205
|
+
|
|
248
206
|
var Badge = function Badge(_ref) {
|
|
249
207
|
var _ref$variant = _ref.variant,
|
|
250
|
-
variant = _ref$variant === void 0 ? '
|
|
208
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
251
209
|
_ref$bgColor = _ref.bgColor,
|
|
252
210
|
bgColor = _ref$bgColor === void 0 ? 'transparent' : _ref$bgColor,
|
|
253
211
|
_ref$borderColor = _ref.borderColor,
|
|
254
212
|
borderColor = _ref$borderColor === void 0 ? 'transparent' : _ref$borderColor,
|
|
255
213
|
children = _ref.children,
|
|
256
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
214
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
257
215
|
|
|
258
216
|
return React.createElement(Box, Object.assign({
|
|
259
217
|
css: {
|
|
@@ -264,7 +222,9 @@ var Badge = function Badge(_ref) {
|
|
|
264
222
|
}, props), children);
|
|
265
223
|
};
|
|
266
224
|
|
|
267
|
-
var _excluded$
|
|
225
|
+
var _excluded$5 = ["as", "variant", "size", "space", "disabled", "children", "className"];
|
|
226
|
+
// ---------------
|
|
227
|
+
|
|
268
228
|
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
269
229
|
var _ref$as = _ref.as,
|
|
270
230
|
as = _ref$as === void 0 ? 'button' : _ref$as,
|
|
@@ -272,10 +232,12 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
272
232
|
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
273
233
|
_ref$size = _ref.size,
|
|
274
234
|
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
235
|
+
_ref$space = _ref.space,
|
|
236
|
+
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
275
237
|
disabled = _ref.disabled,
|
|
276
238
|
children = _ref.children,
|
|
277
239
|
className = _ref.className,
|
|
278
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
240
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
279
241
|
|
|
280
242
|
var _useButton = useButton(_extends({}, props, {
|
|
281
243
|
elementType: typeof as === 'string' ? as : 'span',
|
|
@@ -285,25 +247,28 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
285
247
|
|
|
286
248
|
return React.createElement(Box, Object.assign({}, buttonProps, props, {
|
|
287
249
|
as: as,
|
|
250
|
+
display: "inline-flex",
|
|
251
|
+
alignItems: "center",
|
|
288
252
|
variant: ["button." + variant, "button." + size],
|
|
289
253
|
className: className,
|
|
290
|
-
ref: ref
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}, children));
|
|
254
|
+
ref: ref,
|
|
255
|
+
css: {
|
|
256
|
+
columnGap: space
|
|
257
|
+
}
|
|
258
|
+
}), children);
|
|
296
259
|
});
|
|
297
260
|
|
|
298
|
-
var _excluded$
|
|
261
|
+
var _excluded$6 = ["variant", "title", "width", "className", "children"];
|
|
262
|
+
// ---------------
|
|
263
|
+
|
|
299
264
|
var Card = function Card(_ref) {
|
|
300
265
|
var _ref$variant = _ref.variant,
|
|
301
|
-
variant = _ref$variant === void 0 ? '
|
|
266
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
302
267
|
title = _ref.title,
|
|
303
268
|
width = _ref.width,
|
|
304
269
|
className = _ref.className,
|
|
305
270
|
children = _ref.children,
|
|
306
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
271
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
307
272
|
|
|
308
273
|
return React.createElement(Box, Object.assign({}, props, {
|
|
309
274
|
variant: "card." + variant,
|
|
@@ -316,85 +281,85 @@ var Card = function Card(_ref) {
|
|
|
316
281
|
}, title), children);
|
|
317
282
|
};
|
|
318
283
|
|
|
319
|
-
var
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
284
|
+
var CheckboxIcon = function CheckboxIcon(_ref) {
|
|
285
|
+
var _ref$variant = _ref.variant,
|
|
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,
|
|
323
290
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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, {
|
|
327
300
|
width: "16",
|
|
328
301
|
height: "32",
|
|
329
302
|
viewBox: "0 0 16 32",
|
|
330
|
-
fill: "none"
|
|
331
|
-
|
|
303
|
+
fill: "none",
|
|
304
|
+
"aria-hidden": "true"
|
|
305
|
+
}, React.createElement(Box, {
|
|
332
306
|
as: "rect",
|
|
333
307
|
x: "0.5",
|
|
334
308
|
y: "8.5",
|
|
335
309
|
width: "15px",
|
|
336
310
|
height: "15px",
|
|
337
311
|
rx: "1.5",
|
|
338
|
-
variant:
|
|
339
|
-
}), React.createElement(Box, {
|
|
312
|
+
variant: conditional("checkbox." + variant, conditionalStates)
|
|
313
|
+
}), checked && React.createElement(Box, {
|
|
314
|
+
__baseCSS: {
|
|
315
|
+
fill: 'gray00'
|
|
316
|
+
},
|
|
340
317
|
as: "path",
|
|
341
318
|
fillRule: "evenodd",
|
|
342
319
|
clipRule: "evenodd",
|
|
343
|
-
d: "M13.9571 12.8338L12.4085 11.2852L6.08699 17.6007L3.59887 15.1126L2.04163 16.6588L6.08682 20.704L13.9571 12.8338Z"
|
|
344
|
-
variant: "checkbox.checked.icon"
|
|
345
|
-
}));
|
|
346
|
-
};
|
|
347
|
-
var CheckboxUnchecked = function CheckboxUnchecked(_ref2) {
|
|
348
|
-
var _ref2$disabled = _ref2.disabled,
|
|
349
|
-
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
350
|
-
_ref2$error = _ref2.error,
|
|
351
|
-
error = _ref2$error === void 0 ? false : _ref2$error,
|
|
352
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
353
|
-
|
|
354
|
-
return React.createElement(SVG, Object.assign({
|
|
355
|
-
width: "16",
|
|
356
|
-
height: "32",
|
|
357
|
-
viewBox: "0 0 16 32",
|
|
358
|
-
fill: "none"
|
|
359
|
-
}, props), React.createElement(Box, {
|
|
360
|
-
as: "rect",
|
|
361
|
-
x: "0.5",
|
|
362
|
-
y: "8.5",
|
|
363
|
-
width: "15px",
|
|
364
|
-
height: "15px",
|
|
365
|
-
rx: "1.5",
|
|
366
|
-
variant: disabled ? 'checkbox.unchecked.disabled' : error ? 'checkbox.unchecked.error' : 'checkbox.unchecked'
|
|
320
|
+
d: "M13.9571 12.8338L12.4085 11.2852L6.08699 17.6007L3.59887 15.1126L2.04163 16.6588L6.08682 20.704L13.9571 12.8338Z"
|
|
367
321
|
}));
|
|
368
322
|
};
|
|
369
323
|
|
|
370
|
-
var _excluded$7 = ["variant", "required", "children"]
|
|
371
|
-
|
|
324
|
+
var _excluded$7 = ["variant", "required", "color", "children"],
|
|
325
|
+
_excluded2 = ["required", "children"];
|
|
326
|
+
var LabelBase = function LabelBase(_ref) {
|
|
372
327
|
var _ref$variant = _ref.variant,
|
|
373
328
|
variant = _ref$variant === void 0 ? 'above' : _ref$variant,
|
|
374
|
-
|
|
329
|
+
_ref$color = _ref.color,
|
|
330
|
+
color = _ref$color === void 0 ? 'text' : _ref$color,
|
|
375
331
|
children = _ref.children,
|
|
376
332
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
377
333
|
|
|
334
|
+
return React.createElement(Box, Object.assign({}, props, {
|
|
335
|
+
as: "label",
|
|
336
|
+
__baseCSS: {
|
|
337
|
+
color: color
|
|
338
|
+
},
|
|
339
|
+
variant: "label." + variant
|
|
340
|
+
}), children);
|
|
341
|
+
};
|
|
342
|
+
var Label = function Label(_ref2) {
|
|
343
|
+
var required = _ref2.required,
|
|
344
|
+
children = _ref2.children,
|
|
345
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
346
|
+
|
|
378
347
|
return required ? React.createElement(Box, {
|
|
379
348
|
as: "span",
|
|
380
349
|
display: "inline-flex",
|
|
381
350
|
alignItems: "center"
|
|
382
|
-
}, React.createElement(
|
|
383
|
-
as: "label",
|
|
384
|
-
variant: "label." + variant
|
|
385
|
-
}), children), required && React.createElement(Box, {
|
|
351
|
+
}, React.createElement(LabelBase, Object.assign({}, props), children), required && React.createElement(Box, {
|
|
386
352
|
as: Required,
|
|
387
353
|
size: 16,
|
|
388
354
|
css: {
|
|
389
|
-
color: '
|
|
355
|
+
color: 'error'
|
|
390
356
|
}
|
|
391
|
-
})) : React.createElement(
|
|
392
|
-
as: "label",
|
|
393
|
-
variant: "label." + variant
|
|
394
|
-
}), children);
|
|
357
|
+
})) : React.createElement(LabelBase, Object.assign({}, props), children);
|
|
395
358
|
};
|
|
396
359
|
|
|
397
360
|
var _excluded$8 = ["variant", "children", "className"];
|
|
361
|
+
// ---------------
|
|
362
|
+
|
|
398
363
|
var ValidationMessage = function ValidationMessage(_ref) {
|
|
399
364
|
var _ref$variant = _ref.variant,
|
|
400
365
|
variant = _ref$variant === void 0 ? 'error' : _ref$variant,
|
|
@@ -411,82 +376,64 @@ var ValidationMessage = function ValidationMessage(_ref) {
|
|
|
411
376
|
}, props), children);
|
|
412
377
|
};
|
|
413
378
|
|
|
414
|
-
var _excluded$9 = ["
|
|
415
|
-
_excluded2$1 = ["label", "required", "error", "errorMessage"];
|
|
379
|
+
var _excluded$9 = ["error"],
|
|
380
|
+
_excluded2$1 = ["label", "required", "labelVariant", "error", "errorMessage"];
|
|
416
381
|
|
|
417
|
-
var
|
|
418
|
-
var
|
|
419
|
-
|
|
420
|
-
disabled = _ref.disabled,
|
|
421
|
-
error = _ref.error;
|
|
382
|
+
var CheckboxInput = function CheckboxInput(_ref) {
|
|
383
|
+
var error = _ref.error,
|
|
384
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
422
385
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
as: CheckboxChecked,
|
|
426
|
-
variant: "checkbox." + variant,
|
|
427
|
-
disabled: disabled
|
|
428
|
-
});
|
|
429
|
-
}
|
|
386
|
+
var state = useToggleState(props);
|
|
387
|
+
var ref = React.useRef(null);
|
|
430
388
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
variant: "checkbox." + variant,
|
|
434
|
-
disabled: disabled,
|
|
435
|
-
error: error
|
|
436
|
-
});
|
|
437
|
-
};
|
|
389
|
+
var _useCheckbox = useCheckbox(props, state, ref),
|
|
390
|
+
inputProps = _useCheckbox.inputProps;
|
|
438
391
|
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
_ref2$variant = _ref2.variant,
|
|
442
|
-
variant = _ref2$variant === void 0 ? 'default' : _ref2$variant,
|
|
443
|
-
error = _ref2.error,
|
|
444
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$9);
|
|
392
|
+
var _useFocusRing = useFocusRing(),
|
|
393
|
+
focusProps = _useFocusRing.focusProps;
|
|
445
394
|
|
|
446
395
|
return React.createElement(Box, {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
}, React.createElement(Box, Object.assign({
|
|
396
|
+
pr: "xsmall"
|
|
397
|
+
}, React.createElement(VisuallyHidden, null, React.createElement(Box, Object.assign({
|
|
450
398
|
as: "input",
|
|
451
399
|
type: "checkbox",
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
width: 1,
|
|
457
|
-
height: 1,
|
|
458
|
-
overflow: 'hidden'
|
|
459
|
-
}
|
|
460
|
-
}, props)), React.createElement(CheckboxIcon, {
|
|
400
|
+
disabled: props.disabled
|
|
401
|
+
}, inputProps, focusProps, {
|
|
402
|
+
ref: ref
|
|
403
|
+
}, props))), React.createElement(CheckboxIcon, {
|
|
461
404
|
checked: props.checked,
|
|
462
|
-
variant: variant,
|
|
405
|
+
variant: props.variant,
|
|
463
406
|
disabled: props.disabled,
|
|
464
407
|
error: error
|
|
465
408
|
}));
|
|
466
409
|
};
|
|
467
410
|
|
|
468
|
-
var Checkbox = function Checkbox(
|
|
469
|
-
var label =
|
|
470
|
-
required =
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
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));
|
|
490
437
|
};
|
|
491
438
|
|
|
492
439
|
var _excluded$a = ["width", "children"];
|
|
@@ -513,9 +460,25 @@ var Column = function Column(_ref) {
|
|
|
513
460
|
};
|
|
514
461
|
|
|
515
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
|
+
|
|
516
479
|
var Columns = function Columns(_ref) {
|
|
517
480
|
var _ref$space = _ref.space,
|
|
518
|
-
space = _ref$space === void 0 ?
|
|
481
|
+
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
519
482
|
_ref$horizontalAlign = _ref.horizontalAlign,
|
|
520
483
|
horizontalAlign = _ref$horizontalAlign === void 0 ? 'left' : _ref$horizontalAlign,
|
|
521
484
|
_ref$verticalAlign = _ref.verticalAlign,
|
|
@@ -524,75 +487,96 @@ var Columns = function Columns(_ref) {
|
|
|
524
487
|
children = _ref.children,
|
|
525
488
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
526
489
|
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}); // horizontal Alignment
|
|
533
|
-
|
|
534
|
-
var justify = 'flex-start';
|
|
490
|
+
var justifyContent = useAlignment(horizontalAlign);
|
|
491
|
+
var alignItems = useAlignment(verticalAlign);
|
|
492
|
+
/**
|
|
493
|
+
* transform space string to space value from theme
|
|
494
|
+
*/
|
|
535
495
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
} else if (horizontalAlign === 'center') {
|
|
539
|
-
justify = 'center';
|
|
540
|
-
} // vertical Alignment
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
var alignItems = 'flex-start';
|
|
544
|
-
|
|
545
|
-
if (verticalAlign === 'bottom') {
|
|
546
|
-
alignItems = 'flex-end';
|
|
547
|
-
} else if (verticalAlign === 'center') {
|
|
548
|
-
alignItems = 'center';
|
|
549
|
-
}
|
|
496
|
+
var _useTheme = useTheme(),
|
|
497
|
+
css = _useTheme.css;
|
|
550
498
|
|
|
499
|
+
var spaceObject = css({
|
|
500
|
+
space: space
|
|
501
|
+
});
|
|
502
|
+
var spaceValue = Object.values(spaceObject)[0];
|
|
551
503
|
return React.createElement(Box, {
|
|
552
|
-
p: space
|
|
504
|
+
p: space,
|
|
553
505
|
display: "flex",
|
|
554
506
|
className: className
|
|
555
507
|
}, React.createElement(Box, Object.assign({
|
|
556
|
-
width: "calc(100% + " +
|
|
557
|
-
m: -
|
|
508
|
+
width: "calc(100% + " + spaceValue + "px)",
|
|
509
|
+
m: -spaceValue / 2 + "px",
|
|
558
510
|
display: "flex",
|
|
559
511
|
flexWrap: "wrap",
|
|
560
512
|
alignItems: alignItems,
|
|
561
|
-
justifyContent:
|
|
562
|
-
}, props), Children.map(
|
|
563
|
-
return React.cloneElement(child, {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
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
|
+
}
|
|
567
519
|
}, child.props.children));
|
|
568
520
|
})));
|
|
569
521
|
};
|
|
570
522
|
|
|
571
|
-
var _excluded$c = ["as", "variant", "children"];
|
|
572
|
-
|
|
523
|
+
var _excluded$c = ["as", "variant", "children", "className", "align", "color", "cursor", "outline", "userSelect"];
|
|
524
|
+
// ---------------
|
|
525
|
+
|
|
526
|
+
var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
573
527
|
var _ref$as = _ref.as,
|
|
574
|
-
as = _ref$as === void 0 ? '
|
|
528
|
+
as = _ref$as === void 0 ? 'span' : _ref$as,
|
|
575
529
|
_ref$variant = _ref.variant,
|
|
576
|
-
variant = _ref$variant === void 0 ? '
|
|
530
|
+
variant = _ref$variant === void 0 ? 'body' : _ref$variant,
|
|
577
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,
|
|
578
538
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
579
539
|
|
|
580
540
|
return React.createElement(Box, Object.assign({}, props, {
|
|
581
541
|
as: as,
|
|
582
|
-
variant: "text." + variant
|
|
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
|
|
583
552
|
}), children);
|
|
584
|
-
};
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
var _excluded$d = ["variant", "backdropVariant", "children"],
|
|
556
|
+
_excluded2$2 = ["isDismissable", "isOpen", "onClose"];
|
|
557
|
+
// ---------------
|
|
585
558
|
|
|
586
|
-
var _excluded$d = ["children"];
|
|
587
559
|
var ModalDialog = function ModalDialog(_ref) {
|
|
588
|
-
var
|
|
560
|
+
var variant = _ref.variant,
|
|
561
|
+
_ref$backdropVariant = _ref.backdropVariant,
|
|
562
|
+
backdropVariant = _ref$backdropVariant === void 0 ? 'backdrop' : _ref$backdropVariant,
|
|
563
|
+
children = _ref.children,
|
|
589
564
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
590
565
|
|
|
591
|
-
|
|
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
|
|
592
570
|
// the Escape key to close the modal.
|
|
571
|
+
|
|
572
|
+
|
|
593
573
|
var ref = React.useRef();
|
|
594
574
|
|
|
595
|
-
var _useOverlay = useOverlay(
|
|
575
|
+
var _useOverlay = useOverlay({
|
|
576
|
+
isDismissable: isDismissable,
|
|
577
|
+
isOpen: isOpen,
|
|
578
|
+
onClose: onClose
|
|
579
|
+
}, ref),
|
|
596
580
|
overlayProps = _useOverlay.overlayProps,
|
|
597
581
|
underlayProps = _useOverlay.underlayProps; // Prevent scrolling while the modal is open, and hide content
|
|
598
582
|
// outside the modal from screen readers.
|
|
@@ -607,24 +591,38 @@ var ModalDialog = function ModalDialog(_ref) {
|
|
|
607
591
|
dialogProps = _useDialog.dialogProps;
|
|
608
592
|
|
|
609
593
|
return React.createElement(Box, Object.assign({
|
|
610
|
-
|
|
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
|
|
611
605
|
}, underlayProps), React.createElement(FocusScope, {
|
|
612
606
|
contain: true,
|
|
613
607
|
restoreFocus: true,
|
|
614
608
|
autoFocus: true
|
|
615
609
|
}, React.createElement(Box, Object.assign({}, overlayProps, dialogProps, modalProps, {
|
|
616
610
|
ref: ref,
|
|
617
|
-
variant: "dialog.
|
|
618
|
-
}), children)));
|
|
611
|
+
variant: variant ? "dialog." + variant : "dialog"
|
|
612
|
+
}, restProps), children)));
|
|
619
613
|
};
|
|
620
614
|
|
|
621
|
-
var _excluded$e = ["
|
|
615
|
+
var _excluded$e = ["backdropVariant", "children", "className", "close", "isOpen", "title", "variant"];
|
|
616
|
+
// ---------------
|
|
617
|
+
|
|
622
618
|
var Dialog = function Dialog(_ref) {
|
|
623
|
-
var
|
|
624
|
-
|
|
619
|
+
var backdropVariant = _ref.backdropVariant,
|
|
620
|
+
children = _ref.children,
|
|
625
621
|
className = _ref.className,
|
|
626
|
-
isOpen = _ref.isOpen,
|
|
627
622
|
close = _ref.close,
|
|
623
|
+
isOpen = _ref.isOpen,
|
|
624
|
+
title = _ref.title,
|
|
625
|
+
variant = _ref.variant,
|
|
628
626
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
629
627
|
|
|
630
628
|
var closeButtonRef = React.useRef(); // useButton ensures that focus management is handled correctly,
|
|
@@ -638,29 +636,56 @@ var Dialog = function Dialog(_ref) {
|
|
|
638
636
|
}, closeButtonRef),
|
|
639
637
|
closeButtonProps = _useButton.buttonProps;
|
|
640
638
|
|
|
641
|
-
return React.createElement(OverlayContainer, null, React.createElement(ModalDialog, {
|
|
639
|
+
return React.createElement(OverlayContainer, null, React.createElement(ModalDialog, Object.assign({
|
|
640
|
+
variant: variant,
|
|
641
|
+
backdropVariant: backdropVariant,
|
|
642
642
|
isOpen: isOpen,
|
|
643
643
|
onClose: close,
|
|
644
644
|
isDismissable: true
|
|
645
|
-
}, React.createElement(Box, Object.assign({
|
|
646
|
-
variant: "dialog.wrapper",
|
|
647
|
-
className: className
|
|
648
645
|
}, props), React.createElement(Box, {
|
|
649
|
-
|
|
650
|
-
|
|
646
|
+
__baseCSS: {
|
|
647
|
+
display: 'flex',
|
|
648
|
+
justifyContent: 'space-between',
|
|
649
|
+
borderRadius: 'small',
|
|
650
|
+
pl: 'large',
|
|
651
|
+
pb: 'large'
|
|
652
|
+
},
|
|
653
|
+
className: className
|
|
654
|
+
}, React.createElement(Box, {
|
|
655
|
+
pt: "medium"
|
|
656
|
+
}, title && React.createElement(Text, {
|
|
651
657
|
as: "h4",
|
|
652
|
-
variant: "
|
|
658
|
+
variant: "headline4"
|
|
653
659
|
}, title), children), React.createElement(Box, {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
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
|
+
}
|
|
658
683
|
}, closeButtonProps, {
|
|
659
684
|
ref: closeButtonRef
|
|
660
685
|
}), React.createElement(Close, {
|
|
661
686
|
size: 16
|
|
662
687
|
}))))));
|
|
663
|
-
}; //
|
|
688
|
+
}; // get the overlayTriggerState and openButton props for using the dialog component
|
|
664
689
|
|
|
665
690
|
var useDialogButtonProps = function useDialogButtonProps() {
|
|
666
691
|
var state = useOverlayTriggerState({});
|
|
@@ -681,21 +706,33 @@ var useDialogButtonProps = function useDialogButtonProps() {
|
|
|
681
706
|
};
|
|
682
707
|
|
|
683
708
|
var _excluded$f = ["variant"];
|
|
709
|
+
// ---------------
|
|
710
|
+
|
|
684
711
|
var Divider = function Divider(_ref) {
|
|
685
712
|
var _ref$variant = _ref.variant,
|
|
686
|
-
variant = _ref$variant === void 0 ? '
|
|
713
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
687
714
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
688
715
|
|
|
689
|
-
|
|
690
|
-
|
|
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
|
+
},
|
|
691
726
|
variant: "divider." + variant
|
|
692
|
-
}));
|
|
727
|
+
}, props, separatorProps));
|
|
693
728
|
};
|
|
694
729
|
|
|
695
730
|
var _excluded$g = ["variant", "type"];
|
|
731
|
+
// ---------------
|
|
732
|
+
|
|
696
733
|
var Input = function Input(_ref) {
|
|
697
734
|
var _ref$variant = _ref.variant,
|
|
698
|
-
variant = _ref$variant === void 0 ? '
|
|
735
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
699
736
|
_ref$type = _ref.type,
|
|
700
737
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
701
738
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
@@ -707,11 +744,16 @@ var Input = function Input(_ref) {
|
|
|
707
744
|
}));
|
|
708
745
|
};
|
|
709
746
|
|
|
710
|
-
var _excluded$h = ["type", "
|
|
747
|
+
var _excluded$h = ["type", "variant", "labelVariant", "htmlFor", "label", "required", "error", "errorMessage", "disabled"];
|
|
748
|
+
// ---------------
|
|
749
|
+
|
|
711
750
|
var Field = function Field(_ref) {
|
|
712
751
|
var _ref$type = _ref.type,
|
|
713
752
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
714
|
-
|
|
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,
|
|
715
757
|
htmlFor = _ref.htmlFor,
|
|
716
758
|
label = _ref.label,
|
|
717
759
|
required = _ref.required,
|
|
@@ -721,76 +763,36 @@ var Field = function Field(_ref) {
|
|
|
721
763
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
722
764
|
|
|
723
765
|
return React.createElement(React.Fragment, null, React.createElement(Label, {
|
|
724
|
-
variant:
|
|
766
|
+
variant: labelVariant,
|
|
725
767
|
htmlFor: htmlFor,
|
|
726
768
|
required: required
|
|
727
769
|
}, label), React.createElement(Input, Object.assign({}, props, {
|
|
728
770
|
type: type,
|
|
729
771
|
id: htmlFor,
|
|
730
772
|
disabled: disabled,
|
|
731
|
-
variant:
|
|
732
|
-
className: className
|
|
773
|
+
variant: variant
|
|
733
774
|
})), error && errorMessage && React.createElement(ValidationMessage, null, React.createElement(Exclamation, {
|
|
734
775
|
size: 16
|
|
735
776
|
}), errorMessage));
|
|
736
777
|
};
|
|
737
778
|
|
|
738
|
-
var _excluded$i = ["
|
|
739
|
-
|
|
740
|
-
var _ref$show = _ref.show,
|
|
741
|
-
show = _ref$show === void 0 ? false : _ref$show,
|
|
742
|
-
children = _ref.children,
|
|
743
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
744
|
-
|
|
745
|
-
return React.createElement(Box, Object.assign({}, props, {
|
|
746
|
-
as: "span",
|
|
747
|
-
display: show ? 'display' : 'none'
|
|
748
|
-
}), children);
|
|
749
|
-
};
|
|
779
|
+
var _excluded$i = ["variant"];
|
|
780
|
+
// ---------------
|
|
750
781
|
|
|
751
|
-
var _excluded$j = ["variant"];
|
|
752
782
|
var Image = function Image(_ref) {
|
|
753
783
|
var _ref$variant = _ref.variant,
|
|
754
784
|
variant = _ref$variant === void 0 ? 'fullWidth' : _ref$variant,
|
|
755
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
785
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
756
786
|
|
|
757
787
|
return React.createElement(Box, Object.assign({}, props, {
|
|
758
788
|
as: "img",
|
|
759
|
-
variant: "
|
|
789
|
+
variant: "image." + variant
|
|
760
790
|
}));
|
|
761
791
|
};
|
|
762
792
|
|
|
763
|
-
var _excluded$
|
|
764
|
-
|
|
765
|
-
var _ref$as = _ref.as,
|
|
766
|
-
as = _ref$as === void 0 ? 'span' : _ref$as,
|
|
767
|
-
_ref$variant = _ref.variant,
|
|
768
|
-
variant = _ref$variant === void 0 ? 'body' : _ref$variant,
|
|
769
|
-
children = _ref.children,
|
|
770
|
-
className = _ref.className,
|
|
771
|
-
align = _ref.align,
|
|
772
|
-
color = _ref.color,
|
|
773
|
-
cursor = _ref.cursor,
|
|
774
|
-
outline = _ref.outline,
|
|
775
|
-
userSelect = _ref.userSelect,
|
|
776
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
793
|
+
var _excluded$j = ["as", "variant", "children", "disabled"];
|
|
794
|
+
// ---------------
|
|
777
795
|
|
|
778
|
-
return React.createElement(Box, Object.assign({}, props, {
|
|
779
|
-
as: as,
|
|
780
|
-
variant: "text." + variant,
|
|
781
|
-
css: {
|
|
782
|
-
textAlign: align,
|
|
783
|
-
color: color,
|
|
784
|
-
cursor: cursor,
|
|
785
|
-
outline: outline,
|
|
786
|
-
userSelect: userSelect
|
|
787
|
-
},
|
|
788
|
-
className: className,
|
|
789
|
-
ref: ref
|
|
790
|
-
}), children);
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
var _excluded$l = ["as", "variant", "children", "disabled"];
|
|
794
796
|
var Link = function Link(_ref) {
|
|
795
797
|
var _ref$as = _ref.as,
|
|
796
798
|
as = _ref$as === void 0 ? 'a' : _ref$as,
|
|
@@ -798,7 +800,7 @@ var Link = function Link(_ref) {
|
|
|
798
800
|
variant = _ref$variant === void 0 ? 'link' : _ref$variant,
|
|
799
801
|
children = _ref.children,
|
|
800
802
|
disabled = _ref.disabled,
|
|
801
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
803
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
802
804
|
|
|
803
805
|
var ref = useRef();
|
|
804
806
|
|
|
@@ -815,7 +817,9 @@ var Link = function Link(_ref) {
|
|
|
815
817
|
}), children);
|
|
816
818
|
};
|
|
817
819
|
|
|
818
|
-
var _excluded$
|
|
820
|
+
var _excluded$k = ["variant", "label", "onClick", "show", "children"];
|
|
821
|
+
// ---------------
|
|
822
|
+
|
|
819
823
|
var Menu = function Menu(_ref) {
|
|
820
824
|
var _ref$variant = _ref.variant,
|
|
821
825
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
@@ -825,7 +829,7 @@ var Menu = function Menu(_ref) {
|
|
|
825
829
|
_ref$show = _ref.show,
|
|
826
830
|
show = _ref$show === void 0 ? false : _ref$show,
|
|
827
831
|
children = _ref.children,
|
|
828
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
832
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
829
833
|
|
|
830
834
|
return React.createElement(Box, Object.assign({
|
|
831
835
|
variant: "menu." + variant
|
|
@@ -840,13 +844,15 @@ var Menu = function Menu(_ref) {
|
|
|
840
844
|
}, children) : null);
|
|
841
845
|
};
|
|
842
846
|
|
|
843
|
-
var _excluded$
|
|
847
|
+
var _excluded$l = ["variant", "className", "children"];
|
|
848
|
+
// ---------------
|
|
849
|
+
|
|
844
850
|
var MenuItem = function MenuItem(_ref) {
|
|
845
851
|
var _ref$variant = _ref.variant,
|
|
846
852
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
847
853
|
className = _ref.className,
|
|
848
854
|
children = _ref.children,
|
|
849
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
855
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
850
856
|
|
|
851
857
|
return React.createElement(Box, {
|
|
852
858
|
variant: "menuItem." + variant,
|
|
@@ -856,14 +862,16 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
856
862
|
}, props), children));
|
|
857
863
|
};
|
|
858
864
|
|
|
859
|
-
var _excluded$
|
|
865
|
+
var _excluded$m = ["messageTitle", "variant", "className", "children"];
|
|
866
|
+
// ---------------
|
|
867
|
+
|
|
860
868
|
var Message = function Message(_ref) {
|
|
861
869
|
var messageTitle = _ref.messageTitle,
|
|
862
870
|
_ref$variant = _ref.variant,
|
|
863
871
|
variant = _ref$variant === void 0 ? 'info' : _ref$variant,
|
|
864
872
|
className = _ref.className,
|
|
865
873
|
children = _ref.children,
|
|
866
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
874
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
867
875
|
|
|
868
876
|
var icon = React.createElement(Info, null);
|
|
869
877
|
|
|
@@ -877,15 +885,15 @@ var Message = function Message(_ref) {
|
|
|
877
885
|
|
|
878
886
|
return React.createElement(Box, Object.assign({
|
|
879
887
|
display: "inline-block",
|
|
880
|
-
variant: "
|
|
888
|
+
variant: "message." + variant,
|
|
881
889
|
className: className
|
|
882
890
|
}, props), React.createElement(Box, {
|
|
883
891
|
display: "flex",
|
|
884
892
|
alignItems: "center",
|
|
885
|
-
variant: "
|
|
886
|
-
}, icon, React.createElement(
|
|
893
|
+
variant: "message.title"
|
|
894
|
+
}, icon, React.createElement(Text, {
|
|
887
895
|
as: "h4",
|
|
888
|
-
variant: "
|
|
896
|
+
variant: "headline4"
|
|
889
897
|
}, messageTitle)), React.createElement(Box, {
|
|
890
898
|
css: {
|
|
891
899
|
color: 'black'
|
|
@@ -893,167 +901,126 @@ var Message = function Message(_ref) {
|
|
|
893
901
|
}, children));
|
|
894
902
|
};
|
|
895
903
|
|
|
896
|
-
//
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
// const styles = css({
|
|
900
|
-
// body: { variant: 'root.body' },
|
|
901
|
-
// html: { variant: 'root.html' },
|
|
902
|
-
// })(theme);
|
|
903
|
-
// return <Global styles={styles} />;
|
|
904
|
-
// };
|
|
905
|
-
// a merge of the ThemeProvider and the react-aria OverlayProvider
|
|
906
|
-
|
|
907
|
-
var MarigoldProvider = function MarigoldProvider(_ref) {
|
|
904
|
+
// ---------------
|
|
905
|
+
|
|
906
|
+
function MarigoldProvider(_ref) {
|
|
908
907
|
var theme = _ref.theme,
|
|
909
908
|
children = _ref.children;
|
|
909
|
+
var outer = useTheme();
|
|
910
|
+
var isTopLevel = outer.theme === __defaultTheme;
|
|
910
911
|
return React.createElement(ThemeProvider, {
|
|
911
912
|
theme: theme
|
|
912
|
-
}, React.createElement(OverlayProvider, null, children));
|
|
913
|
-
}
|
|
913
|
+
}, isTopLevel ? React.createElement(React.Fragment, null, React.createElement(Global, null), React.createElement(OverlayProvider, null, children)) : children);
|
|
914
|
+
}
|
|
914
915
|
|
|
915
|
-
var
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
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,
|
|
919
922
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
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, {
|
|
923
932
|
width: "16",
|
|
924
933
|
height: "32",
|
|
925
934
|
viewBox: "0 0 16 32",
|
|
926
|
-
fill: "none"
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
cy: "16",
|
|
931
|
-
r: "7.5",
|
|
932
|
-
variant: disabled ? 'radio.checked.disabled' : 'radio.checked'
|
|
933
|
-
}), React.createElement(Box, {
|
|
935
|
+
fill: "none",
|
|
936
|
+
"aria-hidden": "true"
|
|
937
|
+
}, React.createElement(Box, {
|
|
938
|
+
variant: conditional("radio." + variant, conditionalStates),
|
|
934
939
|
as: "circle",
|
|
935
940
|
cx: "8",
|
|
936
941
|
cy: "16",
|
|
937
|
-
r: "
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
};
|
|
941
|
-
var RadioUnchecked = function RadioUnchecked(_ref2) {
|
|
942
|
-
var _ref2$disabled = _ref2.disabled,
|
|
943
|
-
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
944
|
-
_ref2$error = _ref2.error,
|
|
945
|
-
error = _ref2$error === void 0 ? false : _ref2$error,
|
|
946
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
947
|
-
|
|
948
|
-
return React.createElement(SVG, Object.assign({
|
|
949
|
-
width: "16",
|
|
950
|
-
height: "32",
|
|
951
|
-
viewBox: "0 0 16 32",
|
|
952
|
-
fill: "none"
|
|
953
|
-
}, props), React.createElement(Box, {
|
|
954
|
-
as: "circle",
|
|
942
|
+
r: "7.5"
|
|
943
|
+
}), checked && React.createElement("circle", {
|
|
944
|
+
fill: "white",
|
|
955
945
|
cx: "8",
|
|
956
946
|
cy: "16",
|
|
957
|
-
r: "
|
|
958
|
-
variant: disabled ? 'radio.unchecked.disabled' : error ? 'radio.unchecked.error' : 'radio.unchecked'
|
|
947
|
+
r: "3"
|
|
959
948
|
}));
|
|
960
949
|
};
|
|
961
950
|
|
|
962
|
-
var _excluded$
|
|
963
|
-
_excluded2$3 = ["label", "required", "error", "errorMessage"];
|
|
951
|
+
var _excluded$n = ["error"],
|
|
952
|
+
_excluded2$3 = ["label", "required", "labelVariant", "error", "errorMessage"];
|
|
964
953
|
|
|
965
|
-
var
|
|
966
|
-
var
|
|
967
|
-
|
|
968
|
-
disabled = _ref.disabled,
|
|
969
|
-
error = _ref.error;
|
|
954
|
+
var RadioInput = function RadioInput(_ref) {
|
|
955
|
+
var error = _ref.error,
|
|
956
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
970
957
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
as: RadioChecked,
|
|
974
|
-
variant: "radio." + variant,
|
|
975
|
-
disabled: disabled
|
|
976
|
-
});
|
|
977
|
-
}
|
|
958
|
+
var _useFocusRing = useFocusRing(),
|
|
959
|
+
focusProps = _useFocusRing.focusProps;
|
|
978
960
|
|
|
979
961
|
return React.createElement(Box, {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
962
|
+
pr: "xsmall"
|
|
963
|
+
}, React.createElement(VisuallyHidden, null, React.createElement("input", Object.assign({
|
|
964
|
+
type: "radio",
|
|
965
|
+
disabled: props.disabled
|
|
966
|
+
}, focusProps, props))), React.createElement(RadioIcon, {
|
|
967
|
+
variant: props.variant,
|
|
968
|
+
disabled: props.disabled,
|
|
969
|
+
checked: props.checked,
|
|
983
970
|
error: error
|
|
984
|
-
});
|
|
971
|
+
}));
|
|
985
972
|
};
|
|
986
973
|
|
|
987
|
-
var
|
|
988
|
-
var
|
|
989
|
-
|
|
990
|
-
|
|
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,
|
|
991
979
|
error = _ref2.error,
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
css: {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
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
|
+
}
|
|
1007
998
|
}
|
|
1008
|
-
},
|
|
1009
|
-
|
|
1010
|
-
variant: variant,
|
|
1011
|
-
disabled: props.disabled,
|
|
999
|
+
}, React.createElement(Box, Object.assign({
|
|
1000
|
+
as: RadioInput,
|
|
1012
1001
|
error: error
|
|
1013
|
-
}))
|
|
1002
|
+
}, props)), label), error && errorMessage && React.createElement(ValidationMessage, null, React.createElement(Exclamation, {
|
|
1003
|
+
size: 16
|
|
1004
|
+
}), errorMessage));
|
|
1014
1005
|
};
|
|
1015
1006
|
|
|
1016
|
-
var
|
|
1017
|
-
|
|
1018
|
-
required = _ref3.required,
|
|
1019
|
-
error = _ref3.error,
|
|
1020
|
-
errorMessage = _ref3.errorMessage,
|
|
1021
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);
|
|
1022
|
-
|
|
1023
|
-
if (label) {
|
|
1024
|
-
return React.createElement(React.Fragment, null, React.createElement(Label, {
|
|
1025
|
-
htmlFor: props.id,
|
|
1026
|
-
required: required,
|
|
1027
|
-
variant: props.disabled ? 'disabled' : 'inline'
|
|
1028
|
-
}, React.createElement(Box, Object.assign({
|
|
1029
|
-
as: RadioInput,
|
|
1030
|
-
pr: "8px",
|
|
1031
|
-
error: error
|
|
1032
|
-
}, props)), label), error && errorMessage && React.createElement(ValidationMessage, null, React.createElement(Exclamation, {
|
|
1033
|
-
size: 16
|
|
1034
|
-
}), errorMessage));
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
return React.createElement(RadioInput, Object.assign({}, props));
|
|
1038
|
-
};
|
|
1007
|
+
var _excluded$o = ["variant", "className"];
|
|
1008
|
+
// ---------------
|
|
1039
1009
|
|
|
1040
|
-
var _excluded$r = ["variant", "className"];
|
|
1041
1010
|
var Slider = function Slider(_ref) {
|
|
1042
1011
|
var _ref$variant = _ref.variant,
|
|
1043
|
-
variant = _ref$variant === void 0 ? '
|
|
1012
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
1044
1013
|
className = _ref.className,
|
|
1045
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1014
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
1046
1015
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1016
|
+
return React.createElement(Box, Object.assign({
|
|
1017
|
+
as: "input",
|
|
1018
|
+
type: "range",
|
|
1049
1019
|
css: {
|
|
1050
1020
|
verticalAlign: 'middle'
|
|
1051
1021
|
},
|
|
1022
|
+
variant: "slider." + variant,
|
|
1052
1023
|
className: className
|
|
1053
|
-
});
|
|
1054
|
-
return React.createElement("input", Object.assign({
|
|
1055
|
-
type: "range",
|
|
1056
|
-
className: classNames
|
|
1057
1024
|
}, props));
|
|
1058
1025
|
};
|
|
1059
1026
|
|
|
@@ -1132,6 +1099,7 @@ var ListBox = function ListBox(props) {
|
|
|
1132
1099
|
|
|
1133
1100
|
return React.createElement(Box, Object.assign({
|
|
1134
1101
|
as: "ul",
|
|
1102
|
+
p: "none",
|
|
1135
1103
|
css: {
|
|
1136
1104
|
listStyle: 'none'
|
|
1137
1105
|
}
|
|
@@ -1151,13 +1119,13 @@ var ListBox = function ListBox(props) {
|
|
|
1151
1119
|
}));
|
|
1152
1120
|
};
|
|
1153
1121
|
|
|
1154
|
-
var _excluded$
|
|
1122
|
+
var _excluded$p = ["children", "className", "isOpen", "onClose"];
|
|
1155
1123
|
var Popover = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1156
1124
|
var children = _ref.children,
|
|
1157
1125
|
className = _ref.className,
|
|
1158
1126
|
isOpen = _ref.isOpen,
|
|
1159
1127
|
onClose = _ref.onClose,
|
|
1160
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1128
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
1161
1129
|
|
|
1162
1130
|
// Handle events that should cause the popup to close,
|
|
1163
1131
|
var _useOverlay = useOverlay({
|
|
@@ -1182,9 +1150,13 @@ var Popover = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1182
1150
|
}))));
|
|
1183
1151
|
});
|
|
1184
1152
|
|
|
1185
|
-
var _excluded$
|
|
1153
|
+
var _excluded$q = ["labelVariant", "placeholder", "disabled", "required", "error", "errorMessage", "width", "className"];
|
|
1154
|
+
// ---------------
|
|
1155
|
+
|
|
1186
1156
|
var Select = function Select(_ref) {
|
|
1187
|
-
var _ref$
|
|
1157
|
+
var _ref$labelVariant = _ref.labelVariant,
|
|
1158
|
+
labelVariant = _ref$labelVariant === void 0 ? 'above' : _ref$labelVariant,
|
|
1159
|
+
_ref$placeholder = _ref.placeholder,
|
|
1188
1160
|
placeholder = _ref$placeholder === void 0 ? 'Select an option' : _ref$placeholder,
|
|
1189
1161
|
disabled = _ref.disabled,
|
|
1190
1162
|
required = _ref.required,
|
|
@@ -1192,7 +1164,7 @@ var Select = function Select(_ref) {
|
|
|
1192
1164
|
errorMessage = _ref.errorMessage,
|
|
1193
1165
|
width = _ref.width,
|
|
1194
1166
|
className = _ref.className,
|
|
1195
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1167
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
1196
1168
|
|
|
1197
1169
|
var state = useSelectState(props);
|
|
1198
1170
|
var overlayTriggerState = useOverlayTriggerState({});
|
|
@@ -1235,7 +1207,7 @@ var Select = function Select(_ref) {
|
|
|
1235
1207
|
width: width && width
|
|
1236
1208
|
}, props.label && React.createElement(Box, null, React.createElement(Label, Object.assign({}, labelProps, {
|
|
1237
1209
|
htmlFor: labelProps.id,
|
|
1238
|
-
variant:
|
|
1210
|
+
variant: labelVariant
|
|
1239
1211
|
}), required ? React.createElement(Box, {
|
|
1240
1212
|
as: "span",
|
|
1241
1213
|
display: "inline-flex",
|
|
@@ -1267,7 +1239,7 @@ var Select = function Select(_ref) {
|
|
|
1267
1239
|
as: ArrowUp,
|
|
1268
1240
|
size: 16,
|
|
1269
1241
|
css: {
|
|
1270
|
-
fill:
|
|
1242
|
+
fill: 'text'
|
|
1271
1243
|
}
|
|
1272
1244
|
}) : React.createElement(Box, {
|
|
1273
1245
|
as: ArrowDown,
|
|
@@ -1279,7 +1251,7 @@ var Select = function Select(_ref) {
|
|
|
1279
1251
|
as: Popover
|
|
1280
1252
|
}, overlayProps, positionProps, {
|
|
1281
1253
|
css: {
|
|
1282
|
-
width:
|
|
1254
|
+
width: triggerRef.current && triggerRef.current.offsetWidth + 'px'
|
|
1283
1255
|
},
|
|
1284
1256
|
ref: overlayRef,
|
|
1285
1257
|
isOpen: state.isOpen,
|
|
@@ -1301,38 +1273,12 @@ var Select = function Select(_ref) {
|
|
|
1301
1273
|
}), React.createElement(ValidationMessage, null, errorMessage)));
|
|
1302
1274
|
};
|
|
1303
1275
|
|
|
1304
|
-
var _excluded$
|
|
1305
|
-
|
|
1306
|
-
left: 'flex-start',
|
|
1307
|
-
center: 'center',
|
|
1308
|
-
right: 'flex-end'
|
|
1309
|
-
};
|
|
1310
|
-
var Stack = function Stack(_ref) {
|
|
1311
|
-
var _ref$space = _ref.space,
|
|
1312
|
-
space = _ref$space === void 0 ? 'none' : _ref$space,
|
|
1313
|
-
_ref$align = _ref.align,
|
|
1314
|
-
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
1315
|
-
children = _ref.children,
|
|
1316
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
1276
|
+
var _excluded$r = ["variant", "htmlFor", "label", "error", "errorMessage", "required", "className", "children"];
|
|
1277
|
+
// ---------------
|
|
1317
1278
|
|
|
1318
|
-
return React.createElement(Box, Object.assign({}, props, {
|
|
1319
|
-
display: "flex",
|
|
1320
|
-
flexDirection: "column",
|
|
1321
|
-
alignItems: ALIGNMENT[align],
|
|
1322
|
-
css: {
|
|
1323
|
-
'> * + *': {
|
|
1324
|
-
pt: space
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
}), Children.map(flattenChildren(children), function (child) {
|
|
1328
|
-
return React.createElement(Box, null, React.cloneElement(child, {}, child.props.children));
|
|
1329
|
-
}));
|
|
1330
|
-
};
|
|
1331
|
-
|
|
1332
|
-
var _excluded$v = ["variant", "htmlFor", "label", "error", "errorMessage", "required", "className", "children"];
|
|
1333
1279
|
var Textarea = function Textarea(_ref) {
|
|
1334
1280
|
var _ref$variant = _ref.variant,
|
|
1335
|
-
variant = _ref$variant === void 0 ? '
|
|
1281
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
1336
1282
|
_ref$htmlFor = _ref.htmlFor,
|
|
1337
1283
|
htmlFor = _ref$htmlFor === void 0 ? 'textarea' : _ref$htmlFor,
|
|
1338
1284
|
label = _ref.label,
|
|
@@ -1341,7 +1287,7 @@ var Textarea = function Textarea(_ref) {
|
|
|
1341
1287
|
required = _ref.required,
|
|
1342
1288
|
_ref$className = _ref.className,
|
|
1343
1289
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1344
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1290
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
1345
1291
|
|
|
1346
1292
|
return React.createElement(Box, null, label && React.createElement(Label, {
|
|
1347
1293
|
htmlFor: htmlFor,
|
|
@@ -1360,15 +1306,15 @@ var Textarea = function Textarea(_ref) {
|
|
|
1360
1306
|
}), errorMessage));
|
|
1361
1307
|
};
|
|
1362
1308
|
|
|
1363
|
-
var _excluded$
|
|
1309
|
+
var _excluded$s = ["children"];
|
|
1364
1310
|
var Container = function Container(_ref) {
|
|
1365
1311
|
var children = _ref.children,
|
|
1366
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1312
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
1367
1313
|
|
|
1368
1314
|
return React.createElement(Box, Object.assign({}, props, {
|
|
1369
1315
|
width: "100%"
|
|
1370
1316
|
}), children);
|
|
1371
1317
|
};
|
|
1372
1318
|
|
|
1373
|
-
export { ActionGroup, 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 };
|
|
1374
1320
|
//# sourceMappingURL=components.esm.js.map
|