@caspeco/casper-ui-library 6.0.0 → 7.0.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.
Files changed (74) hide show
  1. package/dist/components/alert/alert.js +25 -25
  2. package/dist/components/button/types.d.ts +1 -1
  3. package/dist/components/button/types.d.ts.map +1 -1
  4. package/dist/components/combobox/combobox-button.d.ts.map +1 -1
  5. package/dist/components/combobox/combobox-button.js +57 -57
  6. package/dist/components/combobox/combobox-menu.d.ts.map +1 -1
  7. package/dist/components/combobox/combobox-menu.js +58 -56
  8. package/dist/components/combobox/combobox.d.ts.map +1 -1
  9. package/dist/components/combobox/combobox.js +34 -34
  10. package/dist/components/combobox/types.d.ts +2 -2
  11. package/dist/components/combobox/types.d.ts.map +1 -1
  12. package/dist/components/date-picker/base-date-picker.d.ts.map +1 -1
  13. package/dist/components/date-picker/base-date-picker.js +129 -129
  14. package/dist/components/date-picker/types.d.ts +3 -2
  15. package/dist/components/date-picker/types.d.ts.map +1 -1
  16. package/dist/components/drawer/use-drawer-key-down.js +8 -6
  17. package/dist/components/icon/icon.d.ts.map +1 -1
  18. package/dist/components/icon/icon.js +13 -12
  19. package/dist/components/icon-button/icon-button.d.ts +1 -1
  20. package/dist/components/icon-button/types.d.ts +3 -2
  21. package/dist/components/icon-button/types.d.ts.map +1 -1
  22. package/dist/components/image-upload/image-cropper.d.ts.map +1 -1
  23. package/dist/components/image-upload/image-upload-dropzone.d.ts.map +1 -1
  24. package/dist/components/image-upload/image-upload-dropzone.js +24 -24
  25. package/dist/components/image-upload/image-upload-modal.d.ts.map +1 -1
  26. package/dist/components/image-upload/image-upload-modal.js +61 -58
  27. package/dist/components/menu/menu-item.d.ts +2 -1
  28. package/dist/components/menu/menu-item.d.ts.map +1 -1
  29. package/dist/components/menu/menu.composition.d.ts.map +1 -1
  30. package/dist/components/modal/modal-footer.d.ts.map +1 -1
  31. package/dist/components/modal/modal-footer.js +16 -13
  32. package/dist/components/table/index.d.ts +1 -0
  33. package/dist/components/table/index.d.ts.map +1 -1
  34. package/dist/components/table/table-cell.js +18 -18
  35. package/dist/components/table/table-content.d.ts.map +1 -1
  36. package/dist/components/table/table-content.js +21 -19
  37. package/dist/components/table/table-context-provider.d.ts +8 -4
  38. package/dist/components/table/table-context-provider.d.ts.map +1 -1
  39. package/dist/components/table/table-context-provider.js +96 -94
  40. package/dist/components/table/table-filter.d.ts +27 -0
  41. package/dist/components/table/table-filter.d.ts.map +1 -0
  42. package/dist/components/table/table-filter.js +140 -0
  43. package/dist/components/table/table-filter.spec.d.ts +2 -0
  44. package/dist/components/table/table-filter.spec.d.ts.map +1 -0
  45. package/dist/components/table/table-header-dropdown.d.ts +1 -1
  46. package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
  47. package/dist/components/table/table-header-dropdown.js +71 -59
  48. package/dist/components/table/table-row.js +40 -40
  49. package/dist/components/table/table-toolbar.d.ts.map +1 -1
  50. package/dist/components/table/table-toolbar.js +111 -81
  51. package/dist/components/table/table.composition.d.ts +1 -1
  52. package/dist/components/table/table.composition.d.ts.map +1 -1
  53. package/dist/components/table/table.d.ts +1 -1
  54. package/dist/components/table/table.d.ts.map +1 -1
  55. package/dist/components/table/table.js +22 -24
  56. package/dist/components/table/translations.d.ts +10 -0
  57. package/dist/components/table/translations.d.ts.map +1 -1
  58. package/dist/components/table/translations.js +17 -9
  59. package/dist/components/table/types.d.ts +1 -5
  60. package/dist/components/table/types.d.ts.map +1 -1
  61. package/dist/components/tabs/tabs.composition.d.ts +1 -1
  62. package/dist/index.js +168 -165
  63. package/dist/theme/index.d.ts +2 -1
  64. package/dist/theme/index.d.ts.map +1 -1
  65. package/dist/theme/theme-config/components/button-theme.d.ts.map +1 -1
  66. package/dist/theme/theme-config/components/button-theme.js +35 -20
  67. package/dist/theme/theme-context.d.ts +10 -0
  68. package/dist/theme/theme-context.d.ts.map +1 -0
  69. package/dist/theme/theme-context.js +11 -0
  70. package/dist/theme/theme-provider-context.composition.d.ts.map +1 -1
  71. package/dist/theme/theme-provider.d.ts +0 -8
  72. package/dist/theme/theme-provider.d.ts.map +1 -1
  73. package/dist/theme/theme-provider.js +21 -27
  74. package/package.json +16 -11
