@marigold/components 1.1.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +32 -28
- package/dist/index.js +776 -886
- package/dist/index.mjs +803 -912
- package/package.json +51 -51
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
1
|
// src/Aside/Aside.tsx
|
|
34
2
|
import React from "react";
|
|
35
3
|
|
|
@@ -87,12 +55,12 @@ var Aspect = ({
|
|
|
87
55
|
// src/Badge/Badge.tsx
|
|
88
56
|
import React3 from "react";
|
|
89
57
|
import { useComponentStyles } from "@marigold/system";
|
|
90
|
-
var Badge = (
|
|
91
|
-
var _b = _a, { variant, size, children } = _b, props = __objRest(_b, ["variant", "size", "children"]);
|
|
58
|
+
var Badge = ({ variant, size, children, ...props }) => {
|
|
92
59
|
const styles = useComponentStyles("Badge", { variant, size });
|
|
93
|
-
return /* @__PURE__ */ React3.createElement(Box,
|
|
60
|
+
return /* @__PURE__ */ React3.createElement(Box, {
|
|
61
|
+
...props,
|
|
94
62
|
css: styles
|
|
95
|
-
}
|
|
63
|
+
}, children);
|
|
96
64
|
};
|
|
97
65
|
|
|
98
66
|
// src/Breakout/Breakout.tsx
|
|
@@ -108,27 +76,24 @@ var useAlignment = (direction) => {
|
|
|
108
76
|
}
|
|
109
77
|
return "flex-start";
|
|
110
78
|
};
|
|
111
|
-
var Breakout = (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"horizontalAlign",
|
|
118
|
-
"verticalAlign",
|
|
119
|
-
"children"
|
|
120
|
-
]);
|
|
79
|
+
var Breakout = ({
|
|
80
|
+
horizontalAlign,
|
|
81
|
+
verticalAlign,
|
|
82
|
+
children,
|
|
83
|
+
...props
|
|
84
|
+
}) => {
|
|
121
85
|
const alignItems = useAlignment(horizontalAlign);
|
|
122
86
|
const justifyContent = useAlignment(verticalAlign);
|
|
123
|
-
return /* @__PURE__ */ React4.createElement(Box,
|
|
87
|
+
return /* @__PURE__ */ React4.createElement(Box, {
|
|
124
88
|
alignItems,
|
|
125
89
|
justifyContent,
|
|
126
90
|
width: "100%",
|
|
127
91
|
display: verticalAlign || horizontalAlign ? "flex" : "block",
|
|
128
92
|
css: {
|
|
129
93
|
gridColumn: "1 / -1"
|
|
130
|
-
}
|
|
131
|
-
|
|
94
|
+
},
|
|
95
|
+
...props
|
|
96
|
+
}, children);
|
|
132
97
|
};
|
|
133
98
|
|
|
134
99
|
// src/Button/Button.tsx
|
|
@@ -145,33 +110,30 @@ import {
|
|
|
145
110
|
useComponentStyles as useComponentStyles2,
|
|
146
111
|
useStateProps
|
|
147
112
|
} from "@marigold/system";
|
|
148
|
-
var Button = forwardRef((
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
"as",
|
|
157
|
-
"children",
|
|
158
|
-
"variant",
|
|
159
|
-
"size",
|
|
160
|
-
"disabled"
|
|
161
|
-
]);
|
|
113
|
+
var Button = forwardRef(({
|
|
114
|
+
as = "button",
|
|
115
|
+
children,
|
|
116
|
+
variant,
|
|
117
|
+
size,
|
|
118
|
+
disabled,
|
|
119
|
+
...props
|
|
120
|
+
}, ref) => {
|
|
162
121
|
const buttonRef = useRef(null);
|
|
163
122
|
useImperativeHandle(ref, () => buttonRef.current);
|
|
164
|
-
const { buttonProps, isPressed } = useButton(
|
|
123
|
+
const { buttonProps, isPressed } = useButton({
|
|
124
|
+
...props,
|
|
165
125
|
elementType: typeof as === "string" ? as : "span",
|
|
166
126
|
isDisabled: disabled
|
|
167
|
-
}
|
|
127
|
+
}, buttonRef);
|
|
168
128
|
const { isFocusVisible, focusProps } = useFocusRing();
|
|
169
129
|
const styles = useComponentStyles2("Button", { variant, size });
|
|
170
130
|
const stateProps = useStateProps({
|
|
171
131
|
active: isPressed,
|
|
172
132
|
focus: isFocusVisible
|
|
173
133
|
});
|
|
174
|
-
return /* @__PURE__ */ React5.createElement(Box2,
|
|
134
|
+
return /* @__PURE__ */ React5.createElement(Box2, {
|
|
135
|
+
...mergeProps(buttonProps, focusProps),
|
|
136
|
+
...stateProps,
|
|
175
137
|
as,
|
|
176
138
|
ref: buttonRef,
|
|
177
139
|
__baseCSS: {
|
|
@@ -181,7 +143,7 @@ var Button = forwardRef((_a, ref) => {
|
|
|
181
143
|
cursor: disabled ? "not-allowed" : "pointer"
|
|
182
144
|
},
|
|
183
145
|
css: styles
|
|
184
|
-
}
|
|
146
|
+
}, children);
|
|
185
147
|
});
|
|
186
148
|
|
|
187
149
|
// src/Card/Card.tsx
|
|
@@ -190,45 +152,41 @@ import {
|
|
|
190
152
|
Box as Box3,
|
|
191
153
|
useComponentStyles as useComponentStyles3
|
|
192
154
|
} from "@marigold/system";
|
|
193
|
-
var Card = (
|
|
194
|
-
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
155
|
+
var Card = ({ children, variant, size, ...props }) => {
|
|
195
156
|
const styles = useComponentStyles3("Card", { variant, size });
|
|
196
|
-
return /* @__PURE__ */ React6.createElement(Box3,
|
|
157
|
+
return /* @__PURE__ */ React6.createElement(Box3, {
|
|
158
|
+
...props,
|
|
197
159
|
css: styles
|
|
198
|
-
}
|
|
160
|
+
}, children);
|
|
199
161
|
};
|
|
200
162
|
|
|
201
163
|
// src/Center/Center.tsx
|
|
202
164
|
import React7 from "react";
|
|
203
|
-
var Center = (
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
maxInlineSize: maxWidth,
|
|
222
|
-
gap: space
|
|
223
|
-
}
|
|
224
|
-
}, props), children);
|
|
225
|
-
};
|
|
165
|
+
var Center = ({
|
|
166
|
+
maxWidth,
|
|
167
|
+
space = "none",
|
|
168
|
+
children,
|
|
169
|
+
...props
|
|
170
|
+
}) => /* @__PURE__ */ React7.createElement(Box, {
|
|
171
|
+
css: {
|
|
172
|
+
boxSizing: "content-box",
|
|
173
|
+
display: "flex",
|
|
174
|
+
flexDirection: "column",
|
|
175
|
+
alignItems: "center",
|
|
176
|
+
justifyContent: "center",
|
|
177
|
+
marginInline: "auto",
|
|
178
|
+
maxInlineSize: maxWidth,
|
|
179
|
+
gap: space
|
|
180
|
+
},
|
|
181
|
+
...props
|
|
182
|
+
}, children);
|
|
226
183
|
|
|
227
184
|
// src/Checkbox/Checkbox.tsx
|
|
228
|
-
import React10 from "react";
|
|
185
|
+
import React10, { forwardRef as forwardRef2 } from "react";
|
|
229
186
|
import { useCheckbox, useCheckboxGroupItem } from "@react-aria/checkbox";
|
|
230
187
|
import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
231
188
|
import { useHover } from "@react-aria/interactions";
|
|
189
|
+
import { useObjectRef } from "@react-aria/utils";
|
|
232
190
|
import { useToggleState } from "@react-stately/toggle";
|
|
233
191
|
import {
|
|
234
192
|
Box as Box6,
|
|
@@ -251,26 +209,21 @@ import {
|
|
|
251
209
|
import React8 from "react";
|
|
252
210
|
import { Required } from "@marigold/icons";
|
|
253
211
|
import { Box as Box4, useComponentStyles as useComponentStyles4 } from "@marigold/system";
|
|
254
|
-
var Label = (
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"as",
|
|
263
|
-
"required",
|
|
264
|
-
"children",
|
|
265
|
-
"variant",
|
|
266
|
-
"size"
|
|
267
|
-
]);
|
|
212
|
+
var Label = ({
|
|
213
|
+
as = "label",
|
|
214
|
+
required,
|
|
215
|
+
children,
|
|
216
|
+
variant,
|
|
217
|
+
size,
|
|
218
|
+
...props
|
|
219
|
+
}) => {
|
|
268
220
|
const styles = useComponentStyles4("Label", { size, variant });
|
|
269
|
-
return /* @__PURE__ */ React8.createElement(Box4,
|
|
221
|
+
return /* @__PURE__ */ React8.createElement(Box4, {
|
|
222
|
+
...props,
|
|
270
223
|
as,
|
|
271
224
|
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
272
225
|
css: styles
|
|
273
|
-
}
|
|
226
|
+
}, children, required && /* @__PURE__ */ React8.createElement(Required, {
|
|
274
227
|
role: "presentation",
|
|
275
228
|
size: 16,
|
|
276
229
|
fill: "error"
|
|
@@ -280,39 +233,34 @@ var Label = (_a) => {
|
|
|
280
233
|
// src/Checkbox/CheckboxGroup.tsx
|
|
281
234
|
var CheckboxGroupContext = createContext(null);
|
|
282
235
|
var useCheckboxGroupContext = () => useContext(CheckboxGroupContext);
|
|
283
|
-
var CheckboxGroup = (
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
"variant",
|
|
295
|
-
"size",
|
|
296
|
-
"required",
|
|
297
|
-
"disabled",
|
|
298
|
-
"readOnly",
|
|
299
|
-
"error"
|
|
300
|
-
]);
|
|
301
|
-
const props = __spreadValues({
|
|
236
|
+
var CheckboxGroup = ({
|
|
237
|
+
children,
|
|
238
|
+
variant,
|
|
239
|
+
size,
|
|
240
|
+
required,
|
|
241
|
+
disabled,
|
|
242
|
+
readOnly,
|
|
243
|
+
error,
|
|
244
|
+
...rest
|
|
245
|
+
}) => {
|
|
246
|
+
const props = {
|
|
302
247
|
isRequired: required,
|
|
303
248
|
isDisabled: disabled,
|
|
304
249
|
isReadOnly: readOnly,
|
|
305
|
-
validationState: error ? "invalid" : "valid"
|
|
306
|
-
|
|
250
|
+
validationState: error ? "invalid" : "valid",
|
|
251
|
+
...rest
|
|
252
|
+
};
|
|
307
253
|
const state = useCheckboxGroupState(props);
|
|
308
254
|
const { groupProps, labelProps } = useCheckboxGroup(props, state);
|
|
309
255
|
const styles = useComponentStyles5("CheckboxGroup", { variant, size }, { parts: ["container", "group"] });
|
|
310
|
-
return /* @__PURE__ */ React9.createElement(Box5,
|
|
256
|
+
return /* @__PURE__ */ React9.createElement(Box5, {
|
|
257
|
+
...groupProps,
|
|
311
258
|
css: styles.container
|
|
312
|
-
}
|
|
259
|
+
}, props.label && /* @__PURE__ */ React9.createElement(Label, {
|
|
313
260
|
as: "span",
|
|
314
|
-
required
|
|
315
|
-
|
|
261
|
+
required,
|
|
262
|
+
...labelProps
|
|
263
|
+
}, props.label), /* @__PURE__ */ React9.createElement(Box5, {
|
|
316
264
|
role: "presentation",
|
|
317
265
|
__baseCSS: {
|
|
318
266
|
display: "flex",
|
|
@@ -321,7 +269,7 @@ var CheckboxGroup = (_a) => {
|
|
|
321
269
|
},
|
|
322
270
|
css: styles.group
|
|
323
271
|
}, /* @__PURE__ */ React9.createElement(CheckboxGroupContext.Provider, {
|
|
324
|
-
value:
|
|
272
|
+
value: { variant, size, error, ...state }
|
|
325
273
|
}, children)));
|
|
326
274
|
};
|
|
327
275
|
|
|
@@ -342,47 +290,35 @@ var IndeterminateMark = () => /* @__PURE__ */ React10.createElement("svg", {
|
|
|
342
290
|
stroke: "none",
|
|
343
291
|
d: "M11.5 2.04018H0.5V0.46875H11.5V2.04018Z"
|
|
344
292
|
}));
|
|
345
|
-
var Icon = (
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
} = _b, props = __objRest(_b, [
|
|
375
|
-
"size",
|
|
376
|
-
"variant",
|
|
377
|
-
"disabled",
|
|
378
|
-
"checked",
|
|
379
|
-
"defaultChecked",
|
|
380
|
-
"indeterminate",
|
|
381
|
-
"readOnly",
|
|
382
|
-
"required",
|
|
383
|
-
"error"
|
|
384
|
-
]);
|
|
385
|
-
const ref = React10.useRef(null);
|
|
293
|
+
var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ React10.createElement(Box6, {
|
|
294
|
+
"aria-hidden": "true",
|
|
295
|
+
__baseCSS: {
|
|
296
|
+
width: 16,
|
|
297
|
+
height: 16,
|
|
298
|
+
bg: "#fff",
|
|
299
|
+
border: "1px solid #000",
|
|
300
|
+
borderRadius: 3,
|
|
301
|
+
display: "flex",
|
|
302
|
+
alignItems: "center",
|
|
303
|
+
justifyContent: "center",
|
|
304
|
+
p: 1
|
|
305
|
+
},
|
|
306
|
+
css,
|
|
307
|
+
...props
|
|
308
|
+
}, indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React10.createElement(CheckMark, null) : null);
|
|
309
|
+
var Checkbox = forwardRef2(({
|
|
310
|
+
size,
|
|
311
|
+
variant,
|
|
312
|
+
disabled,
|
|
313
|
+
checked,
|
|
314
|
+
defaultChecked,
|
|
315
|
+
indeterminate,
|
|
316
|
+
readOnly,
|
|
317
|
+
required,
|
|
318
|
+
error,
|
|
319
|
+
...props
|
|
320
|
+
}, ref) => {
|
|
321
|
+
const inputRef = useObjectRef(ref);
|
|
386
322
|
const checkboxProps = {
|
|
387
323
|
isIndeterminate: indeterminate,
|
|
388
324
|
isDisabled: disabled,
|
|
@@ -391,16 +327,24 @@ var Checkbox = (_a) => {
|
|
|
391
327
|
validationState: error ? "invalid" : "valid"
|
|
392
328
|
};
|
|
393
329
|
const groupState = useCheckboxGroupContext();
|
|
394
|
-
const { inputProps } = groupState ? useCheckboxGroupItem(
|
|
330
|
+
const { inputProps } = groupState ? useCheckboxGroupItem({
|
|
331
|
+
...props,
|
|
332
|
+
...checkboxProps,
|
|
395
333
|
value: props.value
|
|
396
|
-
}
|
|
334
|
+
}, groupState, inputRef) : useCheckbox({
|
|
397
335
|
isSelected: checked,
|
|
398
|
-
defaultSelected: defaultChecked
|
|
399
|
-
|
|
336
|
+
defaultSelected: defaultChecked,
|
|
337
|
+
...checkboxProps,
|
|
338
|
+
...props
|
|
339
|
+
}, useToggleState({
|
|
400
340
|
isSelected: checked,
|
|
401
|
-
defaultSelected: defaultChecked
|
|
402
|
-
|
|
403
|
-
|
|
341
|
+
defaultSelected: defaultChecked,
|
|
342
|
+
...props
|
|
343
|
+
}), inputRef);
|
|
344
|
+
const styles = useComponentStyles6("Checkbox", {
|
|
345
|
+
variant: (groupState == null ? void 0 : groupState.variant) || variant,
|
|
346
|
+
size: (groupState == null ? void 0 : groupState.size) || size
|
|
347
|
+
}, { parts: ["container", "label", "checkbox"] });
|
|
404
348
|
const { hoverProps, isHovered } = useHover({});
|
|
405
349
|
const { isFocusVisible, focusProps } = useFocusRing2();
|
|
406
350
|
const stateProps = useStateProps2({
|
|
@@ -412,7 +356,7 @@ var Checkbox = (_a) => {
|
|
|
412
356
|
readOnly,
|
|
413
357
|
indeterminate
|
|
414
358
|
});
|
|
415
|
-
return /* @__PURE__ */ React10.createElement(Box6,
|
|
359
|
+
return /* @__PURE__ */ React10.createElement(Box6, {
|
|
416
360
|
as: "label",
|
|
417
361
|
__baseCSS: {
|
|
418
362
|
display: "flex",
|
|
@@ -420,10 +364,12 @@ var Checkbox = (_a) => {
|
|
|
420
364
|
gap: "1ch",
|
|
421
365
|
position: "relative"
|
|
422
366
|
},
|
|
423
|
-
css: styles.container
|
|
424
|
-
|
|
367
|
+
css: styles.container,
|
|
368
|
+
...hoverProps,
|
|
369
|
+
...stateProps
|
|
370
|
+
}, /* @__PURE__ */ React10.createElement(Box6, {
|
|
425
371
|
as: "input",
|
|
426
|
-
ref,
|
|
372
|
+
ref: inputRef,
|
|
427
373
|
css: {
|
|
428
374
|
position: "absolute",
|
|
429
375
|
width: "100%",
|
|
@@ -433,30 +379,29 @@ var Checkbox = (_a) => {
|
|
|
433
379
|
zIndex: 1,
|
|
434
380
|
opacity: 1e-4,
|
|
435
381
|
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
436
|
-
}
|
|
437
|
-
|
|
382
|
+
},
|
|
383
|
+
...inputProps,
|
|
384
|
+
...focusProps
|
|
385
|
+
}), /* @__PURE__ */ React10.createElement(Icon, {
|
|
438
386
|
checked: inputProps.checked,
|
|
439
387
|
indeterminate,
|
|
440
|
-
css: styles.checkbox
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
388
|
+
css: styles.checkbox,
|
|
389
|
+
...stateProps
|
|
390
|
+
}), props.children && /* @__PURE__ */ React10.createElement(Box6, {
|
|
391
|
+
css: styles.label,
|
|
392
|
+
...stateProps
|
|
393
|
+
}, props.children));
|
|
394
|
+
});
|
|
445
395
|
|
|
446
396
|
// src/Columns/Columns.tsx
|
|
447
397
|
import React11, { Children } from "react";
|
|
448
|
-
var Columns = (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
"space",
|
|
456
|
-
"columns",
|
|
457
|
-
"collapseAt",
|
|
458
|
-
"children"
|
|
459
|
-
]);
|
|
398
|
+
var Columns = ({
|
|
399
|
+
space = "none",
|
|
400
|
+
columns,
|
|
401
|
+
collapseAt = "40em",
|
|
402
|
+
children,
|
|
403
|
+
...props
|
|
404
|
+
}) => {
|
|
460
405
|
if (Children.count(children) !== columns.length) {
|
|
461
406
|
throw new Error(`Columns: expected ${columns.length} children, got ${Children.count(children)}`);
|
|
462
407
|
}
|
|
@@ -467,7 +412,7 @@ var Columns = (_a) => {
|
|
|
467
412
|
}
|
|
468
413
|
};
|
|
469
414
|
});
|
|
470
|
-
return /* @__PURE__ */ React11.createElement(Box,
|
|
415
|
+
return /* @__PURE__ */ React11.createElement(Box, {
|
|
471
416
|
display: "flex",
|
|
472
417
|
css: Object.assign({
|
|
473
418
|
flexWrap: "wrap",
|
|
@@ -475,8 +420,9 @@ var Columns = (_a) => {
|
|
|
475
420
|
"> *": {
|
|
476
421
|
flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
|
|
477
422
|
}
|
|
478
|
-
}, ...getColumnWidths)
|
|
479
|
-
|
|
423
|
+
}, ...getColumnWidths),
|
|
424
|
+
...props
|
|
425
|
+
}, children);
|
|
480
426
|
};
|
|
481
427
|
|
|
482
428
|
// src/Container/Container.tsx
|
|
@@ -487,20 +433,14 @@ var ALIGNMENT = {
|
|
|
487
433
|
center: "center",
|
|
488
434
|
right: "flex-end"
|
|
489
435
|
};
|
|
490
|
-
var Container = (
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
"contentType",
|
|
499
|
-
"size",
|
|
500
|
-
"align",
|
|
501
|
-
"alignContainer",
|
|
502
|
-
"children"
|
|
503
|
-
]);
|
|
436
|
+
var Container = ({
|
|
437
|
+
contentType = "content",
|
|
438
|
+
size = "medium",
|
|
439
|
+
align = "left",
|
|
440
|
+
alignContainer = "left",
|
|
441
|
+
children,
|
|
442
|
+
...props
|
|
443
|
+
}) => {
|
|
504
444
|
const maxWidth = tokenSize[contentType][size];
|
|
505
445
|
let gridTemplateColumns = `${maxWidth} 1fr 1fr`;
|
|
506
446
|
let gridColumn = 1;
|
|
@@ -512,7 +452,7 @@ var Container = (_a) => {
|
|
|
512
452
|
gridTemplateColumns = `1fr 1fr ${maxWidth}`;
|
|
513
453
|
gridColumn = 3;
|
|
514
454
|
}
|
|
515
|
-
return /* @__PURE__ */ React12.createElement(Box,
|
|
455
|
+
return /* @__PURE__ */ React12.createElement(Box, {
|
|
516
456
|
display: "grid",
|
|
517
457
|
css: {
|
|
518
458
|
gridTemplateColumns,
|
|
@@ -520,8 +460,9 @@ var Container = (_a) => {
|
|
|
520
460
|
"> *": {
|
|
521
461
|
gridColumn
|
|
522
462
|
}
|
|
523
|
-
}
|
|
524
|
-
|
|
463
|
+
},
|
|
464
|
+
...props
|
|
465
|
+
}, children);
|
|
525
466
|
};
|
|
526
467
|
|
|
527
468
|
// src/Content/Content.tsx
|
|
@@ -530,22 +471,18 @@ import {
|
|
|
530
471
|
Box as Box7,
|
|
531
472
|
useComponentStyles as useComponentStyles7
|
|
532
473
|
} from "@marigold/system";
|
|
533
|
-
var Content = (
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
"children",
|
|
540
|
-
"variant",
|
|
541
|
-
"size"
|
|
542
|
-
]);
|
|
474
|
+
var Content = ({
|
|
475
|
+
children,
|
|
476
|
+
variant,
|
|
477
|
+
size,
|
|
478
|
+
...props
|
|
479
|
+
}) => {
|
|
543
480
|
const styles = useComponentStyles7("Content", { variant, size });
|
|
544
|
-
return /* @__PURE__ */ React13.createElement(Box7,
|
|
545
|
-
as: "section"
|
|
546
|
-
|
|
481
|
+
return /* @__PURE__ */ React13.createElement(Box7, {
|
|
482
|
+
as: "section",
|
|
483
|
+
...props,
|
|
547
484
|
css: styles
|
|
548
|
-
}
|
|
485
|
+
}, children);
|
|
549
486
|
};
|
|
550
487
|
|
|
551
488
|
// src/Dialog/Dialog.tsx
|
|
@@ -562,14 +499,13 @@ import React14 from "react";
|
|
|
562
499
|
import {
|
|
563
500
|
useComponentStyles as useComponentStyles8
|
|
564
501
|
} from "@marigold/system";
|
|
565
|
-
var Header = (
|
|
566
|
-
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
502
|
+
var Header = ({ children, variant, size, ...props }) => {
|
|
567
503
|
const styles = useComponentStyles8("Header", { variant, size });
|
|
568
|
-
return /* @__PURE__ */ React14.createElement(Box,
|
|
569
|
-
as: "header"
|
|
570
|
-
|
|
504
|
+
return /* @__PURE__ */ React14.createElement(Box, {
|
|
505
|
+
as: "header",
|
|
506
|
+
...props,
|
|
571
507
|
css: styles
|
|
572
|
-
}
|
|
508
|
+
}, children);
|
|
573
509
|
};
|
|
574
510
|
|
|
575
511
|
// src/Headline/Headline.tsx
|
|
@@ -578,27 +514,22 @@ import {
|
|
|
578
514
|
Box as Box8,
|
|
579
515
|
useComponentStyles as useComponentStyles9
|
|
580
516
|
} from "@marigold/system";
|
|
581
|
-
var Headline = (
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
"children",
|
|
589
|
-
"variant",
|
|
590
|
-
"size",
|
|
591
|
-
"level"
|
|
592
|
-
]);
|
|
517
|
+
var Headline = ({
|
|
518
|
+
children,
|
|
519
|
+
variant,
|
|
520
|
+
size,
|
|
521
|
+
level = "1",
|
|
522
|
+
...props
|
|
523
|
+
}) => {
|
|
593
524
|
const styles = useComponentStyles9("Headline", {
|
|
594
525
|
variant,
|
|
595
526
|
size: size ?? `level-${level}`
|
|
596
527
|
});
|
|
597
|
-
return /* @__PURE__ */ React15.createElement(Box8,
|
|
598
|
-
as: `h${level}
|
|
599
|
-
|
|
528
|
+
return /* @__PURE__ */ React15.createElement(Box8, {
|
|
529
|
+
as: `h${level}`,
|
|
530
|
+
...props,
|
|
600
531
|
css: styles
|
|
601
|
-
}
|
|
532
|
+
}, children);
|
|
602
533
|
};
|
|
603
534
|
|
|
604
535
|
// src/Dialog/Context.ts
|
|
@@ -612,31 +543,30 @@ import { PressResponder } from "@react-aria/interactions";
|
|
|
612
543
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
613
544
|
|
|
614
545
|
// src/Overlay/Modal.tsx
|
|
615
|
-
import React17, { forwardRef as
|
|
546
|
+
import React17, { forwardRef as forwardRef3 } from "react";
|
|
616
547
|
import { FocusScope } from "@react-aria/focus";
|
|
617
548
|
import { useModal, useOverlay, usePreventScroll } from "@react-aria/overlays";
|
|
618
|
-
import { mergeProps as mergeProps2, useObjectRef } from "@react-aria/utils";
|
|
549
|
+
import { mergeProps as mergeProps2, useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
619
550
|
|
|
620
551
|
// src/Overlay/Underlay.tsx
|
|
621
552
|
import React16 from "react";
|
|
622
553
|
import { Box as Box9, useComponentStyles as useComponentStyles10 } from "@marigold/system";
|
|
623
|
-
var Underlay = (
|
|
624
|
-
var _b = _a, { size, variant } = _b, props = __objRest(_b, ["size", "variant"]);
|
|
554
|
+
var Underlay = ({ size, variant, ...props }) => {
|
|
625
555
|
const styles = useComponentStyles10("Underlay", { size, variant });
|
|
626
|
-
return /* @__PURE__ */ React16.createElement(Box9,
|
|
556
|
+
return /* @__PURE__ */ React16.createElement(Box9, {
|
|
627
557
|
__baseCSS: {
|
|
628
558
|
position: "fixed",
|
|
629
559
|
inset: 0,
|
|
630
560
|
zIndex: 1
|
|
631
561
|
},
|
|
632
|
-
css: styles
|
|
633
|
-
|
|
562
|
+
css: styles,
|
|
563
|
+
...props
|
|
564
|
+
});
|
|
634
565
|
};
|
|
635
566
|
|
|
636
567
|
// src/Overlay/Modal.tsx
|
|
637
|
-
var Modal =
|
|
638
|
-
|
|
639
|
-
const modalRef = useObjectRef(ref);
|
|
568
|
+
var Modal = forwardRef3(({ children, open, dismissable, keyboardDismissable, onClose, ...props }, ref) => {
|
|
569
|
+
const modalRef = useObjectRef2(ref);
|
|
640
570
|
const { overlayProps, underlayProps } = useOverlay({
|
|
641
571
|
isOpen: open,
|
|
642
572
|
onClose,
|
|
@@ -649,7 +579,9 @@ var Modal = forwardRef2((_a, ref) => {
|
|
|
649
579
|
contain: true,
|
|
650
580
|
restoreFocus: true,
|
|
651
581
|
autoFocus: true
|
|
652
|
-
}, /* @__PURE__ */ React17.createElement(Underlay,
|
|
582
|
+
}, /* @__PURE__ */ React17.createElement(Underlay, {
|
|
583
|
+
...underlayProps
|
|
584
|
+
}), /* @__PURE__ */ React17.createElement("div", {
|
|
653
585
|
style: {
|
|
654
586
|
display: "flex",
|
|
655
587
|
alignItems: "center",
|
|
@@ -659,8 +591,9 @@ var Modal = forwardRef2((_a, ref) => {
|
|
|
659
591
|
zIndex: 2,
|
|
660
592
|
pointerEvents: "none"
|
|
661
593
|
},
|
|
662
|
-
ref: modalRef
|
|
663
|
-
|
|
594
|
+
ref: modalRef,
|
|
595
|
+
...mergeProps2(props, overlayProps, modalProps)
|
|
596
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
664
597
|
style: { pointerEvents: "auto" }
|
|
665
598
|
}, children)));
|
|
666
599
|
});
|
|
@@ -668,60 +601,53 @@ var Modal = forwardRef2((_a, ref) => {
|
|
|
668
601
|
// src/Overlay/Overlay.tsx
|
|
669
602
|
import React18 from "react";
|
|
670
603
|
import { OverlayContainer } from "@react-aria/overlays";
|
|
671
|
-
var Overlay = (
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
"children",
|
|
678
|
-
"open",
|
|
679
|
-
"container"
|
|
680
|
-
]);
|
|
604
|
+
var Overlay = ({
|
|
605
|
+
children,
|
|
606
|
+
open = false,
|
|
607
|
+
container,
|
|
608
|
+
...props
|
|
609
|
+
}) => {
|
|
681
610
|
if (!open) {
|
|
682
611
|
return null;
|
|
683
612
|
}
|
|
684
613
|
return /* @__PURE__ */ React18.createElement(OverlayContainer, {
|
|
685
614
|
portalContainer: container
|
|
686
|
-
}, /* @__PURE__ */ React18.createElement(Box,
|
|
615
|
+
}, /* @__PURE__ */ React18.createElement(Box, {
|
|
616
|
+
...props
|
|
617
|
+
}, children));
|
|
687
618
|
};
|
|
688
619
|
|
|
689
620
|
// src/Overlay/Popover.tsx
|
|
690
|
-
import React19, { forwardRef as
|
|
621
|
+
import React19, { forwardRef as forwardRef4, useRef as useRef2 } from "react";
|
|
691
622
|
import { useModal as useModal2, useOverlay as useOverlay2 } from "@react-aria/overlays";
|
|
692
623
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
693
|
-
var Popover =
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
"children",
|
|
703
|
-
"open",
|
|
704
|
-
"dismissable",
|
|
705
|
-
"keyboardDismissDisabled",
|
|
706
|
-
"shouldCloseOnBlur",
|
|
707
|
-
"minWidth"
|
|
708
|
-
]);
|
|
624
|
+
var Popover = forwardRef4(({
|
|
625
|
+
children,
|
|
626
|
+
open,
|
|
627
|
+
dismissable,
|
|
628
|
+
keyboardDismissDisabled,
|
|
629
|
+
shouldCloseOnBlur,
|
|
630
|
+
minWidth = 0,
|
|
631
|
+
...props
|
|
632
|
+
}, ref) => {
|
|
709
633
|
const fallbackRef = useRef2(null);
|
|
710
634
|
const popoverRef = ref || fallbackRef;
|
|
711
|
-
const { overlayProps } = useOverlay2(
|
|
635
|
+
const { overlayProps } = useOverlay2({
|
|
712
636
|
isOpen: open,
|
|
713
637
|
isDismissable: dismissable,
|
|
714
638
|
isKeyboardDismissDisabled: keyboardDismissDisabled,
|
|
715
|
-
shouldCloseOnBlur
|
|
716
|
-
|
|
639
|
+
shouldCloseOnBlur,
|
|
640
|
+
...props
|
|
641
|
+
}, popoverRef);
|
|
717
642
|
const { modalProps } = useModal2({});
|
|
718
643
|
const style = { minWidth };
|
|
719
644
|
return /* @__PURE__ */ React19.createElement(Overlay, {
|
|
720
645
|
open
|
|
721
|
-
}, /* @__PURE__ */ React19.createElement(Box,
|
|
646
|
+
}, /* @__PURE__ */ React19.createElement(Box, {
|
|
722
647
|
ref: popoverRef,
|
|
723
|
-
role: "presentation"
|
|
724
|
-
|
|
648
|
+
role: "presentation",
|
|
649
|
+
...mergeProps3(props, overlayProps, modalProps, style)
|
|
650
|
+
}, children));
|
|
725
651
|
});
|
|
726
652
|
|
|
727
653
|
// src/Dialog/DialogTrigger.tsx
|
|
@@ -759,7 +685,7 @@ var CloseButton = ({ css }) => {
|
|
|
759
685
|
}, ref);
|
|
760
686
|
return /* @__PURE__ */ React21.createElement(Box10, {
|
|
761
687
|
css: { display: "flex", justifyContent: "flex-end" }
|
|
762
|
-
}, /* @__PURE__ */ React21.createElement(Box10,
|
|
688
|
+
}, /* @__PURE__ */ React21.createElement(Box10, {
|
|
763
689
|
as: "button",
|
|
764
690
|
__baseCSS: {
|
|
765
691
|
outline: "none",
|
|
@@ -771,8 +697,9 @@ var CloseButton = ({ css }) => {
|
|
|
771
697
|
p: 0
|
|
772
698
|
},
|
|
773
699
|
css,
|
|
774
|
-
ref
|
|
775
|
-
|
|
700
|
+
ref,
|
|
701
|
+
...buttonProps
|
|
702
|
+
}, /* @__PURE__ */ React21.createElement("svg", {
|
|
776
703
|
viewBox: "0 0 20 20",
|
|
777
704
|
fill: "currentColor"
|
|
778
705
|
}, /* @__PURE__ */ React21.createElement("path", {
|
|
@@ -792,26 +719,22 @@ var addTitleProps = (children, titleProps) => {
|
|
|
792
719
|
childs.splice(titleIndex, 1, titleChild);
|
|
793
720
|
return childs;
|
|
794
721
|
};
|
|
795
|
-
var Dialog = (
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
"children",
|
|
803
|
-
"variant",
|
|
804
|
-
"size",
|
|
805
|
-
"closeButton"
|
|
806
|
-
]);
|
|
722
|
+
var Dialog = ({
|
|
723
|
+
children,
|
|
724
|
+
variant,
|
|
725
|
+
size,
|
|
726
|
+
closeButton,
|
|
727
|
+
...props
|
|
728
|
+
}) => {
|
|
807
729
|
const ref = useRef4(null);
|
|
808
730
|
const { close } = useDialogContext();
|
|
809
731
|
const { dialogProps, titleProps } = useDialog(props, ref);
|
|
810
732
|
const styles = useComponentStyles11("Dialog", { variant, size }, { parts: ["container", "closeButton"] });
|
|
811
|
-
return /* @__PURE__ */ React21.createElement(Box10,
|
|
733
|
+
return /* @__PURE__ */ React21.createElement(Box10, {
|
|
812
734
|
__baseCSS: { bg: "#fff" },
|
|
813
|
-
css: styles.container
|
|
814
|
-
|
|
735
|
+
css: styles.container,
|
|
736
|
+
...dialogProps
|
|
737
|
+
}, closeButton && /* @__PURE__ */ React21.createElement(CloseButton, {
|
|
815
738
|
css: styles.closeButton
|
|
816
739
|
}), typeof children === "function" ? children({ close, titleProps }) : props["aria-labelledby"] ? children : addTitleProps(children, titleProps));
|
|
817
740
|
};
|
|
@@ -821,13 +744,14 @@ Dialog.Trigger = DialogTrigger;
|
|
|
821
744
|
import React22 from "react";
|
|
822
745
|
import { useSeparator } from "@react-aria/separator";
|
|
823
746
|
import { Box as Box11, useComponentStyles as useComponentStyles12 } from "@marigold/system";
|
|
824
|
-
var Divider = (
|
|
825
|
-
var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
|
|
747
|
+
var Divider = ({ variant, ...props }) => {
|
|
826
748
|
const { separatorProps } = useSeparator(props);
|
|
827
749
|
const styles = useComponentStyles12("Divider", { variant });
|
|
828
|
-
return /* @__PURE__ */ React22.createElement(Box11,
|
|
829
|
-
css: styles
|
|
830
|
-
|
|
750
|
+
return /* @__PURE__ */ React22.createElement(Box11, {
|
|
751
|
+
css: styles,
|
|
752
|
+
...props,
|
|
753
|
+
...separatorProps
|
|
754
|
+
});
|
|
831
755
|
};
|
|
832
756
|
|
|
833
757
|
// src/Footer/Footer.tsx
|
|
@@ -835,26 +759,25 @@ import React23 from "react";
|
|
|
835
759
|
import {
|
|
836
760
|
useComponentStyles as useComponentStyles13
|
|
837
761
|
} from "@marigold/system";
|
|
838
|
-
var Footer = (
|
|
839
|
-
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
762
|
+
var Footer = ({ children, variant, size, ...props }) => {
|
|
840
763
|
const styles = useComponentStyles13("Footer", { variant, size });
|
|
841
|
-
return /* @__PURE__ */ React23.createElement(Box,
|
|
842
|
-
as: "footer"
|
|
843
|
-
|
|
764
|
+
return /* @__PURE__ */ React23.createElement(Box, {
|
|
765
|
+
as: "footer",
|
|
766
|
+
...props,
|
|
844
767
|
css: styles
|
|
845
|
-
}
|
|
768
|
+
}, children);
|
|
846
769
|
};
|
|
847
770
|
|
|
848
771
|
// src/Image/Image.tsx
|
|
849
772
|
import React24 from "react";
|
|
850
773
|
import { useComponentStyles as useComponentStyles14 } from "@marigold/system";
|
|
851
|
-
var Image = (
|
|
852
|
-
var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
|
|
774
|
+
var Image = ({ variant, ...props }) => {
|
|
853
775
|
const styles = useComponentStyles14("Image", { variant });
|
|
854
|
-
return /* @__PURE__ */ React24.createElement(Box,
|
|
776
|
+
return /* @__PURE__ */ React24.createElement(Box, {
|
|
777
|
+
...props,
|
|
855
778
|
as: "img",
|
|
856
779
|
css: styles
|
|
857
|
-
})
|
|
780
|
+
});
|
|
858
781
|
};
|
|
859
782
|
|
|
860
783
|
// src/Inline/Inline.tsx
|
|
@@ -869,72 +792,63 @@ var ALIGNMENT_Y = {
|
|
|
869
792
|
center: "center",
|
|
870
793
|
bottom: "flex-end"
|
|
871
794
|
};
|
|
872
|
-
var Inline = (
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
"
|
|
881
|
-
"
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
gap: space,
|
|
889
|
-
alignItems: ALIGNMENT_Y[alignY],
|
|
890
|
-
justifyContent: ALIGNMENT_X[alignX]
|
|
891
|
-
}
|
|
892
|
-
}, props), children);
|
|
893
|
-
};
|
|
795
|
+
var Inline = ({
|
|
796
|
+
space = "none",
|
|
797
|
+
alignX = "left",
|
|
798
|
+
alignY = "center",
|
|
799
|
+
children,
|
|
800
|
+
...props
|
|
801
|
+
}) => /* @__PURE__ */ React25.createElement(Box, {
|
|
802
|
+
css: {
|
|
803
|
+
display: "flex",
|
|
804
|
+
flexWrap: "wrap",
|
|
805
|
+
gap: space,
|
|
806
|
+
alignItems: ALIGNMENT_Y[alignY],
|
|
807
|
+
justifyContent: ALIGNMENT_X[alignX]
|
|
808
|
+
},
|
|
809
|
+
...props
|
|
810
|
+
}, children);
|
|
894
811
|
|
|
895
812
|
// src/Input/Input.tsx
|
|
896
|
-
import React26, { forwardRef as
|
|
813
|
+
import React26, { forwardRef as forwardRef5 } from "react";
|
|
897
814
|
import { Box as Box12, useComponentStyles as useComponentStyles15 } from "@marigold/system";
|
|
898
|
-
var Input =
|
|
899
|
-
var _b = _a, { variant, size, type = "text" } = _b, props = __objRest(_b, ["variant", "size", "type"]);
|
|
815
|
+
var Input = forwardRef5(({ variant, size, type = "text", ...props }, ref) => {
|
|
900
816
|
const styles = useComponentStyles15("Input", { variant, size });
|
|
901
|
-
return /* @__PURE__ */ React26.createElement(Box12,
|
|
817
|
+
return /* @__PURE__ */ React26.createElement(Box12, {
|
|
818
|
+
...props,
|
|
902
819
|
ref,
|
|
903
820
|
as: "input",
|
|
904
821
|
type,
|
|
905
822
|
css: styles
|
|
906
|
-
})
|
|
823
|
+
});
|
|
907
824
|
});
|
|
908
825
|
|
|
909
826
|
// src/Link/Link.tsx
|
|
910
827
|
import React27, { useRef as useRef5 } from "react";
|
|
911
828
|
import { useLink } from "@react-aria/link";
|
|
912
829
|
import { useComponentStyles as useComponentStyles16 } from "@marigold/system";
|
|
913
|
-
var Link = (
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
"as",
|
|
922
|
-
"variant",
|
|
923
|
-
"size",
|
|
924
|
-
"children",
|
|
925
|
-
"disabled"
|
|
926
|
-
]);
|
|
830
|
+
var Link = ({
|
|
831
|
+
as = "a",
|
|
832
|
+
variant,
|
|
833
|
+
size,
|
|
834
|
+
children,
|
|
835
|
+
disabled,
|
|
836
|
+
...props
|
|
837
|
+
}) => {
|
|
927
838
|
const ref = useRef5(null);
|
|
928
|
-
const { linkProps } = useLink(
|
|
839
|
+
const { linkProps } = useLink({
|
|
840
|
+
...props,
|
|
929
841
|
elementType: typeof as === "string" ? as : "span",
|
|
930
842
|
isDisabled: disabled
|
|
931
|
-
}
|
|
843
|
+
}, ref);
|
|
932
844
|
const styles = useComponentStyles16("Link", { variant, size });
|
|
933
|
-
return /* @__PURE__ */ React27.createElement(Box,
|
|
845
|
+
return /* @__PURE__ */ React27.createElement(Box, {
|
|
934
846
|
as,
|
|
935
847
|
css: styles,
|
|
936
|
-
ref
|
|
937
|
-
|
|
848
|
+
ref,
|
|
849
|
+
...props,
|
|
850
|
+
...linkProps
|
|
851
|
+
}, children);
|
|
938
852
|
};
|
|
939
853
|
|
|
940
854
|
// src/Menu/Menu.tsx
|
|
@@ -971,24 +885,27 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
971
885
|
overlayRef,
|
|
972
886
|
isOpen: state.isOpen
|
|
973
887
|
});
|
|
974
|
-
const menuContext =
|
|
888
|
+
const menuContext = {
|
|
889
|
+
...menuProps,
|
|
975
890
|
open: state.isOpen,
|
|
976
891
|
onClose: state.close,
|
|
977
892
|
autoFocus: state.focusStrategy,
|
|
978
893
|
triggerWidth: menuTriggerRef.current ? menuTriggerRef.current.offsetWidth : void 0
|
|
979
|
-
}
|
|
894
|
+
};
|
|
980
895
|
return /* @__PURE__ */ React28.createElement(MenuContext.Provider, {
|
|
981
896
|
value: menuContext
|
|
982
|
-
}, /* @__PURE__ */ React28.createElement(PressResponder2,
|
|
897
|
+
}, /* @__PURE__ */ React28.createElement(PressResponder2, {
|
|
898
|
+
...menuTriggerProps,
|
|
983
899
|
ref: menuTriggerRef,
|
|
984
900
|
isPressed: state.isOpen
|
|
985
|
-
}
|
|
901
|
+
}, menuTrigger), /* @__PURE__ */ React28.createElement(Popover, {
|
|
986
902
|
open: state.isOpen,
|
|
987
903
|
onClose: state.close,
|
|
988
904
|
dismissable: true,
|
|
989
905
|
shouldCloseOnBlur: true,
|
|
990
|
-
ref: overlayRef
|
|
991
|
-
|
|
906
|
+
ref: overlayRef,
|
|
907
|
+
...positionProps
|
|
908
|
+
}, menu));
|
|
992
909
|
};
|
|
993
910
|
|
|
994
911
|
// src/Menu/MenuItem.tsx
|
|
@@ -1009,7 +926,7 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
1009
926
|
const stateProps = useStateProps3({
|
|
1010
927
|
focus: isFocusVisible
|
|
1011
928
|
});
|
|
1012
|
-
return /* @__PURE__ */ React29.createElement(Box13,
|
|
929
|
+
return /* @__PURE__ */ React29.createElement(Box13, {
|
|
1013
930
|
as: "li",
|
|
1014
931
|
ref,
|
|
1015
932
|
__baseCSS: {
|
|
@@ -1017,24 +934,25 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
1017
934
|
outline: 0
|
|
1018
935
|
}
|
|
1019
936
|
},
|
|
1020
|
-
css
|
|
1021
|
-
|
|
937
|
+
css,
|
|
938
|
+
...mergeProps4(menuItemProps, focusProps),
|
|
939
|
+
...stateProps
|
|
940
|
+
}, item.rendered);
|
|
1022
941
|
};
|
|
1023
942
|
|
|
1024
943
|
// src/Menu/Menu.tsx
|
|
1025
|
-
var Menu = (
|
|
1026
|
-
|
|
1027
|
-
const
|
|
1028
|
-
const ownProps = __spreadValues(__spreadValues({}, props), menuContext);
|
|
944
|
+
var Menu = ({ variant, size, ...props }) => {
|
|
945
|
+
const { triggerWidth, ...menuContext } = useMenuContext();
|
|
946
|
+
const ownProps = { ...props, ...menuContext };
|
|
1029
947
|
const ref = useRef8(null);
|
|
1030
|
-
const state = useTreeState(
|
|
948
|
+
const state = useTreeState({ ...ownProps, selectionMode: "none" });
|
|
1031
949
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
1032
950
|
const styles = useComponentStyles17("Menu", { variant, size }, { parts: ["container", "item"] });
|
|
1033
951
|
return /* @__PURE__ */ React30.createElement(FocusScope2, {
|
|
1034
952
|
restoreFocus: true
|
|
1035
953
|
}, /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(DismissButton, {
|
|
1036
954
|
onDismiss: ownProps.onClose
|
|
1037
|
-
}), /* @__PURE__ */ React30.createElement(Box14,
|
|
955
|
+
}), /* @__PURE__ */ React30.createElement(Box14, {
|
|
1038
956
|
as: "ul",
|
|
1039
957
|
ref,
|
|
1040
958
|
style: { width: triggerWidth },
|
|
@@ -1043,8 +961,9 @@ var Menu = (_a) => {
|
|
|
1043
961
|
p: 0,
|
|
1044
962
|
overflowWrap: "break-word"
|
|
1045
963
|
},
|
|
1046
|
-
css: styles.container
|
|
1047
|
-
|
|
964
|
+
css: styles.container,
|
|
965
|
+
...menuProps
|
|
966
|
+
}, [...state.collection].map((item) => /* @__PURE__ */ React30.createElement(MenuItem, {
|
|
1048
967
|
key: item.key,
|
|
1049
968
|
item,
|
|
1050
969
|
state,
|
|
@@ -1061,18 +980,13 @@ Menu.Item = Item;
|
|
|
1061
980
|
import React31 from "react";
|
|
1062
981
|
import { Exclamation, Info, Notification } from "@marigold/icons";
|
|
1063
982
|
import { useComponentStyles as useComponentStyles18 } from "@marigold/system";
|
|
1064
|
-
var Message = (
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
"messageTitle",
|
|
1072
|
-
"variant",
|
|
1073
|
-
"size",
|
|
1074
|
-
"children"
|
|
1075
|
-
]);
|
|
983
|
+
var Message = ({
|
|
984
|
+
messageTitle,
|
|
985
|
+
variant = "info",
|
|
986
|
+
size,
|
|
987
|
+
children,
|
|
988
|
+
...props
|
|
989
|
+
}) => {
|
|
1076
990
|
const styles = useComponentStyles18("Message", {
|
|
1077
991
|
variant,
|
|
1078
992
|
size
|
|
@@ -1084,9 +998,10 @@ var Message = (_a) => {
|
|
|
1084
998
|
if (variant === "error") {
|
|
1085
999
|
icon = /* @__PURE__ */ React31.createElement(Exclamation, null);
|
|
1086
1000
|
}
|
|
1087
|
-
return /* @__PURE__ */ React31.createElement(Box,
|
|
1088
|
-
css: styles.container
|
|
1089
|
-
|
|
1001
|
+
return /* @__PURE__ */ React31.createElement(Box, {
|
|
1002
|
+
css: styles.container,
|
|
1003
|
+
...props
|
|
1004
|
+
}, /* @__PURE__ */ React31.createElement(Box, {
|
|
1090
1005
|
__baseCSS: { display: "flex", alignItems: "center", gap: 4 }
|
|
1091
1006
|
}, /* @__PURE__ */ React31.createElement(Box, {
|
|
1092
1007
|
role: "presentation",
|
|
@@ -1099,12 +1014,12 @@ var Message = (_a) => {
|
|
|
1099
1014
|
};
|
|
1100
1015
|
|
|
1101
1016
|
// src/NumberField/NumberField.tsx
|
|
1102
|
-
import React35, { forwardRef as
|
|
1017
|
+
import React35, { forwardRef as forwardRef6 } from "react";
|
|
1103
1018
|
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1104
1019
|
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1105
1020
|
import { useLocale } from "@react-aria/i18n";
|
|
1106
1021
|
import { useNumberField } from "@react-aria/numberfield";
|
|
1107
|
-
import { mergeProps as mergeProps6, useObjectRef as
|
|
1022
|
+
import { mergeProps as mergeProps6, useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
1108
1023
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
1109
1024
|
import {
|
|
1110
1025
|
Box as Box18,
|
|
@@ -1123,35 +1038,28 @@ import {
|
|
|
1123
1038
|
Box as Box15,
|
|
1124
1039
|
useComponentStyles as useComponentStyles19
|
|
1125
1040
|
} from "@marigold/system";
|
|
1126
|
-
var HelpText = (
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
"size",
|
|
1139
|
-
"disabled",
|
|
1140
|
-
"description",
|
|
1141
|
-
"descriptionProps",
|
|
1142
|
-
"error",
|
|
1143
|
-
"errorMessage",
|
|
1144
|
-
"errorMessageProps"
|
|
1145
|
-
]);
|
|
1146
|
-
var _a2;
|
|
1041
|
+
var HelpText = ({
|
|
1042
|
+
variant,
|
|
1043
|
+
size,
|
|
1044
|
+
disabled,
|
|
1045
|
+
description,
|
|
1046
|
+
descriptionProps,
|
|
1047
|
+
error,
|
|
1048
|
+
errorMessage,
|
|
1049
|
+
errorMessageProps,
|
|
1050
|
+
...props
|
|
1051
|
+
}) => {
|
|
1052
|
+
var _a;
|
|
1147
1053
|
const hasErrorMessage = errorMessage && error;
|
|
1148
1054
|
const styles = useComponentStyles19("HelpText", { variant, size }, { parts: ["container", "icon"] });
|
|
1149
|
-
return /* @__PURE__ */ React32.createElement(Box15,
|
|
1055
|
+
return /* @__PURE__ */ React32.createElement(Box15, {
|
|
1056
|
+
...hasErrorMessage ? errorMessageProps : descriptionProps,
|
|
1057
|
+
...props,
|
|
1150
1058
|
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
1151
1059
|
css: styles.container
|
|
1152
|
-
}
|
|
1060
|
+
}, hasErrorMessage ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Exclamation2, {
|
|
1153
1061
|
role: "presentation",
|
|
1154
|
-
size: ((
|
|
1062
|
+
size: ((_a = styles == null ? void 0 : styles.icon) == null ? void 0 : _a.size) || 16
|
|
1155
1063
|
}), errorMessage) : /* @__PURE__ */ React32.createElement(React32.Fragment, null, description));
|
|
1156
1064
|
};
|
|
1157
1065
|
|
|
@@ -1175,11 +1083,14 @@ var FieldBase = ({
|
|
|
1175
1083
|
const hasHelpText = !!description || errorMessage && error;
|
|
1176
1084
|
return /* @__PURE__ */ React33.createElement(Box16, {
|
|
1177
1085
|
css: { display: "flex", flexDirection: "column", width }
|
|
1178
|
-
}, label && /* @__PURE__ */ React33.createElement(Label,
|
|
1086
|
+
}, label && /* @__PURE__ */ React33.createElement(Label, {
|
|
1179
1087
|
required,
|
|
1180
1088
|
variant,
|
|
1181
|
-
size
|
|
1182
|
-
|
|
1089
|
+
size,
|
|
1090
|
+
...labelProps,
|
|
1091
|
+
...stateProps
|
|
1092
|
+
}, label), children, hasHelpText && /* @__PURE__ */ React33.createElement(HelpText, {
|
|
1093
|
+
...stateProps,
|
|
1183
1094
|
variant,
|
|
1184
1095
|
size,
|
|
1185
1096
|
disabled,
|
|
@@ -1188,7 +1099,7 @@ var FieldBase = ({
|
|
|
1188
1099
|
error,
|
|
1189
1100
|
errorMessage,
|
|
1190
1101
|
errorMessageProps
|
|
1191
|
-
}))
|
|
1102
|
+
}));
|
|
1192
1103
|
};
|
|
1193
1104
|
|
|
1194
1105
|
// src/NumberField/StepButton.tsx
|
|
@@ -1217,10 +1128,9 @@ var Minus = () => /* @__PURE__ */ React34.createElement(Box17, {
|
|
|
1217
1128
|
clipRule: "evenodd",
|
|
1218
1129
|
d: "M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
1219
1130
|
}));
|
|
1220
|
-
var StepButton = (
|
|
1221
|
-
var _b = _a, { direction, css } = _b, props = __objRest(_b, ["direction", "css"]);
|
|
1131
|
+
var StepButton = ({ direction, css, ...props }) => {
|
|
1222
1132
|
const ref = useRef9(null);
|
|
1223
|
-
const { buttonProps, isPressed } = useButton3(
|
|
1133
|
+
const { buttonProps, isPressed } = useButton3({ ...props, elementType: "div" }, ref);
|
|
1224
1134
|
const { hoverProps, isHovered } = useHover2(props);
|
|
1225
1135
|
const stateProps = useStateProps4({
|
|
1226
1136
|
active: isPressed,
|
|
@@ -1228,48 +1138,42 @@ var StepButton = (_a) => {
|
|
|
1228
1138
|
disabled: props.isDisabled
|
|
1229
1139
|
});
|
|
1230
1140
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
1231
|
-
return /* @__PURE__ */ React34.createElement(Box17,
|
|
1141
|
+
return /* @__PURE__ */ React34.createElement(Box17, {
|
|
1232
1142
|
__baseCSS: {
|
|
1233
1143
|
display: "flex",
|
|
1234
1144
|
alignItems: "center",
|
|
1235
1145
|
justifyContent: "center",
|
|
1236
1146
|
cursor: props.isDisabled ? "not-allowed" : "pointer"
|
|
1237
1147
|
},
|
|
1238
|
-
css
|
|
1239
|
-
|
|
1148
|
+
css,
|
|
1149
|
+
...mergeProps5(buttonProps, hoverProps),
|
|
1150
|
+
...stateProps
|
|
1151
|
+
}, /* @__PURE__ */ React34.createElement(Icon3, null));
|
|
1240
1152
|
};
|
|
1241
1153
|
|
|
1242
1154
|
// src/NumberField/NumberField.tsx
|
|
1243
|
-
var NumberField =
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
"size",
|
|
1256
|
-
"width",
|
|
1257
|
-
"disabled",
|
|
1258
|
-
"required",
|
|
1259
|
-
"readOnly",
|
|
1260
|
-
"error",
|
|
1261
|
-
"hideStepper"
|
|
1262
|
-
]);
|
|
1263
|
-
const props = __spreadValues({
|
|
1155
|
+
var NumberField = forwardRef6(({
|
|
1156
|
+
variant,
|
|
1157
|
+
size,
|
|
1158
|
+
width,
|
|
1159
|
+
disabled,
|
|
1160
|
+
required,
|
|
1161
|
+
readOnly,
|
|
1162
|
+
error,
|
|
1163
|
+
hideStepper,
|
|
1164
|
+
...rest
|
|
1165
|
+
}, ref) => {
|
|
1166
|
+
const props = {
|
|
1264
1167
|
isDisabled: disabled,
|
|
1265
1168
|
isRequired: required,
|
|
1266
1169
|
isReadOnly: readOnly,
|
|
1267
|
-
validationState: error ? "invalid" : "valid"
|
|
1268
|
-
|
|
1170
|
+
validationState: error ? "invalid" : "valid",
|
|
1171
|
+
...rest
|
|
1172
|
+
};
|
|
1269
1173
|
const showStepper = !hideStepper;
|
|
1270
1174
|
const { locale } = useLocale();
|
|
1271
|
-
const inputRef =
|
|
1272
|
-
const state = useNumberFieldState(
|
|
1175
|
+
const inputRef = useObjectRef3(ref);
|
|
1176
|
+
const state = useNumberFieldState({ ...props, locale });
|
|
1273
1177
|
const {
|
|
1274
1178
|
labelProps,
|
|
1275
1179
|
groupProps,
|
|
@@ -1306,7 +1210,7 @@ var NumberField = forwardRef5((_a, ref) => {
|
|
|
1306
1210
|
variant,
|
|
1307
1211
|
size,
|
|
1308
1212
|
width
|
|
1309
|
-
}, /* @__PURE__ */ React35.createElement(Box18,
|
|
1213
|
+
}, /* @__PURE__ */ React35.createElement(Box18, {
|
|
1310
1214
|
"data-group": true,
|
|
1311
1215
|
__baseCSS: {
|
|
1312
1216
|
display: "flex",
|
|
@@ -1315,18 +1219,24 @@ var NumberField = forwardRef5((_a, ref) => {
|
|
|
1315
1219
|
flexGrow: 1
|
|
1316
1220
|
}
|
|
1317
1221
|
},
|
|
1318
|
-
css: styles.group
|
|
1319
|
-
|
|
1222
|
+
css: styles.group,
|
|
1223
|
+
...mergeProps6(groupProps, focusProps, hoverProps),
|
|
1224
|
+
...stateProps
|
|
1225
|
+
}, showStepper && /* @__PURE__ */ React35.createElement(StepButton, {
|
|
1320
1226
|
direction: "down",
|
|
1321
|
-
css: styles.stepper
|
|
1322
|
-
|
|
1227
|
+
css: styles.stepper,
|
|
1228
|
+
...decrementButtonProps
|
|
1229
|
+
}), /* @__PURE__ */ React35.createElement(Input, {
|
|
1323
1230
|
ref: inputRef,
|
|
1324
1231
|
variant,
|
|
1325
|
-
size
|
|
1326
|
-
|
|
1232
|
+
size,
|
|
1233
|
+
...inputProps,
|
|
1234
|
+
...stateProps
|
|
1235
|
+
}), showStepper && /* @__PURE__ */ React35.createElement(StepButton, {
|
|
1327
1236
|
direction: "up",
|
|
1328
|
-
css: styles.stepper
|
|
1329
|
-
|
|
1237
|
+
css: styles.stepper,
|
|
1238
|
+
...incrementButtonProps
|
|
1239
|
+
})));
|
|
1330
1240
|
});
|
|
1331
1241
|
|
|
1332
1242
|
// src/Provider/index.ts
|
|
@@ -1343,21 +1253,34 @@ import {
|
|
|
1343
1253
|
__defaultTheme
|
|
1344
1254
|
} from "@marigold/system";
|
|
1345
1255
|
function MarigoldProvider({
|
|
1256
|
+
children,
|
|
1346
1257
|
theme,
|
|
1347
|
-
|
|
1258
|
+
selector,
|
|
1259
|
+
normalizeDocument = true
|
|
1348
1260
|
}) {
|
|
1261
|
+
var _a;
|
|
1349
1262
|
const outer = useTheme();
|
|
1350
1263
|
const isTopLevel = outer.theme === __defaultTheme;
|
|
1264
|
+
if (((_a = outer.theme) == null ? void 0 : _a.root) && !isTopLevel && !selector) {
|
|
1265
|
+
throw new Error(`[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
|
|
1266
|
+
Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`);
|
|
1267
|
+
}
|
|
1351
1268
|
return /* @__PURE__ */ React36.createElement(ThemeProvider, {
|
|
1352
1269
|
theme
|
|
1353
|
-
},
|
|
1270
|
+
}, /* @__PURE__ */ React36.createElement(Global, {
|
|
1271
|
+
normalizeDocument: isTopLevel && normalizeDocument,
|
|
1272
|
+
selector
|
|
1273
|
+
}), isTopLevel ? /* @__PURE__ */ React36.createElement(OverlayProvider, null, children) : children);
|
|
1354
1274
|
}
|
|
1355
1275
|
|
|
1356
1276
|
// src/Radio/Radio.tsx
|
|
1357
|
-
import React38, {
|
|
1277
|
+
import React38, {
|
|
1278
|
+
forwardRef as forwardRef7
|
|
1279
|
+
} from "react";
|
|
1358
1280
|
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
1359
1281
|
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
1360
1282
|
import { useRadio } from "@react-aria/radio";
|
|
1283
|
+
import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
1361
1284
|
import {
|
|
1362
1285
|
Box as Box20,
|
|
1363
1286
|
useComponentStyles as useComponentStyles22,
|
|
@@ -1377,43 +1300,36 @@ import {
|
|
|
1377
1300
|
Box as Box19,
|
|
1378
1301
|
useComponentStyles as useComponentStyles21
|
|
1379
1302
|
} from "@marigold/system";
|
|
1380
|
-
var RadioGroup = (
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
"orientation",
|
|
1394
|
-
"size",
|
|
1395
|
-
"variant",
|
|
1396
|
-
"width",
|
|
1397
|
-
"required",
|
|
1398
|
-
"disabled",
|
|
1399
|
-
"readOnly",
|
|
1400
|
-
"error"
|
|
1401
|
-
]);
|
|
1402
|
-
const props = __spreadValues({
|
|
1303
|
+
var RadioGroup = ({
|
|
1304
|
+
children,
|
|
1305
|
+
orientation = "vertical",
|
|
1306
|
+
size,
|
|
1307
|
+
variant,
|
|
1308
|
+
width,
|
|
1309
|
+
required,
|
|
1310
|
+
disabled,
|
|
1311
|
+
readOnly,
|
|
1312
|
+
error,
|
|
1313
|
+
...rest
|
|
1314
|
+
}) => {
|
|
1315
|
+
const props = {
|
|
1403
1316
|
isRequired: required,
|
|
1404
1317
|
isDisabled: disabled,
|
|
1405
1318
|
isReadOnly: readOnly,
|
|
1406
|
-
validationState: error ? "invalid" : "valid"
|
|
1407
|
-
|
|
1319
|
+
validationState: error ? "invalid" : "valid",
|
|
1320
|
+
...rest
|
|
1321
|
+
};
|
|
1408
1322
|
const state = useRadioGroupState(props);
|
|
1409
1323
|
const { radioGroupProps, labelProps } = useRadioGroup(props, state);
|
|
1410
1324
|
const styles = useComponentStyles21("RadioGroup", { variant, size }, { parts: ["container", "group"] });
|
|
1411
|
-
return /* @__PURE__ */ React37.createElement(Box19,
|
|
1325
|
+
return /* @__PURE__ */ React37.createElement(Box19, {
|
|
1326
|
+
...radioGroupProps,
|
|
1412
1327
|
css: styles.container
|
|
1413
|
-
}
|
|
1328
|
+
}, props.label && /* @__PURE__ */ React37.createElement(Label, {
|
|
1414
1329
|
as: "span",
|
|
1415
|
-
required
|
|
1416
|
-
|
|
1330
|
+
required,
|
|
1331
|
+
...labelProps
|
|
1332
|
+
}, props.label), /* @__PURE__ */ React37.createElement(Box19, {
|
|
1417
1333
|
role: "presentation",
|
|
1418
1334
|
"data-orientation": orientation,
|
|
1419
1335
|
__baseCSS: {
|
|
@@ -1424,7 +1340,7 @@ var RadioGroup = (_a) => {
|
|
|
1424
1340
|
},
|
|
1425
1341
|
css: styles.group
|
|
1426
1342
|
}, /* @__PURE__ */ React37.createElement(RadioGroupContext.Provider, {
|
|
1427
|
-
value:
|
|
1343
|
+
value: { variant, size, width, error, ...state }
|
|
1428
1344
|
}, children)));
|
|
1429
1345
|
};
|
|
1430
1346
|
|
|
@@ -1437,39 +1353,32 @@ var Dot = () => /* @__PURE__ */ React38.createElement("svg", {
|
|
|
1437
1353
|
cy: "3",
|
|
1438
1354
|
r: "3"
|
|
1439
1355
|
}));
|
|
1440
|
-
var Icon2 = (
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
var Radio = (_a) => {
|
|
1459
|
-
var _b = _a, { width, disabled } = _b, props = __objRest(_b, ["width", "disabled"]);
|
|
1460
|
-
const _a2 = useRadioGroupContext(), {
|
|
1356
|
+
var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */ React38.createElement(Box20, {
|
|
1357
|
+
"aria-hidden": "true",
|
|
1358
|
+
__baseCSS: {
|
|
1359
|
+
width: 16,
|
|
1360
|
+
height: 16,
|
|
1361
|
+
bg: "#fff",
|
|
1362
|
+
border: "1px solid #000",
|
|
1363
|
+
borderRadius: "50%",
|
|
1364
|
+
display: "flex",
|
|
1365
|
+
alignItems: "center",
|
|
1366
|
+
justifyContent: "center",
|
|
1367
|
+
p: 4
|
|
1368
|
+
},
|
|
1369
|
+
css,
|
|
1370
|
+
...props
|
|
1371
|
+
}, checked ? /* @__PURE__ */ React38.createElement(Dot, null) : null);
|
|
1372
|
+
var Radio = forwardRef7(({ width, disabled, ...props }, ref) => {
|
|
1373
|
+
const {
|
|
1461
1374
|
variant,
|
|
1462
1375
|
size,
|
|
1463
1376
|
error,
|
|
1464
|
-
width: groupWidth
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
"width"
|
|
1470
|
-
]);
|
|
1471
|
-
const ref = useRef10(null);
|
|
1472
|
-
const { inputProps } = useRadio(__spreadValues({ isDisabled: disabled }, props), state, ref);
|
|
1377
|
+
width: groupWidth,
|
|
1378
|
+
...state
|
|
1379
|
+
} = useRadioGroupContext();
|
|
1380
|
+
const inputRef = useObjectRef4(ref);
|
|
1381
|
+
const { inputProps } = useRadio({ isDisabled: disabled, ...props }, state, inputRef);
|
|
1473
1382
|
const styles = useComponentStyles22("Radio", { variant: variant || props.variant, size: size || props.size }, { parts: ["container", "label", "radio"] });
|
|
1474
1383
|
const { hoverProps, isHovered } = useHover4({});
|
|
1475
1384
|
const { isFocusVisible, focusProps } = useFocusRing5();
|
|
@@ -1481,7 +1390,7 @@ var Radio = (_a) => {
|
|
|
1481
1390
|
readOnly: props.readOnly,
|
|
1482
1391
|
error
|
|
1483
1392
|
});
|
|
1484
|
-
return /* @__PURE__ */ React38.createElement(Box20,
|
|
1393
|
+
return /* @__PURE__ */ React38.createElement(Box20, {
|
|
1485
1394
|
as: "label",
|
|
1486
1395
|
__baseCSS: {
|
|
1487
1396
|
display: "flex",
|
|
@@ -1490,10 +1399,12 @@ var Radio = (_a) => {
|
|
|
1490
1399
|
position: "relative",
|
|
1491
1400
|
width: width || groupWidth || "100%"
|
|
1492
1401
|
},
|
|
1493
|
-
css: styles.container
|
|
1494
|
-
|
|
1402
|
+
css: styles.container,
|
|
1403
|
+
...hoverProps,
|
|
1404
|
+
...stateProps
|
|
1405
|
+
}, /* @__PURE__ */ React38.createElement(Box20, {
|
|
1495
1406
|
as: "input",
|
|
1496
|
-
ref,
|
|
1407
|
+
ref: inputRef,
|
|
1497
1408
|
css: {
|
|
1498
1409
|
position: "absolute",
|
|
1499
1410
|
width: "100%",
|
|
@@ -1503,18 +1414,25 @@ var Radio = (_a) => {
|
|
|
1503
1414
|
zIndex: 1,
|
|
1504
1415
|
opacity: 1e-4,
|
|
1505
1416
|
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1417
|
+
},
|
|
1418
|
+
...inputProps,
|
|
1419
|
+
...focusProps
|
|
1420
|
+
}), /* @__PURE__ */ React38.createElement(Icon2, {
|
|
1508
1421
|
checked: inputProps.checked,
|
|
1509
|
-
css: styles.radio
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1422
|
+
css: styles.radio,
|
|
1423
|
+
...stateProps
|
|
1424
|
+
}), /* @__PURE__ */ React38.createElement(Box20, {
|
|
1425
|
+
css: styles.label,
|
|
1426
|
+
...stateProps
|
|
1427
|
+
}, props.children));
|
|
1428
|
+
});
|
|
1514
1429
|
Radio.Group = RadioGroup;
|
|
1515
1430
|
|
|
1516
1431
|
// src/Select/Select.tsx
|
|
1517
|
-
import React42, {
|
|
1432
|
+
import React42, {
|
|
1433
|
+
forwardRef as forwardRef9,
|
|
1434
|
+
useRef as useRef11
|
|
1435
|
+
} from "react";
|
|
1518
1436
|
import { useButton as useButton4 } from "@react-aria/button";
|
|
1519
1437
|
import { FocusScope as FocusScope3, useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1520
1438
|
import { useMessageFormatter } from "@react-aria/i18n";
|
|
@@ -1522,7 +1440,7 @@ import { DismissButton as DismissButton2, useOverlayPosition as useOverlayPositi
|
|
|
1522
1440
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
1523
1441
|
import { useSelectState } from "@react-stately/select";
|
|
1524
1442
|
import { Item as Item2, Section } from "@react-stately/collections";
|
|
1525
|
-
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1443
|
+
import { mergeProps as mergeProps7, useObjectRef as useObjectRef6 } from "@react-aria/utils";
|
|
1526
1444
|
import {
|
|
1527
1445
|
Box as Box24,
|
|
1528
1446
|
useComponentStyles as useComponentStyles24,
|
|
@@ -1530,8 +1448,8 @@ import {
|
|
|
1530
1448
|
} from "@marigold/system";
|
|
1531
1449
|
|
|
1532
1450
|
// src/ListBox/ListBox.tsx
|
|
1533
|
-
import React41, { forwardRef as
|
|
1534
|
-
import { useObjectRef as
|
|
1451
|
+
import React41, { forwardRef as forwardRef8 } from "react";
|
|
1452
|
+
import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
|
|
1535
1453
|
import {
|
|
1536
1454
|
Box as Box23,
|
|
1537
1455
|
useComponentStyles as useComponentStyles23
|
|
@@ -1549,11 +1467,11 @@ import { useListBoxSection } from "@react-aria/listbox";
|
|
|
1549
1467
|
import { Box as Box22 } from "@marigold/system";
|
|
1550
1468
|
|
|
1551
1469
|
// src/ListBox/ListBoxOption.tsx
|
|
1552
|
-
import React39, { useRef as
|
|
1470
|
+
import React39, { useRef as useRef10 } from "react";
|
|
1553
1471
|
import { useOption } from "@react-aria/listbox";
|
|
1554
1472
|
import { Box as Box21, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1555
1473
|
var ListBoxOption = ({ item, state }) => {
|
|
1556
|
-
const ref =
|
|
1474
|
+
const ref = useRef10(null);
|
|
1557
1475
|
const { optionProps, isSelected, isDisabled, isFocused } = useOption({
|
|
1558
1476
|
key: item.key
|
|
1559
1477
|
}, state, ref);
|
|
@@ -1563,11 +1481,13 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
1563
1481
|
disabled: isDisabled,
|
|
1564
1482
|
focusVisible: isFocused
|
|
1565
1483
|
});
|
|
1566
|
-
return /* @__PURE__ */ React39.createElement(Box21,
|
|
1484
|
+
return /* @__PURE__ */ React39.createElement(Box21, {
|
|
1567
1485
|
as: "li",
|
|
1568
1486
|
ref,
|
|
1569
|
-
css: styles.option
|
|
1570
|
-
|
|
1487
|
+
css: styles.option,
|
|
1488
|
+
...optionProps,
|
|
1489
|
+
...stateProps
|
|
1490
|
+
}, item.rendered);
|
|
1571
1491
|
};
|
|
1572
1492
|
|
|
1573
1493
|
// src/ListBox/ListBoxSection.tsx
|
|
@@ -1577,16 +1497,19 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1577
1497
|
"aria-label": section["aria-label"]
|
|
1578
1498
|
});
|
|
1579
1499
|
const { styles } = useListBoxContext();
|
|
1580
|
-
return /* @__PURE__ */ React40.createElement(Box22,
|
|
1500
|
+
return /* @__PURE__ */ React40.createElement(Box22, {
|
|
1581
1501
|
as: "li",
|
|
1582
|
-
css: styles.section
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1502
|
+
css: styles.section,
|
|
1503
|
+
...itemProps
|
|
1504
|
+
}, section.rendered && /* @__PURE__ */ React40.createElement(Box22, {
|
|
1505
|
+
css: styles.sectionTitle,
|
|
1506
|
+
...headingProps
|
|
1507
|
+
}, section.rendered), /* @__PURE__ */ React40.createElement(Box22, {
|
|
1586
1508
|
as: "ul",
|
|
1587
1509
|
__baseCSS: { listStyle: "none", p: 0 },
|
|
1588
|
-
css: styles.list
|
|
1589
|
-
|
|
1510
|
+
css: styles.list,
|
|
1511
|
+
...groupProps
|
|
1512
|
+
}, [...section.childNodes].map((node) => /* @__PURE__ */ React40.createElement(ListBoxOption, {
|
|
1590
1513
|
key: node.key,
|
|
1591
1514
|
item: node,
|
|
1592
1515
|
state
|
|
@@ -1594,21 +1517,21 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1594
1517
|
};
|
|
1595
1518
|
|
|
1596
1519
|
// src/ListBox/ListBox.tsx
|
|
1597
|
-
var ListBox =
|
|
1598
|
-
|
|
1599
|
-
const innerRef = useObjectRef3(ref);
|
|
1520
|
+
var ListBox = forwardRef8(({ state, variant, size, ...props }, ref) => {
|
|
1521
|
+
const innerRef = useObjectRef5(ref);
|
|
1600
1522
|
const { listBoxProps } = useListBox(props, state, innerRef);
|
|
1601
1523
|
const styles = useComponentStyles23("ListBox", { variant, size }, { parts: ["container", "list", "option", "section", "sectionTitle"] });
|
|
1602
1524
|
return /* @__PURE__ */ React41.createElement(ListBoxContext.Provider, {
|
|
1603
1525
|
value: { styles }
|
|
1604
1526
|
}, /* @__PURE__ */ React41.createElement(Box23, {
|
|
1605
1527
|
css: styles.container
|
|
1606
|
-
}, /* @__PURE__ */ React41.createElement(Box23,
|
|
1528
|
+
}, /* @__PURE__ */ React41.createElement(Box23, {
|
|
1607
1529
|
as: "ul",
|
|
1608
1530
|
ref: innerRef,
|
|
1609
1531
|
__baseCSS: { listStyle: "none", p: 0 },
|
|
1610
|
-
css: styles.list
|
|
1611
|
-
|
|
1532
|
+
css: styles.list,
|
|
1533
|
+
...listBoxProps
|
|
1534
|
+
}, [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */ React41.createElement(ListBoxSection, {
|
|
1612
1535
|
key: item.key,
|
|
1613
1536
|
section: item,
|
|
1614
1537
|
state
|
|
@@ -1643,34 +1566,18 @@ var Chevron = ({ css }) => /* @__PURE__ */ React42.createElement(Box24, {
|
|
|
1643
1566
|
strokeLinejoin: "round",
|
|
1644
1567
|
d: "M19 9l-7 7-7-7"
|
|
1645
1568
|
}));
|
|
1646
|
-
var Select = (
|
|
1647
|
-
var _b = _a, {
|
|
1648
|
-
variant,
|
|
1649
|
-
size,
|
|
1650
|
-
width,
|
|
1651
|
-
open,
|
|
1652
|
-
disabled,
|
|
1653
|
-
required,
|
|
1654
|
-
error
|
|
1655
|
-
} = _b, rest = __objRest(_b, [
|
|
1656
|
-
"variant",
|
|
1657
|
-
"size",
|
|
1658
|
-
"width",
|
|
1659
|
-
"open",
|
|
1660
|
-
"disabled",
|
|
1661
|
-
"required",
|
|
1662
|
-
"error"
|
|
1663
|
-
]);
|
|
1569
|
+
var Select = forwardRef9(({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
|
|
1664
1570
|
const formatMessage = useMessageFormatter(messages);
|
|
1665
|
-
const
|
|
1571
|
+
const buttonRef = useObjectRef6(ref);
|
|
1572
|
+
const props = {
|
|
1666
1573
|
isOpen: open,
|
|
1667
1574
|
isDisabled: disabled,
|
|
1668
1575
|
isRequired: required,
|
|
1669
1576
|
validationState: error ? "invalid" : "valid",
|
|
1670
|
-
placeholder: rest.placeholder || formatMessage("placeholder")
|
|
1671
|
-
|
|
1577
|
+
placeholder: rest.placeholder || formatMessage("placeholder"),
|
|
1578
|
+
...rest
|
|
1579
|
+
};
|
|
1672
1580
|
const state = useSelectState(props);
|
|
1673
|
-
const buttonRef = useRef12(null);
|
|
1674
1581
|
const {
|
|
1675
1582
|
labelProps,
|
|
1676
1583
|
triggerProps,
|
|
@@ -1679,9 +1586,9 @@ var Select = (_a) => {
|
|
|
1679
1586
|
descriptionProps,
|
|
1680
1587
|
errorMessageProps
|
|
1681
1588
|
} = useSelect(props, state, buttonRef);
|
|
1682
|
-
const { buttonProps } = useButton4(
|
|
1589
|
+
const { buttonProps } = useButton4({ isDisabled: disabled, ...triggerProps }, buttonRef);
|
|
1683
1590
|
const { focusProps, isFocusVisible } = useFocusRing6();
|
|
1684
|
-
const overlayRef =
|
|
1591
|
+
const overlayRef = useRef11(null);
|
|
1685
1592
|
const { overlayProps: positionProps } = useOverlayPosition2({
|
|
1686
1593
|
targetRef: buttonRef,
|
|
1687
1594
|
overlayRef,
|
|
@@ -1700,7 +1607,7 @@ var Select = (_a) => {
|
|
|
1700
1607
|
size,
|
|
1701
1608
|
width,
|
|
1702
1609
|
label: props.label,
|
|
1703
|
-
labelProps:
|
|
1610
|
+
labelProps: { as: "span", ...labelProps },
|
|
1704
1611
|
description: props.description,
|
|
1705
1612
|
descriptionProps,
|
|
1706
1613
|
error,
|
|
@@ -1715,7 +1622,7 @@ var Select = (_a) => {
|
|
|
1715
1622
|
label: props.label,
|
|
1716
1623
|
name: props.name,
|
|
1717
1624
|
isDisabled: disabled
|
|
1718
|
-
}), /* @__PURE__ */ React42.createElement(Box24,
|
|
1625
|
+
}), /* @__PURE__ */ React42.createElement(Box24, {
|
|
1719
1626
|
as: "button",
|
|
1720
1627
|
__baseCSS: {
|
|
1721
1628
|
display: "flex",
|
|
@@ -1725,41 +1632,47 @@ var Select = (_a) => {
|
|
|
1725
1632
|
width: "100%"
|
|
1726
1633
|
},
|
|
1727
1634
|
css: styles.button,
|
|
1728
|
-
ref: buttonRef
|
|
1729
|
-
|
|
1635
|
+
ref: buttonRef,
|
|
1636
|
+
...mergeProps7(buttonProps, focusProps),
|
|
1637
|
+
...stateProps
|
|
1638
|
+
}, /* @__PURE__ */ React42.createElement(Box24, {
|
|
1730
1639
|
css: {
|
|
1731
1640
|
overflow: "hidden",
|
|
1732
1641
|
whiteSpace: "nowrap"
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1642
|
+
},
|
|
1643
|
+
...valueProps
|
|
1644
|
+
}, state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ React42.createElement(Chevron, {
|
|
1735
1645
|
css: styles.icon
|
|
1736
|
-
})), /* @__PURE__ */ React42.createElement(Popover,
|
|
1646
|
+
})), /* @__PURE__ */ React42.createElement(Popover, {
|
|
1737
1647
|
open: state.isOpen,
|
|
1738
1648
|
onClose: state.close,
|
|
1739
1649
|
dismissable: true,
|
|
1740
1650
|
shouldCloseOnBlur: true,
|
|
1741
1651
|
minWidth: buttonRef.current ? buttonRef.current.offsetWidth : void 0,
|
|
1742
|
-
ref: overlayRef
|
|
1743
|
-
|
|
1652
|
+
ref: overlayRef,
|
|
1653
|
+
...positionProps
|
|
1654
|
+
}, /* @__PURE__ */ React42.createElement(FocusScope3, {
|
|
1744
1655
|
restoreFocus: true
|
|
1745
1656
|
}, /* @__PURE__ */ React42.createElement(DismissButton2, {
|
|
1746
1657
|
onDismiss: state.close
|
|
1747
|
-
}), /* @__PURE__ */ React42.createElement(ListBox,
|
|
1658
|
+
}), /* @__PURE__ */ React42.createElement(ListBox, {
|
|
1748
1659
|
state,
|
|
1749
1660
|
variant,
|
|
1750
|
-
size
|
|
1751
|
-
|
|
1661
|
+
size,
|
|
1662
|
+
...menuProps
|
|
1663
|
+
}), /* @__PURE__ */ React42.createElement(DismissButton2, {
|
|
1752
1664
|
onDismiss: state.close
|
|
1753
1665
|
}))));
|
|
1754
|
-
};
|
|
1666
|
+
});
|
|
1755
1667
|
Select.Option = Item2;
|
|
1756
1668
|
Select.Section = Section;
|
|
1757
1669
|
|
|
1758
1670
|
// src/Slider/Slider.tsx
|
|
1759
|
-
import React44, {
|
|
1671
|
+
import React44, { forwardRef as forwardRef10 } from "react";
|
|
1760
1672
|
import { useSlider } from "@react-aria/slider";
|
|
1761
1673
|
import { useSliderState } from "@react-stately/slider";
|
|
1762
1674
|
import { useNumberFormatter } from "@react-aria/i18n";
|
|
1675
|
+
import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
1763
1676
|
import { useComponentStyles as useComponentStyles25 } from "@marigold/system";
|
|
1764
1677
|
|
|
1765
1678
|
// src/Slider/Thumb.tsx
|
|
@@ -1773,8 +1686,7 @@ import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
|
1773
1686
|
|
|
1774
1687
|
// src/Slider/Thumb.tsx
|
|
1775
1688
|
import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
|
|
1776
|
-
var Thumb = (
|
|
1777
|
-
var _b = _a, { state, trackRef, styles } = _b, props = __objRest(_b, ["state", "trackRef", "styles"]);
|
|
1689
|
+
var Thumb = ({ state, trackRef, styles, ...props }) => {
|
|
1778
1690
|
const { disabled } = props;
|
|
1779
1691
|
const inputRef = React43.useRef(null);
|
|
1780
1692
|
const { isFocusVisible, focusProps, isFocused } = useFocusRing7();
|
|
@@ -1799,52 +1711,50 @@ var Thumb = (_a) => {
|
|
|
1799
1711
|
transform: "translateX(-50%)",
|
|
1800
1712
|
left: `${state.getThumbPercent(0) * 100}%`
|
|
1801
1713
|
}
|
|
1802
|
-
}, /* @__PURE__ */ React43.createElement(Box,
|
|
1803
|
-
|
|
1804
|
-
|
|
1714
|
+
}, /* @__PURE__ */ React43.createElement(Box, {
|
|
1715
|
+
...thumbProps,
|
|
1716
|
+
__baseCSS: styles,
|
|
1717
|
+
...stateProps
|
|
1718
|
+
}, /* @__PURE__ */ React43.createElement(VisuallyHidden, null, /* @__PURE__ */ React43.createElement(Box, {
|
|
1805
1719
|
as: "input",
|
|
1806
1720
|
type: "range",
|
|
1807
|
-
ref: inputRef
|
|
1808
|
-
|
|
1721
|
+
ref: inputRef,
|
|
1722
|
+
...mergeProps8(inputProps, focusProps)
|
|
1723
|
+
}))));
|
|
1809
1724
|
};
|
|
1810
1725
|
|
|
1811
1726
|
// src/Slider/Slider.tsx
|
|
1812
|
-
var Slider = (
|
|
1813
|
-
var _b = _a, {
|
|
1814
|
-
variant,
|
|
1815
|
-
size,
|
|
1816
|
-
width = "100%"
|
|
1817
|
-
} = _b, props = __objRest(_b, [
|
|
1818
|
-
"variant",
|
|
1819
|
-
"size",
|
|
1820
|
-
"width"
|
|
1821
|
-
]);
|
|
1727
|
+
var Slider = forwardRef10(({ variant, size, width = "100%", ...props }, ref) => {
|
|
1822
1728
|
const { formatOptions } = props;
|
|
1823
|
-
const trackRef =
|
|
1729
|
+
const trackRef = useObjectRef7(ref);
|
|
1824
1730
|
const numberFormatter = useNumberFormatter(formatOptions);
|
|
1825
|
-
const state = useSliderState(
|
|
1826
|
-
const { groupProps, trackProps, labelProps, outputProps } = useSlider(
|
|
1827
|
-
label: props.children
|
|
1828
|
-
|
|
1731
|
+
const state = useSliderState({ ...props, numberFormatter });
|
|
1732
|
+
const { groupProps, trackProps, labelProps, outputProps } = useSlider({
|
|
1733
|
+
label: props.children,
|
|
1734
|
+
...props
|
|
1735
|
+
}, state, trackRef);
|
|
1829
1736
|
const styles = useComponentStyles25("Slider", { variant, size }, { parts: ["track", "thumb", "label", "output"] });
|
|
1830
|
-
return /* @__PURE__ */ React44.createElement(Box,
|
|
1737
|
+
return /* @__PURE__ */ React44.createElement(Box, {
|
|
1831
1738
|
__baseCSS: {
|
|
1832
1739
|
display: "flex",
|
|
1833
1740
|
flexDirection: "column",
|
|
1834
1741
|
touchAction: "none",
|
|
1835
1742
|
width
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1743
|
+
},
|
|
1744
|
+
...groupProps
|
|
1745
|
+
}, /* @__PURE__ */ React44.createElement(Box, {
|
|
1838
1746
|
__baseCSS: { display: "flex", alignSelf: "stretch" }
|
|
1839
|
-
}, props.children && /* @__PURE__ */ React44.createElement(Box,
|
|
1747
|
+
}, props.children && /* @__PURE__ */ React44.createElement(Box, {
|
|
1840
1748
|
as: "label",
|
|
1841
|
-
__baseCSS: styles.label
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1749
|
+
__baseCSS: styles.label,
|
|
1750
|
+
...labelProps
|
|
1751
|
+
}, props.children), /* @__PURE__ */ React44.createElement(Box, {
|
|
1752
|
+
as: "output",
|
|
1753
|
+
...outputProps,
|
|
1845
1754
|
__baseCSS: { flex: "1 0 auto", textAlign: "end" },
|
|
1846
1755
|
css: styles.output
|
|
1847
|
-
}
|
|
1756
|
+
}, state.getThumbValueLabel(0))), /* @__PURE__ */ React44.createElement(Box, {
|
|
1757
|
+
...trackProps,
|
|
1848
1758
|
ref: trackRef,
|
|
1849
1759
|
__baseCSS: {
|
|
1850
1760
|
position: "relative",
|
|
@@ -1852,7 +1762,7 @@ var Slider = (_a) => {
|
|
|
1852
1762
|
width: "100%",
|
|
1853
1763
|
cursor: props.disabled ? "not-allowed" : "pointer"
|
|
1854
1764
|
}
|
|
1855
|
-
}
|
|
1765
|
+
}, /* @__PURE__ */ React44.createElement(Box, {
|
|
1856
1766
|
__baseCSS: styles.track
|
|
1857
1767
|
}), /* @__PURE__ */ React44.createElement(Thumb, {
|
|
1858
1768
|
state,
|
|
@@ -1860,15 +1770,16 @@ var Slider = (_a) => {
|
|
|
1860
1770
|
disabled: props.disabled,
|
|
1861
1771
|
styles: styles.thumb
|
|
1862
1772
|
})));
|
|
1863
|
-
};
|
|
1773
|
+
});
|
|
1864
1774
|
|
|
1865
1775
|
// src/Split/Split.tsx
|
|
1866
1776
|
import React45 from "react";
|
|
1867
1777
|
import { Box as Box25 } from "@marigold/system";
|
|
1868
|
-
var Split = (props) => /* @__PURE__ */ React45.createElement(Box25,
|
|
1778
|
+
var Split = (props) => /* @__PURE__ */ React45.createElement(Box25, {
|
|
1779
|
+
...props,
|
|
1869
1780
|
role: "separator",
|
|
1870
1781
|
css: { flexGrow: 1 }
|
|
1871
|
-
})
|
|
1782
|
+
});
|
|
1872
1783
|
|
|
1873
1784
|
// src/Stack/Stack.tsx
|
|
1874
1785
|
import React46 from "react";
|
|
@@ -1882,69 +1793,56 @@ var ALIGNMENT_Y2 = {
|
|
|
1882
1793
|
center: "center",
|
|
1883
1794
|
bottom: "flex-end"
|
|
1884
1795
|
};
|
|
1885
|
-
var Stack = (
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
"
|
|
1895
|
-
"
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
gap: space,
|
|
1905
|
-
alignItems: ALIGNMENT_X2[alignX],
|
|
1906
|
-
justifyContent: ALIGNMENT_Y2[alignY],
|
|
1907
|
-
blockSize: stretch ? "100%" : "auto"
|
|
1908
|
-
}
|
|
1909
|
-
}, props), children);
|
|
1910
|
-
};
|
|
1796
|
+
var Stack = ({
|
|
1797
|
+
children,
|
|
1798
|
+
space = "none",
|
|
1799
|
+
alignX = "left",
|
|
1800
|
+
alignY = "top",
|
|
1801
|
+
stretch = false,
|
|
1802
|
+
...props
|
|
1803
|
+
}) => /* @__PURE__ */ React46.createElement(Box, {
|
|
1804
|
+
css: {
|
|
1805
|
+
display: "flex",
|
|
1806
|
+
flexDirection: "column",
|
|
1807
|
+
p: 0,
|
|
1808
|
+
gap: space,
|
|
1809
|
+
alignItems: ALIGNMENT_X2[alignX],
|
|
1810
|
+
justifyContent: ALIGNMENT_Y2[alignY],
|
|
1811
|
+
blockSize: stretch ? "100%" : "auto"
|
|
1812
|
+
},
|
|
1813
|
+
...props
|
|
1814
|
+
}, children);
|
|
1911
1815
|
|
|
1912
1816
|
// src/Switch/Switch.tsx
|
|
1913
|
-
import React47, {
|
|
1817
|
+
import React47, { forwardRef as forwardRef11 } from "react";
|
|
1914
1818
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
1915
1819
|
import { useSwitch } from "@react-aria/switch";
|
|
1820
|
+
import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
1916
1821
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
1917
1822
|
import {
|
|
1918
1823
|
useComponentStyles as useComponentStyles26,
|
|
1919
1824
|
useStateProps as useStateProps10
|
|
1920
1825
|
} from "@marigold/system";
|
|
1921
|
-
var Switch = (
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
"width",
|
|
1934
|
-
"checked",
|
|
1935
|
-
"disabled",
|
|
1936
|
-
"readOnly",
|
|
1937
|
-
"defaultChecked"
|
|
1938
|
-
]);
|
|
1939
|
-
const ref = useRef14(null);
|
|
1940
|
-
const props = __spreadValues({
|
|
1826
|
+
var Switch = forwardRef11(({
|
|
1827
|
+
variant,
|
|
1828
|
+
size,
|
|
1829
|
+
width = "100%",
|
|
1830
|
+
checked,
|
|
1831
|
+
disabled,
|
|
1832
|
+
readOnly,
|
|
1833
|
+
defaultChecked,
|
|
1834
|
+
...rest
|
|
1835
|
+
}, ref) => {
|
|
1836
|
+
const inputRef = useObjectRef8(ref);
|
|
1837
|
+
const props = {
|
|
1941
1838
|
isSelected: checked,
|
|
1942
1839
|
isDisabled: disabled,
|
|
1943
1840
|
isReadOnly: readOnly,
|
|
1944
|
-
defaultSelected: defaultChecked
|
|
1945
|
-
|
|
1841
|
+
defaultSelected: defaultChecked,
|
|
1842
|
+
...rest
|
|
1843
|
+
};
|
|
1946
1844
|
const state = useToggleState2(props);
|
|
1947
|
-
const { inputProps } = useSwitch(props, state,
|
|
1845
|
+
const { inputProps } = useSwitch(props, state, inputRef);
|
|
1948
1846
|
const { isFocusVisible, focusProps } = useFocusRing8();
|
|
1949
1847
|
const stateProps = useStateProps10({
|
|
1950
1848
|
checked: state.isSelected,
|
|
@@ -1964,9 +1862,9 @@ var Switch = (_a) => {
|
|
|
1964
1862
|
width
|
|
1965
1863
|
},
|
|
1966
1864
|
css: styles.container
|
|
1967
|
-
}, /* @__PURE__ */ React47.createElement(Box,
|
|
1865
|
+
}, /* @__PURE__ */ React47.createElement(Box, {
|
|
1968
1866
|
as: "input",
|
|
1969
|
-
ref,
|
|
1867
|
+
ref: inputRef,
|
|
1970
1868
|
css: {
|
|
1971
1869
|
position: "absolute",
|
|
1972
1870
|
width: "100%",
|
|
@@ -1976,10 +1874,12 @@ var Switch = (_a) => {
|
|
|
1976
1874
|
zIndex: 1,
|
|
1977
1875
|
opacity: 1e-4,
|
|
1978
1876
|
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1877
|
+
},
|
|
1878
|
+
...inputProps,
|
|
1879
|
+
...focusProps
|
|
1880
|
+
}), props.children && /* @__PURE__ */ React47.createElement(Box, {
|
|
1981
1881
|
css: styles.label
|
|
1982
|
-
}, props.children), /* @__PURE__ */ React47.createElement(Box,
|
|
1882
|
+
}, props.children), /* @__PURE__ */ React47.createElement(Box, {
|
|
1983
1883
|
__baseCSS: {
|
|
1984
1884
|
position: "relative",
|
|
1985
1885
|
width: 48,
|
|
@@ -1987,8 +1887,9 @@ var Switch = (_a) => {
|
|
|
1987
1887
|
bg: "#dee2e6",
|
|
1988
1888
|
borderRadius: 20
|
|
1989
1889
|
},
|
|
1990
|
-
css: styles.track
|
|
1991
|
-
|
|
1890
|
+
css: styles.track,
|
|
1891
|
+
...stateProps
|
|
1892
|
+
}, /* @__PURE__ */ React47.createElement(Box, {
|
|
1992
1893
|
__baseCSS: {
|
|
1993
1894
|
display: "block",
|
|
1994
1895
|
position: "absolute",
|
|
@@ -2005,12 +1906,13 @@ var Switch = (_a) => {
|
|
|
2005
1906
|
transform: "translateX(calc(47px - 100%))"
|
|
2006
1907
|
}
|
|
2007
1908
|
},
|
|
2008
|
-
css: styles.thumb
|
|
2009
|
-
|
|
2010
|
-
};
|
|
1909
|
+
css: styles.thumb,
|
|
1910
|
+
...stateProps
|
|
1911
|
+
})));
|
|
1912
|
+
});
|
|
2011
1913
|
|
|
2012
1914
|
// src/Table/Table.tsx
|
|
2013
|
-
import React56, { useRef as
|
|
1915
|
+
import React56, { useRef as useRef18 } from "react";
|
|
2014
1916
|
import { useTable } from "@react-aria/table";
|
|
2015
1917
|
import {
|
|
2016
1918
|
Cell,
|
|
@@ -2035,17 +1937,19 @@ import React48 from "react";
|
|
|
2035
1937
|
import { useTableRowGroup } from "@react-aria/table";
|
|
2036
1938
|
var TableBody = ({ children }) => {
|
|
2037
1939
|
const { rowGroupProps } = useTableRowGroup();
|
|
2038
|
-
return /* @__PURE__ */ React48.createElement("tbody",
|
|
1940
|
+
return /* @__PURE__ */ React48.createElement("tbody", {
|
|
1941
|
+
...rowGroupProps
|
|
1942
|
+
}, children);
|
|
2039
1943
|
};
|
|
2040
1944
|
|
|
2041
1945
|
// src/Table/TableCell.tsx
|
|
2042
|
-
import React49, { useRef as
|
|
1946
|
+
import React49, { useRef as useRef12 } from "react";
|
|
2043
1947
|
import { useTableCell } from "@react-aria/table";
|
|
2044
1948
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2045
1949
|
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
2046
1950
|
import { Box as Box26, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2047
1951
|
var TableCell = ({ cell }) => {
|
|
2048
|
-
const ref =
|
|
1952
|
+
const ref = useRef12(null);
|
|
2049
1953
|
const { state, styles } = useTableContext();
|
|
2050
1954
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2051
1955
|
const { gridCellProps } = useTableCell({
|
|
@@ -2053,47 +1957,45 @@ var TableCell = ({ cell }) => {
|
|
|
2053
1957
|
}, state, ref);
|
|
2054
1958
|
const { focusProps, isFocusVisible } = useFocusRing9();
|
|
2055
1959
|
const stateProps = useStateProps11({ disabled, focusVisible: isFocusVisible });
|
|
2056
|
-
return /* @__PURE__ */ React49.createElement(Box26,
|
|
1960
|
+
return /* @__PURE__ */ React49.createElement(Box26, {
|
|
2057
1961
|
as: "td",
|
|
2058
1962
|
ref,
|
|
2059
|
-
css: styles.cell
|
|
2060
|
-
|
|
1963
|
+
css: styles.cell,
|
|
1964
|
+
...mergeProps9(gridCellProps, focusProps),
|
|
1965
|
+
...stateProps
|
|
1966
|
+
}, cell.rendered);
|
|
2061
1967
|
};
|
|
2062
1968
|
|
|
2063
1969
|
// src/Table/TableCheckboxCell.tsx
|
|
2064
|
-
import React50, { useRef as
|
|
1970
|
+
import React50, { useRef as useRef13 } from "react";
|
|
2065
1971
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
2066
1972
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2067
1973
|
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
2068
1974
|
import { Box as Box27, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2069
1975
|
|
|
2070
1976
|
// src/Table/utils.ts
|
|
2071
|
-
var mapCheckboxProps = (
|
|
2072
|
-
|
|
2073
|
-
checkboxProps: _b
|
|
2074
|
-
} = _a, _c = _b, {
|
|
1977
|
+
var mapCheckboxProps = ({
|
|
1978
|
+
checkboxProps: {
|
|
2075
1979
|
isIndeterminate,
|
|
2076
1980
|
isSelected,
|
|
2077
1981
|
isDisabled,
|
|
2078
|
-
defaultSelected
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
"defaultSelected"
|
|
2084
|
-
]);
|
|
2085
|
-
const checkboxProps = __spreadValues({
|
|
1982
|
+
defaultSelected,
|
|
1983
|
+
...rest
|
|
1984
|
+
}
|
|
1985
|
+
}) => {
|
|
1986
|
+
const checkboxProps = {
|
|
2086
1987
|
disabled: isDisabled,
|
|
2087
1988
|
checked: isSelected,
|
|
2088
1989
|
defaultChecked: defaultSelected,
|
|
2089
|
-
indeterminate: isIndeterminate
|
|
2090
|
-
|
|
1990
|
+
indeterminate: isIndeterminate,
|
|
1991
|
+
...rest
|
|
1992
|
+
};
|
|
2091
1993
|
return { checkboxProps };
|
|
2092
1994
|
};
|
|
2093
1995
|
|
|
2094
1996
|
// src/Table/TableCheckboxCell.tsx
|
|
2095
1997
|
var TableCheckboxCell = ({ cell }) => {
|
|
2096
|
-
const ref =
|
|
1998
|
+
const ref = useRef13(null);
|
|
2097
1999
|
const { state, styles } = useTableContext();
|
|
2098
2000
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2099
2001
|
const { gridCellProps } = useTableCell2({
|
|
@@ -2102,7 +2004,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2102
2004
|
const { checkboxProps } = mapCheckboxProps(useTableSelectionCheckbox({ key: cell.parentKey }, state));
|
|
2103
2005
|
const { focusProps, isFocusVisible } = useFocusRing10();
|
|
2104
2006
|
const stateProps = useStateProps12({ disabled, focusVisible: isFocusVisible });
|
|
2105
|
-
return /* @__PURE__ */ React50.createElement(Box27,
|
|
2007
|
+
return /* @__PURE__ */ React50.createElement(Box27, {
|
|
2106
2008
|
as: "td",
|
|
2107
2009
|
ref,
|
|
2108
2010
|
__baseCSS: {
|
|
@@ -2110,12 +2012,16 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2110
2012
|
verticalAlign: "middle",
|
|
2111
2013
|
lineHeight: 1
|
|
2112
2014
|
},
|
|
2113
|
-
css: styles.cell
|
|
2114
|
-
|
|
2015
|
+
css: styles.cell,
|
|
2016
|
+
...mergeProps10(gridCellProps, focusProps),
|
|
2017
|
+
...stateProps
|
|
2018
|
+
}, /* @__PURE__ */ React50.createElement(Checkbox, {
|
|
2019
|
+
...checkboxProps
|
|
2020
|
+
}));
|
|
2115
2021
|
};
|
|
2116
2022
|
|
|
2117
2023
|
// src/Table/TableColumnHeader.tsx
|
|
2118
|
-
import React51, { useRef as
|
|
2024
|
+
import React51, { useRef as useRef14 } from "react";
|
|
2119
2025
|
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
2120
2026
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
2121
2027
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
@@ -2136,7 +2042,7 @@ var SortIndicator = ({
|
|
|
2136
2042
|
}, direction === "ascending" ? "\u25B2" : "\u25BC");
|
|
2137
2043
|
var TableColumnHeader = ({ column }) => {
|
|
2138
2044
|
var _a, _b;
|
|
2139
|
-
const ref =
|
|
2045
|
+
const ref = useRef14(null);
|
|
2140
2046
|
const { state, styles } = useTableContext();
|
|
2141
2047
|
const { columnHeaderProps } = useTableColumnHeader({
|
|
2142
2048
|
node: column
|
|
@@ -2147,12 +2053,14 @@ var TableColumnHeader = ({ column }) => {
|
|
|
2147
2053
|
hover: isHovered,
|
|
2148
2054
|
focusVisible: isFocusVisible
|
|
2149
2055
|
});
|
|
2150
|
-
return /* @__PURE__ */ React51.createElement(Box28,
|
|
2056
|
+
return /* @__PURE__ */ React51.createElement(Box28, {
|
|
2151
2057
|
as: "th",
|
|
2152
2058
|
colSpan: column.colspan,
|
|
2153
2059
|
ref,
|
|
2154
|
-
css: styles.header
|
|
2155
|
-
|
|
2060
|
+
css: styles.header,
|
|
2061
|
+
...mergeProps11(columnHeaderProps, hoverProps, focusProps),
|
|
2062
|
+
...stateProps
|
|
2063
|
+
}, column.rendered, column.props.allowsSorting && /* @__PURE__ */ React51.createElement(SortIndicator, {
|
|
2156
2064
|
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
2157
2065
|
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
2158
2066
|
}));
|
|
@@ -2163,30 +2071,33 @@ import React52 from "react";
|
|
|
2163
2071
|
import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
|
|
2164
2072
|
var TableHeader = ({ children }) => {
|
|
2165
2073
|
const { rowGroupProps } = useTableRowGroup2();
|
|
2166
|
-
return /* @__PURE__ */ React52.createElement("thead",
|
|
2074
|
+
return /* @__PURE__ */ React52.createElement("thead", {
|
|
2075
|
+
...rowGroupProps
|
|
2076
|
+
}, children);
|
|
2167
2077
|
};
|
|
2168
2078
|
|
|
2169
2079
|
// src/Table/TableHeaderRow.tsx
|
|
2170
|
-
import React53, { useRef as
|
|
2080
|
+
import React53, { useRef as useRef15 } from "react";
|
|
2171
2081
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
2172
2082
|
var TableHeaderRow = ({ item, children }) => {
|
|
2173
2083
|
const { state } = useTableContext();
|
|
2174
|
-
const ref =
|
|
2084
|
+
const ref = useRef15(null);
|
|
2175
2085
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
2176
|
-
return /* @__PURE__ */ React53.createElement("tr",
|
|
2086
|
+
return /* @__PURE__ */ React53.createElement("tr", {
|
|
2087
|
+
...rowProps,
|
|
2177
2088
|
ref
|
|
2178
|
-
}
|
|
2089
|
+
}, children);
|
|
2179
2090
|
};
|
|
2180
2091
|
|
|
2181
2092
|
// src/Table/TableRow.tsx
|
|
2182
|
-
import React54, { useRef as
|
|
2093
|
+
import React54, { useRef as useRef16 } from "react";
|
|
2183
2094
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
2184
2095
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2185
2096
|
import { useTableRow } from "@react-aria/table";
|
|
2186
2097
|
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
2187
2098
|
import { Box as Box29, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2188
2099
|
var TableRow = ({ children, row }) => {
|
|
2189
|
-
const ref =
|
|
2100
|
+
const ref = useRef16(null);
|
|
2190
2101
|
const { state, styles } = useTableContext();
|
|
2191
2102
|
const { rowProps, isPressed } = useTableRow({
|
|
2192
2103
|
node: row
|
|
@@ -2202,15 +2113,17 @@ var TableRow = ({ children, row }) => {
|
|
|
2202
2113
|
focusVisible: isFocusVisible,
|
|
2203
2114
|
active: isPressed
|
|
2204
2115
|
});
|
|
2205
|
-
return /* @__PURE__ */ React54.createElement(Box29,
|
|
2116
|
+
return /* @__PURE__ */ React54.createElement(Box29, {
|
|
2206
2117
|
as: "tr",
|
|
2207
2118
|
ref,
|
|
2208
|
-
css: styles.row
|
|
2209
|
-
|
|
2119
|
+
css: styles.row,
|
|
2120
|
+
...mergeProps12(rowProps, focusProps, hoverProps),
|
|
2121
|
+
...stateProps
|
|
2122
|
+
}, children);
|
|
2210
2123
|
};
|
|
2211
2124
|
|
|
2212
2125
|
// src/Table/TableSelectAllCell.tsx
|
|
2213
|
-
import React55, { useRef as
|
|
2126
|
+
import React55, { useRef as useRef17 } from "react";
|
|
2214
2127
|
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
2215
2128
|
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2216
2129
|
import {
|
|
@@ -2220,7 +2133,7 @@ import {
|
|
|
2220
2133
|
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2221
2134
|
import { Box as Box30, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2222
2135
|
var TableSelectAllCell = ({ column }) => {
|
|
2223
|
-
const ref =
|
|
2136
|
+
const ref = useRef17(null);
|
|
2224
2137
|
const { state, styles } = useTableContext();
|
|
2225
2138
|
const { columnHeaderProps } = useTableColumnHeader2({
|
|
2226
2139
|
node: column
|
|
@@ -2232,7 +2145,7 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2232
2145
|
hover: isHovered,
|
|
2233
2146
|
focusVisible: isFocusVisible
|
|
2234
2147
|
});
|
|
2235
|
-
return /* @__PURE__ */ React55.createElement(Box30,
|
|
2148
|
+
return /* @__PURE__ */ React55.createElement(Box30, {
|
|
2236
2149
|
as: "th",
|
|
2237
2150
|
ref,
|
|
2238
2151
|
__baseCSS: {
|
|
@@ -2240,44 +2153,46 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2240
2153
|
verticalAlign: "middle",
|
|
2241
2154
|
lineHeight: 1
|
|
2242
2155
|
},
|
|
2243
|
-
css: styles.header
|
|
2244
|
-
|
|
2156
|
+
css: styles.header,
|
|
2157
|
+
...mergeProps13(columnHeaderProps, hoverProps, focusProps),
|
|
2158
|
+
...stateProps
|
|
2159
|
+
}, /* @__PURE__ */ React55.createElement(Checkbox, {
|
|
2160
|
+
...checkboxProps
|
|
2161
|
+
}));
|
|
2245
2162
|
};
|
|
2246
2163
|
|
|
2247
2164
|
// src/Table/Table.tsx
|
|
2248
|
-
var Table = (
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
]);
|
|
2258
|
-
const tableRef = useRef21(null);
|
|
2259
|
-
const state = useTableState(__spreadProps(__spreadValues({}, props), {
|
|
2165
|
+
var Table = ({
|
|
2166
|
+
variant,
|
|
2167
|
+
size,
|
|
2168
|
+
stretch,
|
|
2169
|
+
...props
|
|
2170
|
+
}) => {
|
|
2171
|
+
const tableRef = useRef18(null);
|
|
2172
|
+
const state = useTableState({
|
|
2173
|
+
...props,
|
|
2260
2174
|
showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
|
|
2261
|
-
})
|
|
2175
|
+
});
|
|
2262
2176
|
const { gridProps } = useTable(props, state, tableRef);
|
|
2263
2177
|
const styles = useComponentStyles27("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
|
|
2264
2178
|
const { collection } = state;
|
|
2265
2179
|
return /* @__PURE__ */ React56.createElement(TableContext.Provider, {
|
|
2266
2180
|
value: { state, styles }
|
|
2267
|
-
}, /* @__PURE__ */ React56.createElement(Box31,
|
|
2181
|
+
}, /* @__PURE__ */ React56.createElement(Box31, {
|
|
2268
2182
|
as: "table",
|
|
2269
2183
|
ref: tableRef,
|
|
2270
2184
|
__baseCSS: {
|
|
2271
2185
|
borderCollapse: "collapse",
|
|
2272
2186
|
width: stretch ? "100%" : void 0
|
|
2273
2187
|
},
|
|
2274
|
-
css: styles.table
|
|
2275
|
-
|
|
2188
|
+
css: styles.table,
|
|
2189
|
+
...gridProps
|
|
2190
|
+
}, /* @__PURE__ */ React56.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React56.createElement(TableHeaderRow, {
|
|
2276
2191
|
key: headerRow.key,
|
|
2277
2192
|
item: headerRow
|
|
2278
2193
|
}, [...headerRow.childNodes].map((column) => {
|
|
2279
|
-
var
|
|
2280
|
-
return ((
|
|
2194
|
+
var _a;
|
|
2195
|
+
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableSelectAllCell, {
|
|
2281
2196
|
key: column.key,
|
|
2282
2197
|
column
|
|
2283
2198
|
}) : /* @__PURE__ */ React56.createElement(TableColumnHeader, {
|
|
@@ -2288,8 +2203,8 @@ var Table = (_a) => {
|
|
|
2288
2203
|
key: row.key,
|
|
2289
2204
|
row
|
|
2290
2205
|
}, [...row.childNodes].map((cell) => {
|
|
2291
|
-
var
|
|
2292
|
-
return ((
|
|
2206
|
+
var _a;
|
|
2207
|
+
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableCheckboxCell, {
|
|
2293
2208
|
key: cell.key,
|
|
2294
2209
|
cell
|
|
2295
2210
|
}) : /* @__PURE__ */ React56.createElement(TableCell, {
|
|
@@ -2310,76 +2225,60 @@ import {
|
|
|
2310
2225
|
useComponentStyles as useComponentStyles28
|
|
2311
2226
|
} from "@marigold/system";
|
|
2312
2227
|
import { Box as Box32 } from "@marigold/system";
|
|
2313
|
-
var Text = (
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
"variant",
|
|
2325
|
-
"size",
|
|
2326
|
-
"align",
|
|
2327
|
-
"color",
|
|
2328
|
-
"fontSize",
|
|
2329
|
-
"cursor",
|
|
2330
|
-
"outline",
|
|
2331
|
-
"children"
|
|
2332
|
-
]);
|
|
2228
|
+
var Text = ({
|
|
2229
|
+
variant,
|
|
2230
|
+
size,
|
|
2231
|
+
align,
|
|
2232
|
+
color,
|
|
2233
|
+
fontSize,
|
|
2234
|
+
cursor,
|
|
2235
|
+
outline,
|
|
2236
|
+
children,
|
|
2237
|
+
...props
|
|
2238
|
+
}) => {
|
|
2333
2239
|
const styles = useComponentStyles28("Text", {
|
|
2334
2240
|
variant,
|
|
2335
2241
|
size
|
|
2336
2242
|
});
|
|
2337
|
-
return /* @__PURE__ */ React57.createElement(Box32,
|
|
2338
|
-
as: "p"
|
|
2339
|
-
|
|
2340
|
-
css:
|
|
2341
|
-
}
|
|
2243
|
+
return /* @__PURE__ */ React57.createElement(Box32, {
|
|
2244
|
+
as: "p",
|
|
2245
|
+
...props,
|
|
2246
|
+
css: { color, cursor, outline, fontSize, textAlign: align, ...styles }
|
|
2247
|
+
}, children);
|
|
2342
2248
|
};
|
|
2343
2249
|
|
|
2344
2250
|
// src/TextArea/TextArea.tsx
|
|
2345
|
-
import React58, {
|
|
2251
|
+
import React58, { forwardRef as forwardRef12 } from "react";
|
|
2252
|
+
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
2253
|
+
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
2346
2254
|
import { useTextField } from "@react-aria/textfield";
|
|
2255
|
+
import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
|
|
2347
2256
|
import {
|
|
2348
2257
|
Box as Box33,
|
|
2349
2258
|
useComponentStyles as useComponentStyles29,
|
|
2350
2259
|
useStateProps as useStateProps16
|
|
2351
2260
|
} from "@marigold/system";
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
rows
|
|
2364
|
-
} = _b, props = __objRest(_b, [
|
|
2365
|
-
"variant",
|
|
2366
|
-
"size",
|
|
2367
|
-
"width",
|
|
2368
|
-
"disabled",
|
|
2369
|
-
"required",
|
|
2370
|
-
"readOnly",
|
|
2371
|
-
"error",
|
|
2372
|
-
"rows"
|
|
2373
|
-
]);
|
|
2261
|
+
var TextArea = forwardRef12(({
|
|
2262
|
+
variant,
|
|
2263
|
+
size,
|
|
2264
|
+
width,
|
|
2265
|
+
disabled,
|
|
2266
|
+
required,
|
|
2267
|
+
readOnly,
|
|
2268
|
+
error,
|
|
2269
|
+
rows,
|
|
2270
|
+
...props
|
|
2271
|
+
}, ref) => {
|
|
2374
2272
|
const { label, description, errorMessage } = props;
|
|
2375
|
-
const
|
|
2376
|
-
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(
|
|
2273
|
+
const textAreaRef = useObjectRef9(ref);
|
|
2274
|
+
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField({
|
|
2377
2275
|
inputElementType: "textarea",
|
|
2378
2276
|
isDisabled: disabled,
|
|
2379
2277
|
isRequired: required,
|
|
2380
2278
|
isReadOnly: readOnly,
|
|
2381
|
-
validationState: error ? "invalid" : "valid"
|
|
2382
|
-
|
|
2279
|
+
validationState: error ? "invalid" : "valid",
|
|
2280
|
+
...props
|
|
2281
|
+
}, textAreaRef);
|
|
2383
2282
|
const { hoverProps, isHovered } = useHover8({});
|
|
2384
2283
|
const { focusProps, isFocusVisible } = useFocusRing14();
|
|
2385
2284
|
const stateProps = useStateProps16({
|
|
@@ -2403,46 +2302,35 @@ var TextArea = (_a) => {
|
|
|
2403
2302
|
variant,
|
|
2404
2303
|
size,
|
|
2405
2304
|
width
|
|
2406
|
-
}, /* @__PURE__ */ React58.createElement(Box33,
|
|
2305
|
+
}, /* @__PURE__ */ React58.createElement(Box33, {
|
|
2407
2306
|
as: "textarea",
|
|
2408
2307
|
css: styles,
|
|
2409
|
-
ref,
|
|
2410
|
-
rows
|
|
2411
|
-
|
|
2412
|
-
|
|
2308
|
+
ref: textAreaRef,
|
|
2309
|
+
rows,
|
|
2310
|
+
...inputProps,
|
|
2311
|
+
...focusProps,
|
|
2312
|
+
...hoverProps,
|
|
2313
|
+
...stateProps
|
|
2314
|
+
}));
|
|
2315
|
+
});
|
|
2413
2316
|
|
|
2414
2317
|
// src/TextField/TextField.tsx
|
|
2415
|
-
import React59, {
|
|
2318
|
+
import React59, { forwardRef as forwardRef13 } from "react";
|
|
2416
2319
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
2417
2320
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
2418
2321
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
2322
|
+
import { useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
2419
2323
|
import { useStateProps as useStateProps17 } from "@marigold/system";
|
|
2420
|
-
var TextField = (
|
|
2421
|
-
var _b = _a, {
|
|
2422
|
-
variant,
|
|
2423
|
-
size,
|
|
2424
|
-
width,
|
|
2425
|
-
disabled,
|
|
2426
|
-
required,
|
|
2427
|
-
readOnly,
|
|
2428
|
-
error
|
|
2429
|
-
} = _b, props = __objRest(_b, [
|
|
2430
|
-
"variant",
|
|
2431
|
-
"size",
|
|
2432
|
-
"width",
|
|
2433
|
-
"disabled",
|
|
2434
|
-
"required",
|
|
2435
|
-
"readOnly",
|
|
2436
|
-
"error"
|
|
2437
|
-
]);
|
|
2324
|
+
var TextField = forwardRef13(({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
|
|
2438
2325
|
const { label, description, errorMessage, autoFocus } = props;
|
|
2439
|
-
const
|
|
2440
|
-
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(
|
|
2326
|
+
const inputRef = useObjectRef10(ref);
|
|
2327
|
+
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2({
|
|
2441
2328
|
isDisabled: disabled,
|
|
2442
2329
|
isRequired: required,
|
|
2443
2330
|
isReadOnly: readOnly,
|
|
2444
|
-
validationState: error ? "invalid" : "valid"
|
|
2445
|
-
|
|
2331
|
+
validationState: error ? "invalid" : "valid",
|
|
2332
|
+
...props
|
|
2333
|
+
}, inputRef);
|
|
2446
2334
|
const { hoverProps, isHovered } = useHover9({});
|
|
2447
2335
|
const { focusProps, isFocusVisible } = useFocusRing15({
|
|
2448
2336
|
isTextInput: true,
|
|
@@ -2468,26 +2356,28 @@ var TextField = (_a) => {
|
|
|
2468
2356
|
variant,
|
|
2469
2357
|
size,
|
|
2470
2358
|
width
|
|
2471
|
-
}, /* @__PURE__ */ React59.createElement(Input,
|
|
2472
|
-
ref,
|
|
2359
|
+
}, /* @__PURE__ */ React59.createElement(Input, {
|
|
2360
|
+
ref: inputRef,
|
|
2473
2361
|
variant,
|
|
2474
|
-
size
|
|
2475
|
-
|
|
2476
|
-
|
|
2362
|
+
size,
|
|
2363
|
+
...inputProps,
|
|
2364
|
+
...focusProps,
|
|
2365
|
+
...hoverProps,
|
|
2366
|
+
...stateProps
|
|
2367
|
+
}));
|
|
2368
|
+
});
|
|
2477
2369
|
|
|
2478
2370
|
// src/Tiles/Tiles.tsx
|
|
2479
2371
|
import React60 from "react";
|
|
2480
|
-
var Tiles = React60.forwardRef((
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
}, props), children);
|
|
2490
|
-
});
|
|
2372
|
+
var Tiles = React60.forwardRef(({ space = "none", itemMinWidth = "250px", children, ...props }, ref) => /* @__PURE__ */ React60.createElement(Box, {
|
|
2373
|
+
ref,
|
|
2374
|
+
display: "grid",
|
|
2375
|
+
__baseCSS: {
|
|
2376
|
+
gap: space,
|
|
2377
|
+
gridTemplateColumns: `repeat(auto-fit, minmax(min(${itemMinWidth}, 100%), 1fr))`
|
|
2378
|
+
},
|
|
2379
|
+
...props
|
|
2380
|
+
}, children));
|
|
2491
2381
|
|
|
2492
2382
|
// src/Tooltip/Tooltip.tsx
|
|
2493
2383
|
import React62 from "react";
|
|
@@ -2503,34 +2393,29 @@ var TooltipContext = createContext7({});
|
|
|
2503
2393
|
var useTooltipContext = () => useContext7(TooltipContext);
|
|
2504
2394
|
|
|
2505
2395
|
// src/Tooltip/TooltipTrigger.tsx
|
|
2506
|
-
import React61, { useRef as
|
|
2396
|
+
import React61, { useRef as useRef19 } from "react";
|
|
2507
2397
|
import { FocusableProvider } from "@react-aria/focus";
|
|
2508
2398
|
import { useOverlayPosition as useOverlayPosition3 } from "@react-aria/overlays";
|
|
2509
2399
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
2510
2400
|
import { useTooltipTriggerState } from "@react-stately/tooltip";
|
|
2511
|
-
var TooltipTrigger = (
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
"disabled",
|
|
2520
|
-
"open",
|
|
2521
|
-
"delay",
|
|
2522
|
-
"placement",
|
|
2523
|
-
"children"
|
|
2524
|
-
]);
|
|
2401
|
+
var TooltipTrigger = ({
|
|
2402
|
+
disabled,
|
|
2403
|
+
open,
|
|
2404
|
+
delay = 1e3,
|
|
2405
|
+
placement = "top",
|
|
2406
|
+
children,
|
|
2407
|
+
...rest
|
|
2408
|
+
}) => {
|
|
2525
2409
|
const [tooltipTrigger, tooltip] = React61.Children.toArray(children);
|
|
2526
|
-
const props =
|
|
2410
|
+
const props = {
|
|
2411
|
+
...rest,
|
|
2527
2412
|
isDisabled: disabled,
|
|
2528
2413
|
isOpen: open,
|
|
2529
2414
|
delay,
|
|
2530
2415
|
placement
|
|
2531
|
-
}
|
|
2532
|
-
const tooltipTriggerRef =
|
|
2533
|
-
const overlayRef =
|
|
2416
|
+
};
|
|
2417
|
+
const tooltipTriggerRef = useRef19(null);
|
|
2418
|
+
const overlayRef = useRef19(null);
|
|
2534
2419
|
const state = useTooltipTriggerState(props);
|
|
2535
2420
|
const { triggerProps, tooltipProps } = useTooltipTrigger(props, state, tooltipTriggerRef);
|
|
2536
2421
|
const {
|
|
@@ -2545,15 +2430,18 @@ var TooltipTrigger = (_a) => {
|
|
|
2545
2430
|
isOpen: state.isOpen,
|
|
2546
2431
|
overlayRef
|
|
2547
2432
|
});
|
|
2548
|
-
return /* @__PURE__ */ React61.createElement(FocusableProvider,
|
|
2549
|
-
ref: tooltipTriggerRef
|
|
2550
|
-
|
|
2551
|
-
|
|
2433
|
+
return /* @__PURE__ */ React61.createElement(FocusableProvider, {
|
|
2434
|
+
ref: tooltipTriggerRef,
|
|
2435
|
+
...triggerProps
|
|
2436
|
+
}, tooltipTrigger, /* @__PURE__ */ React61.createElement(TooltipContext.Provider, {
|
|
2437
|
+
value: {
|
|
2552
2438
|
state,
|
|
2553
2439
|
overlayRef,
|
|
2554
2440
|
arrowProps,
|
|
2555
|
-
placement: overlayPlacement
|
|
2556
|
-
|
|
2441
|
+
placement: overlayPlacement,
|
|
2442
|
+
...tooltipProps,
|
|
2443
|
+
...positionProps
|
|
2444
|
+
}
|
|
2557
2445
|
}, /* @__PURE__ */ React61.createElement(Overlay, {
|
|
2558
2446
|
open: state.isOpen
|
|
2559
2447
|
}, tooltip)));
|
|
@@ -2561,14 +2449,17 @@ var TooltipTrigger = (_a) => {
|
|
|
2561
2449
|
|
|
2562
2450
|
// src/Tooltip/Tooltip.tsx
|
|
2563
2451
|
var Tooltip = ({ children, variant, size }) => {
|
|
2564
|
-
const
|
|
2452
|
+
const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
|
|
2565
2453
|
const { tooltipProps } = useTooltip({}, state);
|
|
2566
2454
|
const styles = useComponentStyles30("Tooltip", { variant, size }, { parts: ["container", "arrow"] });
|
|
2567
|
-
return /* @__PURE__ */ React62.createElement(Box34,
|
|
2455
|
+
return /* @__PURE__ */ React62.createElement(Box34, {
|
|
2456
|
+
...tooltipProps,
|
|
2457
|
+
...rest,
|
|
2568
2458
|
ref: overlayRef,
|
|
2569
2459
|
css: styles.container,
|
|
2570
2460
|
"data-placement": placement
|
|
2571
|
-
}
|
|
2461
|
+
}, /* @__PURE__ */ React62.createElement("div", null, children), /* @__PURE__ */ React62.createElement(Box34, {
|
|
2462
|
+
...arrowProps,
|
|
2572
2463
|
__baseCSS: {
|
|
2573
2464
|
position: "absolute",
|
|
2574
2465
|
height: 0,
|
|
@@ -2579,7 +2470,7 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
2579
2470
|
borderBottomColor: "transparent"
|
|
2580
2471
|
},
|
|
2581
2472
|
css: styles.arrow
|
|
2582
|
-
}))
|
|
2473
|
+
}));
|
|
2583
2474
|
};
|
|
2584
2475
|
Tooltip.Trigger = TooltipTrigger;
|
|
2585
2476
|
export {
|