@caspeco/casper-ui-library 7.7.4 → 7.7.5

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.
@@ -1,14 +1,14 @@
1
1
  import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
- import { useStyleConfig as L, Flex as c, Box as u, Input as N } from "@chakra-ui/react";
3
- import { Fragment as X } from "react";
4
- import { ComboboxItem as _ } from "./combobox-item.js";
5
- import { Tag as $ } 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 d, ThemeRadiusVariable as U, ThemeIconSizeVariable as q } from "../../theme/theme-types.js";
9
- function E() {
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 E } from "./combobox-item.js";
5
+ import { Tag as K } from "../tag/tag.js";
6
+ import { Icon as U } from "../icon/icon.js";
7
+ import { Icons as q } from "../icon/types.js";
8
+ import { ThemeColorVariable as r, ThemeSpaceVariable as u, ThemeRadiusVariable as G, ThemeIconSizeVariable as J } from "../../theme/theme-types.js";
9
+ function j() {
10
10
  return /* @__PURE__ */ i(
11
- u,
11
+ d,
12
12
  {
13
13
  backgroundColor: r.NeutralContainer,
14
14
  width: "8px",
@@ -26,51 +26,51 @@ function E() {
26
26
  }
27
27
  );
28
28
  }
29
- function I({
30
- id: j,
29
+ function oo({
30
+ id: B,
31
31
  asPlainText: e,
32
- inputValue: b,
32
+ inputValue: h,
33
33
  selectedItems: n,
34
- displayItems: B,
34
+ displayItems: R,
35
35
  toggleItem: C,
36
36
  highlightState: l,
37
37
  openState: a,
38
- parentStrings: R,
39
- size: V,
40
- variant: W,
38
+ parentStrings: V,
39
+ size: W,
40
+ variant: v,
41
41
  label: S,
42
- placeHolderText: v,
43
- isDisabled: h,
42
+ placeHolderText: s,
43
+ isDisabled: b,
44
44
  isReadOnly: m,
45
- isInvalid: t,
46
- collapsed: s,
47
- hasPendingDelete: w,
45
+ isInvalid: w,
46
+ collapsed: k,
47
+ hasPendingDelete: t,
48
48
  setHasPendingDelete: g,
49
- setInputValue: k,
50
- onSearch: O,
49
+ setInputValue: O,
50
+ onSearch: y,
51
51
  isSingleSelect: z
52
52
  }) {
53
- const A = L("Combobox", { size: V, variant: W }), D = (o) => {
54
- if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ? C(B[l.index]) : a.open()), o.key === "Escape") {
53
+ const A = N("Combobox", { size: W, variant: v }), D = (o) => {
54
+ if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ? C(R[l.index]) : a.open()), o.key === "Escape") {
55
55
  if (!a.isOpen) return;
56
- o.preventDefault(), o.stopPropagation(), a.close(), e || (k(""), O?.(""));
56
+ o.preventDefault(), o.stopPropagation(), a.close(), e || (O(""), y?.(""));
57
57
  }
58
- o.key === "Backspace" ? b.length === 0 && n.length > 0 && !e && (w ? (C(n[n.length - 1]), g(!1)) : g(!0)) : g(!1), o.key === "ArrowDown" && (a.isOpen ? l.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? l.previous() : a.open());
58
+ o.key === "Backspace" ? h.length === 0 && n.length > 0 && !e && (t ? (C(n[n.length - 1]), g(!1)) : g(!0)) : g(!1), o.key === "ArrowDown" && (a.isOpen ? l.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? l.previous() : a.open());
59
59
  }, F = (o) => {
60
60
  o.preventDefault(), o.stopPropagation();
61
61
  const p = o.target.value;
62
- k(p), O?.(p), l.set(0), a.open();
63
- }, x = n[0], y = n[n.length - 1];
62
+ O(p), y?.(p), l.set(0), a.open();
63
+ }, x = n[0], _ = n[n.length - 1], L = a.isOpen || e || s;
64
64
  return /* @__PURE__ */ f(
65
65
  c,
66
66
  {
67
67
  __css: A,
68
- "aria-disabled": h,
68
+ "aria-disabled": b,
69
69
  "aria-readonly": m,
70
- "aria-invalid": t,
71
- borderRadius: U.Small,
72
- padding: d.Small,
73
- _focusWithin: t ? {
70
+ "aria-invalid": w,
71
+ borderRadius: G.Small,
72
+ padding: u.Small,
73
+ _focusWithin: w ? {
74
74
  borderColor: r.Error,
75
75
  boxShadow: `0 0 0 4px ${r.ErrorContainer}`,
76
76
  backgroundColor: r.Surface
@@ -87,45 +87,45 @@ function I({
87
87
  /* @__PURE__ */ f(
88
88
  c,
89
89
  {
90
- flexWrap: s || z ? "nowrap" : "wrap",
91
- gap: d.Small,
90
+ flexWrap: k || z ? "nowrap" : "wrap",
91
+ gap: u.Small,
92
92
  overflow: "hidden",
93
93
  children: [
94
- S && /* @__PURE__ */ i(u, { whiteSpace: "nowrap", children: S }),
95
- !e && (s ? n.length > 0 && y && /* @__PURE__ */ f(
94
+ S && /* @__PURE__ */ i(d, { whiteSpace: "nowrap", children: S }),
95
+ !e && (k ? n.length > 0 && _ && /* @__PURE__ */ f(
96
96
  c,
97
97
  {
98
- gap: d.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(E, {}),
105
- n.length > 2 && /* @__PURE__ */ i(E, {}),
106
- n.length > 1 && /* @__PURE__ */ i($, { children: n.length - 1 }),
104
+ n.length > 3 && /* @__PURE__ */ i(j, {}),
105
+ n.length > 2 && /* @__PURE__ */ i(j, {}),
106
+ n.length > 1 && /* @__PURE__ */ i(K, { children: n.length - 1 }),
107
107
  /* @__PURE__ */ i(
108
- _,
108
+ E,
109
109
  {
110
- isDeleting: w,
111
- item: y,
110
+ isDeleting: t,
111
+ item: _,
112
112
  asPlainText: e
113
113
  }
114
114
  )
115
115
  ]
116
116
  }
117
117
  ) : n.map((o, p) => /* @__PURE__ */ i(
118
- _,
118
+ E,
119
119
  {
120
120
  item: o,
121
121
  asPlainText: e,
122
- isDeleting: p === n.length - 1 && w
122
+ isDeleting: p === n.length - 1 && t
123
123
  },
124
124
  o.id
125
125
  ))),
126
- e && n.length > 0 && x && b === x.label && R[x.id]?.map((o) => /* @__PURE__ */ f(X, { children: [
126
+ e && n.length > 0 && x && h === x.label && V[x.id]?.map((o) => /* @__PURE__ */ f($, { children: [
127
127
  /* @__PURE__ */ i(
128
- u,
128
+ d,
129
129
  {
130
130
  color: r.OnSurfaceSubdued,
131
131
  textOverflow: "ellipsis",
@@ -134,22 +134,22 @@ function I({
134
134
  children: o
135
135
  }
136
136
  ),
137
- /* @__PURE__ */ i(u, { color: r.OnSurfaceSubdued, children: "/" })
137
+ /* @__PURE__ */ i(d, { color: r.OnSurfaceSubdued, children: "/" })
138
138
  ] }, o)),
139
139
  /* @__PURE__ */ i(
140
- N,
140
+ X,
141
141
  {
142
- id: j,
143
- isDisabled: h,
142
+ id: B,
143
+ isDisabled: b,
144
144
  isReadOnly: m,
145
- isInvalid: t,
145
+ isInvalid: w,
146
146
  onKeyDown: D,
147
147
  variant: "unstyled",
148
- value: b,
148
+ value: h,
149
149
  autoComplete: "off",
150
- minWidth: d.XLarge,
150
+ minWidth: u.XLarge,
151
151
  onChange: F,
152
- placeholder: v,
152
+ placeholder: s,
153
153
  border: "none",
154
154
  flex: 1,
155
155
  color: r.OnSurface,
@@ -161,7 +161,7 @@ function I({
161
161
  cursor: "not-allowed",
162
162
  color: r.OnSurfaceSubdued
163
163
  },
164
- sx: a.isOpen ? {} : {
164
+ sx: L ? {} : {
165
165
  position: "absolute",
166
166
  width: "1px",
167
167
  height: "1px",
@@ -178,11 +178,11 @@ function I({
178
178
  }
179
179
  ),
180
180
  /* @__PURE__ */ i(c, { className: "combobox-dropdown-icon", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ i(
181
- K,
181
+ U,
182
182
  {
183
- icon: T.TreeViewCollapse,
184
- size: q.Small,
185
- color: h || m ? r.OnSurfaceSubdued : r.OnSurface
183
+ icon: q.TreeViewCollapse,
184
+ size: J.Small,
185
+ color: b || m ? r.OnSurfaceSubdued : r.OnSurface
186
186
  }
187
187
  ) })
188
188
  ]
@@ -190,5 +190,5 @@ function I({
190
190
  );
191
191
  }
192
192
  export {
193
- I as ComboboxButton
193
+ oo as ComboboxButton
194
194
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caspeco/casper-ui-library",
3
- "version": "7.7.4",
3
+ "version": "7.7.5",
4
4
  "prettier": "@caspeco/prettier-config",
5
5
  "type": "module",
6
6
  "sideEffects": false,