@marigold/components 1.1.0 → 1.2.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 +32 -28
- package/dist/index.js +89 -110
- package/dist/index.mjs +110 -126
- package/package.json +51 -51
package/dist/index.js
CHANGED
|
@@ -290,6 +290,7 @@ var import_react10 = __toESM(require("react"));
|
|
|
290
290
|
var import_checkbox3 = require("@react-aria/checkbox");
|
|
291
291
|
var import_focus2 = require("@react-aria/focus");
|
|
292
292
|
var import_interactions = require("@react-aria/interactions");
|
|
293
|
+
var import_utils2 = require("@react-aria/utils");
|
|
293
294
|
var import_toggle = require("@react-stately/toggle");
|
|
294
295
|
var import_system7 = require("@marigold/system");
|
|
295
296
|
|
|
@@ -412,7 +413,7 @@ var Icon = (_a) => {
|
|
|
412
413
|
css
|
|
413
414
|
}, props), indeterminate ? /* @__PURE__ */ import_react10.default.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ import_react10.default.createElement(CheckMark, null) : null);
|
|
414
415
|
};
|
|
415
|
-
var Checkbox = (_a) => {
|
|
416
|
+
var Checkbox = (0, import_react10.forwardRef)((_a, ref) => {
|
|
416
417
|
var _b = _a, {
|
|
417
418
|
size,
|
|
418
419
|
variant,
|
|
@@ -434,7 +435,7 @@ var Checkbox = (_a) => {
|
|
|
434
435
|
"required",
|
|
435
436
|
"error"
|
|
436
437
|
]);
|
|
437
|
-
const
|
|
438
|
+
const inputRef = (0, import_utils2.useObjectRef)(ref);
|
|
438
439
|
const checkboxProps = {
|
|
439
440
|
isIndeterminate: indeterminate,
|
|
440
441
|
isDisabled: disabled,
|
|
@@ -445,14 +446,17 @@ var Checkbox = (_a) => {
|
|
|
445
446
|
const groupState = useCheckboxGroupContext();
|
|
446
447
|
const { inputProps } = groupState ? (0, import_checkbox3.useCheckboxGroupItem)(__spreadProps(__spreadValues(__spreadValues({}, props), checkboxProps), {
|
|
447
448
|
value: props.value
|
|
448
|
-
}), groupState,
|
|
449
|
+
}), groupState, inputRef) : (0, import_checkbox3.useCheckbox)(__spreadValues(__spreadValues({
|
|
449
450
|
isSelected: checked,
|
|
450
451
|
defaultSelected: defaultChecked
|
|
451
452
|
}, checkboxProps), props), (0, import_toggle.useToggleState)(__spreadValues({
|
|
452
453
|
isSelected: checked,
|
|
453
454
|
defaultSelected: defaultChecked
|
|
454
|
-
}, props)),
|
|
455
|
-
const styles = (0, import_system7.useComponentStyles)("Checkbox", {
|
|
455
|
+
}, props)), inputRef);
|
|
456
|
+
const styles = (0, import_system7.useComponentStyles)("Checkbox", {
|
|
457
|
+
variant: (groupState == null ? void 0 : groupState.variant) || variant,
|
|
458
|
+
size: (groupState == null ? void 0 : groupState.size) || size
|
|
459
|
+
}, { parts: ["container", "label", "checkbox"] });
|
|
456
460
|
const { hoverProps, isHovered } = (0, import_interactions.useHover)({});
|
|
457
461
|
const { isFocusVisible, focusProps } = (0, import_focus2.useFocusRing)();
|
|
458
462
|
const stateProps = (0, import_system7.useStateProps)({
|
|
@@ -475,7 +479,7 @@ var Checkbox = (_a) => {
|
|
|
475
479
|
css: styles.container
|
|
476
480
|
}, hoverProps), stateProps), /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, __spreadValues(__spreadValues({
|
|
477
481
|
as: "input",
|
|
478
|
-
ref,
|
|
482
|
+
ref: inputRef,
|
|
479
483
|
css: {
|
|
480
484
|
position: "absolute",
|
|
481
485
|
width: "100%",
|
|
@@ -493,7 +497,7 @@ var Checkbox = (_a) => {
|
|
|
493
497
|
}, stateProps)), props.children && /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, __spreadValues({
|
|
494
498
|
css: styles.label
|
|
495
499
|
}, stateProps), props.children));
|
|
496
|
-
};
|
|
500
|
+
});
|
|
497
501
|
|
|
498
502
|
// src/Columns/Columns.tsx
|
|
499
503
|
var import_react11 = __toESM(require("react"));
|
|
@@ -633,7 +637,7 @@ var Headline = (_a) => {
|
|
|
633
637
|
]);
|
|
634
638
|
const styles = (0, import_system10.useComponentStyles)("Headline", {
|
|
635
639
|
variant,
|
|
636
|
-
size: size
|
|
640
|
+
size: size ?? `level-${level}`
|
|
637
641
|
});
|
|
638
642
|
return /* @__PURE__ */ import_react15.default.createElement(import_system10.Box, __spreadProps(__spreadValues({
|
|
639
643
|
as: `h${level}`
|
|
@@ -656,7 +660,7 @@ var import_overlays4 = require("@react-stately/overlays");
|
|
|
656
660
|
var import_react18 = __toESM(require("react"));
|
|
657
661
|
var import_focus3 = require("@react-aria/focus");
|
|
658
662
|
var import_overlays = require("@react-aria/overlays");
|
|
659
|
-
var
|
|
663
|
+
var import_utils3 = require("@react-aria/utils");
|
|
660
664
|
|
|
661
665
|
// src/Overlay/Underlay.tsx
|
|
662
666
|
var import_react17 = __toESM(require("react"));
|
|
@@ -677,7 +681,7 @@ var Underlay = (_a) => {
|
|
|
677
681
|
// src/Overlay/Modal.tsx
|
|
678
682
|
var Modal = (0, import_react18.forwardRef)((_a, ref) => {
|
|
679
683
|
var _b = _a, { children, open, dismissable, keyboardDismissable, onClose } = _b, props = __objRest(_b, ["children", "open", "dismissable", "keyboardDismissable", "onClose"]);
|
|
680
|
-
const modalRef = (0,
|
|
684
|
+
const modalRef = (0, import_utils3.useObjectRef)(ref);
|
|
681
685
|
const { overlayProps, underlayProps } = (0, import_overlays.useOverlay)({
|
|
682
686
|
isOpen: open,
|
|
683
687
|
onClose,
|
|
@@ -701,7 +705,7 @@ var Modal = (0, import_react18.forwardRef)((_a, ref) => {
|
|
|
701
705
|
pointerEvents: "none"
|
|
702
706
|
},
|
|
703
707
|
ref: modalRef
|
|
704
|
-
}, (0,
|
|
708
|
+
}, (0, import_utils3.mergeProps)(props, overlayProps, modalProps)), /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
705
709
|
style: { pointerEvents: "auto" }
|
|
706
710
|
}, children)));
|
|
707
711
|
});
|
|
@@ -713,7 +717,7 @@ var Overlay = (_a) => {
|
|
|
713
717
|
var _b = _a, {
|
|
714
718
|
children,
|
|
715
719
|
open = false,
|
|
716
|
-
container
|
|
720
|
+
container
|
|
717
721
|
} = _b, props = __objRest(_b, [
|
|
718
722
|
"children",
|
|
719
723
|
"open",
|
|
@@ -730,7 +734,7 @@ var Overlay = (_a) => {
|
|
|
730
734
|
// src/Overlay/Popover.tsx
|
|
731
735
|
var import_react20 = __toESM(require("react"));
|
|
732
736
|
var import_overlays3 = require("@react-aria/overlays");
|
|
733
|
-
var
|
|
737
|
+
var import_utils4 = require("@react-aria/utils");
|
|
734
738
|
var Popover = (0, import_react20.forwardRef)((_a, ref) => {
|
|
735
739
|
var _b = _a, {
|
|
736
740
|
children,
|
|
@@ -762,7 +766,7 @@ var Popover = (0, import_react20.forwardRef)((_a, ref) => {
|
|
|
762
766
|
}, /* @__PURE__ */ import_react20.default.createElement(import_system.Box, __spreadValues({
|
|
763
767
|
ref: popoverRef,
|
|
764
768
|
role: "presentation"
|
|
765
|
-
}, (0,
|
|
769
|
+
}, (0, import_utils4.mergeProps)(props, overlayProps, modalProps, style)), children));
|
|
766
770
|
});
|
|
767
771
|
|
|
768
772
|
// src/Dialog/DialogTrigger.tsx
|
|
@@ -1031,7 +1035,7 @@ var MenuTrigger = ({ disabled, children }) => {
|
|
|
1031
1035
|
var import_react31 = __toESM(require("react"));
|
|
1032
1036
|
var import_focus4 = require("@react-aria/focus");
|
|
1033
1037
|
var import_menu3 = require("@react-aria/menu");
|
|
1034
|
-
var
|
|
1038
|
+
var import_utils5 = require("@react-aria/utils");
|
|
1035
1039
|
var import_system18 = require("@marigold/system");
|
|
1036
1040
|
var MenuItem = ({ item, state, onAction, css }) => {
|
|
1037
1041
|
const ref = (0, import_react31.useRef)(null);
|
|
@@ -1054,7 +1058,7 @@ var MenuItem = ({ item, state, onAction, css }) => {
|
|
|
1054
1058
|
}
|
|
1055
1059
|
},
|
|
1056
1060
|
css
|
|
1057
|
-
}, (0,
|
|
1061
|
+
}, (0, import_utils5.mergeProps)(menuItemProps, focusProps)), stateProps), item.rendered);
|
|
1058
1062
|
};
|
|
1059
1063
|
|
|
1060
1064
|
// src/Menu/Menu.tsx
|
|
@@ -1140,7 +1144,7 @@ var import_focus6 = require("@react-aria/focus");
|
|
|
1140
1144
|
var import_interactions5 = require("@react-aria/interactions");
|
|
1141
1145
|
var import_i18n = require("@react-aria/i18n");
|
|
1142
1146
|
var import_numberfield = require("@react-aria/numberfield");
|
|
1143
|
-
var
|
|
1147
|
+
var import_utils7 = require("@react-aria/utils");
|
|
1144
1148
|
var import_numberfield2 = require("@react-stately/numberfield");
|
|
1145
1149
|
var import_system24 = require("@marigold/system");
|
|
1146
1150
|
|
|
@@ -1224,7 +1228,7 @@ var FieldBase = ({
|
|
|
1224
1228
|
var import_react36 = __toESM(require("react"));
|
|
1225
1229
|
var import_button3 = require("@react-aria/button");
|
|
1226
1230
|
var import_interactions4 = require("@react-aria/interactions");
|
|
1227
|
-
var
|
|
1231
|
+
var import_utils6 = require("@react-aria/utils");
|
|
1228
1232
|
var import_system23 = require("@marigold/system");
|
|
1229
1233
|
var Plus = () => /* @__PURE__ */ import_react36.default.createElement(import_system23.Box, {
|
|
1230
1234
|
as: "svg",
|
|
@@ -1265,7 +1269,7 @@ var StepButton = (_a) => {
|
|
|
1265
1269
|
cursor: props.isDisabled ? "not-allowed" : "pointer"
|
|
1266
1270
|
},
|
|
1267
1271
|
css
|
|
1268
|
-
}, (0,
|
|
1272
|
+
}, (0, import_utils6.mergeProps)(buttonProps, hoverProps)), stateProps), /* @__PURE__ */ import_react36.default.createElement(Icon3, null));
|
|
1269
1273
|
};
|
|
1270
1274
|
|
|
1271
1275
|
// src/NumberField/NumberField.tsx
|
|
@@ -1297,7 +1301,7 @@ var NumberField = (0, import_react37.forwardRef)((_a, ref) => {
|
|
|
1297
1301
|
}, rest);
|
|
1298
1302
|
const showStepper = !hideStepper;
|
|
1299
1303
|
const { locale } = (0, import_i18n.useLocale)();
|
|
1300
|
-
const inputRef = (0,
|
|
1304
|
+
const inputRef = (0, import_utils7.useObjectRef)(ref);
|
|
1301
1305
|
const state = (0, import_numberfield2.useNumberFieldState)(__spreadProps(__spreadValues({}, props), { locale }));
|
|
1302
1306
|
const {
|
|
1303
1307
|
labelProps,
|
|
@@ -1345,7 +1349,7 @@ var NumberField = (0, import_react37.forwardRef)((_a, ref) => {
|
|
|
1345
1349
|
}
|
|
1346
1350
|
},
|
|
1347
1351
|
css: styles.group
|
|
1348
|
-
}, (0,
|
|
1352
|
+
}, (0, import_utils7.mergeProps)(groupProps, focusProps, hoverProps)), stateProps), showStepper && /* @__PURE__ */ import_react37.default.createElement(StepButton, __spreadValues({
|
|
1349
1353
|
direction: "down",
|
|
1350
1354
|
css: styles.stepper
|
|
1351
1355
|
}, decrementButtonProps)), /* @__PURE__ */ import_react37.default.createElement(Input, __spreadValues(__spreadValues({
|
|
@@ -1367,14 +1371,24 @@ var import_react38 = __toESM(require("react"));
|
|
|
1367
1371
|
var import_overlays7 = require("@react-aria/overlays");
|
|
1368
1372
|
var import_system25 = require("@marigold/system");
|
|
1369
1373
|
function MarigoldProvider({
|
|
1374
|
+
children,
|
|
1370
1375
|
theme,
|
|
1371
|
-
|
|
1376
|
+
selector,
|
|
1377
|
+
normalizeDocument = true
|
|
1372
1378
|
}) {
|
|
1379
|
+
var _a;
|
|
1373
1380
|
const outer = (0, import_system25.useTheme)();
|
|
1374
1381
|
const isTopLevel = outer.theme === import_system25.__defaultTheme;
|
|
1382
|
+
if (((_a = outer.theme) == null ? void 0 : _a.root) && !isTopLevel && !selector) {
|
|
1383
|
+
throw new Error(`[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
|
|
1384
|
+
Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`);
|
|
1385
|
+
}
|
|
1375
1386
|
return /* @__PURE__ */ import_react38.default.createElement(import_system25.ThemeProvider, {
|
|
1376
1387
|
theme
|
|
1377
|
-
},
|
|
1388
|
+
}, /* @__PURE__ */ import_react38.default.createElement(import_system25.Global, {
|
|
1389
|
+
normalizeDocument: isTopLevel && normalizeDocument,
|
|
1390
|
+
selector
|
|
1391
|
+
}), isTopLevel ? /* @__PURE__ */ import_react38.default.createElement(import_overlays7.OverlayProvider, null, children) : children);
|
|
1378
1392
|
}
|
|
1379
1393
|
|
|
1380
1394
|
// src/Radio/Radio.tsx
|
|
@@ -1382,6 +1396,7 @@ var import_react41 = __toESM(require("react"));
|
|
|
1382
1396
|
var import_interactions6 = require("@react-aria/interactions");
|
|
1383
1397
|
var import_focus7 = require("@react-aria/focus");
|
|
1384
1398
|
var import_radio3 = require("@react-aria/radio");
|
|
1399
|
+
var import_utils8 = require("@react-aria/utils");
|
|
1385
1400
|
var import_system28 = require("@marigold/system");
|
|
1386
1401
|
|
|
1387
1402
|
// src/Radio/Context.ts
|
|
@@ -1472,7 +1487,7 @@ var Icon2 = (_a) => {
|
|
|
1472
1487
|
css
|
|
1473
1488
|
}, props), checked ? /* @__PURE__ */ import_react41.default.createElement(Dot, null) : null);
|
|
1474
1489
|
};
|
|
1475
|
-
var Radio = (_a) => {
|
|
1490
|
+
var Radio = (0, import_react41.forwardRef)((_a, ref) => {
|
|
1476
1491
|
var _b = _a, { width, disabled } = _b, props = __objRest(_b, ["width", "disabled"]);
|
|
1477
1492
|
const _a2 = useRadioGroupContext(), {
|
|
1478
1493
|
variant,
|
|
@@ -1485,8 +1500,8 @@ var Radio = (_a) => {
|
|
|
1485
1500
|
"error",
|
|
1486
1501
|
"width"
|
|
1487
1502
|
]);
|
|
1488
|
-
const
|
|
1489
|
-
const { inputProps } = (0, import_radio3.useRadio)(__spreadValues({ isDisabled: disabled }, props), state,
|
|
1503
|
+
const inputRef = (0, import_utils8.useObjectRef)(ref);
|
|
1504
|
+
const { inputProps } = (0, import_radio3.useRadio)(__spreadValues({ isDisabled: disabled }, props), state, inputRef);
|
|
1490
1505
|
const styles = (0, import_system28.useComponentStyles)("Radio", { variant: variant || props.variant, size: size || props.size }, { parts: ["container", "label", "radio"] });
|
|
1491
1506
|
const { hoverProps, isHovered } = (0, import_interactions6.useHover)({});
|
|
1492
1507
|
const { isFocusVisible, focusProps } = (0, import_focus7.useFocusRing)();
|
|
@@ -1510,7 +1525,7 @@ var Radio = (_a) => {
|
|
|
1510
1525
|
css: styles.container
|
|
1511
1526
|
}, hoverProps), stateProps), /* @__PURE__ */ import_react41.default.createElement(import_system28.Box, __spreadValues(__spreadValues({
|
|
1512
1527
|
as: "input",
|
|
1513
|
-
ref,
|
|
1528
|
+
ref: inputRef,
|
|
1514
1529
|
css: {
|
|
1515
1530
|
position: "absolute",
|
|
1516
1531
|
width: "100%",
|
|
@@ -1527,7 +1542,7 @@ var Radio = (_a) => {
|
|
|
1527
1542
|
}, stateProps)), /* @__PURE__ */ import_react41.default.createElement(import_system28.Box, __spreadValues({
|
|
1528
1543
|
css: styles.label
|
|
1529
1544
|
}, stateProps), props.children));
|
|
1530
|
-
};
|
|
1545
|
+
});
|
|
1531
1546
|
Radio.Group = RadioGroup;
|
|
1532
1547
|
|
|
1533
1548
|
// src/Select/Select.tsx
|
|
@@ -1539,12 +1554,12 @@ var import_overlays8 = require("@react-aria/overlays");
|
|
|
1539
1554
|
var import_select = require("@react-aria/select");
|
|
1540
1555
|
var import_select2 = require("@react-stately/select");
|
|
1541
1556
|
var import_collections2 = require("@react-stately/collections");
|
|
1542
|
-
var
|
|
1557
|
+
var import_utils10 = require("@react-aria/utils");
|
|
1543
1558
|
var import_system32 = require("@marigold/system");
|
|
1544
1559
|
|
|
1545
1560
|
// src/ListBox/ListBox.tsx
|
|
1546
1561
|
var import_react45 = __toESM(require("react"));
|
|
1547
|
-
var
|
|
1562
|
+
var import_utils9 = require("@react-aria/utils");
|
|
1548
1563
|
var import_system31 = require("@marigold/system");
|
|
1549
1564
|
var import_listbox3 = require("@react-aria/listbox");
|
|
1550
1565
|
|
|
@@ -1606,7 +1621,7 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1606
1621
|
// src/ListBox/ListBox.tsx
|
|
1607
1622
|
var ListBox = (0, import_react45.forwardRef)((_a, ref) => {
|
|
1608
1623
|
var _b = _a, { state, variant, size } = _b, props = __objRest(_b, ["state", "variant", "size"]);
|
|
1609
|
-
const innerRef = (0,
|
|
1624
|
+
const innerRef = (0, import_utils9.useObjectRef)(ref);
|
|
1610
1625
|
const { listBoxProps } = (0, import_listbox3.useListBox)(props, state, innerRef);
|
|
1611
1626
|
const styles = (0, import_system31.useComponentStyles)("ListBox", { variant, size }, { parts: ["container", "list", "option", "section", "sectionTitle"] });
|
|
1612
1627
|
return /* @__PURE__ */ import_react45.default.createElement(ListBoxContext.Provider, {
|
|
@@ -1653,25 +1668,10 @@ var Chevron = ({ css }) => /* @__PURE__ */ import_react46.default.createElement(
|
|
|
1653
1668
|
strokeLinejoin: "round",
|
|
1654
1669
|
d: "M19 9l-7 7-7-7"
|
|
1655
1670
|
}));
|
|
1656
|
-
var Select = (_a) => {
|
|
1657
|
-
var _b = _a, {
|
|
1658
|
-
variant,
|
|
1659
|
-
size,
|
|
1660
|
-
width,
|
|
1661
|
-
open,
|
|
1662
|
-
disabled,
|
|
1663
|
-
required,
|
|
1664
|
-
error
|
|
1665
|
-
} = _b, rest = __objRest(_b, [
|
|
1666
|
-
"variant",
|
|
1667
|
-
"size",
|
|
1668
|
-
"width",
|
|
1669
|
-
"open",
|
|
1670
|
-
"disabled",
|
|
1671
|
-
"required",
|
|
1672
|
-
"error"
|
|
1673
|
-
]);
|
|
1671
|
+
var Select = (0, import_react46.forwardRef)((_a, ref) => {
|
|
1672
|
+
var _b = _a, { variant, size, width, open, disabled, required, error } = _b, rest = __objRest(_b, ["variant", "size", "width", "open", "disabled", "required", "error"]);
|
|
1674
1673
|
const formatMessage = (0, import_i18n2.useMessageFormatter)(messages);
|
|
1674
|
+
const buttonRef = (0, import_utils10.useObjectRef)(ref);
|
|
1675
1675
|
const props = __spreadValues({
|
|
1676
1676
|
isOpen: open,
|
|
1677
1677
|
isDisabled: disabled,
|
|
@@ -1680,7 +1680,6 @@ var Select = (_a) => {
|
|
|
1680
1680
|
placeholder: rest.placeholder || formatMessage("placeholder")
|
|
1681
1681
|
}, rest);
|
|
1682
1682
|
const state = (0, import_select2.useSelectState)(props);
|
|
1683
|
-
const buttonRef = (0, import_react46.useRef)(null);
|
|
1684
1683
|
const {
|
|
1685
1684
|
labelProps,
|
|
1686
1685
|
triggerProps,
|
|
@@ -1736,7 +1735,7 @@ var Select = (_a) => {
|
|
|
1736
1735
|
},
|
|
1737
1736
|
css: styles.button,
|
|
1738
1737
|
ref: buttonRef
|
|
1739
|
-
}, (0,
|
|
1738
|
+
}, (0, import_utils10.mergeProps)(buttonProps, focusProps)), stateProps), /* @__PURE__ */ import_react46.default.createElement(import_system32.Box, __spreadValues({
|
|
1740
1739
|
css: {
|
|
1741
1740
|
overflow: "hidden",
|
|
1742
1741
|
whiteSpace: "nowrap"
|
|
@@ -1761,7 +1760,7 @@ var Select = (_a) => {
|
|
|
1761
1760
|
}, menuProps)), /* @__PURE__ */ import_react46.default.createElement(import_overlays8.DismissButton, {
|
|
1762
1761
|
onDismiss: state.close
|
|
1763
1762
|
}))));
|
|
1764
|
-
};
|
|
1763
|
+
});
|
|
1765
1764
|
Select.Option = import_collections2.Item;
|
|
1766
1765
|
Select.Section = import_collections2.Section;
|
|
1767
1766
|
|
|
@@ -1770,12 +1769,13 @@ var import_react48 = __toESM(require("react"));
|
|
|
1770
1769
|
var import_slider2 = require("@react-aria/slider");
|
|
1771
1770
|
var import_slider3 = require("@react-stately/slider");
|
|
1772
1771
|
var import_i18n3 = require("@react-aria/i18n");
|
|
1772
|
+
var import_utils12 = require("@react-aria/utils");
|
|
1773
1773
|
var import_system34 = require("@marigold/system");
|
|
1774
1774
|
|
|
1775
1775
|
// src/Slider/Thumb.tsx
|
|
1776
1776
|
var import_react47 = __toESM(require("react"));
|
|
1777
1777
|
var import_slider = require("@react-aria/slider");
|
|
1778
|
-
var
|
|
1778
|
+
var import_utils11 = require("@react-aria/utils");
|
|
1779
1779
|
var import_system33 = require("@marigold/system");
|
|
1780
1780
|
|
|
1781
1781
|
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
@@ -1815,22 +1815,14 @@ var Thumb = (_a) => {
|
|
|
1815
1815
|
as: "input",
|
|
1816
1816
|
type: "range",
|
|
1817
1817
|
ref: inputRef
|
|
1818
|
-
}, (0,
|
|
1818
|
+
}, (0, import_utils11.mergeProps)(inputProps, focusProps))))));
|
|
1819
1819
|
};
|
|
1820
1820
|
|
|
1821
1821
|
// src/Slider/Slider.tsx
|
|
1822
|
-
var Slider = (_a) => {
|
|
1823
|
-
var _b = _a, {
|
|
1824
|
-
variant,
|
|
1825
|
-
size,
|
|
1826
|
-
width = "100%"
|
|
1827
|
-
} = _b, props = __objRest(_b, [
|
|
1828
|
-
"variant",
|
|
1829
|
-
"size",
|
|
1830
|
-
"width"
|
|
1831
|
-
]);
|
|
1822
|
+
var Slider = (0, import_react48.forwardRef)((_a, ref) => {
|
|
1823
|
+
var _b = _a, { variant, size, width = "100%" } = _b, props = __objRest(_b, ["variant", "size", "width"]);
|
|
1832
1824
|
const { formatOptions } = props;
|
|
1833
|
-
const trackRef = (0,
|
|
1825
|
+
const trackRef = (0, import_utils12.useObjectRef)(ref);
|
|
1834
1826
|
const numberFormatter = (0, import_i18n3.useNumberFormatter)(formatOptions);
|
|
1835
1827
|
const state = (0, import_slider3.useSliderState)(__spreadProps(__spreadValues({}, props), { numberFormatter }));
|
|
1836
1828
|
const { groupProps, trackProps, labelProps, outputProps } = (0, import_slider2.useSlider)(__spreadValues({
|
|
@@ -1870,7 +1862,7 @@ var Slider = (_a) => {
|
|
|
1870
1862
|
disabled: props.disabled,
|
|
1871
1863
|
styles: styles.thumb
|
|
1872
1864
|
})));
|
|
1873
|
-
};
|
|
1865
|
+
});
|
|
1874
1866
|
|
|
1875
1867
|
// src/Split/Split.tsx
|
|
1876
1868
|
var import_react49 = __toESM(require("react"));
|
|
@@ -1923,9 +1915,10 @@ var Stack = (_a) => {
|
|
|
1923
1915
|
var import_react51 = __toESM(require("react"));
|
|
1924
1916
|
var import_focus10 = require("@react-aria/focus");
|
|
1925
1917
|
var import_switch = require("@react-aria/switch");
|
|
1918
|
+
var import_utils13 = require("@react-aria/utils");
|
|
1926
1919
|
var import_toggle2 = require("@react-stately/toggle");
|
|
1927
1920
|
var import_system36 = require("@marigold/system");
|
|
1928
|
-
var Switch = (_a) => {
|
|
1921
|
+
var Switch = (0, import_react51.forwardRef)((_a, ref) => {
|
|
1929
1922
|
var _b = _a, {
|
|
1930
1923
|
variant,
|
|
1931
1924
|
size,
|
|
@@ -1943,7 +1936,7 @@ var Switch = (_a) => {
|
|
|
1943
1936
|
"readOnly",
|
|
1944
1937
|
"defaultChecked"
|
|
1945
1938
|
]);
|
|
1946
|
-
const
|
|
1939
|
+
const inputRef = (0, import_utils13.useObjectRef)(ref);
|
|
1947
1940
|
const props = __spreadValues({
|
|
1948
1941
|
isSelected: checked,
|
|
1949
1942
|
isDisabled: disabled,
|
|
@@ -1951,7 +1944,7 @@ var Switch = (_a) => {
|
|
|
1951
1944
|
defaultSelected: defaultChecked
|
|
1952
1945
|
}, rest);
|
|
1953
1946
|
const state = (0, import_toggle2.useToggleState)(props);
|
|
1954
|
-
const { inputProps } = (0, import_switch.useSwitch)(props, state,
|
|
1947
|
+
const { inputProps } = (0, import_switch.useSwitch)(props, state, inputRef);
|
|
1955
1948
|
const { isFocusVisible, focusProps } = (0, import_focus10.useFocusRing)();
|
|
1956
1949
|
const stateProps = (0, import_system36.useStateProps)({
|
|
1957
1950
|
checked: state.isSelected,
|
|
@@ -1973,7 +1966,7 @@ var Switch = (_a) => {
|
|
|
1973
1966
|
css: styles.container
|
|
1974
1967
|
}, /* @__PURE__ */ import_react51.default.createElement(import_system.Box, __spreadValues(__spreadValues({
|
|
1975
1968
|
as: "input",
|
|
1976
|
-
ref,
|
|
1969
|
+
ref: inputRef,
|
|
1977
1970
|
css: {
|
|
1978
1971
|
position: "absolute",
|
|
1979
1972
|
width: "100%",
|
|
@@ -2014,7 +2007,7 @@ var Switch = (_a) => {
|
|
|
2014
2007
|
},
|
|
2015
2008
|
css: styles.thumb
|
|
2016
2009
|
}, stateProps))));
|
|
2017
|
-
};
|
|
2010
|
+
});
|
|
2018
2011
|
|
|
2019
2012
|
// src/Table/Table.tsx
|
|
2020
2013
|
var import_react61 = __toESM(require("react"));
|
|
@@ -2039,7 +2032,7 @@ var TableBody = ({ children }) => {
|
|
|
2039
2032
|
var import_react54 = __toESM(require("react"));
|
|
2040
2033
|
var import_table2 = require("@react-aria/table");
|
|
2041
2034
|
var import_focus11 = require("@react-aria/focus");
|
|
2042
|
-
var
|
|
2035
|
+
var import_utils14 = require("@react-aria/utils");
|
|
2043
2036
|
var import_system37 = require("@marigold/system");
|
|
2044
2037
|
var TableCell = ({ cell }) => {
|
|
2045
2038
|
const ref = (0, import_react54.useRef)(null);
|
|
@@ -2054,14 +2047,14 @@ var TableCell = ({ cell }) => {
|
|
|
2054
2047
|
as: "td",
|
|
2055
2048
|
ref,
|
|
2056
2049
|
css: styles.cell
|
|
2057
|
-
}, (0,
|
|
2050
|
+
}, (0, import_utils14.mergeProps)(gridCellProps, focusProps)), stateProps), cell.rendered);
|
|
2058
2051
|
};
|
|
2059
2052
|
|
|
2060
2053
|
// src/Table/TableCheckboxCell.tsx
|
|
2061
2054
|
var import_react55 = __toESM(require("react"));
|
|
2062
2055
|
var import_table3 = require("@react-aria/table");
|
|
2063
2056
|
var import_focus12 = require("@react-aria/focus");
|
|
2064
|
-
var
|
|
2057
|
+
var import_utils15 = require("@react-aria/utils");
|
|
2065
2058
|
var import_system38 = require("@marigold/system");
|
|
2066
2059
|
|
|
2067
2060
|
// src/Table/utils.ts
|
|
@@ -2108,7 +2101,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2108
2101
|
lineHeight: 1
|
|
2109
2102
|
},
|
|
2110
2103
|
css: styles.cell
|
|
2111
|
-
}, (0,
|
|
2104
|
+
}, (0, import_utils15.mergeProps)(gridCellProps, focusProps)), stateProps), /* @__PURE__ */ import_react55.default.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2112
2105
|
};
|
|
2113
2106
|
|
|
2114
2107
|
// src/Table/TableColumnHeader.tsx
|
|
@@ -2116,7 +2109,7 @@ var import_react56 = __toESM(require("react"));
|
|
|
2116
2109
|
var import_focus13 = require("@react-aria/focus");
|
|
2117
2110
|
var import_interactions7 = require("@react-aria/interactions");
|
|
2118
2111
|
var import_table4 = require("@react-aria/table");
|
|
2119
|
-
var
|
|
2112
|
+
var import_utils17 = require("@react-aria/utils");
|
|
2120
2113
|
var import_system39 = require("@marigold/system");
|
|
2121
2114
|
var SortIndicator = ({
|
|
2122
2115
|
direction = "ascending",
|
|
@@ -2149,7 +2142,7 @@ var TableColumnHeader = ({ column }) => {
|
|
|
2149
2142
|
colSpan: column.colspan,
|
|
2150
2143
|
ref,
|
|
2151
2144
|
css: styles.header
|
|
2152
|
-
}, (0,
|
|
2145
|
+
}, (0, import_utils17.mergeProps)(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered, column.props.allowsSorting && /* @__PURE__ */ import_react56.default.createElement(SortIndicator, {
|
|
2153
2146
|
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
2154
2147
|
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
2155
2148
|
}));
|
|
@@ -2180,7 +2173,7 @@ var import_react59 = __toESM(require("react"));
|
|
|
2180
2173
|
var import_focus14 = require("@react-aria/focus");
|
|
2181
2174
|
var import_interactions8 = require("@react-aria/interactions");
|
|
2182
2175
|
var import_table7 = require("@react-aria/table");
|
|
2183
|
-
var
|
|
2176
|
+
var import_utils18 = require("@react-aria/utils");
|
|
2184
2177
|
var import_system40 = require("@marigold/system");
|
|
2185
2178
|
var TableRow = ({ children, row }) => {
|
|
2186
2179
|
const ref = (0, import_react59.useRef)(null);
|
|
@@ -2203,7 +2196,7 @@ var TableRow = ({ children, row }) => {
|
|
|
2203
2196
|
as: "tr",
|
|
2204
2197
|
ref,
|
|
2205
2198
|
css: styles.row
|
|
2206
|
-
}, (0,
|
|
2199
|
+
}, (0, import_utils18.mergeProps)(rowProps, focusProps, hoverProps)), stateProps), children);
|
|
2207
2200
|
};
|
|
2208
2201
|
|
|
2209
2202
|
// src/Table/TableSelectAllCell.tsx
|
|
@@ -2211,7 +2204,7 @@ var import_react60 = __toESM(require("react"));
|
|
|
2211
2204
|
var import_focus15 = require("@react-aria/focus");
|
|
2212
2205
|
var import_interactions9 = require("@react-aria/interactions");
|
|
2213
2206
|
var import_table8 = require("@react-aria/table");
|
|
2214
|
-
var
|
|
2207
|
+
var import_utils19 = require("@react-aria/utils");
|
|
2215
2208
|
var import_system41 = require("@marigold/system");
|
|
2216
2209
|
var TableSelectAllCell = ({ column }) => {
|
|
2217
2210
|
const ref = (0, import_react60.useRef)(null);
|
|
@@ -2235,7 +2228,7 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2235
2228
|
lineHeight: 1
|
|
2236
2229
|
},
|
|
2237
2230
|
css: styles.header
|
|
2238
|
-
}, (0,
|
|
2231
|
+
}, (0, import_utils19.mergeProps)(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */ import_react60.default.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2239
2232
|
};
|
|
2240
2233
|
|
|
2241
2234
|
// src/Table/Table.tsx
|
|
@@ -2335,11 +2328,12 @@ var Text = (_a) => {
|
|
|
2335
2328
|
|
|
2336
2329
|
// src/TextArea/TextArea.tsx
|
|
2337
2330
|
var import_react63 = __toESM(require("react"));
|
|
2338
|
-
var import_textfield = require("@react-aria/textfield");
|
|
2339
|
-
var import_system45 = require("@marigold/system");
|
|
2340
2331
|
var import_interactions10 = require("@react-aria/interactions");
|
|
2341
2332
|
var import_focus16 = require("@react-aria/focus");
|
|
2342
|
-
var
|
|
2333
|
+
var import_textfield = require("@react-aria/textfield");
|
|
2334
|
+
var import_utils21 = require("@react-aria/utils");
|
|
2335
|
+
var import_system45 = require("@marigold/system");
|
|
2336
|
+
var TextArea = (0, import_react63.forwardRef)((_a, ref) => {
|
|
2343
2337
|
var _b = _a, {
|
|
2344
2338
|
variant,
|
|
2345
2339
|
size,
|
|
@@ -2360,14 +2354,14 @@ var TextArea = (_a) => {
|
|
|
2360
2354
|
"rows"
|
|
2361
2355
|
]);
|
|
2362
2356
|
const { label, description, errorMessage } = props;
|
|
2363
|
-
const
|
|
2357
|
+
const textAreaRef = (0, import_utils21.useObjectRef)(ref);
|
|
2364
2358
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield.useTextField)(__spreadValues({
|
|
2365
2359
|
inputElementType: "textarea",
|
|
2366
2360
|
isDisabled: disabled,
|
|
2367
2361
|
isRequired: required,
|
|
2368
2362
|
isReadOnly: readOnly,
|
|
2369
2363
|
validationState: error ? "invalid" : "valid"
|
|
2370
|
-
}, props),
|
|
2364
|
+
}, props), textAreaRef);
|
|
2371
2365
|
const { hoverProps, isHovered } = (0, import_interactions10.useHover)({});
|
|
2372
2366
|
const { focusProps, isFocusVisible } = (0, import_focus16.useFocusRing)();
|
|
2373
2367
|
const stateProps = (0, import_system45.useStateProps)({
|
|
@@ -2394,43 +2388,28 @@ var TextArea = (_a) => {
|
|
|
2394
2388
|
}, /* @__PURE__ */ import_react63.default.createElement(import_system45.Box, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2395
2389
|
as: "textarea",
|
|
2396
2390
|
css: styles,
|
|
2397
|
-
ref,
|
|
2391
|
+
ref: textAreaRef,
|
|
2398
2392
|
rows
|
|
2399
2393
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
2400
|
-
};
|
|
2394
|
+
});
|
|
2401
2395
|
|
|
2402
2396
|
// src/TextField/TextField.tsx
|
|
2403
2397
|
var import_react64 = __toESM(require("react"));
|
|
2404
2398
|
var import_interactions11 = require("@react-aria/interactions");
|
|
2405
2399
|
var import_focus17 = require("@react-aria/focus");
|
|
2406
2400
|
var import_textfield2 = require("@react-aria/textfield");
|
|
2401
|
+
var import_utils22 = require("@react-aria/utils");
|
|
2407
2402
|
var import_system46 = require("@marigold/system");
|
|
2408
|
-
var TextField = (_a) => {
|
|
2409
|
-
var _b = _a, {
|
|
2410
|
-
variant,
|
|
2411
|
-
size,
|
|
2412
|
-
width,
|
|
2413
|
-
disabled,
|
|
2414
|
-
required,
|
|
2415
|
-
readOnly,
|
|
2416
|
-
error
|
|
2417
|
-
} = _b, props = __objRest(_b, [
|
|
2418
|
-
"variant",
|
|
2419
|
-
"size",
|
|
2420
|
-
"width",
|
|
2421
|
-
"disabled",
|
|
2422
|
-
"required",
|
|
2423
|
-
"readOnly",
|
|
2424
|
-
"error"
|
|
2425
|
-
]);
|
|
2403
|
+
var TextField = (0, import_react64.forwardRef)((_a, ref) => {
|
|
2404
|
+
var _b = _a, { variant, size, width, disabled, required, readOnly, error } = _b, props = __objRest(_b, ["variant", "size", "width", "disabled", "required", "readOnly", "error"]);
|
|
2426
2405
|
const { label, description, errorMessage, autoFocus } = props;
|
|
2427
|
-
const
|
|
2406
|
+
const inputRef = (0, import_utils22.useObjectRef)(ref);
|
|
2428
2407
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield2.useTextField)(__spreadValues({
|
|
2429
2408
|
isDisabled: disabled,
|
|
2430
2409
|
isRequired: required,
|
|
2431
2410
|
isReadOnly: readOnly,
|
|
2432
2411
|
validationState: error ? "invalid" : "valid"
|
|
2433
|
-
}, props),
|
|
2412
|
+
}, props), inputRef);
|
|
2434
2413
|
const { hoverProps, isHovered } = (0, import_interactions11.useHover)({});
|
|
2435
2414
|
const { focusProps, isFocusVisible } = (0, import_focus17.useFocusRing)({
|
|
2436
2415
|
isTextInput: true,
|
|
@@ -2457,11 +2436,11 @@ var TextField = (_a) => {
|
|
|
2457
2436
|
size,
|
|
2458
2437
|
width
|
|
2459
2438
|
}, /* @__PURE__ */ import_react64.default.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2460
|
-
ref,
|
|
2439
|
+
ref: inputRef,
|
|
2461
2440
|
variant,
|
|
2462
2441
|
size
|
|
2463
2442
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
2464
|
-
};
|
|
2443
|
+
});
|
|
2465
2444
|
|
|
2466
2445
|
// src/Tiles/Tiles.tsx
|
|
2467
2446
|
var import_react65 = __toESM(require("react"));
|