@marigold/components 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +37 -28
- package/dist/index.js +219 -201
- package/dist/index.mjs +202 -180
- package/package.json +6 -5
package/dist/index.mjs
CHANGED
|
@@ -225,10 +225,11 @@ var Center = (_a) => {
|
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
// src/Checkbox/Checkbox.tsx
|
|
228
|
-
import React10 from "react";
|
|
228
|
+
import React10, { forwardRef as forwardRef2 } from "react";
|
|
229
229
|
import { useCheckbox, useCheckboxGroupItem } from "@react-aria/checkbox";
|
|
230
230
|
import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
231
231
|
import { useHover } from "@react-aria/interactions";
|
|
232
|
+
import { useObjectRef } from "@react-aria/utils";
|
|
232
233
|
import { useToggleState } from "@react-stately/toggle";
|
|
233
234
|
import {
|
|
234
235
|
Box as Box6,
|
|
@@ -360,7 +361,7 @@ var Icon = (_a) => {
|
|
|
360
361
|
css
|
|
361
362
|
}, props), indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React10.createElement(CheckMark, null) : null);
|
|
362
363
|
};
|
|
363
|
-
var Checkbox = (_a) => {
|
|
364
|
+
var Checkbox = forwardRef2((_a, ref) => {
|
|
364
365
|
var _b = _a, {
|
|
365
366
|
size,
|
|
366
367
|
variant,
|
|
@@ -382,7 +383,7 @@ var Checkbox = (_a) => {
|
|
|
382
383
|
"required",
|
|
383
384
|
"error"
|
|
384
385
|
]);
|
|
385
|
-
const
|
|
386
|
+
const inputRef = useObjectRef(ref);
|
|
386
387
|
const checkboxProps = {
|
|
387
388
|
isIndeterminate: indeterminate,
|
|
388
389
|
isDisabled: disabled,
|
|
@@ -393,14 +394,17 @@ var Checkbox = (_a) => {
|
|
|
393
394
|
const groupState = useCheckboxGroupContext();
|
|
394
395
|
const { inputProps } = groupState ? useCheckboxGroupItem(__spreadProps(__spreadValues(__spreadValues({}, props), checkboxProps), {
|
|
395
396
|
value: props.value
|
|
396
|
-
}), groupState,
|
|
397
|
+
}), groupState, inputRef) : useCheckbox(__spreadValues(__spreadValues({
|
|
397
398
|
isSelected: checked,
|
|
398
399
|
defaultSelected: defaultChecked
|
|
399
400
|
}, checkboxProps), props), useToggleState(__spreadValues({
|
|
400
401
|
isSelected: checked,
|
|
401
402
|
defaultSelected: defaultChecked
|
|
402
|
-
}, props)),
|
|
403
|
-
const styles = useComponentStyles6("Checkbox", {
|
|
403
|
+
}, props)), inputRef);
|
|
404
|
+
const styles = useComponentStyles6("Checkbox", {
|
|
405
|
+
variant: (groupState == null ? void 0 : groupState.variant) || variant,
|
|
406
|
+
size: (groupState == null ? void 0 : groupState.size) || size
|
|
407
|
+
}, { parts: ["container", "label", "checkbox"] });
|
|
404
408
|
const { hoverProps, isHovered } = useHover({});
|
|
405
409
|
const { isFocusVisible, focusProps } = useFocusRing2();
|
|
406
410
|
const stateProps = useStateProps2({
|
|
@@ -423,7 +427,7 @@ var Checkbox = (_a) => {
|
|
|
423
427
|
css: styles.container
|
|
424
428
|
}, hoverProps), stateProps), /* @__PURE__ */ React10.createElement(Box6, __spreadValues(__spreadValues({
|
|
425
429
|
as: "input",
|
|
426
|
-
ref,
|
|
430
|
+
ref: inputRef,
|
|
427
431
|
css: {
|
|
428
432
|
position: "absolute",
|
|
429
433
|
width: "100%",
|
|
@@ -441,7 +445,7 @@ var Checkbox = (_a) => {
|
|
|
441
445
|
}, stateProps)), props.children && /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
|
|
442
446
|
css: styles.label
|
|
443
447
|
}, stateProps), props.children));
|
|
444
|
-
};
|
|
448
|
+
});
|
|
445
449
|
|
|
446
450
|
// src/Columns/Columns.tsx
|
|
447
451
|
import React11, { Children } from "react";
|
|
@@ -592,7 +596,7 @@ var Headline = (_a) => {
|
|
|
592
596
|
]);
|
|
593
597
|
const styles = useComponentStyles9("Headline", {
|
|
594
598
|
variant,
|
|
595
|
-
size: size
|
|
599
|
+
size: size ?? `level-${level}`
|
|
596
600
|
});
|
|
597
601
|
return /* @__PURE__ */ React15.createElement(Box8, __spreadProps(__spreadValues({
|
|
598
602
|
as: `h${level}`
|
|
@@ -612,10 +616,10 @@ import { PressResponder } from "@react-aria/interactions";
|
|
|
612
616
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
613
617
|
|
|
614
618
|
// src/Overlay/Modal.tsx
|
|
615
|
-
import React17, { forwardRef as
|
|
619
|
+
import React17, { forwardRef as forwardRef3 } from "react";
|
|
616
620
|
import { FocusScope } from "@react-aria/focus";
|
|
617
621
|
import { useModal, useOverlay, usePreventScroll } from "@react-aria/overlays";
|
|
618
|
-
import { mergeProps as mergeProps2, useObjectRef } from "@react-aria/utils";
|
|
622
|
+
import { mergeProps as mergeProps2, useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
619
623
|
|
|
620
624
|
// src/Overlay/Underlay.tsx
|
|
621
625
|
import React16 from "react";
|
|
@@ -634,9 +638,9 @@ var Underlay = (_a) => {
|
|
|
634
638
|
};
|
|
635
639
|
|
|
636
640
|
// src/Overlay/Modal.tsx
|
|
637
|
-
var Modal =
|
|
641
|
+
var Modal = forwardRef3((_a, ref) => {
|
|
638
642
|
var _b = _a, { children, open, dismissable, keyboardDismissable, onClose } = _b, props = __objRest(_b, ["children", "open", "dismissable", "keyboardDismissable", "onClose"]);
|
|
639
|
-
const modalRef =
|
|
643
|
+
const modalRef = useObjectRef2(ref);
|
|
640
644
|
const { overlayProps, underlayProps } = useOverlay({
|
|
641
645
|
isOpen: open,
|
|
642
646
|
onClose,
|
|
@@ -672,7 +676,7 @@ var Overlay = (_a) => {
|
|
|
672
676
|
var _b = _a, {
|
|
673
677
|
children,
|
|
674
678
|
open = false,
|
|
675
|
-
container
|
|
679
|
+
container
|
|
676
680
|
} = _b, props = __objRest(_b, [
|
|
677
681
|
"children",
|
|
678
682
|
"open",
|
|
@@ -687,10 +691,10 @@ var Overlay = (_a) => {
|
|
|
687
691
|
};
|
|
688
692
|
|
|
689
693
|
// src/Overlay/Popover.tsx
|
|
690
|
-
import React19, { forwardRef as
|
|
694
|
+
import React19, { forwardRef as forwardRef4, useRef as useRef2 } from "react";
|
|
691
695
|
import { useModal as useModal2, useOverlay as useOverlay2 } from "@react-aria/overlays";
|
|
692
696
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
693
|
-
var Popover =
|
|
697
|
+
var Popover = forwardRef4((_a, ref) => {
|
|
694
698
|
var _b = _a, {
|
|
695
699
|
children,
|
|
696
700
|
open,
|
|
@@ -893,9 +897,9 @@ var Inline = (_a) => {
|
|
|
893
897
|
};
|
|
894
898
|
|
|
895
899
|
// src/Input/Input.tsx
|
|
896
|
-
import React26, { forwardRef as
|
|
900
|
+
import React26, { forwardRef as forwardRef5 } from "react";
|
|
897
901
|
import { Box as Box12, useComponentStyles as useComponentStyles15 } from "@marigold/system";
|
|
898
|
-
var Input =
|
|
902
|
+
var Input = forwardRef5((_a, ref) => {
|
|
899
903
|
var _b = _a, { variant, size, type = "text" } = _b, props = __objRest(_b, ["variant", "size", "type"]);
|
|
900
904
|
const styles = useComponentStyles15("Input", { variant, size });
|
|
901
905
|
return /* @__PURE__ */ React26.createElement(Box12, __spreadProps(__spreadValues({}, props), {
|
|
@@ -1099,12 +1103,12 @@ var Message = (_a) => {
|
|
|
1099
1103
|
};
|
|
1100
1104
|
|
|
1101
1105
|
// src/NumberField/NumberField.tsx
|
|
1102
|
-
import React35, { forwardRef as
|
|
1106
|
+
import React35, { forwardRef as forwardRef6 } from "react";
|
|
1103
1107
|
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1104
1108
|
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1105
1109
|
import { useLocale } from "@react-aria/i18n";
|
|
1106
1110
|
import { useNumberField } from "@react-aria/numberfield";
|
|
1107
|
-
import { mergeProps as mergeProps6, useObjectRef as
|
|
1111
|
+
import { mergeProps as mergeProps6, useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
1108
1112
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
1109
1113
|
import {
|
|
1110
1114
|
Box as Box18,
|
|
@@ -1240,7 +1244,7 @@ var StepButton = (_a) => {
|
|
|
1240
1244
|
};
|
|
1241
1245
|
|
|
1242
1246
|
// src/NumberField/NumberField.tsx
|
|
1243
|
-
var NumberField =
|
|
1247
|
+
var NumberField = forwardRef6((_a, ref) => {
|
|
1244
1248
|
var _b = _a, {
|
|
1245
1249
|
variant,
|
|
1246
1250
|
size,
|
|
@@ -1268,7 +1272,7 @@ var NumberField = forwardRef5((_a, ref) => {
|
|
|
1268
1272
|
}, rest);
|
|
1269
1273
|
const showStepper = !hideStepper;
|
|
1270
1274
|
const { locale } = useLocale();
|
|
1271
|
-
const inputRef =
|
|
1275
|
+
const inputRef = useObjectRef3(ref);
|
|
1272
1276
|
const state = useNumberFieldState(__spreadProps(__spreadValues({}, props), { locale }));
|
|
1273
1277
|
const {
|
|
1274
1278
|
labelProps,
|
|
@@ -1343,21 +1347,34 @@ import {
|
|
|
1343
1347
|
__defaultTheme
|
|
1344
1348
|
} from "@marigold/system";
|
|
1345
1349
|
function MarigoldProvider({
|
|
1350
|
+
children,
|
|
1346
1351
|
theme,
|
|
1347
|
-
|
|
1352
|
+
selector,
|
|
1353
|
+
normalizeDocument = true
|
|
1348
1354
|
}) {
|
|
1355
|
+
var _a;
|
|
1349
1356
|
const outer = useTheme();
|
|
1350
1357
|
const isTopLevel = outer.theme === __defaultTheme;
|
|
1358
|
+
if (((_a = outer.theme) == null ? void 0 : _a.root) && !isTopLevel && !selector) {
|
|
1359
|
+
throw new Error(`[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
|
|
1360
|
+
Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`);
|
|
1361
|
+
}
|
|
1351
1362
|
return /* @__PURE__ */ React36.createElement(ThemeProvider, {
|
|
1352
1363
|
theme
|
|
1353
|
-
},
|
|
1364
|
+
}, /* @__PURE__ */ React36.createElement(Global, {
|
|
1365
|
+
normalizeDocument: isTopLevel && normalizeDocument,
|
|
1366
|
+
selector
|
|
1367
|
+
}), isTopLevel ? /* @__PURE__ */ React36.createElement(OverlayProvider, null, children) : children);
|
|
1354
1368
|
}
|
|
1355
1369
|
|
|
1356
1370
|
// src/Radio/Radio.tsx
|
|
1357
|
-
import React38, {
|
|
1371
|
+
import React38, {
|
|
1372
|
+
forwardRef as forwardRef7
|
|
1373
|
+
} from "react";
|
|
1358
1374
|
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
1359
1375
|
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
1360
1376
|
import { useRadio } from "@react-aria/radio";
|
|
1377
|
+
import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
1361
1378
|
import {
|
|
1362
1379
|
Box as Box20,
|
|
1363
1380
|
useComponentStyles as useComponentStyles22,
|
|
@@ -1455,7 +1472,7 @@ var Icon2 = (_a) => {
|
|
|
1455
1472
|
css
|
|
1456
1473
|
}, props), checked ? /* @__PURE__ */ React38.createElement(Dot, null) : null);
|
|
1457
1474
|
};
|
|
1458
|
-
var Radio = (_a) => {
|
|
1475
|
+
var Radio = forwardRef7((_a, ref) => {
|
|
1459
1476
|
var _b = _a, { width, disabled } = _b, props = __objRest(_b, ["width", "disabled"]);
|
|
1460
1477
|
const _a2 = useRadioGroupContext(), {
|
|
1461
1478
|
variant,
|
|
@@ -1468,8 +1485,8 @@ var Radio = (_a) => {
|
|
|
1468
1485
|
"error",
|
|
1469
1486
|
"width"
|
|
1470
1487
|
]);
|
|
1471
|
-
const
|
|
1472
|
-
const { inputProps } = useRadio(__spreadValues({ isDisabled: disabled }, props), state,
|
|
1488
|
+
const inputRef = useObjectRef4(ref);
|
|
1489
|
+
const { inputProps } = useRadio(__spreadValues({ isDisabled: disabled }, props), state, inputRef);
|
|
1473
1490
|
const styles = useComponentStyles22("Radio", { variant: variant || props.variant, size: size || props.size }, { parts: ["container", "label", "radio"] });
|
|
1474
1491
|
const { hoverProps, isHovered } = useHover4({});
|
|
1475
1492
|
const { isFocusVisible, focusProps } = useFocusRing5();
|
|
@@ -1493,7 +1510,7 @@ var Radio = (_a) => {
|
|
|
1493
1510
|
css: styles.container
|
|
1494
1511
|
}, hoverProps), stateProps), /* @__PURE__ */ React38.createElement(Box20, __spreadValues(__spreadValues({
|
|
1495
1512
|
as: "input",
|
|
1496
|
-
ref,
|
|
1513
|
+
ref: inputRef,
|
|
1497
1514
|
css: {
|
|
1498
1515
|
position: "absolute",
|
|
1499
1516
|
width: "100%",
|
|
@@ -1510,11 +1527,14 @@ var Radio = (_a) => {
|
|
|
1510
1527
|
}, stateProps)), /* @__PURE__ */ React38.createElement(Box20, __spreadValues({
|
|
1511
1528
|
css: styles.label
|
|
1512
1529
|
}, stateProps), props.children));
|
|
1513
|
-
};
|
|
1530
|
+
});
|
|
1514
1531
|
Radio.Group = RadioGroup;
|
|
1515
1532
|
|
|
1516
1533
|
// src/Select/Select.tsx
|
|
1517
|
-
import React42, {
|
|
1534
|
+
import React42, {
|
|
1535
|
+
forwardRef as forwardRef9,
|
|
1536
|
+
useRef as useRef11
|
|
1537
|
+
} from "react";
|
|
1518
1538
|
import { useButton as useButton4 } from "@react-aria/button";
|
|
1519
1539
|
import { FocusScope as FocusScope3, useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1520
1540
|
import { useMessageFormatter } from "@react-aria/i18n";
|
|
@@ -1522,7 +1542,7 @@ import { DismissButton as DismissButton2, useOverlayPosition as useOverlayPositi
|
|
|
1522
1542
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
1523
1543
|
import { useSelectState } from "@react-stately/select";
|
|
1524
1544
|
import { Item as Item2, Section } from "@react-stately/collections";
|
|
1525
|
-
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1545
|
+
import { mergeProps as mergeProps7, useObjectRef as useObjectRef6 } from "@react-aria/utils";
|
|
1526
1546
|
import {
|
|
1527
1547
|
Box as Box24,
|
|
1528
1548
|
useComponentStyles as useComponentStyles24,
|
|
@@ -1530,8 +1550,8 @@ import {
|
|
|
1530
1550
|
} from "@marigold/system";
|
|
1531
1551
|
|
|
1532
1552
|
// src/ListBox/ListBox.tsx
|
|
1533
|
-
import React41, { forwardRef as
|
|
1534
|
-
import { useObjectRef as
|
|
1553
|
+
import React41, { forwardRef as forwardRef8 } from "react";
|
|
1554
|
+
import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
|
|
1535
1555
|
import {
|
|
1536
1556
|
Box as Box23,
|
|
1537
1557
|
useComponentStyles as useComponentStyles23
|
|
@@ -1549,11 +1569,11 @@ import { useListBoxSection } from "@react-aria/listbox";
|
|
|
1549
1569
|
import { Box as Box22 } from "@marigold/system";
|
|
1550
1570
|
|
|
1551
1571
|
// src/ListBox/ListBoxOption.tsx
|
|
1552
|
-
import React39, { useRef as
|
|
1572
|
+
import React39, { useRef as useRef10 } from "react";
|
|
1553
1573
|
import { useOption } from "@react-aria/listbox";
|
|
1554
1574
|
import { Box as Box21, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1555
1575
|
var ListBoxOption = ({ item, state }) => {
|
|
1556
|
-
const ref =
|
|
1576
|
+
const ref = useRef10(null);
|
|
1557
1577
|
const { optionProps, isSelected, isDisabled, isFocused } = useOption({
|
|
1558
1578
|
key: item.key
|
|
1559
1579
|
}, state, ref);
|
|
@@ -1594,9 +1614,9 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1594
1614
|
};
|
|
1595
1615
|
|
|
1596
1616
|
// src/ListBox/ListBox.tsx
|
|
1597
|
-
var ListBox =
|
|
1617
|
+
var ListBox = forwardRef8((_a, ref) => {
|
|
1598
1618
|
var _b = _a, { state, variant, size } = _b, props = __objRest(_b, ["state", "variant", "size"]);
|
|
1599
|
-
const innerRef =
|
|
1619
|
+
const innerRef = useObjectRef5(ref);
|
|
1600
1620
|
const { listBoxProps } = useListBox(props, state, innerRef);
|
|
1601
1621
|
const styles = useComponentStyles23("ListBox", { variant, size }, { parts: ["container", "list", "option", "section", "sectionTitle"] });
|
|
1602
1622
|
return /* @__PURE__ */ React41.createElement(ListBoxContext.Provider, {
|
|
@@ -1643,25 +1663,10 @@ var Chevron = ({ css }) => /* @__PURE__ */ React42.createElement(Box24, {
|
|
|
1643
1663
|
strokeLinejoin: "round",
|
|
1644
1664
|
d: "M19 9l-7 7-7-7"
|
|
1645
1665
|
}));
|
|
1646
|
-
var Select = (_a) => {
|
|
1647
|
-
var _b = _a, {
|
|
1648
|
-
variant,
|
|
1649
|
-
size,
|
|
1650
|
-
width,
|
|
1651
|
-
open,
|
|
1652
|
-
disabled,
|
|
1653
|
-
required,
|
|
1654
|
-
error
|
|
1655
|
-
} = _b, rest = __objRest(_b, [
|
|
1656
|
-
"variant",
|
|
1657
|
-
"size",
|
|
1658
|
-
"width",
|
|
1659
|
-
"open",
|
|
1660
|
-
"disabled",
|
|
1661
|
-
"required",
|
|
1662
|
-
"error"
|
|
1663
|
-
]);
|
|
1666
|
+
var Select = forwardRef9((_a, ref) => {
|
|
1667
|
+
var _b = _a, { variant, size, width, open, disabled, required, error } = _b, rest = __objRest(_b, ["variant", "size", "width", "open", "disabled", "required", "error"]);
|
|
1664
1668
|
const formatMessage = useMessageFormatter(messages);
|
|
1669
|
+
const buttonRef = useObjectRef6(ref);
|
|
1665
1670
|
const props = __spreadValues({
|
|
1666
1671
|
isOpen: open,
|
|
1667
1672
|
isDisabled: disabled,
|
|
@@ -1670,7 +1675,6 @@ var Select = (_a) => {
|
|
|
1670
1675
|
placeholder: rest.placeholder || formatMessage("placeholder")
|
|
1671
1676
|
}, rest);
|
|
1672
1677
|
const state = useSelectState(props);
|
|
1673
|
-
const buttonRef = useRef12(null);
|
|
1674
1678
|
const {
|
|
1675
1679
|
labelProps,
|
|
1676
1680
|
triggerProps,
|
|
@@ -1681,7 +1685,7 @@ var Select = (_a) => {
|
|
|
1681
1685
|
} = useSelect(props, state, buttonRef);
|
|
1682
1686
|
const { buttonProps } = useButton4(__spreadValues({ isDisabled: disabled }, triggerProps), buttonRef);
|
|
1683
1687
|
const { focusProps, isFocusVisible } = useFocusRing6();
|
|
1684
|
-
const overlayRef =
|
|
1688
|
+
const overlayRef = useRef11(null);
|
|
1685
1689
|
const { overlayProps: positionProps } = useOverlayPosition2({
|
|
1686
1690
|
targetRef: buttonRef,
|
|
1687
1691
|
overlayRef,
|
|
@@ -1751,15 +1755,16 @@ var Select = (_a) => {
|
|
|
1751
1755
|
}, menuProps)), /* @__PURE__ */ React42.createElement(DismissButton2, {
|
|
1752
1756
|
onDismiss: state.close
|
|
1753
1757
|
}))));
|
|
1754
|
-
};
|
|
1758
|
+
});
|
|
1755
1759
|
Select.Option = Item2;
|
|
1756
1760
|
Select.Section = Section;
|
|
1757
1761
|
|
|
1758
1762
|
// src/Slider/Slider.tsx
|
|
1759
|
-
import React44, {
|
|
1763
|
+
import React44, { forwardRef as forwardRef10 } from "react";
|
|
1760
1764
|
import { useSlider } from "@react-aria/slider";
|
|
1761
1765
|
import { useSliderState } from "@react-stately/slider";
|
|
1762
1766
|
import { useNumberFormatter } from "@react-aria/i18n";
|
|
1767
|
+
import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
1763
1768
|
import { useComponentStyles as useComponentStyles25 } from "@marigold/system";
|
|
1764
1769
|
|
|
1765
1770
|
// src/Slider/Thumb.tsx
|
|
@@ -1809,18 +1814,10 @@ var Thumb = (_a) => {
|
|
|
1809
1814
|
};
|
|
1810
1815
|
|
|
1811
1816
|
// src/Slider/Slider.tsx
|
|
1812
|
-
var Slider = (_a) => {
|
|
1813
|
-
var _b = _a, {
|
|
1814
|
-
variant,
|
|
1815
|
-
size,
|
|
1816
|
-
width = "100%"
|
|
1817
|
-
} = _b, props = __objRest(_b, [
|
|
1818
|
-
"variant",
|
|
1819
|
-
"size",
|
|
1820
|
-
"width"
|
|
1821
|
-
]);
|
|
1817
|
+
var Slider = forwardRef10((_a, ref) => {
|
|
1818
|
+
var _b = _a, { variant, size, width = "100%" } = _b, props = __objRest(_b, ["variant", "size", "width"]);
|
|
1822
1819
|
const { formatOptions } = props;
|
|
1823
|
-
const trackRef =
|
|
1820
|
+
const trackRef = useObjectRef7(ref);
|
|
1824
1821
|
const numberFormatter = useNumberFormatter(formatOptions);
|
|
1825
1822
|
const state = useSliderState(__spreadProps(__spreadValues({}, props), { numberFormatter }));
|
|
1826
1823
|
const { groupProps, trackProps, labelProps, outputProps } = useSlider(__spreadValues({
|
|
@@ -1860,10 +1857,18 @@ var Slider = (_a) => {
|
|
|
1860
1857
|
disabled: props.disabled,
|
|
1861
1858
|
styles: styles.thumb
|
|
1862
1859
|
})));
|
|
1863
|
-
};
|
|
1860
|
+
});
|
|
1864
1861
|
|
|
1865
|
-
// src/
|
|
1862
|
+
// src/Split/Split.tsx
|
|
1866
1863
|
import React45 from "react";
|
|
1864
|
+
import { Box as Box25 } from "@marigold/system";
|
|
1865
|
+
var Split = (props) => /* @__PURE__ */ React45.createElement(Box25, __spreadProps(__spreadValues({}, props), {
|
|
1866
|
+
role: "separator",
|
|
1867
|
+
css: { flexGrow: 1 }
|
|
1868
|
+
}));
|
|
1869
|
+
|
|
1870
|
+
// src/Stack/Stack.tsx
|
|
1871
|
+
import React46 from "react";
|
|
1867
1872
|
var ALIGNMENT_X2 = {
|
|
1868
1873
|
left: "flex-start",
|
|
1869
1874
|
center: "center",
|
|
@@ -1888,7 +1893,7 @@ var Stack = (_a) => {
|
|
|
1888
1893
|
"alignY",
|
|
1889
1894
|
"stretch"
|
|
1890
1895
|
]);
|
|
1891
|
-
return /* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ React46.createElement(Box, __spreadValues({
|
|
1892
1897
|
css: {
|
|
1893
1898
|
display: "flex",
|
|
1894
1899
|
flexDirection: "column",
|
|
@@ -1902,15 +1907,16 @@ var Stack = (_a) => {
|
|
|
1902
1907
|
};
|
|
1903
1908
|
|
|
1904
1909
|
// src/Switch/Switch.tsx
|
|
1905
|
-
import
|
|
1910
|
+
import React47, { forwardRef as forwardRef11 } from "react";
|
|
1906
1911
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
1907
1912
|
import { useSwitch } from "@react-aria/switch";
|
|
1913
|
+
import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
1908
1914
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
1909
1915
|
import {
|
|
1910
1916
|
useComponentStyles as useComponentStyles26,
|
|
1911
1917
|
useStateProps as useStateProps10
|
|
1912
1918
|
} from "@marigold/system";
|
|
1913
|
-
var Switch = (_a) => {
|
|
1919
|
+
var Switch = forwardRef11((_a, ref) => {
|
|
1914
1920
|
var _b = _a, {
|
|
1915
1921
|
variant,
|
|
1916
1922
|
size,
|
|
@@ -1928,7 +1934,7 @@ var Switch = (_a) => {
|
|
|
1928
1934
|
"readOnly",
|
|
1929
1935
|
"defaultChecked"
|
|
1930
1936
|
]);
|
|
1931
|
-
const
|
|
1937
|
+
const inputRef = useObjectRef8(ref);
|
|
1932
1938
|
const props = __spreadValues({
|
|
1933
1939
|
isSelected: checked,
|
|
1934
1940
|
isDisabled: disabled,
|
|
@@ -1936,7 +1942,7 @@ var Switch = (_a) => {
|
|
|
1936
1942
|
defaultSelected: defaultChecked
|
|
1937
1943
|
}, rest);
|
|
1938
1944
|
const state = useToggleState2(props);
|
|
1939
|
-
const { inputProps } = useSwitch(props, state,
|
|
1945
|
+
const { inputProps } = useSwitch(props, state, inputRef);
|
|
1940
1946
|
const { isFocusVisible, focusProps } = useFocusRing8();
|
|
1941
1947
|
const stateProps = useStateProps10({
|
|
1942
1948
|
checked: state.isSelected,
|
|
@@ -1945,7 +1951,7 @@ var Switch = (_a) => {
|
|
|
1945
1951
|
focus: isFocusVisible
|
|
1946
1952
|
});
|
|
1947
1953
|
const styles = useComponentStyles26("Switch", { variant, size }, { parts: ["container", "label", "track", "thumb"] });
|
|
1948
|
-
return /* @__PURE__ */
|
|
1954
|
+
return /* @__PURE__ */ React47.createElement(Box, {
|
|
1949
1955
|
as: "label",
|
|
1950
1956
|
__baseCSS: {
|
|
1951
1957
|
display: "flex",
|
|
@@ -1956,9 +1962,9 @@ var Switch = (_a) => {
|
|
|
1956
1962
|
width
|
|
1957
1963
|
},
|
|
1958
1964
|
css: styles.container
|
|
1959
|
-
}, /* @__PURE__ */
|
|
1965
|
+
}, /* @__PURE__ */ React47.createElement(Box, __spreadValues(__spreadValues({
|
|
1960
1966
|
as: "input",
|
|
1961
|
-
ref,
|
|
1967
|
+
ref: inputRef,
|
|
1962
1968
|
css: {
|
|
1963
1969
|
position: "absolute",
|
|
1964
1970
|
width: "100%",
|
|
@@ -1969,9 +1975,9 @@ var Switch = (_a) => {
|
|
|
1969
1975
|
opacity: 1e-4,
|
|
1970
1976
|
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1971
1977
|
}
|
|
1972
|
-
}, inputProps), focusProps)), props.children && /* @__PURE__ */
|
|
1978
|
+
}, inputProps), focusProps)), props.children && /* @__PURE__ */ React47.createElement(Box, {
|
|
1973
1979
|
css: styles.label
|
|
1974
|
-
}, props.children), /* @__PURE__ */
|
|
1980
|
+
}, props.children), /* @__PURE__ */ React47.createElement(Box, __spreadValues({
|
|
1975
1981
|
__baseCSS: {
|
|
1976
1982
|
position: "relative",
|
|
1977
1983
|
width: 48,
|
|
@@ -1980,7 +1986,7 @@ var Switch = (_a) => {
|
|
|
1980
1986
|
borderRadius: 20
|
|
1981
1987
|
},
|
|
1982
1988
|
css: styles.track
|
|
1983
|
-
}, stateProps), /* @__PURE__ */
|
|
1989
|
+
}, stateProps), /* @__PURE__ */ React47.createElement(Box, __spreadValues({
|
|
1984
1990
|
__baseCSS: {
|
|
1985
1991
|
display: "block",
|
|
1986
1992
|
position: "absolute",
|
|
@@ -1999,10 +2005,10 @@ var Switch = (_a) => {
|
|
|
1999
2005
|
},
|
|
2000
2006
|
css: styles.thumb
|
|
2001
2007
|
}, stateProps))));
|
|
2002
|
-
};
|
|
2008
|
+
});
|
|
2003
2009
|
|
|
2004
2010
|
// src/Table/Table.tsx
|
|
2005
|
-
import
|
|
2011
|
+
import React56, { useRef as useRef18 } from "react";
|
|
2006
2012
|
import { useTable } from "@react-aria/table";
|
|
2007
2013
|
import {
|
|
2008
2014
|
Cell,
|
|
@@ -2013,7 +2019,7 @@ import {
|
|
|
2013
2019
|
useTableState
|
|
2014
2020
|
} from "@react-stately/table";
|
|
2015
2021
|
import {
|
|
2016
|
-
Box as
|
|
2022
|
+
Box as Box31,
|
|
2017
2023
|
useComponentStyles as useComponentStyles27
|
|
2018
2024
|
} from "@marigold/system";
|
|
2019
2025
|
|
|
@@ -2023,21 +2029,21 @@ var TableContext = createContext6({});
|
|
|
2023
2029
|
var useTableContext = () => useContext6(TableContext);
|
|
2024
2030
|
|
|
2025
2031
|
// src/Table/TableBody.tsx
|
|
2026
|
-
import
|
|
2032
|
+
import React48 from "react";
|
|
2027
2033
|
import { useTableRowGroup } from "@react-aria/table";
|
|
2028
2034
|
var TableBody = ({ children }) => {
|
|
2029
2035
|
const { rowGroupProps } = useTableRowGroup();
|
|
2030
|
-
return /* @__PURE__ */
|
|
2036
|
+
return /* @__PURE__ */ React48.createElement("tbody", __spreadValues({}, rowGroupProps), children);
|
|
2031
2037
|
};
|
|
2032
2038
|
|
|
2033
2039
|
// src/Table/TableCell.tsx
|
|
2034
|
-
import
|
|
2040
|
+
import React49, { useRef as useRef12 } from "react";
|
|
2035
2041
|
import { useTableCell } from "@react-aria/table";
|
|
2036
2042
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2037
2043
|
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
2038
|
-
import { Box as
|
|
2044
|
+
import { Box as Box26, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2039
2045
|
var TableCell = ({ cell }) => {
|
|
2040
|
-
const ref =
|
|
2046
|
+
const ref = useRef12(null);
|
|
2041
2047
|
const { state, styles } = useTableContext();
|
|
2042
2048
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2043
2049
|
const { gridCellProps } = useTableCell({
|
|
@@ -2045,7 +2051,7 @@ var TableCell = ({ cell }) => {
|
|
|
2045
2051
|
}, state, ref);
|
|
2046
2052
|
const { focusProps, isFocusVisible } = useFocusRing9();
|
|
2047
2053
|
const stateProps = useStateProps11({ disabled, focusVisible: isFocusVisible });
|
|
2048
|
-
return /* @__PURE__ */
|
|
2054
|
+
return /* @__PURE__ */ React49.createElement(Box26, __spreadValues(__spreadValues({
|
|
2049
2055
|
as: "td",
|
|
2050
2056
|
ref,
|
|
2051
2057
|
css: styles.cell
|
|
@@ -2053,11 +2059,11 @@ var TableCell = ({ cell }) => {
|
|
|
2053
2059
|
};
|
|
2054
2060
|
|
|
2055
2061
|
// src/Table/TableCheckboxCell.tsx
|
|
2056
|
-
import
|
|
2062
|
+
import React50, { useRef as useRef13 } from "react";
|
|
2057
2063
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
2058
2064
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2059
2065
|
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
2060
|
-
import { Box as
|
|
2066
|
+
import { Box as Box27, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2061
2067
|
|
|
2062
2068
|
// src/Table/utils.ts
|
|
2063
2069
|
var mapCheckboxProps = (_a) => {
|
|
@@ -2085,7 +2091,7 @@ var mapCheckboxProps = (_a) => {
|
|
|
2085
2091
|
|
|
2086
2092
|
// src/Table/TableCheckboxCell.tsx
|
|
2087
2093
|
var TableCheckboxCell = ({ cell }) => {
|
|
2088
|
-
const ref =
|
|
2094
|
+
const ref = useRef13(null);
|
|
2089
2095
|
const { state, styles } = useTableContext();
|
|
2090
2096
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2091
2097
|
const { gridCellProps } = useTableCell2({
|
|
@@ -2094,7 +2100,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2094
2100
|
const { checkboxProps } = mapCheckboxProps(useTableSelectionCheckbox({ key: cell.parentKey }, state));
|
|
2095
2101
|
const { focusProps, isFocusVisible } = useFocusRing10();
|
|
2096
2102
|
const stateProps = useStateProps12({ disabled, focusVisible: isFocusVisible });
|
|
2097
|
-
return /* @__PURE__ */
|
|
2103
|
+
return /* @__PURE__ */ React50.createElement(Box27, __spreadValues(__spreadValues({
|
|
2098
2104
|
as: "td",
|
|
2099
2105
|
ref,
|
|
2100
2106
|
__baseCSS: {
|
|
@@ -2103,18 +2109,32 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2103
2109
|
lineHeight: 1
|
|
2104
2110
|
},
|
|
2105
2111
|
css: styles.cell
|
|
2106
|
-
}, mergeProps10(gridCellProps, focusProps)), stateProps), /* @__PURE__ */
|
|
2112
|
+
}, mergeProps10(gridCellProps, focusProps)), stateProps), /* @__PURE__ */ React50.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2107
2113
|
};
|
|
2108
2114
|
|
|
2109
2115
|
// src/Table/TableColumnHeader.tsx
|
|
2110
|
-
import
|
|
2116
|
+
import React51, { useRef as useRef14 } from "react";
|
|
2111
2117
|
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
2112
2118
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
2113
2119
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
2114
2120
|
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2115
|
-
import { Box as
|
|
2121
|
+
import { Box as Box28, useStateProps as useStateProps13 } from "@marigold/system";
|
|
2122
|
+
var SortIndicator = ({
|
|
2123
|
+
direction = "ascending",
|
|
2124
|
+
visible
|
|
2125
|
+
}) => /* @__PURE__ */ React51.createElement(Box28, {
|
|
2126
|
+
as: "span",
|
|
2127
|
+
role: "presentation",
|
|
2128
|
+
"aria-hidden": "true",
|
|
2129
|
+
css: {
|
|
2130
|
+
color: "currentColor",
|
|
2131
|
+
paddingInlineStart: "0.5ch",
|
|
2132
|
+
visibility: visible ? "visible" : "hidden"
|
|
2133
|
+
}
|
|
2134
|
+
}, direction === "ascending" ? "\u25B2" : "\u25BC");
|
|
2116
2135
|
var TableColumnHeader = ({ column }) => {
|
|
2117
|
-
|
|
2136
|
+
var _a, _b;
|
|
2137
|
+
const ref = useRef14(null);
|
|
2118
2138
|
const { state, styles } = useTableContext();
|
|
2119
2139
|
const { columnHeaderProps } = useTableColumnHeader({
|
|
2120
2140
|
node: column
|
|
@@ -2125,43 +2145,46 @@ var TableColumnHeader = ({ column }) => {
|
|
|
2125
2145
|
hover: isHovered,
|
|
2126
2146
|
focusVisible: isFocusVisible
|
|
2127
2147
|
});
|
|
2128
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ React51.createElement(Box28, __spreadValues(__spreadValues({
|
|
2129
2149
|
as: "th",
|
|
2130
2150
|
colSpan: column.colspan,
|
|
2131
2151
|
ref,
|
|
2132
2152
|
css: styles.header
|
|
2133
|
-
}, mergeProps11(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered
|
|
2153
|
+
}, mergeProps11(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered, column.props.allowsSorting && /* @__PURE__ */ React51.createElement(SortIndicator, {
|
|
2154
|
+
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
2155
|
+
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
2156
|
+
}));
|
|
2134
2157
|
};
|
|
2135
2158
|
|
|
2136
2159
|
// src/Table/TableHeader.tsx
|
|
2137
|
-
import
|
|
2160
|
+
import React52 from "react";
|
|
2138
2161
|
import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
|
|
2139
2162
|
var TableHeader = ({ children }) => {
|
|
2140
2163
|
const { rowGroupProps } = useTableRowGroup2();
|
|
2141
|
-
return /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ React52.createElement("thead", __spreadValues({}, rowGroupProps), children);
|
|
2142
2165
|
};
|
|
2143
2166
|
|
|
2144
2167
|
// src/Table/TableHeaderRow.tsx
|
|
2145
|
-
import
|
|
2168
|
+
import React53, { useRef as useRef15 } from "react";
|
|
2146
2169
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
2147
2170
|
var TableHeaderRow = ({ item, children }) => {
|
|
2148
2171
|
const { state } = useTableContext();
|
|
2149
|
-
const ref =
|
|
2172
|
+
const ref = useRef15(null);
|
|
2150
2173
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
2151
|
-
return /* @__PURE__ */
|
|
2174
|
+
return /* @__PURE__ */ React53.createElement("tr", __spreadProps(__spreadValues({}, rowProps), {
|
|
2152
2175
|
ref
|
|
2153
2176
|
}), children);
|
|
2154
2177
|
};
|
|
2155
2178
|
|
|
2156
2179
|
// src/Table/TableRow.tsx
|
|
2157
|
-
import
|
|
2180
|
+
import React54, { useRef as useRef16 } from "react";
|
|
2158
2181
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
2159
2182
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2160
2183
|
import { useTableRow } from "@react-aria/table";
|
|
2161
2184
|
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
2162
|
-
import { Box as
|
|
2185
|
+
import { Box as Box29, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2163
2186
|
var TableRow = ({ children, row }) => {
|
|
2164
|
-
const ref =
|
|
2187
|
+
const ref = useRef16(null);
|
|
2165
2188
|
const { state, styles } = useTableContext();
|
|
2166
2189
|
const { rowProps, isPressed } = useTableRow({
|
|
2167
2190
|
node: row
|
|
@@ -2177,7 +2200,7 @@ var TableRow = ({ children, row }) => {
|
|
|
2177
2200
|
focusVisible: isFocusVisible,
|
|
2178
2201
|
active: isPressed
|
|
2179
2202
|
});
|
|
2180
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ React54.createElement(Box29, __spreadValues(__spreadValues({
|
|
2181
2204
|
as: "tr",
|
|
2182
2205
|
ref,
|
|
2183
2206
|
css: styles.row
|
|
@@ -2185,7 +2208,7 @@ var TableRow = ({ children, row }) => {
|
|
|
2185
2208
|
};
|
|
2186
2209
|
|
|
2187
2210
|
// src/Table/TableSelectAllCell.tsx
|
|
2188
|
-
import
|
|
2211
|
+
import React55, { useRef as useRef17 } from "react";
|
|
2189
2212
|
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
2190
2213
|
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2191
2214
|
import {
|
|
@@ -2193,9 +2216,9 @@ import {
|
|
|
2193
2216
|
useTableSelectAllCheckbox
|
|
2194
2217
|
} from "@react-aria/table";
|
|
2195
2218
|
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2196
|
-
import { Box as
|
|
2219
|
+
import { Box as Box30, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2197
2220
|
var TableSelectAllCell = ({ column }) => {
|
|
2198
|
-
const ref =
|
|
2221
|
+
const ref = useRef17(null);
|
|
2199
2222
|
const { state, styles } = useTableContext();
|
|
2200
2223
|
const { columnHeaderProps } = useTableColumnHeader2({
|
|
2201
2224
|
node: column
|
|
@@ -2207,7 +2230,7 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2207
2230
|
hover: isHovered,
|
|
2208
2231
|
focusVisible: isFocusVisible
|
|
2209
2232
|
});
|
|
2210
|
-
return /* @__PURE__ */
|
|
2233
|
+
return /* @__PURE__ */ React55.createElement(Box30, __spreadValues(__spreadValues({
|
|
2211
2234
|
as: "th",
|
|
2212
2235
|
ref,
|
|
2213
2236
|
__baseCSS: {
|
|
@@ -2216,46 +2239,58 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2216
2239
|
lineHeight: 1
|
|
2217
2240
|
},
|
|
2218
2241
|
css: styles.header
|
|
2219
|
-
}, mergeProps13(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */
|
|
2242
|
+
}, mergeProps13(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */ React55.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2220
2243
|
};
|
|
2221
2244
|
|
|
2222
2245
|
// src/Table/Table.tsx
|
|
2223
2246
|
var Table = (_a) => {
|
|
2224
|
-
var _b = _a, {
|
|
2225
|
-
|
|
2247
|
+
var _b = _a, {
|
|
2248
|
+
variant,
|
|
2249
|
+
size,
|
|
2250
|
+
stretch
|
|
2251
|
+
} = _b, props = __objRest(_b, [
|
|
2252
|
+
"variant",
|
|
2253
|
+
"size",
|
|
2254
|
+
"stretch"
|
|
2255
|
+
]);
|
|
2256
|
+
const tableRef = useRef18(null);
|
|
2226
2257
|
const state = useTableState(__spreadProps(__spreadValues({}, props), {
|
|
2227
2258
|
showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
|
|
2228
2259
|
}));
|
|
2229
2260
|
const { gridProps } = useTable(props, state, tableRef);
|
|
2230
2261
|
const styles = useComponentStyles27("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
|
|
2231
2262
|
const { collection } = state;
|
|
2232
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ React56.createElement(TableContext.Provider, {
|
|
2233
2264
|
value: { state, styles }
|
|
2234
|
-
}, /* @__PURE__ */
|
|
2265
|
+
}, /* @__PURE__ */ React56.createElement(Box31, __spreadValues({
|
|
2235
2266
|
as: "table",
|
|
2236
2267
|
ref: tableRef,
|
|
2268
|
+
__baseCSS: {
|
|
2269
|
+
borderCollapse: "collapse",
|
|
2270
|
+
width: stretch ? "100%" : void 0
|
|
2271
|
+
},
|
|
2237
2272
|
css: styles.table
|
|
2238
|
-
}, gridProps), /* @__PURE__ */
|
|
2273
|
+
}, gridProps), /* @__PURE__ */ React56.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React56.createElement(TableHeaderRow, {
|
|
2239
2274
|
key: headerRow.key,
|
|
2240
2275
|
item: headerRow
|
|
2241
2276
|
}, [...headerRow.childNodes].map((column) => {
|
|
2242
2277
|
var _a2;
|
|
2243
|
-
return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */
|
|
2278
|
+
return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableSelectAllCell, {
|
|
2244
2279
|
key: column.key,
|
|
2245
2280
|
column
|
|
2246
|
-
}) : /* @__PURE__ */
|
|
2281
|
+
}) : /* @__PURE__ */ React56.createElement(TableColumnHeader, {
|
|
2247
2282
|
key: column.key,
|
|
2248
2283
|
column
|
|
2249
2284
|
});
|
|
2250
|
-
})))), /* @__PURE__ */
|
|
2285
|
+
})))), /* @__PURE__ */ React56.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ React56.createElement(TableRow, {
|
|
2251
2286
|
key: row.key,
|
|
2252
2287
|
row
|
|
2253
2288
|
}, [...row.childNodes].map((cell) => {
|
|
2254
2289
|
var _a2;
|
|
2255
|
-
return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */
|
|
2290
|
+
return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableCheckboxCell, {
|
|
2256
2291
|
key: cell.key,
|
|
2257
2292
|
cell
|
|
2258
|
-
}) : /* @__PURE__ */
|
|
2293
|
+
}) : /* @__PURE__ */ React56.createElement(TableCell, {
|
|
2259
2294
|
key: cell.key,
|
|
2260
2295
|
cell
|
|
2261
2296
|
});
|
|
@@ -2268,11 +2303,11 @@ Table.Header = Header2;
|
|
|
2268
2303
|
Table.Row = Row;
|
|
2269
2304
|
|
|
2270
2305
|
// src/Text/Text.tsx
|
|
2271
|
-
import
|
|
2306
|
+
import React57 from "react";
|
|
2272
2307
|
import {
|
|
2273
2308
|
useComponentStyles as useComponentStyles28
|
|
2274
2309
|
} from "@marigold/system";
|
|
2275
|
-
import { Box as
|
|
2310
|
+
import { Box as Box32 } from "@marigold/system";
|
|
2276
2311
|
var Text = (_a) => {
|
|
2277
2312
|
var _b = _a, {
|
|
2278
2313
|
variant,
|
|
@@ -2297,7 +2332,7 @@ var Text = (_a) => {
|
|
|
2297
2332
|
variant,
|
|
2298
2333
|
size
|
|
2299
2334
|
});
|
|
2300
|
-
return /* @__PURE__ */
|
|
2335
|
+
return /* @__PURE__ */ React57.createElement(Box32, __spreadProps(__spreadValues({
|
|
2301
2336
|
as: "p"
|
|
2302
2337
|
}, props), {
|
|
2303
2338
|
css: __spreadValues({ color, cursor, outline, fontSize, textAlign: align }, styles)
|
|
@@ -2305,16 +2340,17 @@ var Text = (_a) => {
|
|
|
2305
2340
|
};
|
|
2306
2341
|
|
|
2307
2342
|
// src/TextArea/TextArea.tsx
|
|
2308
|
-
import
|
|
2343
|
+
import React58, { forwardRef as forwardRef12 } from "react";
|
|
2344
|
+
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
2345
|
+
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
2309
2346
|
import { useTextField } from "@react-aria/textfield";
|
|
2347
|
+
import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
|
|
2310
2348
|
import {
|
|
2311
|
-
Box as
|
|
2349
|
+
Box as Box33,
|
|
2312
2350
|
useComponentStyles as useComponentStyles29,
|
|
2313
2351
|
useStateProps as useStateProps16
|
|
2314
2352
|
} from "@marigold/system";
|
|
2315
|
-
|
|
2316
|
-
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
2317
|
-
var TextArea = (_a) => {
|
|
2353
|
+
var TextArea = forwardRef12((_a, ref) => {
|
|
2318
2354
|
var _b = _a, {
|
|
2319
2355
|
variant,
|
|
2320
2356
|
size,
|
|
@@ -2335,14 +2371,14 @@ var TextArea = (_a) => {
|
|
|
2335
2371
|
"rows"
|
|
2336
2372
|
]);
|
|
2337
2373
|
const { label, description, errorMessage } = props;
|
|
2338
|
-
const
|
|
2374
|
+
const textAreaRef = useObjectRef9(ref);
|
|
2339
2375
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(__spreadValues({
|
|
2340
2376
|
inputElementType: "textarea",
|
|
2341
2377
|
isDisabled: disabled,
|
|
2342
2378
|
isRequired: required,
|
|
2343
2379
|
isReadOnly: readOnly,
|
|
2344
2380
|
validationState: error ? "invalid" : "valid"
|
|
2345
|
-
}, props),
|
|
2381
|
+
}, props), textAreaRef);
|
|
2346
2382
|
const { hoverProps, isHovered } = useHover8({});
|
|
2347
2383
|
const { focusProps, isFocusVisible } = useFocusRing14();
|
|
2348
2384
|
const stateProps = useStateProps16({
|
|
@@ -2353,7 +2389,7 @@ var TextArea = (_a) => {
|
|
|
2353
2389
|
error
|
|
2354
2390
|
});
|
|
2355
2391
|
const styles = useComponentStyles29("TextArea", { variant, size });
|
|
2356
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ React58.createElement(FieldBase, {
|
|
2357
2393
|
label,
|
|
2358
2394
|
labelProps,
|
|
2359
2395
|
required,
|
|
@@ -2366,46 +2402,31 @@ var TextArea = (_a) => {
|
|
|
2366
2402
|
variant,
|
|
2367
2403
|
size,
|
|
2368
2404
|
width
|
|
2369
|
-
}, /* @__PURE__ */
|
|
2405
|
+
}, /* @__PURE__ */ React58.createElement(Box33, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2370
2406
|
as: "textarea",
|
|
2371
2407
|
css: styles,
|
|
2372
|
-
ref,
|
|
2408
|
+
ref: textAreaRef,
|
|
2373
2409
|
rows
|
|
2374
2410
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
2375
|
-
};
|
|
2411
|
+
});
|
|
2376
2412
|
|
|
2377
2413
|
// src/TextField/TextField.tsx
|
|
2378
|
-
import
|
|
2414
|
+
import React59, { forwardRef as forwardRef13 } from "react";
|
|
2379
2415
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
2380
2416
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
2381
2417
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
2418
|
+
import { useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
2382
2419
|
import { useStateProps as useStateProps17 } from "@marigold/system";
|
|
2383
|
-
var TextField = (_a) => {
|
|
2384
|
-
var _b = _a, {
|
|
2385
|
-
variant,
|
|
2386
|
-
size,
|
|
2387
|
-
width,
|
|
2388
|
-
disabled,
|
|
2389
|
-
required,
|
|
2390
|
-
readOnly,
|
|
2391
|
-
error
|
|
2392
|
-
} = _b, props = __objRest(_b, [
|
|
2393
|
-
"variant",
|
|
2394
|
-
"size",
|
|
2395
|
-
"width",
|
|
2396
|
-
"disabled",
|
|
2397
|
-
"required",
|
|
2398
|
-
"readOnly",
|
|
2399
|
-
"error"
|
|
2400
|
-
]);
|
|
2420
|
+
var TextField = forwardRef13((_a, ref) => {
|
|
2421
|
+
var _b = _a, { variant, size, width, disabled, required, readOnly, error } = _b, props = __objRest(_b, ["variant", "size", "width", "disabled", "required", "readOnly", "error"]);
|
|
2401
2422
|
const { label, description, errorMessage, autoFocus } = props;
|
|
2402
|
-
const
|
|
2423
|
+
const inputRef = useObjectRef10(ref);
|
|
2403
2424
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(__spreadValues({
|
|
2404
2425
|
isDisabled: disabled,
|
|
2405
2426
|
isRequired: required,
|
|
2406
2427
|
isReadOnly: readOnly,
|
|
2407
2428
|
validationState: error ? "invalid" : "valid"
|
|
2408
|
-
}, props),
|
|
2429
|
+
}, props), inputRef);
|
|
2409
2430
|
const { hoverProps, isHovered } = useHover9({});
|
|
2410
2431
|
const { focusProps, isFocusVisible } = useFocusRing15({
|
|
2411
2432
|
isTextInput: true,
|
|
@@ -2418,7 +2439,7 @@ var TextField = (_a) => {
|
|
|
2418
2439
|
readOnly,
|
|
2419
2440
|
error
|
|
2420
2441
|
});
|
|
2421
|
-
return /* @__PURE__ */
|
|
2442
|
+
return /* @__PURE__ */ React59.createElement(FieldBase, {
|
|
2422
2443
|
label,
|
|
2423
2444
|
labelProps,
|
|
2424
2445
|
required,
|
|
@@ -2431,18 +2452,18 @@ var TextField = (_a) => {
|
|
|
2431
2452
|
variant,
|
|
2432
2453
|
size,
|
|
2433
2454
|
width
|
|
2434
|
-
}, /* @__PURE__ */
|
|
2435
|
-
ref,
|
|
2455
|
+
}, /* @__PURE__ */ React59.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2456
|
+
ref: inputRef,
|
|
2436
2457
|
variant,
|
|
2437
2458
|
size
|
|
2438
2459
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
2439
|
-
};
|
|
2460
|
+
});
|
|
2440
2461
|
|
|
2441
2462
|
// src/Tiles/Tiles.tsx
|
|
2442
|
-
import
|
|
2443
|
-
var Tiles =
|
|
2463
|
+
import React60 from "react";
|
|
2464
|
+
var Tiles = React60.forwardRef((_a, ref) => {
|
|
2444
2465
|
var _b = _a, { space = "none", itemMinWidth = "250px", children } = _b, props = __objRest(_b, ["space", "itemMinWidth", "children"]);
|
|
2445
|
-
return /* @__PURE__ */
|
|
2466
|
+
return /* @__PURE__ */ React60.createElement(Box, __spreadValues({
|
|
2446
2467
|
ref,
|
|
2447
2468
|
display: "grid",
|
|
2448
2469
|
__baseCSS: {
|
|
@@ -2453,10 +2474,10 @@ var Tiles = React59.forwardRef((_a, ref) => {
|
|
|
2453
2474
|
});
|
|
2454
2475
|
|
|
2455
2476
|
// src/Tooltip/Tooltip.tsx
|
|
2456
|
-
import
|
|
2477
|
+
import React62 from "react";
|
|
2457
2478
|
import { useTooltip } from "@react-aria/tooltip";
|
|
2458
2479
|
import {
|
|
2459
|
-
Box as
|
|
2480
|
+
Box as Box34,
|
|
2460
2481
|
useComponentStyles as useComponentStyles30
|
|
2461
2482
|
} from "@marigold/system";
|
|
2462
2483
|
|
|
@@ -2466,7 +2487,7 @@ var TooltipContext = createContext7({});
|
|
|
2466
2487
|
var useTooltipContext = () => useContext7(TooltipContext);
|
|
2467
2488
|
|
|
2468
2489
|
// src/Tooltip/TooltipTrigger.tsx
|
|
2469
|
-
import
|
|
2490
|
+
import React61, { useRef as useRef19 } from "react";
|
|
2470
2491
|
import { FocusableProvider } from "@react-aria/focus";
|
|
2471
2492
|
import { useOverlayPosition as useOverlayPosition3 } from "@react-aria/overlays";
|
|
2472
2493
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
@@ -2485,15 +2506,15 @@ var TooltipTrigger = (_a) => {
|
|
|
2485
2506
|
"placement",
|
|
2486
2507
|
"children"
|
|
2487
2508
|
]);
|
|
2488
|
-
const [tooltipTrigger, tooltip] =
|
|
2509
|
+
const [tooltipTrigger, tooltip] = React61.Children.toArray(children);
|
|
2489
2510
|
const props = __spreadProps(__spreadValues({}, rest), {
|
|
2490
2511
|
isDisabled: disabled,
|
|
2491
2512
|
isOpen: open,
|
|
2492
2513
|
delay,
|
|
2493
2514
|
placement
|
|
2494
2515
|
});
|
|
2495
|
-
const tooltipTriggerRef =
|
|
2496
|
-
const overlayRef =
|
|
2516
|
+
const tooltipTriggerRef = useRef19(null);
|
|
2517
|
+
const overlayRef = useRef19(null);
|
|
2497
2518
|
const state = useTooltipTriggerState(props);
|
|
2498
2519
|
const { triggerProps, tooltipProps } = useTooltipTrigger(props, state, tooltipTriggerRef);
|
|
2499
2520
|
const {
|
|
@@ -2508,16 +2529,16 @@ var TooltipTrigger = (_a) => {
|
|
|
2508
2529
|
isOpen: state.isOpen,
|
|
2509
2530
|
overlayRef
|
|
2510
2531
|
});
|
|
2511
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ React61.createElement(FocusableProvider, __spreadValues({
|
|
2512
2533
|
ref: tooltipTriggerRef
|
|
2513
|
-
}, triggerProps), tooltipTrigger, /* @__PURE__ */
|
|
2534
|
+
}, triggerProps), tooltipTrigger, /* @__PURE__ */ React61.createElement(TooltipContext.Provider, {
|
|
2514
2535
|
value: __spreadValues(__spreadValues({
|
|
2515
2536
|
state,
|
|
2516
2537
|
overlayRef,
|
|
2517
2538
|
arrowProps,
|
|
2518
2539
|
placement: overlayPlacement
|
|
2519
2540
|
}, tooltipProps), positionProps)
|
|
2520
|
-
}, /* @__PURE__ */
|
|
2541
|
+
}, /* @__PURE__ */ React61.createElement(Overlay, {
|
|
2521
2542
|
open: state.isOpen
|
|
2522
2543
|
}, tooltip)));
|
|
2523
2544
|
};
|
|
@@ -2527,11 +2548,11 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
2527
2548
|
const _a = useTooltipContext(), { arrowProps, state, overlayRef, placement } = _a, rest = __objRest(_a, ["arrowProps", "state", "overlayRef", "placement"]);
|
|
2528
2549
|
const { tooltipProps } = useTooltip({}, state);
|
|
2529
2550
|
const styles = useComponentStyles30("Tooltip", { variant, size }, { parts: ["container", "arrow"] });
|
|
2530
|
-
return /* @__PURE__ */
|
|
2551
|
+
return /* @__PURE__ */ React62.createElement(Box34, __spreadProps(__spreadValues(__spreadValues({}, tooltipProps), rest), {
|
|
2531
2552
|
ref: overlayRef,
|
|
2532
2553
|
css: styles.container,
|
|
2533
2554
|
"data-placement": placement
|
|
2534
|
-
}), /* @__PURE__ */
|
|
2555
|
+
}), /* @__PURE__ */ React62.createElement("div", null, children), /* @__PURE__ */ React62.createElement(Box34, __spreadProps(__spreadValues({}, arrowProps), {
|
|
2535
2556
|
__baseCSS: {
|
|
2536
2557
|
position: "absolute",
|
|
2537
2558
|
height: 0,
|
|
@@ -2580,6 +2601,7 @@ export {
|
|
|
2580
2601
|
SSRProvider,
|
|
2581
2602
|
Select,
|
|
2582
2603
|
Slider,
|
|
2604
|
+
Split,
|
|
2583
2605
|
Stack,
|
|
2584
2606
|
Switch,
|
|
2585
2607
|
Table,
|