@sikka/hawa 0.48.1-next → 0.49.0-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.js +3 -28
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +3 -28
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert/index.js +53 -98
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +53 -98
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.d.mts +2 -0
- package/dist/appLayout/index.d.ts +2 -0
- package/dist/appLayout/index.js +263 -409
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +263 -409
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appMenubar/index.js +15 -20
- package/dist/appMenubar/index.js.map +1 -1
- package/dist/appMenubar/index.mjs +15 -20
- package/dist/appMenubar/index.mjs.map +1 -1
- package/dist/appTabs/index.js +28 -37
- package/dist/appTabs/index.js.map +1 -1
- package/dist/appTabs/index.mjs +28 -37
- package/dist/appTabs/index.mjs.map +1 -1
- package/dist/appTopbar/index.js +125 -173
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs +125 -173
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/backToTop/index.js +50 -82
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +50 -82
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/badge/index.d.mts +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/badge/index.js +2 -18
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +2 -18
- package/dist/badge/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +202 -468
- package/dist/blocks/auth/index.mjs +96 -280
- package/dist/blocks/feedback/index.js +214 -375
- package/dist/blocks/feedback/index.mjs +12 -25
- package/dist/blocks/index.js +604 -1122
- package/dist/blocks/index.mjs +132 -291
- package/dist/blocks/misc/index.js +136 -251
- package/dist/blocks/misc/index.mjs +29 -54
- package/dist/blocks/pricing/index.js +220 -397
- package/dist/blocks/pricing/index.mjs +63 -134
- package/dist/breadcrumb/index.js +1 -5
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +1 -5
- package/dist/breadcrumb/index.mjs.map +1 -1
- package/dist/button/index.js +50 -82
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +50 -82
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js +50 -82
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +50 -82
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/card/index.js +7 -35
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +7 -35
- package/dist/card/index.mjs.map +1 -1
- package/dist/carousel/index.js +15 -27
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +15 -27
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/checkbox/index.js +2 -13
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +2 -13
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chip/index.js +2 -16
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +2 -16
- package/dist/chip/index.mjs.map +1 -1
- package/dist/{chunk-WUMDFBEK.mjs → chunk-3CHFVHTW.mjs} +43 -54
- package/dist/{chunk-2LUXOXAL.mjs → chunk-5SQBJRWE.mjs} +3 -9
- package/dist/{chunk-C2UOOH4X.mjs → chunk-B53SP2WZ.mjs} +3 -17
- package/dist/chunk-GHGWQVTM.mjs +150 -0
- package/dist/{chunk-5S5DR7KF.mjs → chunk-I23ONEDJ.mjs} +2 -10
- package/dist/{chunk-JFWD2ICY.mjs → chunk-JT7R3L5O.mjs} +54 -62
- package/dist/{chunk-6SJUUJOV.mjs → chunk-KDGJZPWK.mjs} +295 -574
- package/dist/{chunk-AWJSHOYU.mjs → chunk-KSJGXQTE.mjs} +1 -1
- package/dist/{chunk-NMW4GM4G.mjs → chunk-SE2JMXYG.mjs} +104 -144
- package/dist/{chunk-GBLWUEYN.mjs → chunk-ULRL4WI6.mjs} +176 -256
- package/dist/{chunk-IFWYR5W2.mjs → chunk-VUELRPUL.mjs} +57 -117
- package/dist/{chunk-WL7C2A5D.mjs → chunk-WQR4XZGL.mjs} +8 -15
- package/dist/codeBlock/index.js +50 -82
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +50 -82
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.js +21 -33
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +22 -37
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.d.mts +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.js +141 -223
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +141 -223
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.d.mts +1 -1
- package/dist/command/index.d.ts +1 -1
- package/dist/command/index.js +129 -212
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +129 -212
- package/dist/command/index.mjs.map +1 -1
- package/dist/dataTable/index.js +254 -394
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +254 -394
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.js +64 -105
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +64 -105
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/destroyableCard/index.js +8 -39
- package/dist/destroyableCard/index.js.map +1 -1
- package/dist/destroyableCard/index.mjs +8 -39
- package/dist/destroyableCard/index.mjs.map +1 -1
- package/dist/dialog/index.js +70 -122
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +70 -122
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +169 -358
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +169 -358
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/docsSidebar/index.js +9 -16
- package/dist/docsSidebar/index.js.map +1 -1
- package/dist/docsSidebar/index.mjs +9 -16
- package/dist/docsSidebar/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.js +124 -164
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +124 -164
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +3 -3
- package/dist/elements/index.d.ts +3 -3
- package/dist/elements/index.js +841 -1505
- package/dist/elements/index.mjs +381 -718
- package/dist/fileDropzone/index.js +60 -159
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +60 -159
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/glow/index.js +4 -16
- package/dist/glow/index.js.map +1 -1
- package/dist/glow/index.mjs +4 -16
- package/dist/glow/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -5
- package/dist/hooks/index.d.ts +1 -5
- package/dist/hooks/index.js +11 -24
- package/dist/hooks/index.mjs +2 -2
- package/dist/{index-B0aJcA6d.d.ts → index-BgNycocQ.d.mts} +2 -2
- package/dist/{index-B0aJcA6d.d.mts → index-BgNycocQ.d.ts} +2 -2
- package/dist/index.css +1 -2
- package/dist/index.d.mts +6 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.js +1194 -2170
- package/dist/index.mjs +1195 -2174
- package/dist/input/index.js +20 -29
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +20 -29
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +122 -163
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +122 -163
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/label/index.js +19 -26
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs +19 -26
- package/dist/label/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +2 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +434 -790
- package/dist/layout/index.mjs +143 -243
- package/dist/loading/index.js +30 -53
- package/dist/loading/index.js.map +1 -1
- package/dist/loading/index.mjs +30 -53
- package/dist/loading/index.mjs.map +1 -1
- package/dist/logos/index.js +66 -191
- package/dist/logos/index.js.map +1 -1
- package/dist/logos/index.mjs +66 -191
- package/dist/logos/index.mjs.map +1 -1
- package/dist/navbar/index.js +1 -4
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +1 -4
- package/dist/navbar/index.mjs.map +1 -1
- package/dist/navigationMenu/index.js +14 -22
- package/dist/navigationMenu/index.js.map +1 -1
- package/dist/navigationMenu/index.mjs +14 -22
- package/dist/navigationMenu/index.mjs.map +1 -1
- package/dist/pagination/index.js +1 -5
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs +1 -5
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/passwordInput/index.js +36 -65
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +36 -65
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +20 -29
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +20 -29
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +14 -16
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +14 -16
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/popover/index.js +14 -24
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/index.mjs +14 -24
- package/dist/popover/index.mjs.map +1 -1
- package/dist/progress/index.js +19 -26
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +19 -26
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progressCircle/index.js +67 -71
- package/dist/progressCircle/index.js.map +1 -1
- package/dist/progressCircle/index.mjs +67 -71
- package/dist/progressCircle/index.mjs.map +1 -1
- package/dist/radio/index.js +122 -163
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +122 -163
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/scrollIndicator/index.js +1 -4
- package/dist/scrollIndicator/index.js.map +1 -1
- package/dist/scrollIndicator/index.mjs +1 -4
- package/dist/scrollIndicator/index.mjs.map +1 -1
- package/dist/select/index.js +20 -29
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +20 -29
- package/dist/select/index.mjs.map +1 -1
- package/dist/separator/index.js.map +1 -1
- package/dist/separator/index.mjs.map +1 -1
- package/dist/sheet/index.js +42 -53
- package/dist/sheet/index.js.map +1 -1
- package/dist/sheet/index.mjs +42 -53
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/sidebar/index.js +66 -133
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/index.mjs +66 -133
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/signature/index.js +19 -26
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs +19 -26
- package/dist/signature/index.mjs.map +1 -1
- package/dist/simpleTable/index.js +50 -81
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs +50 -81
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sonner/index.js.map +1 -1
- package/dist/sonner/index.mjs.map +1 -1
- package/dist/sortButton/index.js +50 -82
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs +50 -82
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.js +214 -294
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +214 -294
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.js +7 -35
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs +7 -35
- package/dist/stats/index.mjs.map +1 -1
- package/dist/switch/index.js +24 -34
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +24 -34
- package/dist/switch/index.mjs.map +1 -1
- package/dist/table/index.js +27 -29
- package/dist/table/index.js.map +1 -1
- package/dist/table/index.mjs +27 -29
- package/dist/table/index.mjs.map +1 -1
- package/dist/tabs/index.js +54 -76
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +54 -76
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.js +21 -38
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +21 -38
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.js +2 -10
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +2 -10
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toaster/index.js +3 -16
- package/dist/toaster/index.js.map +1 -1
- package/dist/toaster/index.mjs +3 -16
- package/dist/toaster/index.mjs.map +1 -1
- package/dist/tooltip/index.js +19 -26
- package/dist/tooltip/index.js.map +1 -1
- package/dist/tooltip/index.mjs +19 -26
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +12 -12
- package/dist/chunk-JP2N5WKD.mjs +0 -190
package/dist/input/index.js
CHANGED
@@ -47,9 +47,7 @@ function cn(...inputs) {
|
|
47
47
|
|
48
48
|
// elements/helperText/HelperText.tsx
|
49
49
|
var import_react = __toESM(require("react"));
|
50
|
-
var HelperText = ({
|
51
|
-
helperText
|
52
|
-
}) => /* @__PURE__ */ import_react.default.createElement(
|
50
|
+
var HelperText = ({ helperText }) => /* @__PURE__ */ import_react.default.createElement(
|
53
51
|
"p",
|
54
52
|
{
|
55
53
|
className: cn(
|
@@ -100,38 +98,31 @@ var Tooltip = ({
|
|
100
98
|
delayDuration = 300,
|
101
99
|
...props
|
102
100
|
}) => {
|
103
|
-
return /* @__PURE__ */ import_react2.default.createElement(
|
104
|
-
TooltipPrimitive.
|
101
|
+
return /* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.TooltipProvider, { delayDuration, ...providerProps }, /* @__PURE__ */ import_react2.default.createElement(
|
102
|
+
TooltipPrimitive.Root,
|
105
103
|
{
|
106
|
-
|
107
|
-
|
104
|
+
open: !disabled && open,
|
105
|
+
defaultOpen,
|
106
|
+
onOpenChange,
|
107
|
+
...props
|
108
108
|
},
|
109
|
+
/* @__PURE__ */ import_react2.default.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
109
110
|
/* @__PURE__ */ import_react2.default.createElement(
|
110
|
-
|
111
|
+
TooltipContent,
|
111
112
|
{
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
...
|
113
|
+
size,
|
114
|
+
side,
|
115
|
+
align: "center",
|
116
|
+
...contentProps,
|
117
|
+
style: {
|
118
|
+
...contentProps == null ? void 0 : contentProps.style,
|
119
|
+
maxWidth: "var(--radix-tooltip-content-available-width)",
|
120
|
+
maxHeight: "var(--radix-tooltip-content-available-height)"
|
121
|
+
}
|
116
122
|
},
|
117
|
-
|
118
|
-
/* @__PURE__ */ import_react2.default.createElement(
|
119
|
-
TooltipContent,
|
120
|
-
{
|
121
|
-
size,
|
122
|
-
side,
|
123
|
-
align: "center",
|
124
|
-
...contentProps,
|
125
|
-
style: {
|
126
|
-
...contentProps == null ? void 0 : contentProps.style,
|
127
|
-
maxWidth: "var(--radix-tooltip-content-available-width)",
|
128
|
-
maxHeight: "var(--radix-tooltip-content-available-height)"
|
129
|
-
}
|
130
|
-
},
|
131
|
-
content
|
132
|
-
)
|
123
|
+
content
|
133
124
|
)
|
134
|
-
);
|
125
|
+
));
|
135
126
|
};
|
136
127
|
|
137
128
|
// elements/label/Label.tsx
|
package/dist/input/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/input/index.ts","../../elements/input/Input.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Input\";\n","import React, { forwardRef, useState } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { Skeleton } from \"../skeleton/Skeleton\";\n\nexport type InputFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {\n isLoading?: boolean;\n isLoadingError?: boolean;\n containerClassName?: string;\n margin?: \"none\" | \"normal\" | \"large\";\n width?: \"small\" | \"normal\" | \"full\" | \"auto\";\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n hideSeparator?: boolean;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n prefixText?: any;\n forceHideHelperText?: boolean;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** The icon inside the input field */\n icon?: any;\n /** Boolean to enable/disable editing the input field and using it as a text field */\n preview?: boolean;\n // maxLength?: any;\n iconInside?: React.ReactNode;\n endIcon?: React.ReactNode;\n endIconProps?: { className?: string };\n startIcon?: React.ReactNode;\n placeholder?: React.ReactNode;\n /** Show the count of characters left in the input field. Works along with maxLength prop. */\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\" | \"center\";\n popup?: boolean;\n popupContent?: React.ReactNode;\n outsidePrefix?: any;\n loadingErrorMesssage?: string;\n};\nexport const Input = forwardRef<HTMLInputElement, InputFieldProps>(\n (\n {\n margin = \"none\",\n width = \"full\",\n preview = false,\n forceHideHelperText = false,\n labelProps,\n placeholder,\n showCount,\n inputProps,\n countPosition = \"bottom\",\n ...props\n },\n ref,\n ) => {\n const [value, setValue] = useState(props.value || \"\");\n\n let marginStyles = {\n none: \"hawa-mb-0\",\n normal: \"hawa-mb-3\",\n large: \"hawa-mb-5\",\n };\n let widthStyles = {\n small: \"hawa-w-full hawa-max-w-2xs\",\n normal: \"hawa-w-1/2\",\n full: \"hawa-w-full\",\n auto: \"\",\n };\n\n let defaultStyle =\n \"hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0\";\n let defaultInputStyle =\n \"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground\";\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = e.target.value;\n setValue(newValue);\n\n if (props.prefixText) {\n // If newValue is shorter than prefixText, set newValue to prefixText\n if (newValue.length < props.prefixText.length) {\n newValue = props.prefixText;\n } else {\n // Check if newValue starts with a substring of prefixText\n const isSubstring = props.prefixText.startsWith(newValue);\n\n if (!isSubstring && !newValue.startsWith(props.prefixText)) {\n newValue = `${props.prefixText}${newValue}`;\n }\n }\n }\n\n if (props.onChange) {\n if (props.type === \"number\" && props.maxLength) {\n let v = newValue.replace(/[^0-9]/g, \"\").slice(0, props.maxLength);\n const newEvent = { ...e, target: { ...e.target, value: v } };\n setValue(v);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n } else {\n const newEvent = { ...e, target: { ...e.target, value: newValue } };\n setValue(newValue);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n }\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (props.type === \"number\" && [\"e\", \"E\", \"+\", \"-\", \".\"].includes(e.key)) {\n e.preventDefault();\n }\n props.onKeyDown && props.onKeyDown(e);\n };\n\n return (\n <div\n className={cn(\n defaultStyle,\n marginStyles[margin],\n widthStyles[width],\n props.containerClassName,\n \"hawa-w-full hawa-gap-2\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className=\"hawa-flex hawa-flex-row hawa-w-full hawa-items-center\">\n {props.outsidePrefix && (\n <span className={cn(\"hawa-me-2 hawa-opacity-90\", !forceHideHelperText && \"hawa-mb-2\")}>\n {props.outsidePrefix}\n </span>\n )}\n {props.isLoading ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton as=\"input\" />\n </div>\n ) : props.isLoadingError ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton\n animation=\"none\"\n className=\"hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]\"\n content={\n <div className=\"hawa-flex hawa-flex-row hawa-gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-text-destructive\"\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n <span>\n <span className=\"hawa-text-destructive\">\n {props.loadingErrorMesssage || \"Error loading data\"}\n </span>\n </span>\n </div>\n }\n />\n </div>\n ) : (\n <>\n {!props.hideSeparator && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n )}\n <div className=\"hawa-flex hawa-flex-col hawa-w-full hawa-gap-2\">\n <div className={\"hawa-relative\"}>\n {props.startIcon && (\n <div className=\"hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2\">\n {props.startIcon}\n </div>\n )}\n {props.endIcon && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2\",\n props.endIconProps?.className,\n )}\n >\n {props.endIcon}\n </div>\n )}\n <input\n required\n dir={props.dir}\n type={props.type}\n value={props.value || value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n autoComplete={props.autoComplete}\n defaultValue={props.defaultValue}\n placeholder={placeholder}\n disabled={props.disabled || preview}\n style={{ height: 40 }}\n maxLength={props.maxLength}\n {...inputProps}\n className={cn(\n defaultInputStyle,\n \"focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white\",\n {\n \"hawa-pe-9\": props.endIcon,\n \"hawa-ps-9\": props.startIcon,\n \"hawa-pe-[60px]\": countPosition === \"center\",\n },\n preview && \"hawa-border-transparent hawa-bg-transparent hawa-px-0\",\n inputProps?.className,\n )}\n />\n </div>\n\n {/* Regular helper text */}\n {!forceHideHelperText && <HelperText helperText={props.helperText} />}\n {/* Popover helper text */}\n {!props.disabled && forceHideHelperText && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all\",\n props.helperText ? \"hawa-border hawa-p-1\" : \"hawa-border-none hawa-p-0\",\n )}\n >\n {props.helperText}\n </div>\n )}\n {/* Character Counter */}\n {showCount && (\n <div\n className={cn(\n \"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all\",\n {\n \"hawa-end-0 hawa-top-[62px]\": countPosition === \"bottom\",\n \"hawa-bottom-[62px] hawa-end-0\": countPosition === \"top\",\n \"hawa-end-2\": countPosition === \"center\",\n },\n )}\n >\n {props.value ? String(props.value).length : 0}/{props.maxLength}\n </div>\n )}\n\n {/* Popover helper text */}\n {/* {props.popup && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[47px] hawa-min-h-fit hawa-w-full hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start hawa-rounded hawa-end-0 hawa-z-20 hawa-drop-shadow-md hawa-bg-background hawa-translate-y-1/2\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\"\n )}\n >\n {props.popupContent}\n </div>\n )} */}\n </div>\n </>\n )}\n </div>\n </div>\n );\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n as?: \"div\" | \"input\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n as = \"div\",\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n const styledAs = {\n div: \"\",\n input: \"hawa-h-[40px] hawa-w-full\",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content && \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n styledAs[as],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA4C;;;ACA5C,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,mBAAkB;AAIX,IAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAGE,6BAAAC,QAAA;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;AChBF,IAAAC,SAAuB;;;ACAvB,IAAAC,gBAAkB;AAElB,uBAAkC;AAKlC,IAAM,iBAAiB,cAAAC,QAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,8BAAAA,QAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MAC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kB;AAAA,YACtC;AAAA,YACA,WAAW;AAAA,YACX,yCAAY;AAAA,UACd;AAAA;AAAA,MACF,CACF,GAGC,CAAC,uBAAuB,8BAAAA,QAAA,cAAC,cAAW,YAAY,MAAM,YAAY,GAElE,CAAC,MAAM,YAAY,uBAClB,8BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,MAAM,aAAa,yBAAyB;AAAA,UAC9C;AAAA;AAAA,QAEC,MAAM;AAAA,MACT,GAGD,aACC,8BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,cACE,8BAA8B,kBAAkB;AAAA,cAChD,iCAAiC,kBAAkB;AAAA,cACnD,cAAc,kBAAkB;AAAA,YAClC;AAAA,UACF;AAAA;AAAA,QAEC,MAAM,QAAQ,OAAO,MAAM,KAAK,EAAE,SAAS;AAAA,QAAE;AAAA,QAAE,MAAM;AAAA,MACxD,CAgBJ,CACF,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;","names":["import_react","React","React","import_react","React","import_react","React","React"]}
|
1
|
+
{"version":3,"sources":["../../elements/input/index.ts","../../elements/input/Input.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["export * from \"./Input\";\n","import React, { forwardRef, useState } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { Skeleton } from \"../skeleton/Skeleton\";\n\nexport type InputFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {\n isLoading?: boolean;\n isLoadingError?: boolean;\n containerClassName?: string;\n margin?: \"none\" | \"normal\" | \"large\";\n width?: \"small\" | \"normal\" | \"full\" | \"auto\";\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n hideSeparator?: boolean;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n prefixText?: any;\n forceHideHelperText?: boolean;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** The icon inside the input field */\n icon?: any;\n /** Boolean to enable/disable editing the input field and using it as a text field */\n preview?: boolean;\n // maxLength?: any;\n iconInside?: React.ReactNode;\n endIcon?: React.ReactNode;\n endIconProps?: { className?: string };\n startIcon?: React.ReactNode;\n placeholder?: React.ReactNode;\n /** Show the count of characters left in the input field. Works along with maxLength prop. */\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\" | \"center\";\n popup?: boolean;\n popupContent?: React.ReactNode;\n outsidePrefix?: any;\n loadingErrorMesssage?: string;\n};\nexport const Input = forwardRef<HTMLInputElement, InputFieldProps>(\n (\n {\n margin = \"none\",\n width = \"full\",\n preview = false,\n forceHideHelperText = false,\n labelProps,\n placeholder,\n showCount,\n inputProps,\n countPosition = \"bottom\",\n ...props\n },\n ref,\n ) => {\n const [value, setValue] = useState(props.value || \"\");\n\n let marginStyles = {\n none: \"hawa-mb-0\",\n normal: \"hawa-mb-3\",\n large: \"hawa-mb-5\",\n };\n let widthStyles = {\n small: \"hawa-w-full hawa-max-w-2xs\",\n normal: \"hawa-w-1/2\",\n full: \"hawa-w-full\",\n auto: \"\",\n };\n\n let defaultStyle =\n \"hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0\";\n let defaultInputStyle =\n \"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground\";\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = e.target.value;\n setValue(newValue);\n\n if (props.prefixText) {\n // If newValue is shorter than prefixText, set newValue to prefixText\n if (newValue.length < props.prefixText.length) {\n newValue = props.prefixText;\n } else {\n // Check if newValue starts with a substring of prefixText\n const isSubstring = props.prefixText.startsWith(newValue);\n\n if (!isSubstring && !newValue.startsWith(props.prefixText)) {\n newValue = `${props.prefixText}${newValue}`;\n }\n }\n }\n\n if (props.onChange) {\n if (props.type === \"number\" && props.maxLength) {\n let v = newValue.replace(/[^0-9]/g, \"\").slice(0, props.maxLength);\n const newEvent = { ...e, target: { ...e.target, value: v } };\n setValue(v);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n } else {\n const newEvent = { ...e, target: { ...e.target, value: newValue } };\n setValue(newValue);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n }\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (props.type === \"number\" && [\"e\", \"E\", \"+\", \"-\", \".\"].includes(e.key)) {\n e.preventDefault();\n }\n props.onKeyDown && props.onKeyDown(e);\n };\n\n return (\n <div\n className={cn(\n defaultStyle,\n marginStyles[margin],\n widthStyles[width],\n props.containerClassName,\n \"hawa-w-full hawa-gap-2\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className=\"hawa-flex hawa-flex-row hawa-w-full hawa-items-center\">\n {props.outsidePrefix && (\n <span className={cn(\"hawa-me-2 hawa-opacity-90\", !forceHideHelperText && \"hawa-mb-2\")}>\n {props.outsidePrefix}\n </span>\n )}\n {props.isLoading ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton as=\"input\" />\n </div>\n ) : props.isLoadingError ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton\n animation=\"none\"\n className=\"hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]\"\n content={\n <div className=\"hawa-flex hawa-flex-row hawa-gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-text-destructive\"\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n <span>\n <span className=\"hawa-text-destructive\">\n {props.loadingErrorMesssage || \"Error loading data\"}\n </span>\n </span>\n </div>\n }\n />\n </div>\n ) : (\n <>\n {!props.hideSeparator && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n )}\n <div className=\"hawa-flex hawa-flex-col hawa-w-full hawa-gap-2\">\n <div className={\"hawa-relative\"}>\n {props.startIcon && (\n <div className=\"hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2\">\n {props.startIcon}\n </div>\n )}\n {props.endIcon && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2\",\n props.endIconProps?.className,\n )}\n >\n {props.endIcon}\n </div>\n )}\n <input\n required\n dir={props.dir}\n type={props.type}\n value={props.value || value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n autoComplete={props.autoComplete}\n defaultValue={props.defaultValue}\n placeholder={placeholder}\n disabled={props.disabled || preview}\n style={{ height: 40 }}\n maxLength={props.maxLength}\n {...inputProps}\n className={cn(\n defaultInputStyle,\n \"focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white\",\n {\n \"hawa-pe-9\": props.endIcon,\n \"hawa-ps-9\": props.startIcon,\n \"hawa-pe-[60px]\": countPosition === \"center\",\n },\n preview && \"hawa-border-transparent hawa-bg-transparent hawa-px-0\",\n inputProps?.className,\n )}\n />\n </div>\n\n {/* Regular helper text */}\n {!forceHideHelperText && <HelperText helperText={props.helperText} />}\n {/* Popover helper text */}\n {!props.disabled && forceHideHelperText && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all\",\n props.helperText ? \"hawa-border hawa-p-1\" : \"hawa-border-none hawa-p-0\",\n )}\n >\n {props.helperText}\n </div>\n )}\n {/* Character Counter */}\n {showCount && (\n <div\n className={cn(\n \"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all\",\n {\n \"hawa-end-0 hawa-top-[62px]\": countPosition === \"bottom\",\n \"hawa-bottom-[62px] hawa-end-0\": countPosition === \"top\",\n \"hawa-end-2\": countPosition === \"center\",\n },\n )}\n >\n {props.value ? String(props.value).length : 0}/{props.maxLength}\n </div>\n )}\n\n {/* Popover helper text */}\n {/* {props.popup && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[47px] hawa-min-h-fit hawa-w-full hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start hawa-rounded hawa-end-0 hawa-z-20 hawa-drop-shadow-md hawa-bg-background hawa-translate-y-1/2\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\"\n )}\n >\n {props.popupContent}\n </div>\n )} */}\n </div>\n </>\n )}\n </div>\n </div>\n );\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: string | React.ReactNode }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider delayDuration={delayDuration} {...providerProps}>\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>{children}</TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n as?: \"div\" | \"input\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n as = \"div\",\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n const styledAs = {\n div: \"\",\n input: \"hawa-h-[40px] hawa-w-full\",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content && \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n styledAs[as],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA4C;;;ACA5C,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACLA,mBAAkB;AAIX,IAAM,aAAa,CAAC,EAAE,WAAW,MACtC,6BAAAC,QAAA;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;ACZF,IAAAC,SAAuB;;;ACAvB,IAAAC,gBAAkB;AAElB,uBAAkC;AAKlC,IAAM,iBAAiB,cAAAC,QAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,8BAAAA,QAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;AAEtD,IAAM,eAAe,cAAAA,QAAM,WAGzB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,8BAAAA,QAAA,cAAkB,wBAAjB,EAAuB,KAAU,WAAW,GAAG,SAAS,GAAI,GAAG,OAAO,CACxE;AACD,aAAa,cAA+B,uBAAM;AA0BlD,IAAM,UAAiD,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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,QAAQ,OAAO,MAAM,KAAK,EAAE,SAAS;AAAA,QAAE;AAAA,QAAE,MAAM;AAAA,MACxD,CAgBJ,CACF,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;","names":["import_react","React","React","import_react","React","import_react","React","React"]}
|
package/dist/input/index.mjs
CHANGED
@@ -12,9 +12,7 @@ function cn(...inputs) {
|
|
12
12
|
|
13
13
|
// elements/helperText/HelperText.tsx
|
14
14
|
import React from "react";
|
15
|
-
var HelperText = ({
|
16
|
-
helperText
|
17
|
-
}) => /* @__PURE__ */ React.createElement(
|
15
|
+
var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
|
18
16
|
"p",
|
19
17
|
{
|
20
18
|
className: cn(
|
@@ -65,38 +63,31 @@ var Tooltip = ({
|
|
65
63
|
delayDuration = 300,
|
66
64
|
...props
|
67
65
|
}) => {
|
68
|
-
return /* @__PURE__ */ React2.createElement(
|
69
|
-
TooltipPrimitive.
|
66
|
+
return /* @__PURE__ */ React2.createElement(TooltipPrimitive.TooltipProvider, { delayDuration, ...providerProps }, /* @__PURE__ */ React2.createElement(
|
67
|
+
TooltipPrimitive.Root,
|
70
68
|
{
|
71
|
-
|
72
|
-
|
69
|
+
open: !disabled && open,
|
70
|
+
defaultOpen,
|
71
|
+
onOpenChange,
|
72
|
+
...props
|
73
73
|
},
|
74
|
+
/* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
74
75
|
/* @__PURE__ */ React2.createElement(
|
75
|
-
|
76
|
+
TooltipContent,
|
76
77
|
{
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
...
|
78
|
+
size,
|
79
|
+
side,
|
80
|
+
align: "center",
|
81
|
+
...contentProps,
|
82
|
+
style: {
|
83
|
+
...contentProps == null ? void 0 : contentProps.style,
|
84
|
+
maxWidth: "var(--radix-tooltip-content-available-width)",
|
85
|
+
maxHeight: "var(--radix-tooltip-content-available-height)"
|
86
|
+
}
|
81
87
|
},
|
82
|
-
|
83
|
-
/* @__PURE__ */ React2.createElement(
|
84
|
-
TooltipContent,
|
85
|
-
{
|
86
|
-
size,
|
87
|
-
side,
|
88
|
-
align: "center",
|
89
|
-
...contentProps,
|
90
|
-
style: {
|
91
|
-
...contentProps == null ? void 0 : contentProps.style,
|
92
|
-
maxWidth: "var(--radix-tooltip-content-available-width)",
|
93
|
-
maxHeight: "var(--radix-tooltip-content-available-height)"
|
94
|
-
}
|
95
|
-
},
|
96
|
-
content
|
97
|
-
)
|
88
|
+
content
|
98
89
|
)
|
99
|
-
);
|
90
|
+
));
|
100
91
|
};
|
101
92
|
|
102
93
|
// elements/label/Label.tsx
|
package/dist/input/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/input/Input.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["import React, { forwardRef, useState } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { Skeleton } from \"../skeleton/Skeleton\";\n\nexport type InputFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {\n isLoading?: boolean;\n isLoadingError?: boolean;\n containerClassName?: string;\n margin?: \"none\" | \"normal\" | \"large\";\n width?: \"small\" | \"normal\" | \"full\" | \"auto\";\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n hideSeparator?: boolean;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n prefixText?: any;\n forceHideHelperText?: boolean;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** The icon inside the input field */\n icon?: any;\n /** Boolean to enable/disable editing the input field and using it as a text field */\n preview?: boolean;\n // maxLength?: any;\n iconInside?: React.ReactNode;\n endIcon?: React.ReactNode;\n endIconProps?: { className?: string };\n startIcon?: React.ReactNode;\n placeholder?: React.ReactNode;\n /** Show the count of characters left in the input field. Works along with maxLength prop. */\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\" | \"center\";\n popup?: boolean;\n popupContent?: React.ReactNode;\n outsidePrefix?: any;\n loadingErrorMesssage?: string;\n};\nexport const Input = forwardRef<HTMLInputElement, InputFieldProps>(\n (\n {\n margin = \"none\",\n width = \"full\",\n preview = false,\n forceHideHelperText = false,\n labelProps,\n placeholder,\n showCount,\n inputProps,\n countPosition = \"bottom\",\n ...props\n },\n ref,\n ) => {\n const [value, setValue] = useState(props.value || \"\");\n\n let marginStyles = {\n none: \"hawa-mb-0\",\n normal: \"hawa-mb-3\",\n large: \"hawa-mb-5\",\n };\n let widthStyles = {\n small: \"hawa-w-full hawa-max-w-2xs\",\n normal: \"hawa-w-1/2\",\n full: \"hawa-w-full\",\n auto: \"\",\n };\n\n let defaultStyle =\n \"hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0\";\n let defaultInputStyle =\n \"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground\";\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = e.target.value;\n setValue(newValue);\n\n if (props.prefixText) {\n // If newValue is shorter than prefixText, set newValue to prefixText\n if (newValue.length < props.prefixText.length) {\n newValue = props.prefixText;\n } else {\n // Check if newValue starts with a substring of prefixText\n const isSubstring = props.prefixText.startsWith(newValue);\n\n if (!isSubstring && !newValue.startsWith(props.prefixText)) {\n newValue = `${props.prefixText}${newValue}`;\n }\n }\n }\n\n if (props.onChange) {\n if (props.type === \"number\" && props.maxLength) {\n let v = newValue.replace(/[^0-9]/g, \"\").slice(0, props.maxLength);\n const newEvent = { ...e, target: { ...e.target, value: v } };\n setValue(v);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n } else {\n const newEvent = { ...e, target: { ...e.target, value: newValue } };\n setValue(newValue);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n }\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (props.type === \"number\" && [\"e\", \"E\", \"+\", \"-\", \".\"].includes(e.key)) {\n e.preventDefault();\n }\n props.onKeyDown && props.onKeyDown(e);\n };\n\n return (\n <div\n className={cn(\n defaultStyle,\n marginStyles[margin],\n widthStyles[width],\n props.containerClassName,\n \"hawa-w-full hawa-gap-2\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className=\"hawa-flex hawa-flex-row hawa-w-full hawa-items-center\">\n {props.outsidePrefix && (\n <span className={cn(\"hawa-me-2 hawa-opacity-90\", !forceHideHelperText && \"hawa-mb-2\")}>\n {props.outsidePrefix}\n </span>\n )}\n {props.isLoading ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton as=\"input\" />\n </div>\n ) : props.isLoadingError ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton\n animation=\"none\"\n className=\"hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]\"\n content={\n <div className=\"hawa-flex hawa-flex-row hawa-gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-text-destructive\"\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n <span>\n <span className=\"hawa-text-destructive\">\n {props.loadingErrorMesssage || \"Error loading data\"}\n </span>\n </span>\n </div>\n }\n />\n </div>\n ) : (\n <>\n {!props.hideSeparator && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n )}\n <div className=\"hawa-flex hawa-flex-col hawa-w-full hawa-gap-2\">\n <div className={\"hawa-relative\"}>\n {props.startIcon && (\n <div className=\"hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2\">\n {props.startIcon}\n </div>\n )}\n {props.endIcon && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2\",\n props.endIconProps?.className,\n )}\n >\n {props.endIcon}\n </div>\n )}\n <input\n required\n dir={props.dir}\n type={props.type}\n value={props.value || value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n autoComplete={props.autoComplete}\n defaultValue={props.defaultValue}\n placeholder={placeholder}\n disabled={props.disabled || preview}\n style={{ height: 40 }}\n maxLength={props.maxLength}\n {...inputProps}\n className={cn(\n defaultInputStyle,\n \"focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white\",\n {\n \"hawa-pe-9\": props.endIcon,\n \"hawa-ps-9\": props.startIcon,\n \"hawa-pe-[60px]\": countPosition === \"center\",\n },\n preview && \"hawa-border-transparent hawa-bg-transparent hawa-px-0\",\n inputProps?.className,\n )}\n />\n </div>\n\n {/* Regular helper text */}\n {!forceHideHelperText && <HelperText helperText={props.helperText} />}\n {/* Popover helper text */}\n {!props.disabled && forceHideHelperText && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all\",\n props.helperText ? \"hawa-border hawa-p-1\" : \"hawa-border-none hawa-p-0\",\n )}\n >\n {props.helperText}\n </div>\n )}\n {/* Character Counter */}\n {showCount && (\n <div\n className={cn(\n \"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all\",\n {\n \"hawa-end-0 hawa-top-[62px]\": countPosition === \"bottom\",\n \"hawa-bottom-[62px] hawa-end-0\": countPosition === \"top\",\n \"hawa-end-2\": countPosition === \"center\",\n },\n )}\n >\n {props.value ? String(props.value).length : 0}/{props.maxLength}\n </div>\n )}\n\n {/* Popover helper text */}\n {/* {props.popup && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[47px] hawa-min-h-fit hawa-w-full hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start hawa-rounded hawa-end-0 hawa-z-20 hawa-drop-shadow-md hawa-bg-background hawa-translate-y-1/2\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\"\n )}\n >\n {props.popupContent}\n </div>\n )} */}\n </div>\n </>\n )}\n </div>\n </div>\n );\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({\n helperText,\n}: {\n helperText?: string | React.ReactNode;\n}) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider\n delayDuration={delayDuration}\n {...providerProps}\n >\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n as?: \"div\" | \"input\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n as = \"div\",\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n const styledAs = {\n div: \"\",\n input: \"hawa-h-[40px] hawa-w-full\",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content && \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n styledAs[as],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;AAAA,OAAOA,UAAS,cAAAC,aAAY,gBAAgB;;;ACA5C,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC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AA;AAAA,UACC,UAAQ;AAAA,UACR,KAAK,MAAM;AAAA,UACX,MAAM,MAAM;AAAA,UACZ,OAAO,MAAM,SAAS;AAAA,UACtB,UAAU;AAAA,UACV,WAAW;AAAA,UACX,cAAc,MAAM;AAAA,UACpB,cAAc,MAAM;AAAA,UACpB;AAAA,UACA,UAAU,MAAM,YAAY;AAAA,UAC5B,OAAO,EAAE,QAAQ,GAAG;AAAA,UACpB,WAAW,MAAM;AAAA,UAChB,GAAG;AAAA,UACJ,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,cACE,aAAa,MAAM;AAAA,cACnB,aAAa,MAAM;AAAA,cACnB,kBAAkB,kBAAkB;AAAA,YACtC;AAAA,YACA,WAAW;AAAA,YACX,yCAAY;AAAA,UACd;AAAA;AAAA,MACF,CACF,GAGC,CAAC,uBAAuB,gBAAAA,OAAA,cAAC,cAAW,YAAY,MAAM,YAAY,GAElE,CAAC,MAAM,YAAY,uBAClB,gBAAAA,OAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,MAAM,aAAa,yBAAyB;AAAA,UAC9C;AAAA;AAAA,QAEC,MAAM;AAAA,MACT,GAGD,aACC,gBAAAA,OAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,cACE,8BAA8B,kBAAkB;AAAA,cAChD,iCAAiC,kBAAkB;AAAA,cACnD,cAAc,kBAAkB;AAAA,YAClC;AAAA,UACF;AAAA;AAAA,QAEC,MAAM,QAAQ,OAAO,MAAM,KAAK,EAAE,SAAS;AAAA,QAAE;AAAA,QAAE,MAAM;AAAA,MACxD,CAgBJ,CACF,CAEJ;AAAA,IACF;AAAA,EAEJ;AACF;","names":["React","forwardRef","React","React","React","React","React","forwardRef","React"]}
|
1
|
+
{"version":3,"sources":["../../elements/input/Input.tsx","../../util/index.ts","../../elements/helperText/HelperText.tsx","../../elements/label/Label.tsx","../../elements/tooltip/Tooltip.tsx","../../elements/skeleton/Skeleton.tsx"],"sourcesContent":["import React, { forwardRef, useState } from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { HelperText } from \"../helperText\";\nimport { Label, LabelProps } from \"../label/Label\";\nimport { Skeleton } from \"../skeleton/Skeleton\";\n\nexport type InputFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {\n isLoading?: boolean;\n isLoadingError?: boolean;\n containerClassName?: string;\n margin?: \"none\" | \"normal\" | \"large\";\n width?: \"small\" | \"normal\" | \"full\" | \"auto\";\n /** The label of the input field */\n label?: any;\n labelProps?: LabelProps;\n hideSeparator?: boolean;\n /** The small red text under the input field to show validation. */\n helperText?: any;\n prefixText?: any;\n forceHideHelperText?: boolean;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** The icon inside the input field */\n icon?: any;\n /** Boolean to enable/disable editing the input field and using it as a text field */\n preview?: boolean;\n // maxLength?: any;\n iconInside?: React.ReactNode;\n endIcon?: React.ReactNode;\n endIconProps?: { className?: string };\n startIcon?: React.ReactNode;\n placeholder?: React.ReactNode;\n /** Show the count of characters left in the input field. Works along with maxLength prop. */\n showCount?: boolean;\n countPosition?: \"top\" | \"bottom\" | \"center\";\n popup?: boolean;\n popupContent?: React.ReactNode;\n outsidePrefix?: any;\n loadingErrorMesssage?: string;\n};\nexport const Input = forwardRef<HTMLInputElement, InputFieldProps>(\n (\n {\n margin = \"none\",\n width = \"full\",\n preview = false,\n forceHideHelperText = false,\n labelProps,\n placeholder,\n showCount,\n inputProps,\n countPosition = \"bottom\",\n ...props\n },\n ref,\n ) => {\n const [value, setValue] = useState(props.value || \"\");\n\n let marginStyles = {\n none: \"hawa-mb-0\",\n normal: \"hawa-mb-3\",\n large: \"hawa-mb-5\",\n };\n let widthStyles = {\n small: \"hawa-w-full hawa-max-w-2xs\",\n normal: \"hawa-w-1/2\",\n full: \"hawa-w-full\",\n auto: \"\",\n };\n\n let defaultStyle =\n \"hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0\";\n let defaultInputStyle =\n \"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground\";\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = e.target.value;\n setValue(newValue);\n\n if (props.prefixText) {\n // If newValue is shorter than prefixText, set newValue to prefixText\n if (newValue.length < props.prefixText.length) {\n newValue = props.prefixText;\n } else {\n // Check if newValue starts with a substring of prefixText\n const isSubstring = props.prefixText.startsWith(newValue);\n\n if (!isSubstring && !newValue.startsWith(props.prefixText)) {\n newValue = `${props.prefixText}${newValue}`;\n }\n }\n }\n\n if (props.onChange) {\n if (props.type === \"number\" && props.maxLength) {\n let v = newValue.replace(/[^0-9]/g, \"\").slice(0, props.maxLength);\n const newEvent = { ...e, target: { ...e.target, value: v } };\n setValue(v);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n } else {\n const newEvent = { ...e, target: { ...e.target, value: newValue } };\n setValue(newValue);\n props.onChange(newEvent as React.ChangeEvent<HTMLInputElement>);\n }\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (props.type === \"number\" && [\"e\", \"E\", \"+\", \"-\", \".\"].includes(e.key)) {\n e.preventDefault();\n }\n props.onKeyDown && props.onKeyDown(e);\n };\n\n return (\n <div\n className={cn(\n defaultStyle,\n marginStyles[margin],\n widthStyles[width],\n props.containerClassName,\n \"hawa-w-full hawa-gap-2\",\n )}\n >\n {props.label && <Label {...labelProps}>{props.label}</Label>}\n <div className=\"hawa-flex hawa-flex-row hawa-w-full hawa-items-center\">\n {props.outsidePrefix && (\n <span className={cn(\"hawa-me-2 hawa-opacity-90\", !forceHideHelperText && \"hawa-mb-2\")}>\n {props.outsidePrefix}\n </span>\n )}\n {props.isLoading ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton as=\"input\" />\n </div>\n ) : props.isLoadingError ? (\n <div className=\"hawa-pb-2 hawa-w-full\">\n <Skeleton\n animation=\"none\"\n className=\"hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]\"\n content={\n <div className=\"hawa-flex hawa-flex-row hawa-gap-2\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"hawa-text-destructive\"\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n <span>\n <span className=\"hawa-text-destructive\">\n {props.loadingErrorMesssage || \"Error loading data\"}\n </span>\n </span>\n </div>\n }\n />\n </div>\n ) : (\n <>\n {!props.hideSeparator && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800\",\n preview ? \"hawa-opacity-100\" : \"hawa-opacity-0\",\n )}\n ></div>\n )}\n <div className=\"hawa-flex hawa-flex-col hawa-w-full hawa-gap-2\">\n <div className={\"hawa-relative\"}>\n {props.startIcon && (\n <div className=\"hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2\">\n {props.startIcon}\n </div>\n )}\n {props.endIcon && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2\",\n props.endIconProps?.className,\n )}\n >\n {props.endIcon}\n </div>\n )}\n <input\n required\n dir={props.dir}\n type={props.type}\n value={props.value || value}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n autoComplete={props.autoComplete}\n defaultValue={props.defaultValue}\n placeholder={placeholder}\n disabled={props.disabled || preview}\n style={{ height: 40 }}\n maxLength={props.maxLength}\n {...inputProps}\n className={cn(\n defaultInputStyle,\n \"focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white\",\n {\n \"hawa-pe-9\": props.endIcon,\n \"hawa-ps-9\": props.startIcon,\n \"hawa-pe-[60px]\": countPosition === \"center\",\n },\n preview && \"hawa-border-transparent hawa-bg-transparent hawa-px-0\",\n inputProps?.className,\n )}\n />\n </div>\n\n {/* Regular helper text */}\n {!forceHideHelperText && <HelperText helperText={props.helperText} />}\n {/* Popover helper text */}\n {!props.disabled && forceHideHelperText && (\n <div\n className={cn(\n \"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all\",\n props.helperText ? \"hawa-border hawa-p-1\" : \"hawa-border-none hawa-p-0\",\n )}\n >\n {props.helperText}\n </div>\n )}\n {/* Character Counter */}\n {showCount && (\n <div\n className={cn(\n \"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all\",\n {\n \"hawa-end-0 hawa-top-[62px]\": countPosition === \"bottom\",\n \"hawa-bottom-[62px] hawa-end-0\": countPosition === \"top\",\n \"hawa-end-2\": countPosition === \"center\",\n },\n )}\n >\n {props.value ? String(props.value).length : 0}/{props.maxLength}\n </div>\n )}\n\n {/* Popover helper text */}\n {/* {props.popup && (\n <div\n className={cn(\n \"hawa-absolute hawa-top-[47px] hawa-min-h-fit hawa-w-full hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start hawa-rounded hawa-end-0 hawa-z-20 hawa-drop-shadow-md hawa-bg-background hawa-translate-y-1/2\",\n props.helperText\n ? \"hawa-border hawa-p-1\"\n : \"hawa-border-none hawa-p-0\"\n )}\n >\n {props.popupContent}\n </div>\n )} */}\n </div>\n </>\n )}\n </div>\n </div>\n );\n },\n);\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(sanitizedHex);\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\"),\n },\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49,\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: string | React.ReactNode }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-helper-color hawa-transition-all hawa-text-xs\",\n helperText ? \"hawa-opacity-100 hawa-h-4\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nimport { Tooltip } from \"../tooltip\";\n\nexport type LabelProps = {\n hint?: React.ReactNode;\n hintSide?: PositionType;\n htmlFor?: string;\n required?: boolean;\n};\n\nconst Label = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps\n>(({ className, hint, hintSide, required, children, ...props }, ref) => (\n <div className=\"hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all\">\n <label\n ref={ref}\n className={cn(\n \"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"hawa-mx-0.5 hawa-text-red-500\">*</span>}\n </label>\n {hint && (\n <Tooltip\n content={hint}\n side={hintSide}\n triggerProps={{\n tabIndex: -1,\n onClick: (event) => event.preventDefault(),\n }}\n >\n <div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"hawa-h-[14px] hawa-w-[14px] hawa-cursor-help\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </div>\n </Tooltip>\n )}\n </div>\n));\n\nLabel.displayName = \"Label\";\n\nexport { Label };\n","import React from \"react\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@util/index\";\n\nimport { PositionType } from \"@_types/commonTypes\";\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {\n size?: \"default\" | \"small\" | \"large\";\n }\n>(({ className, sideOffset = 4, size = \"default\", ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2\",\n {\n \"hawa-text-xs\": size === \"small\",\n \"hawa-text-xl\": size === \"large\",\n },\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipArrow = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>\n>(({ className, ...props }, ref) => (\n <TooltipPrimitive.Arrow ref={ref} className={cn(className)} {...props} />\n));\nTooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;\n\ntype TooltipTypes = {\n /** Controls the open state of the tooltip. */\n open?: any;\n /** Specifies the side where the tooltip will appear. */\n side?: PositionType;\n /** Content to be displayed within the tooltip. */\n content?: any;\n /** Elements to which the tooltip is anchored. */\n children?: any;\n /** Sets the default open state of the tooltip. */\n defaultOpen?: any;\n /** Event handler for open state changes. */\n onOpenChange?: any;\n /** Duration of the delay before the tooltip appears. */\n delayDuration?: any;\n /** Size of the tooltip. */\n size?: \"default\" | \"small\" | \"large\";\n /** Disables the tooltip. */\n disabled?: boolean;\n triggerProps?: TooltipPrimitive.TooltipTriggerProps;\n contentProps?: TooltipPrimitive.TooltipContentProps;\n providerProps?: TooltipPrimitive.TooltipProps;\n};\n\nconst Tooltip: React.FunctionComponent<TooltipTypes> = ({\n side,\n size,\n open,\n content,\n children,\n disabled,\n defaultOpen,\n onOpenChange,\n triggerProps,\n contentProps,\n providerProps,\n delayDuration = 300,\n ...props\n}) => {\n return (\n <TooltipPrimitive.TooltipProvider delayDuration={delayDuration} {...providerProps}>\n <TooltipPrimitive.Root\n open={!disabled && open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n {...props}\n >\n <TooltipPrimitive.Trigger {...triggerProps}>{children}</TooltipPrimitive.Trigger>\n <TooltipContent\n size={size}\n side={side}\n align=\"center\"\n {...contentProps}\n style={{\n ...contentProps?.style,\n maxWidth: \"var(--radix-tooltip-content-available-width)\",\n maxHeight: \"var(--radix-tooltip-content-available-height)\",\n }}\n >\n {content}\n </TooltipContent>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.TooltipProvider>\n );\n};\n\nexport { Tooltip };\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\ninterface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n animation?: \"none\" | \"pulse\" | \"shimmer\";\n content?: any;\n fade?: \"top\" | \"bottom\" | \"left\" | \"right\";\n as?: \"div\" | \"input\";\n}\n\nfunction Skeleton({\n className,\n content,\n animation = \"pulse\",\n fade,\n as = \"div\",\n ...props\n}: SkeletonProps) {\n const animationStyles = {\n none: \"hawa-rounded hawa-bg-muted\",\n pulse: \"hawa-animate-pulse hawa-rounded hawa-bg-muted\",\n shimmer:\n \"hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10\",\n };\n const fadeStyle = {\n bottom: \"hawa-mask-fade-bottom\",\n top: \"hawa-mask-fade-top\",\n right: \"hawa-mask-fade-right\",\n left: \"hawa-mask-fade-left \",\n };\n\n const styledAs = {\n div: \"\",\n input: \"hawa-h-[40px] hawa-w-full\",\n };\n\n return (\n <div\n className={cn(\n animationStyles[animation],\n content && \"hawa-flex hawa-flex-col hawa-items-center hawa-justify-center\",\n fade && fadeStyle[fade],\n styledAs[as],\n className,\n )}\n {...props}\n >\n {content && content}\n </div>\n );\n}\n\nexport { Skeleton };\n"],"mappings":";;;AAAA,OAAOA,UAAS,cAAAC,aAAY,gBAAgB;;;ACA5C,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACLA,OAAO,WAAW;AAIX,IAAM,aAAa,CAAC,EAAE,WAAW,MACtC;AAAA,EAAC;AAAA;AAAA,IACC,WAAW;AAAA,MACT;AAAA,MACA,aAAa,8BAA8B;AAAA,IAC7C;AAAA;AAAA,EAEC;AACH;;;ACZF,YAAYC,YAAW;;;ACAvB,OAAOC,YAAW;AAElB,YAAY,sBAAsB;AAKlC,IAAM,iBAAiBC,OAAM,WAK3B,CAAC,EAAE,WAAW,aAAa,GAAG,OAAO,WAAW,GAAG,MAAM,GAAG,QAC5D,gBAAAA,OAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,QACE,gBAAgB,SAAS;AAAA,QACzB,gBAAgB,SAAS;AAAA,MAC3B;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,y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