@sanity/ui 5.0.0-alpha.1 → 5.0.0-alpha.10
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/README.md +1 -1
- package/dist/cli/install.js +2 -1
- package/dist/index.d.ts +362 -76
- package/dist/index.js +420 -158
- package/dist/index.js.map +1 -1
- package/dist/polyfills.d.ts +1 -0
- package/dist/polyfills.js +5 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +9 -3
- package/src/cli/install.ts +2 -1
- package/src/components/badge/Badge.tsx +53 -0
- package/src/components/badge/badge.css +6 -0
- package/src/components/badge/badge.props.ts +31 -0
- package/src/components/box/Box.tsx +6 -1
- package/src/components/box/box.props.ts +7 -2
- package/src/components/button/button.props.ts +27 -9
- package/src/components/card/card.props.ts +6 -2
- package/src/components/checkbox/Checkbox.tsx +3 -2
- package/src/components/checkbox/checkbox.props.ts +11 -3
- package/src/components/code/code.props.ts +10 -3
- package/src/components/container/container.props.ts +6 -2
- package/src/components/dialog/Dialog.tsx +139 -0
- package/src/components/dialog/dialog.css +49 -0
- package/src/components/dialog/dialog.props.ts +45 -0
- package/src/components/eyebrow/Eyebrow.tsx +1 -1
- package/src/components/eyebrow/eyebrow.props.ts +6 -2
- package/src/components/flex/Flex.tsx +6 -1
- package/src/components/flex/flex.props.ts +6 -2
- package/src/components/grid/Grid.tsx +6 -1
- package/src/components/grid/grid.props.ts +6 -2
- package/src/components/h-stack/hStack.props.ts +3 -1
- package/src/components/heading/Heading.tsx +1 -1
- package/src/components/heading/heading.props.ts +8 -2
- package/src/components/icon/icon.props.ts +6 -2
- package/src/components/icon-button/iconButton.props.ts +7 -2
- package/src/components/index.css +3 -0
- package/src/components/indicator/indicator.props.ts +6 -2
- package/src/components/indicator-stack/indicatorStack.props.ts +3 -1
- package/src/components/inline/inline.props.ts +6 -2
- package/src/components/label/label.props.ts +7 -1
- package/src/components/link/link.props.ts +4 -4
- package/src/components/list/list.props.ts +27 -9
- package/src/components/popover/Popover.tsx +85 -0
- package/src/components/popover/popover.css +21 -0
- package/src/components/popover/popover.props.ts +38 -0
- package/src/components/press-area/pressArea.props.ts +3 -1
- package/src/components/radio/Radio.tsx +1 -1
- package/src/components/radio/radio.props.ts +7 -2
- package/src/components/skip-to-content/skipToContent.props.ts +9 -3
- package/src/components/spinner/Spinner.tsx +1 -1
- package/src/components/spinner/spinner.props.ts +3 -0
- package/src/components/switch/Switch.tsx +1 -1
- package/src/components/switch/switch.props.ts +7 -2
- package/src/components/text/Text.tsx +1 -1
- package/src/components/text/text.props.ts +6 -2
- package/src/components/tooltip/Tooltip.tsx +59 -55
- package/src/components/tooltip/tooltip.css +19 -40
- package/src/components/tooltip/tooltip.props.ts +24 -8
- package/src/components/tooltip-group/TooltipGroup.tsx +2 -5
- package/src/components/tooltip-group/tooltipGroup.props.ts +3 -1
- package/src/components/v-stack/vStack.props.ts +3 -1
- package/src/components/visually-hidden/visuallyHidden.props.ts +6 -2
- package/src/css/classes/generic/display.css +8 -8
- package/src/css/classes/generic/placement.css +31 -0
- package/src/css/classes/local/animation.css +4 -0
- package/src/css/classes/local/index.css +2 -0
- package/src/css/classes/local/top-anchor.css +4 -0
- package/src/css/global/reset.css +20 -18
- package/src/css/tokens/semantic.css +4 -0
- package/src/hooks/useIsClient.ts +10 -0
- package/src/index.ts +5 -0
- package/src/polyfills.ts +15 -0
- package/src/utils/mergeTriggerProps.ts +66 -0
- package/src/utils/renderPortal.tsx +14 -0
- package/src/version.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import clsx from "clsx";
|
|
5
|
-
import { isValidElement, useRef, useEffect, lazy, Suspense, Children,
|
|
6
|
-
import { SpinnerIcon
|
|
5
|
+
import { isValidElement, useRef, useEffect, lazy, Suspense, useId, Children, useSyncExternalStore, useState, cloneElement, Activity } from "react";
|
|
6
|
+
import { SpinnerIcon } from "@sanity/icons/Spinner";
|
|
7
|
+
import { CheckmarkIcon } from "@sanity/icons/Checkmark";
|
|
8
|
+
import { RemoveIcon } from "@sanity/icons/Remove";
|
|
9
|
+
import { CloseIcon } from "@sanity/icons/Close";
|
|
10
|
+
import { createPortal } from "react-dom";
|
|
7
11
|
const PREFIX = "sui", BREAKPOINTS_LENGTH = 6;
|
|
8
12
|
function getProps(componentProps, propDefs) {
|
|
9
13
|
const {
|
|
@@ -95,7 +99,7 @@ function getCompositeValue(propValue, propDef, key) {
|
|
|
95
99
|
compositeValue = mapping?.[propValue];
|
|
96
100
|
return compositeValue;
|
|
97
101
|
}
|
|
98
|
-
const HASH = "
|
|
102
|
+
const HASH = "ad9fa1";
|
|
99
103
|
function suffixClassName(className) {
|
|
100
104
|
return `${className}-${HASH}`;
|
|
101
105
|
}
|
|
@@ -376,18 +380,22 @@ function Box(t0) {
|
|
|
376
380
|
if ($[0] !== t0) {
|
|
377
381
|
const {
|
|
378
382
|
display: t22,
|
|
383
|
+
minHeight: t3,
|
|
384
|
+
minWidth: t4,
|
|
379
385
|
...props
|
|
380
|
-
} = t0, display = t22 === void 0 ? "block" : t22, {
|
|
386
|
+
} = t0, display = t22 === void 0 ? "block" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
|
|
381
387
|
as,
|
|
382
|
-
children:
|
|
388
|
+
children: t5,
|
|
383
389
|
className,
|
|
384
|
-
style:
|
|
385
|
-
...
|
|
390
|
+
style: t6,
|
|
391
|
+
...t7
|
|
386
392
|
} = getProps({
|
|
387
393
|
display,
|
|
394
|
+
minHeight,
|
|
395
|
+
minWidth,
|
|
388
396
|
...props
|
|
389
397
|
}, boxProps);
|
|
390
|
-
children =
|
|
398
|
+
children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(boxClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
|
|
391
399
|
} else
|
|
392
400
|
T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
|
|
393
401
|
let t2;
|
|
@@ -449,18 +457,22 @@ function Flex(t0) {
|
|
|
449
457
|
if ($[0] !== t0) {
|
|
450
458
|
const {
|
|
451
459
|
display: t22,
|
|
460
|
+
minHeight: t3,
|
|
461
|
+
minWidth: t4,
|
|
452
462
|
...props
|
|
453
|
-
} = t0, display = t22 === void 0 ? "flex" : t22, {
|
|
463
|
+
} = t0, display = t22 === void 0 ? "flex" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
|
|
454
464
|
as,
|
|
455
|
-
children:
|
|
465
|
+
children: t5,
|
|
456
466
|
className,
|
|
457
|
-
style:
|
|
458
|
-
...
|
|
467
|
+
style: t6,
|
|
468
|
+
...t7
|
|
459
469
|
} = getProps({
|
|
460
470
|
display,
|
|
471
|
+
minHeight,
|
|
472
|
+
minWidth,
|
|
461
473
|
...props
|
|
462
474
|
}, flexProps);
|
|
463
|
-
children =
|
|
475
|
+
children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(flexClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
|
|
464
476
|
} else
|
|
465
477
|
T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
|
|
466
478
|
let t2;
|
|
@@ -604,7 +616,7 @@ function Text(t0) {
|
|
|
604
616
|
$[7] !== t8 ? (t9 = clsx("sui-overflow-hidden", t8), $[7] = t8, $[8] = t9) : t9 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t7, style, "data-ui": "Text", ...rest, children: /* @__PURE__ */ jsx("span", { className: t9, children }) });
|
|
605
617
|
break bb0;
|
|
606
618
|
}
|
|
607
|
-
T0 = Component, t1 = clsx(textClassName, "sui-overflow-hidden", className);
|
|
619
|
+
T0 = Component, t1 = clsx(textClassName, props.truncate && "sui-overflow-hidden", className);
|
|
608
620
|
}
|
|
609
621
|
$[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
|
|
610
622
|
} else
|
|
@@ -858,7 +870,7 @@ function Checkbox(props) {
|
|
|
858
870
|
useEffect(() => {
|
|
859
871
|
inputRef.current && (inputRef.current.indeterminate = indeterminate);
|
|
860
872
|
}, [indeterminate]);
|
|
861
|
-
const t0 = clsx(checkboxClassName, className), T0 = Box, t1 = "span", t2 = clsx(checkboxMarkClassName, error && "sui-error");
|
|
873
|
+
const t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t1 = "span", t2 = clsx(checkboxMarkClassName, error && "sui-error");
|
|
862
874
|
let t3;
|
|
863
875
|
$[0] !== indeterminate ? (t3 = indeterminate ? /* @__PURE__ */ jsx(RemoveIcon, {}) : /* @__PURE__ */ jsx(CheckmarkIcon, {}), $[0] = indeterminate, $[1] = t3) : t3 = $[1];
|
|
864
876
|
let t4;
|
|
@@ -962,6 +974,181 @@ function Container(t0) {
|
|
|
962
974
|
let t2;
|
|
963
975
|
return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Container", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
|
|
964
976
|
}
|
|
977
|
+
const HEADING_TAG = ["h1", "h2", "h3", "h4", "h5", "h6"], HEADING_SIZE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], headingProps = {
|
|
978
|
+
as: {
|
|
979
|
+
type: "union",
|
|
980
|
+
values: HEADING_TAG
|
|
981
|
+
},
|
|
982
|
+
size: {
|
|
983
|
+
type: "union",
|
|
984
|
+
className: "text-heading",
|
|
985
|
+
values: HEADING_SIZE
|
|
986
|
+
},
|
|
987
|
+
...typographyProps
|
|
988
|
+
}, headingClassName = suffixClassName("sui-Heading");
|
|
989
|
+
function Heading(t0) {
|
|
990
|
+
const $ = c(15);
|
|
991
|
+
let T0, children, rest, style, t1, t2;
|
|
992
|
+
if ($[0] !== t0) {
|
|
993
|
+
t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
994
|
+
bb0: {
|
|
995
|
+
const {
|
|
996
|
+
size: t32,
|
|
997
|
+
weight: t4,
|
|
998
|
+
...props
|
|
999
|
+
} = t0, size = t32 === void 0 ? 2 : t32, weight = t4 === void 0 ? "bold" : t4, {
|
|
1000
|
+
as,
|
|
1001
|
+
children: t5,
|
|
1002
|
+
className,
|
|
1003
|
+
style: t6,
|
|
1004
|
+
...t7
|
|
1005
|
+
} = getProps({
|
|
1006
|
+
size,
|
|
1007
|
+
weight,
|
|
1008
|
+
...props
|
|
1009
|
+
}, headingProps);
|
|
1010
|
+
children = t5, style = t6, rest = t7;
|
|
1011
|
+
const Component = as || "h2";
|
|
1012
|
+
if (props.truncate && props.trim) {
|
|
1013
|
+
const t8 = clsx(headingClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
|
|
1014
|
+
let t10;
|
|
1015
|
+
$[7] !== t9 ? (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10) : t10 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t8, style, "data-ui": "Heading", ...rest, children: /* @__PURE__ */ jsx("span", { className: t10, children }) });
|
|
1016
|
+
break bb0;
|
|
1017
|
+
}
|
|
1018
|
+
T0 = Component, t1 = clsx(headingClassName, props.truncate && "sui-overflow-hidden", className);
|
|
1019
|
+
}
|
|
1020
|
+
$[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
|
|
1021
|
+
} else
|
|
1022
|
+
T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
|
|
1023
|
+
if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
1024
|
+
return t2;
|
|
1025
|
+
let t3;
|
|
1026
|
+
return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Heading", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
|
|
1027
|
+
}
|
|
1028
|
+
const iconButtonProps = {
|
|
1029
|
+
"aria-label": {
|
|
1030
|
+
type: "string"
|
|
1031
|
+
},
|
|
1032
|
+
as: buttonProps.as,
|
|
1033
|
+
icon: {
|
|
1034
|
+
type: "string"
|
|
1035
|
+
}
|
|
1036
|
+
}, iconButtonClassName = suffixClassName("sui-IconButton");
|
|
1037
|
+
function IconButton(props) {
|
|
1038
|
+
const $ = c(16);
|
|
1039
|
+
let IconProp, T0, rest, style, t0, t1;
|
|
1040
|
+
if ($[0] !== props) {
|
|
1041
|
+
const {
|
|
1042
|
+
as,
|
|
1043
|
+
className,
|
|
1044
|
+
style: t22,
|
|
1045
|
+
icon: t32,
|
|
1046
|
+
...t4
|
|
1047
|
+
} = getProps(props, iconButtonProps);
|
|
1048
|
+
style = t22, IconProp = t32, rest = t4;
|
|
1049
|
+
const Component = as || "button";
|
|
1050
|
+
T0 = Button, t0 = Component, t1 = clsx(iconButtonClassName, className), $[0] = props, $[1] = IconProp, $[2] = T0, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
|
|
1051
|
+
} else
|
|
1052
|
+
IconProp = $[1], T0 = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
|
|
1053
|
+
let t2;
|
|
1054
|
+
$[7] !== IconProp ? (t2 = /* @__PURE__ */ jsx(Icon, { icon: IconProp, margin: -2, size: 1 }), $[7] = IconProp, $[8] = t2) : t2 = $[8];
|
|
1055
|
+
let t3;
|
|
1056
|
+
return $[9] !== T0 || $[10] !== rest || $[11] !== style || $[12] !== t0 || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "IconButton", ...rest, children: t2 }), $[9] = T0, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
|
|
1057
|
+
}
|
|
1058
|
+
const dialogProps = {
|
|
1059
|
+
header: {
|
|
1060
|
+
type: "string"
|
|
1061
|
+
},
|
|
1062
|
+
open: {
|
|
1063
|
+
type: "boolean"
|
|
1064
|
+
},
|
|
1065
|
+
size: {
|
|
1066
|
+
type: "union",
|
|
1067
|
+
className: "container",
|
|
1068
|
+
values: CONTAINER_SIZE
|
|
1069
|
+
},
|
|
1070
|
+
topAnchor: {
|
|
1071
|
+
type: "string",
|
|
1072
|
+
className: "top-anchor",
|
|
1073
|
+
variable: "--top-anchor"
|
|
1074
|
+
}
|
|
1075
|
+
}, dialogClassName = suffixClassName("sui-Dialog"), dialogContentClassName = suffixClassName("sui-DialogContent"), dialogFooterClassName = suffixClassName("sui-DialogFooter");
|
|
1076
|
+
function DialogRoot(t0) {
|
|
1077
|
+
const $ = c(17), {
|
|
1078
|
+
open: t1,
|
|
1079
|
+
size: t2,
|
|
1080
|
+
...props
|
|
1081
|
+
} = t0, open = t1 === void 0 ? !1 : t1, size = t2 === void 0 ? 0 : t2, {
|
|
1082
|
+
children,
|
|
1083
|
+
className,
|
|
1084
|
+
style,
|
|
1085
|
+
header,
|
|
1086
|
+
onClose,
|
|
1087
|
+
...rest
|
|
1088
|
+
} = getProps({
|
|
1089
|
+
size,
|
|
1090
|
+
...props
|
|
1091
|
+
}, dialogProps), dialogRef = useRef(null), headerId = useId(), dialogClasses = clsx(dialogClassName, `${props.topAnchor ? "sui-mx-auto" : "sui-m-auto"} sui-radius5 sui-shadow3 sui-p4 sui-flex-direction-column sui-gap4 sui-overflow-y-auto`);
|
|
1092
|
+
let t3, t4;
|
|
1093
|
+
$[0] !== open ? (t3 = () => {
|
|
1094
|
+
const dialogElement = dialogRef.current;
|
|
1095
|
+
if (dialogElement)
|
|
1096
|
+
return open ? dialogElement.open || dialogElement.showModal() : dialogElement.open && dialogElement.close(), () => {
|
|
1097
|
+
dialogElement.close();
|
|
1098
|
+
};
|
|
1099
|
+
}, t4 = [open], $[0] = open, $[1] = t3, $[2] = t4) : (t3 = $[1], t4 = $[2]), useEffect(t3, t4);
|
|
1100
|
+
const t5 = "any", t6 = header ? headerId : void 0, t7 = clsx(dialogClasses, className);
|
|
1101
|
+
let t8;
|
|
1102
|
+
$[3] !== header || $[4] !== headerId ? (t8 = header ? /* @__PURE__ */ jsx(Heading, { trim: !0, size: 1, id: headerId, children: header }) : /* @__PURE__ */ jsx("div", {}), $[3] = header, $[4] = headerId, $[5] = t8) : t8 = $[5];
|
|
1103
|
+
let t9;
|
|
1104
|
+
$[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx(IconButton, { "aria-label": "Close", level: "tertiary", icon: CloseIcon, onClick: () => dialogRef.current?.close() }), $[6] = t9) : t9 = $[6];
|
|
1105
|
+
let t10;
|
|
1106
|
+
$[7] !== t8 ? (t10 = /* @__PURE__ */ jsxs(Flex, { flexShrink: 0, justifyContent: "space-between", alignItems: "center", children: [
|
|
1107
|
+
t8,
|
|
1108
|
+
t9
|
|
1109
|
+
] }), $[7] = t8, $[8] = t10) : t10 = $[8];
|
|
1110
|
+
let t11;
|
|
1111
|
+
return $[9] !== children || $[10] !== onClose || $[11] !== rest || $[12] !== style || $[13] !== t10 || $[14] !== t6 || $[15] !== t7 ? (t11 = /* @__PURE__ */ jsxs("dialog", { ...rest, ref: dialogRef, closedby: t5, "aria-labelledby": t6, onClose, className: t7, style, "data-ui": "Dialog", children: [
|
|
1112
|
+
t10,
|
|
1113
|
+
children
|
|
1114
|
+
] }), $[9] = children, $[10] = onClose, $[11] = rest, $[12] = style, $[13] = t10, $[14] = t6, $[15] = t7, $[16] = t11) : t11 = $[16], t11;
|
|
1115
|
+
}
|
|
1116
|
+
function DialogContent(props) {
|
|
1117
|
+
const $ = c(12);
|
|
1118
|
+
let T0, children, style, t0, t1;
|
|
1119
|
+
if ($[0] !== props) {
|
|
1120
|
+
const {
|
|
1121
|
+
children: t22,
|
|
1122
|
+
className,
|
|
1123
|
+
style: t3,
|
|
1124
|
+
...rest
|
|
1125
|
+
} = getProps(props, {});
|
|
1126
|
+
children = t22, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogContentClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
|
|
1127
|
+
} else
|
|
1128
|
+
T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
|
|
1129
|
+
let t2;
|
|
1130
|
+
return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { ...t0, className: t1, style, "data-ui": "DialogContent", flexGrow: 1, overflowY: "auto", children }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
|
|
1131
|
+
}
|
|
1132
|
+
function DialogFooter(props) {
|
|
1133
|
+
const $ = c(12);
|
|
1134
|
+
let T0, children, style, t0, t1;
|
|
1135
|
+
if ($[0] !== props) {
|
|
1136
|
+
const {
|
|
1137
|
+
children: t22,
|
|
1138
|
+
className,
|
|
1139
|
+
style: t3,
|
|
1140
|
+
...rest
|
|
1141
|
+
} = getProps(props, {});
|
|
1142
|
+
children = t22, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogFooterClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
|
|
1143
|
+
} else
|
|
1144
|
+
T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
|
|
1145
|
+
let t2;
|
|
1146
|
+
return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { ...t0, className: t1, style, "data-ui": "DialogFooter", flexShrink: 0, children }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
|
|
1147
|
+
}
|
|
1148
|
+
DialogRoot.displayName = "Dialog";
|
|
1149
|
+
const Dialog = DialogRoot;
|
|
1150
|
+
DialogRoot.Content = DialogContent;
|
|
1151
|
+
DialogRoot.Footer = DialogFooter;
|
|
965
1152
|
const dividerProps = {
|
|
966
1153
|
...marginProps
|
|
967
1154
|
}, dividerClassName = suffixClassName("sui-Divider");
|
|
@@ -1020,7 +1207,7 @@ function Eyebrow(t0) {
|
|
|
1020
1207
|
$[7] !== t9 ? (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10) : t10 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t8, style, "data-ui": "Eyebrow", ...rest, children: /* @__PURE__ */ jsx("span", { className: t10, children }) });
|
|
1021
1208
|
break bb0;
|
|
1022
1209
|
}
|
|
1023
|
-
T0 = Component, t1 = clsx(eyebrowClassName, "sui-overflow-hidden", className);
|
|
1210
|
+
T0 = Component, t1 = clsx(eyebrowClassName, props.truncate && "sui-overflow-hidden", className);
|
|
1024
1211
|
}
|
|
1025
1212
|
$[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
|
|
1026
1213
|
} else
|
|
@@ -1075,18 +1262,22 @@ function Grid(t0) {
|
|
|
1075
1262
|
if ($[0] !== t0) {
|
|
1076
1263
|
const {
|
|
1077
1264
|
display: t22,
|
|
1265
|
+
minHeight: t3,
|
|
1266
|
+
minWidth: t4,
|
|
1078
1267
|
...props
|
|
1079
|
-
} = t0, display = t22 === void 0 ? "grid" : t22, {
|
|
1268
|
+
} = t0, display = t22 === void 0 ? "grid" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
|
|
1080
1269
|
as,
|
|
1081
|
-
children:
|
|
1270
|
+
children: t5,
|
|
1082
1271
|
className,
|
|
1083
|
-
style:
|
|
1084
|
-
...
|
|
1272
|
+
style: t6,
|
|
1273
|
+
...t7
|
|
1085
1274
|
} = getProps({
|
|
1086
1275
|
display,
|
|
1276
|
+
minHeight,
|
|
1277
|
+
minWidth,
|
|
1087
1278
|
...props
|
|
1088
1279
|
}, gridProps);
|
|
1089
|
-
children =
|
|
1280
|
+
children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(gridClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
|
|
1090
1281
|
} else
|
|
1091
1282
|
T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
|
|
1092
1283
|
let t2;
|
|
@@ -1117,87 +1308,6 @@ function HStack(props) {
|
|
|
1117
1308
|
let t2;
|
|
1118
1309
|
return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "HStack", display: "inline-flex", alignItems: "center", flexWrap: "wrap", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
|
|
1119
1310
|
}
|
|
1120
|
-
const HEADING_TAG = ["h1", "h2", "h3", "h4", "h5", "h6"], HEADING_SIZE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], headingProps = {
|
|
1121
|
-
as: {
|
|
1122
|
-
type: "union",
|
|
1123
|
-
values: HEADING_TAG
|
|
1124
|
-
},
|
|
1125
|
-
size: {
|
|
1126
|
-
type: "union",
|
|
1127
|
-
className: "text-heading",
|
|
1128
|
-
values: HEADING_SIZE
|
|
1129
|
-
},
|
|
1130
|
-
...typographyProps
|
|
1131
|
-
}, headingClassName = suffixClassName("sui-Heading");
|
|
1132
|
-
function Heading(t0) {
|
|
1133
|
-
const $ = c(15);
|
|
1134
|
-
let T0, children, rest, style, t1, t2;
|
|
1135
|
-
if ($[0] !== t0) {
|
|
1136
|
-
t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
1137
|
-
bb0: {
|
|
1138
|
-
const {
|
|
1139
|
-
size: t32,
|
|
1140
|
-
weight: t4,
|
|
1141
|
-
...props
|
|
1142
|
-
} = t0, size = t32 === void 0 ? 2 : t32, weight = t4 === void 0 ? "bold" : t4, {
|
|
1143
|
-
as,
|
|
1144
|
-
children: t5,
|
|
1145
|
-
className,
|
|
1146
|
-
style: t6,
|
|
1147
|
-
...t7
|
|
1148
|
-
} = getProps({
|
|
1149
|
-
size,
|
|
1150
|
-
weight,
|
|
1151
|
-
...props
|
|
1152
|
-
}, headingProps);
|
|
1153
|
-
children = t5, style = t6, rest = t7;
|
|
1154
|
-
const Component = as || "h2";
|
|
1155
|
-
if (props.truncate && props.trim) {
|
|
1156
|
-
const t8 = clsx(headingClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
|
|
1157
|
-
let t10;
|
|
1158
|
-
$[7] !== t9 ? (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10) : t10 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t8, style, "data-ui": "Heading", ...rest, children: /* @__PURE__ */ jsx("span", { className: t10, children }) });
|
|
1159
|
-
break bb0;
|
|
1160
|
-
}
|
|
1161
|
-
T0 = Component, t1 = clsx(headingClassName, "sui-overflow-hidden", className);
|
|
1162
|
-
}
|
|
1163
|
-
$[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
|
|
1164
|
-
} else
|
|
1165
|
-
T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
|
|
1166
|
-
if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
1167
|
-
return t2;
|
|
1168
|
-
let t3;
|
|
1169
|
-
return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Heading", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
|
|
1170
|
-
}
|
|
1171
|
-
const iconButtonProps = {
|
|
1172
|
-
"aria-label": {
|
|
1173
|
-
type: "string"
|
|
1174
|
-
},
|
|
1175
|
-
as: buttonProps.as,
|
|
1176
|
-
icon: {
|
|
1177
|
-
type: "string"
|
|
1178
|
-
}
|
|
1179
|
-
}, iconButtonClassName = suffixClassName("sui-IconButton");
|
|
1180
|
-
function IconButton(props) {
|
|
1181
|
-
const $ = c(16);
|
|
1182
|
-
let IconProp, T0, rest, style, t0, t1;
|
|
1183
|
-
if ($[0] !== props) {
|
|
1184
|
-
const {
|
|
1185
|
-
as,
|
|
1186
|
-
className,
|
|
1187
|
-
style: t22,
|
|
1188
|
-
icon: t32,
|
|
1189
|
-
...t4
|
|
1190
|
-
} = getProps(props, iconButtonProps);
|
|
1191
|
-
style = t22, IconProp = t32, rest = t4;
|
|
1192
|
-
const Component = as || "button";
|
|
1193
|
-
T0 = Button, t0 = Component, t1 = clsx(iconButtonClassName, className), $[0] = props, $[1] = IconProp, $[2] = T0, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
|
|
1194
|
-
} else
|
|
1195
|
-
IconProp = $[1], T0 = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
|
|
1196
|
-
let t2;
|
|
1197
|
-
$[7] !== IconProp ? (t2 = /* @__PURE__ */ jsx(Icon, { icon: IconProp, margin: -2, size: 1 }), $[7] = IconProp, $[8] = t2) : t2 = $[8];
|
|
1198
|
-
let t3;
|
|
1199
|
-
return $[9] !== T0 || $[10] !== rest || $[11] !== style || $[12] !== t0 || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "IconButton", ...rest, children: t2 }), $[9] = T0, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
|
|
1200
|
-
}
|
|
1201
1311
|
const indicatorProps = {
|
|
1202
1312
|
as: {
|
|
1203
1313
|
type: "string"
|
|
@@ -1635,7 +1745,116 @@ ListRoot.Item = ListItem;
|
|
|
1635
1745
|
ListRoot.ButtonItem = ListButtonItem;
|
|
1636
1746
|
ListRoot.ItemText = ListItemText;
|
|
1637
1747
|
ListRoot.ItemImage = ListItemImage;
|
|
1638
|
-
|
|
1748
|
+
function useIsClient() {
|
|
1749
|
+
return useSyncExternalStore(_temp2, _temp3, _temp4);
|
|
1750
|
+
}
|
|
1751
|
+
function _temp4() {
|
|
1752
|
+
return !1;
|
|
1753
|
+
}
|
|
1754
|
+
function _temp3() {
|
|
1755
|
+
return !0;
|
|
1756
|
+
}
|
|
1757
|
+
function _temp2() {
|
|
1758
|
+
return _temp;
|
|
1759
|
+
}
|
|
1760
|
+
function _temp() {
|
|
1761
|
+
}
|
|
1762
|
+
function isReactEventHandler(key, value) {
|
|
1763
|
+
return /^on[A-Z]/.test(key) && typeof value == "function";
|
|
1764
|
+
}
|
|
1765
|
+
function chainEventHandlers(...handlers) {
|
|
1766
|
+
const defined = handlers.filter(Boolean);
|
|
1767
|
+
if (defined.length !== 0)
|
|
1768
|
+
return defined.length === 1 ? defined[0] : (e) => {
|
|
1769
|
+
for (const handler of defined)
|
|
1770
|
+
handler(e);
|
|
1771
|
+
};
|
|
1772
|
+
}
|
|
1773
|
+
function mergeTriggerProps(childProps, forwardedProps, ownProps) {
|
|
1774
|
+
const result = {};
|
|
1775
|
+
for (const source of [forwardedProps, ownProps])
|
|
1776
|
+
if (source) {
|
|
1777
|
+
for (const [key, value] of Object.entries(source))
|
|
1778
|
+
if (key !== "style") {
|
|
1779
|
+
if (isReactEventHandler(key, value)) {
|
|
1780
|
+
result[key] = chainEventHandlers(result[key], value);
|
|
1781
|
+
continue;
|
|
1782
|
+
}
|
|
1783
|
+
value !== void 0 && (result[key] = value);
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
result.style = {
|
|
1787
|
+
...childProps.style,
|
|
1788
|
+
...forwardedProps?.style,
|
|
1789
|
+
...ownProps?.style
|
|
1790
|
+
};
|
|
1791
|
+
for (const [key, value] of Object.entries(childProps))
|
|
1792
|
+
isReactEventHandler(key, value) && (result[key] = chainEventHandlers(result[key], value));
|
|
1793
|
+
return result;
|
|
1794
|
+
}
|
|
1795
|
+
function renderPortal(node, mounted, portal) {
|
|
1796
|
+
return portal ? mounted ? createPortal(node, document.body) : null : node;
|
|
1797
|
+
}
|
|
1798
|
+
const PLACEMENT = ["top", "top-start", "top-end", "right", "right-start", "right-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end"], placementProps = {
|
|
1799
|
+
placement: {
|
|
1800
|
+
type: "union",
|
|
1801
|
+
className: "placement",
|
|
1802
|
+
values: PLACEMENT
|
|
1803
|
+
}
|
|
1804
|
+
}, popoverProps = {
|
|
1805
|
+
anchorName: {
|
|
1806
|
+
type: "string"
|
|
1807
|
+
},
|
|
1808
|
+
content: {
|
|
1809
|
+
type: "string"
|
|
1810
|
+
},
|
|
1811
|
+
portal: {
|
|
1812
|
+
type: "boolean"
|
|
1813
|
+
},
|
|
1814
|
+
...placementProps
|
|
1815
|
+
}, popoverClassName = suffixClassName("sui-PopoverContent");
|
|
1816
|
+
function PopoverRoot(t0) {
|
|
1817
|
+
const $ = c(4), {
|
|
1818
|
+
placement: t1,
|
|
1819
|
+
...props
|
|
1820
|
+
} = t0, placement = t1 === void 0 ? "bottom" : t1, {
|
|
1821
|
+
children,
|
|
1822
|
+
className,
|
|
1823
|
+
style,
|
|
1824
|
+
id: idProp,
|
|
1825
|
+
anchorName,
|
|
1826
|
+
content,
|
|
1827
|
+
portal,
|
|
1828
|
+
triggerProps: forwardedTriggerProps,
|
|
1829
|
+
...rest
|
|
1830
|
+
} = getProps({
|
|
1831
|
+
placement,
|
|
1832
|
+
...props
|
|
1833
|
+
}, popoverProps), reactId = useId(), id = idProp || reactId, [open, setOpen] = useState(!1), isClient = useIsClient();
|
|
1834
|
+
let t2;
|
|
1835
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = (e) => {
|
|
1836
|
+
setOpen(e.newState === "open");
|
|
1837
|
+
}, $[0] = t2) : t2 = $[0];
|
|
1838
|
+
const handleToggle = t2, triggerProps = {
|
|
1839
|
+
popoverTarget: id,
|
|
1840
|
+
style: {
|
|
1841
|
+
anchorName: `--anchor-${anchorName || id}`
|
|
1842
|
+
}
|
|
1843
|
+
}, trigger = children.type.forwardsTriggerProps ? cloneElement(children, {
|
|
1844
|
+
triggerProps
|
|
1845
|
+
}) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps)), t3 = renderPortal(/* @__PURE__ */ jsx(Activity, { mode: open ? "visible" : "hidden", children: /* @__PURE__ */ jsx("div", { className: clsx(popoverClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className), style: {
|
|
1846
|
+
...style,
|
|
1847
|
+
positionAnchor: `--anchor-${anchorName || id}`
|
|
1848
|
+
}, "data-ui": "Popover", popover: "auto", id, onToggle: handleToggle, ...rest, children: content }) }), isClient, portal);
|
|
1849
|
+
let t4;
|
|
1850
|
+
return $[1] !== t3 || $[2] !== trigger ? (t4 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1851
|
+
trigger,
|
|
1852
|
+
t3
|
|
1853
|
+
] }), $[1] = t3, $[2] = trigger, $[3] = t4) : t4 = $[3], t4;
|
|
1854
|
+
}
|
|
1855
|
+
const Popover = Object.assign(PopoverRoot, {
|
|
1856
|
+
forwardsTriggerProps: !0
|
|
1857
|
+
}), radioProps = {
|
|
1639
1858
|
error: {
|
|
1640
1859
|
type: "boolean"
|
|
1641
1860
|
},
|
|
@@ -1656,7 +1875,7 @@ function Radio(props) {
|
|
|
1656
1875
|
error,
|
|
1657
1876
|
...rest
|
|
1658
1877
|
} = getProps(props, radioProps);
|
|
1659
|
-
label = t82, T1 = Label, t2 = clsx(radioClassName, className), t3 = style, t4 = "Radio", t5 = disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "radio", className: radioInputClassName, disabled, ...rest }), T0 = Box, t0 = "span", t1 = clsx(radioMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
|
|
1878
|
+
label = t82, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "radio", className: radioInputClassName, disabled, ...rest }), T0 = Box, t0 = "span", t1 = clsx(radioMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
|
|
1660
1879
|
} else
|
|
1661
1880
|
T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
|
|
1662
1881
|
let t8;
|
|
@@ -1712,7 +1931,7 @@ function Switch(props) {
|
|
|
1712
1931
|
label: t82,
|
|
1713
1932
|
...rest
|
|
1714
1933
|
} = getProps(props, switchProps);
|
|
1715
|
-
label = t82, T1 = Label, t2 = clsx(switchClassName, className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "checkbox", role: "switch", className: switchInputClassName, disabled, ...rest }), T0 = Flex, t0 = "span", t1 = clsx(switchMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
|
|
1934
|
+
label = t82, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "checkbox", role: "switch", className: switchInputClassName, disabled, ...rest }), T0 = Flex, t0 = "span", t1 = clsx(switchMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
|
|
1716
1935
|
} else
|
|
1717
1936
|
T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
|
|
1718
1937
|
let t8;
|
|
@@ -1724,79 +1943,73 @@ function Switch(props) {
|
|
|
1724
1943
|
label
|
|
1725
1944
|
] }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
|
|
1726
1945
|
}
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
type: "union",
|
|
1730
|
-
className: "placement",
|
|
1731
|
-
values: PLACEMENT
|
|
1732
|
-
}
|
|
1733
|
-
}, tooltipProps = {
|
|
1734
|
-
text: {
|
|
1946
|
+
const tooltipProps = {
|
|
1947
|
+
anchorName: {
|
|
1735
1948
|
type: "string"
|
|
1736
1949
|
},
|
|
1737
|
-
|
|
1950
|
+
content: {
|
|
1951
|
+
type: "string"
|
|
1952
|
+
},
|
|
1953
|
+
portal: {
|
|
1738
1954
|
type: "boolean"
|
|
1739
1955
|
},
|
|
1740
1956
|
...placementProps
|
|
1741
|
-
}, tooltipClassName = suffixClassName("sui-Tooltip")
|
|
1742
|
-
function
|
|
1743
|
-
const $ = c(
|
|
1957
|
+
}, tooltipClassName = suffixClassName("sui-Tooltip");
|
|
1958
|
+
function TooltipRoot(t0) {
|
|
1959
|
+
const $ = c(7), {
|
|
1744
1960
|
placement: t1,
|
|
1745
1961
|
...props
|
|
1746
1962
|
} = t0, placement = t1 === void 0 ? "bottom" : t1, {
|
|
1747
1963
|
children,
|
|
1748
1964
|
className,
|
|
1749
1965
|
style,
|
|
1750
|
-
disabled,
|
|
1751
1966
|
id: idProp,
|
|
1752
|
-
|
|
1967
|
+
anchorName,
|
|
1968
|
+
content,
|
|
1969
|
+
portal,
|
|
1970
|
+
triggerProps: forwardedTriggerProps,
|
|
1753
1971
|
...rest
|
|
1754
1972
|
} = getProps({
|
|
1755
1973
|
placement,
|
|
1756
1974
|
...props
|
|
1757
|
-
}, tooltipProps), reactId = useId(), id = idProp || reactId, [dismissed, setDismissed] = useState(!1);
|
|
1975
|
+
}, tooltipProps), reactId = useId(), id = idProp || reactId, [dismissed, setDismissed] = useState(!1), isClient = useIsClient();
|
|
1758
1976
|
let t2, t3;
|
|
1759
|
-
$[0]
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
return window.addEventListener("keydown", handleKeyDown), () => window.removeEventListener("keydown", handleKeyDown);
|
|
1766
|
-
}, t3 = [dismissed], $[0] = dismissed, $[1] = t2, $[2] = t3) : (t2 = $[1], t3 = $[2]), useEffect(t2, t3);
|
|
1767
|
-
const trigger = cloneElement(children, {
|
|
1977
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
|
|
1978
|
+
setDismissed(!1);
|
|
1979
|
+
}, t3 = () => {
|
|
1980
|
+
setDismissed(!1);
|
|
1981
|
+
}, $[0] = t2, $[1] = t3) : (t2 = $[0], t3 = $[1]);
|
|
1982
|
+
const triggerProps = {
|
|
1768
1983
|
"aria-describedby": id,
|
|
1769
|
-
|
|
1770
|
-
setDismissed(!1), children.props.onMouseEnter?.(e_0);
|
|
1771
|
-
},
|
|
1772
|
-
onFocus: (e_1) => {
|
|
1773
|
-
setDismissed(!1), children.props.onFocus?.(e_1);
|
|
1774
|
-
},
|
|
1775
|
-
onClick: (e_2) => {
|
|
1776
|
-
setDismissed(!0), children.props.onClick?.(e_2);
|
|
1777
|
-
},
|
|
1984
|
+
interestfor: id,
|
|
1778
1985
|
style: {
|
|
1779
|
-
|
|
1780
|
-
|
|
1986
|
+
anchorName: `--anchor-${anchorName || id}`
|
|
1987
|
+
},
|
|
1988
|
+
onMouseLeave: t2,
|
|
1989
|
+
onBlur: t3,
|
|
1990
|
+
onClick: () => {
|
|
1991
|
+
setDismissed(!0), document.getElementById(id)?.hidePopover();
|
|
1781
1992
|
}
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1993
|
+
}, trigger = children.type.forwardsTriggerProps ? cloneElement(children, {
|
|
1994
|
+
triggerProps
|
|
1995
|
+
}) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps));
|
|
1996
|
+
let t4;
|
|
1997
|
+
$[2] !== dismissed ? (t4 = (e) => {
|
|
1998
|
+
e.newState === "open" && dismissed && e.preventDefault();
|
|
1999
|
+
}, $[2] = dismissed, $[3] = t4) : t4 = $[3];
|
|
2000
|
+
const handleBeforeToggle = t4, t5 = renderPortal(/* @__PURE__ */ jsx("div", { className: clsx(tooltipClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className), style: {
|
|
1788
2001
|
...style,
|
|
1789
|
-
positionAnchor:
|
|
1790
|
-
},
|
|
1791
|
-
let
|
|
1792
|
-
|
|
1793
|
-
let t8;
|
|
1794
|
-
return $[13] !== t7 || $[14] !== trigger ? (t8 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2002
|
+
positionAnchor: `--anchor-${anchorName || id}`
|
|
2003
|
+
}, "data-ui": "Tooltip", role: "tooltip", popover: "hint", id, onBeforeToggle: handleBeforeToggle, ...rest, children: content }), isClient, portal);
|
|
2004
|
+
let t6;
|
|
2005
|
+
return $[4] !== t5 || $[5] !== trigger ? (t6 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1795
2006
|
trigger,
|
|
1796
|
-
|
|
1797
|
-
] }), $[
|
|
2007
|
+
t5
|
|
2008
|
+
] }), $[4] = t5, $[5] = trigger, $[6] = t6) : t6 = $[6], t6;
|
|
1798
2009
|
}
|
|
1799
|
-
const
|
|
2010
|
+
const Tooltip = Object.assign(TooltipRoot, {
|
|
2011
|
+
forwardsTriggerProps: !0
|
|
2012
|
+
}), tooltipGroupProps = {
|
|
1800
2013
|
as: {
|
|
1801
2014
|
type: "string"
|
|
1802
2015
|
}
|
|
@@ -1812,7 +2025,7 @@ function TooltipGroup(props) {
|
|
|
1812
2025
|
let t0;
|
|
1813
2026
|
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = (e) => {
|
|
1814
2027
|
const tooltip = e.target.closest('[data-ui="Tooltip"]');
|
|
1815
|
-
tooltip && e.propertyName === "
|
|
2028
|
+
tooltip && e.propertyName === "opacity" && window.getComputedStyle(tooltip).opacity !== "0" && setIsActive(!0);
|
|
1816
2029
|
}, $[0] = t0) : t0 = $[0];
|
|
1817
2030
|
const handleTransitionEnd = t0;
|
|
1818
2031
|
let t1;
|
|
@@ -1827,7 +2040,7 @@ function TooltipGroup(props) {
|
|
|
1827
2040
|
const handleBlur = t2, t3 = clsx(tooltipGroupClassName, className);
|
|
1828
2041
|
let t4;
|
|
1829
2042
|
$[3] !== isActive ? (t4 = isActive && {
|
|
1830
|
-
"--tooltip-delay-group":
|
|
2043
|
+
"--tooltip-delay-group": "0ms"
|
|
1831
2044
|
}, $[3] = isActive, $[4] = t4) : t4 = $[4];
|
|
1832
2045
|
let t5;
|
|
1833
2046
|
$[5] !== style || $[6] !== t4 ? (t5 = {
|
|
@@ -1837,13 +2050,60 @@ function TooltipGroup(props) {
|
|
|
1837
2050
|
let t6;
|
|
1838
2051
|
return $[8] !== Component || $[9] !== children || $[10] !== handleBlur || $[11] !== handleMouseLeave || $[12] !== handleTransitionEnd || $[13] !== rest || $[14] !== t3 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Component, { className: t3, style: t5, "data-ui": "TooltipGroup", ref, onTransitionEnd: handleTransitionEnd, onMouseLeave: handleMouseLeave, onBlur: handleBlur, ...rest, children }), $[8] = Component, $[9] = children, $[10] = handleBlur, $[11] = handleMouseLeave, $[12] = handleTransitionEnd, $[13] = rest, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
|
|
1839
2052
|
}
|
|
2053
|
+
const badgeProps = {
|
|
2054
|
+
as: {
|
|
2055
|
+
type: "string"
|
|
2056
|
+
},
|
|
2057
|
+
iconStart: {
|
|
2058
|
+
type: "string"
|
|
2059
|
+
},
|
|
2060
|
+
text: {
|
|
2061
|
+
type: "string"
|
|
2062
|
+
},
|
|
2063
|
+
...toneProps
|
|
2064
|
+
}, badgeClassName = suffixClassName("sui-Badge");
|
|
2065
|
+
function Badge(t0) {
|
|
2066
|
+
const $ = c(20);
|
|
2067
|
+
let T0, children, t1, t2, t3, t4, t5, text;
|
|
2068
|
+
if ($[0] !== t0) {
|
|
2069
|
+
const {
|
|
2070
|
+
tone: t62,
|
|
2071
|
+
...props
|
|
2072
|
+
} = t0, tone = t62 === void 0 ? "neutral" : t62, {
|
|
2073
|
+
as,
|
|
2074
|
+
children: t72,
|
|
2075
|
+
className,
|
|
2076
|
+
style,
|
|
2077
|
+
iconStart: IconStart,
|
|
2078
|
+
text: t8,
|
|
2079
|
+
...rest
|
|
2080
|
+
} = getProps({
|
|
2081
|
+
tone,
|
|
2082
|
+
...props
|
|
2083
|
+
}, badgeProps);
|
|
2084
|
+
children = t72, text = t8;
|
|
2085
|
+
const Component = as || "span", badgeClasses = clsx(badgeClassName, `${IconStart ? "sui-p1" : "sui-px2 sui-py1"} sui-radius-full sui-display-inline-flex sui-align-items-center sui-gap1`);
|
|
2086
|
+
T0 = Component, t1 = clsx(badgeClasses, className), t2 = style, t3 = "Badge", t4 = rest, t5 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, { icon: IconStart, marginX: -1, marginY: -2, size: 0 })), $[0] = t0, $[1] = T0, $[2] = children, $[3] = t1, $[4] = t2, $[5] = t3, $[6] = t4, $[7] = t5, $[8] = text;
|
|
2087
|
+
} else
|
|
2088
|
+
T0 = $[1], children = $[2], t1 = $[3], t2 = $[4], t3 = $[5], t4 = $[6], t5 = $[7], text = $[8];
|
|
2089
|
+
let t6;
|
|
2090
|
+
$[9] !== text ? (t6 = text && /* @__PURE__ */ jsx(Text, { size: 1, trim: !0, children: text }), $[9] = text, $[10] = t6) : t6 = $[10];
|
|
2091
|
+
let t7;
|
|
2092
|
+
return $[11] !== T0 || $[12] !== children || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, { className: t1, style: t2, "data-ui": t3, ...t4, children: [
|
|
2093
|
+
t5,
|
|
2094
|
+
t6,
|
|
2095
|
+
children
|
|
2096
|
+
] }), $[11] = T0, $[12] = children, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
|
|
2097
|
+
}
|
|
1840
2098
|
export {
|
|
2099
|
+
Badge,
|
|
1841
2100
|
Box,
|
|
1842
2101
|
Button,
|
|
1843
2102
|
Card,
|
|
1844
2103
|
Checkbox,
|
|
1845
2104
|
Code,
|
|
1846
2105
|
Container,
|
|
2106
|
+
Dialog,
|
|
1847
2107
|
Divider,
|
|
1848
2108
|
Eyebrow,
|
|
1849
2109
|
Flex,
|
|
@@ -1858,6 +2118,7 @@ export {
|
|
|
1858
2118
|
Label,
|
|
1859
2119
|
Link,
|
|
1860
2120
|
List,
|
|
2121
|
+
Popover,
|
|
1861
2122
|
PressArea,
|
|
1862
2123
|
Radio,
|
|
1863
2124
|
SkipToContent,
|
|
@@ -1867,6 +2128,7 @@ export {
|
|
|
1867
2128
|
Tooltip,
|
|
1868
2129
|
TooltipGroup,
|
|
1869
2130
|
VStack,
|
|
1870
|
-
VisuallyHidden
|
|
2131
|
+
VisuallyHidden,
|
|
2132
|
+
useIsClient
|
|
1871
2133
|
};
|
|
1872
2134
|
//# sourceMappingURL=index.js.map
|