@oneplatformdev/ui 0.1.99-beta.262 → 0.1.99-beta.265

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 (193) hide show
  1. package/Accordion/Accordion.js.map +1 -1
  2. package/Alert/Alert.js.map +1 -1
  3. package/Alert/alertVariants.js.map +1 -1
  4. package/AlertDialog/AlertDialog.js.map +1 -1
  5. package/AlertDialog/AlertDialog.stories.js +2 -4
  6. package/AlertDialog/AlertDialog.stories.js.map +1 -1
  7. package/AlertDialog/AlertDialogRoot.js +18 -20
  8. package/AlertDialog/AlertDialogRoot.js.map +1 -1
  9. package/AreaChart/AreaChart.js.map +1 -1
  10. package/Aside/Aside.js.map +1 -1
  11. package/Aside/AsideSidebar.js.map +1 -1
  12. package/AspectRatio/AspectRatio.js.map +1 -1
  13. package/Avatar/Avatar.js.map +1 -1
  14. package/Badge/Badge.js.map +1 -1
  15. package/Badge/badgeVariants.js.map +1 -1
  16. package/Breadcrumb/Breadcrumb.js.map +1 -1
  17. package/Button/Button.js +10 -11
  18. package/Button/Button.js.map +1 -1
  19. package/Button/Button.stories.js +1 -1
  20. package/Button/Button.stories.js.map +1 -1
  21. package/Button/Button.utils.js.map +1 -1
  22. package/Button/ButtonCounterBadge.js.map +1 -1
  23. package/Button/buttonVariants.js.map +1 -1
  24. package/ButtonIcon/ButtonIcon.js +19 -22
  25. package/ButtonIcon/ButtonIcon.js.map +1 -1
  26. package/ButtonIcon/ButtonIcon.stories.js +1 -1
  27. package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
  28. package/ButtonIcon/buttonIconVariants.js.map +1 -1
  29. package/CHANGELOG.md +3401 -3385
  30. package/Calendar/Calendar.js +4 -6
  31. package/Calendar/Calendar.js.map +1 -1
  32. package/Card/Card.js.map +1 -1
  33. package/Carousel/Carousel.js +6 -7
  34. package/Carousel/Carousel.js.map +1 -1
  35. package/Chart/Chart.js.map +1 -1
  36. package/Checkbox/Checkbox.js +0 -1
  37. package/Checkbox/Checkbox.js.map +1 -1
  38. package/Checkbox/Checkbox.stories.js.map +1 -1
  39. package/Collapsible/Collapsible.js.map +1 -1
  40. package/Combobox/Combobox.js +10 -10
  41. package/Combobox/Combobox.js.map +1 -1
  42. package/Combobox/Combobox.stories.js.map +1 -1
  43. package/Combobox/Combobox.types.js.map +1 -1
  44. package/Combobox/ComboboxOptionItem.js +18 -19
  45. package/Combobox/ComboboxOptionItem.js.map +1 -1
  46. package/Combobox/ComboboxRenderContent.js +26 -27
  47. package/Combobox/ComboboxRenderContent.js.map +1 -1
  48. package/Combobox/ComboboxRenderOptions.js +5 -5
  49. package/Combobox/ComboboxRenderOptions.js.map +1 -1
  50. package/Combobox/ComboboxRenderTrigger.js +28 -30
  51. package/Combobox/ComboboxRenderTrigger.js.map +1 -1
  52. package/Command/Command.js +21 -22
  53. package/Command/Command.js.map +1 -1
  54. package/ContextPopover/ContextDropdownMenu.js.map +1 -1
  55. package/ContextPopover/ContextPopover.js.map +1 -1
  56. package/ContextPopover/useContextPopoverHandler.js.map +1 -1
  57. package/DataTable/DataTable.js +24 -26
  58. package/DataTable/DataTable.js.map +1 -1
  59. package/DataTable/DataTableColumnFilter.js +6 -7
  60. package/DataTable/DataTableColumnFilter.js.map +1 -1
  61. package/DataTable/useDataTable.js.map +1 -1
  62. package/DatePicker/DatePicker.js +12 -13
  63. package/DatePicker/DatePicker.js.map +1 -1
  64. package/Dialog/Dialog.js +20 -21
  65. package/Dialog/Dialog.js.map +1 -1
  66. package/Dialog/Dialog.stories.js +14 -15
  67. package/Dialog/Dialog.stories.js.map +1 -1
  68. package/Dialog/DialogOverlayScope.js.map +1 -1
  69. package/Dialog/useDialogClosePosition.js.map +1 -1
  70. package/Drawer/Drawer.js.map +1 -1
  71. package/DropdownMenu/DropdownMenu.js.map +1 -1
  72. package/Dropzone/Dropzone.d.ts.map +1 -1
  73. package/Dropzone/Dropzone.js +321 -159
  74. package/Dropzone/Dropzone.js.map +1 -1
  75. package/Dropzone/Dropzone.stories.js +257 -63
  76. package/Dropzone/Dropzone.stories.js.map +1 -1
  77. package/Dropzone/Dropzone.types.d.ts +17 -1
  78. package/Dropzone/Dropzone.types.d.ts.map +1 -1
  79. package/Dropzone/Dropzone.types.js +18 -7
  80. package/Dropzone/Dropzone.types.js.map +1 -1
  81. package/Dropzone/DropzoneFilePreview.d.ts.map +1 -1
  82. package/Dropzone/DropzoneFilePreview.js +45 -24
  83. package/Dropzone/DropzoneFilePreview.js.map +1 -1
  84. package/Dropzone/DropzoneSinglePickPreview.d.ts +5 -2
  85. package/Dropzone/DropzoneSinglePickPreview.d.ts.map +1 -1
  86. package/Dropzone/DropzoneSinglePickPreview.js +120 -22
  87. package/Dropzone/DropzoneSinglePickPreview.js.map +1 -1
  88. package/Dropzone/DropzoneUtils.js.map +1 -1
  89. package/Dropzone/index.js +7 -5
  90. package/Form/Form.js +14 -15
  91. package/Form/Form.js.map +1 -1
  92. package/Form/FormRenderControl.js +6 -7
  93. package/Form/FormRenderControl.js.map +1 -1
  94. package/Form/Form_old.js +4 -5
  95. package/Form/Form_old.js.map +1 -1
  96. package/FormCheckbox/FormCheckbox.js +4 -4
  97. package/FormCheckbox/FormCheckbox.js.map +1 -1
  98. package/FormCombobox/FormCombobox.js +4 -4
  99. package/FormCombobox/FormCombobox.js.map +1 -1
  100. package/FormDatePicker/FormDatePicker.js +4 -4
  101. package/FormDatePicker/FormDatePicker.js.map +1 -1
  102. package/FormDropzone/FormDropzone.js +3 -3
  103. package/FormDropzone/FormDropzone.js.map +1 -1
  104. package/FormInput/FormInput.js +6 -6
  105. package/FormInput/FormInput.js.map +1 -1
  106. package/FormInput/FormInput.stories.js.map +1 -1
  107. package/FormRadio/FormRadio.js.map +1 -1
  108. package/FormSelect/FormSelect.js +6 -9
  109. package/FormSelect/FormSelect.js.map +1 -1
  110. package/FormTextarea/FormTextarea.js +4 -4
  111. package/FormTextarea/FormTextarea.js.map +1 -1
  112. package/Header/Header.js.map +1 -1
  113. package/HoverCard/HoverCard.js.map +1 -1
  114. package/InfoBlock/InfoBlock.js.map +1 -1
  115. package/InfoBlock/InfoBlock.stories.js.map +1 -1
  116. package/InfoBlock/infoBlockVariants.js.map +1 -1
  117. package/Input/Input.d.ts.map +1 -1
  118. package/Input/Input.js +95 -58
  119. package/Input/Input.js.map +1 -1
  120. package/Input/Input.stories.js +112 -41
  121. package/Input/Input.stories.js.map +1 -1
  122. package/Input/Input.types.d.ts +4 -0
  123. package/Input/Input.types.d.ts.map +1 -1
  124. package/Input/inputVariants.js.map +1 -1
  125. package/InputOTP/InputOTP.d.ts.map +1 -1
  126. package/InputOTP/InputOTP.js.map +1 -1
  127. package/LICENSE +21 -21
  128. package/Label/Label.js.map +1 -1
  129. package/Label/labelVariants.js.map +1 -1
  130. package/LazyLoader/LazyLoader.js +4 -5
  131. package/LazyLoader/LazyLoader.js.map +1 -1
  132. package/LoadedIcon/LoadedIcon.js.map +1 -1
  133. package/LoadingMask/LoadingMask.js.map +1 -1
  134. package/LoadingMask/RenderLoadingMask.js.map +1 -1
  135. package/LoadingProgress/LoadingProgress.js.map +1 -1
  136. package/LoadingProgress/loadingProgressVariants.js.map +1 -1
  137. package/Menubar/Menubar.js.map +1 -1
  138. package/NavigationMenu/NavigationMenu.js.map +1 -1
  139. package/NavigationMenu/navigationMenuVariants.js.map +1 -1
  140. package/Pagination/Pagination.js +0 -1
  141. package/Pagination/Pagination.js.map +1 -1
  142. package/Popover/Popover.js.map +1 -1
  143. package/Progress/Progress.js.map +1 -1
  144. package/README.md +7 -7
  145. package/Radio/Radio.js.map +1 -1
  146. package/RadioGroup/RadioGroup.js.map +1 -1
  147. package/Resizable/Resizable.js.map +1 -1
  148. package/Resizable/Resizable.stories.js.map +1 -1
  149. package/ScrollArea/ScrollArea.js.map +1 -1
  150. package/Search/Search.js +9 -9
  151. package/Search/Search.js.map +1 -1
  152. package/Search/Search.stories.js.map +1 -1
  153. package/Select/Select.js +6 -7
  154. package/Select/Select.js.map +1 -1
  155. package/Select/Select.stories.js.map +1 -1
  156. package/Select/SelectRoot.js.map +1 -1
  157. package/Separator/Separator.js.map +1 -1
  158. package/Sheet/Sheet.js.map +1 -1
  159. package/Sidebar/Sidebar.js +20 -21
  160. package/Sidebar/Sidebar.js.map +1 -1
  161. package/Skeleton/Skeleton.js.map +1 -1
  162. package/Slider/Slider.js.map +1 -1
  163. package/Sonner/Sonner.js.map +1 -1
  164. package/Switch/Switch.js.map +1 -1
  165. package/Switch/Switch.stories.js.map +1 -1
  166. package/Table/Table.js.map +1 -1
  167. package/TablePagination/TablePagination.js +21 -26
  168. package/TablePagination/TablePagination.js.map +1 -1
  169. package/Tabs/Tabs.js.map +1 -1
  170. package/Tabs/TabsRoot.js.map +1 -1
  171. package/Textarea/Textarea.js.map +1 -1
  172. package/Textarea/Textarea.stories.js.map +1 -1
  173. package/Textarea/useAutosizeTextArea.js.map +1 -1
  174. package/Theme/ThemeModeToggle.js +3 -4
  175. package/Theme/ThemeModeToggle.js.map +1 -1
  176. package/Theme/ThemeProvider.js.map +1 -1
  177. package/Toast/Toast.js.map +1 -1
  178. package/Toast/toast.constants.js.map +1 -1
  179. package/Toast/toastVariants.js.map +1 -1
  180. package/Toast/useToast.js.map +1 -1
  181. package/Toaster/Toaster.js.map +1 -1
  182. package/Toggle/Toggle.js.map +1 -1
  183. package/ToggleGroup/ToggleGroup.js.map +1 -1
  184. package/Tooltip/Tooltip.js.map +1 -1
  185. package/Tooltip/TooltipRoot.js.map +1 -1
  186. package/Tooltip/tooltipVariants.js.map +1 -1
  187. package/index.js +298 -296
  188. package/package.json +7 -5
  189. package/packages/ui/.storybook/Wrappers.js.map +1 -0
  190. package/styles.css +1 -0
  191. package/vite-env.d.ts +7 -7
  192. package/.storybook/Wrappers.js.map +0 -1
  193. /package/{.storybook → packages/ui/.storybook}/Wrappers.js +0 -0
