@oneplatformdev/ui 0.1.99-beta.1 → 0.1.99-beta.11

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.
Files changed (53) hide show
  1. package/.storybook/Wrappers.js +30 -0
  2. package/.storybook/Wrappers.js.map +1 -0
  3. package/Badge/badgeVariants.d.ts +1 -1
  4. package/Button/Button.d.ts +58 -0
  5. package/Button/Button.d.ts.map +1 -1
  6. package/Button/Button.js +60 -61
  7. package/Button/Button.js.map +1 -1
  8. package/Button/Button.stories.js +207 -70
  9. package/Button/Button.stories.js.map +1 -1
  10. package/Button/Button.types.d.ts +52 -6
  11. package/Button/Button.types.d.ts.map +1 -1
  12. package/Button/ButtonCounterBadge.d.ts +7 -0
  13. package/Button/ButtonCounterBadge.d.ts.map +1 -0
  14. package/Button/ButtonCounterBadge.js +23 -0
  15. package/Button/ButtonCounterBadge.js.map +1 -0
  16. package/Button/buttonVariants.d.ts +12 -29
  17. package/Button/buttonVariants.d.ts.map +1 -1
  18. package/Button/buttonVariants.js +74 -12
  19. package/Button/buttonVariants.js.map +1 -1
  20. package/Button/index.js +6 -5
  21. package/ButtonIcon/ButtonIcon.d.ts +56 -0
  22. package/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  23. package/ButtonIcon/ButtonIcon.js +70 -45
  24. package/ButtonIcon/ButtonIcon.js.map +1 -1
  25. package/ButtonIcon/ButtonIcon.stories.js +127 -79
  26. package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
  27. package/ButtonIcon/ButtonIcon.types.d.ts +6 -8
  28. package/ButtonIcon/ButtonIcon.types.d.ts.map +1 -1
  29. package/ButtonIcon/buttonIconVariants.d.ts +4 -2
  30. package/ButtonIcon/buttonIconVariants.d.ts.map +1 -1
  31. package/ButtonIcon/buttonIconVariants.js +5 -5
  32. package/ButtonIcon/buttonIconVariants.js.map +1 -1
  33. package/CHANGELOG.md +147 -0
  34. package/Input/Input.d.ts.map +1 -1
  35. package/Input/Input.js +51 -38
  36. package/Input/Input.js.map +1 -1
  37. package/Input/Input.types.d.ts +1 -0
  38. package/Input/Input.types.d.ts.map +1 -1
  39. package/LoadedIcon/LoadedIcon.d.ts +1 -1
  40. package/LoadedIcon/LoadedIcon.d.ts.map +1 -1
  41. package/LoadedIcon/LoadedIcon.js +17 -13
  42. package/LoadedIcon/LoadedIcon.js.map +1 -1
  43. package/Textarea/Textarea.js +6 -6
  44. package/Textarea/Textarea.js.map +1 -1
  45. package/Textarea/Textarea.stories.js +12 -0
  46. package/Textarea/Textarea.stories.js.map +1 -0
  47. package/Textarea/useAutosizeTextArea.d.ts +1 -1
  48. package/Textarea/useAutosizeTextArea.d.ts.map +1 -1
  49. package/Textarea/useAutosizeTextArea.js.map +1 -1
  50. package/Tooltip/Tooltip.d.ts.map +1 -1
  51. package/Tooltip/Tooltip.js.map +1 -1
  52. package/index.js +326 -325
  53. package/package.json +7 -4
