@deepnoid/ui 0.1.109 → 0.1.110
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/.turbo/turbo-build.log +446 -466
- package/dist/chunk-CV6IVDL6.mjs +356 -0
- package/dist/{chunk-2EECKYM4.mjs → chunk-YCLB7ZNK.mjs} +1 -1
- package/dist/{chunk-7VS6YXNB.mjs → chunk-ZWLRSZTC.mjs} +2 -2
- package/dist/components/charts/circularProgress.js +2 -2
- package/dist/components/charts/circularProgress.mjs +1 -1
- package/dist/components/charts/index.js +2 -2
- package/dist/components/charts/index.mjs +1 -1
- package/dist/components/picker/index.d.mts +4 -0
- package/dist/components/picker/index.d.ts +4 -0
- package/dist/components/{dateTimePicker/calendar.js → picker/index.js} +716 -173
- package/dist/components/{dateTimePicker/calendar.mjs → picker/index.mjs} +7 -6
- package/dist/components/picker/timePicker.d.mts +251 -0
- package/dist/components/picker/timePicker.d.ts +251 -0
- package/dist/components/{dateTimePicker/dateTimePicker.js → picker/timePicker.js} +617 -904
- package/dist/components/{dateTimePicker → picker}/timePicker.mjs +7 -6
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.mjs +1 -1
- package/dist/components/table/index.mjs +3 -3
- package/dist/components/table/table-body.mjs +3 -3
- package/dist/components/table/table-head.mjs +3 -3
- package/dist/components/table/table.mjs +3 -3
- package/dist/components/toast/index.mjs +2 -2
- package/dist/components/toast/use-toast.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +383 -777
- package/dist/index.mjs +41 -45
- package/package.json +1 -1
- package/dist/chunk-FWJ2ZKH6.mjs +0 -87
- package/dist/chunk-P732YGHO.mjs +0 -18
- package/dist/chunk-X5XJWJSO.mjs +0 -122
- package/dist/chunk-Y4W76B42.mjs +0 -210
- package/dist/chunk-ZSQQFMEC.mjs +0 -366
- package/dist/components/dateTimePicker/calendar.d.mts +0 -68
- package/dist/components/dateTimePicker/calendar.d.ts +0 -68
- package/dist/components/dateTimePicker/dateTimePicker.d.mts +0 -288
- package/dist/components/dateTimePicker/dateTimePicker.d.ts +0 -288
- package/dist/components/dateTimePicker/dateTimePicker.mjs +0 -23
- package/dist/components/dateTimePicker/index.d.mts +0 -4
- package/dist/components/dateTimePicker/index.d.ts +0 -4
- package/dist/components/dateTimePicker/index.js +0 -6040
- package/dist/components/dateTimePicker/index.mjs +0 -22
- package/dist/components/dateTimePicker/timePicker.d.mts +0 -11
- package/dist/components/dateTimePicker/timePicker.d.ts +0 -11
- package/dist/components/dateTimePicker/timePicker.js +0 -5417
- package/dist/components/dateTimePicker/useDateTimePicker.d.mts +0 -34
- package/dist/components/dateTimePicker/useDateTimePicker.d.ts +0 -34
- package/dist/components/dateTimePicker/useDateTimePicker.js +0 -117
- package/dist/components/dateTimePicker/useDateTimePicker.mjs +0 -9
- package/dist/components/dateTimePicker/util.d.mts +0 -4
- package/dist/components/dateTimePicker/util.d.ts +0 -4
- package/dist/components/dateTimePicker/util.js +0 -42
- package/dist/components/dateTimePicker/util.mjs +0 -10
- package/dist/{chunk-75HLCORR.mjs → chunk-BG7VAVOX.mjs} +0 -0
- package/dist/{chunk-2OK3VF75.mjs → chunk-U3O7RIXM.mjs} +3 -3
- package/dist/{chunk-IQYWSATB.mjs → chunk-X67ELNP6.mjs} +3 -3
|
@@ -99,14 +99,16 @@ var require_plugin = __commonJS({
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
// src/components/
|
|
103
|
-
var
|
|
104
|
-
__export(
|
|
105
|
-
|
|
106
|
-
default: () => calendar_default
|
|
102
|
+
// src/components/picker/index.ts
|
|
103
|
+
var picker_exports = {};
|
|
104
|
+
__export(picker_exports, {
|
|
105
|
+
TimePicker: () => timePicker_default
|
|
107
106
|
});
|
|
108
|
-
module.exports = __toCommonJS(
|
|
109
|
-
|
|
107
|
+
module.exports = __toCommonJS(picker_exports);
|
|
108
|
+
|
|
109
|
+
// src/components/picker/timePicker.tsx
|
|
110
|
+
var import_react2 = require("react");
|
|
111
|
+
var import_react_dom2 = require("react-dom");
|
|
110
112
|
|
|
111
113
|
// src/utils/tailwind-variants.ts
|
|
112
114
|
var import_tailwind_variants = require("tailwind-variants");
|
|
@@ -5010,201 +5012,742 @@ var Icon = ({ name, size = "md", fill = false, className, onClick, ...props }) =
|
|
|
5010
5012
|
};
|
|
5011
5013
|
var Icon_default = Icon;
|
|
5012
5014
|
|
|
5013
|
-
// src/components/
|
|
5014
|
-
var
|
|
5015
|
-
|
|
5016
|
-
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
5017
|
-
const day = String(date.getDate()).padStart(2, "0");
|
|
5018
|
-
return `${year}-${month}-${day}`;
|
|
5019
|
-
};
|
|
5020
|
-
var formatStringToDate = (date) => {
|
|
5021
|
-
const formattedDate = new Date(date);
|
|
5022
|
-
return formattedDate;
|
|
5023
|
-
};
|
|
5015
|
+
// src/components/select/select.tsx
|
|
5016
|
+
var import_react = require("react");
|
|
5017
|
+
var import_react_dom = require("react-dom");
|
|
5024
5018
|
|
|
5025
|
-
// src/
|
|
5019
|
+
// src/utils/clsx.ts
|
|
5020
|
+
function clsx(...args) {
|
|
5021
|
+
var i = 0, tmp, x, str = "";
|
|
5022
|
+
while (i < args.length) {
|
|
5023
|
+
if (tmp = args[i++]) {
|
|
5024
|
+
if (x = toVal(tmp)) {
|
|
5025
|
+
str && (str += " ");
|
|
5026
|
+
str += x;
|
|
5027
|
+
}
|
|
5028
|
+
}
|
|
5029
|
+
}
|
|
5030
|
+
return str;
|
|
5031
|
+
}
|
|
5032
|
+
function toVal(mix) {
|
|
5033
|
+
var k, y, str = "";
|
|
5034
|
+
if (typeof mix === "string" || typeof mix === "number") {
|
|
5035
|
+
str += mix;
|
|
5036
|
+
} else if (typeof mix === "object") {
|
|
5037
|
+
if (Array.isArray(mix)) {
|
|
5038
|
+
var len = mix.length;
|
|
5039
|
+
for (k = 0; k < len; k++) {
|
|
5040
|
+
if (mix[k]) {
|
|
5041
|
+
if (y = toVal(mix[k])) {
|
|
5042
|
+
str && (str += " ");
|
|
5043
|
+
str += y;
|
|
5044
|
+
}
|
|
5045
|
+
}
|
|
5046
|
+
}
|
|
5047
|
+
} else {
|
|
5048
|
+
for (y in mix) {
|
|
5049
|
+
if (mix[y]) {
|
|
5050
|
+
str && (str += " ");
|
|
5051
|
+
str += y;
|
|
5052
|
+
}
|
|
5053
|
+
}
|
|
5054
|
+
}
|
|
5055
|
+
}
|
|
5056
|
+
return str;
|
|
5057
|
+
}
|
|
5058
|
+
|
|
5059
|
+
// src/components/select/select.tsx
|
|
5026
5060
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
5027
|
-
var
|
|
5028
|
-
|
|
5029
|
-
const
|
|
5030
|
-
const
|
|
5031
|
-
|
|
5061
|
+
var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
5062
|
+
var _a, _b;
|
|
5063
|
+
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
5064
|
+
const {
|
|
5065
|
+
label,
|
|
5066
|
+
options,
|
|
5067
|
+
helperMessage,
|
|
5068
|
+
errorMessage,
|
|
5069
|
+
classNames,
|
|
5070
|
+
defaultSelectedOptions,
|
|
5071
|
+
onChange,
|
|
5072
|
+
multiple,
|
|
5073
|
+
...inputProps
|
|
5074
|
+
} = props;
|
|
5075
|
+
const slots = (0, import_react.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
5076
|
+
const [selectedOptions, setSelectedOptions] = (0, import_react.useState)(defaultSelectedOptions || []);
|
|
5077
|
+
const [targetRect, setTargetRect] = (0, import_react.useState)(null);
|
|
5078
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react.useState)(0);
|
|
5079
|
+
const [isVisible, setIsVisible] = (0, import_react.useState)(false);
|
|
5080
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
5081
|
+
const selectWrapperRef = (0, import_react.useRef)(null);
|
|
5082
|
+
const optionWrapperRef = (0, import_react.useRef)(null);
|
|
5083
|
+
const handleToggleSelect = () => {
|
|
5084
|
+
if (isOpen) {
|
|
5085
|
+
setIsOpen(false);
|
|
5086
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
5087
|
+
} else {
|
|
5088
|
+
if (selectWrapperRef.current) {
|
|
5089
|
+
const rect = selectWrapperRef.current.getBoundingClientRect();
|
|
5090
|
+
setTargetRect(rect);
|
|
5091
|
+
setIsVisible(true);
|
|
5092
|
+
requestAnimationFrame(() => setIsOpen(true));
|
|
5093
|
+
}
|
|
5094
|
+
}
|
|
5095
|
+
};
|
|
5096
|
+
const calculatePositionWithScroll = (rect, height) => {
|
|
5097
|
+
const scrollTop = window.scrollY;
|
|
5098
|
+
const scrollLeft = window.scrollX;
|
|
5099
|
+
const spaceBelow = window.innerHeight - (rect.y + rect.height + 4);
|
|
5100
|
+
const spaceAbove = rect.y - 4;
|
|
5101
|
+
const top = spaceBelow < height && spaceAbove > height ? rect.y - height - 4 : rect.y + rect.height + 4;
|
|
5102
|
+
return {
|
|
5103
|
+
top: top + scrollTop,
|
|
5104
|
+
left: rect.x + scrollLeft
|
|
5105
|
+
};
|
|
5106
|
+
};
|
|
5107
|
+
const handleChangeOption = (option) => {
|
|
5108
|
+
let nextOptions;
|
|
5109
|
+
if (multiple) {
|
|
5110
|
+
const exists = selectedOptions.some((o) => o.value === option.value);
|
|
5111
|
+
nextOptions = exists ? selectedOptions.filter((o) => o.value !== option.value) : [...selectedOptions, option];
|
|
5112
|
+
} else {
|
|
5113
|
+
nextOptions = [option];
|
|
5114
|
+
setIsOpen(false);
|
|
5115
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
5116
|
+
}
|
|
5117
|
+
setSelectedOptions(nextOptions);
|
|
5118
|
+
onChange == null ? void 0 : onChange(nextOptions);
|
|
5119
|
+
};
|
|
5120
|
+
(0, import_react.useEffect)(() => {
|
|
5121
|
+
const handleClickOutside = (e) => {
|
|
5122
|
+
var _a2;
|
|
5123
|
+
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target) && !((_a2 = selectWrapperRef.current) == null ? void 0 : _a2.contains(e.target))) {
|
|
5124
|
+
setIsOpen(false);
|
|
5125
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
5126
|
+
}
|
|
5127
|
+
};
|
|
5128
|
+
window.addEventListener("mousedown", handleClickOutside);
|
|
5129
|
+
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
5130
|
+
}, []);
|
|
5032
5131
|
(0, import_react.useEffect)(() => {
|
|
5033
|
-
if (
|
|
5034
|
-
|
|
5132
|
+
if (optionWrapperRef.current) {
|
|
5133
|
+
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
5035
5134
|
}
|
|
5036
|
-
}, [
|
|
5037
|
-
const
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5135
|
+
}, [targetRect]);
|
|
5136
|
+
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
5137
|
+
const displayValue = multiple ? selectedOptions.map((opt) => opt.label).join(", ") : ((_a = selectedOptions[0]) == null ? void 0 : _a.label) || "";
|
|
5138
|
+
const selectedValue = multiple ? selectedOptions.map((opt) => opt.value).join(", ") : ((_b = selectedOptions[0]) == null ? void 0 : _b.value) || "";
|
|
5139
|
+
const Option = ({
|
|
5140
|
+
option,
|
|
5141
|
+
isSelected,
|
|
5142
|
+
onClick
|
|
5143
|
+
}) => {
|
|
5144
|
+
const slot = select({ ...variantProps, isSelected });
|
|
5145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
5146
|
+
"div",
|
|
5147
|
+
{
|
|
5148
|
+
role: "option",
|
|
5149
|
+
title: option.label,
|
|
5150
|
+
onClick,
|
|
5151
|
+
className: clsx(slot.option({ class: classNames == null ? void 0 : classNames.option })),
|
|
5152
|
+
children: [
|
|
5153
|
+
option.label,
|
|
5154
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "check", size: originalProps.size })
|
|
5155
|
+
]
|
|
5156
|
+
}
|
|
5157
|
+
);
|
|
5158
|
+
};
|
|
5159
|
+
const isControlled = originalProps.value !== void 0;
|
|
5160
|
+
(0, import_react.useEffect)(() => {
|
|
5161
|
+
if (isControlled) {
|
|
5162
|
+
const valueArray = Array.isArray(originalProps.value) ? originalProps.value : [originalProps.value];
|
|
5163
|
+
const matchedOptions = options.filter((opt) => valueArray.includes(opt.value));
|
|
5164
|
+
setSelectedOptions(matchedOptions);
|
|
5165
|
+
}
|
|
5166
|
+
}, [originalProps.value, options]);
|
|
5167
|
+
(0, import_react.useEffect)(() => {
|
|
5168
|
+
if (!isControlled && defaultSelectedOptions) {
|
|
5169
|
+
setSelectedOptions(defaultSelectedOptions);
|
|
5170
|
+
}
|
|
5171
|
+
}, [defaultSelectedOptions]);
|
|
5172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
5174
|
+
"div",
|
|
5175
|
+
{
|
|
5176
|
+
className: clsx(
|
|
5177
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
5178
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
5179
|
+
),
|
|
5180
|
+
children: [
|
|
5181
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
5182
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
5183
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
5184
|
+
"div",
|
|
5185
|
+
{
|
|
5186
|
+
"data-expanded": isOpen,
|
|
5187
|
+
className: clsx(
|
|
5188
|
+
slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
5189
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
5190
|
+
),
|
|
5191
|
+
ref: selectWrapperRef,
|
|
5192
|
+
onClick: handleToggleSelect,
|
|
5193
|
+
children: [
|
|
5194
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
5195
|
+
"input",
|
|
5196
|
+
{
|
|
5197
|
+
...inputProps,
|
|
5198
|
+
ref,
|
|
5199
|
+
className: clsx(
|
|
5200
|
+
slots.select({ class: classNames == null ? void 0 : classNames.select }),
|
|
5201
|
+
inputProps.readOnly ? "!placeholder:text-body-foreground" : ""
|
|
5202
|
+
),
|
|
5203
|
+
name: void 0,
|
|
5204
|
+
value: displayValue,
|
|
5205
|
+
readOnly: true,
|
|
5206
|
+
size: 0
|
|
5207
|
+
}
|
|
5208
|
+
),
|
|
5209
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { type: "hidden", name: inputProps.name, value: selectedValue }),
|
|
5210
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
5211
|
+
Icon_default,
|
|
5212
|
+
{
|
|
5213
|
+
name: "brace-up",
|
|
5214
|
+
size: originalProps.size,
|
|
5215
|
+
className: `transition-transform duration-200 ${isOpen ? "rotate-0" : "rotate-180"}`
|
|
5216
|
+
}
|
|
5217
|
+
)
|
|
5218
|
+
]
|
|
5219
|
+
}
|
|
5220
|
+
),
|
|
5221
|
+
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }), children: helperMessage }),
|
|
5222
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
5223
|
+
] })
|
|
5224
|
+
]
|
|
5225
|
+
}
|
|
5226
|
+
),
|
|
5227
|
+
isVisible && (0, import_react_dom.createPortal)(
|
|
5228
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
5229
|
+
"div",
|
|
5230
|
+
{
|
|
5231
|
+
ref: optionWrapperRef,
|
|
5232
|
+
role: "listbox",
|
|
5233
|
+
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
5234
|
+
style: {
|
|
5235
|
+
position: "absolute",
|
|
5236
|
+
top: position == null ? void 0 : position.top,
|
|
5237
|
+
left: position == null ? void 0 : position.left,
|
|
5238
|
+
width: targetRect == null ? void 0 : targetRect.width,
|
|
5239
|
+
zIndex: 1e3,
|
|
5240
|
+
opacity: isOpen ? 1 : 0,
|
|
5241
|
+
transform: isOpen ? "translateY(0)" : "translateY(-0.25rem)",
|
|
5242
|
+
transition: "opacity 150ms ease-out, transform 150ms ease-out"
|
|
5243
|
+
},
|
|
5244
|
+
children: options.map((option) => {
|
|
5245
|
+
const isSelected = selectedOptions.some((o) => o.value === option.value);
|
|
5246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
5247
|
+
Option,
|
|
5248
|
+
{
|
|
5249
|
+
option,
|
|
5250
|
+
isSelected,
|
|
5251
|
+
onClick: () => handleChangeOption(option)
|
|
5252
|
+
},
|
|
5253
|
+
option.value
|
|
5254
|
+
);
|
|
5255
|
+
})
|
|
5256
|
+
}
|
|
5257
|
+
),
|
|
5258
|
+
document.body
|
|
5259
|
+
)
|
|
5260
|
+
] });
|
|
5261
|
+
});
|
|
5262
|
+
Select.displayName = "Select";
|
|
5263
|
+
var select_default = Select;
|
|
5264
|
+
var select = tv({
|
|
5265
|
+
slots: {
|
|
5266
|
+
base: ["group/select", "flex"],
|
|
5267
|
+
vertical: ["flex-col"],
|
|
5268
|
+
horizon: ["flex-row", "gap-0"],
|
|
5269
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
5270
|
+
wrapper: ["flex", "flex-col"],
|
|
5271
|
+
selectWrapper: [
|
|
5272
|
+
"flex",
|
|
5273
|
+
"items-center",
|
|
5274
|
+
"justify-between",
|
|
5275
|
+
"border",
|
|
5276
|
+
"cursor-pointer",
|
|
5277
|
+
"text-neutral-main",
|
|
5278
|
+
"hover:bg-trans-soft",
|
|
5279
|
+
"group-has-[p.error]/select:border-danger-main",
|
|
5280
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
5281
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
5282
|
+
"group-has-[p.error]/select:hover:bg-danger-soft"
|
|
5283
|
+
],
|
|
5284
|
+
select: [
|
|
5285
|
+
"bg-transparent",
|
|
5286
|
+
"w-full",
|
|
5287
|
+
"outline-none",
|
|
5288
|
+
"placeholder:text-neutral-main",
|
|
5289
|
+
"text-body-foreground",
|
|
5290
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
5291
|
+
"group-has-[p.error]/select:placeholder:text-danger-main"
|
|
5292
|
+
],
|
|
5293
|
+
optionsWrapper: ["border", "rounded", "bg-body-background", "shadow", "overflow-auto"],
|
|
5294
|
+
option: ["flex", "justify-between", "items-center", "cursor-pointer"],
|
|
5295
|
+
helperMessage: ["text-neutral-main"],
|
|
5296
|
+
errorMessage: ["text-danger-main"],
|
|
5297
|
+
readonly: ["pointer-events-none", "!bg-trans-soft"]
|
|
5298
|
+
},
|
|
5299
|
+
variants: {
|
|
5300
|
+
color: {
|
|
5301
|
+
primary: {
|
|
5302
|
+
selectWrapper: ["text-primary-main"],
|
|
5303
|
+
option: ["hover:bg-primary-soft", "hover:text-primary-main"],
|
|
5304
|
+
helperMessage: ["text-primary-main"]
|
|
5305
|
+
},
|
|
5306
|
+
secondary: {
|
|
5307
|
+
selectWrapper: ["text-secondary-main"],
|
|
5308
|
+
option: ["hover:bg-secondary-soft", "hover:text-secondary-main"],
|
|
5309
|
+
helperMessage: ["text-secondary-main"]
|
|
5310
|
+
}
|
|
5311
|
+
},
|
|
5312
|
+
size: {
|
|
5313
|
+
sm: {
|
|
5314
|
+
base: ["text-sm", "gap-[4px]"],
|
|
5315
|
+
label: ["text-sm"],
|
|
5316
|
+
wrapper: ["gap-[4px]"],
|
|
5317
|
+
selectWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
|
|
5318
|
+
select: ["text-sm"],
|
|
5319
|
+
option: ["px-[4px]", "py-[3px]", "text-sm"],
|
|
5320
|
+
helperMessage: ["text-sm"],
|
|
5321
|
+
errorMessage: ["text-sm"]
|
|
5322
|
+
},
|
|
5323
|
+
md: {
|
|
5324
|
+
base: ["text-md", "gap-[6px]", "rounded-md"],
|
|
5325
|
+
label: ["text-md"],
|
|
5326
|
+
wrapper: ["gap-[6px]"],
|
|
5327
|
+
selectWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
|
|
5328
|
+
select: ["text-md"],
|
|
5329
|
+
option: ["px-[6px]", "py-[5.5px]", "text-md"],
|
|
5330
|
+
helperMessage: ["text-sm"],
|
|
5331
|
+
errorMessage: ["text-sm"]
|
|
5332
|
+
},
|
|
5333
|
+
lg: {
|
|
5334
|
+
base: ["text-lg", "gap-[8px]"],
|
|
5335
|
+
label: ["text-lg"],
|
|
5336
|
+
wrapper: ["gap-[8px]"],
|
|
5337
|
+
selectWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
|
|
5338
|
+
select: ["text-lg"],
|
|
5339
|
+
option: ["px-[8px]", "py-[8px]", "text-lg"],
|
|
5340
|
+
helperMessage: ["text-md"],
|
|
5341
|
+
errorMessage: ["text-md"]
|
|
5342
|
+
},
|
|
5343
|
+
xl: {
|
|
5344
|
+
base: ["text-xl", "gap-[10px]"],
|
|
5345
|
+
label: ["text-xl"],
|
|
5346
|
+
wrapper: ["gap-[10px]"],
|
|
5347
|
+
selectWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
|
|
5348
|
+
select: ["text-xl"],
|
|
5349
|
+
option: ["px-[10px]", "py-[11.5px]"],
|
|
5350
|
+
helperMessage: ["text-md"],
|
|
5351
|
+
errorMessage: ["text-md"]
|
|
5352
|
+
}
|
|
5353
|
+
},
|
|
5354
|
+
direction: {
|
|
5355
|
+
vertical: "",
|
|
5356
|
+
horizon: ""
|
|
5357
|
+
},
|
|
5358
|
+
full: {
|
|
5359
|
+
true: {
|
|
5360
|
+
base: ["w-full"],
|
|
5361
|
+
wrapper: ["w-full"],
|
|
5362
|
+
selectWrapper: ["w-full"]
|
|
5363
|
+
}
|
|
5364
|
+
},
|
|
5365
|
+
disabled: {
|
|
5366
|
+
true: {
|
|
5367
|
+
base: ["pointer-events-none"],
|
|
5368
|
+
selectWrapper: [
|
|
5369
|
+
"bg-neutral-soft",
|
|
5370
|
+
"border-neutral-light",
|
|
5371
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
5372
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
5373
|
+
"group-has-[p.error]/select:border-danger-light"
|
|
5374
|
+
],
|
|
5375
|
+
select: [
|
|
5376
|
+
"text-neutral-light",
|
|
5377
|
+
"placeholder:text-neutral-light",
|
|
5378
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
5379
|
+
"group-has-[p.error]/select:placeholder:text-danger-light"
|
|
5380
|
+
],
|
|
5381
|
+
helperMessage: ["!text-neutral-light"],
|
|
5382
|
+
errorMessage: ["!text-danger-light"]
|
|
5383
|
+
}
|
|
5384
|
+
},
|
|
5385
|
+
isSelected: {
|
|
5386
|
+
true: "",
|
|
5387
|
+
false: ""
|
|
5049
5388
|
}
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5389
|
+
},
|
|
5390
|
+
compoundVariants: [
|
|
5391
|
+
{
|
|
5392
|
+
color: "primary",
|
|
5393
|
+
isSelected: true,
|
|
5394
|
+
class: {
|
|
5395
|
+
option: "bg-primary-soft text-primary-main"
|
|
5396
|
+
}
|
|
5397
|
+
},
|
|
5398
|
+
{
|
|
5399
|
+
color: "secondary",
|
|
5400
|
+
isSelected: true,
|
|
5401
|
+
class: {
|
|
5402
|
+
option: "bg-secondary-soft text-secondary-main"
|
|
5403
|
+
}
|
|
5055
5404
|
}
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5405
|
+
],
|
|
5406
|
+
defaultVariants: {
|
|
5407
|
+
color: "primary",
|
|
5408
|
+
size: "md",
|
|
5409
|
+
direction: "vertical",
|
|
5410
|
+
disabled: false,
|
|
5411
|
+
readonly: false
|
|
5412
|
+
}
|
|
5413
|
+
});
|
|
5414
|
+
|
|
5415
|
+
// src/components/picker/timePicker.tsx
|
|
5416
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
5417
|
+
var TimePicker = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
5418
|
+
const [props, variantProps] = mapPropsVariants(originalProps, timePickerStyle.variantKeys);
|
|
5419
|
+
const {
|
|
5420
|
+
classNames,
|
|
5421
|
+
label,
|
|
5422
|
+
errorMessage,
|
|
5423
|
+
valueRange,
|
|
5424
|
+
onChangeRange,
|
|
5425
|
+
size,
|
|
5426
|
+
selectClassNames,
|
|
5427
|
+
placeholder = "",
|
|
5428
|
+
...inputProps
|
|
5429
|
+
} = props;
|
|
5430
|
+
const [selectedRange, setSelectedRange] = (0, import_react2.useState)(
|
|
5431
|
+
valueRange || { start: "", end: "" }
|
|
5432
|
+
);
|
|
5433
|
+
const [isPanelOpen, setIsPanelOpen] = (0, import_react2.useState)(false);
|
|
5434
|
+
const inputWrapperRef = (0, import_react2.useRef)(null);
|
|
5435
|
+
const panelWrapperRef = (0, import_react2.useRef)(null);
|
|
5436
|
+
const [panelPos, setPanelPos] = (0, import_react2.useState)({ top: -9999, left: -9999 });
|
|
5437
|
+
const displayValue = (0, import_react2.useMemo)(() => {
|
|
5438
|
+
if (selectedRange.start && selectedRange.end) {
|
|
5439
|
+
return `${selectedRange.start} ~ ${selectedRange.end}`;
|
|
5062
5440
|
}
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5441
|
+
return "";
|
|
5442
|
+
}, [selectedRange]);
|
|
5443
|
+
const calculatePosition = (0, import_react2.useCallback)(() => {
|
|
5444
|
+
if (inputWrapperRef.current) {
|
|
5445
|
+
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
5446
|
+
setPanelPos({ top: rect.bottom + window.scrollY + 6, left: rect.left + window.scrollX });
|
|
5066
5447
|
}
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5448
|
+
}, []);
|
|
5449
|
+
const handleFocusInput = () => {
|
|
5450
|
+
calculatePosition();
|
|
5451
|
+
setIsPanelOpen(true);
|
|
5071
5452
|
};
|
|
5072
|
-
const
|
|
5073
|
-
|
|
5453
|
+
const handleInputBlur = () => {
|
|
5454
|
+
setTimeout(() => setIsPanelOpen(false), 150);
|
|
5074
5455
|
};
|
|
5075
|
-
const
|
|
5076
|
-
if (
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5456
|
+
const handleInputKeyDown = (e) => {
|
|
5457
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
5458
|
+
e.preventDefault();
|
|
5459
|
+
calculatePosition();
|
|
5460
|
+
setIsPanelOpen((prev) => !prev);
|
|
5461
|
+
} else if (e.key === "Escape") {
|
|
5462
|
+
setIsPanelOpen(false);
|
|
5081
5463
|
}
|
|
5082
5464
|
};
|
|
5083
|
-
(0,
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
(
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
/* @__PURE__ */ (0,
|
|
5131
|
-
/* @__PURE__ */ (0,
|
|
5465
|
+
const slots = (0, import_react2.useMemo)(() => timePickerStyle({ ...variantProps }), [variantProps]);
|
|
5466
|
+
const renderHourOptions = () => {
|
|
5467
|
+
return Array.from({ length: 24 }, (_, i) => {
|
|
5468
|
+
const value = String(i).padStart(2, "0");
|
|
5469
|
+
return { label: value, value };
|
|
5470
|
+
});
|
|
5471
|
+
};
|
|
5472
|
+
const renderMinuteOptions = () => {
|
|
5473
|
+
return Array.from({ length: 60 }, (_, i) => {
|
|
5474
|
+
const value = String(i).padStart(2, "0");
|
|
5475
|
+
return { label: value, value };
|
|
5476
|
+
});
|
|
5477
|
+
};
|
|
5478
|
+
const defaultSelectClassNames = {
|
|
5479
|
+
selectWrapper: "!w-[80px]",
|
|
5480
|
+
optionsWrapper: "max-h-[300px]"
|
|
5481
|
+
};
|
|
5482
|
+
const handleRangeChange = (type, option) => {
|
|
5483
|
+
const [shRaw, smRaw] = selectedRange.start.split(":");
|
|
5484
|
+
const [ehRaw, emRaw] = selectedRange.end.split(":");
|
|
5485
|
+
const sh = (shRaw != null ? shRaw : "00").padStart(2, "0");
|
|
5486
|
+
const sm = (smRaw != null ? smRaw : "00").padStart(2, "0");
|
|
5487
|
+
const eh = (ehRaw != null ? ehRaw : "00").padStart(2, "0");
|
|
5488
|
+
const em = (emRaw != null ? emRaw : "00").padStart(2, "0");
|
|
5489
|
+
const range = {
|
|
5490
|
+
start: `${type === "startHour" ? option.value : sh}:${type === "startMinute" ? option.value : sm}`,
|
|
5491
|
+
end: `${type === "endHour" ? option.value : eh}:${type === "endMinute" ? option.value : em}`
|
|
5492
|
+
};
|
|
5493
|
+
setSelectedRange(range);
|
|
5494
|
+
onChangeRange == null ? void 0 : onChangeRange(range);
|
|
5495
|
+
};
|
|
5496
|
+
const mergedSelectClassNames = {
|
|
5497
|
+
selectWrapper: (selectClassNames == null ? void 0 : selectClassNames.selectWrapper) || defaultSelectClassNames.selectWrapper,
|
|
5498
|
+
optionsWrapper: (selectClassNames == null ? void 0 : selectClassNames.optionsWrapper) || defaultSelectClassNames.optionsWrapper
|
|
5499
|
+
};
|
|
5500
|
+
const getSelectValue = (timeString, part) => {
|
|
5501
|
+
if (!timeString) return "00";
|
|
5502
|
+
const [hour, minute] = timeString.split(":");
|
|
5503
|
+
return part === "hour" ? hour || "00" : minute || "00";
|
|
5504
|
+
};
|
|
5505
|
+
const handleClearRange = () => {
|
|
5506
|
+
const emptyRange = { start: "", end: "" };
|
|
5507
|
+
setSelectedRange(emptyRange);
|
|
5508
|
+
onChangeRange == null ? void 0 : onChangeRange(emptyRange);
|
|
5509
|
+
};
|
|
5510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
5511
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
5512
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref: inputWrapperRef, className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }), children: [
|
|
5515
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5516
|
+
"input",
|
|
5517
|
+
{
|
|
5518
|
+
...inputProps,
|
|
5519
|
+
ref,
|
|
5520
|
+
className: slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
5521
|
+
type: "text",
|
|
5522
|
+
value: displayValue,
|
|
5523
|
+
placeholder,
|
|
5524
|
+
readOnly: true,
|
|
5525
|
+
onFocus: handleFocusInput,
|
|
5526
|
+
onBlur: handleInputBlur,
|
|
5527
|
+
onKeyDown: handleInputKeyDown
|
|
5528
|
+
}
|
|
5529
|
+
),
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }), children: [
|
|
5531
|
+
displayValue && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5532
|
+
Icon_default,
|
|
5533
|
+
{
|
|
5534
|
+
name: "close",
|
|
5535
|
+
className: "text-neutral-light hover:text-neutral-main mr-[5px] cursor-pointer",
|
|
5536
|
+
onClick: (e) => {
|
|
5537
|
+
e.stopPropagation();
|
|
5538
|
+
handleClearRange();
|
|
5539
|
+
}
|
|
5540
|
+
}
|
|
5541
|
+
),
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5543
|
+
Icon_default,
|
|
5544
|
+
{
|
|
5545
|
+
name: "clock",
|
|
5546
|
+
className: "cursor-pointer",
|
|
5547
|
+
onClick: () => {
|
|
5548
|
+
calculatePosition();
|
|
5549
|
+
setIsPanelOpen((v) => !v);
|
|
5550
|
+
}
|
|
5551
|
+
}
|
|
5552
|
+
)
|
|
5553
|
+
] })
|
|
5554
|
+
] }),
|
|
5555
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage }), children: errorMessage })
|
|
5556
|
+
] })
|
|
5132
5557
|
] }),
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5558
|
+
isPanelOpen && (0, import_react_dom2.createPortal)(
|
|
5559
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5560
|
+
"div",
|
|
5561
|
+
{
|
|
5562
|
+
ref: panelWrapperRef,
|
|
5563
|
+
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
5564
|
+
style: {
|
|
5565
|
+
position: "absolute",
|
|
5566
|
+
top: panelPos.top,
|
|
5567
|
+
left: panelPos.left,
|
|
5568
|
+
zIndex: 1e3
|
|
5569
|
+
},
|
|
5570
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
5571
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "bg-body-background text-neutral-main flex items-center gap-[5px] p-[10px]", children: [
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-[5px]", children: [
|
|
5573
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5574
|
+
select_default,
|
|
5575
|
+
{
|
|
5576
|
+
options: renderHourOptions(),
|
|
5577
|
+
value: getSelectValue(selectedRange.start, "hour"),
|
|
5578
|
+
onChange: (options) => {
|
|
5579
|
+
if (options[0]) handleRangeChange("startHour", options[0]);
|
|
5580
|
+
},
|
|
5581
|
+
classNames: mergedSelectClassNames
|
|
5582
|
+
}
|
|
5583
|
+
),
|
|
5584
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: ":" }),
|
|
5585
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5586
|
+
select_default,
|
|
5587
|
+
{
|
|
5588
|
+
options: renderMinuteOptions(),
|
|
5589
|
+
value: getSelectValue(selectedRange.start, "minute"),
|
|
5590
|
+
onChange: (options) => {
|
|
5591
|
+
if (options[0]) handleRangeChange("startMinute", options[0]);
|
|
5592
|
+
},
|
|
5593
|
+
classNames: mergedSelectClassNames
|
|
5594
|
+
}
|
|
5595
|
+
)
|
|
5596
|
+
] }),
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "~" }),
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-[5px]", children: [
|
|
5599
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5600
|
+
select_default,
|
|
5601
|
+
{
|
|
5602
|
+
options: renderHourOptions(),
|
|
5603
|
+
value: getSelectValue(selectedRange.end, "hour"),
|
|
5604
|
+
onChange: (options) => {
|
|
5605
|
+
if (options[0]) handleRangeChange("endHour", options[0]);
|
|
5606
|
+
},
|
|
5607
|
+
classNames: mergedSelectClassNames
|
|
5608
|
+
}
|
|
5609
|
+
),
|
|
5610
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: ":" }),
|
|
5611
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
5612
|
+
select_default,
|
|
5613
|
+
{
|
|
5614
|
+
options: renderMinuteOptions(),
|
|
5615
|
+
value: getSelectValue(selectedRange.end, "minute"),
|
|
5616
|
+
onChange: (options) => {
|
|
5617
|
+
if (options[0]) handleRangeChange("endMinute", options[0]);
|
|
5618
|
+
},
|
|
5619
|
+
classNames: mergedSelectClassNames
|
|
5620
|
+
}
|
|
5621
|
+
)
|
|
5622
|
+
] })
|
|
5623
|
+
] })
|
|
5624
|
+
}
|
|
5625
|
+
),
|
|
5626
|
+
document.body
|
|
5627
|
+
)
|
|
5628
|
+
] });
|
|
5142
5629
|
});
|
|
5143
|
-
|
|
5144
|
-
var
|
|
5145
|
-
var
|
|
5630
|
+
TimePicker.displayName = "TimePicker";
|
|
5631
|
+
var timePicker_default = TimePicker;
|
|
5632
|
+
var timePickerStyle = tv({
|
|
5146
5633
|
slots: {
|
|
5147
|
-
base: [
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
"border",
|
|
5152
|
-
"border-neutral-main",
|
|
5153
|
-
"bg-background",
|
|
5154
|
-
"rounded-md",
|
|
5155
|
-
"p-4",
|
|
5156
|
-
"shadow-lg",
|
|
5157
|
-
"select-none"
|
|
5158
|
-
],
|
|
5159
|
-
dateTitle: ["text-sm", "font-[500]", "data-[saturday=true]:text-[#1E7EEE]", "data-[sunday=true]:text-[#FF4684]"],
|
|
5160
|
-
date: [
|
|
5634
|
+
base: ["group/timepicker", "flex", "flex-col"],
|
|
5635
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
5636
|
+
wrapper: ["flex", "flex-col"],
|
|
5637
|
+
inputWrapper: [
|
|
5161
5638
|
"flex",
|
|
5162
|
-
"justify-center",
|
|
5163
5639
|
"items-center",
|
|
5164
|
-
"
|
|
5165
|
-
"
|
|
5166
|
-
"rounded-full",
|
|
5640
|
+
"justify-between",
|
|
5641
|
+
"border",
|
|
5167
5642
|
"cursor-pointer",
|
|
5168
|
-
"
|
|
5169
|
-
"
|
|
5170
|
-
"
|
|
5171
|
-
"
|
|
5172
|
-
"
|
|
5173
|
-
"
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
"
|
|
5177
|
-
"
|
|
5178
|
-
"
|
|
5179
|
-
"
|
|
5180
|
-
|
|
5643
|
+
"text-neutral-main",
|
|
5644
|
+
"hover:bg-trans-soft",
|
|
5645
|
+
"group-has-[p.error]/input:border-danger-main",
|
|
5646
|
+
"group-has-[p.error]/input:bg-danger-soft",
|
|
5647
|
+
"group-has-[p.error]/input:text-danger-main",
|
|
5648
|
+
"group-has-[p.error]/input:hover:bg-danger-soft"
|
|
5649
|
+
],
|
|
5650
|
+
input: [
|
|
5651
|
+
"bg-transparent",
|
|
5652
|
+
"w-full",
|
|
5653
|
+
"outline-none",
|
|
5654
|
+
"placeholder:text-neutral-main",
|
|
5655
|
+
"text-body-foreground",
|
|
5656
|
+
"group-has-[p.error]/input:text-danger-main",
|
|
5657
|
+
"group-has-[p.error]/input:placeholder:text-danger-main",
|
|
5658
|
+
"cursor-pointer"
|
|
5659
|
+
],
|
|
5660
|
+
icon: ["flex", "items-center", "select-none", "text-body-foreground", "group-has-[p.error]/input:text-danger-main"],
|
|
5661
|
+
optionsWrapper: ["border", "rounded", "bg-body-background", "shadow", "overflow-auto"],
|
|
5662
|
+
errorMessage: ["text-danger-main", "mt-1", "text-sm"],
|
|
5663
|
+
selectWrapper: []
|
|
5181
5664
|
},
|
|
5182
5665
|
variants: {
|
|
5183
|
-
variant: {
|
|
5184
|
-
solid: {}
|
|
5185
|
-
},
|
|
5186
5666
|
color: {
|
|
5187
5667
|
primary: {
|
|
5188
|
-
|
|
5668
|
+
icon: ["text-primary-main"]
|
|
5189
5669
|
},
|
|
5190
5670
|
secondary: {
|
|
5191
|
-
|
|
5671
|
+
icon: ["text-secondary-main"]
|
|
5672
|
+
}
|
|
5673
|
+
},
|
|
5674
|
+
size: {
|
|
5675
|
+
sm: {
|
|
5676
|
+
base: ["text-sm", "gap-[4px]"],
|
|
5677
|
+
label: ["text-sm"],
|
|
5678
|
+
wrapper: ["gap-[4px]"],
|
|
5679
|
+
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
|
|
5680
|
+
input: ["text-sm"],
|
|
5681
|
+
icon: ["text-sm"],
|
|
5682
|
+
errorMessage: ["text-sm"]
|
|
5683
|
+
},
|
|
5684
|
+
md: {
|
|
5685
|
+
base: ["text-md", "gap-[6px]"],
|
|
5686
|
+
label: ["text-md"],
|
|
5687
|
+
wrapper: ["gap-[6px]"],
|
|
5688
|
+
inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
|
|
5689
|
+
input: ["text-md"],
|
|
5690
|
+
icon: ["text-md"],
|
|
5691
|
+
errorMessage: ["text-sm"]
|
|
5692
|
+
},
|
|
5693
|
+
lg: {
|
|
5694
|
+
base: ["text-lg", "gap-[8px]"],
|
|
5695
|
+
label: ["text-lg"],
|
|
5696
|
+
wrapper: ["gap-[8px]"],
|
|
5697
|
+
inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
|
|
5698
|
+
input: ["text-lg"],
|
|
5699
|
+
icon: ["text-lg"],
|
|
5700
|
+
errorMessage: ["text-md"]
|
|
5701
|
+
},
|
|
5702
|
+
xl: {
|
|
5703
|
+
base: ["text-xl", "gap-[10px]"],
|
|
5704
|
+
label: ["text-xl"],
|
|
5705
|
+
wrapper: ["gap-[10px]"],
|
|
5706
|
+
inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
|
|
5707
|
+
input: ["text-xl"],
|
|
5708
|
+
icon: ["text-xl"],
|
|
5709
|
+
errorMessage: ["text-md"]
|
|
5710
|
+
}
|
|
5711
|
+
},
|
|
5712
|
+
full: {
|
|
5713
|
+
true: {
|
|
5714
|
+
base: ["w-full"],
|
|
5715
|
+
wrapper: ["w-full"],
|
|
5716
|
+
inputWrapper: ["w-full"]
|
|
5717
|
+
}
|
|
5718
|
+
},
|
|
5719
|
+
disabled: {
|
|
5720
|
+
true: {
|
|
5721
|
+
base: ["pointer-events-none"],
|
|
5722
|
+
label: ["text-neutral-light"],
|
|
5723
|
+
inputWrapper: [
|
|
5724
|
+
"bg-neutral-soft",
|
|
5725
|
+
"border-neutral-light",
|
|
5726
|
+
"group-has-[p.error]/input:text-danger-light",
|
|
5727
|
+
"group-has-[p.error]/input:bg-danger-soft",
|
|
5728
|
+
"group-has-[p.error]/input:border-danger-light",
|
|
5729
|
+
"cursor-not-allowed"
|
|
5730
|
+
],
|
|
5731
|
+
input: [
|
|
5732
|
+
"text-neutral-light",
|
|
5733
|
+
"placeholder:text-neutral-light",
|
|
5734
|
+
"group-has-[p.error]/input:text-danger-light",
|
|
5735
|
+
"group-has-[p.error]/input:placeholder:text-danger-light",
|
|
5736
|
+
"cursor-not-allowed"
|
|
5737
|
+
],
|
|
5738
|
+
icon: ["text-neutral-light"],
|
|
5739
|
+
errorMessage: ["text-danger-light"]
|
|
5192
5740
|
}
|
|
5193
5741
|
}
|
|
5194
5742
|
},
|
|
5195
5743
|
defaultVariants: {
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
disabled: true,
|
|
5202
|
-
isRequired: true,
|
|
5203
|
-
class: {}
|
|
5204
|
-
}
|
|
5205
|
-
]
|
|
5744
|
+
color: "primary",
|
|
5745
|
+
size: "md",
|
|
5746
|
+
full: false,
|
|
5747
|
+
disabled: false
|
|
5748
|
+
}
|
|
5206
5749
|
});
|
|
5207
5750
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5208
5751
|
0 && (module.exports = {
|
|
5209
|
-
|
|
5752
|
+
TimePicker
|
|
5210
5753
|
});
|