@@ -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 counter = false,\n maxLength,\n fullSize = false,\n value,\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-10',\n classNameInputSlotProps,\n fullSize && 'min-w-auto',\n )}\n ref={ref}\n maxLength={maxLength}\n value={value}\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 {counter && typeof maxLength === 'number' && (\n <div className={cn(\n 'w-full text-right inline-flex items-center justify-end',\n 'text-xs font-medium leading-[1.2] text-muted-foreground',\n 'peer-disabled:cursor-not-allowed peer-disabled:opacity-70'\n )}>\n {String(value || '').length}/{maxLength}\n </div>\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","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,QA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A;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;"}
1
+ {"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useImperativeHandle, useRef, useState } from 'react';\r\nimport { Eye, EyeOff, X } 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\nconst clearInputNatively = (input: HTMLInputElement | null) => {\r\n if (!input) return;\r\n const setter = Object.getOwnPropertyDescriptor(\r\n HTMLInputElement.prototype,\r\n 'value',\r\n )?.set;\r\n setter?.call(input, '');\r\n input.dispatchEvent(new Event('input', { bubbles: true }));\r\n input.dispatchEvent(new Event('change', { bubbles: true }));\r\n};\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 defaultValue,\r\n disabled,\r\n readOnly,\r\n clearable = false,\r\n onClear,\r\n ...rest\r\n } = props;\r\n const {\r\n startAdornment,\r\n className: classNameInputSlotProps,\r\n ...restInputSlotProps\r\n } = input || {};\r\n\r\n const innerRef = useRef<HTMLInputElement>(null);\r\n useImperativeHandle(ref, () => innerRef.current as HTMLInputElement);\r\n\r\n const isControlled = value !== undefined;\r\n const [uncontrolledValue, setUncontrolledValue] = useState<string>(\r\n defaultValue !== undefined ? String(defaultValue) : '',\r\n );\r\n const currentValue = isControlled ? String(value ?? '') : uncontrolledValue;\r\n\r\n const showClear =\r\n clearable && !disabled && !readOnly && currentValue.length > 0;\r\n\r\n const handleClear = () => {\r\n clearInputNatively(innerRef.current);\r\n if (!isControlled) setUncontrolledValue('');\r\n innerRef.current?.focus();\r\n onClear?.();\r\n };\r\n\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 clearable && 'pr-8',\r\n classNameInputSlotProps,\r\n fullSize && 'min-w-auto',\r\n )}\r\n ref={innerRef}\r\n maxLength={maxLength}\r\n value={value}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n readOnly={readOnly}\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 (!isControlled) setUncontrolledValue(e.target.value);\r\n if (onChange) onChange(e);\r\n }}\r\n />\r\n {showClear && (\r\n <button\r\n type=\"button\"\r\n tabIndex={-1}\r\n aria-label=\"Clear input\"\r\n onMouseDown={(e) => e.preventDefault()}\r\n onClick={handleClear}\r\n className={cn(\r\n 'absolute top-1/2 right-3 -translate-y-1/2',\r\n 'text-muted-foreground hover:text-foreground',\r\n 'inline-flex items-center justify-center',\r\n )}\r\n >\r\n <X size={16} />\r\n </button>\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 {currentValue.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":["clearInputNatively","input","BaseInput","React","props","ref","className","variant","type","wrapper","onChange","onTransform","counter","maxLength","fullSize","value","defaultValue","disabled","readOnly","clearable","onClear","rest","startAdornment","classNameInputSlotProps","restInputSlotProps","innerRef","useRef","useImperativeHandle","isControlled","uncontrolledValue","setUncontrolledValue","useState","currentValue","showClear","handleClear","jsxs","cn","jsx","inputVariants","e","X","PasswordInput","isVisible","setIsVisible","inputType","toggleVisibility","VisibilityButton","onClick","Eye","EyeOff","Input"],"mappings":";;;;;AAOA,MAAMA,IAAqB,CAACC,MAAmC;AAC7D,MAAI,CAACA,EAAO;AAKZ,EAJe,OAAO;AAAA,IACpB,iBAAiB;AAAA,IACjB;AAAA,EAAA,GACC,KACK,KAAKA,GAAO,EAAE,GACtBA,EAAM,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,GAAA,CAAM,CAAC,GACzDA,EAAM,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,GAAA,CAAM,CAAC;AAC5D,GAEaC,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAW,EAAE,OAAAP,GAAO,SAAAQ,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,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC,IAAY;AAAA,MACZ,SAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDjB,GACE;AAAA,MACJ,gBAAAkB;AAAA,MACA,WAAWC;AAAA,MACX,GAAGC;AAAA,IAAA,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,EAEJ;AACF;AACAJ,EAAc,cAAc;AAO5B,MAAMK,IAAmB,CAAC,EAAE,WAAAJ,GAAW,SAAAK,QACrC,gBAAAV;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAAU;AAAA,IACA,WAAU;AAAA,IAET,UAAAL,sBAAaM,GAAA,EAAI,MAAM,IAAI,IAAK,gBAAAX,EAACY,GAAA,EAAO,MAAM,GAAA,CAAI;AAAA,EAAA;AACrD,GAGWC,IAAQ/C,EAAM;AAAA,EACzB,CAAC,EAAE,MAAAK,GAAM,GAAGJ,EAAA,GAASC,MACfG,MAAS,aAAmB,gBAAA6B,EAACI,KAAc,MAAAjC,GAAa,GAAGJ,GAAO,KAAAC,GAAU,IACzE,gBAAAgC,EAACnC,GAAA,EAAU,MAAAM,GAAa,GAAGJ,GAAO,KAAAC,GAAU;AAEvD;AACA6C,EAAM,cAAc;"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { useState as n } from "react";
3
- import { Search as s, Mail as c } from "lucide-react";
4
- import { Input as l } from "./Input.js";
2
+ import { useState as o } from "react";
3
+ import { Search as c, Mail as s } from "lucide-react";
4
+ import { Input as n } from "./Input.js";
5
5
  const h = {
6
6
  title: "Input/Input",
7
- component: l,
7
+ component: n,
8
8
  tags: ["autodocs"],
9
9
  parameters: {
10
10
  layout: "centered"
@@ -14,9 +14,13 @@ const h = {
14
14
  variant: "default",
15
15
  fullSize: !1,
16
16
  counter: !1,
17
- disabled: !1
17
+ disabled: !1,
18
+ clearable: !1
18
19
  },
19
20
  argTypes: {
21
+ clearable: {
22
+ control: "boolean"
23
+ },
20
24
  variant: {
21
25
  control: "select",
22
26
  options: ["default", "grey"]
@@ -52,39 +56,39 @@ const h = {
52
56
  type: "text",
53
57
  placeholder: "Grey input"
54
58
  }
55
- }, f = {
59
+ }, v = {
56
60
  args: {
57
61
  placeholder: "Search...",
58
62
  slotProps: {
59
63
  input: {
60
- startAdornment: /* @__PURE__ */ e(s, { size: 16 })
64
+ startAdornment: /* @__PURE__ */ e(c, { size: 16 })
61
65
  }
62
66
  }
63
67
  }
64
- }, v = {
68
+ }, b = {
65
69
  args: {
66
70
  type: "email",
67
71
  placeholder: "Email address",
68
72
  slotProps: {
69
73
  input: {
70
- startAdornment: /* @__PURE__ */ e(c, { size: 16 })
74
+ startAdornment: /* @__PURE__ */ e(s, { size: 16 })
71
75
  }
72
76
  }
73
77
  }
74
- }, y = {
78
+ }, f = {
75
79
  args: {
76
80
  type: "password",
77
81
  placeholder: "Password"
78
82
  }
79
- }, b = {
80
- render: (t) => {
81
- const [r, o] = n("");
83
+ }, x = {
84
+ render: (a) => {
85
+ const [t, l] = o("");
82
86
  return /* @__PURE__ */ e("div", { className: "w-[320px]", children: /* @__PURE__ */ e(
83
- l,
87
+ n,
84
88
  {
85
- ...t,
86
- value: r,
87
- onChange: (a) => o(a.target.value)
89
+ ...a,
90
+ value: t,
91
+ onChange: (r) => l(r.target.value)
88
92
  }
89
93
  ) });
90
94
  },
@@ -93,8 +97,8 @@ const h = {
93
97
  counter: !0,
94
98
  maxLength: 50
95
99
  }
96
- }, x = {
97
- render: (t) => /* @__PURE__ */ e("div", { className: "w-[480px]", children: /* @__PURE__ */ e(l, { ...t }) }),
100
+ }, y = {
101
+ render: (a) => /* @__PURE__ */ e("div", { className: "w-[480px]", children: /* @__PURE__ */ e(n, { ...a }) }),
98
102
  args: {
99
103
  placeholder: "Full width input",
100
104
  fullSize: !0
@@ -105,31 +109,94 @@ const h = {
105
109
  disabled: !0,
106
110
  value: "Disabled value"
107
111
  }
108
- }, S = {
109
- render: (t) => {
110
- const [r, o] = n("");
112
+ }, C = {
113
+ render: (a) => {
114
+ const [t, l] = o("");
111
115
  return /* @__PURE__ */ e("div", { className: "w-[320px]", children: /* @__PURE__ */ e(
112
- l,
116
+ n,
113
117
  {
114
- ...t,
115
- value: r,
116
- onTransform: (a) => a.replace(/\D/g, ""),
117
- onChange: (a) => o(a.target.value)
118
+ ...a,
119
+ value: t,
120
+ onTransform: (r) => r.replace(/\D/g, ""),
121
+ onChange: (r) => l(r.target.value)
118
122
  }
119
123
  ) });
120
124
  },
121
125
  args: {
122
126
  placeholder: "Only numbers allowed"
123
127
  }
124
- }, D = {
125
- render: (t) => {
126
- const [r, o] = n("");
128
+ }, S = {
129
+ render: (a) => {
130
+ const [t, l] = o("Clear me");
131
+ return /* @__PURE__ */ e("div", { className: "w-[320px]", children: /* @__PURE__ */ e(
132
+ n,
133
+ {
134
+ ...a,
135
+ value: t,
136
+ onChange: (r) => l(r.target.value),
137
+ onClear: () => console.log("cleared")
138
+ }
139
+ ) });
140
+ },
141
+ args: {
142
+ placeholder: "Type something...",
143
+ clearable: !0
144
+ }
145
+ }, N = {
146
+ render: (a) => /* @__PURE__ */ e("div", { className: "w-[320px]", children: /* @__PURE__ */ e(n, { ...a, defaultValue: "Uncontrolled value" }) }),
147
+ args: {
148
+ placeholder: "Type something...",
149
+ clearable: !0
150
+ }
151
+ }, V = {
152
+ render: (a) => {
153
+ const [t, l] = o("john@example.com");
154
+ return /* @__PURE__ */ e("div", { className: "w-[320px]", children: /* @__PURE__ */ e(
155
+ n,
156
+ {
157
+ ...a,
158
+ value: t,
159
+ onChange: (r) => l(r.target.value)
160
+ }
161
+ ) });
162
+ },
163
+ args: {
164
+ type: "email",
165
+ placeholder: "Email address",
166
+ clearable: !0,
167
+ slotProps: {
168
+ input: {
169
+ startAdornment: /* @__PURE__ */ e(s, { size: 16 })
170
+ }
171
+ }
172
+ }
173
+ }, P = {
174
+ render: (a) => {
175
+ const [t, l] = o("Some text");
176
+ return /* @__PURE__ */ e("div", { className: "w-[320px]", children: /* @__PURE__ */ e(
177
+ n,
178
+ {
179
+ ...a,
180
+ value: t,
181
+ onChange: (r) => l(r.target.value)
182
+ }
183
+ ) });
184
+ },
185
+ args: {
186
+ placeholder: "Type something...",
187
+ clearable: !0,
188
+ counter: !0,
189
+ maxLength: 50
190
+ }
191
+ }, T = {
192
+ render: (a) => {
193
+ const [t, l] = o("");
127
194
  return /* @__PURE__ */ e("div", { className: "w-[360px]", children: /* @__PURE__ */ e(
128
- l,
195
+ n,
129
196
  {
130
- ...t,
131
- value: r,
132
- onChange: (a) => o(a.target.value)
197
+ ...a,
198
+ value: t,
199
+ onChange: (r) => l(r.target.value)
133
200
  }
134
201
  ) });
135
202
  },
@@ -139,16 +206,20 @@ const h = {
139
206
  }
140
207
  };
141
208
  export {
209
+ S as Clearable,
210
+ N as ClearableUncontrolled,
211
+ P as ClearableWithCounter,
212
+ V as ClearableWithStartAdornment,
142
213
  m as Default,
143
214
  w as Disabled,
144
- v as Email,
145
- x as FullWidth,
215
+ b as Email,
216
+ y as FullWidth,
146
217
  g as GreyVariant,
147
- y as Password,
148
- D as Playground,
149
- b as WithCounter,
150
- f as WithStartAdornment,
151
- S as WithTransform,
218
+ f as Password,
219
+ T as Playground,
220
+ x as WithCounter,
221
+ v as WithStartAdornment,
222
+ C as WithTransform,
152
223
  h as default
153
224
  };
154
225
  //# sourceMappingURL=Input.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.stories.js","sources":["../../src/Input/Input.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react';\nimport React, { useState } from 'react';\nimport { Mail, Search } from 'lucide-react';\n\nimport { Input } from './Input';\n\nconst meta = {\n title: 'Input/Input',\n component: Input,\n tags: ['autodocs'],\n parameters: {\n layout: 'centered',\n },\n args: {\n placeholder: 'Enter text...',\n variant: 'default',\n fullSize: false,\n counter: false,\n disabled: false,\n },\n argTypes: {\n variant: {\n control: 'select',\n options: ['default', 'grey'],\n },\n type: {\n control: 'select',\n options: ['text', 'password', 'email', 'search', 'number'],\n },\n fullSize: {\n control: 'boolean',\n },\n counter: {\n control: 'boolean',\n },\n disabled: {\n control: 'boolean',\n },\n maxLength: {\n control: 'number',\n },\n onChange: { action: 'changed' },\n onBlur: { action: 'blurred' },\n onFocus: { action: 'focused' },\n },\n} satisfies Meta<typeof Input>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n args: {\n type: 'text',\n placeholder: 'Default input',\n },\n};\n\nexport const GreyVariant: Story = {\n args: {\n variant: 'grey',\n type: 'text',\n placeholder: 'Grey input',\n },\n};\n\nexport const WithStartAdornment: Story = {\n args: {\n placeholder: 'Search...',\n slotProps: {\n input: {\n startAdornment: <Search size={16} />,\n },\n },\n },\n};\n\nexport const Email: Story = {\n args: {\n type: 'email',\n placeholder: 'Email address',\n slotProps: {\n input: {\n startAdornment: <Mail size={16} />,\n },\n },\n },\n};\n\nexport const Password: Story = {\n args: {\n type: 'password',\n placeholder: 'Password',\n },\n};\n\nexport const WithCounter: Story = {\n render: (args) => {\n const [value, setValue] = useState('');\n\n return (\n <div className=\"w-[320px]\">\n <Input\n {...args}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n />\n </div>\n );\n },\n args: {\n placeholder: 'Type something...',\n counter: true,\n maxLength: 50,\n },\n};\n\nexport const FullWidth: Story = {\n render: (args) => (\n <div className=\"w-[480px]\">\n <Input {...args} />\n </div>\n ),\n args: {\n placeholder: 'Full width input',\n fullSize: true,\n },\n};\n\nexport const Disabled: Story = {\n args: {\n placeholder: 'Disabled input',\n disabled: true,\n value: 'Disabled value',\n },\n};\n\nexport const WithTransform: Story = {\n render: (args) => {\n const [value, setValue] = useState('');\n\n return (\n <div className=\"w-[320px]\">\n <Input\n {...args}\n value={value}\n onTransform={(next) => next.replace(/\\D/g, '')}\n onChange={(e) => setValue(e.target.value)}\n />\n </div>\n );\n },\n args: {\n placeholder: 'Only numbers allowed',\n },\n};\n\nexport const Playground: Story = {\n render: (args) => {\n const [value, setValue] = useState('');\n\n return (\n <div className=\"w-[360px]\">\n <Input\n {...args}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n />\n </div>\n );\n },\n args: {\n placeholder: 'Play with controls',\n maxLength: 100,\n },\n};\n"],"names":["meta","Input","Default","GreyVariant","WithStartAdornment","jsx","Search","Email","Mail","Password","WithCounter","args","value","setValue","useState","e","FullWidth","Disabled","WithTransform","next","Playground"],"mappings":";;;;AAMA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,MAAM,CAAC,UAAU;AAAA,EACjB,YAAY;AAAA,IACV,QAAQ;AAAA,EAAA;AAAA,EAEV,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,EAAA;AAAA,EAEZ,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,SAAS,CAAC,WAAW,MAAM;AAAA,IAAA;AAAA,IAE7B,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,YAAY,SAAS,UAAU,QAAQ;AAAA,IAAA;AAAA,IAE3D,UAAU;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,SAAS;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,IAEX,UAAU;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,WAAW;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,IAEX,UAAU,EAAE,QAAQ,UAAA;AAAA,IACpB,QAAQ,EAAE,QAAQ,UAAA;AAAA,IAClB,SAAS,EAAE,QAAQ,UAAA;AAAA,EAAU;AAEjC,GAKaC,IAAiB;AAAA,EAC5B,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EAAA;AAEjB,GAEaC,IAAqB;AAAA,EAChC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,IACN,aAAa;AAAA,EAAA;AAEjB,GAEaC,IAA4B;AAAA,EACvC,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,WAAW;AAAA,MACT,OAAO;AAAA,QACL,gBAAgB,gBAAAC,EAACC,GAAA,EAAO,MAAM,GAAA,CAAI;AAAA,MAAA;AAAA,IACpC;AAAA,EACF;AAEJ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AA,QACJ,OAAAC;AAAA,QACA,aAAa,CAACO,MAASA,EAAK,QAAQ,OAAO,EAAE;AAAA,QAC7C,UAAU,CAACJ,MAAMF,EAASE,EAAE,OAAO,KAAK;AAAA,MAAA;AAAA,IAAA,GAE5C;AAAA,EAEJ;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,EAAA;AAEjB,GAEaK,IAAoB;AAAA,EAC/B,QAAQ,CAACT,MAAS;AAChB,UAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAS,EAAE;AAErC,WACE,gBAAAT,EAAC,OAAA,EAAI,WAAU,aACb,UAAA,gBAAAA;AAAA,MAACJ;AAAA,MAAA;AAAA,QACE,GAAGU;AAAA,QACJ,OAAAC;AAAA,QACA,UAAU,CAACG,MAAMF,EAASE,EAAE,OAAO,KAAK;AAAA,MAAA;AAAA,IAAA,GAE5C;AAAA,EAEJ;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,WAAW;AAAA,EAAA;AAEf;"}
1
+ {"version":3,"file":"Input.stories.js","sources":["../../src/Input/Input.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react';\r\nimport React, { useState } from 'react';\r\nimport { Mail, Search } from 'lucide-react';\r\n\r\nimport { Input } from './Input';\r\n\r\nconst meta = {\r\n title: 'Input/Input',\r\n component: Input,\r\n tags: ['autodocs'],\r\n parameters: {\r\n layout: 'centered',\r\n },\r\n args: {\r\n placeholder: 'Enter text...',\r\n variant: 'default',\r\n fullSize: false,\r\n counter: false,\r\n disabled: false,\r\n clearable: false,\r\n },\r\n argTypes: {\r\n clearable: {\r\n control: 'boolean',\r\n },\r\n variant: {\r\n control: 'select',\r\n options: ['default', 'grey'],\r\n },\r\n type: {\r\n control: 'select',\r\n options: ['text', 'password', 'email', 'search', 'number'],\r\n },\r\n fullSize: {\r\n control: 'boolean',\r\n },\r\n counter: {\r\n control: 'boolean',\r\n },\r\n disabled: {\r\n control: 'boolean',\r\n },\r\n maxLength: {\r\n control: 'number',\r\n },\r\n onChange: { action: 'changed' },\r\n onBlur: { action: 'blurred' },\r\n onFocus: { action: 'focused' },\r\n },\r\n} satisfies Meta<typeof Input>;\r\n\r\nexport default meta;\r\ntype Story = StoryObj<typeof meta>;\r\n\r\nexport const Default: Story = {\r\n args: {\r\n type: 'text',\r\n placeholder: 'Default input',\r\n },\r\n};\r\n\r\nexport const GreyVariant: Story = {\r\n args: {\r\n variant: 'grey',\r\n type: 'text',\r\n placeholder: 'Grey input',\r\n },\r\n};\r\n\r\nexport const WithStartAdornment: Story = {\r\n args: {\r\n placeholder: 'Search...',\r\n slotProps: {\r\n input: {\r\n startAdornment: <Search size={16} />,\r\n },\r\n },\r\n },\r\n};\r\n\r\nexport const Email: Story = {\r\n args: {\r\n type: 'email',\r\n placeholder: 'Email address',\r\n slotProps: {\r\n input: {\r\n startAdornment: <Mail size={16} />,\r\n },\r\n },\r\n },\r\n};\r\n\r\nexport const Password: Story = {\r\n args: {\r\n type: 'password',\r\n placeholder: 'Password',\r\n },\r\n};\r\n\r\nexport const WithCounter: Story = {\r\n render: (args) => {\r\n const [value, setValue] = useState('');\r\n\r\n return (\r\n <div className=\"w-[320px]\">\r\n <Input\r\n {...args}\r\n value={value}\r\n onChange={(e) => setValue(e.target.value)}\r\n />\r\n </div>\r\n );\r\n },\r\n args: {\r\n placeholder: 'Type something...',\r\n counter: true,\r\n maxLength: 50,\r\n },\r\n};\r\n\r\nexport const FullWidth: Story = {\r\n render: (args) => (\r\n <div className=\"w-[480px]\">\r\n <Input {...args} />\r\n </div>\r\n ),\r\n args: {\r\n placeholder: 'Full width input',\r\n fullSize: true,\r\n },\r\n};\r\n\r\nexport const Disabled: Story = {\r\n args: {\r\n placeholder: 'Disabled input',\r\n disabled: true,\r\n value: 'Disabled value',\r\n },\r\n};\r\n\r\nexport const WithTransform: Story = {\r\n render: (args) => {\r\n const [value, setValue] = useState('');\r\n\r\n return (\r\n <div className=\"w-[320px]\">\r\n <Input\r\n {...args}\r\n value={value}\r\n onTransform={(next) => next.replace(/\\D/g, '')}\r\n onChange={(e) => setValue(e.target.value)}\r\n />\r\n </div>\r\n );\r\n },\r\n args: {\r\n placeholder: 'Only numbers allowed',\r\n },\r\n};\r\n\r\nexport const Clearable: Story = {\r\n render: (args) => {\r\n const [value, setValue] = useState('Clear me');\r\n\r\n return (\r\n <div className=\"w-[320px]\">\r\n <Input\r\n {...args}\r\n value={value}\r\n onChange={(e) => setValue(e.target.value)}\r\n onClear={() => console.log('cleared')}\r\n />\r\n </div>\r\n );\r\n },\r\n args: {\r\n placeholder: 'Type something...',\r\n clearable: true,\r\n },\r\n};\r\n\r\nexport const ClearableUncontrolled: Story = {\r\n render: (args) => (\r\n <div className=\"w-[320px]\">\r\n <Input {...args} defaultValue=\"Uncontrolled value\" />\r\n </div>\r\n ),\r\n args: {\r\n placeholder: 'Type something...',\r\n clearable: true,\r\n },\r\n};\r\n\r\nexport const ClearableWithStartAdornment: Story = {\r\n render: (args) => {\r\n const [value, setValue] = useState('john@example.com');\r\n\r\n return (\r\n <div className=\"w-[320px]\">\r\n <Input\r\n {...args}\r\n value={value}\r\n onChange={(e) => setValue(e.target.value)}\r\n />\r\n </div>\r\n );\r\n },\r\n args: {\r\n type: 'email',\r\n placeholder: 'Email address',\r\n clearable: true,\r\n slotProps: {\r\n input: {\r\n startAdornment: <Mail size={16} />,\r\n },\r\n },\r\n },\r\n};\r\n\r\nexport const ClearableWithCounter: Story = {\r\n render: (args) => {\r\n const [value, setValue] = useState('Some text');\r\n\r\n return (\r\n <div className=\"w-[320px]\">\r\n <Input\r\n {...args}\r\n value={value}\r\n onChange={(e) => setValue(e.target.value)}\r\n />\r\n </div>\r\n );\r\n },\r\n args: {\r\n placeholder: 'Type something...',\r\n clearable: true,\r\n counter: true,\r\n maxLength: 50,\r\n },\r\n};\r\n\r\nexport const Playground: Story = {\r\n render: (args) => {\r\n const [value, setValue] = useState('');\r\n\r\n return (\r\n <div className=\"w-[360px]\">\r\n <Input\r\n {...args}\r\n value={value}\r\n onChange={(e) => setValue(e.target.value)}\r\n />\r\n </div>\r\n );\r\n },\r\n args: {\r\n placeholder: 'Play with controls',\r\n maxLength: 100,\r\n },\r\n};\r\n"],"names":["meta","Input","Default","GreyVariant","WithStartAdornment","jsx","Search","Email","Mail","Password","WithCounter","args","value","setValue","useState","e","FullWidth","Disabled","WithTransform","next","Clearable","ClearableUncontrolled","ClearableWithStartAdornment","ClearableWithCounter","Playground"],"mappings":";;;;AAMA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,MAAM,CAAC,UAAU;AAAA,EACjB,YAAY;AAAA,IACV,QAAQ;AAAA,EAAA;AAAA,EAEV,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,EAAA;AAAA,EAEb,UAAU;AAAA,IACR,WAAW;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,IAEX,SAAS;AAAA,MACP,SAAS;AAAA,MACT,SAAS,CAAC,WAAW,MAAM;AAAA,IAAA;AAAA,IAE7B,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,YAAY,SAAS,UAAU,QAAQ;AAAA,IAAA;AAAA,IAE3D,UAAU;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,SAAS;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,IAEX,UAAU;AAAA,MACR,SAAS;AAAA,IAAA;AAAA,IAEX,WAAW;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,IAEX,UAAU,EAAE,QAAQ,UAAA;AAAA,IACpB,QAAQ,EAAE,QAAQ,UAAA;AAAA,IAClB,SAAS,EAAE,QAAQ,UAAA;AAAA,EAAU;AAEjC,GAKaC,IAAiB;AAAA,EAC5B,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EAAA;AAEjB,GAEaC,IAAqB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A,IACJ,aAAa;AAAA,IACb,WAAW;AAAA,EAAA;AAEf;"}
@@ -17,5 +17,9 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>,
17
17
  onPastePrepare?: (value: string, event: React.ClipboardEvent<HTMLInputElement>) => string;
18
18
  fullSize?: boolean;
19
19
  counter?: boolean;
20
+ /** Show a clear (X) button inside the input that empties the value and emulates a native input/change event */
21
+ clearable?: boolean;
22
+ /** Optional callback fired after the input has been cleared */
23
+ onClear?: () => void;
20
24
  }
21
25
  //# 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,K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AAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -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-lg 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 'box-border',\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,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 +1 @@
1
- {"version":3,"file":"LoadingMask.js","sources":["../../src/LoadingMask/LoadingMask.tsx"],"sourcesContent":["import { ILoadingMaskProps } from './LoadingMask.types';\nimport { RenderLoadingMask } from './RenderLoadingMask';\nimport { cn } from '@oneplatformdev/utils';\n\nexport const LoadingMask = (props: ILoadingMaskProps) => {\n const { loading = true, fullWidth = false, className, ...rest } = props;\n if(!loading) return null;\n if (!fullWidth) return <RenderLoadingMask />;\n return (\n <div\n {...rest}\n className={cn(\n 'absolute inset-0',\n 'flex items-center justify-center',\n className\n )}\n >\n <RenderLoadingMask />\n </div>\n );\n};\n"],"names":["LoadingMask","props","loading","fullWidth","className","rest","jsx","cn","RenderLoadingMask"],"mappings":";;;AAIO,MAAMA,IAAc,CAACC,MAA6B;AACvD,QAAM,EAAE,SAAAC,IAAU,IAAM,WAAAC,IAAY,IAAO,WAAAC,GAAW,GAAGC,MAASJ;AAClE,SAAIC,IACCC,IAEH,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAH;AAAA,MAAA;AAAA,MAGF,4BAACI,GAAA,CAAA,CAAkB;AAAA,IAAA;AAAA,EAAA,IAVA,gBAAAF,EAACE,GAAA,CAAA,CAAkB,IADtB;AActB;"}
1
+ {"version":3,"file":"LoadingMask.js","sources":["../../src/LoadingMask/LoadingMask.tsx"],"sourcesContent":["import { ILoadingMaskProps } from './LoadingMask.types';\r\nimport { RenderLoadingMask } from './RenderLoadingMask';\r\nimport { cn } from '@oneplatformdev/utils';\r\n\r\nexport const LoadingMask = (props: ILoadingMaskProps) => {\r\n const { loading = true, fullWidth = false, className, ...rest } = props;\r\n if(!loading) return null;\r\n if (!fullWidth) return <RenderLoadingMask />;\r\n return (\r\n <div\r\n {...rest}\r\n className={cn(\r\n 'absolute inset-0',\r\n 'flex items-center justify-center',\r\n className\r\n )}\r\n >\r\n <RenderLoadingMask />\r\n </div>\r\n );\r\n};\r\n"],"names":["LoadingMask","props","loading","fullWidth","className","rest","jsx","cn","RenderLoadingMask"],"mappings":";;;AAIO,MAAMA,IAAc,CAACC,MAA6B;AACvD,QAAM,EAAE,SAAAC,IAAU,IAAM,WAAAC,IAAY,IAAO,WAAAC,GAAW,GAAGC,MAASJ;AAClE,SAAIC,IACCC,IAEH,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAH;AAAA,MAAA;AAAA,MAGF,4BAACI,GAAA,CAAA,CAAkB;AAAA,IAAA;AAAA,EAAA,IAVA,gBAAAF,EAACE,GAAA,CAAA,CAAkB,IADtB;AActB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderLoadingMask.js","sources":["../../src/LoadingMask/RenderLoadingMask.tsx"],"sourcesContent":["import { forwardRef, HTMLAttributes } from 'react';\nimport { cn } from '@oneplatformdev/utils';\n\nexport const RenderLoadingMask = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>((props, ref) => {\n const { className, ...rest } = props;\n return (\n <div\n {...rest}\n ref={ref}\n className={cn('flex flex-1 items-center justify-center', className)}\n >\n <svg\n className=\"h-8 w-8 animate-spin text-gray-900 dark:text-gray-50\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 4.75V6.25\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M17.1475 6.8525L16.0625 7.9375\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M19.25 12H17.75\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M17.1475 17.1475L16.0625 16.0625\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M12 17.75V19.25\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M6.8525 17.1475L7.9375 16.0625\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M4.75 12H6.25\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M6.8525 6.8525L7.9375 7.9375\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n});\n"],"names":["RenderLoadingMask","forwardRef","props","ref","className","rest","jsx","cn","jsxs"],"mappings":";;;AAGO,MAAMA,IAAoBC,EAG/B,CAACC,GAAOC,MAAQ;AAChB,QAAM,EAAE,WAAAC,GAAW,GAAGC,EAAA,IAASH;AAC/B,SACE,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,KAAAF;AAAA,MACA,WAAWI,EAAG,2CAA2CH,CAAS;AAAA,MAElE,UAAA,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UAEN,UAAA;AAAA,YAAA,gBAAAF;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,UACjB;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"RenderLoadingMask.js","sources":["../../src/LoadingMask/RenderLoadingMask.tsx"],"sourcesContent":["import { forwardRef, HTMLAttributes } from 'react';\r\nimport { cn } from '@oneplatformdev/utils';\r\n\r\nexport const RenderLoadingMask = forwardRef<\r\n HTMLDivElement,\r\n HTMLAttributes<HTMLDivElement>\r\n>((props, ref) => {\r\n const { className, ...rest } = props;\r\n return (\r\n <div\r\n {...rest}\r\n ref={ref}\r\n className={cn('flex flex-1 items-center justify-center', className)}\r\n >\r\n <svg\r\n className=\"h-8 w-8 animate-spin text-gray-900 dark:text-gray-50\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M12 4.75V6.25\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n <path\r\n d=\"M17.1475 6.8525L16.0625 7.9375\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n <path\r\n d=\"M19.25 12H17.75\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n <path\r\n d=\"M17.1475 17.1475L16.0625 16.0625\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n <path\r\n d=\"M12 17.75V19.25\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n <path\r\n d=\"M6.8525 17.1475L7.9375 16.0625\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n <path\r\n d=\"M4.75 12H6.25\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n <path\r\n d=\"M6.8525 6.8525L7.9375 7.9375\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n </svg>\r\n </div>\r\n );\r\n});\r\n"],"names":["RenderLoadingMask","forwardRef","props","ref","className","rest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AA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAEjB,gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,GAAE;AAAA,gBACF,QAAO;AAAA,gBACP,aAAY;AAAA,gBACZ,eAAc;AAAA,gBACd,gBAAe;AAAA,cAAA;AAAA,YAAA;AAAA,UACjB;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingProgress.js","sources":["../../src/LoadingProgress/LoadingProgress.tsx"],"sourcesContent":["import { FC } from \"react\";\n\nimport { cn } from \"@oneplatformdev/utils\";\nimport { loadingProgressVariants } from './loadingProgressVariants';\nimport { ILoadingProgressProps } from './LoadingProgress.types';\n\n// TODO: progress loading for art-metal. remove or refactor\nexport const LoadingProgress: FC<ILoadingProgressProps> = (props) => {\n const { className, fullWidth = false, size, color, wrapClassName } = props;\n return (\n <div\n className={cn(\n wrapClassName,\n 'w-fit h-auto',\n Boolean(fullWidth) && 'flex grow w-full h-full items-center justify-center'\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\n loadingProgressVariants({ size, color, className }),\n )}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\"/>\n </svg>\n </div>\n );\n};\n"],"names":["LoadingProgress","props","className","fullWidth","size","color","wrapClassName","jsx","cn","loadingProgressVariants"],"mappings":";;;AAOO,MAAMA,IAA6C,CAACC,MAAU;AACnE,QAAM,EAAE,WAAAC,GAAW,WAAAC,IAAY,IAAO,MAAAC,GAAM,OAAAC,GAAO,eAAAC,MAAkBL;AACrE,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTF;AAAA,QACA;AAAA,QACA,EAAQH,KAAc;AAAA,MAAA;AAAA,MAGxB,UAAA,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,OAAM;AAAA,UACN,QAAO;AAAA,UACP,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,UACf,WAAWC;AAAA,YACTC,EAAwB,EAAE,MAAAL,GAAM,OAAAC,GAAO,WAAAH,GAAW;AAAA,UAAA;AAAA,UAGpD,UAAA,gBAAAK,EAAC,QAAA,EAAK,GAAE,8BAAA,CAA6B;AAAA,QAAA;AAAA,MAAA;AAAA,IACvC;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"LoadingProgress.js","sources":["../../src/LoadingProgress/LoadingProgress.tsx"],"sourcesContent":["import { FC } from \"react\";\r\n\r\nimport { cn } from \"@oneplatformdev/utils\";\r\nimport { loadingProgressVariants } from './loadingProgressVariants';\r\nimport { ILoadingProgressProps } from './LoadingProgress.types';\r\n\r\n// TODO: progress loading for art-metal. remove or refactor\r\nexport const LoadingProgress: FC<ILoadingProgressProps> = (props) => {\r\n const { className, fullWidth = false, size, color, wrapClassName } = props;\r\n return (\r\n <div\r\n className={cn(\r\n wrapClassName,\r\n 'w-fit h-auto',\r\n Boolean(fullWidth) && 'flex grow w-full h-full items-center justify-center'\r\n )}\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={cn(\r\n loadingProgressVariants({ size, color, className }),\r\n )}\r\n >\r\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\"/>\r\n </svg>\r\n </div>\r\n );\r\n};\r\n"],"names":["LoadingProgress","props","className","fullWidth","size","color","wrapClassName","jsx","cn","loadingProgressVariants"],"mappings":";;;AAOO,MAAMA,IAA6C,CAACC,MAAU;AACnE,QAAM,EAAE,WAAAC,GAAW,WAAAC,IAAY,IAAO,MAAAC,GAAM,OAAAC,GAAO,eAAAC,MAAkBL;AACrE,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTF;AAAA,QACA;AAAA,QACA,EAAQH,KAAc;AAAA,MAAA;AAAA,MAGxB,UAAA,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,OAAM;AAAA,UACN,QAAO;AAAA,UACP,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA,UACf,WAAWC;AAAA,YACTC,EAAwB,EAAE,MAAAL,GAAM,OAAAC,GAAO,WAAAH,GAAW;AAAA,UAAA;AAAA,UAGpD,UAAA,gBAAAK,EAAC,QAAA,EAAK,GAAE,8BAAA,CAA6B;AAAA,QAAA;AAAA,MAAA;AAAA,IACvC;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"loadingProgressVariants.js","sources":["../../src/LoadingProgress/loadingProgressVariants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const loadingProgressVariants = cva(\n \"animate-spin\",\n {\n variants: {\n color: {\n primary: 'text-primary',\n default: ''\n },\n size: {\n default: \"\",\n sm: \"\",\n lg: \"w-20 h-20\",\n },\n },\n defaultVariants: {\n size: \"default\",\n color: \"default\",\n },\n }\n);\n"],"names":["loadingProgressVariants","cva"],"mappings":";AAEO,MAAMA,IAA0BC;AAAA,EACrC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,MAAA;AAAA,MAEX,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;"}
1
+ {"version":3,"file":"loadingProgressVariants.js","sources":["../../src/LoadingProgress/loadingProgressVariants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\r\n\r\nexport const loadingProgressVariants = cva(\r\n \"animate-spin\",\r\n {\r\n variants: {\r\n color: {\r\n primary: 'text-primary',\r\n default: ''\r\n },\r\n size: {\r\n default: \"\",\r\n sm: \"\",\r\n lg: \"w-20 h-20\",\r\n },\r\n },\r\n defaultVariants: {\r\n size: \"default\",\r\n color: \"default\",\r\n },\r\n }\r\n);\r\n"],"names":["loadingProgressVariants","cva"],"mappings":";AAEO,MAAMA,IAA0BC;AAAA,EACrC;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,MAAA;AAAA,MAEX,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;"}