@marigold/components 1.2.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +37 -15
- package/dist/index.js +1316 -1025
- package/dist/index.mjs +1298 -1014
- package/package.json +48 -48
package/dist/index.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
|
|
23
26
|
// src/index.ts
|
|
@@ -47,6 +50,7 @@ __export(src_exports, {
|
|
|
47
50
|
Input: () => Input,
|
|
48
51
|
Label: () => Label,
|
|
49
52
|
Link: () => Link,
|
|
53
|
+
List: () => List,
|
|
50
54
|
MarigoldProvider: () => MarigoldProvider,
|
|
51
55
|
Menu: () => Menu,
|
|
52
56
|
Message: () => Message,
|
|
@@ -64,16 +68,21 @@ __export(src_exports, {
|
|
|
64
68
|
Text: () => Text,
|
|
65
69
|
TextArea: () => TextArea,
|
|
66
70
|
TextField: () => TextField,
|
|
67
|
-
ThemeProvider: () =>
|
|
71
|
+
ThemeProvider: () => import_system29.ThemeProvider,
|
|
68
72
|
Tiles: () => Tiles,
|
|
69
73
|
Tooltip: () => Tooltip,
|
|
70
74
|
Underlay: () => Underlay,
|
|
71
75
|
VisuallyHidden: () => import_visually_hidden.VisuallyHidden,
|
|
76
|
+
useAsyncList: () => import_data.useAsyncList,
|
|
72
77
|
useCheckboxGroupContext: () => useCheckboxGroupContext,
|
|
73
|
-
|
|
78
|
+
useListData: () => import_data.useListData,
|
|
79
|
+
useTheme: () => import_system29.useTheme
|
|
74
80
|
});
|
|
75
81
|
module.exports = __toCommonJS(src_exports);
|
|
76
82
|
|
|
83
|
+
// src/hooks.ts
|
|
84
|
+
var import_data = require("@react-stately/data");
|
|
85
|
+
|
|
77
86
|
// src/Aside/Aside.tsx
|
|
78
87
|
var import_react = __toESM(require("react"));
|
|
79
88
|
|
|
@@ -176,43 +185,70 @@ var Breakout = ({
|
|
|
176
185
|
var import_react5 = __toESM(require("react"));
|
|
177
186
|
var import_button = require("@react-aria/button");
|
|
178
187
|
var import_focus = require("@react-aria/focus");
|
|
188
|
+
var import_interactions = require("@react-aria/interactions");
|
|
179
189
|
var import_utils = require("@react-aria/utils");
|
|
180
190
|
var import_system3 = require("@marigold/system");
|
|
181
|
-
var Button = (0, import_react5.forwardRef)(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
191
|
+
var Button = (0, import_react5.forwardRef)(
|
|
192
|
+
({
|
|
193
|
+
as = "button",
|
|
194
|
+
children,
|
|
195
|
+
variant,
|
|
196
|
+
size,
|
|
197
|
+
disabled,
|
|
198
|
+
onClick,
|
|
199
|
+
onPress,
|
|
200
|
+
onPressStart,
|
|
201
|
+
onPressEnd,
|
|
202
|
+
onPressChange,
|
|
203
|
+
onPressUp,
|
|
204
|
+
fullWidth,
|
|
205
|
+
...props
|
|
206
|
+
}, ref) => {
|
|
207
|
+
const buttonRef = (0, import_utils.useObjectRef)(ref);
|
|
208
|
+
const { hoverProps, isHovered } = (0, import_interactions.useHover)({ isDisabled: disabled });
|
|
209
|
+
const { isFocusVisible, focusProps } = (0, import_focus.useFocusRing)({
|
|
210
|
+
autoFocus: props.autoFocus
|
|
211
|
+
});
|
|
212
|
+
const { buttonProps, isPressed } = (0, import_button.useButton)(
|
|
213
|
+
{
|
|
214
|
+
...props,
|
|
215
|
+
onClick,
|
|
216
|
+
onPress,
|
|
217
|
+
onPressStart,
|
|
218
|
+
onPressEnd,
|
|
219
|
+
onPressChange,
|
|
220
|
+
onPressUp,
|
|
221
|
+
elementType: typeof as === "string" ? as : "span",
|
|
222
|
+
isDisabled: disabled
|
|
223
|
+
},
|
|
224
|
+
buttonRef
|
|
225
|
+
);
|
|
226
|
+
const styles = (0, import_system3.useComponentStyles)("Button", { variant, size });
|
|
227
|
+
const stateProps = (0, import_system3.useStateProps)({
|
|
228
|
+
active: isPressed,
|
|
229
|
+
focusVisible: isFocusVisible,
|
|
230
|
+
hover: isHovered
|
|
231
|
+
});
|
|
232
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_system3.Box, {
|
|
233
|
+
...(0, import_utils.mergeProps)(buttonProps, focusProps, hoverProps, props),
|
|
234
|
+
...stateProps,
|
|
235
|
+
as,
|
|
236
|
+
ref: buttonRef,
|
|
237
|
+
__baseCSS: {
|
|
238
|
+
display: "inline-flex",
|
|
239
|
+
alignItems: "center",
|
|
240
|
+
justifyContent: "center",
|
|
241
|
+
gap: "0.5ch",
|
|
242
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
243
|
+
width: fullWidth ? "100%" : void 0,
|
|
244
|
+
"&:focus": {
|
|
245
|
+
outline: 0
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
css: styles
|
|
249
|
+
}, children);
|
|
250
|
+
}
|
|
251
|
+
);
|
|
216
252
|
|
|
217
253
|
// src/Card/Card.tsx
|
|
218
254
|
var import_react6 = __toESM(require("react"));
|
|
@@ -250,7 +286,7 @@ var Center = ({
|
|
|
250
286
|
var import_react10 = __toESM(require("react"));
|
|
251
287
|
var import_checkbox3 = require("@react-aria/checkbox");
|
|
252
288
|
var import_focus2 = require("@react-aria/focus");
|
|
253
|
-
var
|
|
289
|
+
var import_interactions2 = require("@react-aria/interactions");
|
|
254
290
|
var import_utils2 = require("@react-aria/utils");
|
|
255
291
|
var import_toggle = require("@react-stately/toggle");
|
|
256
292
|
var import_system7 = require("@marigold/system");
|
|
@@ -287,7 +323,9 @@ var Label = ({
|
|
|
287
323
|
};
|
|
288
324
|
|
|
289
325
|
// src/Checkbox/CheckboxGroup.tsx
|
|
290
|
-
var CheckboxGroupContext = (0, import_react9.createContext)(
|
|
326
|
+
var CheckboxGroupContext = (0, import_react9.createContext)(
|
|
327
|
+
null
|
|
328
|
+
);
|
|
291
329
|
var useCheckboxGroupContext = () => (0, import_react9.useContext)(CheckboxGroupContext);
|
|
292
330
|
var CheckboxGroup = ({
|
|
293
331
|
children,
|
|
@@ -308,7 +346,11 @@ var CheckboxGroup = ({
|
|
|
308
346
|
};
|
|
309
347
|
const state = (0, import_checkbox2.useCheckboxGroupState)(props);
|
|
310
348
|
const { groupProps, labelProps } = (0, import_checkbox.useCheckboxGroup)(props, state);
|
|
311
|
-
const styles = (0, import_system6.useComponentStyles)(
|
|
349
|
+
const styles = (0, import_system6.useComponentStyles)(
|
|
350
|
+
"CheckboxGroup",
|
|
351
|
+
{ variant, size },
|
|
352
|
+
{ parts: ["container", "group"] }
|
|
353
|
+
);
|
|
312
354
|
return /* @__PURE__ */ import_react9.default.createElement(import_system6.Box, {
|
|
313
355
|
...groupProps,
|
|
314
356
|
css: styles.container
|
|
@@ -362,92 +404,107 @@ var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ import
|
|
|
362
404
|
css,
|
|
363
405
|
...props
|
|
364
406
|
}, indeterminate ? /* @__PURE__ */ import_react10.default.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ import_react10.default.createElement(CheckMark, null) : null);
|
|
365
|
-
var Checkbox = (0, import_react10.forwardRef)(
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
readOnly,
|
|
373
|
-
required,
|
|
374
|
-
error,
|
|
375
|
-
...props
|
|
376
|
-
}, ref) => {
|
|
377
|
-
const inputRef = (0, import_utils2.useObjectRef)(ref);
|
|
378
|
-
const checkboxProps = {
|
|
379
|
-
isIndeterminate: indeterminate,
|
|
380
|
-
isDisabled: disabled,
|
|
381
|
-
isReadOnly: readOnly,
|
|
382
|
-
isRequired: required,
|
|
383
|
-
validationState: error ? "invalid" : "valid"
|
|
384
|
-
};
|
|
385
|
-
const groupState = useCheckboxGroupContext();
|
|
386
|
-
const { inputProps } = groupState ? (0, import_checkbox3.useCheckboxGroupItem)({
|
|
387
|
-
...props,
|
|
388
|
-
...checkboxProps,
|
|
389
|
-
value: props.value
|
|
390
|
-
}, groupState, inputRef) : (0, import_checkbox3.useCheckbox)({
|
|
391
|
-
isSelected: checked,
|
|
392
|
-
defaultSelected: defaultChecked,
|
|
393
|
-
...checkboxProps,
|
|
394
|
-
...props
|
|
395
|
-
}, (0, import_toggle.useToggleState)({
|
|
396
|
-
isSelected: checked,
|
|
397
|
-
defaultSelected: defaultChecked,
|
|
398
|
-
...props
|
|
399
|
-
}), inputRef);
|
|
400
|
-
const styles = (0, import_system7.useComponentStyles)("Checkbox", {
|
|
401
|
-
variant: (groupState == null ? void 0 : groupState.variant) || variant,
|
|
402
|
-
size: (groupState == null ? void 0 : groupState.size) || size
|
|
403
|
-
}, { parts: ["container", "label", "checkbox"] });
|
|
404
|
-
const { hoverProps, isHovered } = (0, import_interactions.useHover)({});
|
|
405
|
-
const { isFocusVisible, focusProps } = (0, import_focus2.useFocusRing)();
|
|
406
|
-
const stateProps = (0, import_system7.useStateProps)({
|
|
407
|
-
hover: isHovered,
|
|
408
|
-
focus: isFocusVisible,
|
|
409
|
-
checked: inputProps.checked,
|
|
410
|
-
disabled: inputProps.disabled,
|
|
411
|
-
error: (groupState == null ? void 0 : groupState.error) || error,
|
|
412
|
-
readOnly,
|
|
413
|
-
indeterminate
|
|
414
|
-
});
|
|
415
|
-
return /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, {
|
|
416
|
-
as: "label",
|
|
417
|
-
__baseCSS: {
|
|
418
|
-
display: "flex",
|
|
419
|
-
alignItems: "center",
|
|
420
|
-
gap: "1ch",
|
|
421
|
-
position: "relative"
|
|
422
|
-
},
|
|
423
|
-
css: styles.container,
|
|
424
|
-
...hoverProps,
|
|
425
|
-
...stateProps
|
|
426
|
-
}, /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, {
|
|
427
|
-
as: "input",
|
|
428
|
-
ref: inputRef,
|
|
429
|
-
css: {
|
|
430
|
-
position: "absolute",
|
|
431
|
-
width: "100%",
|
|
432
|
-
height: "100%",
|
|
433
|
-
top: 0,
|
|
434
|
-
left: 0,
|
|
435
|
-
zIndex: 1,
|
|
436
|
-
opacity: 1e-4,
|
|
437
|
-
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
438
|
-
},
|
|
439
|
-
...inputProps,
|
|
440
|
-
...focusProps
|
|
441
|
-
}), /* @__PURE__ */ import_react10.default.createElement(Icon, {
|
|
442
|
-
checked: inputProps.checked,
|
|
407
|
+
var Checkbox = (0, import_react10.forwardRef)(
|
|
408
|
+
({
|
|
409
|
+
size,
|
|
410
|
+
variant,
|
|
411
|
+
disabled,
|
|
412
|
+
checked,
|
|
413
|
+
defaultChecked,
|
|
443
414
|
indeterminate,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
415
|
+
readOnly,
|
|
416
|
+
required,
|
|
417
|
+
error,
|
|
418
|
+
...props
|
|
419
|
+
}, ref) => {
|
|
420
|
+
const inputRef = (0, import_utils2.useObjectRef)(ref);
|
|
421
|
+
const checkboxProps = {
|
|
422
|
+
isIndeterminate: indeterminate,
|
|
423
|
+
isDisabled: disabled,
|
|
424
|
+
isReadOnly: readOnly,
|
|
425
|
+
isRequired: required,
|
|
426
|
+
validationState: error ? "invalid" : "valid"
|
|
427
|
+
};
|
|
428
|
+
const groupState = useCheckboxGroupContext();
|
|
429
|
+
const { inputProps } = groupState ? (0, import_checkbox3.useCheckboxGroupItem)(
|
|
430
|
+
{
|
|
431
|
+
...props,
|
|
432
|
+
...checkboxProps,
|
|
433
|
+
value: props.value
|
|
434
|
+
},
|
|
435
|
+
groupState,
|
|
436
|
+
inputRef
|
|
437
|
+
) : (0, import_checkbox3.useCheckbox)(
|
|
438
|
+
{
|
|
439
|
+
isSelected: checked,
|
|
440
|
+
defaultSelected: defaultChecked,
|
|
441
|
+
...checkboxProps,
|
|
442
|
+
...props
|
|
443
|
+
},
|
|
444
|
+
(0, import_toggle.useToggleState)({
|
|
445
|
+
isSelected: checked,
|
|
446
|
+
defaultSelected: defaultChecked,
|
|
447
|
+
isReadOnly: readOnly,
|
|
448
|
+
...props
|
|
449
|
+
}),
|
|
450
|
+
inputRef
|
|
451
|
+
);
|
|
452
|
+
const styles = (0, import_system7.useComponentStyles)(
|
|
453
|
+
"Checkbox",
|
|
454
|
+
{
|
|
455
|
+
variant: (groupState == null ? void 0 : groupState.variant) || variant,
|
|
456
|
+
size: (groupState == null ? void 0 : groupState.size) || size
|
|
457
|
+
},
|
|
458
|
+
{ parts: ["container", "label", "checkbox"] }
|
|
459
|
+
);
|
|
460
|
+
const { hoverProps, isHovered } = (0, import_interactions2.useHover)({});
|
|
461
|
+
const { isFocusVisible, focusProps } = (0, import_focus2.useFocusRing)();
|
|
462
|
+
const stateProps = (0, import_system7.useStateProps)({
|
|
463
|
+
hover: isHovered,
|
|
464
|
+
focus: isFocusVisible,
|
|
465
|
+
checked: inputProps.checked,
|
|
466
|
+
disabled: inputProps.disabled,
|
|
467
|
+
error: (groupState == null ? void 0 : groupState.error) || error,
|
|
468
|
+
readOnly,
|
|
469
|
+
indeterminate
|
|
470
|
+
});
|
|
471
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, {
|
|
472
|
+
as: "label",
|
|
473
|
+
__baseCSS: {
|
|
474
|
+
display: "flex",
|
|
475
|
+
alignItems: "center",
|
|
476
|
+
gap: "1ch",
|
|
477
|
+
position: "relative"
|
|
478
|
+
},
|
|
479
|
+
css: styles.container,
|
|
480
|
+
...hoverProps,
|
|
481
|
+
...stateProps
|
|
482
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, {
|
|
483
|
+
as: "input",
|
|
484
|
+
ref: inputRef,
|
|
485
|
+
css: {
|
|
486
|
+
position: "absolute",
|
|
487
|
+
width: "100%",
|
|
488
|
+
height: "100%",
|
|
489
|
+
top: 0,
|
|
490
|
+
left: 0,
|
|
491
|
+
zIndex: 1,
|
|
492
|
+
opacity: 1e-4,
|
|
493
|
+
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
494
|
+
},
|
|
495
|
+
...inputProps,
|
|
496
|
+
...focusProps
|
|
497
|
+
}), /* @__PURE__ */ import_react10.default.createElement(Icon, {
|
|
498
|
+
checked: inputProps.checked,
|
|
499
|
+
indeterminate,
|
|
500
|
+
css: styles.checkbox,
|
|
501
|
+
...stateProps
|
|
502
|
+
}), props.children && /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, {
|
|
503
|
+
css: styles.label,
|
|
504
|
+
...stateProps
|
|
505
|
+
}, props.children));
|
|
506
|
+
}
|
|
507
|
+
);
|
|
451
508
|
|
|
452
509
|
// src/Columns/Columns.tsx
|
|
453
510
|
var import_react11 = __toESM(require("react"));
|
|
@@ -459,7 +516,11 @@ var Columns = ({
|
|
|
459
516
|
...props
|
|
460
517
|
}) => {
|
|
461
518
|
if (import_react11.Children.count(children) !== columns.length) {
|
|
462
|
-
throw new Error(
|
|
519
|
+
throw new Error(
|
|
520
|
+
`Columns: expected ${columns.length} children, got ${import_react11.Children.count(
|
|
521
|
+
children
|
|
522
|
+
)}`
|
|
523
|
+
);
|
|
463
524
|
}
|
|
464
525
|
const getColumnWidths = columns.map((column, index) => {
|
|
465
526
|
return {
|
|
@@ -470,13 +531,16 @@ var Columns = ({
|
|
|
470
531
|
});
|
|
471
532
|
return /* @__PURE__ */ import_react11.default.createElement(import_system.Box, {
|
|
472
533
|
display: "flex",
|
|
473
|
-
css: Object.assign(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
534
|
+
css: Object.assign(
|
|
535
|
+
{
|
|
536
|
+
flexWrap: "wrap",
|
|
537
|
+
gap: space,
|
|
538
|
+
"> *": {
|
|
539
|
+
flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
...getColumnWidths
|
|
543
|
+
),
|
|
480
544
|
...props
|
|
481
545
|
}, children);
|
|
482
546
|
};
|
|
@@ -584,7 +648,7 @@ var useDialogContext = () => (0, import_react16.useContext)(DialogContext);
|
|
|
584
648
|
|
|
585
649
|
// src/Dialog/DialogTrigger.tsx
|
|
586
650
|
var import_react21 = __toESM(require("react"));
|
|
587
|
-
var
|
|
651
|
+
var import_interactions3 = require("@react-aria/interactions");
|
|
588
652
|
var import_overlays4 = require("@react-stately/overlays");
|
|
589
653
|
|
|
590
654
|
// src/Overlay/Modal.tsx
|
|
@@ -610,38 +674,43 @@ var Underlay = ({ size, variant, ...props }) => {
|
|
|
610
674
|
};
|
|
611
675
|
|
|
612
676
|
// src/Overlay/Modal.tsx
|
|
613
|
-
var Modal = (0, import_react18.forwardRef)(
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
677
|
+
var Modal = (0, import_react18.forwardRef)(
|
|
678
|
+
({ children, open, dismissable, keyboardDismissable, onClose, ...props }, ref) => {
|
|
679
|
+
const modalRef = (0, import_utils3.useObjectRef)(ref);
|
|
680
|
+
const { overlayProps, underlayProps } = (0, import_overlays.useOverlay)(
|
|
681
|
+
{
|
|
682
|
+
isOpen: open,
|
|
683
|
+
onClose,
|
|
684
|
+
isDismissable: dismissable,
|
|
685
|
+
isKeyboardDismissDisabled: !keyboardDismissable
|
|
686
|
+
},
|
|
687
|
+
modalRef
|
|
688
|
+
);
|
|
689
|
+
(0, import_overlays.usePreventScroll)();
|
|
690
|
+
const { modalProps } = (0, import_overlays.useModal)({});
|
|
691
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_focus3.FocusScope, {
|
|
692
|
+
contain: true,
|
|
693
|
+
restoreFocus: true,
|
|
694
|
+
autoFocus: true
|
|
695
|
+
}, /* @__PURE__ */ import_react18.default.createElement(Underlay, {
|
|
696
|
+
...underlayProps
|
|
697
|
+
}), /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
698
|
+
style: {
|
|
699
|
+
display: "flex",
|
|
700
|
+
alignItems: "center",
|
|
701
|
+
justifyContent: "center",
|
|
702
|
+
position: "fixed",
|
|
703
|
+
inset: 0,
|
|
704
|
+
zIndex: 2,
|
|
705
|
+
pointerEvents: "none"
|
|
706
|
+
},
|
|
707
|
+
ref: modalRef,
|
|
708
|
+
...(0, import_utils3.mergeProps)(props, overlayProps, modalProps)
|
|
709
|
+
}, /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
710
|
+
style: { pointerEvents: "auto" }
|
|
711
|
+
}, children)));
|
|
712
|
+
}
|
|
713
|
+
);
|
|
645
714
|
|
|
646
715
|
// src/Overlay/Overlay.tsx
|
|
647
716
|
var import_react19 = __toESM(require("react"));
|
|
@@ -666,34 +735,39 @@ var Overlay = ({
|
|
|
666
735
|
var import_react20 = __toESM(require("react"));
|
|
667
736
|
var import_overlays3 = require("@react-aria/overlays");
|
|
668
737
|
var import_utils4 = require("@react-aria/utils");
|
|
669
|
-
var Popover = (0, import_react20.forwardRef)(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
minWidth = 0,
|
|
676
|
-
...props
|
|
677
|
-
}, ref) => {
|
|
678
|
-
const fallbackRef = (0, import_react20.useRef)(null);
|
|
679
|
-
const popoverRef = ref || fallbackRef;
|
|
680
|
-
const { overlayProps } = (0, import_overlays3.useOverlay)({
|
|
681
|
-
isOpen: open,
|
|
682
|
-
isDismissable: dismissable,
|
|
683
|
-
isKeyboardDismissDisabled: keyboardDismissDisabled,
|
|
738
|
+
var Popover = (0, import_react20.forwardRef)(
|
|
739
|
+
({
|
|
740
|
+
children,
|
|
741
|
+
open,
|
|
742
|
+
dismissable,
|
|
743
|
+
keyboardDismissDisabled,
|
|
684
744
|
shouldCloseOnBlur,
|
|
745
|
+
minWidth = 0,
|
|
685
746
|
...props
|
|
686
|
-
},
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
747
|
+
}, ref) => {
|
|
748
|
+
const fallbackRef = (0, import_react20.useRef)(null);
|
|
749
|
+
const popoverRef = ref || fallbackRef;
|
|
750
|
+
const { overlayProps } = (0, import_overlays3.useOverlay)(
|
|
751
|
+
{
|
|
752
|
+
isOpen: open,
|
|
753
|
+
isDismissable: dismissable,
|
|
754
|
+
isKeyboardDismissDisabled: keyboardDismissDisabled,
|
|
755
|
+
shouldCloseOnBlur,
|
|
756
|
+
...props
|
|
757
|
+
},
|
|
758
|
+
popoverRef
|
|
759
|
+
);
|
|
760
|
+
const { modalProps } = (0, import_overlays3.useModal)({});
|
|
761
|
+
const style = { minWidth };
|
|
762
|
+
return /* @__PURE__ */ import_react20.default.createElement(Overlay, {
|
|
763
|
+
open
|
|
764
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_system.Box, {
|
|
765
|
+
ref: popoverRef,
|
|
766
|
+
role: "presentation",
|
|
767
|
+
...(0, import_utils4.mergeProps)(props, overlayProps, modalProps, style)
|
|
768
|
+
}, children));
|
|
769
|
+
}
|
|
770
|
+
);
|
|
697
771
|
|
|
698
772
|
// src/Dialog/DialogTrigger.tsx
|
|
699
773
|
var DialogTrigger = ({
|
|
@@ -707,7 +781,7 @@ var DialogTrigger = ({
|
|
|
707
781
|
const ctx = { open: state.isOpen, close: state.close };
|
|
708
782
|
return /* @__PURE__ */ import_react21.default.createElement(DialogContext.Provider, {
|
|
709
783
|
value: ctx
|
|
710
|
-
}, /* @__PURE__ */ import_react21.default.createElement(
|
|
784
|
+
}, /* @__PURE__ */ import_react21.default.createElement(import_interactions3.PressResponder, {
|
|
711
785
|
ref: dialogTriggerRef,
|
|
712
786
|
isPressed: state.isOpen,
|
|
713
787
|
onPress: state.toggle
|
|
@@ -725,9 +799,12 @@ var DialogTrigger = ({
|
|
|
725
799
|
var CloseButton = ({ css }) => {
|
|
726
800
|
const ref = (0, import_react22.useRef)(null);
|
|
727
801
|
const { close } = useDialogContext();
|
|
728
|
-
const { buttonProps } = (0, import_button2.useButton)(
|
|
729
|
-
|
|
730
|
-
|
|
802
|
+
const { buttonProps } = (0, import_button2.useButton)(
|
|
803
|
+
{
|
|
804
|
+
onPress: () => close == null ? void 0 : close()
|
|
805
|
+
},
|
|
806
|
+
ref
|
|
807
|
+
);
|
|
731
808
|
return /* @__PURE__ */ import_react22.default.createElement(import_system12.Box, {
|
|
732
809
|
css: { display: "flex", justifyContent: "flex-end" }
|
|
733
810
|
}, /* @__PURE__ */ import_react22.default.createElement(import_system12.Box, {
|
|
@@ -755,12 +832,19 @@ var CloseButton = ({ css }) => {
|
|
|
755
832
|
};
|
|
756
833
|
var addTitleProps = (children, titleProps) => {
|
|
757
834
|
const childs = import_react22.default.Children.toArray(children);
|
|
758
|
-
const titleIndex = childs.findIndex(
|
|
835
|
+
const titleIndex = childs.findIndex(
|
|
836
|
+
(child) => import_react22.default.isValidElement(child) && (child.type === Header || child.type === Headline)
|
|
837
|
+
);
|
|
759
838
|
if (titleIndex < 0) {
|
|
760
|
-
console.warn(
|
|
839
|
+
console.warn(
|
|
840
|
+
"No child in <Dialog> found that can act as title for accessibility. Please add a <Header> or <Headline> as direct child."
|
|
841
|
+
);
|
|
761
842
|
return children;
|
|
762
843
|
}
|
|
763
|
-
const titleChild = import_react22.default.cloneElement(
|
|
844
|
+
const titleChild = import_react22.default.cloneElement(
|
|
845
|
+
childs[titleIndex],
|
|
846
|
+
titleProps
|
|
847
|
+
);
|
|
764
848
|
childs.splice(titleIndex, 1, titleChild);
|
|
765
849
|
return childs;
|
|
766
850
|
};
|
|
@@ -774,7 +858,11 @@ var Dialog = ({
|
|
|
774
858
|
const ref = (0, import_react22.useRef)(null);
|
|
775
859
|
const { close } = useDialogContext();
|
|
776
860
|
const { dialogProps, titleProps } = (0, import_dialog.useDialog)(props, ref);
|
|
777
|
-
const styles = (0, import_system12.useComponentStyles)(
|
|
861
|
+
const styles = (0, import_system12.useComponentStyles)(
|
|
862
|
+
"Dialog",
|
|
863
|
+
{ variant, size },
|
|
864
|
+
{ parts: ["container", "closeButton"] }
|
|
865
|
+
);
|
|
778
866
|
return /* @__PURE__ */ import_react22.default.createElement(import_system12.Box, {
|
|
779
867
|
__baseCSS: { bg: "#fff" },
|
|
780
868
|
css: styles.container,
|
|
@@ -814,12 +902,24 @@ var Footer = ({ children, variant, size, ...props }) => {
|
|
|
814
902
|
// src/Image/Image.tsx
|
|
815
903
|
var import_react25 = __toESM(require("react"));
|
|
816
904
|
var import_system15 = require("@marigold/system");
|
|
817
|
-
var
|
|
818
|
-
|
|
819
|
-
|
|
905
|
+
var import_system16 = require("@marigold/system");
|
|
906
|
+
var Image = ({
|
|
907
|
+
variant,
|
|
908
|
+
size,
|
|
909
|
+
fit,
|
|
910
|
+
position,
|
|
911
|
+
...props
|
|
912
|
+
}) => {
|
|
913
|
+
const styles = (0, import_system16.useComponentStyles)("Image", { variant, size });
|
|
914
|
+
const css = {
|
|
915
|
+
...styles,
|
|
916
|
+
objectFit: fit,
|
|
917
|
+
objectPosition: position
|
|
918
|
+
};
|
|
919
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_system15.Box, {
|
|
820
920
|
...props,
|
|
821
921
|
as: "img",
|
|
822
|
-
css
|
|
922
|
+
css
|
|
823
923
|
});
|
|
824
924
|
};
|
|
825
925
|
|
|
@@ -854,72 +954,130 @@ var Inline = ({
|
|
|
854
954
|
|
|
855
955
|
// src/Input/Input.tsx
|
|
856
956
|
var import_react27 = __toESM(require("react"));
|
|
857
|
-
var
|
|
858
|
-
var Input = (0, import_react27.forwardRef)(
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
});
|
|
957
|
+
var import_system17 = require("@marigold/system");
|
|
958
|
+
var Input = (0, import_react27.forwardRef)(
|
|
959
|
+
({ variant, size, type = "text", ...props }, ref) => {
|
|
960
|
+
const styles = (0, import_system17.useComponentStyles)("Input", { variant, size });
|
|
961
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_system17.Box, {
|
|
962
|
+
...props,
|
|
963
|
+
ref,
|
|
964
|
+
as: "input",
|
|
965
|
+
type,
|
|
966
|
+
css: styles
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
);
|
|
868
970
|
|
|
869
971
|
// src/Link/Link.tsx
|
|
870
972
|
var import_react28 = __toESM(require("react"));
|
|
871
973
|
var import_link = require("@react-aria/link");
|
|
872
|
-
var
|
|
873
|
-
var
|
|
874
|
-
|
|
974
|
+
var import_system18 = require("@marigold/system");
|
|
975
|
+
var import_utils5 = require("@react-aria/utils");
|
|
976
|
+
var Link = (0, import_react28.forwardRef)(
|
|
977
|
+
({
|
|
978
|
+
as = "a",
|
|
979
|
+
variant,
|
|
980
|
+
size,
|
|
981
|
+
children,
|
|
982
|
+
disabled,
|
|
983
|
+
onPress,
|
|
984
|
+
onPressStart,
|
|
985
|
+
...props
|
|
986
|
+
}, ref) => {
|
|
987
|
+
const linkRef = (0, import_utils5.useObjectRef)(ref);
|
|
988
|
+
const { linkProps } = (0, import_link.useLink)(
|
|
989
|
+
{
|
|
990
|
+
...props,
|
|
991
|
+
elementType: typeof as === "string" ? as : "span",
|
|
992
|
+
isDisabled: disabled
|
|
993
|
+
},
|
|
994
|
+
linkRef
|
|
995
|
+
);
|
|
996
|
+
const styles = (0, import_system18.useComponentStyles)("Link", { variant, size });
|
|
997
|
+
return /* @__PURE__ */ import_react28.default.createElement(import_system.Box, {
|
|
998
|
+
as,
|
|
999
|
+
css: styles,
|
|
1000
|
+
ref: linkRef,
|
|
1001
|
+
...props,
|
|
1002
|
+
...linkProps
|
|
1003
|
+
}, children);
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
1006
|
+
|
|
1007
|
+
// src/List/List.tsx
|
|
1008
|
+
var import_react31 = __toESM(require("react"));
|
|
1009
|
+
var import_system20 = require("@marigold/system");
|
|
1010
|
+
|
|
1011
|
+
// src/List/Context.ts
|
|
1012
|
+
var import_react29 = require("react");
|
|
1013
|
+
var ListContext = (0, import_react29.createContext)({});
|
|
1014
|
+
var useListContext = () => (0, import_react29.useContext)(ListContext);
|
|
1015
|
+
|
|
1016
|
+
// src/List/ListItem.tsx
|
|
1017
|
+
var import_react30 = __toESM(require("react"));
|
|
1018
|
+
var import_system19 = require("@marigold/system");
|
|
1019
|
+
var ListItem = ({ children, ...props }) => {
|
|
1020
|
+
const { styles } = useListContext();
|
|
1021
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_system19.Box, {
|
|
1022
|
+
...props,
|
|
1023
|
+
as: "li",
|
|
1024
|
+
css: styles
|
|
1025
|
+
}, children);
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
// src/List/List.tsx
|
|
1029
|
+
var List = ({
|
|
1030
|
+
as = "ul",
|
|
1031
|
+
children,
|
|
875
1032
|
variant,
|
|
876
1033
|
size,
|
|
877
|
-
children,
|
|
878
|
-
disabled,
|
|
879
1034
|
...props
|
|
880
1035
|
}) => {
|
|
881
|
-
const
|
|
882
|
-
|
|
1036
|
+
const styles = (0, import_system20.useComponentStyles)(
|
|
1037
|
+
"List",
|
|
1038
|
+
{ variant, size },
|
|
1039
|
+
{ parts: ["ul", "ol", "item"] }
|
|
1040
|
+
);
|
|
1041
|
+
return /* @__PURE__ */ import_react31.default.createElement(import_system20.Box, {
|
|
883
1042
|
...props,
|
|
884
|
-
elementType: typeof as === "string" ? as : "span",
|
|
885
|
-
isDisabled: disabled
|
|
886
|
-
}, ref);
|
|
887
|
-
const styles = (0, import_system17.useComponentStyles)("Link", { variant, size });
|
|
888
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_system.Box, {
|
|
889
1043
|
as,
|
|
890
|
-
css: styles
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
}, children);
|
|
1044
|
+
css: styles[as]
|
|
1045
|
+
}, /* @__PURE__ */ import_react31.default.createElement(ListContext.Provider, {
|
|
1046
|
+
value: { styles: styles.item }
|
|
1047
|
+
}, children));
|
|
895
1048
|
};
|
|
1049
|
+
List.Item = ListItem;
|
|
896
1050
|
|
|
897
1051
|
// src/Menu/Menu.tsx
|
|
898
|
-
var
|
|
1052
|
+
var import_react35 = __toESM(require("react"));
|
|
899
1053
|
var import_focus5 = require("@react-aria/focus");
|
|
900
1054
|
var import_menu4 = require("@react-aria/menu");
|
|
901
1055
|
var import_overlays6 = require("@react-aria/overlays");
|
|
902
1056
|
var import_collections = require("@react-stately/collections");
|
|
903
1057
|
var import_tree = require("@react-stately/tree");
|
|
904
|
-
var
|
|
1058
|
+
var import_system22 = require("@marigold/system");
|
|
905
1059
|
|
|
906
1060
|
// src/Menu/Context.ts
|
|
907
|
-
var
|
|
908
|
-
var MenuContext = (0,
|
|
909
|
-
var useMenuContext = () => (0,
|
|
1061
|
+
var import_react32 = require("react");
|
|
1062
|
+
var MenuContext = (0, import_react32.createContext)({});
|
|
1063
|
+
var useMenuContext = () => (0, import_react32.useContext)(MenuContext);
|
|
910
1064
|
|
|
911
1065
|
// src/Menu/MenuTrigger.tsx
|
|
912
|
-
var
|
|
1066
|
+
var import_react33 = __toESM(require("react"));
|
|
913
1067
|
var import_menu = require("@react-stately/menu");
|
|
914
1068
|
var import_menu2 = require("@react-aria/menu");
|
|
915
1069
|
var import_overlays5 = require("@react-aria/overlays");
|
|
916
|
-
var
|
|
1070
|
+
var import_interactions4 = require("@react-aria/interactions");
|
|
917
1071
|
var MenuTrigger = ({ disabled, children }) => {
|
|
918
|
-
const [menuTrigger, menu] =
|
|
919
|
-
const menuTriggerRef = (0,
|
|
920
|
-
const overlayRef = (0,
|
|
1072
|
+
const [menuTrigger, menu] = import_react33.default.Children.toArray(children);
|
|
1073
|
+
const menuTriggerRef = (0, import_react33.useRef)(null);
|
|
1074
|
+
const overlayRef = (0, import_react33.useRef)(null);
|
|
921
1075
|
const state = (0, import_menu.useMenuTriggerState)({});
|
|
922
|
-
const { menuTriggerProps, menuProps } = (0, import_menu2.useMenuTrigger)(
|
|
1076
|
+
const { menuTriggerProps, menuProps } = (0, import_menu2.useMenuTrigger)(
|
|
1077
|
+
{ trigger: "press", isDisabled: disabled },
|
|
1078
|
+
state,
|
|
1079
|
+
menuTriggerRef
|
|
1080
|
+
);
|
|
923
1081
|
const { overlayProps: positionProps } = (0, import_overlays5.useOverlayPosition)({
|
|
924
1082
|
targetRef: menuTriggerRef,
|
|
925
1083
|
overlayRef,
|
|
@@ -932,13 +1090,13 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
932
1090
|
autoFocus: state.focusStrategy,
|
|
933
1091
|
triggerWidth: menuTriggerRef.current ? menuTriggerRef.current.offsetWidth : void 0
|
|
934
1092
|
};
|
|
935
|
-
return /* @__PURE__ */
|
|
1093
|
+
return /* @__PURE__ */ import_react33.default.createElement(MenuContext.Provider, {
|
|
936
1094
|
value: menuContext
|
|
937
|
-
}, /* @__PURE__ */
|
|
1095
|
+
}, /* @__PURE__ */ import_react33.default.createElement(import_interactions4.PressResponder, {
|
|
938
1096
|
...menuTriggerProps,
|
|
939
1097
|
ref: menuTriggerRef,
|
|
940
1098
|
isPressed: state.isOpen
|
|
941
|
-
}, menuTrigger), /* @__PURE__ */
|
|
1099
|
+
}, menuTrigger), /* @__PURE__ */ import_react33.default.createElement(Popover, {
|
|
942
1100
|
open: state.isOpen,
|
|
943
1101
|
onClose: state.close,
|
|
944
1102
|
dismissable: true,
|
|
@@ -949,24 +1107,28 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
949
1107
|
};
|
|
950
1108
|
|
|
951
1109
|
// src/Menu/MenuItem.tsx
|
|
952
|
-
var
|
|
1110
|
+
var import_react34 = __toESM(require("react"));
|
|
953
1111
|
var import_focus4 = require("@react-aria/focus");
|
|
954
1112
|
var import_menu3 = require("@react-aria/menu");
|
|
955
|
-
var
|
|
956
|
-
var
|
|
1113
|
+
var import_utils6 = require("@react-aria/utils");
|
|
1114
|
+
var import_system21 = require("@marigold/system");
|
|
957
1115
|
var MenuItem = ({ item, state, onAction, css }) => {
|
|
958
|
-
const ref = (0,
|
|
1116
|
+
const ref = (0, import_react34.useRef)(null);
|
|
959
1117
|
const { onClose } = useMenuContext();
|
|
960
|
-
const { menuItemProps } = (0, import_menu3.useMenuItem)(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1118
|
+
const { menuItemProps } = (0, import_menu3.useMenuItem)(
|
|
1119
|
+
{
|
|
1120
|
+
key: item.key,
|
|
1121
|
+
onAction,
|
|
1122
|
+
onClose
|
|
1123
|
+
},
|
|
1124
|
+
state,
|
|
1125
|
+
ref
|
|
1126
|
+
);
|
|
965
1127
|
const { isFocusVisible, focusProps } = (0, import_focus4.useFocusRing)();
|
|
966
|
-
const stateProps = (0,
|
|
1128
|
+
const stateProps = (0, import_system21.useStateProps)({
|
|
967
1129
|
focus: isFocusVisible
|
|
968
1130
|
});
|
|
969
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_system21.Box, {
|
|
970
1132
|
as: "li",
|
|
971
1133
|
ref,
|
|
972
1134
|
__baseCSS: {
|
|
@@ -975,7 +1137,7 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
975
1137
|
}
|
|
976
1138
|
},
|
|
977
1139
|
css,
|
|
978
|
-
...(0,
|
|
1140
|
+
...(0, import_utils6.mergeProps)(menuItemProps, focusProps),
|
|
979
1141
|
...stateProps
|
|
980
1142
|
}, item.rendered);
|
|
981
1143
|
};
|
|
@@ -984,15 +1146,19 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
984
1146
|
var Menu = ({ variant, size, ...props }) => {
|
|
985
1147
|
const { triggerWidth, ...menuContext } = useMenuContext();
|
|
986
1148
|
const ownProps = { ...props, ...menuContext };
|
|
987
|
-
const ref = (0,
|
|
1149
|
+
const ref = (0, import_react35.useRef)(null);
|
|
988
1150
|
const state = (0, import_tree.useTreeState)({ ...ownProps, selectionMode: "none" });
|
|
989
1151
|
const { menuProps } = (0, import_menu4.useMenu)(ownProps, state, ref);
|
|
990
|
-
const styles = (0,
|
|
991
|
-
|
|
1152
|
+
const styles = (0, import_system22.useComponentStyles)(
|
|
1153
|
+
"Menu",
|
|
1154
|
+
{ variant, size },
|
|
1155
|
+
{ parts: ["container", "item"] }
|
|
1156
|
+
);
|
|
1157
|
+
return /* @__PURE__ */ import_react35.default.createElement(import_focus5.FocusScope, {
|
|
992
1158
|
restoreFocus: true
|
|
993
|
-
}, /* @__PURE__ */
|
|
1159
|
+
}, /* @__PURE__ */ import_react35.default.createElement("div", null, /* @__PURE__ */ import_react35.default.createElement(import_overlays6.DismissButton, {
|
|
994
1160
|
onDismiss: ownProps.onClose
|
|
995
|
-
}), /* @__PURE__ */
|
|
1161
|
+
}), /* @__PURE__ */ import_react35.default.createElement(import_system22.Box, {
|
|
996
1162
|
as: "ul",
|
|
997
1163
|
ref,
|
|
998
1164
|
style: { width: triggerWidth },
|
|
@@ -1003,13 +1169,13 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
1003
1169
|
},
|
|
1004
1170
|
css: styles.container,
|
|
1005
1171
|
...menuProps
|
|
1006
|
-
}, [...state.collection].map((item) => /* @__PURE__ */
|
|
1172
|
+
}, [...state.collection].map((item) => /* @__PURE__ */ import_react35.default.createElement(MenuItem, {
|
|
1007
1173
|
key: item.key,
|
|
1008
1174
|
item,
|
|
1009
1175
|
state,
|
|
1010
1176
|
onAction: props.onSelect,
|
|
1011
1177
|
css: styles.item
|
|
1012
|
-
}))), /* @__PURE__ */
|
|
1178
|
+
}))), /* @__PURE__ */ import_react35.default.createElement(import_overlays6.DismissButton, {
|
|
1013
1179
|
onDismiss: ownProps.onClose
|
|
1014
1180
|
})));
|
|
1015
1181
|
};
|
|
@@ -1017,9 +1183,9 @@ Menu.Trigger = MenuTrigger;
|
|
|
1017
1183
|
Menu.Item = import_collections.Item;
|
|
1018
1184
|
|
|
1019
1185
|
// src/Message/Message.tsx
|
|
1020
|
-
var
|
|
1186
|
+
var import_react36 = __toESM(require("react"));
|
|
1021
1187
|
var import_icons2 = require("@marigold/icons");
|
|
1022
|
-
var
|
|
1188
|
+
var import_system23 = require("@marigold/system");
|
|
1023
1189
|
var Message = ({
|
|
1024
1190
|
messageTitle,
|
|
1025
1191
|
variant = "info",
|
|
@@ -1027,50 +1193,54 @@ var Message = ({
|
|
|
1027
1193
|
children,
|
|
1028
1194
|
...props
|
|
1029
1195
|
}) => {
|
|
1030
|
-
const styles = (0,
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1196
|
+
const styles = (0, import_system23.useComponentStyles)(
|
|
1197
|
+
"Message",
|
|
1198
|
+
{
|
|
1199
|
+
variant,
|
|
1200
|
+
size
|
|
1201
|
+
},
|
|
1202
|
+
{ parts: ["container", "icon", "title", "content"] }
|
|
1203
|
+
);
|
|
1204
|
+
var icon = /* @__PURE__ */ import_react36.default.createElement(import_icons2.Info, null);
|
|
1035
1205
|
if (variant === "warning") {
|
|
1036
|
-
icon = /* @__PURE__ */
|
|
1206
|
+
icon = /* @__PURE__ */ import_react36.default.createElement(import_icons2.Notification, null);
|
|
1037
1207
|
}
|
|
1038
1208
|
if (variant === "error") {
|
|
1039
|
-
icon = /* @__PURE__ */
|
|
1209
|
+
icon = /* @__PURE__ */ import_react36.default.createElement(import_icons2.Exclamation, null);
|
|
1040
1210
|
}
|
|
1041
|
-
return /* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ import_react36.default.createElement(import_system.Box, {
|
|
1042
1212
|
css: styles.container,
|
|
1043
1213
|
...props
|
|
1044
|
-
}, /* @__PURE__ */
|
|
1214
|
+
}, /* @__PURE__ */ import_react36.default.createElement(import_system.Box, {
|
|
1045
1215
|
__baseCSS: { display: "flex", alignItems: "center", gap: 4 }
|
|
1046
|
-
}, /* @__PURE__ */
|
|
1216
|
+
}, /* @__PURE__ */ import_react36.default.createElement(import_system.Box, {
|
|
1047
1217
|
role: "presentation",
|
|
1048
1218
|
css: styles.icon
|
|
1049
|
-
}, icon), /* @__PURE__ */
|
|
1219
|
+
}, icon), /* @__PURE__ */ import_react36.default.createElement(import_system.Box, {
|
|
1050
1220
|
css: styles.title
|
|
1051
|
-
}, messageTitle)), /* @__PURE__ */
|
|
1221
|
+
}, messageTitle)), /* @__PURE__ */ import_react36.default.createElement(import_system.Box, {
|
|
1052
1222
|
css: styles.content
|
|
1053
1223
|
}, children));
|
|
1054
1224
|
};
|
|
1055
1225
|
|
|
1056
1226
|
// src/NumberField/NumberField.tsx
|
|
1057
|
-
var
|
|
1227
|
+
var import_react40 = __toESM(require("react"));
|
|
1058
1228
|
var import_focus6 = require("@react-aria/focus");
|
|
1059
|
-
var
|
|
1229
|
+
var import_interactions6 = require("@react-aria/interactions");
|
|
1060
1230
|
var import_i18n = require("@react-aria/i18n");
|
|
1061
1231
|
var import_numberfield = require("@react-aria/numberfield");
|
|
1062
|
-
var
|
|
1232
|
+
var import_utils8 = require("@react-aria/utils");
|
|
1063
1233
|
var import_numberfield2 = require("@react-stately/numberfield");
|
|
1064
|
-
var
|
|
1234
|
+
var import_system27 = require("@marigold/system");
|
|
1065
1235
|
|
|
1066
1236
|
// src/FieldBase/FieldBase.tsx
|
|
1067
|
-
var
|
|
1068
|
-
var
|
|
1237
|
+
var import_react38 = __toESM(require("react"));
|
|
1238
|
+
var import_system25 = require("@marigold/system");
|
|
1069
1239
|
|
|
1070
1240
|
// src/HelpText/HelpText.tsx
|
|
1071
|
-
var
|
|
1241
|
+
var import_react37 = __toESM(require("react"));
|
|
1072
1242
|
var import_icons3 = require("@marigold/icons");
|
|
1073
|
-
var
|
|
1243
|
+
var import_system24 = require("@marigold/system");
|
|
1074
1244
|
var HelpText = ({
|
|
1075
1245
|
variant,
|
|
1076
1246
|
size,
|
|
@@ -1084,16 +1254,20 @@ var HelpText = ({
|
|
|
1084
1254
|
}) => {
|
|
1085
1255
|
var _a;
|
|
1086
1256
|
const hasErrorMessage = errorMessage && error;
|
|
1087
|
-
const styles = (0,
|
|
1088
|
-
|
|
1257
|
+
const styles = (0, import_system24.useComponentStyles)(
|
|
1258
|
+
"HelpText",
|
|
1259
|
+
{ variant, size },
|
|
1260
|
+
{ parts: ["container", "icon"] }
|
|
1261
|
+
);
|
|
1262
|
+
return /* @__PURE__ */ import_react37.default.createElement(import_system24.Box, {
|
|
1089
1263
|
...hasErrorMessage ? errorMessageProps : descriptionProps,
|
|
1090
1264
|
...props,
|
|
1091
1265
|
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
1092
1266
|
css: styles.container
|
|
1093
|
-
}, hasErrorMessage ? /* @__PURE__ */
|
|
1267
|
+
}, hasErrorMessage ? /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(import_icons3.Exclamation, {
|
|
1094
1268
|
role: "presentation",
|
|
1095
1269
|
size: ((_a = styles == null ? void 0 : styles.icon) == null ? void 0 : _a.size) || 16
|
|
1096
|
-
}), errorMessage) : /* @__PURE__ */
|
|
1270
|
+
}), errorMessage) : /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, description));
|
|
1097
1271
|
};
|
|
1098
1272
|
|
|
1099
1273
|
// src/FieldBase/FieldBase.tsx
|
|
@@ -1114,15 +1288,15 @@ var FieldBase = ({
|
|
|
1114
1288
|
stateProps
|
|
1115
1289
|
}) => {
|
|
1116
1290
|
const hasHelpText = !!description || errorMessage && error;
|
|
1117
|
-
return /* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ import_react38.default.createElement(import_system25.Box, {
|
|
1118
1292
|
css: { display: "flex", flexDirection: "column", width }
|
|
1119
|
-
}, label && /* @__PURE__ */
|
|
1293
|
+
}, label && /* @__PURE__ */ import_react38.default.createElement(Label, {
|
|
1120
1294
|
required,
|
|
1121
1295
|
variant,
|
|
1122
1296
|
size,
|
|
1123
1297
|
...labelProps,
|
|
1124
1298
|
...stateProps
|
|
1125
|
-
}, label), children, hasHelpText && /* @__PURE__ */
|
|
1299
|
+
}, label), children, hasHelpText && /* @__PURE__ */ import_react38.default.createElement(HelpText, {
|
|
1126
1300
|
...stateProps,
|
|
1127
1301
|
variant,
|
|
1128
1302
|
size,
|
|
@@ -1136,42 +1310,45 @@ var FieldBase = ({
|
|
|
1136
1310
|
};
|
|
1137
1311
|
|
|
1138
1312
|
// src/NumberField/StepButton.tsx
|
|
1139
|
-
var
|
|
1313
|
+
var import_react39 = __toESM(require("react"));
|
|
1140
1314
|
var import_button3 = require("@react-aria/button");
|
|
1141
|
-
var
|
|
1142
|
-
var
|
|
1143
|
-
var
|
|
1144
|
-
var Plus = () => /* @__PURE__ */
|
|
1315
|
+
var import_interactions5 = require("@react-aria/interactions");
|
|
1316
|
+
var import_utils7 = require("@react-aria/utils");
|
|
1317
|
+
var import_system26 = require("@marigold/system");
|
|
1318
|
+
var Plus = () => /* @__PURE__ */ import_react39.default.createElement(import_system26.Box, {
|
|
1145
1319
|
as: "svg",
|
|
1146
1320
|
__baseCSS: { width: 16, height: 16 },
|
|
1147
1321
|
viewBox: "0 0 20 20",
|
|
1148
1322
|
fill: "currentColor"
|
|
1149
|
-
}, /* @__PURE__ */
|
|
1323
|
+
}, /* @__PURE__ */ import_react39.default.createElement("path", {
|
|
1150
1324
|
fillRule: "evenodd",
|
|
1151
1325
|
clipRule: "evenodd",
|
|
1152
1326
|
d: "M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
|
|
1153
1327
|
}));
|
|
1154
|
-
var Minus = () => /* @__PURE__ */
|
|
1328
|
+
var Minus = () => /* @__PURE__ */ import_react39.default.createElement(import_system26.Box, {
|
|
1155
1329
|
as: "svg",
|
|
1156
1330
|
__baseCSS: { width: 16, height: 16 },
|
|
1157
1331
|
viewBox: "0 0 20 20",
|
|
1158
1332
|
fill: "currentColor"
|
|
1159
|
-
}, /* @__PURE__ */
|
|
1333
|
+
}, /* @__PURE__ */ import_react39.default.createElement("path", {
|
|
1160
1334
|
fillRule: "evenodd",
|
|
1161
1335
|
clipRule: "evenodd",
|
|
1162
1336
|
d: "M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
1163
1337
|
}));
|
|
1164
1338
|
var StepButton = ({ direction, css, ...props }) => {
|
|
1165
|
-
const ref = (0,
|
|
1166
|
-
const { buttonProps, isPressed } = (0, import_button3.useButton)(
|
|
1167
|
-
|
|
1168
|
-
|
|
1339
|
+
const ref = (0, import_react39.useRef)(null);
|
|
1340
|
+
const { buttonProps, isPressed } = (0, import_button3.useButton)(
|
|
1341
|
+
{ ...props, elementType: "div" },
|
|
1342
|
+
ref
|
|
1343
|
+
);
|
|
1344
|
+
const { hoverProps, isHovered } = (0, import_interactions5.useHover)(props);
|
|
1345
|
+
const stateProps = (0, import_system26.useStateProps)({
|
|
1169
1346
|
active: isPressed,
|
|
1170
1347
|
hover: isHovered,
|
|
1171
1348
|
disabled: props.isDisabled
|
|
1172
1349
|
});
|
|
1173
1350
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
1174
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ import_react39.default.createElement(import_system26.Box, {
|
|
1175
1352
|
__baseCSS: {
|
|
1176
1353
|
display: "flex",
|
|
1177
1354
|
alignItems: "center",
|
|
@@ -1179,107 +1356,113 @@ var StepButton = ({ direction, css, ...props }) => {
|
|
|
1179
1356
|
cursor: props.isDisabled ? "not-allowed" : "pointer"
|
|
1180
1357
|
},
|
|
1181
1358
|
css,
|
|
1182
|
-
...(0,
|
|
1359
|
+
...(0, import_utils7.mergeProps)(buttonProps, hoverProps),
|
|
1183
1360
|
...stateProps
|
|
1184
|
-
}, /* @__PURE__ */
|
|
1361
|
+
}, /* @__PURE__ */ import_react39.default.createElement(Icon3, null));
|
|
1185
1362
|
};
|
|
1186
1363
|
|
|
1187
1364
|
// src/NumberField/NumberField.tsx
|
|
1188
|
-
var NumberField = (0,
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
required,
|
|
1194
|
-
readOnly,
|
|
1195
|
-
error,
|
|
1196
|
-
hideStepper,
|
|
1197
|
-
...rest
|
|
1198
|
-
}, ref) => {
|
|
1199
|
-
const props = {
|
|
1200
|
-
isDisabled: disabled,
|
|
1201
|
-
isRequired: required,
|
|
1202
|
-
isReadOnly: readOnly,
|
|
1203
|
-
validationState: error ? "invalid" : "valid",
|
|
1204
|
-
...rest
|
|
1205
|
-
};
|
|
1206
|
-
const showStepper = !hideStepper;
|
|
1207
|
-
const { locale } = (0, import_i18n.useLocale)();
|
|
1208
|
-
const inputRef = (0, import_utils7.useObjectRef)(ref);
|
|
1209
|
-
const state = (0, import_numberfield2.useNumberFieldState)({ ...props, locale });
|
|
1210
|
-
const {
|
|
1211
|
-
labelProps,
|
|
1212
|
-
groupProps,
|
|
1213
|
-
inputProps,
|
|
1214
|
-
descriptionProps,
|
|
1215
|
-
errorMessageProps,
|
|
1216
|
-
incrementButtonProps,
|
|
1217
|
-
decrementButtonProps
|
|
1218
|
-
} = (0, import_numberfield.useNumberField)(props, state, inputRef);
|
|
1219
|
-
const { hoverProps, isHovered } = (0, import_interactions5.useHover)({ isDisabled: disabled });
|
|
1220
|
-
const { focusProps, isFocused } = (0, import_focus6.useFocusRing)({
|
|
1221
|
-
within: true,
|
|
1222
|
-
isTextInput: true,
|
|
1223
|
-
autoFocus: props.autoFocus
|
|
1224
|
-
});
|
|
1225
|
-
const styles = (0, import_system24.useComponentStyles)("NumberField", { variant, size }, { parts: ["group", "stepper"] });
|
|
1226
|
-
const stateProps = (0, import_system24.useStateProps)({
|
|
1227
|
-
hover: isHovered,
|
|
1228
|
-
focus: isFocused,
|
|
1365
|
+
var NumberField = (0, import_react40.forwardRef)(
|
|
1366
|
+
({
|
|
1367
|
+
variant,
|
|
1368
|
+
size,
|
|
1369
|
+
width,
|
|
1229
1370
|
disabled,
|
|
1230
|
-
readOnly,
|
|
1231
|
-
error
|
|
1232
|
-
});
|
|
1233
|
-
return /* @__PURE__ */ import_react37.default.createElement(FieldBase, {
|
|
1234
|
-
label: props.label,
|
|
1235
|
-
labelProps,
|
|
1236
1371
|
required,
|
|
1237
|
-
|
|
1238
|
-
descriptionProps,
|
|
1372
|
+
readOnly,
|
|
1239
1373
|
error,
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1374
|
+
hideStepper,
|
|
1375
|
+
...rest
|
|
1376
|
+
}, ref) => {
|
|
1377
|
+
const props = {
|
|
1378
|
+
isDisabled: disabled,
|
|
1379
|
+
isRequired: required,
|
|
1380
|
+
isReadOnly: readOnly,
|
|
1381
|
+
validationState: error ? "invalid" : "valid",
|
|
1382
|
+
...rest
|
|
1383
|
+
};
|
|
1384
|
+
const showStepper = !hideStepper;
|
|
1385
|
+
const { locale } = (0, import_i18n.useLocale)();
|
|
1386
|
+
const inputRef = (0, import_utils8.useObjectRef)(ref);
|
|
1387
|
+
const state = (0, import_numberfield2.useNumberFieldState)({ ...props, locale });
|
|
1388
|
+
const {
|
|
1389
|
+
labelProps,
|
|
1390
|
+
groupProps,
|
|
1391
|
+
inputProps,
|
|
1392
|
+
descriptionProps,
|
|
1393
|
+
errorMessageProps,
|
|
1394
|
+
incrementButtonProps,
|
|
1395
|
+
decrementButtonProps
|
|
1396
|
+
} = (0, import_numberfield.useNumberField)(props, state, inputRef);
|
|
1397
|
+
const { hoverProps, isHovered } = (0, import_interactions6.useHover)({ isDisabled: disabled });
|
|
1398
|
+
const { focusProps, isFocused } = (0, import_focus6.useFocusRing)({
|
|
1399
|
+
within: true,
|
|
1400
|
+
isTextInput: true,
|
|
1401
|
+
autoFocus: props.autoFocus
|
|
1402
|
+
});
|
|
1403
|
+
const styles = (0, import_system27.useComponentStyles)(
|
|
1404
|
+
"NumberField",
|
|
1405
|
+
{ variant, size },
|
|
1406
|
+
{ parts: ["group", "stepper"] }
|
|
1407
|
+
);
|
|
1408
|
+
const stateProps = (0, import_system27.useStateProps)({
|
|
1409
|
+
hover: isHovered,
|
|
1410
|
+
focus: isFocused,
|
|
1411
|
+
disabled,
|
|
1412
|
+
readOnly,
|
|
1413
|
+
error
|
|
1414
|
+
});
|
|
1415
|
+
return /* @__PURE__ */ import_react40.default.createElement(FieldBase, {
|
|
1416
|
+
label: props.label,
|
|
1417
|
+
labelProps,
|
|
1418
|
+
required,
|
|
1419
|
+
description: props.description,
|
|
1420
|
+
descriptionProps,
|
|
1421
|
+
error,
|
|
1422
|
+
errorMessage: props.errorMessage,
|
|
1423
|
+
errorMessageProps,
|
|
1424
|
+
stateProps,
|
|
1425
|
+
variant,
|
|
1426
|
+
size,
|
|
1427
|
+
width
|
|
1428
|
+
}, /* @__PURE__ */ import_react40.default.createElement(import_system27.Box, {
|
|
1429
|
+
"data-group": true,
|
|
1430
|
+
__baseCSS: {
|
|
1431
|
+
display: "flex",
|
|
1432
|
+
alignItems: "stretch",
|
|
1433
|
+
"> input": {
|
|
1434
|
+
flexGrow: 1
|
|
1435
|
+
}
|
|
1436
|
+
},
|
|
1437
|
+
css: styles.group,
|
|
1438
|
+
...(0, import_utils8.mergeProps)(groupProps, focusProps, hoverProps),
|
|
1439
|
+
...stateProps
|
|
1440
|
+
}, showStepper && /* @__PURE__ */ import_react40.default.createElement(StepButton, {
|
|
1441
|
+
direction: "down",
|
|
1442
|
+
css: styles.stepper,
|
|
1443
|
+
...decrementButtonProps
|
|
1444
|
+
}), /* @__PURE__ */ import_react40.default.createElement(Input, {
|
|
1445
|
+
ref: inputRef,
|
|
1446
|
+
variant,
|
|
1447
|
+
size,
|
|
1448
|
+
...inputProps,
|
|
1449
|
+
...stateProps
|
|
1450
|
+
}), showStepper && /* @__PURE__ */ import_react40.default.createElement(StepButton, {
|
|
1451
|
+
direction: "up",
|
|
1452
|
+
css: styles.stepper,
|
|
1453
|
+
...incrementButtonProps
|
|
1454
|
+
})));
|
|
1455
|
+
}
|
|
1456
|
+
);
|
|
1274
1457
|
|
|
1275
1458
|
// src/Provider/index.ts
|
|
1276
|
-
var
|
|
1459
|
+
var import_system29 = require("@marigold/system");
|
|
1277
1460
|
var import_ssr = require("@react-aria/ssr");
|
|
1278
1461
|
|
|
1279
1462
|
// src/Provider/MarigoldProvider.tsx
|
|
1280
|
-
var
|
|
1463
|
+
var import_react41 = __toESM(require("react"));
|
|
1281
1464
|
var import_overlays7 = require("@react-aria/overlays");
|
|
1282
|
-
var
|
|
1465
|
+
var import_system28 = require("@marigold/system");
|
|
1283
1466
|
function MarigoldProvider({
|
|
1284
1467
|
children,
|
|
1285
1468
|
theme,
|
|
@@ -1287,38 +1470,42 @@ function MarigoldProvider({
|
|
|
1287
1470
|
normalizeDocument = true
|
|
1288
1471
|
}) {
|
|
1289
1472
|
var _a;
|
|
1290
|
-
const outer = (0,
|
|
1291
|
-
const isTopLevel = outer.theme ===
|
|
1473
|
+
const outer = (0, import_system28.useTheme)();
|
|
1474
|
+
const isTopLevel = outer.theme === import_system28.__defaultTheme;
|
|
1292
1475
|
if (((_a = outer.theme) == null ? void 0 : _a.root) && !isTopLevel && !selector) {
|
|
1293
|
-
throw new Error(
|
|
1294
|
-
|
|
1476
|
+
throw new Error(
|
|
1477
|
+
`[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
|
|
1478
|
+
Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`
|
|
1479
|
+
);
|
|
1295
1480
|
}
|
|
1296
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ import_react41.default.createElement(import_system28.ThemeProvider, {
|
|
1297
1482
|
theme
|
|
1298
|
-
}, /* @__PURE__ */
|
|
1483
|
+
}, /* @__PURE__ */ import_react41.default.createElement(import_system28.Global, {
|
|
1299
1484
|
normalizeDocument: isTopLevel && normalizeDocument,
|
|
1300
1485
|
selector
|
|
1301
|
-
}), isTopLevel ? /* @__PURE__ */
|
|
1486
|
+
}), isTopLevel ? /* @__PURE__ */ import_react41.default.createElement(import_overlays7.OverlayProvider, null, children) : children);
|
|
1302
1487
|
}
|
|
1303
1488
|
|
|
1304
1489
|
// src/Radio/Radio.tsx
|
|
1305
|
-
var
|
|
1306
|
-
var
|
|
1490
|
+
var import_react44 = __toESM(require("react"));
|
|
1491
|
+
var import_interactions7 = require("@react-aria/interactions");
|
|
1307
1492
|
var import_focus7 = require("@react-aria/focus");
|
|
1308
1493
|
var import_radio3 = require("@react-aria/radio");
|
|
1309
|
-
var
|
|
1310
|
-
var
|
|
1494
|
+
var import_utils9 = require("@react-aria/utils");
|
|
1495
|
+
var import_system31 = require("@marigold/system");
|
|
1311
1496
|
|
|
1312
1497
|
// src/Radio/Context.ts
|
|
1313
|
-
var
|
|
1314
|
-
var RadioGroupContext = (0,
|
|
1315
|
-
|
|
1498
|
+
var import_react42 = require("react");
|
|
1499
|
+
var RadioGroupContext = (0, import_react42.createContext)(
|
|
1500
|
+
null
|
|
1501
|
+
);
|
|
1502
|
+
var useRadioGroupContext = () => (0, import_react42.useContext)(RadioGroupContext);
|
|
1316
1503
|
|
|
1317
1504
|
// src/Radio/RadioGroup.tsx
|
|
1318
|
-
var
|
|
1505
|
+
var import_react43 = __toESM(require("react"));
|
|
1319
1506
|
var import_radio = require("@react-aria/radio");
|
|
1320
1507
|
var import_radio2 = require("@react-stately/radio");
|
|
1321
|
-
var
|
|
1508
|
+
var import_system30 = require("@marigold/system");
|
|
1322
1509
|
var RadioGroup = ({
|
|
1323
1510
|
children,
|
|
1324
1511
|
orientation = "vertical",
|
|
@@ -1340,15 +1527,19 @@ var RadioGroup = ({
|
|
|
1340
1527
|
};
|
|
1341
1528
|
const state = (0, import_radio2.useRadioGroupState)(props);
|
|
1342
1529
|
const { radioGroupProps, labelProps } = (0, import_radio.useRadioGroup)(props, state);
|
|
1343
|
-
const styles = (0,
|
|
1344
|
-
|
|
1530
|
+
const styles = (0, import_system30.useComponentStyles)(
|
|
1531
|
+
"RadioGroup",
|
|
1532
|
+
{ variant, size },
|
|
1533
|
+
{ parts: ["container", "group"] }
|
|
1534
|
+
);
|
|
1535
|
+
return /* @__PURE__ */ import_react43.default.createElement(import_system30.Box, {
|
|
1345
1536
|
...radioGroupProps,
|
|
1346
1537
|
css: styles.container
|
|
1347
|
-
}, props.label && /* @__PURE__ */
|
|
1538
|
+
}, props.label && /* @__PURE__ */ import_react43.default.createElement(Label, {
|
|
1348
1539
|
as: "span",
|
|
1349
1540
|
required,
|
|
1350
1541
|
...labelProps
|
|
1351
|
-
}, props.label), /* @__PURE__ */
|
|
1542
|
+
}, props.label), /* @__PURE__ */ import_react43.default.createElement(import_system30.Box, {
|
|
1352
1543
|
role: "presentation",
|
|
1353
1544
|
"data-orientation": orientation,
|
|
1354
1545
|
__baseCSS: {
|
|
@@ -1358,21 +1549,21 @@ var RadioGroup = ({
|
|
|
1358
1549
|
gap: orientation === "vertical" ? "0.5ch" : "1.5ch"
|
|
1359
1550
|
},
|
|
1360
1551
|
css: styles.group
|
|
1361
|
-
}, /* @__PURE__ */
|
|
1552
|
+
}, /* @__PURE__ */ import_react43.default.createElement(RadioGroupContext.Provider, {
|
|
1362
1553
|
value: { variant, size, width, error, ...state }
|
|
1363
1554
|
}, children)));
|
|
1364
1555
|
};
|
|
1365
1556
|
|
|
1366
1557
|
// src/Radio/Radio.tsx
|
|
1367
|
-
var Dot = () => /* @__PURE__ */
|
|
1558
|
+
var Dot = () => /* @__PURE__ */ import_react44.default.createElement("svg", {
|
|
1368
1559
|
viewBox: "0 0 6 6"
|
|
1369
|
-
}, /* @__PURE__ */
|
|
1560
|
+
}, /* @__PURE__ */ import_react44.default.createElement("circle", {
|
|
1370
1561
|
fill: "currentColor",
|
|
1371
1562
|
cx: "3",
|
|
1372
1563
|
cy: "3",
|
|
1373
1564
|
r: "3"
|
|
1374
1565
|
}));
|
|
1375
|
-
var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */
|
|
1566
|
+
var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */ import_react44.default.createElement(import_system31.Box, {
|
|
1376
1567
|
"aria-hidden": "true",
|
|
1377
1568
|
__baseCSS: {
|
|
1378
1569
|
width: 16,
|
|
@@ -1387,68 +1578,78 @@ var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */ import_react41.defau
|
|
|
1387
1578
|
},
|
|
1388
1579
|
css,
|
|
1389
1580
|
...props
|
|
1390
|
-
}, checked ? /* @__PURE__ */
|
|
1391
|
-
var Radio = (0,
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1581
|
+
}, checked ? /* @__PURE__ */ import_react44.default.createElement(Dot, null) : null);
|
|
1582
|
+
var Radio = (0, import_react44.forwardRef)(
|
|
1583
|
+
({ width, disabled, ...props }, ref) => {
|
|
1584
|
+
const {
|
|
1585
|
+
variant,
|
|
1586
|
+
size,
|
|
1587
|
+
error,
|
|
1588
|
+
width: groupWidth,
|
|
1589
|
+
...state
|
|
1590
|
+
} = useRadioGroupContext();
|
|
1591
|
+
const inputRef = (0, import_utils9.useObjectRef)(ref);
|
|
1592
|
+
const { inputProps } = (0, import_radio3.useRadio)(
|
|
1593
|
+
{ isDisabled: disabled, ...props },
|
|
1594
|
+
state,
|
|
1595
|
+
inputRef
|
|
1596
|
+
);
|
|
1597
|
+
const styles = (0, import_system31.useComponentStyles)(
|
|
1598
|
+
"Radio",
|
|
1599
|
+
{ variant: variant || props.variant, size: size || props.size },
|
|
1600
|
+
{ parts: ["container", "label", "radio"] }
|
|
1601
|
+
);
|
|
1602
|
+
const { hoverProps, isHovered } = (0, import_interactions7.useHover)({});
|
|
1603
|
+
const { isFocusVisible, focusProps } = (0, import_focus7.useFocusRing)();
|
|
1604
|
+
const stateProps = (0, import_system31.useStateProps)({
|
|
1605
|
+
hover: isHovered,
|
|
1606
|
+
focus: isFocusVisible,
|
|
1607
|
+
checked: inputProps.checked,
|
|
1608
|
+
disabled: inputProps.disabled,
|
|
1609
|
+
readOnly: props.readOnly,
|
|
1610
|
+
error
|
|
1611
|
+
});
|
|
1612
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_system31.Box, {
|
|
1613
|
+
as: "label",
|
|
1614
|
+
__baseCSS: {
|
|
1615
|
+
display: "flex",
|
|
1616
|
+
alignItems: "center",
|
|
1617
|
+
gap: "1ch",
|
|
1618
|
+
position: "relative",
|
|
1619
|
+
width: width || groupWidth || "100%"
|
|
1620
|
+
},
|
|
1621
|
+
css: styles.container,
|
|
1622
|
+
...hoverProps,
|
|
1623
|
+
...stateProps
|
|
1624
|
+
}, /* @__PURE__ */ import_react44.default.createElement(import_system31.Box, {
|
|
1625
|
+
as: "input",
|
|
1626
|
+
ref: inputRef,
|
|
1627
|
+
css: {
|
|
1628
|
+
position: "absolute",
|
|
1629
|
+
width: "100%",
|
|
1630
|
+
height: "100%",
|
|
1631
|
+
top: 0,
|
|
1632
|
+
left: 0,
|
|
1633
|
+
zIndex: 1,
|
|
1634
|
+
opacity: 1e-4,
|
|
1635
|
+
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1636
|
+
},
|
|
1637
|
+
...inputProps,
|
|
1638
|
+
...focusProps
|
|
1639
|
+
}), /* @__PURE__ */ import_react44.default.createElement(Icon2, {
|
|
1640
|
+
checked: inputProps.checked,
|
|
1641
|
+
css: styles.radio,
|
|
1642
|
+
...stateProps
|
|
1643
|
+
}), /* @__PURE__ */ import_react44.default.createElement(import_system31.Box, {
|
|
1644
|
+
css: styles.label,
|
|
1645
|
+
...stateProps
|
|
1646
|
+
}, props.children));
|
|
1647
|
+
}
|
|
1648
|
+
);
|
|
1448
1649
|
Radio.Group = RadioGroup;
|
|
1449
1650
|
|
|
1450
1651
|
// src/Select/Select.tsx
|
|
1451
|
-
var
|
|
1652
|
+
var import_react49 = __toESM(require("react"));
|
|
1452
1653
|
var import_button4 = require("@react-aria/button");
|
|
1453
1654
|
var import_focus8 = require("@react-aria/focus");
|
|
1454
1655
|
var import_i18n2 = require("@react-aria/i18n");
|
|
@@ -1456,41 +1657,45 @@ var import_overlays8 = require("@react-aria/overlays");
|
|
|
1456
1657
|
var import_select = require("@react-aria/select");
|
|
1457
1658
|
var import_select2 = require("@react-stately/select");
|
|
1458
1659
|
var import_collections2 = require("@react-stately/collections");
|
|
1459
|
-
var
|
|
1460
|
-
var
|
|
1660
|
+
var import_utils11 = require("@react-aria/utils");
|
|
1661
|
+
var import_system35 = require("@marigold/system");
|
|
1461
1662
|
|
|
1462
1663
|
// src/ListBox/ListBox.tsx
|
|
1463
|
-
var
|
|
1464
|
-
var
|
|
1465
|
-
var
|
|
1664
|
+
var import_react48 = __toESM(require("react"));
|
|
1665
|
+
var import_utils10 = require("@react-aria/utils");
|
|
1666
|
+
var import_system34 = require("@marigold/system");
|
|
1466
1667
|
var import_listbox3 = require("@react-aria/listbox");
|
|
1467
1668
|
|
|
1468
1669
|
// src/ListBox/Context.ts
|
|
1469
|
-
var
|
|
1470
|
-
var ListBoxContext = (0,
|
|
1471
|
-
var useListBoxContext = () => (0,
|
|
1670
|
+
var import_react45 = require("react");
|
|
1671
|
+
var ListBoxContext = (0, import_react45.createContext)({});
|
|
1672
|
+
var useListBoxContext = () => (0, import_react45.useContext)(ListBoxContext);
|
|
1472
1673
|
|
|
1473
1674
|
// src/ListBox/ListBoxSection.tsx
|
|
1474
|
-
var
|
|
1675
|
+
var import_react47 = __toESM(require("react"));
|
|
1475
1676
|
var import_listbox2 = require("@react-aria/listbox");
|
|
1476
|
-
var
|
|
1677
|
+
var import_system33 = require("@marigold/system");
|
|
1477
1678
|
|
|
1478
1679
|
// src/ListBox/ListBoxOption.tsx
|
|
1479
|
-
var
|
|
1680
|
+
var import_react46 = __toESM(require("react"));
|
|
1480
1681
|
var import_listbox = require("@react-aria/listbox");
|
|
1481
|
-
var
|
|
1682
|
+
var import_system32 = require("@marigold/system");
|
|
1482
1683
|
var ListBoxOption = ({ item, state }) => {
|
|
1483
|
-
const ref = (0,
|
|
1484
|
-
const { optionProps, isSelected, isDisabled, isFocused } = (0, import_listbox.useOption)(
|
|
1485
|
-
|
|
1486
|
-
|
|
1684
|
+
const ref = (0, import_react46.useRef)(null);
|
|
1685
|
+
const { optionProps, isSelected, isDisabled, isFocused } = (0, import_listbox.useOption)(
|
|
1686
|
+
{
|
|
1687
|
+
key: item.key
|
|
1688
|
+
},
|
|
1689
|
+
state,
|
|
1690
|
+
ref
|
|
1691
|
+
);
|
|
1487
1692
|
const { styles } = useListBoxContext();
|
|
1488
|
-
const stateProps = (0,
|
|
1693
|
+
const stateProps = (0, import_system32.useStateProps)({
|
|
1489
1694
|
selected: isSelected,
|
|
1490
1695
|
disabled: isDisabled,
|
|
1491
1696
|
focusVisible: isFocused
|
|
1492
1697
|
});
|
|
1493
|
-
return /* @__PURE__ */
|
|
1698
|
+
return /* @__PURE__ */ import_react46.default.createElement(import_system32.Box, {
|
|
1494
1699
|
as: "li",
|
|
1495
1700
|
ref,
|
|
1496
1701
|
css: styles.option,
|
|
@@ -1506,19 +1711,19 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1506
1711
|
"aria-label": section["aria-label"]
|
|
1507
1712
|
});
|
|
1508
1713
|
const { styles } = useListBoxContext();
|
|
1509
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ import_react47.default.createElement(import_system33.Box, {
|
|
1510
1715
|
as: "li",
|
|
1511
1716
|
css: styles.section,
|
|
1512
1717
|
...itemProps
|
|
1513
|
-
}, section.rendered && /* @__PURE__ */
|
|
1718
|
+
}, section.rendered && /* @__PURE__ */ import_react47.default.createElement(import_system33.Box, {
|
|
1514
1719
|
css: styles.sectionTitle,
|
|
1515
1720
|
...headingProps
|
|
1516
|
-
}, section.rendered), /* @__PURE__ */
|
|
1721
|
+
}, section.rendered), /* @__PURE__ */ import_react47.default.createElement(import_system33.Box, {
|
|
1517
1722
|
as: "ul",
|
|
1518
1723
|
__baseCSS: { listStyle: "none", p: 0 },
|
|
1519
1724
|
css: styles.list,
|
|
1520
1725
|
...groupProps
|
|
1521
|
-
}, [...section.childNodes].map((node) => /* @__PURE__ */
|
|
1726
|
+
}, [...section.childNodes].map((node) => /* @__PURE__ */ import_react47.default.createElement(ListBoxOption, {
|
|
1522
1727
|
key: node.key,
|
|
1523
1728
|
item: node,
|
|
1524
1729
|
state
|
|
@@ -1526,30 +1731,38 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1526
1731
|
};
|
|
1527
1732
|
|
|
1528
1733
|
// src/ListBox/ListBox.tsx
|
|
1529
|
-
var ListBox = (0,
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1734
|
+
var ListBox = (0, import_react48.forwardRef)(
|
|
1735
|
+
({ state, variant, size, ...props }, ref) => {
|
|
1736
|
+
const innerRef = (0, import_utils10.useObjectRef)(ref);
|
|
1737
|
+
const { listBoxProps } = (0, import_listbox3.useListBox)(props, state, innerRef);
|
|
1738
|
+
const styles = (0, import_system34.useComponentStyles)(
|
|
1739
|
+
"ListBox",
|
|
1740
|
+
{ variant, size },
|
|
1741
|
+
{ parts: ["container", "list", "option", "section", "sectionTitle"] }
|
|
1742
|
+
);
|
|
1743
|
+
return /* @__PURE__ */ import_react48.default.createElement(ListBoxContext.Provider, {
|
|
1744
|
+
value: { styles }
|
|
1745
|
+
}, /* @__PURE__ */ import_react48.default.createElement(import_system34.Box, {
|
|
1746
|
+
css: styles.container
|
|
1747
|
+
}, /* @__PURE__ */ import_react48.default.createElement(import_system34.Box, {
|
|
1748
|
+
as: "ul",
|
|
1749
|
+
ref: innerRef,
|
|
1750
|
+
__baseCSS: { listStyle: "none", p: 0 },
|
|
1751
|
+
css: styles.list,
|
|
1752
|
+
...listBoxProps
|
|
1753
|
+
}, [...state.collection].map(
|
|
1754
|
+
(item) => item.type === "section" ? /* @__PURE__ */ import_react48.default.createElement(ListBoxSection, {
|
|
1755
|
+
key: item.key,
|
|
1756
|
+
section: item,
|
|
1757
|
+
state
|
|
1758
|
+
}) : /* @__PURE__ */ import_react48.default.createElement(ListBoxOption, {
|
|
1759
|
+
key: item.key,
|
|
1760
|
+
item,
|
|
1761
|
+
state
|
|
1762
|
+
})
|
|
1763
|
+
))));
|
|
1764
|
+
}
|
|
1765
|
+
);
|
|
1553
1766
|
|
|
1554
1767
|
// src/Select/intl.ts
|
|
1555
1768
|
var messages = {
|
|
@@ -1562,7 +1775,7 @@ var messages = {
|
|
|
1562
1775
|
};
|
|
1563
1776
|
|
|
1564
1777
|
// src/Select/Select.tsx
|
|
1565
|
-
var Chevron = ({ css }) => /* @__PURE__ */
|
|
1778
|
+
var Chevron = ({ css }) => /* @__PURE__ */ import_react49.default.createElement(import_system35.Box, {
|
|
1566
1779
|
as: "svg",
|
|
1567
1780
|
__baseCSS: { width: 16, height: 16 },
|
|
1568
1781
|
css,
|
|
@@ -1570,125 +1783,134 @@ var Chevron = ({ css }) => /* @__PURE__ */ import_react46.default.createElement(
|
|
|
1570
1783
|
viewBox: "0 0 24 24",
|
|
1571
1784
|
stroke: "currentColor",
|
|
1572
1785
|
strokeWidth: 2
|
|
1573
|
-
}, /* @__PURE__ */
|
|
1786
|
+
}, /* @__PURE__ */ import_react49.default.createElement("path", {
|
|
1574
1787
|
strokeLinecap: "round",
|
|
1575
1788
|
strokeLinejoin: "round",
|
|
1576
1789
|
d: "M19 9l-7 7-7-7"
|
|
1577
1790
|
}));
|
|
1578
|
-
var Select = (0,
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
},
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
})
|
|
1791
|
+
var Select = (0, import_react49.forwardRef)(
|
|
1792
|
+
({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
|
|
1793
|
+
const formatMessage = (0, import_i18n2.useMessageFormatter)(messages);
|
|
1794
|
+
const buttonRef = (0, import_utils11.useObjectRef)(ref);
|
|
1795
|
+
const props = {
|
|
1796
|
+
isOpen: open,
|
|
1797
|
+
isDisabled: disabled,
|
|
1798
|
+
isRequired: required,
|
|
1799
|
+
validationState: error ? "invalid" : "valid",
|
|
1800
|
+
placeholder: rest.placeholder || formatMessage("placeholder"),
|
|
1801
|
+
...rest
|
|
1802
|
+
};
|
|
1803
|
+
const state = (0, import_select2.useSelectState)(props);
|
|
1804
|
+
const {
|
|
1805
|
+
labelProps,
|
|
1806
|
+
triggerProps,
|
|
1807
|
+
valueProps,
|
|
1808
|
+
menuProps,
|
|
1809
|
+
descriptionProps,
|
|
1810
|
+
errorMessageProps
|
|
1811
|
+
} = (0, import_select.useSelect)(props, state, buttonRef);
|
|
1812
|
+
const { buttonProps } = (0, import_button4.useButton)(
|
|
1813
|
+
{ isDisabled: disabled, ...triggerProps },
|
|
1814
|
+
buttonRef
|
|
1815
|
+
);
|
|
1816
|
+
const { focusProps, isFocusVisible } = (0, import_focus8.useFocusRing)();
|
|
1817
|
+
const overlayRef = (0, import_react49.useRef)(null);
|
|
1818
|
+
const { overlayProps: positionProps } = (0, import_overlays8.useOverlayPosition)({
|
|
1819
|
+
targetRef: buttonRef,
|
|
1820
|
+
overlayRef,
|
|
1821
|
+
isOpen: state.isOpen,
|
|
1822
|
+
placement: "bottom left"
|
|
1823
|
+
});
|
|
1824
|
+
const styles = (0, import_system35.useComponentStyles)(
|
|
1825
|
+
"Select",
|
|
1826
|
+
{ variant, size },
|
|
1827
|
+
{ parts: ["container", "button", "icon"] }
|
|
1828
|
+
);
|
|
1829
|
+
const stateProps = (0, import_system35.useStateProps)({
|
|
1830
|
+
disabled,
|
|
1831
|
+
error,
|
|
1832
|
+
focusVisible: isFocusVisible,
|
|
1833
|
+
expanded: state.isOpen
|
|
1834
|
+
});
|
|
1835
|
+
return /* @__PURE__ */ import_react49.default.createElement(FieldBase, {
|
|
1836
|
+
variant,
|
|
1837
|
+
size,
|
|
1838
|
+
width,
|
|
1839
|
+
label: props.label,
|
|
1840
|
+
labelProps: { as: "span", ...labelProps },
|
|
1841
|
+
description: props.description,
|
|
1842
|
+
descriptionProps,
|
|
1843
|
+
error,
|
|
1844
|
+
errorMessage: props.errorMessage,
|
|
1845
|
+
errorMessageProps,
|
|
1846
|
+
stateProps,
|
|
1847
|
+
disabled,
|
|
1848
|
+
required
|
|
1849
|
+
}, /* @__PURE__ */ import_react49.default.createElement(import_select.HiddenSelect, {
|
|
1850
|
+
state,
|
|
1851
|
+
triggerRef: buttonRef,
|
|
1852
|
+
label: props.label,
|
|
1853
|
+
name: props.name,
|
|
1854
|
+
isDisabled: disabled
|
|
1855
|
+
}), /* @__PURE__ */ import_react49.default.createElement(import_system35.Box, {
|
|
1856
|
+
as: "button",
|
|
1857
|
+
__baseCSS: {
|
|
1858
|
+
display: "flex",
|
|
1859
|
+
position: "relative",
|
|
1860
|
+
alignItems: "center",
|
|
1861
|
+
justifyContent: "space-between",
|
|
1862
|
+
width: "100%"
|
|
1863
|
+
},
|
|
1864
|
+
css: styles.button,
|
|
1865
|
+
ref: buttonRef,
|
|
1866
|
+
...(0, import_utils11.mergeProps)(buttonProps, focusProps),
|
|
1867
|
+
...stateProps
|
|
1868
|
+
}, /* @__PURE__ */ import_react49.default.createElement(import_system35.Box, {
|
|
1869
|
+
css: {
|
|
1870
|
+
overflow: "hidden",
|
|
1871
|
+
whiteSpace: "nowrap"
|
|
1872
|
+
},
|
|
1873
|
+
...valueProps
|
|
1874
|
+
}, state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ import_react49.default.createElement(Chevron, {
|
|
1875
|
+
css: styles.icon
|
|
1876
|
+
})), /* @__PURE__ */ import_react49.default.createElement(Popover, {
|
|
1877
|
+
open: state.isOpen,
|
|
1878
|
+
onClose: state.close,
|
|
1879
|
+
dismissable: true,
|
|
1880
|
+
shouldCloseOnBlur: true,
|
|
1881
|
+
minWidth: buttonRef.current ? buttonRef.current.offsetWidth : void 0,
|
|
1882
|
+
ref: overlayRef,
|
|
1883
|
+
...positionProps
|
|
1884
|
+
}, /* @__PURE__ */ import_react49.default.createElement(import_focus8.FocusScope, {
|
|
1885
|
+
restoreFocus: true
|
|
1886
|
+
}, /* @__PURE__ */ import_react49.default.createElement(import_overlays8.DismissButton, {
|
|
1887
|
+
onDismiss: state.close
|
|
1888
|
+
}), /* @__PURE__ */ import_react49.default.createElement(ListBox, {
|
|
1889
|
+
state,
|
|
1890
|
+
variant,
|
|
1891
|
+
size,
|
|
1892
|
+
...menuProps
|
|
1893
|
+
}), /* @__PURE__ */ import_react49.default.createElement(import_overlays8.DismissButton, {
|
|
1894
|
+
onDismiss: state.close
|
|
1895
|
+
}))));
|
|
1896
|
+
}
|
|
1897
|
+
);
|
|
1676
1898
|
Select.Option = import_collections2.Item;
|
|
1677
1899
|
Select.Section = import_collections2.Section;
|
|
1678
1900
|
|
|
1679
1901
|
// src/Slider/Slider.tsx
|
|
1680
|
-
var
|
|
1902
|
+
var import_react51 = __toESM(require("react"));
|
|
1681
1903
|
var import_slider2 = require("@react-aria/slider");
|
|
1682
1904
|
var import_slider3 = require("@react-stately/slider");
|
|
1683
1905
|
var import_i18n3 = require("@react-aria/i18n");
|
|
1684
|
-
var
|
|
1685
|
-
var
|
|
1906
|
+
var import_utils13 = require("@react-aria/utils");
|
|
1907
|
+
var import_system37 = require("@marigold/system");
|
|
1686
1908
|
|
|
1687
1909
|
// src/Slider/Thumb.tsx
|
|
1688
|
-
var
|
|
1910
|
+
var import_react50 = __toESM(require("react"));
|
|
1689
1911
|
var import_slider = require("@react-aria/slider");
|
|
1690
|
-
var
|
|
1691
|
-
var
|
|
1912
|
+
var import_utils12 = require("@react-aria/utils");
|
|
1913
|
+
var import_system36 = require("@marigold/system");
|
|
1692
1914
|
|
|
1693
1915
|
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
1694
1916
|
var import_visually_hidden = require("@react-aria/visually-hidden");
|
|
@@ -1697,101 +1919,111 @@ var import_visually_hidden = require("@react-aria/visually-hidden");
|
|
|
1697
1919
|
var import_focus9 = require("@react-aria/focus");
|
|
1698
1920
|
var Thumb = ({ state, trackRef, styles, ...props }) => {
|
|
1699
1921
|
const { disabled } = props;
|
|
1700
|
-
const inputRef =
|
|
1922
|
+
const inputRef = import_react50.default.useRef(null);
|
|
1701
1923
|
const { isFocusVisible, focusProps, isFocused } = (0, import_focus9.useFocusRing)();
|
|
1702
1924
|
const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
|
|
1703
|
-
const stateProps = (0,
|
|
1925
|
+
const stateProps = (0, import_system36.useStateProps)({
|
|
1704
1926
|
focus: focused,
|
|
1705
1927
|
disabled
|
|
1706
1928
|
});
|
|
1707
|
-
const { thumbProps, inputProps } = (0, import_slider.useSliderThumb)(
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1929
|
+
const { thumbProps, inputProps } = (0, import_slider.useSliderThumb)(
|
|
1930
|
+
{
|
|
1931
|
+
index: 0,
|
|
1932
|
+
trackRef,
|
|
1933
|
+
inputRef,
|
|
1934
|
+
isDisabled: disabled
|
|
1935
|
+
},
|
|
1936
|
+
state
|
|
1937
|
+
);
|
|
1938
|
+
(0, import_react50.useEffect)(() => {
|
|
1714
1939
|
state.setThumbEditable(0, !disabled);
|
|
1715
1940
|
}, [disabled, state]);
|
|
1716
|
-
return /* @__PURE__ */
|
|
1717
|
-
__baseCSS: {
|
|
1718
|
-
|
|
1719
|
-
top: 16,
|
|
1720
|
-
transform: "translateX(-50%)",
|
|
1721
|
-
left: `${state.getThumbPercent(0) * 100}%`
|
|
1722
|
-
}
|
|
1723
|
-
}, /* @__PURE__ */ import_react47.default.createElement(import_system.Box, {
|
|
1941
|
+
return /* @__PURE__ */ import_react50.default.createElement(import_system.Box, {
|
|
1942
|
+
__baseCSS: { top: "50%" },
|
|
1943
|
+
css: styles,
|
|
1724
1944
|
...thumbProps,
|
|
1725
|
-
__baseCSS: styles,
|
|
1726
1945
|
...stateProps
|
|
1727
|
-
}, /* @__PURE__ */
|
|
1946
|
+
}, /* @__PURE__ */ import_react50.default.createElement(import_visually_hidden.VisuallyHidden, null, /* @__PURE__ */ import_react50.default.createElement(import_system.Box, {
|
|
1728
1947
|
as: "input",
|
|
1729
1948
|
type: "range",
|
|
1730
1949
|
ref: inputRef,
|
|
1731
|
-
...(0,
|
|
1732
|
-
})))
|
|
1950
|
+
...(0, import_utils12.mergeProps)(inputProps, focusProps)
|
|
1951
|
+
})));
|
|
1733
1952
|
};
|
|
1734
1953
|
|
|
1735
1954
|
// src/Slider/Slider.tsx
|
|
1736
|
-
var Slider = (0,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
}
|
|
1955
|
+
var Slider = (0, import_react51.forwardRef)(
|
|
1956
|
+
({ variant, size, width = "100%", ...props }, ref) => {
|
|
1957
|
+
const { formatOptions } = props;
|
|
1958
|
+
const trackRef = (0, import_utils13.useObjectRef)(ref);
|
|
1959
|
+
const numberFormatter = (0, import_i18n3.useNumberFormatter)(formatOptions);
|
|
1960
|
+
const state = (0, import_slider3.useSliderState)({ ...props, numberFormatter });
|
|
1961
|
+
const { groupProps, trackProps, labelProps, outputProps } = (0, import_slider2.useSlider)(
|
|
1962
|
+
{
|
|
1963
|
+
label: props.children,
|
|
1964
|
+
...props
|
|
1965
|
+
},
|
|
1966
|
+
state,
|
|
1967
|
+
trackRef
|
|
1968
|
+
);
|
|
1969
|
+
const styles = (0, import_system37.useComponentStyles)(
|
|
1970
|
+
"Slider",
|
|
1971
|
+
{ variant, size },
|
|
1972
|
+
{ parts: ["track", "thumb", "label", "output"] }
|
|
1973
|
+
);
|
|
1974
|
+
return /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
1975
|
+
__baseCSS: {
|
|
1976
|
+
display: "flex",
|
|
1977
|
+
flexDirection: "column",
|
|
1978
|
+
touchAction: "none",
|
|
1979
|
+
width
|
|
1980
|
+
},
|
|
1981
|
+
...groupProps
|
|
1982
|
+
}, /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
1983
|
+
__baseCSS: { display: "flex", alignSelf: "stretch" }
|
|
1984
|
+
}, props.children && /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
1985
|
+
as: "label",
|
|
1986
|
+
__baseCSS: styles.label,
|
|
1987
|
+
...labelProps
|
|
1988
|
+
}, props.children), /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
1989
|
+
as: "output",
|
|
1990
|
+
...outputProps,
|
|
1991
|
+
__baseCSS: { flex: "1 0 auto", textAlign: "end" },
|
|
1992
|
+
css: styles.output
|
|
1993
|
+
}, state.getThumbValueLabel(0))), /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
1994
|
+
...trackProps,
|
|
1995
|
+
ref: trackRef,
|
|
1996
|
+
__baseCSS: {
|
|
1997
|
+
height: 32,
|
|
1998
|
+
width: "100%",
|
|
1999
|
+
cursor: props.disabled ? "not-allowed" : "pointer"
|
|
2000
|
+
}
|
|
2001
|
+
}, /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
2002
|
+
__baseCSS: {
|
|
2003
|
+
top: "50%",
|
|
2004
|
+
transform: "translateY(-50%)"
|
|
2005
|
+
},
|
|
2006
|
+
css: styles.track
|
|
2007
|
+
}), /* @__PURE__ */ import_react51.default.createElement(Thumb, {
|
|
2008
|
+
state,
|
|
2009
|
+
trackRef,
|
|
2010
|
+
disabled: props.disabled,
|
|
2011
|
+
styles: styles.thumb
|
|
2012
|
+
})));
|
|
2013
|
+
}
|
|
2014
|
+
);
|
|
1783
2015
|
|
|
1784
2016
|
// src/Split/Split.tsx
|
|
1785
|
-
var
|
|
1786
|
-
var
|
|
1787
|
-
var Split = (props) => /* @__PURE__ */
|
|
2017
|
+
var import_react52 = __toESM(require("react"));
|
|
2018
|
+
var import_system38 = require("@marigold/system");
|
|
2019
|
+
var Split = (props) => /* @__PURE__ */ import_react52.default.createElement(import_system38.Box, {
|
|
1788
2020
|
...props,
|
|
1789
2021
|
role: "separator",
|
|
1790
2022
|
css: { flexGrow: 1 }
|
|
1791
2023
|
});
|
|
1792
2024
|
|
|
1793
2025
|
// src/Stack/Stack.tsx
|
|
1794
|
-
var
|
|
2026
|
+
var import_react53 = __toESM(require("react"));
|
|
1795
2027
|
var ALIGNMENT_X2 = {
|
|
1796
2028
|
left: "flex-start",
|
|
1797
2029
|
center: "center",
|
|
@@ -1809,7 +2041,7 @@ var Stack = ({
|
|
|
1809
2041
|
alignY = "top",
|
|
1810
2042
|
stretch = false,
|
|
1811
2043
|
...props
|
|
1812
|
-
}) => /* @__PURE__ */
|
|
2044
|
+
}) => /* @__PURE__ */ import_react53.default.createElement(import_system.Box, {
|
|
1813
2045
|
css: {
|
|
1814
2046
|
display: "flex",
|
|
1815
2047
|
flexDirection: "column",
|
|
@@ -1823,151 +2055,161 @@ var Stack = ({
|
|
|
1823
2055
|
}, children);
|
|
1824
2056
|
|
|
1825
2057
|
// src/Switch/Switch.tsx
|
|
1826
|
-
var
|
|
2058
|
+
var import_react54 = __toESM(require("react"));
|
|
1827
2059
|
var import_focus10 = require("@react-aria/focus");
|
|
1828
2060
|
var import_switch = require("@react-aria/switch");
|
|
1829
|
-
var
|
|
2061
|
+
var import_utils14 = require("@react-aria/utils");
|
|
1830
2062
|
var import_toggle2 = require("@react-stately/toggle");
|
|
1831
|
-
var
|
|
1832
|
-
var Switch = (0,
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
readOnly,
|
|
1839
|
-
defaultChecked,
|
|
1840
|
-
...rest
|
|
1841
|
-
}, ref) => {
|
|
1842
|
-
const inputRef = (0, import_utils13.useObjectRef)(ref);
|
|
1843
|
-
const props = {
|
|
1844
|
-
isSelected: checked,
|
|
1845
|
-
isDisabled: disabled,
|
|
1846
|
-
isReadOnly: readOnly,
|
|
1847
|
-
defaultSelected: defaultChecked,
|
|
1848
|
-
...rest
|
|
1849
|
-
};
|
|
1850
|
-
const state = (0, import_toggle2.useToggleState)(props);
|
|
1851
|
-
const { inputProps } = (0, import_switch.useSwitch)(props, state, inputRef);
|
|
1852
|
-
const { isFocusVisible, focusProps } = (0, import_focus10.useFocusRing)();
|
|
1853
|
-
const stateProps = (0, import_system36.useStateProps)({
|
|
1854
|
-
checked: state.isSelected,
|
|
2063
|
+
var import_system39 = require("@marigold/system");
|
|
2064
|
+
var Switch = (0, import_react54.forwardRef)(
|
|
2065
|
+
({
|
|
2066
|
+
variant,
|
|
2067
|
+
size,
|
|
2068
|
+
width = "100%",
|
|
2069
|
+
checked,
|
|
1855
2070
|
disabled,
|
|
1856
2071
|
readOnly,
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
},
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
2072
|
+
defaultChecked,
|
|
2073
|
+
...rest
|
|
2074
|
+
}, ref) => {
|
|
2075
|
+
const inputRef = (0, import_utils14.useObjectRef)(ref);
|
|
2076
|
+
const props = {
|
|
2077
|
+
isSelected: checked,
|
|
2078
|
+
isDisabled: disabled,
|
|
2079
|
+
isReadOnly: readOnly,
|
|
2080
|
+
defaultSelected: defaultChecked,
|
|
2081
|
+
...rest
|
|
2082
|
+
};
|
|
2083
|
+
const state = (0, import_toggle2.useToggleState)(props);
|
|
2084
|
+
const { inputProps } = (0, import_switch.useSwitch)(props, state, inputRef);
|
|
2085
|
+
const { isFocusVisible, focusProps } = (0, import_focus10.useFocusRing)();
|
|
2086
|
+
const stateProps = (0, import_system39.useStateProps)({
|
|
2087
|
+
checked: state.isSelected,
|
|
2088
|
+
disabled,
|
|
2089
|
+
readOnly,
|
|
2090
|
+
focus: isFocusVisible
|
|
2091
|
+
});
|
|
2092
|
+
const styles = (0, import_system39.useComponentStyles)(
|
|
2093
|
+
"Switch",
|
|
2094
|
+
{ variant, size },
|
|
2095
|
+
{ parts: ["container", "label", "track", "thumb"] }
|
|
2096
|
+
);
|
|
2097
|
+
return /* @__PURE__ */ import_react54.default.createElement(import_system.Box, {
|
|
2098
|
+
as: "label",
|
|
2099
|
+
__baseCSS: {
|
|
2100
|
+
display: "flex",
|
|
2101
|
+
alignItems: "center",
|
|
2102
|
+
justifyContent: "space-between",
|
|
2103
|
+
gap: "1ch",
|
|
2104
|
+
position: "relative",
|
|
2105
|
+
width
|
|
2106
|
+
},
|
|
2107
|
+
css: styles.container
|
|
2108
|
+
}, /* @__PURE__ */ import_react54.default.createElement(import_system.Box, {
|
|
2109
|
+
as: "input",
|
|
2110
|
+
ref: inputRef,
|
|
2111
|
+
css: {
|
|
2112
|
+
position: "absolute",
|
|
2113
|
+
width: "100%",
|
|
2114
|
+
height: "100%",
|
|
2115
|
+
top: 0,
|
|
2116
|
+
left: 0,
|
|
2117
|
+
zIndex: 1,
|
|
2118
|
+
opacity: 1e-4,
|
|
2119
|
+
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
2120
|
+
},
|
|
2121
|
+
...inputProps,
|
|
2122
|
+
...focusProps
|
|
2123
|
+
}), props.children && /* @__PURE__ */ import_react54.default.createElement(import_system.Box, {
|
|
2124
|
+
css: styles.label
|
|
2125
|
+
}, props.children), /* @__PURE__ */ import_react54.default.createElement(import_system.Box, {
|
|
2126
|
+
__baseCSS: {
|
|
2127
|
+
position: "relative",
|
|
2128
|
+
width: 48,
|
|
2129
|
+
height: 24,
|
|
2130
|
+
bg: "#dee2e6",
|
|
2131
|
+
borderRadius: 20
|
|
2132
|
+
},
|
|
2133
|
+
css: styles.track,
|
|
2134
|
+
...stateProps
|
|
2135
|
+
}, /* @__PURE__ */ import_react54.default.createElement(import_system.Box, {
|
|
2136
|
+
__baseCSS: {
|
|
2137
|
+
display: "block",
|
|
2138
|
+
position: "absolute",
|
|
2139
|
+
top: 1,
|
|
2140
|
+
left: 0,
|
|
2141
|
+
willChange: "transform",
|
|
2142
|
+
transform: "translateX(1px)",
|
|
2143
|
+
transition: "all 0.1s cubic-bezier(.7, 0, .3, 1)",
|
|
2144
|
+
height: 22,
|
|
2145
|
+
width: 22,
|
|
2146
|
+
borderRadius: 9999,
|
|
2147
|
+
bg: "#fff",
|
|
2148
|
+
"&:checked": {
|
|
2149
|
+
transform: "translateX(calc(47px - 100%))"
|
|
2150
|
+
}
|
|
2151
|
+
},
|
|
2152
|
+
css: styles.thumb,
|
|
2153
|
+
...stateProps
|
|
2154
|
+
})));
|
|
2155
|
+
}
|
|
2156
|
+
);
|
|
1919
2157
|
|
|
1920
2158
|
// src/Table/Table.tsx
|
|
1921
|
-
var
|
|
2159
|
+
var import_react64 = __toESM(require("react"));
|
|
1922
2160
|
var import_table9 = require("@react-aria/table");
|
|
1923
2161
|
var import_table10 = require("@react-stately/table");
|
|
1924
|
-
var
|
|
2162
|
+
var import_system45 = require("@marigold/system");
|
|
1925
2163
|
|
|
1926
2164
|
// src/Table/Context.tsx
|
|
1927
|
-
var
|
|
1928
|
-
var TableContext = (0,
|
|
1929
|
-
var useTableContext = () => (0,
|
|
2165
|
+
var import_react55 = require("react");
|
|
2166
|
+
var TableContext = (0, import_react55.createContext)({});
|
|
2167
|
+
var useTableContext = () => (0, import_react55.useContext)(TableContext);
|
|
1930
2168
|
|
|
1931
2169
|
// src/Table/TableBody.tsx
|
|
1932
|
-
var
|
|
2170
|
+
var import_react56 = __toESM(require("react"));
|
|
1933
2171
|
var import_table = require("@react-aria/table");
|
|
1934
2172
|
var TableBody = ({ children }) => {
|
|
1935
2173
|
const { rowGroupProps } = (0, import_table.useTableRowGroup)();
|
|
1936
|
-
return /* @__PURE__ */
|
|
2174
|
+
return /* @__PURE__ */ import_react56.default.createElement("tbody", {
|
|
1937
2175
|
...rowGroupProps
|
|
1938
2176
|
}, children);
|
|
1939
2177
|
};
|
|
1940
2178
|
|
|
1941
2179
|
// src/Table/TableCell.tsx
|
|
1942
|
-
var
|
|
2180
|
+
var import_react57 = __toESM(require("react"));
|
|
1943
2181
|
var import_table2 = require("@react-aria/table");
|
|
1944
2182
|
var import_focus11 = require("@react-aria/focus");
|
|
1945
|
-
var
|
|
1946
|
-
var
|
|
2183
|
+
var import_utils15 = require("@react-aria/utils");
|
|
2184
|
+
var import_system40 = require("@marigold/system");
|
|
1947
2185
|
var TableCell = ({ cell }) => {
|
|
1948
|
-
const ref = (0,
|
|
2186
|
+
const ref = (0, import_react57.useRef)(null);
|
|
1949
2187
|
const { state, styles } = useTableContext();
|
|
1950
2188
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
1951
|
-
const { gridCellProps } = (0, import_table2.useTableCell)(
|
|
1952
|
-
|
|
1953
|
-
|
|
2189
|
+
const { gridCellProps } = (0, import_table2.useTableCell)(
|
|
2190
|
+
{
|
|
2191
|
+
node: cell
|
|
2192
|
+
},
|
|
2193
|
+
state,
|
|
2194
|
+
ref
|
|
2195
|
+
);
|
|
1954
2196
|
const { focusProps, isFocusVisible } = (0, import_focus11.useFocusRing)();
|
|
1955
|
-
const stateProps = (0,
|
|
1956
|
-
return /* @__PURE__ */
|
|
2197
|
+
const stateProps = (0, import_system40.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
2198
|
+
return /* @__PURE__ */ import_react57.default.createElement(import_system40.Box, {
|
|
1957
2199
|
as: "td",
|
|
1958
2200
|
ref,
|
|
1959
2201
|
css: styles.cell,
|
|
1960
|
-
...(0,
|
|
2202
|
+
...(0, import_utils15.mergeProps)(gridCellProps, focusProps),
|
|
1961
2203
|
...stateProps
|
|
1962
2204
|
}, cell.rendered);
|
|
1963
2205
|
};
|
|
1964
2206
|
|
|
1965
2207
|
// src/Table/TableCheckboxCell.tsx
|
|
1966
|
-
var
|
|
2208
|
+
var import_react58 = __toESM(require("react"));
|
|
1967
2209
|
var import_table3 = require("@react-aria/table");
|
|
1968
2210
|
var import_focus12 = require("@react-aria/focus");
|
|
1969
|
-
var
|
|
1970
|
-
var
|
|
2211
|
+
var import_utils16 = require("@react-aria/utils");
|
|
2212
|
+
var import_system41 = require("@marigold/system");
|
|
1971
2213
|
|
|
1972
2214
|
// src/Table/utils.ts
|
|
1973
2215
|
var mapCheckboxProps = ({
|
|
@@ -1991,16 +2233,22 @@ var mapCheckboxProps = ({
|
|
|
1991
2233
|
|
|
1992
2234
|
// src/Table/TableCheckboxCell.tsx
|
|
1993
2235
|
var TableCheckboxCell = ({ cell }) => {
|
|
1994
|
-
const ref = (0,
|
|
2236
|
+
const ref = (0, import_react58.useRef)(null);
|
|
1995
2237
|
const { state, styles } = useTableContext();
|
|
1996
2238
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
1997
|
-
const { gridCellProps } = (0, import_table3.useTableCell)(
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2239
|
+
const { gridCellProps } = (0, import_table3.useTableCell)(
|
|
2240
|
+
{
|
|
2241
|
+
node: cell
|
|
2242
|
+
},
|
|
2243
|
+
state,
|
|
2244
|
+
ref
|
|
2245
|
+
);
|
|
2246
|
+
const { checkboxProps } = mapCheckboxProps(
|
|
2247
|
+
(0, import_table3.useTableSelectionCheckbox)({ key: cell.parentKey }, state)
|
|
2248
|
+
);
|
|
2001
2249
|
const { focusProps, isFocusVisible } = (0, import_focus12.useFocusRing)();
|
|
2002
|
-
const stateProps = (0,
|
|
2003
|
-
return /* @__PURE__ */
|
|
2250
|
+
const stateProps = (0, import_system41.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
2251
|
+
return /* @__PURE__ */ import_react58.default.createElement(import_system41.Box, {
|
|
2004
2252
|
as: "td",
|
|
2005
2253
|
ref,
|
|
2006
2254
|
__baseCSS: {
|
|
@@ -2009,24 +2257,24 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2009
2257
|
lineHeight: 1
|
|
2010
2258
|
},
|
|
2011
2259
|
css: styles.cell,
|
|
2012
|
-
...(0,
|
|
2260
|
+
...(0, import_utils16.mergeProps)(gridCellProps, focusProps),
|
|
2013
2261
|
...stateProps
|
|
2014
|
-
}, /* @__PURE__ */
|
|
2262
|
+
}, /* @__PURE__ */ import_react58.default.createElement(Checkbox, {
|
|
2015
2263
|
...checkboxProps
|
|
2016
2264
|
}));
|
|
2017
2265
|
};
|
|
2018
2266
|
|
|
2019
2267
|
// src/Table/TableColumnHeader.tsx
|
|
2020
|
-
var
|
|
2268
|
+
var import_react59 = __toESM(require("react"));
|
|
2021
2269
|
var import_focus13 = require("@react-aria/focus");
|
|
2022
|
-
var
|
|
2270
|
+
var import_interactions8 = require("@react-aria/interactions");
|
|
2023
2271
|
var import_table4 = require("@react-aria/table");
|
|
2024
|
-
var
|
|
2025
|
-
var
|
|
2272
|
+
var import_utils18 = require("@react-aria/utils");
|
|
2273
|
+
var import_system42 = require("@marigold/system");
|
|
2026
2274
|
var SortIndicator = ({
|
|
2027
2275
|
direction = "ascending",
|
|
2028
2276
|
visible
|
|
2029
|
-
}) => /* @__PURE__ */
|
|
2277
|
+
}) => /* @__PURE__ */ import_react59.default.createElement(import_system42.Box, {
|
|
2030
2278
|
as: "span",
|
|
2031
2279
|
role: "presentation",
|
|
2032
2280
|
"aria-hidden": "true",
|
|
@@ -2038,107 +2286,119 @@ var SortIndicator = ({
|
|
|
2038
2286
|
}, direction === "ascending" ? "\u25B2" : "\u25BC");
|
|
2039
2287
|
var TableColumnHeader = ({ column }) => {
|
|
2040
2288
|
var _a, _b;
|
|
2041
|
-
const ref = (0,
|
|
2289
|
+
const ref = (0, import_react59.useRef)(null);
|
|
2042
2290
|
const { state, styles } = useTableContext();
|
|
2043
|
-
const { columnHeaderProps } = (0, import_table4.useTableColumnHeader)(
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2291
|
+
const { columnHeaderProps } = (0, import_table4.useTableColumnHeader)(
|
|
2292
|
+
{
|
|
2293
|
+
node: column
|
|
2294
|
+
},
|
|
2295
|
+
state,
|
|
2296
|
+
ref
|
|
2297
|
+
);
|
|
2298
|
+
const { hoverProps, isHovered } = (0, import_interactions8.useHover)({});
|
|
2047
2299
|
const { focusProps, isFocusVisible } = (0, import_focus13.useFocusRing)();
|
|
2048
|
-
const stateProps = (0,
|
|
2300
|
+
const stateProps = (0, import_system42.useStateProps)({
|
|
2049
2301
|
hover: isHovered,
|
|
2050
2302
|
focusVisible: isFocusVisible
|
|
2051
2303
|
});
|
|
2052
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ import_react59.default.createElement(import_system42.Box, {
|
|
2053
2305
|
as: "th",
|
|
2054
2306
|
colSpan: column.colspan,
|
|
2055
2307
|
ref,
|
|
2056
2308
|
css: styles.header,
|
|
2057
|
-
...(0,
|
|
2309
|
+
...(0, import_utils18.mergeProps)(columnHeaderProps, hoverProps, focusProps),
|
|
2058
2310
|
...stateProps
|
|
2059
|
-
}, column.rendered, column.props.allowsSorting && /* @__PURE__ */
|
|
2311
|
+
}, column.rendered, column.props.allowsSorting && /* @__PURE__ */ import_react59.default.createElement(SortIndicator, {
|
|
2060
2312
|
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
2061
2313
|
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
2062
2314
|
}));
|
|
2063
2315
|
};
|
|
2064
2316
|
|
|
2065
2317
|
// src/Table/TableHeader.tsx
|
|
2066
|
-
var
|
|
2318
|
+
var import_react60 = __toESM(require("react"));
|
|
2067
2319
|
var import_table5 = require("@react-aria/table");
|
|
2068
2320
|
var TableHeader = ({ children }) => {
|
|
2069
2321
|
const { rowGroupProps } = (0, import_table5.useTableRowGroup)();
|
|
2070
|
-
return /* @__PURE__ */
|
|
2322
|
+
return /* @__PURE__ */ import_react60.default.createElement("thead", {
|
|
2071
2323
|
...rowGroupProps
|
|
2072
2324
|
}, children);
|
|
2073
2325
|
};
|
|
2074
2326
|
|
|
2075
2327
|
// src/Table/TableHeaderRow.tsx
|
|
2076
|
-
var
|
|
2328
|
+
var import_react61 = __toESM(require("react"));
|
|
2077
2329
|
var import_table6 = require("@react-aria/table");
|
|
2078
2330
|
var TableHeaderRow = ({ item, children }) => {
|
|
2079
2331
|
const { state } = useTableContext();
|
|
2080
|
-
const ref = (0,
|
|
2332
|
+
const ref = (0, import_react61.useRef)(null);
|
|
2081
2333
|
const { rowProps } = (0, import_table6.useTableHeaderRow)({ node: item }, state, ref);
|
|
2082
|
-
return /* @__PURE__ */
|
|
2334
|
+
return /* @__PURE__ */ import_react61.default.createElement("tr", {
|
|
2083
2335
|
...rowProps,
|
|
2084
2336
|
ref
|
|
2085
2337
|
}, children);
|
|
2086
2338
|
};
|
|
2087
2339
|
|
|
2088
2340
|
// src/Table/TableRow.tsx
|
|
2089
|
-
var
|
|
2341
|
+
var import_react62 = __toESM(require("react"));
|
|
2090
2342
|
var import_focus14 = require("@react-aria/focus");
|
|
2091
|
-
var
|
|
2343
|
+
var import_interactions9 = require("@react-aria/interactions");
|
|
2092
2344
|
var import_table7 = require("@react-aria/table");
|
|
2093
|
-
var
|
|
2094
|
-
var
|
|
2345
|
+
var import_utils19 = require("@react-aria/utils");
|
|
2346
|
+
var import_system43 = require("@marigold/system");
|
|
2095
2347
|
var TableRow = ({ children, row }) => {
|
|
2096
|
-
const ref = (0,
|
|
2348
|
+
const ref = (0, import_react62.useRef)(null);
|
|
2097
2349
|
const { state, styles } = useTableContext();
|
|
2098
|
-
const { rowProps, isPressed } = (0, import_table7.useTableRow)(
|
|
2099
|
-
|
|
2100
|
-
|
|
2350
|
+
const { rowProps, isPressed } = (0, import_table7.useTableRow)(
|
|
2351
|
+
{
|
|
2352
|
+
node: row
|
|
2353
|
+
},
|
|
2354
|
+
state,
|
|
2355
|
+
ref
|
|
2356
|
+
);
|
|
2101
2357
|
const disabled = state.disabledKeys.has(row.key);
|
|
2102
2358
|
const selected = state.selectionManager.isSelected(row.key);
|
|
2103
2359
|
const { focusProps, isFocusVisible } = (0, import_focus14.useFocusRing)({ within: true });
|
|
2104
|
-
const { hoverProps, isHovered } = (0,
|
|
2105
|
-
const stateProps = (0,
|
|
2360
|
+
const { hoverProps, isHovered } = (0, import_interactions9.useHover)({ isDisabled: disabled });
|
|
2361
|
+
const stateProps = (0, import_system43.useStateProps)({
|
|
2106
2362
|
disabled,
|
|
2107
2363
|
selected,
|
|
2108
2364
|
hover: isHovered,
|
|
2109
2365
|
focusVisible: isFocusVisible,
|
|
2110
2366
|
active: isPressed
|
|
2111
2367
|
});
|
|
2112
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ import_react62.default.createElement(import_system43.Box, {
|
|
2113
2369
|
as: "tr",
|
|
2114
2370
|
ref,
|
|
2115
2371
|
css: styles.row,
|
|
2116
|
-
...(0,
|
|
2372
|
+
...(0, import_utils19.mergeProps)(rowProps, focusProps, hoverProps),
|
|
2117
2373
|
...stateProps
|
|
2118
2374
|
}, children);
|
|
2119
2375
|
};
|
|
2120
2376
|
|
|
2121
2377
|
// src/Table/TableSelectAllCell.tsx
|
|
2122
|
-
var
|
|
2378
|
+
var import_react63 = __toESM(require("react"));
|
|
2123
2379
|
var import_focus15 = require("@react-aria/focus");
|
|
2124
|
-
var
|
|
2380
|
+
var import_interactions10 = require("@react-aria/interactions");
|
|
2125
2381
|
var import_table8 = require("@react-aria/table");
|
|
2126
|
-
var
|
|
2127
|
-
var
|
|
2382
|
+
var import_utils20 = require("@react-aria/utils");
|
|
2383
|
+
var import_system44 = require("@marigold/system");
|
|
2128
2384
|
var TableSelectAllCell = ({ column }) => {
|
|
2129
|
-
const ref = (0,
|
|
2385
|
+
const ref = (0, import_react63.useRef)(null);
|
|
2130
2386
|
const { state, styles } = useTableContext();
|
|
2131
|
-
const { columnHeaderProps } = (0, import_table8.useTableColumnHeader)(
|
|
2132
|
-
|
|
2133
|
-
|
|
2387
|
+
const { columnHeaderProps } = (0, import_table8.useTableColumnHeader)(
|
|
2388
|
+
{
|
|
2389
|
+
node: column
|
|
2390
|
+
},
|
|
2391
|
+
state,
|
|
2392
|
+
ref
|
|
2393
|
+
);
|
|
2134
2394
|
const { checkboxProps } = mapCheckboxProps((0, import_table8.useTableSelectAllCheckbox)(state));
|
|
2135
|
-
const { hoverProps, isHovered } = (0,
|
|
2395
|
+
const { hoverProps, isHovered } = (0, import_interactions10.useHover)({});
|
|
2136
2396
|
const { focusProps, isFocusVisible } = (0, import_focus15.useFocusRing)();
|
|
2137
|
-
const stateProps = (0,
|
|
2397
|
+
const stateProps = (0, import_system44.useStateProps)({
|
|
2138
2398
|
hover: isHovered,
|
|
2139
2399
|
focusVisible: isFocusVisible
|
|
2140
2400
|
});
|
|
2141
|
-
return /* @__PURE__ */
|
|
2401
|
+
return /* @__PURE__ */ import_react63.default.createElement(import_system44.Box, {
|
|
2142
2402
|
as: "th",
|
|
2143
2403
|
ref,
|
|
2144
2404
|
__baseCSS: {
|
|
@@ -2147,9 +2407,9 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2147
2407
|
lineHeight: 1
|
|
2148
2408
|
},
|
|
2149
2409
|
css: styles.header,
|
|
2150
|
-
...(0,
|
|
2410
|
+
...(0, import_utils20.mergeProps)(columnHeaderProps, hoverProps, focusProps),
|
|
2151
2411
|
...stateProps
|
|
2152
|
-
}, /* @__PURE__ */
|
|
2412
|
+
}, /* @__PURE__ */ import_react63.default.createElement(Checkbox, {
|
|
2153
2413
|
...checkboxProps
|
|
2154
2414
|
}));
|
|
2155
2415
|
};
|
|
@@ -2161,17 +2421,21 @@ var Table = ({
|
|
|
2161
2421
|
stretch,
|
|
2162
2422
|
...props
|
|
2163
2423
|
}) => {
|
|
2164
|
-
const tableRef = (0,
|
|
2424
|
+
const tableRef = (0, import_react64.useRef)(null);
|
|
2165
2425
|
const state = (0, import_table10.useTableState)({
|
|
2166
2426
|
...props,
|
|
2167
2427
|
showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
|
|
2168
2428
|
});
|
|
2169
2429
|
const { gridProps } = (0, import_table9.useTable)(props, state, tableRef);
|
|
2170
|
-
const styles = (0,
|
|
2430
|
+
const styles = (0, import_system45.useComponentStyles)(
|
|
2431
|
+
"Table",
|
|
2432
|
+
{ variant, size },
|
|
2433
|
+
{ parts: ["table", "header", "row", "cell"] }
|
|
2434
|
+
);
|
|
2171
2435
|
const { collection } = state;
|
|
2172
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ import_react64.default.createElement(TableContext.Provider, {
|
|
2173
2437
|
value: { state, styles }
|
|
2174
|
-
}, /* @__PURE__ */
|
|
2438
|
+
}, /* @__PURE__ */ import_react64.default.createElement(import_system45.Box, {
|
|
2175
2439
|
as: "table",
|
|
2176
2440
|
ref: tableRef,
|
|
2177
2441
|
__baseCSS: {
|
|
@@ -2180,31 +2444,35 @@ var Table = ({
|
|
|
2180
2444
|
},
|
|
2181
2445
|
css: styles.table,
|
|
2182
2446
|
...gridProps
|
|
2183
|
-
}, /* @__PURE__ */
|
|
2447
|
+
}, /* @__PURE__ */ import_react64.default.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ import_react64.default.createElement(TableHeaderRow, {
|
|
2184
2448
|
key: headerRow.key,
|
|
2185
2449
|
item: headerRow
|
|
2186
|
-
}, [...headerRow.childNodes].map(
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2450
|
+
}, [...headerRow.childNodes].map(
|
|
2451
|
+
(column) => {
|
|
2452
|
+
var _a;
|
|
2453
|
+
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ import_react64.default.createElement(TableSelectAllCell, {
|
|
2454
|
+
key: column.key,
|
|
2455
|
+
column
|
|
2456
|
+
}) : /* @__PURE__ */ import_react64.default.createElement(TableColumnHeader, {
|
|
2457
|
+
key: column.key,
|
|
2458
|
+
column
|
|
2459
|
+
});
|
|
2460
|
+
}
|
|
2461
|
+
)))), /* @__PURE__ */ import_react64.default.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ import_react64.default.createElement(TableRow, {
|
|
2196
2462
|
key: row.key,
|
|
2197
2463
|
row
|
|
2198
|
-
}, [...row.childNodes].map(
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2464
|
+
}, [...row.childNodes].map(
|
|
2465
|
+
(cell) => {
|
|
2466
|
+
var _a;
|
|
2467
|
+
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ import_react64.default.createElement(TableCheckboxCell, {
|
|
2468
|
+
key: cell.key,
|
|
2469
|
+
cell
|
|
2470
|
+
}) : /* @__PURE__ */ import_react64.default.createElement(TableCell, {
|
|
2471
|
+
key: cell.key,
|
|
2472
|
+
cell
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
))))));
|
|
2208
2476
|
};
|
|
2209
2477
|
Table.Body = import_table10.TableBody;
|
|
2210
2478
|
Table.Cell = import_table10.Cell;
|
|
@@ -2213,9 +2481,9 @@ Table.Header = import_table10.TableHeader;
|
|
|
2213
2481
|
Table.Row = import_table10.Row;
|
|
2214
2482
|
|
|
2215
2483
|
// src/Text/Text.tsx
|
|
2216
|
-
var
|
|
2217
|
-
var
|
|
2218
|
-
var
|
|
2484
|
+
var import_react65 = __toESM(require("react"));
|
|
2485
|
+
var import_system46 = require("@marigold/system");
|
|
2486
|
+
var import_system47 = require("@marigold/system");
|
|
2219
2487
|
var Text = ({
|
|
2220
2488
|
variant,
|
|
2221
2489
|
size,
|
|
@@ -2227,11 +2495,11 @@ var Text = ({
|
|
|
2227
2495
|
children,
|
|
2228
2496
|
...props
|
|
2229
2497
|
}) => {
|
|
2230
|
-
const styles = (0,
|
|
2498
|
+
const styles = (0, import_system46.useComponentStyles)("Text", {
|
|
2231
2499
|
variant,
|
|
2232
2500
|
size
|
|
2233
2501
|
});
|
|
2234
|
-
return /* @__PURE__ */
|
|
2502
|
+
return /* @__PURE__ */ import_react65.default.createElement(import_system47.Box, {
|
|
2235
2503
|
as: "p",
|
|
2236
2504
|
...props,
|
|
2237
2505
|
css: { color, cursor, outline, fontSize, textAlign: align, ...styles }
|
|
@@ -2239,145 +2507,157 @@ var Text = ({
|
|
|
2239
2507
|
};
|
|
2240
2508
|
|
|
2241
2509
|
// src/TextArea/TextArea.tsx
|
|
2242
|
-
var
|
|
2243
|
-
var
|
|
2510
|
+
var import_react66 = __toESM(require("react"));
|
|
2511
|
+
var import_interactions11 = require("@react-aria/interactions");
|
|
2244
2512
|
var import_focus16 = require("@react-aria/focus");
|
|
2245
2513
|
var import_textfield = require("@react-aria/textfield");
|
|
2246
|
-
var
|
|
2247
|
-
var
|
|
2248
|
-
var TextArea = (0,
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
required,
|
|
2254
|
-
readOnly,
|
|
2255
|
-
error,
|
|
2256
|
-
rows,
|
|
2257
|
-
...props
|
|
2258
|
-
}, ref) => {
|
|
2259
|
-
const { label, description, errorMessage } = props;
|
|
2260
|
-
const textAreaRef = (0, import_utils21.useObjectRef)(ref);
|
|
2261
|
-
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield.useTextField)({
|
|
2262
|
-
inputElementType: "textarea",
|
|
2263
|
-
isDisabled: disabled,
|
|
2264
|
-
isRequired: required,
|
|
2265
|
-
isReadOnly: readOnly,
|
|
2266
|
-
validationState: error ? "invalid" : "valid",
|
|
2267
|
-
...props
|
|
2268
|
-
}, textAreaRef);
|
|
2269
|
-
const { hoverProps, isHovered } = (0, import_interactions10.useHover)({});
|
|
2270
|
-
const { focusProps, isFocusVisible } = (0, import_focus16.useFocusRing)();
|
|
2271
|
-
const stateProps = (0, import_system45.useStateProps)({
|
|
2272
|
-
hover: isHovered,
|
|
2273
|
-
focus: isFocusVisible,
|
|
2514
|
+
var import_utils22 = require("@react-aria/utils");
|
|
2515
|
+
var import_system48 = require("@marigold/system");
|
|
2516
|
+
var TextArea = (0, import_react66.forwardRef)(
|
|
2517
|
+
({
|
|
2518
|
+
variant,
|
|
2519
|
+
size,
|
|
2520
|
+
width,
|
|
2274
2521
|
disabled,
|
|
2275
|
-
readOnly,
|
|
2276
|
-
error
|
|
2277
|
-
});
|
|
2278
|
-
const styles = (0, import_system45.useComponentStyles)("TextArea", { variant, size });
|
|
2279
|
-
return /* @__PURE__ */ import_react63.default.createElement(FieldBase, {
|
|
2280
|
-
label,
|
|
2281
|
-
labelProps,
|
|
2282
2522
|
required,
|
|
2283
|
-
|
|
2284
|
-
descriptionProps,
|
|
2523
|
+
readOnly,
|
|
2285
2524
|
error,
|
|
2286
|
-
errorMessage,
|
|
2287
|
-
errorMessageProps,
|
|
2288
|
-
stateProps,
|
|
2289
|
-
variant,
|
|
2290
|
-
size,
|
|
2291
|
-
width
|
|
2292
|
-
}, /* @__PURE__ */ import_react63.default.createElement(import_system45.Box, {
|
|
2293
|
-
as: "textarea",
|
|
2294
|
-
css: styles,
|
|
2295
|
-
ref: textAreaRef,
|
|
2296
2525
|
rows,
|
|
2297
|
-
...
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2526
|
+
...props
|
|
2527
|
+
}, ref) => {
|
|
2528
|
+
const { label, description, errorMessage } = props;
|
|
2529
|
+
const textAreaRef = (0, import_utils22.useObjectRef)(ref);
|
|
2530
|
+
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield.useTextField)(
|
|
2531
|
+
{
|
|
2532
|
+
inputElementType: "textarea",
|
|
2533
|
+
isDisabled: disabled,
|
|
2534
|
+
isRequired: required,
|
|
2535
|
+
isReadOnly: readOnly,
|
|
2536
|
+
validationState: error ? "invalid" : "valid",
|
|
2537
|
+
...props
|
|
2538
|
+
},
|
|
2539
|
+
textAreaRef
|
|
2540
|
+
);
|
|
2541
|
+
const { hoverProps, isHovered } = (0, import_interactions11.useHover)({});
|
|
2542
|
+
const { focusProps, isFocusVisible } = (0, import_focus16.useFocusRing)();
|
|
2543
|
+
const stateProps = (0, import_system48.useStateProps)({
|
|
2544
|
+
hover: isHovered,
|
|
2545
|
+
focus: isFocusVisible,
|
|
2546
|
+
disabled,
|
|
2547
|
+
readOnly,
|
|
2548
|
+
error
|
|
2549
|
+
});
|
|
2550
|
+
const styles = (0, import_system48.useComponentStyles)("TextArea", { variant, size });
|
|
2551
|
+
return /* @__PURE__ */ import_react66.default.createElement(FieldBase, {
|
|
2552
|
+
label,
|
|
2553
|
+
labelProps,
|
|
2554
|
+
required,
|
|
2555
|
+
description,
|
|
2556
|
+
descriptionProps,
|
|
2557
|
+
error,
|
|
2558
|
+
errorMessage,
|
|
2559
|
+
errorMessageProps,
|
|
2560
|
+
stateProps,
|
|
2561
|
+
variant,
|
|
2562
|
+
size,
|
|
2563
|
+
width
|
|
2564
|
+
}, /* @__PURE__ */ import_react66.default.createElement(import_system48.Box, {
|
|
2565
|
+
as: "textarea",
|
|
2566
|
+
css: styles,
|
|
2567
|
+
ref: textAreaRef,
|
|
2568
|
+
rows,
|
|
2569
|
+
...inputProps,
|
|
2570
|
+
...focusProps,
|
|
2571
|
+
...hoverProps,
|
|
2572
|
+
...stateProps
|
|
2573
|
+
}));
|
|
2574
|
+
}
|
|
2575
|
+
);
|
|
2303
2576
|
|
|
2304
2577
|
// src/TextField/TextField.tsx
|
|
2305
|
-
var
|
|
2306
|
-
var
|
|
2578
|
+
var import_react67 = __toESM(require("react"));
|
|
2579
|
+
var import_interactions12 = require("@react-aria/interactions");
|
|
2307
2580
|
var import_focus17 = require("@react-aria/focus");
|
|
2308
2581
|
var import_textfield2 = require("@react-aria/textfield");
|
|
2309
|
-
var
|
|
2310
|
-
var
|
|
2311
|
-
var TextField = (0,
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2582
|
+
var import_utils23 = require("@react-aria/utils");
|
|
2583
|
+
var import_system49 = require("@marigold/system");
|
|
2584
|
+
var TextField = (0, import_react67.forwardRef)(
|
|
2585
|
+
({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
|
|
2586
|
+
const { label, description, errorMessage, autoFocus } = props;
|
|
2587
|
+
const inputRef = (0, import_utils23.useObjectRef)(ref);
|
|
2588
|
+
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield2.useTextField)(
|
|
2589
|
+
{
|
|
2590
|
+
isDisabled: disabled,
|
|
2591
|
+
isRequired: required,
|
|
2592
|
+
isReadOnly: readOnly,
|
|
2593
|
+
validationState: error ? "invalid" : "valid",
|
|
2594
|
+
...props
|
|
2595
|
+
},
|
|
2596
|
+
inputRef
|
|
2597
|
+
);
|
|
2598
|
+
const { hoverProps, isHovered } = (0, import_interactions12.useHover)({});
|
|
2599
|
+
const { focusProps, isFocusVisible } = (0, import_focus17.useFocusRing)({
|
|
2600
|
+
isTextInput: true,
|
|
2601
|
+
autoFocus
|
|
2602
|
+
});
|
|
2603
|
+
const stateProps = (0, import_system49.useStateProps)({
|
|
2604
|
+
hover: isHovered,
|
|
2605
|
+
focus: isFocusVisible,
|
|
2606
|
+
disabled,
|
|
2607
|
+
readOnly,
|
|
2608
|
+
error
|
|
2609
|
+
});
|
|
2610
|
+
return /* @__PURE__ */ import_react67.default.createElement(FieldBase, {
|
|
2611
|
+
label,
|
|
2612
|
+
labelProps,
|
|
2613
|
+
required,
|
|
2614
|
+
description,
|
|
2615
|
+
descriptionProps,
|
|
2616
|
+
error,
|
|
2617
|
+
errorMessage,
|
|
2618
|
+
errorMessageProps,
|
|
2619
|
+
stateProps,
|
|
2620
|
+
variant,
|
|
2621
|
+
size,
|
|
2622
|
+
width
|
|
2623
|
+
}, /* @__PURE__ */ import_react67.default.createElement(Input, {
|
|
2624
|
+
ref: inputRef,
|
|
2625
|
+
variant,
|
|
2626
|
+
size,
|
|
2627
|
+
...inputProps,
|
|
2628
|
+
...focusProps,
|
|
2629
|
+
...hoverProps,
|
|
2630
|
+
...stateProps
|
|
2631
|
+
}));
|
|
2632
|
+
}
|
|
2633
|
+
);
|
|
2356
2634
|
|
|
2357
2635
|
// src/Tiles/Tiles.tsx
|
|
2358
|
-
var
|
|
2359
|
-
var Tiles =
|
|
2360
|
-
ref,
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2636
|
+
var import_react68 = __toESM(require("react"));
|
|
2637
|
+
var Tiles = import_react68.default.forwardRef(
|
|
2638
|
+
({ space = "none", itemMinWidth = "250px", children, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement(import_system.Box, {
|
|
2639
|
+
ref,
|
|
2640
|
+
display: "grid",
|
|
2641
|
+
__baseCSS: {
|
|
2642
|
+
gap: space,
|
|
2643
|
+
gridTemplateColumns: `repeat(auto-fit, minmax(min(${itemMinWidth}, 100%), 1fr))`
|
|
2644
|
+
},
|
|
2645
|
+
...props
|
|
2646
|
+
}, children)
|
|
2647
|
+
);
|
|
2368
2648
|
|
|
2369
2649
|
// src/Tooltip/Tooltip.tsx
|
|
2370
|
-
var
|
|
2650
|
+
var import_react71 = __toESM(require("react"));
|
|
2371
2651
|
var import_tooltip3 = require("@react-aria/tooltip");
|
|
2372
|
-
var
|
|
2652
|
+
var import_system50 = require("@marigold/system");
|
|
2373
2653
|
|
|
2374
2654
|
// src/Tooltip/Context.ts
|
|
2375
|
-
var
|
|
2376
|
-
var TooltipContext = (0,
|
|
2377
|
-
var useTooltipContext = () => (0,
|
|
2655
|
+
var import_react69 = require("react");
|
|
2656
|
+
var TooltipContext = (0, import_react69.createContext)({});
|
|
2657
|
+
var useTooltipContext = () => (0, import_react69.useContext)(TooltipContext);
|
|
2378
2658
|
|
|
2379
2659
|
// src/Tooltip/TooltipTrigger.tsx
|
|
2380
|
-
var
|
|
2660
|
+
var import_react70 = __toESM(require("react"));
|
|
2381
2661
|
var import_focus18 = require("@react-aria/focus");
|
|
2382
2662
|
var import_overlays9 = require("@react-aria/overlays");
|
|
2383
2663
|
var import_tooltip = require("@react-aria/tooltip");
|
|
@@ -2390,7 +2670,7 @@ var TooltipTrigger = ({
|
|
|
2390
2670
|
children,
|
|
2391
2671
|
...rest
|
|
2392
2672
|
}) => {
|
|
2393
|
-
const [tooltipTrigger, tooltip] =
|
|
2673
|
+
const [tooltipTrigger, tooltip] = import_react70.default.Children.toArray(children);
|
|
2394
2674
|
const props = {
|
|
2395
2675
|
...rest,
|
|
2396
2676
|
isDisabled: disabled,
|
|
@@ -2398,10 +2678,14 @@ var TooltipTrigger = ({
|
|
|
2398
2678
|
delay,
|
|
2399
2679
|
placement
|
|
2400
2680
|
};
|
|
2401
|
-
const tooltipTriggerRef = (0,
|
|
2402
|
-
const overlayRef = (0,
|
|
2681
|
+
const tooltipTriggerRef = (0, import_react70.useRef)(null);
|
|
2682
|
+
const overlayRef = (0, import_react70.useRef)(null);
|
|
2403
2683
|
const state = (0, import_tooltip2.useTooltipTriggerState)(props);
|
|
2404
|
-
const { triggerProps, tooltipProps } = (0, import_tooltip.useTooltipTrigger)(
|
|
2684
|
+
const { triggerProps, tooltipProps } = (0, import_tooltip.useTooltipTrigger)(
|
|
2685
|
+
props,
|
|
2686
|
+
state,
|
|
2687
|
+
tooltipTriggerRef
|
|
2688
|
+
);
|
|
2405
2689
|
const {
|
|
2406
2690
|
overlayProps: positionProps,
|
|
2407
2691
|
placement: overlayPlacement,
|
|
@@ -2414,10 +2698,10 @@ var TooltipTrigger = ({
|
|
|
2414
2698
|
isOpen: state.isOpen,
|
|
2415
2699
|
overlayRef
|
|
2416
2700
|
});
|
|
2417
|
-
return /* @__PURE__ */
|
|
2701
|
+
return /* @__PURE__ */ import_react70.default.createElement(import_focus18.FocusableProvider, {
|
|
2418
2702
|
ref: tooltipTriggerRef,
|
|
2419
2703
|
...triggerProps
|
|
2420
|
-
}, tooltipTrigger, /* @__PURE__ */
|
|
2704
|
+
}, tooltipTrigger, /* @__PURE__ */ import_react70.default.createElement(TooltipContext.Provider, {
|
|
2421
2705
|
value: {
|
|
2422
2706
|
state,
|
|
2423
2707
|
overlayRef,
|
|
@@ -2426,7 +2710,7 @@ var TooltipTrigger = ({
|
|
|
2426
2710
|
...tooltipProps,
|
|
2427
2711
|
...positionProps
|
|
2428
2712
|
}
|
|
2429
|
-
}, /* @__PURE__ */
|
|
2713
|
+
}, /* @__PURE__ */ import_react70.default.createElement(Overlay, {
|
|
2430
2714
|
open: state.isOpen
|
|
2431
2715
|
}, tooltip)));
|
|
2432
2716
|
};
|
|
@@ -2435,14 +2719,18 @@ var TooltipTrigger = ({
|
|
|
2435
2719
|
var Tooltip = ({ children, variant, size }) => {
|
|
2436
2720
|
const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
|
|
2437
2721
|
const { tooltipProps } = (0, import_tooltip3.useTooltip)({}, state);
|
|
2438
|
-
const styles = (0,
|
|
2439
|
-
|
|
2722
|
+
const styles = (0, import_system50.useComponentStyles)(
|
|
2723
|
+
"Tooltip",
|
|
2724
|
+
{ variant, size },
|
|
2725
|
+
{ parts: ["container", "arrow"] }
|
|
2726
|
+
);
|
|
2727
|
+
return /* @__PURE__ */ import_react71.default.createElement(import_system50.Box, {
|
|
2440
2728
|
...tooltipProps,
|
|
2441
2729
|
...rest,
|
|
2442
2730
|
ref: overlayRef,
|
|
2443
2731
|
css: styles.container,
|
|
2444
2732
|
"data-placement": placement
|
|
2445
|
-
}, /* @__PURE__ */
|
|
2733
|
+
}, /* @__PURE__ */ import_react71.default.createElement("div", null, children), /* @__PURE__ */ import_react71.default.createElement(import_system50.Box, {
|
|
2446
2734
|
...arrowProps,
|
|
2447
2735
|
__baseCSS: {
|
|
2448
2736
|
position: "absolute",
|
|
@@ -2483,6 +2771,7 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
2483
2771
|
Input,
|
|
2484
2772
|
Label,
|
|
2485
2773
|
Link,
|
|
2774
|
+
List,
|
|
2486
2775
|
MarigoldProvider,
|
|
2487
2776
|
Menu,
|
|
2488
2777
|
Message,
|
|
@@ -2505,6 +2794,8 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
2505
2794
|
Tooltip,
|
|
2506
2795
|
Underlay,
|
|
2507
2796
|
VisuallyHidden,
|
|
2797
|
+
useAsyncList,
|
|
2508
2798
|
useCheckboxGroupContext,
|
|
2799
|
+
useListData,
|
|
2509
2800
|
useTheme
|
|
2510
2801
|
});
|