@konstructio/ui 0.0.5 → 0.0.7

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 (43) hide show
  1. package/dist/{AlertDialogTrigger-lenvKoGF.js → AlertDialogTrigger-D4Tm_9M0.js} +2 -2
  2. package/dist/{Modal-Bg9UG35z.js → Modal-Ca3bkvvt.js} +2 -2
  3. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  4. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  5. package/dist/components/AlertDialog/components/index.js +1 -1
  6. package/dist/components/Autocomplete/Autocomplete.js +31 -30
  7. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  8. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  9. package/dist/components/Card/Card.d.ts +4 -0
  10. package/dist/components/Card/Card.js +38 -0
  11. package/dist/components/Card/Card.types.d.ts +7 -0
  12. package/dist/components/Card/Card.types.js +1 -0
  13. package/dist/components/Card/Card.variants.d.ts +10 -0
  14. package/dist/components/Card/Card.variants.js +87 -0
  15. package/dist/components/Checkbox/Checkbox.js +106 -101
  16. package/dist/components/Checkbox/Checkbox.types.d.ts +2 -0
  17. package/dist/components/Dropdown/components/List/List.js +14 -13
  18. package/dist/components/Dropdown/components/List/List.types.d.ts +1 -3
  19. package/dist/components/Dropdown/components/ListItem/ListItem.js +25 -18
  20. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +14 -3
  21. package/dist/components/Dropdown/components/Wrapper.js +46 -34
  22. package/dist/components/Modal/Modal.js +2 -2
  23. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  24. package/dist/components/Modal/components/index.js +1 -1
  25. package/dist/components/NumberInput/NumberInput.js +65 -65
  26. package/dist/components/Range/Range.js +1 -1
  27. package/dist/components/Slider/Slider.js +1 -1
  28. package/dist/components/Switch/Switch.js +59 -49
  29. package/dist/components/Toast/Toast.js +3 -3
  30. package/dist/components/Tooltip/Tooltip.js +17 -17
  31. package/dist/components/Tooltip/Tooltip.variants.js +1 -1
  32. package/dist/components/index.d.ts +1 -0
  33. package/dist/components/index.js +32 -30
  34. package/dist/index-BaNV0qac.js +19164 -0
  35. package/dist/{index-O3j1K921.js → index-BedjZUuB.js} +1 -1
  36. package/dist/{index-ffjBR8Av.js → index-BtibbG81.js} +1 -1
  37. package/dist/{index-Ci9Yg4G1.js → index-z-AJyzdv.js} +1 -1
  38. package/dist/index.js +42 -40
  39. package/dist/package.json +36 -36
  40. package/dist/styles.css +1 -1
  41. package/dist/{useBreadcrumb-tyxjV-a1.js → useBreadcrumb-DxYsZvj_.js} +4 -4
  42. package/package.json +36 -36
  43. package/dist/index-OOfdXoxx.js +0 -423
@@ -1,63 +1,63 @@
1
- import { jsxs as x, jsx as l } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as u } from "react/jsx-runtime";
2
2
  import * as h from "react";
3
3
  import { forwardRef as I, useState as _, useRef as H, useId as A, useImperativeHandle as M, useEffect as $, useCallback as j } from "react";
4
4
  import { c as z, a as B, d as q } from "../../index-8vgf-x5i.js";
5
5
  import { u as F } from "../../index-DoOsnuB6.js";
6
6
  import { u as O, a as V } from "../../index-BxeV34ij.js";
7
- import { P } from "../../index-OOfdXoxx.js";
7
+ import { P } from "../../index-BaNV0qac.js";
8
8
  import { cn as D } from "../../utils/index.js";
9
9
  import "../../contexts/theme.context.js";
10
10
  import { useTheme as L } from "../../contexts/theme.hook.js";
11
11
  import "../../js.cookie-OLEfuq_g.js";
12
12
  import { switchVariants as U, thumbVariants as W } from "./Switch.variants.js";
