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