twenty-ui 2.49.0 → 2.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/Button-CU8BS-Yd.js +75 -0
- package/dist/Button-iVyxlrwO.cjs +1 -0
- package/dist/Dropdown-ChTVyesF.js +1018 -0
- package/dist/Dropdown-DlItz8Gh.cjs +1 -0
- package/dist/Heading-CHvEXL6n.cjs +1 -0
- package/dist/{Heading-pXllCJCO.js → Heading-Nj5BlPqB.js} +3 -3
- package/dist/{ListItem-DwBb-I1D.cjs → ListItem-C6Xl00m1.cjs} +1 -1
- package/dist/{ListItem-DizNUBT8.js → ListItem-C84ANa76.js} +1 -1
- package/dist/{OverflowingTextWithTooltip-Z2daM0_x.cjs → OverflowingTextWithTooltip-BQmpPObX.cjs} +1 -1
- package/dist/{OverflowingTextWithTooltip-BmUROIah.js → OverflowingTextWithTooltip-BtB9cGdJ.js} +20 -21
- package/dist/ProgressBar-CzGs7cuE.cjs +1 -0
- package/dist/ProgressBar-D4tKQ7OA.js +84 -0
- package/dist/{Radio-BEAztmPu.js → Radio-BwBZ4e8g.js} +29 -29
- package/dist/{Radio-Dx6b4SYZ.cjs → Radio-sIYxZnR_.cjs} +1 -1
- package/dist/TabsTabContent-6rkARU9F.cjs +1 -0
- package/dist/TabsTabContent-DPkLTBi2.js +39 -0
- package/dist/Tooltip-6uS8_wdA.js +132 -0
- package/dist/Tooltip-DL3sfbuw.cjs +1 -0
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +6 -7
- package/dist/components/feedback/InlineBanner/InlineBanner.d.ts +2 -2
- package/dist/components/feedback/InlineBanner/internal/InlineBannerComponent.d.ts +1 -1
- package/dist/components/feedback/InlineBanner/types/InlineBannerProps.d.ts +1 -0
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/SegmentedControl/types/SegmentedControlProps.d.ts +1 -1
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +1 -1
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownSearch.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownSearchEffect.d.ts +8 -0
- package/dist/components/navigation/index.d.ts +0 -11
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.mjs +6 -11
- package/dist/components/settings.cjs +1 -1
- package/dist/components/settings.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +35 -41
- package/dist/data-display-C-eoJ5En.js +378 -0
- package/dist/data-display-CM1yXpnE.cjs +2 -0
- package/dist/data-display-CXw-mxeS.js +252 -0
- package/dist/data-display-DdES9XqZ.cjs +1 -0
- package/dist/{feedback-DTyVVcTb.js → feedback-4HKPcMRs.js} +216 -215
- package/dist/feedback-BSOWDBI0.js +38 -0
- package/dist/feedback-DBRXDPSP.cjs +1 -0
- package/dist/feedback-DspXawf9.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +605 -611
- package/dist/input-CWWp7cqL.cjs +1 -0
- package/dist/input-CvZ_uB_9.cjs +1 -0
- package/dist/{input-BrjD91wv.js → input-Qn5_aFYU.js} +5 -5
- package/dist/input-k5cMhFI_.js +428 -0
- package/dist/{layout-DQcjBu08.js → layout-DDqeMgFv.js} +2 -2
- package/dist/{layout-CthYckvl.cjs → layout-iSfGrMrH.cjs} +1 -1
- package/dist/navigation-7Y6gHFlj.cjs +1 -0
- package/dist/{navigation-CIVYqPc5.js → navigation-BY8X2w04.js} +31 -31
- package/dist/navigation-BcXCiLE1.js +86 -0
- package/dist/navigation-ByYN6NgX.cjs +1 -0
- package/dist/normalizeSearchText-DLmPiBUZ.js +19 -0
- package/dist/normalizeSearchText-Do0MELpQ.cjs +1 -0
- package/dist/preventDismissingClickActivation-BEBrL9aB.cjs +1 -0
- package/dist/preventDismissingClickActivation-BQFMKRey.js +29 -0
- package/dist/primitives/accessibility.cjs +1 -1
- package/dist/primitives/accessibility.mjs +1 -1
- package/dist/primitives/data-display/Avatar/constants/AvatarPropertiesBySize.d.ts +4 -0
- package/dist/primitives/data-display/Avatar/types/AvatarSize.d.ts +1 -1
- package/dist/primitives/data-display/Badge/types/BadgeColor.d.ts +1 -1
- package/dist/primitives/data-display/Chip/types/ChipVariant.d.ts +1 -1
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +7 -8
- package/dist/primitives/feedback/Banner/Banner.d.ts +1 -1
- package/dist/primitives/feedback/Banner/internal/BannerAction.d.ts +1 -1
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +2 -2
- package/dist/primitives/input/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/internal/AutocompleteInput.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/types/AutocompleteInputProps.d.ts +8 -1
- package/dist/primitives/input/Button/types/ButtonColor.d.ts +1 -1
- package/dist/primitives/input/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/primitives/input/RadioGroup/types/RadioGroupProps.d.ts +3 -1
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +3 -3
- package/dist/primitives/navigation/Tabs/types/TabsSize.d.ts +1 -1
- package/dist/primitives/navigation.cjs +1 -1
- package/dist/primitives/navigation.mjs +2 -2
- package/dist/primitives/surfaces/Card/Card.d.ts +1 -1
- package/dist/primitives/surfaces/Card/internal/CardRoot.d.ts +1 -1
- package/dist/primitives/surfaces/Card/types/CardRootProps.d.ts +0 -1
- package/dist/primitives/surfaces/Tooltip/Tooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/__stories__/findTooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/internal/TooltipBody.d.ts +2 -8
- package/dist/primitives/surfaces/Tooltip/types/TooltipBodyProps.d.ts +6 -0
- package/dist/primitives/surfaces/index.d.ts +1 -0
- package/dist/primitives/surfaces.cjs +1 -1
- package/dist/primitives/surfaces.mjs +2 -2
- package/dist/primitives/typography/Heading/types/HeadingProps.d.ts +1 -1
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +3 -3
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +45 -46
- package/dist/{settings-CPXhrmbK.cjs → settings-DT5bEO6A.cjs} +1 -1
- package/dist/{settings-BgVuLpg9.js → settings-XGSJtobU.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/surfaces-q8voTXEJ.cjs +1 -0
- package/dist/{surfaces-BLsR5ka0.js → surfaces-vhSZBmbz.js} +77 -78
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/utils/waitForStorybookFontsLoaded.d.ts +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +87 -77
- package/dist/{typography-DT2eKLvd.js → typography-BPdXzW2T.js} +1 -1
- package/dist/{typography-bKeSMuJd.cjs → typography-CWtuNruY.cjs} +1 -1
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +11 -10
- package/package.json +1 -1
- package/dist/Avatar-C6WxBgjS.cjs +0 -1
- package/dist/Avatar-ifVlxbx_.js +0 -73
- package/dist/Button-DIw804CX.js +0 -72
- package/dist/Button-DTm1WDzp.cjs +0 -1
- package/dist/Dropdown-1OAJvS1f.js +0 -1000
- package/dist/Dropdown-Bl4OXCf9.cjs +0 -1
- package/dist/Heading-CTRYClCO.cjs +0 -1
- package/dist/ProgressBar-B3xACTV2.js +0 -84
- package/dist/ProgressBar-OpSMnDBz.cjs +0 -1
- package/dist/TabsTabContent-Co27Y2TU.cjs +0 -1
- package/dist/TabsTabContent-DVcObDp6.js +0 -39
- package/dist/TintedIconTile-B1XDtGrF.js +0 -40
- package/dist/TintedIconTile-DO1XJXCQ.cjs +0 -1
- package/dist/Tooltip-Bg9Uk01p.cjs +0 -1
- package/dist/Tooltip-cLCgtFBF.js +0 -124
- package/dist/components/navigation/MenuItem/MenuItem.d.ts +0 -2
- package/dist/components/navigation/MenuItem/parts/MenuItemIcon.d.ts +0 -9
- package/dist/components/navigation/MenuItem/parts/MenuItemIconBoxContainer.d.ts +0 -7
- package/dist/components/navigation/MenuItem/parts/MenuItemIconWithGripSwap.d.ts +0 -8
- package/dist/components/navigation/MenuItem/parts/MenuItemLeftContent.d.ts +0 -19
- package/dist/components/navigation/MenuItem/parts/StyledMenuItemBase.d.ts +0 -25
- package/dist/components/navigation/MenuItem/types/MenuItemDraggableGripMode.d.ts +0 -1
- package/dist/components/navigation/MenuItem/types/MenuItemProps.d.ts +0 -33
- package/dist/components/navigation/MenuItemAvatar/MenuItemAvatar.d.ts +0 -2
- package/dist/components/navigation/MenuItemAvatar/types/MenuItemAvatarProps.d.ts +0 -18
- package/dist/components/navigation/MenuItemDraggable/MenuItemDraggable.d.ts +0 -2
- package/dist/components/navigation/MenuItemDraggable/types/MenuItemDraggableProps.d.ts +0 -20
- package/dist/components/navigation/MenuItemSuggestion/MenuItemSuggestion.d.ts +0 -2
- package/dist/components/navigation/MenuItemSuggestion/types/MenuItemSuggestionProps.d.ts +0 -12
- package/dist/components/navigation/MenuPicker/MenuPicker.d.ts +0 -2
- package/dist/components/navigation/MenuPicker/types/MenuPickerProps.d.ts +0 -15
- package/dist/data-display-BSKGlijb.cjs +0 -1
- package/dist/data-display-BtXCGOGw.js +0 -345
- package/dist/data-display-DtXIhJ4B.js +0 -184
- package/dist/data-display-XV3ht1rC.cjs +0 -2
- package/dist/feedback-Cs-38OH4.cjs +0 -1
- package/dist/feedback-DA-AU5z5.js +0 -38
- package/dist/feedback-DNLERYY9.cjs +0 -1
- package/dist/input-B_rBplmn.cjs +0 -1
- package/dist/input-ChlFcqIS.cjs +0 -1
- package/dist/input-D1oyk0tD.js +0 -421
- package/dist/navigation-B6nka3bW.js +0 -400
- package/dist/navigation-CflGBYv-.cjs +0 -1
- package/dist/navigation-DoInK0Sp.cjs +0 -1
- package/dist/preventDismissingClickActivation-AaqHBLnW.js +0 -45
- package/dist/preventDismissingClickActivation-CIhWvKCu.cjs +0 -1
- package/dist/surfaces-0rL5DoHt.cjs +0 -1
- /package/dist/{handleClickableElementKeyDown-C8Uz61XJ.js → accessibility-C8Uz61XJ.js} +0 -0
- /package/dist/{handleClickableElementKeyDown-CByqtBhO.cjs → accessibility-CByqtBhO.cjs} +0 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { t as _ } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
+
import { Jc as Y, No as Z, Pn as ee, Tn as re, Vt as G, rr as oe, wn as ne } from "./icon-CUE-QGQK.js";
|
|
3
|
+
import { t as te } from "./doNotTranslate-BSVT8Xyd.js";
|
|
4
|
+
import { a as T, h as ae, r as K } from "./theme-B2EaXhye.js";
|
|
5
|
+
import { t as le } from "./VisuallyHidden-CFZP7ybO.js";
|
|
6
|
+
import { t as se } from "./ProgressRing-8mYV9cxE.js";
|
|
7
|
+
import { s as ie } from "./utilities-BKCMZyqZ.js";
|
|
8
|
+
import { useRender as x } from "@base-ui/react/use-render";
|
|
9
|
+
import { isArray as ce, isBoolean as de, isNonEmptyArray as D, isNonEmptyString as V, isNumber as ue, isString as _e } from "@sniptt/guards";
|
|
10
|
+
import { clsx as c } from "clsx";
|
|
11
|
+
import { Children as E, createContext as me, isValidElement as ve, useContext as he, useId as pe, useState as be } from "react";
|
|
12
|
+
import { Fragment as S, jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
import { Collapsible as P } from "@base-ui/react/collapsible";
|
|
14
|
+
var Ce = "_container_5cu4g_1", Ne = "_itemContainer_5cu4g_6", fe = "_overflowCountContainer_5cu4g_22", ge = "_overflowCount_5cu4g_22", g = {
|
|
15
|
+
container: Ce,
|
|
16
|
+
itemContainer: Ne,
|
|
17
|
+
overflowCountContainer: fe,
|
|
18
|
+
overflowCount: ge
|
|
19
|
+
}, Ie = 4, Tr = ({ avatars: e, className: r, maxVisible: n = Ie, total: t, renderOverflow: s, overflowShape: l = "square", overlap: a = "right", overlapOffset: i = "3px", render: b, ref: C, ...m }) => {
|
|
20
|
+
const u = E.toArray(e), y = Number.isNaN(n) ? 0 : Math.max(0, Math.floor(n)), N = u.slice(0, y), h = t ?? u.length, f = (Number.isFinite(h) ? Math.max(u.length, Math.floor(h)) : u.length) - N.length, A = _(s), w = f > 0 && (A ? s(f) : /* @__PURE__ */ d("span", {
|
|
21
|
+
className: g.overflowCount,
|
|
22
|
+
"data-shape": l,
|
|
23
|
+
children: ["+", f]
|
|
24
|
+
})), F = D(E.toArray(w)), M = { "--avatar-group-overlap-offset": i }, W = x({
|
|
25
|
+
render: b,
|
|
26
|
+
ref: C,
|
|
27
|
+
props: {
|
|
28
|
+
...m,
|
|
29
|
+
className: c(g.container, r),
|
|
30
|
+
children: /* @__PURE__ */ d(S, { children: [E.map(N, (L) => /* @__PURE__ */ o("span", {
|
|
31
|
+
className: g.itemContainer,
|
|
32
|
+
"data-overlap": a,
|
|
33
|
+
style: M,
|
|
34
|
+
children: L
|
|
35
|
+
}, ve(L) ? L.key : void 0)), F && /* @__PURE__ */ o("span", {
|
|
36
|
+
className: c(g.itemContainer, !A && g.overflowCountContainer),
|
|
37
|
+
"data-overlap": a,
|
|
38
|
+
style: M,
|
|
39
|
+
children: w
|
|
40
|
+
})] })
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return D(N) || F ? W : null;
|
|
44
|
+
}, Te = "_container_1j72k_1", xe = "_commands_1j72k_13", ye = "_actions_1j72k_25", Ae = "_prompt_1j72k_32", k = {
|
|
45
|
+
container: Te,
|
|
46
|
+
commands: xe,
|
|
47
|
+
actions: ye,
|
|
48
|
+
prompt: Ae
|
|
49
|
+
}, xr = ({ commands: e, actions: r, render: n, ref: t, className: s, ...l }) => x({
|
|
50
|
+
render: n,
|
|
51
|
+
ref: t,
|
|
52
|
+
props: {
|
|
53
|
+
...l,
|
|
54
|
+
className: c(k.container, s),
|
|
55
|
+
children: /* @__PURE__ */ d(S, { children: [/* @__PURE__ */ o("pre", {
|
|
56
|
+
className: k.commands,
|
|
57
|
+
children: /* @__PURE__ */ o("code", { children: e.map((a, i) => /* @__PURE__ */ d("span", { children: [
|
|
58
|
+
i > 0 && `
|
|
59
|
+
`,
|
|
60
|
+
/* @__PURE__ */ o("span", {
|
|
61
|
+
className: k.prompt,
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
children: "> "
|
|
64
|
+
}),
|
|
65
|
+
a
|
|
66
|
+
] }, i)) })
|
|
67
|
+
}), _(r) && /* @__PURE__ */ o("div", {
|
|
68
|
+
className: k.actions,
|
|
69
|
+
children: r
|
|
70
|
+
})] })
|
|
71
|
+
}
|
|
72
|
+
}), we = "_list_1i4lv_1", ke = "_nested_1i4lv_8", z = {
|
|
73
|
+
list: we,
|
|
74
|
+
nested: ke
|
|
75
|
+
}, Je = ({ depth: e, className: r, children: n }) => /* @__PURE__ */ o("ul", {
|
|
76
|
+
className: c(z.list, e > 0 && z.nested, r),
|
|
77
|
+
children: n
|
|
78
|
+
}), U = me(void 0), p = () => {
|
|
79
|
+
const e = he(U);
|
|
80
|
+
if (!_(e)) throw new Error(te("useJsonTreeContextOrThrow must be used within a JsonTreeContextProvider"));
|
|
81
|
+
return e;
|
|
82
|
+
}, Se = "_button_1e3ij_1", Le = "_red_1e3ij_17", Ee = "_chevron_1e3ij_22", $ = {
|
|
83
|
+
button: Se,
|
|
84
|
+
red: Le,
|
|
85
|
+
chevron: Ee
|
|
86
|
+
}, $e = ({ isOpen: e, onClick: r, variant: n }) => {
|
|
87
|
+
const t = K(), { arrowButtonCollapsedLabel: s, arrowButtonExpandedLabel: l } = p(), a = n === "blue" ? T.color.blue : n === "red" ? T.font.color.danger : T.font.color.secondary;
|
|
88
|
+
return /* @__PURE__ */ d("button", {
|
|
89
|
+
className: c($.button, n === "red" && $.red),
|
|
90
|
+
onClick: r,
|
|
91
|
+
children: [/* @__PURE__ */ o(le, { children: e ? l : s }), /* @__PURE__ */ o("div", {
|
|
92
|
+
className: $.chevron,
|
|
93
|
+
"data-open": e || void 0,
|
|
94
|
+
children: /* @__PURE__ */ o(re, {
|
|
95
|
+
size: t.icon.size.md,
|
|
96
|
+
color: a
|
|
97
|
+
})
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
}, je = ({ label: e, value: r, depth: n, keyPath: t, highlighting: s }) => {
|
|
101
|
+
const { emptyArrayLabel: l } = p();
|
|
102
|
+
return /* @__PURE__ */ o(B, {
|
|
103
|
+
elements: [...r.entries()].map(([a, i]) => ({
|
|
104
|
+
id: a,
|
|
105
|
+
label: String(a),
|
|
106
|
+
value: i
|
|
107
|
+
})),
|
|
108
|
+
renderElementsCount: (a) => `[${a}]`,
|
|
109
|
+
label: e,
|
|
110
|
+
Icon: G,
|
|
111
|
+
depth: n,
|
|
112
|
+
emptyElementsText: l,
|
|
113
|
+
keyPath: t,
|
|
114
|
+
highlighting: s
|
|
115
|
+
});
|
|
116
|
+
}, Oe = ({ label: e, value: r, depth: n, keyPath: t, highlighting: s }) => {
|
|
117
|
+
const { emptyObjectLabel: l } = p();
|
|
118
|
+
return /* @__PURE__ */ o(B, {
|
|
119
|
+
elements: Object.entries(r).map(([a, i]) => ({
|
|
120
|
+
id: a,
|
|
121
|
+
label: a,
|
|
122
|
+
value: i
|
|
123
|
+
})),
|
|
124
|
+
renderElementsCount: (a) => `{${a}}`,
|
|
125
|
+
label: e,
|
|
126
|
+
Icon: oe,
|
|
127
|
+
depth: n,
|
|
128
|
+
emptyElementsText: l,
|
|
129
|
+
keyPath: t,
|
|
130
|
+
highlighting: s
|
|
131
|
+
});
|
|
132
|
+
}, Re = "_labelContainer_1pq94_1", qe = "_blue_1pq94_23", Ve = "_red_1pq94_29", j = {
|
|
133
|
+
labelContainer: Re,
|
|
134
|
+
blue: qe,
|
|
135
|
+
red: Ve
|
|
136
|
+
}, X = ({ label: e, Icon: r, highlighting: n }) => {
|
|
137
|
+
const t = K();
|
|
138
|
+
return /* @__PURE__ */ d("span", {
|
|
139
|
+
className: c(j.labelContainer, n === "blue" && j.blue, n === "red" && j.red),
|
|
140
|
+
children: [/* @__PURE__ */ o(r, {
|
|
141
|
+
size: t.icon.size.md,
|
|
142
|
+
color: n === "blue" ? t.color.blue : n === "red" ? t.font.color.danger : t.font.color.tertiary
|
|
143
|
+
}), /* @__PURE__ */ o("span", { children: e })]
|
|
144
|
+
});
|
|
145
|
+
}, Be = "_text_1ot24_1", Fe = "_blue_1ot24_10", Me = "_red_1ot24_14", De = "_button_1ot24_18", J = {
|
|
146
|
+
text: Be,
|
|
147
|
+
blue: Fe,
|
|
148
|
+
red: Me,
|
|
149
|
+
button: De
|
|
150
|
+
}, Pe = ({ valueAsString: e, highlighting: r }) => {
|
|
151
|
+
const { onNodeValueClick: n } = p(), t = _(n), s = () => {
|
|
152
|
+
n?.(e);
|
|
153
|
+
}, l = c(J.text, r === "blue" && J.blue, r === "red" && J.red);
|
|
154
|
+
return t ? /* @__PURE__ */ o("button", {
|
|
155
|
+
className: c(l, J.button),
|
|
156
|
+
type: "button",
|
|
157
|
+
onClick: s,
|
|
158
|
+
children: e
|
|
159
|
+
}) : /* @__PURE__ */ o("span", {
|
|
160
|
+
className: l,
|
|
161
|
+
children: e
|
|
162
|
+
});
|
|
163
|
+
}, ze = "_listItem_1i7if_1", He = { listItem: ze }, I = (e) => /* @__PURE__ */ d("li", {
|
|
164
|
+
className: He.listItem,
|
|
165
|
+
children: [e.label && /* @__PURE__ */ o(X, {
|
|
166
|
+
label: e.label,
|
|
167
|
+
Icon: e.Icon,
|
|
168
|
+
highlighting: e.highlighting
|
|
169
|
+
}), /* @__PURE__ */ o(Pe, {
|
|
170
|
+
valueAsString: e.valueAsString,
|
|
171
|
+
highlighting: e.highlighting
|
|
172
|
+
})]
|
|
173
|
+
}), Ge = (e) => ce(e), Q = ({ label: e, value: r, depth: n, keyPath: t }) => {
|
|
174
|
+
const { getNodeHighlighting: s, emptyStringLabel: l } = p(), a = s?.(t);
|
|
175
|
+
return _(r) ? _e(r) ? /* @__PURE__ */ o(I, {
|
|
176
|
+
label: e,
|
|
177
|
+
valueAsString: V(r) ? r : l,
|
|
178
|
+
Icon: Y,
|
|
179
|
+
highlighting: a
|
|
180
|
+
}) : ue(r) ? /* @__PURE__ */ o(I, {
|
|
181
|
+
label: e,
|
|
182
|
+
valueAsString: String(r),
|
|
183
|
+
Icon: Z,
|
|
184
|
+
highlighting: a
|
|
185
|
+
}) : de(r) ? /* @__PURE__ */ o(I, {
|
|
186
|
+
label: e,
|
|
187
|
+
valueAsString: String(r),
|
|
188
|
+
Icon: ne,
|
|
189
|
+
highlighting: a
|
|
190
|
+
}) : Ge(r) ? /* @__PURE__ */ o(je, {
|
|
191
|
+
label: e,
|
|
192
|
+
value: r,
|
|
193
|
+
depth: n,
|
|
194
|
+
keyPath: t,
|
|
195
|
+
highlighting: a
|
|
196
|
+
}) : /* @__PURE__ */ o(Oe, {
|
|
197
|
+
label: e,
|
|
198
|
+
value: r,
|
|
199
|
+
depth: n,
|
|
200
|
+
keyPath: t,
|
|
201
|
+
highlighting: a
|
|
202
|
+
}) : /* @__PURE__ */ o(I, {
|
|
203
|
+
label: e,
|
|
204
|
+
valueAsString: "null",
|
|
205
|
+
Icon: ee,
|
|
206
|
+
highlighting: a
|
|
207
|
+
});
|
|
208
|
+
}, Ke = "_container_d0cqx_1", Ue = "_labelContainer_d0cqx_6", Xe = "_elementsCount_d0cqx_12", Qe = "_elementsCountRed_d0cqx_16", We = "_panel_d0cqx_20", Ye = "_list_d0cqx_30", Ze = "_nested_d0cqx_37", v = {
|
|
209
|
+
container: Ke,
|
|
210
|
+
labelContainer: Ue,
|
|
211
|
+
elementsCount: Xe,
|
|
212
|
+
elementsCountRed: Qe,
|
|
213
|
+
panel: We,
|
|
214
|
+
list: Ye,
|
|
215
|
+
nested: Ze
|
|
216
|
+
}, B = ({ label: e, Icon: r, elements: n, renderElementsCount: t, emptyElementsText: s, depth: l, keyPath: a, highlighting: i }) => {
|
|
217
|
+
const { shouldExpandNodeInitially: b } = p(), C = !_(e), [m, u] = be(b({
|
|
218
|
+
keyPath: a,
|
|
219
|
+
depth: l
|
|
220
|
+
})), y = /* @__PURE__ */ o("ul", {
|
|
221
|
+
className: c(v.list, l > 0 && v.nested),
|
|
222
|
+
children: n.length === 0 ? /* @__PURE__ */ o(I, {
|
|
223
|
+
valueAsString: s,
|
|
224
|
+
highlighting: void 0
|
|
225
|
+
}) : n.map(({ id: h, label: f, value: A }) => {
|
|
226
|
+
const w = V(a) ? `${a}.${h}` : String(h);
|
|
227
|
+
return /* @__PURE__ */ o(Q, {
|
|
228
|
+
label: f,
|
|
229
|
+
value: A,
|
|
230
|
+
depth: l + 1,
|
|
231
|
+
keyPath: w
|
|
232
|
+
}, h);
|
|
233
|
+
})
|
|
234
|
+
}), N = () => {
|
|
235
|
+
u(!m);
|
|
236
|
+
};
|
|
237
|
+
return C ? /* @__PURE__ */ o("li", {
|
|
238
|
+
className: v.container,
|
|
239
|
+
children: y
|
|
240
|
+
}) : /* @__PURE__ */ d(P.Root, {
|
|
241
|
+
className: v.container,
|
|
242
|
+
open: m,
|
|
243
|
+
render: /* @__PURE__ */ o("li", {}),
|
|
244
|
+
children: [/* @__PURE__ */ d("div", {
|
|
245
|
+
className: v.labelContainer,
|
|
246
|
+
children: [
|
|
247
|
+
/* @__PURE__ */ o($e, {
|
|
248
|
+
isOpen: m,
|
|
249
|
+
onClick: N,
|
|
250
|
+
variant: i === "partial-blue" ? "blue" : i === "red" ? i : void 0
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ o(X, {
|
|
253
|
+
label: e,
|
|
254
|
+
Icon: r,
|
|
255
|
+
highlighting: i === "red" ? i : void 0
|
|
256
|
+
}),
|
|
257
|
+
t && /* @__PURE__ */ o("span", {
|
|
258
|
+
className: c(v.elementsCount, i === "red" && v.elementsCountRed),
|
|
259
|
+
children: t(n.length)
|
|
260
|
+
})
|
|
261
|
+
]
|
|
262
|
+
}), /* @__PURE__ */ o(P.Panel, {
|
|
263
|
+
className: v.panel,
|
|
264
|
+
children: y
|
|
265
|
+
})]
|
|
266
|
+
});
|
|
267
|
+
}, er = ({ value: e, children: r }) => /* @__PURE__ */ o(U.Provider, {
|
|
268
|
+
value: e,
|
|
269
|
+
children: r
|
|
270
|
+
}), rr = ({ depth: e }) => e <= 1, yr = ({ value: e, entries: r, shouldExpandNodeInitially: n = rr, ...t }) => /* @__PURE__ */ o(er, {
|
|
271
|
+
value: {
|
|
272
|
+
...t,
|
|
273
|
+
shouldExpandNodeInitially: n
|
|
274
|
+
},
|
|
275
|
+
children: /* @__PURE__ */ o(Je, {
|
|
276
|
+
depth: 0,
|
|
277
|
+
children: _(r) ? /* @__PURE__ */ o(B, {
|
|
278
|
+
elements: r,
|
|
279
|
+
Icon: G,
|
|
280
|
+
depth: 0,
|
|
281
|
+
keyPath: "",
|
|
282
|
+
emptyElementsText: t.emptyObjectLabel
|
|
283
|
+
}) : /* @__PURE__ */ o(Q, {
|
|
284
|
+
value: e ?? null,
|
|
285
|
+
depth: 0,
|
|
286
|
+
keyPath: ""
|
|
287
|
+
})
|
|
288
|
+
})
|
|
289
|
+
}), or = "_row_1hj4l_1", nr = "_label_1hj4l_11", tr = "_icon_1hj4l_20", O = {
|
|
290
|
+
row: or,
|
|
291
|
+
label: nr,
|
|
292
|
+
icon: tr
|
|
293
|
+
}, Ar = ({ children: e, startIcon: r, value: n, progress: t, progressColor: s, progressValueText: l, render: a, ref: i, className: b, ...C }) => {
|
|
294
|
+
const m = pe(), u = l ?? n;
|
|
295
|
+
return x({
|
|
296
|
+
render: a,
|
|
297
|
+
ref: i,
|
|
298
|
+
props: {
|
|
299
|
+
...C,
|
|
300
|
+
className: c(O.row, b),
|
|
301
|
+
children: /* @__PURE__ */ d(S, { children: [/* @__PURE__ */ d("div", {
|
|
302
|
+
className: O.label,
|
|
303
|
+
children: [_(r) && /* @__PURE__ */ o("span", {
|
|
304
|
+
className: O.icon,
|
|
305
|
+
"aria-hidden": "true",
|
|
306
|
+
children: r
|
|
307
|
+
}), /* @__PURE__ */ o("span", {
|
|
308
|
+
id: m,
|
|
309
|
+
children: e
|
|
310
|
+
})]
|
|
311
|
+
}), _(t) ? /* @__PURE__ */ o(se, {
|
|
312
|
+
value: t,
|
|
313
|
+
size: "sm",
|
|
314
|
+
barColor: s,
|
|
315
|
+
"aria-labelledby": m,
|
|
316
|
+
...V(u) ? { "aria-valuetext": u } : {},
|
|
317
|
+
children: n
|
|
318
|
+
}) : /* @__PURE__ */ o("span", { children: n })] })
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}, ar = "_root_7l8sk_1", lr = "_stackedIcon_7l8sk_14", H = {
|
|
322
|
+
root: ar,
|
|
323
|
+
stackedIcon: lr
|
|
324
|
+
}, wr = ({ icon: e, stackedIcon: r, className: n, render: t, ref: s, ...l }) => x({
|
|
325
|
+
render: t,
|
|
326
|
+
ref: s,
|
|
327
|
+
props: {
|
|
328
|
+
...l,
|
|
329
|
+
className: c(H.root, n),
|
|
330
|
+
children: /* @__PURE__ */ d(S, { children: [/* @__PURE__ */ o("span", {
|
|
331
|
+
"aria-hidden": "true",
|
|
332
|
+
children: e
|
|
333
|
+
}), /* @__PURE__ */ o("span", {
|
|
334
|
+
"aria-hidden": "true",
|
|
335
|
+
className: H.stackedIcon,
|
|
336
|
+
children: r
|
|
337
|
+
})] })
|
|
338
|
+
}
|
|
339
|
+
}), R = {
|
|
340
|
+
background: 4,
|
|
341
|
+
border: 6,
|
|
342
|
+
icon: 10
|
|
343
|
+
}, q = (e, r) => T.color[`${e}${r}`] ?? T.tag.text[e], sr = (e) => {
|
|
344
|
+
const r = ie(e);
|
|
345
|
+
return {
|
|
346
|
+
backgroundColor: q(r, R.background),
|
|
347
|
+
iconColor: q(r, R.icon),
|
|
348
|
+
borderColor: q(r, R.border)
|
|
349
|
+
};
|
|
350
|
+
}, ir = "_root_9ntdy_1", cr = { root: ir }, kr = ({ icon: e, color: r = ae, className: n, style: t, render: s, ref: l, ...a }) => {
|
|
351
|
+
const i = sr(r);
|
|
352
|
+
return x({
|
|
353
|
+
render: s,
|
|
354
|
+
ref: l,
|
|
355
|
+
props: {
|
|
356
|
+
...a,
|
|
357
|
+
className: c(cr.root, n),
|
|
358
|
+
style: {
|
|
359
|
+
backgroundColor: i.backgroundColor,
|
|
360
|
+
color: i.iconColor,
|
|
361
|
+
...t
|
|
362
|
+
},
|
|
363
|
+
children: /* @__PURE__ */ o("span", {
|
|
364
|
+
"aria-hidden": "true",
|
|
365
|
+
children: e
|
|
366
|
+
})
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
export {
|
|
371
|
+
yr as a,
|
|
372
|
+
Ar as i,
|
|
373
|
+
sr as n,
|
|
374
|
+
xr as o,
|
|
375
|
+
wr as r,
|
|
376
|
+
Tr as s,
|
|
377
|
+
kr as t
|
|
378
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const x=require("./theme-1XkFz8Qu.cjs"),_=require("./isDefined-DS2Q42p5.cjs"),X=require("./doNotTranslate-CHE7WmRS.cjs"),Q=require("./VisuallyHidden-B-n4x1KY.cjs"),W=require("./ProgressRing-g1nHGyUp.cjs"),Y=require("./utilities-xZh8D2gd.cjs");let T=require("@base-ui/react/use-render"),u=require("@sniptt/guards"),c=require("clsx"),h=require("react"),e=require("react/jsx-runtime"),B=require("@base-ui/react/collapsible"),b=require("@tabler/icons-react");var Z="_container_5cu4g_1",ee="_itemContainer_5cu4g_6",re="_overflowCountContainer_5cu4g_22",ne="_overflowCount_5cu4g_22",y={container:Z,itemContainer:ee,overflowCountContainer:re,overflowCount:ne},te=4,oe=({avatars:r,className:n,maxVisible:t=te,total:o,renderOverflow:l,overflowShape:a="square",overlap:s="right",overlapOffset:i="3px",render:C,ref:f,...m})=>{const d=h.Children.toArray(r),q=Number.isNaN(t)?0:Math.max(0,Math.floor(t)),N=d.slice(0,q),p=o??d.length,g=(Number.isFinite(p)?Math.max(d.length,Math.floor(p)):d.length)-N.length,A=_.isDefined(l),k=g>0&&(A?l(g):(0,e.jsxs)("span",{className:y.overflowCount,"data-shape":a,children:["+",g]})),V=(0,u.isNonEmptyArray)(h.Children.toArray(k)),P={"--avatar-group-overlap-offset":i},U=(0,T.useRender)({render:C,ref:f,props:{...m,className:(0,c.clsx)(y.container,n),children:(0,e.jsxs)(e.Fragment,{children:[h.Children.map(N,J=>(0,e.jsx)("span",{className:y.itemContainer,"data-overlap":s,style:P,children:J},(0,h.isValidElement)(J)?J.key:void 0)),V&&(0,e.jsx)("span",{className:(0,c.clsx)(y.itemContainer,!A&&y.overflowCountContainer),"data-overlap":s,style:P,children:k})]})}});return(0,u.isNonEmptyArray)(N)||V?U:null},se="_container_1j72k_1",ae="_commands_1j72k_13",le="_actions_1j72k_25",ie="_prompt_1j72k_32",w={container:se,commands:ae,actions:le,prompt:ie},ce=({commands:r,actions:n,render:t,ref:o,className:l,...a})=>(0,T.useRender)({render:t,ref:o,props:{...a,className:(0,c.clsx)(w.container,l),children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("pre",{className:w.commands,children:(0,e.jsx)("code",{children:r.map((s,i)=>(0,e.jsxs)("span",{children:[i>0&&`
|
|
2
|
+
`,(0,e.jsx)("span",{className:w.prompt,"aria-hidden":"true",children:"> "}),s]},i))})}),_.isDefined(n)&&(0,e.jsx)("div",{className:w.actions,children:n})]})}}),de="_list_1i4lv_1",ue="_nested_1i4lv_8",F={list:de,nested:ue},_e=({depth:r,className:n,children:t})=>(0,e.jsx)("ul",{className:(0,c.clsx)(F.list,r>0&&F.nested,n),children:t}),z=(0,h.createContext)(void 0),j=()=>{const r=(0,h.useContext)(z);if(!_.isDefined(r))throw new Error(X.doNotTranslate("useJsonTreeContextOrThrow must be used within a JsonTreeContextProvider"));return r},me="_button_1e3ij_1",ve="_red_1e3ij_17",xe="_chevron_1e3ij_22",E={button:me,red:ve,chevron:xe},he=({isOpen:r,onClick:n,variant:t})=>{const o=x.useTheme(),{arrowButtonCollapsedLabel:l,arrowButtonExpandedLabel:a}=j(),s=t==="blue"?x.themeCssVariables.color.blue:t==="red"?x.themeCssVariables.font.color.danger:x.themeCssVariables.font.color.secondary;return(0,e.jsxs)("button",{className:(0,c.clsx)(E.button,t==="red"&&E.red),onClick:n,children:[(0,e.jsx)(Q.VisuallyHidden,{children:r?a:l}),(0,e.jsx)("div",{className:E.chevron,"data-open":r||void 0,children:(0,e.jsx)(b.IconChevronDown,{size:o.icon.size.md,color:s})})]})},be=({label:r,value:n,depth:t,keyPath:o,highlighting:l})=>{const{emptyArrayLabel:a}=j();return(0,e.jsx)($,{elements:[...n.entries()].map(([s,i])=>({id:s,label:String(s),value:i})),renderElementsCount:s=>`[${s}]`,label:r,Icon:b.IconBrackets,depth:t,emptyElementsText:a,keyPath:o,highlighting:l})},pe=({label:r,value:n,depth:t,keyPath:o,highlighting:l})=>{const{emptyObjectLabel:a}=j();return(0,e.jsx)($,{elements:Object.entries(n).map(([s,i])=>({id:s,label:s,value:i})),renderElementsCount:s=>`{${s}}`,label:r,Icon:b.IconCube,depth:t,emptyElementsText:a,keyPath:o,highlighting:l})},je="_labelContainer_1pq94_1",Ce="_blue_1pq94_23",fe="_red_1pq94_29",O={labelContainer:je,blue:Ce,red:fe},H=({label:r,Icon:n,highlighting:t})=>{const o=x.useTheme();return(0,e.jsxs)("span",{className:(0,c.clsx)(O.labelContainer,t==="blue"&&O.blue,t==="red"&&O.red),children:[(0,e.jsx)(n,{size:o.icon.size.md,color:t==="blue"?o.color.blue:t==="red"?o.font.color.danger:o.font.color.tertiary}),(0,e.jsx)("span",{children:r})]})},Ne="_text_1ot24_1",ge="_blue_1ot24_10",ye="_red_1ot24_14",Ie="_button_1ot24_18",S={text:Ne,blue:ge,red:ye,button:Ie},Te=({valueAsString:r,highlighting:n})=>{const{onNodeValueClick:t}=j(),o=_.isDefined(t),l=()=>{t?.(r)},a=(0,c.clsx)(S.text,n==="blue"&&S.blue,n==="red"&&S.red);return o?(0,e.jsx)("button",{className:(0,c.clsx)(a,S.button),type:"button",onClick:l,children:r}):(0,e.jsx)("span",{className:a,children:r})},qe="_listItem_1i7if_1",Ae={listItem:qe},I=r=>(0,e.jsxs)("li",{className:Ae.listItem,children:[r.label&&(0,e.jsx)(H,{label:r.label,Icon:r.Icon,highlighting:r.highlighting}),(0,e.jsx)(Te,{valueAsString:r.valueAsString,highlighting:r.highlighting})]}),ke=r=>(0,u.isArray)(r),G=({label:r,value:n,depth:t,keyPath:o})=>{const{getNodeHighlighting:l,emptyStringLabel:a}=j(),s=l?.(o);return _.isDefined(n)?(0,u.isString)(n)?(0,e.jsx)(I,{label:r,valueAsString:(0,u.isNonEmptyString)(n)?n:a,Icon:b.IconTypography,highlighting:s}):(0,u.isNumber)(n)?(0,e.jsx)(I,{label:r,valueAsString:String(n),Icon:b.IconNumber9,highlighting:s}):(0,u.isBoolean)(n)?(0,e.jsx)(I,{label:r,valueAsString:String(n),Icon:b.IconCheckbox,highlighting:s}):ke(n)?(0,e.jsx)(be,{label:r,value:n,depth:t,keyPath:o,highlighting:s}):(0,e.jsx)(pe,{label:r,value:n,depth:t,keyPath:o,highlighting:s}):(0,e.jsx)(I,{label:r,valueAsString:"null",Icon:b.IconCircleOff,highlighting:s})},we="_container_d0cqx_1",Se="_labelContainer_d0cqx_6",Je="_elementsCount_d0cqx_12",Ee="_elementsCountRed_d0cqx_16",Oe="_panel_d0cqx_20",Le="_list_d0cqx_30",Re="_nested_d0cqx_37",v={container:we,labelContainer:Se,elementsCount:Je,elementsCountRed:Ee,panel:Oe,list:Le,nested:Re},$=({label:r,Icon:n,elements:t,renderElementsCount:o,emptyElementsText:l,depth:a,keyPath:s,highlighting:i})=>{const{shouldExpandNodeInitially:C}=j(),f=!_.isDefined(r),[m,d]=(0,h.useState)(C({keyPath:s,depth:a})),q=(0,e.jsx)("ul",{className:(0,c.clsx)(v.list,a>0&&v.nested),children:t.length===0?(0,e.jsx)(I,{valueAsString:l,highlighting:void 0}):t.map(({id:p,label:g,value:A})=>{const k=(0,u.isNonEmptyString)(s)?`${s}.${p}`:String(p);return(0,e.jsx)(G,{label:g,value:A,depth:a+1,keyPath:k},p)})}),N=()=>{d(!m)};return f?(0,e.jsx)("li",{className:v.container,children:q}):(0,e.jsxs)(B.Collapsible.Root,{className:v.container,open:m,render:(0,e.jsx)("li",{}),children:[(0,e.jsxs)("div",{className:v.labelContainer,children:[(0,e.jsx)(he,{isOpen:m,onClick:N,variant:i==="partial-blue"?"blue":i==="red"?i:void 0}),(0,e.jsx)(H,{label:r,Icon:n,highlighting:i==="red"?i:void 0}),o&&(0,e.jsx)("span",{className:(0,c.clsx)(v.elementsCount,i==="red"&&v.elementsCountRed),children:o(t.length)})]}),(0,e.jsx)(B.Collapsible.Panel,{className:v.panel,children:q})]})},De=({value:r,children:n})=>(0,e.jsx)(z.Provider,{value:r,children:n}),$e=({depth:r})=>r<=1,Ve=({value:r,entries:n,shouldExpandNodeInitially:t=$e,...o})=>(0,e.jsx)(De,{value:{...o,shouldExpandNodeInitially:t},children:(0,e.jsx)(_e,{depth:0,children:_.isDefined(n)?(0,e.jsx)($,{elements:n,Icon:b.IconBrackets,depth:0,keyPath:"",emptyElementsText:o.emptyObjectLabel}):(0,e.jsx)(G,{value:r??null,depth:0,keyPath:""})})}),Pe="_row_1hj4l_1",Be="_label_1hj4l_11",Fe="_icon_1hj4l_20",L={row:Pe,label:Be,icon:Fe},Me=({children:r,startIcon:n,value:t,progress:o,progressColor:l,progressValueText:a,render:s,ref:i,className:C,...f})=>{const m=(0,h.useId)(),d=a??t;return(0,T.useRender)({render:s,ref:i,props:{...f,className:(0,c.clsx)(L.row,C),children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:L.label,children:[_.isDefined(n)&&(0,e.jsx)("span",{className:L.icon,"aria-hidden":"true",children:n}),(0,e.jsx)("span",{id:m,children:r})]}),_.isDefined(o)?(0,e.jsx)(W.ProgressRing,{value:o,size:"sm",barColor:l,"aria-labelledby":m,...(0,u.isNonEmptyString)(d)?{"aria-valuetext":d}:{},children:t}):(0,e.jsx)("span",{children:t})]})}})},ze="_root_7l8sk_1",He="_stackedIcon_7l8sk_14",M={root:ze,stackedIcon:He},Ge=({icon:r,stackedIcon:n,className:t,render:o,ref:l,...a})=>(0,T.useRender)({render:o,ref:l,props:{...a,className:(0,c.clsx)(M.root,t),children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{"aria-hidden":"true",children:r}),(0,e.jsx)("span",{"aria-hidden":"true",className:M.stackedIcon,children:n})]})}}),R={background:4,border:6,icon:10},D=(r,n)=>x.themeCssVariables.color[`${r}${n}`]??x.themeCssVariables.tag.text[r],K=r=>{const n=Y.parseThemeColor(r);return{backgroundColor:D(n,R.background),iconColor:D(n,R.icon),borderColor:D(n,R.border)}},Ke="_root_9ntdy_1",Ue={root:Ke},Xe=({icon:r,color:n=x.DEFAULT_THEME_COLOR_FALLBACK,className:t,style:o,render:l,ref:a,...s})=>{const i=K(n);return(0,T.useRender)({render:l,ref:a,props:{...s,className:(0,c.clsx)(Ue.root,t),style:{backgroundColor:i.backgroundColor,color:i.iconColor,...o},children:(0,e.jsx)("span",{"aria-hidden":"true",children:r})}})};Object.defineProperty(exports,"AvatarGroup",{enumerable:!0,get:function(){return oe}});Object.defineProperty(exports,"CommandBlock",{enumerable:!0,get:function(){return ce}});Object.defineProperty(exports,"JsonTree",{enumerable:!0,get:function(){return Ve}});Object.defineProperty(exports,"MetricRow",{enumerable:!0,get:function(){return Me}});Object.defineProperty(exports,"StackIcon",{enumerable:!0,get:function(){return Ge}});Object.defineProperty(exports,"TintedIconTile",{enumerable:!0,get:function(){return Xe}});Object.defineProperty(exports,"getIconTileColorShades",{enumerable:!0,get:function(){return K}});
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { t as v } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
+
import { t as q } from "./doNotTranslate-BSVT8Xyd.js";
|
|
3
|
+
import { a as u, r as H } from "./theme-B2EaXhye.js";
|
|
4
|
+
import { t as E } from "./mergeClassNames-ClFMR1v0.js";
|
|
5
|
+
import { o as A, s as J } from "./utilities-BKCMZyqZ.js";
|
|
6
|
+
import { t as K } from "./Loader-DtHWQH8w.js";
|
|
7
|
+
import { t as D } from "./OverflowingTextWithTooltip-BtB9cGdJ.js";
|
|
8
|
+
import { useRender as x } from "@base-ui/react/use-render";
|
|
9
|
+
import { isBoolean as L, isFunction as Q, isNonEmptyString as W, isString as I } from "@sniptt/guards";
|
|
10
|
+
import { clsx as k } from "clsx";
|
|
11
|
+
import { Fragment as N, jsx as l, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
import { Avatar as z } from "@base-ui/react/avatar";
|
|
13
|
+
var X = "_root_173kq_1", aa = "_avatarPulsing_173kq_1", ta = "_image_173kq_95", ra = "_fallback_173kq_107", B = {
|
|
14
|
+
root: X,
|
|
15
|
+
avatarPulsing: aa,
|
|
16
|
+
image: ta,
|
|
17
|
+
fallback: ra
|
|
18
|
+
}, j = ({ className: a, ...t }) => /* @__PURE__ */ l(z.Fallback, {
|
|
19
|
+
...t,
|
|
20
|
+
className: E(B.fallback, a)
|
|
21
|
+
}), P = ({ className: a, ...t }) => /* @__PURE__ */ l(z.Image, {
|
|
22
|
+
...t,
|
|
23
|
+
className: E(B.image, a)
|
|
24
|
+
}), $ = (a) => a?.trim().charAt(0).toUpperCase(), O = ({ name: a, colorSeed: t = a, size: r = "md", shape: i = "square", variant: e = "soft", color: o, backgroundColor: s, borderColor: c, pulsing: d = !1, ring: n = !1, className: _, style: m, ...g }) => {
|
|
25
|
+
const p = H(), f = $(a), T = f ? o ?? A({
|
|
26
|
+
string: t ?? "",
|
|
27
|
+
variant: 12,
|
|
28
|
+
theme: p
|
|
29
|
+
}) : o ?? p.font.color.tertiary, S = f ? s ?? A({
|
|
30
|
+
string: t ?? "",
|
|
31
|
+
variant: e === "outline" ? 5 : 4,
|
|
32
|
+
theme: p
|
|
33
|
+
}) : s ?? p.background.transparent.light, y = c ?? (f ? A({
|
|
34
|
+
string: t ?? "",
|
|
35
|
+
variant: 6,
|
|
36
|
+
theme: p
|
|
37
|
+
}) : void 0);
|
|
38
|
+
return /* @__PURE__ */ l(z.Root, {
|
|
39
|
+
...g,
|
|
40
|
+
"data-size": r,
|
|
41
|
+
"data-shape": i,
|
|
42
|
+
"data-pulsing": d || void 0,
|
|
43
|
+
"data-ring": n || void 0,
|
|
44
|
+
className: E(B.root, _),
|
|
45
|
+
style: (b) => ({
|
|
46
|
+
"--tw-avatar-color": T,
|
|
47
|
+
"--tw-avatar-background": b.imageLoadingStatus === "loaded" ? "none" : S,
|
|
48
|
+
"--tw-avatar-border": e === "outline" && b.imageLoadingStatus !== "loaded" && y ? q(`1px solid ${y}`) : "none",
|
|
49
|
+
...Q(m) ? m(b) : m
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}, ea = ({ src: a, name: t, icon: r, imageProps: i, fallbackProps: e, backgroundColor: o, ...s }) => {
|
|
53
|
+
const c = $(t), d = v(r) && !L(r) && r !== "", n = i?.alt ?? "", _ = !d && W(n), { children: m = d ? r : c || "-", ...g } = e ?? {}, p = v(g.role) || v(g["aria-label"]) || v(g["aria-labelledby"]), f = !_ && !p && !v(g.render);
|
|
54
|
+
return /* @__PURE__ */ h(O, {
|
|
55
|
+
...s,
|
|
56
|
+
name: t,
|
|
57
|
+
backgroundColor: d ? "inherit" : o,
|
|
58
|
+
children: [!d && /* @__PURE__ */ l(P, {
|
|
59
|
+
src: a ?? void 0,
|
|
60
|
+
...i,
|
|
61
|
+
alt: n
|
|
62
|
+
}), /* @__PURE__ */ l(j, {
|
|
63
|
+
role: _ ? "img" : void 0,
|
|
64
|
+
"aria-label": _ ? n : void 0,
|
|
65
|
+
"aria-hidden": f || void 0,
|
|
66
|
+
...g,
|
|
67
|
+
children: m
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}, La = Object.assign(ea, {
|
|
71
|
+
Root: O,
|
|
72
|
+
Image: P,
|
|
73
|
+
Fallback: j
|
|
74
|
+
}), za = {
|
|
75
|
+
xxl: {
|
|
76
|
+
fontSize: "16px",
|
|
77
|
+
width: "40px"
|
|
78
|
+
},
|
|
79
|
+
xl: {
|
|
80
|
+
fontSize: "16px",
|
|
81
|
+
width: "32px"
|
|
82
|
+
},
|
|
83
|
+
lg: {
|
|
84
|
+
fontSize: "13px",
|
|
85
|
+
width: "24px"
|
|
86
|
+
},
|
|
87
|
+
md: {
|
|
88
|
+
fontSize: "12px",
|
|
89
|
+
width: "16px"
|
|
90
|
+
},
|
|
91
|
+
sm: {
|
|
92
|
+
fontSize: "10px",
|
|
93
|
+
width: "14px"
|
|
94
|
+
},
|
|
95
|
+
xs: {
|
|
96
|
+
fontSize: "8px",
|
|
97
|
+
width: "12px"
|
|
98
|
+
}
|
|
99
|
+
}, oa = "_badge_1bd5g_1", sa = { badge: oa }, Ba = ({ size: a = "sm", color: t = "tertiary", shape: r = "pill", className: i, render: e, ref: o, ...s }) => x({
|
|
100
|
+
defaultTagName: "span",
|
|
101
|
+
render: e,
|
|
102
|
+
ref: o,
|
|
103
|
+
props: {
|
|
104
|
+
...s,
|
|
105
|
+
className: k(sa.badge, i),
|
|
106
|
+
"data-badge-size": a,
|
|
107
|
+
"data-badge-color": t,
|
|
108
|
+
"data-badge-shape": r
|
|
109
|
+
}
|
|
110
|
+
}), la = "_chip_gk059_1", ia = "_label_gk059_32", na = "_endElementDivider_gk059_93", C = {
|
|
111
|
+
chip: la,
|
|
112
|
+
label: ia,
|
|
113
|
+
endElementDivider: na
|
|
114
|
+
}, da = { height: "var(--t-spacing-4)" }, Fa = ({ children: a, size: t = "sm", variant: r = "ghost", color: i = "primary", shape: e = "square", weight: o = "regular", onClick: s, clickable: c = v(s), startElement: d, endElement: n, endElementDivider: _ = !1, maxWidth: m, truncate: g = !0, tooltipContent: p, tooltipDelay: f, isTooltipMultiline: T, tooltipPlace: S, alwaysShowTooltip: y = !1, className: b, style: M, render: U, ref: V, ...Y }) => {
|
|
115
|
+
const Z = v(a) && !L(a) && a !== "", G = I(a) ? {
|
|
116
|
+
text: a,
|
|
117
|
+
tooltipContent: p
|
|
118
|
+
} : {
|
|
119
|
+
text: a ?? !1,
|
|
120
|
+
tooltipContent: p ?? ""
|
|
121
|
+
};
|
|
122
|
+
return x({
|
|
123
|
+
render: U,
|
|
124
|
+
ref: V,
|
|
125
|
+
state: {
|
|
126
|
+
size: t,
|
|
127
|
+
variant: r,
|
|
128
|
+
color: i,
|
|
129
|
+
shape: e,
|
|
130
|
+
weight: o,
|
|
131
|
+
clickable: c,
|
|
132
|
+
truncate: g
|
|
133
|
+
},
|
|
134
|
+
props: {
|
|
135
|
+
...Y,
|
|
136
|
+
onClick: s,
|
|
137
|
+
className: k(C.chip, b),
|
|
138
|
+
style: {
|
|
139
|
+
...v(m) ? { "--tw-chip-max-width": q(`${m}px`) } : {},
|
|
140
|
+
...M
|
|
141
|
+
},
|
|
142
|
+
children: /* @__PURE__ */ h(N, { children: [
|
|
143
|
+
d,
|
|
144
|
+
Z && /* @__PURE__ */ l(D, {
|
|
145
|
+
...G,
|
|
146
|
+
render: /* @__PURE__ */ l("span", {}),
|
|
147
|
+
className: C.label,
|
|
148
|
+
style: t === "md" ? da : void 0,
|
|
149
|
+
truncate: g,
|
|
150
|
+
tooltipDelay: f,
|
|
151
|
+
isTooltipMultiline: T,
|
|
152
|
+
tooltipPlace: S,
|
|
153
|
+
alwaysShowTooltip: y
|
|
154
|
+
}),
|
|
155
|
+
v(n) && n !== !1 && /* @__PURE__ */ h(N, { children: [_ && /* @__PURE__ */ l("span", { className: C.endElementDivider }), n] })
|
|
156
|
+
] })
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}, ca = "_root_6bfj6_1", ma = "_circle_6bfj6_13", F = {
|
|
160
|
+
root: ca,
|
|
161
|
+
circle: ma
|
|
162
|
+
}, Ra = ({ colorName: a, color: t, variant: r, className: i, style: e, render: o, ref: s, ...c }) => x({
|
|
163
|
+
defaultTagName: "div",
|
|
164
|
+
render: o,
|
|
165
|
+
ref: s,
|
|
166
|
+
props: {
|
|
167
|
+
...c,
|
|
168
|
+
className: k(F.root, r === "circle" && F.circle, i),
|
|
169
|
+
style: {
|
|
170
|
+
"--color-sample-color": t ?? u.tag.background[a],
|
|
171
|
+
"--color-sample-border-color": u.tag.text[a],
|
|
172
|
+
...e
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}), ga = "_status_y5v42_1", pa = "_content_y5v42_49", R = {
|
|
176
|
+
status: ga,
|
|
177
|
+
content: pa
|
|
178
|
+
}, qa = ({ children: a, color: t, loading: r = !1, weight: i = "regular", className: e, style: o, render: s, ref: c, ...d }) => {
|
|
179
|
+
const n = J(t);
|
|
180
|
+
return x({
|
|
181
|
+
defaultTagName: "span",
|
|
182
|
+
render: s,
|
|
183
|
+
ref: c,
|
|
184
|
+
state: {
|
|
185
|
+
loading: r,
|
|
186
|
+
weight: i
|
|
187
|
+
},
|
|
188
|
+
props: {
|
|
189
|
+
"aria-busy": r || void 0,
|
|
190
|
+
...d,
|
|
191
|
+
className: k(R.status, e),
|
|
192
|
+
style: {
|
|
193
|
+
"--tw-status-background": u.tag.background[n],
|
|
194
|
+
"--tw-status-text-color": u.tag.text[n],
|
|
195
|
+
...o
|
|
196
|
+
},
|
|
197
|
+
children: /* @__PURE__ */ h(N, { children: [/* @__PURE__ */ l("span", {
|
|
198
|
+
className: R.content,
|
|
199
|
+
children: a
|
|
200
|
+
}), r && /* @__PURE__ */ l(K, {
|
|
201
|
+
color: t,
|
|
202
|
+
"aria-hidden": "true",
|
|
203
|
+
render: /* @__PURE__ */ l("span", {})
|
|
204
|
+
})] })
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}, va = "_tag_1ot0y_1", _a = "_content_1ot0y_49", ua = "_overflowingText_1ot0y_58", fa = "_iconContainer_1ot0y_62", w = {
|
|
208
|
+
tag: va,
|
|
209
|
+
content: _a,
|
|
210
|
+
overflowingText: ua,
|
|
211
|
+
iconContainer: fa
|
|
212
|
+
}, Da = ({ children: a, color: t, weight: r = "regular", variant: i = "soft", startIcon: e, truncate: o = !0, borderStyle: s = "solid", className: c, style: d, render: n, ref: _, ...m }) => x({
|
|
213
|
+
defaultTagName: "span",
|
|
214
|
+
render: n,
|
|
215
|
+
ref: _,
|
|
216
|
+
state: {
|
|
217
|
+
variant: i,
|
|
218
|
+
weight: r,
|
|
219
|
+
truncate: o
|
|
220
|
+
},
|
|
221
|
+
props: {
|
|
222
|
+
...m,
|
|
223
|
+
className: k(w.tag, c),
|
|
224
|
+
style: {
|
|
225
|
+
"--tw-tag-background": t === "transparent" ? "transparent" : u.tag.background[t] ?? u.tag.background.gray,
|
|
226
|
+
"--tw-tag-text": t === "transparent" ? u.font.color.secondary : u.tag.text[t] ?? u.font.color.secondary,
|
|
227
|
+
"--tw-tag-border-style": s,
|
|
228
|
+
...d
|
|
229
|
+
},
|
|
230
|
+
children: /* @__PURE__ */ h(N, { children: [v(e) && !L(e) && e !== "" && /* @__PURE__ */ l("span", {
|
|
231
|
+
className: w.iconContainer,
|
|
232
|
+
"aria-hidden": !0,
|
|
233
|
+
children: e
|
|
234
|
+
}), /* @__PURE__ */ l("span", {
|
|
235
|
+
className: w.content,
|
|
236
|
+
children: I(a) && o ? /* @__PURE__ */ l(D, {
|
|
237
|
+
text: a,
|
|
238
|
+
render: /* @__PURE__ */ l("span", {}),
|
|
239
|
+
className: w.overflowingText
|
|
240
|
+
}) : a
|
|
241
|
+
})] })
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
export {
|
|
245
|
+
Ba as a,
|
|
246
|
+
Fa as i,
|
|
247
|
+
qa as n,
|
|
248
|
+
za as o,
|
|
249
|
+
Ra as r,
|
|
250
|
+
La as s,
|
|
251
|
+
Da as t
|
|
252
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const m=require("./theme-1XkFz8Qu.cjs"),v=require("./isDefined-DS2Q42p5.cjs"),R=require("./doNotTranslate-CHE7WmRS.cjs"),S=require("./mergeClassNames-D4lshrT6.cjs"),y=require("./utilities-xZh8D2gd.cjs"),U=require("./Loader-Bb72CUQ9.cjs"),O=require("./OverflowingTextWithTooltip-BQmpPObX.cjs");let h=require("@base-ui/react/use-render"),f=require("@sniptt/guards"),T=require("clsx"),t=require("react/jsx-runtime"),w=require("@base-ui/react/avatar");var W="_root_173kq_1",Z="_avatarPulsing_173kq_1",G="_image_173kq_95",H="_fallback_173kq_107",A={root:W,avatarPulsing:Z,image:G,fallback:H},B=({className:e,...a})=>(0,t.jsx)(w.Avatar.Fallback,{...a,className:S.mergeClassNames(A.fallback,e)}),E=({className:e,...a})=>(0,t.jsx)(w.Avatar.Image,{...a,className:S.mergeClassNames(A.image,e)}),V=e=>e?.trim().charAt(0).toUpperCase(),F=({name:e,colorSeed:a=e,size:r="md",shape:o="square",variant:s="soft",color:i,backgroundColor:n,borderColor:u,pulsing:d=!1,ring:l=!1,className:p,style:c,...g})=>{const _=m.useTheme(),b=V(e),k=b?i??y.stringToThemeColorP3String({string:a??"",variant:12,theme:_}):i??_.font.color.tertiary,q=b?n??y.stringToThemeColorP3String({string:a??"",variant:s==="outline"?5:4,theme:_}):n??_.background.transparent.light,j=u??(b?y.stringToThemeColorP3String({string:a??"",variant:6,theme:_}):void 0);return(0,t.jsx)(w.Avatar.Root,{...g,"data-size":r,"data-shape":o,"data-pulsing":d||void 0,"data-ring":l||void 0,className:S.mergeClassNames(A.root,p),style:x=>({"--tw-avatar-color":k,"--tw-avatar-background":x.imageLoadingStatus==="loaded"?"none":q,"--tw-avatar-border":s==="outline"&&x.imageLoadingStatus!=="loaded"&&j?R.doNotTranslate(`1px solid ${j}`):"none",...(0,f.isFunction)(c)?c(x):c})})},J=({src:e,name:a,icon:r,imageProps:o,fallbackProps:s,backgroundColor:i,...n})=>{const u=V(a),d=v.isDefined(r)&&!(0,f.isBoolean)(r)&&r!=="",l=o?.alt??"",p=!d&&(0,f.isNonEmptyString)(l),{children:c=d?r:u||"-",...g}=s??{},_=v.isDefined(g.role)||v.isDefined(g["aria-label"])||v.isDefined(g["aria-labelledby"]),b=!p&&!_&&!v.isDefined(g.render);return(0,t.jsxs)(F,{...n,name:a,backgroundColor:d?"inherit":i,children:[!d&&(0,t.jsx)(E,{src:e??void 0,...o,alt:l}),(0,t.jsx)(B,{role:p?"img":void 0,"aria-label":p?l:void 0,"aria-hidden":b||void 0,...g,children:c})]})},K=Object.assign(J,{Root:F,Image:E,Fallback:B}),Q={xxl:{fontSize:"16px",width:"40px"},xl:{fontSize:"16px",width:"32px"},lg:{fontSize:"13px",width:"24px"},md:{fontSize:"12px",width:"16px"},sm:{fontSize:"10px",width:"14px"},xs:{fontSize:"8px",width:"12px"}},X="_badge_1bd5g_1",ee={badge:X},ae=({size:e="sm",color:a="tertiary",shape:r="pill",className:o,render:s,ref:i,...n})=>(0,h.useRender)({defaultTagName:"span",render:s,ref:i,props:{...n,className:(0,T.clsx)(ee.badge,o),"data-badge-size":e,"data-badge-color":a,"data-badge-shape":r}}),te="_chip_gk059_1",re="_label_gk059_32",se="_endElementDivider_gk059_93",N={chip:te,label:re,endElementDivider:se},ie={height:"var(--t-spacing-4)"},ne=({children:e,size:a="sm",variant:r="ghost",color:o="primary",shape:s="square",weight:i="regular",onClick:n,clickable:u=v.isDefined(n),startElement:d,endElement:l,endElementDivider:p=!1,maxWidth:c,truncate:g=!0,tooltipContent:_,tooltipDelay:b,isTooltipMultiline:k,tooltipPlace:q,alwaysShowTooltip:j=!1,className:x,style:L,render:I,ref:z,...$})=>{const Y=v.isDefined(e)&&!(0,f.isBoolean)(e)&&e!=="",M=(0,f.isString)(e)?{text:e,tooltipContent:_}:{text:e??!1,tooltipContent:_??""};return(0,h.useRender)({render:I,ref:z,state:{size:a,variant:r,color:o,shape:s,weight:i,clickable:u,truncate:g},props:{...$,onClick:n,className:(0,T.clsx)(N.chip,x),style:{...v.isDefined(c)?{"--tw-chip-max-width":R.doNotTranslate(`${c}px`)}:{},...L},children:(0,t.jsxs)(t.Fragment,{children:[d,Y&&(0,t.jsx)(O.OverflowingTextWithTooltip,{...M,render:(0,t.jsx)("span",{}),className:N.label,style:a==="md"?ie:void 0,truncate:g,tooltipDelay:b,isTooltipMultiline:k,tooltipPlace:q,alwaysShowTooltip:j}),v.isDefined(l)&&l!==!1&&(0,t.jsxs)(t.Fragment,{children:[p&&(0,t.jsx)("span",{className:N.endElementDivider}),l]})]})}})},oe="_root_6bfj6_1",le="_circle_6bfj6_13",D={root:oe,circle:le},de=({colorName:e,color:a,variant:r,className:o,style:s,render:i,ref:n,...u})=>(0,h.useRender)({defaultTagName:"div",render:i,ref:n,props:{...u,className:(0,T.clsx)(D.root,r==="circle"&&D.circle,o),style:{"--color-sample-color":a??m.themeCssVariables.tag.background[e],"--color-sample-border-color":m.themeCssVariables.tag.text[e],...s}}}),ue="_status_y5v42_1",ce="_content_y5v42_49",P={status:ue,content:ce},ge=({children:e,color:a,loading:r=!1,weight:o="regular",className:s,style:i,render:n,ref:u,...d})=>{const l=y.parseThemeColor(a);return(0,h.useRender)({defaultTagName:"span",render:n,ref:u,state:{loading:r,weight:o},props:{"aria-busy":r||void 0,...d,className:(0,T.clsx)(P.status,s),style:{"--tw-status-background":m.themeCssVariables.tag.background[l],"--tw-status-text-color":m.themeCssVariables.tag.text[l],...i},children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:P.content,children:e}),r&&(0,t.jsx)(U.Loader,{color:a,"aria-hidden":"true",render:(0,t.jsx)("span",{})})]})}})},_e="_tag_1ot0y_1",me="_content_1ot0y_49",ve="_overflowingText_1ot0y_58",pe="_iconContainer_1ot0y_62",C={tag:_e,content:me,overflowingText:ve,iconContainer:pe},be=({children:e,color:a,weight:r="regular",variant:o="soft",startIcon:s,truncate:i=!0,borderStyle:n="solid",className:u,style:d,render:l,ref:p,...c})=>(0,h.useRender)({defaultTagName:"span",render:l,ref:p,state:{variant:o,weight:r,truncate:i},props:{...c,className:(0,T.clsx)(C.tag,u),style:{"--tw-tag-background":a==="transparent"?"transparent":m.themeCssVariables.tag.background[a]??m.themeCssVariables.tag.background.gray,"--tw-tag-text":a==="transparent"?m.themeCssVariables.font.color.secondary:m.themeCssVariables.tag.text[a]??m.themeCssVariables.font.color.secondary,"--tw-tag-border-style":n,...d},children:(0,t.jsxs)(t.Fragment,{children:[v.isDefined(s)&&!(0,f.isBoolean)(s)&&s!==""&&(0,t.jsx)("span",{className:C.iconContainer,"aria-hidden":!0,children:s}),(0,t.jsx)("span",{className:C.content,children:(0,f.isString)(e)&&i?(0,t.jsx)(O.OverflowingTextWithTooltip,{text:e,render:(0,t.jsx)("span",{}),className:C.overflowingText}):e})]})}});Object.defineProperty(exports,"AVATAR_PROPERTIES_BY_SIZE",{enumerable:!0,get:function(){return Q}});Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return K}});Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return ae}});Object.defineProperty(exports,"Chip",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"ColorSample",{enumerable:!0,get:function(){return de}});Object.defineProperty(exports,"Status",{enumerable:!0,get:function(){return ge}});Object.defineProperty(exports,"Tag",{enumerable:!0,get:function(){return be}});
|