@@ -1,72 +1,72 @@
1
1
  import { jsx as r, jsxs as t } from "react/jsx-runtime";
2
- import { Alert as F, Flex as l, chakra as I } from "@chakra-ui/react";
2
+ import { Alert as F, Flex as l, chakra as V } from "@chakra-ui/react";
3
3
  import { useMemo as i } from "react";
4
- import { getAlertTextColor as V, getAlertBackgroundColor as k, getAlertIcon as M } from "./helper.js";
5
- import { ThemeFontVariable as m, ThemeRadiusVariable as j, ThemeSpaceVariable as B, ThemeIconSizeVariable as s, ThemeFontSizeVariable as w } from "../../theme/theme-types.js";
6
- import { Icon as f } from "../icon/icon.js";
4
+ import { getAlertTextColor as k, getAlertBackgroundColor as I, getAlertIcon as M } from "./helper.js";
5
+ import { ThemeFontVariable as s, ThemeRadiusVariable as j, ThemeSpaceVariable as B, ThemeIconSizeVariable as f, ThemeFontSizeVariable as w } from "../../theme/theme-types.js";
6
+ import { Icon as d } from "../icon/icon.js";
7
7
  import { Text as R } from "../text/text.js";
8
8
  import { Icons as y } from "../icon/types.js";