13
- var k = "Switch", [X, ue] = z(k), [G, J] = X(k), g = h.forwardRef(
14
- (e, r) => {
13
+ var k = "Switch", [X, de] = z(k), [G, J] = X(k), g = h.forwardRef(
14
+ (e, s) => {
15
15
  const {
16
16
  __scopeSwitch: t,
17
- name: s,
18
- checked: c,
17
+ name: c,
18
+ checked: n,
19
19
  defaultChecked: p,
20
- required: n,
20
+ required: o,
21
21
  disabled: a,
22
22
  value: i = "on",
23
23
  onCheckedChange: m,
24
- form: o,
25
- ...u
26
- } = e, [d, b] = h.useState(null), v = F(r, (C) => b(C)), f = h.useRef(!1), w = d ? o || !!d.closest("form") : !0, [S = !1, E] = B({
27
- prop: c,
24
+ form: r,
25
+ ...d
26
+ } = e, [l, b] = h.useState(null), v = F(s, (C) => b(C)), f = h.useRef(!1), w = l ? r || !!l.closest("form") : !0, [S = !1, E] = B({
27
+ prop: n,
28
28
  defaultProp: p,
29
29
  onChange: m
30
30
  });
31
31
  return /* @__PURE__ */ x(G, { scope: t, checked: S, disabled: a, children: [
32
- /* @__PURE__ */ l(
32
+ /* @__PURE__ */ u(
33
33
  P.button,
34
34
  {
35
35
  type: "button",
36
36
  role: "switch",
37
37
  "aria-checked": S,
38
- "aria-required": n,
38
+ "aria-required": o,
39
39
  "data-state": N(S),
40
40
  "data-disabled": a ? "" : void 0,
41
41
  disabled: a,
42
42
  value: i,
43
- ...u,
43
+ ...d,
44
44
  ref: v,
45
45
  onClick: q(e.onClick, (C) => {
46
46
  E((T) => !T), w && (f.current = C.isPropagationStopped(), f.current || C.stopPropagation());
47
47
  })
48
48
  }
49
49
  ),
50
- w && /* @__PURE__ */ l(
50
+ w && /* @__PURE__ */ u(
51
51
  K,
52
52
  {
53
- control: d,
53
+ control: l,
54
54
  bubbles: !f.current,
55
- name: s,
55
+ name: c,
56
56
  value: i,
57
57
  checked: S,
58
- required: n,
58
+ required: o,
59
59
  disabled: a,
60
- form: o,
60
+ form: r,
61
61
  style: { transform: "translateX(-100%)" }
62
62
  }
63
63
  )
@@ -66,35 +66,35 @@ var k = "Switch", [X, ue] = z(k), [G, J] = X(k), g = h.forwardRef(
66
66
  );
67
67
  g.displayName = k;
68
68
  var R = "SwitchThumb", y = h.forwardRef(
69
- (e, r) => {
70
- const { __scopeSwitch: t, ...s } = e, c = J(R, t);
71
- return /* @__PURE__ */ l(
69
+ (e, s) => {
70
+ const { __scopeSwitch: t, ...c } = e, n = J(R, t);
71
+ return /* @__PURE__ */ u(
72
72
  P.span,
73
73
  {
74
- "data-state": N(c.checked),
75
- "data-disabled": c.disabled ? "" : void 0,
76
- ...s,
77
- ref: r
74
+ "data-state": N(n.checked),
75
+ "data-disabled": n.disabled ? "" : void 0,
76
+ ...c,
77
+ ref: s
78
78
  }
79
79
  );
80
80
  }
81
81
  );
82
82
  y.displayName = R;
83
83
  var K = (e) => {
84
- const { control: r, checked: t, bubbles: s = !0, ...c } = e, p = h.useRef(null), n = O(t), a = V(r);
84
+ const { control: s, checked: t, bubbles: c = !0, ...n } = e, p = h.useRef(null), o = O(t), a = V(s);
85
85
  return h.useEffect(() => {
86
- const i = p.current, m = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(m, "checked").set;
87
- if (n !== t && u) {
88
- const d = new Event("click", { bubbles: s });
89
- u.call(i, t), i.dispatchEvent(d);
86
+ const i = p.current, m = window.HTMLInputElement.prototype, d = Object.getOwnPropertyDescriptor(m, "checked").set;
87
+ if (o !== t && d) {
88
+ const l = new Event("click", { bubbles: c });
89
+ d.call(i, t), i.dispatchEvent(l);
90
90
  }
91
- }, [n, t, s]), /* @__PURE__ */ l(
91
+ }, [o, t, c]), /* @__PURE__ */ u(
92
92
  "input",
93
93
  {
94
94
  type: "checkbox",
95
95
  "aria-hidden": !0,
96
96
  defaultChecked: t,
97
- ...c,
97
+ ...n,
98
98
  tabIndex: -1,
99
99
  ref: p,
100
100
  style: {
@@ -112,19 +112,19 @@ function N(e) {
112
112
  return e ? "checked" : "unchecked";
113
113
  }
114
114
  var Q = g, Y = y;
115
- const de = I(
115
+ const le = I(
116
116
  ({
117
117
  name: e,
118
- defaultChecked: r,
118
+ defaultChecked: s,
119
119
  alignment: t = "horizontal",
120
- theme: s,
121
- thumbClassName: c,
120
+ theme: c,
121
+ thumbClassName: n,
122
122
  className: p,
123
- label: n
123
+ label: o
124
124
  }, a) => {
125
- const [i, m] = _(r ?? !1), o = H(null), u = A(), { theme: d } = L(), b = s ?? d, v = e ? `${u}-${e}` : u;
126
- M(a, () => o.current, [o]), $(() => {
127
- o.current && (o.current.value = `${i}`);
125
+ const [i, m] = _(s ?? !1), r = H(null), d = A(), { theme: l } = L(), b = c ?? l, v = e ? `${d}-${e}` : d;
126
+ M(a, () => r.current, [r]), $(() => {
127
+ r.current && (r.current.value = `${i}`);
128
128
  }, [i]);
129
129
  const f = j(
130
130
  (w) => m(w),
@@ -138,39 +138,49 @@ const de = I(
138
138
  t === "vertical" ? "flex-col" : "flex-row"
139
139
  ),
140
140
  children: [
141
- n ? /* @__PURE__ */ l(
141
+ o ? /* @__PURE__ */ u(
142
142
  "label",
143
143
  {
144
144
  className: "text-base",
145
145
  htmlFor: v,
146
146
  style: { paddingRight: 15 },
147
- children: n
147
+ children: o
148
148
  }
149
149
  ) : null,
150
- /* @__PURE__ */ l(
150
+ /* @__PURE__ */ u(
151
151
  Q,
152
152
  {
153
153
  id: v,
154
- defaultChecked: r,
154
+ defaultChecked: s,
155
155
  onCheckedChange: f,
156
156
  className: U({ theme: b, className: p }),
157
- children: /* @__PURE__ */ l(
157
+ "aria-label": o,
158
+ children: /* @__PURE__ */ u(
158
159
  Y,
159
160
  {
160
161
  className: W({
161
162
  theme: b,
162
- className: c
163
+ className: n
163
164
  })
164
165
  }
165
166
  )
166
167
  }
167
168
  ),
168
- /* @__PURE__ */ l("input", { ref: o, name: e, type: "text", className: "hidden" })
169
+ /* @__PURE__ */ u(
170
+ "input",
171
+ {
172
+ ref: r,
173
+ name: e,
174
+ type: "text",
175
+ className: "hidden",
176
+ "aria-hidden": "true"
177
+ }
178
+ )
169
179
  ]
170
180
  }
171
181
  );
172
182
  }
173
183
  );
174
184
  export {
175
- de as Switch
185
+ le as Switch
176
186
  };
@@ -1,13 +1,13 @@
1
1
  import { jsxs as D, jsx as c, Fragment as ne } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
3
  import { useState as xe, useRef as Re, useEffect as be, useMemo as te, isValidElement as oe, useCallback as ge } from "react";
4
- import { P as L, r as Se, d as Ie } from "../../index-OOfdXoxx.js";
4
+ import { P as L, r as Se, d as Ie } from "../../index-BaNV0qac.js";
5
5
  import { c as Ne, a as Ae, b as X, d as b, u as Fe } from "../../index-8vgf-x5i.js";
6
6
  import { u as se, S as j } from "../../index-DoOsnuB6.js";
7
7
  import { c as _e } from "../../index-BBjak_0p.js";
8
- import { B as De, R as Le, P as Oe } from "../../index-O3j1K921.js";
8
+ import { B as De, R as Le, P as Oe } from "../../index-BedjZUuB.js";
9
9
  import { P as Me } from "../../index-D4Q2rMby.js";
10
- import { V as ae, R as ke } from "../../index-ffjBR8Av.js";
10
+ import { V as ae, R as ke } from "../../index-BtibbG81.js";
11
11
  import "../../contexts/theme.context.js";
12
12
  import { useTheme as Ve } from "../../contexts/theme.hook.js";
13
13
  import "../../js.cookie-OLEfuq_g.js";
@@ -1,36 +1,36 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import { forwardRef as N, useRef as v, useImperativeHandle as w, useMemo as R, isValidElement as T } from "react";
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import { forwardRef as N, useRef as w, useImperativeHandle as x, useMemo as R, isValidElement as T } from "react";
3
3
  import { S as i } from "../../index-DoOsnuB6.js";
4
4
  import "../../contexts/theme.context.js";
5
5
  import { useTheme as V } from "../../contexts/theme.hook.js";
6
6
  import "../../js.cookie-OLEfuq_g.js";
7
7
  import { cn as a } from "../../utils/index.js";
8
- import { tooltipVariants as j, arrowVariants as C } from "./Tooltip.variants.js";
9
- import { useTooltip as S } from "./hooks/useTooltip.js";
8
+ import { tooltipVariants as b, arrowVariants as j } from "./Tooltip.variants.js";
9
+ import { useTooltip as C } from "./hooks/useTooltip.js";
10
10
  const z = N(
11
- ({ children: r, content: n, className: l, theme: p, position: t, wrapperClassName: c }, f) => {
12
- const d = v(null), { theme: h } = V(), m = p ?? h, { isVisible: u, componentRef: o } = S();
13
- w(f, () => o.current, [o]);
14
- const x = R(
15
- () => T(r) ? r : /* @__PURE__ */ e("p", { className: "p-2", children: r }),
16
- [r]
11
+ ({ children: t, content: l, className: n, theme: p, position: r, wrapperClassName: c }, f) => {
12
+ const d = w(null), { theme: h } = V(), s = p ?? h, { isVisible: u, componentRef: o } = C();
13
+ x(f, () => o.current, [o]);
14
+ const v = R(
15
+ () => T(t) ? t : /* @__PURE__ */ e("p", { className: "p-2", children: t }),
16
+ [t]
17
17
  );
18
- return /* @__PURE__ */ e("div", { className: a("w-full", c), children: /* @__PURE__ */ s("div", { className: "relative w-max", children: [
19
- /* @__PURE__ */ e(i, { ref: o, className: a("cursor-pointer ", l), children: x }),
20
- /* @__PURE__ */ s(
18
+ return /* @__PURE__ */ e("div", { className: a("w-full", c), children: /* @__PURE__ */ m("div", { className: "relative w-max", children: [
19
+ /* @__PURE__ */ e(i, { ref: o, className: a("cursor-pointer ", n), children: v }),
20
+ /* @__PURE__ */ m(
21
21
  "div",
22
22
  {
23
23
  ref: d,
24
- className: j({ theme: m, position: t }),
25
- "aria-expanded": u,
24
+ className: b({ theme: s, position: r }),
25
+ "data-visible": u,
26
26
  children: [
27
27
  /* @__PURE__ */ e(
28
28
  "span",
29
29
  {
30
- className: C({ theme: m, position: t })
30
+ className: j({ theme: s, position: r })
31
31
  }
32
32
  ),
33
- /* @__PURE__ */ e(i, { children: n })
33
+ /* @__PURE__ */ e(i, { children: l })
34
34
  ]
35
35
  }
36
36
  )
@@ -10,7 +10,7 @@ const e = r(
10
10
  "ease-linear",
11
11
  "opacity-0",
12
12
  "duration-250",
13
- "aria-expanded:opacity-100",
13
+ "[&[data-visible='true']]:opacity-100",
14
14
  "delay-100"
15
15
  ],
16
16
  {
@@ -2,6 +2,7 @@ export * from './AlertDialog/AlertDialog';
2
2
  export * from './Autocomplete/Autocomplete';
3
3
  export * from './Breadcrumb/Breadcrumb';
4
4
  export * from './Button/Button';
5
+ export * from './Card/Card';
5
6
  export * from './Checkbox/Checkbox';
6
7
  export * from './Dropdown/Dropdown';
7
8
  export * from './Input/Input';
@@ -2,39 +2,41 @@ import { AlertDialog as e } from "./AlertDialog/AlertDialog.js";
2
2
  import { Autocomplete as p } from "./Autocomplete/Autocomplete.js";
3
3
  import { Breadcrumb as x } from "./Breadcrumb/Breadcrumb.js";
4
4
  import { Button as a } from "./Button/Button.js";
5
- import { Checkbox as u } from "./Checkbox/Checkbox.js";
6
- import { Dropdown as d } from "./Dropdown/Dropdown.js";
7
- import { Input as i } from "./Input/Input.js";
8
- import { M as T } from "../Modal-Bg9UG35z.js";
9
- import { NumberInput as b } from "./NumberInput/NumberInput.js";
10
- import { ProgressBar as B } from "./ProgressBar/ProgressBar.js";
11
- import { Radio as h } from "./Radio/Radio.js";
12
- import { Range as D } from "./Range/Range.js";
13
- import { Slider as M } from "./Slider/Slider.js";
14
- import { Switch as k } from "./Switch/Switch.js";
15
- import { Tag as N } from "./Tag/Tag.js";
16
- import { TagSelect as j } from "./TagSelect/TagSelect.js";
17
- import { TextArea as v } from "./TextArea/TextArea.js";
18
- import { Toast as z } from "./Toast/Toast.js";
19
- import { Tooltip as F } from "./Tooltip/Tooltip.js";
5
+ import { Card as d } from "./Card/Card.js";
6
+ import { Checkbox as c } from "./Checkbox/Checkbox.js";
7
+ import { Dropdown as i } from "./Dropdown/Dropdown.js";
8
+ import { Input as T } from "./Input/Input.js";
9
+ import { M as b } from "../Modal-Ca3bkvvt.js";
10
+ import { NumberInput as B } from "./NumberInput/NumberInput.js";
11
+ import { ProgressBar as h } from "./ProgressBar/ProgressBar.js";
12
+ import { Radio as C } from "./Radio/Radio.js";
13
+ import { Range as I } from "./Range/Range.js";
14
+ import { Slider as R } from "./Slider/Slider.js";
15
+ import { Switch as N } from "./Switch/Switch.js";
16
+ import { Tag as j } from "./Tag/Tag.js";
17
+ import { TagSelect as v } from "./TagSelect/TagSelect.js";
18
+ import { TextArea as z } from "./TextArea/TextArea.js";
19
+ import { Toast as F } from "./Toast/Toast.js";
20
+ import { Tooltip as H } from "./Tooltip/Tooltip.js";
20
21
  export {
21
22
  e as AlertDialog,
22
23
  p as Autocomplete,
23
24
  x as Breadcrumb,
24
25
  a as Button,
25
- u as Checkbox,
26
- d as Dropdown,
27
- i as Input,
28
- T as Modal,
29
- b as NumberInput,
30
- B as ProgressBar,
31
- h as Radio,
32
- D as Range,
33
- M as Slider,
34
- k as Switch,
35
- N as Tag,
36
- j as TagSelect,
37
- v as TextArea,
38
- z as Toast,
39
- F as Tooltip
26
+ d as Card,
27
+ c as Checkbox,
28
+ i as Dropdown,
29
+ T as Input,
30
+ b as Modal,
31
+ B as NumberInput,
32
+ h as ProgressBar,
33
+ C as Radio,
34
+ I as Range,
35
+ R as Slider,
36
+ N as Switch,
37
+ j as Tag,
38
+ v as TagSelect,
39
+ z as TextArea,
40
+ F as Toast,
41
+ H as Tooltip
40
42
  };