@konstructio/ui 0.0.12-alpha.17 → 0.0.12-alpha.19

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,23 +1,23 @@
1
- import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
- import { R as O } from "../../index-CbTU3cnP.js";
3
- import u, { forwardRef as b, useId as z, useCallback as w } from "react";
4
- import { cn as y } from "../../utils/index.js";
5
- import { labelVariants as _, buttonVariants as j, numberInputVariants as E } from "./NumberInput.variants.js";
6
- import { P as a } from "../../index-C5psggHV.js";
7
- import { useTheme as T } from "../../contexts/theme.hook.js";
8
- function v() {
9
- return v = Object.assign || function(e) {
1
+ import { jsxs as y, jsx as u } from "react/jsx-runtime";
2
+ import { R as w } from "../../index-CbTU3cnP.js";
3
+ import p, { forwardRef as d, useId as _, useCallback as j } from "react";
4
+ import { cn as v } from "../../utils/index.js";
5
+ import { labelVariants as E, buttonVariants as x, numberInputVariants as T } from "./NumberInput.variants.js";
6
+ import { P as s } from "../../index-C5psggHV.js";
7
+ import { useTheme as $ } from "../../contexts/theme.hook.js";
8
+ function h() {
9
+ return h = Object.assign || function(e) {
10
10
  for (var i = 1; i < arguments.length; i++) {
11
11
  var r = arguments[i];
12
12
  for (var t in r)
13
13
  Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
14
14
  }
15
15
  return e;
16
- }, v.apply(this, arguments);
16
+ }, h.apply(this, arguments);
17
17
  }
18
- function $(e, i) {
18
+ function L(e, i) {
19
19
  if (e == null) return {};
20
- var r = L(e, i), t, n;
20
+ var r = W(e, i), t, n;
21
21
  if (Object.getOwnPropertySymbols) {
22
22
  var o = Object.getOwnPropertySymbols(e);
23
23
  for (n = 0; n < o.length; n++)
@@ -25,16 +25,16 @@ function $(e, i) {
25
25
  }
26
26
  return r;
27
27
  }
28
- function L(e, i) {
28
+ function W(e, i) {
29
29
  if (e == null) return {};
30
30
  var r = {}, t = Object.keys(e), n, o;
31
31
  for (o = 0; o < t.length; o++)
32
32
  n = t[o], !(i.indexOf(n) >= 0) && (r[n] = e[n]);
33
33
  return r;
34
34
  }
35
- var d = b(function(e, i) {
36
- var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, o = n === void 0 ? 24 : n, l = $(e, ["color", "size"]);
37
- return /* @__PURE__ */ u.createElement("svg", v({
35
+ var g = d(function(e, i) {
36
+ var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, o = n === void 0 ? 24 : n, f = L(e, ["color", "size"]);
37
+ return /* @__PURE__ */ p.createElement("svg", h({
38
38
  ref: i,
39
39
  xmlns: "http://www.w3.org/2000/svg",
40
40
  width: o,
@@ -45,31 +45,31 @@ var d = b(function(e, i) {
45
45
  strokeWidth: "2",
46
46
  strokeLinecap: "round",
47
47
  strokeLinejoin: "round"
48
- }, l), /* @__PURE__ */ u.createElement("line", {
48
+ }, f), /* @__PURE__ */ p.createElement("line", {
49
49
  x1: "5",
50
50
  y1: "12",
51
51
  x2: "19",
52
52
  y2: "12"
53
53
  }));
54
54
  });
55
- d.propTypes = {
56
- color: a.string,
57
- size: a.oneOfType([a.string, a.number])
55
+ g.propTypes = {
56
+ color: s.string,
57
+ size: s.oneOfType([s.string, s.number])
58
58
  };
59
- d.displayName = "Minus";
60
- function h() {
61
- return h = Object.assign || function(e) {
59
+ g.displayName = "Minus";
60
+ function b() {
61
+ return b = Object.assign || function(e) {
62
62
  for (var i = 1; i < arguments.length; i++) {
63
63
  var r = arguments[i];
64
64
  for (var t in r)
65
65
  Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
66
66
  }
67
67
  return e;
68
- }, h.apply(this, arguments);
68
+ }, b.apply(this, arguments);
69
69
  }
70
- function W(e, i) {
70
+ function V(e, i) {
71
71
  if (e == null) return {};
72
- var r = V(e, i), t, n;
72
+ var r = M(e, i), t, n;
73
73
  if (Object.getOwnPropertySymbols) {
74
74
  var o = Object.getOwnPropertySymbols(e);
75
75
  for (n = 0; n < o.length; n++)
@@ -77,16 +77,16 @@ function W(e, i) {
77
77
  }
78
78
  return r;
79
79
  }
80
- function V(e, i) {
80
+ function M(e, i) {
81
81
  if (e == null) return {};
82
82
  var r = {}, t = Object.keys(e), n, o;
83
83
  for (o = 0; o < t.length; o++)
84
84
  n = t[o], !(i.indexOf(n) >= 0) && (r[n] = e[n]);
85
85
  return r;
86
86
  }
87
- var g = b(function(e, i) {
88
- var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, o = n === void 0 ? 24 : n, l = W(e, ["color", "size"]);
89
- return /* @__PURE__ */ u.createElement("svg", h({
87
+ var O = d(function(e, i) {
88
+ var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, o = n === void 0 ? 24 : n, f = V(e, ["color", "size"]);
89
+ return /* @__PURE__ */ p.createElement("svg", b({
90
90
  ref: i,
91
91
  xmlns: "http://www.w3.org/2000/svg",
92
92
  width: o,
@@ -97,24 +97,24 @@ var g = b(function(e, i) {
97
97
  strokeWidth: "2",
98
98
  strokeLinecap: "round",
99
99
  strokeLinejoin: "round"
100
- }, l), /* @__PURE__ */ u.createElement("line", {
100
+ }, f), /* @__PURE__ */ p.createElement("line", {
101
101
  x1: "12",
102
102
  y1: "5",
103
103
  x2: "12",
104
104
  y2: "19"
105
- }), /* @__PURE__ */ u.createElement("line", {
105
+ }), /* @__PURE__ */ p.createElement("line", {
106
106
  x1: "5",
107
107
  y1: "12",
108
108
  x2: "19",
109
109
  y2: "12"
110
110
  }));
111
111
  });
112
- g.propTypes = {
113
- color: a.string,
114
- size: a.oneOfType([a.string, a.number])
112
+ O.propTypes = {
113
+ color: s.string,
114
+ size: s.oneOfType([s.string, s.number])
115
115
  };
116
- g.displayName = "Plus";
117
- const A = b(
116
+ O.displayName = "Plus";
117
+ const G = d(
118
118
  ({
119
119
  className: e,
120
120
  label: i,
@@ -122,69 +122,69 @@ const A = b(
122
122
  min: t = 1 / 0,
123
123
  name: n,
124
124
  theme: o,
125
- value: l,
126
- onChange: s
127
- }, x) => {
128
- const { theme: P } = T(), p = o ?? P, k = z(), I = w(() => {
129
- let f = 0;
130
- t === 1 / 0 ? f = l - 1 : f = Math.max(t, l - 1), s == null || s({ target: { value: f } });
131
- }, [l, t, s]), N = w(() => {
132
- let f = 0;
133
- r === -1 / 0 ? f = l + 1 : f = Math.min(r, l + 1), s == null || s({ target: { value: f } });
134
- }, [l, r, s]);
135
- return /* @__PURE__ */ m("div", { className: "flex flex-col gap-1", children: [
136
- i ? /* @__PURE__ */ c(
125
+ value: f,
126
+ onChange: l
127
+ }, P) => {
128
+ const { theme: k } = $(), m = o ?? k, I = _(), a = f ?? 0, N = j(() => {
129
+ let c = 0;
130
+ t === 1 / 0 ? c = a - 1 : c = Math.max(t, a - 1), l == null || l({ target: { value: c } });
131
+ }, [a, t, l]), z = j(() => {
132
+ let c = 0;
133
+ r === -1 / 0 ? c = a + 1 : c = Math.min(r, a + 1), l == null || l({ target: { value: c } });
134
+ }, [a, r, l]);
135
+ return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
136
+ i ? /* @__PURE__ */ u(
137
137
  "label",
138
138
  {
139
- htmlFor: n ?? k,
140
- className: y(
141
- _({
142
- theme: p
139
+ htmlFor: n ?? I,
140
+ className: v(
141
+ E({
142
+ theme: m
143
143
  })
144
144
  ),
145
145
  children: i
146
146
  }
147
147
  ) : null,
148
- /* @__PURE__ */ m("div", { className: "flex items-center", role: "presentation", children: [
149
- /* @__PURE__ */ m(
148
+ /* @__PURE__ */ y("div", { className: "flex items-center", role: "presentation", children: [
149
+ /* @__PURE__ */ y(
150
150
  "button",
151
151
  {
152
152
  type: "button",
153
- onClick: I,
154
- className: y(
155
- j({ theme: p, button: "rigth" })
153
+ onClick: N,
154
+ className: v(
155
+ x({ theme: m, button: "rigth" })
156
156
  ),
157
157
  children: [
158
- /* @__PURE__ */ c(d, { className: "w-4 h-4" }),
159
- /* @__PURE__ */ c(O, { children: "Decrement" })
158
+ /* @__PURE__ */ u(g, { className: "w-4 h-4" }),
159
+ /* @__PURE__ */ u(w, { children: "Decrement" })
160
160
  ]
161
161
  }
162
162
  ),
163
- /* @__PURE__ */ c(
163
+ /* @__PURE__ */ u(
164
164
  "input",
165
165
  {
166
- ref: x,
166
+ ref: P,
167
167
  type: "number",
168
- value: l,
168
+ value: a,
169
169
  name: n,
170
- className: y(
171
- E({ className: e, theme: p })
170
+ className: v(
171
+ T({ className: e, theme: m })
172
172
  ),
173
173
  readOnly: !0,
174
174
  "aria-label": typeof i == "string" ? i : "number input"
175
175
  }
176
176
  ),
177
- /* @__PURE__ */ m(
177
+ /* @__PURE__ */ y(
178
178
  "button",
179
179
  {
180
180
  type: "button",
181
- onClick: N,
182
- className: y(
183
- j({ theme: p, button: "left" })
181
+ onClick: z,
182
+ className: v(
183
+ x({ theme: m, button: "left" })
184
184
  ),
185
185
  children: [
186
- /* @__PURE__ */ c(g, { className: "w-4 h-4" }),
187
- /* @__PURE__ */ c(O, { children: "Increment" })
186
+ /* @__PURE__ */ u(O, { className: "w-4 h-4" }),
187
+ /* @__PURE__ */ u(w, { children: "Increment" })
188
188
  ]
189
189
  }
190
190
  )
@@ -193,5 +193,5 @@ const A = b(
193
193
  }
194
194
  );
195
195
  export {
196
- A as NumberInput
196
+ G as NumberInput
197
197
  };
package/dist/index.d.ts CHANGED
@@ -320,7 +320,7 @@ declare interface NumberInputProps extends VariantProps<typeof numberInputVarian
320
320
  max?: number;
321
321
  min?: number;
322
322
  name?: string;
323
- value: number;
323
+ value?: number;
324
324
  onChange?: ({ target: { value } }: {
325
325
  target: {
326
326
  value: number;
package/dist/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.0.12-alpha.16",
5
+ "version": "0.0.12-alpha.18",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.0.12-alpha.17",
5
+ "version": "0.0.12-alpha.19",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",