@caspeco/casper-ui-library 5.1.0 → 5.1.1

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 +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,2CAwKpB"}
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,16 +1,16 @@
1
1
  import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
- import { useStyleConfig as E, Flex as u, Box as d, Input as F } from "@chakra-ui/react";
3
- import { Fragment as L } from "react";
4
- import { ComboboxItem as O } from "./combobox-item.js";
5
- import { Tag as N } from "../tag/tag.js";
6
- import { Icon as X } from "../icon/icon.js";
7
- import { Icons as K } from "../icon/types.js";
8
- import { ThemeColorVariable as n, ThemeSpaceVariable as c, ThemeRadiusVariable as T, ThemeIconSizeVariable as U } from "../../theme/theme-types.js";
9
- function y() {
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() {
10
10
  return /* @__PURE__ */ i(
11
11
  d,
12
12
  {
13
- backgroundColor: n.NeutralContainer,
13
+ backgroundColor: r.NeutralContainer,
14
14
  width: "8px",
15
15
  borderRadius: "4px",
16
16
  marginRight: "-8px",
@@ -21,45 +21,45 @@ function y() {
21
21
  height: "100%",
22
22
  width: "8px",
23
23
  display: "block",
24
- backgroundColor: n.Surface
24
+ backgroundColor: r.Surface
25
25
  }
26
26
  }
27
27
  );
28
28
  }
29
29
  function H({
30
- id: s,
30
+ id: _,
31
31
  asPlainText: l,
32
32
  inputValue: b,
33
- selectedItems: r,
34
- displayItems: _,
35
- toggleItem: x,
36
- highlightState: f,
33
+ selectedItems: n,
34
+ displayItems: E,
35
+ toggleItem: C,
36
+ highlightState: e,
37
37
  openState: a,
38
38
  parentStrings: j,
39
39
  size: B,
40
40
  variant: R,
41
- label: C,
41
+ label: S,
42
42
  placeHolderText: V,
43
43
  isDisabled: h,
44
44
  isReadOnly: m,
45
- isInvalid: W,
46
- collapsed: S,
47
- hasPendingDelete: w,
48
- setHasPendingDelete: g,
49
- setInputValue: k,
50
- onSearch: t,
51
- isSingleSelect: v
45
+ isInvalid: w,
46
+ collapsed: k,
47
+ hasPendingDelete: g,
48
+ setHasPendingDelete: x,
49
+ setInputValue: t,
50
+ onSearch: O,
51
+ isSingleSelect: W
52
52
  }) {
53
- const z = E("Combobox", { size: B, variant: R }), A = (o) => {
54
- if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ? x(_[f.index]) : a.open()), o.key === "Escape") {
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") {
55
55
  if (!a.isOpen) return;
56
- o.preventDefault(), o.stopPropagation(), a.close(), l || (k(""), t?.(""));
56
+ o.preventDefault(), o.stopPropagation(), a.close(), l || (t(""), O?.(""));
57
57
  }
58
- o.key === "Backspace" ? b.length === 0 && r.length > 0 && !l && (w ? (x(r[r.length - 1]), g(!1)) : g(!0)) : g(!1), o.key === "ArrowDown" && (a.isOpen ? f.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? f.previous() : a.open());
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
59
  }, D = (o) => {
60
60
  o.preventDefault(), o.stopPropagation();
61
- const e = o.target.value;
62
- k(e), t?.(e), f.set(0), a.open();
61
+ const f = o.target.value;
62
+ t(f), O?.(f), e.set(0), a.open();
63
63
  };
