@caspeco/casper-ui-library 8.0.3 → 8.2.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.
@@ -3,7 +3,8 @@ type ComboboxItemProps = {
3
3
  item: ComboboxItemType;
4
4
  asPlainText?: boolean;
5
5
  isDeleting?: boolean;
6
+ highlightQuery?: string;
6
7
  };
7
- export declare function ComboboxItem({ item, asPlainText, isDeleting }: ComboboxItemProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ComboboxItem({ item, asPlainText, isDeleting, highlightQuery }: ComboboxItemProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
9
10
  //# sourceMappingURL=combobox-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-item.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAahE,KAAK,iBAAiB,GAAG;IACxB,IAAI,EAAE,gBAAgB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,iBAAiB,2CAkBhF"}
1
+ {"version":3,"file":"combobox-item.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAchE,KAAK,iBAAiB,GAAG;IACxB,IAAI,EAAE,gBAAgB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,iBAAiB,2CAoBhG"}
@@ -1,9 +1,10 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { Flex as t } from "@chakra-ui/react";
3
- import { Box as a } from "../box/box.js";
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { Flex as s } from "@chakra-ui/react";
3
+ import { Box as n } from "../box/box.js";
4
+ import { Highlight as l } from "../highlight/highlight.js";
4
5
  import { Tag as o } from "../tag/tag.js";
5
- import { ThemeSpaceVariable as c } from "../../theme/theme-types.js";
6
- const s = {
6
+ import { ThemeSpaceVariable as m } from "../../theme/theme-types.js";
7
+ const f = {
7
8
  info: o.Info,
8
9
  success: o.Success,
9
10
  warning: o.Warning,
@@ -13,14 +14,14 @@ const s = {
13
14
  neutral: o,
14
15
  undefined: o.ComboboxItem
15
16
  };
16
- function b({ item: r, asPlainText: p, isDeleting: n }) {
17
- const l = n ? "primary" : r.variant || "neutral", d = s[l];
18
- return p ? /* @__PURE__ */ i(t, { gap: c.XSmall, overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", children: [
17
+ function y({ item: r, asPlainText: d, isDeleting: p, highlightQuery: a }) {
18
+ const i = p ? "primary" : r.variant || "neutral", c = f[i];
19
+ return d ? /* @__PURE__ */ t(s, { gap: m.XSmall, overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", children: [
19
20
  r.prepend,
20
- r.label,
21
+ /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(l, { query: a ?? "", children: r.label }) }),
21
22
  r.append
22
- ] }) : /* @__PURE__ */ e(a, { overflow: "hidden", children: /* @__PURE__ */ e(d, { prepend: r.prepend, append: r.append, dot: r.dot, solid: n, children: /* @__PURE__ */ e(a, { display: "block", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", children: r.label }) }) });
23
+ ] }) : /* @__PURE__ */ e(n, { overflow: "hidden", children: /* @__PURE__ */ e(c, { prepend: r.prepend, append: r.append, dot: r.dot, solid: p, children: /* @__PURE__ */ e(n, { display: "block", overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis", children: /* @__PURE__ */ e(l, { query: a ?? "", children: r.label }) }) }) });
23
24
  }
24
25
  export {
25
- b as ComboboxItem
26
+ y as ComboboxItem
26
27
  };
@@ -3,5 +3,5 @@ export declare function CheckboxOrRadioButton({ isSingleSelect, isChecked, }: {
3
3
  isSingleSelect: boolean;
4
4
  isChecked: boolean;
5
5
  }): import("react/jsx-runtime").JSX.Element;
6
- export declare function ComboboxMenu({ asPlainText, inputValue, selectedItems, displayItems, toggleItem, highlightState, openState, parentStrings, isSingleSelect, isSearching, isReadOnly, isHidingItems, popoverWidth, popoverPlacement, previousSelectedItems, parentRef, popupRef, footerContent, subMenuState, translation, }: ComboboxInnerProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ComboboxMenu(props: ComboboxInnerProps): import("react/jsx-runtime").JSX.Element;
7
7
  //# sourceMappingURL=combobox-menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-menu.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-menu.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAyClD,wBAAgB,qBAAqB,CAAC,EACrC,cAAc,EACd,SAAS,GACT,EAAE;IACF,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;CACnB,2CAwBA;AAED,wBAAgB,YAAY,CAAC,EAC5B,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,WAAW,GACX,EAAE,kBAAkB,2CAwJpB"}
1
+ {"version":3,"file":"combobox-menu.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-menu.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,kBAAkB,EAIlB,MAAM,SAAS,CAAC;AA2CjB,wBAAgB,qBAAqB,CAAC,EACrC,cAAc,EACd,SAAS,GACT,EAAE;IACF,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;CACnB,2CAEA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,2CAiGrD"}
@@ -1,117 +1,93 @@
1
- import { jsxs as l, jsx as i, Fragment as G } from "react/jsx-runtime";
2
- import { Box as d, Flex as g } from "@chakra-ui/react";
3
- import { autoUpdate as J, computePosition as K, flip as L } from "../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
4
- import { Fragment as z, useState as N, useEffect as Q } from "react";
5
- import { ComboboxItem as Z } from "./combobox-item.js";
6
- import { interpolate as R } from "./translations.js";
7
- import { ThemeColorVariable as o, ThemeShadowVariable as oo, ThemeRadiusVariable as D, ThemeSpaceVariable as t, ThemeIconSizeVariable as $, ThemeFontSizeVariable as ro, ThemeBorderVariable as no } from "../../theme/theme-types.js";
1
+ import { jsxs as g, jsx as n, Fragment as _ } from "react/jsx-runtime";
2
+ import { Box as C, Flex as y } from "@chakra-ui/react";
3
+ import { autoUpdate as G, computePosition as Q, flip as U } from "../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
4
+ import { useState as Y, useEffect as q, Fragment as T } from "react";
5
+ import { ComboboxItem as H } from "./combobox-item.js";
6
+ import { interpolate as J } from "./translations.js";
7
+ import { ThemeColorVariable as d, ThemeShadowVariable as K, ThemeRadiusVariable as Z, ThemeSpaceVariable as c, ThemeFontSizeVariable as R, ThemeBorderVariable as N, ThemeIconSizeVariable as F } from "../../theme/theme-types.js";
8
8
  import { Text as V } from "../text/text.js";
9
- import { Icon as B } from "../icon/icon.js";
10
- import { Icons as C } from "../icon/types.js";
11
- const eo = (n, e, u, a, p) => {
12
- const [s, m] = N({
9
+ import { Icon as z } from "../icon/icon.js";
10
+ import { Icons as D } from "../icon/types.js";
11
+ import { Checkbox as W } from "../checkbox/checkbox.js";
12
+ import { Radio as ee } from "../radio/radio.js";
13
+ const ne = (o, t, s, h, a) => {
14
+ const [b, x] = Y({
13
15
  transform: "translate(0, 0)",
14
16
  minWidth: 0
15
17
  });
16
- return Q(() => {
17
- if (!n.current || !e.current || !u) return () => {
18
+ return q(() => {
19
+ if (!o.current || !t.current || !s) return () => {
18
20
  };
19
- const S = async () => {
20
- if (n.current && e.current && u) {
21
- const { width: b } = n.current.getBoundingClientRect(), { x, y: k } = await K(n.current, e.current, {
22
- placement: p || "bottom-start",
23
- middleware: [L()]
21
+ const k = async () => {
22
+ if (o.current && t.current && s) {
23
+ const { width: S } = o.current.getBoundingClientRect(), { x: P, y: u } = await Q(o.current, t.current, {
24
+ placement: a || "bottom-start",
25
+ middleware: [U()]
24
26
  });
25
- m({
26
- transform: `translate(${x}px, ${k}px)`,
27
- minWidth: a || b
27
+ x({
28
+ transform: `translate(${P}px, ${u}px)`,
29
+ minWidth: h || S
28
30
  });
29
31
  }
30
- }, h = () => {
31
- S().catch(console.error);
32
+ }, w = () => {
33
+ k().catch(console.error);
32
34
  };
33
- return J(n.current, e.current, h);
34
- }, [n, e, u, p, a]), s;
35
+ return G(o.current, t.current, w);
36
+ }, [o, t, s, a, h]), b;
35
37
  };
36
- function to({
37
- isSingleSelect: n,
38
- isChecked: e
38
+ function X({
39
+ isSingleSelect: o,
40
+ isChecked: t
39
41
  }) {
40
- return /* @__PURE__ */ i(
41
- d,
42
- {
43
- position: "relative",
44
- width: "24px",
45
- height: "24px",
46
- flexShrink: "0",
47
- border: `${n && e ? 8 : 2}px solid ${e ? o.Primary : o.OnBackground}`,
48
- backgroundColor: e && !n ? o.Primary : "auto",
49
- borderRadius: n ? "50%" : D.Small,
50
- children: !n && e && /* @__PURE__ */ i(
51
- B,
52
- {
53
- top: "-2px",
54
- position: "absolute",
55
- width: $.Small,
56
- color: o.Surface,
57
- icon: C.Checkbox
58
- }
59
- )
60
- }
61
- );
42
+ return o ? /* @__PURE__ */ n(ee, { isChecked: t }) : /* @__PURE__ */ n(W, { isChecked: t });
62
43
  }
63
- function fo({
64
- asPlainText: n,
65
- inputValue: e,
66
- selectedItems: u,
67
- displayItems: a,
68
- toggleItem: p,
69
- highlightState: s,
70
- openState: m,
71
- parentStrings: S,
72
- isSingleSelect: h,
73
- isSearching: b,
74
- isReadOnly: x,
75
- isHidingItems: k,
76
- popoverWidth: I,
77
- popoverPlacement: X,
78
- previousSelectedItems: w,
79
- parentRef: j,
80
- popupRef: O,
81
- footerContent: v,
82
- subMenuState: M,
83
- translation: T
84
- }) {
85
- const H = eo(
86
- j,
87
- O,
88
- m.isOpen,
89
- I,
90
- X
91
- ), A = (r) => {
92
- s.set(r);
44
+ function pe(o) {
45
+ const {
46
+ inputValue: t,
47
+ displayItems: s,
48
+ highlightState: h,
49
+ openState: a,
50
+ isSingleSelect: b,
51
+ isSearching: x,
52
+ isHidingItems: k,
53
+ popoverWidth: w,
54
+ popoverPlacement: S,
55
+ parentRef: P,
56
+ popupRef: u,
57
+ footerContent: l,
58
+ translation: e,
59
+ folderStyle: i
60
+ } = o, r = ne(
61
+ P,
62
+ u,
63
+ a.isOpen,
64
+ w,
65
+ S
66
+ ), v = (m) => {
67
+ h.set(m);
93
68
  };
94
- return /* @__PURE__ */ l(
95
- d,
69
+ return /* @__PURE__ */ g(
70
+ C,
96
71
  {
97
- display: m.isOpen ? "block" : "none",
72
+ display: a.isOpen ? "block" : "none",
98
73
  inset: "0 auto auto 0",
99
74
  position: "fixed",
100
75
  zIndex: "50",
101
76
  visibility: "visible",
102
- backgroundColor: o.Surface,
103
- borderRadius: D.Medium,
104
- boxShadow: oo.Medium,
105
- color: o.OnSurface,
77
+ backgroundColor: d.Surface,
78
+ borderRadius: Z.Medium,
79
+ boxShadow: K.Medium,
80
+ color: d.OnSurface,
106
81
  overflow: "hidden",
107
- style: H,
108
- ref: O,
109
- onClick: (r) => {
110
- r.preventDefault(), r.stopPropagation(), h && m.close();
82
+ style: r,
83
+ ref: u,
84
+ maxW: "90%",
85
+ onClick: (m) => {
86
+ m.preventDefault(), m.stopPropagation(), b && a.close();
111
87
  },
112
88
  children: [
113
- /* @__PURE__ */ l(
114
- g,
89
+ /* @__PURE__ */ g(
90
+ y,
115
91
  {
116
92
  as: "ul",
117
93
  flexDirection: "column",
@@ -119,103 +95,208 @@ function fo({
119
95
  overflowY: "auto",
120
96
  overflowX: "hidden",
121
97
  role: "listbox",
122
- "aria-multiselectable": !h,
123
- padding: `${t.Small} 0`,
98
+ "aria-multiselectable": !b,
99
+ padding: `${c.Small} 0`,
124
100
  children: [
125
- b && a.length === 0 && e.length > 0 && /* @__PURE__ */ i(
101
+ x && s.length === 0 && t.length > 0 && /* @__PURE__ */ n(
126
102
  V,
127
103
  {
128
- px: t.Small,
129
- color: o.OnSurfaceSubdued,
130
- children: `${T.noMatchFor} "${e}"`
104
+ px: c.Small,
105
+ color: d.OnSurfaceSubdued,
106
+ children: `${e.noMatchFor} "${t}"`
131
107
  }
132
108
  ),
133
- a.map((r, f) => {
134
- const y = u.some((c) => c.id === r.id), E = (c) => {
135
- c.stopPropagation(), c.preventDefault(), p(r);
136
- }, U = r.children?.length, P = r.id === "_back", W = M.opened[M.opened.length - 1], F = r.id === W?.id, Y = P ? /* @__PURE__ */ l(g, { gap: t.XSmall, alignItems: "center", children: [
137
- /* @__PURE__ */ i(B, { icon: C.Back, size: $.Small }),
138
- r.label
139
- ] }) : /* @__PURE__ */ l(G, { children: [
140
- /* @__PURE__ */ l(g, { gap: t.XSmall, alignItems: "center", whiteSpace: "nowrap", children: [
141
- S[r.id]?.map((c) => /* @__PURE__ */ l(z, { children: [
142
- /* @__PURE__ */ i(d, { color: o.OnSurfaceSubdued, children: c }),
143
- /* @__PURE__ */ i(d, { color: o.OnSurfaceSubdued, children: "/" })
144
- ] }, c)),
145
- /* @__PURE__ */ i(Z, { item: r, asPlainText: n })
146
- ] }),
147
- x ? void 0 : U && !F && !b ? /* @__PURE__ */ i(
148
- B,
149
- {
150
- icon: C.Forward,
151
- size: $.Small,
152
- color: o.OnBackgroundSubdued
153
- }
154
- ) : /* @__PURE__ */ i(to, { isSingleSelect: h, isChecked: y })
155
- ] }), _ = w.length > 0 && w.length - 1 === f && w.length < a.length, q = !x && !b && (_ || (P || F));
156
- return /* @__PURE__ */ l(z, { children: [
157
- /* @__PURE__ */ i(
158
- g,
159
- {
160
- as: "li",
161
- role: "option",
162
- width: "100%",
163
- flexDirection: "row",
164
- justifyContent: "space-between",
165
- padding: `${t.Small} ${t.Medium}`,
166
- gap: t.Medium,
167
- textDecoration: "none",
168
- backgroundColor: s.index === f ? o.AccentHoverAlpha : "",
169
- onClick: E,
170
- tabIndex: -1,
171
- onMouseEnter: () => A(f),
172
- "data-is-active-index": s.index === f,
173
- "aria-selected": y,
174
- children: Y
175
- }
176
- ),
177
- q && /* @__PURE__ */ i(
178
- d,
179
- {
180
- margin: `${t.Small} ${P ? 0 : t.Medium}`,
181
- height: "1px",
182
- flexShrink: 0,
183
- backgroundColor: o.OnBackgroundBorder
184
- }
185
- )
186
- ] }, r.id);
187
- }),
188
- k && /* @__PURE__ */ i(
109
+ i === "stacked" ? /* @__PURE__ */ n(oe, { ...o, onHover: v }) : /* @__PURE__ */ n(re, { ...o, onHover: v }),
110
+ k && /* @__PURE__ */ n(
189
111
  V,
190
112
  {
191
- px: t.Small,
192
- py: t.Small,
193
- color: o.OnSurfaceSubdued,
194
- fontSize: ro.Small,
195
- children: R(T.showMaxItems, {
196
- count: a.length
113
+ px: c.Small,
114
+ py: c.Small,
115
+ color: d.OnSurfaceSubdued,
116
+ fontSize: R.Small,
117
+ children: J(e.showMaxItems, {
118
+ count: s.length
197
119
  })
198
120
  }
199
121
  )
200
122
  ]
201
123
  }
202
124
  ),
203
- v && /* @__PURE__ */ i(
204
- d,
125
+ l && /* @__PURE__ */ n(
126
+ C,
205
127
  {
206
128
  position: "sticky",
207
129
  bottom: "0",
208
- backgroundColor: o.Surface,
209
- padding: `${t.Small} ${t.Medium}`,
210
- borderTop: `${no.XSmall} ${o.OnSurfaceBorder}`,
211
- children: v
130
+ backgroundColor: d.Surface,
131
+ padding: `${c.Small} ${c.Medium}`,
132
+ borderTop: `${N.XSmall} ${d.OnSurfaceBorder}`,
133
+ children: l
212
134
  }
213
135
  )
214
136
  ]
215
137
  }
216
138
  );
217
139
  }
140
+ const A = ({
141
+ children: o,
142
+ isChecked: t,
143
+ onClick: s,
144
+ isActive: h,
145
+ onHover: a
146
+ }) => /* @__PURE__ */ n(
147
+ y,
148
+ {
149
+ as: "li",
150
+ role: "option",
151
+ width: "100%",
152
+ flexDirection: "row",
153
+ justifyContent: "space-between",
154
+ padding: `${c.Small} ${c.Medium}`,
155
+ gap: c.Medium,
156
+ textDecoration: "none",
157
+ backgroundColor: h ? d.AccentHoverAlpha : "",
158
+ onClick: s,
159
+ tabIndex: -1,
160
+ onMouseEnter: a,
161
+ "data-is-active-index": h,
162
+ "aria-selected": t,
163
+ children: o
164
+ }
165
+ ), oe = ({
166
+ displayItems: o,
167
+ selectedItems: t,
168
+ toggleItem: s,
169
+ onHover: h,
170
+ parentSelectsChildren: a,
171
+ highlightState: b,
172
+ inputValue: x,
173
+ isSingleSelect: k
174
+ }) => {
175
+ const w = (l, e) => l.children && l.children.length > 0 ? l.children.every((i) => w(i, e)) : e.some((i) => i.id === l.id), S = (l) => l.children && l.children.length > 0 ? l.children.some((e) => S(e)) : t.some((e) => e.id === l.id);
176
+ let P = 0;
177
+ const u = (l, e, i = []) => l.map((r) => {
178
+ const v = (p) => {
179
+ p.stopPropagation(), p.preventDefault(), s(r);
180
+ };
181
+ i.length > 0 && (i[i.length - 1] -= 1);
182
+ const m = P++, B = r.children && r.children.length > 0, I = !B || r.isSelectableParent;
183
+ let $ = e.some((p) => p.id === r.id);
184
+ return a && B && !r.isSelectableParent && w(r, e) && ($ = !0), /* @__PURE__ */ g(T, { children: [
185
+ /* @__PURE__ */ g(
186
+ A,
187
+ {
188
+ isActive: b.index === m,
189
+ isChecked: $,
190
+ onClick: v,
191
+ onHover: () => h(m),
192
+ children: [
193
+ /* @__PURE__ */ g(y, { alignItems: "center", whiteSpace: "nowrap", minW: 0, children: [
194
+ i.map((p, O, M) => {
195
+ const f = M.length === O + 1, j = p > 0, E = p === 0, L = j || f;
196
+ return /* @__PURE__ */ g(
197
+ y,
198
+ {
199
+ w: c.Medium,
200
+ minW: c.Medium,
201
+ alignItems: "center",
202
+ my: "-0.5rem",
203
+ h: "2.5rem",
204
+ children: [
205
+ L && /* @__PURE__ */ n(
206
+ C,
207
+ {
208
+ w: "1px",
209
+ h: E ? "52%" : "100%",
210
+ backgroundColor: d.OnSurface,
211
+ mb: "auto"
212
+ }
213
+ ),
214
+ f && /* @__PURE__ */ n(
215
+ C,
216
+ {
217
+ w: "inherit",
218
+ height: "1px",
219
+ backgroundColor: d.OnSurface,
220
+ mr: c.XSmall
221
+ }
222
+ )
223
+ ]
224
+ },
225
+ `${r.id}_${O}`
226
+ );
227
+ }),
228
+ /* @__PURE__ */ n(H, { item: r, asPlainText: !0, highlightQuery: x })
229
+ ] }),
230
+ I ? /* @__PURE__ */ n(X, { isSingleSelect: k, isChecked: $ }) : a && !k && /* @__PURE__ */ n(W, { isIndeterminate: S(r), isChecked: $ })
231
+ ]
232
+ }
233
+ ),
234
+ r.children && u(r.children, e, [...i, r.children.length])
235
+ ] }, r.id);
236
+ });
237
+ return u(o, t);
238
+ }, re = ({
239
+ displayItems: o,
240
+ selectedItems: t,
241
+ toggleItem: s,
242
+ onHover: h,
243
+ highlightState: a,
244
+ isSingleSelect: b,
245
+ subMenuState: x,
246
+ parentStrings: k,
247
+ asPlainText: w,
248
+ isSearching: S,
249
+ isReadOnly: P,
250
+ previousSelectedItems: u
251
+ }) => {
252
+ const l = (e, i) => {
253
+ e.stopPropagation(), e.preventDefault(), s(i);
254
+ };
255
+ return o.map((e, i) => {
256
+ const r = t.some((f) => f.id === e.id), v = e.children?.length, m = e.id === "_back", B = x.opened[x.opened.length - 1], I = e.id === B?.id, $ = m ? /* @__PURE__ */ g(y, { gap: c.XSmall, alignItems: "center", children: [
257
+ /* @__PURE__ */ n(z, { icon: D.Back, size: F.Small }),
258
+ e.label
259
+ ] }) : /* @__PURE__ */ g(_, { children: [
260
+ /* @__PURE__ */ g(y, { gap: c.XSmall, alignItems: "center", whiteSpace: "nowrap", children: [
261
+ k[e.id]?.map((f) => /* @__PURE__ */ g(T, { children: [
262
+ /* @__PURE__ */ n(C, { color: d.OnSurfaceSubdued, children: f }),
263
+ /* @__PURE__ */ n(C, { color: d.OnSurfaceSubdued, children: "/" })
264
+ ] }, f)),
265
+ /* @__PURE__ */ n(H, { item: e, asPlainText: w })
266
+ ] }),
267
+ P ? void 0 : v && !I && !S ? /* @__PURE__ */ n(
268
+ z,
269
+ {
270
+ icon: D.Forward,
271
+ size: F.Small,
272
+ color: d.OnBackgroundSubdued
273
+ }
274
+ ) : /* @__PURE__ */ n(X, { isSingleSelect: b, isChecked: r })
275
+ ] }), p = u.length > 0 && u.length - 1 === i && u.length < o.length, M = !P && !S && (p || (m || I));
276
+ return /* @__PURE__ */ g(T, { children: [
277
+ /* @__PURE__ */ n(
278
+ A,
279
+ {
280
+ isActive: a.index === i,
281
+ isChecked: r,
282
+ onClick: (f) => l(f, e),
283
+ onHover: () => h(i),
284
+ children: $
285
+ }
286
+ ),
287
+ M && /* @__PURE__ */ n(
288
+ C,
289
+ {
290
+ margin: `${c.Small} ${m ? 0 : c.Medium}`,
291
+ height: "1px",
292
+ flexShrink: 0,
293
+ backgroundColor: d.OnBackgroundBorder
294
+ }
295
+ )
296
+ ] }, e.id);
297
+ });
298
+ };
218
299
  export {
219
- to as CheckboxOrRadioButton,
220
- fo as ComboboxMenu
300
+ X as CheckboxOrRadioButton,
301
+ pe as ComboboxMenu
221
302
  };
@@ -6,4 +6,5 @@ export declare const Sizes: () => import("react/jsx-runtime").JSX.Element;
6
6
  export declare const GhostVariant: () => import("react/jsx-runtime").JSX.Element;
7
7
  export declare const WithItemsAsPlainText: () => import("react/jsx-runtime").JSX.Element;
8
8
  export declare const WithFooterContent: () => import("react/jsx-runtime").JSX.Element;
9
+ export declare const WithFolderStyleStacked: () => import("react/jsx-runtime").JSX.Element;
9
10
  //# sourceMappingURL=combobox.composition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.composition.tsx"],"names":[],"mappings":"AAgJA,eAAO,MAAM,YAAY,+CAoBxB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAmBvB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAiDpB,CAAC;AAEF,eAAO,MAAM,OAAO,+CAoBnB,CAAC;AAEF,eAAO,MAAM,KAAK,+CAyEjB,CAAC;AAEF,eAAO,MAAM,YAAY,+CAoBxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,+CAyBhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAyB7B,CAAC"}
1
+ {"version":3,"file":"combobox.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.composition.tsx"],"names":[],"mappings":"AAqOA,eAAO,MAAM,YAAY,+CAoBxB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAmBvB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAiDpB,CAAC;AAEF,eAAO,MAAM,OAAO,+CAoBnB,CAAC;AAEF,eAAO,MAAM,KAAK,+CAyEjB,CAAC;AAEF,eAAO,MAAM,YAAY,+CAoBxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,+CAyBhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAyB7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,+CA8BlC,CAAC"}
@@ -6,5 +6,5 @@ import { ComboboxProps } from './types.js';
6
6
  *
7
7
  * @see Docs https://caspeco.github.io/casper-ui-library/components/combobox
8
8
  */
9
- export declare function Combobox({ id, label, isSingleSelect, selectedItems, locale, size, variant, asPlainText, onSearch, items, maxVisibleItems, onChange, onBlur, isDisabled, isReadOnly, isRequired, placeholder, isInvalid, footerContent, popoverWidth, popoverPlacement, collapsed, ...props }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function Combobox({ id, label, isSingleSelect, selectedItems, locale, size, variant, asPlainText, onSearch, items, maxVisibleItems, onChange, onBlur, isDisabled, isReadOnly, isRequired, placeholder, isInvalid, footerContent, popoverWidth, popoverPlacement, collapsed, folderStyle, parentSelectsChildren, ...props }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
10
10
  //# sourceMappingURL=combobox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAIX,aAAa,EAKb,MAAM,SAAS,CAAC;AAqGjB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACxB,EAAE,EACF,KAAU,EACV,cAAsB,EACtB,aAAkB,EAClB,MAAgB,EAChB,IAAW,EACX,OAAmB,EACnB,WAAmB,EACnB,QAAQ,EACR,KAAK,EACL,eAAe,EACf,QAAQ,EACR,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAiB,EACjB,GAAG,KAAK,EACR,EAAE,aAAa,2CAgMf"}
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAIX,aAAa,EAKb,MAAM,SAAS,CAAC;AAsGjB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACxB,EAAE,EACF,KAAU,EACV,cAAsB,EACtB,aAAkB,EAClB,MAAgB,EAChB,IAAW,EACX,OAAmB,EACnB,WAAmB,EACnB,QAAQ,EACR,KAAK,EACL,eAAe,EACf,QAAQ,EACR,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAiB,EACjB,WAAuB,EACvB,qBAAqB,EACrB,GAAG,KAAK,EACR,EAAE,aAAa,2CAgTf"}