@sikka/hawa 0.23.2-next → 0.23.7-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.
Files changed (145) hide show
  1. package/dist/accordion/index.js +30 -2399
  2. package/dist/accordion/index.mjs +19 -461
  3. package/dist/alert/index.mjs +0 -1
  4. package/dist/appStores/index.js +75 -0
  5. package/dist/appStores/index.mjs +38 -0
  6. package/dist/avatar/index.mjs +118 -3
  7. package/dist/backToTop/index.mjs +102 -4
  8. package/dist/badge/index.js +127 -0
  9. package/dist/badge/index.mjs +84 -0
  10. package/dist/blocks/auth/index.js +1173 -3092
  11. package/dist/blocks/auth/index.mjs +16 -10
  12. package/dist/blocks/feedback/index.js +864 -2913
  13. package/dist/blocks/feedback/index.mjs +14 -8
  14. package/dist/blocks/index.js +5714 -5316
  15. package/dist/blocks/index.mjs +390 -45
  16. package/dist/blocks/misc/index.js +634 -2409
  17. package/dist/blocks/misc/index.mjs +14 -8
  18. package/dist/blocks/pricing/index.js +522 -524
  19. package/dist/blocks/pricing/index.mjs +1861 -45
  20. package/dist/breadcrumb/index.js +63 -0
  21. package/dist/breadcrumb/index.mjs +26 -0
  22. package/dist/card/index.mjs +83 -8
  23. package/dist/checkbox/index.mjs +138 -3
  24. package/dist/chip/index.js +129 -0
  25. package/dist/chip/index.mjs +8 -0
  26. package/dist/{chunk-X6PCWJYD.mjs → chunk-2R2QPJT7.mjs} +761 -1104
  27. package/dist/chunk-677VOLD4.mjs +464 -0
  28. package/dist/chunk-72HYR6WB.mjs +88 -0
  29. package/dist/chunk-A25EXELT.mjs +131 -0
  30. package/dist/{chunk-OE27DSIY.mjs → chunk-F6TKEDDP.mjs} +2 -4
  31. package/dist/{chunk-YFC2GSJ6.mjs → chunk-P2O6R3S6.mjs} +66 -5
  32. package/dist/{chunk-GXXX5UB4.mjs → chunk-QGKW5R5F.mjs} +59 -20
  33. package/dist/chunk-TR56G3NM.mjs +2350 -0
  34. package/dist/chunk-UAVBFK53.mjs +346 -0
  35. package/dist/combobox/index.mjs +153 -7
  36. package/dist/dataTable/index.mjs +355 -8
  37. package/dist/elements/index.js +800 -1148
  38. package/dist/elements/index.mjs +1 -11
  39. package/dist/fileDropzone/index.mjs +226 -4
  40. package/dist/index.js +1721 -1721
  41. package/dist/index.mjs +1663 -1663
  42. package/dist/layout/index.js +493 -510
  43. package/dist/layout/index.mjs +1 -1
  44. package/dist/loading/index.mjs +0 -1
  45. package/dist/logos/index.mjs +204 -3
  46. package/dist/navigationMenu/index.mjs +155 -13
  47. package/dist/phoneInput/index.js +2074 -0
  48. package/dist/phoneInput/index.mjs +1776 -0
  49. package/dist/pinInput/index.js +130 -0
  50. package/dist/pinInput/index.mjs +88 -0
  51. package/dist/progress/index.js +71 -0
  52. package/dist/progress/index.mjs +29 -0
  53. package/dist/radio/index.mjs +202 -4
  54. package/dist/scrollArea/index.js +90 -0
  55. package/dist/scrollArea/index.mjs +47 -0
  56. package/dist/select/index.mjs +1 -1
  57. package/dist/sheet/index.mjs +137 -12
  58. package/dist/sortButton/index.mjs +40 -4
  59. package/dist/stopPropagationWrapper/index.js +48 -0
  60. package/dist/stopPropagationWrapper/index.mjs +11 -0
  61. package/dist/switch/index.mjs +79 -3
  62. package/dist/tabs/index.js +1 -1
  63. package/dist/tabs/index.mjs +68 -6
  64. package/dist/textarea/index.mjs +54 -4
  65. package/package.json +2 -2
  66. package/dist/Chip-DJ6ThZc_.d.ts +0 -21
  67. package/dist/Chip-eal8vwDz.d.mts +0 -21
  68. package/dist/accordion/index.d.mts +0 -42
  69. package/dist/accordion/index.d.ts +0 -42
  70. package/dist/alert/index.d.mts +0 -28
  71. package/dist/alert/index.d.ts +0 -28
  72. package/dist/avatar/index.d.mts +0 -15
  73. package/dist/avatar/index.d.ts +0 -15
  74. package/dist/backToTop/index.d.mts +0 -15
  75. package/dist/backToTop/index.d.ts +0 -15
  76. package/dist/button/index.d.mts +0 -16
  77. package/dist/button/index.d.ts +0 -16
  78. package/dist/card/index.d.mts +0 -17
  79. package/dist/card/index.d.ts +0 -17
  80. package/dist/checkbox/index.d.mts +0 -20
  81. package/dist/checkbox/index.d.ts +0 -20
  82. package/dist/chunk-BK5WF7UO.mjs +0 -231
  83. package/dist/chunk-CXWYC6FS.mjs +0 -360
  84. package/dist/chunk-D2USGMDT.mjs +0 -208
  85. package/dist/chunk-DX4SLF2L.mjs +0 -45
  86. package/dist/chunk-ENNSA4VR.mjs +0 -5566
  87. package/dist/chunk-GXSYCLZZ.mjs +0 -158
  88. package/dist/chunk-IQPGAHUR.mjs +0 -107
  89. package/dist/chunk-POT2IP62.mjs +0 -123
  90. package/dist/chunk-TWDZB2VH.mjs +0 -151
  91. package/dist/chunk-VBTYVVA7.mjs +0 -93
  92. package/dist/chunk-VCGW5DIP.mjs +0 -170
  93. package/dist/chunk-X3SMPIA3.mjs +0 -0
  94. package/dist/chunk-XA646BZ2.mjs +0 -143
  95. package/dist/chunk-ZCUUQ5VV.mjs +0 -84
  96. package/dist/combobox/index.d.mts +0 -32
  97. package/dist/combobox/index.d.ts +0 -32
  98. package/dist/command/index.d.mts +0 -48
  99. package/dist/command/index.d.ts +0 -48
  100. package/dist/commonTypes-gbO4hPli.d.mts +0 -7
  101. package/dist/commonTypes-gbO4hPli.d.ts +0 -7
  102. package/dist/dataTable/index.d.mts +0 -39
  103. package/dist/dataTable/index.d.ts +0 -39
  104. package/dist/dialog/index.d.mts +0 -57
  105. package/dist/dialog/index.d.ts +0 -57
  106. package/dist/dropdownMenu/index.d.mts +0 -95
  107. package/dist/dropdownMenu/index.d.ts +0 -95
  108. package/dist/fileDropzone/index.d.mts +0 -37
  109. package/dist/fileDropzone/index.d.ts +0 -37
  110. package/dist/input/index.d.mts +0 -36
  111. package/dist/input/index.d.ts +0 -36
  112. package/dist/label/index.d.mts +0 -12
  113. package/dist/label/index.d.ts +0 -12
  114. package/dist/loading/index.d.mts +0 -15
  115. package/dist/loading/index.d.ts +0 -15
  116. package/dist/logos/index.d.mts +0 -27
  117. package/dist/logos/index.d.ts +0 -27
  118. package/dist/navigationMenu/index.d.mts +0 -39
  119. package/dist/navigationMenu/index.d.ts +0 -39
  120. package/dist/popover/index.d.mts +0 -23
  121. package/dist/popover/index.d.ts +0 -23
  122. package/dist/radio/index.d.mts +0 -28
  123. package/dist/radio/index.d.ts +0 -28
  124. package/dist/select/index.d.mts +0 -43
  125. package/dist/select/index.d.ts +0 -43
  126. package/dist/sheet/index.d.mts +0 -30
  127. package/dist/sheet/index.d.ts +0 -30
  128. package/dist/skeleton/index.d.mts +0 -10
  129. package/dist/skeleton/index.d.ts +0 -10
  130. package/dist/sortButton/index.d.mts +0 -10
  131. package/dist/sortButton/index.d.ts +0 -10
  132. package/dist/splitButton/index.d.mts +0 -15
  133. package/dist/splitButton/index.d.ts +0 -15
  134. package/dist/switch/index.d.mts +0 -12
  135. package/dist/switch/index.d.ts +0 -12
  136. package/dist/table/index.d.mts +0 -21
  137. package/dist/table/index.d.ts +0 -21
  138. package/dist/tabs/index.d.mts +0 -16
  139. package/dist/tabs/index.d.ts +0 -16
  140. package/dist/textarea/index.d.mts +0 -17
  141. package/dist/textarea/index.d.ts +0 -17
  142. package/dist/tooltip/index.d.mts +0 -26
  143. package/dist/tooltip/index.d.ts +0 -26
  144. /package/dist/{chunk-A7OPD7H7.mjs → chunk-B6UCD4GP.mjs} +0 -0
  145. /package/dist/{chunk-O2ALK7UE.mjs → chunk-Z4M72OD3.mjs} +0 -0
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // components/elements/pinInput/index.ts
31
+ var pinInput_exports = {};
32
+ __export(pinInput_exports, {
33
+ PinInput: () => PinInput
34
+ });
35
+ module.exports = __toCommonJS(pinInput_exports);
36
+
37
+ // components/elements/pinInput/PinInput.tsx
38
+ var import_react = __toESM(require("react"));
39
+
40
+ // components/util.ts
41
+ var import_clsx = require("clsx");
42
+ var import_tailwind_merge = require("tailwind-merge");
43
+ function cn(...inputs) {
44
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
45
+ }
46
+
47
+ // components/elements/pinInput/PinInput.tsx
48
+ var PinInput = ({
49
+ label,
50
+ icon,
51
+ digits,
52
+ width = "normal",
53
+ getPins,
54
+ inputProps,
55
+ ...props
56
+ }) => {
57
+ const [pin, setPin] = (0, import_react.useState)(Array.from(Array(digits)));
58
+ const handleKeyDown = (e, index) => {
59
+ let backTo = 0;
60
+ if (e.key === "Backspace") {
61
+ e.target.value.length === 0 ? backTo = index - 1 : backTo = index;
62
+ const previousInput = document.getElementById(`input-${backTo}`);
63
+ previousInput == null ? void 0 : previousInput.focus();
64
+ }
65
+ };
66
+ (0, import_react.useEffect)(() => {
67
+ let unfilled = pin.includes(void 0);
68
+ if (!unfilled && getPins) {
69
+ getPins(pin);
70
+ }
71
+ });
72
+ const handleChange = (e, index) => {
73
+ if (!/^\d*$/.test(e.target.value)) {
74
+ const newPin = [...pin];
75
+ newPin[index] = "";
76
+ setPin(newPin);
77
+ return;
78
+ } else {
79
+ const newPin = [...pin];
80
+ newPin[index] = e.target.value;
81
+ setPin(newPin);
82
+ if (e.target.value.length === 1) {
83
+ const nextInput = document.getElementById(`input-${index + 1}`);
84
+ nextInput == null ? void 0 : nextInput.focus();
85
+ } else if (e.target.value.length === 0) {
86
+ const previousInput = document.getElementById(`input-${index - 1}`);
87
+ previousInput == null ? void 0 : previousInput.focus();
88
+ }
89
+ }
90
+ };
91
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ import_react.default.createElement(
92
+ "div",
93
+ {
94
+ className: "hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2",
95
+ dir: "ltr"
96
+ },
97
+ pin.map((value, index) => /* @__PURE__ */ import_react.default.createElement(
98
+ "input",
99
+ {
100
+ key: index,
101
+ type: "text",
102
+ maxLength: 1,
103
+ value,
104
+ id: `input-${index}`,
105
+ pattern: "[0-9]*",
106
+ className: cn(
107
+ "hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center",
108
+ width === "full" ? "hawa-w-full" : "hawa-w-10"
109
+ ),
110
+ onChange: (e) => handleChange(e, index),
111
+ onKeyDown: (e) => handleKeyDown(e, index),
112
+ onFocus: (e) => e.target.select(),
113
+ ...inputProps
114
+ }
115
+ ))
116
+ ), /* @__PURE__ */ import_react.default.createElement(
117
+ "p",
118
+ {
119
+ className: cn(
120
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
121
+ props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
122
+ )
123
+ },
124
+ props.helperText
125
+ ));
126
+ };
127
+ // Annotate the CommonJS export names for ESM import in node:
128
+ 0 && (module.exports = {
129
+ PinInput
130
+ });
@@ -0,0 +1,88 @@
1
+ import {
2
+ cn
3
+ } from "../chunk-TE3BKEXL.mjs";
4
+
5
+ // components/elements/pinInput/PinInput.tsx
6
+ import React, { useEffect, useState } from "react";
7
+ var PinInput = ({
8
+ label,
9
+ icon,
10
+ digits,
11
+ width = "normal",
12
+ getPins,
13
+ inputProps,
14
+ ...props
15
+ }) => {
16
+ const [pin, setPin] = useState(Array.from(Array(digits)));
17
+ const handleKeyDown = (e, index) => {
18
+ let backTo = 0;
19
+ if (e.key === "Backspace") {
20
+ e.target.value.length === 0 ? backTo = index - 1 : backTo = index;
21
+ const previousInput = document.getElementById(`input-${backTo}`);
22
+ previousInput == null ? void 0 : previousInput.focus();
23
+ }
24
+ };
25
+ useEffect(() => {
26
+ let unfilled = pin.includes(void 0);
27
+ if (!unfilled && getPins) {
28
+ getPins(pin);
29
+ }
30
+ });
31
+ const handleChange = (e, index) => {
32
+ if (!/^\d*$/.test(e.target.value)) {
33
+ const newPin = [...pin];
34
+ newPin[index] = "";
35
+ setPin(newPin);
36
+ return;
37
+ } else {
38
+ const newPin = [...pin];
39
+ newPin[index] = e.target.value;
40
+ setPin(newPin);
41
+ if (e.target.value.length === 1) {
42
+ const nextInput = document.getElementById(`input-${index + 1}`);
43
+ nextInput == null ? void 0 : nextInput.focus();
44
+ } else if (e.target.value.length === 0) {
45
+ const previousInput = document.getElementById(`input-${index - 1}`);
46
+ previousInput == null ? void 0 : previousInput.focus();
47
+ }
48
+ }
49
+ };
50
+ return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React.createElement(
51
+ "div",
52
+ {
53
+ className: "hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2",
54
+ dir: "ltr"
55
+ },
56
+ pin.map((value, index) => /* @__PURE__ */ React.createElement(
57
+ "input",
58
+ {
59
+ key: index,
60
+ type: "text",
61
+ maxLength: 1,
62
+ value,
63
+ id: `input-${index}`,
64
+ pattern: "[0-9]*",
65
+ className: cn(
66
+ "hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center",
67
+ width === "full" ? "hawa-w-full" : "hawa-w-10"
68
+ ),
69
+ onChange: (e) => handleChange(e, index),
70
+ onKeyDown: (e) => handleKeyDown(e, index),
71
+ onFocus: (e) => e.target.select(),
72
+ ...inputProps
73
+ }
74
+ ))
75
+ ), /* @__PURE__ */ React.createElement(
76
+ "p",
77
+ {
78
+ className: cn(
79
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
80
+ props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
81
+ )
82
+ },
83
+ props.helperText
84
+ ));
85
+ };
86
+ export {
87
+ PinInput
88
+ };
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // components/elements/progress/index.ts
31
+ var progress_exports = {};
32
+ __export(progress_exports, {
33
+ Progress: () => Progress
34
+ });
35
+ module.exports = __toCommonJS(progress_exports);
36
+
37
+ // components/elements/progress/Progress.tsx
38
+ var React = __toESM(require("react"));
39
+ var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
40
+
41
+ // components/util.ts
42
+ var import_clsx = require("clsx");
43
+ var import_tailwind_merge = require("tailwind-merge");
44
+ function cn(...inputs) {
45
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
46
+ }
47
+
48
+ // components/elements/progress/Progress.tsx
49
+ var Progress = React.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React.createElement(
50
+ ProgressPrimitive.Root,
51
+ {
52
+ ref,
53
+ className: cn(
54
+ "hawa-relative hawa-h-4 hawa-w-full hawa-overflow-hidden hawa-rounded hawa-bg-secondary",
55
+ className
56
+ ),
57
+ ...props
58
+ },
59
+ /* @__PURE__ */ React.createElement(
60
+ ProgressPrimitive.Indicator,
61
+ {
62
+ className: "hawa-h-full hawa-w-full hawa-flex-1 hawa-bg-primary hawa-transition-all",
63
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
64
+ }
65
+ )
66
+ ));
67
+ Progress.displayName = ProgressPrimitive.Root.displayName;
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ Progress
71
+ });
@@ -0,0 +1,29 @@
1
+ import {
2
+ cn
3
+ } from "../chunk-TE3BKEXL.mjs";
4
+
5
+ // components/elements/progress/Progress.tsx
6
+ import * as React from "react";
7
+ import * as ProgressPrimitive from "@radix-ui/react-progress";
8
+ var Progress = React.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React.createElement(
9
+ ProgressPrimitive.Root,
10
+ {
11
+ ref,
12
+ className: cn(
13
+ "hawa-relative hawa-h-4 hawa-w-full hawa-overflow-hidden hawa-rounded hawa-bg-secondary",
14
+ className
15
+ ),
16
+ ...props
17
+ },
18
+ /* @__PURE__ */ React.createElement(
19
+ ProgressPrimitive.Indicator,
20
+ {
21
+ className: "hawa-h-full hawa-w-full hawa-flex-1 hawa-bg-primary hawa-transition-all",
22
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
23
+ }
24
+ )
25
+ ));
26
+ Progress.displayName = ProgressPrimitive.Root.displayName;
27
+ export {
28
+ Progress
29
+ };
@@ -1,9 +1,207 @@
1
1
  import {
2
- Radio
3
- } from "../chunk-YFC2GSJ6.mjs";
4
- import "../chunk-Z3JCNSB3.mjs";
2
+ Label
3
+ } from "../chunk-Z3JCNSB3.mjs";
5
4
  import "../chunk-VFP56EVG.mjs";
