twenty-ui 2.48.0 → 2.49.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/README.md +27 -2
- package/dist/Avatar-C6WxBgjS.cjs +1 -0
- package/dist/{Avatar-D-QA0RE5.js → Avatar-ifVlxbx_.js} +18 -17
- package/dist/{Button-D5enZ0Qz.js → Button-DIw804CX.js} +1 -1
- package/dist/{Button-Dbi5P05r.cjs → Button-DTm1WDzp.cjs} +1 -1
- package/dist/Dropdown-1OAJvS1f.js +1000 -0
- package/dist/Dropdown-Bl4OXCf9.cjs +1 -0
- package/dist/{ListItem-CjnrSbka.js → ListItem-DizNUBT8.js} +1 -1
- package/dist/{ListItem-CHTR-GLd.cjs → ListItem-DwBb-I1D.cjs} +1 -1
- package/dist/{ProgressBar-BvT1dyFo.js → ProgressBar-B3xACTV2.js} +1 -1
- package/dist/{ProgressBar-DfFz0fFB.cjs → ProgressBar-OpSMnDBz.cjs} +1 -1
- package/dist/{Radio-DMI1B7o5.js → Radio-BEAztmPu.js} +1 -1
- package/dist/{Radio-xmHgGHQO.cjs → Radio-Dx6b4SYZ.cjs} +1 -1
- package/dist/ResizeHandle-B1MuHTNA.cjs +1 -0
- package/dist/{ResizeHandle-C1kQ3MYR.js → ResizeHandle-B30OYZxS.js} +56 -55
- package/dist/Shortcut-Bp9iDdQg.js +73 -0
- package/dist/Shortcut-N8TELGPI.cjs +1 -0
- package/dist/{TintedIconTile-4BGa8g8n.js → TintedIconTile-B1XDtGrF.js} +1 -1
- package/dist/{TintedIconTile-CU2hCerq.cjs → TintedIconTile-DO1XJXCQ.cjs} +1 -1
- package/dist/components/__stories__/reading-direction/DirectionalLayoutExample.d.ts +3 -1
- package/dist/components/code-editor.cjs +1 -1
- package/dist/components/code-editor.mjs +52 -51
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +2 -2
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/CountrySelect/CountrySelect.d.ts +5 -2
- package/dist/components/input/CountrySelect/__stories__/CountrySelectPartsExample.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectComponent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContext.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContextValue.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectDropdown.d.ts +4 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectOptions.d.ts +2 -11
- package/dist/components/input/CountrySelect/internal/CountrySelectOptionsContent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectRoot.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectTrigger.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/NO_COUNTRY_SELECTION_VALUE.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/PreparedCountryChoice.d.ts +5 -0
- package/dist/components/input/CountrySelect/internal/getCountrySelectionValue.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/useCountrySelectContextOrThrow.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountryChoice.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsProps.d.ts +10 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsState.d.ts +4 -0
- package/dist/components/input/CountrySelect/types/CountrySelectProps.d.ts +7 -13
- package/dist/components/input/CountrySelect/types/CountrySelectRootProps.d.ts +12 -0
- package/dist/components/input/CountrySelect/types/CountrySelectTriggerProps.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/CurrencyPicker.d.ts +4 -3
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerChangingDefaultExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledSearchExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerExample.d.ts +3 -4
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerListLabelExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerRootStateExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerContext.d.ts +11 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerOptions.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerRoot.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerShorthand.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerTrigger.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/PreparedCurrencyPickerOption.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/internal/getCurrencyPickerSearchText.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/useCurrencyPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerChangeEventDetails.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOption.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOptionsProps.d.ts +6 -5
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerProps.d.ts +10 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerRootProps.d.ts +17 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerState.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerTriggerProps.d.ts +3 -2
- package/dist/components/input/IconButton/__stories__/IconButtonExample.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/PhoneCountryPicker.d.ts +5 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/PhoneCountryPickerExample.d.ts +7 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/testDisabledPhoneCountryPicker.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryCallingCodeDirection.d.ts +3 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryNullSelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountrySelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerContext.d.ts +9 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerOptions.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerRoot.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerTrigger.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PreparedPhoneCountryOption.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/getPhoneCountryOptionTooltipLabel.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/matchesPhoneCountrySearch.d.ts +6 -0
- package/dist/components/input/PhoneCountryPicker/internal/usePhoneCountryPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryOption.d.ts +1 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerOptionsProps.d.ts +4 -5
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerProps.d.ts +10 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerRootProps.d.ts +12 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerTriggerProps.d.ts +1 -3
- package/dist/components/input/index.d.ts +10 -0
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +13 -13
- package/dist/components/layout/OverflowingList/internal/measureItemWidths.d.ts +1 -2
- package/dist/components/layout/OverflowingList/internal/measureOverflowingListLayout.d.ts +1 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +1 -1
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +2 -1
- package/dist/components/navigation/Dropdown/__stories__/DropdownIconGridExample.d.ts +3 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownSelectionGroupsExample.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/DropdownContextValue.d.ts +6 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItem.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItemOwner.d.ts +7 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContext.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContextValue.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroup.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroupEffect.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/createDropdownSelectionEventDetails.d.ts +5 -0
- package/dist/components/navigation/Dropdown/internal/dropdownItemActivation.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownItemExplicitId.d.ts +2 -2
- package/dist/components/navigation/Dropdown/internal/getDropdownOptionItemRole.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownSelectionGroupState.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/getTrailingFocusGuard.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/isDropdownOptionItemSelected.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/useDropdownSelections.d.ts +12 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemProps.d.ts +7 -2
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemSelectEventDetails.d.ts +2 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemState.d.ts +5 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupChangeEventDetails.d.ts +7 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupProps.d.ts +21 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupState.d.ts +7 -0
- package/dist/components/navigation/index.d.ts +5 -0
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.mjs +2 -2
- package/dist/components/settings.cjs +1 -1
- package/dist/components/settings.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +22 -22
- package/dist/data-display-BSKGlijb.cjs +1 -0
- package/dist/{data-display-KyZbLLy-.js → data-display-BtXCGOGw.js} +81 -80
- package/dist/{data-display-0QO_WDSs.js → data-display-DtXIhJ4B.js} +45 -44
- package/dist/data-display-XV3ht1rC.cjs +2 -0
- package/dist/doNotTranslate-BSVT8Xyd.js +4 -0
- package/dist/doNotTranslate-CHE7WmRS.cjs +1 -0
- package/dist/feedback-Cs-38OH4.cjs +1 -0
- package/dist/{feedback-CM6fatE8.js → feedback-DTyVVcTb.js} +198 -197
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +42 -42
- package/dist/{input-CJDYNwoO.cjs → input-B_rBplmn.cjs} +1 -1
- package/dist/input-BrjD91wv.js +785 -0
- package/dist/input-ChlFcqIS.cjs +1 -0
- package/dist/{input-DRpDiMRi.js → input-D1oyk0tD.js} +2 -2
- package/dist/layout-CthYckvl.cjs +1 -0
- package/dist/layout-DQcjBu08.js +439 -0
- package/dist/{navigation-B1SRvzKK.js → navigation-B6nka3bW.js} +125 -128
- package/dist/navigation-CIVYqPc5.js +132 -0
- package/dist/navigation-CflGBYv-.cjs +1 -0
- package/dist/navigation-DoInK0Sp.cjs +1 -0
- package/dist/preventDismissingClickActivation-AaqHBLnW.js +45 -0
- package/dist/preventDismissingClickActivation-CIhWvKCu.cjs +1 -0
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +2 -2
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +1 -1
- package/dist/primitives/input/Radio/__stories__/RadioCardContent.d.ts +8 -0
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +3 -3
- package/dist/primitives/layout/ResizeHandle/__stories__/ResizableNotesExample.d.ts +2 -0
- package/dist/primitives/layout.cjs +1 -1
- package/dist/primitives/layout.mjs +1 -1
- package/dist/primitives/navigation.cjs +1 -1
- package/dist/primitives/navigation.mjs +2 -2
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +2 -2
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +11 -11
- package/dist/{settings-BjEZiHXE.js → settings-BgVuLpg9.js} +1 -1
- package/dist/{settings-BAYsnlZJ.cjs → settings-CPXhrmbK.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/testing/GroupedCatalog.d.ts +14 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +96 -66
- package/dist/{typography-fOTFr0jS.js → typography-DT2eKLvd.js} +1 -1
- package/dist/{typography-B5QEuPaL.cjs → typography-bKeSMuJd.cjs} +1 -1
- package/dist/useIsMobile-Byp9AIq-.cjs +1 -0
- package/dist/useIsMobile-D1ImfQnE.js +38 -0
- package/dist/utilities/internal/doNotTranslate.d.ts +1 -0
- package/dist/utilities-BKCMZyqZ.js +53 -0
- package/dist/utilities-xZh8D2gd.cjs +1 -0
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +3 -3
- package/package.json +3 -3
- package/dist/Avatar-CQhIEazb.cjs +0 -1
- package/dist/Dropdown-BKjAaZS0.cjs +0 -1
- package/dist/Dropdown-C2hXrjvD.js +0 -820
- package/dist/ResizeHandle-DI4LHIQm.cjs +0 -1
- package/dist/Shortcut-BvWUZ3pb.js +0 -72
- package/dist/Shortcut-CgrdLv_L.cjs +0 -1
- package/dist/data-display-CPmTJAWJ.cjs +0 -1
- package/dist/data-display-DjhAHvj1.cjs +0 -2
- package/dist/feedback-ybO4n69s.cjs +0 -1
- package/dist/input-3D2lXywH.cjs +0 -1
- package/dist/input-TM3nUdu6.js +0 -554
- package/dist/layout-BszCDxAO.js +0 -441
- package/dist/layout-VaIq7Sjr.cjs +0 -1
- package/dist/navigation-CYAs2LnR.js +0 -131
- package/dist/navigation-CthkGHJ8.cjs +0 -1
- package/dist/navigation-DrOV5E67.cjs +0 -1
- package/dist/preventDismissingClickActivation-CzWqpjiX.js +0 -44
- package/dist/preventDismissingClickActivation-DZxTSLV3.cjs +0 -1
- package/dist/useIsMobile-DxOPI2_E.cjs +0 -1
- package/dist/useIsMobile-nrufFzMb.js +0 -37
- package/dist/utilities-BeLfNQ0Q.cjs +0 -1
- package/dist/utilities-CEi9I09B.js +0 -52
package/dist/testing.mjs
CHANGED
|
@@ -1,90 +1,91 @@
|
|
|
1
1
|
import { t as w } from "./isDefined-fMi6eQ4r.js";
|
|
2
2
|
import { a as Q } from "./theme-B2EaXhye.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { t as B } from "./Heading-pXllCJCO.js";
|
|
4
|
+
import { isFunction as _, isNumber as U, isString as V } from "@sniptt/guards";
|
|
5
|
+
import { clsx as f } from "clsx";
|
|
6
|
+
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
6
7
|
var q = {
|
|
7
8
|
test: "error",
|
|
8
9
|
config: { rules: [{
|
|
9
10
|
id: "color-contrast",
|
|
10
11
|
enabled: !1
|
|
11
12
|
}] }
|
|
12
|
-
}, T = "_layout_17ld0_1",
|
|
13
|
-
className:
|
|
13
|
+
}, T = "_layout_17ld0_1", y = { layout: T }, F = ({ width: e, backgroundColor: r, height: A, children: t }) => /* @__PURE__ */ a("div", {
|
|
14
|
+
className: y.layout,
|
|
14
15
|
style: {
|
|
15
|
-
background:
|
|
16
|
-
height: w(
|
|
16
|
+
background: r,
|
|
17
|
+
height: w(A) ? `${A}px` : "fit-content",
|
|
17
18
|
minWidth: e ? "unset" : "300px",
|
|
18
19
|
width: e ? `${e}px` : "fit-content"
|
|
19
20
|
},
|
|
20
21
|
children: t
|
|
21
|
-
}), M = "_columnTitle_5dert_1", N = "_rowsTitle_5dert_7", k = "_rowTitle_5dert_15",
|
|
22
|
+
}), M = "_columnTitle_5dert_1", N = "_rowsTitle_5dert_7", k = "_rowTitle_5dert_15", S = "_elementTitle_5dert_23", b = "_container_5dert_32", I = "_columnContainer_5dert_37", D = "_rowsContainer_5dert_43", L = "_rowContainer_5dert_49", W = "_elementContainer_5dert_56", j = "_cellContainer_5dert_60", i = {
|
|
22
23
|
columnTitle: M,
|
|
23
24
|
rowsTitle: N,
|
|
24
25
|
rowTitle: k,
|
|
25
|
-
elementTitle:
|
|
26
|
-
container:
|
|
27
|
-
columnContainer:
|
|
26
|
+
elementTitle: S,
|
|
27
|
+
container: b,
|
|
28
|
+
columnContainer: I,
|
|
28
29
|
rowsContainer: D,
|
|
29
|
-
rowContainer:
|
|
30
|
-
elementContainer:
|
|
31
|
-
cellContainer:
|
|
32
|
-
},
|
|
30
|
+
rowContainer: L,
|
|
31
|
+
elementContainer: W,
|
|
32
|
+
cellContainer: j
|
|
33
|
+
}, g = {
|
|
33
34
|
name: "",
|
|
34
35
|
values: [void 0],
|
|
35
36
|
props: () => ({})
|
|
36
|
-
},
|
|
37
|
-
const { catalog: { dimensions:
|
|
37
|
+
}, p = (e) => V(e) || U(e), $ = (e, r) => {
|
|
38
|
+
const { catalog: { dimensions: A = [], options: t = {} } = {
|
|
38
39
|
dimensions: [],
|
|
39
40
|
options: {}
|
|
40
|
-
} } =
|
|
41
|
-
if (!
|
|
42
|
-
const [
|
|
41
|
+
} } = r.parameters || {};
|
|
42
|
+
if (!A || !Array.isArray(A)) return /* @__PURE__ */ a(e, {});
|
|
43
|
+
const [n = g, o = g, C = g, h = g] = A;
|
|
43
44
|
return /* @__PURE__ */ a("div", {
|
|
44
|
-
className:
|
|
45
|
-
children:
|
|
46
|
-
className:
|
|
45
|
+
className: i.container,
|
|
46
|
+
children: h.values.map((c, u) => /* @__PURE__ */ l("div", {
|
|
47
|
+
className: i.columnContainer,
|
|
47
48
|
children: [/* @__PURE__ */ a("div", {
|
|
48
|
-
className:
|
|
49
|
-
children:
|
|
50
|
-
}),
|
|
51
|
-
className:
|
|
49
|
+
className: i.columnTitle,
|
|
50
|
+
children: h.labels?.(c) ?? (p(c) ? c : "")
|
|
51
|
+
}), C.values.map((d, v) => /* @__PURE__ */ l("div", {
|
|
52
|
+
className: i.rowsContainer,
|
|
52
53
|
children: [/* @__PURE__ */ a("div", {
|
|
53
|
-
className:
|
|
54
|
-
children:
|
|
55
|
-
}),
|
|
56
|
-
className:
|
|
54
|
+
className: i.rowsTitle,
|
|
55
|
+
children: C.labels?.(d) ?? (p(d) ? d : "")
|
|
56
|
+
}), o.values.map((m, R) => /* @__PURE__ */ l("div", {
|
|
57
|
+
className: i.rowContainer,
|
|
57
58
|
children: [/* @__PURE__ */ a("div", {
|
|
58
|
-
className:
|
|
59
|
-
children:
|
|
60
|
-
}),
|
|
61
|
-
className:
|
|
62
|
-
id:
|
|
59
|
+
className: i.rowTitle,
|
|
60
|
+
children: o.labels?.(m) ?? (p(m) ? m : "")
|
|
61
|
+
}), n.values.map((s, E) => /* @__PURE__ */ l("div", {
|
|
62
|
+
className: i.cellContainer,
|
|
63
|
+
id: A.length > 1 ? `catalog-cell-${u}-${v}-${R}-${E}` : s,
|
|
63
64
|
children: [/* @__PURE__ */ a("span", {
|
|
64
|
-
className:
|
|
65
|
-
children:
|
|
65
|
+
className: i.elementTitle,
|
|
66
|
+
children: n.labels?.(s) ?? (p(s) ? s : "")
|
|
66
67
|
}), /* @__PURE__ */ a("div", {
|
|
67
|
-
className:
|
|
68
|
+
className: f(i.elementContainer, t?.elementContainer?.className),
|
|
68
69
|
style: {
|
|
69
70
|
minWidth: t?.elementContainer?.width ? `${t.elementContainer.width}px` : "auto",
|
|
70
71
|
...t?.elementContainer?.style
|
|
71
72
|
},
|
|
72
73
|
children: /* @__PURE__ */ a(e, { args: {
|
|
73
|
-
...
|
|
74
|
-
...
|
|
75
|
-
...
|
|
76
|
-
...
|
|
77
|
-
...
|
|
74
|
+
...r.args,
|
|
75
|
+
...n.props(s),
|
|
76
|
+
...o.props(m),
|
|
77
|
+
...C.props(d),
|
|
78
|
+
...h.props(c)
|
|
78
79
|
} })
|
|
79
80
|
})]
|
|
80
|
-
}, `d1-${
|
|
81
|
-
}, `d2-${
|
|
82
|
-
}, `d3-${
|
|
83
|
-
}, `d4-${
|
|
81
|
+
}, `d1-${E}`))]
|
|
82
|
+
}, `d2-${R}`))]
|
|
83
|
+
}, `d3-${v}`))]
|
|
84
|
+
}, `d4-${u}`))
|
|
84
85
|
});
|
|
85
|
-
},
|
|
86
|
+
}, K = (e, r) => {
|
|
86
87
|
if (e)
|
|
87
|
-
switch (
|
|
88
|
+
switch (r) {
|
|
88
89
|
case "default":
|
|
89
90
|
return Q.grayScale.gray11;
|
|
90
91
|
case "danger":
|
|
@@ -94,15 +95,43 @@ var q = {
|
|
|
94
95
|
default:
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
|
-
},
|
|
98
|
-
const { container:
|
|
98
|
+
}, P = (e, r) => {
|
|
99
|
+
const { container: A } = r.parameters, t = r.args.inverted, n = r.args.accent, o = K(t, n);
|
|
99
100
|
return /* @__PURE__ */ a(F, {
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
102
|
-
backgroundColor:
|
|
101
|
+
width: A?.width,
|
|
102
|
+
height: A?.height,
|
|
103
|
+
backgroundColor: o,
|
|
103
104
|
children: /* @__PURE__ */ a(e, {})
|
|
104
105
|
});
|
|
105
|
-
},
|
|
106
|
+
}, x = ({ groups: e, renderExample: r }) => /* @__PURE__ */ a("div", {
|
|
107
|
+
style: {
|
|
108
|
+
display: "grid",
|
|
109
|
+
gap: "var(--t-spacing-6)",
|
|
110
|
+
width: "100%"
|
|
111
|
+
},
|
|
112
|
+
children: e.map(({ label: A, examples: t }) => /* @__PURE__ */ l("section", {
|
|
113
|
+
"aria-label": A,
|
|
114
|
+
children: [/* @__PURE__ */ a(B, {
|
|
115
|
+
level: 3,
|
|
116
|
+
children: A
|
|
117
|
+
}), /* @__PURE__ */ a("div", {
|
|
118
|
+
style: {
|
|
119
|
+
display: "flex",
|
|
120
|
+
flexWrap: "wrap",
|
|
121
|
+
gap: "var(--t-spacing-6)",
|
|
122
|
+
marginTop: "var(--t-spacing-3)"
|
|
123
|
+
},
|
|
124
|
+
children: t.map((n) => /* @__PURE__ */ a("div", {
|
|
125
|
+
style: {
|
|
126
|
+
display: "grid",
|
|
127
|
+
gap: "var(--t-spacing-2)",
|
|
128
|
+
justifyItems: "start"
|
|
129
|
+
},
|
|
130
|
+
children: r(n)
|
|
131
|
+
}, n.label))
|
|
132
|
+
})]
|
|
133
|
+
}, A))
|
|
134
|
+
}), z = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAYABgAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABgAAAAAQAAAGAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABSgAwAEAAAAAQAAABQAAAAA/8AAEQgAFAAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/bAEMACwgICggHCwoJCg0MCw0RHBIRDw8RIhkaFBwpJCsqKCQnJy0yQDctMD0wJyc4TDk9Q0VISUgrNk9VTkZUQEdIRf/bAEMBDA0NEQ8RIRISIUUuJy5FRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRf/dAAQAAv/aAAwDAQACEQMRAD8Ava1q728otYY98joSCTgZrnbXWdTtrhrfVZXWLafmcAEkdgR/hVltQku9Q8+OIEBcGOT+ID0PY1ka1KH2u8ToqnPLbmIqG7u6LtbQ7RXBRec4Uck9eKXcPWsKDWVnhWSL5kYcFelSf2m3901POh8jP//QoyIAnTuKpXsY82NsksUyWPU5q/L9z8RVK++/F/uCsVsaEURwgA4HtT9x9TUcf3KfUGh//9k=", Y = (e) => Object.assign(new EventTarget(), {
|
|
106
135
|
media: e,
|
|
107
136
|
matches: !1,
|
|
108
137
|
onchange: null,
|
|
@@ -110,20 +139,21 @@ var q = {
|
|
|
110
139
|
},
|
|
111
140
|
removeListener: () => {
|
|
112
141
|
}
|
|
113
|
-
}),
|
|
114
|
-
const
|
|
115
|
-
return window.matchMedia = (
|
|
116
|
-
const t = _(
|
|
117
|
-
return w(
|
|
142
|
+
}), ee = (e) => {
|
|
143
|
+
const r = window.matchMedia;
|
|
144
|
+
return window.matchMedia = (A) => {
|
|
145
|
+
const t = _(r) ? r.call(window, A) : Y(A), n = e[A];
|
|
146
|
+
return w(n) && Object.defineProperty(t, "matches", { value: n }), t;
|
|
118
147
|
}, () => {
|
|
119
|
-
window.matchMedia =
|
|
148
|
+
window.matchMedia = r;
|
|
120
149
|
};
|
|
121
150
|
};
|
|
122
151
|
export {
|
|
123
152
|
q as A11Y_DEFER_COLOR_CONTRAST,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
153
|
+
z as AVATAR_URL_MOCK,
|
|
154
|
+
$ as CatalogDecorator,
|
|
155
|
+
P as ComponentDecorator,
|
|
127
156
|
F as ComponentStorybookLayout,
|
|
128
|
-
|
|
157
|
+
x as GroupedCatalog,
|
|
158
|
+
ee as overrideMediaQueryMatches
|
|
129
159
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as r } from "./Shortcut-
|
|
1
|
+
import { n as r } from "./Shortcut-Bp9iDdQg.js";
|
|
2
2
|
import { n as e } from "./OverflowingTextWithTooltip-BmUROIah.js";
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
var v = ({ mode: o, children: t }) => /* @__PURE__ */ i(e.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=require("./Shortcut-
|
|
1
|
+
const t=require("./Shortcut-N8TELGPI.cjs"),o=require("./OverflowingTextWithTooltip-Z2daM0_x.cjs");let i=require("react/jsx-runtime");var n=({mode:e,children:r})=>(0,i.jsx)(o.OverflowingTextTooltipModeContext.Provider,{value:e,children:r}),u=e=>t.getShortcutPresentation(e).text;Object.defineProperty(exports,"OverflowingTextTooltipModeProvider",{enumerable:!0,get:function(){return n}});Object.defineProperty(exports,"formatShortcut",{enumerable:!0,get:function(){return u}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const S=require("./theme-1XkFz8Qu.cjs"),u=require("./isDefined-DS2Q42p5.cjs"),s=require("./doNotTranslate-CHE7WmRS.cjs");let a=require("@sniptt/guards"),c=require("react");var l=()=>{const r=globalThis.navigator?.userAgent;if(!(0,a.isString)(r))return"unknown";const e=r.toLowerCase();return e.includes("ios")||e.includes("iphone")||e.includes("ipad")?"ios":e.includes(s.doNotTranslate("mac os x"))||e.includes("macos")?"mac":e.includes("windows")?"windows":e.includes("android")?"android":e.includes("linux")?"linux":"unknown"},o=s.doNotTranslate("(max-width: 768px)"),f={getSnapshot:()=>!1,subscribe:()=>()=>{}},i=new WeakMap,g=r=>({getSnapshot:()=>r.matches,subscribe:e=>(r.addEventListener("change",e),()=>r.removeEventListener("change",e))}),y=r=>{const e=i.get(r);if(u.isDefined(e))return e;const t=new Map;return i.set(r,t),t},M=r=>{if(typeof window>"u"||!(0,a.isFunction)(window.matchMedia))return f;const e=y(window.matchMedia),t=e.get(r);if(u.isDefined(t))return t;const n=g(window.matchMedia(r));return e.set(r,n),n},m=()=>!1,d=r=>{const{subscribe:e,getSnapshot:t}=M(r);return(0,c.useSyncExternalStore)(e,t,m)},w=()=>d(o);Object.defineProperty(exports,"MOBILE_MEDIA_QUERY",{enumerable:!0,get:function(){return o}});Object.defineProperty(exports,"getUserDevice",{enumerable:!0,get:function(){return l}});Object.defineProperty(exports,"useIsMobile",{enumerable:!0,get:function(){return w}});Object.defineProperty(exports,"useMediaQuery",{enumerable:!0,get:function(){return d}});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as s } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
+
import { t as a } from "./doNotTranslate-BSVT8Xyd.js";
|
|
3
|
+
import "./theme-B2EaXhye.js";
|
|
4
|
+
import { isFunction as o, isString as u } from "@sniptt/guards";
|
|
5
|
+
import { useSyncExternalStore as d } from "react";
|
|
6
|
+
var E = () => {
|
|
7
|
+
const r = globalThis.navigator?.userAgent;
|
|
8
|
+
if (!u(r)) return "unknown";
|
|
9
|
+
const e = r.toLowerCase();
|
|
10
|
+
return e.includes("ios") || e.includes("iphone") || e.includes("ipad") ? "ios" : e.includes(a("mac os x")) || e.includes("macos") ? "mac" : e.includes("windows") ? "windows" : e.includes("android") ? "android" : e.includes("linux") ? "linux" : "unknown";
|
|
11
|
+
}, c = a("(max-width: 768px)"), m = {
|
|
12
|
+
getSnapshot: () => !1,
|
|
13
|
+
subscribe: () => () => {
|
|
14
|
+
}
|
|
15
|
+
}, i = /* @__PURE__ */ new WeakMap(), f = (r) => ({
|
|
16
|
+
getSnapshot: () => r.matches,
|
|
17
|
+
subscribe: (e) => (r.addEventListener("change", e), () => r.removeEventListener("change", e))
|
|
18
|
+
}), l = (r) => {
|
|
19
|
+
const e = i.get(r);
|
|
20
|
+
if (s(e)) return e;
|
|
21
|
+
const t = /* @__PURE__ */ new Map();
|
|
22
|
+
return i.set(r, t), t;
|
|
23
|
+
}, w = (r) => {
|
|
24
|
+
if (typeof window > "u" || !o(window.matchMedia)) return m;
|
|
25
|
+
const e = l(window.matchMedia), t = e.get(r);
|
|
26
|
+
if (s(t)) return t;
|
|
27
|
+
const n = f(window.matchMedia(r));
|
|
28
|
+
return e.set(r, n), n;
|
|
29
|
+
}, S = () => !1, p = (r) => {
|
|
30
|
+
const { subscribe: e, getSnapshot: t } = w(r);
|
|
31
|
+
return d(e, t, S);
|
|
32
|
+
}, b = () => p(c);
|
|
33
|
+
export {
|
|
34
|
+
E as i,
|
|
35
|
+
p as n,
|
|
36
|
+
c as r,
|
|
37
|
+
b as t
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const doNotTranslate: <TValue>(value: TValue) => TValue;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { t as o } from "./doNotTranslate-BSVT8Xyd.js";
|
|
2
|
+
import { f as a, h } from "./theme-B2EaXhye.js";
|
|
3
|
+
import { i as c, n as m } from "./useIsMobile-D1ImfQnE.js";
|
|
4
|
+
import { z as l } from "zod";
|
|
5
|
+
var g = (r) => r.replace(/\d+$/, ""), f = l.enum(a), O = (r) => {
|
|
6
|
+
const e = f.safeParse(r ?? "");
|
|
7
|
+
return e.success ? e.data : h;
|
|
8
|
+
}, v = (r) => {
|
|
9
|
+
let e = 0;
|
|
10
|
+
for (let t = 0; t < r.length; t++) e = r.charCodeAt(t) + ((e << 5) - e);
|
|
11
|
+
return a[Math.abs(e) % a.length] ?? a[0];
|
|
12
|
+
}, S = ({ string: r, variant: e = 9, theme: t }) => {
|
|
13
|
+
if (e < 1 || e > 12) throw new Error(o("Variant must be between 1 and 12"));
|
|
14
|
+
const i = `${v(r)}${e}`;
|
|
15
|
+
return t.color[i];
|
|
16
|
+
}, T = () => {
|
|
17
|
+
const r = c();
|
|
18
|
+
return r === "mac" || r === "ios" ? "⌘" : o("Ctrl");
|
|
19
|
+
}, p = o("(hover: none) and (pointer: coarse)"), A = () => m(p), u = [
|
|
20
|
+
"http:",
|
|
21
|
+
"https:",
|
|
22
|
+
"mailto:",
|
|
23
|
+
"tel:"
|
|
24
|
+
], s = "https://same-origin-probe.invalid", n = (r) => {
|
|
25
|
+
if (r.startsWith("/")) try {
|
|
26
|
+
return new URL(r, s).origin === s;
|
|
27
|
+
} catch {
|
|
28
|
+
return !1;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const e = new URL(r);
|
|
32
|
+
return u.includes(e.protocol);
|
|
33
|
+
} catch {
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
36
|
+
}, L = (r) => {
|
|
37
|
+
if (!r || r.trim().length === 0) return;
|
|
38
|
+
if (n(r)) return r;
|
|
39
|
+
if (r.startsWith("/")) return;
|
|
40
|
+
const e = `https://${r}`;
|
|
41
|
+
return n(e) ? e : void 0;
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
v as a,
|
|
45
|
+
f as c,
|
|
46
|
+
T as i,
|
|
47
|
+
g as l,
|
|
48
|
+
A as n,
|
|
49
|
+
S as o,
|
|
50
|
+
p as r,
|
|
51
|
+
O as s,
|
|
52
|
+
L as t
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=require("./theme-1XkFz8Qu.cjs"),o=require("./doNotTranslate-CHE7WmRS.cjs"),u=require("./useIsMobile-Byp9AIq-.cjs");let h=require("zod");var f=e=>e.replace(/\d+$/,""),s=h.z.enum(n.MAIN_COLOR_NAMES),O=e=>{const r=s.safeParse(e??"");return r.success?r.data:n.DEFAULT_THEME_COLOR_FALLBACK},c=e=>{let r=0;for(let t=0;t<e.length;t++)r=e.charCodeAt(t)+((r<<5)-r);return n.MAIN_COLOR_NAMES[Math.abs(r)%n.MAIN_COLOR_NAMES.length]??n.MAIN_COLOR_NAMES[0]},C=({string:e,variant:r=9,theme:t})=>{if(r<1||r>12)throw new Error(o.doNotTranslate("Variant must be between 1 and 12"));const m=`${c(e)}${r}`;return t.color[m]},g=()=>{const e=u.getUserDevice();return e==="mac"||e==="ios"?"⌘":o.doNotTranslate("Ctrl")},l=o.doNotTranslate("(hover: none) and (pointer: coarse)"),_=()=>u.useMediaQuery(l),b=["http:","https:","mailto:","tel:"],a="https://same-origin-probe.invalid",i=e=>{if(e.startsWith("/"))try{return new URL(e,a).origin===a}catch{return!1}try{const r=new URL(e);return b.includes(r.protocol)}catch{return!1}},d=e=>{if(!e||e.trim().length===0)return;if(i(e))return e;if(e.startsWith("/"))return;const r=`https://${e}`;return i(r)?r:void 0};Object.defineProperty(exports,"TOUCH_DEVICE_MEDIA_QUERY",{enumerable:!0,get:function(){return l}});Object.defineProperty(exports,"getMainColorNameFromPaletteColorName",{enumerable:!0,get:function(){return f}});Object.defineProperty(exports,"getOsControlSymbol",{enumerable:!0,get:function(){return g}});Object.defineProperty(exports,"getSafeUrl",{enumerable:!0,get:function(){return d}});Object.defineProperty(exports,"parseThemeColor",{enumerable:!0,get:function(){return O}});Object.defineProperty(exports,"stringToThemeColor",{enumerable:!0,get:function(){return c}});Object.defineProperty(exports,"stringToThemeColorP3String",{enumerable:!0,get:function(){return C}});Object.defineProperty(exports,"themeColorSchema",{enumerable:!0,get:function(){return s}});Object.defineProperty(exports,"useIsTouchDevice",{enumerable:!0,get:function(){return _}});
|
package/dist/utilities.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./isDefined-DS2Q42p5.cjs"),e=require("./utilities-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./isDefined-DS2Q42p5.cjs"),e=require("./utilities-xZh8D2gd.cjs"),i=require("./useIsMobile-Byp9AIq-.cjs"),r=require("./preventDismissingClickActivation-CIhWvKCu.cjs");exports.MOBILE_MEDIA_QUERY=i.MOBILE_MEDIA_QUERY;exports.TOUCH_DEVICE_MEDIA_QUERY=e.TOUCH_DEVICE_MEDIA_QUERY;exports.getMainColorNameFromPaletteColorName=e.getMainColorNameFromPaletteColorName;exports.getOsControlSymbol=e.getOsControlSymbol;exports.getSafeUrl=e.getSafeUrl;exports.getUserDevice=i.getUserDevice;exports.isDefined=o.isDefined;exports.normalizeSearchText=r.normalizeSearchText;exports.parseThemeColor=e.parseThemeColor;exports.preventDismissingClickActivation=r.preventDismissingClickActivation;exports.stringToThemeColor=e.stringToThemeColor;exports.stringToThemeColorP3String=e.stringToThemeColorP3String;exports.themeColorSchema=e.themeColorSchema;exports.useIsMobile=i.useIsMobile;exports.useIsTouchDevice=e.useIsTouchDevice;exports.useMediaQuery=i.useMediaQuery;
|
package/dist/utilities.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as o } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
-
import { a as r, c as a, i as t, l as i, n as m, o as l, r as n, s as C, t as c } from "./utilities-
|
|
3
|
-
import { i as T, n as h, r as p, t as D } from "./useIsMobile-
|
|
4
|
-
import { n as f, t as I } from "./preventDismissingClickActivation-
|
|
2
|
+
import { a as r, c as a, i as t, l as i, n as m, o as l, r as n, s as C, t as c } from "./utilities-BKCMZyqZ.js";
|
|
3
|
+
import { i as T, n as h, r as p, t as D } from "./useIsMobile-D1ImfQnE.js";
|
|
4
|
+
import { n as f, t as I } from "./preventDismissingClickActivation-AaqHBLnW.js";
|
|
5
5
|
export {
|
|
6
6
|
p as MOBILE_MEDIA_QUERY,
|
|
7
7
|
n as TOUCH_DEVICE_MEDIA_QUERY,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twenty-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.49.0",
|
|
4
4
|
"description": "Twenty's shared React UI component library.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"vitest": "^4.1.0"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@base-ui/react": "^1.
|
|
79
|
-
"@base-ui/utils": "0.
|
|
78
|
+
"@base-ui/react": "^1.9.0",
|
|
79
|
+
"@base-ui/utils": "0.5.0",
|
|
80
80
|
"@sniptt/guards": "^0.2.0",
|
|
81
81
|
"@tabler/icons-react": "^3.31.0",
|
|
82
82
|
"clsx": "^2.1.1",
|
package/dist/Avatar-CQhIEazb.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const I=require("./theme-1XkFz8Qu.cjs"),g=require("./isDefined-DS2Q42p5.cjs"),A=require("./mergeClassNames-D4lshrT6.cjs"),h=require("./utilities-BeLfNQ0Q.cjs");let k=require("@sniptt/guards"),l=require("react/jsx-runtime"),q=require("@base-ui/react/avatar");var P="_root_14f7e_1",S="_avatarPulsing_14f7e_1",y="_image_14f7e_89",L="_fallback_14f7e_101",j={root:P,avatarPulsing:S,image:y,fallback:L},p=({className:a,...e})=>(0,l.jsx)(q.Avatar.Fallback,{...e,className:A.mergeClassNames(j.fallback,a)}),x=({className:a,...e})=>(0,l.jsx)(q.Avatar.Image,{...e,className:A.mergeClassNames(j.image,a)}),N=a=>a?.trim().charAt(0).toUpperCase(),D=({name:a,colorSeed:e=a,size:i="md",shape:v="square",variant:u="soft",color:m,backgroundColor:b,borderColor:_,pulsing:s=!1,ring:n=!1,className:o,style:c,...r})=>{const t=I.useTheme(),d=N(a),T=d?m??h.stringToThemeColorP3String({string:e??"",variant:12,theme:t}):m??t.font.color.tertiary,F=d?b??h.stringToThemeColorP3String({string:e??"",variant:u==="outline"?5:4,theme:t}):b??t.background.transparent.light,C=_??(d?h.stringToThemeColorP3String({string:e??"",variant:6,theme:t}):void 0);return(0,l.jsx)(q.Avatar.Root,{...r,"data-size":i,"data-shape":v,"data-pulsing":s||void 0,"data-ring":n||void 0,className:A.mergeClassNames(j.root,o),style:f=>({"--tw-avatar-color":T,"--tw-avatar-background":f.imageLoadingStatus==="loaded"?"none":F,"--tw-avatar-border":u==="outline"&&f.imageLoadingStatus!=="loaded"&&C?`1px solid ${C}`:"none",...(0,k.isFunction)(c)?c(f):c})})},w=({src:a,name:e,icon:i,imageProps:v,fallbackProps:u,backgroundColor:m,...b})=>{const _=N(e),s=g.isDefined(i)&&!(0,k.isBoolean)(i)&&i!=="",n=v?.alt??"",o=!s&&(0,k.isNonEmptyString)(n),{children:c=s?i:_||"-",...r}=u??{},t=g.isDefined(r.role)||g.isDefined(r["aria-label"])||g.isDefined(r["aria-labelledby"]),d=!o&&!t&&!g.isDefined(r.render);return(0,l.jsxs)(D,{...b,name:e,backgroundColor:s?"inherit":m,children:[!s&&(0,l.jsx)(x,{src:a??void 0,...v,alt:n}),(0,l.jsx)(p,{role:o?"img":void 0,"aria-label":o?n:void 0,"aria-hidden":d||void 0,...r,children:c})]})},B=Object.assign(w,{Root:D,Image:x,Fallback:p});Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return B}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const d=require("./isDefined-DS2Q42p5.cjs"),Y=require("./mergeClassNames-D4lshrT6.cjs"),Ke=require("./preventDismissingClickActivation-DZxTSLV3.cjs"),de=require("./Button-Dbi5P05r.cjs"),ve=require("./isRenderableSlot-Guryb6Nf.cjs"),Ge=require("./Tooltip-Bg9Uk01p.cjs"),xe=require("./OverflowingTextWithTooltip-Z2daM0_x.cjs"),ee=require("./ListItem.module-CO4u2oeF.cjs"),ue=require("./ListItem-CHTR-GLd.cjs"),J=require("./Popover-CneCJTvD.cjs"),He=require("./Input-DvL77rvu.cjs");let ye=require("@base-ui/react/use-render"),$=require("@sniptt/guards"),K=require("clsx"),m=require("react"),c=require("react/jsx-runtime"),Ie=require("@base-ui/react/button"),oe=require("@base-ui/utils/useMergedRefs"),Te=require("@base-ui/react/popover"),We=require("@base-ui/utils/areArraysEqual"),Ce=require("@base-ui/react/direction-provider"),le=require("@base-ui/react/menu"),te=require("@tabler/icons-react");var Ue="_content_1tgf7_1",ze="_page_1tgf7_13",$e="_group_1tgf7_17",Ve="_groupLabel_1tgf7_23",Ye="_separator_1tgf7_35",Xe="_section_1tgf7_42",Je="_back_1tgf7_73",Qe="_backIcon_1tgf7_85",Ze="_searchContainer_1tgf7_89",et="_search_1tgf7_89",tt="_status_1tgf7_106",rt="_header_1tgf7_112",ot="_title_1tgf7_125",nt="_itemWithActions_1tgf7_134",st="_itemWithActionsPrimary_1tgf7_140",at="_itemActions_1tgf7_155",it="_itemDecoration_1tgf7_159",C={content:Ue,page:ze,group:$e,groupLabel:Ve,separator:Ye,section:Xe,back:Je,backIcon:Qe,searchContainer:Ze,search:et,status:tt,header:rt,title:ot,itemWithActions:nt,itemWithActionsPrimary:st,itemActions:at,itemDecoration:it},fe=({render:e,ref:t,disabled:r,...o})=>(0,ye.useRender)({render:e,ref:t,defaultTagName:"button",props:{...o,disabled:r}}),pe=({nativeButton:e,renderProps:t})=>e&&"disabled"in t&&(0,$.isBoolean)(t.disabled)?t.disabled:void 0,ct="[data-dropdown-item]",Ae=({actions:e,actionsVisibility:t="hover",color:r="neutral",selected:o=!1,focused:s=!1,indicator:a="none",disabled:i=!1,hasSubmenu:n=!1,children:f})=>(0,c.jsxs)("div",{className:(0,K.clsx)(ee.ListItem_module_default.root,C.itemWithActions),role:"none","data-actions-visibility":t,"data-color":r,"data-selected":o?"":void 0,"data-highlighted":s?"":void 0,"data-indicator":a,"data-disabled":i?"":void 0,onClick:l=>{l.target===l.currentTarget&&l.currentTarget.querySelector(ct)?.click()},children:[f,(0,c.jsx)("span",{className:(0,K.clsx)(ee.ListItem_module_default.actions,C.itemActions),children:e}),a==="check"&&o&&(0,c.jsx)(te.IconCheck,{className:(0,K.clsx)(ee.ListItem_module_default.checkIndicator,C.itemDecoration),"aria-hidden":!0}),n&&(0,c.jsx)(te.IconChevronRight,{className:(0,K.clsx)(ee.ListItem_module_default.submenuIcon,C.itemDecoration),"aria-hidden":!0})]}),ge=({id:e,render:t})=>(0,m.isValidElement)(t)?t.props.id??e:e,me=e=>e.getAttribute("aria-label")??e.textContent??"",Se=({content:e,item:t})=>t.getAttribute("aria-disabled")!=="true"&&!t.hasAttribute("disabled")&&t.closest("[data-dropdown-content]")===e,ne=e=>Array.from(e.querySelectorAll("[data-dropdown-item]")).filter(t=>Se({content:e,item:t})),re=(0,m.createContext)(void 0),E=()=>{const e=(0,m.useContext)(re);if(!d.isDefined(e))throw new Error("Dropdown components must be inside Dropdown.Root");return e},we=({id:e,disabled:t,isSubmenuTrigger:r=!1})=>{const o=E(),s=r?o.parentType:o.type,a=r?o.parentRowFocus:o.rowFocus,i=s!=="panel"&&(a?.rowIds?.includes(e)??!0);return{tabIndex:t||i&&a?.tabStopRowId!==e?-1:0}},Pe=({color:e,startIcon:t,endIcon:r,description:o,descriptionPlacement:s,shortcut:a,shortcutJoinLabel:i,hasSubmenu:n,actions:f,actionsVisibility:l,children:p,render:g,disabled:h=!1,nativeButton:u=!d.isDefined(g),closeOnClick:A=!0,onClick:b,page:x,id:w,...D})=>{const{type:_,closeTree:y,goToPage:N}=E(),k=(0,m.useId)(),S=ge({id:w,render:g}),L=S??k,j=we({id:L,disabled:h}),T=ve.isRenderableSlot(f),F=n??d.isDefined(x),O=(0,c.jsx)(Ie.Button,{...D,id:L,disabled:h,nativeButton:u,role:D.role??(_==="menu"?"menuitem":void 0),tabIndex:j.tabIndex,"data-dropdown-item":"","data-dropdown-page":x,onClick:P=>{if(b?.(P),!P.defaultPrevented){if(d.isDefined(x)){const I=P.currentTarget.closest("[data-dropdown-content]");if(!d.isDefined(I))return;N({id:x,trigger:{id:S,index:ne(I).indexOf(P.currentTarget),page:x,label:me(P.currentTarget)}});return}A&&y()}},render:P=>{const I=pe({nativeButton:u,renderProps:P});return(0,c.jsx)(ue.ListItem,{...P,render:(0,c.jsx)(fe,{render:g,disabled:I}),className:(0,K.clsx)(P.className,T&&C.itemWithActionsPrimary),disabled:h,color:e,startIcon:t,endIcon:r,actionsVisibility:l,description:o,descriptionPlacement:s,shortcut:a,shortcutJoinLabel:i,hasSubmenu:!T&&F,children:p})}});return T?(0,c.jsx)(Ae,{actions:f,actionsVisibility:l,color:e,disabled:h,hasSubmenu:F,children:O}):O},dt=({children:e="Back",className:t,onClick:r,...o})=>{const{goBack:s,canGoBack:a}=E();return(0,c.jsx)(Pe,{...o,className:(0,K.clsx)(C.back,t),"data-dropdown-back":"",disabled:o.disabled||!a,startIcon:(0,c.jsx)(te.IconChevronLeft,{className:C.backIcon}),closeOnClick:!1,onClick:i=>{r?.(i),!i.defaultPrevented&&s()},children:e})},ut="_button_1qwl0_1",lt="_tooltipAnchor_1qwl0_29",ft="_icon_1qwl0_33",ie={button:ut,tooltipAnchor:lt,icon:ft},Re=({children:e,size:t,shape:r="square",className:o,tooltip:s,tooltipPlace:a="bottom",tooltipDelay:i=1e3,tooltipOffset:n=5,disabled:f,loading:l,...p})=>{const g=(0,m.useContext)(de.ButtonGroupContext),h=t??g?.size??"md",u=(0,$.isNonEmptyString)(s),A=f||l,b=(0,c.jsx)(de.Button,{...p,size:h==="xs"?"sm":h,"data-icon-size":h,"data-shape":r,disabled:f,loading:l,startIcon:(0,c.jsx)("span",{className:ie.icon,children:e}),className:Y.mergeClassNames(ie.button,o)});return u?(0,c.jsx)(Ge.Tooltip,{content:s,delay:i,side:a,sideOffset:n,children:A?(0,c.jsx)("span",{className:ie.tooltipAnchor,children:b}):b}):b},pt="_button_prhtf_1",gt={button:pt},je=({className:e,emphasis:t="standard",size:r,variant:o,...s})=>{const a=(0,m.useContext)(de.ButtonGroupContext),i=r??a?.size??"sm",n=o??a?.variant??"ghost";return(0,c.jsx)(Re,{...s,size:i,variant:n,"data-emphasis":t,className:Y.mergeClassNames(gt.button,e)})},mt=({render:e,children:t,"aria-label":r,...o})=>(0,c.jsx)(Te.Popover.Close,{...o,"aria-label":r,render:e??(0,c.jsx)(je,{size:"sm","aria-label":r,children:t??(0,c.jsx)(te.IconX,{})}),children:d.isDefined(e)?t:void 0}),se=e=>e.querySelector("[data-dropdown-search]:not(:disabled)"),De=({content:e,target:t,edge:r="first",type:o})=>{const s=d.isDefined(t?.id)?e.ownerDocument.getElementById(t.id):null;if(d.isDefined(s)&&e.contains(s))return s;const a=ne(e),i=d.isDefined(t)?a.filter(u=>u.dataset.dropdownPage===t.page):[],[n]=i;if(i.length===1&&d.isDefined(n))return n;const f=(0,$.isNonEmptyString)(t?.label)?i.filter(u=>me(u)===t?.label):[],[l]=f;if(f.length===1&&d.isDefined(l))return l;const p=d.isDefined(t)?a[t.index]:void 0;if(d.isDefined(p))return p;const g=e.querySelector('input:not(:disabled):not([type="hidden"]),button:not(:disabled),textarea:not(:disabled),select:not(:disabled),a[href],[tabindex="0"]');if((Array.from(e.querySelectorAll("[data-dropdown-page-type]")).find(u=>u.closest("[data-dropdown-content]")===e)?.dataset.dropdownPageType??o??e.dataset.type)==="panel")return g??e;const h=se(e);return d.isDefined(h)?h:r==="last"?a[a.length-1]??g??e:a.find(u=>!u.hasAttribute("data-dropdown-back"))??a[0]??g??e},wt=({contentRef:e})=>{const{open:t,pageId:r,pageFocusRequest:o,setPageFocusRequest:s}=E();return(0,m.useLayoutEffect)(()=>{d.isDefined(o)&&(s(void 0),!(!t||o.pageId!==r||!d.isDefined(e.current))&&De({content:e.current,target:o.target}).focus())},[e,t,r,o,s]),null},ke=({content:e,item:t})=>t.hasAttribute("data-dropdown-item")&&Se({content:e,item:t})&&(!t.hasAttribute("data-dropdown-back")||!d.isDefined(se(e))),qe=e=>Array.from(e.querySelectorAll("[data-dropdown-item]")).filter(t=>ke({content:e,item:t})),be=e=>{if(e.dataset.type==="panel")return;const t=se(e);if(!(!d.isDefined(t)||!(0,$.isNonEmptyString)(t.value.trim())))return ne(e).find(r=>r.hasAttribute("data-dropdown-option-item"))},Dt=({content:e})=>{const{setRowIds:t,setSearchTargetId:r}=E();return(0,m.useLayoutEffect)(()=>{if(!d.isDefined(e))return;const o=()=>{const a=qe(e).map(i=>i.id);t(i=>d.isDefined(i)&&(0,We.areArraysEqual)(i,a)?i:a),r(be(e)?.id)};o();const s=new MutationObserver(o);return s.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","aria-disabled","id"]}),()=>{s.disconnect(),t(void 0),r(void 0)}},[e,t,r]),null},bt=e=>(e.ctrlKey||e.metaKey)&&!e.defaultPrevented,ht=e=>Array.from(e.ownerDocument.querySelectorAll("[data-dropdown-item][aria-controls]")).find(t=>t.getAttribute("aria-controls")===e.id),_t=({rowCells:e,column:t,isEnabledCell:r})=>{const o=Math.min(t,e.length-1);for(let s=0;s<e.length;s++){const a=[e[o-s],e[o+s]].find(r);if(d.isDefined(a))return a}},Ne=({key:e,items:t,currentItem:r,search:o,isRightToLeft:s})=>{const a=r?.closest("[data-dropdown-columns]"),i=Number(a?.dataset.dropdownColumns),n=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e);if(!d.isDefined(a)||!d.isDefined(r)||!n||!(0,$.isPositiveInteger)(i))return;const f=Array.from(a.children).filter(w=>w instanceof HTMLElement&&!w.hasAttribute("data-dropdown-section-label")),l=f.indexOf(r);if(l<0)return;const p=Math.floor(l/i),g=l%i,h=e==="ArrowUp"||e==="ArrowDown",u=e==="ArrowDown"||e===(s?"ArrowLeft":"ArrowRight")?1:-1,A=Math.ceil(f.length/i),b=new Set(t),x=w=>d.isDefined(w)&&b.has(w);if(h){for(let _=p+u;_>=0&&_<A;_+=u){const y=f[Math.min(_*i+g,f.length-1)];if(x(y))return y}for(let _=p+u;_>=0&&_<A;_+=u){const y=_t({rowCells:f.slice(_*i,(_+1)*i),column:g,isEnabledCell:x});if(d.isDefined(y))return y}const w=f.filter(x),D=u<0?w[0]:w[w.length-1];return(d.isDefined(D)?t[t.indexOf(D)+u]:void 0)??(u<0?o:void 0)??r}for(let w=g+u;w>=0&&w<i;w+=u){const D=f[p*i+w];if(x(D))return D}return r},vt=({key:e,items:t,currentIndex:r,search:o,isSearch:s,isRightToLeft:a=!1})=>{const i=Ne({key:e,items:t,currentItem:t[r],search:o,isRightToLeft:a});if(d.isDefined(i))return i;const n=t.length-1;if(e==="ArrowDown")return t[r===n?0:r+1];if(e==="ArrowUp"&&r===0&&d.isDefined(o))return o;if(e==="ArrowUp")return t[r<=0?n:r-1];if(!s&&e==="Home")return t[0];if(!s&&e==="End")return t[n]},xt=500,yt=()=>{const{type:e,isSubmenu:t,setOpen:r,closeTree:o}=E(),s=(0,Ce.useDirection)(),[a,i]=(0,m.useState)({text:"",timestamp:0});return n=>{if(n.defaultPrevented)return;const f=n.currentTarget,l=n.target;if(!(l instanceof HTMLElement)||l.closest("[data-dropdown-content]")!==f)return;const p=l.matches('input,textarea,select,[contenteditable="true"]'),g=s==="rtl",h=g?"ArrowRight":"ArrowLeft",u=t&&!p&&n.key===h,A=u&&e!=="panel"?Ne({key:n.key,items:ne(f),currentItem:l,search:null,isRightToLeft:g}):void 0,b=d.isDefined(A)&&A!==l;if(t&&(n.key==="Escape"||u&&!b)){n.preventDefault(),n.stopPropagation(),ht(f)?.focus(),r(!1);return}if(e==="panel")return;if(e==="menu"&&n.key==="Tab"&&n.shiftKey){n.preventDefault(),o(n.nativeEvent);return}const x=se(f),w=l===x;if(p&&!w)return;const D=qe(f),_=w&&n.key==="Enter"&&!n.nativeEvent.isComposing?be(f):void 0;if(d.isDefined(_)){n.preventDefault(),_.click();return}const y=D.indexOf(l),N=vt({key:n.key,items:D,currentIndex:y,search:x,isSearch:w,isRightToLeft:g});if(d.isDefined(N)){n.preventDefault(),N.focus();return}if(p||n.key.length!==1||n.key===" "||n.altKey||n.ctrlKey||n.metaKey)return;const k=Date.now(),S=k-a.timestamp>xt?n.key:a.text+n.key;i({text:S,timestamp:k});const L=([...S].every(T=>T===S[0])?n.key:S).toLocaleLowerCase(),j=[...D.slice(y+1),...D.slice(0,y+1)].find(T=>me(T).trim().toLocaleLowerCase().startsWith(L));d.isDefined(j)&&(n.preventDefault(),j.focus())}},It=({side:e,align:t="start",sideOffset:r=0,alignOffset:o,anchor:s,collisionPadding:a,container:i,keepMounted:n,width:f=200,className:l,style:p,children:g,initialFocus:h,onKeyDown:u,onFocus:A,onInput:b,onClick:x,onMouseDown:w,onPointerDown:D,"aria-label":_,"aria-labelledby":y,ref:N,...k})=>{const{type:S,isSubmenu:L,rowFocus:j,initialFocusEdge:T,focusOnOpen:F,triggerId:O,titleId:P,setSearchTargetId:I}=E(),B=(0,m.useRef)(null),[M,U]=(0,m.useState)(null),H=(0,oe.useMergedRefs)(B,N,U),X=yt(),V=d.isDefined(_)?void 0:P??O;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(J.Popover.Portal,{container:i,keepMounted:n,children:(0,c.jsx)(J.Popover.Positioner,{side:e??(L?"inline-end":"bottom"),align:t,sideOffset:r,alignOffset:o,anchor:s,collisionPadding:a,children:(0,c.jsx)(J.Popover.Popup,{...k,ref:H,role:S==="menu"?"menu":"dialog","aria-label":_,"aria-labelledby":y??V,"data-dropdown-content":"","data-type":S,className:Y.mergeClassNames(C.content,l),style:v=>({width:f,...(0,$.isFunction)(p)?p(v):p}),initialFocus:h??(()=>F?d.isDefined(B.current)?De({content:B.current,edge:T,type:S}):!0:!1),onKeyDown:v=>{u?.(v),X(v),bt(v)||v.stopPropagation()},onFocus:v=>{A?.(v);const{target:z}=v;z instanceof HTMLElement&&ke({content:v.currentTarget,item:z})&&j.focusRow(z.id)},onInput:v=>{b?.(v),I(be(v.currentTarget)?.id)},onClick:v=>{v.stopPropagation(),x?.(v)},onMouseDown:v=>{v.stopPropagation(),w?.(v)},onPointerDown:v=>{v.stopPropagation(),D?.(v)},children:g})})}),(0,c.jsx)(wt,{contentRef:B}),(0,c.jsx)(Dt,{content:M})]})},Tt=({className:e,...t})=>(0,c.jsx)(xe.Text,{...t,role:"status","aria-live":"polite",className:(0,K.clsx)(C.status,e)}),Ct=({render:e,ref:t,className:r,...o})=>(0,ye.useRender)({render:e,ref:t,props:{...o,className:(0,K.clsx)(C.header,r)}}),At=({className:e,...t})=>(0,c.jsx)(xe.Text,{...t,role:"status","aria-live":"polite","aria-busy":"true",className:(0,K.clsx)(C.status,e)}),St=({selected:e,indicator:t,onSelect:r,closeOnSelect:o,color:s,startIcon:a,endIcon:i,description:n,descriptionPlacement:f,shortcut:l,shortcutJoinLabel:p,hasSubmenu:g,actions:h,actionsVisibility:u,children:A,render:b,disabled:x=!1,nativeButton:w=!d.isDefined(b),onClick:D,id:_,...y})=>{const{type:N,multiple:k,closeTree:S,searchTargetId:L}=E(),j=N==="menu",T=d.isDefined(e),F=!j&&(w||y.role==="button"),O=!j&&!F&&T&&e,P=T?k?"menuitemcheckbox":"menuitemradio":"menuitem",I=k?"checkbox":"check",B=(0,m.useId)(),M=ge({id:_,render:b})??B,U=we({id:M,disabled:x}),H=ve.isRenderableSlot(h),X=L===M,V=t??(T?I:"none"),v=H&&V==="check",z=(0,c.jsx)(Ie.Button,{...y,id:M,disabled:x,nativeButton:w,role:j?P:y.role,"aria-checked":j&&T?e:void 0,"aria-pressed":F&&T?e:void 0,"aria-current":O?"true":void 0,tabIndex:U.tabIndex,"data-dropdown-item":"","data-dropdown-option-item":"",onClick:W=>{D?.(W),!W.defaultPrevented&&(r?.(),(o??!k)&&S())},render:W=>{const Z=pe({nativeButton:w,renderProps:W});return(0,c.jsx)(ue.ListItem,{...W,render:(0,c.jsx)(fe,{render:b,disabled:Z}),className:(0,K.clsx)(W.className,H&&C.itemWithActionsPrimary),disabled:x,selected:e,focused:X,indicator:v?"none":V,color:s,startIcon:a,endIcon:i,actionsVisibility:u,description:n,descriptionPlacement:f,shortcut:l,shortcutJoinLabel:p,hasSubmenu:!H&&g,children:A})}});return H?(0,c.jsx)(Ae,{actions:h,actionsVisibility:u,color:s,selected:e,focused:X,indicator:V,disabled:x,hasSubmenu:g,children:z}):z},Pt=({id:e,type:t,children:r})=>{const o=E(),{registerPage:s}=o,a=(0,m.useCallback)(i=>{d.isDefined(i)&&s({id:e,type:t})},[e,t,s]);return o.pageId!==e?null:(0,c.jsx)(re.Provider,{value:{...o,type:t??o.rootType},children:(0,c.jsx)("div",{ref:a,className:C.page,"data-dropdown-page-type":t??o.rootType,children:r})})},Rt=({open:e,registerOpenNestedRoot:t})=>((0,m.useEffect)(()=>{if(e)return t?.()},[e,t]),null),jt=({rowIds:e=[],focusedRowId:t})=>d.isDefined(t)&&e.includes(t)?t:e[0],kt=e=>e instanceof FocusEvent?e.type==="focusout"&&e.relatedTarget instanceof Element?e.relatedTarget:null:e.target instanceof Element?e.target:null,ce=({onDismiss:e,event:t,target:r=kt(t)})=>{if(!d.isDefined(e))return!1;let o=!1;return e({target:r,type:t.type,preventDefault:()=>{o=!0}}),o},_e=()=>{const[e,t]=(0,m.useState)();return[e,(0,m.useCallback)(r=>(t(r),()=>t(o=>o===r?void 0:o)),[])]},Ee=({children:e,type:t,open:r,defaultOpen:o=!1,onOpenChange:s,onEscapeKeyDown:a,onInteractOutside:i,multiple:n=!1,defaultPage:f="root",isSubmenu:l=!1})=>{const p=(0,m.useContext)(re),g=(0,m.useRef)(0),h=(0,m.useCallback)(()=>(g.current+=1,()=>{g.current-=1}),[]),[u,A]=(0,m.useState)(o),b=r??u,[x,w]=(0,m.useState)(b),[D,_]=(0,m.useState)([{id:f}]),[y,N]=(0,m.useState)(),[k,S]=(0,m.useState)(),[L,j]=(0,m.useState)(),T=D[D.length-1]?.id,[F,O]=(0,m.useState)(),[P,I]=(0,m.useState)("first"),[B,M]=(0,m.useState)(!0),[U,H]=(0,m.useState)(),[X,V]=_e(),[v,z]=_e(),W=b&&!x,Z=!b&&x;(W||Z)&&w(b),W&&(_([{id:f}]),N(void 0),O(void 0),j(void 0)),Z&&(I("first"),M(!0),H(void 0));const ae=R=>{d.isDefined(r)||A(R),s?.(R)},Oe=R=>{d.isDefined(R)&&ce({onDismiss:i,event:R,target:null})||(ae(!1),l&&p?.closeTree(R))},Le=({id:R,trigger:q})=>{O({pageId:R}),_(G=>[...G,{id:R,trigger:q}])},Fe=()=>{const R=D[D.length-2];if(!d.isDefined(R))return;const q=D[D.length-1]?.trigger;O({pageId:R.id,target:q}),_(G=>G.slice(0,-1))},Be=(0,m.useCallback)(({id:R,type:q})=>{if(!b)return;const G=q??t;N(Q=>Q?.id===R&&Q.type===G?Q:{id:R,type:G})},[b,t]);return(0,c.jsx)(J.Popover.Root,{open:b,onOpenChange:(R,q)=>{const G=q.reason==="outside-press"||q.reason==="focus-out";if(G&&g.current>0){q.cancel();return}const Q=q.reason==="escape-key"&&ce({onDismiss:a,event:q.event}),Me=G&&ce({onDismiss:i,event:q.event});if(Q||Me){q.cancel();return}G&&Ke.preventDismissingClickActivation(q.event),M(q.reason!=="trigger-hover"),ae(R)},children:(0,c.jsxs)(re.Provider,{value:{type:d.isDefined(y)&&y.id===T?y.type:t,rootType:t,open:b,multiple:n,isSubmenu:l,parentType:p?.type,rowFocus:{rowIds:k,tabStopRowId:jt({rowIds:k,focusedRowId:L}),focusRow:j},parentRowFocus:p?.rowFocus,setRowIds:S,pageId:T,pageFocusRequest:F,setPageFocusRequest:O,canGoBack:D.length>1,initialFocusEdge:P,setInitialFocusEdge:I,focusOnOpen:B,setFocusOnOpen:M,setOpen:ae,closeTree:Oe,goToPage:Le,goBack:Fe,registerPage:Be,registerOpenNestedRoot:h,searchTargetId:U,setSearchTargetId:H,triggerId:X,registerTrigger:V,titleId:v,registerTitle:z},children:[(0,c.jsx)(Rt,{open:b,registerOpenNestedRoot:l?void 0:p?.registerOpenNestedRoot}),e]})})},qt=({onValueChange:e,className:t,...r})=>{const{searchTargetId:o}=E();return(0,c.jsx)("div",{className:C.searchContainer,children:(0,c.jsx)(He.Input,{type:"search",autoComplete:"off","aria-activedescendant":o,...r,"data-dropdown-search":"",className:Y.mergeClassNames(C.search,t),onValueChange:s=>e?.(s)})})},Nt=({className:e,...t})=>(0,c.jsx)(le.Menu.Group,{...t,className:Y.mergeClassNames(C.group,e)}),Et=({className:e,...t})=>(0,c.jsx)(le.Menu.GroupLabel,{...t,className:Y.mergeClassNames(C.groupLabel,e)}),Ot=({label:e,scrollable:t,columns:r,style:o,className:s,children:a,...i})=>{const n=(0,$.isPositiveInteger)(r)?r:void 0;return(0,c.jsxs)(Nt,{...i,"data-scrollable":t||void 0,"data-dropdown-columns":n,style:{...o,...d.isDefined(n)&&{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`}},className:(0,K.clsx)(C.section,s),children:[d.isDefined(e)&&(0,c.jsx)(Et,{"data-dropdown-section-label":"",children:e}),a]})},Lt=({className:e,...t})=>(0,c.jsx)(le.Menu.Separator,{...t,role:"separator","data-dropdown-separator":"",className:(0,K.clsx)(C.separator,e)}),Ft=({type:e="menu",...t})=>(0,c.jsx)(Ee,{...t,type:e,isSubmenu:!0}),he=e=>(0,m.useCallback)(t=>{if(!(!d.isDefined(t)||!(0,$.isNonEmptyString)(t.id)))return e(t.id)},[e]),Bt=({color:e,startIcon:t,endIcon:r,description:o,descriptionPlacement:s,shortcut:a,shortcutJoinLabel:i,hasSubmenu:n=!0,children:f,render:l,disabled:p=!1,nativeButton:g=!d.isDefined(l),openOnHover:h=!0,onKeyDown:u,id:A,ref:b,...x})=>{const w=(0,Ce.useDirection)(),{type:D,rootType:_,parentType:y,open:N,setOpen:k,setFocusOnOpen:S,registerTrigger:L}=E(),j=N?D:_,T=(0,m.useId)(),F=ge({id:A,render:l})??T,O=we({id:F,disabled:p,isSubmenuTrigger:!0}),P=(0,oe.useMergedRefs)(b,he(L));return(0,c.jsx)(J.Popover.Trigger,{...x,ref:P,id:F,disabled:p,nativeButton:g,openOnHover:h,role:y==="menu"?"menuitem":void 0,"aria-haspopup":j==="menu"?"menu":"dialog",tabIndex:O.tabIndex,"data-dropdown-item":"",onKeyDown:I=>{if(u?.(I),I.defaultPrevented||p)return;const B=w==="rtl"?"ArrowLeft":"ArrowRight";if(I.key===B){I.preventDefault(),I.stopPropagation(),S(!0);const M=I.currentTarget.getAttribute("aria-controls"),U=d.isDefined(M)?I.currentTarget.ownerDocument.getElementById(M):null;if(N&&d.isDefined(U)){De({content:U,type:D}).focus();return}k(!0)}},render:I=>{const B=pe({nativeButton:g,renderProps:I});return(0,c.jsx)(ue.ListItem,{...I,render:(0,c.jsx)(fe,{render:l,disabled:B}),disabled:p,color:e,startIcon:t,endIcon:r,description:o,descriptionPlacement:s,shortcut:a,shortcutJoinLabel:i,hasSubmenu:n,children:f})}})},Mt=({className:e,render:t,ref:r,...o})=>{const{registerTitle:s}=E(),a=(0,oe.useMergedRefs)(r,he(s));return(0,c.jsx)(Te.Popover.Title,{...o,ref:a,render:t??(0,c.jsx)("div",{}),className:Y.mergeClassNames(C.title,e)})},Kt=({onKeyDown:e,onClick:t,ref:r,...o})=>{const{type:s,rootType:a,open:i,setOpen:n,setInitialFocusEdge:f,setFocusOnOpen:l,registerTrigger:p}=E(),g=i?s:a,h=(0,oe.useMergedRefs)(r,he(p));return(0,c.jsx)(J.Popover.Trigger,{...o,ref:h,"aria-haspopup":g==="menu"?"menu":"dialog",onClick:u=>{u.stopPropagation(),u.preventDefault(),t?.(u)},onKeyDown:u=>{e?.(u),!(u.defaultPrevented||u.baseUIHandlerPrevented||o.disabled||g==="panel")&&(u.key!=="ArrowDown"&&u.key!=="ArrowUp"||(u.preventDefault(),l(!0),f(u.key==="ArrowUp"?"last":"first"),n(!0)))}})},Gt=Ee,Ht={Root:Gt,Trigger:Kt,Content:It,ActionItem:Pe,OptionItem:St,Search:qt,Header:Ct,Title:Mt,Close:mt,Page:Pt,Back:dt,Submenu:Ft,SubmenuTrigger:Bt,Section:Ot,Separator:Lt,Loading:At,Empty:Tt};Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return Ht}});Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return Re}});Object.defineProperty(exports,"LightIconButton",{enumerable:!0,get:function(){return je}});Object.defineProperty(exports,"useDropdownContext",{enumerable:!0,get:function(){return E}});
|