konsolpro-custom-ui 0.0.348 → 0.0.349

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,144 +1,144 @@
1
- var Y = Object.defineProperty, Z = Object.defineProperties;
2
- var ee = Object.getOwnPropertyDescriptors;
3
- var P = Object.getOwnPropertySymbols;
4
- var q = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
- var j = (e, t, r) => t in e ? Y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, x = (e, t) => {
6
- for (var r in t || (t = {}))
7
- q.call(t, r) && j(e, r, t[r]);
8
- if (P)
9
- for (var r of P(t))
10
- A.call(t, r) && j(e, r, t[r]);
1
+ var Z = Object.defineProperty, ee = Object.defineProperties;
2
+ var re = Object.getOwnPropertyDescriptors;
3
+ var N = Object.getOwnPropertySymbols;
4
+ var A = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
5
+ var q = (e, r, o) => r in e ? Z(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, y = (e, r) => {
6
+ for (var o in r || (r = {}))
7
+ A.call(r, o) && q(e, o, r[o]);
8
+ if (N)
9
+ for (var o of N(r))
10
+ F.call(r, o) && q(e, o, r[o]);
11
11
  return e;
12
- }, g = (e, t) => Z(e, ee(t));
13
- var w = (e, t) => {
14
- var r = {};
15
- for (var o in e)
16
- q.call(e, o) && t.indexOf(o) < 0 && (r[o] = e[o]);
17
- if (e != null && P)
18
- for (var o of P(e))
19
- t.indexOf(o) < 0 && A.call(e, o) && (r[o] = e[o]);
20
- return r;
12
+ }, g = (e, r) => ee(e, re(r));
13
+ var w = (e, r) => {
14
+ var o = {};
15
+ for (var t in e)
16
+ A.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
17
+ if (e != null && N)
18
+ for (var t of N(e))
19
+ r.indexOf(t) < 0 && F.call(e, t) && (o[t] = e[t]);
20
+ return o;
21
21
  };
22
- import { jsx as l, jsxs as z, Fragment as re } from "react/jsx-runtime";
23
- import * as v from "react";
24
- import B from "react";
25
- import { u as L } from "../../chunks/index-DLcqcWxM.js";
22
+ import { jsx as d, jsxs as B, Fragment as oe } from "react/jsx-runtime";
23
+ import * as b from "react";
24
+ import D from "react";
25
+ import { u as O } from "../../chunks/index-DLcqcWxM.js";
26
26
  import { c as te } from "../../chunks/index-E4d_Gd-w.js";
27
- import { c as F } from "../../chunks/index-DLeNytVF.js";
28
- import { u as oe } from "../../chunks/index-DYfkNB0n.js";
29
- import { u as ne } from "../../chunks/index-BZPx6jYI.js";
30
- import { u as ae } from "../../chunks/index-CHDs-SiB.js";
31
- import { P as ce } from "../../chunks/index-PsqJG3fE.js";
32
- import { P as D } from "../../chunks/index-BJD1rYeT.js";
33
- import { c as O } from "../../chunks/index-BO6p208a.js";
34
- import { c as S } from "../../chunks/utils-TbLXCoKm.js";
35
- import { Icon as se } from "../icon/icon.js";
36
- var N = "Checkbox", [ie, Se] = te(N), [de, T] = ie(N);
37
- function le(e) {
27
+ import { c as L } from "../../chunks/index-DLeNytVF.js";
28
+ import { u as ne } from "../../chunks/index-DYfkNB0n.js";
29
+ import { u as ae } from "../../chunks/index-BZPx6jYI.js";
30
+ import { u as ce } from "../../chunks/index-CHDs-SiB.js";
31
+ import { P as se } from "../../chunks/index-PsqJG3fE.js";
32
+ import { P as T } from "../../chunks/index-BJD1rYeT.js";
33
+ import { c as V } from "../../chunks/index-BO6p208a.js";
34
+ import { c as P } from "../../chunks/utils-TbLXCoKm.js";
35
+ import { Icon as ie } from "../icon/icon.js";
36
+ var S = "Checkbox", [de, Se] = te(S), [le, M] = de(S);
37
+ function ue(e) {
38
38
  const {
39
- __scopeCheckbox: t,
40
- checked: r,
41
- children: o,
39
+ __scopeCheckbox: r,
40
+ checked: o,
41
+ children: t,
42
42
  defaultChecked: a,
43
- disabled: d,
44
- form: s,
43
+ disabled: l,
44
+ form: c,
45
45
  name: n,
46
- onCheckedChange: h,
47
- required: k,
46
+ onCheckedChange: m,
47
+ required: v,
48
48
  value: p = "on",
49
49
  // @ts-expect-error
50
- internal_do_not_use_render: C
51
- } = e, [f, u] = oe({
52
- prop: r,
50
+ internal_do_not_use_render: k
51
+ } = e, [C, h] = ne({
52
+ prop: o,
53
53
  defaultProp: a != null ? a : !1,
54
- onChange: h,
55
- caller: N
56
- }), [b, R] = v.useState(null), [y, m] = v.useState(null), _ = v.useRef(!1), i = b ? !!s || !!b.closest("form") : (
54
+ onChange: m,
55
+ caller: S
56
+ }), [u, R] = b.useState(null), [_, x] = b.useState(null), f = b.useRef(!1), s = u ? !!c || !!u.closest("form") : (
57
57
  // We set this to true by default so that events bubble to forms without JS (SSR)
58
58
  !0
59
- ), c = {
60
- checked: f,
61
- disabled: d,
62
- setChecked: u,
63
- control: b,
59
+ ), i = {
60
+ checked: C,
61
+ disabled: l,
62
+ setChecked: h,
63
+ control: u,
64
64
  setControl: R,
65
65
  name: n,
66
- form: s,
66
+ form: c,
67
67
  value: p,
68
- hasConsumerStoppedPropagationRef: _,
69
- required: k,
68
+ hasConsumerStoppedPropagationRef: f,
69
+ required: v,
70
70
  defaultChecked: I(a) ? !1 : a,
71
- isFormControl: i,
72
- bubbleInput: y,
73
- setBubbleInput: m
71
+ isFormControl: s,
72
+ bubbleInput: _,
73
+ setBubbleInput: x
74
74
  };
75
- return /* @__PURE__ */ l(
76
- de,
77
- g(x({
78
- scope: t
79
- }, c), {
80
- children: ue(C) ? C(c) : o
75
+ return /* @__PURE__ */ d(
76
+ le,
77
+ g(y({
78
+ scope: r
79
+ }, i), {
80
+ children: me(k) ? k(i) : t
81
81
  })
82
82
  );
83
83
  }
84
- var V = "CheckboxTrigger", H = v.forwardRef(
85
- (d, a) => {
86
- var s = d, { __scopeCheckbox: e, onKeyDown: t, onClick: r } = s, o = w(s, ["__scopeCheckbox", "onKeyDown", "onClick"]);
84
+ var H = "CheckboxTrigger", G = b.forwardRef(
85
+ (l, a) => {
86
+ var c = l, { __scopeCheckbox: e, onKeyDown: r, onClick: o } = c, t = w(c, ["__scopeCheckbox", "onKeyDown", "onClick"]);
87
87
  const {
88
88
  control: n,
89
- value: h,
90
- disabled: k,
89
+ value: m,
90
+ disabled: v,
91
91
  checked: p,
92
- required: C,
93
- setControl: f,
94
- setChecked: u,
95
- hasConsumerStoppedPropagationRef: b,
92
+ required: k,
93
+ setControl: C,
94
+ setChecked: h,
95
+ hasConsumerStoppedPropagationRef: u,
96
96
  isFormControl: R,
97
- bubbleInput: y
98
- } = T(V, e), m = L(a, f), _ = v.useRef(p);
99
- return v.useEffect(() => {
100
- const i = n == null ? void 0 : n.form;
101
- if (i) {
102
- const c = () => u(_.current);
103
- return i.addEventListener("reset", c), () => i.removeEventListener("reset", c);
97
+ bubbleInput: _
98
+ } = M(H, e), x = O(a, C), f = b.useRef(p);
99
+ return b.useEffect(() => {
100
+ const s = n == null ? void 0 : n.form;
101
+ if (s) {
102
+ const i = () => h(f.current);
103
+ return s.addEventListener("reset", i), () => s.removeEventListener("reset", i);
104
104
  }
105
- }, [n, u]), /* @__PURE__ */ l(
106
- D.button,
107
- g(x({
105
+ }, [n, h]), /* @__PURE__ */ d(
106
+ T.button,
107
+ g(y({
108
108
  type: "button",
109
109
  role: "checkbox",
110
110
  "aria-checked": I(p) ? "mixed" : p,
111
- "aria-required": C,
112
- "data-state": J(p),
113
- "data-disabled": k ? "" : void 0,
114
- disabled: k,
115
- value: h
116
- }, o), {
117
- ref: m,
118
- onKeyDown: F(t, (i) => {
119
- i.key === "Enter" && i.preventDefault();
111
+ "aria-required": k,
112
+ "data-state": Q(p),
113
+ "data-disabled": v ? "" : void 0,
114
+ disabled: v,
115
+ value: m
116
+ }, t), {
117
+ ref: x,
118
+ onKeyDown: L(r, (s) => {
119
+ s.key === "Enter" && s.preventDefault();
120
120
  }),
121
- onClick: F(r, (i) => {
122
- u((c) => I(c) ? !0 : !c), y && R && (b.current = i.isPropagationStopped(), b.current || i.stopPropagation());
121
+ onClick: L(o, (s) => {
122
+ h((i) => I(i) ? !0 : !i), _ && R && (u.current = s.isPropagationStopped(), u.current || s.stopPropagation());
123
123
  })
124
124
  })
125
125
  );
126
126
  }
127
127
  );
128
- H.displayName = V;
129
- var G = v.forwardRef(
130
- (e, t) => {
131
- const f = e, {
132
- __scopeCheckbox: r,
133
- name: o,
128
+ G.displayName = H;
129
+ var K = b.forwardRef(
130
+ (e, r) => {
131
+ const C = e, {
132
+ __scopeCheckbox: o,
133
+ name: t,
134
134
  checked: a,
135
- defaultChecked: d,
136
- required: s,
135
+ defaultChecked: l,
136
+ required: c,
137
137
  disabled: n,
138
- value: h,
139
- onCheckedChange: k,
138
+ value: m,
139
+ onCheckedChange: v,
140
140
  form: p
141
- } = f, C = w(f, [
141
+ } = C, k = w(C, [
142
142
  "__scopeCheckbox",
143
143
  "name",
144
144
  "checked",
@@ -149,30 +149,30 @@ var G = v.forwardRef(
149
149
  "onCheckedChange",
150
150
  "form"
151
151
  ]);
152
- return /* @__PURE__ */ l(
153
- le,
152
+ return /* @__PURE__ */ d(
153
+ ue,
154
154
  {
155
- __scopeCheckbox: r,
155
+ __scopeCheckbox: o,
156
156
  checked: a,
157
- defaultChecked: d,
157
+ defaultChecked: l,
158
158
  disabled: n,
159
- required: s,
160
- onCheckedChange: k,
161
- name: o,
159
+ required: c,
160
+ onCheckedChange: v,
161
+ name: t,
162
162
  form: p,
163
- value: h,
164
- internal_do_not_use_render: ({ isFormControl: u }) => /* @__PURE__ */ z(re, { children: [
165
- /* @__PURE__ */ l(
166
- H,
167
- g(x({}, C), {
168
- ref: t,
169
- __scopeCheckbox: r
163
+ value: m,
164
+ internal_do_not_use_render: ({ isFormControl: h }) => /* @__PURE__ */ B(oe, { children: [
165
+ /* @__PURE__ */ d(
166
+ G,
167
+ g(y({}, k), {
168
+ ref: r,
169
+ __scopeCheckbox: o
170
170
  })
171
171
  ),
172
- u && /* @__PURE__ */ l(
173
- $,
172
+ h && /* @__PURE__ */ d(
173
+ J,
174
174
  {
175
- __scopeCheckbox: r
175
+ __scopeCheckbox: o
176
176
  }
177
177
  )
178
178
  ] })
@@ -180,73 +180,73 @@ var G = v.forwardRef(
180
180
  );
181
181
  }
182
182
  );
183
- G.displayName = N;
184
- var K = "CheckboxIndicator", U = v.forwardRef(
185
- (e, t) => {
186
- const s = e, { __scopeCheckbox: r, forceMount: o } = s, a = w(s, ["__scopeCheckbox", "forceMount"]), d = T(K, r);
187
- return /* @__PURE__ */ l(
188
- ce,
183
+ K.displayName = S;
184
+ var U = "CheckboxIndicator", X = b.forwardRef(
185
+ (e, r) => {
186
+ const c = e, { __scopeCheckbox: o, forceMount: t } = c, a = w(c, ["__scopeCheckbox", "forceMount"]), l = M(U, o);
187
+ return /* @__PURE__ */ d(
188
+ se,
189
189
  {
190
- present: o || I(d.checked) || d.checked === !0,
191
- children: /* @__PURE__ */ l(
192
- D.span,
193
- g(x({
194
- "data-state": J(d.checked),
195
- "data-disabled": d.disabled ? "" : void 0
190
+ present: t || I(l.checked) || l.checked === !0,
191
+ children: /* @__PURE__ */ d(
192
+ T.span,
193
+ g(y({
194
+ "data-state": Q(l.checked),
195
+ "data-disabled": l.disabled ? "" : void 0
196
196
  }, a), {
197
- ref: t,
198
- style: x({ pointerEvents: "none" }, e.style)
197
+ ref: r,
198
+ style: y({ pointerEvents: "none" }, e.style)
199
199
  })
200
200
  )
201
201
  }
202
202
  );
203
203
  }
204
204
  );
205
- U.displayName = K;
206
- var X = "CheckboxBubbleInput", $ = v.forwardRef(
207
- (o, r) => {
208
- var a = o, { __scopeCheckbox: e } = a, t = w(a, ["__scopeCheckbox"]);
205
+ X.displayName = U;
206
+ var $ = "CheckboxBubbleInput", J = b.forwardRef(
207
+ (t, o) => {
208
+ var a = t, { __scopeCheckbox: e } = a, r = w(a, ["__scopeCheckbox"]);
209
209
  const {
210
- control: d,
211
- hasConsumerStoppedPropagationRef: s,
210
+ control: l,
211
+ hasConsumerStoppedPropagationRef: c,
212
212
  checked: n,
213
- defaultChecked: h,
214
- required: k,
213
+ defaultChecked: m,
214
+ required: v,
215
215
  disabled: p,
216
- name: C,
217
- value: f,
218
- form: u,
219
- bubbleInput: b,
216
+ name: k,
217
+ value: C,
218
+ form: h,
219
+ bubbleInput: u,
220
220
  setBubbleInput: R
221
- } = T(X, e), y = L(r, R), m = ne(n), _ = ae(d);
222
- v.useEffect(() => {
223
- const c = b;
224
- if (!c) return;
225
- const E = window.HTMLInputElement.prototype, M = Object.getOwnPropertyDescriptor(
221
+ } = M($, e), _ = O(o, R), x = ae(n), f = ce(l);
222
+ b.useEffect(() => {
223
+ const i = u;
224
+ if (!i) return;
225
+ const E = window.HTMLInputElement.prototype, j = Object.getOwnPropertyDescriptor(
226
226
  E,
227
227
  "checked"
228
- ).set, Q = !s.current;
229
- if (m !== n && M) {
230
- const W = new Event("click", { bubbles: Q });
231
- c.indeterminate = I(n), M.call(c, I(n) ? !1 : n), c.dispatchEvent(W);
228
+ ).set, W = !c.current;
229
+ if (x !== n && j) {
230
+ const Y = new Event("click", { bubbles: W });
231
+ i.indeterminate = I(n), j.call(i, I(n) ? !1 : n), i.dispatchEvent(Y);
232
232
  }
233
- }, [b, m, n, s]);
234
- const i = v.useRef(I(n) ? !1 : n);
235
- return /* @__PURE__ */ l(
236
- D.input,
237
- g(x({
233
+ }, [u, x, n, c]);
234
+ const s = b.useRef(I(n) ? !1 : n);
235
+ return /* @__PURE__ */ d(
236
+ T.input,
237
+ g(y({
238
238
  type: "checkbox",
239
239
  "aria-hidden": !0,
240
- defaultChecked: h != null ? h : i.current,
241
- required: k,
240
+ defaultChecked: m != null ? m : s.current,
241
+ required: v,
242
242
  disabled: p,
243
- name: C,
244
- value: f,
245
- form: u
246
- }, t), {
243
+ name: k,
244
+ value: C,
245
+ form: h
246
+ }, r), {
247
247
  tabIndex: -1,
248
- ref: y,
249
- style: g(x(x({}, t.style), _), {
248
+ ref: _,
249
+ style: g(y(y({}, r.style), f), {
250
250
  position: "absolute",
251
251
  pointerEvents: "none",
252
252
  opacity: 0,
@@ -260,17 +260,17 @@ var X = "CheckboxBubbleInput", $ = v.forwardRef(
260
260
  );
261
261
  }
262
262
  );
263
- $.displayName = X;
264
- function ue(e) {
263
+ J.displayName = $;
264
+ function me(e) {
265
265
  return typeof e == "function";
266
266
  }
267
267
  function I(e) {
268
268
  return e === "indeterminate";
269
269
  }
270
- function J(e) {
270
+ function Q(e) {
271
271
  return I(e) ? "indeterminate" : e ? "checked" : "unchecked";
272
272
  }
273
- const pe = O(
273
+ const pe = V(
274
274
  "group peer cursor-pointer border-border focus:border-primary focus:shadow-focus disabled:cursor-not-allowed shrink-0 rounded-sm border focus:outline-none flex items-center justify-center",
275
275
  {
276
276
  variants: {
@@ -294,7 +294,7 @@ const pe = O(
294
294
  isDisabled: !1
295
295
  }
296
296
  }
297
- ), me = O(
297
+ ), he = V(
298
298
  "rounded-[2px] bg-primary shrink-0 group-hover:bg-primary-hover group-disabled:group-hover:bg-primary group-active:bg-primary-active",
299
299
  {
300
300
  variants: {
@@ -305,59 +305,60 @@ const pe = O(
305
305
  }
306
306
  }
307
307
  );
308
- function he(e) {
308
+ function fe(e) {
309
309
  const {
310
- className: t,
311
- size: r = "md",
312
- label: o,
313
- disabled: a,
314
- checked: d,
315
- id: s,
316
- onCheckedChange: n,
317
- ref: h,
318
- "data-testid": k
319
- } = e, p = r === "md" ? 16 : 24, C = B.useId(), f = s || C, u = a || !1, [b, R] = B.useState(!1), y = d !== void 0, m = y ? d : b, _ = () => m === !0 ? "checked" : m === "indeterminate" ? "indeterminate" : "unchecked", i = (E) => {
320
- y && n ? n(E) : y || R(E);
321
- }, c = /* @__PURE__ */ l(
322
- G,
310
+ className: r,
311
+ checkboxClassName: o,
312
+ size: t = "md",
313
+ label: a,
314
+ disabled: l,
315
+ checked: c,
316
+ id: n,
317
+ onCheckedChange: m,
318
+ ref: v,
319
+ "data-testid": p
320
+ } = e, k = t === "md" ? 16 : 24, C = D.useId(), h = n || C, u = l || !1, [R, _] = D.useState(!1), x = c !== void 0, f = x ? c : R, s = () => f === !0 ? "checked" : f === "indeterminate" ? "indeterminate" : "unchecked", i = (z) => {
321
+ x && m ? m(z) : x || _(z);
322
+ }, E = /* @__PURE__ */ d(
323
+ K,
323
324
  {
324
- ref: h,
325
- id: f,
326
- className: S(
327
- pe({ size: r, state: _(), isDisabled: u }),
328
- t
325
+ ref: v,
326
+ id: h,
327
+ className: P(
328
+ pe({ size: t, state: s(), isDisabled: u }),
329
+ o || (a ? void 0 : r)
329
330
  ),
330
331
  disabled: u,
331
- checked: m,
332
+ checked: f,
332
333
  onCheckedChange: i,
333
- "data-testid": k,
334
- children: /* @__PURE__ */ z(U, { className: "flex h-full w-full items-center justify-center", children: [
335
- m === "indeterminate" && /* @__PURE__ */ l("div", { className: me({ size: r }) }),
336
- m === !0 && /* @__PURE__ */ l(se, { icon: "DoneIcon", size: p, className: "text-white" })
334
+ "data-testid": p,
335
+ children: /* @__PURE__ */ B(X, { className: "flex h-full w-full items-center justify-center", children: [
336
+ f === "indeterminate" && /* @__PURE__ */ d("div", { className: he({ size: t }) }),
337
+ f === !0 && /* @__PURE__ */ d(ie, { icon: "DoneIcon", size: k, className: "text-white" })
337
338
  ] })
338
339
  }
339
340
  );
340
- return o ? /* @__PURE__ */ z("div", { className: "items-top flex flex-row space-x-2", children: [
341
- /* @__PURE__ */ l("div", { className: S(r === "md" && "pt-0.5"), children: c }),
342
- /* @__PURE__ */ l(
341
+ return a ? /* @__PURE__ */ B("div", { className: P("items-top flex flex-row space-x-2", r), children: [
342
+ /* @__PURE__ */ d("div", { className: P(t === "md" && "pt-0.5"), children: E }),
343
+ /* @__PURE__ */ d(
343
344
  "label",
344
345
  {
345
- htmlFor: f,
346
- className: S(
346
+ htmlFor: h,
347
+ className: P(
347
348
  "font-graphik m-0 cursor-pointer text-[14px] leading-[20px] font-normal",
348
349
  u && "cursor-not-allowed opacity-40",
349
- r === "lg" && "pt-0.5"
350
+ t === "lg" && "pt-0.5"
350
351
  ),
351
- children: o
352
+ children: a
352
353
  }
353
354
  )
354
- ] }) : c;
355
+ ] }) : E;
355
356
  }
356
- const ze = B.forwardRef(
357
- (e, t) => /* @__PURE__ */ l(he, g(x({}, e), { ref: t }))
357
+ const ze = D.forwardRef(
358
+ (e, r) => /* @__PURE__ */ d(fe, g(y({}, e), { ref: r }))
358
359
  );
359
360
  export {
360
361
  ze as Checkbox,
361
362
  pe as checkboxVariants,
362
- me as indicatorVariants
363
+ he as indicatorVariants
363
364
  };
@@ -12,6 +12,7 @@ export type CheckboxSize = 'md' | 'lg';
12
12
  type CheckboxValue = boolean | 'indeterminate';
13
13
  interface CheckboxProps<T extends CheckboxValue> {
14
14
  className?: string;
15
+ checkboxClassName?: string;
15
16
  size?: CheckboxSize;
16
17
  label?: string | ReactElement;
17
18
  disabled?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "konsolpro-custom-ui",
3
3
  "type": "module",
4
- "version": "0.0.348",
4
+ "version": "0.0.349",
5
5
  "packageManager": "yarn@3.4.1",
6
6
  "license": "MIT",
7
7
  "sideEffects": [