@sikka/hawa 0.26.19-next → 0.26.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +2 -2
  2. package/dist/accordion/index.js +10 -12
  3. package/dist/accordion/index.mjs +8 -8
  4. package/dist/alert/index.js +8 -7
  5. package/dist/alert/index.mjs +7 -6
  6. package/dist/appLayout/index.js +13 -12
  7. package/dist/appLayout/index.mjs +12 -11
  8. package/dist/appMenubar/index.js +4 -4
  9. package/dist/appMenubar/index.mjs +2 -2
  10. package/dist/appStores/index.js +2 -2
  11. package/dist/appStores/index.mjs +1 -1
  12. package/dist/appTabs/index.js +4 -4
  13. package/dist/appTabs/index.mjs +2 -2
  14. package/dist/appTopbar/index.js +6 -6
  15. package/dist/appTopbar/index.mjs +4 -4
  16. package/dist/avatar/index.js +5 -5
  17. package/dist/avatar/index.mjs +4 -4
  18. package/dist/backToTop/index.js +8 -7
  19. package/dist/backToTop/index.mjs +7 -6
  20. package/dist/badge/index.js +4 -4
  21. package/dist/badge/index.mjs +2 -2
  22. package/dist/blocks/auth/index.js +38 -37
  23. package/dist/blocks/auth/index.mjs +24 -24
  24. package/dist/blocks/feedback/index.js +27 -26
  25. package/dist/blocks/feedback/index.mjs +11 -11
  26. package/dist/blocks/index.js +77 -76
  27. package/dist/blocks/index.mjs +34 -34
  28. package/dist/blocks/misc/index.js +31 -30
  29. package/dist/blocks/misc/index.mjs +14 -14
  30. package/dist/blocks/pricing/index.js +123 -122
  31. package/dist/blocks/pricing/index.mjs +18 -18
  32. package/dist/breadcrumb/index.js +2 -2
  33. package/dist/breadcrumb/index.mjs +1 -1
  34. package/dist/button/index.js +6 -5
  35. package/dist/button/index.mjs +5 -4
  36. package/dist/card/index.js +4 -4
  37. package/dist/card/index.mjs +2 -2
  38. package/dist/carousel/index.d.mts +1 -1
  39. package/dist/carousel/index.d.ts +1 -1
  40. package/dist/carousel/index.js +9 -18
  41. package/dist/carousel/index.mjs +7 -16
  42. package/dist/checkbox/index.js +4 -4
  43. package/dist/checkbox/index.mjs +2 -2
  44. package/dist/chip/index.js +4 -4
  45. package/dist/chip/index.mjs +2 -2
  46. package/dist/{chunk-343SRWR4.mjs → chunk-3GBITBPL.mjs} +2 -2
  47. package/dist/{chunk-TTKRRN7S.mjs → chunk-4IOG44R3.mjs} +2 -2
  48. package/dist/{chunk-3N6JJKMN.mjs → chunk-65TG6EVD.mjs} +5 -4
  49. package/dist/{chunk-LT3VHLAG.mjs → chunk-APZM24KK.mjs} +2 -2
  50. package/dist/{chunk-FYH74ZRQ.mjs → chunk-AREFDTXK.mjs} +9 -8
  51. package/dist/{chunk-FNVYY7ND.mjs → chunk-D22AALLE.mjs} +1 -1
  52. package/dist/{chunk-OD5WIQGQ.mjs → chunk-FDKCMEMD.mjs} +2 -2
  53. package/dist/{chunk-KNHT2UBG.mjs → chunk-KMCIHW76.mjs} +2 -2
  54. package/dist/{chunk-M2ZS3EDT.mjs → chunk-OAXF3RCQ.mjs} +2 -2
  55. package/dist/chunk-OTGCLEKC.mjs +62 -0
  56. package/dist/{chunk-OE23TTPS.mjs → chunk-POIP5U4M.mjs} +3 -3
  57. package/dist/{chunk-EYUG3GRC.mjs → chunk-SJ2Z6ZOG.mjs} +4 -4
  58. package/dist/{chunk-WRZFWCOQ.mjs → chunk-TGZRVRLP.mjs} +4 -4
  59. package/dist/{chunk-TE3BKEXL.mjs → chunk-TWNGV3RE.mjs} +1 -1
  60. package/dist/{chunk-ATUSR6VI.mjs → chunk-U3TZWNDZ.mjs} +4 -4
  61. package/dist/{chunk-W77KCP35.mjs → chunk-VQQ6MUX5.mjs} +2 -2
  62. package/dist/{chunk-SUS6O2PO.mjs → chunk-WPSUV4AD.mjs} +21 -21
  63. package/dist/{chunk-3KMBSNM3.mjs → chunk-Z5SL5QTQ.mjs} +11 -10
  64. package/dist/{chunk-ZCZ3WARS.mjs → chunk-ZS3FB3PO.mjs} +1 -1
  65. package/dist/codeBlock/index.js +153 -2454
  66. package/dist/codeBlock/index.mjs +129 -2393
  67. package/dist/collapsible/index.js +2 -2
  68. package/dist/collapsible/index.mjs +1 -1
  69. package/dist/colorPicker/index.js +7 -7
  70. package/dist/colorPicker/index.mjs +126 -2
  71. package/dist/combobox/index.js +193 -193
  72. package/dist/combobox/index.mjs +8 -8
  73. package/dist/command/index.js +5 -5
  74. package/dist/command/index.mjs +1 -1
  75. package/dist/copyrights/index.js +2 -2
  76. package/dist/copyrights/index.mjs +1 -1
  77. package/dist/count/index.js +2 -2
  78. package/dist/count/index.mjs +1 -1
  79. package/dist/dataTable/index.js +16 -15
  80. package/dist/dataTable/index.mjs +15 -14
  81. package/dist/destroyableCard/index.js +6 -8
  82. package/dist/destroyableCard/index.mjs +4 -4
  83. package/dist/dialog/index.js +4 -4
  84. package/dist/dialog/index.mjs +2 -2
  85. package/dist/docsLayout/index.js +12 -11
  86. package/dist/docsLayout/index.mjs +11 -10
  87. package/dist/docsSidebar/index.js +4 -4
  88. package/dist/docsSidebar/index.mjs +2 -2
  89. package/dist/dropdownMenu/index.js +4 -4
  90. package/dist/dropdownMenu/index.mjs +2 -2
  91. package/dist/elements/index.d.mts +1 -1
  92. package/dist/elements/index.d.ts +1 -1
  93. package/dist/elements/index.js +155 -163
  94. package/dist/elements/index.mjs +47 -56
  95. package/dist/fileDropzone/index.js +10 -9
  96. package/dist/fileDropzone/index.mjs +9 -8
  97. package/dist/fileUploader/index.js +2 -2
  98. package/dist/fileUploader/index.mjs +1 -1
  99. package/dist/glow/index.js +2 -2
  100. package/dist/glow/index.mjs +1 -1
  101. package/dist/hooks/index.d.mts +7 -7
  102. package/dist/hooks/index.d.ts +7 -7
  103. package/dist/hooks/index.js +16 -16
  104. package/dist/hooks/index.mjs +14 -14
  105. package/dist/index.css +0 -465
  106. package/dist/index.d.mts +8 -8
  107. package/dist/index.d.ts +8 -8
  108. package/dist/index.js +213 -221
  109. package/dist/index.mjs +212 -220
  110. package/dist/input/index.js +8 -8
  111. package/dist/input/index.mjs +4 -4
  112. package/dist/interfaceSettings/index.js +9 -9
  113. package/dist/interfaceSettings/index.mjs +4 -4
  114. package/dist/label/index.js +5 -5
  115. package/dist/label/index.mjs +4 -4
  116. package/dist/layout/index.d.mts +1 -1
  117. package/dist/layout/index.d.ts +1 -1
  118. package/dist/layout/index.js +31 -30
  119. package/dist/layout/index.mjs +16 -16
  120. package/dist/loading/index.js +4 -4
  121. package/dist/loading/index.mjs +2 -2
  122. package/dist/logos/index.js +2 -2
  123. package/dist/logos/index.mjs +1 -1
  124. package/dist/navbar/index.js +5 -5
  125. package/dist/navbar/index.mjs +4 -4
  126. package/dist/navigationMenu/index.js +4 -4
  127. package/dist/navigationMenu/index.mjs +2 -2
  128. package/dist/pagination/index.js +4 -4
  129. package/dist/pagination/index.mjs +2 -2
  130. package/dist/passwordInput/index.js +15 -15
  131. package/dist/passwordInput/index.mjs +13 -13
  132. package/dist/phoneInput/index.js +11 -11
  133. package/dist/phoneInput/index.mjs +10 -10
  134. package/dist/pinInput/index.js +4 -4
  135. package/dist/pinInput/index.mjs +2 -2
  136. package/dist/popover/index.js +4 -4
  137. package/dist/popover/index.mjs +2 -2
  138. package/dist/progress/index.js +4 -4
  139. package/dist/progress/index.mjs +2 -2
  140. package/dist/progressCircle/index.js +4 -4
  141. package/dist/progressCircle/index.mjs +2 -2
  142. package/dist/radio/index.js +7 -7
  143. package/dist/radio/index.mjs +6 -6
  144. package/dist/scrollArea/index.js +4 -4
  145. package/dist/scrollArea/index.mjs +2 -2
  146. package/dist/scrollIndicator/index.js +2 -2
  147. package/dist/scrollIndicator/index.mjs +1 -1
  148. package/dist/select/index.js +8 -8
  149. package/dist/select/index.mjs +7 -7
  150. package/dist/separator/index.js +4 -4
  151. package/dist/separator/index.mjs +2 -2
  152. package/dist/sheet/index.js +4 -4
  153. package/dist/sheet/index.mjs +2 -2
  154. package/dist/sidebar/index.js +6 -6
  155. package/dist/sidebar/index.mjs +4 -4
  156. package/dist/signature/index.js +8 -8
  157. package/dist/signature/index.mjs +6 -6
  158. package/dist/simpleTable/index.js +6 -6
  159. package/dist/simpleTable/index.mjs +5 -5
  160. package/dist/skeleton/index.js +4 -4
  161. package/dist/skeleton/index.mjs +2 -2
  162. package/dist/slider/index.js +4 -4
  163. package/dist/slider/index.mjs +2 -2
  164. package/dist/sortButton/index.js +8 -7
  165. package/dist/sortButton/index.mjs +2 -2
  166. package/dist/splitButton/index.js +9 -8
  167. package/dist/splitButton/index.mjs +4 -4
  168. package/dist/stats/index.js +7 -7
  169. package/dist/stats/index.mjs +6 -6
  170. package/dist/stopPropagationWrapper/index.js +2 -2
  171. package/dist/stopPropagationWrapper/index.mjs +1 -1
  172. package/dist/switch/index.js +4 -4
  173. package/dist/switch/index.mjs +2 -2
  174. package/dist/table/index.js +4 -4
  175. package/dist/table/index.mjs +2 -2
  176. package/dist/tabs/index.js +5 -5
  177. package/dist/tabs/index.mjs +4 -4
  178. package/dist/textarea/index.js +7 -7
  179. package/dist/textarea/index.mjs +6 -6
  180. package/dist/toast/index.js +4 -4
  181. package/dist/toast/index.mjs +2 -2
  182. package/dist/toaster/index.js +6 -6
  183. package/dist/toaster/index.mjs +5 -5
  184. package/dist/tooltip/index.js +4 -4
  185. package/dist/tooltip/index.mjs +3 -3
  186. package/dist/types/index.js +1 -1
  187. package/package.json +24 -50
  188. package/dist/chunk-S36W2LDN.mjs +0 -189
