@konstructio/ui 0.1.2-alpha.46 → 0.1.2-alpha.47

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.
@@ -0,0 +1,210 @@
1
+ import { jsxs as f, jsx as u } from "react/jsx-runtime";
2
+ import { R as x } from "../../index-BKjcReYh.js";
3
+ import p, { forwardRef as g, useId as $, useCallback as N } from "react";
4
+ import { cn as y } from "../../utils/index.js";
5
+ import { labelVariants as T, buttonVariants as P, counterVariants as W } from "./Counter.variants.js";
6
+ import { Typography as V } from "../Typography/Typography.js";
7
+ import { P as a } from "../../index-BOE_3f_Z.js";
8
+ function v() {
9
+ return v = Object.assign || function(e) {
10
+ for (var o = 1; o < arguments.length; o++) {
11
+ var r = arguments[o];
12
+ for (var t in r)
13
+ Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
14
+ }
15
+ return e;
16
+ }, v.apply(this, arguments);
17
+ }
18
+ function M(e, o) {
19
+ if (e == null) return {};
20
+ var r = R(e, o), t, n;
21
+ if (Object.getOwnPropertySymbols) {
22
+ var i = Object.getOwnPropertySymbols(e);
23
+ for (n = 0; n < i.length; n++)
24
+ t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
25
+ }
26
+ return r;
27
+ }
28
+ function R(e, o) {
29
+ if (e == null) return {};
30
+ var r = {}, t = Object.keys(e), n, i;
31
+ for (i = 0; i < t.length; i++)
32
+ n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
33
+ return r;
34
+ }
35
+ var O = g(function(e, o) {
36
+ var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, l = M(e, ["color", "size"]);
37
+ return /* @__PURE__ */ p.createElement("svg", v({
38
+ ref: o,
39
+ xmlns: "http://www.w3.org/2000/svg",
40
+ width: i,
41
+ height: i,
42
+ viewBox: "0 0 24 24",
43
+ fill: "none",
44
+ stroke: t,
45
+ strokeWidth: "2",
46
+ strokeLinecap: "round",
47
+ strokeLinejoin: "round"
48
+ }, l), /* @__PURE__ */ p.createElement("line", {
49
+ x1: "5",
50
+ y1: "12",
51
+ x2: "19",
52
+ y2: "12"
53
+ }));
54
+ });
55
+ O.propTypes = {
56
+ color: a.string,
57
+ size: a.oneOfType([a.string, a.number])
58
+ };
59
+ O.displayName = "Minus";
60
+ function b() {
61
+ return b = Object.assign || function(e) {
62
+ for (var o = 1; o < arguments.length; o++) {
63
+ var r = arguments[o];
64
+ for (var t in r)
65
+ Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
66
+ }
67
+ return e;
68
+ }, b.apply(this, arguments);
69
+ }
70
+ function C(e, o) {
71
+ if (e == null) return {};
72
+ var r = B(e, o), t, n;
73
+ if (Object.getOwnPropertySymbols) {
74
+ var i = Object.getOwnPropertySymbols(e);
75
+ for (n = 0; n < i.length; n++)
76
+ t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
77
+ }
78
+ return r;
79
+ }
80
+ function B(e, o) {
81
+ if (e == null) return {};
82
+ var r = {}, t = Object.keys(e), n, i;
83
+ for (i = 0; i < t.length; i++)
84
+ n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
85
+ return r;
86
+ }
87
+ var w = g(function(e, o) {
88
+ var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, l = C(e, ["color", "size"]);
89
+ return /* @__PURE__ */ p.createElement("svg", b({
90
+ ref: o,
91
+ xmlns: "http://www.w3.org/2000/svg",
92
+ width: i,
93
+ height: i,
94
+ viewBox: "0 0 24 24",
95
+ fill: "none",
96
+ stroke: t,
97
+ strokeWidth: "2",
98
+ strokeLinecap: "round",
99
+ strokeLinejoin: "round"
100
+ }, l), /* @__PURE__ */ p.createElement("line", {
101
+ x1: "12",
102
+ y1: "5",
103
+ x2: "12",
104
+ y2: "19"
105
+ }), /* @__PURE__ */ p.createElement("line", {
106
+ x1: "5",
107
+ y1: "12",
108
+ x2: "19",
109
+ y2: "12"
110
+ }));
111
+ });
112
+ w.propTypes = {
113
+ color: a.string,
114
+ size: a.oneOfType([a.string, a.number])
115
+ };
116
+ w.displayName = "Plus";
117
+ const J = g(
118
+ ({
119
+ canDecrement: e = !0,
120
+ canIncrement: o = !0,
121
+ className: r,
122
+ decrementButtonClassName: t,
123
+ incrementButtonClassName: n,
124
+ isRequired: i,
125
+ label: l,
126
+ max: d = -1 / 0,
127
+ min: h = 1 / 0,
128
+ name: j,
129
+ theme: k,
130
+ value: z,
131
+ onChange: m
132
+ }, I) => {
133
+ const _ = $(), s = z ?? 0, E = N(() => {
134
+ let c = 0;
135
+ h === 1 / 0 ? c = s - 1 : c = Math.max(h, s - 1), m?.({ target: { value: c } });
136
+ }, [s, h, m]), L = N(() => {
137
+ let c = 0;
138
+ d === -1 / 0 ? c = s + 1 : c = Math.min(d, s + 1), m?.({ target: { value: c } });
139
+ }, [s, d, m]);
140
+ return /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", "data-theme": k, children: [
141
+ l ? /* @__PURE__ */ f(
142
+ V,
143
+ {
144
+ component: "label",
145
+ htmlFor: j ?? _,
146
+ variant: "labelLarge",
147
+ className: y(T()),
148
+ children: [
149
+ "Number of nodes",
150
+ " ",
151
+ i && /* @__PURE__ */ u("span", { className: "text-red-600", children: "*" })
152
+ ]
153
+ }
154
+ ) : null,
155
+ /* @__PURE__ */ f("div", { className: "flex items-center", role: "presentation", children: [
156
+ /* @__PURE__ */ f(
157
+ "button",
158
+ {
159
+ type: "button",
160
+ onClick: E,
161
+ className: y(
162
+ P({
163
+ button: "rigth",
164
+ className: t
165
+ })
166
+ ),
167
+ disabled: !e,
168
+ children: [
169
+ /* @__PURE__ */ u(O, { className: "w-4 h-4" }),
170
+ /* @__PURE__ */ u(x, { children: "Decrement" })
171
+ ]
172
+ }
173
+ ),
174
+ /* @__PURE__ */ u(
175
+ "input",
176
+ {
177
+ ref: I,
178
+ type: "number",
179
+ value: s,
180
+ name: j,
181
+ className: y(W({ className: r })),
182
+ readOnly: !0,
183
+ "aria-label": typeof l == "string" ? l : "number input"
184
+ }
185
+ ),
186
+ /* @__PURE__ */ f(
187
+ "button",
188
+ {
189
+ type: "button",
190
+ onClick: L,
191
+ className: y(
192
+ P({
193
+ button: "left",
194
+ className: n
195
+ })
196
+ ),
197
+ disabled: !o,
198
+ children: [
199
+ /* @__PURE__ */ u(w, { className: "w-4 h-4" }),
200
+ /* @__PURE__ */ u(x, { children: "Increment" })
201
+ ]
202
+ }
203
+ )
204
+ ] })
205
+ ] });
206
+ }
207
+ );
208
+ export {
209
+ J as Counter
210
+ };
@@ -0,0 +1,70 @@
1
+ import { c as e } from "../../index-D29mdTf5.js";
2
+ const t = e([
3
+ "[&::-webkit-inner-spin-button]:appearance-none",
4
+ "[&::-webkit-outer-spin-button]:appearance-none",
5
+ "[-moz-appearance:textfield]",
6
+ "appearance-none",
7
+ "border",
8
+ "border-x-0",
9
+ "focus-visible:outline-none",
10
+ "focus-visible:ring-transparent",
11
+ "h-9",
12
+ "max-w-16",
13
+ "text-right",
14
+ "px-3",
15
+ "border-gray-300",
16
+ "text-slate-800",
17
+ "bg-white",
18
+ "dark:bg-metal-800",
19
+ "dark:border-metal-700",
20
+ "dark:text-metal-50"
21
+ ]), r = e(
22
+ [
23
+ "h-9",
24
+ "w-9",
25
+ "flex",
26
+ "items-center",
27
+ "justify-center",
28
+ "border",
29
+ "text-slate-500",
30
+ "border-gray-300",
31
+ "bg-white",
32
+ "cursor-pointer",
33
+ "hover:bg-aurora-50",
34
+ "hover:text-slate-600",
35
+ "disabled:hover:bg-white",
36
+ "disabled:bg-white",
37
+ "disabled:text-slate-400",
38
+ "dark:bg-metal-800",
39
+ "dark:border-metal-700",
40
+ "dark:text-aurora-500",
41
+ "dark:hover:bg-aurora-900",
42
+ "dark:hover:text-aurora-500",
43
+ "dark:disabled:text-metal-400",
44
+ "dark:disabled:hover:bg-metal-800",
45
+ "dark:disabled:bg-metal-800",
46
+ "disabled:cursor-not-allowed"
47
+ ],
48
+ {
49
+ variants: {
50
+ button: {
51
+ left: ["rounded-e"],
52
+ rigth: ["rounded-s"]
53
+ }
54
+ }
55
+ }
56
+ ), o = e(["cursor-pointer"], {
57
+ variants: {
58
+ variant: {
59
+ default: ""
60
+ }
61
+ },
62
+ defaultVariants: {
63
+ variant: "default"
64
+ }
65
+ });
66
+ export {
67
+ r as buttonVariants,
68
+ t as counterVariants,
69
+ o as labelVariants
70
+ };
@@ -195,7 +195,7 @@ const pe = ({
195
195
  children: Y
196
196
  }
197
197
  ) }),
