@deepnoid/ui 0.1.19 → 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 +202 -183
- package/dist/assets/images/cogwheel.d.mts +2 -0
- package/dist/assets/images/cogwheel.d.ts +2 -0
- package/dist/assets/images/cogwheel.js +4 -0
- package/dist/assets/images/cogwheel.mjs +8 -0
- package/dist/assets/images/folder.d.mts +2 -0
- package/dist/assets/images/folder.d.ts +2 -0
- package/dist/assets/images/folder.js +4 -0
- package/dist/assets/images/folder.mjs +8 -0
- package/dist/chunk-2DLKV6TT.mjs +168 -0
- package/dist/{chunk-7TXQPX4O.mjs → chunk-2Y7IBUAZ.mjs} +19 -8
- package/dist/chunk-3BKCODIL.mjs +49 -0
- package/dist/{chunk-A7OXEUCC.mjs → chunk-3IU2RPSM.mjs} +75 -9
- package/dist/{chunk-3TJAGKKY.mjs → chunk-7CFOD7G4.mjs} +11 -9
- package/dist/chunk-7KUFDVGL.mjs +71 -0
- package/dist/chunk-7USF56CT.mjs +8 -0
- package/dist/{chunk-5ANQDLRS.mjs → chunk-DUPQBPI2.mjs} +4 -4
- package/dist/{chunk-K7Z6PVXE.mjs → chunk-EWZAHXN7.mjs} +7 -7
- package/dist/{chunk-BFM3LPBK.mjs → chunk-FBAR75U4.mjs} +4 -4
- package/dist/{chunk-RPDPB4JP.mjs → chunk-HQLSHEK6.mjs} +4 -4
- package/dist/{chunk-DADMVOYI.mjs → chunk-HWL7TPUN.mjs} +1 -1
- package/dist/chunk-IZM66FHP.mjs +8 -0
- package/dist/{chunk-QIDZXCYP.mjs → chunk-JHDYQCEE.mjs} +6 -6
- package/dist/chunk-MBLZYQCN.mjs +1 -0
- package/dist/{chunk-7A5M7DRD.mjs → chunk-MQI5SZWO.mjs} +7 -7
- package/dist/{chunk-3DPVPTHL.mjs → chunk-MV7RSV4D.mjs} +3 -3
- package/dist/chunk-MW7CSRIE.mjs +348 -0
- package/dist/chunk-OV7CZNXU.mjs +135 -0
- package/dist/{chunk-AG7AWQKH.mjs → chunk-Q6BZ76DI.mjs} +4 -4
- package/dist/{chunk-63WXGSTV.mjs → chunk-QHWFHOW2.mjs} +24 -14
- package/dist/{chunk-FONJYZKH.mjs → chunk-SDHQUYFI.mjs} +7 -7
- package/dist/{chunk-UHFJ7ZFM.mjs → chunk-UTC2D6GV.mjs} +6 -6
- package/dist/chunk-XGYQ6D3S.mjs +82 -0
- package/dist/{chunk-UYPVP36M.mjs → chunk-XQGD4ZIX.mjs} +1 -1
- package/dist/cogwheel-U2B3CWEL.png +0 -0
- package/dist/components/avatar/avatar.js +75 -9
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +75 -9
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +75 -9
- package/dist/components/breadcrumb/breadcrumb.mjs +9 -9
- package/dist/components/breadcrumb/index.js +75 -9
- package/dist/components/breadcrumb/index.mjs +9 -9
- package/dist/components/button/button.js +75 -9
- package/dist/components/button/button.mjs +5 -5
- package/dist/components/button/icon-button.js +75 -9
- package/dist/components/button/icon-button.mjs +5 -5
- package/dist/components/button/index.js +75 -9
- package/dist/components/button/index.mjs +9 -9
- 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.js +75 -9
- package/dist/components/chip/chip.mjs +4 -4
- package/dist/components/chip/index.js +75 -9
- package/dist/components/chip/index.mjs +4 -4
- package/dist/components/dateTimePicker/calendar.js +75 -9
- package/dist/components/dateTimePicker/calendar.mjs +4 -4
- package/dist/components/dateTimePicker/dateTimePicker.js +75 -9
- package/dist/components/dateTimePicker/dateTimePicker.mjs +9 -9
- package/dist/components/dateTimePicker/index.js +75 -9
- package/dist/components/dateTimePicker/index.mjs +9 -9
- package/dist/components/dateTimePicker/timePicker.js +75 -9
- package/dist/components/dateTimePicker/timePicker.mjs +7 -7
- package/dist/components/icon/Icon.d.mts +6 -2
- package/dist/components/icon/Icon.d.ts +6 -2
- package/dist/components/icon/Icon.js +75 -9
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +75 -9
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +2 -1
- package/dist/components/icon/template.d.ts +2 -1
- package/dist/components/icon/template.js +75 -9
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +89 -12
- package/dist/components/input/index.mjs +5 -5
- package/dist/components/input/input.js +89 -12
- package/dist/components/input/input.mjs +5 -5
- package/dist/components/list/index.js +75 -9
- package/dist/components/list/index.mjs +8 -8
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.js +75 -9
- package/dist/components/list/listItem.mjs +5 -5
- package/dist/components/modal/index.d.mts +0 -3
- package/dist/components/modal/index.d.ts +0 -3
- package/dist/components/modal/index.js +205 -158
- package/dist/components/modal/index.mjs +11 -9
- package/dist/components/modal/modal.d.mts +43 -105
- package/dist/components/modal/modal.d.ts +43 -105
- package/dist/components/modal/modal.js +206 -164
- package/dist/components/modal/modal.mjs +12 -12
- package/dist/components/pagination/index.js +89 -12
- package/dist/components/pagination/index.mjs +6 -6
- package/dist/components/pagination/pagination.js +89 -12
- package/dist/components/pagination/pagination.mjs +6 -6
- package/dist/components/radio/index.mjs +3 -3
- package/dist/components/radio/radio.mjs +3 -3
- package/dist/components/ripple/index.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 +376 -295
- package/dist/components/select/index.mjs +5 -6
- package/dist/components/select/select.d.mts +190 -177
- package/dist/components/select/select.d.ts +190 -177
- package/dist/components/select/select.js +376 -295
- package/dist/components/select/select.mjs +5 -6
- package/dist/components/table/form-table.d.mts +52 -0
- package/dist/components/table/form-table.d.ts +52 -0
- package/dist/components/table/form-table.js +365 -0
- package/dist/components/table/form-table.mjs +9 -0
- package/dist/components/table/index.d.mts +2 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +162 -30
- package/dist/components/table/index.mjs +15 -11
- 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 +119 -30
- package/dist/components/table/table.mjs +10 -10
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/toast/index.js +239 -97
- package/dist/components/toast/index.mjs +6 -5
- package/dist/components/toast/toast.d.mts +40 -81
- package/dist/components/toast/toast.d.ts +40 -81
- package/dist/components/toast/toast.js +210 -56
- package/dist/components/toast/toast.mjs +5 -4
- package/dist/components/toast/use-toast.d.mts +6 -10
- package/dist/components/toast/use-toast.d.ts +6 -10
- package/dist/components/toast/use-toast.js +239 -97
- package/dist/components/toast/use-toast.mjs +6 -5
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.d.mts +2 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/index.js +4371 -0
- package/dist/components/tree/index.mjs +15 -0
- package/dist/components/tree/tree.d.mts +20 -0
- package/dist/components/tree/tree.d.ts +20 -0
- package/dist/components/{select/option.js → tree/tree.js} +146 -74
- package/dist/components/tree/tree.mjs +14 -0
- package/dist/folder-RO3QTLGS.svg +9 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +681 -545
- package/dist/index.mjs +71 -62
- package/package.json +1 -1
- package/types/images.d.ts +14 -0
- package/dist/chunk-5OBP42D6.mjs +0 -117
- package/dist/chunk-HDNQOLUJ.mjs +0 -83
- package/dist/chunk-MJT6ZW4C.mjs +0 -255
- package/dist/chunk-P6NVCCBZ.mjs +0 -76
- package/dist/chunk-RXIFDECK.mjs +0 -213
- 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.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-D6QI3DJG.mjs → chunk-7H5XPHY6.mjs} +4 -4
- package/dist/{chunk-2UUH2MBF.mjs → chunk-DX3KXNP6.mjs} +0 -0
- package/dist/{chunk-Z2537DF6.mjs → chunk-IL5ENWCR.mjs} +3 -3
- package/dist/{chunk-WFMFC7R6.mjs → chunk-KCOHU7X7.mjs} +4 -4
- package/dist/{chunk-LL6F3WDX.mjs → chunk-P5QCU457.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-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 = {
|
|
@@ -841,23 +785,89 @@ var template = {
|
|
|
841
785
|
}
|
|
842
786
|
);
|
|
843
787
|
},
|
|
844
|
-
|
|
845
|
-
// ** Status **
|
|
846
|
-
plus: ({ className, fill }) => {
|
|
788
|
+
exclamation: ({ className, fill }) => {
|
|
847
789
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
848
790
|
"svg",
|
|
849
791
|
{
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
792
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
793
|
+
width: "18",
|
|
794
|
+
height: "18",
|
|
795
|
+
viewBox: "0 0 18 18",
|
|
853
796
|
fill: "none",
|
|
797
|
+
className,
|
|
798
|
+
children: fill ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
800
|
+
"path",
|
|
801
|
+
{
|
|
802
|
+
d: "M11.264 2.37077C11.2832 2.37715 11.3024 2.38353 11.3223 2.3901C12.3182 2.72483 13.1824 3.30575 13.9306 4.03468C13.9575 4.06039 13.9843 4.08609 14.0119 4.11257C14.1806 4.27693 14.33 4.45208 14.4754 4.63713C14.4981 4.66509 14.5208 4.69305 14.5442 4.72185C15.0188 5.31801 15.3774 6.01161 15.6224 6.73137C15.6303 6.75453 15.6382 6.77768 15.6464 6.80155C16.1308 8.2413 16.1125 9.82918 15.6224 11.2641C15.6105 11.2995 15.6105 11.2995 15.5983 11.3356C15.3948 11.9315 15.1066 12.5059 14.7335 13.0141C14.7221 13.0297 14.7107 13.0453 14.6989 13.0614C14.313 13.5865 13.8736 14.0779 13.3571 14.4772C13.3155 14.5109 13.3155 14.5109 13.273 14.5454C12.6801 15.0224 11.982 15.3801 11.264 15.6247C11.2408 15.6326 11.2177 15.6406 11.1938 15.6487C9.43757 16.2402 7.50979 16.0678 5.85241 15.2592C4.96204 14.8102 4.13267 14.1489 3.52213 13.3583C3.49962 13.3305 3.47711 13.3028 3.45392 13.2742C2.32855 11.8738 1.85507 9.99621 2.03839 8.22438C2.17342 7.0638 2.58402 5.9339 3.26407 4.98139C3.27714 4.96288 3.29022 4.94436 3.30369 4.92529C3.51689 4.62523 3.75292 4.35545 4.00958 4.09206C4.03773 4.06274 4.06588 4.03342 4.09403 4.00409C4.26597 3.8279 4.44681 3.67012 4.6404 3.5183C4.6683 3.49563 4.69621 3.47296 4.72496 3.4496C6.54339 2.00006 9.08031 1.63201 11.264 2.37077Z",
|
|
803
|
+
fill: "currentColor"
|
|
804
|
+
}
|
|
805
|
+
),
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
807
|
+
"path",
|
|
808
|
+
{
|
|
809
|
+
d: "M9.36648 5.85289C9.53634 5.9647 9.6533 6.12598 9.71812 6.32867C9.73452 6.40467 9.74201 6.47516 9.74238 6.55312C9.74254 6.57462 9.74269 6.59612 9.74284 6.61826C9.7429 6.64157 9.74296 6.66489 9.74302 6.68891C9.74315 6.71368 9.74329 6.73845 9.74344 6.76397C9.74385 6.84591 9.7441 6.92785 9.74431 7.00979C9.7444 7.03785 9.74448 7.06592 9.74457 7.09484C9.74497 7.22817 9.74528 7.3615 9.74545 7.49483C9.74568 7.66315 9.74639 7.83146 9.74732 7.99978C9.74787 8.11787 9.74805 8.23596 9.74812 8.35405C9.74823 8.41042 9.74847 8.46679 9.74886 8.52316C9.75351 9.23268 9.75351 9.23268 9.54833 9.48966C9.39246 9.65505 9.20768 9.73677 8.98973 9.75C8.78199 9.74035 8.59485 9.64627 8.44906 9.48814C8.28258 9.27909 8.24899 9.03597 8.25049 8.7678C8.25038 8.7429 8.25027 8.718 8.25015 8.69234C8.24987 8.61081 8.25006 8.5293 8.25027 8.44777C8.25023 8.39068 8.25017 8.33358 8.25009 8.27649C8.24999 8.15716 8.25013 8.03783 8.25043 7.9185C8.25079 7.76594 8.25058 7.6134 8.2502 7.46085C8.24997 7.34306 8.25004 7.22527 8.25021 7.10748C8.25025 7.05125 8.2502 6.99501 8.25005 6.93877C8.24989 6.86005 8.25014 6.78135 8.25049 6.70263C8.25036 6.67965 8.25023 6.65668 8.2501 6.63301C8.25225 6.37163 8.32078 6.1648 8.48128 5.96879C8.72644 5.71507 9.07274 5.68973 9.36648 5.85289Z",
|
|
810
|
+
fill: "white"
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
814
|
+
"path",
|
|
815
|
+
{
|
|
816
|
+
d: "M9.34541 10.8369C9.52938 10.9471 9.67125 11.1068 9.73271 11.3148C9.77656 11.529 9.73613 11.7317 9.62145 11.916C9.49889 12.0867 9.3528 12.1846 9.14957 12.2412C8.92053 12.2704 8.73922 12.2283 8.55045 12.0972C8.38043 11.959 8.27865 11.7781 8.25072 11.5592C8.24266 11.3506 8.30179 11.162 8.43381 10.9998C8.68322 10.7451 9.02878 10.6749 9.34541 10.8369Z",
|
|
817
|
+
fill: "white"
|
|
818
|
+
}
|
|
819
|
+
)
|
|
820
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
822
|
+
"path",
|
|
823
|
+
{
|
|
824
|
+
d: "M5.03711 3.84082C6.60875 2.5881 8.77805 2.2038 10.7188 2.72754L11.1035 2.84473L11.1064 2.8457C11.125 2.85187 11.144 2.85694 11.1631 2.86328V2.86426C11.9606 3.13233 12.6739 3.57547 13.3125 4.14258L13.582 4.39258L13.585 4.39551L13.666 4.47363C13.7385 4.54442 13.8078 4.61844 13.876 4.69629L14.082 4.94629L14.0869 4.95215L14.1562 5.03711C14.5346 5.51326 14.8361 6.06221 15.0586 6.6416L15.1494 6.89258V6.89355L15.1738 6.96387C15.5931 8.21222 15.6047 9.58552 15.2295 10.8506L15.1494 11.1025L15.1484 11.1045C15.1368 11.1391 15.1363 11.1401 15.125 11.1738C14.9596 11.6581 14.7354 12.1232 14.4541 12.542L14.3301 12.7178L14.3291 12.7197C14.3181 12.7348 14.3072 12.7501 14.2959 12.7656C13.9281 13.2659 13.5205 13.7197 13.0518 14.082L13.3457 14.4629L13.0508 14.0811L13.042 14.0889L12.958 14.1572C12.4859 14.5367 11.9342 14.8378 11.3535 15.0605L11.1025 15.1514H11.1016C11.0793 15.159 11.0571 15.1669 11.0342 15.1748C9.51234 15.6873 7.84224 15.5817 6.36426 14.9443L6.07129 14.8096C5.3482 14.4439 4.67072 13.9288 4.1377 13.3203L3.91797 13.0527L3.91016 13.0439L3.84277 12.959H3.8418C2.81057 11.6744 2.36571 9.93549 2.53516 8.28223C2.64545 7.33424 2.95228 6.41319 3.44727 5.60938L3.6709 5.27148L3.67285 5.26953C3.6858 5.2512 3.69858 5.23275 3.71191 5.21387L3.71094 5.21289C3.85636 5.00834 4.01615 4.81758 4.18945 4.62891L4.36816 4.44141L4.37012 4.43848C4.39734 4.41013 4.42493 4.38187 4.45215 4.35352C4.52879 4.27498 4.60794 4.19996 4.69043 4.12695L4.94922 3.91211L4.95605 3.90625C4.98272 3.88459 5.00872 3.86211 5.03613 3.83984L5.03711 3.84082Z",
|
|
825
|
+
stroke: "currentColor"
|
|
826
|
+
}
|
|
827
|
+
),
|
|
828
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
829
|
+
"path",
|
|
830
|
+
{
|
|
831
|
+
d: "M9.36648 5.85289C9.53634 5.9647 9.6533 6.12598 9.71812 6.32867C9.73452 6.40467 9.74201 6.47516 9.74238 6.55312C9.74254 6.57462 9.74269 6.59612 9.74284 6.61826C9.7429 6.64157 9.74296 6.66489 9.74302 6.68891C9.74315 6.71368 9.74329 6.73845 9.74344 6.76397C9.74385 6.84591 9.7441 6.92785 9.74431 7.00979C9.7444 7.03785 9.74448 7.06592 9.74457 7.09484C9.74497 7.22817 9.74528 7.3615 9.74545 7.49483C9.74568 7.66315 9.74639 7.83146 9.74732 7.99978C9.74787 8.11787 9.74805 8.23596 9.74812 8.35405C9.74823 8.41042 9.74847 8.46679 9.74886 8.52316C9.75351 9.23268 9.75351 9.23268 9.54833 9.48966C9.39246 9.65505 9.20768 9.73677 8.98973 9.75C8.78199 9.74035 8.59485 9.64627 8.44906 9.48814C8.28258 9.27909 8.24899 9.03597 8.25049 8.7678C8.25038 8.7429 8.25027 8.718 8.25015 8.69234C8.24987 8.61081 8.25006 8.5293 8.25027 8.44777C8.25023 8.39068 8.25017 8.33358 8.25009 8.27649C8.24999 8.15716 8.25013 8.03783 8.25043 7.9185C8.25079 7.76594 8.25058 7.6134 8.2502 7.46085C8.24997 7.34306 8.25004 7.22527 8.25021 7.10748C8.25025 7.05125 8.2502 6.99501 8.25005 6.93877C8.24989 6.86005 8.25014 6.78135 8.25049 6.70263C8.25036 6.67965 8.25023 6.65668 8.2501 6.63301C8.25225 6.37163 8.32078 6.1648 8.48128 5.96879C8.72644 5.71507 9.07274 5.68973 9.36648 5.85289Z",
|
|
832
|
+
fill: "currentColor"
|
|
833
|
+
}
|
|
834
|
+
),
|
|
835
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
836
|
+
"path",
|
|
837
|
+
{
|
|
838
|
+
d: "M9.34541 10.8369C9.52938 10.9471 9.67125 11.1068 9.73271 11.3148C9.77656 11.529 9.73613 11.7317 9.62145 11.916C9.49889 12.0867 9.3528 12.1846 9.14957 12.2412C8.92053 12.2704 8.73922 12.2283 8.55045 12.0972C8.38043 11.959 8.27865 11.7781 8.25072 11.5592C8.24266 11.3506 8.30179 11.162 8.43381 10.9998C8.68322 10.7451 9.02878 10.6749 9.34541 10.8369Z",
|
|
839
|
+
fill: "currentColor"
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
] })
|
|
843
|
+
}
|
|
844
|
+
);
|
|
845
|
+
},
|
|
846
|
+
close: ({ className }) => {
|
|
847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
848
|
+
"svg",
|
|
849
|
+
{
|
|
854
850
|
xmlns: "http://www.w3.org/2000/svg",
|
|
851
|
+
width: "27",
|
|
852
|
+
height: "27",
|
|
853
|
+
viewBox: "0 0 27 27",
|
|
854
|
+
fill: "none",
|
|
855
855
|
className,
|
|
856
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
857
|
+
"path",
|
|
858
|
+
{
|
|
859
|
+
fillRule: "evenodd",
|
|
860
|
+
clipRule: "evenodd",
|
|
861
|
+
d: "M6.24339 6.2645C6.39943 6.10887 6.61095 6.02146 6.83149 6.02146C7.05203 6.02146 7.26355 6.10887 7.41959 6.2645L13.4893 12.3255L19.5589 6.2645C19.6351 6.18285 19.727 6.11736 19.8291 6.07194C19.9312 6.02652 20.0414 6.0021 20.1531 6.00013C20.2648 5.99816 20.3758 6.01869 20.4795 6.06048C20.5831 6.10228 20.6772 6.16449 20.7562 6.2434C20.8353 6.32232 20.8976 6.41632 20.9394 6.51979C20.9813 6.62327 21.0018 6.73411 20.9999 6.84569C20.9979 6.95727 20.9734 7.06732 20.928 7.16926C20.8825 7.27119 20.8169 7.36294 20.7351 7.43902L14.6655 13.5L20.7351 19.561C20.8169 19.6371 20.8825 19.7288 20.928 19.8307C20.9734 19.9327 20.9979 20.0427 20.9999 20.1543C21.0018 20.2659 20.9813 20.3767 20.9394 20.4802C20.8976 20.5837 20.8353 20.6777 20.7562 20.7566C20.6772 20.8355 20.5831 20.8977 20.4795 20.9395C20.3758 20.9813 20.2648 21.0018 20.1531 20.9999C20.0414 20.9979 19.9312 20.9735 19.8291 20.9281C19.727 20.8826 19.6351 20.8172 19.5589 20.7355L13.4893 14.6745L7.41959 20.7355C7.26183 20.8823 7.05317 20.9622 6.83757 20.9584C6.62196 20.9546 6.41626 20.8674 6.26378 20.7151C6.1113 20.5629 6.02396 20.3575 6.02016 20.1422C6.01635 19.9269 6.09638 19.7185 6.24339 19.561L12.313 13.5L6.24339 7.43902C6.08754 7.2832 6 7.07198 6 6.85176C6 6.63154 6.08754 6.42032 6.24339 6.2645Z",
|
|
862
|
+
fill: "currentColor"
|
|
863
|
+
}
|
|
864
|
+
)
|
|
857
865
|
}
|
|
858
866
|
);
|
|
859
867
|
},
|
|
860
|
-
|
|
868
|
+
// ----------------------------------- old ---------------------------------
|
|
869
|
+
// ** Status **
|
|
870
|
+
plus: ({ className, fill }) => {
|
|
861
871
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
862
872
|
"svg",
|
|
863
873
|
{
|
|
@@ -867,7 +877,7 @@ var template = {
|
|
|
867
877
|
fill: "none",
|
|
868
878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
869
879
|
className,
|
|
870
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "
|
|
880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 4.5V19.5M19.5 12H4.5", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
871
881
|
}
|
|
872
882
|
);
|
|
873
883
|
},
|
|
@@ -4307,302 +4317,373 @@ var Icon = ({ name, size = "md", fill = false, className, onClick, ...props }) =
|
|
|
4307
4317
|
};
|
|
4308
4318
|
var Icon_default = Icon;
|
|
4309
4319
|
|
|
4310
|
-
// src/
|
|
4311
|
-
|
|
4312
|
-
var
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
onClick: () => props.onClick(props.option),
|
|
4320
|
-
ref: (node) => {
|
|
4321
|
-
props.isSelected && (node == null ? void 0 : node.scrollIntoView());
|
|
4322
|
-
},
|
|
4323
|
-
children: [
|
|
4324
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: option(), children: props.children }),
|
|
4325
|
-
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 }) })
|
|
4326
|
-
]
|
|
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
|
+
}
|
|
4327
4329
|
}
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
base: ["border-primary-main", "hover:bg-primary-soft", "hover:text-primary-main"],
|
|
4346
|
-
icon: "text-primary-main"
|
|
4347
|
-
},
|
|
4348
|
-
secondary: {
|
|
4349
|
-
base: ["border-secondary-main", "hover:bg-secondary-soft", "hover:text-secondary-main"],
|
|
4350
|
-
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
|
+
}
|
|
4351
4347
|
}
|
|
4352
|
-
}
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
base: "text-md px-[8px] py-[6.5px]"
|
|
4359
|
-
},
|
|
4360
|
-
lg: {
|
|
4361
|
-
base: "text-lg px-[10px] py-[8px]"
|
|
4362
|
-
},
|
|
4363
|
-
xl: {
|
|
4364
|
-
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
|
+
}
|
|
4365
4354
|
}
|
|
4366
4355
|
}
|
|
4367
|
-
},
|
|
4368
|
-
defaultVariants: {
|
|
4369
|
-
variant: "normal",
|
|
4370
|
-
color: "primary",
|
|
4371
|
-
size: "md"
|
|
4372
4356
|
}
|
|
4373
|
-
|
|
4357
|
+
return str;
|
|
4358
|
+
}
|
|
4374
4359
|
|
|
4375
4360
|
// src/components/select/select.tsx
|
|
4376
|
-
var
|
|
4377
|
-
var Select = (0,
|
|
4361
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4362
|
+
var Select = (0, import_react.forwardRef)((originalProps, ref) => {
|
|
4363
|
+
var _a;
|
|
4378
4364
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
4379
|
-
const { classNames, options, defaultOption, onChange, ...inputProps } = props;
|
|
4380
|
-
const slots = (0, import_react2.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
4381
4365
|
const {
|
|
4382
|
-
|
|
4383
|
-
selectedOption,
|
|
4384
|
-
optionWrapperHeight,
|
|
4385
|
-
selectWrapperRef,
|
|
4386
|
-
optionWrapperRef,
|
|
4387
|
-
handleToggleSelect,
|
|
4388
|
-
handleChangeOption,
|
|
4389
|
-
calculatePositionWithScroll
|
|
4390
|
-
} = useSelect({
|
|
4366
|
+
label,
|
|
4391
4367
|
options,
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
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]);
|
|
4395
4437
|
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
4396
|
-
const
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
)
|
|
4402
|
-
|
|
4403
|
-
()
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
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)(
|
|
4451
4505
|
"div",
|
|
4452
4506
|
{
|
|
4453
|
-
|
|
4507
|
+
ref: optionWrapperRef,
|
|
4508
|
+
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
4454
4509
|
style: {
|
|
4455
4510
|
position: "absolute",
|
|
4456
4511
|
top: position == null ? void 0 : position.top,
|
|
4457
4512
|
left: position == null ? void 0 : position.left,
|
|
4458
|
-
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"
|
|
4459
4518
|
},
|
|
4460
|
-
children: options.map((option) =>
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
))
|
|
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
|
+
})
|
|
4473
4531
|
}
|
|
4474
4532
|
),
|
|
4475
4533
|
document.body
|
|
4476
|
-
)
|
|
4534
|
+
)
|
|
4477
4535
|
] });
|
|
4478
4536
|
});
|
|
4479
4537
|
Select.displayName = "Select";
|
|
4480
4538
|
var select_default = Select;
|
|
4481
4539
|
var select = tv({
|
|
4482
4540
|
slots: {
|
|
4483
|
-
base: ["group/select", "flex
|
|
4484
|
-
|
|
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"],
|
|
4485
4546
|
selectWrapper: [
|
|
4486
4547
|
"flex",
|
|
4487
4548
|
"items-center",
|
|
4488
|
-
"
|
|
4489
|
-
"border
|
|
4490
|
-
"
|
|
4491
|
-
"
|
|
4492
|
-
"
|
|
4493
|
-
"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"
|
|
4494
4558
|
],
|
|
4495
4559
|
select: [
|
|
4496
|
-
"w-full",
|
|
4497
4560
|
"bg-transparent",
|
|
4498
|
-
"
|
|
4499
|
-
"
|
|
4500
|
-
"cursor-pointer",
|
|
4561
|
+
"w-full",
|
|
4562
|
+
"outline-none",
|
|
4501
4563
|
"placeholder:text-neutral-main",
|
|
4502
|
-
"
|
|
4503
|
-
"
|
|
4564
|
+
"text-neutral-dark",
|
|
4565
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
4566
|
+
"group-has-[p.error]/select:placeholder:text-danger-main"
|
|
4504
4567
|
],
|
|
4505
|
-
optionsWrapper: ["
|
|
4506
|
-
|
|
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"]
|
|
4507
4573
|
},
|
|
4508
4574
|
variants: {
|
|
4509
|
-
variant: {
|
|
4510
|
-
solid: {
|
|
4511
|
-
selectWrapper: "bg-trans-soft hover:bg-trans-light data-[expanded=true]:bg-trans-light group-has-[p]/select:bg-danger-soft"
|
|
4512
|
-
},
|
|
4513
|
-
normal: {
|
|
4514
|
-
selectWrapper: "border hover:bg-trans-soft data-[expanded=true]:bg-trans-soft"
|
|
4515
|
-
},
|
|
4516
|
-
line: {
|
|
4517
|
-
selectWrapper: "border-b !rounded-none hover:bg-trans-soft data-[expanded=true]:bg-trans-soft",
|
|
4518
|
-
optionsWrapper: "!rounded-none"
|
|
4519
|
-
}
|
|
4520
|
-
},
|
|
4521
4575
|
color: {
|
|
4522
4576
|
primary: {
|
|
4523
|
-
selectWrapper: "
|
|
4524
|
-
|
|
4525
|
-
select: "data-[expanded=true]:text-primary-main"
|
|
4577
|
+
selectWrapper: ["hover:text-primary-main"],
|
|
4578
|
+
option: ["hover:bg-primary-soft", "hover:text-primary-main"]
|
|
4526
4579
|
},
|
|
4527
4580
|
secondary: {
|
|
4528
|
-
selectWrapper: "
|
|
4529
|
-
|
|
4530
|
-
|
|
4581
|
+
selectWrapper: ["hover:text-secondary-main"],
|
|
4582
|
+
select: ["text-secondary-main"],
|
|
4583
|
+
option: ["hover:bg-secondary-soft", "hover:text-secondary-main"]
|
|
4531
4584
|
}
|
|
4532
4585
|
},
|
|
4533
4586
|
size: {
|
|
4534
4587
|
sm: {
|
|
4535
|
-
base: "text-sm gap-[
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
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"]
|
|
4539
4596
|
},
|
|
4540
4597
|
md: {
|
|
4541
|
-
base: "text-md gap-[
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
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"]
|
|
4545
4606
|
},
|
|
4546
4607
|
lg: {
|
|
4547
|
-
base: "text-lg gap-[
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
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"]
|
|
4551
4616
|
},
|
|
4552
4617
|
xl: {
|
|
4553
|
-
base: "text-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
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"]
|
|
4557
4626
|
}
|
|
4558
4627
|
},
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
selectWrapper: "rounded-none",
|
|
4563
|
-
optionsWrapper: "rounded-none"
|
|
4564
|
-
},
|
|
4565
|
-
full: {
|
|
4566
|
-
selectWrapper: "rounded-full"
|
|
4567
|
-
}
|
|
4628
|
+
direction: {
|
|
4629
|
+
vertical: "",
|
|
4630
|
+
horizon: ""
|
|
4568
4631
|
},
|
|
4569
|
-
|
|
4632
|
+
full: {
|
|
4570
4633
|
true: {
|
|
4571
|
-
|
|
4572
|
-
|
|
4634
|
+
base: ["w-full"],
|
|
4635
|
+
wrapper: ["w-full"],
|
|
4636
|
+
selectWrapper: ["w-full"]
|
|
4573
4637
|
}
|
|
4574
4638
|
},
|
|
4575
|
-
|
|
4639
|
+
disabled: {
|
|
4576
4640
|
true: {
|
|
4577
|
-
base: "
|
|
4578
|
-
selectWrapper:
|
|
4579
|
-
|
|
4580
|
-
|
|
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"]
|
|
4581
4657
|
}
|
|
4582
4658
|
},
|
|
4583
|
-
|
|
4584
|
-
true:
|
|
4585
|
-
|
|
4586
|
-
}
|
|
4659
|
+
isSelected: {
|
|
4660
|
+
true: "",
|
|
4661
|
+
false: ""
|
|
4587
4662
|
}
|
|
4588
4663
|
},
|
|
4589
|
-
defaultVariants: {
|
|
4590
|
-
variant: "solid",
|
|
4591
|
-
color: "primary",
|
|
4592
|
-
size: "md",
|
|
4593
|
-
fullWidth: false,
|
|
4594
|
-
isDisabled: false,
|
|
4595
|
-
isRequired: false
|
|
4596
|
-
},
|
|
4597
4664
|
compoundVariants: [
|
|
4598
4665
|
{
|
|
4599
|
-
|
|
4600
|
-
|
|
4666
|
+
color: "primary",
|
|
4667
|
+
isSelected: true,
|
|
4668
|
+
class: {
|
|
4669
|
+
option: "bg-primary-soft text-primary-main"
|
|
4670
|
+
}
|
|
4671
|
+
},
|
|
4672
|
+
{
|
|
4673
|
+
color: "secondary",
|
|
4674
|
+
isSelected: true,
|
|
4601
4675
|
class: {
|
|
4602
|
-
|
|
4676
|
+
option: "bg-secondary-soft text-secondary-main"
|
|
4603
4677
|
}
|
|
4604
4678
|
}
|
|
4605
|
-
]
|
|
4679
|
+
],
|
|
4680
|
+
defaultVariants: {
|
|
4681
|
+
color: "primary",
|
|
4682
|
+
size: "md",
|
|
4683
|
+
direction: "vertical",
|
|
4684
|
+
disabled: false,
|
|
4685
|
+
readonly: false
|
|
4686
|
+
}
|
|
4606
4687
|
});
|
|
4607
4688
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4608
4689
|
0 && (module.exports = {
|