@konstructio/ui 0.0.12-alpha.4 → 0.0.12-alpha.5
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/Autocomplete/Autocomplete.variants.js +0 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +2 -4
- package/dist/components/TextArea/TextArea.js +31 -20
- package/dist/components/TextArea/TextArea.variants.js +0 -1
- package/dist/index.d.ts +2 -3
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -132,7 +132,7 @@ const _ = u(
|
|
|
132
132
|
...d
|
|
133
133
|
}, x) => {
|
|
134
134
|
const v = b(), { theme: O } = N();
|
|
135
|
-
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5", children: [
|
|
135
|
+
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1.5 w-full", children: [
|
|
136
136
|
r ? /* @__PURE__ */ a(
|
|
137
137
|
"label",
|
|
138
138
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as r } from "../../index-BNmRGtA6.js";
|
|
2
|
-
const
|
|
2
|
+
const o = r(
|
|
3
3
|
[
|
|
4
4
|
"bg-transparent",
|
|
5
5
|
"border",
|
|
@@ -15,8 +15,6 @@ const t = r(
|
|
|
15
15
|
"py-1",
|
|
16
16
|
"rounded-md",
|
|
17
17
|
"shadow-sm",
|
|
18
|
-
"text-base",
|
|
19
|
-
"text-zinc-700",
|
|
20
18
|
"transition-colors",
|
|
21
19
|
"w-full"
|
|
22
20
|
],
|
|
@@ -39,5 +37,5 @@ const t = r(
|
|
|
39
37
|
}
|
|
40
38
|
);
|
|
41
39
|
export {
|
|
42
|
-
|
|
40
|
+
o as inputVariants
|
|
43
41
|
};
|
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { textAreaVariants as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
const
|
|
7
|
-
({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsxs as N, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as T, useId as j, useState as v, useCallback as A } from "react";
|
|
3
|
+
import { cn as I } from "../../utils/index.js";
|
|
4
|
+
import { textAreaVariants as V } from "./TextArea.variants.js";
|
|
5
|
+
import { useTheme as b } from "../../contexts/theme.hook.js";
|
|
6
|
+
const $ = T(
|
|
7
|
+
({
|
|
8
|
+
initialValue: o,
|
|
9
|
+
label: t,
|
|
10
|
+
name: l,
|
|
11
|
+
placeholder: c,
|
|
12
|
+
rows: i = 3,
|
|
13
|
+
theme: u,
|
|
14
|
+
onChange: e,
|
|
15
|
+
className: d
|
|
16
|
+
}, f) => {
|
|
17
|
+
const r = j(), { theme: x } = b(), s = l ? `${r}-name` : r, [n, p] = v(o ?? ""), h = A(
|
|
18
|
+
(a) => {
|
|
19
|
+
p(a.target.value), e == null || e(a);
|
|
11
20
|
},
|
|
12
21
|
[e]
|
|
13
22
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
t ? /* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ N("div", { className: "flex flex-col gap-2", children: [
|
|
24
|
+
t ? /* @__PURE__ */ m("label", { htmlFor: s, className: "cursor-pointer", children: t }) : null,
|
|
25
|
+
/* @__PURE__ */ m(
|
|
17
26
|
"textarea",
|
|
18
27
|
{
|
|
19
28
|
id: s,
|
|
20
|
-
ref:
|
|
21
|
-
className:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
ref: f,
|
|
30
|
+
className: I(
|
|
31
|
+
V({ className: d, theme: u ?? x })
|
|
32
|
+
),
|
|
33
|
+
rows: i,
|
|
34
|
+
placeholder: c,
|
|
35
|
+
value: n,
|
|
36
|
+
onChange: h
|
|
26
37
|
}
|
|
27
38
|
)
|
|
28
39
|
] });
|
|
29
40
|
}
|
|
30
41
|
);
|
|
31
42
|
export {
|
|
32
|
-
|
|
43
|
+
$ as TextArea
|
|
33
44
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ declare type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
|
162
162
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
163
163
|
|
|
164
164
|
declare interface InputProps extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
165
|
-
label?: string;
|
|
165
|
+
label?: string | ReactNode;
|
|
166
166
|
labelClassName?: string;
|
|
167
167
|
error?: string;
|
|
168
168
|
onClickIcon?: () => void;
|
|
@@ -491,10 +491,9 @@ export declare const TextArea: FC<TextAreaProps>;
|
|
|
491
491
|
|
|
492
492
|
declare interface TextAreaProps extends InputHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textAreaVariants> {
|
|
493
493
|
rows?: number;
|
|
494
|
-
label?: string;
|
|
494
|
+
label?: string | ReactNode;
|
|
495
495
|
name?: string;
|
|
496
496
|
initialValue?: string;
|
|
497
|
-
onChange?: () => void;
|
|
498
497
|
}
|
|
499
498
|
|
|
500
499
|
declare const textAreaVariants: (props?: ({
|
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.
|
|
5
|
+
"version": "0.0.12-alpha.4",
|
|
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.
|
|
5
|
+
"version": "0.0.12-alpha.5",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|