198
- (a === t.Default || a === t.Error) && /* @__PURE__ */ e("div", { className: "shrink-0 w-[calc(100px+1rem)]" }),
198
+ (a === t.Default || a === t.Error) && /* @__PURE__ */ e("div", { className: "shrink-0 w-29" }),
199
199
  a === t.Uploading && /* @__PURE__ */ e("div", { className: "shrink-0 w-10" })
200
200
  ] }),
201
201
  /* @__PURE__ */ e(
@@ -15,7 +15,7 @@ const a = t(
15
15
  }
16
16
  }
17
17
  ), r = t(
18
- ["flex", "gap-2", "h-[60px]", "items-center", "w-full"],
18
+ ["flex", "gap-2", "h-15", "items-center", "w-full"],
19
19
  {
20
20
  variants: {
21
21
  status: {
@@ -1,53 +1,54 @@
1
- import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as g, useId as j, useCallback as w } from "react";
1
+ import { jsxs as c, jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as V, useId as j, useCallback as w } from "react";
3
+ import { Typography as d } from "../Typography/Typography.js";
3
4
  import { cn as a } from "../../utils/index.js";
4
- import { radioVariants as y, labelRadioVariants as t, wrapperRadioVariants as F } from "./Radio.variants.js";
5
- const $ = g(
5
+ import { radioVariants as F, labelRadioVariants as p, wrapperRadioVariants as $ } from "./Radio.variants.js";
6
+ const C = V(
6
7
  ({
7
8
  checked: r = !1,
8
- className: p,
9
- defaultChecked: o,
9
+ className: f,
10
+ defaultChecked: l,
10
11
  disabled: e,
11
- label: f,
12
- labelTextClassName: N,
13
- description: l,
14
- descriptionClassName: h,
15
- name: i,
16
- theme: x,
17
- value: m,
18
- wrapperClassName: R,
19
- onChange: c
20
- }, u) => {
21
- const d = `${j()}-${i}`, b = w(
22
- (V) => {
23
- c?.(V);
12
+ label: N,
13
+ labelTextClassName: h,
14
+ description: o,
15
+ descriptionClassName: x,
16
+ name: m,
17
+ theme: R,
18
+ value: n,
19
+ wrapperClassName: u,
20
+ onChange: i
21
+ }, y) => {
22
+ const t = `${j()}-${m}`, b = w(
23
+ (g) => {
24
+ i?.(g);
24
25
  },
25
- [c]
26
+ [i]
26
27
  );
27
- return /* @__PURE__ */ n(
28
+ return /* @__PURE__ */ c(
28
29
  "label",
29
30
  {
30
- htmlFor: d,
31
+ htmlFor: t,
31
32
  className: a(
32
- F({
33
- className: R,
33
+ $({
34
+ className: u,
34
35
  disabled: e || !1
35
36
  })
36
37
  ),
37
- "data-theme": x,
38
+ "data-theme": R,
38
39
  children: [
39
40
  /* @__PURE__ */ s(
40
41
  "input",
41
42
  {
42
- ref: u,
43
- id: d,
43
+ ref: y,
44
+ id: t,
44
45
  type: "radio",
45
- name: i,
46
- value: m,
46
+ name: m,
47
+ value: n,
47
48
  checked: r,
48
- defaultChecked: o,
49
+ defaultChecked: l,
49
50
  className: "hidden peer",
50
- onChange: () => b(m),
51
+ onChange: () => b(n),
51
52
  disabled: e
52
53
  }
53
54
  ),
@@ -55,31 +56,33 @@ const $ = g(
55
56
  "span",
56
57
  {
57
58
  className: a(
58
- y({
59
- className: p,
59
+ F({
60
+ className: f,
60
61
  disabled: e || !1,
61
- checked: r || o || !1
62
+ checked: r || l || !1
62
63
  })
63
64
  )
64
65
  }
65
66
  ),
66
- /* @__PURE__ */ n("div", { className: a(l && "flex flex-col gap-1"), children: [
67
+ /* @__PURE__ */ c("div", { className: a(o && "flex flex-col gap-1"), children: [
67
68
  /* @__PURE__ */ s(
68
- "span",
69
+ d,
69
70
  {
71
+ component: "span",
70
72
  className: a(
71
- t({ className: N })
73
+ p({ className: h })
72
74
  ),
73
- children: f
75
+ children: N
74
76
  }
75
77
  ),
76
- l && /* @__PURE__ */ s(
77
- "span",
78
+ o && /* @__PURE__ */ s(
79
+ d,
78
80
  {
81
+ component: "span",
79
82
  className: a(
80
- t({ className: h })
83
+ p({ className: x })
81
84
  ),
82
- children: l
85
+ children: o
83
86
  }
84
87
  )
85
88
  ] })
@@ -88,7 +91,7 @@ const $ = g(
88
91
  );
89
92
  }
90
93
  );
91
- $.displayName = "KonstructRadio";
94
+ C.displayName = "KonstructRadio";
92
95
  export {
93
- $ as Radio
96
+ C as Radio
94
97
  };
@@ -15,7 +15,8 @@ const a = e(
15
15
  ), o = e(
16
16
  [
17
17
  "border",
18
- "border-gray-300",
18
+ "border-zinc-400",
19
+ "dark:border-metal-600",
19
20
  "duration-300",
20
21
  "inline-block",
21
22
  "rounded-full",
@@ -61,22 +62,25 @@ const a = e(
61
62
  disabled: !0,
62
63
  checked: !0,
63
64
  class: [
64
- "peer-checked:border-gray-300",
65
- "peer-checked:before:bg-gray-300",
65
+ "peer-checked:border-zinc-300",
66
+ "peer-checked:before:bg-zinc-300",
66
67
  "cursor-not-allowed",
67
- "[&+span]:cursor-not-allowed"
68
+ "[&+span]:cursor-not-allowed",
69
+ "dark:peer-checked:before:bg-aurora-500/50",
70
+ "dark:peer-checked:border-aurora-500/50"
68
71
  ]
69
72
  },
70
73
  {
71
74
  disabled: !0,
72
75
  checked: !1,
73
76
  class: [
74
- "peer-checked:border-gray-200",
75
- "peer-checked:border-gray-200",
76
- "peer-checked:before:bg-gray-200",
77
+ "peer-checked:border-zinc-300",
78
+ "peer-checked:before:bg-zinc-50",
77
79
  "cursor-not-allowed",
78
80
  "[&+span]:cursor-not-allowed",
79
- "bg-gray-50"
81
+ "bg-gray-50",
82
+ "dark:bg-metal-800",
83
+ "dark:bg-metal-800"
80
84
  ]
81
85
  }
82
86
  ],
@@ -1,5 +1,5 @@
1
- import { c as t } from "../../index-D29mdTf5.js";
2
- const e = t([
1
+ import { c as r } from "../../index-D29mdTf5.js";
2
+ const e = r([
3
3
  "border",
4
4
  "rounded",
5
5
  "p-2.5",
@@ -7,8 +7,10 @@ const e = t([
7
7
  "flex",
8
8
  "items-center",
9
9
  "justify-between",
10
+ "bg-white",
10
11
  "border-gray-300",
11
12
  "dark:border-metal-700",
13
+ "dark:bg-metal-800",
12
14
  "cursor-pointer",
13
15
  "transition-all",
14
16
  "transition-duration-100",
@@ -16,7 +18,7 @@ const e = t([
16
18
  "text-sm",
17
19
  "text-slate-800",
18
20
  "dark:text-slate-50"
19
- ]), a = t([
21
+ ]), a = r([
20
22
  "snap-y",
21
23
  "snap-mandatory",
22
24
  "overflow-y-scroll",
@@ -24,7 +26,7 @@ const e = t([
24
26
  "flex",
25
27
  "flex-col",
26
28
  "dark:text-metal-50"
27
- ]), o = t([
29
+ ]), o = r([
28
30
  "w-15",
29
31
  "h-10",
30
32
  "snap-start",
@@ -46,8 +48,11 @@ const e = t([
46
48
  "focus-within:border-blue-200",
47
49
  "dark:focus-within:border-aurora-50",
48
50
  "dark:data-[active=true]:bg-aurora-500",
49
- "dark:data-[active=true]:text-metal-900"
50
- ]), n = t([
51
+ "dark:data-[active=true]:hover:border-aurora-50",
52
+ "dark:hover:border-transparent",
53
+ "dark:data-[active=true]:text-metal-900",
54
+ "dark:hover:bg-metal-700"
55
+ ]), n = r([
51
56
  "flex",
52
57
  "items-center",
53
58
  "justify-center",
@@ -1,39 +1,44 @@
1
1
  import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
2
  import { useCallback as b } from "react";
3
3
  import { cn as t } from "../../../../utils/index.js";
4
- import { buttonVariants as n, liVariants as c } from "../../TimePicker.variants.js";
5
- import { useTimePickerContext as N } from "../../contexts/time-picker.hook.js";
6
- const x = ({
7
- listClassName: s,
8
- listItemClassName: a,
9
- listItemButtonClassName: i
4
+ import { buttonVariants as n, liVariants as s } from "../../TimePicker.variants.js";
5
+ import { useTimePickerContext as x } from "../../contexts/time-picker.hook.js";
6
+ const N = ({
7
+ listClassName: c,
8
+ listItemClassName: i,
9
+ listItemButtonClassName: l
10
10
  }) => {
11
- const { format: m, isAM: l, onSelectAM: p, onSelectPM: u } = N(), o = b(
12
- (e, d) => {
13
- e.currentTarget?.blur(), d();
11
+ const { format: m, isAM: a, onSelectAM: d, onSelectPM: p } = x(), o = b(
12
+ (e, u) => {
13
+ e.currentTarget?.blur(), u();
14
14
  },
15
15
  []
16
16
  );
17
17
  return m === "24" ? null : /* @__PURE__ */ f(
18
18
  "ul",
19
19
  {
20
- className: t("flex items-center justify-center flex-col", s),
20
+ className: t("flex items-center justify-center flex-col", c),
21
21
  "aria-label": "meridian",
22
22
  role: "listbox",
23
23
  children: [
24
24
  /* @__PURE__ */ r(
25
25
  "li",
26
26
  {
27
- className: t(c({ className: a })),
28
- "data-active": l,
27
+ className: t(s({ className: i })),
28
+ "data-active": a,
29
29
  role: "presentation",
30
30
  children: /* @__PURE__ */ r(
31
31
  "button",
32
32
  {
33
33
  type: "button",
34
34
  role: "option",
35
- className: t(n({ className: i })),
36
- onClick: (e) => o(e, p),
35
+ className: t(
36
+ n({ className: l }),
37
+ {
38
+ "dark:text-slate-50": !a
39
+ }
40
+ ),
41
+ onClick: (e) => o(e, d),
37
42
  children: "AM"
38
43
  }
39
44
  )
@@ -42,16 +47,21 @@ const x = ({
42
47
  /* @__PURE__ */ r(
43
48
  "li",
44
49
  {
45
- className: t(c({ className: a })),
46
- "data-active": !l,
50
+ className: t(s({ className: i })),
51
+ "data-active": !a,
47
52
  role: "presentation",
48
53
  children: /* @__PURE__ */ r(
49
54
  "button",
50
55
  {
51
56
  type: "button",
52
57
  role: "option",
53
- className: t(n({ className: i })),
54
- onClick: (e) => o(e, u),
58
+ className: t(
59
+ n({ className: l }),
60
+ {
61
+ "dark:text-slate-50": a
62
+ }
63
+ ),
64
+ onClick: (e) => o(e, p),
55
65
  children: "PM"
56
66
  }
57
67
  )
@@ -61,7 +71,7 @@ const x = ({
61
71
  }
62
72
  );
63
73
  };
64
- x.displayName = "MeridianList";
74
+ N.displayName = "MeridianList";
65
75
  export {
66
- x as MeridianList
76
+ N as MeridianList
67
77
  };