9
9
  function G({
10
- minHeight: d = "48px",
11
- px: u = B.Medium,
12
- py: x = "12px",
13
- w: g = "100%",
14
- children: p,
10
+ minHeight: u = "48px",
11
+ px: x = B.Medium,
12
+ py: g = "12px",
13
+ w: p = "100%",
14
+ children: b,
15
15
  title: o,
16
16
  onClose: a,
17
17
  type: e = "info",
18
- iconVerticalAlign: b,
19
- icon: h,
18
+ iconVerticalAlign: h,
19
+ icon: c,
20
20
  ...C
21
21
  }) {
22
- const n = i(() => V(e), [e]), S = i(() => k(e), [e]), T = h ?? i(() => M(e), [e]), A = () => a ? /* @__PURE__ */ r(
23
- I.button,
22
+ const n = i(() => k(e), [e]), S = i(() => I(e), [e]), T = i(() => c ?? M(e), [c, e]), A = () => a ? /* @__PURE__ */ r(
23
+ V.button,
24
24
  {
25
25
  type: "button",
26
26
  "aria-label": "Close",
27
27
  onClick: a,
28
28
  mt: o ? "4px" : 0,
29
29
  alignSelf: o ? "flex-start" : "center",
30
- children: /* @__PURE__ */ r(f, { icon: y.Close, size: s.Medium, color: n })
30
+ children: /* @__PURE__ */ r(d, { icon: y.Close, size: f.Medium, color: n })
31
31
  }
32
- ) : null, c = b || (o ? "flex-start" : "center"), z = c === "flex-start" ? "4px" : 0;
32
+ ) : null, m = h || (o ? "flex-start" : "center"), z = m === "flex-start" ? "4px" : 0;
33
33
  return /* @__PURE__ */ r(
34
34
  F,
35
35
  {
36
36
  bgColor: S,
37
- px: u,
38
- py: x,
39
- w: g,
37
+ px: x,
38
+ py: g,
39
+ w: p,
40
40
  borderRadius: j.Small,
41
41
  display: "flex",
42
42
  alignItems: "center",
43
- minHeight: d,
44
- fontFamily: m.Body,
43
+ minHeight: u,
44
+ fontFamily: s.Body,
45
45
  color: n,
46
46
  ...C,
47
47
  children: /* @__PURE__ */ t(l, { align: "center", w: "100%", justify: "space-between", gap: "10px", children: [
48
48
  /* @__PURE__ */ t(l, { gap: "10px", children: [
49
49
  /* @__PURE__ */ r(
50
- f,
50
+ d,
51
51
  {
52
52
  color: n,
53
53
  icon: T,
54
- size: s.Small,
54
+ size: f.Small,
55
55
  mt: z,
56
- alignSelf: c
56
+ alignSelf: m
57
57
  }
58
58
  ),
59
59
  /* @__PURE__ */ t(l, { direction: "column", alignContent: "flex-start", children: [
60
60
  o && /* @__PURE__ */ r(
61
61
  R,
62
62
  {
63
- fontFamily: m.SubHeader,
63
+ fontFamily: s.SubHeader,
64
64
  fontSize: w.Large,
65
65
  fontWeight: "medium",
66
66
  children: o
67
67
  }
68
68
  ),
69
- p
69
+ b
70
70
  ] })
71
71
  ] }),
72
72
  A()
@@ -7,7 +7,7 @@ export type ButtonProps = CustomChakraBoxProps & LayoutProps & MarginProps & Pad
7
7
  * @note The 'segmentedControl' variant is only used by the SegmentedControl component.
8
8
  * @note The 'card' variant is deprecated, use the component ToggleButton instead.
9
9
  */
10
- variant?: ResponsiveValue<"primary" | "secondary" | "link" | "ghost" | "tertiary" | "segmentedControl" | "card"> | undefined;
10
+ variant?: ResponsiveValue<"primary" | "secondary" | "link" | "ghost" | "tertiary" | "segmentedControl" | "card" | "alert"> | undefined;
11
11
  /** The size of the button, default: md */
12
12
  size?: ResponsiveValue<"lg" | "sm" | "md"> | undefined;
13
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EACN,KAAK,WAAW,IAAI,iBAAiB,EACrC,KAAK,SAAS,IAAI,eAAe,EACjC,KAAK,eAAe,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAC7C,WAAW,GACX,WAAW,GACX,YAAY,GACZ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC,GAChD,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG;IACvG;;;;OAIG;IACH,OAAO,CAAC,EACL,eAAe,CAAC,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,GAAG,MAAM,CAAC,GACtG,SAAS,CAAC;IAEb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IAEvD;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC;IAEjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,KAAK,CAAC;CAClB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EACN,KAAK,WAAW,IAAI,iBAAiB,EACrC,KAAK,SAAS,IAAI,eAAe,EACjC,KAAK,eAAe,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAC7C,WAAW,GACX,WAAW,GACX,YAAY,GACZ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC,GAChD,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC,GAAG;IACvG;;;;OAIG;IACH,OAAO,CAAC,EACL,eAAe,CACf,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAC9F,GACD,SAAS,CAAC;IAEb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IAEvD;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC;IAEjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,KAAK,CAAC;CAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-button.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-button.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAsBlD,wBAAgB,cAAc,CAAC,EAC9B,EAAE,EACF,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,cAAc,GACd,EAAE,kBAAkB,2CAiLpB"}
1
+ {"version":3,"file":"combobox-button.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-button.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAsBlD,wBAAgB,cAAc,CAAC,EAC9B,EAAE,EACF,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,cAAc,GACd,EAAE,kBAAkB,2CAsLpB"}
@@ -1,12 +1,12 @@
1
1
  import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
- import { useStyleConfig as F, Flex as u, Box as d, Input as L } from "@chakra-ui/react";
3
- import { Fragment as N } from "react";
4
- import { ComboboxItem as y } from "./combobox-item.js";
5
- import { Tag as X } from "../tag/tag.js";
6
- import { Icon as $ } from "../icon/icon.js";
7
- import { Icons as v } from "../icon/types.js";
8
- import { ThemeColorVariable as r, ThemeSpaceVariable as c, ThemeRadiusVariable as K, ThemeIconSizeVariable as T } from "../../theme/theme-types.js";
9
- function s() {
2
+ import { useStyleConfig as N, Flex as c, Box as d, Input as X } from "@chakra-ui/react";
3
+ import { Fragment as $ } from "react";
4
+ import { ComboboxItem as _ } from "./combobox-item.js";
5
+ import { Tag as v } from "../tag/tag.js";
6
+ import { Icon as K } from "../icon/icon.js";
7
+ import { Icons as T } from "../icon/types.js";
8
+ import { ThemeColorVariable as r, ThemeSpaceVariable as u, ThemeRadiusVariable as U, ThemeIconSizeVariable as q } from "../../theme/theme-types.js";
9
+ function E() {
10
10
  return /* @__PURE__ */ i(
11
11
  d,
12
12
  {
@@ -26,50 +26,50 @@ function s() {
26
26
  }
27
27
  );
28
28
  }
29
- function H({
30
- id: _,
31
- asPlainText: l,
29
+ function P({
30
+ id: j,
31
+ asPlainText: e,
32
32
  inputValue: b,
33
33
  selectedItems: n,
34
- displayItems: E,
34
+ displayItems: B,
35
35
  toggleItem: C,
36
- highlightState: e,
36
+ highlightState: l,
37
37
  openState: a,
38
- parentStrings: j,
39
- size: B,
40
- variant: R,
38
+ parentStrings: R,
39
+ size: V,
40
+ variant: W,
41
41
  label: S,
42
- placeHolderText: V,
42
+ placeHolderText: z,
43
43
  isDisabled: h,
44
44
  isReadOnly: m,
45
45
  isInvalid: w,
46
46
  collapsed: k,
47
47
  hasPendingDelete: g,
48
- setHasPendingDelete: x,
49
- setInputValue: t,
48
+ setHasPendingDelete: t,
49
+ setInputValue: s,
50
50
  onSearch: O,
51
- isSingleSelect: W
51
+ isSingleSelect: A
52
52
  }) {
53
- const z = F("Combobox", { size: B, variant: R }), A = (o) => {
54
- if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ? C(E[e.index]) : a.open()), o.key === "Escape") {
53
+ const D = N("Combobox", { size: V, variant: W }), F = (o) => {
54
+ if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ? C(B[l.index]) : a.open()), o.key === "Escape") {
55
55
  if (!a.isOpen) return;
56
- o.preventDefault(), o.stopPropagation(), a.close(), l || (t(""), O?.(""));
56
+ o.preventDefault(), o.stopPropagation(), a.close(), e || (s(""), O?.(""));
57
57
  }
58
- o.key === "Backspace" ? b.length === 0 && n.length > 0 && !l && (g ? (C(n[n.length - 1]), x(!1)) : x(!0)) : x(!1), o.key === "ArrowDown" && (a.isOpen ? e.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? e.previous() : a.open());
59
- }, D = (o) => {
58
+ o.key === "Backspace" ? b.length === 0 && n.length > 0 && !e && (g ? (C(n[n.length - 1]), t(!1)) : t(!0)) : t(!1), o.key === "ArrowDown" && (a.isOpen ? l.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? l.previous() : a.open());
59
+ }, L = (o) => {
60
60
  o.preventDefault(), o.stopPropagation();
61
61
  const f = o.target.value;
62
- t(f), O?.(f), e.set(0), a.open();
63
- };
62
+ s(f), O?.(f), l.set(0), a.open();
63
+ }, x = n[0], y = n[n.length - 1];
64
64
  return /* @__PURE__ */ p(
65
- u,
65
+ c,
66
66
  {
67
- __css: z,
67
+ __css: D,
68
68
  "aria-disabled": h,
69
69
  "aria-readonly": m,
70
70
  "aria-invalid": w,
71
- borderRadius: K.Small,
72
- padding: c.Small,
71
+ borderRadius: U.Small,
72
+ padding: u.Small,
73
73
  _focusWithin: w ? {
74
74
  borderColor: r.Error,
75
75
  boxShadow: `0 0 0 4px ${r.ErrorContainer}`,
@@ -85,45 +85,45 @@ function H({
85
85
  },
86
86
  children: [
87
87
  /* @__PURE__ */ p(
88
- u,
88
+ c,
89
89
  {
90
- flexWrap: k || W ? "nowrap" : "wrap",
91
- gap: c.Small,
90
+ flexWrap: k || A ? "nowrap" : "wrap",
91
+ gap: u.Small,
92
92
  overflow: "hidden",
93
93
  children: [
94
94
  S && /* @__PURE__ */ i(d, { whiteSpace: "nowrap", children: S }),
95
- !l && (k ? n.length > 0 && /* @__PURE__ */ p(
96
- u,
95
+ !e && (k ? n.length > 0 && y && /* @__PURE__ */ p(
96
+ c,
97
97
  {
98
- gap: c.XSmall,
98
+ gap: u.XSmall,
99
99
  flexShrink: "1",
100
100
  overflow: "hidden",
101
101
  whiteSpace: "nowrap",
102
102
  textOverflow: "ellipsis",
103
103
  children: [
104
- n.length > 3 && /* @__PURE__ */ i(s, {}),
105
- n.length > 2 && /* @__PURE__ */ i(s, {}),
106
- n.length > 1 && /* @__PURE__ */ i(X, { children: n.length - 1 }),
104
+ n.length > 3 && /* @__PURE__ */ i(E, {}),
105
+ n.length > 2 && /* @__PURE__ */ i(E, {}),
106
+ n.length > 1 && /* @__PURE__ */ i(v, { children: n.length - 1 }),
107
107
  /* @__PURE__ */ i(
108
- y,
108
+ _,
109
109
  {
110
110
  isDeleting: g,
111
- item: n[n.length - 1],
112
- asPlainText: l
111
+ item: y,
112
+ asPlainText: e
113
113
  }
114
114
  )
115
115
  ]
116
116
  }
117
117
  ) : n.map((o, f) => /* @__PURE__ */ i(
118
- y,
118
+ _,
119
119
  {
120
120
  item: o,
121
- asPlainText: l,
121
+ asPlainText: e,
122
122
  isDeleting: f === n.length - 1 && g
123
123
  },
124
124
  o.id
125
125
  ))),
126
- l && n.length > 0 && b === n[0].label && j[n[0].id]?.map((o) => /* @__PURE__ */ p(N, { children: [
126
+ e && n.length > 0 && x && b === x.label && R[x.id]?.map((o) => /* @__PURE__ */ p($, { children: [
127
127
  /* @__PURE__ */ i(
128
128
  d,
129
129
  {
@@ -137,19 +137,19 @@ function H({
137
137
  /* @__PURE__ */ i(d, { color: r.OnSurfaceSubdued, children: "/" })
138
138
  ] }, o)),
139
139
  /* @__PURE__ */ i(
140
- L,
140
+ X,
141
141
  {
142
- id: _,
142
+ id: j,
143
143
  isDisabled: h,
144
144
  isReadOnly: m,
145
145
  isInvalid: w,
146
- onKeyDown: A,
146
+ onKeyDown: F,
147
147
  variant: "unstyled",
148
148
  value: b,
149
149
  autoComplete: "off",
150
- minWidth: c.XLarge,
151
- onChange: D,
152
- placeholder: V,
150
+ minWidth: u.XLarge,
151
+ onChange: L,
152
+ placeholder: z,
153
153
  border: "none",
154
154
  flex: 1,
155
155
  color: r.OnSurface,
@@ -166,11 +166,11 @@ function H({
166
166
  ]
167
167
  }
168
168
  ),
169
- /* @__PURE__ */ i(u, { className: "combobox-dropdown-icon", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ i(
170
- $,
169
+ /* @__PURE__ */ i(c, { className: "combobox-dropdown-icon", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ i(
170
+ K,
171
171
  {
172
- icon: v.TreeViewCollapse,
173
- size: T.Small,
172
+ icon: T.TreeViewCollapse,
173
+ size: q.Small,
174
174
  color: h || m ? r.OnSurfaceSubdued : r.OnSurface
175
175
  }
176
176
  ) })
@@ -179,5 +179,5 @@ function H({
179
179
  );
180
180
  }
181
181
  export {
182
- H as ComboboxButton
182
+ P as ComboboxButton
183
183
  };
@@ -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;AAqClD,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,2CAqJpB"}
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,2CAqJpB"}
@@ -1,15 +1,15 @@
1
1
  import { jsxs as l, jsx as i, Fragment as G } from "react/jsx-runtime";
2
2
  import { Box as d, Flex as g } from "@chakra-ui/react";
3
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 F, useState as N, useEffect as Q } from "react";
4
+ import { Fragment as z, useState as N, useEffect as Q } from "react";
5
5
  import { ComboboxItem as Z } from "./combobox-item.js";
6
6
  import { interpolate as R } from "./translations.js";
7
- import { ThemeColorVariable as o, ThemeShadowVariable as oo, ThemeRadiusVariable as V, ThemeSpaceVariable as t, ThemeIconSizeVariable as $, ThemeFontSizeVariable as ro, ThemeBorderVariable as no } from "../../theme/theme-types.js";
8
- import { Text as z } from "../text/text.js";
9
- import { Icon as P } from "../icon/icon.js";
10
- import { Icons as B } from "../icon/types.js";
11
- const eo = (n, e, u, a, b) => {
12
- const [m, s] = N({
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";
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({
13
13
  transform: "translate(0, 0)",
14
14
  minWidth: 0
15
15
  });
@@ -18,18 +18,20 @@ const eo = (n, e, u, a, b) => {
18
18
  };
19
19
  const S = async () => {
20
20
  if (n.current && e.current && u) {
21
- const { width: p } = n.current.getBoundingClientRect(), { x: h, y: x } = await K(n.current, e.current, {
22
- placement: b || "bottom-start",
21
+ const { width: h } = n.current.getBoundingClientRect(), { x, y: k } = await K(n.current, e.current, {
22
+ placement: p || "bottom-start",
23
23
  middleware: [L()]
24
24
  });
25
- s({
26
- transform: `translate(${h}px, ${x}px)`,
27
- minWidth: a || p
25
+ m({
26
+ transform: `translate(${x}px, ${k}px)`,
27
+ minWidth: a || h
28
28
  });
29
29
  }
30
+ }, b = () => {
31
+ S().catch(console.error);
30
32
  };
31
- return J(n.current, e.current, S);
32
- }, [n, e, u, b, a]), m;
33
+ return J(n.current, e.current, b);
34
+ }, [n, e, u, p, a]), s;
33
35
  };
34
36
  function to({
35
37
  isSingleSelect: n,
@@ -44,15 +46,15 @@ function to({
44
46
  flexShrink: "0",
45
47
  border: `${n && e ? 8 : 2}px solid ${e ? o.Primary : o.OnBackground}`,
46
48
  backgroundColor: e && !n ? o.Primary : "auto",
47
- borderRadius: n ? "50%" : V.Small,
49
+ borderRadius: n ? "50%" : D.Small,
48
50
  children: !n && e && /* @__PURE__ */ i(
49
- P,
51
+ B,
50
52
  {
51
53
  top: "-2px",
52
54
  position: "absolute",
53
55
  width: $.Small,
54
56
  color: o.Surface,
55
- icon: B.Checkbox
57
+ icon: C.Checkbox
56
58
  }
57
59
  )
58
60
  }
@@ -63,49 +65,49 @@ function fo({
63
65
  inputValue: e,
64
66
  selectedItems: u,
65
67
  displayItems: a,
66
- toggleItem: b,
67
- highlightState: m,
68
- openState: s,
68
+ toggleItem: p,
69
+ highlightState: s,
70
+ openState: m,
69
71
  parentStrings: S,
70
- isSingleSelect: p,
72
+ isSingleSelect: b,
71
73
  isSearching: h,
72
74
  isReadOnly: x,
73
- isHidingItems: D,
75
+ isHidingItems: k,
74
76
  popoverWidth: I,
75
77
  popoverPlacement: X,
76
- previousSelectedItems: k,
78
+ previousSelectedItems: w,
77
79
  parentRef: j,
78
- popupRef: C,
79
- footerContent: O,
80
- subMenuState: v,
81
- translation: M
80
+ popupRef: O,
81
+ footerContent: v,
82
+ subMenuState: M,
83
+ translation: T
82
84
  }) {
83
85
  const H = eo(
84
86
  j,
85
- C,
86
- s.isOpen,
87
+ O,
88
+ m.isOpen,
87
89
  I,
88
90
  X
89
91
  ), A = (r) => {
90
- m.set(r);
92
+ s.set(r);
91
93
  };
92
94
  return /* @__PURE__ */ l(
93
95
  d,
94
96
  {
95
- display: s.isOpen ? "block" : "none",
97
+ display: m.isOpen ? "block" : "none",
96
98
  inset: "0 auto auto 0",
97
99
  position: "fixed",
98
100
  zIndex: "50",
99
101
  visibility: "visible",
100
102
  backgroundColor: o.Surface,
101
- borderRadius: V.Medium,
103
+ borderRadius: D.Medium,
102
104
  boxShadow: oo.Medium,
103
105
  color: o.OnSurface,
104
106
  overflow: "hidden",
105
107
  style: H,
106
- ref: C,
108
+ ref: O,
107
109
  onClick: (r) => {
108
- r.preventDefault(), r.stopPropagation(), p && s.close();
110
+ r.preventDefault(), r.stopPropagation(), b && m.close();
109
111
  },
110
112
  children: [
111
113
  /* @__PURE__ */ l(
@@ -119,37 +121,37 @@ function fo({
119
121
  padding: `${t.Small} 0`,
120
122
  children: [
121
123
  h && a.length === 0 && e.length > 0 && /* @__PURE__ */ i(
122
- z,
124
+ V,
123
125
  {
124
126
  px: t.Small,
125
127
  color: o.OnSurfaceSubdued,
126
- children: `${M.noMatchFor} "${e}"`
128
+ children: `${T.noMatchFor} "${e}"`
127
129
  }
128
130
  ),
129
131
  a.map((r, f) => {
130
- const T = u.some((c) => c.id === r.id), E = (c) => {
131
- c.stopPropagation(), c.preventDefault(), b(r);
132
- }, U = r.children?.length, w = r.id === "_back", W = v.opened[v.opened.length - 1], y = r.id === W?.id, Y = w ? /* @__PURE__ */ l(g, { gap: t.XSmall, alignItems: "center", children: [
133
- /* @__PURE__ */ i(P, { icon: B.Back, size: $.Small }),
132
+ const y = u.some((c) => c.id === r.id), E = (c) => {
133
+ c.stopPropagation(), c.preventDefault(), p(r);
134
+ }, 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: [
135
+ /* @__PURE__ */ i(B, { icon: C.Back, size: $.Small }),
134
136
  r.label
135
137
  ] }) : /* @__PURE__ */ l(G, { children: [
136
138
  /* @__PURE__ */ l(g, { gap: t.XSmall, alignItems: "center", whiteSpace: "nowrap", children: [
137
- S[r.id]?.map((c) => /* @__PURE__ */ l(F, { children: [
139
+ S[r.id]?.map((c) => /* @__PURE__ */ l(z, { children: [
138
140
  /* @__PURE__ */ i(d, { color: o.OnSurfaceSubdued, children: c }),
139
141
  /* @__PURE__ */ i(d, { color: o.OnSurfaceSubdued, children: "/" })
140
142
  ] }, c)),
141
143
  /* @__PURE__ */ i(Z, { item: r, asPlainText: n })
142
144
  ] }),
143
- x ? void 0 : U && !y && !h ? /* @__PURE__ */ i(
144
- P,
145
+ x ? void 0 : U && !F && !h ? /* @__PURE__ */ i(
146
+ B,
145
147
  {
146
- icon: B.Forward,
148
+ icon: C.Forward,
147
149
  size: $.Small,
148
150
  color: o.OnBackgroundSubdued
149
151
  }
150
- ) : /* @__PURE__ */ i(to, { isSingleSelect: p, isChecked: T })
151
- ] }), _ = k.length > 0 && k.length - 1 === f && k.length < a.length, q = !x && !h && (_ || (w || y));
152
- return /* @__PURE__ */ l(F, { children: [
152
+ ) : /* @__PURE__ */ i(to, { isSingleSelect: b, isChecked: y })
153
+ ] }), _ = w.length > 0 && w.length - 1 === f && w.length < a.length, q = !x && !h && (_ || (P || F));
154
+ return /* @__PURE__ */ l(z, { children: [
153
155
  /* @__PURE__ */ i(
154
156
  g,
155
157
  {
@@ -160,19 +162,19 @@ function fo({
160
162
  padding: `${t.Small} ${t.Medium}`,
161
163
  gap: t.Medium,
162
164
  textDecoration: "none",
163
- backgroundColor: m.index === f ? o.AccentHoverAlpha : "",
165
+ backgroundColor: s.index === f ? o.AccentHoverAlpha : "",
164
166
  onClick: E,
165
167
  tabIndex: -1,
166
168
  onMouseEnter: () => A(f),
167
- "data-is-active-index": m.index === f,
168
- "aria-selected": T,
169
+ "data-is-active-index": s.index === f,
170
+ "aria-selected": y,
169
171
  children: Y
170
172
  }
171
173
  ),
172
174
  q && /* @__PURE__ */ i(
173
175
  d,
174
176
  {
175
- margin: `${t.Small} ${w ? 0 : t.Medium}`,
177
+ margin: `${t.Small} ${P ? 0 : t.Medium}`,
176
178
  height: "1px",
177
179
  flexShrink: 0,
178
180
  backgroundColor: o.OnBackgroundBorder
@@ -180,14 +182,14 @@ function fo({
180
182
  )
181
183
  ] }, r.id);
182
184
  }),
183
- D && /* @__PURE__ */ i(
184
- z,
185
+ k && /* @__PURE__ */ i(
186
+ V,
185
187
  {
186
188
  px: t.Small,
187
189
  py: t.Small,
188
190
  color: o.OnSurfaceSubdued,
189
191
  fontSize: ro.Small,
190
- children: R(M.showMaxItems, {
192
+ children: R(T.showMaxItems, {
191
193
  count: a.length
192
194
  })
193
195
  }
@@ -195,7 +197,7 @@ function fo({
195
197
  ]
196
198
  }
197
199
  ),
198
- O && /* @__PURE__ */ i(
200
+ v && /* @__PURE__ */ i(
199
201
  d,
200
202
  {
201
203
  position: "sticky",
@@ -203,7 +205,7 @@ function fo({
203
205
  backgroundColor: o.Surface,
204
206
  padding: `${t.Small} ${t.Medium}`,
205
207
  borderTop: `${no.XSmall} ${o.OnSurfaceBorder}`,
206
- children: O
208
+ children: v
207
209
  }
208
210
  )
209
211
  ]
@@ -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;AAiGjB;;;;;;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,2CA2Lf"}
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;AAiGjB;;;;;;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,2CA+Lf"}