@sikka/hawa 0.1.92 → 0.1.93
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.d.mts +36 -9
- package/dist/index.d.ts +36 -9
- package/dist/index.js +251 -102
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +776 -631
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +89 -9
- package/package.json +1 -1
- package/src/blocks/Payment/CreditCardForm.tsx +63 -2
- package/src/elements/HawaRadio.tsx +13 -13
- package/src/elements/HawaTextField.tsx +7 -2
- package/src/elements/StickyFeatures.tsx +53 -0
- package/src/elements/UserReferralSource.tsx +101 -0
- package/src/elements/index.ts +2 -0
- package/src/styles.css +89 -9
- package/src/tailwind.css +7 -7
package/dist/index.js
CHANGED
|
@@ -221,14 +221,14 @@ var React16 = _interopRequireWildcard(_react);
|
|
|
221
221
|
var React19 = _interopRequireWildcard(_react);
|
|
222
222
|
var React31 = _interopRequireWildcard(_react);
|
|
223
223
|
var React60 = _interopRequireWildcard(_react);
|
|
224
|
-
var React62 = _interopRequireWildcard(_react);
|
|
225
224
|
var React63 = _interopRequireWildcard(_react);
|
|
226
|
-
var React64 = _interopRequireWildcard(_react);
|
|
227
225
|
var React65 = _interopRequireWildcard(_react);
|
|
228
226
|
var React66 = _interopRequireWildcard(_react);
|
|
229
227
|
var React67 = _interopRequireWildcard(_react);
|
|
228
|
+
var React68 = _interopRequireWildcard(_react);
|
|
230
229
|
var React69 = _interopRequireWildcard(_react);
|
|
231
|
-
var
|
|
230
|
+
var React71 = _interopRequireWildcard(_react);
|
|
231
|
+
var React77 = _interopRequireWildcard(_react);
|
|
232
232
|
var _clsx = require("clsx");
|
|
233
233
|
var _clsx2 = _interopRequireDefault(_clsx);
|
|
234
234
|
var HawaCheckbox = function(props) {
|
|
@@ -385,7 +385,9 @@ var HawaTextField = function(_param) {
|
|
|
385
385
|
}, props.icon), /* @__PURE__ */ React6.default.createElement("input", _object_spread_props(_object_spread({}, props), {
|
|
386
386
|
className: cn(defaultInputStyle, props.icon && "pl-10", preview && "border-transparent bg-transparent px-0"),
|
|
387
387
|
disabled: preview
|
|
388
|
-
}))), props.
|
|
388
|
+
}))), props.iconInside && /* @__PURE__ */ React6.default.createElement("div", {
|
|
389
|
+
className: "absolute right-1 top-[41px] -translate-y-1/2"
|
|
390
|
+
}, props.iconInside), props.helpertext ? /* @__PURE__ */ React6.default.createElement("p", {
|
|
389
391
|
className: "mb-0 mt-1 text-xs text-red-600 dark:text-red-500"
|
|
390
392
|
}, props.helpertext) : null));
|
|
391
393
|
};
|
|
@@ -477,7 +479,7 @@ var HawaRadio = function(_param) {
|
|
|
477
479
|
case "tabs":
|
|
478
480
|
return /* @__PURE__ */ React6.default.createElement("ul", {
|
|
479
481
|
ref: ref,
|
|
480
|
-
className:
|
|
482
|
+
className: cn(_optionalChain([
|
|
481
483
|
props,
|
|
482
484
|
"access",
|
|
483
485
|
function(_3) {
|
|
@@ -507,7 +509,7 @@ var HawaRadio = function(_param) {
|
|
|
507
509
|
setSelectedOption(opt.value);
|
|
508
510
|
props.onChangeTab(opt.value);
|
|
509
511
|
},
|
|
510
|
-
className:
|
|
512
|
+
className: cn("w-full cursor-pointer", orientation === "horizontal" && parentDirection === "ltr" && "rounded-none first:rounded-l last:rounded-r", orientation === "horizontal" && parentDirection === "rtl" && "rounded-none first:rounded-r last:rounded-l", orientation === "vertical" && "rounded-none first:rounded-t last:rounded-b", "last flex flex-row items-center justify-center gap-2 ", selectedOption === opt.value ? activeTabStyle : inactiveTabStyle),
|
|
511
513
|
key: o
|
|
512
514
|
}, opt.icon && opt.icon, opt.label);
|
|
513
515
|
});
|
|
@@ -515,7 +517,7 @@ var HawaRadio = function(_param) {
|
|
|
515
517
|
]));
|
|
516
518
|
case "bordered":
|
|
517
519
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
518
|
-
className:
|
|
520
|
+
className: cn(orientationStyle[orientation], "gap-4")
|
|
519
521
|
}, props.options.map(function(opt, i) {
|
|
520
522
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
521
523
|
className: "rounded border border-gray-200 "
|
|
@@ -530,12 +532,12 @@ var HawaRadio = function(_param) {
|
|
|
530
532
|
name: "bordered-radio"
|
|
531
533
|
}), /* @__PURE__ */ React6.default.createElement("label", {
|
|
532
534
|
htmlFor: opt.value.toString(),
|
|
533
|
-
className:
|
|
535
|
+
className: cn("ml-2 w-full p-4 pl-3 text-sm font-medium dark:text-white", opt.disabled ? "opacity-50" : "cursor-pointer text-gray-900")
|
|
534
536
|
}, opt.label)));
|
|
535
537
|
}));
|
|
536
538
|
case "cards":
|
|
537
539
|
return /* @__PURE__ */ React6.default.createElement("ul", {
|
|
538
|
-
className:
|
|
540
|
+
className: cn(orientationStyle[orientation], "gap-4")
|
|
539
541
|
}, _optionalChain([
|
|
540
542
|
props,
|
|
541
543
|
"access",
|
|
@@ -559,7 +561,7 @@ var HawaRadio = function(_param) {
|
|
|
559
561
|
disabled: opt.disabled
|
|
560
562
|
}), /* @__PURE__ */ React6.default.createElement("label", {
|
|
561
563
|
htmlFor: opt.value.toString(),
|
|
562
|
-
className:
|
|
564
|
+
className: cn("inline-flex h-full w-full items-center justify-between rounded-lg border border-gray-200 bg-white p-5 text-gray-500 peer-checked:border-blue-600 peer-checked:text-blue-600 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:peer-checked:text-primary", opt.disabled ? "opacity-50" : "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-gray-300 hover:text-gray-600")
|
|
563
565
|
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
564
566
|
className: "block h-full w-full"
|
|
565
567
|
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
@@ -572,10 +574,10 @@ var HawaRadio = function(_param) {
|
|
|
572
574
|
]));
|
|
573
575
|
default:
|
|
574
576
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
575
|
-
className: orientationStyle[orientation]
|
|
577
|
+
className: cn(orientationStyle[orientation], "gap-2")
|
|
576
578
|
}, props.options.map(function(opt, i) {
|
|
577
579
|
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
578
|
-
className: "radio-item radio-item-default
|
|
580
|
+
className: "radio-item radio-item-default flex items-center transition-all",
|
|
579
581
|
key: i + 1
|
|
580
582
|
}, /* @__PURE__ */ React6.default.createElement("input", {
|
|
581
583
|
disabled: opt.disabled,
|
|
@@ -585,7 +587,7 @@ var HawaRadio = function(_param) {
|
|
|
585
587
|
name: "default-radio"
|
|
586
588
|
}), /* @__PURE__ */ React6.default.createElement("label", {
|
|
587
589
|
htmlFor: opt.value.toString(),
|
|
588
|
-
className:
|
|
590
|
+
className: cn("text-sm font-medium dark:text-white", opt.disabled ? "text-gray-400" : "cursor-pointer text-gray-900")
|
|
589
591
|
}, opt.label));
|
|
590
592
|
}));
|
|
591
593
|
}
|
|
@@ -6859,6 +6861,119 @@ var ActionCard = function(props) {
|
|
|
6859
6861
|
className: "flex flex-row justify-between text-sm transition-all duration-200 ".concat(hovered ? "opacity-100" : "opacity-0")
|
|
6860
6862
|
}, props.bottomElement));
|
|
6861
6863
|
};
|
|
6864
|
+
// src/elements/StickyFeatures.tsx
|
|
6865
|
+
var StickyFeatures = function(props) {
|
|
6866
|
+
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
6867
|
+
className: "bg-white py-24 sm:py-32"
|
|
6868
|
+
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
6869
|
+
className: "mx-auto flex max-w-5xl flex-col items-start gap-10 px-6 md:flex-row lg:px-8"
|
|
6870
|
+
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
6871
|
+
className: "w-full md:sticky md:top-10 md:w-[28rem]"
|
|
6872
|
+
}, /* @__PURE__ */ React6.default.createElement("h2", {
|
|
6873
|
+
className: "text-lg font-semibold leading-8 tracking-tight text-indigo-600"
|
|
6874
|
+
}, props.tag), /* @__PURE__ */ React6.default.createElement("p", {
|
|
6875
|
+
className: "mt-2 text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl"
|
|
6876
|
+
}, props.title), /* @__PURE__ */ React6.default.createElement("p", {
|
|
6877
|
+
className: "mb-2 mt-6 text-base leading-7 text-gray-600"
|
|
6878
|
+
}, props.description)), /* @__PURE__ */ React6.default.createElement("div", {
|
|
6879
|
+
className: "mt-5 w-full min-w-0 flex-1 md:mt-0"
|
|
6880
|
+
}, /* @__PURE__ */ React6.default.createElement("dl", {
|
|
6881
|
+
className: "grid grid-cols-1 gap-x-8 gap-y-10 md:max-w-xl lg:max-w-none lg:gap-y-16"
|
|
6882
|
+
}, props.features.map(function(f) {
|
|
6883
|
+
return /* @__PURE__ */ React6.default.createElement("div", {
|
|
6884
|
+
className: "relative rounded-lg bg-gray-50 p-10"
|
|
6885
|
+
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
6886
|
+
className: "flex h-10 w-10 items-center justify-center rounded-lg bg-indigo-600"
|
|
6887
|
+
}, f.icon), /* @__PURE__ */ React6.default.createElement("dt", {
|
|
6888
|
+
className: "mt-4 text-lg font-semibold leading-7 text-gray-900"
|
|
6889
|
+
}, f.title), /* @__PURE__ */ React6.default.createElement("dd", {
|
|
6890
|
+
className: "mt-2 text-base leading-7 text-gray-600"
|
|
6891
|
+
}, f.description));
|
|
6892
|
+
})))));
|
|
6893
|
+
};
|
|
6894
|
+
// src/elements/UserReferralSource.tsx
|
|
6895
|
+
// src/elements/Textarea.tsx
|
|
6896
|
+
var Textarea = React60.forwardRef(function(_param, ref) {
|
|
6897
|
+
var className = _param.className, label = _param.label, props = _object_without_properties(_param, [
|
|
6898
|
+
"className",
|
|
6899
|
+
"label"
|
|
6900
|
+
]);
|
|
6901
|
+
return /* @__PURE__ */ React60.createElement(React60.Fragment, null, label && /* @__PURE__ */ React60.createElement(Label, {
|
|
6902
|
+
htmlFor: props.id
|
|
6903
|
+
}, label), /* @__PURE__ */ React60.createElement("textarea", _object_spread({
|
|
6904
|
+
className: cn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
6905
|
+
ref: ref
|
|
6906
|
+
}, props)));
|
|
6907
|
+
});
|
|
6908
|
+
Textarea.displayName = "Textarea";
|
|
6909
|
+
// src/elements/UserReferralSource.tsx
|
|
6910
|
+
var UserReferralSource = function(_param) {
|
|
6911
|
+
var _param_position = _param.position, position = _param_position === void 0 ? "bottom-right" : _param_position, props = _object_without_properties(_param, [
|
|
6912
|
+
"position"
|
|
6913
|
+
]);
|
|
6914
|
+
var _react_useState_call = _sliced_to_array(_react.useState.call(void 0, false), 2), closed = _react_useState_call[0], setClosed = _react_useState_call[1];
|
|
6915
|
+
var _react_useState_call1 = _sliced_to_array(_react.useState.call(void 0, false), 2), answered = _react_useState_call1[0], setAnswered = _react_useState_call1[1];
|
|
6916
|
+
var _react_useState_call2 = _sliced_to_array(_react.useState.call(void 0, null), 2), clickedOption = _react_useState_call2[0], setClickedOption = _react_useState_call2[1];
|
|
6917
|
+
var _react_useState_call3 = _sliced_to_array(_react.useState.call(void 0, 5), 2), closingTimer = _react_useState_call3[0], setClosingTimer = _react_useState_call3[1];
|
|
6918
|
+
var popUpRef = _react.useRef.call(void 0, null);
|
|
6919
|
+
var boxPosition = {
|
|
6920
|
+
"bottom-right": "right-4",
|
|
6921
|
+
"bottom-left": "left-4"
|
|
6922
|
+
};
|
|
6923
|
+
_react.useEffect.call(void 0, function() {
|
|
6924
|
+
var timeoutHide = setTimeout(function() {
|
|
6925
|
+
if (closingTimer >= 0) {
|
|
6926
|
+
setClosingTimer(closingTimer - 1);
|
|
6927
|
+
}
|
|
6928
|
+
}, 1e3);
|
|
6929
|
+
return function() {
|
|
6930
|
+
clearTimeout(timeoutHide);
|
|
6931
|
+
};
|
|
6932
|
+
}, [
|
|
6933
|
+
closingTimer
|
|
6934
|
+
]);
|
|
6935
|
+
var slowClose = function() {
|
|
6936
|
+
setClosed(true);
|
|
6937
|
+
setTimeout(function() {
|
|
6938
|
+
popUpRef.current.removeChild(popUpRef.current.children[0]);
|
|
6939
|
+
}, 200);
|
|
6940
|
+
};
|
|
6941
|
+
return /* @__PURE__ */ React6.default.createElement(Card, {
|
|
6942
|
+
ref: popUpRef,
|
|
6943
|
+
className: _clsx2.default.call(void 0, "fixed bottom-4 p-4 ", boxPosition[position])
|
|
6944
|
+
}, /* @__PURE__ */ React6.default.createElement("button", {
|
|
6945
|
+
type: "button",
|
|
6946
|
+
className: "absolute right-2 top-2 inline-flex h-8 w-8 rounded p-1.5 text-gray-400 transition-all hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white",
|
|
6947
|
+
"data-dismiss-target": "#toast-default",
|
|
6948
|
+
"aria-label": "Close",
|
|
6949
|
+
onClick: function() {
|
|
6950
|
+
return slowClose();
|
|
6951
|
+
}
|
|
6952
|
+
}, /* @__PURE__ */ React6.default.createElement("svg", {
|
|
6953
|
+
"aria-hidden": "true",
|
|
6954
|
+
className: "h-5 w-5",
|
|
6955
|
+
fill: "currentColor",
|
|
6956
|
+
viewBox: "0 0 20 20"
|
|
6957
|
+
}, /* @__PURE__ */ React6.default.createElement("path", {
|
|
6958
|
+
fillRule: "evenodd",
|
|
6959
|
+
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
6960
|
+
clipRule: "evenodd"
|
|
6961
|
+
}))), /* @__PURE__ */ React6.default.createElement(CardContent, {
|
|
6962
|
+
headless: true
|
|
6963
|
+
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
6964
|
+
className: _clsx2.default.call(void 0, "flex flex-col gap-4", // "relative flex w-full max-w-sm flex-col gap-2 rounded border bg-background p-4 shadow-md transition-all",
|
|
6965
|
+
closed ? "opacity-0" : "opacity-100")
|
|
6966
|
+
}, /* @__PURE__ */ React6.default.createElement("div", {
|
|
6967
|
+
className: "mt-4 font-bold"
|
|
6968
|
+
}, props.question), /* @__PURE__ */ React6.default.createElement("div", {
|
|
6969
|
+
className: "flex w-full flex-row gap-1 rounded "
|
|
6970
|
+
}, /* @__PURE__ */ React6.default.createElement(HawaRadio, {
|
|
6971
|
+
orientation: "vertical",
|
|
6972
|
+
options: props.options
|
|
6973
|
+
})), /* @__PURE__ */ React6.default.createElement("div", null, /* @__PURE__ */ React6.default.createElement(Textarea, null))), /* @__PURE__ */ React6.default.createElement(Button, {
|
|
6974
|
+
className: "mt-4 w-full"
|
|
6975
|
+
}, "Submit")));
|
|
6976
|
+
};
|
|
6862
6977
|
// src/elements/Carousel.tsx
|
|
6863
6978
|
// src/hooks/useCarousel.ts
|
|
6864
6979
|
var useCarousel = function(imageWidth) {
|
|
@@ -6933,13 +7048,13 @@ var Carousel = function(param) {
|
|
|
6933
7048
|
}));
|
|
6934
7049
|
};
|
|
6935
7050
|
// src/elements/Input.tsx
|
|
6936
|
-
var Input =
|
|
7051
|
+
var Input = React63.forwardRef(function(_param, ref) {
|
|
6937
7052
|
var className = _param.className, preview = _param.preview, type = _param.type, props = _object_without_properties(_param, [
|
|
6938
7053
|
"className",
|
|
6939
7054
|
"preview",
|
|
6940
7055
|
"type"
|
|
6941
7056
|
]);
|
|
6942
|
-
return /* @__PURE__ */
|
|
7057
|
+
return /* @__PURE__ */ React63.createElement("input", _object_spread({
|
|
6943
7058
|
type: type,
|
|
6944
7059
|
className: cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className, preview && " disabled:cursor-default disabled:opacity-100 border-opacity-25 "),
|
|
6945
7060
|
disabled: preview,
|
|
@@ -7022,13 +7137,13 @@ var InterfaceSettings = function(_param) {
|
|
|
7022
7137
|
// src/elements/Popover.tsx
|
|
7023
7138
|
var _reactpopover = require("@radix-ui/react-popover");
|
|
7024
7139
|
var PopoverPrimitive = _interopRequireWildcard(_reactpopover);
|
|
7025
|
-
var PopoverContent =
|
|
7140
|
+
var PopoverContent = React65.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7026
7141
|
var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
|
|
7027
7142
|
"className",
|
|
7028
7143
|
"align",
|
|
7029
7144
|
"sideOffset"
|
|
7030
7145
|
]);
|
|
7031
|
-
return
|
|
7146
|
+
return React65.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React65.createElement(PopoverPrimitive.Content, _object_spread({
|
|
7032
7147
|
ref: ref,
|
|
7033
7148
|
align: align,
|
|
7034
7149
|
sideOffset: sideOffset,
|
|
@@ -7038,7 +7153,7 @@ var PopoverContent = React62.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
|
7038
7153
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
7039
7154
|
var Popover = function(param) {
|
|
7040
7155
|
var trigger = param.trigger, children = param.children, className = param.className, _param_align = param.align, align = _param_align === void 0 ? "center" : _param_align, side = param.side, _param_sideOffset = param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset;
|
|
7041
|
-
return /* @__PURE__ */
|
|
7156
|
+
return /* @__PURE__ */ React65.createElement(PopoverPrimitive.Root, null, /* @__PURE__ */ React65.createElement(PopoverPrimitive.Trigger, null, trigger), /* @__PURE__ */ React65.createElement(PopoverContent, {
|
|
7042
7157
|
side: side,
|
|
7043
7158
|
className: className,
|
|
7044
7159
|
align: align,
|
|
@@ -7048,79 +7163,65 @@ var Popover = function(param) {
|
|
|
7048
7163
|
// src/elements/Tabs.tsx
|
|
7049
7164
|
var _reacttabs = require("@radix-ui/react-tabs");
|
|
7050
7165
|
var TabsPrimitive = _interopRequireWildcard(_reacttabs);
|
|
7051
|
-
var TabsContext =
|
|
7166
|
+
var TabsContext = React66.createContext({
|
|
7052
7167
|
orientation: "vertical"
|
|
7053
7168
|
});
|
|
7054
|
-
var Tabs =
|
|
7169
|
+
var Tabs = React66.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7055
7170
|
var className = _param.className, orientation = _param.orientation, props = _object_without_properties(_param, [
|
|
7056
7171
|
"className",
|
|
7057
7172
|
"orientation"
|
|
7058
7173
|
]);
|
|
7059
|
-
return
|
|
7174
|
+
return React66.createElement(TabsPrimitive.Root, _object_spread({
|
|
7060
7175
|
ref: ref,
|
|
7061
7176
|
className: cn("flex gap-2", orientation === "horizontal" ? "flex-row" : "flex-col", className)
|
|
7062
|
-
}, props), /* @__PURE__ */
|
|
7177
|
+
}, props), /* @__PURE__ */ React66.createElement(TabsContext.Provider, {
|
|
7063
7178
|
value: {
|
|
7064
7179
|
orientation: orientation
|
|
7065
7180
|
}
|
|
7066
7181
|
}, props.children));
|
|
7067
7182
|
});
|
|
7068
7183
|
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
7069
|
-
var TabsList =
|
|
7184
|
+
var TabsList = React66.forwardRef(function(_param, ref) {
|
|
7070
7185
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7071
7186
|
"className"
|
|
7072
7187
|
]);
|
|
7073
|
-
var orientation =
|
|
7074
|
-
return /* @__PURE__ */
|
|
7188
|
+
var orientation = React66.useContext(TabsContext).orientation;
|
|
7189
|
+
return /* @__PURE__ */ React66.createElement(TabsPrimitive.List, _object_spread({
|
|
7075
7190
|
ref: ref,
|
|
7076
7191
|
className: cn("flex w-fit flex-wrap items-center justify-start gap-1 rounded border bg-muted p-1 text-muted-foreground dark:border-primary/10 ", orientation === "horizontal" ? "flex-col" : "flex-row", className)
|
|
7077
7192
|
}, props));
|
|
7078
7193
|
});
|
|
7079
7194
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
7080
|
-
var TabsTrigger =
|
|
7195
|
+
var TabsTrigger = React66.forwardRef(function(_param, ref) {
|
|
7081
7196
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7082
7197
|
"className"
|
|
7083
7198
|
]);
|
|
7084
|
-
return /* @__PURE__ */
|
|
7199
|
+
return /* @__PURE__ */ React66.createElement(TabsPrimitive.Trigger, _object_spread({
|
|
7085
7200
|
ref: ref,
|
|
7086
7201
|
className: cn("inline-flex w-full flex-1 select-none items-center justify-center whitespace-nowrap rounded border px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm dark:border-primary/10", className)
|
|
7087
7202
|
}, props));
|
|
7088
7203
|
});
|
|
7089
7204
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
7090
|
-
var TabsContent =
|
|
7205
|
+
var TabsContent = React66.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7091
7206
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7092
7207
|
"className"
|
|
7093
7208
|
]);
|
|
7094
|
-
return
|
|
7209
|
+
return React66.createElement(TabsPrimitive.Content, _object_spread({
|
|
7095
7210
|
ref: ref,
|
|
7096
7211
|
className: cn("w-full ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className)
|
|
7097
7212
|
}, props));
|
|
7098
7213
|
});
|
|
7099
7214
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
7100
|
-
// src/elements/Textarea.tsx
|
|
7101
|
-
var Textarea = React64.forwardRef(function(_param, ref) {
|
|
7102
|
-
var className = _param.className, label = _param.label, props = _object_without_properties(_param, [
|
|
7103
|
-
"className",
|
|
7104
|
-
"label"
|
|
7105
|
-
]);
|
|
7106
|
-
return /* @__PURE__ */ React64.createElement(React64.Fragment, null, label && /* @__PURE__ */ React64.createElement(Label, {
|
|
7107
|
-
htmlFor: props.id
|
|
7108
|
-
}, label), /* @__PURE__ */ React64.createElement("textarea", _object_spread({
|
|
7109
|
-
className: cn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
7110
|
-
ref: ref
|
|
7111
|
-
}, props)));
|
|
7112
|
-
});
|
|
7113
|
-
Textarea.displayName = "Textarea";
|
|
7114
7215
|
// src/elements/Separator.tsx
|
|
7115
7216
|
var _reactseparator = require("@radix-ui/react-separator");
|
|
7116
7217
|
var SeparatorPrimitive = _interopRequireWildcard(_reactseparator);
|
|
7117
|
-
var Separator3 =
|
|
7218
|
+
var Separator3 = React67.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7118
7219
|
var className = _param.className, _param_orientation = _param.orientation, orientation = _param_orientation === void 0 ? "horizontal" : _param_orientation, _param_decorative = _param.decorative, decorative = _param_decorative === void 0 ? true : _param_decorative, props = _object_without_properties(_param, [
|
|
7119
7220
|
"className",
|
|
7120
7221
|
"orientation",
|
|
7121
7222
|
"decorative"
|
|
7122
7223
|
]);
|
|
7123
|
-
return
|
|
7224
|
+
return React67.createElement(SeparatorPrimitive.Root, _object_spread({
|
|
7124
7225
|
ref: ref,
|
|
7125
7226
|
decorative: decorative,
|
|
7126
7227
|
orientation: orientation,
|
|
@@ -7150,24 +7251,24 @@ var toastVariants = _classvarianceauthority.cva.call(void 0, "group pointer-even
|
|
|
7150
7251
|
}
|
|
7151
7252
|
});
|
|
7152
7253
|
var ToastProvider = ToastPrimitives.Provider;
|
|
7153
|
-
var ToastViewport =
|
|
7254
|
+
var ToastViewport = React68.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7154
7255
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7155
7256
|
"className"
|
|
7156
7257
|
]);
|
|
7157
|
-
return
|
|
7258
|
+
return React68.createElement(ToastPrimitives.Viewport, _object_spread({
|
|
7158
7259
|
ref: ref,
|
|
7159
7260
|
className: cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]", className)
|
|
7160
7261
|
}, props));
|
|
7161
7262
|
});
|
|
7162
7263
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
7163
|
-
var Toast =
|
|
7264
|
+
var Toast = React68.forwardRef(function(_param, ref) {
|
|
7164
7265
|
var className = _param.className, variant = _param.variant, _param_severity = _param.severity, severity = _param_severity === void 0 ? "none" : _param_severity, direction = _param.direction, props = _object_without_properties(_param, [
|
|
7165
7266
|
"className",
|
|
7166
7267
|
"variant",
|
|
7167
7268
|
"severity",
|
|
7168
7269
|
"direction"
|
|
7169
7270
|
]);
|
|
7170
|
-
return /* @__PURE__ */
|
|
7271
|
+
return /* @__PURE__ */ React68.createElement(ToastPrimitives.Root, _object_spread({
|
|
7171
7272
|
ref: ref,
|
|
7172
7273
|
className: cn(toastVariants({
|
|
7173
7274
|
variant: variant,
|
|
@@ -7177,52 +7278,52 @@ var Toast = React66.forwardRef(function(_param, ref) {
|
|
|
7177
7278
|
}, props));
|
|
7178
7279
|
});
|
|
7179
7280
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
7180
|
-
var ToastAction =
|
|
7281
|
+
var ToastAction = React68.forwardRef(function(_param, ref) {
|
|
7181
7282
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7182
7283
|
"className"
|
|
7183
7284
|
]);
|
|
7184
|
-
return /* @__PURE__ */
|
|
7285
|
+
return /* @__PURE__ */ React68.createElement(ToastPrimitives.Action, _object_spread({
|
|
7185
7286
|
ref: ref,
|
|
7186
7287
|
className: cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", "group-[.info]:border-muted/40 group-[.info]:hover:border-info/30 group-[.info]:hover:bg-info group-[.info]:hover:text-info-foreground group-[.info]:focus:ring-info", "group-[.error]:border-muted/40 group-[.error]:hover:border-error/30 group-[.error]:hover:bg-error group-[.error]:hover:text-error-foreground group-[.error]:focus:ring-error", "group-[.success]:border-muted/40 group-[.success]:hover:border-success/30 group-[.success]:hover:bg-success group-[.success]:hover:text-success-foreground group-[.success]:focus:ring-success", "group-[.warning]:border-muted/40 group-[.warning]:hover:border-warning/30 group-[.warning]:hover:bg-warning group-[.warning]:hover:text-warning-foreground group-[.warning]:focus:ring-warning", className)
|
|
7187
7288
|
}, props));
|
|
7188
7289
|
});
|
|
7189
7290
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
7190
|
-
var ToastClose =
|
|
7291
|
+
var ToastClose = React68.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7191
7292
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7192
7293
|
"className"
|
|
7193
7294
|
]);
|
|
7194
|
-
return
|
|
7295
|
+
return React68.createElement(ToastPrimitives.Close, _object_spread({
|
|
7195
7296
|
ref: ref,
|
|
7196
7297
|
className: cn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className),
|
|
7197
7298
|
"toast-close": ""
|
|
7198
|
-
}, props), /* @__PURE__ */
|
|
7299
|
+
}, props), /* @__PURE__ */ React68.createElement("svg", {
|
|
7199
7300
|
"aria-label": "Close Icon",
|
|
7200
7301
|
"aria-hidden": "true",
|
|
7201
7302
|
className: "h-4 w-4",
|
|
7202
7303
|
fill: "currentColor",
|
|
7203
7304
|
viewBox: "0 0 20 20"
|
|
7204
|
-
}, /* @__PURE__ */
|
|
7305
|
+
}, /* @__PURE__ */ React68.createElement("path", {
|
|
7205
7306
|
fillRule: "evenodd",
|
|
7206
7307
|
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
7207
7308
|
clipRule: "evenodd"
|
|
7208
7309
|
})));
|
|
7209
7310
|
});
|
|
7210
7311
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
7211
|
-
var ToastTitle =
|
|
7312
|
+
var ToastTitle = React68.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7212
7313
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7213
7314
|
"className"
|
|
7214
7315
|
]);
|
|
7215
|
-
return
|
|
7316
|
+
return React68.createElement(ToastPrimitives.Title, _object_spread({
|
|
7216
7317
|
ref: ref,
|
|
7217
7318
|
className: cn("text-sm font-semibold", className)
|
|
7218
7319
|
}, props));
|
|
7219
7320
|
});
|
|
7220
7321
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
7221
|
-
var ToastDescription =
|
|
7322
|
+
var ToastDescription = React68.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7222
7323
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7223
7324
|
"className"
|
|
7224
7325
|
]);
|
|
7225
|
-
return
|
|
7326
|
+
return React68.createElement(ToastPrimitives.Description, _object_spread({
|
|
7226
7327
|
ref: ref,
|
|
7227
7328
|
className: cn("text-sm opacity-90", className)
|
|
7228
7329
|
}, props));
|
|
@@ -7340,8 +7441,8 @@ function toast(_param) {
|
|
|
7340
7441
|
};
|
|
7341
7442
|
}
|
|
7342
7443
|
function useToast() {
|
|
7343
|
-
var
|
|
7344
|
-
|
|
7444
|
+
var _React69_useState = _sliced_to_array(React69.useState(memoryState), 2), state = _React69_useState[0], setState = _React69_useState[1];
|
|
7445
|
+
React69.useEffect(function() {
|
|
7345
7446
|
listeners.push(setState);
|
|
7346
7447
|
return function() {
|
|
7347
7448
|
var index = listeners.indexOf(setState);
|
|
@@ -7394,42 +7495,42 @@ var DialogPortal = function(_param) /* @__PURE__ */ {
|
|
|
7394
7495
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7395
7496
|
"className"
|
|
7396
7497
|
]);
|
|
7397
|
-
return
|
|
7498
|
+
return React71.createElement(DialogPrimitive.Portal, _object_spread({
|
|
7398
7499
|
className: cn(className)
|
|
7399
7500
|
}, props));
|
|
7400
7501
|
};
|
|
7401
7502
|
DialogPortal.displayName = DialogPrimitive.Portal.displayName;
|
|
7402
|
-
var DialogOverlay =
|
|
7503
|
+
var DialogOverlay = React71.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7403
7504
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7404
7505
|
"className"
|
|
7405
7506
|
]);
|
|
7406
|
-
return
|
|
7507
|
+
return React71.createElement(DialogPrimitive.Overlay, _object_spread({
|
|
7407
7508
|
ref: ref,
|
|
7408
7509
|
className: cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className)
|
|
7409
7510
|
}, props));
|
|
7410
7511
|
});
|
|
7411
7512
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
7412
|
-
var DialogContent =
|
|
7513
|
+
var DialogContent = React71.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7413
7514
|
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
7414
7515
|
"className",
|
|
7415
7516
|
"children"
|
|
7416
7517
|
]);
|
|
7417
|
-
return
|
|
7518
|
+
return React71.createElement(DialogPortal, null, /* @__PURE__ */ React71.createElement(DialogOverlay, null), /* @__PURE__ */ React71.createElement(DialogPrimitive.Content, _object_spread({
|
|
7418
7519
|
ref: ref,
|
|
7419
7520
|
className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full", className)
|
|
7420
|
-
}, props), children, /* @__PURE__ */
|
|
7521
|
+
}, props), children, /* @__PURE__ */ React71.createElement(DialogPrimitive.Close, {
|
|
7421
7522
|
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
|
|
7422
|
-
}, /* @__PURE__ */
|
|
7523
|
+
}, /* @__PURE__ */ React71.createElement("svg", {
|
|
7423
7524
|
"aria-label": "Close Icon",
|
|
7424
7525
|
"aria-hidden": "true",
|
|
7425
7526
|
className: "h-5 w-5",
|
|
7426
7527
|
fill: "currentColor",
|
|
7427
7528
|
viewBox: "0 0 20 20"
|
|
7428
|
-
}, /* @__PURE__ */
|
|
7529
|
+
}, /* @__PURE__ */ React71.createElement("path", {
|
|
7429
7530
|
fillRule: "evenodd",
|
|
7430
7531
|
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
7431
7532
|
clipRule: "evenodd"
|
|
7432
|
-
})), /* @__PURE__ */
|
|
7533
|
+
})), /* @__PURE__ */ React71.createElement("span", {
|
|
7433
7534
|
className: "sr-only"
|
|
7434
7535
|
}, "Close"))));
|
|
7435
7536
|
});
|
|
@@ -7438,7 +7539,7 @@ var DialogHeader = function(_param) /* @__PURE__ */ {
|
|
|
7438
7539
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7439
7540
|
"className"
|
|
7440
7541
|
]);
|
|
7441
|
-
return
|
|
7542
|
+
return React71.createElement("div", _object_spread({
|
|
7442
7543
|
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className)
|
|
7443
7544
|
}, props));
|
|
7444
7545
|
};
|
|
@@ -7447,26 +7548,26 @@ var DialogFooter = function(_param) /* @__PURE__ */ {
|
|
|
7447
7548
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7448
7549
|
"className"
|
|
7449
7550
|
]);
|
|
7450
|
-
return
|
|
7551
|
+
return React71.createElement("div", _object_spread({
|
|
7451
7552
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
|
|
7452
7553
|
}, props));
|
|
7453
7554
|
};
|
|
7454
7555
|
DialogFooter.displayName = "DialogFooter";
|
|
7455
|
-
var DialogTitle =
|
|
7556
|
+
var DialogTitle = React71.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7456
7557
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7457
7558
|
"className"
|
|
7458
7559
|
]);
|
|
7459
|
-
return
|
|
7560
|
+
return React71.createElement(DialogPrimitive.Title, _object_spread({
|
|
7460
7561
|
ref: ref,
|
|
7461
7562
|
className: cn("text-lg font-semibold leading-none tracking-tight", className)
|
|
7462
7563
|
}, props));
|
|
7463
7564
|
});
|
|
7464
7565
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
7465
|
-
var DialogDescription =
|
|
7566
|
+
var DialogDescription = React71.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7466
7567
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7467
7568
|
"className"
|
|
7468
7569
|
]);
|
|
7469
|
-
return
|
|
7570
|
+
return React71.createElement(DialogPrimitive.Description, _object_spread({
|
|
7470
7571
|
ref: ref,
|
|
7471
7572
|
className: cn("text-sm text-muted-foreground", className)
|
|
7472
7573
|
}, props));
|
|
@@ -7671,28 +7772,28 @@ var _reactaccordion = require("@radix-ui/react-accordion");
|
|
|
7671
7772
|
var AccordionPrimitive = _interopRequireWildcard(_reactaccordion);
|
|
7672
7773
|
var Accordion = AccordionPrimitive.Root;
|
|
7673
7774
|
var triggerStyles = "flex flex-1 items-center select-none cursor-pointer bg-primary-foreground rounded justify-between p-2 px-3 font-medium transition-all [&[data-state=open]>svg]:-rotate-90";
|
|
7674
|
-
var AccordionItem =
|
|
7775
|
+
var AccordionItem = React77.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7675
7776
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
7676
7777
|
"className"
|
|
7677
7778
|
]);
|
|
7678
|
-
return
|
|
7779
|
+
return React77.createElement(AccordionPrimitive.Item, _object_spread({
|
|
7679
7780
|
ref: ref,
|
|
7680
7781
|
className: cn(className)
|
|
7681
7782
|
}, props));
|
|
7682
7783
|
});
|
|
7683
7784
|
AccordionItem.displayName = "AccordionItem";
|
|
7684
|
-
var AccordionTrigger =
|
|
7785
|
+
var AccordionTrigger = React77.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7685
7786
|
var className = _param.className, showArrow = _param.showArrow, children = _param.children, props = _object_without_properties(_param, [
|
|
7686
7787
|
"className",
|
|
7687
7788
|
"showArrow",
|
|
7688
7789
|
"children"
|
|
7689
7790
|
]);
|
|
7690
|
-
return
|
|
7791
|
+
return React77.createElement(AccordionPrimitive.Header, {
|
|
7691
7792
|
className: "flex"
|
|
7692
|
-
}, /* @__PURE__ */
|
|
7793
|
+
}, /* @__PURE__ */ React77.createElement(AccordionPrimitive.Trigger, _object_spread({
|
|
7693
7794
|
ref: ref,
|
|
7694
7795
|
className: cn(triggerStyles, className)
|
|
7695
|
-
}, props), children, showArrow && /* @__PURE__ */
|
|
7796
|
+
}, props), children, showArrow && /* @__PURE__ */ React77.createElement("svg", {
|
|
7696
7797
|
"aria-label": "Chevron Right Icon",
|
|
7697
7798
|
stroke: "currentColor",
|
|
7698
7799
|
fill: "currentColor",
|
|
@@ -7700,29 +7801,29 @@ var AccordionTrigger = React75.forwardRef(function(_param, ref) /* @__PURE__ */
|
|
|
7700
7801
|
height: "1em",
|
|
7701
7802
|
width: "1em",
|
|
7702
7803
|
className: "h-4 w-4 shrink-0 rotate-90 transition-transform duration-200"
|
|
7703
|
-
}, /* @__PURE__ */
|
|
7804
|
+
}, /* @__PURE__ */ React77.createElement("path", {
|
|
7704
7805
|
d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
|
|
7705
7806
|
}))));
|
|
7706
7807
|
});
|
|
7707
7808
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
7708
|
-
var AccordionContent =
|
|
7809
|
+
var AccordionContent = React77.forwardRef(function(_param, ref) /* @__PURE__ */ {
|
|
7709
7810
|
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
7710
7811
|
"className",
|
|
7711
7812
|
"children"
|
|
7712
7813
|
]);
|
|
7713
|
-
return
|
|
7814
|
+
return React77.createElement(AccordionPrimitive.Content, _object_spread({
|
|
7714
7815
|
ref: ref,
|
|
7715
7816
|
className: cn("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", className)
|
|
7716
|
-
}, props), /* @__PURE__ */
|
|
7817
|
+
}, props), /* @__PURE__ */ React77.createElement("div", null, children));
|
|
7717
7818
|
});
|
|
7718
7819
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
7719
7820
|
var SidebarGroup = function(param) {
|
|
7720
7821
|
var title = param.title, items = param.items, selectedItem = param.selectedItem, openedItem = param.openedItem, setOpenedItem = param.setOpenedItem, onItemClick = param.onItemClick, onSubItemClick = param.onSubItemClick, direction = param.direction, isOpen = param.isOpen;
|
|
7721
|
-
return /* @__PURE__ */
|
|
7822
|
+
return /* @__PURE__ */ React77.createElement("div", null, title && /* @__PURE__ */ React77.createElement("h3", {
|
|
7722
7823
|
className: "mb-1 font-bold"
|
|
7723
|
-
}, title), /* @__PURE__ */
|
|
7824
|
+
}, title), /* @__PURE__ */ React77.createElement("ul", {
|
|
7724
7825
|
className: "flex flex-col gap-2"
|
|
7725
|
-
}, /* @__PURE__ */
|
|
7826
|
+
}, /* @__PURE__ */ React77.createElement(Accordion, {
|
|
7726
7827
|
value: openedItem,
|
|
7727
7828
|
type: "single",
|
|
7728
7829
|
onValueChange: function(e) {
|
|
@@ -7731,7 +7832,7 @@ var SidebarGroup = function(param) {
|
|
|
7731
7832
|
collapsible: true,
|
|
7732
7833
|
className: "flex flex-col gap-1"
|
|
7733
7834
|
}, items.map(function(item, idx) {
|
|
7734
|
-
return /* @__PURE__ */
|
|
7835
|
+
return /* @__PURE__ */ React77.createElement(SidebarItem, {
|
|
7735
7836
|
isOpen: isOpen,
|
|
7736
7837
|
isSelected: selectedItem,
|
|
7737
7838
|
key: idx,
|
|
@@ -7748,23 +7849,23 @@ var SidebarItem = function(param) {
|
|
|
7748
7849
|
return isSelected && isSelected[index] === value ? "bg-primary text-primary-foreground cursor-default" : "hover:bg-primary/10";
|
|
7749
7850
|
};
|
|
7750
7851
|
if (item.subitems) {
|
|
7751
|
-
return /* @__PURE__ */
|
|
7852
|
+
return /* @__PURE__ */ React77.createElement(AccordionItem, {
|
|
7752
7853
|
value: item.value,
|
|
7753
7854
|
className: "overflow-x-clip",
|
|
7754
7855
|
dir: direction
|
|
7755
|
-
}, /* @__PURE__ */
|
|
7856
|
+
}, /* @__PURE__ */ React77.createElement(AccordionTrigger, {
|
|
7756
7857
|
className: cn(getSelectedStyle(item.value, 0)),
|
|
7757
7858
|
showArrow: isOpen
|
|
7758
|
-
}, /* @__PURE__ */
|
|
7859
|
+
}, /* @__PURE__ */ React77.createElement("div", {
|
|
7759
7860
|
className: cn(!isOpen && "py-1", "flex w-fit flex-row items-center gap-2")
|
|
7760
|
-
}, item.icon, isOpen && /* @__PURE__ */
|
|
7861
|
+
}, item.icon, isOpen && /* @__PURE__ */ React77.createElement("span", {
|
|
7761
7862
|
className: cn("transition-all ", isOpen ? "opacity-100" : "opacity-0")
|
|
7762
|
-
}, item.label))), item.subitems && /* @__PURE__ */
|
|
7863
|
+
}, item.label))), item.subitems && /* @__PURE__ */ React77.createElement(AccordionContent, {
|
|
7763
7864
|
className: " mt-1 h-full rounded "
|
|
7764
|
-
}, /* @__PURE__ */
|
|
7865
|
+
}, /* @__PURE__ */ React77.createElement("div", {
|
|
7765
7866
|
className: cn("flex h-full flex-col gap-2 bg-foreground/5 p-1")
|
|
7766
7867
|
}, item.subitems.map(function(subitem, idx) {
|
|
7767
|
-
return /* @__PURE__ */
|
|
7868
|
+
return /* @__PURE__ */ React77.createElement("li", {
|
|
7768
7869
|
key: idx,
|
|
7769
7870
|
onClick: function(e) {
|
|
7770
7871
|
e.stopPropagation();
|
|
@@ -7779,7 +7880,7 @@ var SidebarItem = function(param) {
|
|
|
7779
7880
|
}, subitem.icon, subitem.label);
|
|
7780
7881
|
}))));
|
|
7781
7882
|
} else {
|
|
7782
|
-
return /* @__PURE__ */
|
|
7883
|
+
return /* @__PURE__ */ React77.createElement("div", {
|
|
7783
7884
|
dir: direction,
|
|
7784
7885
|
onClick: function() {
|
|
7785
7886
|
if (onItemClick) {
|
|
@@ -7789,9 +7890,9 @@ var SidebarItem = function(param) {
|
|
|
7789
7890
|
}
|
|
7790
7891
|
},
|
|
7791
7892
|
className: cn(triggerStyles, getSelectedStyle(item.value, 0), "overflow-x-clip ")
|
|
7792
|
-
}, /* @__PURE__ */
|
|
7893
|
+
}, /* @__PURE__ */ React77.createElement("div", {
|
|
7793
7894
|
className: "flex flex-row items-center gap-2 "
|
|
7794
|
-
}, item.icon, /* @__PURE__ */
|
|
7895
|
+
}, item.icon, /* @__PURE__ */ React77.createElement("span", {
|
|
7795
7896
|
className: cn("whitespace-nowrap transition-all", isOpen ? "opacity-100" : "opacity-0")
|
|
7796
7897
|
}, item.label)));
|
|
7797
7898
|
}
|
|
@@ -10441,8 +10542,48 @@ var SelectPayment = function(props) {
|
|
|
10441
10542
|
};
|
|
10442
10543
|
// src/blocks/Payment/CreditCardForm.tsx
|
|
10443
10544
|
var CreditCardForm = function(props) {
|
|
10545
|
+
var _react_useState_call = _sliced_to_array(_react.useState.call(void 0, ""), 2), cardNumber = _react_useState_call[0], setCardNumber = _react_useState_call[1];
|
|
10546
|
+
var _react_useState_call1 = _sliced_to_array(_react.useState.call(void 0, ""), 2), cardType = _react_useState_call1[0], setCardType = _react_useState_call1[1];
|
|
10444
10547
|
var methods = _reacthookform.useForm.call(void 0);
|
|
10445
10548
|
var errors = methods.formState.errors, handleSubmit = methods.handleSubmit, control = methods.control;
|
|
10549
|
+
var getCardType = function(card_bin) {
|
|
10550
|
+
var visa_regex = /^4[0-9]{0,15}$/m;
|
|
10551
|
+
var mastercard_regex = /^5$|^5[0-5][0-9]{0,16}$/m;
|
|
10552
|
+
var amex_regex = /^3$|^3[47][0-9]{0,13}$/m;
|
|
10553
|
+
var mada_regex = /^(440647|440795|446404|457865|968208|457997|474491|636120|417633|468540|468541|468542|468543|968201|446393|409201|458456|484783|462220|455708|410621|455036|486094|486095|486096|504300|440533|489318|489319|445564|968211|410685|406996|432328|428671|428672|428673|968206|446672|543357|434107|407197|407395|412565|431361|604906|521076|529415|535825|543085|524130|554180|549760|968209|524514|529741|537767|535989|536023|513213|520058|558563|588982|589005|531095|530906|532013|968204|422817|422818|422819|428331|483010|483011|483012|589206|968207|419593|439954|530060|531196|420132)/;
|
|
10554
|
+
var meeza_regex = /^507803[0-6][0-9]|507808[3-9][0-9]|507809[0-9][0-9]|507810[0-2][0-9]/;
|
|
10555
|
+
var card_type = "visa";
|
|
10556
|
+
if (card_bin.replace(/[^\d]/g, "").match(mada_regex)) {
|
|
10557
|
+
card_type = "mada";
|
|
10558
|
+
} else if (card_bin.replace(/[^\d]/g, "").match(meeza_regex)) {
|
|
10559
|
+
card_type = "meeza";
|
|
10560
|
+
} else if (card_bin.replace(/[^\d]/g, "").match(visa_regex)) {
|
|
10561
|
+
card_type = "visa";
|
|
10562
|
+
} else if (card_bin.replace(/[^\d]/g, "").match(mastercard_regex)) {
|
|
10563
|
+
card_type = "mastercard";
|
|
10564
|
+
} else if (card_bin.replace(/[^\d]/g, "").match(amex_regex)) {
|
|
10565
|
+
card_type = "amex";
|
|
10566
|
+
}
|
|
10567
|
+
return card_type;
|
|
10568
|
+
};
|
|
10569
|
+
var onCardNumberChange = function(event) {
|
|
10570
|
+
var _event_target = event.target, value = _event_target.value, name = _event_target.name;
|
|
10571
|
+
var cardNumber2 = value;
|
|
10572
|
+
value = value.replace(/\D/g, "");
|
|
10573
|
+
if (/^3[47]\d{0,13}$/.test(value)) {
|
|
10574
|
+
cardNumber2 = value.replace(/(\d{4})/, "$1 ").replace(/(\d{4}) (\d{6})/, "$1 $2 ");
|
|
10575
|
+
} else if (/^3(?:0[0-5]|[68]\d)\d{0,11}$/.test(value)) {
|
|
10576
|
+
cardNumber2 = value.replace(/(\d{4})/, "$1 ").replace(/(\d{4}) (\d{6})/, "$1 $2 ");
|
|
10577
|
+
} else if (/^\d{0,16}$/.test(value)) {
|
|
10578
|
+
cardNumber2 = value.replace(/(\d{4})/, "$1 ").replace(/(\d{4}) (\d{4})/, "$1 $2 ").replace(/(\d{4}) (\d{4}) (\d{4})/, "$1 $2 $3 ");
|
|
10579
|
+
}
|
|
10580
|
+
console.log("card number is ", cardNumber2.trimRight());
|
|
10581
|
+
setCardNumber(cardNumber2.trimRight());
|
|
10582
|
+
};
|
|
10583
|
+
_react.useEffect.call(void 0, function() {
|
|
10584
|
+
var cardTypeSlug = getCardType(cardNumber);
|
|
10585
|
+
setCardType(cardTypeSlug);
|
|
10586
|
+
});
|
|
10446
10587
|
return /* @__PURE__ */ React6.default.createElement(Card, null, /* @__PURE__ */ React6.default.createElement("form", {
|
|
10447
10588
|
onSubmit: handleSubmit(props.handle)
|
|
10448
10589
|
}, /* @__PURE__ */ React6.default.createElement(CardContent, {
|
|
@@ -10451,7 +10592,7 @@ var CreditCardForm = function(props) {
|
|
|
10451
10592
|
className: "flex flex-row gap-4"
|
|
10452
10593
|
}, /* @__PURE__ */ React6.default.createElement(_reacthookform.Controller, {
|
|
10453
10594
|
control: control,
|
|
10454
|
-
name: "
|
|
10595
|
+
name: "cardNumber",
|
|
10455
10596
|
render: function(param) {
|
|
10456
10597
|
var field = param.field;
|
|
10457
10598
|
return /* @__PURE__ */ React6.default.createElement(HawaTextField, {
|
|
@@ -10459,6 +10600,7 @@ var CreditCardForm = function(props) {
|
|
|
10459
10600
|
name: "cardNumber",
|
|
10460
10601
|
placeholder: "1234 1234 1234 1234",
|
|
10461
10602
|
type: "number",
|
|
10603
|
+
onChange: onCardNumberChange,
|
|
10462
10604
|
label: "Card Number",
|
|
10463
10605
|
helpertext: _optionalChain([
|
|
10464
10606
|
errors,
|
|
@@ -10470,7 +10612,12 @@ var CreditCardForm = function(props) {
|
|
|
10470
10612
|
function(_244) {
|
|
10471
10613
|
return _244.message;
|
|
10472
10614
|
}
|
|
10473
|
-
])
|
|
10615
|
+
]),
|
|
10616
|
+
iconInside: /* @__PURE__ */ React6.default.createElement("img", {
|
|
10617
|
+
src: "https://sikka-images.s3.ap-southeast-1.amazonaws.com/payment-symbols/borderless/".concat(cardType, ".png"),
|
|
10618
|
+
alt: "",
|
|
10619
|
+
className: "h-8"
|
|
10620
|
+
})
|
|
10474
10621
|
});
|
|
10475
10622
|
},
|
|
10476
10623
|
rules: {
|
|
@@ -11958,6 +12105,7 @@ exports.SignInForm = SignInForm;
|
|
|
11958
12105
|
exports.SignInPhone = SignInPhone;
|
|
11959
12106
|
exports.SignUpForm = SignUpForm;
|
|
11960
12107
|
exports.Skeleton = Skeleton;
|
|
12108
|
+
exports.StickyFeatures = StickyFeatures;
|
|
11961
12109
|
exports.SubsectionList = SubsectionList;
|
|
11962
12110
|
exports.Switch = Switch;
|
|
11963
12111
|
exports.Tabs = Tabs;
|
|
@@ -11979,6 +12127,7 @@ exports.Tooltip = Tooltip;
|
|
|
11979
12127
|
exports.UsageCard = UsageCard;
|
|
11980
12128
|
exports.UserFeedback = UserFeedback;
|
|
11981
12129
|
exports.UserProfileForm = UserProfileForm;
|
|
12130
|
+
exports.UserReferralSource = UserReferralSource;
|
|
11982
12131
|
exports.UserSettingsForm = UserSettingsForm;
|
|
11983
12132
|
exports.buttonVariants = buttonVariants;
|
|
11984
12133
|
exports.reducer = reducer;
|