@sikka/hawa 0.30.28-next → 0.30.29-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/blocks/auth/index.js +1 -3
- package/dist/blocks/auth/index.mjs +1 -3
- package/dist/blocks/feedback/index.js +1 -1
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.js +5 -6
- package/dist/blocks/index.mjs +3 -5
- package/dist/blocks/misc/index.js +3 -2
- package/dist/blocks/misc/index.mjs +3 -2
- package/dist/{chunk-MNK7PSNG.mjs → chunk-XTGWVGTN.mjs} +3 -2
- package/dist/elements/index.js +5 -4
- package/dist/elements/index.mjs +3 -3
- package/dist/floatBox/index.d.mts +1 -1
- package/dist/floatBox/index.d.ts +1 -1
- package/dist/floatBox/index.js +2 -2
- package/dist/floatBox/index.js.map +1 -1
- package/dist/floatBox/index.mjs +2 -2
- package/dist/floatBox/index.mjs.map +1 -1
- package/dist/index.js +7 -8
- package/dist/index.mjs +7 -8
- package/dist/interfaceSettings/index.js +2 -2
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +2 -2
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/tabs/index.js +3 -2
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +3 -2
- package/dist/tabs/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -4038,9 +4038,7 @@ var RegisterForm = ({
|
|
4038
4038
|
isSearchable: false,
|
4039
4039
|
isClearable: false,
|
4040
4040
|
options: props.userReferenceOptions || [],
|
4041
|
-
onChange: (e) =>
|
4042
|
-
field.onChange(e.value);
|
4043
|
-
}
|
4041
|
+
onChange: (e) => field.onChange(e)
|
4044
4042
|
}
|
4045
4043
|
);
|
4046
4044
|
}
|
@@ -3132,9 +3132,7 @@ var RegisterForm = ({
|
|
3132
3132
|
isSearchable: false,
|
3133
3133
|
isClearable: false,
|
3134
3134
|
options: props.userReferenceOptions || [],
|
3135
|
-
onChange: (e) =>
|
3136
|
-
field.onChange(e.value);
|
3137
|
-
}
|
3135
|
+
onChange: (e) => field.onChange(e)
|
3138
3136
|
}
|
3139
3137
|
);
|
3140
3138
|
}
|
@@ -970,7 +970,7 @@ var UserReferralSource = ({
|
|
970
970
|
orientation: "vertical",
|
971
971
|
options: optionsWithOther,
|
972
972
|
defaultValue: field.value,
|
973
|
-
onChange: (e) => field.onChange(e
|
973
|
+
onChange: (e) => field.onChange(e),
|
974
974
|
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
975
975
|
}
|
976
976
|
);
|
@@ -145,7 +145,7 @@ var UserReferralSource = ({
|
|
145
145
|
orientation: "vertical",
|
146
146
|
options: optionsWithOther,
|
147
147
|
defaultValue: field.value,
|
148
|
-
onChange: (e) => field.onChange(e
|
148
|
+
onChange: (e) => field.onChange(e),
|
149
149
|
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
150
150
|
}
|
151
151
|
);
|
package/dist/blocks/index.js
CHANGED
@@ -4195,9 +4195,7 @@ var RegisterForm = ({
|
|
4195
4195
|
isSearchable: false,
|
4196
4196
|
isClearable: false,
|
4197
4197
|
options: props.userReferenceOptions || [],
|
4198
|
-
onChange: (e) =>
|
4199
|
-
field.onChange(e.value);
|
4200
|
-
}
|
4198
|
+
onChange: (e) => field.onChange(e)
|
4201
4199
|
}
|
4202
4200
|
);
|
4203
4201
|
}
|
@@ -5081,7 +5079,7 @@ var UserReferralSource = ({
|
|
5081
5079
|
orientation: "vertical",
|
5082
5080
|
options: optionsWithOther,
|
5083
5081
|
defaultValue: field.value,
|
5084
|
-
onChange: (e) => field.onChange(e
|
5082
|
+
onChange: (e) => field.onChange(e),
|
5085
5083
|
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
5086
5084
|
}
|
5087
5085
|
);
|
@@ -5722,7 +5720,7 @@ var FloatBox = ({
|
|
5722
5720
|
side = "bottom",
|
5723
5721
|
sideOffset = 40,
|
5724
5722
|
align = "center",
|
5725
|
-
|
5723
|
+
withArrow = false,
|
5726
5724
|
...props
|
5727
5725
|
}) => {
|
5728
5726
|
let stylesMap = {
|
@@ -5764,7 +5762,7 @@ var FloatBox = ({
|
|
5764
5762
|
"data-side": side,
|
5765
5763
|
"data-floatbox-state": open ? "open" : "closed"
|
5766
5764
|
},
|
5767
|
-
|
5765
|
+
withArrow && /* @__PURE__ */ React43.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
5768
5766
|
/* @__PURE__ */ React43.createElement("span", null, props.children)
|
5769
5767
|
);
|
5770
5768
|
};
|
@@ -5877,6 +5875,7 @@ var TabsTrigger = React44.forwardRef(({ className, chipProps, ...props }, ref) =
|
|
5877
5875
|
/* @__PURE__ */ React44.createElement(
|
5878
5876
|
FloatBox,
|
5879
5877
|
{
|
5878
|
+
withArrow: true,
|
5880
5879
|
align: orientation === "vertical" ? "start" : "start",
|
5881
5880
|
side: orientation === "vertical" ? "right" : "bottom",
|
5882
5881
|
sideOffset: orientation === "vertical" ? width + 30 : 45,
|
package/dist/blocks/index.mjs
CHANGED
@@ -26,7 +26,7 @@ import {
|
|
26
26
|
UncheckMark,
|
27
27
|
VeryBadEmoji,
|
28
28
|
VeryGoodEmoji
|
29
|
-
} from "../chunk-
|
29
|
+
} from "../chunk-XTGWVGTN.mjs";
|
30
30
|
import "../chunk-R2SKHHDK.mjs";
|
31
31
|
import {
|
32
32
|
Button,
|
@@ -754,9 +754,7 @@ var RegisterForm = ({
|
|
754
754
|
isSearchable: false,
|
755
755
|
isClearable: false,
|
756
756
|
options: props.userReferenceOptions || [],
|
757
|
-
onChange: (e) =>
|
758
|
-
field.onChange(e.value);
|
759
|
-
}
|
757
|
+
onChange: (e) => field.onChange(e)
|
760
758
|
}
|
761
759
|
);
|
762
760
|
}
|
@@ -1289,7 +1287,7 @@ var UserReferralSource = ({
|
|
1289
1287
|
orientation: "vertical",
|
1290
1288
|
options: optionsWithOther,
|
1291
1289
|
defaultValue: field.value,
|
1292
|
-
onChange: (e) => field.onChange(e
|
1290
|
+
onChange: (e) => field.onChange(e),
|
1293
1291
|
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
1294
1292
|
}
|
1295
1293
|
);
|
@@ -271,7 +271,7 @@ var FloatBox = ({
|
|
271
271
|
side = "bottom",
|
272
272
|
sideOffset = 40,
|
273
273
|
align = "center",
|
274
|
-
|
274
|
+
withArrow = false,
|
275
275
|
...props
|
276
276
|
}) => {
|
277
277
|
let stylesMap = {
|
@@ -313,7 +313,7 @@ var FloatBox = ({
|
|
313
313
|
"data-side": side,
|
314
314
|
"data-floatbox-state": open ? "open" : "closed"
|
315
315
|
},
|
316
|
-
|
316
|
+
withArrow && /* @__PURE__ */ React11.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
317
317
|
/* @__PURE__ */ React11.createElement("span", null, props.children)
|
318
318
|
);
|
319
319
|
};
|
@@ -426,6 +426,7 @@ var TabsTrigger = React12.forwardRef(({ className, chipProps, ...props }, ref) =
|
|
426
426
|
/* @__PURE__ */ React12.createElement(
|
427
427
|
FloatBox,
|
428
428
|
{
|
429
|
+
withArrow: true,
|
429
430
|
align: orientation === "vertical" ? "start" : "start",
|
430
431
|
side: orientation === "vertical" ? "right" : "bottom",
|
431
432
|
sideOffset: orientation === "vertical" ? width + 30 : 45,
|
@@ -122,7 +122,7 @@ var FloatBox = ({
|
|
122
122
|
side = "bottom",
|
123
123
|
sideOffset = 40,
|
124
124
|
align = "center",
|
125
|
-
|
125
|
+
withArrow = false,
|
126
126
|
...props
|
127
127
|
}) => {
|
128
128
|
let stylesMap = {
|
@@ -164,7 +164,7 @@ var FloatBox = ({
|
|
164
164
|
"data-side": side,
|
165
165
|
"data-floatbox-state": open ? "open" : "closed"
|
166
166
|
},
|
167
|
-
|
167
|
+
withArrow && /* @__PURE__ */ React9.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
168
168
|
/* @__PURE__ */ React9.createElement("span", null, props.children)
|
169
169
|
);
|
170
170
|
};
|
@@ -277,6 +277,7 @@ var TabsTrigger = React10.forwardRef(({ className, chipProps, ...props }, ref) =
|
|
277
277
|
/* @__PURE__ */ React10.createElement(
|
278
278
|
FloatBox,
|
279
279
|
{
|
280
|
+
withArrow: true,
|
280
281
|
align: orientation === "vertical" ? "start" : "start",
|
281
282
|
side: orientation === "vertical" ? "right" : "bottom",
|
282
283
|
sideOffset: orientation === "vertical" ? width + 30 : 45,
|
@@ -2870,7 +2870,7 @@ var FloatBox = ({
|
|
2870
2870
|
side = "bottom",
|
2871
2871
|
sideOffset = 40,
|
2872
2872
|
align = "center",
|
2873
|
-
|
2873
|
+
withArrow = false,
|
2874
2874
|
...props
|
2875
2875
|
}) => {
|
2876
2876
|
let stylesMap = {
|
@@ -2912,7 +2912,7 @@ var FloatBox = ({
|
|
2912
2912
|
"data-side": side,
|
2913
2913
|
"data-floatbox-state": open ? "open" : "closed"
|
2914
2914
|
},
|
2915
|
-
|
2915
|
+
withArrow && /* @__PURE__ */ React13.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
2916
2916
|
/* @__PURE__ */ React13.createElement("span", null, props.children)
|
2917
2917
|
);
|
2918
2918
|
};
|
@@ -3025,6 +3025,7 @@ var TabsTrigger = React14.forwardRef(({ className, chipProps, ...props }, ref) =
|
|
3025
3025
|
/* @__PURE__ */ React14.createElement(
|
3026
3026
|
FloatBox,
|
3027
3027
|
{
|
3028
|
+
withArrow: true,
|
3028
3029
|
align: orientation === "vertical" ? "start" : "start",
|
3029
3030
|
side: orientation === "vertical" ? "right" : "bottom",
|
3030
3031
|
sideOffset: orientation === "vertical" ? width + 30 : 45,
|
package/dist/elements/index.js
CHANGED
@@ -4226,7 +4226,7 @@ var FloatBox = ({
|
|
4226
4226
|
side = "bottom",
|
4227
4227
|
sideOffset = 40,
|
4228
4228
|
align = "center",
|
4229
|
-
|
4229
|
+
withArrow = false,
|
4230
4230
|
...props
|
4231
4231
|
}) => {
|
4232
4232
|
let stylesMap = {
|
@@ -4268,7 +4268,7 @@ var FloatBox = ({
|
|
4268
4268
|
"data-side": side,
|
4269
4269
|
"data-floatbox-state": open ? "open" : "closed"
|
4270
4270
|
},
|
4271
|
-
|
4271
|
+
withArrow && /* @__PURE__ */ React39.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
4272
4272
|
/* @__PURE__ */ React39.createElement("span", null, props.children)
|
4273
4273
|
);
|
4274
4274
|
};
|
@@ -4381,6 +4381,7 @@ var TabsTrigger = React40.forwardRef(({ className, chipProps, ...props }, ref) =
|
|
4381
4381
|
/* @__PURE__ */ React40.createElement(
|
4382
4382
|
FloatBox,
|
4383
4383
|
{
|
4384
|
+
withArrow: true,
|
4384
4385
|
align: orientation === "vertical" ? "start" : "start",
|
4385
4386
|
side: orientation === "vertical" ? "right" : "bottom",
|
4386
4387
|
sideOffset: orientation === "vertical" ? width + 30 : 45,
|
@@ -8095,7 +8096,7 @@ var InterfaceSettings = ({
|
|
8095
8096
|
defaultValue: language,
|
8096
8097
|
onChange: (e) => {
|
8097
8098
|
if (handleLanguage) {
|
8098
|
-
handleLanguage(e
|
8099
|
+
handleLanguage(e);
|
8099
8100
|
}
|
8100
8101
|
setLanguage(e);
|
8101
8102
|
},
|
@@ -8113,7 +8114,7 @@ var InterfaceSettings = ({
|
|
8113
8114
|
defaultValue: color,
|
8114
8115
|
onChange: (e) => {
|
8115
8116
|
if (handleColorMode) {
|
8116
|
-
handleColorMode(e
|
8117
|
+
handleColorMode(e);
|
8117
8118
|
}
|
8118
8119
|
setColor(e);
|
8119
8120
|
},
|
package/dist/elements/index.mjs
CHANGED
@@ -27,7 +27,7 @@ import {
|
|
27
27
|
TabsTrigger,
|
28
28
|
Textarea,
|
29
29
|
UncheckMark
|
30
|
-
} from "../chunk-
|
30
|
+
} from "../chunk-XTGWVGTN.mjs";
|
31
31
|
import {
|
32
32
|
useClipboard
|
33
33
|
} from "../chunk-R2SKHHDK.mjs";
|
@@ -3276,7 +3276,7 @@ var InterfaceSettings = ({
|
|
3276
3276
|
defaultValue: language,
|
3277
3277
|
onChange: (e) => {
|
3278
3278
|
if (handleLanguage) {
|
3279
|
-
handleLanguage(e
|
3279
|
+
handleLanguage(e);
|
3280
3280
|
}
|
3281
3281
|
setLanguage(e);
|
3282
3282
|
},
|
@@ -3294,7 +3294,7 @@ var InterfaceSettings = ({
|
|
3294
3294
|
defaultValue: color,
|
3295
3295
|
onChange: (e) => {
|
3296
3296
|
if (handleColorMode) {
|
3297
|
-
handleColorMode(e
|
3297
|
+
handleColorMode(e);
|
3298
3298
|
}
|
3299
3299
|
setColor(e);
|
3300
3300
|
},
|
package/dist/floatBox/index.d.ts
CHANGED
package/dist/floatBox/index.js
CHANGED
@@ -52,7 +52,7 @@ var FloatBox = ({
|
|
52
52
|
side = "bottom",
|
53
53
|
sideOffset = 40,
|
54
54
|
align = "center",
|
55
|
-
|
55
|
+
withArrow = false,
|
56
56
|
...props
|
57
57
|
}) => {
|
58
58
|
let stylesMap = {
|
@@ -94,7 +94,7 @@ var FloatBox = ({
|
|
94
94
|
"data-side": side,
|
95
95
|
"data-floatbox-state": open ? "open" : "closed"
|
96
96
|
},
|
97
|
-
|
97
|
+
withArrow && /* @__PURE__ */ React.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
98
98
|
/* @__PURE__ */ React.createElement("span", null, props.children)
|
99
99
|
);
|
100
100
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/floatBox/index.ts","../../elements/floatBox/FloatBox.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./FloatBox\";\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport type FloatBoxProps = {\n className?: string;\n open?: boolean;\n children?: React.ReactNode;\n side?: \"bottom\" | \"left\" | \"right\" | \"top\";\n sideOffset?: number;\n align?: \"start\" | \"center\" | \"end\";\n alignOffset?: number;\n
|
1
|
+
{"version":3,"sources":["../../elements/floatBox/index.ts","../../elements/floatBox/FloatBox.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./FloatBox\";\n","import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport type FloatBoxProps = {\n className?: string;\n open?: boolean;\n children?: React.ReactNode;\n side?: \"bottom\" | \"left\" | \"right\" | \"top\";\n sideOffset?: number;\n align?: \"start\" | \"center\" | \"end\";\n alignOffset?: number;\n withArrow?: boolean;\n};\n\nconst FloatBox: React.FC<FloatBoxProps> = ({\n className,\n open,\n side = \"bottom\",\n sideOffset = 40,\n align = \"center\",\n withArrow = false,\n ...props\n}) => {\n let stylesMap = {\n bottom: {\n start: { top: sideOffset, insetInlineStart: 0 },\n center: { top: sideOffset },\n end: { top: sideOffset, insetInlineEnd: 0 },\n },\n top: {\n start: { bottom: sideOffset, insetInlineStart: 0 },\n center: { bottom: sideOffset },\n end: { bottom: sideOffset, insetInlineEnd: 0 },\n },\n right: {\n start: { left: sideOffset, top: -5 },\n center: { left: sideOffset },\n end: { left: sideOffset, bottom: 0 },\n },\n left: {\n start: { right: sideOffset, top: 0 },\n center: { right: sideOffset },\n end: { right: sideOffset, bottom: 0 },\n },\n };\n const arrowDirection = {\n top: \"hawa-arrow-default-bottom\",\n bottom: \"hawa-arrow-default-top\",\n right: \"hawa-arrow-default-left\",\n left: \"hawa-arrow-default-right\",\n };\n\n return (\n <div\n className={cn(\n \"data-[floatbox-state=closed]:hawa-invisible data-[floatbox-state=open]:hawa-visible hawa-absolute dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[floatbox-state=open]:hawa-animate-in data-[floatbox-state=closed]:hawa-animate-out data-[floatbox-state=closed]:hawa-fade-out-0 data-[floatbox-state=open]:hawa-fade-in-0 data-[floatbox-state=closed]:hawa-zoom-out-95 data-[floatbox-state=open]:hawa-zoom-in-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 hawa-bg-popover\",\n className,\n )}\n style={{ ...stylesMap[side][align] }}\n data-side={side}\n data-floatbox-state={open ? \"open\" : \"closed\"}\n >\n {withArrow && (\n <div className={cn(\"hawa-bg-red-500\", arrowDirection[side])} />\n )}\n <span>{props.children}</span>\n </div>\n );\n};\n\nexport { FloatBox };\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADUA,IAAM,WAAoC,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,GAAG;AACL,MAAM;AACJ,MAAI,YAAY;AAAA,IACd,QAAQ;AAAA,MACN,OAAO,EAAE,KAAK,YAAY,kBAAkB,EAAE;AAAA,MAC9C,QAAQ,EAAE,KAAK,WAAW;AAAA,MAC1B,KAAK,EAAE,KAAK,YAAY,gBAAgB,EAAE;AAAA,IAC5C;AAAA,IACA,KAAK;AAAA,MACH,OAAO,EAAE,QAAQ,YAAY,kBAAkB,EAAE;AAAA,MACjD,QAAQ,EAAE,QAAQ,WAAW;AAAA,MAC7B,KAAK,EAAE,QAAQ,YAAY,gBAAgB,EAAE;AAAA,IAC/C;AAAA,IACA,OAAO;AAAA,MACL,OAAO,EAAE,MAAM,YAAY,KAAK,GAAG;AAAA,MACnC,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC3B,KAAK,EAAE,MAAM,YAAY,QAAQ,EAAE;AAAA,IACrC;AAAA,IACA,MAAM;AAAA,MACJ,OAAO,EAAE,OAAO,YAAY,KAAK,EAAE;AAAA,MACnC,QAAQ,EAAE,OAAO,WAAW;AAAA,MAC5B,KAAK,EAAE,OAAO,YAAY,QAAQ,EAAE;AAAA,IACtC;AAAA,EACF;AACA,QAAM,iBAAiB;AAAA,IACrB,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,GAAG,UAAU,IAAI,EAAE,KAAK,EAAE;AAAA,MACnC,aAAW;AAAA,MACX,uBAAqB,OAAO,SAAS;AAAA;AAAA,IAEpC,aACC,oCAAC,SAAI,WAAW,GAAG,mBAAmB,eAAe,IAAI,CAAC,GAAG;AAAA,IAE/D,oCAAC,cAAM,MAAM,QAAS;AAAA,EACxB;AAEJ;","names":[]}
|
package/dist/floatBox/index.mjs
CHANGED
@@ -17,7 +17,7 @@ var FloatBox = ({
|
|
17
17
|
side = "bottom",
|
18
18
|
sideOffset = 40,
|
19
19
|
align = "center",
|
20
|
-
|
20
|
+
withArrow = false,
|
21
21
|
...props
|
22
22
|
}) => {
|
23
23
|
let stylesMap = {
|
@@ -59,7 +59,7 @@ var FloatBox = ({
|
|
59
59
|
"data-side": side,
|
60
60
|
"data-floatbox-state": open ? "open" : "closed"
|
61
61
|
},
|
62
|
-
|
62
|
+
withArrow && /* @__PURE__ */ React.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
63
63
|
/* @__PURE__ */ React.createElement("span", null, props.children)
|
64
64
|
);
|
65
65
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/floatBox/FloatBox.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport type FloatBoxProps = {\n className?: string;\n open?: boolean;\n children?: React.ReactNode;\n side?: \"bottom\" | \"left\" | \"right\" | \"top\";\n sideOffset?: number;\n align?: \"start\" | \"center\" | \"end\";\n alignOffset?: number;\n
|
1
|
+
{"version":3,"sources":["../../elements/floatBox/FloatBox.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport type FloatBoxProps = {\n className?: string;\n open?: boolean;\n children?: React.ReactNode;\n side?: \"bottom\" | \"left\" | \"right\" | \"top\";\n sideOffset?: number;\n align?: \"start\" | \"center\" | \"end\";\n alignOffset?: number;\n withArrow?: boolean;\n};\n\nconst FloatBox: React.FC<FloatBoxProps> = ({\n className,\n open,\n side = \"bottom\",\n sideOffset = 40,\n align = \"center\",\n withArrow = false,\n ...props\n}) => {\n let stylesMap = {\n bottom: {\n start: { top: sideOffset, insetInlineStart: 0 },\n center: { top: sideOffset },\n end: { top: sideOffset, insetInlineEnd: 0 },\n },\n top: {\n start: { bottom: sideOffset, insetInlineStart: 0 },\n center: { bottom: sideOffset },\n end: { bottom: sideOffset, insetInlineEnd: 0 },\n },\n right: {\n start: { left: sideOffset, top: -5 },\n center: { left: sideOffset },\n end: { left: sideOffset, bottom: 0 },\n },\n left: {\n start: { right: sideOffset, top: 0 },\n center: { right: sideOffset },\n end: { right: sideOffset, bottom: 0 },\n },\n };\n const arrowDirection = {\n top: \"hawa-arrow-default-bottom\",\n bottom: \"hawa-arrow-default-top\",\n right: \"hawa-arrow-default-left\",\n left: \"hawa-arrow-default-right\",\n };\n\n return (\n <div\n className={cn(\n \"data-[floatbox-state=closed]:hawa-invisible data-[floatbox-state=open]:hawa-visible hawa-absolute dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[floatbox-state=open]:hawa-animate-in data-[floatbox-state=closed]:hawa-animate-out data-[floatbox-state=closed]:hawa-fade-out-0 data-[floatbox-state=open]:hawa-fade-in-0 data-[floatbox-state=closed]:hawa-zoom-out-95 data-[floatbox-state=open]:hawa-zoom-in-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 hawa-bg-popover\",\n className,\n )}\n style={{ ...stylesMap[side][align] }}\n data-side={side}\n data-floatbox-state={open ? \"open\" : \"closed\"}\n >\n {withArrow && (\n <div className={cn(\"hawa-bg-red-500\", arrowDirection[side])} />\n )}\n <span>{props.children}</span>\n </div>\n );\n};\n\nexport { FloatBox };\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"],"mappings":";;;AAAA,YAAY,WAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADUA,IAAM,WAAoC,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,GAAG;AACL,MAAM;AACJ,MAAI,YAAY;AAAA,IACd,QAAQ;AAAA,MACN,OAAO,EAAE,KAAK,YAAY,kBAAkB,EAAE;AAAA,MAC9C,QAAQ,EAAE,KAAK,WAAW;AAAA,MAC1B,KAAK,EAAE,KAAK,YAAY,gBAAgB,EAAE;AAAA,IAC5C;AAAA,IACA,KAAK;AAAA,MACH,OAAO,EAAE,QAAQ,YAAY,kBAAkB,EAAE;AAAA,MACjD,QAAQ,EAAE,QAAQ,WAAW;AAAA,MAC7B,KAAK,EAAE,QAAQ,YAAY,gBAAgB,EAAE;AAAA,IAC/C;AAAA,IACA,OAAO;AAAA,MACL,OAAO,EAAE,MAAM,YAAY,KAAK,GAAG;AAAA,MACnC,QAAQ,EAAE,MAAM,WAAW;AAAA,MAC3B,KAAK,EAAE,MAAM,YAAY,QAAQ,EAAE;AAAA,IACrC;AAAA,IACA,MAAM;AAAA,MACJ,OAAO,EAAE,OAAO,YAAY,KAAK,EAAE;AAAA,MACnC,QAAQ,EAAE,OAAO,WAAW;AAAA,MAC5B,KAAK,EAAE,OAAO,YAAY,QAAQ,EAAE;AAAA,IACtC;AAAA,EACF;AACA,QAAM,iBAAiB;AAAA,IACrB,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,OAAO,EAAE,GAAG,UAAU,IAAI,EAAE,KAAK,EAAE;AAAA,MACnC,aAAW;AAAA,MACX,uBAAqB,OAAO,SAAS;AAAA;AAAA,IAEpC,aACC,oCAAC,SAAI,WAAW,GAAG,mBAAmB,eAAe,IAAI,CAAC,GAAG;AAAA,IAE/D,oCAAC,cAAM,MAAM,QAAS;AAAA,EACxB;AAEJ;","names":[]}
|
package/dist/index.js
CHANGED
@@ -4604,7 +4604,7 @@ var FloatBox = ({
|
|
4604
4604
|
side = "bottom",
|
4605
4605
|
sideOffset = 40,
|
4606
4606
|
align = "center",
|
4607
|
-
|
4607
|
+
withArrow = false,
|
4608
4608
|
...props
|
4609
4609
|
}) => {
|
4610
4610
|
let stylesMap = {
|
@@ -4646,7 +4646,7 @@ var FloatBox = ({
|
|
4646
4646
|
"data-side": side,
|
4647
4647
|
"data-floatbox-state": open ? "open" : "closed"
|
4648
4648
|
},
|
4649
|
-
|
4649
|
+
withArrow && /* @__PURE__ */ React39.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
4650
4650
|
/* @__PURE__ */ React39.createElement("span", null, props.children)
|
4651
4651
|
);
|
4652
4652
|
};
|
@@ -4759,6 +4759,7 @@ var TabsTrigger = React40.forwardRef(({ className, chipProps, ...props }, ref) =
|
|
4759
4759
|
/* @__PURE__ */ React40.createElement(
|
4760
4760
|
FloatBox,
|
4761
4761
|
{
|
4762
|
+
withArrow: true,
|
4762
4763
|
align: orientation === "vertical" ? "start" : "start",
|
4763
4764
|
side: orientation === "vertical" ? "right" : "bottom",
|
4764
4765
|
sideOffset: orientation === "vertical" ? width + 30 : 45,
|
@@ -8563,7 +8564,7 @@ var InterfaceSettings = ({
|
|
8563
8564
|
defaultValue: language,
|
8564
8565
|
onChange: (e) => {
|
8565
8566
|
if (handleLanguage) {
|
8566
|
-
handleLanguage(e
|
8567
|
+
handleLanguage(e);
|
8567
8568
|
}
|
8568
8569
|
setLanguage(e);
|
8569
8570
|
},
|
@@ -8581,7 +8582,7 @@ var InterfaceSettings = ({
|
|
8581
8582
|
defaultValue: color,
|
8582
8583
|
onChange: (e) => {
|
8583
8584
|
if (handleColorMode) {
|
8584
|
-
handleColorMode(e
|
8585
|
+
handleColorMode(e);
|
8585
8586
|
}
|
8586
8587
|
setColor(e);
|
8587
8588
|
},
|
@@ -10699,9 +10700,7 @@ var RegisterForm = ({
|
|
10699
10700
|
isSearchable: false,
|
10700
10701
|
isClearable: false,
|
10701
10702
|
options: props.userReferenceOptions || [],
|
10702
|
-
onChange: (e) =>
|
10703
|
-
field.onChange(e.value);
|
10704
|
-
}
|
10703
|
+
onChange: (e) => field.onChange(e)
|
10705
10704
|
}
|
10706
10705
|
);
|
10707
10706
|
}
|
@@ -11234,7 +11233,7 @@ var UserReferralSource = ({
|
|
11234
11233
|
orientation: "vertical",
|
11235
11234
|
options: optionsWithOther,
|
11236
11235
|
defaultValue: field.value,
|
11237
|
-
onChange: (e) => field.onChange(e
|
11236
|
+
onChange: (e) => field.onChange(e),
|
11238
11237
|
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
11239
11238
|
}
|
11240
11239
|
);
|
package/dist/index.mjs
CHANGED
@@ -4374,7 +4374,7 @@ var FloatBox = ({
|
|
4374
4374
|
side = "bottom",
|
4375
4375
|
sideOffset = 40,
|
4376
4376
|
align = "center",
|
4377
|
-
|
4377
|
+
withArrow = false,
|
4378
4378
|
...props
|
4379
4379
|
}) => {
|
4380
4380
|
let stylesMap = {
|
@@ -4416,7 +4416,7 @@ var FloatBox = ({
|
|
4416
4416
|
"data-side": side,
|
4417
4417
|
"data-floatbox-state": open ? "open" : "closed"
|
4418
4418
|
},
|
4419
|
-
|
4419
|
+
withArrow && /* @__PURE__ */ React39.createElement("div", { className: cn("hawa-bg-red-500", arrowDirection[side]) }),
|
4420
4420
|
/* @__PURE__ */ React39.createElement("span", null, props.children)
|
4421
4421
|
);
|
4422
4422
|
};
|
@@ -4529,6 +4529,7 @@ var TabsTrigger = React40.forwardRef(({ className, chipProps, ...props }, ref) =
|
|
4529
4529
|
/* @__PURE__ */ React40.createElement(
|
4530
4530
|
FloatBox,
|
4531
4531
|
{
|
4532
|
+
withArrow: true,
|
4532
4533
|
align: orientation === "vertical" ? "start" : "start",
|
4533
4534
|
side: orientation === "vertical" ? "right" : "bottom",
|
4534
4535
|
sideOffset: orientation === "vertical" ? width + 30 : 45,
|
@@ -8340,7 +8341,7 @@ var InterfaceSettings = ({
|
|
8340
8341
|
defaultValue: language,
|
8341
8342
|
onChange: (e) => {
|
8342
8343
|
if (handleLanguage) {
|
8343
|
-
handleLanguage(e
|
8344
|
+
handleLanguage(e);
|
8344
8345
|
}
|
8345
8346
|
setLanguage(e);
|
8346
8347
|
},
|
@@ -8358,7 +8359,7 @@ var InterfaceSettings = ({
|
|
8358
8359
|
defaultValue: color,
|
8359
8360
|
onChange: (e) => {
|
8360
8361
|
if (handleColorMode) {
|
8361
|
-
handleColorMode(e
|
8362
|
+
handleColorMode(e);
|
8362
8363
|
}
|
8363
8364
|
setColor(e);
|
8364
8365
|
},
|
@@ -10476,9 +10477,7 @@ var RegisterForm = ({
|
|
10476
10477
|
isSearchable: false,
|
10477
10478
|
isClearable: false,
|
10478
10479
|
options: props.userReferenceOptions || [],
|
10479
|
-
onChange: (e) =>
|
10480
|
-
field.onChange(e.value);
|
10481
|
-
}
|
10480
|
+
onChange: (e) => field.onChange(e)
|
10482
10481
|
}
|
10483
10482
|
);
|
10484
10483
|
}
|
@@ -11011,7 +11010,7 @@ var UserReferralSource = ({
|
|
11011
11010
|
orientation: "vertical",
|
11012
11011
|
options: optionsWithOther,
|
11013
11012
|
defaultValue: field.value,
|
11014
|
-
onChange: (e) => field.onChange(e
|
11013
|
+
onChange: (e) => field.onChange(e),
|
11015
11014
|
helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
|
11016
11015
|
}
|
11017
11016
|
);
|
@@ -391,7 +391,7 @@ var InterfaceSettings = ({
|
|
391
391
|
defaultValue: language,
|
392
392
|
onChange: (e) => {
|
393
393
|
if (handleLanguage) {
|
394
|
-
handleLanguage(e
|
394
|
+
handleLanguage(e);
|
395
395
|
}
|
396
396
|
setLanguage(e);
|
397
397
|
},
|
@@ -409,7 +409,7 @@ var InterfaceSettings = ({
|
|
409
409
|
defaultValue: color,
|
410
410
|
onChange: (e) => {
|
411
411
|
if (handleColorMode) {
|
412
|
-
handleColorMode(e
|
412
|
+
handleColorMode(e);
|
413
413
|
}
|
414
414
|
setColor(e);
|
415
415
|
},
|