@sikka/hawa 0.40.0-next → 0.41.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/blocks/auth/index.js +100 -15
- package/dist/blocks/auth/index.mjs +104 -19
- package/dist/blocks/feedback/index.js +1 -2
- package/dist/blocks/feedback/index.mjs +6 -8
- package/dist/blocks/index.js +101 -17
- package/dist/blocks/index.mjs +3 -5
- package/dist/blocks/misc/index.mjs +5 -5
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/checkbox/index.js +2 -2
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +2 -2
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/{chunk-AJTYKC5R.mjs → chunk-4ZELUQQ7.mjs} +1 -1
- package/dist/{chunk-GN7EIDTE.mjs → chunk-55TPME67.mjs} +1 -1
- package/dist/{chunk-CTZRVSTI.mjs → chunk-F6SLF6DS.mjs} +1 -1
- package/dist/{chunk-UBUVHGW4.mjs → chunk-FJXDCBMQ.mjs} +16 -16
- package/dist/{chunk-CTNKKP2O.mjs → chunk-FK2C6C3B.mjs} +61 -61
- package/dist/{chunk-27G5FKOP.mjs → chunk-IS73LH5Y.mjs} +1 -1
- package/dist/{chunk-GU2DOJ7Q.mjs → chunk-JGP3PSJL.mjs} +85 -0
- package/dist/{chunk-QZIENYTE.mjs → chunk-NSMJTT6Y.mjs} +1 -1
- package/dist/{chunk-RT2Q3SH7.mjs → chunk-UHUOBAEP.mjs} +1 -1
- package/dist/{chunk-DYPGZ2IP.mjs → chunk-ZSX2KZ2D.mjs} +1 -1
- package/dist/dataTable/index.d.mts +6 -1
- package/dist/dataTable/index.d.ts +6 -1
- package/dist/dataTable/index.js +454 -240
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +472 -258
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +85 -0
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +85 -0
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +11 -1
- package/dist/elements/index.d.ts +11 -1
- package/dist/elements/index.js +616 -453
- package/dist/elements/index.mjs +252 -174
- package/dist/index.css +27 -127
- package/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +619 -457
- package/dist/index.mjs +713 -551
- package/dist/layout/index.js +85 -0
- package/dist/layout/index.mjs +2 -2
- package/dist/logos/index.d.mts +5 -0
- package/dist/logos/index.d.ts +5 -0
- package/dist/logos/index.js +85 -0
- package/dist/logos/index.js.map +1 -1
- package/dist/logos/index.mjs +85 -0
- package/dist/logos/index.mjs.map +1 -1
- package/dist/pinInput/index.js +13 -13
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +13 -13
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/simpleTable/index.js +4 -4
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs +4 -4
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/table/index.js +4 -4
- package/dist/table/index.js.map +1 -1
- package/dist/table/index.mjs +4 -4
- package/dist/table/index.mjs.map +1 -1
- package/package.json +3 -5
package/dist/blocks/index.js
CHANGED
@@ -761,6 +761,91 @@ var Logos = {
|
|
761
761
|
},
|
762
762
|
/* @__PURE__ */ import_react4.default.createElement("path", { d: "M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z" })
|
763
763
|
),
|
764
|
+
telegram: (props) => /* @__PURE__ */ import_react4.default.createElement(
|
765
|
+
"svg",
|
766
|
+
{
|
767
|
+
role: "img",
|
768
|
+
viewBox: "0 0 24 24",
|
769
|
+
xmlns: "http://www.w3.org/2000/svg",
|
770
|
+
...props
|
771
|
+
},
|
772
|
+
/* @__PURE__ */ import_react4.default.createElement("title", null, "Telegram"),
|
773
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
774
|
+
"path",
|
775
|
+
{
|
776
|
+
fill: "currentColor",
|
777
|
+
d: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
|
778
|
+
}
|
779
|
+
)
|
780
|
+
),
|
781
|
+
youtube: (props) => /* @__PURE__ */ import_react4.default.createElement(
|
782
|
+
"svg",
|
783
|
+
{
|
784
|
+
role: "img",
|
785
|
+
viewBox: "0 0 24 24",
|
786
|
+
xmlns: "http://www.w3.org/2000/svg",
|
787
|
+
...props
|
788
|
+
},
|
789
|
+
/* @__PURE__ */ import_react4.default.createElement("title", null, "YouTube"),
|
790
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
791
|
+
"path",
|
792
|
+
{
|
793
|
+
fill: "currentColor",
|
794
|
+
d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
|
795
|
+
}
|
796
|
+
)
|
797
|
+
),
|
798
|
+
tiktok: (props) => /* @__PURE__ */ import_react4.default.createElement(
|
799
|
+
"svg",
|
800
|
+
{
|
801
|
+
role: "img",
|
802
|
+
viewBox: "0 0 24 24",
|
803
|
+
xmlns: "http://www.w3.org/2000/svg",
|
804
|
+
...props
|
805
|
+
},
|
806
|
+
/* @__PURE__ */ import_react4.default.createElement("title", null, "TikTok"),
|
807
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
808
|
+
"path",
|
809
|
+
{
|
810
|
+
fill: "currentColor",
|
811
|
+
d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"
|
812
|
+
}
|
813
|
+
)
|
814
|
+
),
|
815
|
+
linkedin: (props) => /* @__PURE__ */ import_react4.default.createElement(
|
816
|
+
"svg",
|
817
|
+
{
|
818
|
+
role: "img",
|
819
|
+
viewBox: "0 0 24 24",
|
820
|
+
xmlns: "http://www.w3.org/2000/svg",
|
821
|
+
...props
|
822
|
+
},
|
823
|
+
/* @__PURE__ */ import_react4.default.createElement("title", null, "LinkedIn"),
|
824
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
825
|
+
"path",
|
826
|
+
{
|
827
|
+
fill: "currentColor",
|
828
|
+
d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
|
829
|
+
}
|
830
|
+
)
|
831
|
+
),
|
832
|
+
behance: (props) => /* @__PURE__ */ import_react4.default.createElement(
|
833
|
+
"svg",
|
834
|
+
{
|
835
|
+
role: "img",
|
836
|
+
viewBox: "0 0 24 24",
|
837
|
+
xmlns: "http://www.w3.org/2000/svg",
|
838
|
+
...props
|
839
|
+
},
|
840
|
+
/* @__PURE__ */ import_react4.default.createElement("title", null, "Behance"),
|
841
|
+
/* @__PURE__ */ import_react4.default.createElement(
|
842
|
+
"path",
|
843
|
+
{
|
844
|
+
fill: "currentColor",
|
845
|
+
d: "M16.969 16.927a2.561 2.561 0 0 0 1.901.677 2.501 2.501 0 0 0 1.531-.475c.362-.235.636-.584.779-.99h2.585a5.091 5.091 0 0 1-1.9 2.896 5.292 5.292 0 0 1-3.091.88 5.839 5.839 0 0 1-2.284-.433 4.871 4.871 0 0 1-1.723-1.211 5.657 5.657 0 0 1-1.08-1.874 7.057 7.057 0 0 1-.383-2.393c-.005-.8.129-1.595.396-2.349a5.313 5.313 0 0 1 5.088-3.604 4.87 4.87 0 0 1 2.376.563c.661.362 1.231.87 1.668 1.485a6.2 6.2 0 0 1 .943 2.133c.194.821.263 1.666.205 2.508h-7.699c-.063.79.184 1.574.688 2.187ZM6.947 4.084a8.065 8.065 0 0 1 1.928.198 4.29 4.29 0 0 1 1.49.638c.418.303.748.711.958 1.182.241.579.357 1.203.341 1.83a3.506 3.506 0 0 1-.506 1.961 3.726 3.726 0 0 1-1.503 1.287 3.588 3.588 0 0 1 2.027 1.437c.464.747.697 1.615.67 2.494a4.593 4.593 0 0 1-.423 2.032 3.945 3.945 0 0 1-1.163 1.413 5.114 5.114 0 0 1-1.683.807 7.135 7.135 0 0 1-1.928.259H0V4.084h6.947Zm-.235 12.9c.308.004.616-.029.916-.099a2.18 2.18 0 0 0 .766-.332c.228-.158.411-.371.534-.619.142-.317.208-.663.191-1.009a2.08 2.08 0 0 0-.642-1.715 2.618 2.618 0 0 0-1.696-.505h-3.54v4.279h3.471Zm13.635-5.967a2.13 2.13 0 0 0-1.654-.619 2.336 2.336 0 0 0-1.163.259 2.474 2.474 0 0 0-.738.62 2.359 2.359 0 0 0-.396.792c-.074.239-.12.485-.137.734h4.769a3.239 3.239 0 0 0-.679-1.785l-.002-.001Zm-13.813-.648a2.254 2.254 0 0 0 1.423-.433c.399-.355.607-.88.56-1.413a1.916 1.916 0 0 0-.178-.891 1.298 1.298 0 0 0-.495-.533 1.851 1.851 0 0 0-.711-.274 3.966 3.966 0 0 0-.835-.073H3.241v3.631h3.293v-.014ZM21.62 5.122h-5.976v1.527h5.976V5.122Z"
|
846
|
+
}
|
847
|
+
)
|
848
|
+
),
|
764
849
|
microsoft: (props) => /* @__PURE__ */ import_react4.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", ...props }, /* @__PURE__ */ import_react4.default.createElement(
|
765
850
|
"path",
|
766
851
|
{
|
@@ -3969,7 +4054,7 @@ var Checkbox = ({
|
|
3969
4054
|
htmlFor: id,
|
3970
4055
|
className: cn(
|
3971
4056
|
"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium",
|
3972
|
-
disabled ? "hawa-cursor-not-allowed
|
4057
|
+
disabled ? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70" : "hawa-cursor-pointer"
|
3973
4058
|
),
|
3974
4059
|
style: {
|
3975
4060
|
// lineHeight: labelLineHeightStyles[size]
|
@@ -4027,7 +4112,7 @@ var CheckboxElement = React18.forwardRef(({ radius = "inherit", size = "default"
|
|
4027
4112
|
{
|
4028
4113
|
ref,
|
4029
4114
|
className: cn(
|
4030
|
-
"hawa-peer hawa-shrink-0
|
4115
|
+
"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
|
4031
4116
|
checkboxSizes[size],
|
4032
4117
|
checkboxRadius[radius],
|
4033
4118
|
className
|
@@ -4708,19 +4793,19 @@ var z5 = __toESM(require("zod"));
|
|
4708
4793
|
var React25 = __toESM(require("react"));
|
4709
4794
|
var import_input_otp = require("input-otp");
|
4710
4795
|
|
4711
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
4796
|
+
// ../../node_modules/.pnpm/lucide-react@0.381.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4712
4797
|
var import_react23 = require("react");
|
4713
4798
|
|
4714
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
4799
|
+
// ../../node_modules/.pnpm/lucide-react@0.381.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
4715
4800
|
var toKebabCase = (string9) => string9.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
4716
4801
|
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
4717
4802
|
return Boolean(className) && array.indexOf(className) === index;
|
4718
4803
|
}).join(" ");
|
4719
4804
|
|
4720
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
4805
|
+
// ../../node_modules/.pnpm/lucide-react@0.381.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4721
4806
|
var import_react22 = require("react");
|
4722
4807
|
|
4723
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
4808
|
+
// ../../node_modules/.pnpm/lucide-react@0.381.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
4724
4809
|
var defaultAttributes = {
|
4725
4810
|
xmlns: "http://www.w3.org/2000/svg",
|
4726
4811
|
width: 24,
|
@@ -4733,7 +4818,7 @@ var defaultAttributes = {
|
|
4733
4818
|
strokeLinejoin: "round"
|
4734
4819
|
};
|
4735
4820
|
|
4736
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
4821
|
+
// ../../node_modules/.pnpm/lucide-react@0.381.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4737
4822
|
var Icon = (0, import_react22.forwardRef)(
|
4738
4823
|
({
|
4739
4824
|
color = "currentColor",
|
@@ -4765,7 +4850,7 @@ var Icon = (0, import_react22.forwardRef)(
|
|
4765
4850
|
}
|
4766
4851
|
);
|
4767
4852
|
|
4768
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
4853
|
+
// ../../node_modules/.pnpm/lucide-react@0.381.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4769
4854
|
var createLucideIcon = (iconName, iconNode) => {
|
4770
4855
|
const Component = (0, import_react23.forwardRef)(
|
4771
4856
|
({ className, ...props }, ref) => (0, import_react23.createElement)(Icon, {
|
@@ -4779,7 +4864,7 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
4779
4864
|
return Component;
|
4780
4865
|
};
|
4781
4866
|
|
4782
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
4867
|
+
// ../../node_modules/.pnpm/lucide-react@0.381.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
4783
4868
|
var Dot = createLucideIcon("Dot", [
|
4784
4869
|
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
4785
4870
|
]);
|
@@ -5752,9 +5837,8 @@ var FeedbackForm = (props) => {
|
|
5752
5837
|
console.log("Form is submitted but onSubmit prop is missing");
|
5753
5838
|
}
|
5754
5839
|
}),
|
5755
|
-
className: "hawa-flex hawa-flex-col hawa-gap-
|
5840
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
5756
5841
|
},
|
5757
|
-
/* @__PURE__ */ import_react29.default.createElement(Label, null),
|
5758
5842
|
/* @__PURE__ */ import_react29.default.createElement(
|
5759
5843
|
import_react_hook_form7.Controller,
|
5760
5844
|
{
|
@@ -7832,7 +7916,7 @@ var Usage = (props) => {
|
|
7832
7916
|
|
7833
7917
|
lucide-react/dist/esm/shared/src/utils.js:
|
7834
7918
|
(**
|
7835
|
-
* @license lucide-react v0.
|
7919
|
+
* @license lucide-react v0.381.0 - ISC
|
7836
7920
|
*
|
7837
7921
|
* This source code is licensed under the ISC license.
|
7838
7922
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7840,7 +7924,7 @@ lucide-react/dist/esm/shared/src/utils.js:
|
|
7840
7924
|
|
7841
7925
|
lucide-react/dist/esm/defaultAttributes.js:
|
7842
7926
|
(**
|
7843
|
-
* @license lucide-react v0.
|
7927
|
+
* @license lucide-react v0.381.0 - ISC
|
7844
7928
|
*
|
7845
7929
|
* This source code is licensed under the ISC license.
|
7846
7930
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7848,7 +7932,7 @@ lucide-react/dist/esm/defaultAttributes.js:
|
|
7848
7932
|
|
7849
7933
|
lucide-react/dist/esm/Icon.js:
|
7850
7934
|
(**
|
7851
|
-
* @license lucide-react v0.
|
7935
|
+
* @license lucide-react v0.381.0 - ISC
|
7852
7936
|
*
|
7853
7937
|
* This source code is licensed under the ISC license.
|
7854
7938
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7856,7 +7940,7 @@ lucide-react/dist/esm/Icon.js:
|
|
7856
7940
|
|
7857
7941
|
lucide-react/dist/esm/createLucideIcon.js:
|
7858
7942
|
(**
|
7859
|
-
* @license lucide-react v0.
|
7943
|
+
* @license lucide-react v0.381.0 - ISC
|
7860
7944
|
*
|
7861
7945
|
* This source code is licensed under the ISC license.
|
7862
7946
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7864,7 +7948,7 @@ lucide-react/dist/esm/createLucideIcon.js:
|
|
7864
7948
|
|
7865
7949
|
lucide-react/dist/esm/icons/dot.js:
|
7866
7950
|
(**
|
7867
|
-
* @license lucide-react v0.
|
7951
|
+
* @license lucide-react v0.381.0 - ISC
|
7868
7952
|
*
|
7869
7953
|
* This source code is licensed under the ISC license.
|
7870
7954
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7872,7 +7956,7 @@ lucide-react/dist/esm/icons/dot.js:
|
|
7872
7956
|
|
7873
7957
|
lucide-react/dist/esm/lucide-react.js:
|
7874
7958
|
(**
|
7875
|
-
* @license lucide-react v0.
|
7959
|
+
* @license lucide-react v0.381.0 - ISC
|
7876
7960
|
*
|
7877
7961
|
* This source code is licensed under the ISC license.
|
7878
7962
|
* See the LICENSE file in the root directory of this source tree.
|
package/dist/blocks/index.mjs
CHANGED
@@ -17,7 +17,7 @@ import {
|
|
17
17
|
TabsList,
|
18
18
|
TabsTrigger,
|
19
19
|
Textarea
|
20
|
-
} from "../chunk-
|
20
|
+
} from "../chunk-FJXDCBMQ.mjs";
|
21
21
|
import "../chunk-XCW5YNMS.mjs";
|
22
22
|
import {
|
23
23
|
BadEmoji,
|
@@ -34,7 +34,6 @@ import {
|
|
34
34
|
EyeIcon,
|
35
35
|
GoodEmoji,
|
36
36
|
HiddenEyeIcon,
|
37
|
-
Label,
|
38
37
|
Loading,
|
39
38
|
Logos,
|
40
39
|
Skeleton,
|
@@ -43,7 +42,7 @@ import {
|
|
43
42
|
VeryBadEmoji,
|
44
43
|
VeryGoodEmoji,
|
45
44
|
cn
|
46
|
-
} from "../chunk-
|
45
|
+
} from "../chunk-JGP3PSJL.mjs";
|
47
46
|
import "../chunk-SYGWSBJL.mjs";
|
48
47
|
|
49
48
|
// blocks/auth/AuthButtons.tsx
|
@@ -1635,9 +1634,8 @@ var FeedbackForm = (props) => {
|
|
1635
1634
|
console.log("Form is submitted but onSubmit prop is missing");
|
1636
1635
|
}
|
1637
1636
|
}),
|
1638
|
-
className: "hawa-flex hawa-flex-col hawa-gap-
|
1637
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
1639
1638
|
},
|
1640
|
-
/* @__PURE__ */ React12.createElement(Label, null),
|
1641
1639
|
/* @__PURE__ */ React12.createElement(
|
1642
1640
|
Controller7,
|
1643
1641
|
{
|
@@ -1,17 +1,17 @@
|
|
1
1
|
"use client";
|
2
2
|
import {
|
3
3
|
Input
|
4
|
-
} from "../../chunk-
|
4
|
+
} from "../../chunk-ZSX2KZ2D.mjs";
|
5
5
|
import {
|
6
6
|
Chip,
|
7
7
|
ScrollArea
|
8
|
-
} from "../../chunk-
|
8
|
+
} from "../../chunk-UHUOBAEP.mjs";
|
9
9
|
import {
|
10
10
|
Textarea
|
11
|
-
} from "../../chunk-
|
11
|
+
} from "../../chunk-55TPME67.mjs";
|
12
12
|
import {
|
13
13
|
Select
|
14
|
-
} from "../../chunk-
|
14
|
+
} from "../../chunk-NSMJTT6Y.mjs";
|
15
15
|
import {
|
16
16
|
Button,
|
17
17
|
Card,
|
@@ -21,7 +21,7 @@ import {
|
|
21
21
|
CardHeader,
|
22
22
|
CardTitle,
|
23
23
|
cn
|
24
|
-
} from "../../chunk-
|
24
|
+
} from "../../chunk-FK2C6C3B.mjs";
|
25
25
|
|
26
26
|
// blocks/misc/LegalTexts.tsx
|
27
27
|
import React10 from "react";
|
@@ -2,22 +2,22 @@
|
|
2
2
|
import {
|
3
3
|
Chip,
|
4
4
|
ScrollArea
|
5
|
-
} from "../../chunk-
|
5
|
+
} from "../../chunk-UHUOBAEP.mjs";
|
6
6
|
import "../../chunk-47APBDKK.mjs";
|
7
7
|
import {
|
8
8
|
Radio
|
9
|
-
} from "../../chunk-
|
9
|
+
} from "../../chunk-F6SLF6DS.mjs";
|
10
10
|
import {
|
11
11
|
CheckMark,
|
12
12
|
UncheckMark
|
13
|
-
} from "../../chunk-
|
13
|
+
} from "../../chunk-4ZELUQQ7.mjs";
|
14
14
|
import {
|
15
15
|
Button,
|
16
16
|
Card,
|
17
17
|
Skeleton,
|
18
18
|
Tooltip,
|
19
19
|
cn
|
20
|
-
} from "../../chunk-
|
20
|
+
} from "../../chunk-FK2C6C3B.mjs";
|
21
21
|
|
22
22
|
// blocks/pricing/PricingPlans.tsx
|
23
23
|
import React8 from "react";
|
package/dist/checkbox/index.js
CHANGED
@@ -89,7 +89,7 @@ var Checkbox = ({
|
|
89
89
|
htmlFor: id,
|
90
90
|
className: cn(
|
91
91
|
"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium",
|
92
|
-
disabled ? "hawa-cursor-not-allowed
|
92
|
+
disabled ? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70" : "hawa-cursor-pointer"
|
93
93
|
),
|
94
94
|
style: {
|
95
95
|
// lineHeight: labelLineHeightStyles[size]
|
@@ -147,7 +147,7 @@ var CheckboxElement = React.forwardRef(({ radius = "inherit", size = "default",
|
|
147
147
|
{
|
148
148
|
ref,
|
149
149
|
className: cn(
|
150
|
-
"hawa-peer hawa-shrink-0
|
150
|
+
"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
|
151
151
|
checkboxSizes[size],
|
152
152
|
checkboxRadius[radius],
|
153
153
|
className
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/checkbox/index.ts","../../elements/checkbox/Checkbox.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Checkbox\";\n","import * as React from \"react\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\n\nimport { RadiusType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\ntype CheckBoxTypes = {\n id: string;\n label?: React.ReactNode;\n sublabel?: React.ReactNode;\n helperText?: any;\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n};\n\ntype CheckboxProps = CheckBoxTypes &\n React.ComponentProps<typeof CheckboxElement>;\n\nexport const Checkbox: React.FC<CheckboxProps> = ({\n id,\n label,\n sublabel,\n helperText,\n disabled,\n size = \"default\",\n radius = \"inherit\",\n ...props\n}) => {\n let labelLineHeightStyles = {\n xs: sublabel || helperText ? 0.5 : 0.1,\n sm: 0.6,\n default: 1,\n md: 0.8,\n lg: 0.9,\n xl: 1\n };\n return (\n <div\n className={cn(\n \"hawa-flex hawa-gap-2\",\n size === \"default\" ? \"hawa-items-top\" : \"hawa-items-center\"\n )}\n >\n <CheckboxElement\n {...props}\n size={size}\n radius={radius}\n disabled={disabled}\n id={id}\n />\n {(label || helperText) && (\n <div className={\"hawa-grid hawa-gap-1.5\"}>\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70 \"\n : \"hawa-cursor-pointer\"\n )}\n style={{\n // lineHeight: labelLineHeightStyles[size]\n\n lineHeight: 1\n }}\n >\n {label}\n </label>\n )}\n {sublabel && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70\"\n : \"hawa-cursor-pointer\"\n )}\n >\n {sublabel}\n </label>\n )}\n {helperText && !disabled && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color\",\n disabled && \"hawa-cursor-not-allowed hawa-opacity-70\"\n )}\n >\n {helperText}\n </label>\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst CheckboxElement = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n }\n>(({ radius = \"inherit\", size = \"default\", className, ...props }, ref) => {\n let checkboxRadius = {\n none: \"hawa-rounded-none\",\n inherit: \"hawa-rounded-sm\",\n full: \"hawa-rounded-full\"\n };\n let checkboxSizes = {\n xs: \"hawa-w-3 hawa-h-3\",\n sm: \"hawa-w-6 hawa-h-6\",\n default: \"hawa-icon\",\n md: \"hawa-w-8 hawa-h-8\",\n lg: \"hawa-w-10 hawa-h-10\",\n xl: \"hawa-w-12 hawa-h-12\"\n };\n let checkboxIndicatorSizes = {\n xs: \"0.5em\",\n default: \"0.60em\",\n sm: \"0.75em\",\n md: \"0.875em\",\n lg: \"1em\",\n xl: \"1.25em\"\n };\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground\",\n checkboxSizes[size],\n checkboxRadius[radius],\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n \"hawa-flex hawa-items-center hawa-justify-center hawa-text-current\"\n )}\n >\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height={checkboxIndicatorSizes[size]}\n width={checkboxIndicatorSizes[size]}\n // height=\"0.60em\"\n // width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckboxElement.displayName = CheckboxPrimitive.Root.displayName;\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;AAEvB,wBAAmC;;;ACFnC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADeO,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAG;AACL,MAAM;AACJ,MAAI,wBAAwB;AAAA,IAC1B,IAAI,YAAY,aAAa,MAAM;AAAA,IACnC,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,SAAS,YAAY,mBAAmB;AAAA,MAC1C;AAAA;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACE,SAAS,eACT,oCAAC,SAAI,WAAW,4BACb,SACC;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAW;AAAA,UACT;AAAA,UACA,WACI,yEACA;AAAA,QACN;AAAA,QACA,OAAO;AAAA;AA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BAAuB,IAAI;AAAA;AAAA,QAIlC,oCAAC,UAAK,GAAE,sRAAqR;AAAA,MAC/R;AAAA,MAAO;AAAA,IACT;AAAA,EACF;AAEJ,CAAC;AACD,gBAAgB,cAAgC,uBAAK;","names":[]}
|
1
|
+
{"version":3,"sources":["../../elements/checkbox/index.ts","../../elements/checkbox/Checkbox.tsx","../../util/index.ts"],"sourcesContent":["export * from \"./Checkbox\";\n","import * as React from \"react\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { cn } from \"@util/index\";\n\nimport { RadiusType } from \"@_types/commonTypes\";\n\ntype CheckBoxTypes = {\n id: string;\n label?: React.ReactNode;\n sublabel?: React.ReactNode;\n helperText?: any;\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n};\n\ntype CheckboxProps = CheckBoxTypes &\n React.ComponentProps<typeof CheckboxElement>;\n\nexport const Checkbox: React.FC<CheckboxProps> = ({\n id,\n label,\n sublabel,\n helperText,\n disabled,\n size = \"default\",\n radius = \"inherit\",\n ...props\n}) => {\n let labelLineHeightStyles = {\n xs: sublabel || helperText ? 0.5 : 0.1,\n sm: 0.6,\n default: 1,\n md: 0.8,\n lg: 0.9,\n xl: 1,\n };\n return (\n <div\n className={cn(\n \"hawa-flex hawa-gap-2\",\n size === \"default\" ? \"hawa-items-top\" : \"hawa-items-center\",\n )}\n >\n <CheckboxElement\n {...props}\n size={size}\n radius={radius}\n disabled={disabled}\n id={id}\n />\n {(label || helperText) && (\n <div className={\"hawa-grid hawa-gap-1.5\"}>\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70\"\n : \"hawa-cursor-pointer\",\n )}\n style={{\n // lineHeight: labelLineHeightStyles[size]\n\n lineHeight: 1,\n }}\n >\n {label}\n </label>\n )}\n {sublabel && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70\"\n : \"hawa-cursor-pointer\",\n )}\n >\n {sublabel}\n </label>\n )}\n {helperText && !disabled && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color\",\n disabled && \"hawa-cursor-not-allowed hawa-opacity-70\",\n )}\n >\n {helperText}\n </label>\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst CheckboxElement = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n }\n>(({ radius = \"inherit\", size = \"default\", className, ...props }, ref) => {\n let checkboxRadius = {\n none: \"hawa-rounded-none\",\n inherit: \"hawa-rounded-sm\",\n full: \"hawa-rounded-full\",\n };\n let checkboxSizes = {\n xs: \"hawa-w-3 hawa-h-3\",\n sm: \"hawa-w-6 hawa-h-6\",\n default: \"hawa-icon\",\n md: \"hawa-w-8 hawa-h-8\",\n lg: \"hawa-w-10 hawa-h-10\",\n xl: \"hawa-w-12 hawa-h-12\",\n };\n let checkboxIndicatorSizes = {\n xs: \"0.5em\",\n default: \"0.60em\",\n sm: \"0.75em\",\n md: \"0.875em\",\n lg: \"1em\",\n xl: \"1.25em\",\n };\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground\",\n checkboxSizes[size],\n checkboxRadius[radius],\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n \"hawa-flex hawa-items-center hawa-justify-center hawa-text-current\",\n )}\n >\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height={checkboxIndicatorSizes[size]}\n width={checkboxIndicatorSizes[size]}\n // height=\"0.60em\"\n // width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckboxElement.displayName = CheckboxPrimitive.Root.displayName;\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;AAEvB,wBAAmC;;;ACFnC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADcO,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAG;AACL,MAAM;AACJ,MAAI,wBAAwB;AAAA,IAC1B,IAAI,YAAY,aAAa,MAAM;AAAA,IACnC,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA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AAA,QAClB,eAAe,MAAM;AAAA,QACrB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,IAEJ;AAAA,MAAmB;AAAA,MAAlB;AAAA,QACC,WAAW;AAAA,UACT;AAAA,QACF;AAAA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,cAAW;AAAA,UACX,QAAO;AAAA,UACP,MAAK;AAAA,UACL,aAAY;AAAA,UACZ,SAAQ;AAAA,UACR,QAAQ,uBAAuB,IAAI;AAAA,UACnC,OAAO,uBAAuB,IAAI;AAAA;AAAA,QAIlC,oCAAC,UAAK,GAAE,sRAAqR;AAAA,MAC/R;AAAA,MAAO;AAAA,IACT;AAAA,EACF;AAEJ,CAAC;AACD,gBAAgB,cAAgC,uBAAK;","names":[]}
|
package/dist/checkbox/index.mjs
CHANGED
@@ -54,7 +54,7 @@ var Checkbox = ({
|
|
54
54
|
htmlFor: id,
|
55
55
|
className: cn(
|
56
56
|
"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium",
|
57
|
-
disabled ? "hawa-cursor-not-allowed
|
57
|
+
disabled ? "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70" : "hawa-cursor-pointer"
|
58
58
|
),
|
59
59
|
style: {
|
60
60
|
// lineHeight: labelLineHeightStyles[size]
|
@@ -112,7 +112,7 @@ var CheckboxElement = React.forwardRef(({ radius = "inherit", size = "default",
|
|
112
112
|
{
|
113
113
|
ref,
|
114
114
|
className: cn(
|
115
|
-
"hawa-peer hawa-shrink-0
|
115
|
+
"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
|
116
116
|
checkboxSizes[size],
|
117
117
|
checkboxRadius[radius],
|
118
118
|
className
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/checkbox/Checkbox.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\n\nimport { RadiusType } from \"@_types/commonTypes\";\n\nimport { cn } from \"@util/index\";\n\ntype CheckBoxTypes = {\n id: string;\n label?: React.ReactNode;\n sublabel?: React.ReactNode;\n helperText?: any;\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n};\n\ntype CheckboxProps = CheckBoxTypes &\n React.ComponentProps<typeof CheckboxElement>;\n\nexport const Checkbox: React.FC<CheckboxProps> = ({\n id,\n label,\n sublabel,\n helperText,\n disabled,\n size = \"default\",\n radius = \"inherit\",\n ...props\n}) => {\n let labelLineHeightStyles = {\n xs: sublabel || helperText ? 0.5 : 0.1,\n sm: 0.6,\n default: 1,\n md: 0.8,\n lg: 0.9,\n xl: 1\n };\n return (\n <div\n className={cn(\n \"hawa-flex hawa-gap-2\",\n size === \"default\" ? \"hawa-items-top\" : \"hawa-items-center\"\n )}\n >\n <CheckboxElement\n {...props}\n size={size}\n radius={radius}\n disabled={disabled}\n id={id}\n />\n {(label || helperText) && (\n <div className={\"hawa-grid hawa-gap-1.5\"}>\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70 \"\n : \"hawa-cursor-pointer\"\n )}\n style={{\n // lineHeight: labelLineHeightStyles[size]\n\n lineHeight: 1\n }}\n >\n {label}\n </label>\n )}\n {sublabel && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70\"\n : \"hawa-cursor-pointer\"\n )}\n >\n {sublabel}\n </label>\n )}\n {helperText && !disabled && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color\",\n disabled && \"hawa-cursor-not-allowed hawa-opacity-70\"\n )}\n >\n {helperText}\n </label>\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst CheckboxElement = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n }\n>(({ radius = \"inherit\", size = \"default\", className, ...props }, ref) => {\n let checkboxRadius = {\n none: \"hawa-rounded-none\",\n inherit: \"hawa-rounded-sm\",\n full: \"hawa-rounded-full\"\n };\n let checkboxSizes = {\n xs: \"hawa-w-3 hawa-h-3\",\n sm: \"hawa-w-6 hawa-h-6\",\n default: \"hawa-icon\",\n md: \"hawa-w-8 hawa-h-8\",\n lg: \"hawa-w-10 hawa-h-10\",\n xl: \"hawa-w-12 hawa-h-12\"\n };\n let checkboxIndicatorSizes = {\n xs: \"0.5em\",\n default: \"0.60em\",\n sm: \"0.75em\",\n md: \"0.875em\",\n lg: \"1em\",\n xl: \"1.25em\"\n };\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground\",\n checkboxSizes[size],\n checkboxRadius[radius],\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n \"hawa-flex hawa-items-center hawa-justify-center hawa-text-current\"\n )}\n >\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height={checkboxIndicatorSizes[size]}\n width={checkboxIndicatorSizes[size]}\n // height=\"0.60em\"\n // width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckboxElement.displayName = CheckboxPrimitive.Root.displayName;\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;AAEvB,YAAY,uBAAuB;;;ACFnC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADeO,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAG;AACL,MAAM;AACJ,MAAI,wBAAwB;AAAA,IAC1B,IAAI,YAAY,aAAa,MAAM;AAAA,IACnC,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,SAAS,YAAY,mBAAmB;AAAA,MAC1C;AAAA;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACE,SAAS,eACT,oCAAC,SAAI,WAAW,4BACb,SACC;AAAA,MAAC;AAAA;AAAA,Q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,MAAK;AAAA,UACL,aAAY;AAAA,UACZ,SAAQ;AAAA,UACR,QAAQ,uBAAuB,IAAI;AAAA,UACnC,OAAO,uBAAuB,IAAI;AAAA;AAAA,QAIlC,oCAAC,UAAK,GAAE,sRAAqR;AAAA,MAC/R;AAAA,MAAO;AAAA,IACT;AAAA,EACF;AAEJ,CAAC;AACD,gBAAgB,cAAgC,uBAAK;","names":[]}
|
1
|
+
{"version":3,"sources":["../../elements/checkbox/Checkbox.tsx","../../util/index.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { cn } from \"@util/index\";\n\nimport { RadiusType } from \"@_types/commonTypes\";\n\ntype CheckBoxTypes = {\n id: string;\n label?: React.ReactNode;\n sublabel?: React.ReactNode;\n helperText?: any;\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n};\n\ntype CheckboxProps = CheckBoxTypes &\n React.ComponentProps<typeof CheckboxElement>;\n\nexport const Checkbox: React.FC<CheckboxProps> = ({\n id,\n label,\n sublabel,\n helperText,\n disabled,\n size = \"default\",\n radius = \"inherit\",\n ...props\n}) => {\n let labelLineHeightStyles = {\n xs: sublabel || helperText ? 0.5 : 0.1,\n sm: 0.6,\n default: 1,\n md: 0.8,\n lg: 0.9,\n xl: 1,\n };\n return (\n <div\n className={cn(\n \"hawa-flex hawa-gap-2\",\n size === \"default\" ? \"hawa-items-top\" : \"hawa-items-center\",\n )}\n >\n <CheckboxElement\n {...props}\n size={size}\n radius={radius}\n disabled={disabled}\n id={id}\n />\n {(label || helperText) && (\n <div className={\"hawa-grid hawa-gap-1.5\"}>\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-pt-0.5 hawa-text-sm hawa-font-medium\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70\"\n : \"hawa-cursor-pointer\",\n )}\n style={{\n // lineHeight: labelLineHeightStyles[size]\n\n lineHeight: 1,\n }}\n >\n {label}\n </label>\n )}\n {sublabel && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-sm hawa-text-muted-foreground\",\n disabled\n ? \"hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70\"\n : \"hawa-cursor-pointer\",\n )}\n >\n {sublabel}\n </label>\n )}\n {helperText && !disabled && (\n <label\n htmlFor={id}\n className={cn(\n \"hawa-w-fit hawa-select-none hawa-text-xs hawa-text-helper-color\",\n disabled && \"hawa-cursor-not-allowed hawa-opacity-70\",\n )}\n >\n {helperText}\n </label>\n )}\n </div>\n )}\n </div>\n );\n};\n\nconst CheckboxElement = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {\n size?: \"xs\" | \"sm\" | \"default\" | \"md\" | \"lg\" | \"xl\";\n radius?: RadiusType;\n }\n>(({ radius = \"inherit\", size = \"default\", className, ...props }, ref) => {\n let checkboxRadius = {\n none: \"hawa-rounded-none\",\n inherit: \"hawa-rounded-sm\",\n full: \"hawa-rounded-full\",\n };\n let checkboxSizes = {\n xs: \"hawa-w-3 hawa-h-3\",\n sm: \"hawa-w-6 hawa-h-6\",\n default: \"hawa-icon\",\n md: \"hawa-w-8 hawa-h-8\",\n lg: \"hawa-w-10 hawa-h-10\",\n xl: \"hawa-w-12 hawa-h-12\",\n };\n let checkboxIndicatorSizes = {\n xs: \"0.5em\",\n default: \"0.60em\",\n sm: \"0.75em\",\n md: \"0.875em\",\n lg: \"1em\",\n xl: \"1.25em\",\n };\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"hawa-peer hawa-shrink-0 hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground\",\n checkboxSizes[size],\n checkboxRadius[radius],\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n \"hawa-flex hawa-items-center hawa-justify-center hawa-text-current\",\n )}\n >\n <svg\n aria-label=\"Check Mark\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n viewBox=\"0 0 512 512\"\n height={checkboxIndicatorSizes[size]}\n width={checkboxIndicatorSizes[size]}\n // height=\"0.60em\"\n // width=\"0.60em\"\n >\n <path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path>\n </svg>{\" \"}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckboxElement.displayName = CheckboxPrimitive.Root.displayName;\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;AAEvB,YAAY,uBAAuB;;;ACFnC,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADcO,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,GAAG;AACL,MAAM;AACJ,MAAI,wBAAwB;AAAA,IAC1B,IAAI,YAAY,aAAa,MAAM;AAAA,IACnC,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;A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