@deepnoid/ui 0.1.20 → 0.1.21
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 +149 -159
- package/dist/{chunk-JOCMCOEK.mjs → chunk-2Y7IBUAZ.mjs} +17 -6
- package/dist/{chunk-LNYMVBV5.mjs → chunk-7CFOD7G4.mjs} +11 -9
- package/dist/{chunk-YBDA3WQP.mjs → chunk-7KUFDVGL.mjs} +1 -1
- package/dist/{chunk-6KXBXGYR.mjs → chunk-HQLSHEK6.mjs} +1 -1
- package/dist/{chunk-EYVRTVRM.mjs → chunk-JHDYQCEE.mjs} +5 -5
- package/dist/{chunk-3DPVPTHL.mjs → chunk-MV7RSV4D.mjs} +3 -3
- package/dist/chunk-MW7CSRIE.mjs +348 -0
- package/dist/{chunk-ZUSUVPYV.mjs → chunk-OV7CZNXU.mjs} +5 -5
- package/dist/{chunk-OWG4RL2T.mjs → chunk-Q6BZ76DI.mjs} +2 -2
- package/dist/{chunk-63WXGSTV.mjs → chunk-QHWFHOW2.mjs} +24 -14
- package/dist/{chunk-EGHTZLZJ.mjs → chunk-UTC2D6GV.mjs} +5 -5
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.mjs +6 -6
- package/dist/components/breadcrumb/index.mjs +6 -6
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/icon-button.mjs +2 -2
- package/dist/components/button/index.mjs +5 -5
- package/dist/components/button/text-button.mjs +3 -3
- package/dist/components/checkbox/checkbox.mjs +3 -3
- package/dist/components/checkbox/index.mjs +3 -3
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.mjs +6 -6
- package/dist/components/dateTimePicker/index.mjs +6 -6
- package/dist/components/dateTimePicker/timePicker.mjs +4 -4
- package/dist/components/input/index.js +13 -2
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.js +13 -2
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.mjs +2 -2
- package/dist/components/modal/index.mjs +8 -8
- package/dist/components/modal/modal.mjs +8 -8
- package/dist/components/pagination/index.js +13 -2
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.js +13 -2
- package/dist/components/pagination/pagination.mjs +4 -4
- package/dist/components/radio/index.mjs +3 -3
- package/dist/components/radio/radio.mjs +3 -3
- package/dist/components/select/index.d.mts +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.js +301 -286
- package/dist/components/select/index.mjs +3 -4
- package/dist/components/select/select.d.mts +190 -177
- package/dist/components/select/select.d.ts +190 -177
- package/dist/components/select/select.js +301 -286
- package/dist/components/select/select.mjs +3 -4
- package/dist/components/table/index.js +43 -20
- package/dist/components/table/index.mjs +8 -8
- package/dist/components/table/table-body.d.mts +3 -2
- package/dist/components/table/table-body.d.ts +3 -2
- package/dist/components/table/table-body.js +23 -13
- package/dist/components/table/table-body.mjs +4 -4
- package/dist/components/table/table-head.d.mts +2 -2
- package/dist/components/table/table-head.d.ts +2 -2
- package/dist/components/table/table-head.js +2 -2
- package/dist/components/table/table-head.mjs +4 -4
- package/dist/components/table/table.d.mts +2 -1
- package/dist/components/table/table.d.ts +2 -1
- package/dist/components/table/table.js +43 -20
- package/dist/components/table/table.mjs +8 -8
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.mjs +3 -3
- package/dist/components/tree/tree.mjs +3 -3
- package/dist/index.js +490 -494
- package/dist/index.mjs +50 -52
- package/package.json +1 -1
- package/dist/chunk-BXXAMH3R.mjs +0 -255
- package/dist/chunk-OF3X4BXG.mjs +0 -76
- package/dist/chunk-S3QS5B7F.mjs +0 -61
- package/dist/components/select/option.d.mts +0 -17
- package/dist/components/select/option.d.ts +0 -17
- package/dist/components/select/option.js +0 -4359
- package/dist/components/select/option.mjs +0 -12
- package/dist/components/select/useSelect.d.mts +0 -31
- package/dist/components/select/useSelect.d.ts +0 -31
- package/dist/components/select/useSelect.js +0 -84
- package/dist/components/select/useSelect.mjs +0 -8
- package/dist/{chunk-OUAKGMDW.mjs → chunk-2DLKV6TT.mjs} +4 -4
- package/dist/{chunk-D6QI3DJG.mjs → chunk-7H5XPHY6.mjs} +4 -4
- package/dist/{chunk-Q72LZAPG.mjs → chunk-DUPQBPI2.mjs} +3 -3
- package/dist/{chunk-VQROXH43.mjs → chunk-EWZAHXN7.mjs} +3 -3
- package/dist/{chunk-6HX3PPL6.mjs → chunk-FBAR75U4.mjs} +3 -3
- package/dist/{chunk-Z2537DF6.mjs → chunk-IL5ENWCR.mjs} +3 -3
- package/dist/{chunk-WFMFC7R6.mjs → chunk-KCOHU7X7.mjs} +4 -4
- package/dist/{chunk-PNRS23HE.mjs → chunk-MQI5SZWO.mjs} +3 -3
- package/dist/{chunk-LL6F3WDX.mjs → chunk-P5QCU457.mjs} +3 -3
- package/dist/{chunk-PZIVMTKX.mjs → chunk-SDHQUYFI.mjs} +3 -3
- package/dist/{chunk-2YMAKIZ6.mjs → chunk-SSMMWMQC.mjs} +3 -3
- package/dist/{chunk-HIVPDIEP.mjs → chunk-UFVQPPPW.mjs} +3 -3
- package/dist/{chunk-BPVRXFIC.mjs → chunk-XGYQ6D3S.mjs} +3 -3
- package/dist/{chunk-QIRL6HY6.mjs → chunk-YIIFWADW.mjs} +4 -4
|
@@ -107,7 +107,7 @@ __export(select_exports, {
|
|
|
107
107
|
module.exports = __toCommonJS(select_exports);
|
|
108
108
|
|
|
109
109
|
// src/components/select/select.tsx
|
|
110
|
-
var
|
|
110
|
+
var import_react = require("react");
|
|
111
111
|
var import_react_dom = require("react-dom");
|
|
112
112
|
|
|
113
113
|
// src/utils/tailwind-variants.ts
|
|
@@ -347,62 +347,6 @@ var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
|
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
349
|
|
|
350
|
-
// src/components/select/useSelect.tsx
|
|
351
|
-
var import_react = require("react");
|
|
352
|
-
var useSelect = ({ options, defaultOption, onChange }) => {
|
|
353
|
-
const [selectedOption, setSelectedOption] = (0, import_react.useState)(defaultOption);
|
|
354
|
-
const [targetRect, setTargetRect] = (0, import_react.useState)(null);
|
|
355
|
-
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react.useState)(0);
|
|
356
|
-
const selectWrapperRef = (0, import_react.useRef)(null);
|
|
357
|
-
const optionWrapperRef = (0, import_react.useRef)(null);
|
|
358
|
-
const calculatePositionWithScroll = (targetRect2, optionWrapperHeight2) => {
|
|
359
|
-
const scrollTop = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
360
|
-
const scrollLeft = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
361
|
-
const spaceBelow = window.innerHeight - (targetRect2.y + targetRect2.height + 4);
|
|
362
|
-
const spaceAbove = targetRect2.y - 4;
|
|
363
|
-
const top = spaceBelow < optionWrapperHeight2 && spaceAbove > optionWrapperHeight2 ? targetRect2.y - optionWrapperHeight2 - 4 : targetRect2.y + targetRect2.height + 4;
|
|
364
|
-
return {
|
|
365
|
-
top: top + scrollTop,
|
|
366
|
-
left: targetRect2.x + scrollLeft
|
|
367
|
-
};
|
|
368
|
-
};
|
|
369
|
-
const handleToggleSelect = () => {
|
|
370
|
-
if (selectWrapperRef.current) {
|
|
371
|
-
const rect = selectWrapperRef.current.getBoundingClientRect();
|
|
372
|
-
setTargetRect((prevRect) => prevRect ? null : { x: rect.x, y: rect.y, width: rect.width, height: rect.height });
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
const handleChangeOption = (option) => {
|
|
376
|
-
onChange == null ? void 0 : onChange(option);
|
|
377
|
-
setSelectedOption(option);
|
|
378
|
-
handleToggleSelect();
|
|
379
|
-
};
|
|
380
|
-
(0, import_react.useEffect)(() => {
|
|
381
|
-
const onClickOutside = (e) => {
|
|
382
|
-
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target)) {
|
|
383
|
-
setTargetRect(null);
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
window.addEventListener("mousedown", onClickOutside);
|
|
387
|
-
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
388
|
-
}, []);
|
|
389
|
-
(0, import_react.useEffect)(() => {
|
|
390
|
-
if (optionWrapperRef.current) {
|
|
391
|
-
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
392
|
-
}
|
|
393
|
-
}, [targetRect]);
|
|
394
|
-
return {
|
|
395
|
-
selectedOption,
|
|
396
|
-
targetRect,
|
|
397
|
-
optionWrapperHeight,
|
|
398
|
-
selectWrapperRef,
|
|
399
|
-
optionWrapperRef,
|
|
400
|
-
handleToggleSelect,
|
|
401
|
-
handleChangeOption,
|
|
402
|
-
calculatePositionWithScroll
|
|
403
|
-
};
|
|
404
|
-
};
|
|
405
|
-
|
|
406
350
|
// src/components/icon/template.tsx
|
|
407
351
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
408
352
|
var template = {
|
|
@@ -4373,302 +4317,373 @@ var Icon = ({ name, size = "md", fill = false, className, onClick, ...props }) =
|
|
|
4373
4317
|
};
|
|
4374
4318
|
var Icon_default = Icon;
|
|
4375
4319
|
|
|
4376
|
-
// src/
|
|
4377
|
-
|
|
4378
|
-
var
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
onClick: () => props.onClick(props.option),
|
|
4386
|
-
ref: (node) => {
|
|
4387
|
-
props.isSelected && (node == null ? void 0 : node.scrollIntoView());
|
|
4388
|
-
},
|
|
4389
|
-
children: [
|
|
4390
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: option(), children: props.children }),
|
|
4391
|
-
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: icon(), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "check", size: props.size }) })
|
|
4392
|
-
]
|
|
4320
|
+
// src/utils/clsx.ts
|
|
4321
|
+
function clsx(...args) {
|
|
4322
|
+
var i = 0, tmp, x, str = "";
|
|
4323
|
+
while (i < args.length) {
|
|
4324
|
+
if (tmp = args[i++]) {
|
|
4325
|
+
if (x = toVal(tmp)) {
|
|
4326
|
+
str && (str += " ");
|
|
4327
|
+
str += x;
|
|
4328
|
+
}
|
|
4393
4329
|
}
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
base: ["border-primary-main", "hover:bg-primary-soft", "hover:text-primary-main"],
|
|
4412
|
-
icon: "text-primary-main"
|
|
4413
|
-
},
|
|
4414
|
-
secondary: {
|
|
4415
|
-
base: ["border-secondary-main", "hover:bg-secondary-soft", "hover:text-secondary-main"],
|
|
4416
|
-
icon: "text-secondary-main"
|
|
4330
|
+
}
|
|
4331
|
+
return str;
|
|
4332
|
+
}
|
|
4333
|
+
function toVal(mix) {
|
|
4334
|
+
var k, y, str = "";
|
|
4335
|
+
if (typeof mix === "string" || typeof mix === "number") {
|
|
4336
|
+
str += mix;
|
|
4337
|
+
} else if (typeof mix === "object") {
|
|
4338
|
+
if (Array.isArray(mix)) {
|
|
4339
|
+
var len = mix.length;
|
|
4340
|
+
for (k = 0; k < len; k++) {
|
|
4341
|
+
if (mix[k]) {
|
|
4342
|
+
if (y = toVal(mix[k])) {
|
|
4343
|
+
str && (str += " ");
|
|
4344
|
+
str += y;
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4417
4347
|
}
|
|
4418
|
-
}
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
base: "text-md px-[8px] py-[6.5px]"
|
|
4425
|
-
},
|
|
4426
|
-
lg: {
|
|
4427
|
-
base: "text-lg px-[10px] py-[8px]"
|
|
4428
|
-
},
|
|
4429
|
-
xl: {
|
|
4430
|
-
base: "text-xl px-[10px] py-[8px]"
|
|
4348
|
+
} else {
|
|
4349
|
+
for (y in mix) {
|
|
4350
|
+
if (mix[y]) {
|
|
4351
|
+
str && (str += " ");
|
|
4352
|
+
str += y;
|
|
4353
|
+
}
|
|
4431
4354
|
}
|
|
4432
4355
|
}
|
|
4433
|
-
},
|
|
4434
|
-
defaultVariants: {
|
|
4435
|
-
variant: "normal",
|
|
4436
|
-
color: "primary",
|
|
4437
|
-
size: "md"
|
|
4438
4356
|
}
|
|
4439
|
-
|
|
4357
|
+
return str;
|
|
4358
|
+
}
|
|
4440
4359
|
|
|
4441
4360
|
// src/components/select/select.tsx
|
|
4442
|
-
var
|
|
4443
|
-
var Select = (0,
|
|
4361
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4362
|
+
var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
4363
|
+
var _a;
|
|
4444
4364
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
4445
|
-
const { classNames, options, defaultOption, onChange, ...inputProps } = props;
|
|
4446
|
-
const slots = (0, import_react2.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
4447
4365
|
const {
|
|
4448
|
-
|
|
4449
|
-
selectedOption,
|
|
4450
|
-
optionWrapperHeight,
|
|
4451
|
-
selectWrapperRef,
|
|
4452
|
-
optionWrapperRef,
|
|
4453
|
-
handleToggleSelect,
|
|
4454
|
-
handleChangeOption,
|
|
4455
|
-
calculatePositionWithScroll
|
|
4456
|
-
} = useSelect({
|
|
4366
|
+
label,
|
|
4457
4367
|
options,
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4368
|
+
helperText,
|
|
4369
|
+
errorText,
|
|
4370
|
+
classNames,
|
|
4371
|
+
defaultSelectedOptions = [],
|
|
4372
|
+
onChange,
|
|
4373
|
+
multiple,
|
|
4374
|
+
...inputProps
|
|
4375
|
+
} = props;
|
|
4376
|
+
const slots = (0, import_react.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
4377
|
+
const [selectedOptions, setSelectedOptions] = (0, import_react.useState)(defaultSelectedOptions);
|
|
4378
|
+
const [targetRect, setTargetRect] = (0, import_react.useState)(null);
|
|
4379
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react.useState)(0);
|
|
4380
|
+
const [isVisible, setIsVisible] = (0, import_react.useState)(false);
|
|
4381
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
4382
|
+
const selectWrapperRef = (0, import_react.useRef)(null);
|
|
4383
|
+
const optionWrapperRef = (0, import_react.useRef)(null);
|
|
4384
|
+
const handleToggleSelect = () => {
|
|
4385
|
+
if (isOpen) {
|
|
4386
|
+
setIsOpen(false);
|
|
4387
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
4388
|
+
} else {
|
|
4389
|
+
if (selectWrapperRef.current) {
|
|
4390
|
+
const rect = selectWrapperRef.current.getBoundingClientRect();
|
|
4391
|
+
setTargetRect(rect);
|
|
4392
|
+
setIsVisible(true);
|
|
4393
|
+
requestAnimationFrame(() => setIsOpen(true));
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
};
|
|
4397
|
+
const calculatePositionWithScroll = (rect, height) => {
|
|
4398
|
+
const scrollTop = window.scrollY;
|
|
4399
|
+
const scrollLeft = window.scrollX;
|
|
4400
|
+
const spaceBelow = window.innerHeight - (rect.y + rect.height + 4);
|
|
4401
|
+
const spaceAbove = rect.y - 4;
|
|
4402
|
+
const top = spaceBelow < height && spaceAbove > height ? rect.y - height - 4 : rect.y + rect.height + 4;
|
|
4403
|
+
return {
|
|
4404
|
+
top: top + scrollTop,
|
|
4405
|
+
left: rect.x + scrollLeft
|
|
4406
|
+
};
|
|
4407
|
+
};
|
|
4408
|
+
const handleChangeOption = (option) => {
|
|
4409
|
+
let nextOptions;
|
|
4410
|
+
if (multiple) {
|
|
4411
|
+
const exists = selectedOptions.some((o) => o.key === option.key);
|
|
4412
|
+
nextOptions = exists ? selectedOptions.filter((o) => o.key !== option.key) : [...selectedOptions, option];
|
|
4413
|
+
} else {
|
|
4414
|
+
nextOptions = [option];
|
|
4415
|
+
setIsOpen(false);
|
|
4416
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
4417
|
+
}
|
|
4418
|
+
setSelectedOptions(nextOptions);
|
|
4419
|
+
onChange == null ? void 0 : onChange(nextOptions);
|
|
4420
|
+
};
|
|
4421
|
+
(0, import_react.useEffect)(() => {
|
|
4422
|
+
const handleClickOutside = (e) => {
|
|
4423
|
+
var _a2;
|
|
4424
|
+
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target) && !((_a2 = selectWrapperRef.current) == null ? void 0 : _a2.contains(e.target))) {
|
|
4425
|
+
setIsOpen(false);
|
|
4426
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
4427
|
+
}
|
|
4428
|
+
};
|
|
4429
|
+
window.addEventListener("mousedown", handleClickOutside);
|
|
4430
|
+
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
4431
|
+
}, []);
|
|
4432
|
+
(0, import_react.useEffect)(() => {
|
|
4433
|
+
if (optionWrapperRef.current) {
|
|
4434
|
+
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
4435
|
+
}
|
|
4436
|
+
}, [targetRect]);
|
|
4461
4437
|
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
4462
|
-
const
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
)
|
|
4468
|
-
|
|
4469
|
-
()
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4438
|
+
const displayValue = multiple ? selectedOptions.map((opt) => opt.value).join(", ") : ((_a = selectedOptions[0]) == null ? void 0 : _a.value) || "";
|
|
4439
|
+
const Option = ({
|
|
4440
|
+
option,
|
|
4441
|
+
isSelected,
|
|
4442
|
+
onClick
|
|
4443
|
+
}) => {
|
|
4444
|
+
const slot = select({ ...variantProps, isSelected });
|
|
4445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { title: option.value, onClick, className: clsx(slot.option({ class: classNames == null ? void 0 : classNames.option })), children: [
|
|
4446
|
+
option.value,
|
|
4447
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon_default, { name: "check", size: originalProps.size })
|
|
4448
|
+
] });
|
|
4449
|
+
};
|
|
4450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
4451
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4452
|
+
"div",
|
|
4453
|
+
{
|
|
4454
|
+
className: clsx(
|
|
4455
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
4456
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
4457
|
+
),
|
|
4458
|
+
children: [
|
|
4459
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
4460
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4462
|
+
"div",
|
|
4463
|
+
{
|
|
4464
|
+
"data-expanded": isOpen,
|
|
4465
|
+
className: clsx(
|
|
4466
|
+
slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
4467
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
4468
|
+
),
|
|
4469
|
+
ref: selectWrapperRef,
|
|
4470
|
+
onClick: handleToggleSelect,
|
|
4471
|
+
children: [
|
|
4472
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4473
|
+
"input",
|
|
4474
|
+
{
|
|
4475
|
+
...inputProps,
|
|
4476
|
+
ref,
|
|
4477
|
+
className: clsx(
|
|
4478
|
+
slots.select({ class: classNames == null ? void 0 : classNames.select }),
|
|
4479
|
+
inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
|
|
4480
|
+
),
|
|
4481
|
+
value: displayValue,
|
|
4482
|
+
readOnly: true,
|
|
4483
|
+
size: 0
|
|
4484
|
+
}
|
|
4485
|
+
),
|
|
4486
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4487
|
+
Icon_default,
|
|
4488
|
+
{
|
|
4489
|
+
name: "brace-up",
|
|
4490
|
+
size: originalProps.size,
|
|
4491
|
+
className: `transition-transform duration-200 ${isOpen ? "rotate-0" : "rotate-180"}`
|
|
4492
|
+
}
|
|
4493
|
+
)
|
|
4494
|
+
]
|
|
4495
|
+
}
|
|
4496
|
+
),
|
|
4497
|
+
helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
4498
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
4499
|
+
] })
|
|
4500
|
+
]
|
|
4501
|
+
}
|
|
4502
|
+
),
|
|
4503
|
+
isVisible && (0, import_react_dom.createPortal)(
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4517
4505
|
"div",
|
|
4518
4506
|
{
|
|
4519
|
-
|
|
4507
|
+
ref: optionWrapperRef,
|
|
4508
|
+
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
4520
4509
|
style: {
|
|
4521
4510
|
position: "absolute",
|
|
4522
4511
|
top: position == null ? void 0 : position.top,
|
|
4523
4512
|
left: position == null ? void 0 : position.left,
|
|
4524
|
-
width: targetRect.width
|
|
4513
|
+
width: targetRect == null ? void 0 : targetRect.width,
|
|
4514
|
+
zIndex: 1e3,
|
|
4515
|
+
opacity: isOpen ? 1 : 0,
|
|
4516
|
+
transform: isOpen ? "translateY(0)" : "translateY(-0.25rem)",
|
|
4517
|
+
transition: "opacity 150ms ease-out, transform 150ms ease-out"
|
|
4525
4518
|
},
|
|
4526
|
-
children: options.map((option) =>
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
))
|
|
4519
|
+
children: options.map((option) => {
|
|
4520
|
+
const isSelected = selectedOptions.some((o) => o.key === option.key);
|
|
4521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4522
|
+
Option,
|
|
4523
|
+
{
|
|
4524
|
+
option,
|
|
4525
|
+
isSelected,
|
|
4526
|
+
onClick: () => handleChangeOption(option)
|
|
4527
|
+
},
|
|
4528
|
+
option.key
|
|
4529
|
+
);
|
|
4530
|
+
})
|
|
4539
4531
|
}
|
|
4540
4532
|
),
|
|
4541
4533
|
document.body
|
|
4542
|
-
)
|
|
4534
|
+
)
|
|
4543
4535
|
] });
|
|
4544
4536
|
});
|
|
4545
4537
|
Select.displayName = "Select";
|
|
4546
4538
|
var select_default = Select;
|
|
4547
4539
|
var select = tv({
|
|
4548
4540
|
slots: {
|
|
4549
|
-
base: ["group/select", "flex
|
|
4550
|
-
|
|
4541
|
+
base: ["group/select", "flex"],
|
|
4542
|
+
vertical: ["flex-col"],
|
|
4543
|
+
horizon: ["flex-row", "gap-0"],
|
|
4544
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
4545
|
+
wrapper: ["flex", "flex-col"],
|
|
4551
4546
|
selectWrapper: [
|
|
4552
4547
|
"flex",
|
|
4553
4548
|
"items-center",
|
|
4554
|
-
"
|
|
4555
|
-
"border
|
|
4556
|
-
"
|
|
4557
|
-
"
|
|
4558
|
-
"
|
|
4559
|
-
"group-has-[p]/select:
|
|
4549
|
+
"justify-between",
|
|
4550
|
+
"border",
|
|
4551
|
+
"cursor-pointer",
|
|
4552
|
+
"text-neutral-main",
|
|
4553
|
+
"hover:bg-trans-soft",
|
|
4554
|
+
"group-has-[p.error]/select:border-danger-main",
|
|
4555
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
4556
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
4557
|
+
"group-has-[p.error]/select:hover:bg-danger-soft"
|
|
4560
4558
|
],
|
|
4561
4559
|
select: [
|
|
4562
|
-
"w-full",
|
|
4563
4560
|
"bg-transparent",
|
|
4564
|
-
"
|
|
4565
|
-
"
|
|
4566
|
-
"cursor-pointer",
|
|
4561
|
+
"w-full",
|
|
4562
|
+
"outline-none",
|
|
4567
4563
|
"placeholder:text-neutral-main",
|
|
4568
|
-
"
|
|
4569
|
-
"
|
|
4564
|
+
"text-neutral-dark",
|
|
4565
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
4566
|
+
"group-has-[p.error]/select:placeholder:text-danger-main"
|
|
4570
4567
|
],
|
|
4571
|
-
optionsWrapper: ["
|
|
4572
|
-
|
|
4568
|
+
optionsWrapper: ["border", "rounded", "bg-white", "shadow", "overflow-auto"],
|
|
4569
|
+
option: ["flex", "justify-between", "items-center", "cursor-pointer"],
|
|
4570
|
+
helperText: ["text-neutral-main"],
|
|
4571
|
+
errorText: ["text-danger-main"],
|
|
4572
|
+
readonly: ["pointer-events-none", "!bg-trans-soft"]
|
|
4573
4573
|
},
|
|
4574
4574
|
variants: {
|
|
4575
|
-
variant: {
|
|
4576
|
-
solid: {
|
|
4577
|
-
selectWrapper: "bg-trans-soft hover:bg-trans-light data-[expanded=true]:bg-trans-light group-has-[p]/select:bg-danger-soft"
|
|
4578
|
-
},
|
|
4579
|
-
normal: {
|
|
4580
|
-
selectWrapper: "border hover:bg-trans-soft data-[expanded=true]:bg-trans-soft"
|
|
4581
|
-
},
|
|
4582
|
-
line: {
|
|
4583
|
-
selectWrapper: "border-b !rounded-none hover:bg-trans-soft data-[expanded=true]:bg-trans-soft",
|
|
4584
|
-
optionsWrapper: "!rounded-none"
|
|
4585
|
-
}
|
|
4586
|
-
},
|
|
4587
4575
|
color: {
|
|
4588
4576
|
primary: {
|
|
4589
|
-
selectWrapper: "
|
|
4590
|
-
|
|
4591
|
-
select: "data-[expanded=true]:text-primary-main"
|
|
4577
|
+
selectWrapper: ["hover:text-primary-main"],
|
|
4578
|
+
option: ["hover:bg-primary-soft", "hover:text-primary-main"]
|
|
4592
4579
|
},
|
|
4593
4580
|
secondary: {
|
|
4594
|
-
selectWrapper: "
|
|
4595
|
-
|
|
4596
|
-
|
|
4581
|
+
selectWrapper: ["hover:text-secondary-main"],
|
|
4582
|
+
select: ["text-secondary-main"],
|
|
4583
|
+
option: ["hover:bg-secondary-soft", "hover:text-secondary-main"]
|
|
4597
4584
|
}
|
|
4598
4585
|
},
|
|
4599
4586
|
size: {
|
|
4600
4587
|
sm: {
|
|
4601
|
-
base: "text-sm gap-[
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4588
|
+
base: ["text-sm", "gap-[4px]"],
|
|
4589
|
+
label: ["text-sm"],
|
|
4590
|
+
wrapper: ["gap-[4px]"],
|
|
4591
|
+
selectWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
|
|
4592
|
+
select: ["text-sm"],
|
|
4593
|
+
option: ["px-[4px]", "py-[3px]", "text-sm"],
|
|
4594
|
+
helperText: ["text-sm"],
|
|
4595
|
+
errorText: ["text-sm"]
|
|
4605
4596
|
},
|
|
4606
4597
|
md: {
|
|
4607
|
-
base: "text-md gap-[
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4598
|
+
base: ["text-md", "gap-[6px]", "rounded-md"],
|
|
4599
|
+
label: ["text-md"],
|
|
4600
|
+
wrapper: ["gap-[6px]"],
|
|
4601
|
+
selectWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
|
|
4602
|
+
select: ["text-md"],
|
|
4603
|
+
option: ["px-[6px]", "py-[5.5px]", "text-md"],
|
|
4604
|
+
helperText: ["text-sm"],
|
|
4605
|
+
errorText: ["text-sm"]
|
|
4611
4606
|
},
|
|
4612
4607
|
lg: {
|
|
4613
|
-
base: "text-lg gap-[
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4608
|
+
base: ["text-lg", "gap-[8px]"],
|
|
4609
|
+
label: ["text-lg"],
|
|
4610
|
+
wrapper: ["gap-[8px]"],
|
|
4611
|
+
selectWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
|
|
4612
|
+
select: ["text-lg"],
|
|
4613
|
+
option: ["px-[8px]", "py-[8px]", "text-lg"],
|
|
4614
|
+
helperText: ["text-md"],
|
|
4615
|
+
errorText: ["text-md"]
|
|
4617
4616
|
},
|
|
4618
4617
|
xl: {
|
|
4619
|
-
base: "text-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4618
|
+
base: ["text-xl", "gap-[10px]"],
|
|
4619
|
+
label: ["text-xl"],
|
|
4620
|
+
wrapper: ["gap-[10px]"],
|
|
4621
|
+
selectWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
|
|
4622
|
+
select: ["text-xl"],
|
|
4623
|
+
option: ["px-[10px]", "py-[11.5px]"],
|
|
4624
|
+
helperText: ["text-md"],
|
|
4625
|
+
errorText: ["text-md"]
|
|
4623
4626
|
}
|
|
4624
4627
|
},
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
selectWrapper: "rounded-none",
|
|
4629
|
-
optionsWrapper: "rounded-none"
|
|
4630
|
-
},
|
|
4631
|
-
full: {
|
|
4632
|
-
selectWrapper: "rounded-full"
|
|
4633
|
-
}
|
|
4628
|
+
direction: {
|
|
4629
|
+
vertical: "",
|
|
4630
|
+
horizon: ""
|
|
4634
4631
|
},
|
|
4635
|
-
|
|
4632
|
+
full: {
|
|
4636
4633
|
true: {
|
|
4637
|
-
|
|
4638
|
-
|
|
4634
|
+
base: ["w-full"],
|
|
4635
|
+
wrapper: ["w-full"],
|
|
4636
|
+
selectWrapper: ["w-full"]
|
|
4639
4637
|
}
|
|
4640
4638
|
},
|
|
4641
|
-
|
|
4639
|
+
disabled: {
|
|
4642
4640
|
true: {
|
|
4643
|
-
base: "
|
|
4644
|
-
selectWrapper:
|
|
4645
|
-
|
|
4646
|
-
|
|
4641
|
+
base: ["pointer-events-none"],
|
|
4642
|
+
selectWrapper: [
|
|
4643
|
+
"bg-neutral-soft",
|
|
4644
|
+
"border-neutral-light",
|
|
4645
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
4646
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
4647
|
+
"group-has-[p.error]/select:border-danger-light"
|
|
4648
|
+
],
|
|
4649
|
+
select: [
|
|
4650
|
+
"text-neutral-light",
|
|
4651
|
+
"placeholder:text-neutral-light",
|
|
4652
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
4653
|
+
"group-has-[p.error]/select:placeholder:text-danger-light"
|
|
4654
|
+
],
|
|
4655
|
+
helperText: ["!text-neutral-light"],
|
|
4656
|
+
errorText: ["!text-danger-light"]
|
|
4647
4657
|
}
|
|
4648
4658
|
},
|
|
4649
|
-
|
|
4650
|
-
true:
|
|
4651
|
-
|
|
4652
|
-
}
|
|
4659
|
+
isSelected: {
|
|
4660
|
+
true: "",
|
|
4661
|
+
false: ""
|
|
4653
4662
|
}
|
|
4654
4663
|
},
|
|
4655
|
-
defaultVariants: {
|
|
4656
|
-
variant: "solid",
|
|
4657
|
-
color: "primary",
|
|
4658
|
-
size: "md",
|
|
4659
|
-
fullWidth: false,
|
|
4660
|
-
isDisabled: false,
|
|
4661
|
-
isRequired: false
|
|
4662
|
-
},
|
|
4663
4664
|
compoundVariants: [
|
|
4664
4665
|
{
|
|
4665
|
-
|
|
4666
|
-
|
|
4666
|
+
color: "primary",
|
|
4667
|
+
isSelected: true,
|
|
4667
4668
|
class: {
|
|
4668
|
-
|
|
4669
|
+
option: "bg-primary-soft text-primary-main"
|
|
4670
|
+
}
|
|
4671
|
+
},
|
|
4672
|
+
{
|
|
4673
|
+
color: "secondary",
|
|
4674
|
+
isSelected: true,
|
|
4675
|
+
class: {
|
|
4676
|
+
option: "bg-secondary-soft text-secondary-main"
|
|
4669
4677
|
}
|
|
4670
4678
|
}
|
|
4671
|
-
]
|
|
4679
|
+
],
|
|
4680
|
+
defaultVariants: {
|
|
4681
|
+
color: "primary",
|
|
4682
|
+
size: "md",
|
|
4683
|
+
direction: "vertical",
|
|
4684
|
+
disabled: false,
|
|
4685
|
+
readonly: false
|
|
4686
|
+
}
|
|
4672
4687
|
});
|
|
4673
4688
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4674
4689
|
0 && (module.exports = {
|