@oneplatformdev/ui 0.1.99-beta.34 → 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,19 @@
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
+
1
17
  ## 0.1.99-beta.34 (2026-01-13)
2
18
 
3
19
  ### 🧱 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,wGAmEb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
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"}
@@ -1,73 +1,78 @@
1
- import { jsxs as n, Fragment as p, jsx as b } from "react/jsx-runtime";
2
- import * as h from "react";
3
- import { useId as A, useRef as v, useState as w, useImperativeHandle as z, useEffect as F } from "react";
4
- import { cn as d } from "@oneplatformdev/utils";
5
- import { useAutosizeTextArea as N } from "./useAutosizeTextArea.js";
6
- const y = h.forwardRef(
7
- (u, m) => {
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: c,
10
- value: t = "",
11
- maxHeight: i = Number.MAX_SAFE_INTEGER,
12
- minHeight: o = 40,
13
- resizeble: f = !1,
9
+ className: g,
10
+ value: r = "",
11
+ maxHeight: a = Number.MAX_SAFE_INTEGER,
12
+ minHeight: i = 40,
13
+ resizeble: x = !1,
14
14
  counter: s = !1,
15
- id: a = "",
16
- ...r
17
- } = u, l = A(), e = v(null), [x, g] = w("");
18
- return N({
19
- textAreaRef: e,
20
- triggerAutoSize: x,
21
- maxHeight: i,
22
- minHeight: o
23
- }), z(m, () => ({
24
- ...e.current ?? {},
25
- textArea: e.current,
26
- focus: () => e?.current?.focus(),
27
- maxHeight: i,
28
- minHeight: o
29
- })), F(() => {
30
- g(t);
31
- }, [r?.defaultValue, t]), /* @__PURE__ */ n(p, { children: [
32
- /* @__PURE__ */ b(
15
+ id: n = "",
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,
24
+ minHeight: i
25
+ }), N(c, () => ({
26
+ ...t.current ?? {},
27
+ textArea: t.current,
28
+ focus: () => t?.current?.focus(),
29
+ maxHeight: a,
30
+ minHeight: i
31
+ })), T(() => {
32
+ h(r);
33
+ }, [o?.defaultValue, r]), /* @__PURE__ */ d(v, { children: [
34
+ /* @__PURE__ */ A(
33
35
  "textarea",
34
36
  {
35
- id: a || l,
36
- ...r,
37
- ref: e,
38
- value: t,
39
- className: d(
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
- f ? "resize" : "resize-none overflow-hidden!",
49
+ x ? "resize" : "resize-none overflow-hidden!",
45
50
  s && "pb-1",
46
- c
51
+ g
47
52
  )
48
53
  }
49
54
  ),
50
- s && /* @__PURE__ */ n(
55
+ s && /* @__PURE__ */ d(
51
56
  "label",
52
57
  {
53
- htmlFor: a || l,
54
- className: d(
58
+ htmlFor: n || u,
59
+ className: f(
55
60
  "w-full text-right inline-flex items-center justify-end",
56
61
  "text-xs font-medium leading-[1.2] text-muted-foreground",
57
62
  "peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
58
63
  ),
59
64
  children: [
60
- String(t || "").length,
65
+ String(r || "").length,
61
66
  " / ",
62
- r?.maxLength
67
+ o?.maxLength
63
68
  ]
64
69
  }
65
70
  )
66
71
  ] });
67
72
  }
68
73
  );
69
- y.displayName = "Textarea";
74
+ R.displayName = "Textarea";
70
75
  export {
71
- y as Textarea
76
+ R as Textarea
72
77
  };
73
78
  //# sourceMappingURL=Textarea.js.map
@@ -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 = false,\n counter = false,\n id: customId = '',\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 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","props","id","useId","textAreaRef","useRef","triggerAutoSize","setTriggerAutoSize","useState","useAutosizeTextArea","useImperativeHandle","useEffect","jsxs","Fragment","jsx","cn"],"mappings":";;;;;AAOA,M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,UAGD,UAAA;AAAA,YAAA,OAAOpB,KAAS,EAAE,EAAE;AAAA,YAAO;AAAA,YAAIM,GAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACzC,GAEJ;AAAA,EAEJ;AACF;AACAX,EAAS,cAAc;"}
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","useAutosizeTextArea","useImperativeHandle","useEffect","jsxs","Fragment","jsx","cn"],"mappings":";;;;;AAOA,MAAMA,IAAWC,EAAM;AAAA,EACrB,CAACC,GAAeC,MAAQ;AACtB,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,OAAAC,IAAQ;AAAA,MACR,WAAAC,IAAY,OAAO;AAAA,MACnB,WAAAC,IAAY;AAAA,MACZ,WAAAC,IAAY;AAAA,MACZ,SAAAC,IAAU;AAAA,MACV,IAAIC,IAAW;AAAA,MACf,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDX,GACEY,IAAKC,EAAA,GACLC,IAAcC,EAAmC,IAAI,GACrD,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAE;AAEzD,WAAAC,EAAoB;AAAA,MAClB,aAAAL;AAAA,MACA,iBAAAE;AAAA,MACA,WAAAZ;AAAA,MACA,WAAAC;AAAA,IAAA,CACD,GAEDe,EAAoBnB,GAAK,OAAO;AAAA,MAC9B,GAAKa,EAAY,WAAW,CAAA;AAAA,MAC5B,UAAUA,EAAY;AAAA,MACtB,OAAO,MAAMA,GAAa,SAAS,MAAA;AAAA,MACnC,WAAAV;AAAA,MACA,WAAAC;AAAA,IAAA,EACA,GAEFgB,EAAU,MAAM;AACd,MAAAJ,EAAmBd,CAAe;AAAA,IACpC,GAAG,CAACQ,GAAO,cAAcR,CAAK,CAAC,GAG7B,gBAAAmB,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAIhB,KAAYI;AAAA,UACf,GAAGD;AAAA,UACJ,KAAKG;AAAA,UACL,OAAAX;AAAA,UACA,UAAU,CAAC,MAAM;AACf,YAAI,OAAOO,IAAc,EAAE,OAAO,OAAO,CAAC,KAAM,aAC9C,EAAE,OAAO,QAAQA,EAAY,EAAE,OAAO,OAAO,CAAC,IAEhDD,IAAW,CAAC;AAAA,UACd;AAAA,UACA,WAAWgB;AAAA,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;AAElD,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;CACnB"}
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.34",
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/hooks": "^0.1.99-beta.34",
109
- "@oneplatformdev/utils": "^0.1.99-beta.34",
110
- "@oneplatformdev/tokens": "^0.1.99-beta.34"
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"