package/CHANGELOG.md CHANGED
@@ -1,3 +1,150 @@
1
+ ## 0.1.99-beta.11 (2026-01-02)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **Button:** add counter badge support and update variant types for consistency ([cb6b0da](https://github.com/oneplatformdev/core-web/commit/cb6b0da))
6
+ - **ButtonIcon:** add screen reader text for improved accessibility ([465e76f](https://github.com/oneplatformdev/core-web/commit/465e76f))
7
+
8
+ ### 🩹 Fixes
9
+
10
+ - **ButtonIcon:** adjust padding for large size variant ([21042cd](https://github.com/oneplatformdev/core-web/commit/21042cd))
11
+
12
+ ### 🧱 Updated Dependencies
13
+
14
+ - Updated @oneplatformdev/utils to 0.1.99-beta.11
15
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.11
16
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.11
17
+
18
+ ### ❤️ Thank You
19
+
20
+ - Bohdan Radchenko
21
+
22
+ ## 0.1.99-beta.10 (2025-12-30)
23
+
24
+ ### 🚀 Features
25
+
26
+ - **Button:** add screen reader text rendering for accessibility ([e168003](https://github.com/oneplatformdev/core-web/commit/e168003))
27
+
28
+ ### 🧱 Updated Dependencies
29
+
30
+ - Updated @oneplatformdev/utils to 0.1.99-beta.10
31
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.10
32
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.10
33
+
34
+ ### ❤️ Thank You
35
+
36
+ - Bohdan Radchenko
37
+
38
+ ## 0.1.99-beta.9 (2025-12-30)
39
+
40
+ ### 🩹 Fixes
41
+
42
+ - **Button:** update documentation links for Button and ButtonIcon components ([cfa993f](https://github.com/oneplatformdev/core-web/commit/cfa993f))
43
+
44
+ ### 🧱 Updated Dependencies
45
+
46
+ - Updated @oneplatformdev/utils to 0.1.99-beta.9
47
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.9
48
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.9
49
+
50
+ ### ❤️ Thank You
51
+
52
+ - Bohdan Radchenko
53
+
54
+ ## 0.1.99-beta.8 (2025-12-30)
55
+
56
+ ### 🚀 Features
57
+
58
+ - **Textarea:** update styles and add new story for Textarea component ([9bafda1](https://github.com/oneplatformdev/core-web/commit/9bafda1))
59
+ - **Button:** add screen reader text options for improved accessibility ([9b93d9d](https://github.com/oneplatformdev/core-web/commit/9b93d9d))
60
+
61
+ ### 🧱 Updated Dependencies
62
+
63
+ - Updated @oneplatformdev/utils to 0.1.99-beta.8
64
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.8
65
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.8
66
+
67
+ ### ❤️ Thank You
68
+
69
+ - Bohdan Radchenko
70
+
71
+ ## 0.1.99-beta.7 (2025-12-29)
72
+
73
+ ### 🚀 Features
74
+
75
+ - **Button:** add screen reader support for accessibility ([ec7de8e](https://github.com/oneplatformdev/core-web/commit/ec7de8e))
76
+
77
+ ### 🧱 Updated Dependencies
78
+
79
+ - Updated @oneplatformdev/utils to 0.1.99-beta.7
80
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.7
81
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.7
82
+
83
+ ### ❤️ Thank You
84
+
85
+ - Bohdan Radchenko
86
+
87
+ ## 0.1.99-beta.6 (2025-12-29)
88
+
89
+ ### 🚀 Features
90
+
91
+ - **ButtonIcon:** introduce icon-only variant with enhanced props and storybook support ([d643217](https://github.com/oneplatformdev/core-web/commit/d643217))
92
+ - **Button:** add storybook integration with loading and tooltip support ([72ae45e](https://github.com/oneplatformdev/core-web/commit/72ae45e))
93
+
94
+ ### 🧱 Updated Dependencies
95
+
96
+ - Updated @oneplatformdev/utils to 0.1.99-beta.6
97
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.6
98
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.6
99
+
100
+ ### ❤️ Thank You
101
+
102
+ - Bohdan Radchenko
103
+
104
+ ## 0.1.99-beta.5 (2025-12-29)
105
+
106
+ ### 🧱 Updated Dependencies
107
+
108
+ - Updated @oneplatformdev/utils to 0.1.99-beta.5
109
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.5
110
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.5
111
+
112
+ ## 0.1.99-beta.4 (2025-12-29)
113
+
114
+ ### 🧱 Updated Dependencies
115
+
116
+ - Updated @oneplatformdev/utils to 0.1.99-beta.4
117
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.4
118
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.4
119
+
120
+ ## 0.1.99-beta.3 (2025-12-29)
121
+
122
+ ### 🚀 Features
123
+
124
+ - **Button:** add storybook integration with loading and tooltip support ([e7a2e21](https://github.com/oneplatformdev/core-web/commit/e7a2e21))
125
+
126
+ ### 🩹 Fixes
127
+
128
+ - **Button:** update tooltip handling and remove deprecated size variants ([de56165](https://github.com/oneplatformdev/core-web/commit/de56165))
129
+
130
+ ### 🧱 Updated Dependencies
131
+
132
+ - Updated @oneplatformdev/utils to 0.1.99-beta.3
133
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.3
134
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.3
135
+
136
+ ### ❤️ Thank You
137
+
138
+ - Bohdan Radchenko
139
+
140
+ ## 0.1.99-beta.2 (2025-12-29)
141
+
142
+ ### 🧱 Updated Dependencies
143
+
144
+ - Updated @oneplatformdev/utils to 0.1.99-beta.2
145
+ - Updated @oneplatformdev/hooks to 0.1.99-beta.2
146
+ - Updated @oneplatformdev/tokens to 0.1.99-beta.2
147
+
1
148
  ## 0.1.99-beta.1 (2025-12-29)
2
149
 
3
150
  ### 🩹 Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAO,MAAM,SAAS,qFA2CrB,CAAC;AAGF,eAAO,MAAM,aAAa,qFAiBzB,CAAC;AAkBF,eAAO,MAAM,KAAK,qFAKjB,CAAC"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAO,MAAM,SAAS,qFAmDrB,CAAC;AAGF,eAAO,MAAM,aAAa,qFAiBzB,CAAC;AAkBF,eAAO,MAAM,KAAK,qFAKjB,CAAC"}
package/Input/Input.js CHANGED
@@ -1,73 +1,86 @@
1
- import { jsxs as N, jsx as s } from "react/jsx-runtime";
2
- import c, { useState as b } from "react";
3
- import { Eye as v, EyeOff as h } from "lucide-react";
4
- import { inputVariants as P } from "./inputVariants.js";
1
+ import { jsxs as w, jsx as s } from "react/jsx-runtime";
2
+ import u, { useState as v } from "react";
3
+ import { Eye as h, EyeOff as P } from "lucide-react";
4
+ import { inputVariants as x } from "./inputVariants.js";
5
5
  import { cn as p } from "@oneplatformdev/utils";
6
- const m = c.forwardRef(
6
+ const m = u.forwardRef(
7
7
  (t, a) => {
8
8
  const {
9
9
  className: e,
10
10
  variant: o,
11
11
  type: n,
12
- slotProps: { input: l, wrapper: u } = {},
12
+ slotProps: { input: l, wrapper: c } = {},
13
13
  onChange: f,
14
14
  onTransform: d,
15
- ...w
15
+ fullSize: N = !1,
16
+ ...g
16
17
  } = t, {
17
18
  startAdornment: i,
18
- className: g,
19
- ...I
19
+ className: I,
20
+ ...b
20
21
  } = l || {};
21
- return /* @__PURE__ */ N("div", { ...u || {}, className: p("relative", u?.className), children: [
22
- !!i && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: i }),
23
- /* @__PURE__ */ s(
24
- "input",
25
- {
26
- type: n,
27
- className: p(
28
- P({ variant: o, className: e }),
29
- !!i && "pl-8",
30
- g
31
- ),
32
- ref: a,
33
- ...I,
34
- ...w,
35
- onChange: (r) => {
36
- typeof d?.(r.target.value, r) == "string" && (r.target.value = d(r.target.value, r)), f && f(r);
37
- }
38
- }
39
- )
40
- ] });
22
+ return /* @__PURE__ */ w(
23
+ "div",
24
+ {
25
+ ...c || {},
26
+ className: p(
27
+ "relative",
28
+ N && "w-full",
29
+ c?.className
30
+ ),
31
+ children: [
32
+ !!i && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: i }),
33
+ /* @__PURE__ */ s(
34
+ "input",
35
+ {
36
+ type: n,
37
+ className: p(
38
+ x({ variant: o, className: e }),
39
+ !!i && "pl-8",
40
+ I,
41
+ N && "min-w-auto"
42
+ ),
43
+ ref: a,
44
+ ...b,
45
+ ...g,
46
+ onChange: (r) => {
47
+ typeof d?.(r.target.value, r) == "string" && (r.target.value = d(r.target.value, r)), f && f(r);
48
+ }
49
+ }
50
+ )
51
+ ]
52
+ }
53
+ );
41
54
  }
42
55
  );
43
56
  m.displayName = "Input";
44
- const y = c.forwardRef(
57
+ const y = u.forwardRef(
45
58
  (t, a) => {
46
- const [e, o] = b(!1), n = e ? "text" : "password", l = () => {
59
+ const [e, o] = v(!1), n = e ? "text" : "password", l = () => {
47
60
  o(!e);
48
61
  };
49
- return /* @__PURE__ */ N("div", { ...t?.slotProps?.wrapper || {}, className: p("relative", t?.slotProps?.wrapper?.className), children: [
62
+ return /* @__PURE__ */ w("div", { ...t?.slotProps?.wrapper || {}, className: p("relative", t?.slotProps?.wrapper?.className), children: [
50
63
  /* @__PURE__ */ s(m, { ...t, type: n, className: "pr-8", ref: a }),
51
- /* @__PURE__ */ s(x, { isVisible: e, onClick: l })
64
+ /* @__PURE__ */ s(V, { isVisible: e, onClick: l })
52
65
  ] });
53
66
  }
54
67
  );
55
68
  y.displayName = "PasswordInput";
56
- const x = ({ isVisible: t, onClick: a }) => /* @__PURE__ */ s(
69
+ const V = ({ isVisible: t, onClick: a }) => /* @__PURE__ */ s(
57
70
  "button",
58
71
  {
59
72
  type: "button",
60
73
  onClick: a,
61
74
  className: "absolute top-1/2 right-3 transform -translate-y-1/2",
62
- children: t ? /* @__PURE__ */ s(v, { size: 16 }) : /* @__PURE__ */ s(h, { size: 16 })
75
+ children: t ? /* @__PURE__ */ s(h, { size: 16 }) : /* @__PURE__ */ s(P, { size: 16 })
63
76
  }
64
- ), V = c.forwardRef(
77
+ ), B = u.forwardRef(
65
78
  ({ type: t, ...a }, e) => t === "password" ? /* @__PURE__ */ s(y, { type: t, ...a, ref: e }) : /* @__PURE__ */ s(m, { type: t, ...a, ref: e })
66
79
  );
67
- V.displayName = "Input";
80
+ B.displayName = "Input";
68
81
  export {
69
82
  m as BaseInput,
70
- V as Input,
83
+ B as Input,
71
84
  y as PasswordInput
72
85
  };
73
86
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { inputVariants } from './inputVariants';\n\nimport { cn } from '@oneplatformdev/utils';\nimport { InputProps } from './Input.types';\n\nexport const BaseInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n className,\n variant,\n type,\n slotProps: { input, wrapper } = {},\n onChange,\n onTransform,\n ...rest\n } = props;\n const {\n startAdornment,\n className: classNameInputSlotProps,\n ...restInputSlotProps\n } = input || {};\n return (\n <div {...(wrapper || {})} className={cn('relative', wrapper?.className)}>\n {Boolean(startAdornment) && (\n <span className=\"absolute left-[10px] top-1/2 -translate-y-1/2\">\n {startAdornment}\n </span>\n )}\n <input\n type={type}\n className={cn(\n inputVariants({ variant, className }),\n Boolean(startAdornment) && 'pl-8',\n classNameInputSlotProps\n )}\n ref={ref}\n {...restInputSlotProps}\n {...rest}\n onChange={(e) => {\n if (typeof onTransform?.(e.target.value, e) === 'string') {\n e.target.value = onTransform(e.target.value, e);\n }\n if (onChange) onChange(e);\n }}\n />\n </div>\n );\n }\n);\nBaseInput.displayName = 'Input';\n\nexport const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const [isVisible, setIsVisible] = useState<boolean>(false);\n\n const inputType = isVisible ? 'text' : 'password';\n\n const toggleVisibility = () => {\n setIsVisible(!isVisible);\n };\n\n return (\n <div {...(props?.slotProps?.wrapper || {})} className={cn('relative', props?.slotProps?.wrapper?.className)}>\n <BaseInput {...props} type={inputType} className=\"pr-8\" ref={ref} />\n <VisibilityButton isVisible={isVisible} onClick={toggleVisibility} />\n </div>\n );\n }\n);\nPasswordInput.displayName = 'PasswordInput';\n\ntype VisibilityButtonProps = {\n isVisible: boolean\n onClick: () => void\n}\n\nconst VisibilityButton = ({ isVisible, onClick }:VisibilityButtonProps) => (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"absolute top-1/2 right-3 transform -translate-y-1/2\"\n >\n {isVisible ? <Eye size={16} /> : <EyeOff size={16} />}\n </button>\n);\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ type, ...props }, ref) => {\n if (type === 'password') return <PasswordInput type={type} {...props} ref={ref} />;\n return <BaseInput type={type} {...props} ref={ref} />;\n }\n);\nInput.displayName = 'Input';\n"],"names":["BaseInput","React","props","ref","className","variant","type","input","wrapper","onChange","onTransform","rest","startAdornment","classNameInputSlotProps","restInputSlotProps","jsxs","cn","jsx","inputVariants","e","PasswordInput","isVisible","setIsVisible","useState","inputType","toggleVisibility","VisibilityButton","onClick","Eye","EyeOff","Input"],"mappings":";;;;;AAOO,MAAMA,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAW,EAAE,OAAAC,GAAO,SAAAC,EAAA,IAAY,CAAA;AAAA,MAChC,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDT,GACE;AAAA,MACJ,gBAAAU;AAAA,MACA,WAAWC;AAAA,MACX,GAAGC;AAAA,IAAA,IACDP,KAAS,CAAA;AACb,WACE,gBAAAQ,EAAC,OAAA,EAAK,GAAIP,KAAW,CAAA,GAAK,WAAWQ,EAAG,YAAYR,GAAS,SAAS,GACnE,UAAA;AAAA,MAAA,EAAQI,KACP,gBAAAK,EAAC,QAAA,EAAK,WAAU,iDACb,UAAAL,GACH;AAAA,MAEF,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAAX;AAAA,UACA,WAAWU;AAAA,YACTE,EAAc,EAAE,SAAAb,GAAS,WAAAD,GAAW;AAAA,YACpC,EAAQQ,KAAmB;AAAA,YAC3BC;AAAA,UAAA;AAAA,UAEF,KAAAV;AAAA,UACC,GAAGW;AAAA,UACH,GAAGH;AAAA,UACJ,UAAU,CAACQ,MAAM;AACf,YAAI,OAAOT,IAAcS,EAAE,OAAO,OAAOA,CAAC,KAAM,aAC9CA,EAAE,OAAO,QAAQT,EAAYS,EAAE,OAAO,OAAOA,CAAC,IAE5CV,OAAmBU,CAAC;AAAA,UAC1B;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAEJ;AACF;AACAnB,EAAU,cAAc;AAEjB,MAAMoB,IAAgBnB,EAAM;AAAA,EACjC,CAACC,GAAOC,MAAQ;AACd,UAAM,CAACkB,GAAWC,CAAY,IAAIC,EAAkB,EAAK,GAEnDC,IAAYH,IAAY,SAAS,YAEjCI,IAAmB,MAAM;AAC7B,MAAAH,EAAa,CAACD,CAAS;AAAA,IACzB;AAEA,WACE,gBAAAN,EAAC,OAAA,EAAK,GAAIb,GAAO,WAAW,WAAW,CAAA,GAAK,WAAWc,EAAG,YAAYd,GAAO,WAAW,SAAS,SAAS,GACxG,UAAA;AAAA,MAAA,gBAAAe,EAACjB,KAAW,GAAGE,GAAO,MAAMsB,GAAW,WAAU,QAAO,KAAArB,GAAU;AAAA,MAClE,gBAAAc,EAACS,GAAA,EAAiB,WAAAL,GAAsB,SAASI,EAAA,CAAkB;AAAA,IAAA,GACrE;AAAA,EAEJ;AACF;AACAL,EAAc,cAAc;AAO5B,MAAMM,IAAmB,CAAC,EAAE,WAAAL,GAAW,SAAAM,QACrC,gBAAAV;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAAU;AAAA,IACA,WAAU;AAAA,IAET,UAAAN,sBAAaO,GAAA,EAAI,MAAM,IAAI,IAAK,gBAAAX,EAACY,GAAA,EAAO,MAAM,GAAA,CAAI;AAAA,EAAA;AACrD,GAGWC,IAAQ7B,EAAM;AAAA,EACzB,CAAC,EAAE,MAAAK,GAAM,GAAGJ,EAAA,GAASC,MACfG,MAAS,aAAmB,gBAAAW,EAACG,KAAc,MAAAd,GAAa,GAAGJ,GAAO,KAAAC,GAAU,IACzE,gBAAAc,EAACjB,GAAA,EAAU,MAAAM,GAAa,GAAGJ,GAAO,KAAAC,GAAU;AAEvD;AACA2B,EAAM,cAAc;"}
1
+ {"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { inputVariants } from './inputVariants';\n\nimport { cn } from '@oneplatformdev/utils';\nimport { InputProps } from './Input.types';\n\nexport const BaseInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n className,\n variant,\n type,\n slotProps: { input, wrapper } = {},\n onChange,\n onTransform,\n fullSize = false,\n ...rest\n } = props;\n const {\n startAdornment,\n className: classNameInputSlotProps,\n ...restInputSlotProps\n } = input || {};\n return (\n <div\n {...(wrapper || {})}\n className={cn(\n 'relative',\n fullSize && 'w-full',\n wrapper?.className\n )}>\n {Boolean(startAdornment) && (\n <span className=\"absolute left-[10px] top-1/2 -translate-y-1/2\">\n {startAdornment}\n </span>\n )}\n <input\n type={type}\n className={cn(\n inputVariants({ variant, className }),\n Boolean(startAdornment) && 'pl-8',\n classNameInputSlotProps,\n fullSize && 'min-w-auto',\n )}\n ref={ref}\n {...restInputSlotProps}\n {...rest}\n onChange={(e) => {\n if (typeof onTransform?.(e.target.value, e) === 'string') {\n e.target.value = onTransform(e.target.value, e);\n }\n if (onChange) onChange(e);\n }}\n />\n </div>\n );\n }\n);\nBaseInput.displayName = 'Input';\n\nexport const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const [isVisible, setIsVisible] = useState<boolean>(false);\n\n const inputType = isVisible ? 'text' : 'password';\n\n const toggleVisibility = () => {\n setIsVisible(!isVisible);\n };\n\n return (\n <div {...(props?.slotProps?.wrapper || {})} className={cn('relative', props?.slotProps?.wrapper?.className)}>\n <BaseInput {...props} type={inputType} className=\"pr-8\" ref={ref} />\n <VisibilityButton isVisible={isVisible} onClick={toggleVisibility} />\n </div>\n );\n }\n);\nPasswordInput.displayName = 'PasswordInput';\n\ntype VisibilityButtonProps = {\n isVisible: boolean\n onClick: () => void\n}\n\nconst VisibilityButton = ({ isVisible, onClick }:VisibilityButtonProps) => (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"absolute top-1/2 right-3 transform -translate-y-1/2\"\n >\n {isVisible ? <Eye size={16} /> : <EyeOff size={16} />}\n </button>\n);\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ type, ...props }, ref) => {\n if (type === 'password') return <PasswordInput type={type} {...props} ref={ref} />;\n return <BaseInput type={type} {...props} ref={ref} />;\n }\n);\nInput.displayName = 'Input';\n"],"names":["BaseInput","React","props","ref","className","variant","type","input","wrapper","onChange","onTransform","fullSize","rest","startAdornment","classNameInputSlotProps","restInputSlotProps","jsxs","cn","jsx","inputVariants","e","PasswordInput","isVisible","setIsVisible","useState","inputType","toggleVisibility","VisibilityButton","onClick","Eye","EyeOff","Input"],"mappings":";;;;;AAOO,MAAMA,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAW,EAAE,OAAAC,GAAO,SAAAC,EAAA,IAAY,CAAA;AAAA,MAChC,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,UAAAC,IAAW;AAAA,MACX,GAAGC;AAAA,IAAA,IACDV,GACE;AAAA,MACJ,gBAAAW;AAAA,MACA,WAAWC;AAAA,MACX,GAAGC;AAAA,IAAA,IACDR,KAAS,CAAA;AACb,WACE,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAIR,KAAW,CAAA;AAAA,QAChB,WAAWS;AAAA,UACT;AAAA,UACAN,KAAY;AAAA,UACZH,GAAS;AAAA,QAAA;AAAA,QAEV,UAAA;AAAA,UAAA,EAAQK,KACP,gBAAAK,EAAC,QAAA,EAAK,WAAU,iDACb,UAAAL,GACH;AAAA,UAEF,gBAAAK;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAAZ;AAAA,cACA,WAAWW;AAAA,gBACTE,EAAc,EAAE,SAAAd,GAAS,WAAAD,GAAW;AAAA,gBACpC,EAAQS,KAAmB;AAAA,gBAC3BC;AAAA,gBACAH,KAAY;AAAA,cAAA;AAAA,cAEd,KAAAR;AAAA,cACC,GAAGY;AAAA,cACH,GAAGH;AAAA,cACJ,UAAU,CAACQ,MAAM;AACf,gBAAI,OAAOV,IAAcU,EAAE,OAAO,OAAOA,CAAC,KAAM,aAC9CA,EAAE,OAAO,QAAQV,EAAYU,EAAE,OAAO,OAAOA,CAAC,IAE5CX,OAAmBW,CAAC;AAAA,cAC1B;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACApB,EAAU,cAAc;AAEjB,MAAMqB,IAAgBpB,EAAM;AAAA,EACjC,CAACC,GAAOC,MAAQ;AACd,UAAM,CAACmB,GAAWC,CAAY,IAAIC,EAAkB,EAAK,GAEnDC,IAAYH,IAAY,SAAS,YAEjCI,IAAmB,MAAM;AAC7B,MAAAH,EAAa,CAACD,CAAS;AAAA,IACzB;AAEA,WACE,gBAAAN,EAAC,OAAA,EAAK,GAAId,GAAO,WAAW,WAAW,CAAA,GAAK,WAAWe,EAAG,YAAYf,GAAO,WAAW,SAAS,SAAS,GACxG,UAAA;AAAA,MAAA,gBAAAgB,EAAClB,KAAW,GAAGE,GAAO,MAAMuB,GAAW,WAAU,QAAO,KAAAtB,GAAU;AAAA,MAClE,gBAAAe,EAACS,GAAA,EAAiB,WAAAL,GAAsB,SAASI,EAAA,CAAkB;AAAA,IAAA,GACrE;AAAA,EAEJ;AACF;AACAL,EAAc,cAAc;AAO5B,MAAMM,IAAmB,CAAC,EAAE,WAAAL,GAAW,SAAAM,QACrC,gBAAAV;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAAU;AAAA,IACA,WAAU;AAAA,IAET,UAAAN,sBAAaO,GAAA,EAAI,MAAM,IAAI,IAAK,gBAAAX,EAACY,GAAA,EAAO,MAAM,GAAA,CAAI;AAAA,EAAA;AACrD,GAGWC,IAAQ9B,EAAM;AAAA,EACzB,CAAC,EAAE,MAAAK,GAAM,GAAGJ,EAAA,GAASC,MACfG,MAAS,aAAmB,gBAAAY,EAACG,KAAc,MAAAf,GAAa,GAAGJ,GAAO,KAAAC,GAAU,IACzE,gBAAAe,EAAClB,GAAA,EAAU,MAAAM,GAAa,GAAGJ,GAAO,KAAAC,GAAU;AAEvD;AACA4B,EAAM,cAAc;"}
@@ -15,5 +15,6 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>,
15
15
  onTransform?: (value: string, event: ChangeEvent<HTMLInputElement>) => string;
16
16
  /** func transform pasted value before set to input */
17
17
  onPastePrepare?: (value: string, event: React.ClipboardEvent<HTMLInputElement>) => string;
18
+ fullSize?: boolean;
18
19
  }
19
20
  //# sourceMappingURL=Input.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.types.d.ts","sourceRoot":"","sources":["../../src/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,wBAAwB,EACxB,cAAc,EACd,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,WAAW,mBACf,SAAQ,wBAAwB,CAAC,OAAO,SAAS,CAAC;IAClD,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IACvF,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,kEAAkE;IAClE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAC9E,sDAAsD;IACtD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;CAC3F"}
1
+ {"version":3,"file":"Input.types.d.ts","sourceRoot":"","sources":["../../src/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,WAAW,EACX,wBAAwB,EACxB,cAAc,EACd,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,WAAW,mBACf,SAAQ,wBAAwB,CAAC,OAAO,SAAS,CAAC;IAClD,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IACvF,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,kEAAkE;IAClE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAC9E,sDAAsD;IACtD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,MAAM,CAAC;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { FC, HTMLAttributes, PropsWithChildren } from 'react';
3
3
  declare const loadedIconVariants: (props?: ({
4
- size?: "sm" | "lg" | "md" | null | undefined;
4
+ size?: "inherit" | "xs" | "sm" | "md" | "lg" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  interface ILoadedIconProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof loadedIconVariants> {
7
7
  loading?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"LoadedIcon.d.ts","sourceRoot":"","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI9D,QAAA,MAAM,kBAAkB;;8EAStB,CAAC;AAEH,UAAU,gBACT,SAAQ,cAAc,CAAC,cAAc,CAAC,EACrC,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAY9D,CAAC"}
1
+ {"version":3,"file":"LoadedIcon.d.ts","sourceRoot":"","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI9D,QAAA,MAAM,kBAAkB;;8EAatB,CAAC;AAEH,UAAU,gBACR,SAAQ,cAAc,CAAC,cAAc,CAAC,EACpC,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAY9D,CAAC"}
@@ -1,28 +1,32 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { cva as n } from "class-variance-authority";
3
- import { LoaderCircleIcon as t } from "lucide-react";
2
+ import { cva as t } from "class-variance-authority";
3
+ import { LoaderCircleIcon as m } from "lucide-react";
4
4
  import { cn as c } from "@oneplatformdev/utils";
5
- const d = n([], {
5
+ const d = t([
6
+ "relative"
7
+ ], {
6
8
  variants: {
7
9
  size: {
8
- sm: "[&_svg]:size-[18px]!",
9
- md: "[&_svg]:size-5!",
10
- lg: "[&_svg]:size-5!"
10
+ inherit: "[&_svg]:size-inherit",
11
+ xs: "[&_svg]:size-3",
12
+ sm: "[&_svg]:size-4",
13
+ md: "[&_svg]:size-5",
14
+ lg: "[&_svg]:size-6"
11
15
  }
12
16
  },
13
- defaultVariants: { size: "md" }
14
- }), f = (a) => {
15
- const { loading: e, children: i, size: o = "md", className: r, ...m } = a;
17
+ defaultVariants: { size: "inherit" }
18
+ }), p = (i) => {
19
+ const { loading: e, children: r, size: a = "md", className: n, ...o } = i;
16
20
  return /* @__PURE__ */ s(
17
21
  "div",
18
22
  {
19
- ...m,
20
- className: c(d({ size: o, className: r })),
21
- children: e ? /* @__PURE__ */ s(t, { className: "animate-spin" }) : i
23
+ ...o,
24
+ className: c(d({ size: a, className: n })),
25
+ children: e ? /* @__PURE__ */ s(m, { className: "animate-spin" }) : r
22
26
  }
23
27
  );
24
28
  };
25
29
  export {
26
- f as LoadedIcon
30
+ p as LoadedIcon
27
31
  };
28
32
  //# sourceMappingURL=LoadedIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoadedIcon.js","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { LoaderCircleIcon } from 'lucide-react';\nimport { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { cn } from '@oneplatformdev/utils';\n\nconst loadedIconVariants = cva([], {\n variants: {\n size: {\n sm: '[&_svg]:size-[18px]!',\n md: '[&_svg]:size-5!',\n lg: '[&_svg]:size-5!',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\ninterface ILoadedIconProps\n\textends HTMLAttributes<HTMLDivElement>,\n\t\tVariantProps<typeof loadedIconVariants> {\n\tloading?: boolean;\n}\n\nexport const LoadedIcon: FC<PropsWithChildren<ILoadedIconProps>> = (props) => {\n\tconst { loading, children, size = 'md', className, ...rest } = props;\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={cn(loadedIconVariants({size , className}))}\n\t\t>\n\t\t\t{loading\n\t\t\t\t? <LoaderCircleIcon className=\"animate-spin\"/>\n\t\t\t\t: children}\n\t\t</div>\n\t);\n};\n"],"names":["loadedIconVariants","cva","LoadedIcon","props","loading","children","size","className","rest","jsx","cn","LoaderCircleIcon"],"mappings":";;;;AAMA,MAAMA,IAAqBC,EAAI,IAAI;AAAA,EACjC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,EAAE,MAAM,KAAA;AAC3B,CAAC,GAQYC,IAAsD,CAACC,MAAU;AAC7E,QAAM,EAAE,SAAAC,GAAS,UAAAC,GAAU,MAAAC,IAAO,MAAM,WAAAC,GAAW,GAAGC,MAASL;AAC/D,SACC,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,GAAGD;AAAA,MACJ,WAAWE,EAAGV,EAAmB,EAAC,MAAAM,GAAO,WAAAC,EAAA,CAAU,CAAC;AAAA,MAEnD,UAAAH,IACE,gBAAAK,EAACE,GAAA,EAAiB,WAAU,gBAAc,IAC1CN;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"LoadedIcon.js","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { LoaderCircleIcon } from 'lucide-react';\nimport { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { cn } from '@oneplatformdev/utils';\n\nconst loadedIconVariants = cva([\n 'relative',\n], {\n variants: {\n size: {\n inherit: '[&_svg]:size-inherit',\n xs: '[&_svg]:size-3',\n sm: '[&_svg]:size-4',\n md: '[&_svg]:size-5',\n lg: '[&_svg]:size-6',\n },\n },\n defaultVariants: { size: 'inherit' },\n});\n\ninterface ILoadedIconProps\n extends HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof loadedIconVariants> {\n loading?: boolean;\n}\n\nexport const LoadedIcon: FC<PropsWithChildren<ILoadedIconProps>> = (props) => {\n const { loading, children, size = 'md', className, ...rest } = props;\n return (\n <div\n {...rest}\n className={cn(loadedIconVariants({ size, className }))}\n >\n {loading\n ? <LoaderCircleIcon className=\"animate-spin\"/>\n : children}\n </div>\n );\n};\n"],"names":["loadedIconVariants","cva","LoadedIcon","props","loading","children","size","className","rest","jsx","cn","LoaderCircleIcon"],"mappings":";;;;AAMA,MAAMA,IAAqBC,EAAI;AAAA,EAC7B;AACF,GAAG;AAAA,EACD,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,EAAE,MAAM,UAAA;AAC3B,CAAC,GAQYC,IAAsD,CAACC,MAAU;AAC5E,QAAM,EAAE,SAAAC,GAAS,UAAAC,GAAU,MAAAC,IAAO,MAAM,WAAAC,GAAW,GAAGC,MAASL;AAC/D,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,WAAWE,EAAGV,EAAmB,EAAE,MAAAM,GAAM,WAAAC,EAAA,CAAW,CAAC;AAAA,MAEpD,UAAAH,IACG,gBAAAK,EAACE,GAAA,EAAiB,WAAU,gBAAc,IAC1CN;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1,4 +1,4 @@
1
- import { jsxs as l, Fragment as g, jsx as b } from "react/jsx-runtime";
1
+ import { jsxs as l, Fragment as p, jsx as b } from "react/jsx-runtime";
2
2
  import * as h from "react";
3
3
  import { useId as A, useRef as v, useState as w, useImperativeHandle as z, useEffect as F } from "react";
4
4
  import { cn as d } from "@oneplatformdev/utils";
@@ -9,12 +9,12 @@ const y = h.forwardRef(
9
9
  className: c,
10
10
  value: t = "",
11
11
  maxHeight: o = Number.MAX_SAFE_INTEGER,
12
- minHeight: i = 0,
12
+ minHeight: i = 40,
13
13
  resizeble: f = !0,
14
14
  counter: s = !1,
15
15
  id: n = "",
16
16
  ...r
17
- } = u, a = A(), e = v(null), [x, p] = w("");
17
+ } = u, a = A(), e = v(null), [x, g] = w("");
18
18
  return N({
19
19
  textAreaRef: e,
20
20
  triggerAutoSize: x,
@@ -27,8 +27,8 @@ const y = h.forwardRef(
27
27
  maxHeight: o,
28
28
  minHeight: i
29
29
  })), F(() => {
30
- p(t);
31
- }, [r?.defaultValue, t]), /* @__PURE__ */ l(g, { children: [
30
+ g(t);
31
+ }, [r?.defaultValue, t]), /* @__PURE__ */ l(p, { children: [
32
32
  /* @__PURE__ */ b(
33
33
  "textarea",
34
34
  {
@@ -38,7 +38,7 @@ const y = h.forwardRef(
38
38
  value: t,
39
39
  className: d(
40
40
  "flex min-h-10 w-full px-3 py-2 text-base relative md:text-sm",
41
- "rounded-[12px] border border-input bg-[#FCFCFC] shadow-none",
41
+ "rounded-lg border border-input bg-[#FCFCFC] shadow-none",
42
42
  "placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
43
43
  "focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring",
44
44
  f ? "resize" : "resize-none overflow-hidden!",
@@ -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 = 0,\n resizeble = true,\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-[12px] 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-2',\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-sm font-normal text-muted-foreground',\n 'leading-none 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,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,GAAGC;AAAA,IAAA,IACDT,GACEU,IAAKC,EAAA,GACLC,IAAcC,EAAmC,IAAI,GACrD,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAE;AAEzD,WAAAC,EAAoB;AAAA,MAClB,aAAAL;AAAA,MACA,iBAAAE;AAAA,MACA,WAAAV;AAAA,MACA,WAAAC;AAAA,IAAA,CACD,GAEDa,EAAoBjB,GAAK,OAAO;AAAA,MAC9B,GAAKW,EAAY,WAAW,CAAA;AAAA,MAC5B,UAAUA,EAAY;AAAA,MACtB,OAAO,MAAMA,GAAa,SAAS,MAAA;AAAA,MACnC,WAAAR;AAAA,MACA,WAAAC;AAAA,IAAA,EACA,GAEFc,EAAU,MAAM;AACd,MAAAJ,EAAmBZ,CAAe;AAAA,IACpC,GAAG,CAACM,GAAO,cAAcN,CAAK,CAAC,GAG7B,gBAAAiB,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAId,KAAYE;AAAA,UACf,GAAGD;AAAA,UACJ,KAAKG;AAAA,UACL,OAAAT;AAAA,UACA,WAAWoB;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACAjB,IAAY,WAAW;AAAA,YACvBC,KAAW;AAAA,YACXL;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,MAEDK,KACC,gBAAAa;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASZ,KAAYE;AAAA,UACrB,WAAWa;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,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 = true,\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-2',\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-sm font-normal text-muted-foreground',\n 'leading-none 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,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,GAAGC;AAAA,IAAA,IACDT,GACEU,IAAKC,EAAA,GACLC,IAAcC,EAAmC,IAAI,GACrD,CAACC,GAAiBC,CAAkB,IAAIC,EAAS,EAAE;AAEzD,WAAAC,EAAoB;AAAA,MAClB,aAAAL;AAAA,MACA,iBAAAE;AAAA,MACA,WAAAV;AAAA,MACA,WAAAC;AAAA,IAAA,CACD,GAEDa,EAAoBjB,GAAK,OAAO;AAAA,MAC9B,GAAKW,EAAY,WAAW,CAAA;AAAA,MAC5B,UAAUA,EAAY;AAAA,MACtB,OAAO,MAAMA,GAAa,SAAS,MAAA;AAAA,MACnC,WAAAR;AAAA,MACA,WAAAC;AAAA,IAAA,EACA,GAEFc,EAAU,MAAM;AACd,MAAAJ,EAAmBZ,CAAe;AAAA,IACpC,GAAG,CAACM,GAAO,cAAcN,CAAK,CAAC,GAG7B,gBAAAiB,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAId,KAAYE;AAAA,UACf,GAAGD;AAAA,UACJ,KAAKG;AAAA,UACL,OAAAT;AAAA,UACA,WAAWoB;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACAjB,IAAY,WAAW;AAAA,YACvBC,KAAW;AAAA,YACXL;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,MAEDK,KACC,gBAAAa;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASZ,KAAYE;AAAA,UACrB,WAAWa;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,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;"}
@@ -0,0 +1,12 @@
1
+ import { Textarea as t } from "./Textarea.js";
2
+ const a = {
3
+ title: "Textarea",
4
+ component: t
5
+ }, o = {
6
+ args: {}
7
+ };
8
+ export {
9
+ o as Default,
10
+ a as default
11
+ };
12
+ //# sourceMappingURL=Textarea.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea.stories.js","sources":["../../src/Textarea/Textarea.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite';\n\nimport { Textarea } from './Textarea';\n\nconst meta = {\n title: 'Textarea',\n component: Textarea,\n} satisfies Meta<typeof Textarea>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n args: {}\n};\n"],"names":["meta","Textarea","Default"],"mappings":";AAIA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AACb,GAMaC,IAAiB;AAAA,EAC5B,MAAM,CAAA;AACR;"}
@@ -1,3 +1,3 @@
1
- import { IUseAutosizeTextAreaProps } from '../../projects/ui/src/index.ts';
1
+ import { IUseAutosizeTextAreaProps } from './Textarea.types';
2
2
  export declare const useAutosizeTextArea: ({ textAreaRef, triggerAutoSize, maxHeight, minHeight, }: IUseAutosizeTextAreaProps) => void;
3
3
  //# sourceMappingURL=useAutosizeTextArea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAutosizeTextArea.d.ts","sourceRoot":"","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,eAAO,MAAM,mBAAmB,GAAI,yDAKjC,yBAAyB,SAsB3B,CAAC"}
1
+ {"version":3,"file":"useAutosizeTextArea.d.ts","sourceRoot":"","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,eAAO,MAAM,mBAAmB,GAAI,yDAKjC,yBAAyB,SAsB3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAutosizeTextArea.js","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { IUseAutosizeTextAreaProps } from '@oneplatformdev/ui';\n\nexport const useAutosizeTextArea = ({\n textAreaRef,\n triggerAutoSize,\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 0,\n}: IUseAutosizeTextAreaProps) => {\n const [init, setInit] = React.useState(true);\n React.useEffect(() => {\n const offsetBorder = 0;\n const textAreaElement = textAreaRef.current;\n if (textAreaElement) {\n if (init) {\n textAreaElement.style.minHeight = `${minHeight + offsetBorder}px`;\n if (maxHeight > minHeight) {\n textAreaElement.style.maxHeight = `${maxHeight}px`;\n }\n setInit(false);\n }\n textAreaElement.style.height = `${minHeight + offsetBorder}px`;\n const scrollHeight = textAreaElement.scrollHeight;\n if (scrollHeight > maxHeight) {\n textAreaElement.style.height = `${maxHeight}px`;\n } else {\n textAreaElement.style.height = `${scrollHeight + offsetBorder}px`;\n }\n }\n }, [textAreaRef.current, triggerAutoSize]);\n};\n"],"names":["useAutosizeTextArea","textAreaRef","triggerAutoSize","maxHeight","minHeight","init","setInit","React","textAreaElement","scrollHeight"],"mappings":";AAKO,MAAMA,IAAsB,CAAC;AAAA,EAClC,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC,IAAY,OAAO;AAAA,EACnB,WAAAC,IAAY;AACd,MAAiC;AAC/B,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAM,SAAS,EAAI;AAC3C,EAAAA,EAAM,UAAU,MAAM;AAEpB,UAAMC,IAAkBP,EAAY;AACpC,QAAIO,GAAiB;AACnB,MAAIH,MACFG,EAAgB,MAAM,YAAY,GAAGJ,IAAY,CAAY,MACzDD,IAAYC,MACdI,EAAgB,MAAM,YAAY,GAAGL,CAAS,OAEhDG,EAAQ,EAAK,IAEfE,EAAgB,MAAM,SAAS,GAAGJ,IAAY,CAAY;AAC1D,YAAMK,IAAeD,EAAgB;AACrC,MAAIC,IAAeN,IACjBK,EAAgB,MAAM,SAAS,GAAGL,CAAS,OAE3CK,EAAgB,MAAM,SAAS,GAAGC,IAAe,CAAY;AAAA,IAEjE;AAAA,EACF,GAAG,CAACR,EAAY,SAASC,CAAe,CAAC;AAC3C;"}
1
+ {"version":3,"file":"useAutosizeTextArea.js","sources":["../../src/Textarea/useAutosizeTextArea.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { IUseAutosizeTextAreaProps } from './Textarea.types';\n\nexport const useAutosizeTextArea = ({\n textAreaRef,\n triggerAutoSize,\n maxHeight = Number.MAX_SAFE_INTEGER,\n minHeight = 0,\n}: IUseAutosizeTextAreaProps) => {\n const [init, setInit] = React.useState(true);\n React.useEffect(() => {\n const offsetBorder = 0;\n const textAreaElement = textAreaRef.current;\n if (textAreaElement) {\n if (init) {\n textAreaElement.style.minHeight = `${minHeight + offsetBorder}px`;\n if (maxHeight > minHeight) {\n textAreaElement.style.maxHeight = `${maxHeight}px`;\n }\n setInit(false);\n }\n textAreaElement.style.height = `${minHeight + offsetBorder}px`;\n const scrollHeight = textAreaElement.scrollHeight;\n if (scrollHeight > maxHeight) {\n textAreaElement.style.height = `${maxHeight}px`;\n } else {\n textAreaElement.style.height = `${scrollHeight + offsetBorder}px`;\n }\n }\n }, [textAreaRef.current, triggerAutoSize]);\n};\n"],"names":["useAutosizeTextArea","textAreaRef","triggerAutoSize","maxHeight","minHeight","init","setInit","React","textAreaElement","scrollHeight"],"mappings":";AAKO,MAAMA,IAAsB,CAAC;AAAA,EAClC,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC,IAAY,OAAO;AAAA,EACnB,WAAAC,IAAY;AACd,MAAiC;AAC/B,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAM,SAAS,EAAI;AAC3C,EAAAA,EAAM,UAAU,MAAM;AAEpB,UAAMC,IAAkBP,EAAY;AACpC,QAAIO,GAAiB;AACnB,MAAIH,MACFG,EAAgB,MAAM,YAAY,GAAGJ,IAAY,CAAY,MACzDD,IAAYC,MACdI,EAAgB,MAAM,YAAY,GAAGL,CAAS,OAEhDG,EAAQ,EAAK,IAEfE,EAAgB,MAAM,SAAS,GAAGJ,IAAY,CAAY;AAC1D,YAAMK,IAAeD,EAAgB;AACrC,MAAIC,IAAeN,IACjBK,EAAgB,MAAM,SAAS,GAAGL,CAAS,OAE3CK,EAAgB,MAAM,SAAS,GAAGC,IAAe,CAAY;AAAA,IAEjE;AAAA,EACF,GAAG,CAACR,EAAY,SAASC,CAAe,CAAC;AAC3C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,CAAC,YAAY,CAAC,4CAyClE,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,iBAAiB,CAAC,YAAY,CAAC,4CAQ7D,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,CAAC,YAAY,CAAC,4CAwClE,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,iBAAiB,CAAC,YAAY,CAAC,4CAQ7D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import { CircleQuestionMarkIcon } from 'lucide-react';\nimport { PropsWithChildren } from \"react\";\n\nimport { cn } from \"@oneplatformdev/utils\";\nimport type { TooltipProps } from \"./Tooltip.types\";\nimport { TooltipRoot, TooltipTrigger, TooltipContent, TooltipProvider } from \"./TooltipRoot\";\n\nexport const TooltipInner = (props: PropsWithChildren<TooltipProps>) => {\n const { triggerProps, contentProps, message, children, showQuestionMark = false, ...rest } = props;\n return (\n <TooltipRoot\n defaultOpen={false}\n delayDuration={300}\n {...rest}\n >\n\n <TooltipTrigger\n {...(triggerProps || {})}\n className={cn(\n 'flex flex-row gap-1 w-fit',\n 'items-center',\n 'cursor-pointer',\n 'outline-none',\n triggerProps?.className\n )}\n type='button'\n >\n {children}\n {showQuestionMark && <CircleQuestionMarkIcon/>}\n </TooltipTrigger>\n\n <TooltipContent\n align=\"center\"\n {...(contentProps || {})}\n className={cn(\n 'flex items-center justify-center',\n 'max-w-[320px] p-1',\n 'bg-[#FCFCFC] border-none',\n 'shadow-[0px_4px_8px_rgba(13,14,43,0.125)]',\n 'text-[#363B4E] font-normal text-sm leading-normal',\n 'whitespace-pre-wrap',\n contentProps?.className\n )}\n >\n {message || ''}\n </TooltipContent>\n </TooltipRoot>\n );\n};\n\nexport const Tooltip = (props: PropsWithChildren<TooltipProps>) => {\n const { skipProvider = true } = props;\n if (skipProvider) return <TooltipInner {...props}/>;\n return (\n <TooltipProvider>\n <TooltipInner {...props}/>\n </TooltipProvider>\n );\n};\n"],"names":["TooltipInner","props","triggerProps","contentProps","message","children","showQuestionMark","rest","jsxs","TooltipRoot","TooltipTrigger","cn","CircleQuestionMarkIcon","jsx","TooltipContent","Tooltip","skipProvider","TooltipProvider"],"mappings":";;;;AAOO,MAAMA,IAAe,CAACC,MAA2C;AACtE,QAAM,EAAE,cAAAC,GAAc,cAAAC,GAAc,SAAAC,GAAS,UAAAC,GAAU,kBAAAC,IAAmB,IAAO,GAAGC,EAAA,IAASN;AAC7F,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAa;AAAA,MACb,eAAe;AAAA,MACd,GAAGF;AAAA,MAGJ,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACE;AAAA,UAAA;AAAA,YACE,GAAIR,KAAgB,CAAA;AAAA,YACrB,WAAWS;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACAT,GAAc;AAAA,YAAA;AAAA,YAEhB,MAAK;AAAA,YAEJ,UAAA;AAAA,cAAAG;AAAA,cACAC,uBAAqBM,GAAA,CAAA,CAAsB;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAG9C,gBAAAC;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACL,GAAIX,KAAgB,CAAA;AAAA,YACrB,WAAWQ;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACAR,GAAc;AAAA,YAAA;AAAA,YAGf,UAAAC,KAAW;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA;AAGN,GAEaW,IAAU,CAACd,MAA2C;AACjE,QAAM,EAAE,cAAAe,IAAe,GAAA,IAASf;AAChC,SAAIe,IAAqB,gBAAAH,EAACb,GAAA,EAAc,GAAGC,EAAA,CAAM,sBAE9CgB,GAAA,EACC,UAAA,gBAAAJ,EAACb,GAAA,EAAc,GAAGC,GAAM,GAC1B;AAEJ;"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import { CircleQuestionMarkIcon } from 'lucide-react';\nimport { PropsWithChildren } from \"react\";\n\nimport { cn } from \"@oneplatformdev/utils\";\nimport type { TooltipProps } from \"./Tooltip.types\";\nimport { TooltipRoot, TooltipTrigger, TooltipContent, TooltipProvider } from \"./TooltipRoot\";\n\nexport const TooltipInner = (props: PropsWithChildren<TooltipProps>) => {\n const { triggerProps, contentProps, message, children, showQuestionMark = false, ...rest } = props;\n return (\n <TooltipRoot\n defaultOpen={false}\n delayDuration={300}\n {...rest}\n >\n <TooltipTrigger\n {...(triggerProps || {})}\n className={cn(\n 'flex flex-row gap-1 w-fit',\n 'items-center',\n 'cursor-pointer',\n 'outline-none',\n triggerProps?.className\n )}\n type='button'\n >\n {children}\n {showQuestionMark && <CircleQuestionMarkIcon/>}\n </TooltipTrigger>\n\n <TooltipContent\n align=\"center\"\n {...(contentProps || {})}\n className={cn(\n 'flex items-center justify-center',\n 'max-w-[320px] p-1',\n 'bg-[#FCFCFC] border-none',\n 'shadow-[0px_4px_8px_rgba(13,14,43,0.125)]',\n 'text-[#363B4E] font-normal text-sm leading-normal',\n 'whitespace-pre-wrap',\n contentProps?.className\n )}\n >\n {message || ''}\n </TooltipContent>\n </TooltipRoot>\n );\n};\n\nexport const Tooltip = (props: PropsWithChildren<TooltipProps>) => {\n const { skipProvider = true } = props;\n if (skipProvider) return <TooltipInner {...props}/>;\n return (\n <TooltipProvider>\n <TooltipInner {...props}/>\n </TooltipProvider>\n );\n};\n"],"names":["TooltipInner","props","triggerProps","contentProps","message","children","showQuestionMark","rest","jsxs","TooltipRoot","TooltipTrigger","cn","CircleQuestionMarkIcon","jsx","TooltipContent","Tooltip","skipProvider","TooltipProvider"],"mappings":";;;;AAOO,MAAMA,IAAe,CAACC,MAA2C;AACtE,QAAM,EAAE,cAAAC,GAAc,cAAAC,GAAc,SAAAC,GAAS,UAAAC,GAAU,kBAAAC,IAAmB,IAAO,GAAGC,EAAA,IAASN;AAC7F,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAa;AAAA,MACb,eAAe;AAAA,MACd,GAAGF;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAC;AAAA,UAACE;AAAA,UAAA;AAAA,YACE,GAAIR,KAAgB,CAAA;AAAA,YACrB,WAAWS;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACAT,GAAc;AAAA,YAAA;AAAA,YAEhB,MAAK;AAAA,YAEJ,UAAA;AAAA,cAAAG;AAAA,cACAC,uBAAqBM,GAAA,CAAA,CAAsB;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAG9C,gBAAAC;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACL,GAAIX,KAAgB,CAAA;AAAA,YACrB,WAAWQ;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACAR,GAAc;AAAA,YAAA;AAAA,YAGf,UAAAC,KAAW;AAAA,UAAA;AAAA,QAAA;AAAA,MACd;AAAA,IAAA;AAAA,EAAA;AAGN,GAEaW,IAAU,CAACd,MAA2C;AACjE,QAAM,EAAE,cAAAe,IAAe,GAAA,IAASf;AAChC,SAAIe,IAAqB,gBAAAH,EAACb,GAAA,EAAc,GAAGC,EAAA,CAAM,sBAE9CgB,GAAA,EACC,UAAA,gBAAAJ,EAACb,GAAA,EAAc,GAAGC,GAAM,GAC1B;AAEJ;"}