@oneplatformdev/ui 0.1.99-beta.19 → 0.1.99-beta.197

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 (265) hide show
  1. package/.storybook/Wrappers.js.map +1 -1
  2. package/Accordion/Accordion.d.ts +1 -1
  3. package/Accordion/Accordion.d.ts.map +1 -1
  4. package/Accordion/Accordion.js +48 -26
  5. package/Accordion/Accordion.js.map +1 -1
  6. package/Alert/Alert.js.map +1 -1
  7. package/Alert/alertVariants.js.map +1 -1
  8. package/AlertDialog/AlertDialog.js.map +1 -1
  9. package/AlertDialog/AlertDialog.stories.js +2 -3
  10. package/AlertDialog/AlertDialog.stories.js.map +1 -1
  11. package/AlertDialog/AlertDialogRoot.d.ts.map +1 -1
  12. package/AlertDialog/AlertDialogRoot.js +23 -23
  13. package/AlertDialog/AlertDialogRoot.js.map +1 -1
  14. package/AreaChart/AreaChart.js.map +1 -1
  15. package/Aside/Aside.js.map +1 -1
  16. package/Aside/AsideSidebar.js.map +1 -1
  17. package/AspectRatio/AspectRatio.js.map +1 -1
  18. package/Avatar/Avatar.js.map +1 -1
  19. package/Badge/Badge.js.map +1 -1
  20. package/Badge/badgeVariants.js.map +1 -1
  21. package/Breadcrumb/Breadcrumb.js.map +1 -1
  22. package/Button/Button.d.ts.map +1 -1
  23. package/Button/Button.js +40 -41
  24. package/Button/Button.js.map +1 -1
  25. package/Button/Button.stories.js.map +1 -1
  26. package/Button/Button.utils.d.ts +3 -0
  27. package/Button/Button.utils.d.ts.map +1 -0
  28. package/Button/Button.utils.js +14 -0
  29. package/Button/Button.utils.js.map +1 -0
  30. package/Button/ButtonCounterBadge.js.map +1 -1
  31. package/Button/buttonVariants.d.ts.map +1 -1
  32. package/Button/buttonVariants.js +2 -1
  33. package/Button/buttonVariants.js.map +1 -1
  34. package/Button/index.d.ts +1 -0
  35. package/Button/index.d.ts.map +1 -1
  36. package/Button/index.js +8 -6
  37. package/Button/index.js.map +1 -1
  38. package/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  39. package/ButtonIcon/ButtonIcon.js +49 -50
  40. package/ButtonIcon/ButtonIcon.js.map +1 -1
  41. package/ButtonIcon/ButtonIcon.stories.js +35 -33
  42. package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
  43. package/ButtonIcon/buttonIconVariants.d.ts.map +1 -1
  44. package/ButtonIcon/buttonIconVariants.js +3 -2
  45. package/ButtonIcon/buttonIconVariants.js.map +1 -1
  46. package/CHANGELOG.md +2649 -1786
  47. package/Calendar/Calendar.js +0 -1
  48. package/Calendar/Calendar.js.map +1 -1
  49. package/Card/Card.js.map +1 -1
  50. package/Carousel/Carousel.js +6 -7
  51. package/Carousel/Carousel.js.map +1 -1
  52. package/Chart/Chart.js.map +1 -1
  53. package/Checkbox/Checkbox.d.ts.map +1 -1
  54. package/Checkbox/Checkbox.js +34 -33
  55. package/Checkbox/Checkbox.js.map +1 -1
  56. package/Checkbox/Checkbox.stories.js +108 -0
  57. package/Checkbox/Checkbox.stories.js.map +1 -0
  58. package/Collapsible/Collapsible.js.map +1 -1
  59. package/Combobox/Combobox.d.ts +1 -1
  60. package/Combobox/Combobox.d.ts.map +1 -1
  61. package/Combobox/Combobox.js +204 -191
  62. package/Combobox/Combobox.js.map +1 -1
  63. package/Combobox/Combobox.stories.js +212 -0
  64. package/Combobox/Combobox.stories.js.map +1 -0
  65. package/Combobox/Combobox.types.d.ts +34 -19
  66. package/Combobox/Combobox.types.d.ts.map +1 -1
  67. package/Combobox/ComboboxOptionItem.d.ts +4 -3
  68. package/Combobox/ComboboxOptionItem.d.ts.map +1 -1
  69. package/Combobox/ComboboxOptionItem.js +49 -22
  70. package/Combobox/ComboboxOptionItem.js.map +1 -1
  71. package/Combobox/ComboboxOptions.d.ts +2 -2
  72. package/Combobox/ComboboxOptions.d.ts.map +1 -1
  73. package/Combobox/ComboboxOptions.js +48 -49
  74. package/Combobox/ComboboxOptions.js.map +1 -1
  75. package/Command/Command.d.ts +6 -1
  76. package/Command/Command.d.ts.map +1 -1
  77. package/Command/Command.js +61 -47
  78. package/Command/Command.js.map +1 -1
  79. package/DataTable/DataTable.js +12 -13
  80. package/DataTable/DataTable.js.map +1 -1
  81. package/DataTable/DataTableColumnFilter.js +6 -7
  82. package/DataTable/DataTableColumnFilter.js.map +1 -1
  83. package/DataTable/useDataTable.js.map +1 -1
  84. package/DatePicker/DatePicker.js +12 -13
  85. package/DatePicker/DatePicker.js.map +1 -1
  86. package/Dialog/Dialog.d.ts +4 -1
  87. package/Dialog/Dialog.d.ts.map +1 -1
  88. package/Dialog/Dialog.js +67 -35
  89. package/Dialog/Dialog.js.map +1 -1
  90. package/Dialog/Dialog.stories.js +101 -0
  91. package/Dialog/Dialog.stories.js.map +1 -0
  92. package/Dialog/Dialog.types.d.ts +4 -0
  93. package/Dialog/Dialog.types.d.ts.map +1 -0
  94. package/Dialog/Dialog.types.js +2 -0
  95. package/Dialog/Dialog.types.js.map +1 -0
  96. package/Dialog/DialogOverlayScope.js.map +1 -1
  97. package/Dialog/index.d.ts +1 -0
  98. package/Dialog/index.d.ts.map +1 -1
  99. package/Drawer/Drawer.js.map +1 -1
  100. package/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  101. package/DropdownMenu/DropdownMenu.js +33 -20
  102. package/DropdownMenu/DropdownMenu.js.map +1 -1
  103. package/Dropzone/Dropzone.js.map +1 -1
  104. package/Dropzone/Dropzone.types.js.map +1 -1
  105. package/Dropzone/DropzoneFilePreview.js.map +1 -1
  106. package/Dropzone/DropzoneSinglePickPreview.js.map +1 -1
  107. package/Dropzone/DropzoneUtils.js.map +1 -1
  108. package/Form/Form.d.ts.map +1 -1
  109. package/Form/Form.js +14 -15
  110. package/Form/Form.js.map +1 -1
  111. package/Form/FormRenderControl.d.ts +1 -1
  112. package/Form/FormRenderControl.d.ts.map +1 -1
  113. package/Form/FormRenderControl.js +53 -14
  114. package/Form/FormRenderControl.js.map +1 -1
  115. package/Form/FormRenderControl.types.d.ts +4 -1
  116. package/Form/FormRenderControl.types.d.ts.map +1 -1
  117. package/Form/Form_old.js +4 -5
  118. package/Form/Form_old.js.map +1 -1
  119. package/FormCheckbox/FormCheckbox.js +4 -4
  120. package/FormCheckbox/FormCheckbox.js.map +1 -1
  121. package/FormCombobox/FormCombobox.d.ts.map +1 -1
  122. package/FormCombobox/FormCombobox.js +15 -13
  123. package/FormCombobox/FormCombobox.js.map +1 -1
  124. package/FormDatePicker/FormDatePicker.d.ts.map +1 -1
  125. package/FormDatePicker/FormDatePicker.js +18 -16
  126. package/FormDatePicker/FormDatePicker.js.map +1 -1
  127. package/FormDropzone/FormDropzone.d.ts.map +1 -1
  128. package/FormDropzone/FormDropzone.js +13 -11
  129. package/FormDropzone/FormDropzone.js.map +1 -1
  130. package/FormInput/FormInput.d.ts.map +1 -1
  131. package/FormInput/FormInput.js +47 -27
  132. package/FormInput/FormInput.js.map +1 -1
  133. package/FormInput/FormInput.stories.js +61 -0
  134. package/FormInput/FormInput.stories.js.map +1 -0
  135. package/FormInput/FormInput.types.d.ts +1 -0
  136. package/FormInput/FormInput.types.d.ts.map +1 -1
  137. package/FormRadio/FormRadio.js.map +1 -1
  138. package/FormSelect/FormSelect.d.ts.map +1 -1
  139. package/FormSelect/FormSelect.js +19 -18
  140. package/FormSelect/FormSelect.js.map +1 -1
  141. package/FormTextarea/FormTextarea.d.ts.map +1 -1
  142. package/FormTextarea/FormTextarea.js +13 -11
  143. package/FormTextarea/FormTextarea.js.map +1 -1
  144. package/Header/Header.js.map +1 -1
  145. package/HoverCard/HoverCard.js.map +1 -1
  146. package/InfoBlock/InfoBlock.d.ts +7 -0
  147. package/InfoBlock/InfoBlock.d.ts.map +1 -0
  148. package/InfoBlock/InfoBlock.js +28 -0
  149. package/InfoBlock/InfoBlock.js.map +1 -0
  150. package/InfoBlock/InfoBlock.stories.js +50 -0
  151. package/InfoBlock/InfoBlock.stories.js.map +1 -0
  152. package/InfoBlock/InfoBlock.types.d.ts +9 -0
  153. package/InfoBlock/InfoBlock.types.d.ts.map +1 -0
  154. package/InfoBlock/InfoBlock.types.js +2 -0
  155. package/InfoBlock/InfoBlock.types.js.map +1 -0
  156. package/InfoBlock/index.d.ts +3 -0
  157. package/InfoBlock/index.d.ts.map +1 -0
  158. package/InfoBlock/index.js +5 -0
  159. package/InfoBlock/index.js.map +1 -0
  160. package/InfoBlock/infoBlockVariants.d.ts +6 -0
  161. package/InfoBlock/infoBlockVariants.d.ts.map +1 -0
  162. package/InfoBlock/infoBlockVariants.js +27 -0
  163. package/InfoBlock/infoBlockVariants.js.map +1 -0
  164. package/Input/Input.d.ts.map +1 -1
  165. package/Input/Input.js +65 -51
  166. package/Input/Input.js.map +1 -1
  167. package/Input/Input.types.d.ts +1 -0
  168. package/Input/Input.types.d.ts.map +1 -1
  169. package/Input/inputVariants.d.ts.map +1 -1
  170. package/Input/inputVariants.js +5 -4
  171. package/Input/inputVariants.js.map +1 -1
  172. package/InputOTP/InputOTP.d.ts.map +1 -1
  173. package/InputOTP/InputOTP.js.map +1 -1
  174. package/LICENSE +21 -21
  175. package/Label/Label.js.map +1 -1
  176. package/Label/labelVariants.js.map +1 -1
  177. package/LazyLoader/LazyLoader.js +4 -5
  178. package/LazyLoader/LazyLoader.js.map +1 -1
  179. package/LoadedIcon/LoadedIcon.js.map +1 -1
  180. package/LoadingMask/LoadingMask.d.ts +1 -2
  181. package/LoadingMask/LoadingMask.d.ts.map +1 -1
  182. package/LoadingMask/LoadingMask.js +8 -8
  183. package/LoadingMask/LoadingMask.js.map +1 -1
  184. package/LoadingMask/LoadingMask.types.d.ts +1 -0
  185. package/LoadingMask/LoadingMask.types.d.ts.map +1 -1
  186. package/LoadingMask/RenderLoadingMask.js.map +1 -1
  187. package/LoadingProgress/LoadingProgress.js.map +1 -1
  188. package/LoadingProgress/loadingProgressVariants.js.map +1 -1
  189. package/Menubar/Menubar.js.map +1 -1
  190. package/NavigationMenu/NavigationMenu.js.map +1 -1
  191. package/NavigationMenu/navigationMenuVariants.js.map +1 -1
  192. package/Pagination/Pagination.js +0 -1
  193. package/Pagination/Pagination.js.map +1 -1
  194. package/Popover/Popover.js.map +1 -1
  195. package/Progress/Progress.js.map +1 -1
  196. package/README.md +7 -7
  197. package/Radio/Radio.js.map +1 -1
  198. package/RadioGroup/RadioGroup.js.map +1 -1
  199. package/Resizable/Resizable.d.ts +1 -1
  200. package/Resizable/Resizable.d.ts.map +1 -1
  201. package/Resizable/Resizable.js +21 -16
  202. package/Resizable/Resizable.js.map +1 -1
  203. package/Resizable/Resizable.stories.js.map +1 -1
  204. package/ScrollArea/ScrollArea.js.map +1 -1
  205. package/Search/Search.d.ts.map +1 -1
  206. package/Search/Search.js +40 -31
  207. package/Search/Search.js.map +1 -1
  208. package/Search/Search.stories.js +17 -0
  209. package/Search/Search.stories.js.map +1 -0
  210. package/Select/Select.d.ts.map +1 -1
  211. package/Select/Select.js +53 -49
  212. package/Select/Select.js.map +1 -1
  213. package/Select/Select.stories.js.map +1 -1
  214. package/Select/Select.types.d.ts +4 -0
  215. package/Select/Select.types.d.ts.map +1 -1
  216. package/Select/SelectRoot.js +1 -1
  217. package/Select/SelectRoot.js.map +1 -1
  218. package/Separator/Separator.js.map +1 -1
  219. package/Sheet/Sheet.js.map +1 -1
  220. package/Sidebar/Sidebar.js +20 -21
  221. package/Sidebar/Sidebar.js.map +1 -1
  222. package/Skeleton/Skeleton.js.map +1 -1
  223. package/Slider/Slider.js.map +1 -1
  224. package/Sonner/Sonner.js.map +1 -1
  225. package/Switch/Switch.js.map +1 -1
  226. package/Table/Table.js.map +1 -1
  227. package/TablePagination/TablePagination.js +17 -21
  228. package/TablePagination/TablePagination.js.map +1 -1
  229. package/Tabs/Tabs.js.map +1 -1
  230. package/Tabs/TabsRoot.js.map +1 -1
  231. package/Textarea/Textarea.d.ts.map +1 -1
  232. package/Textarea/Textarea.js +48 -43
  233. package/Textarea/Textarea.js.map +1 -1
  234. package/Textarea/Textarea.stories.js +1 -1
  235. package/Textarea/Textarea.stories.js.map +1 -1
  236. package/Textarea/Textarea.types.d.ts +3 -1
  237. package/Textarea/Textarea.types.d.ts.map +1 -1
  238. package/Textarea/useAutosizeTextArea.js.map +1 -1
  239. package/Theme/ThemeModeToggle.js +3 -4
  240. package/Theme/ThemeModeToggle.js.map +1 -1
  241. package/Theme/ThemeProvider.js.map +1 -1
  242. package/Toast/Toast.d.ts +1 -1
  243. package/Toast/Toast.js.map +1 -1
  244. package/Toast/toast.constants.js.map +1 -1
  245. package/Toast/toastVariants.d.ts +1 -1
  246. package/Toast/toastVariants.js.map +1 -1
  247. package/Toast/useToast.js.map +1 -1
  248. package/Toaster/Toaster.js.map +1 -1
  249. package/Toggle/Toggle.js.map +1 -1
  250. package/ToggleGroup/ToggleGroup.js.map +1 -1
  251. package/Tooltip/Tooltip.d.ts.map +1 -1
  252. package/Tooltip/Tooltip.js +41 -29
  253. package/Tooltip/Tooltip.js.map +1 -1
  254. package/Tooltip/Tooltip.types.d.ts +1 -0
  255. package/Tooltip/Tooltip.types.d.ts.map +1 -1
  256. package/Tooltip/TooltipRoot.js.map +1 -1
  257. package/Tooltip/tooltipVariants.d.ts +4 -0
  258. package/Tooltip/tooltipVariants.d.ts.map +1 -0
  259. package/Tooltip/tooltipVariants.js +23 -0
  260. package/Tooltip/tooltipVariants.js.map +1 -0
  261. package/index.d.ts +1 -0
  262. package/index.d.ts.map +1 -1
  263. package/index.js +332 -328
  264. package/index.js.map +1 -1
  265. package/package.json +6 -5
