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