@sikka/hawa 0.8.14-next → 0.8.16-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 +19 -10
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -10
- package/dist/index.mjs +21 -8
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -431,18 +431,17 @@ 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:
|
|
437
|
-
--
|
|
438
|
-
--info:
|
|
439
|
-
--
|
|
440
|
-
--warning:
|
|
441
|
-
|
|
442
|
-
|
|
434
|
+
|
|
435
|
+
--success: 106 70% 40%; /* A shade of green */
|
|
436
|
+
--success-foreground: 0 0% 100%; /* White */
|
|
437
|
+
--info: 200 100% 30%; /* A shade of blue */
|
|
438
|
+
--info-foreground: 0 0% 100%; /* White */
|
|
439
|
+
--warning: 45 100% 50%; /* A shade of yellow */
|
|
440
|
+
--warning-foreground: 0 0% 20%; /* Dark grey */
|
|
441
|
+
|
|
443
442
|
--destructive: 0 62.8% 30.6%;
|
|
444
443
|
--destructive-foreground: 0 85.7% 97.3%;
|
|
445
|
-
|
|
444
|
+
|
|
446
445
|
--border: 240 3.7% 15.9%;
|
|
447
446
|
--input: 240 3.7% 15.9%;
|
|
448
447
|
--ring: 240 4.9% 83.9%;
|
|
@@ -661,6 +660,16 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
|
661
660
|
height: 1rem;
|
|
662
661
|
width: 1rem;
|
|
663
662
|
}
|
|
663
|
+
.helper-text {
|
|
664
|
+
font-size: 0.75rem;
|
|
665
|
+
line-height: 1rem;
|
|
666
|
+
--tw-text-opacity: 1;
|
|
667
|
+
color: rgb(220 38 38 / var(--tw-text-opacity));
|
|
668
|
+
}
|
|
669
|
+
:is([data-mode="dark"] .helper-text) {
|
|
670
|
+
--tw-text-opacity: 1;
|
|
671
|
+
color: rgb(239 68 68 / var(--tw-text-opacity));
|
|
672
|
+
}
|
|
664
673
|
.ddm-w-parent {
|
|
665
674
|
width: var(--radix-dropdown-menu-trigger-width);
|
|
666
675
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -116,7 +116,7 @@ interface ItemCardTypes {
|
|
|
116
116
|
/** a URL for the image of the card */
|
|
117
117
|
cardImage?: string;
|
|
118
118
|
/** a function that fires when the card is clicked anywhere */
|
|
119
|
-
onCardClick?:
|
|
119
|
+
onCardClick?: (event: React__default.MouseEvent<HTMLDivElement>) => void;
|
|
120
120
|
/** a React node with HawaIconCount children to have counters at the bottom of the card */
|
|
121
121
|
counts?: JSX.Element;
|
|
122
122
|
/** The action buttons on the bottom right of the card */
|
|
@@ -665,7 +665,7 @@ type SelectTypes = {
|
|
|
665
665
|
controlClassNames?: string;
|
|
666
666
|
containerClassNames?: string;
|
|
667
667
|
onChange?: any;
|
|
668
|
-
helperText?:
|
|
668
|
+
helperText?: string;
|
|
669
669
|
onInputChange?: any;
|
|
670
670
|
native?: any;
|
|
671
671
|
width?: "full" | "small" | "fit";
|
package/dist/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ interface ItemCardTypes {
|
|
|
116
116
|
/** a URL for the image of the card */
|
|
117
117
|
cardImage?: string;
|
|
118
118
|
/** a function that fires when the card is clicked anywhere */
|
|
119
|
-
onCardClick?:
|
|
119
|
+
onCardClick?: (event: React__default.MouseEvent<HTMLDivElement>) => void;
|
|
120
120
|
/** a React node with HawaIconCount children to have counters at the bottom of the card */
|
|
121
121
|
counts?: JSX.Element;
|
|
122
122
|
/** The action buttons on the bottom right of the card */
|
|
@@ -665,7 +665,7 @@ type SelectTypes = {
|
|
|
665
665
|
controlClassNames?: string;
|
|
666
666
|
containerClassNames?: string;
|
|
667
667
|
onChange?: any;
|
|
668
|
-
helperText?:
|
|
668
|
+
helperText?: string;
|
|
669
669
|
onInputChange?: any;
|
|
670
670
|
native?: any;
|
|
671
671
|
width?: "full" | "small" | "fit";
|
package/dist/index.js
CHANGED
|
@@ -1362,7 +1362,8 @@ var DropdownMenu = function(param) {
|
|
|
1362
1362
|
};
|
|
1363
1363
|
// components/elements/cards/ItemCard.tsx
|
|
1364
1364
|
var ItemCard = function(_param) {
|
|
1365
|
-
var handleOpenActionHeader = function handleOpenActionHeader() {
|
|
1365
|
+
var handleOpenActionHeader = function handleOpenActionHeader(e) {
|
|
1366
|
+
e.stopPropagation();
|
|
1366
1367
|
setOpenActionHeader(!openActionHeader);
|
|
1367
1368
|
};
|
|
1368
1369
|
var actions = _param.actions, counts = _param.counts, content = _param.content, headerActions = _param.headerActions, clickableImage = _param.clickableImage, clickableImageAction = _param.clickableImageAction, clickableImageActionText = _param.clickableImageActionText, clickableImageActionIcon = _param.clickableImageActionIcon, header = _param.header, cardImage = _param.cardImage, _param_orientation = _param.orientation, orientation = _param_orientation === void 0 ? "vertical" : _param_orientation, props = _object_without_properties(_param, [
|
|
@@ -1404,11 +1405,17 @@ var ItemCard = function(_param) {
|
|
|
1404
1405
|
openActionHeader
|
|
1405
1406
|
]);
|
|
1406
1407
|
return /* @__PURE__ */ import_react5.default.createElement("div", _object_spread({
|
|
1407
|
-
className: (0, import_clsx5.default)(defaultStyle, orientationStyles[orientation])
|
|
1408
|
+
className: (0, import_clsx5.default)(defaultStyle, orientationStyles[orientation]),
|
|
1409
|
+
onClick: function(e) {
|
|
1410
|
+
e.stopPropagation();
|
|
1411
|
+
if (props.onCardClick) {
|
|
1412
|
+
props.onCardClick(e);
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1408
1415
|
}, props), cardImage && /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
1409
1416
|
className: "hawa-group hawa-relative hawa-overflow-clip"
|
|
1410
1417
|
}, /* @__PURE__ */ import_react5.default.createElement("img", {
|
|
1411
|
-
src:
|
|
1418
|
+
src: cardImage,
|
|
1412
1419
|
className: (0, import_clsx5.default)(imageStyles[orientation], clickableImage ? "hawa-overflow-clip hawa-transition-all group-hover:hawa-blur-lg" : "")
|
|
1413
1420
|
}), clickableImage && /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
1414
1421
|
className: "hawa-absolute hawa-left-0 hawa-top-0 hawa-flex hawa-h-full hawa-w-full hawa-items-center hawa-justify-center hawa-opacity-0 hawa-transition-all group-hover:hawa-opacity-100 "
|
|
@@ -1441,7 +1448,15 @@ var ItemCard = function(_param) {
|
|
|
1441
1448
|
className: "hawa-w-full hawa-font-normal hawa-text-gray-700 dark:hawa-text-gray-400"
|
|
1442
1449
|
}, content), actions || counts ? /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
1443
1450
|
className: (0, import_clsx5.default)("hawa-mt-3 hawa-flex hawa-items-center hawa-rounded-b-lg dark:hawa-text-white ", actions && counts ? "hawa-justify-between" : "hawa-justify-end")
|
|
1444
|
-
}, counts, actions) : null));
|
|
1451
|
+
}, counts, /* @__PURE__ */ import_react5.default.createElement(StopPropagationWrapper, null, actions)) : null));
|
|
1452
|
+
};
|
|
1453
|
+
var StopPropagationWrapper = function(props) {
|
|
1454
|
+
var handleClick = function(e) {
|
|
1455
|
+
e.stopPropagation();
|
|
1456
|
+
};
|
|
1457
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
1458
|
+
onClick: handleClick
|
|
1459
|
+
}, props.children);
|
|
1445
1460
|
};
|
|
1446
1461
|
// components/elements/Dialog.tsx
|
|
1447
1462
|
var React9 = __toESM(require("react"));
|
|
@@ -1757,7 +1772,7 @@ var Checkbox = function(_param) {
|
|
|
1757
1772
|
className: cn("hawa-cursor-pointer hawa-select-none hawa-text-sm hawa-text-muted-foreground", checkboxProps.disabled && "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70")
|
|
1758
1773
|
}, sublabel), helperText && !checkboxProps.disabled && /* @__PURE__ */ React13.createElement("label", {
|
|
1759
1774
|
htmlFor: id,
|
|
1760
|
-
className: cn("hawa-select-none
|
|
1775
|
+
className: cn("hawa-select-none helper-text", checkboxProps.disabled && "hawa-cursor-not-allowed hawa-opacity-70")
|
|
1761
1776
|
}, helperText)));
|
|
1762
1777
|
};
|
|
1763
1778
|
var CheckboxElement = React13.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
@@ -2428,7 +2443,7 @@ var Textarea = React24.forwardRef(function(_param, ref) {
|
|
|
2428
2443
|
className: cn("hawa-flex hawa-min-h-[80px] hawa-w-full hawa-rounded-md hawa-border hawa-border-input hawa-bg-background hawa-px-3 hawa-py-2 hawa-text-sm hawa-ring-offset-background placeholder:hawa-text-muted-foreground 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", className),
|
|
2429
2444
|
ref: ref
|
|
2430
2445
|
}, props)), props.helperText && /* @__PURE__ */ React24.createElement("p", {
|
|
2431
|
-
className: "
|
|
2446
|
+
className: "helper-text"
|
|
2432
2447
|
}, props.helperText));
|
|
2433
2448
|
});
|
|
2434
2449
|
Textarea.displayName = "Textarea";
|
|
@@ -4593,7 +4608,7 @@ var Select = function(props) {
|
|
|
4593
4608
|
return props.onInputChange(newValue, action);
|
|
4594
4609
|
}
|
|
4595
4610
|
}), props.helperText && /* @__PURE__ */ import_react18.default.createElement("p", {
|
|
4596
|
-
className: "
|
|
4611
|
+
className: "helper-text"
|
|
4597
4612
|
}, props.helperText));
|
|
4598
4613
|
};
|
|
4599
4614
|
// components/elements/PhoneInput.tsx
|
|
@@ -4895,7 +4910,7 @@ var Input = function(_param) {
|
|
|
4895
4910
|
})), props.iconInside && /* @__PURE__ */ import_react22.default.createElement("div", {
|
|
4896
4911
|
className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2"
|
|
4897
4912
|
}, props.iconInside), props.helperText && /* @__PURE__ */ import_react22.default.createElement("p", {
|
|
4898
|
-
className: "hawa-mb-0 hawa-mt-0
|
|
4913
|
+
className: "hawa-mb-0 hawa-mt-0 helper-text"
|
|
4899
4914
|
}, props.helperText))));
|
|
4900
4915
|
};
|
|
4901
4916
|
// components/elements/DataTable.tsx
|
|
@@ -8118,13 +8133,13 @@ var FeedbackForm = function(props) {
|
|
|
8118
8133
|
control: control,
|
|
8119
8134
|
render: function(param) {
|
|
8120
8135
|
var field = param.field;
|
|
8121
|
-
var _formState_errors_requestType;
|
|
8136
|
+
var _formState_errors_requestType_message, _formState_errors_requestType;
|
|
8122
8137
|
return /* @__PURE__ */ import_react45.default.createElement(Select, _object_spread_props(_object_spread({}, field), {
|
|
8123
8138
|
onChange: function(option) {
|
|
8124
8139
|
return field.onChange(option.value);
|
|
8125
8140
|
},
|
|
8126
8141
|
options: props.requestTypes,
|
|
8127
|
-
helperText:
|
|
8142
|
+
helperText: (_formState_errors_requestType = formState.errors.requestType) === null || _formState_errors_requestType === void 0 ? void 0 : (_formState_errors_requestType_message = _formState_errors_requestType.message) === null || _formState_errors_requestType_message === void 0 ? void 0 : _formState_errors_requestType_message.toString()
|
|
8128
8143
|
}));
|
|
8129
8144
|
}
|
|
8130
8145
|
}), /* @__PURE__ */ import_react45.default.createElement(Label2, null, props.texts.description), /* @__PURE__ */ import_react45.default.createElement(import_react_hook_form7.Controller, {
|
package/dist/index.mjs
CHANGED
|
@@ -747,7 +747,8 @@ var ItemCard = ({
|
|
|
747
747
|
};
|
|
748
748
|
let headerActionsButtonStyle = "hawa-inline-block hawa-rounded hawa-p-1 hawa-text-sm hawa-text-gray-500 hover:hawa-bg-gray-100 focus:hawa-outline-none focus:hawa-ring-4 focus:hawa-ring-gray-200 dark:hawa-text-gray-400 dark:hover:hawa-bg-gray-700 dark:focus:hawa-ring-gray-700";
|
|
749
749
|
const [openActionHeader, setOpenActionHeader] = useState3(false);
|
|
750
|
-
function handleOpenActionHeader() {
|
|
750
|
+
function handleOpenActionHeader(e) {
|
|
751
|
+
e.stopPropagation();
|
|
751
752
|
setOpenActionHeader(!openActionHeader);
|
|
752
753
|
}
|
|
753
754
|
useEffect2(() => {
|
|
@@ -762,12 +763,18 @@ var ItemCard = ({
|
|
|
762
763
|
"div",
|
|
763
764
|
{
|
|
764
765
|
className: clsx5(defaultStyle, orientationStyles[orientation]),
|
|
766
|
+
onClick: (e) => {
|
|
767
|
+
e.stopPropagation();
|
|
768
|
+
if (props.onCardClick) {
|
|
769
|
+
props.onCardClick(e);
|
|
770
|
+
}
|
|
771
|
+
},
|
|
765
772
|
...props
|
|
766
773
|
},
|
|
767
774
|
cardImage && /* @__PURE__ */ React8.createElement("div", { className: "hawa-group hawa-relative hawa-overflow-clip" }, /* @__PURE__ */ React8.createElement(
|
|
768
775
|
"img",
|
|
769
776
|
{
|
|
770
|
-
src:
|
|
777
|
+
src: cardImage,
|
|
771
778
|
className: clsx5(
|
|
772
779
|
imageStyles[orientation],
|
|
773
780
|
clickableImage ? "hawa-overflow-clip hawa-transition-all group-hover:hawa-blur-lg" : ""
|
|
@@ -815,10 +822,16 @@ var ItemCard = ({
|
|
|
815
822
|
)
|
|
816
823
|
},
|
|
817
824
|
counts,
|
|
818
|
-
actions
|
|
825
|
+
/* @__PURE__ */ React8.createElement(StopPropagationWrapper, null, actions)
|
|
819
826
|
) : null)
|
|
820
827
|
);
|
|
821
828
|
};
|
|
829
|
+
var StopPropagationWrapper = (props) => {
|
|
830
|
+
const handleClick = (e) => {
|
|
831
|
+
e.stopPropagation();
|
|
832
|
+
};
|
|
833
|
+
return /* @__PURE__ */ React8.createElement("div", { onClick: handleClick }, props.children);
|
|
834
|
+
};
|
|
822
835
|
|
|
823
836
|
// components/elements/Dialog.tsx
|
|
824
837
|
import * as React9 from "react";
|
|
@@ -1194,7 +1207,7 @@ var Checkbox = ({
|
|
|
1194
1207
|
{
|
|
1195
1208
|
htmlFor: id,
|
|
1196
1209
|
className: cn(
|
|
1197
|
-
"hawa-select-none
|
|
1210
|
+
"hawa-select-none helper-text",
|
|
1198
1211
|
checkboxProps.disabled && "hawa-cursor-not-allowed hawa-opacity-70"
|
|
1199
1212
|
)
|
|
1200
1213
|
},
|
|
@@ -1999,7 +2012,7 @@ var Textarea = React24.forwardRef(
|
|
|
1999
2012
|
ref,
|
|
2000
2013
|
...props
|
|
2001
2014
|
}
|
|
2002
|
-
), props.helperText && /* @__PURE__ */ React24.createElement("p", { className: "
|
|
2015
|
+
), props.helperText && /* @__PURE__ */ React24.createElement("p", { className: "helper-text" }, props.helperText));
|
|
2003
2016
|
}
|
|
2004
2017
|
);
|
|
2005
2018
|
Textarea.displayName = "Textarea";
|
|
@@ -4223,7 +4236,7 @@ var Select = (props) => {
|
|
|
4223
4236
|
onInputChange: (newValue, action) => props.onInputChange(newValue, action)
|
|
4224
4237
|
}
|
|
4225
4238
|
),
|
|
4226
|
-
props.helperText && /* @__PURE__ */ React29.createElement("p", { className: "
|
|
4239
|
+
props.helperText && /* @__PURE__ */ React29.createElement("p", { className: "helper-text" }, props.helperText)
|
|
4227
4240
|
);
|
|
4228
4241
|
};
|
|
4229
4242
|
|
|
@@ -4571,7 +4584,7 @@ var Input = ({
|
|
|
4571
4584
|
placeholder: props.placeholder,
|
|
4572
4585
|
disabled: preview
|
|
4573
4586
|
}
|
|
4574
|
-
)), props.iconInside && /* @__PURE__ */ React34.createElement("div", { className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2" }, props.iconInside), props.helperText && /* @__PURE__ */ React34.createElement("p", { className: "hawa-mb-0 hawa-mt-0
|
|
4587
|
+
)), props.iconInside && /* @__PURE__ */ React34.createElement("div", { className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2" }, props.iconInside), props.helperText && /* @__PURE__ */ React34.createElement("p", { className: "hawa-mb-0 hawa-mt-0 helper-text" }, props.helperText)))
|
|
4575
4588
|
);
|
|
4576
4589
|
};
|
|
4577
4590
|
|
|
@@ -8022,7 +8035,7 @@ var FeedbackForm = (props) => {
|
|
|
8022
8035
|
...field,
|
|
8023
8036
|
onChange: (option) => field.onChange(option.value),
|
|
8024
8037
|
options: props.requestTypes,
|
|
8025
|
-
helperText: formState.errors.requestType
|
|
8038
|
+
helperText: formState.errors.requestType?.message?.toString()
|
|
8026
8039
|
}
|
|
8027
8040
|
)
|
|
8028
8041
|
}
|