6
- import "../chunk-TE3BKEXL.mjs";
5
+ import {
6
+ cn
7
+ } from "../chunk-TE3BKEXL.mjs";
8
+
9
+ // components/elements/radio/Radio.tsx
10
+ import React, { useState, useRef, useEffect } from "react";
11
+ var Radio = ({
12
+ design = "default",
13
+ width = "default",
14
+ size = "default",
15
+ orientation = "horizontal",
16
+ labelProps,
17
+ tabsContainerClassName,
18
+ ...props
19
+ }) => {
20
+ var _a, _b, _c;
21
+ const [selectedOption, setSelectedOption] = useState(props.defaultValue);
22
+ let activeTabStyle = "hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary";
23
+ let inactiveTabStyle = "hawa-inline-block hawa-w-full hawa-transition-all hover:hawa-bg-muted hawa-bg-primary-foreground dark:hover:hawa-text-white";
24
+ let orientationStyle = {
25
+ horizontal: "hawa-flex hawa-flex-row",
26
+ vertical: "hawa-flex hawa-flex-col"
27
+ };
28
+ let tabSizeStyle = {
29
+ default: "hawa-py-2 hawa-px-4 hawa-text-sm",
30
+ lg: "hawa-py-2 hawa-px-4",
31
+ sm: "hawa-p-1.5 hawa-text-xs",
32
+ xs: "hawa-p-1 hawa-text-[10px]"
33
+ };
34
+ let widthStyle = {
35
+ none: "",
36
+ default: "hawa-max-w-fit",
37
+ full: "hawa-w-full"
38
+ };
39
+ const [parentDirection, setParentDirection] = React.useState(
40
+ null
41
+ );
42
+ const parentRef = useRef(null);
43
+ useEffect(() => {
44
+ var _a2;
45
+ const parentNode = (_a2 = parentRef.current) == null ? void 0 : _a2.parentNode;
46
+ if (parentNode) {
47
+ const dir = window.getComputedStyle(parentNode).direction;
48
+ setParentDirection(dir);
49
+ }
50
+ });
51
+ switch (design) {
52
+ case "tabs":
53
+ return /* @__PURE__ */ React.createElement(
54
+ "ul",
55
+ {
56
+ ref: parentRef,
57
+ className: cn(
58
+ props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
59
+ "hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium",
60
+ orientationStyle[orientation],
61
+ widthStyle[width],
62
+ tabsContainerClassName
63
+ )
64
+ },
65
+ (_b = props.options) == null ? void 0 : _b.map((opt, o) => /* @__PURE__ */ React.createElement(
66
+ "li",
67
+ {
68
+ "aria-current": "page",
69
+ onClick: () => {
70
+ setSelectedOption(opt.value);
71
+ if (props.onChangeTab) {
72
+ props.onChangeTab(opt);
73
+ } else {
74
+ console.log("onChangeTab was not provided");
75
+ }
76
+ },
77
+ className: cn(
78
+ "hawa-w-full hawa-cursor-pointer ",
79
+ orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
80
+ orientation === "horizontal" && parentDirection === "rtl" && "hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l",
81
+ orientation === "vertical" && "hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b",
82
+ tabSizeStyle[size],
83
+ "hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 ",
84
+ selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
85
+ ),
86
+ key: o
87
+ },
88
+ opt.icon && opt.icon,
89
+ opt.label
90
+ ))
91
+ );
92
+ case "bordered":
93
+ return /* @__PURE__ */ React.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React.createElement(
94
+ "div",
95
+ {
96
+ key: i,
97
+ className: "hawa-rounded hawa-border hawa-border-gray-200 "
98
+ },
99
+ /* @__PURE__ */ React.createElement(
100
+ "div",
101
+ {
102
+ className: cn(
103
+ "radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all",
104
+ props.direction === "rtl" ? "margin-left right-19px" : "margin-right left-23px"
105
+ ),
106
+ key: i + 1
107
+ },
108
+ /* @__PURE__ */ React.createElement(
109
+ "input",
110
+ {
111
+ disabled: opt.disabled,
112
+ id: opt.value.toString(),
113
+ type: "radio",
114
+ value: opt.value,
115
+ name: "bordered-radio"
116
+ }
117
+ ),
118
+ /* @__PURE__ */ React.createElement(
119
+ "label",
120
+ {
121
+ htmlFor: opt.value.toString(),
122
+ className: cn(
123
+ "hawa-ml-2 hawa-w-full hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium dark:hawa-text-white",
124
+ opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
125
+ )
126
+ },
127
+ opt.label
128
+ )
129
+ )
130
+ )));
131
+ case "cards":
132
+ return /* @__PURE__ */ React.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React.createElement("li", { key: o }, /* @__PURE__ */ React.createElement(
133
+ "input",
134
+ {
135
+ type: "radio",
136
+ id: opt.value.toString(),
137
+ name: "cards-radio",
138
+ value: opt.value.toString(),
139
+ className: "hawa-peer hawa-hidden",
140
+ required: true,
141
+ disabled: opt.disabled
142
+ }
143
+ ), /* @__PURE__ */ React.createElement(
144
+ "label",
145
+ {
146
+ htmlFor: opt.value.toString(),
147
+ className: cn(
148
+ "hawa-inline-flex hawa-h-full hawa-w-full hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-white hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-gray-800 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
149
+ opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-gray-100 hover:hawa-text-gray-600 dark:hover:hawa-bg-gray-700 dark:hover:hawa-text-gray-300"
150
+ )
151
+ },
152
+ /* @__PURE__ */ React.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ React.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ React.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
153
+ ))));
154
+ default:
155
+ return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React.createElement(
156
+ "div",
157
+ {
158
+ className: cn(
159
+ "radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
160
+ props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
161
+ ),
162
+ key: i + 1
163
+ },
164
+ /* @__PURE__ */ React.createElement(
165
+ "input",
166
+ {
167
+ disabled: opt.disabled,
168
+ id: opt.value.toString(),
169
+ type: "radio",
170
+ value: opt.value,
171
+ name: "default-radio",
172
+ onChange: () => {
173
+ setSelectedOption(opt.value);
174
+ if (props.onChangeTab) {
175
+ props.onChangeTab(opt);
176
+ } else {
177
+ console.log("onChangeTab was not provided");
178
+ }
179
+ }
180
+ }
181
+ ),
182
+ /* @__PURE__ */ React.createElement(
183
+ "label",
184
+ {
185
+ htmlFor: opt.value.toString(),
186
+ className: cn(
187
+ "hawa-text-sm hawa-font-medium dark:hawa-text-white",
188
+ opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
189
+ )
190
+ },
191
+ opt.label
192
+ )
193
+ ))), /* @__PURE__ */ React.createElement(
194
+ "p",
195
+ {
196
+ className: cn(
197
+ "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
198
+ props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
199
+ )
200
+ },
201
+ props.helperText
202
+ ));
203
+ }
204
+ };
7
205
  export {
8
206
  Radio
9
207
  };
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // components/elements/scrollArea/index.ts
31
+ var scrollArea_exports = {};
32
+ __export(scrollArea_exports, {
33
+ ScrollArea: () => ScrollArea,
34
+ ScrollBar: () => ScrollBar
35
+ });
36
+ module.exports = __toCommonJS(scrollArea_exports);
37
+
38
+ // components/elements/scrollArea/ScrollArea.tsx
39
+ var React = __toESM(require("react"));
40
+ var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
41
+
42
+ // components/util.ts
43
+ var import_clsx = require("clsx");
44
+ var import_tailwind_merge = require("tailwind-merge");
45
+ function cn(...inputs) {
46
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
47
+ }
48
+
49
+ // components/elements/scrollArea/ScrollArea.tsx
50
+ var ScrollArea = React.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React.createElement(
51
+ ScrollAreaPrimitive.Root,
52
+ {
53
+ ref,
54
+ className: cn("hawa-relative hawa-overflow-hidden", className),
55
+ ...props
56
+ },
57
+ /* @__PURE__ */ React.createElement(ScrollAreaPrimitive.Viewport, { className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]" }, children),
58
+ /* @__PURE__ */ React.createElement(ScrollBar, { orientation }),
59
+ /* @__PURE__ */ React.createElement(ScrollAreaPrimitive.Corner, null)
60
+ ));
61
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
62
+ var ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React.createElement(
63
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
64
+ {
65
+ ref,
66
+ orientation,
67
+ className: cn(
68
+ "hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors",
69
+ orientation === "vertical" && "hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]",
70
+ orientation === "horizontal" && "hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]",
71
+ className
72
+ ),
73
+ ...props
74
+ },
75
+ /* @__PURE__ */ React.createElement(
76
+ ScrollAreaPrimitive.ScrollAreaThumb,
77
+ {
78
+ className: cn(
79
+ "hawa-relative hawa-rounded-full hawa-bg-border",
80
+ orientation === "vertical" && "hawa-flex-1"
81
+ )
82
+ }
83
+ )
84
+ ));
85
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ ScrollArea,
89
+ ScrollBar
90
+ });
@@ -0,0 +1,47 @@
1
+ import {
2
+ cn
3
+ } from "../chunk-TE3BKEXL.mjs";
4
+
5
+ // components/elements/scrollArea/ScrollArea.tsx
6
+ import * as React from "react";
7
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
8
+ var ScrollArea = React.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React.createElement(
9
+ ScrollAreaPrimitive.Root,
10
+ {
11
+ ref,
12
+ className: cn("hawa-relative hawa-overflow-hidden", className),
13
+ ...props
14
+ },
15
+ /* @__PURE__ */ React.createElement(ScrollAreaPrimitive.Viewport, { className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]" }, children),
16
+ /* @__PURE__ */ React.createElement(ScrollBar, { orientation }),
17
+ /* @__PURE__ */ React.createElement(ScrollAreaPrimitive.Corner, null)
18
+ ));
19
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
20
+ var ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React.createElement(
21
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
22
+ {
23
+ ref,
24
+ orientation,
25
+ className: cn(
26
+ "hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors",
27
+ orientation === "vertical" && "hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]",
28
+ orientation === "horizontal" && "hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]",
29
+ className
30
+ ),
31
+ ...props
32
+ },
33
+ /* @__PURE__ */ React.createElement(
34
+ ScrollAreaPrimitive.ScrollAreaThumb,
35
+ {
36
+ className: cn(
37
+ "hawa-relative hawa-rounded-full hawa-bg-border",
38
+ orientation === "vertical" && "hawa-flex-1"
39
+ )
40
+ }
41
+ )
42
+ ));
43
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
44
+ export {
45
+ ScrollArea,
46
+ ScrollBar
47
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Select
3
- } from "../chunk-O2ALK7UE.mjs";
3
+ } from "../chunk-Z4M72OD3.mjs";
4
4
  import "../chunk-6QJMQV2X.mjs";
5
5
  import "../chunk-Z3JCNSB3.mjs";
6
6
  import "../chunk-VFP56EVG.mjs";