@konstructio/ui 0.1.0-alpha.27 → 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.
@@ -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 k, useState as z } from "react";
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 _ } from "./Input.variants.js";
5
- import { SearchIcon as I } from "../../assets/icons/components/Search.js";
6
- import { Warning as W } from "../../assets/icons/components/Warning.js";
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 $(t, r) {
18
+ function T(t, r) {
19
19
  if (t == null) return {};
20
- var o = L(t, r), e, n;
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 L(t, r) {
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 = $(t, ["color", "size"]);
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 S(t, r) {
72
+ function C(t, r) {
73
73
  if (t == null) return {};
74
- var o = T(t, r), e, n;
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 T(t, r) {
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 x = 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 = S(t, ["color", "size"]);
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
- x.propTypes = {
110
+ w.propTypes = {
111
111
  color: i.string,
112
112
  size: i.oneOfType([i.string, i.number])
113
113
  };
114
- x.displayName = "Eye";
115
- const C = v(
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: f = "text",
126
- helperText: w,
125
+ type: p = "text",
126
+ helperText: x,
127
127
  ...j
128
128
  }, N) => {
129
- const O = k(), [u, E] = z(() => f !== "password"), p = typeof r == "string" && r.length >= 0, P = u ? x : y;
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": p
153
+ "text-red-700": f
154
154
  }
155
155
  ),
156
- children: /* @__PURE__ */ s(I, { className: "w-5 h-5" })
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: p ? "error" : "default"
169
+ variant: f ? "error" : "default"
170
170
  }),
171
- (f === "password" || p) && "pr-10",
171
+ (p === "password" || f) && "pr-10",
172
172
  e && "pl-8"
173
173
  ),
174
174
  ...j
175
175
  }
176
176
  ),
177
- p ? /* @__PURE__ */ s("i", { className: "absolute right-3 text-red-700 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ s(W, { className: "w-5 h-5" }) }) : null,
178
- f === "password" && !r ? /* @__PURE__ */ s("i", { className: "absolute right-3 text-slate-400 top-1/2 -translate-y-[50%]", children: /* @__PURE__ */ s(
179
- P,
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 && w ? /* @__PURE__ */ s("span", { className: "text-xs text-slate-600", children: w }) : null
187
+ !r && x ? /* @__PURE__ */ s("span", { className: "text-xs text-slate-600", children: x }) : null
188
188
  ] });
189
189
  }
190
190
  );
191
- C.displayName = "Input";
191
+ R.displayName = "Input";
192
192
  export {
193
- C as Input
193
+ R as Input
194
194
  };
@@ -1,30 +1,62 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { cn as o } from "../../utils/index.js";
3
- import { progressBarProgress as l, progressBarVariants as d } from "./ProgressBar.variants.js";
4
- const f = ({
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { cn as s } from "../../utils/index.js";
3
+ import { progressBarProgress as f, progressBarVariants as N } from "./ProgressBar.variants.js";
4
+ const j = ({
5
+ backgroundBarClassName: t,
5
6
  label: r,
6
- theme: e,
7
- percent: s,
8
- status: t
9
- }) => /* @__PURE__ */ i("div", { className: "w-full", "data-theme": e, children: [
10
- /* @__PURE__ */ i("div", { className: o("flex", r ? "justify-between" : "justify-end"), children: [
11
- r ? /* @__PURE__ */ a("label", { className: "font-semibold", children: r }) : null,
12
- /* @__PURE__ */ i("span", { className: "font-semibold", children: [
13
- s,
14
- "%"
15
- ] })
16
- ] }),
17
- /* @__PURE__ */ a("div", { className: o(d()), children: /* @__PURE__ */ a(
18
- "div",
19
- {
20
- className: o(
21
- l({ status: t }),
22
- s > 0 && s < 99 ? "transition-width duration-500" : "transition-colors duration-0"
7
+ labelClassName: o,
8
+ labelWrapperClassName: l,
9
+ percent: a,
10
+ percentClassName: n,
11
+ progressBarClassName: d,
12
+ status: m,
13
+ theme: c,
14
+ wrapperClassName: h
15
+ }) => /* @__PURE__ */ i(
16
+ "div",
17
+ {
18
+ className: s("w-full text-inherit", h),
19
+ "data-theme": c,
20
+ children: [
21
+ /* @__PURE__ */ i(
22
+ "div",
23
+ {
24
+ className: s(
25
+ "flex font-semibold",
26
+ {
27
+ "justify-between": r,
28
+ "justify-end": !r
29
+ },
30
+ l
31
+ ),
32
+ children: [
33
+ r ? /* @__PURE__ */ e("label", { className: s(o), children: r }) : null,
34
+ /* @__PURE__ */ i("span", { className: s(n), children: [
35
+ a,
36
+ "%"
37
+ ] })
38
+ ]
39
+ }
23
40
  ),
24
- style: { width: `${s}%` }
25
- }
26
- ) })
27
- ] });
41
+ /* @__PURE__ */ e(
42
+ "div",
43
+ {
44
+ className: s(N({ className: t })),
45
+ children: /* @__PURE__ */ e(
46
+ "div",
47
+ {
48
+ className: s(
49
+ f({ status: m, className: d }),
50
+ a > 0 && a < 99 ? "transition-width duration-500" : "transition-colors duration-0"
51
+ ),
52
+ style: { width: `${a}%` }
53
+ }
54
+ )
55
+ }
56
+ )
57
+ ]
58
+ }
59
+ );
28
60
  export {
29
- f as ProgressBar
61
+ j as ProgressBar
30
62
  };
package/dist/index.d.ts CHANGED
@@ -433,11 +433,17 @@ export declare const PieChart: FC<Props_2>;
433
433
  export declare const ProgressBar: FC<ProgressBarProps>;
434
434
 
435
435
  declare interface ProgressBarProps extends VariantProps<typeof progressBarVariants> {
436
+ backgroundBarClassName?: string;
436
437
  className?: string;
437
438
  label?: string;
439
+ labelClassName?: string;
440
+ labelWrapperClassName?: string;
438
441
  percent: number;
439
- theme?: Theme;
442
+ percentClassName?: string;
443
+ progressBarClassName?: string;
440
444
  status?: 'success' | 'progress';
445
+ theme?: Theme;
446
+ wrapperClassName?: string;
441
447
  }
442
448
 
443
449
  declare const progressBarVariants: (props?: ClassProp | undefined) => string;
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.26",
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.2",
112
- "@storybook/addon-links": "^9.1.2",
113
- "@storybook/react-vite": "^9.1.2",
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.7.0",
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.10",
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.2",
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.2",
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.3.0",
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.27",
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.2",
112
- "@storybook/addon-links": "^9.1.2",
113
- "@storybook/react-vite": "^9.1.2",
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.7.0",
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.10",
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.2",
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.2",
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.3.0",
147
+ "vite-plugin-svgr": "^4.5.0",
148
148
  "vite-tsconfig-paths": "^5.1.4",
149
149
  "vitest": "^3.2.4"
150
150
  },