@@ -5,15 +5,15 @@ import {
5
5
  ToastProvider,
6
6
  ToastTitle,
7
7
  ToastViewport
8
- } from "../chunk-KNHT2UBG.mjs";
8
+ } from "../chunk-KMCIHW76.mjs";
9
9
  import {
10
10
  cn
11
- } from "../chunk-TE3BKEXL.mjs";
11
+ } from "../chunk-TWNGV3RE.mjs";
12
12
 
13
- // components/elements/toaster/Toaster.tsx
13
+ // elements/toaster/Toaster.tsx
14
14
  import React2 from "react";
15
15
 
16
- // components/hooks/useToast.ts
16
+ // hooks/useToast.ts
17
17
  import * as React from "react";
18
18
  var TOAST_LIMIT = 5;
19
19
  var TOAST_REMOVE_DELAY = 1e5;
@@ -127,7 +127,7 @@ function useToast() {
127
127
  };
128
128
  }
129
129
 
130
- // components/elements/toaster/Toaster.tsx
130
+ // elements/toaster/Toaster.tsx
131
131
  function Toaster(props) {
132
132
  const { toasts } = useToast();
133
133
  let isRTL = props.direction === "rtl";
@@ -27,25 +27,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
- // components/elements/tooltip/index.ts
30
+ // elements/tooltip/index.ts
31
31
  var tooltip_exports = {};
32
32
  __export(tooltip_exports, {
33
33
  Tooltip: () => Tooltip
34
34
  });
35
35
  module.exports = __toCommonJS(tooltip_exports);
36
36
 
37
- // components/elements/tooltip/Tooltip.tsx
37
+ // elements/tooltip/Tooltip.tsx
38
38
  var import_react = __toESM(require("react"));
39
39
  var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
40
40
 
41
- // components/util.ts
41
+ // util/index.ts
42
42
  var import_clsx = require("clsx");
43
43
  var import_tailwind_merge = require("tailwind-merge");
44
44
  function cn(...inputs) {
45
45
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
46
46
  }
47
47
 
48
- // components/elements/tooltip/Tooltip.tsx
48
+ // elements/tooltip/Tooltip.tsx
49
49
  var TooltipContent = import_react.default.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ import_react.default.createElement(
50
50
  TooltipPrimitive.Content,
51
51
  {
@@ -1,15 +1,15 @@
1
- // components/elements/tooltip/Tooltip.tsx
1
+ // elements/tooltip/Tooltip.tsx
2
2
  import React from "react";
3
3
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
4
4
 
5
- // components/util.ts
5
+ // util/index.ts
6
6
  import { clsx } from "clsx";
7
7
  import { twMerge } from "tailwind-merge";
8
8
  function cn(...inputs) {
9
9
  return twMerge(clsx(inputs));
10
10
  }
11
11
 
12
- // components/elements/tooltip/Tooltip.tsx
12
+ // elements/tooltip/Tooltip.tsx
13
13
  var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React.createElement(
14
14
  TooltipPrimitive.Content,
15
15
  {
@@ -13,6 +13,6 @@ var __copyProps = (to, from, except, desc) => {
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
 
16
- // components/types/index.ts
16
+ // types/index.ts
17
17
  var types_exports = {};
18
18
  module.exports = __toCommonJS(types_exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.26.19-next",
3
+ "version": "0.26.21",
4
4
  "description": "Modern UI Kit made with Tailwind",
5
5
  "author": {
6
6
  "name": "Sikka Software",
@@ -44,25 +44,8 @@
44
44
  "files": [
45
45
  "dist/**"
46
46
  ],
47
- "scripts": {
48
- "dev": "next dev",
49
- "build": "next build",
50
- "start": "next start -p 3032",
51
- "lint": "next lint",
52
- "check": "tsc --noEmit",
53
- "test": "jest",
54
- "storybook": "storybook dev -p 6006",
55
- "build-storybook": "storybook build",
56
- "prebuild": "node pre-build.js",
57
- "build-lib": "npm run prebuild && node build-library.js",
58
- "build-lib-old": "tsup --dts",
59
- "build-css": "postcss styles/globals.css -o dist/index.css",
60
- "prepub": "npm run build-lib && npm run build-css",
61
- "pub": "npm publish --tag next",
62
- "chromatic": "npx chromatic --project-token=chpt_9c33d11ef14064f --output-dir ./storybook-static"
63
- },
64
47
  "dependencies": {
65
- "@hookform/resolvers": "^3.3.3",
48
+ "@hookform/resolvers": "^3.3.4",
66
49
  "@radix-ui/react-accordion": "^1.1.2",
67
50
  "@radix-ui/react-checkbox": "^1.0.4",
68
51
  "@radix-ui/react-collapsible": "^1.0.3",
@@ -78,20 +61,16 @@
78
61
  "@radix-ui/react-tabs": "^1.0.4",
79
62
  "@radix-ui/react-toast": "^1.1.5",
80
63
  "@radix-ui/react-tooltip": "^1.0.7",
81
- "@tanstack/react-table": "^8.11.2",
82
- "@types/node": "^20.10.6",
83
- "@types/react": "^18.2.46",
84
- "@types/react-dom": "^18.2.18",
64
+ "@tanstack/react-table": "^8.11.3",
65
+ "@tanstack/table-core": "^8.11.3",
85
66
  "class-variance-authority": "^0.7.0",
86
67
  "clsx": "^2.1.0",
87
68
  "cmdk": "^0.2.0",
88
- "embla-carousel-auto-height": "^8.0.0-rc17",
89
- "embla-carousel-react": "^8.0.0-rc17",
69
+ "embla-carousel-auto-height": "^8.0.0-rc18",
70
+ "embla-carousel-react": "^8.0.0-rc18",
90
71
  "eslint": "^8.56.0",
91
72
  "eslint-config-next": "^14.0.4",
92
73
  "libphonenumber-js": "^1.10.53",
93
- "next": "^14.0.4",
94
- "next-themes": "^0.2.1",
95
74
  "prism-react-renderer": "^2.3.1",
96
75
  "react": "18.2.0",
97
76
  "react-dom": "18.2.0",
@@ -107,37 +86,32 @@
107
86
  "devDependencies": {
108
87
  "@babel/preset-react": "^7.23.3",
109
88
  "@sikka/alam": "^0.0.4",
110
- "@storybook/addon-essentials": "^7.6.6",
111
- "@storybook/addon-interactions": "^7.6.6",
112
- "@storybook/addon-links": "^7.6.6",
113
- "@storybook/addon-mdx-gfm": "^7.6.6",
114
- "@storybook/blocks": "^7.6.6",
115
- "@storybook/manager-api": "^7.6.6",
116
- "@storybook/nextjs": "^7.6.6",
117
- "@storybook/react": "^7.6.6",
118
- "@storybook/testing-library": "^0.2.2",
119
- "@storybook/theming": "^7.6.6",
120
- "@testing-library/jest-dom": "^6.1.6",
89
+ "@testing-library/jest-dom": "^6.2.0",
121
90
  "@testing-library/react": "^14.1.2",
122
- "@trivago/prettier-plugin-sort-imports": "^4.3.0",
123
91
  "@types/jest": "^29.5.11",
92
+ "@types/react": "^18.2.46",
93
+ "@types/react-dom": "^18.2.18",
124
94
  "autoprefixer": "^10.4.16",
125
- "eslint-plugin-storybook": "^0.6.15",
95
+ "embla-carousel": "8.0.0-rc18",
126
96
  "jest": "^29.7.0",
127
97
  "jest-environment-jsdom": "^29.7.0",
128
- "lucide-react": "^0.303.0",
129
- "postcss": "^8.4.32",
98
+ "lucide-react": "^0.306.0",
99
+ "postcss": "^8.4.33",
130
100
  "postcss-cli": "^11.0.0",
131
- "postcss-import": "^15.1.0",
132
- "prettier": "^3.1.1",
133
- "prettier-plugin-tailwindcss": "^0.5.10",
134
- "recharts": "^2.10.3",
135
- "storybook": "^7.6.6",
136
- "storybook-dark-mode": "^3.0.3",
101
+ "postcss-import": "^16.0.0",
137
102
  "tailwindcss": "^3.4.0",
138
103
  "tailwindcss-animate": "^1.0.7",
139
104
  "tsconfig-paths-webpack-plugin": "^4.1.0",
140
- "tsup": "^8.0.1",
141
- "typescript": "^5.3.3"
105
+ "tsup": "^8.0.1"
106
+ },
107
+ "scripts": {
108
+ "check": "tsc --noEmit",
109
+ "test": "jest",
110
+ "prebuild": "node ./util/pre-build.js",
111
+ "build-lib": "npm run prebuild && node ./util/build-library.js",
112
+ "build-lib-old": "tsup --dts",
113
+ "build-css": "postcss styles.css -o dist/index.css",
114
+ "prepub": "npm run build-lib && npm run build-css",
115
+ "pub": "npm publish --tag next"
142
116
  }
143
117
  }
@@ -1,189 +0,0 @@
1
- // components/elements/colorPicker/ColorPicker.tsx
2
- import React3, {
3
- useState,
4
- useEffect
5
- } from "react";
6
-
7
- // components/util.ts
8
- import { clsx } from "clsx";
9
- import { twMerge } from "tailwind-merge";
10
- function cn(...inputs) {
11
- return twMerge(clsx(inputs));
12
- }
13
-
14
- // components/elements/label/Label.tsx
15
- import * as React2 from "react";
16
-
17
- // components/elements/tooltip/Tooltip.tsx
18
- import React from "react";
19
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
20
- var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React.createElement(
21
- TooltipPrimitive.Content,
22
- {
23
- ref,
24
- sideOffset,
25
- className: cn(
26
- "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",
27
- className
28
- ),
29
- ...props
30
- }
31
- ));
32
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
33
- var TooltipArrow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
34
- TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
35
- var Tooltip = ({
36
- side,
37
- open,
38
- content,
39
- children,
40
- defaultOpen,
41
- onOpenChange,
42
- triggerProps,
43
- contentProps,
44
- providerProps,
45
- delayDuration = 300,
46
- ...props
47
- }) => {
48
- return /* @__PURE__ */ React.createElement(
49
- TooltipPrimitive.TooltipProvider,
50
- {
51
- delayDuration,
52
- ...providerProps
53
- },
54
- /* @__PURE__ */ React.createElement(
55
- TooltipPrimitive.Root,
56
- {
57
- open,
58
- defaultOpen,
59
- onOpenChange,
60
- ...props
61
- },
62
- /* @__PURE__ */ React.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
63
- /* @__PURE__ */ React.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
64
- )
65
- );
66
- };
67
-
68
- // components/elements/label/Label.tsx
69
- var Label = React2.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React2.createElement(
70
- "label",
71
- {
72
- ref,
73
- className: cn(
74
- "hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
75
- className
76
- ),
77
- ...props
78
- },
79
- children,
80
- required && /* @__PURE__ */ React2.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
81
- ), hint && /* @__PURE__ */ React2.createElement(
82
- Tooltip,
83
- {
84
- content: hint,
85
- side: hintSide,
86
- triggerProps: {
87
- tabIndex: -1,
88
- onClick: (event) => event.preventDefault()
89
- }
90
- },
91
- /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
92
- "svg",
93
- {
94
- xmlns: "http://www.w3.org/2000/svg",
95
- className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
96
- viewBox: "0 0 24 24",
97
- fill: "none",
98
- stroke: "currentColor",
99
- strokeWidth: "2",
100
- strokeLinecap: "round",
101
- strokeLinejoin: "round"
102
- },
103
- /* @__PURE__ */ React2.createElement("circle", { cx: "12", cy: "12", r: "10" }),
104
- /* @__PURE__ */ React2.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
105
- /* @__PURE__ */ React2.createElement("path", { d: "M12 17h.01" })
106
- ))
107
- )));
108
- Label.displayName = "Label";
109
-
110
- // components/elements/colorPicker/ColorPicker.tsx
111
- var ColorPicker = ({
112
- containerProps,
113
- colorPickerProps,
114
- textInputProps,
115
- labelProps,
116
- ...props
117
- }) => {
118
- const [selectedColor, setSelectedColor] = useState(props.color);
119
- useEffect(() => {
120
- if (selectedColor && selectedColor[0] !== "#") {
121
- setSelectedColor(`#${selectedColor}`);
122
- }
123
- }, [selectedColor]);
124
- const handleTextInputChange = (e) => {
125
- const inputElement = e.target;
126
- let inputColor = inputElement.value;
127
- if (inputColor[0] !== "#") {
128
- inputColor = `#${inputColor}`;
129
- }
130
- const sanitizedInput = inputColor.replace(/[^a-fA-F0-9#]/g, "");
131
- setSelectedColor(sanitizedInput);
132
- if (props.handleChange) {
133
- props.handleChange(e);
134
- }
135
- };
136
- return /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React3.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React3.createElement(
137
- "div",
138
- {
139
- style: { height: 40, backgroundColor: selectedColor },
140
- className: "hawa-rounded-bl-lg hawa-rounded-tl-lg hawa-border"
141
- },
142
- /* @__PURE__ */ React3.createElement(
143
- "input",
144
- {
145
- type: "color",
146
- value: selectedColor,
147
- onChange: (e) => {
148
- setSelectedColor(e.target.value);
149
- if (props.handleChange) {
150
- props.handleChange(e);
151
- }
152
- },
153
- className: cn(
154
- "hawa-mt-0 hawa-h-[38px] hawa-opacity-0",
155
- props.colorPickerClassNames
156
- ),
157
- ...colorPickerProps
158
- }
159
- )
160
- ), /* @__PURE__ */ React3.createElement("div", { className: "hawa-relative hawa-flex hawa-max-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React3.createElement(
161
- "input",
162
- {
163
- maxLength: 7,
164
- type: "text",
165
- onInput: handleTextInputChange,
166
- value: selectedColor,
167
- className: cn(
168
- "hawa-block hawa-h-[40px] hawa-w-24 hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
169
- ),
170
- ...textInputProps
171
- }
172
- ))), /* @__PURE__ */ React3.createElement(
173
- "p",
174
- {
175
- className: cn(
176
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
177
- props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
178
- )
179
- },
180
- props.helperText
181
- ));
182
- };
183
-
184
- export {
185
- cn,
186
- Tooltip,
187
- Label,
188
- ColorPicker
189
- };