@@ -1 +1 @@
1
- {"version":3,"file":"HoverCard.js","sources":["../../src/HoverCard/HoverCard.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nconst HoverCard = HoverCardPrimitive.Root\n\nconst HoverCardTrigger = HoverCardPrimitive.Trigger\n\nconst HoverCardContent = React.forwardRef<\n React.ElementRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\n"],"names":["HoverCard","HoverCardPrimitive","HoverCardTrigger","HoverCardContent","React","className","align","sideOffset","props","ref","jsx","cn"],"mappings":";;;;AAOA,MAAMA,IAAYC,EAAmB,MAE/BC,IAAmBD,EAAmB,SAEtCE,IAAmBC,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGC,EAAA,GAASC,MAC5D,gBAAAC;AAAA,EAACT,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAQ;AAAA,IACA,OAAAH;AAAA,IACA,YAAAC;AAAA,IACA,WAAWI;AAAA,MACT;AAAA,MACAN;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,EAAA;AACN,CACD;AACDL,EAAiB,cAAcF,EAAmB,QAAQ;"}
1
+ {"version":3,"file":"HoverCard.js","sources":["../../src/HoverCard/HoverCard.tsx"],"sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\r\n\r\nimport { cn } from \"@oneplatformdev/utils\"\r\n\r\nconst HoverCard = HoverCardPrimitive.Root\r\n\r\nconst HoverCardTrigger = HoverCardPrimitive.Trigger\r\n\r\nconst HoverCardContent = React.forwardRef<\r\n React.ElementRef<typeof HoverCardPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\r\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\r\n <HoverCardPrimitive.Content\r\n ref={ref}\r\n align={align}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName\r\n\r\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\r\n"],"names":["HoverCard","HoverCardPrimitive","HoverCardTrigger","HoverCardContent","React","className","align","sideOffset","props","ref","jsx","cn"],"mappings":";;;;AAOA,MAAMA,IAAYC,EAAmB,MAE/BC,IAAmBD,EAAmB,SAEtCE,IAAmBC,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGC,EAAA,GAASC,MAC5D,gBAAAC;AAAA,EAACT,EAAmB;AAAA,EAAnB;AAAA,IACC,KAAAQ;AAAA,IACA,OAAAH;AAAA,IACA,YAAAC;AAAA,IACA,WAAWI;AAAA,MACT;AAAA,MACAN;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,EAAA;AACN,CACD;AACDL,EAAiB,cAAcF,EAAmB,QAAQ;"}
@@ -0,0 +1,7 @@
1
+ import { InfoBlockProps } from './InfoBlock.types';
2
+ export declare const InfoBlock: {
3
+ (props: InfoBlockProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default InfoBlock;
7
+ //# sourceMappingURL=InfoBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoBlock.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/InfoBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiBtE,eAAO,MAAM,SAAS;YAAW,cAAc;;CAmB9C,CAAA;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as e, jsxs as c, Fragment as m } from "react/jsx-runtime";
2
+ import { cn as f } from "@oneplatformdev/utils";
3
+ import { infoBlockVariants as p } from "./infoBlockVariants.js";
4
+ import { isValidElement as d, createElement as h } from "react";
5
+ import { InfoIcon as u, TriangleAlertIcon as w } from "lucide-react";
6
+ const N = (r) => r ? d(r) ? r : h(r) : null, x = {
7
+ error: /* @__PURE__ */ e(w, { className: "fill-[#DC2626] text-white!" }),
8
+ info: /* @__PURE__ */ e(u, { className: "fill-[#9368FF] text-white!" })
9
+ }, k = (r) => {
10
+ const { className: t, variant: n = "error", content: a, icon: o, children: i, node: l, ...s } = r;
11
+ return /* @__PURE__ */ e(
12
+ "div",
13
+ {
14
+ ...s,
15
+ className: f(p({ className: t, variant: n })),
16
+ children: i ?? /* @__PURE__ */ c(m, { children: [
17
+ N(o ?? x[n]),
18
+ l ?? /* @__PURE__ */ e("span", { className: "whitespace-pre-wrap wrap-break-word line-clamp-10", children: a })
19
+ ] })
20
+ }
21
+ );
22
+ };
23
+ k.displayName = "InfoBlock";
24
+ export {
25
+ k as InfoBlock,
26
+ k as default
27
+ };
28
+ //# sourceMappingURL=InfoBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoBlock.js","sources":["../../src/InfoBlock/InfoBlock.tsx"],"sourcesContent":["import { InfoBlockIconType, InfoBlockProps } from \"./InfoBlock.types\";\r\nimport { cn } from \"@oneplatformdev/utils\";\r\nimport { infoBlockVariants } from \"./infoBlockVariants\";\r\nimport { createElement, isValidElement } from \"react\";\r\nimport { TriangleAlertIcon, InfoIcon } from \"lucide-react\";\r\n\r\nconst renderInnerIcon = (Icon?: InfoBlockIconType) => {\r\n if (!Icon) return null;\r\n if (isValidElement(Icon)) return Icon;\r\n return createElement(Icon);\r\n};\r\n\r\nconst iconByVariant: Record<NonNullable<InfoBlockProps['variant']>, InfoBlockIconType> = {\r\n error: <TriangleAlertIcon className='fill-[#DC2626] text-white!'/>,\r\n info: <InfoIcon className='fill-[#9368FF] text-white!'/>\r\n}\r\n\r\nexport const InfoBlock = (props: InfoBlockProps) => {\r\n const { className, variant = 'error', content, icon, children, node, ...rest } = props;\r\n return (\r\n <div\r\n {...rest}\r\n className={cn(infoBlockVariants({ className, variant }))}\r\n >\r\n {children ?? (\r\n <>\r\n {renderInnerIcon(icon ?? iconByVariant[variant!])}\r\n {node ?? (\r\n <span className='whitespace-pre-wrap wrap-break-word line-clamp-10'>\r\n {content}\r\n </span>\r\n )}\r\n </>\r\n )}\r\n </div>\r\n )\r\n}\r\nInfoBlock.displayName = 'InfoBlock';\r\nexport default InfoBlock;\r\n\r\n"],"names":["renderInnerIcon","Icon","isValidElement","createElement","iconByVariant","jsx","TriangleAlertIcon","InfoIcon","InfoBlock","props","className","variant","content","icon","children","node","rest","cn","infoBlockVariants","jsxs","Fragment"],"mappings":";;;;;AAMA,MAAMA,IAAkB,CAACC,MAClBA,IACDC,EAAeD,CAAI,IAAUA,IAC1BE,EAAcF,CAAI,IAFP,MAKdG,IAAmF;AAAA,EACvF,OAAO,gBAAAC,EAACC,GAAA,EAAkB,WAAU,6BAAA,CAA4B;AAAA,EAChE,MAAM,gBAAAD,EAACE,GAAA,EAAS,WAAU,6BAAA,CAA4B;AACxD,GAEaC,IAAY,CAACC,MAA0B;AAClD,QAAM,EAAE,WAAAC,GAAW,SAAAC,IAAU,SAAS,SAAAC,GAAS,MAAAC,GAAM,UAAAC,GAAU,MAAAC,GAAM,GAAGC,EAAA,IAASP;AACjF,SACE,gBAAAJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGW;AAAA,MACJ,WAAWC,EAAGC,EAAkB,EAAE,WAAAR,GAAW,SAAAC,EAAA,CAAS,CAAC;AAAA,MAEtD,eACC,gBAAAQ,EAAAC,GAAA,EACG,UAAA;AAAA,QAAApB,EAAgBa,KAAQT,EAAcO,CAAQ,CAAC;AAAA,QAC/CI,KACC,gBAAAV,EAAC,QAAA,EAAK,WAAU,qDACf,UAAAO,EAAA,CACH;AAAA,MAAA,EAAA,CAEF;AAAA,IAAA;AAAA,EAAA;AAIR;AACAJ,EAAU,cAAc;"}
@@ -0,0 +1,50 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { InfoBlock as o } from "./InfoBlock.js";
3
+ import { CircleAlert as n } from "lucide-react";
4
+ const a = {
5
+ title: "UI/InfoBlock",
6
+ component: o,
7
+ argTypes: {
8
+ variant: {
9
+ control: "select",
10
+ options: ["error", "info"],
11
+ description: "Defines the color scheme and default icon"
12
+ },
13
+ content: {
14
+ control: "text",
15
+ description: "Text or content inside the block"
16
+ }
17
+ },
18
+ parameters: {
19
+ layout: "centered"
20
+ }
21
+ }, i = {
22
+ args: {
23
+ variant: "error",
24
+ content: "Увага! Перш ніж архівувати підрозділ “Підрозділ дизайну”, переведіть співробітників до іншого — інакше вони будуть автоматично звільнені."
25
+ }
26
+ }, s = {
27
+ args: {
28
+ variant: "info",
29
+ content: "Зміни вступлять в силу після збереження налаштувань профілю."
30
+ }
31
+ }, l = {
32
+ args: {
33
+ variant: "info",
34
+ icon: /* @__PURE__ */ t(n, { className: "text-blue-500" }),
35
+ content: "Цей блок використовує передану вручну іконку замість стандартної."
36
+ }
37
+ }, f = {
38
+ args: {
39
+ variant: "error",
40
+ content: "Дуже довгий текст: ".repeat(20)
41
+ }
42
+ };
43
+ export {
44
+ l as CustomIcon,
45
+ i as Error,
46
+ s as Info,
47
+ f as LongContent,
48
+ a as default
49
+ };
50
+ //# sourceMappingURL=InfoBlock.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoBlock.stories.js","sources":["../../src/InfoBlock/InfoBlock.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite';\r\nimport { InfoBlock } from './InfoBlock';\r\nimport { CircleAlert } from 'lucide-react';\r\n\r\nconst meta = {\r\n title: 'UI/InfoBlock',\r\n component: InfoBlock,\r\n argTypes: {\r\n variant: {\r\n control: 'select',\r\n options: ['error', 'info'],\r\n description: 'Defines the color scheme and default icon',\r\n },\r\n content: {\r\n control: 'text',\r\n description: 'Text or content inside the block',\r\n },\r\n },\r\n parameters: {\r\n layout: 'centered',\r\n },\r\n} satisfies Meta<typeof InfoBlock>;\r\n\r\nexport default meta;\r\n\r\ntype Story = StoryObj<typeof meta>;\r\n\r\nexport const Error: Story = {\r\n args: {\r\n variant: 'error',\r\n content: 'Увага! Перш ніж архівувати підрозділ “Підрозділ дизайну”, переведіть співробітників до іншого — інакше вони будуть автоматично звільнені.',\r\n },\r\n};\r\n\r\nexport const Info: Story = {\r\n args: {\r\n variant: 'info',\r\n content: 'Зміни вступлять в силу після збереження налаштувань профілю.',\r\n },\r\n};\r\n\r\nexport const CustomIcon: Story = {\r\n args: {\r\n variant: 'info',\r\n icon: <CircleAlert className=\"text-blue-500\" />,\r\n content: 'Цей блок використовує передану вручну іконку замість стандартної.',\r\n },\r\n};\r\n\r\nexport const LongContent: Story = {\r\n args: {\r\n variant: 'error',\r\n content: 'Дуже довгий текст: '.repeat(20),\r\n },\r\n};\r\n"],"names":["meta","InfoBlock","Error","Info","CustomIcon","jsx","CircleAlert","LongContent"],"mappings":";;;AAIA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,SAAS,CAAC,SAAS,MAAM;AAAA,MACzB,aAAa;AAAA,IAAA;AAAA,IAEf,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,YAAY;AAAA,IACV,QAAQ;AAAA,EAAA;AAEZ,GAMaC,IAAe;AAAA,EAC1B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAEb,GAEaC,IAAc;AAAA,EACzB,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAEb,GAEaC,IAAoB;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM,gBAAAC,EAACC,GAAA,EAAY,WAAU,gBAAA,CAAgB;AAAA,IAC7C,SAAS;AAAA,EAAA;AAEb,GAEaC,IAAqB;AAAA,EAChC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS,sBAAsB,OAAO,EAAE;AAAA,EAAA;AAE5C;"}
@@ -0,0 +1,9 @@
1
+ import { InfoBlockVariantsProps } from './infoBlockVariants';
2
+ import { ComponentType, HTMLAttributes, PropsWithChildren, ReactElement, ReactNode, SVGProps } from 'react';
3
+ export type InfoBlockIconType = ComponentType<SVGProps<SVGSVGElement>> | ReactElement<SVGProps<SVGSVGElement>>;
4
+ export interface InfoBlockProps extends PropsWithChildren, InfoBlockVariantsProps, Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
5
+ content?: ReactNode;
6
+ node?: ReactNode;
7
+ icon?: InfoBlockIconType;
8
+ }
9
+ //# sourceMappingURL=InfoBlock.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoBlock.types.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/InfoBlock.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,iBAAiB,GACzB,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GACtC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE1C,MAAM,WAAW,cACf,SAAQ,iBAAiB,EACvB,sBAAsB,EACtB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=InfoBlock.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoBlock.types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from './InfoBlock';
2
+ export type * from './InfoBlock.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,mBAAmB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { InfoBlock as r } from "./InfoBlock.js";
2
+ export {
3
+ r as InfoBlock
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,6 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ export declare const infoBlockVariants: (props?: ({
3
+ variant?: "error" | "info" | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
+ export type InfoBlockVariantsProps = VariantProps<typeof infoBlockVariants>;
6
+ //# sourceMappingURL=infoBlockVariants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infoBlockVariants.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/infoBlockVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,iBAAiB;;8EAqB7B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { cva as t } from "class-variance-authority";
2
+ const a = t(
3
+ [
4
+ "flex items-start gap-2",
5
+ "p-2.5 rounded-lg",
6
+ "font-medium text-base leading-normal text-[#06080D]",
7
+ "whitespace-pre-wrap break-words",
8
+ "[&>p]:m-0 [&>p]:p-0",
9
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-6",
10
+ "transition-transform duration-200 [&_svg]:transition-transform [&_svg]:duration-200"
11
+ ],
12
+ {
13
+ variants: {
14
+ variant: {
15
+ error: "bg-[#DC26260F] [&>svg]:text-[#DC2626]",
16
+ info: "bg-[#9368FF0F] [&>svg]:text-[#9368FF]"
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ variant: "error"
21
+ }
22
+ }
23
+ );
24
+ export {
25
+ a as infoBlockVariants
26
+ };
27
+ //# sourceMappingURL=infoBlockVariants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infoBlockVariants.js","sources":["../../src/InfoBlock/infoBlockVariants.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\r\n\r\nexport const infoBlockVariants = cva(\r\n [\r\n 'flex items-start gap-2',\r\n 'p-2.5 rounded-lg',\r\n 'font-medium text-base leading-normal text-[#06080D]',\r\n 'whitespace-pre-wrap break-words',\r\n '[&>p]:m-0 [&>p]:p-0',\r\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-6\",\r\n 'transition-transform duration-200 [&_svg]:transition-transform [&_svg]:duration-200',\r\n ],\r\n {\r\n variants: {\r\n variant: {\r\n error: 'bg-[#DC26260F] [&>svg]:text-[#DC2626]',\r\n info: 'bg-[#9368FF0F] [&>svg]:text-[#9368FF]',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'error',\r\n },\r\n }\r\n)\r\n\r\nexport type InfoBlockVariantsProps = VariantProps<typeof infoBlockVariants>;\r\n"],"names":["infoBlockVariants","cva"],"mappings":";AAEO,MAAMA,IAAoBC;AAAA,EAC/B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
@@ -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,qFAmDrB,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,qFAiErB,CAAC;AAGF,eAAO,MAAM,aAAa,qFAiBzB,CAAC;AAkBF,eAAO,MAAM,KAAK,qFAKjB,CAAC"}
package/Input/Input.js CHANGED
@@ -1,86 +1,100 @@
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
- import { cn as p } from "@oneplatformdev/utils";
6
- const m = u.forwardRef(
7
- (t, a) => {
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import c, { useState as P } from "react";
3
+ import { Eye as S, EyeOff as V } from "lucide-react";
4
+ import { inputVariants as B } from "./inputVariants.js";
5
+ import { cn as n } from "@oneplatformdev/utils";
6
+ const f = c.forwardRef(
7
+ (t, s) => {
8
8
  const {
9
- className: e,
9
+ className: a,
10
10
  variant: o,
11
- type: n,
12
- slotProps: { input: l, wrapper: c } = {},
13
- onChange: f,
14
- onTransform: d,
11
+ type: l,
12
+ slotProps: { input: i, wrapper: d } = {},
13
+ onChange: g,
14
+ onTransform: y,
15
+ counter: h = !1,
16
+ maxLength: p,
15
17
  fullSize: N = !1,
16
- ...g
18
+ value: w,
19
+ ...x
17
20
  } = t, {
18
- startAdornment: i,
19
- className: I,
20
- ...b
21
- } = l || {};
22
- return /* @__PURE__ */ w(
21
+ startAdornment: u,
22
+ className: v,
23
+ ...I
24
+ } = i || {};
25
+ return /* @__PURE__ */ m(
23
26
  "div",
24
27
  {
25
- ...c || {},
26
- className: p(
28
+ ...d || {},
29
+ className: n(
27
30
  "relative",
28
31
  N && "w-full",
29
- c?.className
32
+ d?.className
30
33
  ),
31
34
  children: [
32
- !!i && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: i }),
33
- /* @__PURE__ */ s(
35
+ !!u && /* @__PURE__ */ e("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: u }),
36
+ /* @__PURE__ */ e(
34
37
  "input",
35
38
  {
36
- type: n,
37
- className: p(
38
- x({ variant: o, className: e }),
39
- !!i && "pl-8",
40
- I,
39
+ type: l,
40
+ className: n(
41
+ B({ variant: o, className: a }),
42
+ !!u && "pl-10",
43
+ v,
41
44
  N && "min-w-auto"
42
45
  ),
43
- ref: a,
44
- ...b,
45
- ...g,
46
+ ref: s,
47
+ maxLength: p,
48
+ value: w,
49
+ ...I,
50
+ ...x,
46
51
  onChange: (r) => {
47
- typeof d?.(r.target.value, r) == "string" && (r.target.value = d(r.target.value, r)), f && f(r);
52
+ typeof y?.(r.target.value, r) == "string" && (r.target.value = y(r.target.value, r)), g && g(r);
48
53
  }
49
54
  }
50
- )
55
+ ),
56
+ h && typeof p == "number" && /* @__PURE__ */ m("div", { className: n(
57
+ "w-full text-right inline-flex items-center justify-end",
58
+ "text-xs font-medium leading-[1.2] text-muted-foreground",
59
+ "peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
60
+ ), children: [
61
+ String(w || "").length,
62
+ "/",
63
+ p
64
+ ] })
51
65
  ]
52
66
  }
53
67
  );
54
68
  }
55
69
  );
56
- m.displayName = "Input";
57
- const y = u.forwardRef(
58
- (t, a) => {
59
- const [e, o] = v(!1), n = e ? "text" : "password", l = () => {
60
- o(!e);
70
+ f.displayName = "Input";
71
+ const b = c.forwardRef(
72
+ (t, s) => {
73
+ const [a, o] = P(!1), l = a ? "text" : "password", i = () => {
74
+ o(!a);
61
75
  };
62
- return /* @__PURE__ */ w("div", { ...t?.slotProps?.wrapper || {}, className: p("relative", t?.slotProps?.wrapper?.className), children: [
63
- /* @__PURE__ */ s(m, { ...t, type: n, className: "pr-8", ref: a }),
64
- /* @__PURE__ */ s(V, { isVisible: e, onClick: l })
76
+ return /* @__PURE__ */ m("div", { ...t?.slotProps?.wrapper || {}, className: n("relative", t?.slotProps?.wrapper?.className), children: [
77
+ /* @__PURE__ */ e(f, { ...t, type: l, className: "pr-8", ref: s }),
78
+ /* @__PURE__ */ e(R, { isVisible: a, onClick: i })
65
79
  ] });
66
80
  }
67
81
  );
68
- y.displayName = "PasswordInput";
69
- const V = ({ isVisible: t, onClick: a }) => /* @__PURE__ */ s(
82
+ b.displayName = "PasswordInput";
83
+ const R = ({ isVisible: t, onClick: s }) => /* @__PURE__ */ e(
70
84
  "button",
71
85
  {
72
86
  type: "button",
73
- onClick: a,
87
+ onClick: s,
74
88
  className: "absolute top-1/2 right-3 transform -translate-y-1/2",
75
- children: t ? /* @__PURE__ */ s(h, { size: 16 }) : /* @__PURE__ */ s(P, { size: 16 })
89
+ children: t ? /* @__PURE__ */ e(S, { size: 16 }) : /* @__PURE__ */ e(V, { size: 16 })
76
90
  }
77
- ), B = u.forwardRef(
78
- ({ type: t, ...a }, e) => t === "password" ? /* @__PURE__ */ s(y, { type: t, ...a, ref: e }) : /* @__PURE__ */ s(m, { type: t, ...a, ref: e })
91
+ ), j = c.forwardRef(
92
+ ({ type: t, ...s }, a) => t === "password" ? /* @__PURE__ */ e(b, { type: t, ...s, ref: a }) : /* @__PURE__ */ e(f, { type: t, ...s, ref: a })
79
93
  );
80
- B.displayName = "Input";
94
+ j.displayName = "Input";
81
95
  export {
82
- m as BaseInput,
83
- B as Input,
84
- y as PasswordInput
96
+ f as BaseInput,
97
+ j as Input,
98
+ b as PasswordInput
85
99
  };
86
100
  //# 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 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;"}
1
+ {"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useState } from 'react';\r\nimport { Eye, EyeOff } from 'lucide-react';\r\nimport { inputVariants } from './inputVariants';\r\n\r\nimport { cn } from '@oneplatformdev/utils';\r\nimport { InputProps } from './Input.types';\r\n\r\nexport const BaseInput = React.forwardRef<HTMLInputElement, InputProps>(\r\n (props, ref) => {\r\n const {\r\n className,\r\n variant,\r\n type,\r\n slotProps: { input, wrapper } = {},\r\n onChange,\r\n onTransform,\r\n counter = false,\r\n maxLength,\r\n fullSize = false,\r\n value,\r\n ...rest\r\n } = props;\r\n const {\r\n startAdornment,\r\n className: classNameInputSlotProps,\r\n ...restInputSlotProps\r\n } = input || {};\r\n return (\r\n <div\r\n {...(wrapper || {})}\r\n className={cn(\r\n 'relative',\r\n fullSize && 'w-full',\r\n wrapper?.className\r\n )}>\r\n {Boolean(startAdornment) && (\r\n <span className=\"absolute left-[10px] top-1/2 -translate-y-1/2\">\r\n {startAdornment}\r\n </span>\r\n )}\r\n <input\r\n type={type}\r\n className={cn(\r\n inputVariants({ variant, className }),\r\n Boolean(startAdornment) && 'pl-10',\r\n classNameInputSlotProps,\r\n fullSize && 'min-w-auto',\r\n )}\r\n ref={ref}\r\n maxLength={maxLength}\r\n value={value}\r\n {...restInputSlotProps}\r\n {...rest}\r\n onChange={(e) => {\r\n if (typeof onTransform?.(e.target.value, e) === 'string') {\r\n e.target.value = onTransform(e.target.value, e);\r\n }\r\n if (onChange) onChange(e);\r\n }}\r\n />\r\n {counter && typeof maxLength === 'number' && (\r\n <div className={cn(\r\n 'w-full text-right inline-flex items-center justify-end',\r\n 'text-xs font-medium leading-[1.2] text-muted-foreground',\r\n 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\r\n )}>\r\n {String(value || '').length}/{maxLength}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n);\r\nBaseInput.displayName = 'Input';\r\n\r\nexport const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(\r\n (props, ref) => {\r\n const [isVisible, setIsVisible] = useState<boolean>(false);\r\n\r\n const inputType = isVisible ? 'text' : 'password';\r\n\r\n const toggleVisibility = () => {\r\n setIsVisible(!isVisible);\r\n };\r\n\r\n return (\r\n <div {...(props?.slotProps?.wrapper || {})} className={cn('relative', props?.slotProps?.wrapper?.className)}>\r\n <BaseInput {...props} type={inputType} className=\"pr-8\" ref={ref} />\r\n <VisibilityButton isVisible={isVisible} onClick={toggleVisibility} />\r\n </div>\r\n );\r\n }\r\n);\r\nPasswordInput.displayName = 'PasswordInput';\r\n\r\ntype VisibilityButtonProps = {\r\n isVisible: boolean\r\n onClick: () => void\r\n}\r\n\r\nconst VisibilityButton = ({ isVisible, onClick }:VisibilityButtonProps) => (\r\n <button\r\n type=\"button\"\r\n onClick={onClick}\r\n className=\"absolute top-1/2 right-3 transform -translate-y-1/2\"\r\n >\r\n {isVisible ? <Eye size={16} /> : <EyeOff size={16} />}\r\n </button>\r\n);\r\n\r\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\r\n ({ type, ...props }, ref) => {\r\n if (type === 'password') return <PasswordInput type={type} {...props} ref={ref} />;\r\n return <BaseInput type={type} {...props} ref={ref} />;\r\n }\r\n);\r\nInput.displayName = 'Input';\r\n"],"names":["BaseInput","React","props","ref","className","variant","type","input","wrapper","onChange","onTransform","counter","maxLength","fullSize","value","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,SAAAC,IAAU;AAAA,MACV,WAAAC;AAAA,MACA,UAAAC,IAAW;AAAA,MACX,OAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDb,GACE;AAAA,MACJ,gBAAAc;AAAA,MACA,WAAWC;AAAA,MACX,GAAGC;AAAA,IAAA,IACDX,KAAS,CAAA;AACb,WACE,gBAAAY;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAIX,KAAW,CAAA;AAAA,QAChB,WAAWY;AAAA,UACT;AAAA,UACAP,KAAY;AAAA,UACZL,GAAS;AAAA,QAAA;AAAA,QAEV,UAAA;AAAA,UAAA,EAAQQ,KACP,gBAAAK,EAAC,QAAA,EAAK,WAAU,iDACb,UAAAL,GACH;AAAA,UAEF,gBAAAK;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAAf;AAAA,cACA,WAAWc;AAAA,gBACTE,EAAc,EAAE,SAAAjB,GAAS,WAAAD,GAAW;AAAA,gBACpC,EAAQY,KAAmB;AAAA,gBAC3BC;AAAA,gBACAJ,KAAY;AAAA,cAAA;AAAA,cAEd,KAAAV;AAAA,cACA,WAAAS;AAAA,cACA,OAAAE;AAAA,cACC,GAAGI;AAAA,cACH,GAAGH;AAAA,cACJ,UAAU,CAACQ,MAAM;AACf,gBAAI,OAAOb,IAAca,EAAE,OAAO,OAAOA,CAAC,KAAM,aAC9CA,EAAE,OAAO,QAAQb,EAAYa,EAAE,OAAO,OAAOA,CAAC,IAE5Cd,OAAmBc,CAAC;AAAA,cAC1B;AAAA,YAAA;AAAA,UAAA;AAAA,UAEDZ,KAAW,OAAOC,KAAc,YAC/B,gBAAAO,EAAC,SAAI,WAAWC;AAAA,YACd;AAAA,YACA;AAAA,YACA;AAAA,UAAA,GAEC,UAAA;AAAA,YAAA,OAAON,KAAS,EAAE,EAAE;AAAA,YAAO;AAAA,YAAEF;AAAA,UAAA,EAAA,CAChC;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACAZ,EAAU,cAAc;AAEjB,MAAMwB,IAAgBvB,EAAM;AAAA,EACjC,CAACC,GAAOC,MAAQ;AACd,UAAM,CAACsB,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,GAAIjB,GAAO,WAAW,WAAW,CAAA,GAAK,WAAWkB,EAAG,YAAYlB,GAAO,WAAW,SAAS,SAAS,GACxG,UAAA;AAAA,MAAA,gBAAAmB,EAACrB,KAAW,GAAGE,GAAO,MAAM0B,GAAW,WAAU,QAAO,KAAAzB,GAAU;AAAA,MAClE,gBAAAkB,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,IAAQjC,EAAM;AAAA,EACzB,CAAC,EAAE,MAAAK,GAAM,GAAGJ,EAAA,GAASC,MACfG,MAAS,aAAmB,gBAAAe,EAACG,KAAc,MAAAlB,GAAa,GAAGJ,GAAO,KAAAC,GAAU,IACzE,gBAAAkB,EAACrB,GAAA,EAAU,MAAAM,GAAa,GAAGJ,GAAO,KAAAC,GAAU;AAEvD;AACA+B,EAAM,cAAc;"}
@@ -16,5 +16,6 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>,
16
16
  /** func transform pasted value before set to input */
17
17
  onPastePrepare?: (value: string, event: React.ClipboardEvent<HTMLInputElement>) => string;
18
18
  fullSize?: boolean;
19
+ counter?: boolean;
19
20
  }
20
21
  //# 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;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
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;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"inputVariants.d.ts","sourceRoot":"","sources":["../../src/Input/inputVariants.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;8EAmBzB,CAAC"}
1
+ {"version":3,"file":"inputVariants.d.ts","sourceRoot":"","sources":["../../src/Input/inputVariants.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;8EAoBzB,CAAC"}
@@ -1,11 +1,12 @@
1
- import { cva as e } from "class-variance-authority";
2
- const t = e(
1
+ import { cva as r } from "class-variance-authority";
2
+ const t = r(
3
3
  [
4
- "flex h-10 w-full rounded-md border border-input px-3 py-2",
4
+ "flex h-10 w-full rounded-lg border border-input px-3 py-2",
5
5
  "text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground",
6
6
  "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
7
7
  "group-data-[state=invalid]/form-control:border-destructive",
8
- "group-data-[state=valid]/form-control:border-input"
8
+ "group-data-[state=valid]/form-control:border-input",
9
+ "box-border"
9
10
  ],
10
11
  {
11
12
  variants: {
@@ -1 +1 @@
1
- {"version":3,"file":"inputVariants.js","sources":["../../src/Input/inputVariants.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const inputVariants = cva(\n [\n 'flex h-10 w-full rounded-md border border-input px-3 py-2',\n 'text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n 'group-data-[state=invalid]/form-control:border-destructive',\n 'group-data-[state=valid]/form-control:border-input',\n ],\n {\n variants: {\n variant: {\n default: 'bg-background',\n grey: 'bg-slate-200',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n"],"names":["inputVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC;AAAA,EAC3B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
1
+ {"version":3,"file":"inputVariants.js","sources":["../../src/Input/inputVariants.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\r\n\r\nexport const inputVariants = cva(\r\n [\r\n 'flex h-10 w-full rounded-lg border border-input px-3 py-2',\r\n 'text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground',\r\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\r\n 'group-data-[state=invalid]/form-control:border-destructive',\r\n 'group-data-[state=valid]/form-control:border-input',\r\n 'box-border',\r\n ],\r\n {\r\n variants: {\r\n variant: {\r\n default: 'bg-background',\r\n grey: 'bg-slate-200',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'default',\r\n },\r\n }\r\n);\r\n"],"names":["inputVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC;AAAA,EAC3B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputOTP.d.ts","sourceRoot":"","sources":["../../src/InputOTP/InputOTP.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,QAAA,MAAM,QAAQ;;;;;kBAUqC,GAAG;;;;;;;;;;;;;kBAAH,GAAG;;;;;;;;2FAGpD,CAAA;AAGF,QAAA,MAAM,aAAa,mKAKjB,CAAA;AAGF,QAAA,MAAM,YAAY;WAEiC,MAAM;wCAuBvD,CAAA;AAGF,QAAA,MAAM,iBAAiB,mKAOrB,CAAA;AAGF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"InputOTP.d.ts","sourceRoot":"","sources":["../../src/InputOTP/InputOTP.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,QAAA,MAAM,QAAQ;;;;;kBAUmB,GAAG;;;;;;;;;;;;;kBAAH,GAAG;;;;;;;;2FAGlC,CAAA;AAGF,QAAA,MAAM,aAAa,mKAKjB,CAAA;AAGF,QAAA,MAAM,YAAY;WAEiC,MAAM;wCAuBvD,CAAA;AAGF,QAAA,MAAM,iBAAiB,mKAOrB,CAAA;AAGF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputOTP.js","sources":["../../src/InputOTP/InputOTP.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { Minus } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\";\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n))\nInputOTP.displayName = \"InputOTP\"\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n))\nInputOTPGroup.displayName = \"InputOTPGroup\"\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\n isActive && \"z-10 ring-1 ring-ring\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-foreground duration-1000\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = \"InputOTPSlot\"\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Minus />\n </div>\n))\nInputOTPSeparator.displayName = \"InputOTPSeparator\"\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }\n"],"names":["InputOTP","React","className","containerClassName","props","ref","jsx","OTPInput","cn","InputOTPGroup","InputOTPSlot","index","inputOTPContext","OTPInputContext","char","hasFakeCaret","isActive","jsxs","InputOTPSeparator","Minus"],"mappings":";;;;;AAQA,MAAMA,IAAWC,EAAM,WAGrB,CAAC,EAAE,WAAAC,GAAW,oBAAAC,GAAoB,GAAGC,KAASC,MAC9C,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,oBAAoBG;AAAA,MAClB;AAAA,MACAL;AAAA,IAAA;AAAA,IAEF,WAAWK,EAAG,+BAA+BN,CAAS;AAAA,IACrD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAS,cAAc;AAEvB,MAAMS,IAAgBR,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGE,KAASC,wBACzB,OAAA,EAAI,KAAAA,GAAU,WAAWG,EAAG,qBAAqBN,CAAS,GAAI,GAAGE,GAAO,CAC1E;AACDK,EAAc,cAAc;AAE5B,MAAMC,IAAeT,EAAM,WAGzB,CAAC,EAAE,OAAAU,GAAO,WAAAT,GAAW,GAAGE,EAAA,GAASC,MAAQ;AACzC,QAAMO,IAAkBX,EAAM,WAAWY,CAAe,GAClD,EAAE,MAAAC,GAAM,cAAAC,GAAc,UAAAC,MAAaJ,EAAgB,MAAMD,CAAK;AAEpE,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAQ,KAAY;AAAA,QACZd;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAU;AAAA,QACAC,uBACE,OAAA,EAAI,WAAU,yEACb,UAAA,gBAAAT,EAAC,OAAA,EAAI,WAAU,2DAAA,CAA2D,EAAA,CAC5E;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AACDI,EAAa,cAAc;AAE3B,MAAMQ,IAAoBjB,EAAM,WAG9B,CAAC,EAAE,GAAGG,KAASC,wBACd,OAAA,EAAI,KAAAA,GAAU,MAAK,aAAa,GAAGD,GAClC,UAAA,gBAAAE,EAACa,GAAA,CAAA,CAAM,GACT,CACD;AACDD,EAAkB,cAAc;"}
1
+ {"version":3,"file":"InputOTP.js","sources":["../../src/InputOTP/InputOTP.tsx"],"sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport { OTPInput, OTPInputContext } from \"input-otp\"\r\nimport { Minus } from \"lucide-react\"\r\n\r\nimport { cn } from \"@oneplatformdev/utils\";\r\n\r\nconst InputOTP = React.forwardRef<\r\n React.ElementRef<typeof OTPInput>,\r\n React.ComponentPropsWithoutRef<typeof OTPInput>\r\n>(({ className, containerClassName, ...props }, ref) => (\r\n <OTPInput\r\n ref={ref}\r\n containerClassName={cn(\r\n \"flex items-center gap-2 has-disabled:opacity-50\",\r\n containerClassName\r\n )}\r\n className={cn(\"disabled:cursor-not-allowed\", className)}\r\n {...props}\r\n />\r\n))\r\nInputOTP.displayName = \"InputOTP\"\r\n\r\nconst InputOTPGroup = React.forwardRef<\r\n React.ElementRef<\"div\">,\r\n React.ComponentPropsWithoutRef<\"div\">\r\n>(({ className, ...props }, ref) => (\r\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\r\n))\r\nInputOTPGroup.displayName = \"InputOTPGroup\"\r\n\r\nconst InputOTPSlot = React.forwardRef<\r\n React.ElementRef<\"div\">,\r\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\r\n>(({ index, className, ...props }, ref) => {\r\n const inputOTPContext = React.useContext(OTPInputContext)\r\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(\r\n \"relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\r\n isActive && \"z-10 ring-1 ring-ring\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {char}\r\n {hasFakeCaret && (\r\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\r\n <div className=\"h-4 w-px animate-caret-blink bg-foreground duration-1000\" />\r\n </div>\r\n )}\r\n </div>\r\n )\r\n})\r\nInputOTPSlot.displayName = \"InputOTPSlot\"\r\n\r\nconst InputOTPSeparator = React.forwardRef<\r\n React.ElementRef<\"div\">,\r\n React.ComponentPropsWithoutRef<\"div\">\r\n>(({ ...props }, ref) => (\r\n <div ref={ref} role=\"separator\" {...props}>\r\n <Minus />\r\n </div>\r\n))\r\nInputOTPSeparator.displayName = \"InputOTPSeparator\"\r\n\r\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }\r\n"],"names":["InputOTP","React","className","containerClassName","props","ref","jsx","OTPInput","cn","InputOTPGroup","InputOTPSlot","index","inputOTPContext","OTPInputContext","char","hasFakeCaret","isActive","jsxs","InputOTPSeparator","Minus"],"mappings":";;;;;AAQA,MAAMA,IAAWC,EAAM,WAGrB,CAAC,EAAE,WAAAC,GAAW,oBAAAC,GAAoB,GAAGC,KAASC,MAC9C,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,oBAAoBG;AAAA,MAClB;AAAA,MACAL;AAAA,IAAA;AAAA,IAEF,WAAWK,EAAG,+BAA+BN,CAAS;AAAA,IACrD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAS,cAAc;AAEvB,MAAMS,IAAgBR,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGE,KAASC,wBACzB,OAAA,EAAI,KAAAA,GAAU,WAAWG,EAAG,qBAAqBN,CAAS,GAAI,GAAGE,GAAO,CAC1E;AACDK,EAAc,cAAc;AAE5B,MAAMC,IAAeT,EAAM,WAGzB,CAAC,EAAE,OAAAU,GAAO,WAAAT,GAAW,GAAGE,EAAA,GAASC,MAAQ;AACzC,QAAMO,IAAkBX,EAAM,WAAWY,CAAe,GAClD,EAAE,MAAAC,GAAM,cAAAC,GAAc,UAAAC,MAAaJ,EAAgB,MAAMD,CAAK;AAEpE,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAQ,KAAY;AAAA,QACZd;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAU;AAAA,QACAC,uBACE,OAAA,EAAI,WAAU,yEACb,UAAA,gBAAAT,EAAC,OAAA,EAAI,WAAU,2DAAA,CAA2D,EAAA,CAC5E;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AACDI,EAAa,cAAc;AAE3B,MAAMQ,IAAoBjB,EAAM,WAG9B,CAAC,EAAE,GAAGG,KAASC,wBACd,OAAA,EAAI,KAAAA,GAAU,MAAK,aAAa,GAAGD,GAClC,UAAA,gBAAAE,EAACa,GAAA,CAAA,CAAM,GACT,CACD;AACDD,EAAkB,cAAc;"}
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2025 Oleh Maksimenko
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Oleh Maksimenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sources":["../../src/Label/Label.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction Label(props: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { className, ...rest } = props;\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...rest}\n />\n )\n}\nexport { Label, LabelPrimitive }\n\nexport default Label;\n"],"names":["Label","props","className","rest","jsx","LabelPrimitive","cn"],"mappings":";;;AAOA,SAASA,EAAMC,GAAyD;AACtE,QAAM,EAAE,WAAAC,GAAW,GAAGC,EAAA,IAASF;AAC/B,SACE,gBAAAG;AAAA,IAACC,EAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"Label.js","sources":["../../src/Label/Label.tsx"],"sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\r\n\r\nimport { cn } from \"@oneplatformdev/utils\"\r\n\r\nfunction Label(props: React.ComponentProps<typeof LabelPrimitive.Root>) {\r\n const { className, ...rest } = props;\r\n return (\r\n <LabelPrimitive.Root\r\n data-slot=\"label\"\r\n className={cn(\r\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\r\n className\r\n )}\r\n {...rest}\r\n />\r\n )\r\n}\r\nexport { Label, LabelPrimitive }\r\n\r\nexport default Label;\r\n"],"names":["Label","props","className","rest","jsx","LabelPrimitive","cn"],"mappings":";;;AAOA,SAASA,EAAMC,GAAyD;AACtE,QAAM,EAAE,WAAAC,GAAW,GAAGC,EAAA,IAASF;AAC/B,SACE,gBAAAG;AAAA,IAACC,EAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1 +1 @@
1
- {"version":3,"file":"labelVariants.js","sources":["../../src/Label/labelVariants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const labelVariants = cva([\n 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n 'text-md font-medium leading-[150%]',\n 'group-data-[state=valid]/form-control:text-[#363B4E]',\n 'group-data-[state=invalid]/form-control:text-destructive',\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n]);\n"],"names":["labelVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC,EAAI;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;"}
1
+ {"version":3,"file":"labelVariants.js","sources":["../../src/Label/labelVariants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\r\n\r\nexport const labelVariants = cva([\r\n 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\r\n 'text-md font-medium leading-[150%]',\r\n 'group-data-[state=valid]/form-control:text-[#363B4E]',\r\n 'group-data-[state=invalid]/form-control:text-destructive',\r\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\r\n]);\r\n"],"names":["labelVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC,EAAI;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;"}
@@ -1,9 +1,8 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Suspense as a } from "react";
3
- import { LoadingMask as e } from "../LoadingMask/LoadingMask.js";
4
- import "../LoadingMask/RenderLoadingMask.js";
5
- const s = (r, m = !0) => (t) => /* @__PURE__ */ o(a, { fallback: m ? /* @__PURE__ */ o(e, {}) : null, children: /* @__PURE__ */ o(r, { ...t }) });
2
+ import { Suspense as m } from "react";
3
+ import { LoadingMask as t } from "../LoadingMask/LoadingMask.js";
4
+ const p = (r, a = !0) => (e) => /* @__PURE__ */ o(m, { fallback: a ? /* @__PURE__ */ o(t, {}) : null, children: /* @__PURE__ */ o(r, { ...e }) });
6
5
  export {
7
- s as LazyLoader
6
+ p as LazyLoader
8
7
  };
9
8
  //# sourceMappingURL=LazyLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LazyLoader.js","sources":["../../src/LazyLoader/LazyLoader.tsx"],"sourcesContent":["import React, { JSX, Suspense } from 'react';\n\nimport { LoadingMask } from '../LoadingMask';\n\n// TODO: types any\n/**\n * Component lazy load component.\n * @public\n * @see [Documentation](#)\n * @example\n * ```tsx\n * import { lazy } from 'react';\n * import { LazyLoader } from '@oneplatformdev/ui/LazyLoader';\n *\n * const ModuleComponentViewLazy = LazyLoader(\n * lazy(() => import('path/to/module').then(module => ({\n * default: module.ModuleComponentView,\n * })),\n * ),\n * );\n * ```\n */\nexport const LazyLoader =\n (Component: React.LazyExoticComponent<any>, showLoader = true) =>\n (props: any): JSX.Element =>\n (\n <Suspense fallback={showLoader ? <LoadingMask /> : null}>\n <Component {...props} />\n </Suspense>\n );\n"],"names":["LazyLoader","Component","showLoader","props","jsx","Suspense","LoadingMask"],"mappings":";;;;AAsBO,MAAMA,IACX,CAACC,GAA2CC,IAAa,OACzD,CAACC,MAEG,gBAAAC,EAACC,GAAA,EAAS,UAAUH,IAAa,gBAAAE,EAACE,KAAY,IAAK,MACjD,4BAACL,GAAA,EAAW,GAAGE,GAAO,EAAA,CACxB;"}
1
+ {"version":3,"file":"LazyLoader.js","sources":["../../src/LazyLoader/LazyLoader.tsx"],"sourcesContent":["import React, { JSX, Suspense } from 'react';\r\n\r\nimport { LoadingMask } from '../LoadingMask';\r\n\r\n// TODO: types any\r\n/**\r\n * Component lazy load component.\r\n * @public\r\n * @see [Documentation](#)\r\n * @example\r\n * ```tsx\r\n * import { lazy } from 'react';\r\n * import { LazyLoader } from '@oneplatformdev/ui/LazyLoader';\r\n *\r\n * const ModuleComponentViewLazy = LazyLoader(\r\n * lazy(() => import('path/to/module').then(module => ({\r\n * default: module.ModuleComponentView,\r\n * })),\r\n * ),\r\n * );\r\n * ```\r\n */\r\nexport const LazyLoader =\r\n (Component: React.LazyExoticComponent<any>, showLoader = true) =>\r\n (props: any): JSX.Element =>\r\n (\r\n <Suspense fallback={showLoader ? <LoadingMask /> : null}>\r\n <Component {...props} />\r\n </Suspense>\r\n );\r\n"],"names":["LazyLoader","Component","showLoader","props","jsx","Suspense","LoadingMask"],"mappings":";;;AAsBO,MAAMA,IACX,CAACC,GAA2CC,IAAa,OACzD,CAACC,MAEG,gBAAAC,EAACC,GAAA,EAAS,UAAUH,IAAa,gBAAAE,EAACE,KAAY,IAAK,MACjD,4BAACL,GAAA,EAAW,GAAGE,GAAO,EAAA,CACxB;"}
@@ -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 '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
+ {"version":3,"file":"LoadedIcon.js","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\r\nimport { LoaderCircleIcon } from 'lucide-react';\r\nimport { FC, HTMLAttributes, PropsWithChildren } from 'react';\r\n\r\nimport { cn } from '@oneplatformdev/utils';\r\n\r\nconst loadedIconVariants = cva([\r\n 'relative',\r\n], {\r\n variants: {\r\n size: {\r\n inherit: '[&_svg]:size-inherit',\r\n xs: '[&_svg]:size-3',\r\n sm: '[&_svg]:size-4',\r\n md: '[&_svg]:size-5',\r\n lg: '[&_svg]:size-6',\r\n },\r\n },\r\n defaultVariants: { size: 'inherit' },\r\n});\r\n\r\ninterface ILoadedIconProps\r\n extends HTMLAttributes<HTMLDivElement>,\r\n VariantProps<typeof loadedIconVariants> {\r\n loading?: boolean;\r\n}\r\n\r\nexport const LoadedIcon: FC<PropsWithChildren<ILoadedIconProps>> = (props) => {\r\n const { loading, children, size = 'md', className, ...rest } = props;\r\n return (\r\n <div\r\n {...rest}\r\n className={cn(loadedIconVariants({ size, className }))}\r\n >\r\n {loading\r\n ? <LoaderCircleIcon className=\"animate-spin\"/>\r\n : children}\r\n </div>\r\n );\r\n};\r\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,3 @@
1
- import { FC } from 'react';
2
1
  import { ILoadingMaskProps } from './LoadingMask.types';
3
- export declare const LoadingMask: FC<ILoadingMaskProps>;
2
+ export declare const LoadingMask: (props: ILoadingMaskProps) => import("react/jsx-runtime").JSX.Element | null;
4
3
  //# sourceMappingURL=LoadingMask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingMask.d.ts","sourceRoot":"","sources":["../../src/LoadingMask/LoadingMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,iBAAiB,CAe7C,CAAC"}
1
+ {"version":3,"file":"LoadingMask.d.ts","sourceRoot":"","sources":["../../src/LoadingMask/LoadingMask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,eAAO,MAAM,WAAW,GAAI,OAAO,iBAAiB,mDAgBnD,CAAC"}