@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.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,7 +1857,7 @@ var Slider = (_a) => {
|
|
|
1860
1857
|
disabled: props.disabled,
|
|
1861
1858
|
styles: styles.thumb
|
|
1862
1859
|
})));
|
|
1863
|
-
};
|
|
1860
|
+
});
|
|
1864
1861
|
|
|
1865
1862
|
// src/Split/Split.tsx
|
|
1866
1863
|
import React45 from "react";
|
|
@@ -1910,15 +1907,16 @@ var Stack = (_a) => {
|
|
|
1910
1907
|
};
|
|
1911
1908
|
|
|
1912
1909
|
// src/Switch/Switch.tsx
|
|
1913
|
-
import React47, {
|
|
1910
|
+
import React47, { forwardRef as forwardRef11 } from "react";
|
|
1914
1911
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
1915
1912
|
import { useSwitch } from "@react-aria/switch";
|
|
1913
|
+
import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
1916
1914
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
1917
1915
|
import {
|
|
1918
1916
|
useComponentStyles as useComponentStyles26,
|
|
1919
1917
|
useStateProps as useStateProps10
|
|
1920
1918
|
} from "@marigold/system";
|
|
1921
|
-
var Switch = (_a) => {
|
|
1919
|
+
var Switch = forwardRef11((_a, ref) => {
|
|
1922
1920
|
var _b = _a, {
|
|
1923
1921
|
variant,
|
|
1924
1922
|
size,
|
|
@@ -1936,7 +1934,7 @@ var Switch = (_a) => {
|
|
|
1936
1934
|
"readOnly",
|
|
1937
1935
|
"defaultChecked"
|
|
1938
1936
|
]);
|
|
1939
|
-
const
|
|
1937
|
+
const inputRef = useObjectRef8(ref);
|
|
1940
1938
|
const props = __spreadValues({
|
|
1941
1939
|
isSelected: checked,
|
|
1942
1940
|
isDisabled: disabled,
|
|
@@ -1944,7 +1942,7 @@ var Switch = (_a) => {
|
|
|
1944
1942
|
defaultSelected: defaultChecked
|
|
1945
1943
|
}, rest);
|
|
1946
1944
|
const state = useToggleState2(props);
|
|
1947
|
-
const { inputProps } = useSwitch(props, state,
|
|
1945
|
+
const { inputProps } = useSwitch(props, state, inputRef);
|
|
1948
1946
|
const { isFocusVisible, focusProps } = useFocusRing8();
|
|
1949
1947
|
const stateProps = useStateProps10({
|
|
1950
1948
|
checked: state.isSelected,
|
|
@@ -1966,7 +1964,7 @@ var Switch = (_a) => {
|
|
|
1966
1964
|
css: styles.container
|
|
1967
1965
|
}, /* @__PURE__ */ React47.createElement(Box, __spreadValues(__spreadValues({
|
|
1968
1966
|
as: "input",
|
|
1969
|
-
ref,
|
|
1967
|
+
ref: inputRef,
|
|
1970
1968
|
css: {
|
|
1971
1969
|
position: "absolute",
|
|
1972
1970
|
width: "100%",
|
|
@@ -2007,10 +2005,10 @@ var Switch = (_a) => {
|
|
|
2007
2005
|
},
|
|
2008
2006
|
css: styles.thumb
|
|
2009
2007
|
}, stateProps))));
|
|
2010
|
-
};
|
|
2008
|
+
});
|
|
2011
2009
|
|
|
2012
2010
|
// src/Table/Table.tsx
|
|
2013
|
-
import React56, { useRef as
|
|
2011
|
+
import React56, { useRef as useRef18 } from "react";
|
|
2014
2012
|
import { useTable } from "@react-aria/table";
|
|
2015
2013
|
import {
|
|
2016
2014
|
Cell,
|
|
@@ -2039,13 +2037,13 @@ var TableBody = ({ children }) => {
|
|
|
2039
2037
|
};
|
|
2040
2038
|
|
|
2041
2039
|
// src/Table/TableCell.tsx
|
|
2042
|
-
import React49, { useRef as
|
|
2040
|
+
import React49, { useRef as useRef12 } from "react";
|
|
2043
2041
|
import { useTableCell } from "@react-aria/table";
|
|
2044
2042
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2045
2043
|
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
2046
2044
|
import { Box as Box26, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2047
2045
|
var TableCell = ({ cell }) => {
|
|
2048
|
-
const ref =
|
|
2046
|
+
const ref = useRef12(null);
|
|
2049
2047
|
const { state, styles } = useTableContext();
|
|
2050
2048
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2051
2049
|
const { gridCellProps } = useTableCell({
|
|
@@ -2061,7 +2059,7 @@ var TableCell = ({ cell }) => {
|
|
|
2061
2059
|
};
|
|
2062
2060
|
|
|
2063
2061
|
// src/Table/TableCheckboxCell.tsx
|
|
2064
|
-
import React50, { useRef as
|
|
2062
|
+
import React50, { useRef as useRef13 } from "react";
|
|
2065
2063
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
2066
2064
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2067
2065
|
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
@@ -2093,7 +2091,7 @@ var mapCheckboxProps = (_a) => {
|
|
|
2093
2091
|
|
|
2094
2092
|
// src/Table/TableCheckboxCell.tsx
|
|
2095
2093
|
var TableCheckboxCell = ({ cell }) => {
|
|
2096
|
-
const ref =
|
|
2094
|
+
const ref = useRef13(null);
|
|
2097
2095
|
const { state, styles } = useTableContext();
|
|
2098
2096
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2099
2097
|
const { gridCellProps } = useTableCell2({
|
|
@@ -2115,7 +2113,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2115
2113
|
};
|
|
2116
2114
|
|
|
2117
2115
|
// src/Table/TableColumnHeader.tsx
|
|
2118
|
-
import React51, { useRef as
|
|
2116
|
+
import React51, { useRef as useRef14 } from "react";
|
|
2119
2117
|
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
2120
2118
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
2121
2119
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
@@ -2136,7 +2134,7 @@ var SortIndicator = ({
|
|
|
2136
2134
|
}, direction === "ascending" ? "\u25B2" : "\u25BC");
|
|
2137
2135
|
var TableColumnHeader = ({ column }) => {
|
|
2138
2136
|
var _a, _b;
|
|
2139
|
-
const ref =
|
|
2137
|
+
const ref = useRef14(null);
|
|
2140
2138
|
const { state, styles } = useTableContext();
|
|
2141
2139
|
const { columnHeaderProps } = useTableColumnHeader({
|
|
2142
2140
|
node: column
|
|
@@ -2167,11 +2165,11 @@ var TableHeader = ({ children }) => {
|
|
|
2167
2165
|
};
|
|
2168
2166
|
|
|
2169
2167
|
// src/Table/TableHeaderRow.tsx
|
|
2170
|
-
import React53, { useRef as
|
|
2168
|
+
import React53, { useRef as useRef15 } from "react";
|
|
2171
2169
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
2172
2170
|
var TableHeaderRow = ({ item, children }) => {
|
|
2173
2171
|
const { state } = useTableContext();
|
|
2174
|
-
const ref =
|
|
2172
|
+
const ref = useRef15(null);
|
|
2175
2173
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
2176
2174
|
return /* @__PURE__ */ React53.createElement("tr", __spreadProps(__spreadValues({}, rowProps), {
|
|
2177
2175
|
ref
|
|
@@ -2179,14 +2177,14 @@ var TableHeaderRow = ({ item, children }) => {
|
|
|
2179
2177
|
};
|
|
2180
2178
|
|
|
2181
2179
|
// src/Table/TableRow.tsx
|
|
2182
|
-
import React54, { useRef as
|
|
2180
|
+
import React54, { useRef as useRef16 } from "react";
|
|
2183
2181
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
2184
2182
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2185
2183
|
import { useTableRow } from "@react-aria/table";
|
|
2186
2184
|
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
2187
2185
|
import { Box as Box29, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2188
2186
|
var TableRow = ({ children, row }) => {
|
|
2189
|
-
const ref =
|
|
2187
|
+
const ref = useRef16(null);
|
|
2190
2188
|
const { state, styles } = useTableContext();
|
|
2191
2189
|
const { rowProps, isPressed } = useTableRow({
|
|
2192
2190
|
node: row
|
|
@@ -2210,7 +2208,7 @@ var TableRow = ({ children, row }) => {
|
|
|
2210
2208
|
};
|
|
2211
2209
|
|
|
2212
2210
|
// src/Table/TableSelectAllCell.tsx
|
|
2213
|
-
import React55, { useRef as
|
|
2211
|
+
import React55, { useRef as useRef17 } from "react";
|
|
2214
2212
|
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
2215
2213
|
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2216
2214
|
import {
|
|
@@ -2220,7 +2218,7 @@ import {
|
|
|
2220
2218
|
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2221
2219
|
import { Box as Box30, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2222
2220
|
var TableSelectAllCell = ({ column }) => {
|
|
2223
|
-
const ref =
|
|
2221
|
+
const ref = useRef17(null);
|
|
2224
2222
|
const { state, styles } = useTableContext();
|
|
2225
2223
|
const { columnHeaderProps } = useTableColumnHeader2({
|
|
2226
2224
|
node: column
|
|
@@ -2255,7 +2253,7 @@ var Table = (_a) => {
|
|
|
2255
2253
|
"size",
|
|
2256
2254
|
"stretch"
|
|
2257
2255
|
]);
|
|
2258
|
-
const tableRef =
|
|
2256
|
+
const tableRef = useRef18(null);
|
|
2259
2257
|
const state = useTableState(__spreadProps(__spreadValues({}, props), {
|
|
2260
2258
|
showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
|
|
2261
2259
|
}));
|
|
@@ -2342,16 +2340,17 @@ var Text = (_a) => {
|
|
|
2342
2340
|
};
|
|
2343
2341
|
|
|
2344
2342
|
// src/TextArea/TextArea.tsx
|
|
2345
|
-
import React58, {
|
|
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";
|
|
2346
2346
|
import { useTextField } from "@react-aria/textfield";
|
|
2347
|
+
import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
|
|
2347
2348
|
import {
|
|
2348
2349
|
Box as Box33,
|
|
2349
2350
|
useComponentStyles as useComponentStyles29,
|
|
2350
2351
|
useStateProps as useStateProps16
|
|
2351
2352
|
} from "@marigold/system";
|
|
2352
|
-
|
|
2353
|
-
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
2354
|
-
var TextArea = (_a) => {
|
|
2353
|
+
var TextArea = forwardRef12((_a, ref) => {
|
|
2355
2354
|
var _b = _a, {
|
|
2356
2355
|
variant,
|
|
2357
2356
|
size,
|
|
@@ -2372,14 +2371,14 @@ var TextArea = (_a) => {
|
|
|
2372
2371
|
"rows"
|
|
2373
2372
|
]);
|
|
2374
2373
|
const { label, description, errorMessage } = props;
|
|
2375
|
-
const
|
|
2374
|
+
const textAreaRef = useObjectRef9(ref);
|
|
2376
2375
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(__spreadValues({
|
|
2377
2376
|
inputElementType: "textarea",
|
|
2378
2377
|
isDisabled: disabled,
|
|
2379
2378
|
isRequired: required,
|
|
2380
2379
|
isReadOnly: readOnly,
|
|
2381
2380
|
validationState: error ? "invalid" : "valid"
|
|
2382
|
-
}, props),
|
|
2381
|
+
}, props), textAreaRef);
|
|
2383
2382
|
const { hoverProps, isHovered } = useHover8({});
|
|
2384
2383
|
const { focusProps, isFocusVisible } = useFocusRing14();
|
|
2385
2384
|
const stateProps = useStateProps16({
|
|
@@ -2406,43 +2405,28 @@ var TextArea = (_a) => {
|
|
|
2406
2405
|
}, /* @__PURE__ */ React58.createElement(Box33, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2407
2406
|
as: "textarea",
|
|
2408
2407
|
css: styles,
|
|
2409
|
-
ref,
|
|
2408
|
+
ref: textAreaRef,
|
|
2410
2409
|
rows
|
|
2411
2410
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
2412
|
-
};
|
|
2411
|
+
});
|
|
2413
2412
|
|
|
2414
2413
|
// src/TextField/TextField.tsx
|
|
2415
|
-
import React59, {
|
|
2414
|
+
import React59, { forwardRef as forwardRef13 } from "react";
|
|
2416
2415
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
2417
2416
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
2418
2417
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
2418
|
+
import { useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
2419
2419
|
import { useStateProps as useStateProps17 } from "@marigold/system";
|
|
2420
|
-
var TextField = (_a) => {
|
|
2421
|
-
var _b = _a, {
|
|
2422
|
-
variant,
|
|
2423
|
-
size,
|
|
2424
|
-
width,
|
|
2425
|
-
disabled,
|
|
2426
|
-
required,
|
|
2427
|
-
readOnly,
|
|
2428
|
-
error
|
|
2429
|
-
} = _b, props = __objRest(_b, [
|
|
2430
|
-
"variant",
|
|
2431
|
-
"size",
|
|
2432
|
-
"width",
|
|
2433
|
-
"disabled",
|
|
2434
|
-
"required",
|
|
2435
|
-
"readOnly",
|
|
2436
|
-
"error"
|
|
2437
|
-
]);
|
|
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"]);
|
|
2438
2422
|
const { label, description, errorMessage, autoFocus } = props;
|
|
2439
|
-
const
|
|
2423
|
+
const inputRef = useObjectRef10(ref);
|
|
2440
2424
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(__spreadValues({
|
|
2441
2425
|
isDisabled: disabled,
|
|
2442
2426
|
isRequired: required,
|
|
2443
2427
|
isReadOnly: readOnly,
|
|
2444
2428
|
validationState: error ? "invalid" : "valid"
|
|
2445
|
-
}, props),
|
|
2429
|
+
}, props), inputRef);
|
|
2446
2430
|
const { hoverProps, isHovered } = useHover9({});
|
|
2447
2431
|
const { focusProps, isFocusVisible } = useFocusRing15({
|
|
2448
2432
|
isTextInput: true,
|
|
@@ -2469,11 +2453,11 @@ var TextField = (_a) => {
|
|
|
2469
2453
|
size,
|
|
2470
2454
|
width
|
|
2471
2455
|
}, /* @__PURE__ */ React59.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2472
|
-
ref,
|
|
2456
|
+
ref: inputRef,
|
|
2473
2457
|
variant,
|
|
2474
2458
|
size
|
|
2475
2459
|
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
2476
|
-
};
|
|
2460
|
+
});
|
|
2477
2461
|
|
|
2478
2462
|
// src/Tiles/Tiles.tsx
|
|
2479
2463
|
import React60 from "react";
|
|
@@ -2503,7 +2487,7 @@ var TooltipContext = createContext7({});
|
|
|
2503
2487
|
var useTooltipContext = () => useContext7(TooltipContext);
|
|
2504
2488
|
|
|
2505
2489
|
// src/Tooltip/TooltipTrigger.tsx
|
|
2506
|
-
import React61, { useRef as
|
|
2490
|
+
import React61, { useRef as useRef19 } from "react";
|
|
2507
2491
|
import { FocusableProvider } from "@react-aria/focus";
|
|
2508
2492
|
import { useOverlayPosition as useOverlayPosition3 } from "@react-aria/overlays";
|
|
2509
2493
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
@@ -2529,8 +2513,8 @@ var TooltipTrigger = (_a) => {
|
|
|
2529
2513
|
delay,
|
|
2530
2514
|
placement
|
|
2531
2515
|
});
|
|
2532
|
-
const tooltipTriggerRef =
|
|
2533
|
-
const overlayRef =
|
|
2516
|
+
const tooltipTriggerRef = useRef19(null);
|
|
2517
|
+
const overlayRef = useRef19(null);
|
|
2534
2518
|
const state = useTooltipTriggerState(props);
|
|
2535
2519
|
const { triggerProps, tooltipProps } = useTooltipTrigger(props, state, tooltipTriggerRef);
|
|
2536
2520
|
const {
|