@konstructio/ui 0.1.0-alpha.28 → 0.1.0-alpha.29
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.
- package/dist/components/Input/Input.js +31 -31
- package/dist/package.json +9 -9
- package/package.json +9 -9
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import l, { forwardRef as v, useId as
|
|
2
|
+
import l, { forwardRef as v, useId as z, useRef as _, useState as I } from "react";
|
|
3
3
|
import { cn as d } from "../../utils/index.js";
|
|
4
|
-
import { inputVariants as
|
|
5
|
-
import { SearchIcon as
|
|
6
|
-
import { Warning as
|
|
4
|
+
import { inputVariants as W } from "./Input.variants.js";
|
|
5
|
+
import { SearchIcon as $ } from "../../assets/icons/components/Search.js";
|
|
6
|
+
import { Warning as L } from "../../assets/icons/components/Warning.js";
|
|
7
7
|
import { P as i } from "../../index-h-Ul0anl.js";
|
|
8
8
|
function h() {
|
|
9
9
|
return h = Object.assign || function(t) {
|
|
@@ -15,9 +15,9 @@ function h() {
|
|
|
15
15
|
return t;
|
|
16
16
|
}, h.apply(this, arguments);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function T(t, r) {
|
|
19
19
|
if (t == null) return {};
|
|
20
|
-
var o =
|
|
20
|
+
var o = S(t, r), e, n;
|
|
21
21
|
if (Object.getOwnPropertySymbols) {
|
|
22
22
|
var a = Object.getOwnPropertySymbols(t);
|
|
23
23
|
for (n = 0; n < a.length; n++)
|
|
@@ -25,7 +25,7 @@ function $(t, r) {
|
|
|
25
25
|
}
|
|
26
26
|
return o;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function S(t, r) {
|
|
29
29
|
if (t == null) return {};
|
|
30
30
|
var o = {}, e = Object.keys(t), n, a;
|
|
31
31
|
for (a = 0; a < e.length; a++)
|
|
@@ -33,7 +33,7 @@ function L(t, r) {
|
|
|
33
33
|
return o;
|
|
34
34
|
}
|
|
35
35
|
var y = v(function(t, r) {
|
|
36
|
-
var o = t.color, e = o === void 0 ? "currentColor" : o, n = t.size, a = n === void 0 ? 24 : n, c =
|
|
36
|
+
var o = t.color, e = o === void 0 ? "currentColor" : o, n = t.size, a = n === void 0 ? 24 : n, c = T(t, ["color", "size"]);
|
|
37
37
|
return /* @__PURE__ */ l.createElement("svg", h({
|
|
38
38
|
ref: r,
|
|
39
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -69,9 +69,9 @@ function g() {
|
|
|
69
69
|
return t;
|
|
70
70
|
}, g.apply(this, arguments);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function C(t, r) {
|
|
73
73
|
if (t == null) return {};
|
|
74
|
-
var o =
|
|
74
|
+
var o = M(t, r), e, n;
|
|
75
75
|
if (Object.getOwnPropertySymbols) {
|
|
76
76
|
var a = Object.getOwnPropertySymbols(t);
|
|
77
77
|
for (n = 0; n < a.length; n++)
|
|
@@ -79,15 +79,15 @@ function S(t, r) {
|
|
|
79
79
|
}
|
|
80
80
|
return o;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function M(t, r) {
|
|
83
83
|
if (t == null) return {};
|
|
84
84
|
var o = {}, e = Object.keys(t), n, a;
|
|
85
85
|
for (a = 0; a < e.length; a++)
|
|
86
86
|
n = e[a], !(r.indexOf(n) >= 0) && (o[n] = t[n]);
|
|
87
87
|
return o;
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
var o = t.color, e = o === void 0 ? "currentColor" : o, n = t.size, a = n === void 0 ? 24 : n, c =
|
|
89
|
+
var w = v(function(t, r) {
|
|
90
|
+
var o = t.color, e = o === void 0 ? "currentColor" : o, n = t.size, a = n === void 0 ? 24 : n, c = C(t, ["color", "size"]);
|
|
91
91
|
return /* @__PURE__ */ l.createElement("svg", g({
|
|
92
92
|
ref: r,
|
|
93
93
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -107,12 +107,12 @@ var x = v(function(t, r) {
|
|
|
107
107
|
r: "3"
|
|
108
108
|
}));
|
|
109
109
|
});
|
|
110
|
-
|
|
110
|
+
w.propTypes = {
|
|
111
111
|
color: i.string,
|
|
112
112
|
size: i.oneOfType([i.string, i.number])
|
|
113
113
|
};
|
|
114
|
-
|
|
115
|
-
const
|
|
114
|
+
w.displayName = "Eye";
|
|
115
|
+
const R = v(
|
|
116
116
|
({
|
|
117
117
|
className: t,
|
|
118
118
|
error: r,
|
|
@@ -122,11 +122,11 @@ const C = v(
|
|
|
122
122
|
labelClassName: a,
|
|
123
123
|
name: c,
|
|
124
124
|
theme: b,
|
|
125
|
-
type:
|
|
126
|
-
helperText:
|
|
125
|
+
type: p = "text",
|
|
126
|
+
helperText: x,
|
|
127
127
|
...j
|
|
128
128
|
}, N) => {
|
|
129
|
-
const O =
|
|
129
|
+
const O = z(), P = _(p === "password"), [u, E] = I(() => p !== "password"), f = typeof r == "string" && r.length >= 0, k = u ? w : y;
|
|
130
130
|
return /* @__PURE__ */ m("div", { className: "flex flex-col gap-2 w-full relative", "data-theme": b, children: [
|
|
131
131
|
n ? /* @__PURE__ */ m(
|
|
132
132
|
"label",
|
|
@@ -150,10 +150,10 @@ const C = v(
|
|
|
150
150
|
className: d(
|
|
151
151
|
"absolute left-2.5 top-1/2 -translate-y-[50%] text-slate-400",
|
|
152
152
|
{
|
|
153
|
-
"text-red-700":
|
|
153
|
+
"text-red-700": f
|
|
154
154
|
}
|
|
155
155
|
),
|
|
156
|
-
children: /* @__PURE__ */ s(
|
|
156
|
+
children: /* @__PURE__ */ s($, { className: "w-5 h-5" })
|
|
157
157
|
}
|
|
158
158
|
) : null,
|
|
159
159
|
/* @__PURE__ */ s(
|
|
@@ -162,21 +162,21 @@ const C = v(
|
|
|
162
162
|
id: O,
|
|
163
163
|
ref: N,
|
|
164
164
|
name: c,
|
|
165
|
-
type: u ? "text" : "password",
|
|
165
|
+
type: u ? P.current ? "text" : p : "password",
|
|
166
166
|
className: d(
|
|
167
|
-
|
|
167
|
+
W({
|
|
168
168
|
className: t,
|
|
169
|
-
variant:
|
|
169
|
+
variant: f ? "error" : "default"
|
|
170
170
|
}),
|
|
171
|
-
(
|
|
171
|
+
(p === "password" || f) && "pr-10",
|
|
172
172
|
e && "pl-8"
|
|
173
173
|
),
|
|
174
174
|
...j
|
|
175
175
|
}
|
|
176
176
|
),
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
f ? /* @__PURE__ */ s("i", { className: "absolute right-3 text-red-700 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ s(L, { className: "w-5 h-5" }) }) : null,
|
|
178
|
+
p === "password" && !r ? /* @__PURE__ */ s("i", { className: "absolute right-3 text-slate-400 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ s(
|
|
179
|
+
k,
|
|
180
180
|
{
|
|
181
181
|
className: "w-5 h-5 cursor-pointer",
|
|
182
182
|
onClick: () => E(!u)
|
|
@@ -184,11 +184,11 @@ const C = v(
|
|
|
184
184
|
) }) : null
|
|
185
185
|
] }),
|
|
186
186
|
r ? /* @__PURE__ */ s("span", { className: "text-xs text-red-700", children: r }) : null,
|
|
187
|
-
!r &&
|
|
187
|
+
!r && x ? /* @__PURE__ */ s("span", { className: "text-xs text-slate-600", children: x }) : null
|
|
188
188
|
] });
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
|
-
|
|
191
|
+
R.displayName = "Input";
|
|
192
192
|
export {
|
|
193
|
-
|
|
193
|
+
R as Input
|
|
194
194
|
};
|
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.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.28",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -108,17 +108,17 @@
|
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@rollup/plugin-alias": "^5.1.1",
|
|
111
|
-
"@storybook/addon-docs": "^9.1.
|
|
112
|
-
"@storybook/addon-links": "^9.1.
|
|
113
|
-
"@storybook/react-vite": "^9.1.
|
|
111
|
+
"@storybook/addon-docs": "^9.1.3",
|
|
112
|
+
"@storybook/addon-links": "^9.1.3",
|
|
113
|
+
"@storybook/react-vite": "^9.1.3",
|
|
114
114
|
"@tailwindcss/vite": "^4.1.12",
|
|
115
|
-
"@testing-library/jest-dom": "^6.
|
|
115
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
116
116
|
"@testing-library/react": "^16.3.0",
|
|
117
117
|
"@testing-library/user-event": "^14.6.1",
|
|
118
118
|
"@types/jest-axe": "^3.5.9",
|
|
119
119
|
"@types/js-cookie": "^3.0.6",
|
|
120
120
|
"@types/lodash": "^4.17.20",
|
|
121
|
-
"@types/react": "^19.1.
|
|
121
|
+
"@types/react": "^19.1.11",
|
|
122
122
|
"@types/react-dom": "^19.1.7",
|
|
123
123
|
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
|
124
124
|
"@typescript-eslint/parser": "^8.40.0",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"eslint": "^8.57.0",
|
|
129
129
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
130
130
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
131
|
-
"eslint-plugin-storybook": "^9.1.
|
|
131
|
+
"eslint-plugin-storybook": "^9.1.3",
|
|
132
132
|
"glob": "^11.0.3",
|
|
133
133
|
"husky": "^9.1.7",
|
|
134
134
|
"jest-axe": "^10.0.0",
|
|
@@ -137,14 +137,14 @@
|
|
|
137
137
|
"postcss": "^8.5.6",
|
|
138
138
|
"prettier": "^3.6.2",
|
|
139
139
|
"rimraf": "^6.0.1",
|
|
140
|
-
"storybook": "^9.1.
|
|
140
|
+
"storybook": "^9.1.3",
|
|
141
141
|
"tailwindcss": "^4.1.12",
|
|
142
142
|
"ts-node": "^10.9.2",
|
|
143
143
|
"typescript": "^5.9.2",
|
|
144
144
|
"vite": "^6.3.5",
|
|
145
145
|
"vite-plugin-dts": "^4.5.4",
|
|
146
146
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
147
|
-
"vite-plugin-svgr": "^4.
|
|
147
|
+
"vite-plugin-svgr": "^4.5.0",
|
|
148
148
|
"vite-tsconfig-paths": "^5.1.4",
|
|
149
149
|
"vitest": "^3.2.4"
|
|
150
150
|
},
|
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.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.29",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -108,17 +108,17 @@
|
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@rollup/plugin-alias": "^5.1.1",
|
|
111
|
-
"@storybook/addon-docs": "^9.1.
|
|
112
|
-
"@storybook/addon-links": "^9.1.
|
|
113
|
-
"@storybook/react-vite": "^9.1.
|
|
111
|
+
"@storybook/addon-docs": "^9.1.3",
|
|
112
|
+
"@storybook/addon-links": "^9.1.3",
|
|
113
|
+
"@storybook/react-vite": "^9.1.3",
|
|
114
114
|
"@tailwindcss/vite": "^4.1.12",
|
|
115
|
-
"@testing-library/jest-dom": "^6.
|
|
115
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
116
116
|
"@testing-library/react": "^16.3.0",
|
|
117
117
|
"@testing-library/user-event": "^14.6.1",
|
|
118
118
|
"@types/jest-axe": "^3.5.9",
|
|
119
119
|
"@types/js-cookie": "^3.0.6",
|
|
120
120
|
"@types/lodash": "^4.17.20",
|
|
121
|
-
"@types/react": "^19.1.
|
|
121
|
+
"@types/react": "^19.1.11",
|
|
122
122
|
"@types/react-dom": "^19.1.7",
|
|
123
123
|
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
|
124
124
|
"@typescript-eslint/parser": "^8.40.0",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"eslint": "^8.57.0",
|
|
129
129
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
130
130
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
131
|
-
"eslint-plugin-storybook": "^9.1.
|
|
131
|
+
"eslint-plugin-storybook": "^9.1.3",
|
|
132
132
|
"glob": "^11.0.3",
|
|
133
133
|
"husky": "^9.1.7",
|
|
134
134
|
"jest-axe": "^10.0.0",
|
|
@@ -137,14 +137,14 @@
|
|
|
137
137
|
"postcss": "^8.5.6",
|
|
138
138
|
"prettier": "^3.6.2",
|
|
139
139
|
"rimraf": "^6.0.1",
|
|
140
|
-
"storybook": "^9.1.
|
|
140
|
+
"storybook": "^9.1.3",
|
|
141
141
|
"tailwindcss": "^4.1.12",
|
|
142
142
|
"ts-node": "^10.9.2",
|
|
143
143
|
"typescript": "^5.9.2",
|
|
144
144
|
"vite": "^6.3.5",
|
|
145
145
|
"vite-plugin-dts": "^4.5.4",
|
|
146
146
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
147
|
-
"vite-plugin-svgr": "^4.
|
|
147
|
+
"vite-plugin-svgr": "^4.5.0",
|
|
148
148
|
"vite-tsconfig-paths": "^5.1.4",
|
|
149
149
|
"vitest": "^3.2.4"
|
|
150
150
|
},
|