@marigold/components 0.9.0 → 1.0.1
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 +266 -192
- package/dist/index.js +1595 -1100
- package/dist/index.mjs +1615 -1096
- package/package.json +20 -10
package/dist/index.mjs
CHANGED
|
@@ -95,8 +95,44 @@ var Badge = (_a) => {
|
|
|
95
95
|
}), children);
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
+
// src/Breakout/Breakout.tsx
|
|
99
|
+
import React4 from "react";
|
|
100
|
+
var useAlignment = (direction) => {
|
|
101
|
+
switch (direction) {
|
|
102
|
+
case "right":
|
|
103
|
+
return "flex-end";
|
|
104
|
+
case "bottom":
|
|
105
|
+
return "flex-end";
|
|
106
|
+
case "center":
|
|
107
|
+
return "center";
|
|
108
|
+
}
|
|
109
|
+
return "flex-start";
|
|
110
|
+
};
|
|
111
|
+
var Breakout = (_a) => {
|
|
112
|
+
var _b = _a, {
|
|
113
|
+
horizontalAlign,
|
|
114
|
+
verticalAlign,
|
|
115
|
+
children
|
|
116
|
+
} = _b, props = __objRest(_b, [
|
|
117
|
+
"horizontalAlign",
|
|
118
|
+
"verticalAlign",
|
|
119
|
+
"children"
|
|
120
|
+
]);
|
|
121
|
+
const alignItems = useAlignment(horizontalAlign);
|
|
122
|
+
const justifyContent = useAlignment(verticalAlign);
|
|
123
|
+
return /* @__PURE__ */ React4.createElement(Box, __spreadValues({
|
|
124
|
+
alignItems,
|
|
125
|
+
justifyContent,
|
|
126
|
+
width: "100%",
|
|
127
|
+
display: verticalAlign || horizontalAlign ? "flex" : "block",
|
|
128
|
+
css: {
|
|
129
|
+
gridColumn: "1 / -1"
|
|
130
|
+
}
|
|
131
|
+
}, props), children);
|
|
132
|
+
};
|
|
133
|
+
|
|
98
134
|
// src/Button/Button.tsx
|
|
99
|
-
import
|
|
135
|
+
import React5, {
|
|
100
136
|
forwardRef,
|
|
101
137
|
useImperativeHandle,
|
|
102
138
|
useRef
|
|
@@ -135,7 +171,7 @@ var Button = forwardRef((_a, ref) => {
|
|
|
135
171
|
active: isPressed,
|
|
136
172
|
focus: isFocusVisible
|
|
137
173
|
});
|
|
138
|
-
return /* @__PURE__ */
|
|
174
|
+
return /* @__PURE__ */ React5.createElement(Box2, __spreadProps(__spreadValues(__spreadValues({}, mergeProps(buttonProps, focusProps)), stateProps), {
|
|
139
175
|
as,
|
|
140
176
|
ref: buttonRef,
|
|
141
177
|
__baseCSS: {
|
|
@@ -148,42 +184,6 @@ var Button = forwardRef((_a, ref) => {
|
|
|
148
184
|
}), children);
|
|
149
185
|
});
|
|
150
186
|
|
|
151
|
-
// src/Breakout/Breakout.tsx
|
|
152
|
-
import React5 from "react";
|
|
153
|
-
var useAlignment = (direction) => {
|
|
154
|
-
switch (direction) {
|
|
155
|
-
case "right":
|
|
156
|
-
return "flex-end";
|
|
157
|
-
case "bottom":
|
|
158
|
-
return "flex-end";
|
|
159
|
-
case "center":
|
|
160
|
-
return "center";
|
|
161
|
-
}
|
|
162
|
-
return "flex-start";
|
|
163
|
-
};
|
|
164
|
-
var Breakout = (_a) => {
|
|
165
|
-
var _b = _a, {
|
|
166
|
-
horizontalAlign,
|
|
167
|
-
verticalAlign,
|
|
168
|
-
children
|
|
169
|
-
} = _b, props = __objRest(_b, [
|
|
170
|
-
"horizontalAlign",
|
|
171
|
-
"verticalAlign",
|
|
172
|
-
"children"
|
|
173
|
-
]);
|
|
174
|
-
const alignItems = useAlignment(horizontalAlign);
|
|
175
|
-
const justifyContent = useAlignment(verticalAlign);
|
|
176
|
-
return /* @__PURE__ */ React5.createElement(Box, __spreadValues({
|
|
177
|
-
alignItems,
|
|
178
|
-
justifyContent,
|
|
179
|
-
width: "100%",
|
|
180
|
-
display: verticalAlign || horizontalAlign ? "flex" : "block",
|
|
181
|
-
css: {
|
|
182
|
-
gridColumn: "1 / -1"
|
|
183
|
-
}
|
|
184
|
-
}, props), children);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
187
|
// src/Card/Card.tsx
|
|
188
188
|
import React6 from "react";
|
|
189
189
|
import {
|
|
@@ -247,7 +247,7 @@ import {
|
|
|
247
247
|
useComponentStyles as useComponentStyles5
|
|
248
248
|
} from "@marigold/system";
|
|
249
249
|
|
|
250
|
-
// src/
|
|
250
|
+
// src/Label/Label.tsx
|
|
251
251
|
import React8 from "react";
|
|
252
252
|
import { Required } from "@marigold/icons";
|
|
253
253
|
import { Box as Box4, useComponentStyles as useComponentStyles4 } from "@marigold/system";
|
|
@@ -317,7 +317,7 @@ var CheckboxGroup = (_a) => {
|
|
|
317
317
|
__baseCSS: {
|
|
318
318
|
display: "flex",
|
|
319
319
|
flexDirection: "column",
|
|
320
|
-
alignItems: "
|
|
320
|
+
alignItems: "start"
|
|
321
321
|
},
|
|
322
322
|
css: styles.group
|
|
323
323
|
}, /* @__PURE__ */ React9.createElement(CheckboxGroupContext.Provider, {
|
|
@@ -344,7 +344,6 @@ var IndeterminateMark = () => /* @__PURE__ */ React10.createElement("svg", {
|
|
|
344
344
|
}));
|
|
345
345
|
var Icon = (_a) => {
|
|
346
346
|
var _b = _a, { css, checked, indeterminate } = _b, props = __objRest(_b, ["css", "checked", "indeterminate"]);
|
|
347
|
-
const icon = indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : /* @__PURE__ */ React10.createElement(CheckMark, null);
|
|
348
347
|
return /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
|
|
349
348
|
"aria-hidden": "true",
|
|
350
349
|
__baseCSS: {
|
|
@@ -356,10 +355,10 @@ var Icon = (_a) => {
|
|
|
356
355
|
display: "flex",
|
|
357
356
|
alignItems: "center",
|
|
358
357
|
justifyContent: "center",
|
|
359
|
-
p:
|
|
358
|
+
p: 1
|
|
360
359
|
},
|
|
361
360
|
css
|
|
362
|
-
}, props), checked ?
|
|
361
|
+
}, props), indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React10.createElement(CheckMark, null) : null);
|
|
363
362
|
};
|
|
364
363
|
var Checkbox = (_a) => {
|
|
365
364
|
var _b = _a, {
|
|
@@ -415,7 +414,6 @@ var Checkbox = (_a) => {
|
|
|
415
414
|
});
|
|
416
415
|
return /* @__PURE__ */ React10.createElement(Box6, __spreadValues(__spreadValues({
|
|
417
416
|
as: "label",
|
|
418
|
-
variant: "checkbox",
|
|
419
417
|
__baseCSS: {
|
|
420
418
|
display: "flex",
|
|
421
419
|
alignItems: "center",
|
|
@@ -425,7 +423,6 @@ var Checkbox = (_a) => {
|
|
|
425
423
|
css: styles.container
|
|
426
424
|
}, hoverProps), stateProps), /* @__PURE__ */ React10.createElement(Box6, __spreadValues(__spreadValues({
|
|
427
425
|
as: "input",
|
|
428
|
-
type: "checkbox",
|
|
429
426
|
ref,
|
|
430
427
|
css: {
|
|
431
428
|
position: "absolute",
|
|
@@ -441,7 +438,7 @@ var Checkbox = (_a) => {
|
|
|
441
438
|
checked: inputProps.checked,
|
|
442
439
|
indeterminate,
|
|
443
440
|
css: styles.checkbox
|
|
444
|
-
}, stateProps)), /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
|
|
441
|
+
}, stateProps)), props.children && /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
|
|
445
442
|
css: styles.label
|
|
446
443
|
}, stateProps), props.children));
|
|
447
444
|
};
|
|
@@ -482,8 +479,53 @@ var Columns = (_a) => {
|
|
|
482
479
|
}, props), children);
|
|
483
480
|
};
|
|
484
481
|
|
|
485
|
-
// src/
|
|
482
|
+
// src/Container/Container.tsx
|
|
486
483
|
import React12 from "react";
|
|
484
|
+
import { size as tokenSize } from "@marigold/tokens";
|
|
485
|
+
var ALIGNMENT = {
|
|
486
|
+
left: "flex-start",
|
|
487
|
+
center: "center",
|
|
488
|
+
right: "flex-end"
|
|
489
|
+
};
|
|
490
|
+
var Container = (_a) => {
|
|
491
|
+
var _b = _a, {
|
|
492
|
+
contentType = "content",
|
|
493
|
+
size = "medium",
|
|
494
|
+
align = "left",
|
|
495
|
+
alignContainer = "left",
|
|
496
|
+
children
|
|
497
|
+
} = _b, props = __objRest(_b, [
|
|
498
|
+
"contentType",
|
|
499
|
+
"size",
|
|
500
|
+
"align",
|
|
501
|
+
"alignContainer",
|
|
502
|
+
"children"
|
|
503
|
+
]);
|
|
504
|
+
const maxWidth = tokenSize[contentType][size];
|
|
505
|
+
let gridTemplateColumns = `${maxWidth} 1fr 1fr`;
|
|
506
|
+
let gridColumn = 1;
|
|
507
|
+
if (alignContainer === "center") {
|
|
508
|
+
gridTemplateColumns = `1fr ${maxWidth} 1fr`;
|
|
509
|
+
gridColumn = 2;
|
|
510
|
+
}
|
|
511
|
+
if (alignContainer === "right") {
|
|
512
|
+
gridTemplateColumns = `1fr 1fr ${maxWidth}`;
|
|
513
|
+
gridColumn = 3;
|
|
514
|
+
}
|
|
515
|
+
return /* @__PURE__ */ React12.createElement(Box, __spreadValues({
|
|
516
|
+
display: "grid",
|
|
517
|
+
css: {
|
|
518
|
+
gridTemplateColumns,
|
|
519
|
+
placeItems: ALIGNMENT[align],
|
|
520
|
+
"> *": {
|
|
521
|
+
gridColumn
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}, props), children);
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
// src/Content/Content.tsx
|
|
528
|
+
import React13 from "react";
|
|
487
529
|
import {
|
|
488
530
|
Box as Box7,
|
|
489
531
|
useComponentStyles as useComponentStyles7
|
|
@@ -499,7 +541,7 @@ var Content = (_a) => {
|
|
|
499
541
|
"size"
|
|
500
542
|
]);
|
|
501
543
|
const styles = useComponentStyles7("Content", { variant, size });
|
|
502
|
-
return /* @__PURE__ */
|
|
544
|
+
return /* @__PURE__ */ React13.createElement(Box7, __spreadProps(__spreadValues({
|
|
503
545
|
as: "section"
|
|
504
546
|
}, props), {
|
|
505
547
|
css: styles
|
|
@@ -507,17 +549,34 @@ var Content = (_a) => {
|
|
|
507
549
|
};
|
|
508
550
|
|
|
509
551
|
// src/Dialog/Dialog.tsx
|
|
510
|
-
import
|
|
511
|
-
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
512
|
-
import { OverlayContainer } from "@react-aria/overlays";
|
|
552
|
+
import React21, { useRef as useRef4 } from "react";
|
|
513
553
|
import { useButton as useButton2 } from "@react-aria/button";
|
|
514
|
-
import {
|
|
554
|
+
import { useDialog } from "@react-aria/dialog";
|
|
555
|
+
import {
|
|
556
|
+
Box as Box10,
|
|
557
|
+
useComponentStyles as useComponentStyles11
|
|
558
|
+
} from "@marigold/system";
|
|
559
|
+
|
|
560
|
+
// src/Header/Header.tsx
|
|
561
|
+
import React14 from "react";
|
|
562
|
+
import {
|
|
563
|
+
useComponentStyles as useComponentStyles8
|
|
564
|
+
} from "@marigold/system";
|
|
565
|
+
var Header = (_a) => {
|
|
566
|
+
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
567
|
+
const styles = useComponentStyles8("Header", { variant, size });
|
|
568
|
+
return /* @__PURE__ */ React14.createElement(Box, __spreadProps(__spreadValues({
|
|
569
|
+
as: "header"
|
|
570
|
+
}, props), {
|
|
571
|
+
css: styles
|
|
572
|
+
}), children);
|
|
573
|
+
};
|
|
515
574
|
|
|
516
575
|
// src/Headline/Headline.tsx
|
|
517
|
-
import
|
|
576
|
+
import React15 from "react";
|
|
518
577
|
import {
|
|
519
578
|
Box as Box8,
|
|
520
|
-
useComponentStyles as
|
|
579
|
+
useComponentStyles as useComponentStyles9
|
|
521
580
|
} from "@marigold/system";
|
|
522
581
|
var Headline = (_a) => {
|
|
523
582
|
var _b = _a, {
|
|
@@ -531,210 +590,281 @@ var Headline = (_a) => {
|
|
|
531
590
|
"size",
|
|
532
591
|
"level"
|
|
533
592
|
]);
|
|
534
|
-
const styles =
|
|
593
|
+
const styles = useComponentStyles9("Headline", {
|
|
535
594
|
variant,
|
|
536
595
|
size: size != null ? size : `level-${level}`
|
|
537
596
|
});
|
|
538
|
-
return /* @__PURE__ */
|
|
597
|
+
return /* @__PURE__ */ React15.createElement(Box8, __spreadProps(__spreadValues({
|
|
539
598
|
as: `h${level}`
|
|
540
599
|
}, props), {
|
|
541
600
|
css: styles
|
|
542
601
|
}), children);
|
|
543
602
|
};
|
|
544
603
|
|
|
545
|
-
// src/Dialog/
|
|
546
|
-
import
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
} from "
|
|
552
|
-
import {
|
|
604
|
+
// src/Dialog/Context.ts
|
|
605
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
606
|
+
var DialogContext = createContext2({});
|
|
607
|
+
var useDialogContext = () => useContext2(DialogContext);
|
|
608
|
+
|
|
609
|
+
// src/Dialog/DialogTrigger.tsx
|
|
610
|
+
import React20, { useRef as useRef3 } from "react";
|
|
611
|
+
import { PressResponder } from "@react-aria/interactions";
|
|
612
|
+
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
613
|
+
|
|
614
|
+
// src/Overlay/Modal.tsx
|
|
615
|
+
import React17, { forwardRef as forwardRef2 } from "react";
|
|
553
616
|
import { FocusScope } from "@react-aria/focus";
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
const _a2 = props, { isDismissable, isOpen, onClose } = _a2, restProps = __objRest(_a2, ["isDismissable", "isOpen", "onClose"]);
|
|
565
|
-
const ref = React14.useRef();
|
|
566
|
-
const { overlayProps, underlayProps } = useOverlay({ isDismissable, isOpen, onClose }, ref);
|
|
567
|
-
usePreventScroll();
|
|
568
|
-
const { modalProps } = useModal();
|
|
569
|
-
const { dialogProps } = useDialog(props, ref);
|
|
570
|
-
return /* @__PURE__ */ React14.createElement(Box, __spreadValues({
|
|
617
|
+
import { useModal, useOverlay, usePreventScroll } from "@react-aria/overlays";
|
|
618
|
+
import { mergeProps as mergeProps2, useObjectRef } from "@react-aria/utils";
|
|
619
|
+
|
|
620
|
+
// src/Overlay/Underlay.tsx
|
|
621
|
+
import React16 from "react";
|
|
622
|
+
import { Box as Box9, useComponentStyles as useComponentStyles10 } from "@marigold/system";
|
|
623
|
+
var Underlay = (_a) => {
|
|
624
|
+
var _b = _a, { size, variant } = _b, props = __objRest(_b, ["size", "variant"]);
|
|
625
|
+
const styles = useComponentStyles10("Underlay", { size, variant });
|
|
626
|
+
return /* @__PURE__ */ React16.createElement(Box9, __spreadValues({
|
|
571
627
|
__baseCSS: {
|
|
572
|
-
display: "grid",
|
|
573
|
-
placeItems: "center",
|
|
574
628
|
position: "fixed",
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
left: 0,
|
|
578
|
-
bottom: 0,
|
|
579
|
-
right: 0
|
|
629
|
+
inset: 0,
|
|
630
|
+
zIndex: 1
|
|
580
631
|
},
|
|
581
|
-
|
|
582
|
-
},
|
|
632
|
+
css: styles
|
|
633
|
+
}, props));
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
// src/Overlay/Modal.tsx
|
|
637
|
+
var Modal = forwardRef2((_a, ref) => {
|
|
638
|
+
var _b = _a, { children, open, dismissable, keyboardDismissable, onClose } = _b, props = __objRest(_b, ["children", "open", "dismissable", "keyboardDismissable", "onClose"]);
|
|
639
|
+
const modalRef = useObjectRef(ref);
|
|
640
|
+
const { overlayProps, underlayProps } = useOverlay({
|
|
641
|
+
isOpen: open,
|
|
642
|
+
onClose,
|
|
643
|
+
isDismissable: dismissable,
|
|
644
|
+
isKeyboardDismissDisabled: !keyboardDismissable
|
|
645
|
+
}, modalRef);
|
|
646
|
+
usePreventScroll();
|
|
647
|
+
const { modalProps } = useModal({});
|
|
648
|
+
return /* @__PURE__ */ React17.createElement(FocusScope, {
|
|
583
649
|
contain: true,
|
|
584
650
|
restoreFocus: true,
|
|
585
651
|
autoFocus: true
|
|
586
|
-
}, /* @__PURE__ */
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
652
|
+
}, /* @__PURE__ */ React17.createElement(Underlay, __spreadValues({}, underlayProps)), /* @__PURE__ */ React17.createElement("div", __spreadValues({
|
|
653
|
+
style: {
|
|
654
|
+
display: "flex",
|
|
655
|
+
alignItems: "center",
|
|
656
|
+
justifyContent: "center",
|
|
657
|
+
position: "fixed",
|
|
658
|
+
inset: 0,
|
|
659
|
+
zIndex: 2,
|
|
660
|
+
pointerEvents: "none"
|
|
661
|
+
},
|
|
662
|
+
ref: modalRef
|
|
663
|
+
}, mergeProps2(props, overlayProps, modalProps)), /* @__PURE__ */ React17.createElement("div", {
|
|
664
|
+
style: { pointerEvents: "auto" }
|
|
665
|
+
}, children)));
|
|
666
|
+
});
|
|
591
667
|
|
|
592
|
-
// src/
|
|
593
|
-
|
|
668
|
+
// src/Overlay/Overlay.tsx
|
|
669
|
+
import React18 from "react";
|
|
670
|
+
import { OverlayContainer } from "@react-aria/overlays";
|
|
671
|
+
var Overlay = (_a) => {
|
|
594
672
|
var _b = _a, {
|
|
595
|
-
backdropVariant,
|
|
596
673
|
children,
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
isOpen,
|
|
600
|
-
title,
|
|
601
|
-
variant
|
|
674
|
+
open = false,
|
|
675
|
+
container = document.body
|
|
602
676
|
} = _b, props = __objRest(_b, [
|
|
603
|
-
"backdropVariant",
|
|
604
677
|
"children",
|
|
605
|
-
"
|
|
606
|
-
"
|
|
607
|
-
"isOpen",
|
|
608
|
-
"title",
|
|
609
|
-
"variant"
|
|
678
|
+
"open",
|
|
679
|
+
"container"
|
|
610
680
|
]);
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
backdropVariant,
|
|
618
|
-
isOpen,
|
|
619
|
-
onClose: close,
|
|
620
|
-
isDismissable: true
|
|
621
|
-
}, props), /* @__PURE__ */ React15.createElement(Box, {
|
|
622
|
-
__baseCSS: {
|
|
623
|
-
display: "flex",
|
|
624
|
-
justifyContent: "space-between",
|
|
625
|
-
borderRadius: "small",
|
|
626
|
-
pl: "large",
|
|
627
|
-
pb: "large"
|
|
628
|
-
},
|
|
629
|
-
className
|
|
630
|
-
}, /* @__PURE__ */ React15.createElement(Box, {
|
|
631
|
-
pt: "medium"
|
|
632
|
-
}, title && /* @__PURE__ */ React15.createElement(Headline, {
|
|
633
|
-
level: "4"
|
|
634
|
-
}, title), children), /* @__PURE__ */ React15.createElement(Box, {
|
|
635
|
-
__baseCSS: {
|
|
636
|
-
display: "flex",
|
|
637
|
-
justifyContent: "flex-end",
|
|
638
|
-
alignItems: "start",
|
|
639
|
-
paddingTop: "xsmall",
|
|
640
|
-
paddingX: "xsmall"
|
|
641
|
-
}
|
|
642
|
-
}, /* @__PURE__ */ React15.createElement(Box, __spreadProps(__spreadValues({
|
|
643
|
-
as: Button,
|
|
644
|
-
__baseCSS: {
|
|
645
|
-
color: "text",
|
|
646
|
-
bg: "transparent",
|
|
647
|
-
lineHeight: "xsmall",
|
|
648
|
-
px: "xxsmall",
|
|
649
|
-
":hover": {
|
|
650
|
-
color: "text",
|
|
651
|
-
bg: "transparent",
|
|
652
|
-
cursor: "pointer"
|
|
653
|
-
},
|
|
654
|
-
":focus": {
|
|
655
|
-
outline: 0
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
}, closeButtonProps), {
|
|
659
|
-
ref: closeButtonRef
|
|
660
|
-
}), /* @__PURE__ */ React15.createElement(Close, {
|
|
661
|
-
size: 16
|
|
662
|
-
}))))));
|
|
663
|
-
};
|
|
664
|
-
var useDialogButtonProps = () => {
|
|
665
|
-
const state = useOverlayTriggerState({});
|
|
666
|
-
const openButtonRef = React15.useRef();
|
|
667
|
-
const { buttonProps: openButtonProps } = useButton2({
|
|
668
|
-
onPress: () => state.open()
|
|
669
|
-
}, openButtonRef);
|
|
670
|
-
return {
|
|
671
|
-
state,
|
|
672
|
-
openButtonProps,
|
|
673
|
-
openButtonRef
|
|
674
|
-
};
|
|
681
|
+
if (!open) {
|
|
682
|
+
return null;
|
|
683
|
+
}
|
|
684
|
+
return /* @__PURE__ */ React18.createElement(OverlayContainer, {
|
|
685
|
+
portalContainer: container
|
|
686
|
+
}, /* @__PURE__ */ React18.createElement(Box, __spreadValues({}, props), children));
|
|
675
687
|
};
|
|
676
688
|
|
|
677
|
-
// src/
|
|
678
|
-
import
|
|
679
|
-
import {
|
|
680
|
-
import {
|
|
681
|
-
var
|
|
682
|
-
var _b = _a, {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
+
// src/Overlay/Popover.tsx
|
|
690
|
+
import React19, { forwardRef as forwardRef3, useRef as useRef2 } from "react";
|
|
691
|
+
import { useModal as useModal2, useOverlay as useOverlay2 } from "@react-aria/overlays";
|
|
692
|
+
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
693
|
+
var Popover = forwardRef3((_a, ref) => {
|
|
694
|
+
var _b = _a, {
|
|
695
|
+
children,
|
|
696
|
+
open,
|
|
697
|
+
dismissable,
|
|
698
|
+
keyboardDismissDisabled,
|
|
699
|
+
shouldCloseOnBlur,
|
|
700
|
+
minWidth = 0
|
|
701
|
+
} = _b, props = __objRest(_b, [
|
|
702
|
+
"children",
|
|
703
|
+
"open",
|
|
704
|
+
"dismissable",
|
|
705
|
+
"keyboardDismissDisabled",
|
|
706
|
+
"shouldCloseOnBlur",
|
|
707
|
+
"minWidth"
|
|
708
|
+
]);
|
|
709
|
+
const fallbackRef = useRef2(null);
|
|
710
|
+
const popoverRef = ref || fallbackRef;
|
|
711
|
+
const { overlayProps } = useOverlay2(__spreadValues({
|
|
712
|
+
isOpen: open,
|
|
713
|
+
isDismissable: dismissable,
|
|
714
|
+
isKeyboardDismissDisabled: keyboardDismissDisabled,
|
|
715
|
+
shouldCloseOnBlur
|
|
716
|
+
}, props), popoverRef);
|
|
717
|
+
const { modalProps } = useModal2({});
|
|
718
|
+
const style = { minWidth };
|
|
719
|
+
return /* @__PURE__ */ React19.createElement(Overlay, {
|
|
720
|
+
open
|
|
721
|
+
}, /* @__PURE__ */ React19.createElement(Box, __spreadValues({
|
|
722
|
+
ref: popoverRef,
|
|
723
|
+
role: "presentation"
|
|
724
|
+
}, mergeProps3(props, overlayProps, modalProps, style)), children));
|
|
725
|
+
});
|
|
689
726
|
|
|
690
|
-
// src/
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
}
|
|
727
|
+
// src/Dialog/DialogTrigger.tsx
|
|
728
|
+
var DialogTrigger = ({
|
|
729
|
+
children,
|
|
730
|
+
dismissable = true,
|
|
731
|
+
keyboardDismissable = true
|
|
732
|
+
}) => {
|
|
733
|
+
const [dialogTrigger, dialog] = React20.Children.toArray(children);
|
|
734
|
+
const dialogTriggerRef = useRef3(null);
|
|
735
|
+
const state = useOverlayTriggerState({});
|
|
736
|
+
const ctx = { open: state.isOpen, close: state.close };
|
|
737
|
+
return /* @__PURE__ */ React20.createElement(DialogContext.Provider, {
|
|
738
|
+
value: ctx
|
|
739
|
+
}, /* @__PURE__ */ React20.createElement(PressResponder, {
|
|
740
|
+
ref: dialogTriggerRef,
|
|
741
|
+
isPressed: state.isOpen,
|
|
742
|
+
onPress: state.toggle
|
|
743
|
+
}, dialogTrigger), /* @__PURE__ */ React20.createElement(Overlay, {
|
|
744
|
+
open: state.isOpen
|
|
745
|
+
}, /* @__PURE__ */ React20.createElement(Modal, {
|
|
746
|
+
open: state.isOpen,
|
|
747
|
+
onClose: state.close,
|
|
748
|
+
dismissable,
|
|
749
|
+
keyboardDismissable
|
|
750
|
+
}, dialog)));
|
|
703
751
|
};
|
|
704
752
|
|
|
705
|
-
// src/
|
|
706
|
-
|
|
753
|
+
// src/Dialog/Dialog.tsx
|
|
754
|
+
var CloseButton = ({ css }) => {
|
|
755
|
+
const ref = useRef4(null);
|
|
756
|
+
const { close } = useDialogContext();
|
|
757
|
+
const { buttonProps } = useButton2({
|
|
758
|
+
onPress: () => close == null ? void 0 : close()
|
|
759
|
+
}, ref);
|
|
760
|
+
return /* @__PURE__ */ React21.createElement(Box10, {
|
|
761
|
+
css: { display: "flex", justifyContent: "flex-end" }
|
|
762
|
+
}, /* @__PURE__ */ React21.createElement(Box10, __spreadValues({
|
|
763
|
+
as: "button",
|
|
764
|
+
__baseCSS: {
|
|
765
|
+
outline: "none",
|
|
766
|
+
border: "none",
|
|
767
|
+
cursor: "pointer",
|
|
768
|
+
height: 16,
|
|
769
|
+
width: 16,
|
|
770
|
+
lineHeight: 1,
|
|
771
|
+
p: 0
|
|
772
|
+
},
|
|
773
|
+
css,
|
|
774
|
+
ref
|
|
775
|
+
}, buttonProps), /* @__PURE__ */ React21.createElement("svg", {
|
|
776
|
+
viewBox: "0 0 20 20",
|
|
777
|
+
fill: "currentColor"
|
|
778
|
+
}, /* @__PURE__ */ React21.createElement("path", {
|
|
779
|
+
fillRule: "evenodd",
|
|
780
|
+
clipRule: "evenodd",
|
|
781
|
+
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
782
|
+
}))));
|
|
783
|
+
};
|
|
784
|
+
var addTitleProps = (children, titleProps) => {
|
|
785
|
+
const childs = React21.Children.toArray(children);
|
|
786
|
+
const titleIndex = childs.findIndex((child) => React21.isValidElement(child) && (child.type === Header || child.type === Headline));
|
|
787
|
+
if (titleIndex < 0) {
|
|
788
|
+
console.warn("No child in <Dialog> found that can act as title for accessibility. Please add a <Header> or <Headline> as direct child.");
|
|
789
|
+
return children;
|
|
790
|
+
}
|
|
791
|
+
const titleChild = React21.cloneElement(childs[titleIndex], titleProps);
|
|
792
|
+
childs.splice(titleIndex, 1, titleChild);
|
|
793
|
+
return childs;
|
|
794
|
+
};
|
|
795
|
+
var Dialog = (_a) => {
|
|
796
|
+
var _b = _a, {
|
|
797
|
+
children,
|
|
798
|
+
variant,
|
|
799
|
+
size,
|
|
800
|
+
closeButton
|
|
801
|
+
} = _b, props = __objRest(_b, [
|
|
802
|
+
"children",
|
|
803
|
+
"variant",
|
|
804
|
+
"size",
|
|
805
|
+
"closeButton"
|
|
806
|
+
]);
|
|
807
|
+
const ref = useRef4(null);
|
|
808
|
+
const { close } = useDialogContext();
|
|
809
|
+
const { dialogProps, titleProps } = useDialog(props, ref);
|
|
810
|
+
const styles = useComponentStyles11("Dialog", { variant, size }, { parts: ["container", "closeButton"] });
|
|
811
|
+
return /* @__PURE__ */ React21.createElement(Box10, __spreadValues({
|
|
812
|
+
__baseCSS: { bg: "#fff" },
|
|
813
|
+
css: styles.container
|
|
814
|
+
}, dialogProps), closeButton && /* @__PURE__ */ React21.createElement(CloseButton, {
|
|
815
|
+
css: styles.closeButton
|
|
816
|
+
}), typeof children === "function" ? children({ close, titleProps }) : props["aria-labelledby"] ? children : addTitleProps(children, titleProps));
|
|
817
|
+
};
|
|
818
|
+
Dialog.Trigger = DialogTrigger;
|
|
707
819
|
|
|
708
|
-
// src/
|
|
709
|
-
import
|
|
820
|
+
// src/Divider/Divider.tsx
|
|
821
|
+
import React22 from "react";
|
|
822
|
+
import { useSeparator } from "@react-aria/separator";
|
|
823
|
+
import { Box as Box11, useComponentStyles as useComponentStyles12 } from "@marigold/system";
|
|
824
|
+
var Divider = (_a) => {
|
|
825
|
+
var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
|
|
826
|
+
const { separatorProps } = useSeparator(props);
|
|
827
|
+
const styles = useComponentStyles12("Divider", { variant });
|
|
828
|
+
return /* @__PURE__ */ React22.createElement(Box11, __spreadValues(__spreadValues({
|
|
829
|
+
css: styles
|
|
830
|
+
}, props), separatorProps));
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
// src/Footer/Footer.tsx
|
|
834
|
+
import React23 from "react";
|
|
710
835
|
import {
|
|
711
|
-
useComponentStyles as
|
|
836
|
+
useComponentStyles as useComponentStyles13
|
|
712
837
|
} from "@marigold/system";
|
|
713
|
-
var
|
|
838
|
+
var Footer = (_a) => {
|
|
714
839
|
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
715
|
-
const styles =
|
|
716
|
-
return /* @__PURE__ */
|
|
717
|
-
as: "
|
|
840
|
+
const styles = useComponentStyles13("Footer", { variant, size });
|
|
841
|
+
return /* @__PURE__ */ React23.createElement(Box, __spreadProps(__spreadValues({
|
|
842
|
+
as: "footer"
|
|
718
843
|
}, props), {
|
|
719
844
|
css: styles
|
|
720
845
|
}), children);
|
|
721
846
|
};
|
|
722
847
|
|
|
723
848
|
// src/Image/Image.tsx
|
|
724
|
-
import
|
|
725
|
-
import { useComponentStyles as
|
|
849
|
+
import React24 from "react";
|
|
850
|
+
import { useComponentStyles as useComponentStyles14 } from "@marigold/system";
|
|
726
851
|
var Image = (_a) => {
|
|
727
852
|
var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
|
|
728
|
-
const styles =
|
|
729
|
-
return /* @__PURE__ */
|
|
853
|
+
const styles = useComponentStyles14("Image", { variant });
|
|
854
|
+
return /* @__PURE__ */ React24.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
730
855
|
as: "img",
|
|
731
856
|
css: styles
|
|
732
857
|
}));
|
|
733
858
|
};
|
|
734
859
|
|
|
735
860
|
// src/Inline/Inline.tsx
|
|
736
|
-
import
|
|
737
|
-
var
|
|
861
|
+
import React25 from "react";
|
|
862
|
+
var ALIGNMENT_X = {
|
|
863
|
+
left: "flex-start",
|
|
864
|
+
center: "center",
|
|
865
|
+
right: "flex-end"
|
|
866
|
+
};
|
|
867
|
+
var ALIGNMENT_Y = {
|
|
738
868
|
top: "flex-start",
|
|
739
869
|
center: "center",
|
|
740
870
|
bottom: "flex-end"
|
|
@@ -742,63 +872,44 @@ var ALIGNMENT = {
|
|
|
742
872
|
var Inline = (_a) => {
|
|
743
873
|
var _b = _a, {
|
|
744
874
|
space = "none",
|
|
745
|
-
|
|
875
|
+
alignX = "left",
|
|
876
|
+
alignY = "center",
|
|
746
877
|
children
|
|
747
878
|
} = _b, props = __objRest(_b, [
|
|
748
879
|
"space",
|
|
749
|
-
"
|
|
880
|
+
"alignX",
|
|
881
|
+
"alignY",
|
|
750
882
|
"children"
|
|
751
883
|
]);
|
|
752
|
-
return /* @__PURE__ */
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
884
|
+
return /* @__PURE__ */ React25.createElement(Box, __spreadValues({
|
|
885
|
+
css: {
|
|
886
|
+
display: "flex",
|
|
887
|
+
flexWrap: "wrap",
|
|
888
|
+
gap: space,
|
|
889
|
+
alignItems: ALIGNMENT_Y[alignY],
|
|
890
|
+
justifyContent: ALIGNMENT_X[alignX]
|
|
891
|
+
}
|
|
756
892
|
}, props), children);
|
|
757
893
|
};
|
|
758
894
|
|
|
759
|
-
// src/
|
|
760
|
-
import
|
|
761
|
-
import {
|
|
762
|
-
var
|
|
763
|
-
var _b = _a, {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
"children"
|
|
773
|
-
]);
|
|
774
|
-
return /* @__PURE__ */ React21.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
775
|
-
as: "label",
|
|
776
|
-
__baseCSS: { color },
|
|
777
|
-
variant: `label.${variant}`
|
|
778
|
-
}), children);
|
|
779
|
-
};
|
|
780
|
-
var Label2 = (_a) => {
|
|
781
|
-
var _b = _a, {
|
|
782
|
-
required,
|
|
783
|
-
children
|
|
784
|
-
} = _b, props = __objRest(_b, [
|
|
785
|
-
"required",
|
|
786
|
-
"children"
|
|
787
|
-
]);
|
|
788
|
-
return required ? /* @__PURE__ */ React21.createElement(Box, {
|
|
789
|
-
as: "span",
|
|
790
|
-
display: "inline-flex",
|
|
791
|
-
alignItems: "center"
|
|
792
|
-
}, /* @__PURE__ */ React21.createElement(LabelBase, __spreadValues({}, props), children), required && /* @__PURE__ */ React21.createElement(Required2, {
|
|
793
|
-
size: 16,
|
|
794
|
-
fill: "error"
|
|
795
|
-
})) : /* @__PURE__ */ React21.createElement(LabelBase, __spreadValues({}, props), children);
|
|
796
|
-
};
|
|
895
|
+
// src/Input/Input.tsx
|
|
896
|
+
import React26, { forwardRef as forwardRef4 } from "react";
|
|
897
|
+
import { Box as Box12, useComponentStyles as useComponentStyles15 } from "@marigold/system";
|
|
898
|
+
var Input = forwardRef4((_a, ref) => {
|
|
899
|
+
var _b = _a, { variant, size, type = "text" } = _b, props = __objRest(_b, ["variant", "size", "type"]);
|
|
900
|
+
const styles = useComponentStyles15("Input", { variant, size });
|
|
901
|
+
return /* @__PURE__ */ React26.createElement(Box12, __spreadProps(__spreadValues({}, props), {
|
|
902
|
+
ref,
|
|
903
|
+
as: "input",
|
|
904
|
+
type,
|
|
905
|
+
css: styles
|
|
906
|
+
}));
|
|
907
|
+
});
|
|
797
908
|
|
|
798
909
|
// src/Link/Link.tsx
|
|
799
|
-
import
|
|
910
|
+
import React27, { useRef as useRef5 } from "react";
|
|
800
911
|
import { useLink } from "@react-aria/link";
|
|
801
|
-
import { useComponentStyles as
|
|
912
|
+
import { useComponentStyles as useComponentStyles16 } from "@marigold/system";
|
|
802
913
|
var Link = (_a) => {
|
|
803
914
|
var _b = _a, {
|
|
804
915
|
as = "a",
|
|
@@ -813,13 +924,13 @@ var Link = (_a) => {
|
|
|
813
924
|
"children",
|
|
814
925
|
"disabled"
|
|
815
926
|
]);
|
|
816
|
-
const ref =
|
|
927
|
+
const ref = useRef5(null);
|
|
817
928
|
const { linkProps } = useLink(__spreadProps(__spreadValues({}, props), {
|
|
818
929
|
elementType: typeof as === "string" ? as : "span",
|
|
819
930
|
isDisabled: disabled
|
|
820
931
|
}), ref);
|
|
821
|
-
const styles =
|
|
822
|
-
return /* @__PURE__ */
|
|
932
|
+
const styles = useComponentStyles16("Link", { variant, size });
|
|
933
|
+
return /* @__PURE__ */ React27.createElement(Box, __spreadValues(__spreadValues({
|
|
823
934
|
as,
|
|
824
935
|
css: styles,
|
|
825
936
|
ref
|
|
@@ -827,87 +938,32 @@ var Link = (_a) => {
|
|
|
827
938
|
};
|
|
828
939
|
|
|
829
940
|
// src/Menu/Menu.tsx
|
|
830
|
-
import
|
|
941
|
+
import React30, { useRef as useRef8 } from "react";
|
|
831
942
|
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
832
943
|
import { useMenu } from "@react-aria/menu";
|
|
833
944
|
import { DismissButton } from "@react-aria/overlays";
|
|
834
945
|
import { Item } from "@react-stately/collections";
|
|
835
946
|
import { useTreeState } from "@react-stately/tree";
|
|
836
947
|
import {
|
|
837
|
-
Box as
|
|
838
|
-
useComponentStyles as
|
|
948
|
+
Box as Box14,
|
|
949
|
+
useComponentStyles as useComponentStyles17
|
|
839
950
|
} from "@marigold/system";
|
|
840
951
|
|
|
841
952
|
// src/Menu/Context.ts
|
|
842
|
-
import { createContext as
|
|
843
|
-
var MenuContext =
|
|
844
|
-
var useMenuContext = () =>
|
|
953
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
954
|
+
var MenuContext = createContext3({});
|
|
955
|
+
var useMenuContext = () => useContext3(MenuContext);
|
|
845
956
|
|
|
846
957
|
// src/Menu/MenuTrigger.tsx
|
|
847
|
-
import
|
|
958
|
+
import React28, { useRef as useRef6 } from "react";
|
|
848
959
|
import { useMenuTriggerState } from "@react-stately/menu";
|
|
849
960
|
import { useMenuTrigger } from "@react-aria/menu";
|
|
850
|
-
|
|
851
|
-
// src/Overlay/Overlay.tsx
|
|
852
|
-
import React23 from "react";
|
|
853
|
-
import ReactDOM from "react-dom";
|
|
854
|
-
var Overlay = (_a) => {
|
|
855
|
-
var _b = _a, {
|
|
856
|
-
children,
|
|
857
|
-
open = false,
|
|
858
|
-
container = document.body
|
|
859
|
-
} = _b, props = __objRest(_b, [
|
|
860
|
-
"children",
|
|
861
|
-
"open",
|
|
862
|
-
"container"
|
|
863
|
-
]);
|
|
864
|
-
if (!open) {
|
|
865
|
-
return null;
|
|
866
|
-
}
|
|
867
|
-
const component = /* @__PURE__ */ React23.createElement(Box, __spreadValues({}, props), children);
|
|
868
|
-
return ReactDOM.createPortal(component, container);
|
|
869
|
-
};
|
|
870
|
-
|
|
871
|
-
// src/Overlay/Popover.tsx
|
|
872
|
-
import React24, { forwardRef as forwardRef2 } from "react";
|
|
873
|
-
import { useModal as useModal2, useOverlay as useOverlay2 } from "@react-aria/overlays";
|
|
874
|
-
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
|
875
|
-
var Popover = forwardRef2((_a, ref) => {
|
|
876
|
-
var _b = _a, {
|
|
877
|
-
children,
|
|
878
|
-
open,
|
|
879
|
-
dismissable,
|
|
880
|
-
keyboardDismissDisabled,
|
|
881
|
-
shouldCloseOnBlur
|
|
882
|
-
} = _b, props = __objRest(_b, [
|
|
883
|
-
"children",
|
|
884
|
-
"open",
|
|
885
|
-
"dismissable",
|
|
886
|
-
"keyboardDismissDisabled",
|
|
887
|
-
"shouldCloseOnBlur"
|
|
888
|
-
]);
|
|
889
|
-
const { overlayProps } = useOverlay2(__spreadValues({
|
|
890
|
-
isOpen: open,
|
|
891
|
-
isDismissable: dismissable,
|
|
892
|
-
isKeyboardDismissDisabled: keyboardDismissDisabled,
|
|
893
|
-
shouldCloseOnBlur
|
|
894
|
-
}, props), ref);
|
|
895
|
-
const { modalProps } = useModal2({});
|
|
896
|
-
return /* @__PURE__ */ React24.createElement(Overlay, {
|
|
897
|
-
open
|
|
898
|
-
}, /* @__PURE__ */ React24.createElement(Box, __spreadValues({
|
|
899
|
-
ref,
|
|
900
|
-
role: "presentation"
|
|
901
|
-
}, mergeProps2(props, overlayProps, modalProps)), children));
|
|
902
|
-
});
|
|
903
|
-
|
|
904
|
-
// src/Menu/MenuTrigger.tsx
|
|
905
961
|
import { useOverlayPosition } from "@react-aria/overlays";
|
|
906
|
-
import { PressResponder } from "@react-aria/interactions";
|
|
962
|
+
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
907
963
|
var MenuTrigger = ({ disabled, children }) => {
|
|
908
|
-
const [menuTrigger, menu] =
|
|
909
|
-
const menuTriggerRef =
|
|
910
|
-
const overlayRef =
|
|
964
|
+
const [menuTrigger, menu] = React28.Children.toArray(children);
|
|
965
|
+
const menuTriggerRef = useRef6(null);
|
|
966
|
+
const overlayRef = useRef6(null);
|
|
911
967
|
const state = useMenuTriggerState({});
|
|
912
968
|
const { menuTriggerProps, menuProps } = useMenuTrigger({ trigger: "press", isDisabled: disabled }, state, menuTriggerRef);
|
|
913
969
|
const { overlayProps: positionProps } = useOverlayPosition({
|
|
@@ -921,12 +977,12 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
921
977
|
autoFocus: state.focusStrategy,
|
|
922
978
|
triggerWidth: menuTriggerRef.current ? menuTriggerRef.current.offsetWidth : void 0
|
|
923
979
|
});
|
|
924
|
-
return /* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ React28.createElement(MenuContext.Provider, {
|
|
925
981
|
value: menuContext
|
|
926
|
-
}, /* @__PURE__ */
|
|
982
|
+
}, /* @__PURE__ */ React28.createElement(PressResponder2, __spreadProps(__spreadValues({}, menuTriggerProps), {
|
|
927
983
|
ref: menuTriggerRef,
|
|
928
984
|
isPressed: state.isOpen
|
|
929
|
-
}), menuTrigger), /* @__PURE__ */
|
|
985
|
+
}), menuTrigger), /* @__PURE__ */ React28.createElement(Popover, __spreadValues({
|
|
930
986
|
open: state.isOpen,
|
|
931
987
|
onClose: state.close,
|
|
932
988
|
dismissable: true,
|
|
@@ -936,13 +992,13 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
936
992
|
};
|
|
937
993
|
|
|
938
994
|
// src/Menu/MenuItem.tsx
|
|
939
|
-
import
|
|
995
|
+
import React29, { useRef as useRef7 } from "react";
|
|
940
996
|
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
941
997
|
import { useMenuItem } from "@react-aria/menu";
|
|
942
|
-
import { mergeProps as
|
|
943
|
-
import { Box as
|
|
998
|
+
import { mergeProps as mergeProps4 } from "@react-aria/utils";
|
|
999
|
+
import { Box as Box13, useStateProps as useStateProps3 } from "@marigold/system";
|
|
944
1000
|
var MenuItem = ({ item, state, onAction, css }) => {
|
|
945
|
-
const ref =
|
|
1001
|
+
const ref = useRef7(null);
|
|
946
1002
|
const { onClose } = useMenuContext();
|
|
947
1003
|
const { menuItemProps } = useMenuItem({
|
|
948
1004
|
key: item.key,
|
|
@@ -953,7 +1009,7 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
953
1009
|
const stateProps = useStateProps3({
|
|
954
1010
|
focus: isFocusVisible
|
|
955
1011
|
});
|
|
956
|
-
return /* @__PURE__ */
|
|
1012
|
+
return /* @__PURE__ */ React29.createElement(Box13, __spreadValues(__spreadValues({
|
|
957
1013
|
as: "li",
|
|
958
1014
|
ref,
|
|
959
1015
|
__baseCSS: {
|
|
@@ -962,7 +1018,7 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
962
1018
|
}
|
|
963
1019
|
},
|
|
964
1020
|
css
|
|
965
|
-
},
|
|
1021
|
+
}, mergeProps4(menuItemProps, focusProps)), stateProps), item.rendered);
|
|
966
1022
|
};
|
|
967
1023
|
|
|
968
1024
|
// src/Menu/Menu.tsx
|
|
@@ -970,15 +1026,15 @@ var Menu = (_a) => {
|
|
|
970
1026
|
var _b = _a, { variant, size } = _b, props = __objRest(_b, ["variant", "size"]);
|
|
971
1027
|
const _a2 = useMenuContext(), { triggerWidth } = _a2, menuContext = __objRest(_a2, ["triggerWidth"]);
|
|
972
1028
|
const ownProps = __spreadValues(__spreadValues({}, props), menuContext);
|
|
973
|
-
const ref =
|
|
1029
|
+
const ref = useRef8(null);
|
|
974
1030
|
const state = useTreeState(__spreadProps(__spreadValues({}, ownProps), { selectionMode: "none" }));
|
|
975
1031
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
976
|
-
const styles =
|
|
977
|
-
return /* @__PURE__ */
|
|
1032
|
+
const styles = useComponentStyles17("Menu", { variant, size }, { parts: ["container", "item"] });
|
|
1033
|
+
return /* @__PURE__ */ React30.createElement(FocusScope2, {
|
|
978
1034
|
restoreFocus: true
|
|
979
|
-
}, /* @__PURE__ */
|
|
1035
|
+
}, /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(DismissButton, {
|
|
980
1036
|
onDismiss: ownProps.onClose
|
|
981
|
-
}), /* @__PURE__ */
|
|
1037
|
+
}), /* @__PURE__ */ React30.createElement(Box14, __spreadValues({
|
|
982
1038
|
as: "ul",
|
|
983
1039
|
ref,
|
|
984
1040
|
style: { width: triggerWidth },
|
|
@@ -988,13 +1044,13 @@ var Menu = (_a) => {
|
|
|
988
1044
|
overflowWrap: "break-word"
|
|
989
1045
|
},
|
|
990
1046
|
css: styles.container
|
|
991
|
-
}, menuProps), [...state.collection].map((item) => /* @__PURE__ */
|
|
1047
|
+
}, menuProps), [...state.collection].map((item) => /* @__PURE__ */ React30.createElement(MenuItem, {
|
|
992
1048
|
key: item.key,
|
|
993
1049
|
item,
|
|
994
1050
|
state,
|
|
995
1051
|
onAction: props.onSelect,
|
|
996
1052
|
css: styles.item
|
|
997
|
-
}))), /* @__PURE__ */
|
|
1053
|
+
}))), /* @__PURE__ */ React30.createElement(DismissButton, {
|
|
998
1054
|
onDismiss: ownProps.onClose
|
|
999
1055
|
})));
|
|
1000
1056
|
};
|
|
@@ -1002,815 +1058,1284 @@ Menu.Trigger = MenuTrigger;
|
|
|
1002
1058
|
Menu.Item = Item;
|
|
1003
1059
|
|
|
1004
1060
|
// src/Message/Message.tsx
|
|
1005
|
-
import
|
|
1061
|
+
import React31 from "react";
|
|
1006
1062
|
import { Exclamation, Info, Notification } from "@marigold/icons";
|
|
1063
|
+
import { useComponentStyles as useComponentStyles18 } from "@marigold/system";
|
|
1007
1064
|
var Message = (_a) => {
|
|
1008
1065
|
var _b = _a, {
|
|
1009
1066
|
messageTitle,
|
|
1010
1067
|
variant = "info",
|
|
1011
|
-
|
|
1068
|
+
size,
|
|
1012
1069
|
children
|
|
1013
1070
|
} = _b, props = __objRest(_b, [
|
|
1014
1071
|
"messageTitle",
|
|
1015
1072
|
"variant",
|
|
1016
|
-
"
|
|
1073
|
+
"size",
|
|
1017
1074
|
"children"
|
|
1018
1075
|
]);
|
|
1019
|
-
|
|
1076
|
+
const styles = useComponentStyles18("Message", {
|
|
1077
|
+
variant,
|
|
1078
|
+
size
|
|
1079
|
+
}, { parts: ["container", "icon", "title", "content"] });
|
|
1080
|
+
var icon = /* @__PURE__ */ React31.createElement(Info, null);
|
|
1020
1081
|
if (variant === "warning") {
|
|
1021
|
-
icon = /* @__PURE__ */
|
|
1082
|
+
icon = /* @__PURE__ */ React31.createElement(Notification, null);
|
|
1022
1083
|
}
|
|
1023
1084
|
if (variant === "error") {
|
|
1024
|
-
icon = /* @__PURE__ */
|
|
1085
|
+
icon = /* @__PURE__ */ React31.createElement(Exclamation, null);
|
|
1025
1086
|
}
|
|
1026
|
-
return /* @__PURE__ */
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
css: { color: "black" }
|
|
1087
|
+
return /* @__PURE__ */ React31.createElement(Box, __spreadValues({
|
|
1088
|
+
css: styles.container
|
|
1089
|
+
}, props), /* @__PURE__ */ React31.createElement(Box, {
|
|
1090
|
+
__baseCSS: { display: "flex", alignItems: "center", gap: 4 }
|
|
1091
|
+
}, /* @__PURE__ */ React31.createElement(Box, {
|
|
1092
|
+
role: "presentation",
|
|
1093
|
+
css: styles.icon
|
|
1094
|
+
}, icon), /* @__PURE__ */ React31.createElement(Box, {
|
|
1095
|
+
css: styles.title
|
|
1096
|
+
}, messageTitle)), /* @__PURE__ */ React31.createElement(Box, {
|
|
1097
|
+
css: styles.content
|
|
1038
1098
|
}, children));
|
|
1039
1099
|
};
|
|
1040
1100
|
|
|
1041
|
-
// src/
|
|
1042
|
-
import {
|
|
1043
|
-
import {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
import
|
|
1047
|
-
import {
|
|
1101
|
+
// src/NumberField/NumberField.tsx
|
|
1102
|
+
import React35, { forwardRef as forwardRef5 } from "react";
|
|
1103
|
+
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1104
|
+
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1105
|
+
import { useLocale } from "@react-aria/i18n";
|
|
1106
|
+
import { useNumberField } from "@react-aria/numberfield";
|
|
1107
|
+
import { mergeProps as mergeProps6, useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
1108
|
+
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
1048
1109
|
import {
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
__defaultTheme
|
|
1110
|
+
Box as Box18,
|
|
1111
|
+
useComponentStyles as useComponentStyles20,
|
|
1112
|
+
useStateProps as useStateProps5
|
|
1053
1113
|
} from "@marigold/system";
|
|
1054
|
-
function MarigoldProvider({
|
|
1055
|
-
theme,
|
|
1056
|
-
children
|
|
1057
|
-
}) {
|
|
1058
|
-
const outer = useTheme();
|
|
1059
|
-
const isTopLevel = outer.theme === __defaultTheme;
|
|
1060
|
-
return /* @__PURE__ */ React29.createElement(ThemeProvider, {
|
|
1061
|
-
theme
|
|
1062
|
-
}, isTopLevel ? /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(Global, null), /* @__PURE__ */ React29.createElement(OverlayProvider, null, children)) : children);
|
|
1063
|
-
}
|
|
1064
1114
|
|
|
1065
|
-
// src/
|
|
1115
|
+
// src/FieldBase/FieldBase.tsx
|
|
1116
|
+
import React33 from "react";
|
|
1117
|
+
import { Box as Box16 } from "@marigold/system";
|
|
1118
|
+
|
|
1119
|
+
// src/HelpText/HelpText.tsx
|
|
1066
1120
|
import React32 from "react";
|
|
1067
1121
|
import { Exclamation as Exclamation2 } from "@marigold/icons";
|
|
1068
|
-
import {
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
import { conditional, SVG } from "@marigold/system";
|
|
1074
|
-
var RadioIcon = ({
|
|
1075
|
-
variant = "",
|
|
1076
|
-
checked = false,
|
|
1077
|
-
disabled = false,
|
|
1078
|
-
error = false
|
|
1079
|
-
}) => {
|
|
1080
|
-
const conditionalStates = disabled ? {
|
|
1081
|
-
disabled
|
|
1082
|
-
} : {
|
|
1083
|
-
checked,
|
|
1084
|
-
error
|
|
1085
|
-
};
|
|
1086
|
-
return /* @__PURE__ */ React30.createElement(SVG, {
|
|
1087
|
-
width: "16",
|
|
1088
|
-
height: "32",
|
|
1089
|
-
viewBox: "0 0 16 32",
|
|
1090
|
-
fill: "none",
|
|
1091
|
-
"aria-hidden": "true"
|
|
1092
|
-
}, /* @__PURE__ */ React30.createElement(Box, {
|
|
1093
|
-
variant: conditional(`radio.${variant}`, conditionalStates),
|
|
1094
|
-
as: "circle",
|
|
1095
|
-
cx: "8",
|
|
1096
|
-
cy: "16",
|
|
1097
|
-
r: "7.5"
|
|
1098
|
-
}), checked && /* @__PURE__ */ React30.createElement("circle", {
|
|
1099
|
-
fill: "white",
|
|
1100
|
-
cx: "8",
|
|
1101
|
-
cy: "16",
|
|
1102
|
-
r: "3"
|
|
1103
|
-
}));
|
|
1104
|
-
};
|
|
1105
|
-
|
|
1106
|
-
// src/ValidationMessage/ValidationMessage.tsx
|
|
1107
|
-
import React31 from "react";
|
|
1108
|
-
var ValidationMessage = (_a) => {
|
|
1122
|
+
import {
|
|
1123
|
+
Box as Box15,
|
|
1124
|
+
useComponentStyles as useComponentStyles19
|
|
1125
|
+
} from "@marigold/system";
|
|
1126
|
+
var HelpText = (_a) => {
|
|
1109
1127
|
var _b = _a, {
|
|
1110
|
-
variant
|
|
1111
|
-
|
|
1112
|
-
|
|
1128
|
+
variant,
|
|
1129
|
+
size,
|
|
1130
|
+
disabled,
|
|
1131
|
+
description,
|
|
1132
|
+
descriptionProps,
|
|
1133
|
+
error,
|
|
1134
|
+
errorMessage,
|
|
1135
|
+
errorMessageProps
|
|
1113
1136
|
} = _b, props = __objRest(_b, [
|
|
1114
1137
|
"variant",
|
|
1115
|
-
"
|
|
1116
|
-
"
|
|
1138
|
+
"size",
|
|
1139
|
+
"disabled",
|
|
1140
|
+
"description",
|
|
1141
|
+
"descriptionProps",
|
|
1142
|
+
"error",
|
|
1143
|
+
"errorMessage",
|
|
1144
|
+
"errorMessageProps"
|
|
1117
1145
|
]);
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
},
|
|
1146
|
+
var _a2;
|
|
1147
|
+
const hasErrorMessage = errorMessage && error;
|
|
1148
|
+
const styles = useComponentStyles19("HelpText", { variant, size }, { parts: ["container", "icon"] });
|
|
1149
|
+
return /* @__PURE__ */ React32.createElement(Box15, __spreadProps(__spreadValues(__spreadValues({}, hasErrorMessage ? errorMessageProps : descriptionProps), props), {
|
|
1150
|
+
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
1151
|
+
css: styles.container
|
|
1152
|
+
}), hasErrorMessage ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Exclamation2, {
|
|
1153
|
+
role: "presentation",
|
|
1154
|
+
size: ((_a2 = styles == null ? void 0 : styles.icon) == null ? void 0 : _a2.size) || 16
|
|
1155
|
+
}), errorMessage) : /* @__PURE__ */ React32.createElement(React32.Fragment, null, description));
|
|
1125
1156
|
};
|
|
1126
1157
|
|
|
1127
|
-
// src/
|
|
1128
|
-
var
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
errorMessage
|
|
1149
|
-
} = _b, props = __objRest(_b, [
|
|
1150
|
-
"required",
|
|
1151
|
-
"labelVariant",
|
|
1152
|
-
"errorMessage"
|
|
1153
|
-
]);
|
|
1154
|
-
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Box, {
|
|
1155
|
-
as: Label2,
|
|
1156
|
-
htmlFor: props.id,
|
|
1158
|
+
// src/FieldBase/FieldBase.tsx
|
|
1159
|
+
var FieldBase = ({
|
|
1160
|
+
children,
|
|
1161
|
+
variant,
|
|
1162
|
+
size,
|
|
1163
|
+
width = "100%",
|
|
1164
|
+
disabled,
|
|
1165
|
+
required,
|
|
1166
|
+
label,
|
|
1167
|
+
labelProps,
|
|
1168
|
+
description,
|
|
1169
|
+
descriptionProps,
|
|
1170
|
+
error,
|
|
1171
|
+
errorMessage,
|
|
1172
|
+
errorMessageProps,
|
|
1173
|
+
stateProps
|
|
1174
|
+
}) => {
|
|
1175
|
+
const hasHelpText = !!description || errorMessage && error;
|
|
1176
|
+
return /* @__PURE__ */ React33.createElement(Box16, {
|
|
1177
|
+
css: { display: "flex", flexDirection: "column", width }
|
|
1178
|
+
}, label && /* @__PURE__ */ React33.createElement(Label, __spreadValues(__spreadValues({
|
|
1157
1179
|
required,
|
|
1158
|
-
variant
|
|
1159
|
-
|
|
1160
|
-
}, /* @__PURE__ */
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1180
|
+
variant,
|
|
1181
|
+
size
|
|
1182
|
+
}, labelProps), stateProps), label), children, hasHelpText && /* @__PURE__ */ React33.createElement(HelpText, __spreadProps(__spreadValues({}, stateProps), {
|
|
1183
|
+
variant,
|
|
1184
|
+
size,
|
|
1185
|
+
disabled,
|
|
1186
|
+
description,
|
|
1187
|
+
descriptionProps,
|
|
1188
|
+
error,
|
|
1189
|
+
errorMessage,
|
|
1190
|
+
errorMessageProps
|
|
1191
|
+
})));
|
|
1166
1192
|
};
|
|
1167
1193
|
|
|
1168
|
-
// src/
|
|
1169
|
-
import
|
|
1170
|
-
import { useSelectState } from "@react-stately/select";
|
|
1194
|
+
// src/NumberField/StepButton.tsx
|
|
1195
|
+
import React34, { useRef as useRef9 } from "react";
|
|
1171
1196
|
import { useButton as useButton3 } from "@react-aria/button";
|
|
1197
|
+
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
1172
1198
|
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
|
1199
|
+
import { Box as Box17, useStateProps as useStateProps4 } from "@marigold/system";
|
|
1200
|
+
var Plus = () => /* @__PURE__ */ React34.createElement(Box17, {
|
|
1201
|
+
as: "svg",
|
|
1202
|
+
__baseCSS: { width: 16, height: 16 },
|
|
1203
|
+
viewBox: "0 0 20 20",
|
|
1204
|
+
fill: "currentColor"
|
|
1205
|
+
}, /* @__PURE__ */ React34.createElement("path", {
|
|
1206
|
+
fillRule: "evenodd",
|
|
1207
|
+
clipRule: "evenodd",
|
|
1208
|
+
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"
|
|
1209
|
+
}));
|
|
1210
|
+
var Minus = () => /* @__PURE__ */ React34.createElement(Box17, {
|
|
1211
|
+
as: "svg",
|
|
1212
|
+
__baseCSS: { width: 16, height: 16 },
|
|
1213
|
+
viewBox: "0 0 20 20",
|
|
1214
|
+
fill: "currentColor"
|
|
1215
|
+
}, /* @__PURE__ */ React34.createElement("path", {
|
|
1216
|
+
fillRule: "evenodd",
|
|
1217
|
+
clipRule: "evenodd",
|
|
1218
|
+
d: "M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
1219
|
+
}));
|
|
1220
|
+
var StepButton = (_a) => {
|
|
1221
|
+
var _b = _a, { direction, css } = _b, props = __objRest(_b, ["direction", "css"]);
|
|
1222
|
+
const ref = useRef9(null);
|
|
1223
|
+
const { buttonProps, isPressed } = useButton3(__spreadProps(__spreadValues({}, props), { elementType: "div" }), ref);
|
|
1224
|
+
const { hoverProps, isHovered } = useHover2(props);
|
|
1225
|
+
const stateProps = useStateProps4({
|
|
1226
|
+
active: isPressed,
|
|
1227
|
+
hover: isHovered,
|
|
1228
|
+
disabled: props.isDisabled
|
|
1229
|
+
});
|
|
1230
|
+
const Icon3 = direction === "up" ? Plus : Minus;
|
|
1231
|
+
return /* @__PURE__ */ React34.createElement(Box17, __spreadValues(__spreadValues({
|
|
1232
|
+
__baseCSS: {
|
|
1233
|
+
display: "flex",
|
|
1234
|
+
alignItems: "center",
|
|
1235
|
+
justifyContent: "center",
|
|
1236
|
+
cursor: props.isDisabled ? "not-allowed" : "pointer"
|
|
1237
|
+
},
|
|
1238
|
+
css
|
|
1239
|
+
}, mergeProps5(buttonProps, hoverProps)), stateProps), /* @__PURE__ */ React34.createElement(Icon3, null));
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
// src/NumberField/NumberField.tsx
|
|
1243
|
+
var NumberField = forwardRef5((_a, ref) => {
|
|
1244
|
+
var _b = _a, {
|
|
1245
|
+
variant,
|
|
1246
|
+
size,
|
|
1247
|
+
width,
|
|
1248
|
+
disabled,
|
|
1249
|
+
required,
|
|
1250
|
+
readOnly,
|
|
1251
|
+
error,
|
|
1252
|
+
hideStepper
|
|
1253
|
+
} = _b, rest = __objRest(_b, [
|
|
1254
|
+
"variant",
|
|
1255
|
+
"size",
|
|
1256
|
+
"width",
|
|
1257
|
+
"disabled",
|
|
1258
|
+
"required",
|
|
1259
|
+
"readOnly",
|
|
1260
|
+
"error",
|
|
1261
|
+
"hideStepper"
|
|
1262
|
+
]);
|
|
1263
|
+
const props = __spreadValues({
|
|
1264
|
+
isDisabled: disabled,
|
|
1265
|
+
isRequired: required,
|
|
1266
|
+
isReadOnly: readOnly,
|
|
1267
|
+
validationState: error ? "invalid" : "valid"
|
|
1268
|
+
}, rest);
|
|
1269
|
+
const showStepper = !hideStepper;
|
|
1270
|
+
const { locale } = useLocale();
|
|
1271
|
+
const inputRef = useObjectRef2(ref);
|
|
1272
|
+
const state = useNumberFieldState(__spreadProps(__spreadValues({}, props), { locale }));
|
|
1273
|
+
const {
|
|
1274
|
+
labelProps,
|
|
1275
|
+
groupProps,
|
|
1276
|
+
inputProps,
|
|
1277
|
+
descriptionProps,
|
|
1278
|
+
errorMessageProps,
|
|
1279
|
+
incrementButtonProps,
|
|
1280
|
+
decrementButtonProps
|
|
1281
|
+
} = useNumberField(props, state, inputRef);
|
|
1282
|
+
const { hoverProps, isHovered } = useHover3({ isDisabled: disabled });
|
|
1283
|
+
const { focusProps, isFocused } = useFocusRing4({
|
|
1284
|
+
within: true,
|
|
1285
|
+
isTextInput: true,
|
|
1286
|
+
autoFocus: props.autoFocus
|
|
1287
|
+
});
|
|
1288
|
+
const styles = useComponentStyles20("NumberField", { variant, size }, { parts: ["group", "stepper"] });
|
|
1289
|
+
const stateProps = useStateProps5({
|
|
1290
|
+
hover: isHovered,
|
|
1291
|
+
focus: isFocused,
|
|
1292
|
+
disabled,
|
|
1293
|
+
readOnly,
|
|
1294
|
+
error
|
|
1295
|
+
});
|
|
1296
|
+
return /* @__PURE__ */ React35.createElement(FieldBase, {
|
|
1297
|
+
label: props.label,
|
|
1298
|
+
labelProps,
|
|
1299
|
+
required,
|
|
1300
|
+
description: props.description,
|
|
1301
|
+
descriptionProps,
|
|
1302
|
+
error,
|
|
1303
|
+
errorMessage: props.errorMessage,
|
|
1304
|
+
errorMessageProps,
|
|
1305
|
+
stateProps,
|
|
1306
|
+
variant,
|
|
1307
|
+
size,
|
|
1308
|
+
width
|
|
1309
|
+
}, /* @__PURE__ */ React35.createElement(Box18, __spreadValues(__spreadValues({
|
|
1310
|
+
"data-group": true,
|
|
1311
|
+
__baseCSS: {
|
|
1312
|
+
display: "flex",
|
|
1313
|
+
alignItems: "stretch",
|
|
1314
|
+
"> input": {
|
|
1315
|
+
flexGrow: 1
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
css: styles.group
|
|
1319
|
+
}, mergeProps6(groupProps, focusProps, hoverProps)), stateProps), showStepper && /* @__PURE__ */ React35.createElement(StepButton, __spreadValues({
|
|
1320
|
+
direction: "down",
|
|
1321
|
+
css: styles.stepper
|
|
1322
|
+
}, decrementButtonProps)), /* @__PURE__ */ React35.createElement(Input, __spreadValues(__spreadValues({
|
|
1323
|
+
ref: inputRef,
|
|
1324
|
+
variant,
|
|
1325
|
+
size
|
|
1326
|
+
}, inputProps), stateProps)), showStepper && /* @__PURE__ */ React35.createElement(StepButton, __spreadValues({
|
|
1327
|
+
direction: "up",
|
|
1328
|
+
css: styles.stepper
|
|
1329
|
+
}, incrementButtonProps))));
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
// src/Provider/index.ts
|
|
1333
|
+
import { useTheme as useTheme2, ThemeProvider as ThemeProvider2 } from "@marigold/system";
|
|
1334
|
+
import { SSRProvider } from "@react-aria/ssr";
|
|
1335
|
+
|
|
1336
|
+
// src/Provider/MarigoldProvider.tsx
|
|
1337
|
+
import React36 from "react";
|
|
1338
|
+
import { OverlayProvider } from "@react-aria/overlays";
|
|
1339
|
+
import {
|
|
1340
|
+
Global,
|
|
1341
|
+
ThemeProvider,
|
|
1342
|
+
useTheme,
|
|
1343
|
+
__defaultTheme
|
|
1344
|
+
} from "@marigold/system";
|
|
1345
|
+
function MarigoldProvider({
|
|
1346
|
+
theme,
|
|
1347
|
+
children
|
|
1348
|
+
}) {
|
|
1349
|
+
const outer = useTheme();
|
|
1350
|
+
const isTopLevel = outer.theme === __defaultTheme;
|
|
1351
|
+
return /* @__PURE__ */ React36.createElement(ThemeProvider, {
|
|
1352
|
+
theme
|
|
1353
|
+
}, isTopLevel ? /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(Global, null), /* @__PURE__ */ React36.createElement(OverlayProvider, null, children)) : children);
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
// src/Radio/Radio.tsx
|
|
1357
|
+
import React38, { useRef as useRef10 } from "react";
|
|
1358
|
+
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
1173
1359
|
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
1360
|
+
import { useRadio } from "@react-aria/radio";
|
|
1361
|
+
import {
|
|
1362
|
+
Box as Box20,
|
|
1363
|
+
useComponentStyles as useComponentStyles22,
|
|
1364
|
+
useStateProps as useStateProps6
|
|
1365
|
+
} from "@marigold/system";
|
|
1366
|
+
|
|
1367
|
+
// src/Radio/Context.ts
|
|
1368
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
1369
|
+
var RadioGroupContext = createContext4(null);
|
|
1370
|
+
var useRadioGroupContext = () => useContext4(RadioGroupContext);
|
|
1371
|
+
|
|
1372
|
+
// src/Radio/RadioGroup.tsx
|
|
1373
|
+
import React37 from "react";
|
|
1374
|
+
import { useRadioGroup } from "@react-aria/radio";
|
|
1375
|
+
import { useRadioGroupState } from "@react-stately/radio";
|
|
1376
|
+
import {
|
|
1377
|
+
Box as Box19,
|
|
1378
|
+
useComponentStyles as useComponentStyles21
|
|
1379
|
+
} from "@marigold/system";
|
|
1380
|
+
var RadioGroup = (_a) => {
|
|
1381
|
+
var _b = _a, {
|
|
1382
|
+
children,
|
|
1383
|
+
orientation = "vertical",
|
|
1384
|
+
size,
|
|
1385
|
+
variant,
|
|
1386
|
+
width,
|
|
1387
|
+
required,
|
|
1388
|
+
disabled,
|
|
1389
|
+
readOnly,
|
|
1390
|
+
error
|
|
1391
|
+
} = _b, rest = __objRest(_b, [
|
|
1392
|
+
"children",
|
|
1393
|
+
"orientation",
|
|
1394
|
+
"size",
|
|
1395
|
+
"variant",
|
|
1396
|
+
"width",
|
|
1397
|
+
"required",
|
|
1398
|
+
"disabled",
|
|
1399
|
+
"readOnly",
|
|
1400
|
+
"error"
|
|
1401
|
+
]);
|
|
1402
|
+
const props = __spreadValues({
|
|
1403
|
+
isRequired: required,
|
|
1404
|
+
isDisabled: disabled,
|
|
1405
|
+
isReadOnly: readOnly,
|
|
1406
|
+
validationState: error ? "invalid" : "valid"
|
|
1407
|
+
}, rest);
|
|
1408
|
+
const state = useRadioGroupState(props);
|
|
1409
|
+
const { radioGroupProps, labelProps } = useRadioGroup(props, state);
|
|
1410
|
+
const styles = useComponentStyles21("RadioGroup", { variant, size }, { parts: ["container", "group"] });
|
|
1411
|
+
return /* @__PURE__ */ React37.createElement(Box19, __spreadProps(__spreadValues({}, radioGroupProps), {
|
|
1412
|
+
css: styles.container
|
|
1413
|
+
}), props.label && /* @__PURE__ */ React37.createElement(Label, __spreadValues({
|
|
1414
|
+
as: "span",
|
|
1415
|
+
required
|
|
1416
|
+
}, labelProps), props.label), /* @__PURE__ */ React37.createElement(Box19, {
|
|
1417
|
+
role: "presentation",
|
|
1418
|
+
"data-orientation": orientation,
|
|
1419
|
+
__baseCSS: {
|
|
1420
|
+
display: "flex",
|
|
1421
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
1422
|
+
alignItems: "start",
|
|
1423
|
+
gap: orientation === "vertical" ? "0.5ch" : "1.5ch"
|
|
1424
|
+
},
|
|
1425
|
+
css: styles.group
|
|
1426
|
+
}, /* @__PURE__ */ React37.createElement(RadioGroupContext.Provider, {
|
|
1427
|
+
value: __spreadValues({ variant, size, width, error }, state)
|
|
1428
|
+
}, children)));
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1431
|
+
// src/Radio/Radio.tsx
|
|
1432
|
+
var Dot = () => /* @__PURE__ */ React38.createElement("svg", {
|
|
1433
|
+
viewBox: "0 0 6 6"
|
|
1434
|
+
}, /* @__PURE__ */ React38.createElement("circle", {
|
|
1435
|
+
fill: "currentColor",
|
|
1436
|
+
cx: "3",
|
|
1437
|
+
cy: "3",
|
|
1438
|
+
r: "3"
|
|
1439
|
+
}));
|
|
1440
|
+
var Icon2 = (_a) => {
|
|
1441
|
+
var _b = _a, { checked, css } = _b, props = __objRest(_b, ["checked", "css"]);
|
|
1442
|
+
return /* @__PURE__ */ React38.createElement(Box20, __spreadValues({
|
|
1443
|
+
"aria-hidden": "true",
|
|
1444
|
+
__baseCSS: {
|
|
1445
|
+
width: 16,
|
|
1446
|
+
height: 16,
|
|
1447
|
+
bg: "#fff",
|
|
1448
|
+
border: "1px solid #000",
|
|
1449
|
+
borderRadius: "50%",
|
|
1450
|
+
display: "flex",
|
|
1451
|
+
alignItems: "center",
|
|
1452
|
+
justifyContent: "center",
|
|
1453
|
+
p: 4
|
|
1454
|
+
},
|
|
1455
|
+
css
|
|
1456
|
+
}, props), checked ? /* @__PURE__ */ React38.createElement(Dot, null) : null);
|
|
1457
|
+
};
|
|
1458
|
+
var Radio = (_a) => {
|
|
1459
|
+
var _b = _a, { width, disabled } = _b, props = __objRest(_b, ["width", "disabled"]);
|
|
1460
|
+
const _a2 = useRadioGroupContext(), {
|
|
1461
|
+
variant,
|
|
1462
|
+
size,
|
|
1463
|
+
error,
|
|
1464
|
+
width: groupWidth
|
|
1465
|
+
} = _a2, state = __objRest(_a2, [
|
|
1466
|
+
"variant",
|
|
1467
|
+
"size",
|
|
1468
|
+
"error",
|
|
1469
|
+
"width"
|
|
1470
|
+
]);
|
|
1471
|
+
const ref = useRef10(null);
|
|
1472
|
+
const { inputProps } = useRadio(__spreadValues({ isDisabled: disabled }, props), state, ref);
|
|
1473
|
+
const styles = useComponentStyles22("Radio", { variant: variant || props.variant, size: size || props.size }, { parts: ["container", "label", "radio"] });
|
|
1474
|
+
const { hoverProps, isHovered } = useHover4({});
|
|
1475
|
+
const { isFocusVisible, focusProps } = useFocusRing5();
|
|
1476
|
+
const stateProps = useStateProps6({
|
|
1477
|
+
hover: isHovered,
|
|
1478
|
+
focus: isFocusVisible,
|
|
1479
|
+
checked: inputProps.checked,
|
|
1480
|
+
disabled: inputProps.disabled,
|
|
1481
|
+
readOnly: props.readOnly,
|
|
1482
|
+
error
|
|
1483
|
+
});
|
|
1484
|
+
return /* @__PURE__ */ React38.createElement(Box20, __spreadValues(__spreadValues({
|
|
1485
|
+
as: "label",
|
|
1486
|
+
__baseCSS: {
|
|
1487
|
+
display: "flex",
|
|
1488
|
+
alignItems: "center",
|
|
1489
|
+
gap: "1ch",
|
|
1490
|
+
position: "relative",
|
|
1491
|
+
width: width || groupWidth || "100%"
|
|
1492
|
+
},
|
|
1493
|
+
css: styles.container
|
|
1494
|
+
}, hoverProps), stateProps), /* @__PURE__ */ React38.createElement(Box20, __spreadValues(__spreadValues({
|
|
1495
|
+
as: "input",
|
|
1496
|
+
ref,
|
|
1497
|
+
css: {
|
|
1498
|
+
position: "absolute",
|
|
1499
|
+
width: "100%",
|
|
1500
|
+
height: "100%",
|
|
1501
|
+
top: 0,
|
|
1502
|
+
left: 0,
|
|
1503
|
+
zIndex: 1,
|
|
1504
|
+
opacity: 1e-4,
|
|
1505
|
+
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1506
|
+
}
|
|
1507
|
+
}, inputProps), focusProps)), /* @__PURE__ */ React38.createElement(Icon2, __spreadValues({
|
|
1508
|
+
checked: inputProps.checked,
|
|
1509
|
+
css: styles.radio
|
|
1510
|
+
}, stateProps)), /* @__PURE__ */ React38.createElement(Box20, __spreadValues({
|
|
1511
|
+
css: styles.label
|
|
1512
|
+
}, stateProps), props.children));
|
|
1513
|
+
};
|
|
1514
|
+
Radio.Group = RadioGroup;
|
|
1515
|
+
|
|
1516
|
+
// src/Select/Select.tsx
|
|
1517
|
+
import React42, { useRef as useRef12 } from "react";
|
|
1518
|
+
import { useButton as useButton4 } from "@react-aria/button";
|
|
1519
|
+
import { FocusScope as FocusScope3, useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1520
|
+
import { useMessageFormatter } from "@react-aria/i18n";
|
|
1521
|
+
import { DismissButton as DismissButton2, useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
|
1174
1522
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
1175
|
-
import {
|
|
1176
|
-
import {
|
|
1177
|
-
import {
|
|
1523
|
+
import { useSelectState } from "@react-stately/select";
|
|
1524
|
+
import { Item as Item2, Section } from "@react-stately/collections";
|
|
1525
|
+
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1526
|
+
import {
|
|
1527
|
+
Box as Box24,
|
|
1528
|
+
useComponentStyles as useComponentStyles24,
|
|
1529
|
+
useStateProps as useStateProps8
|
|
1530
|
+
} from "@marigold/system";
|
|
1178
1531
|
|
|
1179
|
-
// src/
|
|
1180
|
-
import
|
|
1532
|
+
// src/ListBox/ListBox.tsx
|
|
1533
|
+
import React41, { forwardRef as forwardRef6 } from "react";
|
|
1534
|
+
import { useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
1535
|
+
import {
|
|
1536
|
+
Box as Box23,
|
|
1537
|
+
useComponentStyles as useComponentStyles23
|
|
1538
|
+
} from "@marigold/system";
|
|
1181
1539
|
import { useListBox } from "@react-aria/listbox";
|
|
1182
1540
|
|
|
1183
|
-
// src/
|
|
1184
|
-
import
|
|
1541
|
+
// src/ListBox/Context.ts
|
|
1542
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
1543
|
+
var ListBoxContext = createContext5({});
|
|
1544
|
+
var useListBoxContext = () => useContext5(ListBoxContext);
|
|
1545
|
+
|
|
1546
|
+
// src/ListBox/ListBoxSection.tsx
|
|
1547
|
+
import React40 from "react";
|
|
1548
|
+
import { useListBoxSection } from "@react-aria/listbox";
|
|
1549
|
+
import { Box as Box22 } from "@marigold/system";
|
|
1550
|
+
|
|
1551
|
+
// src/ListBox/ListBoxOption.tsx
|
|
1552
|
+
import React39, { useRef as useRef11 } from "react";
|
|
1185
1553
|
import { useOption } from "@react-aria/listbox";
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
const
|
|
1189
|
-
const { optionProps, isSelected } = useOption({
|
|
1554
|
+
import { Box as Box21, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1555
|
+
var ListBoxOption = ({ item, state }) => {
|
|
1556
|
+
const ref = useRef11(null);
|
|
1557
|
+
const { optionProps, isSelected, isDisabled, isFocused } = useOption({
|
|
1190
1558
|
key: item.key
|
|
1191
1559
|
}, state, ref);
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
as: "li"
|
|
1201
|
-
}, optionProps), {
|
|
1560
|
+
const { styles } = useListBoxContext();
|
|
1561
|
+
const stateProps = useStateProps7({
|
|
1562
|
+
selected: isSelected,
|
|
1563
|
+
disabled: isDisabled,
|
|
1564
|
+
focusVisible: isFocused
|
|
1565
|
+
});
|
|
1566
|
+
return /* @__PURE__ */ React39.createElement(Box21, __spreadValues(__spreadValues({
|
|
1567
|
+
as: "li",
|
|
1202
1568
|
ref,
|
|
1203
|
-
|
|
1204
|
-
}), item.rendered);
|
|
1569
|
+
css: styles.option
|
|
1570
|
+
}, optionProps), stateProps), item.rendered);
|
|
1205
1571
|
};
|
|
1206
1572
|
|
|
1207
|
-
// src/
|
|
1208
|
-
import React34 from "react";
|
|
1209
|
-
import { useListBoxSection } from "@react-aria/listbox";
|
|
1573
|
+
// src/ListBox/ListBoxSection.tsx
|
|
1210
1574
|
var ListBoxSection = ({ section, state }) => {
|
|
1211
1575
|
const { itemProps, headingProps, groupProps } = useListBoxSection({
|
|
1212
1576
|
heading: section.rendered,
|
|
1213
1577
|
"aria-label": section["aria-label"]
|
|
1214
1578
|
});
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
css:
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
}), section.rendered
|
|
1222
|
-
as: "
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}), section.
|
|
1226
|
-
as: "ul"
|
|
1227
|
-
}, groupProps), [...section.childNodes].map((node) => /* @__PURE__ */ React34.createElement(Option, {
|
|
1579
|
+
const { styles } = useListBoxContext();
|
|
1580
|
+
return /* @__PURE__ */ React40.createElement(Box22, __spreadValues({
|
|
1581
|
+
as: "li",
|
|
1582
|
+
css: styles.section
|
|
1583
|
+
}, itemProps), section.rendered && /* @__PURE__ */ React40.createElement(Box22, __spreadValues({
|
|
1584
|
+
css: styles.sectionTitle
|
|
1585
|
+
}, headingProps), section.rendered), /* @__PURE__ */ React40.createElement(Box22, __spreadValues({
|
|
1586
|
+
as: "ul",
|
|
1587
|
+
__baseCSS: { listStyle: "none", p: 0 },
|
|
1588
|
+
css: styles.list
|
|
1589
|
+
}, groupProps), [...section.childNodes].map((node) => /* @__PURE__ */ React40.createElement(ListBoxOption, {
|
|
1228
1590
|
key: node.key,
|
|
1229
1591
|
item: node,
|
|
1230
1592
|
state
|
|
1231
1593
|
}))));
|
|
1232
1594
|
};
|
|
1233
1595
|
|
|
1234
|
-
// src/
|
|
1235
|
-
var ListBox = (
|
|
1236
|
-
|
|
1237
|
-
const
|
|
1238
|
-
const { listBoxProps } = useListBox(props, state,
|
|
1239
|
-
|
|
1596
|
+
// src/ListBox/ListBox.tsx
|
|
1597
|
+
var ListBox = forwardRef6((_a, ref) => {
|
|
1598
|
+
var _b = _a, { state, variant, size } = _b, props = __objRest(_b, ["state", "variant", "size"]);
|
|
1599
|
+
const innerRef = useObjectRef3(ref);
|
|
1600
|
+
const { listBoxProps } = useListBox(props, state, innerRef);
|
|
1601
|
+
const styles = useComponentStyles23("ListBox", { variant, size }, { parts: ["container", "list", "option", "section", "sectionTitle"] });
|
|
1602
|
+
return /* @__PURE__ */ React41.createElement(ListBoxContext.Provider, {
|
|
1603
|
+
value: { styles }
|
|
1604
|
+
}, /* @__PURE__ */ React41.createElement(Box23, {
|
|
1605
|
+
css: styles.container
|
|
1606
|
+
}, /* @__PURE__ */ React41.createElement(Box23, __spreadValues({
|
|
1240
1607
|
as: "ul",
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
}, listBoxProps), {
|
|
1246
|
-
variant: error ? "select.listbox.error" : "select.listbox",
|
|
1247
|
-
ref
|
|
1248
|
-
}), [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */ React35.createElement(ListBoxSection, {
|
|
1608
|
+
ref: innerRef,
|
|
1609
|
+
__baseCSS: { listStyle: "none", p: 0 },
|
|
1610
|
+
css: styles.list
|
|
1611
|
+
}, listBoxProps), [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */ React41.createElement(ListBoxSection, {
|
|
1249
1612
|
key: item.key,
|
|
1250
1613
|
section: item,
|
|
1251
1614
|
state
|
|
1252
|
-
}) : /* @__PURE__ */
|
|
1615
|
+
}) : /* @__PURE__ */ React41.createElement(ListBoxOption, {
|
|
1253
1616
|
key: item.key,
|
|
1254
1617
|
item,
|
|
1255
1618
|
state
|
|
1256
|
-
})));
|
|
1257
|
-
};
|
|
1258
|
-
|
|
1259
|
-
// src/Select/Popover.tsx
|
|
1260
|
-
import React36, { forwardRef as forwardRef3 } from "react";
|
|
1261
|
-
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
|
1262
|
-
import {
|
|
1263
|
-
DismissButton as DismissButton2,
|
|
1264
|
-
OverlayContainer as OverlayContainer2,
|
|
1265
|
-
useModal as useModal3,
|
|
1266
|
-
useOverlay as useOverlay3
|
|
1267
|
-
} from "@react-aria/overlays";
|
|
1268
|
-
import { mergeProps as mergeProps4 } from "@react-aria/utils";
|
|
1269
|
-
var Popover2 = forwardRef3((_a, ref) => {
|
|
1270
|
-
var _b = _a, { children, className, isOpen, onClose } = _b, otherProps = __objRest(_b, ["children", "className", "isOpen", "onClose"]);
|
|
1271
|
-
const { overlayProps } = useOverlay3({
|
|
1272
|
-
isOpen,
|
|
1273
|
-
onClose,
|
|
1274
|
-
shouldCloseOnBlur: true,
|
|
1275
|
-
isDismissable: true
|
|
1276
|
-
}, ref);
|
|
1277
|
-
const { modalProps } = useModal3();
|
|
1278
|
-
return /* @__PURE__ */ React36.createElement(OverlayContainer2, null, /* @__PURE__ */ React36.createElement(FocusScope3, {
|
|
1279
|
-
restoreFocus: true
|
|
1280
|
-
}, /* @__PURE__ */ React36.createElement(Box, __spreadProps(__spreadValues({}, mergeProps4(overlayProps, otherProps, modalProps)), {
|
|
1281
|
-
className,
|
|
1282
|
-
ref
|
|
1283
|
-
}), children, /* @__PURE__ */ React36.createElement(DismissButton2, {
|
|
1284
|
-
onDismiss: onClose
|
|
1285
|
-
}))));
|
|
1619
|
+
})))));
|
|
1286
1620
|
});
|
|
1287
1621
|
|
|
1622
|
+
// src/Select/intl.ts
|
|
1623
|
+
var messages = {
|
|
1624
|
+
"en-US": {
|
|
1625
|
+
placeholder: "Select an option\u2026"
|
|
1626
|
+
},
|
|
1627
|
+
"de-DE": {
|
|
1628
|
+
placeholder: "Option ausw\xE4hlen\u2026"
|
|
1629
|
+
}
|
|
1630
|
+
};
|
|
1631
|
+
|
|
1288
1632
|
// src/Select/Select.tsx
|
|
1633
|
+
var Chevron = ({ css }) => /* @__PURE__ */ React42.createElement(Box24, {
|
|
1634
|
+
as: "svg",
|
|
1635
|
+
__baseCSS: { width: 16, height: 16 },
|
|
1636
|
+
css,
|
|
1637
|
+
fill: "none",
|
|
1638
|
+
viewBox: "0 0 24 24",
|
|
1639
|
+
stroke: "currentColor",
|
|
1640
|
+
strokeWidth: 2
|
|
1641
|
+
}, /* @__PURE__ */ React42.createElement("path", {
|
|
1642
|
+
strokeLinecap: "round",
|
|
1643
|
+
strokeLinejoin: "round",
|
|
1644
|
+
d: "M19 9l-7 7-7-7"
|
|
1645
|
+
}));
|
|
1289
1646
|
var Select = (_a) => {
|
|
1290
1647
|
var _b = _a, {
|
|
1291
|
-
|
|
1292
|
-
|
|
1648
|
+
variant,
|
|
1649
|
+
size,
|
|
1650
|
+
width,
|
|
1651
|
+
open,
|
|
1293
1652
|
disabled,
|
|
1294
1653
|
required,
|
|
1295
|
-
error
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
"
|
|
1301
|
-
"placeholder",
|
|
1654
|
+
error
|
|
1655
|
+
} = _b, rest = __objRest(_b, [
|
|
1656
|
+
"variant",
|
|
1657
|
+
"size",
|
|
1658
|
+
"width",
|
|
1659
|
+
"open",
|
|
1302
1660
|
"disabled",
|
|
1303
1661
|
"required",
|
|
1304
|
-
"error"
|
|
1305
|
-
"errorMessage",
|
|
1306
|
-
"width",
|
|
1307
|
-
"className"
|
|
1662
|
+
"error"
|
|
1308
1663
|
]);
|
|
1664
|
+
const formatMessage = useMessageFormatter(messages);
|
|
1665
|
+
const props = __spreadValues({
|
|
1666
|
+
isOpen: open,
|
|
1667
|
+
isDisabled: disabled,
|
|
1668
|
+
isRequired: required,
|
|
1669
|
+
validationState: error ? "invalid" : "valid",
|
|
1670
|
+
placeholder: rest.placeholder || formatMessage("placeholder")
|
|
1671
|
+
}, rest);
|
|
1309
1672
|
const state = useSelectState(props);
|
|
1310
|
-
const
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1313
|
-
|
|
1673
|
+
const buttonRef = useRef12(null);
|
|
1674
|
+
const {
|
|
1675
|
+
labelProps,
|
|
1676
|
+
triggerProps,
|
|
1677
|
+
valueProps,
|
|
1678
|
+
menuProps,
|
|
1679
|
+
descriptionProps,
|
|
1680
|
+
errorMessageProps
|
|
1681
|
+
} = useSelect(props, state, buttonRef);
|
|
1682
|
+
const { buttonProps } = useButton4(__spreadValues({ isDisabled: disabled }, triggerProps), buttonRef);
|
|
1683
|
+
const { focusProps, isFocusVisible } = useFocusRing6();
|
|
1684
|
+
const overlayRef = useRef12(null);
|
|
1314
1685
|
const { overlayProps: positionProps } = useOverlayPosition2({
|
|
1315
|
-
targetRef:
|
|
1686
|
+
targetRef: buttonRef,
|
|
1316
1687
|
overlayRef,
|
|
1317
|
-
placement: "bottom",
|
|
1318
|
-
shouldFlip: false,
|
|
1319
1688
|
isOpen: state.isOpen,
|
|
1320
|
-
|
|
1689
|
+
placement: "bottom left"
|
|
1321
1690
|
});
|
|
1322
|
-
const
|
|
1323
|
-
const
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1691
|
+
const styles = useComponentStyles24("Select", { variant, size }, { parts: ["container", "button", "icon"] });
|
|
1692
|
+
const stateProps = useStateProps8({
|
|
1693
|
+
disabled,
|
|
1694
|
+
error,
|
|
1695
|
+
focusVisible: isFocusVisible,
|
|
1696
|
+
expanded: state.isOpen
|
|
1697
|
+
});
|
|
1698
|
+
return /* @__PURE__ */ React42.createElement(FieldBase, {
|
|
1699
|
+
variant,
|
|
1700
|
+
size,
|
|
1701
|
+
width,
|
|
1702
|
+
label: props.label,
|
|
1703
|
+
labelProps: __spreadValues({ as: "span" }, labelProps),
|
|
1704
|
+
description: props.description,
|
|
1705
|
+
descriptionProps,
|
|
1706
|
+
error,
|
|
1707
|
+
errorMessage: props.errorMessage,
|
|
1708
|
+
errorMessageProps,
|
|
1709
|
+
stateProps,
|
|
1710
|
+
disabled,
|
|
1711
|
+
required
|
|
1712
|
+
}, /* @__PURE__ */ React42.createElement(HiddenSelect, {
|
|
1340
1713
|
state,
|
|
1341
|
-
triggerRef,
|
|
1714
|
+
triggerRef: buttonRef,
|
|
1342
1715
|
label: props.label,
|
|
1343
1716
|
name: props.name,
|
|
1344
1717
|
isDisabled: disabled
|
|
1345
|
-
}), /* @__PURE__ */
|
|
1346
|
-
as: "button"
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
as: "span"
|
|
1354
|
-
}, valueProps), {
|
|
1355
|
-
variant: disabled ? "select.disabled" : "select"
|
|
1356
|
-
}), state.selectedItem ? state.selectedItem.rendered : placeholder), state.isOpen && !disabled ? /* @__PURE__ */ React37.createElement(ArrowUp, {
|
|
1357
|
-
size: 16,
|
|
1358
|
-
fill: "text"
|
|
1359
|
-
}) : /* @__PURE__ */ React37.createElement(ArrowDown, {
|
|
1360
|
-
size: 16,
|
|
1361
|
-
fill: disabled ? "disabled" : "text"
|
|
1362
|
-
})), state.isOpen && !disabled && /* @__PURE__ */ React37.createElement(Box, __spreadProps(__spreadValues(__spreadValues({
|
|
1363
|
-
as: Popover2
|
|
1364
|
-
}, overlayProps), positionProps), {
|
|
1365
|
-
css: {
|
|
1366
|
-
width: triggerRef.current && triggerRef.current.offsetWidth + "px"
|
|
1718
|
+
}), /* @__PURE__ */ React42.createElement(Box24, __spreadValues(__spreadValues({
|
|
1719
|
+
as: "button",
|
|
1720
|
+
__baseCSS: {
|
|
1721
|
+
display: "flex",
|
|
1722
|
+
position: "relative",
|
|
1723
|
+
alignItems: "center",
|
|
1724
|
+
justifyContent: "space-between",
|
|
1725
|
+
width: "100%"
|
|
1367
1726
|
},
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
})
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1727
|
+
css: styles.button,
|
|
1728
|
+
ref: buttonRef
|
|
1729
|
+
}, mergeProps7(buttonProps, focusProps)), stateProps), /* @__PURE__ */ React42.createElement(Box24, __spreadValues({
|
|
1730
|
+
css: {
|
|
1731
|
+
overflow: "hidden",
|
|
1732
|
+
whiteSpace: "nowrap"
|
|
1733
|
+
}
|
|
1734
|
+
}, valueProps), state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ React42.createElement(Chevron, {
|
|
1735
|
+
css: styles.icon
|
|
1736
|
+
})), /* @__PURE__ */ React42.createElement(Popover, __spreadValues({
|
|
1737
|
+
open: state.isOpen,
|
|
1738
|
+
onClose: state.close,
|
|
1739
|
+
dismissable: true,
|
|
1740
|
+
shouldCloseOnBlur: true,
|
|
1741
|
+
minWidth: buttonRef.current ? buttonRef.current.offsetWidth : void 0,
|
|
1742
|
+
ref: overlayRef
|
|
1743
|
+
}, positionProps), /* @__PURE__ */ React42.createElement(FocusScope3, {
|
|
1744
|
+
restoreFocus: true
|
|
1745
|
+
}, /* @__PURE__ */ React42.createElement(DismissButton2, {
|
|
1746
|
+
onDismiss: state.close
|
|
1747
|
+
}), /* @__PURE__ */ React42.createElement(ListBox, __spreadValues({
|
|
1748
|
+
state,
|
|
1749
|
+
variant,
|
|
1750
|
+
size
|
|
1751
|
+
}, menuProps)), /* @__PURE__ */ React42.createElement(DismissButton2, {
|
|
1752
|
+
onDismiss: state.close
|
|
1753
|
+
}))));
|
|
1384
1754
|
};
|
|
1755
|
+
Select.Option = Item2;
|
|
1756
|
+
Select.Section = Section;
|
|
1385
1757
|
|
|
1386
1758
|
// src/Slider/Slider.tsx
|
|
1387
|
-
import
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1759
|
+
import React44, { useRef as useRef13 } from "react";
|
|
1760
|
+
import { useSlider } from "@react-aria/slider";
|
|
1761
|
+
import { useSliderState } from "@react-stately/slider";
|
|
1762
|
+
import { useNumberFormatter } from "@react-aria/i18n";
|
|
1763
|
+
import { useComponentStyles as useComponentStyles25 } from "@marigold/system";
|
|
1764
|
+
|
|
1765
|
+
// src/Slider/Thumb.tsx
|
|
1766
|
+
import React43, { useEffect } from "react";
|
|
1767
|
+
import { useSliderThumb } from "@react-aria/slider";
|
|
1768
|
+
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
1769
|
+
import { useStateProps as useStateProps9 } from "@marigold/system";
|
|
1770
|
+
|
|
1771
|
+
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
1772
|
+
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
1773
|
+
|
|
1774
|
+
// src/Slider/Thumb.tsx
|
|
1775
|
+
import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
|
|
1776
|
+
var Thumb = (_a) => {
|
|
1777
|
+
var _b = _a, { state, trackRef, styles } = _b, props = __objRest(_b, ["state", "trackRef", "styles"]);
|
|
1778
|
+
const { disabled } = props;
|
|
1779
|
+
const inputRef = React43.useRef(null);
|
|
1780
|
+
const { isFocusVisible, focusProps, isFocused } = useFocusRing7();
|
|
1781
|
+
const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
|
|
1782
|
+
const stateProps = useStateProps9({
|
|
1783
|
+
focus: focused,
|
|
1784
|
+
disabled
|
|
1785
|
+
});
|
|
1786
|
+
const { thumbProps, inputProps } = useSliderThumb({
|
|
1787
|
+
index: 0,
|
|
1788
|
+
trackRef,
|
|
1789
|
+
inputRef,
|
|
1790
|
+
isDisabled: disabled
|
|
1791
|
+
}, state);
|
|
1792
|
+
useEffect(() => {
|
|
1793
|
+
state.setThumbEditable(0, !disabled);
|
|
1794
|
+
}, [disabled, state]);
|
|
1795
|
+
return /* @__PURE__ */ React43.createElement(Box, {
|
|
1796
|
+
__baseCSS: {
|
|
1797
|
+
position: "absolute",
|
|
1798
|
+
top: 16,
|
|
1799
|
+
transform: "translateX(-50%)",
|
|
1800
|
+
left: `${state.getThumbPercent(0) * 100}%`
|
|
1801
|
+
}
|
|
1802
|
+
}, /* @__PURE__ */ React43.createElement(Box, __spreadValues(__spreadProps(__spreadValues({}, thumbProps), {
|
|
1803
|
+
__baseCSS: styles
|
|
1804
|
+
}), stateProps), /* @__PURE__ */ React43.createElement(VisuallyHidden, null, /* @__PURE__ */ React43.createElement(Box, __spreadValues({
|
|
1391
1805
|
as: "input",
|
|
1392
1806
|
type: "range",
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
}, props));
|
|
1807
|
+
ref: inputRef
|
|
1808
|
+
}, mergeProps8(inputProps, focusProps))))));
|
|
1396
1809
|
};
|
|
1397
1810
|
|
|
1398
|
-
// src/
|
|
1399
|
-
|
|
1400
|
-
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1401
|
-
import { useSwitch } from "@react-aria/switch";
|
|
1402
|
-
import { VisuallyHidden as VisuallyHidden3 } from "@react-aria/visually-hidden";
|
|
1403
|
-
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
1404
|
-
import { conditional as conditional2 } from "@marigold/system";
|
|
1405
|
-
var Switch = (_a) => {
|
|
1811
|
+
// src/Slider/Slider.tsx
|
|
1812
|
+
var Slider = (_a) => {
|
|
1406
1813
|
var _b = _a, {
|
|
1407
|
-
variant
|
|
1408
|
-
|
|
1409
|
-
|
|
1814
|
+
variant,
|
|
1815
|
+
size,
|
|
1816
|
+
width = "100%"
|
|
1410
1817
|
} = _b, props = __objRest(_b, [
|
|
1411
1818
|
"variant",
|
|
1412
|
-
"
|
|
1413
|
-
"
|
|
1819
|
+
"size",
|
|
1820
|
+
"width"
|
|
1414
1821
|
]);
|
|
1415
|
-
const
|
|
1416
|
-
const
|
|
1417
|
-
const
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
variant: labelVariant
|
|
1425
|
-
}, props.children, /* @__PURE__ */ React39.createElement(VisuallyHidden3, null, /* @__PURE__ */ React39.createElement("input", __spreadProps(__spreadValues(__spreadValues({}, inputProps), focusProps), {
|
|
1426
|
-
disabled,
|
|
1427
|
-
ref
|
|
1428
|
-
}))), /* @__PURE__ */ React39.createElement(Box, {
|
|
1429
|
-
as: "svg",
|
|
1430
|
-
__baseCSS: {
|
|
1431
|
-
cursor: disabled ? "not-allowed" : "pointer",
|
|
1432
|
-
width: 56,
|
|
1433
|
-
height: 32
|
|
1434
|
-
},
|
|
1435
|
-
"aria-hidden": "true"
|
|
1436
|
-
}, /* @__PURE__ */ React39.createElement(Box, {
|
|
1437
|
-
as: "rect",
|
|
1822
|
+
const { formatOptions } = props;
|
|
1823
|
+
const trackRef = useRef13(null);
|
|
1824
|
+
const numberFormatter = useNumberFormatter(formatOptions);
|
|
1825
|
+
const state = useSliderState(__spreadProps(__spreadValues({}, props), { numberFormatter }));
|
|
1826
|
+
const { groupProps, trackProps, labelProps, outputProps } = useSlider(__spreadValues({
|
|
1827
|
+
label: props.children
|
|
1828
|
+
}, props), state, trackRef);
|
|
1829
|
+
const styles = useComponentStyles25("Slider", { variant, size }, { parts: ["track", "thumb", "label", "output"] });
|
|
1830
|
+
return /* @__PURE__ */ React44.createElement(Box, __spreadValues({
|
|
1438
1831
|
__baseCSS: {
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
width
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
}), /* @__PURE__ */
|
|
1450
|
-
as: "
|
|
1832
|
+
display: "flex",
|
|
1833
|
+
flexDirection: "column",
|
|
1834
|
+
touchAction: "none",
|
|
1835
|
+
width
|
|
1836
|
+
}
|
|
1837
|
+
}, groupProps), /* @__PURE__ */ React44.createElement(Box, {
|
|
1838
|
+
__baseCSS: { display: "flex", alignSelf: "stretch" }
|
|
1839
|
+
}, props.children && /* @__PURE__ */ React44.createElement(Box, __spreadValues({
|
|
1840
|
+
as: "label",
|
|
1841
|
+
__baseCSS: styles.label
|
|
1842
|
+
}, labelProps), props.children), /* @__PURE__ */ React44.createElement(Box, __spreadProps(__spreadValues({
|
|
1843
|
+
as: "output"
|
|
1844
|
+
}, outputProps), {
|
|
1845
|
+
__baseCSS: { flex: "1 0 auto", textAlign: "end" },
|
|
1846
|
+
css: styles.output
|
|
1847
|
+
}), state.getThumbValueLabel(0))), /* @__PURE__ */ React44.createElement(Box, __spreadProps(__spreadValues({}, trackProps), {
|
|
1848
|
+
ref: trackRef,
|
|
1451
1849
|
__baseCSS: {
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
fill: disabled ? "gray20" : "gray00"
|
|
1850
|
+
position: "relative",
|
|
1851
|
+
height: 32,
|
|
1852
|
+
width: "100%",
|
|
1853
|
+
cursor: props.disabled ? "not-allowed" : "pointer"
|
|
1457
1854
|
}
|
|
1855
|
+
}), /* @__PURE__ */ React44.createElement(Box, {
|
|
1856
|
+
__baseCSS: styles.track
|
|
1857
|
+
}), /* @__PURE__ */ React44.createElement(Thumb, {
|
|
1858
|
+
state,
|
|
1859
|
+
trackRef,
|
|
1860
|
+
disabled: props.disabled,
|
|
1861
|
+
styles: styles.thumb
|
|
1458
1862
|
})));
|
|
1459
1863
|
};
|
|
1460
1864
|
|
|
1461
1865
|
// src/Stack/Stack.tsx
|
|
1462
|
-
import
|
|
1463
|
-
var
|
|
1866
|
+
import React45 from "react";
|
|
1867
|
+
var ALIGNMENT_X2 = {
|
|
1464
1868
|
left: "flex-start",
|
|
1465
1869
|
center: "center",
|
|
1466
1870
|
right: "flex-end"
|
|
1467
1871
|
};
|
|
1872
|
+
var ALIGNMENT_Y2 = {
|
|
1873
|
+
top: "flex-start",
|
|
1874
|
+
center: "center",
|
|
1875
|
+
bottom: "flex-end"
|
|
1876
|
+
};
|
|
1468
1877
|
var Stack = (_a) => {
|
|
1469
1878
|
var _b = _a, {
|
|
1879
|
+
children,
|
|
1470
1880
|
space = "none",
|
|
1471
|
-
|
|
1472
|
-
|
|
1881
|
+
alignX = "left",
|
|
1882
|
+
alignY = "top",
|
|
1883
|
+
stretch = false
|
|
1473
1884
|
} = _b, props = __objRest(_b, [
|
|
1885
|
+
"children",
|
|
1474
1886
|
"space",
|
|
1475
|
-
"
|
|
1476
|
-
"
|
|
1887
|
+
"alignX",
|
|
1888
|
+
"alignY",
|
|
1889
|
+
"stretch"
|
|
1477
1890
|
]);
|
|
1478
|
-
return /* @__PURE__ */
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1891
|
+
return /* @__PURE__ */ React45.createElement(Box, __spreadValues({
|
|
1892
|
+
css: {
|
|
1893
|
+
display: "flex",
|
|
1894
|
+
flexDirection: "column",
|
|
1895
|
+
p: 0,
|
|
1896
|
+
gap: space,
|
|
1897
|
+
alignItems: ALIGNMENT_X2[alignX],
|
|
1898
|
+
justifyContent: ALIGNMENT_Y2[alignY],
|
|
1899
|
+
blockSize: stretch ? "100%" : "auto"
|
|
1900
|
+
}
|
|
1901
|
+
}, props), children);
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
// src/Switch/Switch.tsx
|
|
1905
|
+
import React46, { useRef as useRef14 } from "react";
|
|
1906
|
+
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
1907
|
+
import { useSwitch } from "@react-aria/switch";
|
|
1908
|
+
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
1909
|
+
import {
|
|
1910
|
+
useComponentStyles as useComponentStyles26,
|
|
1911
|
+
useStateProps as useStateProps10
|
|
1912
|
+
} from "@marigold/system";
|
|
1913
|
+
var Switch = (_a) => {
|
|
1914
|
+
var _b = _a, {
|
|
1915
|
+
variant,
|
|
1916
|
+
size,
|
|
1917
|
+
width = "100%",
|
|
1918
|
+
checked,
|
|
1919
|
+
disabled,
|
|
1920
|
+
readOnly,
|
|
1921
|
+
defaultChecked
|
|
1922
|
+
} = _b, rest = __objRest(_b, [
|
|
1923
|
+
"variant",
|
|
1924
|
+
"size",
|
|
1925
|
+
"width",
|
|
1926
|
+
"checked",
|
|
1927
|
+
"disabled",
|
|
1928
|
+
"readOnly",
|
|
1929
|
+
"defaultChecked"
|
|
1930
|
+
]);
|
|
1931
|
+
const ref = useRef14(null);
|
|
1932
|
+
const props = __spreadValues({
|
|
1933
|
+
isSelected: checked,
|
|
1934
|
+
isDisabled: disabled,
|
|
1935
|
+
isReadOnly: readOnly,
|
|
1936
|
+
defaultSelected: defaultChecked
|
|
1937
|
+
}, rest);
|
|
1938
|
+
const state = useToggleState2(props);
|
|
1939
|
+
const { inputProps } = useSwitch(props, state, ref);
|
|
1940
|
+
const { isFocusVisible, focusProps } = useFocusRing8();
|
|
1941
|
+
const stateProps = useStateProps10({
|
|
1942
|
+
checked: state.isSelected,
|
|
1943
|
+
disabled,
|
|
1944
|
+
readOnly,
|
|
1945
|
+
focus: isFocusVisible
|
|
1946
|
+
});
|
|
1947
|
+
const styles = useComponentStyles26("Switch", { variant, size }, { parts: ["container", "label", "track", "thumb"] });
|
|
1948
|
+
return /* @__PURE__ */ React46.createElement(Box, {
|
|
1949
|
+
as: "label",
|
|
1950
|
+
__baseCSS: {
|
|
1951
|
+
display: "flex",
|
|
1952
|
+
alignItems: "center",
|
|
1953
|
+
justifyContent: "space-between",
|
|
1954
|
+
gap: "1ch",
|
|
1955
|
+
position: "relative",
|
|
1956
|
+
width
|
|
1957
|
+
},
|
|
1958
|
+
css: styles.container
|
|
1959
|
+
}, /* @__PURE__ */ React46.createElement(Box, __spreadValues(__spreadValues({
|
|
1960
|
+
as: "input",
|
|
1961
|
+
ref,
|
|
1962
|
+
css: {
|
|
1963
|
+
position: "absolute",
|
|
1964
|
+
width: "100%",
|
|
1965
|
+
height: "100%",
|
|
1966
|
+
top: 0,
|
|
1967
|
+
left: 0,
|
|
1968
|
+
zIndex: 1,
|
|
1969
|
+
opacity: 1e-4,
|
|
1970
|
+
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1971
|
+
}
|
|
1972
|
+
}, inputProps), focusProps)), props.children && /* @__PURE__ */ React46.createElement(Box, {
|
|
1973
|
+
css: styles.label
|
|
1974
|
+
}, props.children), /* @__PURE__ */ React46.createElement(Box, __spreadValues({
|
|
1975
|
+
__baseCSS: {
|
|
1976
|
+
position: "relative",
|
|
1977
|
+
width: 48,
|
|
1978
|
+
height: 24,
|
|
1979
|
+
bg: "#dee2e6",
|
|
1980
|
+
borderRadius: 20
|
|
1981
|
+
},
|
|
1982
|
+
css: styles.track
|
|
1983
|
+
}, stateProps), /* @__PURE__ */ React46.createElement(Box, __spreadValues({
|
|
1984
|
+
__baseCSS: {
|
|
1985
|
+
display: "block",
|
|
1986
|
+
position: "absolute",
|
|
1987
|
+
top: 1,
|
|
1988
|
+
left: 0,
|
|
1989
|
+
willChange: "transform",
|
|
1990
|
+
transform: "translateX(1px)",
|
|
1991
|
+
transition: "all 0.1s cubic-bezier(.7, 0, .3, 1)",
|
|
1992
|
+
height: 22,
|
|
1993
|
+
width: 22,
|
|
1994
|
+
borderRadius: 9999,
|
|
1995
|
+
bg: "#fff",
|
|
1996
|
+
"&:checked": {
|
|
1997
|
+
transform: "translateX(calc(47px - 100%))"
|
|
1998
|
+
}
|
|
1999
|
+
},
|
|
2000
|
+
css: styles.thumb
|
|
2001
|
+
}, stateProps))));
|
|
1485
2002
|
};
|
|
1486
2003
|
|
|
1487
2004
|
// src/Table/Table.tsx
|
|
1488
|
-
import
|
|
2005
|
+
import React55, { useRef as useRef21 } from "react";
|
|
1489
2006
|
import { useTable } from "@react-aria/table";
|
|
1490
2007
|
import {
|
|
1491
2008
|
Cell,
|
|
1492
2009
|
Column,
|
|
1493
2010
|
Row,
|
|
1494
|
-
TableBody,
|
|
1495
|
-
TableHeader,
|
|
2011
|
+
TableBody as Body,
|
|
2012
|
+
TableHeader as Header2,
|
|
1496
2013
|
useTableState
|
|
1497
2014
|
} from "@react-stately/table";
|
|
1498
|
-
import {
|
|
2015
|
+
import {
|
|
2016
|
+
Box as Box30,
|
|
2017
|
+
useComponentStyles as useComponentStyles27
|
|
2018
|
+
} from "@marigold/system";
|
|
2019
|
+
|
|
2020
|
+
// src/Table/Context.tsx
|
|
2021
|
+
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
2022
|
+
var TableContext = createContext6({});
|
|
2023
|
+
var useTableContext = () => useContext6(TableContext);
|
|
2024
|
+
|
|
2025
|
+
// src/Table/TableBody.tsx
|
|
2026
|
+
import React47 from "react";
|
|
2027
|
+
import { useTableRowGroup } from "@react-aria/table";
|
|
2028
|
+
var TableBody = ({ children }) => {
|
|
2029
|
+
const { rowGroupProps } = useTableRowGroup();
|
|
2030
|
+
return /* @__PURE__ */ React47.createElement("tbody", __spreadValues({}, rowGroupProps), children);
|
|
2031
|
+
};
|
|
1499
2032
|
|
|
1500
2033
|
// src/Table/TableCell.tsx
|
|
1501
|
-
import
|
|
1502
|
-
import {
|
|
1503
|
-
import { useFocusRing as
|
|
1504
|
-
import {
|
|
1505
|
-
import {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
const { gridCellProps } = useTableCell({ node: cell }, state, cellRef);
|
|
1517
|
-
const { checkboxProps } = useTableSelectionCheckbox({ key: cell.parentKey }, state);
|
|
1518
|
-
const inputRef = useRef10(null);
|
|
1519
|
-
const { inputProps } = useCheckbox2(checkboxProps, useToggleState3(checkboxProps), inputRef);
|
|
1520
|
-
const { focusProps, isFocusVisible } = useFocusRing7();
|
|
1521
|
-
const stateProps = useStateProps4({ focus: isFocusVisible });
|
|
1522
|
-
return /* @__PURE__ */ React41.createElement(Box, __spreadValues(__spreadValues({
|
|
2034
|
+
import React48, { useRef as useRef15 } from "react";
|
|
2035
|
+
import { useTableCell } from "@react-aria/table";
|
|
2036
|
+
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2037
|
+
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
2038
|
+
import { Box as Box25, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2039
|
+
var TableCell = ({ cell }) => {
|
|
2040
|
+
const ref = useRef15(null);
|
|
2041
|
+
const { state, styles } = useTableContext();
|
|
2042
|
+
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2043
|
+
const { gridCellProps } = useTableCell({
|
|
2044
|
+
node: cell
|
|
2045
|
+
}, state, ref);
|
|
2046
|
+
const { focusProps, isFocusVisible } = useFocusRing9();
|
|
2047
|
+
const stateProps = useStateProps11({ disabled, focusVisible: isFocusVisible });
|
|
2048
|
+
return /* @__PURE__ */ React48.createElement(Box25, __spreadValues(__spreadValues({
|
|
1523
2049
|
as: "td",
|
|
1524
|
-
ref
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
},
|
|
1528
|
-
css
|
|
1529
|
-
}, mergeProps6(gridCellProps, focusProps)), stateProps), isSelectionCell ? /* @__PURE__ */ React41.createElement("input", __spreadValues({}, inputProps)) : /* @__PURE__ */ React41.createElement(React41.Fragment, null, cell.rendered));
|
|
2050
|
+
ref,
|
|
2051
|
+
css: styles.cell
|
|
2052
|
+
}, mergeProps9(gridCellProps, focusProps)), stateProps), cell.rendered);
|
|
1530
2053
|
};
|
|
1531
2054
|
|
|
1532
|
-
// src/Table/
|
|
1533
|
-
import
|
|
1534
|
-
import {
|
|
1535
|
-
import { useFocusRing as
|
|
1536
|
-
import {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
size,
|
|
1554
|
-
align,
|
|
1555
|
-
color,
|
|
1556
|
-
fontSize,
|
|
1557
|
-
cursor,
|
|
1558
|
-
outline,
|
|
1559
|
-
children
|
|
1560
|
-
} = _b, props = __objRest(_b, [
|
|
1561
|
-
"variant",
|
|
1562
|
-
"size",
|
|
1563
|
-
"align",
|
|
1564
|
-
"color",
|
|
1565
|
-
"fontSize",
|
|
1566
|
-
"cursor",
|
|
1567
|
-
"outline",
|
|
1568
|
-
"children"
|
|
2055
|
+
// src/Table/TableCheckboxCell.tsx
|
|
2056
|
+
import React49, { useRef as useRef16 } from "react";
|
|
2057
|
+
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
2058
|
+
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2059
|
+
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
2060
|
+
import { Box as Box26, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2061
|
+
|
|
2062
|
+
// src/Table/utils.ts
|
|
2063
|
+
var mapCheckboxProps = (_a) => {
|
|
2064
|
+
var {
|
|
2065
|
+
checkboxProps: _b
|
|
2066
|
+
} = _a, _c = _b, {
|
|
2067
|
+
isIndeterminate,
|
|
2068
|
+
isSelected,
|
|
2069
|
+
isDisabled,
|
|
2070
|
+
defaultSelected
|
|
2071
|
+
} = _c, rest = __objRest(_c, [
|
|
2072
|
+
"isIndeterminate",
|
|
2073
|
+
"isSelected",
|
|
2074
|
+
"isDisabled",
|
|
2075
|
+
"defaultSelected"
|
|
1569
2076
|
]);
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
2077
|
+
const checkboxProps = __spreadValues({
|
|
2078
|
+
disabled: isDisabled,
|
|
2079
|
+
checked: isSelected,
|
|
2080
|
+
defaultChecked: defaultSelected,
|
|
2081
|
+
indeterminate: isIndeterminate
|
|
2082
|
+
}, rest);
|
|
2083
|
+
return { checkboxProps };
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
// src/Table/TableCheckboxCell.tsx
|
|
2087
|
+
var TableCheckboxCell = ({ cell }) => {
|
|
2088
|
+
const ref = useRef16(null);
|
|
2089
|
+
const { state, styles } = useTableContext();
|
|
2090
|
+
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2091
|
+
const { gridCellProps } = useTableCell2({
|
|
2092
|
+
node: cell
|
|
2093
|
+
}, state, ref);
|
|
2094
|
+
const { checkboxProps } = mapCheckboxProps(useTableSelectionCheckbox({ key: cell.parentKey }, state));
|
|
2095
|
+
const { focusProps, isFocusVisible } = useFocusRing10();
|
|
2096
|
+
const stateProps = useStateProps12({ disabled, focusVisible: isFocusVisible });
|
|
2097
|
+
return /* @__PURE__ */ React49.createElement(Box26, __spreadValues(__spreadValues({
|
|
2098
|
+
as: "td",
|
|
2099
|
+
ref,
|
|
2100
|
+
__baseCSS: {
|
|
2101
|
+
textAlign: "center",
|
|
2102
|
+
verticalAlign: "middle",
|
|
2103
|
+
lineHeight: 1
|
|
2104
|
+
},
|
|
2105
|
+
css: styles.cell
|
|
2106
|
+
}, mergeProps10(gridCellProps, focusProps)), stateProps), /* @__PURE__ */ React49.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
1579
2107
|
};
|
|
1580
2108
|
|
|
1581
2109
|
// src/Table/TableColumnHeader.tsx
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
}) => {
|
|
1589
|
-
const ref =
|
|
1590
|
-
const {
|
|
1591
|
-
const {
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
const {
|
|
1595
|
-
const
|
|
1596
|
-
|
|
2110
|
+
import React50, { useRef as useRef17 } from "react";
|
|
2111
|
+
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
2112
|
+
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
2113
|
+
import { useTableColumnHeader } from "@react-aria/table";
|
|
2114
|
+
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2115
|
+
import { Box as Box27, useStateProps as useStateProps13 } from "@marigold/system";
|
|
2116
|
+
var TableColumnHeader = ({ column }) => {
|
|
2117
|
+
const ref = useRef17(null);
|
|
2118
|
+
const { state, styles } = useTableContext();
|
|
2119
|
+
const { columnHeaderProps } = useTableColumnHeader({
|
|
2120
|
+
node: column
|
|
2121
|
+
}, state, ref);
|
|
2122
|
+
const { hoverProps, isHovered } = useHover5({});
|
|
2123
|
+
const { focusProps, isFocusVisible } = useFocusRing11();
|
|
2124
|
+
const stateProps = useStateProps13({
|
|
2125
|
+
hover: isHovered,
|
|
2126
|
+
focusVisible: isFocusVisible
|
|
2127
|
+
});
|
|
2128
|
+
return /* @__PURE__ */ React50.createElement(Box27, __spreadValues(__spreadValues({
|
|
1597
2129
|
as: "th",
|
|
2130
|
+
colSpan: column.colspan,
|
|
1598
2131
|
ref,
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
2132
|
+
css: styles.header
|
|
2133
|
+
}, mergeProps11(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered);
|
|
2134
|
+
};
|
|
2135
|
+
|
|
2136
|
+
// src/Table/TableHeader.tsx
|
|
2137
|
+
import React51 from "react";
|
|
2138
|
+
import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
|
|
2139
|
+
var TableHeader = ({ children }) => {
|
|
2140
|
+
const { rowGroupProps } = useTableRowGroup2();
|
|
2141
|
+
return /* @__PURE__ */ React51.createElement("thead", __spreadValues({}, rowGroupProps), children);
|
|
1606
2142
|
};
|
|
1607
2143
|
|
|
1608
2144
|
// src/Table/TableHeaderRow.tsx
|
|
1609
|
-
import
|
|
2145
|
+
import React52, { useRef as useRef18 } from "react";
|
|
1610
2146
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
1611
|
-
var TableHeaderRow = ({
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
children
|
|
1615
|
-
}) => {
|
|
1616
|
-
const ref = useRef12(null);
|
|
2147
|
+
var TableHeaderRow = ({ item, children }) => {
|
|
2148
|
+
const { state } = useTableContext();
|
|
2149
|
+
const ref = useRef18(null);
|
|
1617
2150
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
1618
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ React52.createElement("tr", __spreadProps(__spreadValues({}, rowProps), {
|
|
1619
2152
|
ref
|
|
1620
2153
|
}), children);
|
|
1621
2154
|
};
|
|
1622
2155
|
|
|
1623
2156
|
// src/Table/TableRow.tsx
|
|
1624
|
-
import
|
|
1625
|
-
import { useFocusRing as
|
|
2157
|
+
import React53, { useRef as useRef19 } from "react";
|
|
2158
|
+
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
2159
|
+
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
1626
2160
|
import { useTableRow } from "@react-aria/table";
|
|
1627
|
-
import { mergeProps as
|
|
1628
|
-
import { useStateProps as
|
|
1629
|
-
var TableRow = ({
|
|
1630
|
-
const ref =
|
|
1631
|
-
const
|
|
1632
|
-
const { rowProps } = useTableRow({
|
|
1633
|
-
node:
|
|
2161
|
+
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
2162
|
+
import { Box as Box28, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2163
|
+
var TableRow = ({ children, row }) => {
|
|
2164
|
+
const ref = useRef19(null);
|
|
2165
|
+
const { state, styles } = useTableContext();
|
|
2166
|
+
const { rowProps, isPressed } = useTableRow({
|
|
2167
|
+
node: row
|
|
1634
2168
|
}, state, ref);
|
|
1635
|
-
const
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1638
|
-
|
|
2169
|
+
const disabled = state.disabledKeys.has(row.key);
|
|
2170
|
+
const selected = state.selectionManager.isSelected(row.key);
|
|
2171
|
+
const { focusProps, isFocusVisible } = useFocusRing12({ within: true });
|
|
2172
|
+
const { hoverProps, isHovered } = useHover6({ isDisabled: disabled });
|
|
2173
|
+
const stateProps = useStateProps14({
|
|
2174
|
+
disabled,
|
|
2175
|
+
selected,
|
|
2176
|
+
hover: isHovered,
|
|
2177
|
+
focusVisible: isFocusVisible,
|
|
2178
|
+
active: isPressed
|
|
1639
2179
|
});
|
|
1640
|
-
return /* @__PURE__ */
|
|
2180
|
+
return /* @__PURE__ */ React53.createElement(Box28, __spreadValues(__spreadValues({
|
|
1641
2181
|
as: "tr",
|
|
1642
2182
|
ref,
|
|
1643
|
-
css
|
|
1644
|
-
},
|
|
2183
|
+
css: styles.row
|
|
2184
|
+
}, mergeProps12(rowProps, focusProps, hoverProps)), stateProps), children);
|
|
1645
2185
|
};
|
|
1646
2186
|
|
|
1647
|
-
// src/Table/
|
|
1648
|
-
import
|
|
1649
|
-
import {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
2187
|
+
// src/Table/TableSelectAllCell.tsx
|
|
2188
|
+
import React54, { useRef as useRef20 } from "react";
|
|
2189
|
+
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
2190
|
+
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2191
|
+
import {
|
|
2192
|
+
useTableColumnHeader as useTableColumnHeader2,
|
|
2193
|
+
useTableSelectAllCheckbox
|
|
2194
|
+
} from "@react-aria/table";
|
|
2195
|
+
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2196
|
+
import { Box as Box29, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2197
|
+
var TableSelectAllCell = ({ column }) => {
|
|
2198
|
+
const ref = useRef20(null);
|
|
2199
|
+
const { state, styles } = useTableContext();
|
|
2200
|
+
const { columnHeaderProps } = useTableColumnHeader2({
|
|
2201
|
+
node: column
|
|
2202
|
+
}, state, ref);
|
|
2203
|
+
const { checkboxProps } = mapCheckboxProps(useTableSelectAllCheckbox(state));
|
|
2204
|
+
const { hoverProps, isHovered } = useHover7({});
|
|
2205
|
+
const { focusProps, isFocusVisible } = useFocusRing13();
|
|
2206
|
+
const stateProps = useStateProps15({
|
|
2207
|
+
hover: isHovered,
|
|
2208
|
+
focusVisible: isFocusVisible
|
|
2209
|
+
});
|
|
2210
|
+
return /* @__PURE__ */ React54.createElement(Box29, __spreadValues(__spreadValues({
|
|
2211
|
+
as: "th",
|
|
2212
|
+
ref,
|
|
2213
|
+
__baseCSS: {
|
|
2214
|
+
textAlign: "center",
|
|
2215
|
+
verticalAlign: "middle",
|
|
2216
|
+
lineHeight: 1
|
|
2217
|
+
},
|
|
2218
|
+
css: styles.header
|
|
2219
|
+
}, mergeProps13(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */ React54.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
1656
2220
|
};
|
|
1657
2221
|
|
|
1658
2222
|
// src/Table/Table.tsx
|
|
1659
2223
|
var Table = (_a) => {
|
|
1660
|
-
var _b = _a, {
|
|
1661
|
-
|
|
1662
|
-
alignHeader,
|
|
1663
|
-
variant,
|
|
1664
|
-
size
|
|
1665
|
-
} = _b, props = __objRest(_b, [
|
|
1666
|
-
"align",
|
|
1667
|
-
"alignHeader",
|
|
1668
|
-
"variant",
|
|
1669
|
-
"size"
|
|
1670
|
-
]);
|
|
1671
|
-
const showSelectionCheckboxes = props.selectionMode === "multiple" && props.selectionBehavior !== "replace";
|
|
2224
|
+
var _b = _a, { variant, size } = _b, props = __objRest(_b, ["variant", "size"]);
|
|
2225
|
+
const tableRef = useRef21(null);
|
|
1672
2226
|
const state = useTableState(__spreadProps(__spreadValues({}, props), {
|
|
1673
|
-
showSelectionCheckboxes
|
|
2227
|
+
showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
|
|
1674
2228
|
}));
|
|
1675
|
-
const
|
|
1676
|
-
const {
|
|
1677
|
-
const
|
|
1678
|
-
return /* @__PURE__ */
|
|
2229
|
+
const { gridProps } = useTable(props, state, tableRef);
|
|
2230
|
+
const styles = useComponentStyles27("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
|
|
2231
|
+
const { collection } = state;
|
|
2232
|
+
return /* @__PURE__ */ React55.createElement(TableContext.Provider, {
|
|
2233
|
+
value: { state, styles }
|
|
2234
|
+
}, /* @__PURE__ */ React55.createElement(Box30, __spreadValues({
|
|
1679
2235
|
as: "table",
|
|
1680
|
-
ref,
|
|
1681
|
-
|
|
1682
|
-
}, gridProps), /* @__PURE__ */
|
|
1683
|
-
as: "thead"
|
|
1684
|
-
}, state.collection.headerRows.map((headerRow) => /* @__PURE__ */ React47.createElement(TableHeaderRow, {
|
|
2236
|
+
ref: tableRef,
|
|
2237
|
+
css: styles.table
|
|
2238
|
+
}, gridProps), /* @__PURE__ */ React55.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React55.createElement(TableHeaderRow, {
|
|
1685
2239
|
key: headerRow.key,
|
|
1686
|
-
item: headerRow
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
}, [...state.collection.body.childNodes].map((row) => /* @__PURE__ */ React47.createElement(TableRow, {
|
|
1698
|
-
css: styles.row,
|
|
2240
|
+
item: headerRow
|
|
2241
|
+
}, [...headerRow.childNodes].map((column) => {
|
|
2242
|
+
var _a2;
|
|
2243
|
+
return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React55.createElement(TableSelectAllCell, {
|
|
2244
|
+
key: column.key,
|
|
2245
|
+
column
|
|
2246
|
+
}) : /* @__PURE__ */ React55.createElement(TableColumnHeader, {
|
|
2247
|
+
key: column.key,
|
|
2248
|
+
column
|
|
2249
|
+
});
|
|
2250
|
+
})))), /* @__PURE__ */ React55.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ React55.createElement(TableRow, {
|
|
1699
2251
|
key: row.key,
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
2252
|
+
row
|
|
2253
|
+
}, [...row.childNodes].map((cell) => {
|
|
2254
|
+
var _a2;
|
|
2255
|
+
return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React55.createElement(TableCheckboxCell, {
|
|
2256
|
+
key: cell.key,
|
|
2257
|
+
cell
|
|
2258
|
+
}) : /* @__PURE__ */ React55.createElement(TableCell, {
|
|
2259
|
+
key: cell.key,
|
|
2260
|
+
cell
|
|
2261
|
+
});
|
|
1709
2262
|
}))))));
|
|
1710
2263
|
};
|
|
1711
|
-
Table.Body =
|
|
2264
|
+
Table.Body = Body;
|
|
1712
2265
|
Table.Cell = Cell;
|
|
1713
2266
|
Table.Column = Column;
|
|
1714
|
-
Table.Header =
|
|
2267
|
+
Table.Header = Header2;
|
|
1715
2268
|
Table.Row = Row;
|
|
1716
2269
|
|
|
1717
|
-
// src/
|
|
1718
|
-
import
|
|
1719
|
-
import { useTextField } from "@react-aria/textfield";
|
|
1720
|
-
import {
|
|
1721
|
-
Box as Box13,
|
|
1722
|
-
useComponentStyles as useComponentStyles18,
|
|
1723
|
-
useStateProps as useStateProps7
|
|
1724
|
-
} from "@marigold/system";
|
|
1725
|
-
|
|
1726
|
-
// src/Field/FieldBase.tsx
|
|
1727
|
-
import React49 from "react";
|
|
1728
|
-
|
|
1729
|
-
// src/Field/HelpText.tsx
|
|
1730
|
-
import React48 from "react";
|
|
1731
|
-
import { Exclamation as Exclamation4 } from "@marigold/icons";
|
|
2270
|
+
// src/Text/Text.tsx
|
|
2271
|
+
import React56 from "react";
|
|
1732
2272
|
import {
|
|
1733
|
-
|
|
1734
|
-
useComponentStyles as useComponentStyles17
|
|
2273
|
+
useComponentStyles as useComponentStyles28
|
|
1735
2274
|
} from "@marigold/system";
|
|
1736
|
-
|
|
2275
|
+
import { Box as Box31 } from "@marigold/system";
|
|
2276
|
+
var Text = (_a) => {
|
|
1737
2277
|
var _b = _a, {
|
|
1738
2278
|
variant,
|
|
1739
2279
|
size,
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
2280
|
+
align,
|
|
2281
|
+
color,
|
|
2282
|
+
fontSize,
|
|
2283
|
+
cursor,
|
|
2284
|
+
outline,
|
|
2285
|
+
children
|
|
1746
2286
|
} = _b, props = __objRest(_b, [
|
|
1747
2287
|
"variant",
|
|
1748
2288
|
"size",
|
|
1749
|
-
"
|
|
1750
|
-
"
|
|
1751
|
-
"
|
|
1752
|
-
"
|
|
1753
|
-
"
|
|
1754
|
-
"
|
|
2289
|
+
"align",
|
|
2290
|
+
"color",
|
|
2291
|
+
"fontSize",
|
|
2292
|
+
"cursor",
|
|
2293
|
+
"outline",
|
|
2294
|
+
"children"
|
|
1755
2295
|
]);
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
}), /* @__PURE__ */ React48.createElement(Box12, __spreadValues({}, errorMessageProps), errorMessage)) : /* @__PURE__ */ React48.createElement(Box12, __spreadValues({}, descriptionProps), description));
|
|
1766
|
-
};
|
|
1767
|
-
|
|
1768
|
-
// src/Field/FieldBase.tsx
|
|
1769
|
-
var FieldBase = ({
|
|
1770
|
-
variant,
|
|
1771
|
-
size,
|
|
1772
|
-
children,
|
|
1773
|
-
disabled,
|
|
1774
|
-
required,
|
|
1775
|
-
label,
|
|
1776
|
-
labelProps,
|
|
1777
|
-
description,
|
|
1778
|
-
descriptionProps,
|
|
1779
|
-
error,
|
|
1780
|
-
errorMessage,
|
|
1781
|
-
errorMessageProps,
|
|
1782
|
-
stateProps
|
|
1783
|
-
}) => {
|
|
1784
|
-
const hasHelpText = !!description || errorMessage && error;
|
|
1785
|
-
return /* @__PURE__ */ React49.createElement(Stack, null, label && /* @__PURE__ */ React49.createElement(Label, __spreadProps(__spreadValues(__spreadValues({}, labelProps), stateProps), {
|
|
1786
|
-
required
|
|
1787
|
-
}), label), children, hasHelpText && /* @__PURE__ */ React49.createElement(HelpText, __spreadProps(__spreadValues({}, stateProps), {
|
|
1788
|
-
disabled,
|
|
1789
|
-
description,
|
|
1790
|
-
descriptionProps,
|
|
1791
|
-
error,
|
|
1792
|
-
errorMessage,
|
|
1793
|
-
errorMessageProps
|
|
1794
|
-
})));
|
|
2296
|
+
const styles = useComponentStyles28("Text", {
|
|
2297
|
+
variant,
|
|
2298
|
+
size
|
|
2299
|
+
});
|
|
2300
|
+
return /* @__PURE__ */ React56.createElement(Box31, __spreadProps(__spreadValues({
|
|
2301
|
+
as: "p"
|
|
2302
|
+
}, props), {
|
|
2303
|
+
css: __spreadValues({ color, cursor, outline, fontSize, textAlign: align }, styles)
|
|
2304
|
+
}), children);
|
|
1795
2305
|
};
|
|
1796
2306
|
|
|
1797
2307
|
// src/TextArea/TextArea.tsx
|
|
1798
|
-
import {
|
|
1799
|
-
import {
|
|
2308
|
+
import React57, { useRef as useRef22 } from "react";
|
|
2309
|
+
import { useTextField } from "@react-aria/textfield";
|
|
2310
|
+
import {
|
|
2311
|
+
Box as Box32,
|
|
2312
|
+
useComponentStyles as useComponentStyles29,
|
|
2313
|
+
useStateProps as useStateProps16
|
|
2314
|
+
} from "@marigold/system";
|
|
2315
|
+
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
2316
|
+
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
1800
2317
|
var TextArea = (_a) => {
|
|
1801
2318
|
var _b = _a, {
|
|
2319
|
+
variant,
|
|
2320
|
+
size,
|
|
2321
|
+
width,
|
|
1802
2322
|
disabled,
|
|
1803
2323
|
required,
|
|
1804
2324
|
readOnly,
|
|
1805
|
-
error
|
|
2325
|
+
error,
|
|
2326
|
+
rows
|
|
1806
2327
|
} = _b, props = __objRest(_b, [
|
|
2328
|
+
"variant",
|
|
2329
|
+
"size",
|
|
2330
|
+
"width",
|
|
1807
2331
|
"disabled",
|
|
1808
2332
|
"required",
|
|
1809
2333
|
"readOnly",
|
|
1810
|
-
"error"
|
|
2334
|
+
"error",
|
|
2335
|
+
"rows"
|
|
1811
2336
|
]);
|
|
1812
2337
|
const { label, description, errorMessage } = props;
|
|
1813
|
-
const ref =
|
|
2338
|
+
const ref = useRef22(null);
|
|
1814
2339
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(__spreadValues({
|
|
1815
2340
|
inputElementType: "textarea",
|
|
1816
2341
|
isDisabled: disabled,
|
|
@@ -1818,17 +2343,17 @@ var TextArea = (_a) => {
|
|
|
1818
2343
|
isReadOnly: readOnly,
|
|
1819
2344
|
validationState: error ? "invalid" : "valid"
|
|
1820
2345
|
}, props), ref);
|
|
1821
|
-
const { hoverProps, isHovered } =
|
|
1822
|
-
const { focusProps, isFocusVisible } =
|
|
1823
|
-
const stateProps =
|
|
2346
|
+
const { hoverProps, isHovered } = useHover8({});
|
|
2347
|
+
const { focusProps, isFocusVisible } = useFocusRing14();
|
|
2348
|
+
const stateProps = useStateProps16({
|
|
1824
2349
|
hover: isHovered,
|
|
1825
2350
|
focus: isFocusVisible,
|
|
1826
2351
|
disabled,
|
|
1827
2352
|
readOnly,
|
|
1828
2353
|
error
|
|
1829
2354
|
});
|
|
1830
|
-
const styles =
|
|
1831
|
-
return /* @__PURE__ */
|
|
2355
|
+
const styles = useComponentStyles29("TextArea", { variant, size });
|
|
2356
|
+
return /* @__PURE__ */ React57.createElement(FieldBase, {
|
|
1832
2357
|
label,
|
|
1833
2358
|
labelProps,
|
|
1834
2359
|
required,
|
|
@@ -1837,67 +2362,63 @@ var TextArea = (_a) => {
|
|
|
1837
2362
|
error,
|
|
1838
2363
|
errorMessage,
|
|
1839
2364
|
errorMessageProps,
|
|
1840
|
-
stateProps
|
|
1841
|
-
|
|
2365
|
+
stateProps,
|
|
2366
|
+
variant,
|
|
2367
|
+
size,
|
|
2368
|
+
width
|
|
2369
|
+
}, /* @__PURE__ */ React57.createElement(Box32, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
1842
2370
|
as: "textarea",
|
|
1843
|
-
variant: "textArea",
|
|
1844
2371
|
css: styles,
|
|
1845
|
-
ref
|
|
2372
|
+
ref,
|
|
2373
|
+
rows
|
|
1846
2374
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
1847
2375
|
};
|
|
1848
2376
|
|
|
1849
2377
|
// src/TextField/TextField.tsx
|
|
1850
|
-
import
|
|
1851
|
-
import { useHover as
|
|
1852
|
-
import { useFocusRing as
|
|
2378
|
+
import React58, { useRef as useRef23 } from "react";
|
|
2379
|
+
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
2380
|
+
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
1853
2381
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
1854
|
-
import { useStateProps as
|
|
1855
|
-
|
|
1856
|
-
// src/Input/Input.tsx
|
|
1857
|
-
import React51, { forwardRef as forwardRef4 } from "react";
|
|
1858
|
-
import { Box as Box14, useComponentStyles as useComponentStyles19 } from "@marigold/system";
|
|
1859
|
-
var Input = forwardRef4((_a, ref) => {
|
|
1860
|
-
var _b = _a, { variant, size, type = "text" } = _b, props = __objRest(_b, ["variant", "size", "type"]);
|
|
1861
|
-
const styles = useComponentStyles19("Input", { variant, size });
|
|
1862
|
-
return /* @__PURE__ */ React51.createElement(Box14, __spreadProps(__spreadValues({}, props), {
|
|
1863
|
-
ref,
|
|
1864
|
-
as: "input",
|
|
1865
|
-
type,
|
|
1866
|
-
css: styles
|
|
1867
|
-
}));
|
|
1868
|
-
});
|
|
1869
|
-
|
|
1870
|
-
// src/TextField/TextField.tsx
|
|
2382
|
+
import { useStateProps as useStateProps17 } from "@marigold/system";
|
|
1871
2383
|
var TextField = (_a) => {
|
|
1872
2384
|
var _b = _a, {
|
|
2385
|
+
variant,
|
|
2386
|
+
size,
|
|
2387
|
+
width,
|
|
1873
2388
|
disabled,
|
|
1874
2389
|
required,
|
|
1875
2390
|
readOnly,
|
|
1876
2391
|
error
|
|
1877
2392
|
} = _b, props = __objRest(_b, [
|
|
2393
|
+
"variant",
|
|
2394
|
+
"size",
|
|
2395
|
+
"width",
|
|
1878
2396
|
"disabled",
|
|
1879
2397
|
"required",
|
|
1880
2398
|
"readOnly",
|
|
1881
2399
|
"error"
|
|
1882
2400
|
]);
|
|
1883
|
-
const { label, description, errorMessage } = props;
|
|
1884
|
-
const ref =
|
|
2401
|
+
const { label, description, errorMessage, autoFocus } = props;
|
|
2402
|
+
const ref = useRef23(null);
|
|
1885
2403
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(__spreadValues({
|
|
1886
2404
|
isDisabled: disabled,
|
|
1887
2405
|
isRequired: required,
|
|
1888
2406
|
isReadOnly: readOnly,
|
|
1889
2407
|
validationState: error ? "invalid" : "valid"
|
|
1890
2408
|
}, props), ref);
|
|
1891
|
-
const { hoverProps, isHovered } =
|
|
1892
|
-
const { focusProps, isFocusVisible } =
|
|
1893
|
-
|
|
2409
|
+
const { hoverProps, isHovered } = useHover9({});
|
|
2410
|
+
const { focusProps, isFocusVisible } = useFocusRing15({
|
|
2411
|
+
isTextInput: true,
|
|
2412
|
+
autoFocus
|
|
2413
|
+
});
|
|
2414
|
+
const stateProps = useStateProps17({
|
|
1894
2415
|
hover: isHovered,
|
|
1895
2416
|
focus: isFocusVisible,
|
|
1896
2417
|
disabled,
|
|
1897
2418
|
readOnly,
|
|
1898
2419
|
error
|
|
1899
2420
|
});
|
|
1900
|
-
return /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ React58.createElement(FieldBase, {
|
|
1901
2422
|
label,
|
|
1902
2423
|
labelProps,
|
|
1903
2424
|
required,
|
|
@@ -1906,17 +2427,22 @@ var TextField = (_a) => {
|
|
|
1906
2427
|
error,
|
|
1907
2428
|
errorMessage,
|
|
1908
2429
|
errorMessageProps,
|
|
1909
|
-
stateProps
|
|
1910
|
-
|
|
1911
|
-
|
|
2430
|
+
stateProps,
|
|
2431
|
+
variant,
|
|
2432
|
+
size,
|
|
2433
|
+
width
|
|
2434
|
+
}, /* @__PURE__ */ React58.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2435
|
+
ref,
|
|
2436
|
+
variant,
|
|
2437
|
+
size
|
|
1912
2438
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
1913
2439
|
};
|
|
1914
2440
|
|
|
1915
2441
|
// src/Tiles/Tiles.tsx
|
|
1916
|
-
import
|
|
1917
|
-
var Tiles =
|
|
2442
|
+
import React59 from "react";
|
|
2443
|
+
var Tiles = React59.forwardRef((_a, ref) => {
|
|
1918
2444
|
var _b = _a, { space = "none", itemMinWidth = "250px", children } = _b, props = __objRest(_b, ["space", "itemMinWidth", "children"]);
|
|
1919
|
-
return /* @__PURE__ */
|
|
2445
|
+
return /* @__PURE__ */ React59.createElement(Box, __spreadValues({
|
|
1920
2446
|
ref,
|
|
1921
2447
|
display: "grid",
|
|
1922
2448
|
__baseCSS: {
|
|
@@ -1927,100 +2453,98 @@ var Tiles = React53.forwardRef(function Tiles2(_a, ref) {
|
|
|
1927
2453
|
});
|
|
1928
2454
|
|
|
1929
2455
|
// src/Tooltip/Tooltip.tsx
|
|
1930
|
-
import
|
|
2456
|
+
import React61 from "react";
|
|
1931
2457
|
import { useTooltip } from "@react-aria/tooltip";
|
|
1932
|
-
import {
|
|
2458
|
+
import {
|
|
2459
|
+
Box as Box33,
|
|
2460
|
+
useComponentStyles as useComponentStyles30
|
|
2461
|
+
} from "@marigold/system";
|
|
2462
|
+
|
|
2463
|
+
// src/Tooltip/Context.ts
|
|
2464
|
+
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
2465
|
+
var TooltipContext = createContext7({});
|
|
2466
|
+
var useTooltipContext = () => useContext7(TooltipContext);
|
|
1933
2467
|
|
|
1934
2468
|
// src/Tooltip/TooltipTrigger.tsx
|
|
1935
|
-
import
|
|
2469
|
+
import React60, { useRef as useRef24 } from "react";
|
|
1936
2470
|
import { FocusableProvider } from "@react-aria/focus";
|
|
2471
|
+
import { useOverlayPosition as useOverlayPosition3 } from "@react-aria/overlays";
|
|
1937
2472
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
1938
|
-
import {
|
|
1939
|
-
useTooltipTriggerState
|
|
1940
|
-
} from "@react-stately/tooltip";
|
|
1941
|
-
var TooltipContext = React54.createContext({});
|
|
2473
|
+
import { useTooltipTriggerState } from "@react-stately/tooltip";
|
|
1942
2474
|
var TooltipTrigger = (_a) => {
|
|
1943
|
-
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1944
|
-
const [trigger, tooltip] = React54.Children.toArray(children);
|
|
1945
|
-
const state = useTooltipTriggerState(props);
|
|
1946
|
-
const tooltipTriggerRef = useRef17();
|
|
1947
|
-
const { triggerProps, tooltipProps } = useTooltipTrigger({}, state, tooltipTriggerRef);
|
|
1948
|
-
return /* @__PURE__ */ React54.createElement(FocusableProvider, __spreadProps(__spreadValues({}, triggerProps), {
|
|
1949
|
-
ref: tooltipTriggerRef
|
|
1950
|
-
}), trigger, state.isOpen && /* @__PURE__ */ React54.createElement(TooltipContext.Provider, {
|
|
1951
|
-
value: __spreadValues({
|
|
1952
|
-
state
|
|
1953
|
-
}, tooltipProps)
|
|
1954
|
-
}, tooltip));
|
|
1955
|
-
};
|
|
1956
|
-
|
|
1957
|
-
// src/Tooltip/Tooltip.tsx
|
|
1958
|
-
var Tooltip = (_a) => {
|
|
1959
2475
|
var _b = _a, {
|
|
1960
|
-
|
|
2476
|
+
disabled,
|
|
2477
|
+
open,
|
|
2478
|
+
delay = 1e3,
|
|
2479
|
+
placement = "top",
|
|
1961
2480
|
children
|
|
1962
|
-
} = _b,
|
|
1963
|
-
"
|
|
2481
|
+
} = _b, rest = __objRest(_b, [
|
|
2482
|
+
"disabled",
|
|
2483
|
+
"open",
|
|
2484
|
+
"delay",
|
|
2485
|
+
"placement",
|
|
1964
2486
|
"children"
|
|
1965
2487
|
]);
|
|
1966
|
-
const
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
2488
|
+
const [tooltipTrigger, tooltip] = React60.Children.toArray(children);
|
|
2489
|
+
const props = __spreadProps(__spreadValues({}, rest), {
|
|
2490
|
+
isDisabled: disabled,
|
|
2491
|
+
isOpen: open,
|
|
2492
|
+
delay,
|
|
2493
|
+
placement
|
|
2494
|
+
});
|
|
2495
|
+
const tooltipTriggerRef = useRef24(null);
|
|
2496
|
+
const overlayRef = useRef24(null);
|
|
2497
|
+
const state = useTooltipTriggerState(props);
|
|
2498
|
+
const { triggerProps, tooltipProps } = useTooltipTrigger(props, state, tooltipTriggerRef);
|
|
2499
|
+
const {
|
|
2500
|
+
overlayProps: positionProps,
|
|
2501
|
+
placement: overlayPlacement,
|
|
2502
|
+
arrowProps
|
|
2503
|
+
} = useOverlayPosition3({
|
|
2504
|
+
placement: props.placement,
|
|
2505
|
+
targetRef: tooltipTriggerRef,
|
|
2506
|
+
offset: props.offset,
|
|
2507
|
+
crossOffset: props.crossOffset,
|
|
2508
|
+
isOpen: state.isOpen,
|
|
2509
|
+
overlayRef
|
|
2510
|
+
});
|
|
2511
|
+
return /* @__PURE__ */ React60.createElement(FocusableProvider, __spreadValues({
|
|
2512
|
+
ref: tooltipTriggerRef
|
|
2513
|
+
}, triggerProps), tooltipTrigger, /* @__PURE__ */ React60.createElement(TooltipContext.Provider, {
|
|
2514
|
+
value: __spreadValues(__spreadValues({
|
|
2515
|
+
state,
|
|
2516
|
+
overlayRef,
|
|
2517
|
+
arrowProps,
|
|
2518
|
+
placement: overlayPlacement
|
|
2519
|
+
}, tooltipProps), positionProps)
|
|
2520
|
+
}, /* @__PURE__ */ React60.createElement(Overlay, {
|
|
2521
|
+
open: state.isOpen
|
|
2522
|
+
}, tooltip)));
|
|
1975
2523
|
};
|
|
1976
2524
|
|
|
1977
|
-
// src/
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
]);
|
|
1999
|
-
const maxWidth = tokenSize[contentType][size];
|
|
2000
|
-
let gridTemplateColumns = `${maxWidth} 1fr 1fr`;
|
|
2001
|
-
let gridColumn = 1;
|
|
2002
|
-
if (alignContainer === "center") {
|
|
2003
|
-
gridTemplateColumns = `1fr ${maxWidth} 1fr`;
|
|
2004
|
-
gridColumn = 2;
|
|
2005
|
-
}
|
|
2006
|
-
if (alignContainer === "right") {
|
|
2007
|
-
gridTemplateColumns = `1fr 1fr ${maxWidth}`;
|
|
2008
|
-
gridColumn = 3;
|
|
2009
|
-
}
|
|
2010
|
-
return /* @__PURE__ */ React56.createElement(Box, __spreadValues({
|
|
2011
|
-
display: "grid",
|
|
2012
|
-
css: {
|
|
2013
|
-
gridTemplateColumns,
|
|
2014
|
-
placeItems: ALIGNMENT3[align],
|
|
2015
|
-
"> *": {
|
|
2016
|
-
gridColumn
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
}, props), children);
|
|
2525
|
+
// src/Tooltip/Tooltip.tsx
|
|
2526
|
+
var Tooltip = ({ children, variant, size }) => {
|
|
2527
|
+
const _a = useTooltipContext(), { arrowProps, state, overlayRef, placement } = _a, rest = __objRest(_a, ["arrowProps", "state", "overlayRef", "placement"]);
|
|
2528
|
+
const { tooltipProps } = useTooltip({}, state);
|
|
2529
|
+
const styles = useComponentStyles30("Tooltip", { variant, size }, { parts: ["container", "arrow"] });
|
|
2530
|
+
return /* @__PURE__ */ React61.createElement(Box33, __spreadProps(__spreadValues(__spreadValues({}, tooltipProps), rest), {
|
|
2531
|
+
ref: overlayRef,
|
|
2532
|
+
css: styles.container,
|
|
2533
|
+
"data-placement": placement
|
|
2534
|
+
}), /* @__PURE__ */ React61.createElement("div", null, children), /* @__PURE__ */ React61.createElement(Box33, __spreadProps(__spreadValues({}, arrowProps), {
|
|
2535
|
+
__baseCSS: {
|
|
2536
|
+
position: "absolute",
|
|
2537
|
+
height: 0,
|
|
2538
|
+
width: 0,
|
|
2539
|
+
borderStyle: "solid",
|
|
2540
|
+
borderLeftColor: "transparent",
|
|
2541
|
+
borderRightColor: "transparent",
|
|
2542
|
+
borderBottomColor: "transparent"
|
|
2543
|
+
},
|
|
2544
|
+
css: styles.arrow
|
|
2545
|
+
})));
|
|
2020
2546
|
};
|
|
2021
|
-
|
|
2022
|
-
// src/index.ts
|
|
2023
|
-
import { Item as Item2, Section } from "@react-stately/collections";
|
|
2547
|
+
Tooltip.Trigger = TooltipTrigger;
|
|
2024
2548
|
export {
|
|
2025
2549
|
Aside,
|
|
2026
2550
|
Aspect,
|
|
@@ -2044,18 +2568,16 @@ export {
|
|
|
2044
2568
|
Image,
|
|
2045
2569
|
Inline,
|
|
2046
2570
|
Input,
|
|
2047
|
-
|
|
2048
|
-
Label2 as Label,
|
|
2049
|
-
LabelBase,
|
|
2571
|
+
Label,
|
|
2050
2572
|
Link,
|
|
2051
2573
|
MarigoldProvider,
|
|
2052
2574
|
Menu,
|
|
2053
2575
|
Message,
|
|
2576
|
+
NumberField,
|
|
2054
2577
|
Overlay,
|
|
2055
2578
|
Popover,
|
|
2056
2579
|
Radio,
|
|
2057
2580
|
SSRProvider,
|
|
2058
|
-
Section,
|
|
2059
2581
|
Select,
|
|
2060
2582
|
Slider,
|
|
2061
2583
|
Stack,
|
|
@@ -2067,11 +2589,8 @@ export {
|
|
|
2067
2589
|
ThemeProvider2 as ThemeProvider,
|
|
2068
2590
|
Tiles,
|
|
2069
2591
|
Tooltip,
|
|
2070
|
-
|
|
2071
|
-
TooltipTrigger,
|
|
2072
|
-
ValidationMessage,
|
|
2592
|
+
Underlay,
|
|
2073
2593
|
VisuallyHidden,
|
|
2074
2594
|
useCheckboxGroupContext,
|
|
2075
|
-
useDialogButtonProps,
|
|
2076
2595
|
useTheme2 as useTheme
|
|
2077
2596
|
};
|