@marigold/components 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/index.d.ts +33 -27
- package/dist/index.js +298 -212
- package/dist/index.mjs +279 -194
- package/package.json +7 -3
package/dist/index.mjs
CHANGED
|
@@ -78,10 +78,10 @@ var Inline = (_a) => {
|
|
|
78
78
|
"children"
|
|
79
79
|
]);
|
|
80
80
|
return /* @__PURE__ */ React.createElement(Box, __spreadValues({
|
|
81
|
+
__baseCSS: { gap: space, flexWrap: "wrap" },
|
|
81
82
|
display: "inline-flex",
|
|
82
|
-
css: { "> * + *": { pl: space } },
|
|
83
83
|
alignItems: ALIGNMENT[align]
|
|
84
|
-
}, props), Children2.map(flattenChildren(children), (child) =>
|
|
84
|
+
}, props), Children2.map(flattenChildren(children), (child) => child));
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
// src/Stack/Stack.tsx
|
|
@@ -127,45 +127,8 @@ var ActionGroup = (_a) => {
|
|
|
127
127
|
}, props), children);
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
// src/Alert/Alert.tsx
|
|
131
|
-
import React4 from "react";
|
|
132
|
-
import { Exclamation, Check, Notification } from "@marigold/icons";
|
|
133
|
-
var ICON_MAP = {
|
|
134
|
-
success: Check,
|
|
135
|
-
warning: Notification,
|
|
136
|
-
error: Exclamation
|
|
137
|
-
};
|
|
138
|
-
var Alert = (_a) => {
|
|
139
|
-
var _b = _a, {
|
|
140
|
-
variant = "success",
|
|
141
|
-
children
|
|
142
|
-
} = _b, props = __objRest(_b, [
|
|
143
|
-
"variant",
|
|
144
|
-
"children"
|
|
145
|
-
]);
|
|
146
|
-
const Icon = ICON_MAP[variant];
|
|
147
|
-
return /* @__PURE__ */ React4.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
148
|
-
display: "flex",
|
|
149
|
-
variant: `alert.${variant}`
|
|
150
|
-
}), /* @__PURE__ */ React4.createElement(Box, {
|
|
151
|
-
display: "inline-block",
|
|
152
|
-
alignItems: "center",
|
|
153
|
-
width: "32px",
|
|
154
|
-
height: "32px",
|
|
155
|
-
bg: variant
|
|
156
|
-
}, /* @__PURE__ */ React4.createElement(Box, {
|
|
157
|
-
as: Icon,
|
|
158
|
-
size: 12,
|
|
159
|
-
color: "#fff",
|
|
160
|
-
bg: variant,
|
|
161
|
-
m: 10
|
|
162
|
-
})), /* @__PURE__ */ React4.createElement(Box, {
|
|
163
|
-
mx: "16px"
|
|
164
|
-
}, children));
|
|
165
|
-
};
|
|
166
|
-
|
|
167
130
|
// src/Badge/Badge.tsx
|
|
168
|
-
import
|
|
131
|
+
import React4 from "react";
|
|
169
132
|
var Badge = (_a) => {
|
|
170
133
|
var _b = _a, {
|
|
171
134
|
variant = "",
|
|
@@ -178,14 +141,14 @@ var Badge = (_a) => {
|
|
|
178
141
|
"borderColor",
|
|
179
142
|
"children"
|
|
180
143
|
]);
|
|
181
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ React4.createElement(Box, __spreadValues({
|
|
182
145
|
css: { bg: bgColor, borderColor },
|
|
183
146
|
variant: `badge.${variant}`
|
|
184
147
|
}, props), children);
|
|
185
148
|
};
|
|
186
149
|
|
|
187
150
|
// src/Button/Button.tsx
|
|
188
|
-
import
|
|
151
|
+
import React5, { forwardRef } from "react";
|
|
189
152
|
import { useButton } from "@react-aria/button";
|
|
190
153
|
var Button = forwardRef((_a, ref) => {
|
|
191
154
|
var _b = _a, {
|
|
@@ -209,7 +172,7 @@ var Button = forwardRef((_a, ref) => {
|
|
|
209
172
|
elementType: typeof as === "string" ? as : "span",
|
|
210
173
|
isDisabled: disabled
|
|
211
174
|
}), ref);
|
|
212
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ React5.createElement(Box, __spreadProps(__spreadValues(__spreadValues({}, buttonProps), props), {
|
|
213
176
|
as,
|
|
214
177
|
display: "inline-flex",
|
|
215
178
|
alignItems: "center",
|
|
@@ -221,7 +184,7 @@ var Button = forwardRef((_a, ref) => {
|
|
|
221
184
|
});
|
|
222
185
|
|
|
223
186
|
// src/Card/Card.tsx
|
|
224
|
-
import
|
|
187
|
+
import React6 from "react";
|
|
225
188
|
var Card = (_a) => {
|
|
226
189
|
var _b = _a, {
|
|
227
190
|
variant = "",
|
|
@@ -236,11 +199,11 @@ var Card = (_a) => {
|
|
|
236
199
|
"className",
|
|
237
200
|
"children"
|
|
238
201
|
]);
|
|
239
|
-
return /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ React6.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
240
203
|
variant: `card.${variant}`,
|
|
241
204
|
maxWidth: width,
|
|
242
205
|
className
|
|
243
|
-
}), title && /* @__PURE__ */
|
|
206
|
+
}), title && /* @__PURE__ */ React6.createElement(Box, {
|
|
244
207
|
as: "h2",
|
|
245
208
|
variant: "text.h2",
|
|
246
209
|
pb: "small"
|
|
@@ -248,7 +211,7 @@ var Card = (_a) => {
|
|
|
248
211
|
};
|
|
249
212
|
|
|
250
213
|
// src/Checkbox/Checkbox.tsx
|
|
251
|
-
import
|
|
214
|
+
import React10 from "react";
|
|
252
215
|
import { useFocusRing } from "@react-aria/focus";
|
|
253
216
|
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
254
217
|
import { useCheckbox } from "@react-aria/checkbox";
|
|
@@ -348,15 +311,16 @@ function useToggleState(props) {
|
|
|
348
311
|
}
|
|
349
312
|
|
|
350
313
|
// src/Checkbox/Checkbox.tsx
|
|
351
|
-
import { Exclamation
|
|
314
|
+
import { Exclamation } from "@marigold/icons";
|
|
352
315
|
|
|
353
316
|
// src/Checkbox/CheckboxIcon.tsx
|
|
354
|
-
import
|
|
317
|
+
import React7 from "react";
|
|
355
318
|
import { conditional, SVG } from "@marigold/system";
|
|
356
319
|
var CheckboxIcon = ({
|
|
357
320
|
variant = "",
|
|
358
321
|
checked = false,
|
|
359
322
|
disabled = false,
|
|
323
|
+
indeterminated,
|
|
360
324
|
error = false
|
|
361
325
|
}) => {
|
|
362
326
|
const conditionalStates = disabled ? {
|
|
@@ -365,13 +329,13 @@ var CheckboxIcon = ({
|
|
|
365
329
|
checked,
|
|
366
330
|
error
|
|
367
331
|
};
|
|
368
|
-
return /* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ React7.createElement(SVG, {
|
|
369
333
|
width: "16",
|
|
370
334
|
height: "32",
|
|
371
335
|
viewBox: "0 0 16 32",
|
|
372
336
|
fill: "none",
|
|
373
337
|
"aria-hidden": "true"
|
|
374
|
-
}, /* @__PURE__ */
|
|
338
|
+
}, /* @__PURE__ */ React7.createElement(Box, {
|
|
375
339
|
as: "rect",
|
|
376
340
|
x: "0.5",
|
|
377
341
|
y: "8.5",
|
|
@@ -379,7 +343,13 @@ var CheckboxIcon = ({
|
|
|
379
343
|
height: "15px",
|
|
380
344
|
rx: "1.5",
|
|
381
345
|
variant: conditional(`checkbox.${variant}`, conditionalStates)
|
|
382
|
-
}), checked && /* @__PURE__ */
|
|
346
|
+
}), checked && indeterminated && /* @__PURE__ */ React7.createElement(Box, {
|
|
347
|
+
__baseCSS: { fill: "gray00" },
|
|
348
|
+
as: "path",
|
|
349
|
+
fillRule: "evenodd",
|
|
350
|
+
clipRule: "evenodd",
|
|
351
|
+
d: "M13.5 17.0402H2.5V15.4688H13.5V17.0402V17.0402Z"
|
|
352
|
+
}), checked && !indeterminated && /* @__PURE__ */ React7.createElement(Box, {
|
|
383
353
|
__baseCSS: { fill: "gray00" },
|
|
384
354
|
as: "path",
|
|
385
355
|
fillRule: "evenodd",
|
|
@@ -389,7 +359,7 @@ var CheckboxIcon = ({
|
|
|
389
359
|
};
|
|
390
360
|
|
|
391
361
|
// src/Label/Label.tsx
|
|
392
|
-
import
|
|
362
|
+
import React8 from "react";
|
|
393
363
|
import { Required } from "@marigold/icons";
|
|
394
364
|
var LabelBase = (_a) => {
|
|
395
365
|
var _b = _a, {
|
|
@@ -403,7 +373,7 @@ var LabelBase = (_a) => {
|
|
|
403
373
|
"color",
|
|
404
374
|
"children"
|
|
405
375
|
]);
|
|
406
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ React8.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
407
377
|
as: "label",
|
|
408
378
|
__baseCSS: { color },
|
|
409
379
|
variant: `label.${variant}`
|
|
@@ -417,19 +387,18 @@ var Label = (_a) => {
|
|
|
417
387
|
"required",
|
|
418
388
|
"children"
|
|
419
389
|
]);
|
|
420
|
-
return required ? /* @__PURE__ */
|
|
390
|
+
return required ? /* @__PURE__ */ React8.createElement(Box, {
|
|
421
391
|
as: "span",
|
|
422
392
|
display: "inline-flex",
|
|
423
393
|
alignItems: "center"
|
|
424
|
-
}, /* @__PURE__ */
|
|
425
|
-
as: Required,
|
|
394
|
+
}, /* @__PURE__ */ React8.createElement(LabelBase, __spreadValues({}, props), children), required && /* @__PURE__ */ React8.createElement(Required, {
|
|
426
395
|
size: 16,
|
|
427
|
-
|
|
428
|
-
})) : /* @__PURE__ */
|
|
396
|
+
fill: "error"
|
|
397
|
+
})) : /* @__PURE__ */ React8.createElement(LabelBase, __spreadValues({}, props), children);
|
|
429
398
|
};
|
|
430
399
|
|
|
431
400
|
// src/ValidationMessage/ValidationMessage.tsx
|
|
432
|
-
import
|
|
401
|
+
import React9 from "react";
|
|
433
402
|
var ValidationMessage = (_a) => {
|
|
434
403
|
var _b = _a, {
|
|
435
404
|
variant = "error",
|
|
@@ -440,7 +409,7 @@ var ValidationMessage = (_a) => {
|
|
|
440
409
|
"children",
|
|
441
410
|
"className"
|
|
442
411
|
]);
|
|
443
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ React9.createElement(Box, __spreadValues({
|
|
444
413
|
as: "span",
|
|
445
414
|
display: "flex",
|
|
446
415
|
alignItems: "center",
|
|
@@ -451,20 +420,27 @@ var ValidationMessage = (_a) => {
|
|
|
451
420
|
|
|
452
421
|
// src/Checkbox/Checkbox.tsx
|
|
453
422
|
var CheckboxInput = (_a) => {
|
|
454
|
-
var _b = _a, {
|
|
423
|
+
var _b = _a, {
|
|
424
|
+
error,
|
|
425
|
+
indeterminated = false
|
|
426
|
+
} = _b, props = __objRest(_b, [
|
|
427
|
+
"error",
|
|
428
|
+
"indeterminated"
|
|
429
|
+
]);
|
|
455
430
|
const state = useToggleState(props);
|
|
456
|
-
const ref =
|
|
431
|
+
const ref = React10.useRef(null);
|
|
457
432
|
const { inputProps } = useCheckbox(props, state, ref);
|
|
458
433
|
const { focusProps } = useFocusRing();
|
|
459
434
|
const _a2 = props, { children } = _a2, restProps = __objRest(_a2, ["children"]);
|
|
460
|
-
return /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ React10.createElement(Box, {
|
|
461
436
|
pr: "xsmall"
|
|
462
|
-
}, /* @__PURE__ */
|
|
437
|
+
}, /* @__PURE__ */ React10.createElement(VisuallyHidden, null, /* @__PURE__ */ React10.createElement("input", __spreadValues(__spreadProps(__spreadValues(__spreadValues({}, inputProps), focusProps), {
|
|
463
438
|
ref
|
|
464
|
-
}), restProps))), /* @__PURE__ */
|
|
439
|
+
}), restProps))), /* @__PURE__ */ React10.createElement(CheckboxIcon, {
|
|
465
440
|
checked: props.checked,
|
|
466
441
|
variant: props.variant,
|
|
467
442
|
disabled: props.disabled,
|
|
443
|
+
indeterminated,
|
|
468
444
|
error
|
|
469
445
|
}));
|
|
470
446
|
};
|
|
@@ -478,7 +454,7 @@ var Checkbox = (_a) => {
|
|
|
478
454
|
"labelVariant",
|
|
479
455
|
"errorMessage"
|
|
480
456
|
]);
|
|
481
|
-
return /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(Box, {
|
|
482
458
|
as: Label,
|
|
483
459
|
__baseCSS: {
|
|
484
460
|
":hover": { cursor: props.disabled ? "not-allowed" : "pointer" }
|
|
@@ -487,16 +463,15 @@ var Checkbox = (_a) => {
|
|
|
487
463
|
required,
|
|
488
464
|
variant: `label.${labelVariant}`,
|
|
489
465
|
color: props.disabled ? "disabled" : "text"
|
|
490
|
-
}, /* @__PURE__ */
|
|
491
|
-
as: CheckboxInput,
|
|
466
|
+
}, /* @__PURE__ */ React10.createElement(CheckboxInput, __spreadValues({
|
|
492
467
|
error: props.error
|
|
493
|
-
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */
|
|
468
|
+
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */ React10.createElement(ValidationMessage, null, /* @__PURE__ */ React10.createElement(Exclamation, {
|
|
494
469
|
size: 16
|
|
495
470
|
}), errorMessage));
|
|
496
471
|
};
|
|
497
472
|
|
|
498
473
|
// src/Column/Column.tsx
|
|
499
|
-
import
|
|
474
|
+
import React11 from "react";
|
|
500
475
|
var transform = (width) => {
|
|
501
476
|
if (Array.isArray(width)) {
|
|
502
477
|
return width.map((v) => `${v / 12 * 100}%`);
|
|
@@ -511,13 +486,13 @@ var Column = (_a) => {
|
|
|
511
486
|
"width",
|
|
512
487
|
"children"
|
|
513
488
|
]);
|
|
514
|
-
return /* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ React11.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
515
490
|
width: transform(width)
|
|
516
491
|
}), children);
|
|
517
492
|
};
|
|
518
493
|
|
|
519
494
|
// src/Columns/Columns.tsx
|
|
520
|
-
import
|
|
495
|
+
import React12, { Children as Children4 } from "react";
|
|
521
496
|
import { useTheme } from "@marigold/system";
|
|
522
497
|
var useAlignment = (direction) => {
|
|
523
498
|
switch (direction) {
|
|
@@ -549,11 +524,11 @@ var Columns = (_a) => {
|
|
|
549
524
|
const { css } = useTheme();
|
|
550
525
|
const spaceObject = css({ space });
|
|
551
526
|
const spaceValue = Object.values(spaceObject)[0];
|
|
552
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ React12.createElement(Box, {
|
|
553
528
|
p: space,
|
|
554
529
|
display: "flex",
|
|
555
530
|
className
|
|
556
|
-
}, /* @__PURE__ */
|
|
531
|
+
}, /* @__PURE__ */ React12.createElement(Box, __spreadValues({
|
|
557
532
|
width: `calc(100% + ${spaceValue}px)`,
|
|
558
533
|
m: `${-spaceValue / 2}px`,
|
|
559
534
|
display: "flex",
|
|
@@ -561,21 +536,21 @@ var Columns = (_a) => {
|
|
|
561
536
|
alignItems,
|
|
562
537
|
justifyContent
|
|
563
538
|
}, props), Children4.map(flattenChildren(children), (child) => {
|
|
564
|
-
return
|
|
539
|
+
return React12.cloneElement(child, {}, /* @__PURE__ */ React12.createElement(Box, {
|
|
565
540
|
css: { p: `${spaceValue / 2}px` }
|
|
566
541
|
}, child.props.children));
|
|
567
542
|
})));
|
|
568
543
|
};
|
|
569
544
|
|
|
570
545
|
// src/Dialog/Dialog.tsx
|
|
571
|
-
import
|
|
546
|
+
import React15 from "react";
|
|
572
547
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
573
548
|
import { OverlayContainer } from "@react-aria/overlays";
|
|
574
549
|
import { useButton as useButton2 } from "@react-aria/button";
|
|
575
550
|
import { Close } from "@marigold/icons";
|
|
576
551
|
|
|
577
552
|
// src/Text/Text.tsx
|
|
578
|
-
import
|
|
553
|
+
import React13, { forwardRef as forwardRef2 } from "react";
|
|
579
554
|
var Text = forwardRef2((_a, ref) => {
|
|
580
555
|
var _b = _a, {
|
|
581
556
|
as = "span",
|
|
@@ -598,7 +573,7 @@ var Text = forwardRef2((_a, ref) => {
|
|
|
598
573
|
"outline",
|
|
599
574
|
"userSelect"
|
|
600
575
|
]);
|
|
601
|
-
return /* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ React13.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
602
577
|
as,
|
|
603
578
|
variant: `text.${variant}`,
|
|
604
579
|
css: {
|
|
@@ -614,7 +589,7 @@ var Text = forwardRef2((_a, ref) => {
|
|
|
614
589
|
});
|
|
615
590
|
|
|
616
591
|
// src/Dialog/ModalDialog.tsx
|
|
617
|
-
import
|
|
592
|
+
import React14 from "react";
|
|
618
593
|
import {
|
|
619
594
|
useOverlay,
|
|
620
595
|
usePreventScroll,
|
|
@@ -633,12 +608,12 @@ var ModalDialog = (_a) => {
|
|
|
633
608
|
"children"
|
|
634
609
|
]);
|
|
635
610
|
const _a2 = props, { isDismissable, isOpen, onClose } = _a2, restProps = __objRest(_a2, ["isDismissable", "isOpen", "onClose"]);
|
|
636
|
-
const ref =
|
|
611
|
+
const ref = React14.useRef();
|
|
637
612
|
const { overlayProps, underlayProps } = useOverlay({ isDismissable, isOpen, onClose }, ref);
|
|
638
613
|
usePreventScroll();
|
|
639
614
|
const { modalProps } = useModal();
|
|
640
615
|
const { dialogProps } = useDialog(props, ref);
|
|
641
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ React14.createElement(Box, __spreadValues({
|
|
642
617
|
__baseCSS: {
|
|
643
618
|
display: "grid",
|
|
644
619
|
placeItems: "center",
|
|
@@ -650,11 +625,11 @@ var ModalDialog = (_a) => {
|
|
|
650
625
|
right: 0
|
|
651
626
|
},
|
|
652
627
|
variant: `dialog.${backdropVariant}`
|
|
653
|
-
}, underlayProps), /* @__PURE__ */
|
|
628
|
+
}, underlayProps), /* @__PURE__ */ React14.createElement(FocusScope, {
|
|
654
629
|
contain: true,
|
|
655
630
|
restoreFocus: true,
|
|
656
631
|
autoFocus: true
|
|
657
|
-
}, /* @__PURE__ */
|
|
632
|
+
}, /* @__PURE__ */ React14.createElement(Box, __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, overlayProps), dialogProps), modalProps), {
|
|
658
633
|
ref,
|
|
659
634
|
variant: variant ? `dialog.${variant}` : `dialog`
|
|
660
635
|
}), restProps), children)));
|
|
@@ -679,17 +654,17 @@ var Dialog = (_a) => {
|
|
|
679
654
|
"title",
|
|
680
655
|
"variant"
|
|
681
656
|
]);
|
|
682
|
-
const closeButtonRef =
|
|
657
|
+
const closeButtonRef = React15.useRef();
|
|
683
658
|
const { buttonProps: closeButtonProps } = useButton2({
|
|
684
659
|
onPress: () => close()
|
|
685
660
|
}, closeButtonRef);
|
|
686
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ React15.createElement(OverlayContainer, null, /* @__PURE__ */ React15.createElement(ModalDialog, __spreadValues({
|
|
687
662
|
variant,
|
|
688
663
|
backdropVariant,
|
|
689
664
|
isOpen,
|
|
690
665
|
onClose: close,
|
|
691
666
|
isDismissable: true
|
|
692
|
-
}, props), /* @__PURE__ */
|
|
667
|
+
}, props), /* @__PURE__ */ React15.createElement(Box, {
|
|
693
668
|
__baseCSS: {
|
|
694
669
|
display: "flex",
|
|
695
670
|
justifyContent: "space-between",
|
|
@@ -698,12 +673,12 @@ var Dialog = (_a) => {
|
|
|
698
673
|
pb: "large"
|
|
699
674
|
},
|
|
700
675
|
className
|
|
701
|
-
}, /* @__PURE__ */
|
|
676
|
+
}, /* @__PURE__ */ React15.createElement(Box, {
|
|
702
677
|
pt: "medium"
|
|
703
|
-
}, title && /* @__PURE__ */
|
|
678
|
+
}, title && /* @__PURE__ */ React15.createElement(Text, {
|
|
704
679
|
as: "h4",
|
|
705
680
|
variant: "headline4"
|
|
706
|
-
}, title), children), /* @__PURE__ */
|
|
681
|
+
}, title), children), /* @__PURE__ */ React15.createElement(Box, {
|
|
707
682
|
__baseCSS: {
|
|
708
683
|
display: "flex",
|
|
709
684
|
justifyContent: "flex-end",
|
|
@@ -711,7 +686,7 @@ var Dialog = (_a) => {
|
|
|
711
686
|
paddingTop: "xsmall",
|
|
712
687
|
paddingX: "xsmall"
|
|
713
688
|
}
|
|
714
|
-
}, /* @__PURE__ */
|
|
689
|
+
}, /* @__PURE__ */ React15.createElement(Box, __spreadProps(__spreadValues({
|
|
715
690
|
as: Button,
|
|
716
691
|
__baseCSS: {
|
|
717
692
|
color: "text",
|
|
@@ -729,13 +704,13 @@ var Dialog = (_a) => {
|
|
|
729
704
|
}
|
|
730
705
|
}, closeButtonProps), {
|
|
731
706
|
ref: closeButtonRef
|
|
732
|
-
}), /* @__PURE__ */
|
|
707
|
+
}), /* @__PURE__ */ React15.createElement(Close, {
|
|
733
708
|
size: 16
|
|
734
709
|
}))))));
|
|
735
710
|
};
|
|
736
711
|
var useDialogButtonProps = () => {
|
|
737
712
|
const state = useOverlayTriggerState({});
|
|
738
|
-
const openButtonRef =
|
|
713
|
+
const openButtonRef = React15.useRef();
|
|
739
714
|
const { buttonProps: openButtonProps } = useButton2({
|
|
740
715
|
onPress: () => state.open()
|
|
741
716
|
}, openButtonRef);
|
|
@@ -747,21 +722,21 @@ var useDialogButtonProps = () => {
|
|
|
747
722
|
};
|
|
748
723
|
|
|
749
724
|
// src/Divider/Divider.tsx
|
|
750
|
-
import
|
|
725
|
+
import React16 from "react";
|
|
751
726
|
import { useSeparator } from "@react-aria/separator";
|
|
752
727
|
var Divider = (_a) => {
|
|
753
728
|
var _b = _a, { variant = "" } = _b, props = __objRest(_b, ["variant"]);
|
|
754
729
|
const { separatorProps } = useSeparator(props);
|
|
755
|
-
return /* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ React16.createElement(Box, __spreadValues(__spreadValues({
|
|
756
731
|
__baseCSS: { width: "100%", height: "1px", m: "none", bg: "text" },
|
|
757
732
|
variant: `divider.${variant}`
|
|
758
733
|
}, props), separatorProps));
|
|
759
734
|
};
|
|
760
735
|
|
|
761
736
|
// src/Field/Field.tsx
|
|
762
|
-
import
|
|
737
|
+
import React17, { useRef as useRef2 } from "react";
|
|
763
738
|
import { useTextField } from "@react-aria/textfield";
|
|
764
|
-
import { Exclamation as
|
|
739
|
+
import { Exclamation as Exclamation2 } from "@marigold/icons";
|
|
765
740
|
var Field = (_a) => {
|
|
766
741
|
var _b = _a, {
|
|
767
742
|
type = "text",
|
|
@@ -782,18 +757,18 @@ var Field = (_a) => {
|
|
|
782
757
|
]);
|
|
783
758
|
const ref = useRef2(null);
|
|
784
759
|
const { labelProps, inputProps, errorMessageProps } = useTextField(props, ref);
|
|
785
|
-
return /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(Label, __spreadValues({
|
|
786
761
|
variant: labelVariant,
|
|
787
762
|
htmlFor,
|
|
788
763
|
required
|
|
789
|
-
}, labelProps), props.label), /* @__PURE__ */
|
|
764
|
+
}, labelProps), props.label), /* @__PURE__ */ React17.createElement(Box, __spreadValues(__spreadProps(__spreadValues({
|
|
790
765
|
as: "input",
|
|
791
766
|
type,
|
|
792
767
|
id: htmlFor,
|
|
793
768
|
variant: `input.${variant}`
|
|
794
769
|
}, inputProps), {
|
|
795
770
|
ref
|
|
796
|
-
}), props)), error && errorMessage && /* @__PURE__ */
|
|
771
|
+
}), props)), error && errorMessage && /* @__PURE__ */ React17.createElement(ValidationMessage, __spreadValues({}, errorMessageProps), /* @__PURE__ */ React17.createElement(Exclamation2, {
|
|
797
772
|
size: 16
|
|
798
773
|
}), errorMessage));
|
|
799
774
|
};
|
|
@@ -802,21 +777,21 @@ var Field = (_a) => {
|
|
|
802
777
|
import { VisuallyHidden as VisuallyHidden2 } from "@react-aria/visually-hidden";
|
|
803
778
|
|
|
804
779
|
// src/Image/Image.tsx
|
|
805
|
-
import
|
|
780
|
+
import React18 from "react";
|
|
806
781
|
var Image = (_a) => {
|
|
807
782
|
var _b = _a, {
|
|
808
783
|
variant = "fullWidth"
|
|
809
784
|
} = _b, props = __objRest(_b, [
|
|
810
785
|
"variant"
|
|
811
786
|
]);
|
|
812
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ React18.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
813
788
|
as: "img",
|
|
814
789
|
variant: `image.${variant}`
|
|
815
790
|
}));
|
|
816
791
|
};
|
|
817
792
|
|
|
818
793
|
// src/Link/Link.tsx
|
|
819
|
-
import
|
|
794
|
+
import React19, { useRef as useRef3 } from "react";
|
|
820
795
|
import { useLink } from "@react-aria/link";
|
|
821
796
|
var Link = (_a) => {
|
|
822
797
|
var _b = _a, {
|
|
@@ -835,7 +810,7 @@ var Link = (_a) => {
|
|
|
835
810
|
elementType: typeof as === "string" ? as : "span",
|
|
836
811
|
isDisabled: disabled
|
|
837
812
|
}), ref);
|
|
838
|
-
return /* @__PURE__ */
|
|
813
|
+
return /* @__PURE__ */ React19.createElement(Text, __spreadProps(__spreadValues(__spreadValues({}, props), linkProps), {
|
|
839
814
|
as,
|
|
840
815
|
variant,
|
|
841
816
|
ref
|
|
@@ -843,7 +818,7 @@ var Link = (_a) => {
|
|
|
843
818
|
};
|
|
844
819
|
|
|
845
820
|
// src/Menu/Menu.tsx
|
|
846
|
-
import
|
|
821
|
+
import React20 from "react";
|
|
847
822
|
var Menu = (_a) => {
|
|
848
823
|
var _b = _a, {
|
|
849
824
|
variant = "default",
|
|
@@ -858,12 +833,12 @@ var Menu = (_a) => {
|
|
|
858
833
|
"show",
|
|
859
834
|
"children"
|
|
860
835
|
]);
|
|
861
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ React20.createElement(Box, __spreadValues({
|
|
862
837
|
variant: `menu.${variant}`
|
|
863
|
-
}, props), /* @__PURE__ */
|
|
838
|
+
}, props), /* @__PURE__ */ React20.createElement(Button, {
|
|
864
839
|
onClick,
|
|
865
840
|
variant: "menu"
|
|
866
|
-
}, label), show ? /* @__PURE__ */
|
|
841
|
+
}, label), show ? /* @__PURE__ */ React20.createElement(Box, {
|
|
867
842
|
display: "block",
|
|
868
843
|
position: "absolute",
|
|
869
844
|
minWidth: "120px",
|
|
@@ -872,7 +847,7 @@ var Menu = (_a) => {
|
|
|
872
847
|
};
|
|
873
848
|
|
|
874
849
|
// src/MenuItem/MenuItem.tsx
|
|
875
|
-
import
|
|
850
|
+
import React21 from "react";
|
|
876
851
|
var MenuItem = (_a) => {
|
|
877
852
|
var _b = _a, {
|
|
878
853
|
variant = "default",
|
|
@@ -881,16 +856,16 @@ var MenuItem = (_a) => {
|
|
|
881
856
|
"variant",
|
|
882
857
|
"children"
|
|
883
858
|
]);
|
|
884
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ React21.createElement(Box, {
|
|
885
860
|
variant: `menuItem.${variant}`
|
|
886
|
-
}, /* @__PURE__ */
|
|
861
|
+
}, /* @__PURE__ */ React21.createElement(Link, __spreadValues({
|
|
887
862
|
variant: "menuItemLink"
|
|
888
863
|
}, props), children));
|
|
889
864
|
};
|
|
890
865
|
|
|
891
866
|
// src/Message/Message.tsx
|
|
892
|
-
import
|
|
893
|
-
import { Exclamation as
|
|
867
|
+
import React22 from "react";
|
|
868
|
+
import { Exclamation as Exclamation3, Info, Notification } from "@marigold/icons";
|
|
894
869
|
var Message = (_a) => {
|
|
895
870
|
var _b = _a, {
|
|
896
871
|
messageTitle,
|
|
@@ -903,25 +878,25 @@ var Message = (_a) => {
|
|
|
903
878
|
"className",
|
|
904
879
|
"children"
|
|
905
880
|
]);
|
|
906
|
-
var icon = /* @__PURE__ */
|
|
881
|
+
var icon = /* @__PURE__ */ React22.createElement(Info, null);
|
|
907
882
|
if (variant === "warning") {
|
|
908
|
-
icon = /* @__PURE__ */
|
|
883
|
+
icon = /* @__PURE__ */ React22.createElement(Notification, null);
|
|
909
884
|
}
|
|
910
885
|
if (variant === "error") {
|
|
911
|
-
icon = /* @__PURE__ */
|
|
886
|
+
icon = /* @__PURE__ */ React22.createElement(Exclamation3, null);
|
|
912
887
|
}
|
|
913
|
-
return /* @__PURE__ */
|
|
888
|
+
return /* @__PURE__ */ React22.createElement(Box, __spreadValues({
|
|
914
889
|
display: "inline-block",
|
|
915
890
|
variant: `message.${variant}`,
|
|
916
891
|
className
|
|
917
|
-
}, props), /* @__PURE__ */
|
|
892
|
+
}, props), /* @__PURE__ */ React22.createElement(Box, {
|
|
918
893
|
display: "flex",
|
|
919
894
|
alignItems: "center",
|
|
920
895
|
variant: "message.title"
|
|
921
|
-
}, icon, /* @__PURE__ */
|
|
896
|
+
}, icon, /* @__PURE__ */ React22.createElement(Text, {
|
|
922
897
|
as: "h4",
|
|
923
898
|
variant: "headline4"
|
|
924
|
-
}, messageTitle)), /* @__PURE__ */
|
|
899
|
+
}, messageTitle)), /* @__PURE__ */ React22.createElement(Box, {
|
|
925
900
|
css: { color: "black" }
|
|
926
901
|
}, children));
|
|
927
902
|
};
|
|
@@ -931,7 +906,7 @@ import { useTheme as useTheme3, ThemeProvider as ThemeProvider2 } from "@marigol
|
|
|
931
906
|
import { SSRProvider } from "@react-aria/ssr";
|
|
932
907
|
|
|
933
908
|
// src/Provider/MarigoldProvider.tsx
|
|
934
|
-
import
|
|
909
|
+
import React23 from "react";
|
|
935
910
|
import { OverlayProvider } from "@react-aria/overlays";
|
|
936
911
|
import {
|
|
937
912
|
Global,
|
|
@@ -945,19 +920,19 @@ function MarigoldProvider({
|
|
|
945
920
|
}) {
|
|
946
921
|
const outer = useTheme2();
|
|
947
922
|
const isTopLevel = outer.theme === __defaultTheme;
|
|
948
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ React23.createElement(ThemeProvider, {
|
|
949
924
|
theme
|
|
950
|
-
}, isTopLevel ? /* @__PURE__ */
|
|
925
|
+
}, isTopLevel ? /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Global, null), /* @__PURE__ */ React23.createElement(OverlayProvider, null, children)) : children);
|
|
951
926
|
}
|
|
952
927
|
|
|
953
928
|
// src/Radio/Radio.tsx
|
|
954
|
-
import
|
|
955
|
-
import { Exclamation as
|
|
929
|
+
import React25 from "react";
|
|
930
|
+
import { Exclamation as Exclamation4 } from "@marigold/icons";
|
|
956
931
|
import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
957
932
|
import { VisuallyHidden as VisuallyHidden3 } from "@react-aria/visually-hidden";
|
|
958
933
|
|
|
959
934
|
// src/Radio/RadioIcon.tsx
|
|
960
|
-
import
|
|
935
|
+
import React24 from "react";
|
|
961
936
|
import { conditional as conditional2, SVG as SVG2 } from "@marigold/system";
|
|
962
937
|
var RadioIcon = ({
|
|
963
938
|
variant = "",
|
|
@@ -971,19 +946,19 @@ var RadioIcon = ({
|
|
|
971
946
|
checked,
|
|
972
947
|
error
|
|
973
948
|
};
|
|
974
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ React24.createElement(SVG2, {
|
|
975
950
|
width: "16",
|
|
976
951
|
height: "32",
|
|
977
952
|
viewBox: "0 0 16 32",
|
|
978
953
|
fill: "none",
|
|
979
954
|
"aria-hidden": "true"
|
|
980
|
-
}, /* @__PURE__ */
|
|
955
|
+
}, /* @__PURE__ */ React24.createElement(Box, {
|
|
981
956
|
variant: conditional2(`radio.${variant}`, conditionalStates),
|
|
982
957
|
as: "circle",
|
|
983
958
|
cx: "8",
|
|
984
959
|
cy: "16",
|
|
985
960
|
r: "7.5"
|
|
986
|
-
}), checked && /* @__PURE__ */
|
|
961
|
+
}), checked && /* @__PURE__ */ React24.createElement("circle", {
|
|
987
962
|
fill: "white",
|
|
988
963
|
cx: "8",
|
|
989
964
|
cy: "16",
|
|
@@ -996,12 +971,12 @@ var RadioInput = (_a) => {
|
|
|
996
971
|
var _b = _a, { error } = _b, props = __objRest(_b, ["error"]);
|
|
997
972
|
const { focusProps } = useFocusRing2();
|
|
998
973
|
const _a2 = props, { children } = _a2, restProps = __objRest(_a2, ["children"]);
|
|
999
|
-
return /* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ React25.createElement(Box, {
|
|
1000
975
|
pr: "xsmall"
|
|
1001
|
-
}, /* @__PURE__ */
|
|
976
|
+
}, /* @__PURE__ */ React25.createElement(VisuallyHidden3, null, /* @__PURE__ */ React25.createElement("input", __spreadValues(__spreadValues({
|
|
1002
977
|
type: "radio",
|
|
1003
978
|
disabled: props.disabled
|
|
1004
|
-
}, focusProps), restProps))), /* @__PURE__ */
|
|
979
|
+
}, focusProps), restProps))), /* @__PURE__ */ React25.createElement(RadioIcon, {
|
|
1005
980
|
variant: props.variant,
|
|
1006
981
|
disabled: props.disabled,
|
|
1007
982
|
checked: props.checked,
|
|
@@ -1018,34 +993,22 @@ var Radio = (_a) => {
|
|
|
1018
993
|
"labelVariant",
|
|
1019
994
|
"errorMessage"
|
|
1020
995
|
]);
|
|
1021
|
-
return /* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(Box, {
|
|
1022
997
|
as: Label,
|
|
1023
998
|
htmlFor: props.id,
|
|
1024
999
|
required,
|
|
1025
1000
|
variant: `label.${labelVariant}`,
|
|
1026
1001
|
css: props.disabled ? { color: "disabled", ":hover": { cursor: "not-allowed" } } : { color: "text", ":hover": { cursor: "pointer" } }
|
|
1027
|
-
}, /* @__PURE__ */
|
|
1002
|
+
}, /* @__PURE__ */ React25.createElement(Box, __spreadValues({
|
|
1028
1003
|
as: RadioInput,
|
|
1029
1004
|
error: props.error
|
|
1030
|
-
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */
|
|
1005
|
+
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */ React25.createElement(ValidationMessage, null, /* @__PURE__ */ React25.createElement(Exclamation4, {
|
|
1031
1006
|
size: 16
|
|
1032
1007
|
}), errorMessage));
|
|
1033
1008
|
};
|
|
1034
1009
|
|
|
1035
|
-
// src/Slider/Slider.tsx
|
|
1036
|
-
import React27 from "react";
|
|
1037
|
-
var Slider = (_a) => {
|
|
1038
|
-
var _b = _a, { variant = "" } = _b, props = __objRest(_b, ["variant"]);
|
|
1039
|
-
return /* @__PURE__ */ React27.createElement(Box, __spreadValues({
|
|
1040
|
-
as: "input",
|
|
1041
|
-
type: "range",
|
|
1042
|
-
css: { verticalAlign: "middle" },
|
|
1043
|
-
variant: `slider.${variant}`
|
|
1044
|
-
}, props));
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
1010
|
// src/Select/Select.tsx
|
|
1048
|
-
import
|
|
1011
|
+
import React30, { useRef as useRef6 } from "react";
|
|
1049
1012
|
import { useSelectState } from "@react-stately/select";
|
|
1050
1013
|
import { useButton as useButton3 } from "@react-aria/button";
|
|
1051
1014
|
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
|
@@ -1053,14 +1016,14 @@ import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
|
1053
1016
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
1054
1017
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
|
1055
1018
|
import { useOverlayTrigger, useOverlayPosition } from "@react-aria/overlays";
|
|
1056
|
-
import { ArrowDown, ArrowUp, Exclamation as
|
|
1019
|
+
import { ArrowDown, ArrowUp, Exclamation as Exclamation5, Required as Required2 } from "@marigold/icons";
|
|
1057
1020
|
|
|
1058
1021
|
// src/Select/ListBox.tsx
|
|
1059
|
-
import
|
|
1022
|
+
import React28, { useRef as useRef5 } from "react";
|
|
1060
1023
|
import { useListBox } from "@react-aria/listbox";
|
|
1061
1024
|
|
|
1062
1025
|
// src/Select/Option.tsx
|
|
1063
|
-
import
|
|
1026
|
+
import React26, { useEffect, useRef as useRef4, useState as useState2 } from "react";
|
|
1064
1027
|
import { useOption } from "@react-aria/listbox";
|
|
1065
1028
|
var Option = ({ item, state }) => {
|
|
1066
1029
|
const ref = useRef4(null);
|
|
@@ -1075,7 +1038,7 @@ var Option = ({ item, state }) => {
|
|
|
1075
1038
|
}
|
|
1076
1039
|
}
|
|
1077
1040
|
}, [state.disabledKeys, item.key]);
|
|
1078
|
-
return /* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ React26.createElement(Box, __spreadProps(__spreadValues({
|
|
1079
1042
|
as: "li"
|
|
1080
1043
|
}, optionProps), {
|
|
1081
1044
|
ref,
|
|
@@ -1084,26 +1047,26 @@ var Option = ({ item, state }) => {
|
|
|
1084
1047
|
};
|
|
1085
1048
|
|
|
1086
1049
|
// src/Select/ListBoxSection.tsx
|
|
1087
|
-
import
|
|
1050
|
+
import React27 from "react";
|
|
1088
1051
|
import { useListBoxSection } from "@react-aria/listbox";
|
|
1089
1052
|
var ListBoxSection = ({ section, state }) => {
|
|
1090
1053
|
const { itemProps, headingProps, groupProps } = useListBoxSection({
|
|
1091
1054
|
heading: section.rendered,
|
|
1092
1055
|
"aria-label": section["aria-label"]
|
|
1093
1056
|
});
|
|
1094
|
-
return /* @__PURE__ */
|
|
1057
|
+
return /* @__PURE__ */ React27.createElement(Box, __spreadProps(__spreadValues({
|
|
1095
1058
|
as: "li"
|
|
1096
1059
|
}, itemProps), {
|
|
1097
1060
|
css: {
|
|
1098
1061
|
cursor: "not-allowed"
|
|
1099
1062
|
}
|
|
1100
|
-
}), section.rendered && /* @__PURE__ */
|
|
1063
|
+
}), section.rendered && /* @__PURE__ */ React27.createElement(Box, __spreadProps(__spreadValues({
|
|
1101
1064
|
as: "span"
|
|
1102
1065
|
}, headingProps), {
|
|
1103
1066
|
variant: "select.section"
|
|
1104
|
-
}), section.rendered), /* @__PURE__ */
|
|
1067
|
+
}), section.rendered), /* @__PURE__ */ React27.createElement(Box, __spreadValues({
|
|
1105
1068
|
as: "ul"
|
|
1106
|
-
}, groupProps), [...section.childNodes].map((node) => /* @__PURE__ */
|
|
1069
|
+
}, groupProps), [...section.childNodes].map((node) => /* @__PURE__ */ React27.createElement(Option, {
|
|
1107
1070
|
key: node.key,
|
|
1108
1071
|
item: node,
|
|
1109
1072
|
state
|
|
@@ -1115,7 +1078,7 @@ var ListBox = (props) => {
|
|
|
1115
1078
|
const ref = useRef5(null);
|
|
1116
1079
|
const { state, error } = props;
|
|
1117
1080
|
const { listBoxProps } = useListBox(props, state, ref);
|
|
1118
|
-
return /* @__PURE__ */
|
|
1081
|
+
return /* @__PURE__ */ React28.createElement(Box, __spreadProps(__spreadValues({
|
|
1119
1082
|
as: "ul",
|
|
1120
1083
|
p: "none",
|
|
1121
1084
|
css: {
|
|
@@ -1124,11 +1087,11 @@ var ListBox = (props) => {
|
|
|
1124
1087
|
}, listBoxProps), {
|
|
1125
1088
|
variant: error ? "select.listbox.error" : "select.listbox",
|
|
1126
1089
|
ref
|
|
1127
|
-
}), [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */
|
|
1090
|
+
}), [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */ React28.createElement(ListBoxSection, {
|
|
1128
1091
|
key: item.key,
|
|
1129
1092
|
section: item,
|
|
1130
1093
|
state
|
|
1131
|
-
}) : /* @__PURE__ */
|
|
1094
|
+
}) : /* @__PURE__ */ React28.createElement(Option, {
|
|
1132
1095
|
key: item.key,
|
|
1133
1096
|
item,
|
|
1134
1097
|
state
|
|
@@ -1136,7 +1099,7 @@ var ListBox = (props) => {
|
|
|
1136
1099
|
};
|
|
1137
1100
|
|
|
1138
1101
|
// src/Select/Popover.tsx
|
|
1139
|
-
import
|
|
1102
|
+
import React29, { forwardRef as forwardRef3 } from "react";
|
|
1140
1103
|
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
1141
1104
|
import {
|
|
1142
1105
|
DismissButton,
|
|
@@ -1154,12 +1117,12 @@ var Popover = forwardRef3((_a, ref) => {
|
|
|
1154
1117
|
isDismissable: true
|
|
1155
1118
|
}, ref);
|
|
1156
1119
|
const { modalProps } = useModal2();
|
|
1157
|
-
return /* @__PURE__ */
|
|
1120
|
+
return /* @__PURE__ */ React29.createElement(OverlayContainer2, null, /* @__PURE__ */ React29.createElement(FocusScope2, {
|
|
1158
1121
|
restoreFocus: true
|
|
1159
|
-
}, /* @__PURE__ */
|
|
1122
|
+
}, /* @__PURE__ */ React29.createElement(Box, __spreadProps(__spreadValues({}, mergeProps(overlayProps, otherProps, modalProps)), {
|
|
1160
1123
|
className,
|
|
1161
1124
|
ref
|
|
1162
|
-
}), children, /* @__PURE__ */
|
|
1125
|
+
}), children, /* @__PURE__ */ React29.createElement(DismissButton, {
|
|
1163
1126
|
onDismiss: onClose
|
|
1164
1127
|
}))));
|
|
1165
1128
|
});
|
|
@@ -1201,47 +1164,44 @@ var Select = (_a) => {
|
|
|
1201
1164
|
const { labelProps, triggerProps, valueProps, menuProps } = useSelect(props, state, triggerRef);
|
|
1202
1165
|
const { buttonProps } = useButton3(triggerProps, triggerRef);
|
|
1203
1166
|
const { focusProps } = useFocusRing3();
|
|
1204
|
-
return /* @__PURE__ */
|
|
1167
|
+
return /* @__PURE__ */ React30.createElement(Box, {
|
|
1205
1168
|
position: "relative",
|
|
1206
1169
|
display: "inline-block",
|
|
1207
1170
|
width: width && width
|
|
1208
|
-
}, props.label && /* @__PURE__ */
|
|
1171
|
+
}, props.label && /* @__PURE__ */ React30.createElement(Box, null, /* @__PURE__ */ React30.createElement(Label, __spreadProps(__spreadValues({}, labelProps), {
|
|
1209
1172
|
htmlFor: labelProps.id,
|
|
1210
1173
|
variant: labelVariant
|
|
1211
|
-
}), required ? /* @__PURE__ */
|
|
1174
|
+
}), required ? /* @__PURE__ */ React30.createElement(Box, {
|
|
1212
1175
|
as: "span",
|
|
1213
1176
|
display: "inline-flex",
|
|
1214
1177
|
alignItems: "center"
|
|
1215
|
-
}, props.label, /* @__PURE__ */
|
|
1216
|
-
as: Required2,
|
|
1178
|
+
}, props.label, /* @__PURE__ */ React30.createElement(Required2, {
|
|
1217
1179
|
size: 16,
|
|
1218
|
-
|
|
1219
|
-
})) : props.label)), /* @__PURE__ */
|
|
1180
|
+
fill: "error"
|
|
1181
|
+
})) : props.label)), /* @__PURE__ */ React30.createElement(HiddenSelect, {
|
|
1220
1182
|
state,
|
|
1221
1183
|
triggerRef,
|
|
1222
1184
|
label: props.label,
|
|
1223
1185
|
name: props.name,
|
|
1224
1186
|
isDisabled: disabled
|
|
1225
|
-
}), /* @__PURE__ */
|
|
1187
|
+
}), /* @__PURE__ */ React30.createElement(Box, __spreadProps(__spreadValues({
|
|
1226
1188
|
as: "button"
|
|
1227
1189
|
}, mergeProps2(buttonProps, focusProps)), {
|
|
1228
1190
|
ref: triggerRef,
|
|
1229
1191
|
variant: error && state.isOpen && !disabled ? "button.select.errorOpened" : error ? "button.select.error" : state.isOpen && !disabled ? "button.select.open" : "button.select",
|
|
1230
1192
|
disabled,
|
|
1231
1193
|
className
|
|
1232
|
-
}), /* @__PURE__ */
|
|
1194
|
+
}), /* @__PURE__ */ React30.createElement(Box, __spreadProps(__spreadValues({
|
|
1233
1195
|
as: "span"
|
|
1234
1196
|
}, valueProps), {
|
|
1235
1197
|
variant: disabled ? "select.disabled" : "select"
|
|
1236
|
-
}), state.selectedItem ? state.selectedItem.rendered : placeholder), state.isOpen && !disabled ? /* @__PURE__ */
|
|
1237
|
-
as: ArrowUp,
|
|
1198
|
+
}), state.selectedItem ? state.selectedItem.rendered : placeholder), state.isOpen && !disabled ? /* @__PURE__ */ React30.createElement(ArrowUp, {
|
|
1238
1199
|
size: 16,
|
|
1239
|
-
|
|
1240
|
-
}) : /* @__PURE__ */
|
|
1241
|
-
as: ArrowDown,
|
|
1200
|
+
fill: "text"
|
|
1201
|
+
}) : /* @__PURE__ */ React30.createElement(ArrowDown, {
|
|
1242
1202
|
size: 16,
|
|
1243
|
-
|
|
1244
|
-
})), state.isOpen && !disabled && /* @__PURE__ */
|
|
1203
|
+
fill: disabled ? "disabled" : "text"
|
|
1204
|
+
})), state.isOpen && !disabled && /* @__PURE__ */ React30.createElement(Box, __spreadProps(__spreadValues(__spreadValues({
|
|
1245
1205
|
as: Popover
|
|
1246
1206
|
}, overlayProps), positionProps), {
|
|
1247
1207
|
css: {
|
|
@@ -1250,25 +1210,99 @@ var Select = (_a) => {
|
|
|
1250
1210
|
ref: overlayRef,
|
|
1251
1211
|
isOpen: state.isOpen,
|
|
1252
1212
|
onClose: state.close
|
|
1253
|
-
}), /* @__PURE__ */
|
|
1213
|
+
}), /* @__PURE__ */ React30.createElement(ListBox, __spreadProps(__spreadValues({
|
|
1254
1214
|
error
|
|
1255
1215
|
}, menuProps), {
|
|
1256
1216
|
state
|
|
1257
|
-
}))), error && errorMessage && /* @__PURE__ */
|
|
1217
|
+
}))), error && errorMessage && /* @__PURE__ */ React30.createElement(Box, {
|
|
1258
1218
|
as: "span",
|
|
1259
1219
|
display: "inline-flex",
|
|
1260
1220
|
alignItems: "center"
|
|
1261
|
-
}, /* @__PURE__ */
|
|
1262
|
-
as:
|
|
1221
|
+
}, /* @__PURE__ */ React30.createElement(Box, {
|
|
1222
|
+
as: Exclamation5,
|
|
1263
1223
|
size: 16,
|
|
1264
1224
|
css: { color: "error" }
|
|
1265
|
-
}), /* @__PURE__ */
|
|
1225
|
+
}), /* @__PURE__ */ React30.createElement(ValidationMessage, null, errorMessage)));
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
// src/Slider/Slider.tsx
|
|
1229
|
+
import React31 from "react";
|
|
1230
|
+
var Slider = (_a) => {
|
|
1231
|
+
var _b = _a, { variant = "" } = _b, props = __objRest(_b, ["variant"]);
|
|
1232
|
+
return /* @__PURE__ */ React31.createElement(Box, __spreadValues({
|
|
1233
|
+
as: "input",
|
|
1234
|
+
type: "range",
|
|
1235
|
+
css: { verticalAlign: "middle" },
|
|
1236
|
+
variant: `slider.${variant}`
|
|
1237
|
+
}, props));
|
|
1238
|
+
};
|
|
1239
|
+
|
|
1240
|
+
// src/Switch/Switch.tsx
|
|
1241
|
+
import React32, { useRef as useRef7 } from "react";
|
|
1242
|
+
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1243
|
+
import { useSwitch } from "@react-aria/switch";
|
|
1244
|
+
import { VisuallyHidden as VisuallyHidden4 } from "@react-aria/visually-hidden";
|
|
1245
|
+
import { conditional as conditional3 } from "@marigold/system";
|
|
1246
|
+
var Switch = (_a) => {
|
|
1247
|
+
var _b = _a, {
|
|
1248
|
+
variant = "",
|
|
1249
|
+
labelVariant = "above",
|
|
1250
|
+
disabled
|
|
1251
|
+
} = _b, props = __objRest(_b, [
|
|
1252
|
+
"variant",
|
|
1253
|
+
"labelVariant",
|
|
1254
|
+
"disabled"
|
|
1255
|
+
]);
|
|
1256
|
+
const state = useToggleState(props);
|
|
1257
|
+
const ref = useRef7();
|
|
1258
|
+
const { inputProps } = useSwitch(props, state, ref);
|
|
1259
|
+
const { focusProps } = useFocusRing4();
|
|
1260
|
+
return /* @__PURE__ */ React32.createElement(Box, {
|
|
1261
|
+
as: Label,
|
|
1262
|
+
__baseCSS: {
|
|
1263
|
+
userSelect: "none"
|
|
1264
|
+
},
|
|
1265
|
+
variant: labelVariant
|
|
1266
|
+
}, props.children, /* @__PURE__ */ React32.createElement(VisuallyHidden4, null, /* @__PURE__ */ React32.createElement("input", __spreadProps(__spreadValues(__spreadValues({}, inputProps), focusProps), {
|
|
1267
|
+
disabled,
|
|
1268
|
+
ref
|
|
1269
|
+
}))), /* @__PURE__ */ React32.createElement(Box, {
|
|
1270
|
+
as: "svg",
|
|
1271
|
+
__baseCSS: {
|
|
1272
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
1273
|
+
width: 56,
|
|
1274
|
+
height: 32
|
|
1275
|
+
},
|
|
1276
|
+
"aria-hidden": "true"
|
|
1277
|
+
}, /* @__PURE__ */ React32.createElement(Box, {
|
|
1278
|
+
as: "rect",
|
|
1279
|
+
__baseCSS: {
|
|
1280
|
+
x: 4,
|
|
1281
|
+
y: 4,
|
|
1282
|
+
rx: 12,
|
|
1283
|
+
width: 48,
|
|
1284
|
+
height: 24
|
|
1285
|
+
},
|
|
1286
|
+
variant: conditional3(`switch.${variant}`, {
|
|
1287
|
+
checked: state.isSelected,
|
|
1288
|
+
disabled
|
|
1289
|
+
})
|
|
1290
|
+
}), /* @__PURE__ */ React32.createElement(Box, {
|
|
1291
|
+
as: "circle",
|
|
1292
|
+
__baseCSS: {
|
|
1293
|
+
boxShadow: "1px 1px 4px rgba(0, 0, 0, 0.25)",
|
|
1294
|
+
cx: state.isSelected ? 40 : 16,
|
|
1295
|
+
cy: 16,
|
|
1296
|
+
r: 11,
|
|
1297
|
+
fill: disabled ? "gray20" : "gray00"
|
|
1298
|
+
}
|
|
1299
|
+
})));
|
|
1266
1300
|
};
|
|
1267
1301
|
|
|
1268
1302
|
// src/Textarea/Textarea.tsx
|
|
1269
|
-
import React33, { useRef as
|
|
1303
|
+
import React33, { useRef as useRef8 } from "react";
|
|
1270
1304
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
1271
|
-
import { Exclamation as
|
|
1305
|
+
import { Exclamation as Exclamation6 } from "@marigold/icons";
|
|
1272
1306
|
var Textarea = (_a) => {
|
|
1273
1307
|
var _b = _a, {
|
|
1274
1308
|
variant = "",
|
|
@@ -1285,7 +1319,7 @@ var Textarea = (_a) => {
|
|
|
1285
1319
|
"required",
|
|
1286
1320
|
"children"
|
|
1287
1321
|
]);
|
|
1288
|
-
const ref =
|
|
1322
|
+
const ref = useRef8(null);
|
|
1289
1323
|
const { labelProps, inputProps, errorMessageProps } = useTextField2(__spreadProps(__spreadValues({}, props), {
|
|
1290
1324
|
inputElementType: "textarea"
|
|
1291
1325
|
}), ref);
|
|
@@ -1300,13 +1334,61 @@ var Textarea = (_a) => {
|
|
|
1300
1334
|
}
|
|
1301
1335
|
}, inputProps), {
|
|
1302
1336
|
ref
|
|
1303
|
-
}), props)), error && errorMessage && /* @__PURE__ */ React33.createElement(ValidationMessage, __spreadValues({}, errorMessageProps), /* @__PURE__ */ React33.createElement(
|
|
1337
|
+
}), props)), error && errorMessage && /* @__PURE__ */ React33.createElement(ValidationMessage, __spreadValues({}, errorMessageProps), /* @__PURE__ */ React33.createElement(Exclamation6, {
|
|
1304
1338
|
size: 16
|
|
1305
1339
|
}), errorMessage));
|
|
1306
1340
|
};
|
|
1307
1341
|
|
|
1342
|
+
// src/Tooltip/Tooltip.tsx
|
|
1343
|
+
import React35, { useContext } from "react";
|
|
1344
|
+
import { useTooltip } from "@react-aria/tooltip";
|
|
1345
|
+
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
1346
|
+
|
|
1347
|
+
// src/Tooltip/TooltipTrigger.tsx
|
|
1348
|
+
import React34, { useRef as useRef9 } from "react";
|
|
1349
|
+
import { FocusableProvider } from "@react-aria/focus";
|
|
1350
|
+
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
1351
|
+
import {
|
|
1352
|
+
useTooltipTriggerState
|
|
1353
|
+
} from "@react-stately/tooltip";
|
|
1354
|
+
var TooltipContext = React34.createContext({});
|
|
1355
|
+
var TooltipTrigger = (_a) => {
|
|
1356
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1357
|
+
const [trigger, tooltip] = React34.Children.toArray(children);
|
|
1358
|
+
const state = useTooltipTriggerState(props);
|
|
1359
|
+
const tooltipTriggerRef = useRef9();
|
|
1360
|
+
const { triggerProps, tooltipProps } = useTooltipTrigger({}, state, tooltipTriggerRef);
|
|
1361
|
+
return /* @__PURE__ */ React34.createElement(FocusableProvider, __spreadProps(__spreadValues({}, triggerProps), {
|
|
1362
|
+
ref: tooltipTriggerRef
|
|
1363
|
+
}), trigger, state.isOpen && /* @__PURE__ */ React34.createElement(TooltipContext.Provider, {
|
|
1364
|
+
value: __spreadValues({
|
|
1365
|
+
state
|
|
1366
|
+
}, tooltipProps)
|
|
1367
|
+
}, tooltip));
|
|
1368
|
+
};
|
|
1369
|
+
|
|
1370
|
+
// src/Tooltip/Tooltip.tsx
|
|
1371
|
+
var Tooltip = (_a) => {
|
|
1372
|
+
var _b = _a, {
|
|
1373
|
+
variant = "",
|
|
1374
|
+
children
|
|
1375
|
+
} = _b, props = __objRest(_b, [
|
|
1376
|
+
"variant",
|
|
1377
|
+
"children"
|
|
1378
|
+
]);
|
|
1379
|
+
const _a2 = useContext(TooltipContext), { state } = _a2, tooltipProviderProps = __objRest(_a2, ["state"]);
|
|
1380
|
+
const mergedProps = mergeProps3(props, tooltipProviderProps);
|
|
1381
|
+
const { tooltipProps } = useTooltip(mergedProps, state);
|
|
1382
|
+
return /* @__PURE__ */ React35.createElement(Box, __spreadValues({
|
|
1383
|
+
position: "relative"
|
|
1384
|
+
}, tooltipProps), /* @__PURE__ */ React35.createElement(Box, __spreadValues({
|
|
1385
|
+
position: "absolute",
|
|
1386
|
+
variant: `tooltip.${variant}`
|
|
1387
|
+
}, mergedProps), children));
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1308
1390
|
// src/Input/Input.tsx
|
|
1309
|
-
import
|
|
1391
|
+
import React36 from "react";
|
|
1310
1392
|
var Input = (_a) => {
|
|
1311
1393
|
var _b = _a, {
|
|
1312
1394
|
variant = "",
|
|
@@ -1315,7 +1397,7 @@ var Input = (_a) => {
|
|
|
1315
1397
|
"variant",
|
|
1316
1398
|
"type"
|
|
1317
1399
|
]);
|
|
1318
|
-
return /* @__PURE__ */
|
|
1400
|
+
return /* @__PURE__ */ React36.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
1319
1401
|
as: "input",
|
|
1320
1402
|
type,
|
|
1321
1403
|
variant: `input.${variant}`
|
|
@@ -1323,10 +1405,10 @@ var Input = (_a) => {
|
|
|
1323
1405
|
};
|
|
1324
1406
|
|
|
1325
1407
|
// src/Container/Container.tsx
|
|
1326
|
-
import
|
|
1408
|
+
import React37 from "react";
|
|
1327
1409
|
var Container = (_a) => {
|
|
1328
1410
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1329
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ React37.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
1330
1412
|
width: "100%"
|
|
1331
1413
|
}), children);
|
|
1332
1414
|
};
|
|
@@ -1335,7 +1417,6 @@ var Container = (_a) => {
|
|
|
1335
1417
|
import { Item, Section } from "@react-stately/collections";
|
|
1336
1418
|
export {
|
|
1337
1419
|
ActionGroup,
|
|
1338
|
-
Alert,
|
|
1339
1420
|
Badge,
|
|
1340
1421
|
Box,
|
|
1341
1422
|
Button,
|
|
@@ -1364,9 +1445,13 @@ export {
|
|
|
1364
1445
|
Select,
|
|
1365
1446
|
Slider,
|
|
1366
1447
|
Stack,
|
|
1448
|
+
Switch,
|
|
1367
1449
|
Text,
|
|
1368
1450
|
Textarea,
|
|
1369
1451
|
ThemeProvider2 as ThemeProvider,
|
|
1452
|
+
Tooltip,
|
|
1453
|
+
TooltipContext,
|
|
1454
|
+
TooltipTrigger,
|
|
1370
1455
|
ValidationMessage,
|
|
1371
1456
|
VisuallyHidden2 as VisuallyHidden,
|
|
1372
1457
|
useDialogButtonProps,
|