@oneplatformdev/ui 0.1.99-beta.33 → 0.1.99-beta.35
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## 0.1.99-beta.35 (2026-01-13)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **Accordion, DropdownMenu:** enhance className structure and improve styling ([c70c789](https://github.com/oneplatformdev/core-web/commit/c70c789))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated @oneplatformdev/utils to 0.1.99-beta.35
|
|
10
|
+
- Updated @oneplatformdev/hooks to 0.1.99-beta.35
|
|
11
|
+
- Updated @oneplatformdev/tokens to 0.1.99-beta.35
|
|
12
|
+
|
|
13
|
+
### ❤️ Thank You
|
|
14
|
+
|
|
15
|
+
- Bohdan Radchenko
|
|
16
|
+
|
|
17
|
+
## 0.1.99-beta.34 (2026-01-13)
|
|
18
|
+
|
|
19
|
+
### 🧱 Updated Dependencies
|
|
20
|
+
|
|
21
|
+
- Updated @oneplatformdev/utils to 0.1.99-beta.34
|
|
22
|
+
- Updated @oneplatformdev/hooks to 0.1.99-beta.34
|
|
23
|
+
- Updated @oneplatformdev/tokens to 0.1.99-beta.34
|
|
24
|
+
|
|
1
25
|
## 0.1.99-beta.33 (2026-01-13)
|
|
2
26
|
|
|
3
27
|
### 🧱 Updated Dependencies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../src/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../src/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,QAAA,MAAM,QAAQ,wGA2Eb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/Textarea/Textarea.js
CHANGED
|
@@ -1,73 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useAutosizeTextArea as
|
|
6
|
-
const
|
|
7
|
-
(
|
|
1
|
+
import { jsxs as d, Fragment as v, jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { useId as y, useRef as z, useState as F, useImperativeHandle as N, useEffect as T } from "react";
|
|
4
|
+
import { cn as f } from "@oneplatformdev/utils";
|
|
5
|
+
import { useAutosizeTextArea as C } from "./useAutosizeTextArea.js";
|
|
6
|
+
const R = w.forwardRef(
|
|
7
|
+
(m, c) => {
|
|
8
8
|
const {
|
|
9
|
-
className:
|
|
10
|
-
value:
|
|
11
|
-
maxHeight:
|
|
9
|
+
className: g,
|
|
10
|
+
value: r = "",
|
|
11
|
+
maxHeight: a = Number.MAX_SAFE_INTEGER,
|
|
12
12
|
minHeight: i = 40,
|
|
13
|
-
resizeble:
|
|
13
|
+
resizeble: x = !1,
|
|
14
14
|
counter: s = !1,
|
|
15
15
|
id: n = "",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
onChange: p,
|
|
17
|
+
onTransform: l,
|
|
18
|
+
...o
|
|
19
|
+
} = m, u = y(), t = z(null), [b, h] = F("");
|
|
20
|
+
return C({
|
|
21
|
+
textAreaRef: t,
|
|
22
|
+
triggerAutoSize: b,
|
|
23
|
+
maxHeight: a,
|
|
22
24
|
minHeight: i
|
|
23
|
-
}),
|
|
24
|
-
...
|
|
25
|
-
textArea:
|
|
26
|
-
focus: () =>
|
|
27
|
-
maxHeight:
|
|
25
|
+
}), N(c, () => ({
|
|
26
|
+
...t.current ?? {},
|
|
27
|
+
textArea: t.current,
|
|
28
|
+
focus: () => t?.current?.focus(),
|
|
29
|
+
maxHeight: a,
|
|
28
30
|
minHeight: i
|
|
29
|
-
})),
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
/* @__PURE__ */
|
|
31
|
+
})), T(() => {
|
|
32
|
+
h(r);
|
|
33
|
+
}, [o?.defaultValue, r]), /* @__PURE__ */ d(v, { children: [
|
|
34
|
+
/* @__PURE__ */ A(
|
|
33
35
|
"textarea",
|
|
34
36
|
{
|
|
35
|
-
id: n ||
|
|
36
|
-
...
|
|
37
|
-
ref:
|
|
38
|
-
value:
|
|
39
|
-
|
|
37
|
+
id: n || u,
|
|
38
|
+
...o,
|
|
39
|
+
ref: t,
|
|
40
|
+
value: r,
|
|
41
|
+
onChange: (e) => {
|
|
42
|
+
typeof l?.(e.target.value, e) == "string" && (e.target.value = l(e.target.value, e)), p?.(e);
|
|
43
|
+
},
|
|
44
|
+
className: f(
|
|
40
45
|
"flex min-h-10 w-full px-3 py-2 text-base relative md:text-sm",
|
|
41
46
|
"rounded-lg border border-input bg-[#FCFCFC] shadow-none",
|
|
42
47
|
"placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
43
48
|
"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring",
|
|
44
|
-
|
|
45
|
-
s && "pb-
|
|
46
|
-
|
|
49
|
+
x ? "resize" : "resize-none overflow-hidden!",
|
|
50
|
+
s && "pb-1",
|
|
51
|
+
g
|
|
47
52
|
)
|
|
48
53
|
}
|
|
49
54
|
),
|
|
50
|
-
s && /* @__PURE__ */
|
|
55
|
+
s && /* @__PURE__ */ d(
|
|
51
56
|
"label",
|
|
52
57
|
{
|
|
53
|
-
htmlFor: n ||
|
|
54
|
-
className:
|
|
58
|
+
htmlFor: n || u,
|
|
59
|
+
className: f(
|
|
55
60
|
"w-full text-right inline-flex items-center justify-end",
|
|
56
|
-
"text-
|
|
57
|
-
"
|
|
61
|
+
"text-xs font-medium leading-[1.2] text-muted-foreground",
|
|
62
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
58
63
|
),
|
|
59
64
|
children: [
|
|
60
|
-
String(
|
|
65
|
+
String(r || "").length,
|
|
61
66
|
" / ",
|
|
62
|
-
|
|
67
|
+
o?.maxLength
|
|
63
68
|
]
|
|
64
69
|
}
|
|
65
70
|
)
|
|
66
71
|
] });
|
|
67
72
|
}
|
|
68
73
|
);
|
|
69
|
-
|
|
74
|
+
R.displayName = "Textarea";
|
|
70
75
|
export {
|
|
71
|
-
|
|
76
|
+
R as Textarea
|
|
72
77
|
};
|
|
73
78
|
//# sourceMappingURL=Textarea.js.map
|
package/Textarea/Textarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../src/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useEffect, useId, useImperativeHandle, useRef, useState } from 'react';\nimport { cn } from '@oneplatformdev/utils';\n\nimport { TextareaProps } from './Textarea.types';\nimport { useAutosizeTextArea } from './useAutosizeTextArea';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (textareaProps, ref) => {\n const {\n className,\n value = '',\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 40,\n resizeble =
|
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../src/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useEffect, useId, useImperativeHandle, useRef, useState } from 'react';\nimport { cn } from '@oneplatformdev/utils';\n\nimport { TextareaProps } from './Textarea.types';\nimport { useAutosizeTextArea } from './useAutosizeTextArea';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (textareaProps, ref) => {\n const {\n className,\n value = '',\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 40,\n resizeble = false,\n counter = false,\n id: customId = '',\n onChange,\n onTransform,\n ...props\n } = textareaProps;\n const id = useId();\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const [triggerAutoSize, setTriggerAutoSize] = useState('');\n\n useAutosizeTextArea({\n textAreaRef,\n triggerAutoSize: triggerAutoSize,\n maxHeight,\n minHeight,\n });\n\n useImperativeHandle(ref, () => ({\n ...((textAreaRef.current ?? {}) as HTMLTextAreaElement),\n textArea: textAreaRef.current as HTMLTextAreaElement,\n focus: () => textAreaRef?.current?.focus(),\n maxHeight,\n minHeight,\n }));\n\n useEffect(() => {\n setTriggerAutoSize(value as string);\n }, [props?.defaultValue, value]);\n\n return (\n <>\n <textarea\n id={customId || id}\n {...props}\n ref={textAreaRef}\n value={value}\n onChange={(e) => {\n if (typeof onTransform?.(e.target.value, e) === 'string') {\n e.target.value = onTransform(e.target.value, e);\n }\n onChange?.(e);\n }}\n className={cn(\n 'flex min-h-10 w-full px-3 py-2 text-base relative md:text-sm',\n 'rounded-lg border border-input bg-[#FCFCFC] shadow-none',\n 'placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n 'focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring',\n resizeble ? 'resize' : 'resize-none overflow-hidden!',\n counter && 'pb-1',\n className\n )}\n />\n {counter && (\n <label\n htmlFor={customId || id}\n className={cn(\n 'w-full text-right inline-flex items-center justify-end',\n 'text-xs font-medium leading-[1.2] text-muted-foreground',\n 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n )}\n >\n {String(value || '').length} / {props?.maxLength}\n </label>\n )}\n </>\n );\n }\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n"],"names":["Textarea","React","textareaProps","ref","className","value","maxHeight","minHeight","resizeble","counter","customId","onChange","onTransform","props","id","useId","textAreaRef","useRef","triggerAutoSize","setTriggerAutoSize","useState","useAutos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AAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACAnB,IAAY,WAAW;AAAA,YACvBC,KAAW;AAAA,YACXL;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,MAEDK,KACC,gBAAAe;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASd,KAAYI;AAAA,UACrB,WAAWa;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,UAGD,UAAA;AAAA,YAAA,OAAOtB,KAAS,EAAE,EAAE;AAAA,YAAO;AAAA,YAAIQ,GAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACzC,GAEJ;AAAA,EAEJ;AACF;AACAb,EAAS,cAAc;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps, RefObject } from 'react';
|
|
1
|
+
import { ChangeEvent, ComponentProps, RefObject } from 'react';
|
|
2
2
|
export interface IUseAutosizeTextAreaProps {
|
|
3
3
|
textAreaRef: RefObject<HTMLTextAreaElement | null>;
|
|
4
4
|
triggerAutoSize: string;
|
|
@@ -14,5 +14,7 @@ export interface IUseAutosizeTextAreaProps {
|
|
|
14
14
|
export interface TextareaProps extends ComponentProps<'textarea'>, Pick<IUseAutosizeTextAreaProps, 'minHeight' | 'maxHeight'> {
|
|
15
15
|
resizeble?: boolean;
|
|
16
16
|
counter?: boolean;
|
|
17
|
+
/** func transform event.target.value before onChange event call*/
|
|
18
|
+
onTransform?: (value: string, event: ChangeEvent<HTMLInputElement>) => string;
|
|
17
19
|
}
|
|
18
20
|
//# sourceMappingURL=Textarea.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.types.d.ts","sourceRoot":"","sources":["../../src/Textarea/Textarea.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Textarea.types.d.ts","sourceRoot":"","sources":["../../src/Textarea/Textarea.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/D,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aACf,SAAQ,cAAc,CAAC,UAAU,CAAC,EAChC,IAAI,CAAC,yBAAyB,EAAE,WAAW,GAAG,WAAW,CAAC;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;CAC/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/ui",
|
|
3
|
-
"version": "0.1.99-beta.
|
|
3
|
+
"version": "0.1.99-beta.35",
|
|
4
4
|
"description": "UI component library for OnePlatform",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"recharts": "^3.2.0",
|
|
106
106
|
"sonner": "^2.0.7",
|
|
107
107
|
"vaul": "^1.1.2",
|
|
108
|
-
"@oneplatformdev/tokens": "^0.1.99-beta.
|
|
109
|
-
"@oneplatformdev/
|
|
110
|
-
"@oneplatformdev/
|
|
108
|
+
"@oneplatformdev/tokens": "^0.1.99-beta.35",
|
|
109
|
+
"@oneplatformdev/hooks": "^0.1.99-beta.35",
|
|
110
|
+
"@oneplatformdev/utils": "^0.1.99-beta.35"
|
|
111
111
|
},
|
|
112
112
|
"scripts": {
|
|
113
113
|
"chromatic": "chromatic"
|