64
64
  return /* @__PURE__ */ p(
65
65
  u,
@@ -67,27 +67,32 @@ function H({
67
67
  __css: z,
68
68
  "aria-disabled": h,
69
69
  "aria-readonly": m,
70
- borderRadius: T.Small,
70
+ "aria-invalid": w,
71
+ borderRadius: K.Small,
71
72
  padding: c.Small,
72
- _focusWithin: {
73
- borderColor: n.Info,
74
- boxShadow: `0 0 0 4px ${n.InfoContainer}`,
75
- backgroundColor: n.Surface
73
+ _focusWithin: w ? {
74
+ borderColor: r.Error,
75
+ boxShadow: `0 0 0 4px ${r.ErrorContainer}`,
76
+ backgroundColor: r.Surface
77
+ } : {
78
+ borderColor: r.Info,
79
+ boxShadow: `0 0 0 4px ${r.InfoContainer}`,
80
+ backgroundColor: r.Surface
76
81
  },
77
82
  _disabled: {
78
83
  borderColor: "transparent",
79
- backgroundColor: n.SurfaceDisabled
84
+ backgroundColor: r.SurfaceDisabled
80
85
  },
81
86
  children: [
82
87
  /* @__PURE__ */ p(
83
88
  u,
84
89
  {
85
- flexWrap: S || v ? "nowrap" : "wrap",
90
+ flexWrap: k || W ? "nowrap" : "wrap",
86
91
  gap: c.Small,
87
92
  overflow: "hidden",
88
93
  children: [
89
- C && /* @__PURE__ */ i(d, { whiteSpace: "nowrap", children: C }),
90
- !l && (S ? r.length > 0 && /* @__PURE__ */ p(
94
+ S && /* @__PURE__ */ i(d, { whiteSpace: "nowrap", children: S }),
95
+ !l && (k ? n.length > 0 && /* @__PURE__ */ p(
91
96
  u,
92
97
  {
93
98
  gap: c.XSmall,
@@ -96,48 +101,48 @@ function H({
96
101
  whiteSpace: "nowrap",
97
102
  textOverflow: "ellipsis",
98
103
  children: [
99
- r.length > 3 && /* @__PURE__ */ i(y, {}),
100
- r.length > 2 && /* @__PURE__ */ i(y, {}),
101
- r.length > 1 && /* @__PURE__ */ i(N, { children: r.length - 1 }),
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 }),
102
107
  /* @__PURE__ */ i(
103
- O,
108
+ y,
104
109
  {
105
- isDeleting: w,
106
- item: r[r.length - 1],
110
+ isDeleting: g,
111
+ item: n[n.length - 1],
107
112
  asPlainText: l
108
113
  }
109
114
  )
110
115
  ]
111
116
  }
112
- ) : r.map((o, e) => /* @__PURE__ */ i(
113
- O,
117
+ ) : n.map((o, f) => /* @__PURE__ */ i(
118
+ y,
114
119
  {
115
120
  item: o,
116
121
  asPlainText: l,
117
- isDeleting: e === r.length - 1 && w
122
+ isDeleting: f === n.length - 1 && g
118
123
  },
119
124
  o.id
120
125
  ))),
121
- l && r.length > 0 && b === r[0].label && j[r[0].id]?.map((o) => /* @__PURE__ */ p(L, { children: [
126
+ l && n.length > 0 && b === n[0].label && j[n[0].id]?.map((o) => /* @__PURE__ */ p(N, { children: [
122
127
  /* @__PURE__ */ i(
123
128
  d,
124
129
  {
125
- color: n.OnSurfaceSubdued,
130
+ color: r.OnSurfaceSubdued,
126
131
  textOverflow: "ellipsis",
127
132
  overflow: "hidden",
128
133
  whiteSpace: "nowrap",
129
134
  children: o
130
135
  }
131
136
  ),
132
- /* @__PURE__ */ i(d, { color: n.OnSurfaceSubdued, children: "/" })
137
+ /* @__PURE__ */ i(d, { color: r.OnSurfaceSubdued, children: "/" })
133
138
  ] }, o)),
134
139
  /* @__PURE__ */ i(
135
- F,
140
+ L,
136
141
  {
137
- id: s,
142
+ id: _,
138
143
  isDisabled: h,
139
144
  isReadOnly: m,
140
- isInvalid: W,
145
+ isInvalid: w,
141
146
  onKeyDown: A,
142
147
  variant: "unstyled",
143
148
  value: b,
@@ -147,14 +152,14 @@ function H({
147
152
  placeholder: V,
148
153
  border: "none",
149
154
  flex: 1,
150
- color: n.OnSurface,
155
+ color: r.OnSurface,
151
156
  outline: "none",
152
157
  _placeholder: {
153
- color: n.OnSurfaceSubdued
158
+ color: r.OnSurfaceSubdued
154
159
  },
155
160
  _disabled: {
156
161
  cursor: "not-allowed",
157
- color: n.OnSurfaceSubdued
162
+ color: r.OnSurfaceSubdued
158
163
  }
159
164
  }
160
165
  )
@@ -162,11 +167,11 @@ function H({
162
167
  }
163
168
  ),
164
169
  /* @__PURE__ */ i(u, { className: "combobox-dropdown-icon", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ i(
165
- X,
170
+ $,
166
171
  {
167
- icon: K.TreeViewCollapse,
168
- size: U.Small,
169
- color: h || m ? n.OnSurfaceSubdued : n.OnSurface
172
+ icon: v.TreeViewCollapse,
173
+ size: T.Small,
174
+ color: h || m ? r.OnSurfaceSubdued : r.OnSurface
170
175
  }
171
176
  ) })
172
177
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/combobox-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAoE5E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIzB,CAAC"}
1
+ {"version":3,"file":"combobox-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/combobox-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAgF5E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIzB,CAAC"}
@@ -12,6 +12,18 @@ const a = {
12
12
  '&[aria-readonly="true"]': {
13
13
  borderColor: "transparent",
14
14
  backgroundColor: o.SurfaceDisabled
15
+ },
16
+ '&[aria-invalid="true"]': {
17
+ borderColor: o.Error,
18
+ _focusWithin: {
19
+ borderColor: o.Error,
20
+ boxShadow: `0 0 0 4px ${o.ErrorContainer}`
21
+ },
22
+ "@media(hover: hover)": {
23
+ "&:hover:not(:focus-within)": {
24
+ borderColor: o.ErrorHover
25
+ }
26
+ }
15
27
  }
16
28
  }, n = {
17
29
  outline: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caspeco/casper-ui-library",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "prettier": "@caspeco/prettier-config",
5
5
  "type": "module",
6
6
  "sideEffects": false,