@sikka/hawa 0.8.11-next → 0.8.13-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/index.css +26 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +27 -17
- package/dist/index.mjs +69 -48
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -431,8 +431,18 @@ video {
|
|
|
431
431
|
--muted-foreground: 240 5% 64.9%;
|
|
432
432
|
--accent: 240 3.7% 15.9%;
|
|
433
433
|
--accent-foreground: 0 0% 98%;
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
--success: 106 70% 40%; /* A shade of green */
|
|
437
|
+
--success-foreground: 0 0% 100%; /* White */
|
|
438
|
+
--info: 200 100% 30%; /* A shade of blue */
|
|
439
|
+
--info-foreground: 0 0% 100%; /* White */
|
|
440
|
+
--warning: 45 100% 50%; /* A shade of yellow */
|
|
441
|
+
--warning-foreground: 0 0% 20%; /* Dark grey */
|
|
442
|
+
|
|
434
443
|
--destructive: 0 62.8% 30.6%;
|
|
435
444
|
--destructive-foreground: 0 85.7% 97.3%;
|
|
445
|
+
|
|
436
446
|
--border: 240 3.7% 15.9%;
|
|
437
447
|
--input: 240 3.7% 15.9%;
|
|
438
448
|
--ring: 240 4.9% 83.9%;
|
|
@@ -1765,6 +1775,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1765
1775
|
--tw-bg-opacity: 1;
|
|
1766
1776
|
background-color: hsl(var(--destructive) / var(--tw-bg-opacity));
|
|
1767
1777
|
}
|
|
1778
|
+
.hawa-bg-destructive\/90 {
|
|
1779
|
+
background-color: hsl(var(--destructive) / 0.9);
|
|
1780
|
+
}
|
|
1768
1781
|
.hawa-bg-error {
|
|
1769
1782
|
--tw-bg-opacity: 1;
|
|
1770
1783
|
background-color: hsl(var(--error) / var(--tw-bg-opacity));
|
|
@@ -1808,6 +1821,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1808
1821
|
--tw-bg-opacity: 1;
|
|
1809
1822
|
background-color: hsl(var(--info) / var(--tw-bg-opacity));
|
|
1810
1823
|
}
|
|
1824
|
+
.hawa-bg-info\/90 {
|
|
1825
|
+
background-color: hsl(var(--info) / 0.9);
|
|
1826
|
+
}
|
|
1811
1827
|
.hawa-bg-muted {
|
|
1812
1828
|
background-color: hsl(var(--muted));
|
|
1813
1829
|
}
|
|
@@ -1867,6 +1883,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1867
1883
|
--tw-bg-opacity: 1;
|
|
1868
1884
|
background-color: hsl(var(--success) / var(--tw-bg-opacity));
|
|
1869
1885
|
}
|
|
1886
|
+
.hawa-bg-success\/90 {
|
|
1887
|
+
background-color: hsl(var(--success) / 0.9);
|
|
1888
|
+
}
|
|
1870
1889
|
.hawa-bg-transparent {
|
|
1871
1890
|
background-color: transparent;
|
|
1872
1891
|
}
|
|
@@ -1874,6 +1893,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
1874
1893
|
--tw-bg-opacity: 1;
|
|
1875
1894
|
background-color: hsl(var(--warning) / var(--tw-bg-opacity));
|
|
1876
1895
|
}
|
|
1896
|
+
.hawa-bg-warning\/90 {
|
|
1897
|
+
background-color: hsl(var(--warning) / 0.9);
|
|
1898
|
+
}
|
|
1877
1899
|
.hawa-bg-white {
|
|
1878
1900
|
--tw-bg-opacity: 1;
|
|
1879
1901
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
@@ -3230,6 +3252,10 @@ body {
|
|
|
3230
3252
|
--tw-bg-opacity: 1;
|
|
3231
3253
|
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
|
|
3232
3254
|
}
|
|
3255
|
+
:is([data-mode="dark"] .dark\:hawa-bg-gray-900) {
|
|
3256
|
+
--tw-bg-opacity: 1;
|
|
3257
|
+
background-color: rgb(17 24 39 / var(--tw-bg-opacity));
|
|
3258
|
+
}
|
|
3233
3259
|
:is([data-mode="dark"] .dark\:hawa-bg-green-200) {
|
|
3234
3260
|
--tw-bg-opacity: 1;
|
|
3235
3261
|
background-color: rgb(187 247 208 / var(--tw-bg-opacity));
|
package/dist/index.d.mts
CHANGED
|
@@ -199,6 +199,7 @@ declare function Toaster(props: ToasterProps): React__default.JSX.Element;
|
|
|
199
199
|
interface SwitchProps extends React$1.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> {
|
|
200
200
|
size?: "default" | "sm" | "lg";
|
|
201
201
|
label?: string;
|
|
202
|
+
roundedness?: "none" | "full" | "inherit";
|
|
202
203
|
}
|
|
203
204
|
declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
204
205
|
|
|
@@ -246,7 +247,7 @@ declare const Chip: FC<TChipTypes>;
|
|
|
246
247
|
declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
|
|
247
248
|
|
|
248
249
|
type AlertTypes = {
|
|
249
|
-
severity?: "info" | "warning" | "error" | "success";
|
|
250
|
+
severity?: "info" | "warning" | "error" | "success" | "none";
|
|
250
251
|
/** The title of the alert placed above the text of the alert. Can be used alone */
|
|
251
252
|
title?: any;
|
|
252
253
|
/** The text of the alert placed below the title of the alert. Can be used alone */
|
package/dist/index.d.ts
CHANGED
|
@@ -199,6 +199,7 @@ declare function Toaster(props: ToasterProps): React__default.JSX.Element;
|
|
|
199
199
|
interface SwitchProps extends React$1.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> {
|
|
200
200
|
size?: "default" | "sm" | "lg";
|
|
201
201
|
label?: string;
|
|
202
|
+
roundedness?: "none" | "full" | "inherit";
|
|
202
203
|
}
|
|
203
204
|
declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
204
205
|
|
|
@@ -246,7 +247,7 @@ declare const Chip: FC<TChipTypes>;
|
|
|
246
247
|
declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
|
|
247
248
|
|
|
248
249
|
type AlertTypes = {
|
|
249
|
-
severity?: "info" | "warning" | "error" | "success";
|
|
250
|
+
severity?: "info" | "warning" | "error" | "success" | "none";
|
|
250
251
|
/** The title of the alert placed above the text of the alert. Can be used alone */
|
|
251
252
|
title?: any;
|
|
252
253
|
/** The text of the alert placed below the title of the alert. Can be used alone */
|
package/dist/index.js
CHANGED
|
@@ -1717,9 +1717,10 @@ var thumbSize = {
|
|
|
1717
1717
|
lg: "hawa-h-[26px] hawa-w-[26px]"
|
|
1718
1718
|
};
|
|
1719
1719
|
var Switch = React15.forwardRef(function(_param, ref) {
|
|
1720
|
-
var className = _param.className, _param_size = _param.size, size = _param_size === void 0 ? "default" : _param_size, label = _param.label, props = _object_without_properties(_param, [
|
|
1720
|
+
var className = _param.className, _param_size = _param.size, size = _param_size === void 0 ? "default" : _param_size, _param_roundedness = _param.roundedness, roundedness = _param_roundedness === void 0 ? "inherit" : _param_roundedness, label = _param.label, props = _object_without_properties(_param, [
|
|
1721
1721
|
"className",
|
|
1722
1722
|
"size",
|
|
1723
|
+
"roundedness",
|
|
1723
1724
|
"label"
|
|
1724
1725
|
]);
|
|
1725
1726
|
var _React15_useState = _sliced_to_array(React15.useState(null), 2), parentDirection = _React15_useState[0], setParentDirection = _React15_useState[1];
|
|
@@ -1732,15 +1733,25 @@ var Switch = React15.forwardRef(function(_param, ref) {
|
|
|
1732
1733
|
setParentDirection(dir);
|
|
1733
1734
|
}
|
|
1734
1735
|
});
|
|
1736
|
+
var rootRoundednessStyles = {
|
|
1737
|
+
none: "hawa-rounded-none",
|
|
1738
|
+
full: "hawa-rounded-full",
|
|
1739
|
+
inherit: "hawa-rounded"
|
|
1740
|
+
};
|
|
1741
|
+
var thumbRoundednessStyles = {
|
|
1742
|
+
none: "hawa-rounded-none",
|
|
1743
|
+
full: "hawa-rounded-full",
|
|
1744
|
+
inherit: "hawa-rounded-inner"
|
|
1745
|
+
};
|
|
1735
1746
|
return /* @__PURE__ */ React15.createElement("div", {
|
|
1736
1747
|
className: "hawa-flex hawa-flex-row hawa-items-center",
|
|
1737
1748
|
ref: parentRef
|
|
1738
1749
|
}, /* @__PURE__ */ React15.createElement(SwitchPrimitives.Root, _object_spread_props(_object_spread({
|
|
1739
|
-
className: cn("hawa-relative hawa-cursor-pointer hawa-rounded
|
|
1750
|
+
className: cn("hawa-relative hawa-cursor-pointer hawa-rounded hawa-bg-primary/20 hawa-outline-none data-[state=checked]:hawa-bg-primary", rootRoundednessStyles[roundedness], className, rootSize[size])
|
|
1740
1751
|
}, props), {
|
|
1741
1752
|
ref: ref
|
|
1742
1753
|
}), /* @__PURE__ */ React15.createElement(SwitchPrimitives.Thumb, {
|
|
1743
|
-
className: cn(thumbSize[size], "hawa-block hawa-rounded
|
|
1754
|
+
className: cn(thumbSize[size], "hawa-block hawa-rounded hawa-bg-white hawa-transition-transform hawa-duration-100 hawa-will-change-transform data-[state=checked]:hawa-bg-primary-foreground dark:hawa-bg-background", thumbRoundednessStyles[roundedness], parentDirection === "rtl" ? "hawa--translate-x-0.5 data-[state=checked]:hawa--translate-x-[19px]" : "hawa-translate-x-0.5 data-[state=checked]:hawa-translate-x-[19px]")
|
|
1744
1755
|
})), label && /* @__PURE__ */ React15.createElement("span", {
|
|
1745
1756
|
className: "hawa-mx-2 hawa-text-sm hawa-font-medium hawa-text-gray-900 dark:hawa-text-gray-300"
|
|
1746
1757
|
}, label));
|
|
@@ -1964,26 +1975,25 @@ var Alert = function(_param) {
|
|
|
1964
1975
|
duration
|
|
1965
1976
|
]);
|
|
1966
1977
|
var closeButtonStyle = {
|
|
1967
|
-
none: "
|
|
1968
|
-
info: "
|
|
1969
|
-
warning: "
|
|
1970
|
-
error: "
|
|
1971
|
-
success: "
|
|
1978
|
+
none: "",
|
|
1979
|
+
info: "",
|
|
1980
|
+
warning: "",
|
|
1981
|
+
error: "",
|
|
1982
|
+
success: ""
|
|
1972
1983
|
};
|
|
1973
1984
|
var styleVariant = {
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
success: "hawa-text-green-700 hawa-bg-green-100 dark:hawa-bg-green-200 dark:hawa-text-green-800"
|
|
1985
|
+
none: "hawa-text-gray-700 hawa-bg-gray-100 dark:hawa-bg-gray-900 ",
|
|
1986
|
+
info: "hawa-text-info-foreground hawa-bg-info/90",
|
|
1987
|
+
warning: "hawa-text-warning-foreground hawa-bg-warning/90",
|
|
1988
|
+
error: "hawa-text-destructive-foreground hawa-bg-destructive/90",
|
|
1989
|
+
success: "hawa-text-success-foreground hawa-bg-success/90"
|
|
1980
1990
|
};
|
|
1981
1991
|
return /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
1982
1992
|
ref: alertRef
|
|
1983
1993
|
}, /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
1984
|
-
className: (0, import_clsx6.default)("hawa-relative hawa-mb-4 hawa-flex hawa-flex-col hawa-rounded hawa-p-4 hawa-text-sm hawa-transition-all", styleVariant[severity], closed ? "hawa-opacity-0" : "hawa-opacity-100", className),
|
|
1985
1994
|
role: "alert",
|
|
1986
|
-
dir: direction
|
|
1995
|
+
dir: direction,
|
|
1996
|
+
className: (0, import_clsx6.default)("hawa-relative hawa-mb-4 hawa-flex hawa-flex-col hawa-rounded hawa-p-4 hawa-text-sm hawa-transition-all", styleVariant[severity], closed ? "hawa-opacity-0" : "hawa-opacity-100", className)
|
|
1987
1997
|
}, /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
1988
1998
|
className: "hawa-flex hawa-flex-row"
|
|
1989
1999
|
}, icon && /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
@@ -2002,7 +2012,7 @@ var Alert = function(_param) {
|
|
|
2002
2012
|
}, act.label);
|
|
2003
2013
|
})))), !props.persistant && /* @__PURE__ */ import_react13.default.createElement("button", {
|
|
2004
2014
|
type: "button",
|
|
2005
|
-
className: (0, import_clsx6.default)("hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded-inner hawa-p-1.5 hawa-
|
|
2015
|
+
className: (0, import_clsx6.default)("hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded-inner hawa-p-1.5 hawa-transition-all hover:hawa-text-gray-900", closeButtonStyle[severity], direction === "rtl" ? "hawa-left-2" : "hawa-right-2"),
|
|
2006
2016
|
"data-dismiss-target": "#alert-default",
|
|
2007
2017
|
"aria-label": "Close",
|
|
2008
2018
|
onClick: function() {
|
package/dist/index.mjs
CHANGED
|
@@ -1083,41 +1083,63 @@ var thumbSize = {
|
|
|
1083
1083
|
sm: "hawa-h-[16px] hawa-w-[16px]",
|
|
1084
1084
|
lg: "hawa-h-[26px] hawa-w-[26px]"
|
|
1085
1085
|
};
|
|
1086
|
-
var Switch = React15.forwardRef(
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
}
|
|
1109
|
-
/* @__PURE__ */ React15.createElement(
|
|
1110
|
-
|
|
1086
|
+
var Switch = React15.forwardRef(
|
|
1087
|
+
({ className, size = "default", roundedness = "inherit", label, ...props }, ref) => {
|
|
1088
|
+
const [parentDirection, setParentDirection] = React15.useState(
|
|
1089
|
+
null
|
|
1090
|
+
);
|
|
1091
|
+
const parentRef = React15.useRef(null);
|
|
1092
|
+
React15.useEffect(() => {
|
|
1093
|
+
const parentNode = parentRef.current?.parentNode;
|
|
1094
|
+
if (parentNode) {
|
|
1095
|
+
const dir = window.getComputedStyle(parentNode).direction;
|
|
1096
|
+
setParentDirection(dir);
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
const rootRoundednessStyles = {
|
|
1100
|
+
none: "hawa-rounded-none",
|
|
1101
|
+
full: "hawa-rounded-full",
|
|
1102
|
+
inherit: "hawa-rounded"
|
|
1103
|
+
};
|
|
1104
|
+
const thumbRoundednessStyles = {
|
|
1105
|
+
none: "hawa-rounded-none",
|
|
1106
|
+
full: "hawa-rounded-full",
|
|
1107
|
+
inherit: "hawa-rounded-inner"
|
|
1108
|
+
};
|
|
1109
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1110
|
+
"div",
|
|
1111
1111
|
{
|
|
1112
|
-
className:
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1112
|
+
className: "hawa-flex hawa-flex-row hawa-items-center",
|
|
1113
|
+
ref: parentRef
|
|
1114
|
+
},
|
|
1115
|
+
/* @__PURE__ */ React15.createElement(
|
|
1116
|
+
SwitchPrimitives.Root,
|
|
1117
|
+
{
|
|
1118
|
+
className: cn(
|
|
1119
|
+
"hawa-relative hawa-cursor-pointer hawa-rounded hawa-bg-primary/20 hawa-outline-none data-[state=checked]:hawa-bg-primary",
|
|
1120
|
+
rootRoundednessStyles[roundedness],
|
|
1121
|
+
className,
|
|
1122
|
+
rootSize[size]
|
|
1123
|
+
),
|
|
1124
|
+
...props,
|
|
1125
|
+
ref
|
|
1126
|
+
},
|
|
1127
|
+
/* @__PURE__ */ React15.createElement(
|
|
1128
|
+
SwitchPrimitives.Thumb,
|
|
1129
|
+
{
|
|
1130
|
+
className: cn(
|
|
1131
|
+
thumbSize[size],
|
|
1132
|
+
"hawa-block hawa-rounded hawa-bg-white hawa-transition-transform hawa-duration-100 hawa-will-change-transform data-[state=checked]:hawa-bg-primary-foreground dark:hawa-bg-background",
|
|
1133
|
+
thumbRoundednessStyles[roundedness],
|
|
1134
|
+
parentDirection === "rtl" ? "hawa--translate-x-0.5 data-[state=checked]:hawa--translate-x-[19px]" : "hawa-translate-x-0.5 data-[state=checked]:hawa-translate-x-[19px]"
|
|
1135
|
+
)
|
|
1136
|
+
}
|
|
1116
1137
|
)
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
}
|
|
1138
|
+
),
|
|
1139
|
+
label && /* @__PURE__ */ React15.createElement("span", { className: "hawa-mx-2 hawa-text-sm hawa-font-medium hawa-text-gray-900 dark:hawa-text-gray-300" }, label)
|
|
1140
|
+
);
|
|
1141
|
+
}
|
|
1142
|
+
);
|
|
1121
1143
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
1122
1144
|
|
|
1123
1145
|
// components/elements/Radio.tsx
|
|
@@ -1413,31 +1435,30 @@ var Alert = ({
|
|
|
1413
1435
|
}
|
|
1414
1436
|
}, [duration]);
|
|
1415
1437
|
let closeButtonStyle = {
|
|
1416
|
-
none: "
|
|
1417
|
-
info: "
|
|
1418
|
-
warning: "
|
|
1419
|
-
error: "
|
|
1420
|
-
success: "
|
|
1438
|
+
none: "",
|
|
1439
|
+
info: "",
|
|
1440
|
+
warning: "",
|
|
1441
|
+
error: "",
|
|
1442
|
+
success: ""
|
|
1421
1443
|
};
|
|
1422
1444
|
let styleVariant = {
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
success: "hawa-text-green-700 hawa-bg-green-100 dark:hawa-bg-green-200 dark:hawa-text-green-800"
|
|
1445
|
+
none: "hawa-text-gray-700 hawa-bg-gray-100 dark:hawa-bg-gray-900 ",
|
|
1446
|
+
info: "hawa-text-info-foreground hawa-bg-info/90",
|
|
1447
|
+
warning: "hawa-text-warning-foreground hawa-bg-warning/90",
|
|
1448
|
+
error: "hawa-text-destructive-foreground hawa-bg-destructive/90",
|
|
1449
|
+
success: "hawa-text-success-foreground hawa-bg-success/90"
|
|
1429
1450
|
};
|
|
1430
1451
|
return /* @__PURE__ */ React20.createElement("div", { ref: alertRef }, /* @__PURE__ */ React20.createElement(
|
|
1431
1452
|
"div",
|
|
1432
1453
|
{
|
|
1454
|
+
role: "alert",
|
|
1455
|
+
dir: direction,
|
|
1433
1456
|
className: clsx6(
|
|
1434
1457
|
"hawa-relative hawa-mb-4 hawa-flex hawa-flex-col hawa-rounded hawa-p-4 hawa-text-sm hawa-transition-all",
|
|
1435
1458
|
styleVariant[severity],
|
|
1436
1459
|
closed ? "hawa-opacity-0" : "hawa-opacity-100",
|
|
1437
1460
|
className
|
|
1438
|
-
)
|
|
1439
|
-
role: "alert",
|
|
1440
|
-
dir: direction
|
|
1461
|
+
)
|
|
1441
1462
|
},
|
|
1442
1463
|
/* @__PURE__ */ React20.createElement("div", { className: "hawa-flex hawa-flex-row" }, icon && /* @__PURE__ */ React20.createElement(
|
|
1443
1464
|
"div",
|
|
@@ -1468,7 +1489,7 @@ var Alert = ({
|
|
|
1468
1489
|
{
|
|
1469
1490
|
type: "button",
|
|
1470
1491
|
className: clsx6(
|
|
1471
|
-
"hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded-inner hawa-p-1.5 hawa-
|
|
1492
|
+
"hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-9 hawa-w-9 hawa-items-center hawa-justify-center hawa-rounded-inner hawa-p-1.5 hawa-transition-all hover:hawa-text-gray-900",
|
|
1472
1493
|
closeButtonStyle[severity],
|
|
1473
1494
|
direction === "rtl" ? "hawa-left-2" : "hawa-right-2"
|
|
1474
1495
|
),
|