@exem-ui/react 0.1.0 → 0.2.0
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/LICENSE +190 -0
- package/README.en.md +142 -0
- package/README.md +156 -18
- package/dist/index.d.mts +1166 -37
- package/dist/index.d.ts +1166 -37
- package/dist/index.js +3055 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3016 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +24 -143
- package/dist/Button-CMenVfb7.d.mts +0 -35
- package/dist/Button-CMenVfb7.d.ts +0 -35
- package/dist/Select-DMvWV_rF.d.mts +0 -94
- package/dist/Select-DMvWV_rF.d.ts +0 -94
- package/dist/avatar/index.d.mts +0 -37
- package/dist/avatar/index.d.ts +0 -37
- package/dist/avatar/index.js +0 -13
- package/dist/avatar/index.js.map +0 -1
- package/dist/avatar/index.mjs +0 -4
- package/dist/avatar/index.mjs.map +0 -1
- package/dist/badge/index.d.mts +0 -29
- package/dist/badge/index.d.ts +0 -29
- package/dist/badge/index.js +0 -12
- package/dist/badge/index.js.map +0 -1
- package/dist/badge/index.mjs +0 -3
- package/dist/badge/index.mjs.map +0 -1
- package/dist/breadcrumb/index.d.mts +0 -43
- package/dist/breadcrumb/index.d.ts +0 -43
- package/dist/breadcrumb/index.js +0 -13
- package/dist/breadcrumb/index.js.map +0 -1
- package/dist/breadcrumb/index.mjs +0 -4
- package/dist/breadcrumb/index.mjs.map +0 -1
- package/dist/button/index.d.mts +0 -9
- package/dist/button/index.d.ts +0 -9
- package/dist/button/index.js +0 -29
- package/dist/button/index.js.map +0 -1
- package/dist/button/index.mjs +0 -12
- package/dist/button/index.mjs.map +0 -1
- package/dist/checkbox/index.d.mts +0 -54
- package/dist/checkbox/index.d.ts +0 -54
- package/dist/checkbox/index.js +0 -13
- package/dist/checkbox/index.js.map +0 -1
- package/dist/checkbox/index.mjs +0 -4
- package/dist/checkbox/index.mjs.map +0 -1
- package/dist/chunk-34QIGWCT.mjs +0 -10
- package/dist/chunk-34QIGWCT.mjs.map +0 -1
- package/dist/chunk-3FPMWAQT.js +0 -30
- package/dist/chunk-3FPMWAQT.js.map +0 -1
- package/dist/chunk-3HMT3DQV.js +0 -104
- package/dist/chunk-3HMT3DQV.js.map +0 -1
- package/dist/chunk-4WAO7CUT.mjs +0 -95
- package/dist/chunk-4WAO7CUT.mjs.map +0 -1
- package/dist/chunk-5QX4TO4F.js +0 -61
- package/dist/chunk-5QX4TO4F.js.map +0 -1
- package/dist/chunk-5TEFN2CW.js +0 -97
- package/dist/chunk-5TEFN2CW.js.map +0 -1
- package/dist/chunk-5TES5PG6.js +0 -41
- package/dist/chunk-5TES5PG6.js.map +0 -1
- package/dist/chunk-5TVMECVF.js +0 -148
- package/dist/chunk-5TVMECVF.js.map +0 -1
- package/dist/chunk-5WGNZX7Z.mjs +0 -27
- package/dist/chunk-5WGNZX7Z.mjs.map +0 -1
- package/dist/chunk-AQ3OIM2T.js +0 -103
- package/dist/chunk-AQ3OIM2T.js.map +0 -1
- package/dist/chunk-AU5NTBK3.js +0 -361
- package/dist/chunk-AU5NTBK3.js.map +0 -1
- package/dist/chunk-DJHGCJR4.mjs +0 -224
- package/dist/chunk-DJHGCJR4.mjs.map +0 -1
- package/dist/chunk-DPUTW5KD.mjs +0 -74
- package/dist/chunk-DPUTW5KD.mjs.map +0 -1
- package/dist/chunk-E53FHDVN.mjs +0 -336
- package/dist/chunk-E53FHDVN.mjs.map +0 -1
- package/dist/chunk-ECRQD7UU.js +0 -82
- package/dist/chunk-ECRQD7UU.js.map +0 -1
- package/dist/chunk-FB4ESGOX.mjs +0 -59
- package/dist/chunk-FB4ESGOX.mjs.map +0 -1
- package/dist/chunk-FDX4IQK5.js +0 -76
- package/dist/chunk-FDX4IQK5.js.map +0 -1
- package/dist/chunk-FOMIUDRM.js +0 -96
- package/dist/chunk-FOMIUDRM.js.map +0 -1
- package/dist/chunk-FR5F3VTU.js +0 -139
- package/dist/chunk-FR5F3VTU.js.map +0 -1
- package/dist/chunk-GW53LH3I.mjs +0 -81
- package/dist/chunk-GW53LH3I.mjs.map +0 -1
- package/dist/chunk-GXMRIT5E.mjs +0 -94
- package/dist/chunk-GXMRIT5E.mjs.map +0 -1
- package/dist/chunk-IANSI7F7.mjs +0 -393
- package/dist/chunk-IANSI7F7.mjs.map +0 -1
- package/dist/chunk-IDM6MZHF.js +0 -415
- package/dist/chunk-IDM6MZHF.js.map +0 -1
- package/dist/chunk-J5ZYQ3TP.js +0 -104
- package/dist/chunk-J5ZYQ3TP.js.map +0 -1
- package/dist/chunk-KPAUBWZA.mjs +0 -39
- package/dist/chunk-KPAUBWZA.mjs.map +0 -1
- package/dist/chunk-L7P2NDST.mjs +0 -124
- package/dist/chunk-L7P2NDST.mjs.map +0 -1
- package/dist/chunk-M6OWN7QH.js +0 -118
- package/dist/chunk-M6OWN7QH.js.map +0 -1
- package/dist/chunk-MQVHREEI.js +0 -448
- package/dist/chunk-MQVHREEI.js.map +0 -1
- package/dist/chunk-MT47ECUN.js +0 -127
- package/dist/chunk-MT47ECUN.js.map +0 -1
- package/dist/chunk-N6U54JI4.mjs +0 -126
- package/dist/chunk-N6U54JI4.mjs.map +0 -1
- package/dist/chunk-NDG4LR3Q.js +0 -139
- package/dist/chunk-NDG4LR3Q.js.map +0 -1
- package/dist/chunk-PPD4BU4W.mjs +0 -80
- package/dist/chunk-PPD4BU4W.mjs.map +0 -1
- package/dist/chunk-PU5NO5EZ.js +0 -4
- package/dist/chunk-PU5NO5EZ.js.map +0 -1
- package/dist/chunk-Q442ZDTI.mjs +0 -117
- package/dist/chunk-Q442ZDTI.mjs.map +0 -1
- package/dist/chunk-QH23RO3C.mjs +0 -137
- package/dist/chunk-QH23RO3C.mjs.map +0 -1
- package/dist/chunk-REBHUF4L.js +0 -226
- package/dist/chunk-REBHUF4L.js.map +0 -1
- package/dist/chunk-RGB3QLQT.js +0 -275
- package/dist/chunk-RGB3QLQT.js.map +0 -1
- package/dist/chunk-T7U2QRLC.js +0 -94
- package/dist/chunk-T7U2QRLC.js.map +0 -1
- package/dist/chunk-TEHHJ3CS.mjs +0 -73
- package/dist/chunk-TEHHJ3CS.mjs.map +0 -1
- package/dist/chunk-TJY4MIBC.js +0 -117
- package/dist/chunk-TJY4MIBC.js.map +0 -1
- package/dist/chunk-VCMZQOQM.mjs +0 -102
- package/dist/chunk-VCMZQOQM.mjs.map +0 -1
- package/dist/chunk-VKN4H4WI.mjs +0 -3
- package/dist/chunk-VKN4H4WI.mjs.map +0 -1
- package/dist/chunk-VSB25XTY.js +0 -12
- package/dist/chunk-VSB25XTY.js.map +0 -1
- package/dist/chunk-VWTE74UT.mjs +0 -96
- package/dist/chunk-VWTE74UT.mjs.map +0 -1
- package/dist/chunk-WBTL7PBV.js +0 -105
- package/dist/chunk-WBTL7PBV.js.map +0 -1
- package/dist/chunk-WOK3EP3O.js +0 -83
- package/dist/chunk-WOK3EP3O.js.map +0 -1
- package/dist/chunk-WWT73GGM.mjs +0 -83
- package/dist/chunk-WWT73GGM.mjs.map +0 -1
- package/dist/chunk-XBDXTRK3.mjs +0 -102
- package/dist/chunk-XBDXTRK3.mjs.map +0 -1
- package/dist/chunk-YGBEKZWU.mjs +0 -81
- package/dist/chunk-YGBEKZWU.mjs.map +0 -1
- package/dist/chunk-YVFLRPFV.mjs +0 -72
- package/dist/chunk-YVFLRPFV.mjs.map +0 -1
- package/dist/chunk-ZMVBIQ2Z.mjs +0 -253
- package/dist/chunk-ZMVBIQ2Z.mjs.map +0 -1
- package/dist/chunk-ZWCMSHDP.mjs +0 -425
- package/dist/chunk-ZWCMSHDP.mjs.map +0 -1
- package/dist/flat/index.d.mts +0 -13
- package/dist/flat/index.d.ts +0 -13
- package/dist/flat/index.js +0 -31
- package/dist/flat/index.js.map +0 -1
- package/dist/flat/index.mjs +0 -10
- package/dist/flat/index.mjs.map +0 -1
- package/dist/flat/segment.d.mts +0 -39
- package/dist/flat/segment.d.ts +0 -39
- package/dist/flat/segment.js +0 -13
- package/dist/flat/segment.js.map +0 -1
- package/dist/flat/segment.mjs +0 -4
- package/dist/flat/segment.mjs.map +0 -1
- package/dist/flat/select.d.mts +0 -58
- package/dist/flat/select.d.ts +0 -58
- package/dist/flat/select.js +0 -14
- package/dist/flat/select.js.map +0 -1
- package/dist/flat/select.mjs +0 -5
- package/dist/flat/select.mjs.map +0 -1
- package/dist/flat/tooltip.d.mts +0 -98
- package/dist/flat/tooltip.d.ts +0 -98
- package/dist/flat/tooltip.js +0 -17
- package/dist/flat/tooltip.js.map +0 -1
- package/dist/flat/tooltip.mjs +0 -4
- package/dist/flat/tooltip.mjs.map +0 -1
- package/dist/index-CXip5Wb1.d.mts +0 -62
- package/dist/index-Drz3P-6Y.d.ts +0 -62
- package/dist/input/index.d.mts +0 -82
- package/dist/input/index.d.ts +0 -82
- package/dist/input/index.js +0 -22
- package/dist/input/index.js.map +0 -1
- package/dist/input/index.mjs +0 -5
- package/dist/input/index.mjs.map +0 -1
- package/dist/loading/index.d.mts +0 -54
- package/dist/loading/index.d.ts +0 -54
- package/dist/loading/index.js +0 -12
- package/dist/loading/index.js.map +0 -1
- package/dist/loading/index.mjs +0 -3
- package/dist/loading/index.mjs.map +0 -1
- package/dist/messageBox/index.d.mts +0 -33
- package/dist/messageBox/index.d.ts +0 -33
- package/dist/messageBox/index.js +0 -13
- package/dist/messageBox/index.js.map +0 -1
- package/dist/messageBox/index.mjs +0 -4
- package/dist/messageBox/index.mjs.map +0 -1
- package/dist/modal/index.d.mts +0 -97
- package/dist/modal/index.d.ts +0 -97
- package/dist/modal/index.js +0 -15
- package/dist/modal/index.js.map +0 -1
- package/dist/modal/index.mjs +0 -6
- package/dist/modal/index.mjs.map +0 -1
- package/dist/picker/index.d.mts +0 -12
- package/dist/picker/index.d.ts +0 -12
- package/dist/picker/index.js +0 -13
- package/dist/picker/index.js.map +0 -1
- package/dist/picker/index.mjs +0 -4
- package/dist/picker/index.mjs.map +0 -1
- package/dist/progress/index.d.mts +0 -36
- package/dist/progress/index.d.ts +0 -36
- package/dist/progress/index.js +0 -12
- package/dist/progress/index.js.map +0 -1
- package/dist/progress/index.mjs +0 -3
- package/dist/progress/index.mjs.map +0 -1
- package/dist/radio/index.d.mts +0 -39
- package/dist/radio/index.d.ts +0 -39
- package/dist/radio/index.js +0 -12
- package/dist/radio/index.js.map +0 -1
- package/dist/radio/index.mjs +0 -3
- package/dist/radio/index.mjs.map +0 -1
- package/dist/scrollArea/index.d.mts +0 -31
- package/dist/scrollArea/index.d.ts +0 -31
- package/dist/scrollArea/index.js +0 -16
- package/dist/scrollArea/index.js.map +0 -1
- package/dist/scrollArea/index.mjs +0 -3
- package/dist/scrollArea/index.mjs.map +0 -1
- package/dist/segment/index.d.mts +0 -46
- package/dist/segment/index.d.ts +0 -46
- package/dist/segment/index.js +0 -12
- package/dist/segment/index.js.map +0 -1
- package/dist/segment/index.mjs +0 -3
- package/dist/segment/index.mjs.map +0 -1
- package/dist/star/index.d.mts +0 -30
- package/dist/star/index.d.ts +0 -30
- package/dist/star/index.js +0 -12
- package/dist/star/index.js.map +0 -1
- package/dist/star/index.mjs +0 -3
- package/dist/star/index.mjs.map +0 -1
- package/dist/switch/index.d.mts +0 -32
- package/dist/switch/index.d.ts +0 -32
- package/dist/switch/index.js +0 -12
- package/dist/switch/index.js.map +0 -1
- package/dist/switch/index.mjs +0 -3
- package/dist/switch/index.mjs.map +0 -1
- package/dist/tabs/index.d.mts +0 -52
- package/dist/tabs/index.d.ts +0 -52
- package/dist/tabs/index.js +0 -12
- package/dist/tabs/index.js.map +0 -1
- package/dist/tabs/index.mjs +0 -3
- package/dist/tabs/index.mjs.map +0 -1
- package/dist/tag/index.d.mts +0 -68
- package/dist/tag/index.d.ts +0 -68
- package/dist/tag/index.js +0 -17
- package/dist/tag/index.js.map +0 -1
- package/dist/tag/index.mjs +0 -4
- package/dist/tag/index.mjs.map +0 -1
- package/dist/toast/index.d.mts +0 -175
- package/dist/toast/index.d.ts +0 -175
- package/dist/toast/index.js +0 -25
- package/dist/toast/index.js.map +0 -1
- package/dist/toast/index.mjs +0 -4
- package/dist/toast/index.mjs.map +0 -1
- package/dist/tooltip/index.d.mts +0 -26
- package/dist/tooltip/index.d.ts +0 -26
- package/dist/tooltip/index.js +0 -12
- package/dist/tooltip/index.js.map +0 -1
- package/dist/tooltip/index.mjs +0 -3
- package/dist/tooltip/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,150 +1,3075 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var chunkECRQD7UU_js = require('./chunk-ECRQD7UU.js');
|
|
19
|
-
var chunk5TEFN2CW_js = require('./chunk-5TEFN2CW.js');
|
|
20
|
-
var chunkREBHUF4L_js = require('./chunk-REBHUF4L.js');
|
|
21
|
-
var chunk5TVMECVF_js = require('./chunk-5TVMECVF.js');
|
|
22
|
-
require('./chunk-PU5NO5EZ.js');
|
|
23
|
-
require('./chunk-VSB25XTY.js');
|
|
24
|
-
var chunkNDG4LR3Q_js = require('./chunk-NDG4LR3Q.js');
|
|
25
|
-
require('./chunk-3FPMWAQT.js');
|
|
26
|
-
var chunkT7U2QRLC_js = require('./chunk-T7U2QRLC.js');
|
|
27
|
-
require('./chunk-FDX4IQK5.js');
|
|
28
|
-
var chunkMQVHREEI_js = require('./chunk-MQVHREEI.js');
|
|
29
|
-
require('./chunk-5M47B2XJ.js');
|
|
3
|
+
var chunk5M47B2XJ_js = require('./chunk-5M47B2XJ.js');
|
|
4
|
+
var utils = require('@exem-ui/core/utils');
|
|
5
|
+
var React2 = require('react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
8
|
+
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
9
|
+
var SelectPrimitive = require('@radix-ui/react-select');
|
|
10
|
+
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
11
|
+
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
12
|
+
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
13
|
+
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
14
|
+
var reactDayPicker = require('react-day-picker');
|
|
15
|
+
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
16
|
+
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
17
|
+
var sonner = require('sonner');
|
|
30
18
|
|
|
19
|
+
function _interopNamespace(e) {
|
|
20
|
+
if (e && e.__esModule) return e;
|
|
21
|
+
var n = Object.create(null);
|
|
22
|
+
if (e) {
|
|
23
|
+
Object.keys(e).forEach(function (k) {
|
|
24
|
+
if (k !== 'default') {
|
|
25
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
26
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return e[k]; }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
n.default = e;
|
|
34
|
+
return Object.freeze(n);
|
|
35
|
+
}
|
|
31
36
|
|
|
37
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
38
|
+
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
39
|
+
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
40
|
+
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
41
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
42
|
+
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
43
|
+
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
|
|
44
|
+
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
45
|
+
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
32
46
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
47
|
+
var SIZE_CONFIG = {
|
|
48
|
+
xsmall: {
|
|
49
|
+
container: "size-[16px] text-body-3",
|
|
50
|
+
initialPadding: "px-[2.5px] leading-none tracking-tight",
|
|
51
|
+
imagePadding: "p-[2px]",
|
|
52
|
+
iconSize: "size-[12px]"
|
|
53
|
+
},
|
|
54
|
+
small: {
|
|
55
|
+
container: "size-[20px] text-body-2",
|
|
56
|
+
initialPadding: "px-[3.5px]",
|
|
57
|
+
imagePadding: "p-[3px]",
|
|
58
|
+
iconSize: "size-[14px]"
|
|
59
|
+
},
|
|
60
|
+
medium: {
|
|
61
|
+
container: "size-[24px] text-body-2",
|
|
62
|
+
initialPadding: "px-[5.5px] py-[2px]",
|
|
63
|
+
imagePadding: "p-[4px]",
|
|
64
|
+
iconSize: "size-[16px]"
|
|
65
|
+
},
|
|
66
|
+
large: {
|
|
67
|
+
container: "size-[32px] text-title-2",
|
|
68
|
+
initialPadding: "px-[8px] py-[3.5px]",
|
|
69
|
+
imagePadding: "p-[6px]",
|
|
70
|
+
iconSize: "size-[20px]"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var avatarVariants = utils.cva(
|
|
74
|
+
"flex items-center justify-center rounded-[28px] text-center font-semibold",
|
|
75
|
+
{
|
|
76
|
+
variants: {
|
|
77
|
+
size: {
|
|
78
|
+
xsmall: SIZE_CONFIG.xsmall.container,
|
|
79
|
+
small: SIZE_CONFIG.small.container,
|
|
80
|
+
medium: SIZE_CONFIG.medium.container,
|
|
81
|
+
large: SIZE_CONFIG.large.container
|
|
82
|
+
},
|
|
83
|
+
type: {
|
|
84
|
+
initial: "bg-elevation-elevation-5 text-elevation-elevation-0",
|
|
85
|
+
image: "bg-elevation-elevation-4 text-elevation-elevation-0"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
compoundVariants: [
|
|
89
|
+
// Initial type variants
|
|
90
|
+
{ type: "initial", size: "xsmall", class: SIZE_CONFIG.xsmall.initialPadding },
|
|
91
|
+
{ type: "initial", size: "small", class: SIZE_CONFIG.small.initialPadding },
|
|
92
|
+
{ type: "initial", size: "medium", class: SIZE_CONFIG.medium.initialPadding },
|
|
93
|
+
{ type: "initial", size: "large", class: SIZE_CONFIG.large.initialPadding }
|
|
94
|
+
],
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
size: "medium",
|
|
97
|
+
type: "initial"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
var getInitial = (name) => {
|
|
102
|
+
return name ? name.charAt(0).toUpperCase() : "";
|
|
103
|
+
};
|
|
104
|
+
var renderInitialContent = (name) => {
|
|
105
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { children: getInitial(name) });
|
|
106
|
+
};
|
|
107
|
+
var renderImageContent = (src, alt, name) => {
|
|
108
|
+
return /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt: alt || name || "Avatar", className: "size-full rounded-full object-cover" });
|
|
109
|
+
};
|
|
110
|
+
var renderIconContent = (size = "medium") => {
|
|
111
|
+
const iconSize = SIZE_CONFIG[size].iconSize;
|
|
112
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.Person, { className: utils.cn("shrink-0", iconSize) });
|
|
113
|
+
};
|
|
114
|
+
var Avatar = React2.forwardRef(
|
|
115
|
+
({ className, size = "medium", type = "initial", name, src, alt, ...props }, ref) => {
|
|
116
|
+
const resolvedSize = size || "medium";
|
|
117
|
+
const isFallback = type === "image" && !src;
|
|
118
|
+
const fallbackPadding = isFallback ? SIZE_CONFIG[resolvedSize].imagePadding : void 0;
|
|
119
|
+
const renderContent = () => {
|
|
120
|
+
if (type === "initial") {
|
|
121
|
+
return renderInitialContent(name);
|
|
122
|
+
}
|
|
123
|
+
if (type === "image") {
|
|
124
|
+
return src ? renderImageContent(src, alt, name) : renderIconContent(resolvedSize);
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
ref,
|
|
132
|
+
className: utils.cn(avatarVariants({ size, type }), fallbackPadding, className),
|
|
133
|
+
...props,
|
|
134
|
+
children: renderContent()
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
Avatar.displayName = "Avatar";
|
|
140
|
+
var badgeVariants = utils.cva(
|
|
141
|
+
"inline-flex items-center rounded-strong border px-[4px] text-body-3 font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
142
|
+
{
|
|
143
|
+
variants: {
|
|
144
|
+
variant: {
|
|
145
|
+
accent: "border-transparent bg-solid-accent-default text-text-static-light",
|
|
146
|
+
"accent-disabled": "border-transparent bg-solid-accent-disabled text-text-inverse-disabled",
|
|
147
|
+
default: "border-transparent bg-elevation-elevation-3 text-text-secondary",
|
|
148
|
+
"default-disabled": "border-transparent bg-elevation-elevation-2 text-text-disabled"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
defaultVariants: {
|
|
152
|
+
variant: "default"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
var Badge = React2.forwardRef(
|
|
157
|
+
({ className, variant = "default", disabled = false, ...props }, ref) => {
|
|
158
|
+
const finalVariant = disabled ? `${variant}-disabled` : variant;
|
|
159
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
ref,
|
|
163
|
+
className: utils.cn(badgeVariants({ variant: finalVariant }), className),
|
|
164
|
+
...props
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
Badge.displayName = "Badge";
|
|
170
|
+
var StarRoundedEmpty = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
171
|
+
"svg",
|
|
172
|
+
{
|
|
173
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
174
|
+
fill: "none",
|
|
175
|
+
viewBox: "0 0 20 20",
|
|
176
|
+
width: "1em",
|
|
177
|
+
height: "1em",
|
|
178
|
+
"aria-hidden": "true",
|
|
179
|
+
...props,
|
|
180
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
181
|
+
"path",
|
|
182
|
+
{
|
|
183
|
+
stroke: "#cfcfcf",
|
|
184
|
+
strokeLinecap: "round",
|
|
185
|
+
strokeLinejoin: "round",
|
|
186
|
+
d: "m10 14.773 4.275 2.628a.656.656 0 0 0 .978-.716l-1.162-4.905 3.804-3.282a.66.66 0 0 0-.374-1.154l-4.993-.407-1.923-4.656a.653.653 0 0 0-1.21 0L7.473 6.937l-4.993.407a.661.661 0 0 0-.374 1.158l3.805 3.281-1.163 4.902a.656.656 0 0 0 .978.716z"
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
var StarRoundedFilled = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
192
|
+
"svg",
|
|
193
|
+
{
|
|
194
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
195
|
+
fill: "none",
|
|
196
|
+
viewBox: "0 0 20 20",
|
|
197
|
+
width: "1em",
|
|
198
|
+
height: "1em",
|
|
199
|
+
"aria-hidden": "true",
|
|
200
|
+
...props,
|
|
201
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
202
|
+
"path",
|
|
203
|
+
{
|
|
204
|
+
fill: "#FE9A00",
|
|
205
|
+
d: "m18.304 8.973-3.516 3.033 1.071 4.537a1.281 1.281 0 0 1-1.914 1.392L10 15.507l-3.948 2.428a1.28 1.28 0 0 1-1.911-1.392l1.075-4.537L1.7 8.973a1.286 1.286 0 0 1 .728-2.254l4.61-.372 1.778-4.303a1.278 1.278 0 0 1 2.364 0l1.778 4.303 4.61.372a1.286 1.286 0 0 1 .731 2.255z"
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
var Star = React2.forwardRef(
|
|
211
|
+
({ size = "medium", selected = false, className, onClick, ...props }, ref) => {
|
|
212
|
+
const sizeConfig = {
|
|
213
|
+
small: { width: 16, height: 16 },
|
|
214
|
+
medium: { width: 20, height: 20 },
|
|
215
|
+
large: { width: 24, height: 24 }
|
|
216
|
+
};
|
|
217
|
+
const config = sizeConfig[size];
|
|
218
|
+
return selected ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
219
|
+
StarRoundedFilled,
|
|
220
|
+
{
|
|
221
|
+
ref,
|
|
222
|
+
width: config.width,
|
|
223
|
+
height: config.height,
|
|
224
|
+
className: utils.cn("cursor-pointer transition-colors", className),
|
|
225
|
+
onClick,
|
|
226
|
+
...props
|
|
227
|
+
}
|
|
228
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
229
|
+
StarRoundedEmpty,
|
|
230
|
+
{
|
|
231
|
+
ref,
|
|
232
|
+
width: config.width,
|
|
233
|
+
height: config.height,
|
|
234
|
+
className: utils.cn("cursor-pointer transition-colors", className),
|
|
235
|
+
onClick,
|
|
236
|
+
...props
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
Star.displayName = "Star";
|
|
242
|
+
var tagVariants = utils.cva(
|
|
243
|
+
"inline-flex h-5 items-center gap-0.5 rounded-medium px-1 text-body-3 font-medium",
|
|
244
|
+
{
|
|
245
|
+
variants: {
|
|
246
|
+
color: {
|
|
247
|
+
mono: "text-tint-foreground-mono",
|
|
248
|
+
sky: "text-tint-foreground-sky",
|
|
249
|
+
red: "text-tint-foreground-red",
|
|
250
|
+
amber: "text-tint-foreground-amber",
|
|
251
|
+
green: "text-tint-foreground-green",
|
|
252
|
+
orange: "text-tint-foreground-orange",
|
|
253
|
+
cyan: "text-tint-foreground-cyan",
|
|
254
|
+
violet: "text-tint-foreground-violet",
|
|
255
|
+
pink: "text-tint-foreground-pink",
|
|
256
|
+
yellow: "text-tint-foreground-yellow",
|
|
257
|
+
lime: "text-tint-foreground-lime",
|
|
258
|
+
emerald: "text-tint-foreground-emerald",
|
|
259
|
+
teal: "text-tint-foreground-teal",
|
|
260
|
+
blue: "text-tint-foreground-blue",
|
|
261
|
+
indigo: "text-tint-foreground-indigo",
|
|
262
|
+
purple: "text-tint-foreground-purple",
|
|
263
|
+
fuchsia: "text-tint-foreground-fuchsia",
|
|
264
|
+
rose: "text-tint-foreground-rose"
|
|
265
|
+
},
|
|
266
|
+
type: {
|
|
267
|
+
fill: "",
|
|
268
|
+
line: "bg-component-tag border border-border-secondary"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
compoundVariants: [
|
|
272
|
+
{ color: "mono", type: "fill", className: "bg-tint-background-mono" },
|
|
273
|
+
{ color: "sky", type: "fill", className: "bg-tint-background-sky" },
|
|
274
|
+
{ color: "red", type: "fill", className: "bg-tint-background-red" },
|
|
275
|
+
{ color: "amber", type: "fill", className: "bg-tint-background-amber" },
|
|
276
|
+
{ color: "green", type: "fill", className: "bg-tint-background-green" },
|
|
277
|
+
{ color: "orange", type: "fill", className: "bg-tint-background-orange" },
|
|
278
|
+
{ color: "cyan", type: "fill", className: "bg-tint-background-cyan" },
|
|
279
|
+
{ color: "violet", type: "fill", className: "bg-tint-background-violet" },
|
|
280
|
+
{ color: "pink", type: "fill", className: "bg-tint-background-pink" },
|
|
281
|
+
{ color: "yellow", type: "fill", className: "bg-tint-background-yellow" },
|
|
282
|
+
{ color: "lime", type: "fill", className: "bg-tint-background-lime" },
|
|
283
|
+
{ color: "emerald", type: "fill", className: "bg-tint-background-emerald" },
|
|
284
|
+
{ color: "teal", type: "fill", className: "bg-tint-background-teal" },
|
|
285
|
+
{ color: "blue", type: "fill", className: "bg-tint-background-blue" },
|
|
286
|
+
{ color: "indigo", type: "fill", className: "bg-tint-background-indigo" },
|
|
287
|
+
{ color: "purple", type: "fill", className: "bg-tint-background-purple" },
|
|
288
|
+
{ color: "fuchsia", type: "fill", className: "bg-tint-background-fuchsia" },
|
|
289
|
+
{ color: "rose", type: "fill", className: "bg-tint-background-rose" }
|
|
290
|
+
],
|
|
291
|
+
defaultVariants: {
|
|
292
|
+
color: "mono",
|
|
293
|
+
type: "fill"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
var Tag = React2.forwardRef(
|
|
298
|
+
({
|
|
299
|
+
className,
|
|
300
|
+
color,
|
|
301
|
+
type = "fill",
|
|
302
|
+
leftIcon,
|
|
303
|
+
canDelete,
|
|
304
|
+
onDelete,
|
|
305
|
+
rightSlot,
|
|
306
|
+
children,
|
|
307
|
+
...props
|
|
308
|
+
}, ref) => {
|
|
309
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
"data-slot": "tag",
|
|
313
|
+
className: utils.cn(tagVariants({ color, type, className })),
|
|
314
|
+
ref,
|
|
315
|
+
...props,
|
|
316
|
+
children: [
|
|
317
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 size-3 items-center justify-center [&>svg]:size-3", children: leftIcon }),
|
|
318
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-0.5 text-body-3 font-medium", children }),
|
|
319
|
+
canDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
320
|
+
"button",
|
|
321
|
+
{
|
|
322
|
+
type: "button",
|
|
323
|
+
onClick: (e) => {
|
|
324
|
+
e.stopPropagation();
|
|
325
|
+
onDelete?.();
|
|
326
|
+
},
|
|
327
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.X, { type: "regular", className: "size-3 [&>*]:stroke-current [&>path]:fill-current" })
|
|
328
|
+
}
|
|
329
|
+
),
|
|
330
|
+
rightSlot && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto", children: rightSlot })
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
Tag.displayName = "Tag";
|
|
337
|
+
var DoubleTag = React2.forwardRef(
|
|
338
|
+
({ className, items, ...props }, ref) => {
|
|
339
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
340
|
+
"div",
|
|
341
|
+
{
|
|
342
|
+
className: utils.cn(
|
|
343
|
+
"flex w-fit overflow-hidden rounded-medium border border-border-secondary",
|
|
344
|
+
className
|
|
345
|
+
),
|
|
346
|
+
ref,
|
|
347
|
+
...props,
|
|
348
|
+
children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React2.Fragment, { children: [
|
|
349
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tag, { color: item.color, type: "line", className: "rounded-none border-none", children: item.content }),
|
|
350
|
+
index < items.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-[20px] w-px border-none bg-border-secondary" })
|
|
351
|
+
] }, index))
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
DoubleTag.displayName = "DoubleTag";
|
|
357
|
+
var Breadcrumb = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
358
|
+
Breadcrumb.List = React2.forwardRef(
|
|
359
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
360
|
+
"ol",
|
|
361
|
+
{
|
|
362
|
+
ref,
|
|
363
|
+
className: utils.cn(
|
|
364
|
+
"flex flex-wrap items-center gap-[4px] break-words text-body-2 text-text-tertiary",
|
|
365
|
+
className
|
|
366
|
+
),
|
|
367
|
+
...props
|
|
368
|
+
}
|
|
369
|
+
)
|
|
370
|
+
);
|
|
371
|
+
Breadcrumb.Item = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: utils.cn("inline-flex items-center", className), ...props }));
|
|
372
|
+
Breadcrumb.Link = React2.forwardRef(
|
|
373
|
+
({ asChild, className, ...props }, ref) => {
|
|
374
|
+
const Comp = asChild ? reactSlot.Slot : "a";
|
|
375
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ref, className: utils.cn("text-text-link", className), ...props });
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
Breadcrumb.Page = React2.forwardRef(
|
|
379
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
380
|
+
"span",
|
|
381
|
+
{
|
|
382
|
+
ref,
|
|
383
|
+
role: "link",
|
|
384
|
+
"aria-disabled": "true",
|
|
385
|
+
"aria-current": "page",
|
|
386
|
+
className: utils.cn("text-text-primary", className),
|
|
387
|
+
...props
|
|
388
|
+
}
|
|
389
|
+
)
|
|
390
|
+
);
|
|
391
|
+
Breadcrumb.Separator = React2.forwardRef(
|
|
392
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
393
|
+
"li",
|
|
394
|
+
{
|
|
395
|
+
ref,
|
|
396
|
+
role: "presentation",
|
|
397
|
+
"aria-hidden": "true",
|
|
398
|
+
className: utils.cn("[&>svg]:size-3.5", className),
|
|
399
|
+
...props,
|
|
400
|
+
children: children ?? "/"
|
|
401
|
+
}
|
|
402
|
+
)
|
|
403
|
+
);
|
|
404
|
+
Breadcrumb.Ellipsis = React2.forwardRef(
|
|
405
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
406
|
+
"span",
|
|
407
|
+
{
|
|
408
|
+
ref,
|
|
409
|
+
role: "presentation",
|
|
410
|
+
"aria-hidden": "true",
|
|
411
|
+
className: utils.cn("flex h-9 w-9 items-center justify-center", className),
|
|
412
|
+
...props,
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.MoreHorizontal, { type: "regular", className: "size-4" }),
|
|
415
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More" })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
);
|
|
420
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
421
|
+
Breadcrumb.List.displayName = "Breadcrumb.List";
|
|
422
|
+
Breadcrumb.Item.displayName = "Breadcrumb.Item";
|
|
423
|
+
Breadcrumb.Link.displayName = "Breadcrumb.Link";
|
|
424
|
+
Breadcrumb.Page.displayName = "Breadcrumb.Page";
|
|
425
|
+
Breadcrumb.Separator.displayName = "Breadcrumb.Separator";
|
|
426
|
+
Breadcrumb.Ellipsis.displayName = "Breadcrumb.Ellipsis";
|
|
427
|
+
var TabsContext = React2.createContext({ type: "primary" });
|
|
428
|
+
var useTabsContext = () => {
|
|
429
|
+
const context = React2.useContext(TabsContext);
|
|
430
|
+
if (!context) {
|
|
431
|
+
throw new Error("useTabsContext must be used within a TabsProvider");
|
|
432
|
+
}
|
|
433
|
+
return context;
|
|
434
|
+
};
|
|
435
|
+
var tabsListVariants = utils.cva("inline-flex items-center", {
|
|
436
|
+
variants: {
|
|
437
|
+
type: {
|
|
438
|
+
primary: "h-9 gap-5 border-b border-border-primary",
|
|
439
|
+
secondary: "h-8 gap-1"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
defaultVariants: {
|
|
443
|
+
type: "primary"
|
|
444
|
+
}
|
|
36
445
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
446
|
+
var tabsTriggerVariants = utils.cva(
|
|
447
|
+
"group inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-pretendard font-semibold text-body-2 leading-[140%] transition-all disabled:pointer-events-none disabled:opacity-50",
|
|
448
|
+
{
|
|
449
|
+
variants: {
|
|
450
|
+
type: {
|
|
451
|
+
primary: [
|
|
452
|
+
"h-9 border-b-2 border-transparent p-0 text-text-tertiary",
|
|
453
|
+
"hover:text-text-primary",
|
|
454
|
+
"data-[state=active]:border-border-focused data-[state=active]:text-text-primary"
|
|
455
|
+
],
|
|
456
|
+
secondary: [
|
|
457
|
+
"h-8 rounded-strong px-2 text-text-tertiary",
|
|
458
|
+
"hover:text-text-primary",
|
|
459
|
+
"data-[state=active]:rounded-medium data-[state=active]:bg-elevation-elevation-2 data-[state=active]:text-text-primary"
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
defaultVariants: {
|
|
464
|
+
type: "primary"
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
var Tabs = React2.forwardRef(
|
|
469
|
+
({ type = "primary", children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: { type }, children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { ref, ...props, children }) })
|
|
470
|
+
);
|
|
471
|
+
Tabs.List = React2.forwardRef(
|
|
472
|
+
({ className, ...props }, ref) => {
|
|
473
|
+
const { type } = useTabsContext();
|
|
474
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
475
|
+
TabsPrimitive__namespace.List,
|
|
476
|
+
{
|
|
477
|
+
ref,
|
|
478
|
+
className: utils.cn(tabsListVariants({ type }), className),
|
|
479
|
+
...props
|
|
480
|
+
}
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
);
|
|
484
|
+
Tabs.Trigger = React2.forwardRef(
|
|
485
|
+
({ className, leftIcon, rightIcon, badge, children, ...props }, ref) => {
|
|
486
|
+
const { type } = useTabsContext();
|
|
487
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
488
|
+
TabsPrimitive__namespace.Trigger,
|
|
489
|
+
{
|
|
490
|
+
ref,
|
|
491
|
+
className: utils.cn(tabsTriggerVariants({ type }), className),
|
|
492
|
+
...props,
|
|
493
|
+
children: [
|
|
494
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-4", children: leftIcon }),
|
|
495
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
|
|
496
|
+
children,
|
|
497
|
+
badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-tertiary group-data-[state=active]:text-text-accent", children: badge })
|
|
498
|
+
] }),
|
|
499
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-4", children: rightIcon })
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
Tabs.Content = React2.forwardRef(
|
|
506
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Content, { ref, className: utils.cn(className), ...props })
|
|
507
|
+
);
|
|
508
|
+
Tabs.displayName = "Tabs";
|
|
509
|
+
Tabs.List.displayName = "Tabs.List";
|
|
510
|
+
Tabs.Trigger.displayName = "Tabs.Trigger";
|
|
511
|
+
Tabs.Content.displayName = "Tabs.Content";
|
|
512
|
+
var colorStyles = {
|
|
513
|
+
accent: {
|
|
514
|
+
contained: {
|
|
515
|
+
button: "bg-solid-accent-default hover:bg-solid-accent-hovered disabled:bg-solid-accent-disabled",
|
|
516
|
+
icon: "text-icon-static-light group-disabled/button:text-icon-inverse-disabled",
|
|
517
|
+
text: "text-text-static-light group-disabled/button:text-text-inverse-disabled"
|
|
518
|
+
},
|
|
519
|
+
outlined: {
|
|
520
|
+
button: "border border-border-accent hover:bg-elevation-accent disabled:border-border-accent-disabled",
|
|
521
|
+
icon: "text-text-accent group-disabled/button:text-text-accent-disabled",
|
|
522
|
+
text: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
523
|
+
},
|
|
524
|
+
invisible: {
|
|
525
|
+
button: "hover:bg-elevation-accent",
|
|
526
|
+
icon: "text-text-accent group-disabled/button:text-text-accent-disabled",
|
|
527
|
+
text: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
assistive: {
|
|
531
|
+
contained: {
|
|
532
|
+
button: "bg-elevation-elevation-2 hover:bg-elevation-elevation-3 disabled:bg-elevation-elevation-2",
|
|
533
|
+
icon: "text-icon-secondary group-disabled/button:text-icon-disabled",
|
|
534
|
+
text: "text-text-secondary group-disabled/button:text-text-disabled"
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
critical: {
|
|
538
|
+
contained: {
|
|
539
|
+
button: "bg-solid-critical-default hover:bg-solid-critical-hovered disabled:bg-solid-critical-disabled",
|
|
540
|
+
icon: "text-icon-static-light group-disabled/button:text-icon-inverse-disabled",
|
|
541
|
+
text: "text-text-static-light group-disabled/button:text-text-inverse-disabled"
|
|
542
|
+
},
|
|
543
|
+
outlined: {
|
|
544
|
+
button: "border border-border-critical hover:bg-elevation-critical disabled:border-border-critical-disabled",
|
|
545
|
+
icon: "text-text-critical group-disabled/button:text-text-critical-disabled",
|
|
546
|
+
text: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
547
|
+
},
|
|
548
|
+
invisible: {
|
|
549
|
+
button: "hover:bg-elevation-critical",
|
|
550
|
+
icon: "text-text-critical group-disabled/button:text-text-critical-disabled",
|
|
551
|
+
text: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
inverse: {
|
|
555
|
+
contained: {
|
|
556
|
+
button: "bg-elevation-elevation-0 hover:bg-elevation-elevation-2 disabled:bg-elevation-elevation-2",
|
|
557
|
+
icon: "text-icon-secondary group-disabled/button:text-icon-disabled",
|
|
558
|
+
text: "text-text-secondary group-disabled/button:text-text-disabled"
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
primary: {
|
|
562
|
+
contained: {
|
|
563
|
+
button: "bg-solid-primary-default hover:bg-solid-primary-hovered disabled:bg-solid-primary-disabled",
|
|
564
|
+
icon: "text-icon-inverse group-disabled/button:text-icon-inverse",
|
|
565
|
+
text: "text-text-inverse group-disabled/button:text-text-inverse"
|
|
566
|
+
},
|
|
567
|
+
outlined: {
|
|
568
|
+
button: "border border-border-secondary hover:bg-elevation-elevation-2 disabled:border-border-secondary",
|
|
569
|
+
icon: "text-icon-secondary group-disabled/button:text-icon-disabled",
|
|
570
|
+
text: "text-text-secondary group-disabled/button:text-text-disabled"
|
|
571
|
+
},
|
|
572
|
+
invisible: {
|
|
573
|
+
button: "hover:bg-elevation-elevation-2",
|
|
574
|
+
icon: "text-icon-secondary group-disabled/button:text-icon-disabled",
|
|
575
|
+
text: "text-text-secondary group-disabled/button:text-text-disabled"
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
var buttonVariants = utils.cva(
|
|
580
|
+
"inline-flex w-fit shrink-0 cursor-pointer flex-row items-center justify-center rounded-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
581
|
+
{
|
|
582
|
+
compoundVariants: [
|
|
583
|
+
// Primary 색상 조합
|
|
584
|
+
{
|
|
585
|
+
className: colorStyles.primary.contained.button,
|
|
586
|
+
color: "primary",
|
|
587
|
+
variant: "contained"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
className: colorStyles.primary.outlined.button,
|
|
591
|
+
color: "primary",
|
|
592
|
+
variant: "outlined"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
className: colorStyles.primary.invisible.button,
|
|
596
|
+
color: "primary",
|
|
597
|
+
variant: "invisible"
|
|
598
|
+
},
|
|
599
|
+
// Accent 색상 조합
|
|
600
|
+
{
|
|
601
|
+
className: colorStyles.accent.contained.button,
|
|
602
|
+
color: "accent",
|
|
603
|
+
variant: "contained"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
className: colorStyles.accent.outlined.button,
|
|
607
|
+
color: "accent",
|
|
608
|
+
variant: "outlined"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
className: colorStyles.accent.invisible.button,
|
|
612
|
+
color: "accent",
|
|
613
|
+
variant: "invisible"
|
|
614
|
+
},
|
|
615
|
+
// Critical 색상 조합
|
|
616
|
+
{
|
|
617
|
+
className: colorStyles.critical.contained.button,
|
|
618
|
+
color: "critical",
|
|
619
|
+
variant: "contained"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
className: colorStyles.critical.outlined.button,
|
|
623
|
+
color: "critical",
|
|
624
|
+
variant: "outlined"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
className: colorStyles.critical.invisible.button,
|
|
628
|
+
color: "critical",
|
|
629
|
+
variant: "invisible"
|
|
630
|
+
},
|
|
631
|
+
// Assistive 색상 조합 (contained만 지원)
|
|
632
|
+
{
|
|
633
|
+
className: colorStyles.assistive.contained.button,
|
|
634
|
+
color: "assistive",
|
|
635
|
+
variant: "contained"
|
|
636
|
+
},
|
|
637
|
+
// Inverse 색상 조합 (contained만 지원)
|
|
638
|
+
{
|
|
639
|
+
className: colorStyles.inverse.contained.button,
|
|
640
|
+
color: "inverse",
|
|
641
|
+
variant: "contained"
|
|
642
|
+
}
|
|
643
|
+
],
|
|
644
|
+
defaultVariants: {
|
|
645
|
+
color: "primary",
|
|
646
|
+
size: "medium",
|
|
647
|
+
variant: "contained"
|
|
648
|
+
},
|
|
649
|
+
variants: {
|
|
650
|
+
color: {
|
|
651
|
+
accent: "",
|
|
652
|
+
assistive: "",
|
|
653
|
+
critical: "",
|
|
654
|
+
inverse: "",
|
|
655
|
+
primary: ""
|
|
656
|
+
},
|
|
657
|
+
size: {
|
|
658
|
+
xsmall: "h-6 gap-0 px-1 text-body-3 font-medium",
|
|
659
|
+
small: "h-7 gap-0.5 px-1.5 text-body-2 font-medium",
|
|
660
|
+
medium: "h-8 gap-0.5 px-2 text-body-2 font-medium",
|
|
661
|
+
large: "h-10 gap-1 px-2.5 text-body-1 font-medium",
|
|
662
|
+
xlarge: "h-12 gap-1 px-3 text-title-2 font-medium"
|
|
663
|
+
},
|
|
664
|
+
variant: {
|
|
665
|
+
contained: "",
|
|
666
|
+
outlined: "bg-transparent",
|
|
667
|
+
invisible: "bg-transparent"
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
);
|
|
672
|
+
var IconSize = {
|
|
673
|
+
xsmall: "h-4 w-4",
|
|
674
|
+
small: "h-4 w-4",
|
|
675
|
+
medium: "h-4 w-4",
|
|
676
|
+
large: "h-5 w-5",
|
|
677
|
+
xlarge: "h-6 w-6"
|
|
678
|
+
};
|
|
679
|
+
var Button = React2.forwardRef(
|
|
680
|
+
({
|
|
681
|
+
className,
|
|
682
|
+
variant = "contained",
|
|
683
|
+
color = "primary",
|
|
684
|
+
size = "medium",
|
|
685
|
+
icon,
|
|
686
|
+
children,
|
|
687
|
+
...props
|
|
688
|
+
}, ref) => {
|
|
689
|
+
const validColorStyle = color === "assistive" || color === "inverse" ? colorStyles[color].contained : colorStyles[color][variant];
|
|
690
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
691
|
+
icon && React2.cloneElement(icon, {
|
|
692
|
+
className: utils.cn(
|
|
693
|
+
"shrink-0 [&>path]:fill-current",
|
|
694
|
+
validColorStyle.icon,
|
|
695
|
+
icon.props.className,
|
|
696
|
+
IconSize[size ?? "medium"]
|
|
697
|
+
)
|
|
698
|
+
}),
|
|
699
|
+
typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
700
|
+
"span",
|
|
701
|
+
{
|
|
702
|
+
className: utils.cn("truncate", size === "xlarge" ? "px-1" : "px-0.5", validColorStyle.text),
|
|
703
|
+
children
|
|
704
|
+
}
|
|
705
|
+
) : children
|
|
706
|
+
] });
|
|
707
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
708
|
+
"button",
|
|
709
|
+
{
|
|
710
|
+
className: utils.cn(
|
|
711
|
+
buttonVariants({
|
|
712
|
+
className,
|
|
713
|
+
color,
|
|
714
|
+
size,
|
|
715
|
+
variant
|
|
716
|
+
}),
|
|
717
|
+
"group/button"
|
|
718
|
+
),
|
|
719
|
+
ref,
|
|
720
|
+
...props,
|
|
721
|
+
children: content
|
|
722
|
+
}
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
);
|
|
726
|
+
Button.displayName = "Button";
|
|
727
|
+
var segmentListVariants = utils.cva(
|
|
728
|
+
"inline-flex items-center overflow-hidden rounded-medium bg-elevation-elevation-2",
|
|
729
|
+
{
|
|
730
|
+
variants: {
|
|
731
|
+
size: {
|
|
732
|
+
small: "h-7 gap-0 p-0.5",
|
|
733
|
+
medium: "h-8 gap-0 p-0.5",
|
|
734
|
+
large: "h-10 gap-0 p-0.5"
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
defaultVariants: {
|
|
738
|
+
size: "medium"
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
);
|
|
742
|
+
var segmentItemVariants = utils.cva(
|
|
743
|
+
[
|
|
744
|
+
"flex flex-1 items-center justify-center rounded-weak",
|
|
745
|
+
"focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring",
|
|
746
|
+
"disabled:cursor-not-allowed",
|
|
747
|
+
"data-[state=active]:bg-component-segmentedOption data-[state=active]:text-text-primary data-[state=active]:shadow-weak",
|
|
748
|
+
"data-[state=inactive]:text-text-tertiary data-[state=inactive]:disabled:text-text-disabled",
|
|
749
|
+
"transition-colors duration-200 ease-in-out"
|
|
750
|
+
],
|
|
751
|
+
{
|
|
752
|
+
variants: {
|
|
753
|
+
size: {
|
|
754
|
+
small: "h-6 gap-0.5 text-body-3 font-medium",
|
|
755
|
+
medium: "h-7 gap-1 text-body-2 font-medium",
|
|
756
|
+
large: "h-9 gap-1.5 text-body-2 font-medium"
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
defaultVariants: {
|
|
760
|
+
size: "medium"
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
var segmentIconVariants = utils.cva("flex items-center justify-center", {
|
|
765
|
+
variants: {
|
|
766
|
+
size: {
|
|
767
|
+
small: "size-4",
|
|
768
|
+
medium: "size-4",
|
|
769
|
+
large: "size-5"
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
defaultVariants: {
|
|
773
|
+
size: "medium"
|
|
774
|
+
}
|
|
40
775
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
776
|
+
var SegmentContext = React2.createContext(void 0);
|
|
777
|
+
var useSegmentContext = () => {
|
|
778
|
+
const context = React2.useContext(SegmentContext);
|
|
779
|
+
if (!context) {
|
|
780
|
+
throw new Error("Segment components must be used within a Segment");
|
|
781
|
+
}
|
|
782
|
+
return context;
|
|
783
|
+
};
|
|
784
|
+
var Segment = React2.forwardRef(
|
|
785
|
+
({ size = "medium", children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SegmentContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { ref, ...props, children }) })
|
|
786
|
+
);
|
|
787
|
+
Segment.List = React2.forwardRef(
|
|
788
|
+
({ className, ...props }, ref) => {
|
|
789
|
+
const { size } = useSegmentContext();
|
|
790
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
791
|
+
TabsPrimitive__namespace.List,
|
|
792
|
+
{
|
|
793
|
+
ref,
|
|
794
|
+
className: utils.cn(segmentListVariants({ size }), className),
|
|
795
|
+
...props
|
|
796
|
+
}
|
|
797
|
+
);
|
|
798
|
+
}
|
|
799
|
+
);
|
|
800
|
+
Segment.Item = React2.forwardRef(
|
|
801
|
+
({ className, leftIcon, children, ...props }, ref) => {
|
|
802
|
+
const { size } = useSegmentContext();
|
|
803
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
804
|
+
TabsPrimitive__namespace.Trigger,
|
|
805
|
+
{
|
|
806
|
+
ref,
|
|
807
|
+
className: utils.cn(segmentItemVariants({ size }), className),
|
|
808
|
+
...props,
|
|
809
|
+
children: [
|
|
810
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: utils.cn(segmentIconVariants({ size })), children: leftIcon }),
|
|
811
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children })
|
|
812
|
+
]
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
);
|
|
817
|
+
Segment.Content = React2.forwardRef(
|
|
818
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
819
|
+
TabsPrimitive__namespace.Content,
|
|
820
|
+
{
|
|
821
|
+
ref,
|
|
822
|
+
className: utils.cn(
|
|
823
|
+
"ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
824
|
+
className
|
|
825
|
+
),
|
|
826
|
+
...props
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
);
|
|
830
|
+
Segment.displayName = "Segment";
|
|
831
|
+
Segment.List.displayName = "Segment.List";
|
|
832
|
+
Segment.Content.displayName = "Segment.Content";
|
|
833
|
+
Segment.Item.displayName = "Segment.Item";
|
|
834
|
+
var commonInputVariants = {
|
|
835
|
+
// Container variants - 전체 컴포넌트 래퍼
|
|
836
|
+
container: utils.cva("flex flex-col"),
|
|
837
|
+
// Label variants - 라벨 텍스트
|
|
838
|
+
label: utils.cva("inline-block font-regular text-text-primary", {
|
|
839
|
+
variants: {
|
|
840
|
+
size: {
|
|
841
|
+
xsmall: "mb-[2px] text-body-3",
|
|
842
|
+
small: "mb-[4px] text-body-2",
|
|
843
|
+
medium: "mb-[4px] text-body-2",
|
|
844
|
+
large: "mb-[6px] text-body-1"
|
|
845
|
+
},
|
|
846
|
+
disabled: {
|
|
847
|
+
true: "text-text-disabled"
|
|
848
|
+
},
|
|
849
|
+
required: {
|
|
850
|
+
true: 'after:ml-0.5 after:text-text-critical after:content-["*"]'
|
|
851
|
+
}
|
|
852
|
+
},
|
|
853
|
+
compoundVariants: [
|
|
854
|
+
{
|
|
855
|
+
required: true,
|
|
856
|
+
disabled: true,
|
|
857
|
+
className: "after:text-text-disabled"
|
|
858
|
+
}
|
|
859
|
+
],
|
|
860
|
+
defaultVariants: { size: "medium" }
|
|
861
|
+
}),
|
|
862
|
+
// Description variants - 설명 텍스트
|
|
863
|
+
description: utils.cva("mt-0.5 inline-block text-text-tertiary", {
|
|
864
|
+
variants: {
|
|
865
|
+
size: {
|
|
866
|
+
xsmall: "text-caption",
|
|
867
|
+
small: "text-body-3",
|
|
868
|
+
medium: "text-body-3",
|
|
869
|
+
large: "text-body-2"
|
|
870
|
+
},
|
|
871
|
+
error: {
|
|
872
|
+
true: "text-text-critical"
|
|
873
|
+
},
|
|
874
|
+
disabled: {
|
|
875
|
+
true: "text-text-disabled"
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
compoundVariants: [
|
|
879
|
+
{
|
|
880
|
+
error: true,
|
|
881
|
+
disabled: true,
|
|
882
|
+
className: "text-text-disabled"
|
|
883
|
+
// disabled 우선 적용
|
|
884
|
+
}
|
|
885
|
+
],
|
|
886
|
+
defaultVariants: { size: "medium" }
|
|
887
|
+
}),
|
|
888
|
+
// Icon variants - 아이콘 크기
|
|
889
|
+
icon: utils.cva("shrink-0", {
|
|
890
|
+
variants: {
|
|
891
|
+
size: {
|
|
892
|
+
xsmall: "size-4",
|
|
893
|
+
small: "size-4",
|
|
894
|
+
medium: "size-4",
|
|
895
|
+
large: "size-5"
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
defaultVariants: { size: "medium" }
|
|
899
|
+
})
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
// src/input/selectVariants.ts
|
|
903
|
+
var selectVariants = {
|
|
904
|
+
container: commonInputVariants.container,
|
|
905
|
+
content: utils.cn(
|
|
906
|
+
"relative border border-border-primary z-50 min-w-[8rem] overflow-hidden rounded-medium bg-background-overlay shadow-weak",
|
|
907
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
908
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1"
|
|
909
|
+
),
|
|
910
|
+
description: commonInputVariants.description,
|
|
911
|
+
iconSize: commonInputVariants.icon,
|
|
912
|
+
item: utils.cva(
|
|
913
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-weak px-2 text-body-2 text-text-primary outline-none hover:bg-elevation-elevation-2 data-[disabled]:pointer-events-none data-[state=checked]:bg-elevation-accent data-[disabled]:text-text-disabled",
|
|
914
|
+
{
|
|
915
|
+
defaultVariants: { size: "medium" },
|
|
916
|
+
variants: {
|
|
917
|
+
size: {
|
|
918
|
+
xsmall: "h-6",
|
|
919
|
+
small: "h-7",
|
|
920
|
+
medium: "h-8",
|
|
921
|
+
large: "h-10"
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
),
|
|
926
|
+
itemText: utils.cva("truncate flex items-center flex-1 min-w-0", {
|
|
927
|
+
defaultVariants: { size: "medium" },
|
|
928
|
+
variants: {
|
|
929
|
+
size: {
|
|
930
|
+
xsmall: "h-6",
|
|
931
|
+
small: "h-7",
|
|
932
|
+
medium: "h-8",
|
|
933
|
+
large: "h-10"
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
}),
|
|
937
|
+
label: commonInputVariants.label,
|
|
938
|
+
trigger: utils.cva(
|
|
939
|
+
"group flex w-full items-center justify-between rounded-medium outline-none disabled:cursor-not-allowed disabled:bg-elevation-elevation-2 disabled:text-text-disabled data-[state=open]:border data-[state=open]:border-border-focused [&>span]:line-clamp-1 [&[data-placeholder]]:text-text-tertiary [&_svg]:text-icon-primary",
|
|
940
|
+
{
|
|
941
|
+
compoundVariants: [
|
|
942
|
+
{
|
|
943
|
+
className: "border-border-accent text-tint-foreground-sky bg-elevation-accent [&[data-placeholder]]:text-tint-foreground-sky [&_svg]:text-tint-foreground-sky",
|
|
944
|
+
focus: true,
|
|
945
|
+
variant: "line"
|
|
946
|
+
},
|
|
947
|
+
// active + fill: 배경만 accent로 변경
|
|
948
|
+
{
|
|
949
|
+
className: "bg-elevation-accent text-tint-foreground-sky [&[data-placeholder]]:text-tint-foreground-sky [&_svg]:text-tint-foreground-sky",
|
|
950
|
+
active: true,
|
|
951
|
+
variant: "fill"
|
|
952
|
+
},
|
|
953
|
+
// active + line: 배경 accent + 테두리 accent
|
|
954
|
+
{
|
|
955
|
+
className: "bg-elevation-accent border-border-accent text-tint-foreground-sky [&[data-placeholder]]:text-tint-foreground-sky [&_svg]:text-tint-foreground-sky",
|
|
956
|
+
active: true,
|
|
957
|
+
variant: "line"
|
|
958
|
+
}
|
|
959
|
+
],
|
|
960
|
+
defaultVariants: {
|
|
961
|
+
active: false,
|
|
962
|
+
error: false,
|
|
963
|
+
focus: false,
|
|
964
|
+
size: "medium",
|
|
965
|
+
variant: "fill"
|
|
966
|
+
},
|
|
967
|
+
variants: {
|
|
968
|
+
active: {
|
|
969
|
+
false: "",
|
|
970
|
+
true: ""
|
|
971
|
+
},
|
|
972
|
+
error: {
|
|
973
|
+
false: "",
|
|
974
|
+
true: "border !border-border-critical"
|
|
975
|
+
},
|
|
976
|
+
focus: {
|
|
977
|
+
false: "",
|
|
978
|
+
// 현재는 line 타입만 focus 가능
|
|
979
|
+
true: ""
|
|
980
|
+
},
|
|
981
|
+
size: {
|
|
982
|
+
xsmall: "h-6 px-[4px] text-body-3",
|
|
983
|
+
small: "h-7 px-[6px] text-body-2",
|
|
984
|
+
medium: "h-8 px-[8px] text-body-2",
|
|
985
|
+
large: "h-10 px-[10px] text-body-1"
|
|
986
|
+
},
|
|
987
|
+
variant: {
|
|
988
|
+
fill: "bg-elevation-elevation-2",
|
|
989
|
+
line: "border-border-primary border"
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
),
|
|
994
|
+
triggerInner: utils.cva("flex w-full items-center", {
|
|
995
|
+
defaultVariants: { size: "medium" },
|
|
996
|
+
variants: {
|
|
997
|
+
size: {
|
|
998
|
+
xsmall: "gap-0",
|
|
999
|
+
small: "gap-[2px]",
|
|
1000
|
+
medium: "gap-[2px]",
|
|
1001
|
+
large: "gap-[4px]"
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}),
|
|
1005
|
+
viewport: utils.cn("flex flex-col gap-0.5 p-1")
|
|
1006
|
+
};
|
|
1007
|
+
var SelectContext = React2.createContext(null);
|
|
1008
|
+
var useSelectContext = () => {
|
|
1009
|
+
const context = React2.useContext(SelectContext);
|
|
1010
|
+
if (!context) {
|
|
1011
|
+
throw new Error("Select components must be used within a Select");
|
|
1012
|
+
}
|
|
1013
|
+
return context;
|
|
1014
|
+
};
|
|
1015
|
+
var SelectGroupContext = React2.createContext(null);
|
|
1016
|
+
var useSelectGroupContext = () => {
|
|
1017
|
+
return React2.useContext(SelectGroupContext);
|
|
1018
|
+
};
|
|
1019
|
+
var Select = React2.forwardRef(
|
|
1020
|
+
({
|
|
1021
|
+
children,
|
|
1022
|
+
size = "medium",
|
|
1023
|
+
variant = "fill",
|
|
1024
|
+
error = false,
|
|
1025
|
+
disabled = false,
|
|
1026
|
+
focus = false,
|
|
1027
|
+
active = false,
|
|
1028
|
+
className,
|
|
1029
|
+
...selectProps
|
|
1030
|
+
}, ref) => {
|
|
1031
|
+
const uniqueId = React2.useId();
|
|
1032
|
+
const id = `select-${uniqueId}`;
|
|
1033
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContext.Provider, { value: { active, disabled, error, focus, id, size, variant }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn(selectVariants.container(), className), children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Root, { disabled, ...selectProps, children }) }) });
|
|
1034
|
+
}
|
|
1035
|
+
);
|
|
1036
|
+
Select.Value = React2.forwardRef(({ className, children, ...props }, ref) => {
|
|
1037
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Value, { ref, className, ...props, children });
|
|
108
1038
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1039
|
+
Select.Trigger = React2.forwardRef(
|
|
1040
|
+
({ className, children, leftIcon, ...props }, ref) => {
|
|
1041
|
+
const { size, error, id, variant, focus, active } = useSelectContext();
|
|
1042
|
+
const groupContext = useSelectGroupContext();
|
|
1043
|
+
const groupClasses = groupContext ? utils.cn("rounded-none border-0", {
|
|
1044
|
+
"rounded-l-medium": groupContext.isFirstChild,
|
|
1045
|
+
"rounded-r-medium": groupContext.isLastChild,
|
|
1046
|
+
// line variant: group이 외곽 border를 제공하므로, open 시 border 대신 inset ring 사용
|
|
1047
|
+
"data-[state=open]:border-0 data-[state=open]:ring-1 data-[state=open]:ring-inset data-[state=open]:ring-border-focused": variant === "line"
|
|
1048
|
+
}) : void 0;
|
|
1049
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1050
|
+
SelectPrimitive__namespace.Trigger,
|
|
1051
|
+
{
|
|
1052
|
+
ref,
|
|
1053
|
+
id,
|
|
1054
|
+
"data-slot": "select-trigger",
|
|
1055
|
+
className: utils.cn(
|
|
1056
|
+
selectVariants.trigger({ active, error, focus, size, variant }),
|
|
1057
|
+
groupClasses,
|
|
1058
|
+
className
|
|
1059
|
+
),
|
|
1060
|
+
...props,
|
|
1061
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn(selectVariants.triggerInner({ size })), children: [
|
|
1062
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1063
|
+
"span",
|
|
1064
|
+
{
|
|
1065
|
+
className: utils.cn(
|
|
1066
|
+
selectVariants.iconSize({ size }),
|
|
1067
|
+
"flex items-center justify-center group-disabled:text-icon-disabled"
|
|
1068
|
+
),
|
|
1069
|
+
children: leftIcon
|
|
1070
|
+
}
|
|
1071
|
+
),
|
|
1072
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1 truncate text-left", children }),
|
|
1073
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1074
|
+
chunk5M47B2XJ_js.ChevronDown,
|
|
1075
|
+
{
|
|
1076
|
+
type: "regular",
|
|
1077
|
+
className: utils.cn(
|
|
1078
|
+
selectVariants.iconSize({ size }),
|
|
1079
|
+
"transition-transform duration-200 group-data-[state=open]:rotate-180",
|
|
1080
|
+
"group-disabled:text-icon-disabled"
|
|
1081
|
+
)
|
|
1082
|
+
}
|
|
1083
|
+
)
|
|
1084
|
+
] })
|
|
1085
|
+
}
|
|
1086
|
+
);
|
|
1087
|
+
}
|
|
1088
|
+
);
|
|
1089
|
+
Select.Box = React2.forwardRef(
|
|
1090
|
+
({ placeholder, leftIcon, className, ...props }, ref) => {
|
|
1091
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Select.Trigger, { ref, leftIcon, className, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Select.Value, { placeholder }) });
|
|
1092
|
+
}
|
|
1093
|
+
);
|
|
1094
|
+
Select.List = React2.forwardRef(
|
|
1095
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1096
|
+
SelectPrimitive__namespace.Content,
|
|
1097
|
+
{
|
|
1098
|
+
ref,
|
|
1099
|
+
"data-slot": "select-content",
|
|
1100
|
+
className: utils.cn(selectVariants.content, "max-h-60 ", className),
|
|
1101
|
+
position: "popper",
|
|
1102
|
+
...props,
|
|
1103
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1104
|
+
SelectPrimitive__namespace.Viewport,
|
|
1105
|
+
{
|
|
1106
|
+
"data-slot": "select-viewport",
|
|
1107
|
+
className: utils.cn(
|
|
1108
|
+
selectVariants.viewport,
|
|
1109
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
1110
|
+
),
|
|
1111
|
+
children
|
|
1112
|
+
}
|
|
1113
|
+
)
|
|
1114
|
+
}
|
|
1115
|
+
) })
|
|
1116
|
+
);
|
|
1117
|
+
Select.Label = React2.forwardRef(
|
|
1118
|
+
({ children, required = false, size: sizeProp, className }, ref) => {
|
|
1119
|
+
const { size: contextSize, disabled, id } = useSelectContext();
|
|
1120
|
+
const groupContext = useSelectGroupContext();
|
|
1121
|
+
const size = sizeProp ?? groupContext?.size ?? contextSize;
|
|
1122
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1123
|
+
"label",
|
|
1124
|
+
{
|
|
1125
|
+
ref,
|
|
1126
|
+
htmlFor: id,
|
|
1127
|
+
className: utils.cn(selectVariants.label({ disabled, required, size }), className),
|
|
1128
|
+
children
|
|
1129
|
+
}
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
);
|
|
1133
|
+
Select.Item = React2.forwardRef(
|
|
1134
|
+
({
|
|
1135
|
+
className,
|
|
1136
|
+
children,
|
|
1137
|
+
leftIcon,
|
|
1138
|
+
rightIcon,
|
|
1139
|
+
leftIconSize,
|
|
1140
|
+
rightIconSize,
|
|
1141
|
+
size: sizeProp,
|
|
1142
|
+
...props
|
|
1143
|
+
}, ref) => {
|
|
1144
|
+
const { size: contextSize } = useSelectContext();
|
|
1145
|
+
const groupContext = useSelectGroupContext();
|
|
1146
|
+
const size = sizeProp ?? groupContext?.size ?? contextSize;
|
|
1147
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1148
|
+
SelectPrimitive__namespace.Item,
|
|
1149
|
+
{
|
|
1150
|
+
"data-slot": "select-item",
|
|
1151
|
+
ref,
|
|
1152
|
+
className: utils.cn(selectVariants.item({ size }), className),
|
|
1153
|
+
...props,
|
|
1154
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
|
|
1155
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-0.5", children: [
|
|
1156
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1157
|
+
"span",
|
|
1158
|
+
{
|
|
1159
|
+
className: utils.cn(
|
|
1160
|
+
selectVariants.iconSize({ size: leftIconSize ?? size }),
|
|
1161
|
+
"flex items-center justify-center text-icon-primary"
|
|
1162
|
+
),
|
|
1163
|
+
children: leftIcon
|
|
1164
|
+
}
|
|
1165
|
+
),
|
|
1166
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn(selectVariants.itemText({ size })), children }) })
|
|
1167
|
+
] }),
|
|
1168
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1169
|
+
"span",
|
|
1170
|
+
{
|
|
1171
|
+
className: utils.cn(
|
|
1172
|
+
selectVariants.iconSize({ size: rightIconSize ?? size }),
|
|
1173
|
+
"flex items-center justify-center text-icon-primary"
|
|
1174
|
+
),
|
|
1175
|
+
children: rightIcon
|
|
1176
|
+
}
|
|
1177
|
+
)
|
|
1178
|
+
] })
|
|
1179
|
+
}
|
|
1180
|
+
);
|
|
1181
|
+
}
|
|
1182
|
+
);
|
|
1183
|
+
Select.Empty = React2.forwardRef(
|
|
1184
|
+
({ children = "No data", className }, ref) => {
|
|
1185
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn("flex min-h-8 items-center justify-center p-2", className), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-2 text-text-disabled", children }) });
|
|
1186
|
+
}
|
|
1187
|
+
);
|
|
1188
|
+
Select.Description = React2.forwardRef(
|
|
1189
|
+
({ children, size: sizeProp, className }, ref) => {
|
|
1190
|
+
const { size: contextSize, error, disabled } = useSelectContext();
|
|
1191
|
+
const groupContext = useSelectGroupContext();
|
|
1192
|
+
const size = sizeProp ?? groupContext?.size ?? contextSize;
|
|
1193
|
+
if (!children) {
|
|
1194
|
+
return null;
|
|
1195
|
+
}
|
|
1196
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1197
|
+
"div",
|
|
1198
|
+
{
|
|
1199
|
+
ref,
|
|
1200
|
+
"data-slot": "select-description",
|
|
1201
|
+
className: utils.cn(selectVariants.description({ disabled, error, size }), className),
|
|
1202
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { children })
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
);
|
|
1207
|
+
Select.Group = React2.forwardRef(
|
|
1208
|
+
({ children, size = "medium", variant = "fill", hasBackground = false, className }, ref) => {
|
|
1209
|
+
const childArray = React2__namespace.Children.toArray(children);
|
|
1210
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1211
|
+
"div",
|
|
1212
|
+
{
|
|
1213
|
+
ref,
|
|
1214
|
+
className: utils.cn(
|
|
1215
|
+
"flex w-fit flex-row items-stretch overflow-clip rounded-medium",
|
|
1216
|
+
variant === "line" && "border border-border-primary",
|
|
1217
|
+
hasBackground && "bg-elevation-elevation-0",
|
|
1218
|
+
className
|
|
1219
|
+
),
|
|
1220
|
+
children: childArray.map((child, index) => {
|
|
1221
|
+
const isFirst = index === 0;
|
|
1222
|
+
const isLast = index === childArray.length - 1;
|
|
1223
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React2__namespace.Fragment, { children: [
|
|
1224
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1225
|
+
SelectGroupContext.Provider,
|
|
1226
|
+
{
|
|
1227
|
+
value: { isFirstChild: isFirst, isLastChild: isLast, size, variant },
|
|
1228
|
+
children: child
|
|
1229
|
+
}
|
|
1230
|
+
),
|
|
1231
|
+
!isLast && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px self-stretch bg-border-primary" })
|
|
1232
|
+
] }, index);
|
|
1233
|
+
})
|
|
1234
|
+
}
|
|
1235
|
+
);
|
|
1236
|
+
}
|
|
1237
|
+
);
|
|
1238
|
+
Select.displayName = "Select";
|
|
1239
|
+
Select.Label.displayName = "Select.Label";
|
|
1240
|
+
Select.Trigger.displayName = "Select.Trigger";
|
|
1241
|
+
Select.Box.displayName = "Select.Box";
|
|
1242
|
+
Select.Value.displayName = "Select.Value";
|
|
1243
|
+
Select.List.displayName = "Select.List";
|
|
1244
|
+
Select.Item.displayName = "Select.Item";
|
|
1245
|
+
Select.Empty.displayName = "Select.Empty";
|
|
1246
|
+
Select.Description.displayName = "Select.Description";
|
|
1247
|
+
Select.Group.displayName = "Select.Group";
|
|
1248
|
+
var tooltipContentVariants = utils.cva(
|
|
1249
|
+
[
|
|
1250
|
+
// Base layout
|
|
1251
|
+
"z-50 flex flex-col items-start overflow-hidden",
|
|
1252
|
+
"rounded-medium",
|
|
1253
|
+
"text-text-static-light",
|
|
1254
|
+
"bg-component-tooltip border border-border-primary",
|
|
1255
|
+
"shadow-medium",
|
|
1256
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
1257
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
1258
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
1259
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
1260
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
1261
|
+
"data-[side=top]:slide-in-from-bottom-2"
|
|
1262
|
+
],
|
|
1263
|
+
{
|
|
1264
|
+
variants: {
|
|
1265
|
+
size: {
|
|
1266
|
+
tiny: "px-2 py-1 text-body-3",
|
|
1267
|
+
small: "w-[160px] gap-[8px] px-[12px] py-[10px]",
|
|
1268
|
+
medium: "w-[240px] gap-[8px] px-[12px] py-[10px]",
|
|
1269
|
+
large: "w-[320px] gap-[8px] px-[12px] py-[10px]",
|
|
1270
|
+
xlarge: "w-[400px] gap-[8px] px-[12px] py-[10px]"
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
defaultVariants: { size: "small" }
|
|
1274
|
+
}
|
|
1275
|
+
);
|
|
1276
|
+
var tooltipTitleVariants = utils.cva([
|
|
1277
|
+
"text-body-1 font-semibold text-text-static-light",
|
|
1278
|
+
"group-data-[size=tiny]/tooltip-content:text-body-3"
|
|
1279
|
+
]);
|
|
1280
|
+
var tooltipTextVariants = utils.cva([
|
|
1281
|
+
"text-body-2 font-regular text-text-static-light",
|
|
1282
|
+
"group-data-[size=tiny]/tooltip-content:text-body-3"
|
|
1283
|
+
]);
|
|
1284
|
+
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
1285
|
+
Tooltip.Provider = TooltipPrimitive__namespace.Provider;
|
|
1286
|
+
Tooltip.Trigger = TooltipPrimitive__namespace.Trigger;
|
|
1287
|
+
Tooltip.Content = React2.forwardRef(({ className, sideOffset = 4, size, children, portalContainer, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1288
|
+
TooltipPrimitive__namespace.Content,
|
|
1289
|
+
{
|
|
1290
|
+
ref,
|
|
1291
|
+
sideOffset,
|
|
1292
|
+
"data-size": size,
|
|
1293
|
+
className: utils.cn("group/tooltip-content", tooltipContentVariants({ size }), className),
|
|
1294
|
+
...props,
|
|
1295
|
+
children
|
|
1296
|
+
}
|
|
1297
|
+
) }));
|
|
1298
|
+
Tooltip.Title = React2.forwardRef(
|
|
1299
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn(tooltipTitleVariants(), className), ...props, children })
|
|
1300
|
+
);
|
|
1301
|
+
Tooltip.Description = React2.forwardRef(
|
|
1302
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn(tooltipTextVariants(), className), ...props, children })
|
|
1303
|
+
);
|
|
1304
|
+
Tooltip.displayName = "Tooltip";
|
|
1305
|
+
Tooltip.Content.displayName = "Tooltip.Content";
|
|
1306
|
+
Tooltip.Title.displayName = "Tooltip.Title";
|
|
1307
|
+
Tooltip.Description.displayName = "Tooltip.Description";
|
|
1308
|
+
Tooltip.Trigger.displayName = "Tooltip.Trigger";
|
|
1309
|
+
Tooltip.Provider.displayName = "Tooltip.Provider";
|
|
1310
|
+
var FlatTooltip = ({ children, title, size, description, ...props }) => {
|
|
1311
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Provider, { delayDuration: 0, skipDelayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
1312
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip.Trigger, { asChild: true, children }),
|
|
1313
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip.Content, { size, ...props, children: [
|
|
1314
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Title, { children: title }),
|
|
1315
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Description, { children: description })
|
|
1316
|
+
] })
|
|
1317
|
+
] }) });
|
|
1318
|
+
};
|
|
1319
|
+
function ConditionalTooltip({ children, tooltip }) {
|
|
1320
|
+
if (typeof tooltip === "string") {
|
|
1321
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FlatTooltip, { size: "tiny", description: tooltip, children });
|
|
1322
|
+
}
|
|
1323
|
+
if (tooltip && typeof tooltip === "object" && "description" in tooltip && tooltip.use !== false) {
|
|
1324
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FlatTooltip, { size: tooltip.size || "tiny", ...tooltip, children });
|
|
1325
|
+
}
|
|
1326
|
+
return children;
|
|
1327
|
+
}
|
|
1328
|
+
FlatTooltip.displayName = "FlatTooltip";
|
|
1329
|
+
ConditionalTooltip.displayName = "ConditionalTooltip";
|
|
1330
|
+
var iconButtonSizeClasses = {
|
|
1331
|
+
xsmall: "size-6",
|
|
1332
|
+
small: "size-7",
|
|
1333
|
+
medium: "size-8",
|
|
1334
|
+
large: "size-10",
|
|
1335
|
+
xlarge: "size-12"
|
|
1336
|
+
};
|
|
1337
|
+
var IconButton = React2.forwardRef(
|
|
1338
|
+
({
|
|
1339
|
+
className,
|
|
1340
|
+
tooltip,
|
|
1341
|
+
variant = "contained",
|
|
1342
|
+
icon,
|
|
1343
|
+
size = "medium",
|
|
1344
|
+
color = "primary",
|
|
1345
|
+
...props
|
|
1346
|
+
}, ref) => {
|
|
1347
|
+
const buttonProps = {
|
|
1348
|
+
className: utils.cn(iconButtonSizeClasses[size], "px-0", className),
|
|
1349
|
+
color,
|
|
1350
|
+
icon,
|
|
1351
|
+
size,
|
|
1352
|
+
variant,
|
|
1353
|
+
...props
|
|
1354
|
+
};
|
|
1355
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ConditionalTooltip, { tooltip, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ref, ...buttonProps }) });
|
|
1356
|
+
}
|
|
1357
|
+
);
|
|
1358
|
+
IconButton.displayName = "IconButton";
|
|
1359
|
+
var ButtonGroup = React2.forwardRef(
|
|
1360
|
+
({
|
|
1361
|
+
variant = "contained",
|
|
1362
|
+
iconOnly = false,
|
|
1363
|
+
hasBackground = false,
|
|
1364
|
+
size = "medium",
|
|
1365
|
+
items,
|
|
1366
|
+
className
|
|
1367
|
+
}, ref) => {
|
|
1368
|
+
if (items.length === 0) {
|
|
1369
|
+
return null;
|
|
1370
|
+
}
|
|
1371
|
+
const isOutlined = variant === "outlined";
|
|
1372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1373
|
+
"div",
|
|
1374
|
+
{
|
|
1375
|
+
ref,
|
|
1376
|
+
className: utils.cn(
|
|
1377
|
+
"inline-flex items-center overflow-hidden rounded-medium",
|
|
1378
|
+
hasBackground && "bg-elevation-elevation-0",
|
|
1379
|
+
className
|
|
1380
|
+
),
|
|
1381
|
+
role: "group",
|
|
1382
|
+
children: items.map((item, index) => {
|
|
1383
|
+
const isFirst = index === 0;
|
|
1384
|
+
const isLast = index === items.length - 1;
|
|
1385
|
+
const roundedClasses = utils.cn("rounded-none", {
|
|
1386
|
+
"rounded-l-medium": isFirst,
|
|
1387
|
+
"rounded-r-medium": isLast
|
|
1388
|
+
});
|
|
1389
|
+
const dividerClasses = !isOutlined && !isLast ? "border-r border-border-primary" : "";
|
|
1390
|
+
const mergeClasses = isOutlined && !isFirst ? "-ml-px" : "";
|
|
1391
|
+
const hoverClasses = isOutlined ? "relative hover:z-10" : "";
|
|
1392
|
+
if (iconOnly) {
|
|
1393
|
+
const iconBaseProps = {
|
|
1394
|
+
className: utils.cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
|
|
1395
|
+
icon: item.icon,
|
|
1396
|
+
onClick: item.onClick,
|
|
1397
|
+
size
|
|
1398
|
+
};
|
|
1399
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ConditionalTooltip, { tooltip: item.tooltip, children: variant === "contained" ? /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ...iconBaseProps, color: "assistive", variant: "contained" }) : /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ...iconBaseProps, color: "primary", variant: "outlined" }) }, item.id);
|
|
1400
|
+
}
|
|
1401
|
+
const buttonBaseProps = {
|
|
1402
|
+
className: utils.cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
|
|
1403
|
+
icon: item.icon,
|
|
1404
|
+
onClick: item.onClick,
|
|
1405
|
+
size
|
|
1406
|
+
};
|
|
1407
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ConditionalTooltip, { tooltip: item.tooltip, children: variant === "contained" ? /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonBaseProps, color: "assistive", variant: "contained", children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonBaseProps, color: "primary", variant: "outlined", children: item.label }) }, item.id);
|
|
1408
|
+
})
|
|
1409
|
+
}
|
|
1410
|
+
);
|
|
1411
|
+
}
|
|
1412
|
+
);
|
|
1413
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
1414
|
+
var containerVariants = utils.cva("inline-flex items-center", {
|
|
1415
|
+
variants: {
|
|
1416
|
+
size: {
|
|
1417
|
+
small: "gap-1",
|
|
1418
|
+
medium: "gap-1.5",
|
|
1419
|
+
large: "gap-2"
|
|
1420
|
+
},
|
|
1421
|
+
labelPosition: {
|
|
1422
|
+
right: "flex-row",
|
|
1423
|
+
left: "flex-row-reverse"
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
defaultVariants: {
|
|
1427
|
+
size: "medium",
|
|
1428
|
+
labelPosition: "right"
|
|
1429
|
+
}
|
|
112
1430
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
1431
|
+
var boxVariants = utils.cva(
|
|
1432
|
+
"peer shrink-0 cursor-pointer rounded-weak border border-border-secondary ring-offset-background transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed enabled:data-[state=unchecked]:hover:bg-elevation-elevation-2 disabled:data-[state=unchecked]:bg-elevation-elevation-3 bg-background-primary",
|
|
1433
|
+
{
|
|
1434
|
+
variants: {
|
|
1435
|
+
size: {
|
|
1436
|
+
small: "size-4",
|
|
1437
|
+
medium: "size-5",
|
|
1438
|
+
large: "size-6"
|
|
1439
|
+
}
|
|
1440
|
+
},
|
|
1441
|
+
defaultVariants: {
|
|
1442
|
+
size: "medium"
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
);
|
|
1446
|
+
var labelVariants = utils.cva(
|
|
1447
|
+
"cursor-pointer select-none text-text-primary peer-disabled:cursor-not-allowed peer-disabled:text-text-disabled",
|
|
1448
|
+
{
|
|
1449
|
+
variants: {
|
|
1450
|
+
size: {
|
|
1451
|
+
small: "text-body-3",
|
|
1452
|
+
medium: "text-body-2",
|
|
1453
|
+
large: "text-body-1"
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
defaultVariants: {
|
|
1457
|
+
size: "medium"
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
);
|
|
1461
|
+
var iconVariants = utils.cva("text-icon-static-light", {
|
|
1462
|
+
variants: {
|
|
1463
|
+
size: {
|
|
1464
|
+
small: "size-4",
|
|
1465
|
+
medium: "size-5",
|
|
1466
|
+
large: "size-6"
|
|
1467
|
+
},
|
|
1468
|
+
disabled: {
|
|
1469
|
+
true: "text-icon-inverse-disabled"
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
defaultVariants: {
|
|
1473
|
+
size: "medium"
|
|
1474
|
+
}
|
|
116
1475
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1476
|
+
var stateClasses = [
|
|
1477
|
+
"data-[state=checked]:bg-solid-accent-default data-[state=checked]:border-transparent",
|
|
1478
|
+
"data-[state=indeterminate]:bg-solid-accent-default data-[state=indeterminate]:border-transparent",
|
|
1479
|
+
"enabled:data-[state=checked]:hover:bg-solid-accent-hovered enabled:data-[state=indeterminate]:hover:bg-solid-accent-hovered",
|
|
1480
|
+
"enabled:data-[state=checked]:hover:border-transparent enabled:data-[state=indeterminate]:hover:border-transparent",
|
|
1481
|
+
"disabled:data-[state=checked]:bg-solid-accent-disabled disabled:data-[state=indeterminate]:bg-solid-accent-disabled",
|
|
1482
|
+
"disabled:data-[state=checked]:border-transparent disabled:data-[state=indeterminate]:border-transparent"
|
|
1483
|
+
];
|
|
1484
|
+
var Checkbox = React2.forwardRef(
|
|
1485
|
+
({
|
|
1486
|
+
className,
|
|
1487
|
+
label,
|
|
1488
|
+
id,
|
|
1489
|
+
size = "medium",
|
|
1490
|
+
labelPosition = "right",
|
|
1491
|
+
checked,
|
|
1492
|
+
onCheckedChange,
|
|
1493
|
+
disabled = false,
|
|
1494
|
+
defaultChecked,
|
|
1495
|
+
...props
|
|
1496
|
+
}, ref) => {
|
|
1497
|
+
const uniqueId = React2.useId();
|
|
1498
|
+
const checkboxId = id || uniqueId;
|
|
1499
|
+
const checkboxState = checked === "indeterminate" ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
1500
|
+
const checkboxProps = {
|
|
1501
|
+
...props,
|
|
1502
|
+
ref,
|
|
1503
|
+
id: checkboxId,
|
|
1504
|
+
className: utils.cn(boxVariants({ size }), stateClasses, className),
|
|
1505
|
+
onCheckedChange: (state) => {
|
|
1506
|
+
onCheckedChange?.(state === "indeterminate" ? true : !!state);
|
|
1507
|
+
},
|
|
1508
|
+
"data-state": checkboxState,
|
|
1509
|
+
disabled
|
|
1510
|
+
};
|
|
1511
|
+
if (checked !== void 0) {
|
|
1512
|
+
checkboxProps.checked = checked;
|
|
1513
|
+
}
|
|
1514
|
+
if (defaultChecked !== void 0) {
|
|
1515
|
+
checkboxProps.defaultChecked = defaultChecked;
|
|
1516
|
+
}
|
|
1517
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn(containerVariants({ size, labelPosition })), children: [
|
|
1518
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1519
|
+
CheckboxPrimitive__namespace.Root,
|
|
1520
|
+
{
|
|
1521
|
+
...checkboxProps,
|
|
1522
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: checkboxState === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.Minus, { type: "regular", className: utils.cn(iconVariants({ size, disabled })) }) : checkboxState === "checked" ? /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.Check, { type: "regular", className: utils.cn(iconVariants({ size, disabled })) }) : null })
|
|
1523
|
+
}
|
|
1524
|
+
),
|
|
1525
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: checkboxId, className: utils.cn(labelVariants({ size })), children: label })
|
|
1526
|
+
] });
|
|
1527
|
+
}
|
|
1528
|
+
);
|
|
1529
|
+
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
1530
|
+
var containerVariants2 = utils.cva("inline-flex items-center", {
|
|
1531
|
+
variants: {
|
|
1532
|
+
size: { small: "gap-1", medium: "gap-1.5", large: "gap-2" },
|
|
1533
|
+
labelPosition: { right: "flex-row", left: "flex-row-reverse" }
|
|
1534
|
+
},
|
|
1535
|
+
defaultVariants: { size: "medium", labelPosition: "right" }
|
|
120
1536
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1537
|
+
var radioVariants = utils.cva(
|
|
1538
|
+
"peer relative shrink-0 rounded-full border border-border-secondary ring-offset-background transition-colors hover:bg-elevation-elevation-2 bg-background-primary",
|
|
1539
|
+
{
|
|
1540
|
+
variants: { size: { small: "size-4", medium: "size-5", large: "size-6" } },
|
|
1541
|
+
defaultVariants: { size: "medium" }
|
|
1542
|
+
}
|
|
1543
|
+
);
|
|
1544
|
+
var stateClasses2 = [
|
|
1545
|
+
"disabled:cursor-not-allowed",
|
|
1546
|
+
"disabled:data-[state=unchecked]:bg-elevation-elevation-3"
|
|
1547
|
+
];
|
|
1548
|
+
var checkedStateClasses = [
|
|
1549
|
+
"data-[state=checked]:border-border-accent",
|
|
1550
|
+
"disabled:data-[state=checked]:border-border-accent-disabled"
|
|
1551
|
+
];
|
|
1552
|
+
var indicatorVariants = utils.cva(
|
|
1553
|
+
"pointer-events-none block rounded-full bg-icon-accent data-[disabled]:bg-icon-accent-disabled",
|
|
1554
|
+
{
|
|
1555
|
+
variants: {
|
|
1556
|
+
size: { small: "size-2.5", medium: "size-3", large: "size-3.5" }
|
|
1557
|
+
},
|
|
1558
|
+
defaultVariants: { size: "medium" }
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1561
|
+
var labelVariants2 = utils.cva(
|
|
1562
|
+
"cursor-pointer select-none text-text-primary peer-disabled:cursor-not-allowed peer-disabled:text-text-disabled",
|
|
1563
|
+
{
|
|
1564
|
+
variants: { size: { small: "text-body-3", medium: "text-body-2", large: "text-body-1" } },
|
|
1565
|
+
defaultVariants: { size: "medium" }
|
|
1566
|
+
}
|
|
1567
|
+
);
|
|
1568
|
+
var Radio = React2.forwardRef(
|
|
1569
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Root, { ref, className: utils.cn("grid gap-2", className), ...props })
|
|
1570
|
+
);
|
|
1571
|
+
Radio.Item = React2.forwardRef(
|
|
1572
|
+
({ className, size = "medium", label, labelPosition = "right", id, disabled, ...props }, ref) => {
|
|
1573
|
+
const uniqueId = React2.useId();
|
|
1574
|
+
const radioId = id || uniqueId;
|
|
1575
|
+
const control = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1576
|
+
RadioGroupPrimitive__namespace.Item,
|
|
1577
|
+
{
|
|
1578
|
+
ref,
|
|
1579
|
+
id: radioId,
|
|
1580
|
+
disabled,
|
|
1581
|
+
className: utils.cn(radioVariants({ size }), stateClasses2, checkedStateClasses, className),
|
|
1582
|
+
...props,
|
|
1583
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1584
|
+
"span",
|
|
1585
|
+
{
|
|
1586
|
+
className: utils.cn("block", indicatorVariants({ size })),
|
|
1587
|
+
"data-disabled": disabled ? "" : void 0
|
|
1588
|
+
}
|
|
1589
|
+
) })
|
|
1590
|
+
}
|
|
1591
|
+
);
|
|
1592
|
+
if (!label) {
|
|
1593
|
+
return control;
|
|
1594
|
+
}
|
|
1595
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn(containerVariants2({ size, labelPosition })), children: [
|
|
1596
|
+
control,
|
|
1597
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: radioId, className: utils.cn(labelVariants2({ size })), children: label })
|
|
1598
|
+
] });
|
|
1599
|
+
}
|
|
1600
|
+
);
|
|
1601
|
+
Radio.displayName = "Radio";
|
|
1602
|
+
Radio.Item.displayName = "Radio.Item";
|
|
1603
|
+
var switchVariants = utils.cva(
|
|
1604
|
+
"peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full disabled:cursor-not-allowed data-[state=checked]:bg-solid-accent-default data-[state=unchecked]:bg-elevation-elevation-4 hover:data-[state=checked]:bg-solid-accent-hovered hover:data-[state=unchecked]:bg-elevation-elevation-5 disabled:data-[state=checked]:bg-solid-accent-disabled disabled:data-[state=unchecked]:bg-elevation-elevation-3 disabled:hover:data-[state=checked]:bg-solid-accent-disabled disabled:hover:data-[state=unchecked]:bg-elevation-elevation-3",
|
|
1605
|
+
{
|
|
1606
|
+
variants: {
|
|
1607
|
+
size: {
|
|
1608
|
+
small: "h-[16px] w-[28px]",
|
|
1609
|
+
medium: "h-[20px] w-[36px]",
|
|
1610
|
+
large: "h-[24px] w-[44px]"
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1613
|
+
defaultVariants: {
|
|
1614
|
+
size: "medium"
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
);
|
|
1618
|
+
var switchThumbVariants = utils.cva(
|
|
1619
|
+
"pointer-events-none absolute bg-icon-static-light left-[2px] top-[2px] rounded-full ring-0 data-[state=unchecked]:translate-x-0 data-[disabled]:bg-icon-inverse-disabled",
|
|
1620
|
+
{
|
|
1621
|
+
variants: {
|
|
1622
|
+
size: {
|
|
1623
|
+
small: "size-[12px] data-[state=checked]:translate-x-[12px]",
|
|
1624
|
+
medium: "size-[16px] data-[state=checked]:translate-x-[16px]",
|
|
1625
|
+
large: "size-[20px] data-[state=checked]:translate-x-[20px]"
|
|
1626
|
+
}
|
|
1627
|
+
},
|
|
1628
|
+
defaultVariants: {
|
|
1629
|
+
size: "medium"
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
);
|
|
1633
|
+
var containerVariants3 = utils.cva("inline-flex items-center", {
|
|
1634
|
+
variants: {
|
|
1635
|
+
size: {
|
|
1636
|
+
small: "gap-1",
|
|
1637
|
+
medium: "gap-1.5",
|
|
1638
|
+
large: "gap-2"
|
|
1639
|
+
},
|
|
1640
|
+
labelPosition: {
|
|
1641
|
+
right: "flex-row",
|
|
1642
|
+
left: "flex-row-reverse"
|
|
1643
|
+
}
|
|
1644
|
+
},
|
|
1645
|
+
defaultVariants: {
|
|
1646
|
+
size: "medium",
|
|
1647
|
+
labelPosition: "right"
|
|
1648
|
+
}
|
|
124
1649
|
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1650
|
+
var switchLabelVariants = utils.cva(
|
|
1651
|
+
"cursor-pointer select-none font-regular text-text-primary peer-disabled:cursor-not-allowed peer-disabled:text-text-disabled",
|
|
1652
|
+
{
|
|
1653
|
+
variants: {
|
|
1654
|
+
size: {
|
|
1655
|
+
small: "text-body-3",
|
|
1656
|
+
medium: "text-body-2",
|
|
1657
|
+
large: "text-body-1"
|
|
1658
|
+
}
|
|
1659
|
+
},
|
|
1660
|
+
defaultVariants: {
|
|
1661
|
+
size: "medium"
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
);
|
|
1665
|
+
var Switch = React2.forwardRef(
|
|
1666
|
+
({ className, size = "medium", label, labelPosition = "right", id, ...props }, ref) => {
|
|
1667
|
+
const switchId = React2.useId();
|
|
1668
|
+
const finalId = id || switchId;
|
|
1669
|
+
const switchElement = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1670
|
+
SwitchPrimitives__namespace.Root,
|
|
1671
|
+
{
|
|
1672
|
+
id: finalId,
|
|
1673
|
+
className: utils.cn(switchVariants({ size }), className),
|
|
1674
|
+
...props,
|
|
1675
|
+
ref,
|
|
1676
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SwitchPrimitives__namespace.Thumb, { className: utils.cn(switchThumbVariants({ size })) })
|
|
1677
|
+
}
|
|
1678
|
+
);
|
|
1679
|
+
if (!label) {
|
|
1680
|
+
return switchElement;
|
|
1681
|
+
}
|
|
1682
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn(containerVariants3({ size, labelPosition })), children: [
|
|
1683
|
+
switchElement,
|
|
1684
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: finalId, className: utils.cn(switchLabelVariants({ size })), children: label })
|
|
1685
|
+
] });
|
|
1686
|
+
}
|
|
1687
|
+
);
|
|
1688
|
+
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
1689
|
+
function DatePickerChevron({ orientation }) {
|
|
1690
|
+
if (orientation === "left") {
|
|
1691
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.ChevronLeft, { type: "regular", className: "size-5" });
|
|
1692
|
+
}
|
|
1693
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.ChevronRight, { type: "regular", className: "size-5" });
|
|
1694
|
+
}
|
|
1695
|
+
function DatePickerDayButton({
|
|
1696
|
+
day,
|
|
1697
|
+
modifiers,
|
|
1698
|
+
children,
|
|
1699
|
+
className,
|
|
1700
|
+
...buttonProps
|
|
1701
|
+
}) {
|
|
1702
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("button", { className: utils.cn(className, "relative"), ...buttonProps, children: [
|
|
1703
|
+
children,
|
|
1704
|
+
modifiers.today && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1705
|
+
"span",
|
|
1706
|
+
{
|
|
1707
|
+
className: utils.cn(
|
|
1708
|
+
"absolute bottom-[3px] left-1/2 size-1 -translate-x-1/2 rounded-full",
|
|
1709
|
+
modifiers.selected ? "bg-text-inverse" : "bg-icon-critical"
|
|
1710
|
+
)
|
|
1711
|
+
}
|
|
1712
|
+
)
|
|
1713
|
+
] });
|
|
1714
|
+
}
|
|
1715
|
+
function DatePicker({ type = "single", showOutsideDays = true, ...rest }) {
|
|
1716
|
+
const dayPickerProps = { ...rest, mode: type };
|
|
1717
|
+
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
1718
|
+
const [month, setMonth] = React2.useState(
|
|
1719
|
+
dayPickerProps.month ?? dayPickerProps.defaultMonth ?? /* @__PURE__ */ new Date()
|
|
1720
|
+
);
|
|
1721
|
+
const rangeSelected = type === "range" ? rest.selected : void 0;
|
|
1722
|
+
const isRangeComplete = rangeSelected?.from != null && rangeSelected?.to != null;
|
|
1723
|
+
const handleMonthChange = (newMonth) => {
|
|
1724
|
+
setMonth(newMonth);
|
|
1725
|
+
dayPickerProps.onMonthChange?.(newMonth);
|
|
1726
|
+
};
|
|
1727
|
+
const handleDayClick = (day, modifiers, e) => {
|
|
1728
|
+
if (modifiers.outside) {
|
|
1729
|
+
setMonth(new Date(day.getFullYear(), day.getMonth()));
|
|
1730
|
+
}
|
|
1731
|
+
dayPickerProps.onDayClick?.(day, modifiers, e);
|
|
1732
|
+
};
|
|
1733
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1734
|
+
reactDayPicker.DayPicker,
|
|
1735
|
+
{
|
|
1736
|
+
...dayPickerProps,
|
|
1737
|
+
month,
|
|
1738
|
+
onMonthChange: handleMonthChange,
|
|
1739
|
+
onDayClick: handleDayClick,
|
|
1740
|
+
showOutsideDays,
|
|
1741
|
+
formatters: {
|
|
1742
|
+
formatCaption: (date) => {
|
|
1743
|
+
const year = date.getFullYear();
|
|
1744
|
+
const month2 = String(date.getMonth() + 1).padStart(2, "0");
|
|
1745
|
+
return `${year}\uB144 ${month2}\uC6D4`;
|
|
1746
|
+
},
|
|
1747
|
+
formatWeekdayName: (date) => date.toLocaleDateString("en-US", { weekday: "short" }),
|
|
1748
|
+
...dayPickerProps.formatters
|
|
1749
|
+
},
|
|
1750
|
+
components: {
|
|
1751
|
+
Chevron: DatePickerChevron,
|
|
1752
|
+
DayButton: DatePickerDayButton,
|
|
1753
|
+
...dayPickerProps.components
|
|
1754
|
+
},
|
|
1755
|
+
classNames: {
|
|
1756
|
+
root: utils.cn(
|
|
1757
|
+
defaultClassNames.root,
|
|
1758
|
+
"rounded-medium border border-border-primary bg-background-overlay p-4 shadow-medium"
|
|
1759
|
+
),
|
|
1760
|
+
months: utils.cn(defaultClassNames.months, "relative"),
|
|
1761
|
+
month: utils.cn(defaultClassNames.month, "flex flex-col gap-2"),
|
|
1762
|
+
month_caption: utils.cn(defaultClassNames.month_caption, "flex h-7 items-center px-0.5"),
|
|
1763
|
+
caption_label: "text-body-2 font-semibold text-text-primary",
|
|
1764
|
+
nav: utils.cn(defaultClassNames.nav, "absolute right-0 top-0 flex h-7 items-center gap-2"),
|
|
1765
|
+
button_previous: utils.cn(
|
|
1766
|
+
defaultClassNames.button_previous,
|
|
1767
|
+
"flex size-7 items-center justify-center rounded-medium hover:bg-elevation-elevation-2"
|
|
1768
|
+
),
|
|
1769
|
+
button_next: utils.cn(
|
|
1770
|
+
defaultClassNames.button_next,
|
|
1771
|
+
"flex size-7 items-center justify-center rounded-medium hover:bg-elevation-elevation-2"
|
|
1772
|
+
),
|
|
1773
|
+
weekday: utils.cn(
|
|
1774
|
+
defaultClassNames.weekday,
|
|
1775
|
+
"size-8 text-body-3 font-regular text-text-tertiary"
|
|
1776
|
+
),
|
|
1777
|
+
month_grid: utils.cn(
|
|
1778
|
+
defaultClassNames.month_grid,
|
|
1779
|
+
"border-separate border-spacing-x-0 border-spacing-y-1"
|
|
1780
|
+
),
|
|
1781
|
+
week: utils.cn(defaultClassNames.week, "overflow-hidden rounded-medium"),
|
|
1782
|
+
day: utils.cn(defaultClassNames.day, "size-8 text-body-2 font-medium text-text-secondary"),
|
|
1783
|
+
day_button: utils.cn(
|
|
1784
|
+
defaultClassNames.day_button,
|
|
1785
|
+
"size-8 cursor-pointer rounded-full hover:border hover:border-border-focused"
|
|
1786
|
+
),
|
|
1787
|
+
outside: "!text-text-disabled",
|
|
1788
|
+
selected: utils.cn(
|
|
1789
|
+
"[&>button]:bg-solid-primary-default",
|
|
1790
|
+
"[&>button]:text-text-inverse",
|
|
1791
|
+
"[&>button]:border-0",
|
|
1792
|
+
"[&>button]:hover:border-0"
|
|
1793
|
+
),
|
|
1794
|
+
range_start: utils.cn(
|
|
1795
|
+
"rounded-none",
|
|
1796
|
+
isRangeComplete && "[background:linear-gradient(to_right,transparent_50%,var(--color-elevation-elevation-2)_50%)]"
|
|
1797
|
+
),
|
|
1798
|
+
range_end: utils.cn(
|
|
1799
|
+
"rounded-none",
|
|
1800
|
+
isRangeComplete && "[background:linear-gradient(to_left,transparent_50%,var(--color-elevation-elevation-2)_50%)]"
|
|
1801
|
+
),
|
|
1802
|
+
range_middle: utils.cn(
|
|
1803
|
+
"bg-elevation-elevation-2 rounded-none",
|
|
1804
|
+
"[&>button]:!bg-transparent",
|
|
1805
|
+
"[&>button]:!text-text-secondary"
|
|
1806
|
+
),
|
|
1807
|
+
...dayPickerProps.classNames
|
|
1808
|
+
},
|
|
1809
|
+
modifiersClassNames: {
|
|
1810
|
+
today: "rdp-calendar-today",
|
|
1811
|
+
...dayPickerProps.modifiersClassNames
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
);
|
|
1815
|
+
}
|
|
1816
|
+
var TextAreaContext = React2.createContext(null);
|
|
1817
|
+
var useTextAreaContext = () => {
|
|
1818
|
+
const context = React2.useContext(TextAreaContext);
|
|
1819
|
+
if (!context) {
|
|
1820
|
+
throw new Error("TextArea components must be used within a TextArea");
|
|
1821
|
+
}
|
|
1822
|
+
return context;
|
|
1823
|
+
};
|
|
1824
|
+
var textAreaVariants = {
|
|
1825
|
+
container: commonInputVariants.container,
|
|
1826
|
+
label: commonInputVariants.label,
|
|
1827
|
+
field: utils.cva(
|
|
1828
|
+
"scrollbar-overlay block w-full resize-none rounded-medium border transition-colors focus:outline-none",
|
|
1829
|
+
{
|
|
1830
|
+
variants: {
|
|
1831
|
+
variant: {
|
|
1832
|
+
fill: "border-transparent bg-elevation-elevation-2",
|
|
1833
|
+
line: "border-border-primary"
|
|
1834
|
+
},
|
|
1835
|
+
size: {
|
|
1836
|
+
xsmall: "min-h-[60px] px-1.5 py-[3.5px] text-body-3",
|
|
1837
|
+
small: "min-h-[80px] px-2 py-1 text-body-2",
|
|
1838
|
+
medium: "min-h-[100px] px-2.5 py-1.5 text-body-2",
|
|
1839
|
+
large: "min-h-[120px] px-3 py-[9px] text-body-1"
|
|
1840
|
+
},
|
|
1841
|
+
state: {
|
|
1842
|
+
default: "text-text-primary placeholder:text-text-tertiary",
|
|
1843
|
+
focused: "text-text-primary placeholder:text-text-tertiary",
|
|
1844
|
+
error: "text-text-primary placeholder:text-text-tertiary",
|
|
1845
|
+
disabled: "cursor-not-allowed text-text-disabled placeholder:text-text-disabled"
|
|
1846
|
+
}
|
|
1847
|
+
},
|
|
1848
|
+
compoundVariants: [
|
|
1849
|
+
{ variant: "fill", state: "focused", class: "border-border-focused" },
|
|
1850
|
+
{ variant: "fill", state: "error", class: "border-border-critical" },
|
|
1851
|
+
{
|
|
1852
|
+
variant: "fill",
|
|
1853
|
+
state: "disabled",
|
|
1854
|
+
class: "bg-elevation-elevation-2 border-transparent"
|
|
1855
|
+
},
|
|
1856
|
+
{ variant: "line", state: "focused", class: "border-border-focused" },
|
|
1857
|
+
{ variant: "line", state: "error", class: "border-border-critical" },
|
|
1858
|
+
{ variant: "line", state: "disabled", class: "border-border-primary" }
|
|
1859
|
+
],
|
|
1860
|
+
defaultVariants: { variant: "fill", size: "medium", state: "default" }
|
|
1861
|
+
}
|
|
1862
|
+
),
|
|
1863
|
+
descriptionContainer: utils.cva("flex flex-row items-center justify-between", {
|
|
1864
|
+
variants: {
|
|
1865
|
+
size: {
|
|
1866
|
+
xsmall: "gap-0.5 text-caption",
|
|
1867
|
+
small: "gap-1 text-body-3",
|
|
1868
|
+
medium: "gap-1 text-body-3",
|
|
1869
|
+
large: "gap-1 text-body-2"
|
|
1870
|
+
}
|
|
1871
|
+
},
|
|
1872
|
+
defaultVariants: { size: "medium" }
|
|
1873
|
+
}),
|
|
1874
|
+
description: commonInputVariants.description,
|
|
1875
|
+
counter: utils.cva("text-nowrap font-regular", {
|
|
1876
|
+
variants: {
|
|
1877
|
+
disabled: {
|
|
1878
|
+
true: "text-gray-04",
|
|
1879
|
+
false: "text-text-tertiary"
|
|
1880
|
+
}
|
|
1881
|
+
},
|
|
1882
|
+
defaultVariants: { disabled: false }
|
|
1883
|
+
})
|
|
1884
|
+
};
|
|
1885
|
+
var TextArea = React2__namespace.forwardRef(
|
|
1886
|
+
({
|
|
1887
|
+
children,
|
|
1888
|
+
variant = "fill",
|
|
1889
|
+
size = "medium",
|
|
1890
|
+
error = false,
|
|
1891
|
+
disabled = false,
|
|
1892
|
+
value = "",
|
|
1893
|
+
maxLength,
|
|
1894
|
+
className,
|
|
1895
|
+
...textAreaProps
|
|
1896
|
+
}, ref) => {
|
|
1897
|
+
const uniqueId = React2.useId();
|
|
1898
|
+
const id = `text-area-${uniqueId}`;
|
|
1899
|
+
const { onChange, ...restTextAreaProps } = textAreaProps;
|
|
1900
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1901
|
+
TextAreaContext.Provider,
|
|
1902
|
+
{
|
|
1903
|
+
value: { variant, size, error, disabled, id, value, maxLength, onChange },
|
|
1904
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn(textAreaVariants.container, className), children: children || /* @__PURE__ */ jsxRuntime.jsx(TextArea.Field, { ...restTextAreaProps }) })
|
|
1905
|
+
}
|
|
1906
|
+
);
|
|
1907
|
+
}
|
|
1908
|
+
);
|
|
1909
|
+
TextArea.Label = React2__namespace.forwardRef(
|
|
1910
|
+
({ children, required = false, className }, ref) => {
|
|
1911
|
+
const { size, disabled, id } = useTextAreaContext();
|
|
1912
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1913
|
+
"label",
|
|
1914
|
+
{
|
|
1915
|
+
ref,
|
|
1916
|
+
htmlFor: id,
|
|
1917
|
+
className: utils.cn(textAreaVariants.label({ size, disabled, required }), className),
|
|
1918
|
+
children
|
|
1919
|
+
}
|
|
1920
|
+
);
|
|
1921
|
+
}
|
|
1922
|
+
);
|
|
1923
|
+
TextArea.Field = React2__namespace.forwardRef(
|
|
1924
|
+
({ className, onFocus, onBlur, ...props }, ref) => {
|
|
1925
|
+
const {
|
|
1926
|
+
variant,
|
|
1927
|
+
size,
|
|
1928
|
+
error,
|
|
1929
|
+
disabled,
|
|
1930
|
+
id,
|
|
1931
|
+
maxLength,
|
|
1932
|
+
value: contextValue,
|
|
1933
|
+
onChange: contextOnChange
|
|
1934
|
+
} = useTextAreaContext();
|
|
1935
|
+
const [focused, setFocused] = React2__namespace.useState(false);
|
|
1936
|
+
const handleFocus = (e) => {
|
|
1937
|
+
setFocused(true);
|
|
1938
|
+
onFocus?.(e);
|
|
1939
|
+
};
|
|
1940
|
+
const handleBlur = (e) => {
|
|
1941
|
+
setFocused(false);
|
|
1942
|
+
onBlur?.(e);
|
|
1943
|
+
};
|
|
1944
|
+
const state = disabled ? "disabled" : error ? "error" : focused ? "focused" : "default";
|
|
1945
|
+
const isControlled = contextValue !== void 0;
|
|
1946
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1947
|
+
"textarea",
|
|
1948
|
+
{
|
|
1949
|
+
ref,
|
|
1950
|
+
id,
|
|
1951
|
+
disabled,
|
|
1952
|
+
maxLength,
|
|
1953
|
+
className: utils.cn(textAreaVariants.field({ variant, size, state }), className),
|
|
1954
|
+
onFocus: handleFocus,
|
|
1955
|
+
onBlur: handleBlur,
|
|
1956
|
+
onChange: (e) => {
|
|
1957
|
+
contextOnChange?.(e);
|
|
1958
|
+
},
|
|
1959
|
+
...isControlled ? { value: contextValue } : {},
|
|
1960
|
+
...props
|
|
1961
|
+
}
|
|
1962
|
+
);
|
|
1963
|
+
}
|
|
1964
|
+
);
|
|
1965
|
+
TextArea.Description = React2__namespace.forwardRef(
|
|
1966
|
+
({ children, showCounter = true, className }, ref) => {
|
|
1967
|
+
const { size, error, disabled, value = "", maxLength } = useTextAreaContext();
|
|
1968
|
+
if (!children && (!showCounter || !maxLength)) {
|
|
1969
|
+
return null;
|
|
1970
|
+
}
|
|
1971
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: utils.cn(textAreaVariants.descriptionContainer({ size }), className), children: [
|
|
1972
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("p", { className: utils.cn(textAreaVariants.description({ size, error, disabled }), "flex-1"), children }),
|
|
1973
|
+
showCounter && maxLength && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: utils.cn(textAreaVariants.counter({ disabled })), children: [
|
|
1974
|
+
value.length,
|
|
1975
|
+
"/",
|
|
1976
|
+
maxLength
|
|
1977
|
+
] })
|
|
1978
|
+
] });
|
|
1979
|
+
}
|
|
1980
|
+
);
|
|
1981
|
+
TextArea.displayName = "TextArea";
|
|
1982
|
+
TextArea.Label.displayName = "TextArea.Label";
|
|
1983
|
+
TextArea.Field.displayName = "TextArea.Field";
|
|
1984
|
+
TextArea.Description.displayName = "TextArea.Description";
|
|
1985
|
+
var TextFieldContext = React2.createContext(null);
|
|
1986
|
+
var useTextFieldContext = () => {
|
|
1987
|
+
const context = React2.useContext(TextFieldContext);
|
|
1988
|
+
if (!context) {
|
|
1989
|
+
throw new Error("TextField components must be used within a TextField");
|
|
1990
|
+
}
|
|
1991
|
+
return context;
|
|
1992
|
+
};
|
|
1993
|
+
var textFieldVariants = {
|
|
1994
|
+
container: commonInputVariants.container,
|
|
1995
|
+
label: commonInputVariants.label,
|
|
1996
|
+
wrapper: utils.cva(
|
|
1997
|
+
"flex w-full flex-row items-center rounded-medium border transition-colors focus-within:border-border-focused focus-within:outline-none",
|
|
1998
|
+
{
|
|
1999
|
+
variants: {
|
|
2000
|
+
variant: {
|
|
2001
|
+
fill: "border-transparent bg-elevation-elevation-2",
|
|
2002
|
+
line: "border-border-primary"
|
|
2003
|
+
},
|
|
2004
|
+
size: {
|
|
2005
|
+
xsmall: "h-6 gap-0 px-1",
|
|
2006
|
+
small: "h-7 gap-0.5 px-1.5",
|
|
2007
|
+
medium: "h-8 gap-0.5 px-2",
|
|
2008
|
+
large: "h-10 gap-1 px-2.5"
|
|
2009
|
+
},
|
|
2010
|
+
state: {
|
|
2011
|
+
default: "text-text-primary",
|
|
2012
|
+
error: "text-text-primary",
|
|
2013
|
+
disabled: "cursor-not-allowed text-text-disabled"
|
|
2014
|
+
}
|
|
2015
|
+
},
|
|
2016
|
+
compoundVariants: [
|
|
2017
|
+
{ variant: "fill", state: "error", class: "border-border-critical" },
|
|
2018
|
+
{
|
|
2019
|
+
variant: "fill",
|
|
2020
|
+
state: "disabled",
|
|
2021
|
+
class: "bg-elevation-elevation-2 border-transparent"
|
|
2022
|
+
},
|
|
2023
|
+
{ variant: "line", state: "error", class: "border-border-critical" },
|
|
2024
|
+
{ variant: "line", state: "disabled", class: "border-border-primary" }
|
|
2025
|
+
],
|
|
2026
|
+
defaultVariants: { variant: "fill", size: "medium", state: "default" }
|
|
2027
|
+
}
|
|
2028
|
+
),
|
|
2029
|
+
input: utils.cva(
|
|
2030
|
+
"w-full border-none bg-transparent p-0 focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
|
|
2031
|
+
{
|
|
2032
|
+
variants: {
|
|
2033
|
+
size: {
|
|
2034
|
+
xsmall: "text-body-3 placeholder:text-body-3",
|
|
2035
|
+
small: "text-body-2 placeholder:text-body-2",
|
|
2036
|
+
medium: "text-body-2 placeholder:text-body-2",
|
|
2037
|
+
large: "text-body-1 placeholder:text-body-1"
|
|
2038
|
+
},
|
|
2039
|
+
state: {
|
|
2040
|
+
default: "text-text-primary placeholder:text-text-tertiary",
|
|
2041
|
+
error: "text-text-primary placeholder:text-text-tertiary",
|
|
2042
|
+
disabled: "text-text-disabled placeholder:text-text-disabled"
|
|
2043
|
+
}
|
|
2044
|
+
},
|
|
2045
|
+
defaultVariants: { size: "medium", state: "default" }
|
|
2046
|
+
}
|
|
2047
|
+
),
|
|
2048
|
+
description: utils.cva("mt-0.5 font-regular text-text-tertiary", {
|
|
2049
|
+
variants: {
|
|
2050
|
+
size: {
|
|
2051
|
+
xsmall: "text-caption",
|
|
2052
|
+
small: "text-body-3",
|
|
2053
|
+
medium: "text-body-3",
|
|
2054
|
+
large: "text-body-2"
|
|
2055
|
+
},
|
|
2056
|
+
error: {
|
|
2057
|
+
true: "text-text-critical",
|
|
2058
|
+
false: ""
|
|
2059
|
+
},
|
|
2060
|
+
disabled: {
|
|
2061
|
+
true: "text-text-disabled",
|
|
2062
|
+
false: ""
|
|
2063
|
+
}
|
|
2064
|
+
},
|
|
2065
|
+
compoundVariants: [
|
|
2066
|
+
{
|
|
2067
|
+
disabled: true,
|
|
2068
|
+
error: true,
|
|
2069
|
+
class: "text-text-disabled"
|
|
2070
|
+
// disabled가 error보다 우선
|
|
2071
|
+
}
|
|
2072
|
+
],
|
|
2073
|
+
defaultVariants: { size: "medium", error: false, disabled: false }
|
|
2074
|
+
}),
|
|
2075
|
+
subText: utils.cva("ml-1 shrink-0 font-regular", {
|
|
2076
|
+
variants: {
|
|
2077
|
+
size: {
|
|
2078
|
+
xsmall: "text-body-3",
|
|
2079
|
+
small: "text-body-2",
|
|
2080
|
+
medium: "text-body-2",
|
|
2081
|
+
large: "text-body-1"
|
|
2082
|
+
},
|
|
2083
|
+
disabled: {
|
|
2084
|
+
true: "text-text-disabled",
|
|
2085
|
+
false: "text-text-tertiary"
|
|
2086
|
+
}
|
|
2087
|
+
},
|
|
2088
|
+
defaultVariants: { size: "medium", disabled: false }
|
|
2089
|
+
}),
|
|
2090
|
+
icon: utils.cva("shrink-0 text-icon-tertiary", {
|
|
2091
|
+
variants: {
|
|
2092
|
+
size: {
|
|
2093
|
+
xsmall: "size-4",
|
|
2094
|
+
small: "size-4",
|
|
2095
|
+
medium: "size-4",
|
|
2096
|
+
large: "size-5"
|
|
2097
|
+
}
|
|
2098
|
+
},
|
|
2099
|
+
defaultVariants: { size: "medium" }
|
|
2100
|
+
})
|
|
2101
|
+
};
|
|
2102
|
+
var TextField = React2.forwardRef(
|
|
2103
|
+
({
|
|
2104
|
+
children,
|
|
2105
|
+
variant = "fill",
|
|
2106
|
+
size = "medium",
|
|
2107
|
+
error = false,
|
|
2108
|
+
disabled = false,
|
|
2109
|
+
className,
|
|
2110
|
+
id: providedId,
|
|
2111
|
+
value,
|
|
2112
|
+
onChange,
|
|
2113
|
+
...inputProps
|
|
2114
|
+
}, ref) => {
|
|
2115
|
+
const uniqueId = React2.useId();
|
|
2116
|
+
const id = providedId || `text-field-${uniqueId}`;
|
|
2117
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TextFieldContext.Provider, { value: { variant, size, error, disabled, id, value, onChange }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn(textFieldVariants.container, className), children: children || /* @__PURE__ */ jsxRuntime.jsx(TextField.Input, { ...inputProps }) }) });
|
|
2118
|
+
}
|
|
2119
|
+
);
|
|
2120
|
+
TextField.Label = React2.forwardRef(
|
|
2121
|
+
({ children, required = false, className }, ref) => {
|
|
2122
|
+
const { size, disabled, id } = useTextFieldContext();
|
|
2123
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2124
|
+
"label",
|
|
2125
|
+
{
|
|
2126
|
+
ref,
|
|
2127
|
+
htmlFor: id,
|
|
2128
|
+
className: utils.cn(textFieldVariants.label({ size, disabled, required }), className),
|
|
2129
|
+
children
|
|
2130
|
+
}
|
|
2131
|
+
);
|
|
2132
|
+
}
|
|
2133
|
+
);
|
|
2134
|
+
TextField.Input = React2.forwardRef(
|
|
2135
|
+
({ className, leftIcon, rightIcon, subText, ...props }, ref) => {
|
|
2136
|
+
const {
|
|
2137
|
+
variant,
|
|
2138
|
+
size,
|
|
2139
|
+
error,
|
|
2140
|
+
disabled,
|
|
2141
|
+
id,
|
|
2142
|
+
value: contextValue,
|
|
2143
|
+
onChange: contextOnChange
|
|
2144
|
+
} = useTextFieldContext();
|
|
2145
|
+
const state = disabled ? "disabled" : error ? "error" : "default";
|
|
2146
|
+
const isControlled = contextValue !== void 0;
|
|
2147
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn(textFieldVariants.wrapper({ variant, size, state }), className), children: [
|
|
2148
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2149
|
+
"span",
|
|
2150
|
+
{
|
|
2151
|
+
className: utils.cn("flex items-center justify-center", textFieldVariants.icon({ size })),
|
|
2152
|
+
children: leftIcon
|
|
2153
|
+
}
|
|
2154
|
+
),
|
|
2155
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 flex-row items-center justify-center", children: [
|
|
2156
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2157
|
+
"input",
|
|
2158
|
+
{
|
|
2159
|
+
ref,
|
|
2160
|
+
id,
|
|
2161
|
+
disabled,
|
|
2162
|
+
className: utils.cn(textFieldVariants.input({ size, state })),
|
|
2163
|
+
onChange: (e) => {
|
|
2164
|
+
contextOnChange?.(e);
|
|
2165
|
+
},
|
|
2166
|
+
...props,
|
|
2167
|
+
...isControlled ? { value: contextValue } : {}
|
|
2168
|
+
}
|
|
2169
|
+
),
|
|
2170
|
+
subText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: utils.cn(textFieldVariants.subText({ size, disabled })), children: subText })
|
|
2171
|
+
] }),
|
|
2172
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2173
|
+
"span",
|
|
2174
|
+
{
|
|
2175
|
+
className: utils.cn("flex items-center justify-center", textFieldVariants.icon({ size })),
|
|
2176
|
+
children: rightIcon
|
|
2177
|
+
}
|
|
2178
|
+
)
|
|
2179
|
+
] });
|
|
2180
|
+
}
|
|
2181
|
+
);
|
|
2182
|
+
TextField.Description = React2.forwardRef(
|
|
2183
|
+
({ children, className }, ref) => {
|
|
2184
|
+
const { size, error, disabled } = useTextFieldContext();
|
|
2185
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2186
|
+
"p",
|
|
2187
|
+
{
|
|
2188
|
+
ref,
|
|
2189
|
+
className: utils.cn(textFieldVariants.description({ size, error, disabled }), className),
|
|
2190
|
+
children
|
|
2191
|
+
}
|
|
2192
|
+
);
|
|
2193
|
+
}
|
|
2194
|
+
);
|
|
2195
|
+
TextField.displayName = "TextField";
|
|
2196
|
+
TextField.Label.displayName = "TextField.Label";
|
|
2197
|
+
TextField.Input.displayName = "TextField.Input";
|
|
2198
|
+
TextField.Description.displayName = "TextField.Description";
|
|
2199
|
+
function ScrollBar({
|
|
2200
|
+
className,
|
|
2201
|
+
orientation = "vertical",
|
|
2202
|
+
...props
|
|
2203
|
+
}) {
|
|
2204
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2205
|
+
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
2206
|
+
{
|
|
2207
|
+
"data-slot": "scroll-area-scrollbar",
|
|
2208
|
+
orientation,
|
|
2209
|
+
className: utils.cn(
|
|
2210
|
+
"flex touch-none select-none transition-opacity",
|
|
2211
|
+
orientation === "vertical" && "w-[10px] p-[2px] opacity-0 duration-300 ease-out group-hover:opacity-100",
|
|
2212
|
+
orientation === "horizontal" && "h-[10px] flex-col px-[3px] py-[2px]",
|
|
2213
|
+
className
|
|
2214
|
+
),
|
|
2215
|
+
...props,
|
|
2216
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2217
|
+
ScrollAreaPrimitive__namespace.ScrollAreaThumb,
|
|
2218
|
+
{
|
|
2219
|
+
"data-slot": "scroll-area-thumb",
|
|
2220
|
+
className: "relative flex-1 rounded-full bg-component-scroll"
|
|
2221
|
+
}
|
|
2222
|
+
)
|
|
2223
|
+
}
|
|
2224
|
+
);
|
|
2225
|
+
}
|
|
2226
|
+
function ScrollArea({
|
|
2227
|
+
className,
|
|
2228
|
+
children,
|
|
2229
|
+
onScroll,
|
|
2230
|
+
scrollRef,
|
|
2231
|
+
hideVerticalScrollbar = false,
|
|
2232
|
+
hideHorizontalScrollbar = false,
|
|
2233
|
+
disableHorizontalScroll = false,
|
|
2234
|
+
...props
|
|
2235
|
+
}) {
|
|
2236
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2237
|
+
ScrollAreaPrimitive__namespace.Root,
|
|
2238
|
+
{
|
|
2239
|
+
"data-slot": "scroll-area",
|
|
2240
|
+
className: utils.cn("group relative overflow-hidden", className),
|
|
2241
|
+
...props,
|
|
2242
|
+
children: [
|
|
2243
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2244
|
+
ScrollAreaPrimitive__namespace.Viewport,
|
|
2245
|
+
{
|
|
2246
|
+
"data-slot": "scroll-area-viewport",
|
|
2247
|
+
ref: scrollRef,
|
|
2248
|
+
onScroll,
|
|
2249
|
+
className: utils.cn(
|
|
2250
|
+
"size-full rounded-[inherit]",
|
|
2251
|
+
disableHorizontalScroll && "!overflow-x-hidden"
|
|
2252
|
+
),
|
|
2253
|
+
children
|
|
2254
|
+
}
|
|
2255
|
+
),
|
|
2256
|
+
!hideVerticalScrollbar && /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "vertical", forceMount: true }),
|
|
2257
|
+
!(hideHorizontalScrollbar || disableHorizontalScroll) && /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "horizontal", forceMount: true }),
|
|
2258
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
2259
|
+
]
|
|
2260
|
+
}
|
|
2261
|
+
);
|
|
2262
|
+
}
|
|
2263
|
+
var MODAL_PADDING = {
|
|
2264
|
+
body: "px-4 pb-4",
|
|
2265
|
+
footer: "px-4 py-3"
|
|
2266
|
+
};
|
|
2267
|
+
var ModalContext = React2.createContext({ size: "medium" });
|
|
2268
|
+
var Modal = DialogPrimitive__namespace.Root;
|
|
2269
|
+
Modal.Trigger = DialogPrimitive__namespace.Trigger;
|
|
2270
|
+
Modal.Portal = DialogPrimitive__namespace.Portal;
|
|
2271
|
+
Modal.Close = React2.forwardRef(({ size, ...props }, ref) => {
|
|
2272
|
+
const { size: modalSize } = React2.useContext(ModalContext);
|
|
2273
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2274
|
+
Button,
|
|
2275
|
+
{
|
|
2276
|
+
...props,
|
|
2277
|
+
ref,
|
|
2278
|
+
color: "assistive",
|
|
2279
|
+
variant: "contained",
|
|
2280
|
+
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
2281
|
+
}
|
|
2282
|
+
) });
|
|
128
2283
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
2284
|
+
Modal.Overlay = React2.forwardRef(
|
|
2285
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2286
|
+
DialogPrimitive__namespace.Overlay,
|
|
2287
|
+
{
|
|
2288
|
+
ref,
|
|
2289
|
+
className: utils.cn(
|
|
2290
|
+
"fixed inset-0 z-50 bg-component-dim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2291
|
+
className
|
|
2292
|
+
),
|
|
2293
|
+
...props
|
|
2294
|
+
}
|
|
2295
|
+
)
|
|
2296
|
+
);
|
|
2297
|
+
Modal.Content = React2.forwardRef(
|
|
2298
|
+
({ className, children, size = "medium", onInteractOutside, onFocusOutside, ...props }, ref) => {
|
|
2299
|
+
const isFullSize = size === "fullsize";
|
|
2300
|
+
const sizeWidthMap = {
|
|
2301
|
+
small: "max-w-[640px]",
|
|
2302
|
+
medium: "max-w-[800px]",
|
|
2303
|
+
large: "max-w-[960px]",
|
|
2304
|
+
xlarge: "max-w-[1120px]"
|
|
2305
|
+
};
|
|
2306
|
+
const shouldPreventDismissForSelect = (target) => {
|
|
2307
|
+
const isSelectOpen = Boolean(
|
|
2308
|
+
document.querySelector('[data-radix-select-content][data-state="open"]')
|
|
2309
|
+
);
|
|
2310
|
+
if (isSelectOpen) {
|
|
2311
|
+
return true;
|
|
2312
|
+
}
|
|
2313
|
+
if (!(target instanceof Element)) {
|
|
2314
|
+
return false;
|
|
2315
|
+
}
|
|
2316
|
+
return Boolean(
|
|
2317
|
+
target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
|
|
2318
|
+
);
|
|
2319
|
+
};
|
|
2320
|
+
const handleInteractOutside = (event) => {
|
|
2321
|
+
if (shouldPreventDismissForSelect(event.target)) {
|
|
2322
|
+
event.preventDefault();
|
|
2323
|
+
}
|
|
2324
|
+
onInteractOutside?.(event);
|
|
2325
|
+
};
|
|
2326
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxRuntime.jsxs(Modal.Portal, { children: [
|
|
2327
|
+
/* @__PURE__ */ jsxRuntime.jsx(Modal.Overlay, {}),
|
|
2328
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2329
|
+
DialogPrimitive__namespace.Content,
|
|
2330
|
+
{
|
|
2331
|
+
ref,
|
|
2332
|
+
className: utils.cn(
|
|
2333
|
+
// 공통 스타일
|
|
2334
|
+
"fixed z-50 flex flex-col rounded-strong border border-border-primary bg-elevation-elevation-0 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2335
|
+
// fullsize일 때
|
|
2336
|
+
isFullSize ? "inset-0 m-10" : (
|
|
2337
|
+
// 일반 모달일 때
|
|
2338
|
+
utils.cn(
|
|
2339
|
+
"left-[50%] top-[50%] w-full max-h-[90vh] translate-x-[-50%] translate-y-[-50%] shadow-strong data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
2340
|
+
sizeWidthMap[size]
|
|
2341
|
+
)
|
|
2342
|
+
),
|
|
2343
|
+
className
|
|
2344
|
+
),
|
|
2345
|
+
...props,
|
|
2346
|
+
onInteractOutside: handleInteractOutside,
|
|
2347
|
+
children
|
|
2348
|
+
}
|
|
2349
|
+
)
|
|
2350
|
+
] }) });
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
Modal.Header = React2.forwardRef(
|
|
2354
|
+
({ className, line = false, showCloseIcon = true, children, ...props }, ref) => {
|
|
2355
|
+
const { size } = React2.useContext(ModalContext);
|
|
2356
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2357
|
+
"div",
|
|
2358
|
+
{
|
|
2359
|
+
ref,
|
|
2360
|
+
className: utils.cn(
|
|
2361
|
+
"flex shrink-0 flex-row items-center gap-2 pl-4 pr-3",
|
|
2362
|
+
line && "border-b border-border-primary",
|
|
2363
|
+
size === "fullsize" ? "h-16" : "h-14",
|
|
2364
|
+
className
|
|
2365
|
+
),
|
|
2366
|
+
...props,
|
|
2367
|
+
children: [
|
|
2368
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children }),
|
|
2369
|
+
showCloseIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2370
|
+
DialogPrimitive__namespace.Close,
|
|
2371
|
+
{
|
|
2372
|
+
className: utils.cn(
|
|
2373
|
+
"flex shrink-0 items-center justify-center size-8 rounded-medium text-icon-secondary transition-colors hover:bg-elevation-elevation-2 focus:outline-none disabled:pointer-events-none"
|
|
2374
|
+
),
|
|
2375
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.X, { type: "regular", size: 20 })
|
|
2376
|
+
}
|
|
2377
|
+
)
|
|
2378
|
+
]
|
|
2379
|
+
}
|
|
2380
|
+
);
|
|
2381
|
+
}
|
|
2382
|
+
);
|
|
2383
|
+
Modal.Body = React2.forwardRef(
|
|
2384
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2385
|
+
"div",
|
|
2386
|
+
{
|
|
2387
|
+
ref,
|
|
2388
|
+
className: utils.cn(
|
|
2389
|
+
"flex-1 flex flex-col min-h-0 h-full",
|
|
2390
|
+
"[&_[data-slot=scroll-area-viewport]>div]:h-full"
|
|
2391
|
+
),
|
|
2392
|
+
...props,
|
|
2393
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-full flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn(MODAL_PADDING.body, className), children }) })
|
|
2394
|
+
}
|
|
2395
|
+
)
|
|
2396
|
+
);
|
|
2397
|
+
Modal.Footer = React2.forwardRef(
|
|
2398
|
+
({ className, line = true, ...props }, ref) => {
|
|
2399
|
+
const { size } = React2.useContext(ModalContext);
|
|
2400
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2401
|
+
"div",
|
|
2402
|
+
{
|
|
2403
|
+
ref,
|
|
2404
|
+
className: utils.cn(
|
|
2405
|
+
"flex flex-row items-center justify-between",
|
|
2406
|
+
line && "border-t border-border-primary",
|
|
2407
|
+
size === "fullsize" ? "gap-3" : "h-14 gap-3",
|
|
2408
|
+
MODAL_PADDING.footer,
|
|
2409
|
+
className
|
|
2410
|
+
),
|
|
2411
|
+
...props
|
|
2412
|
+
}
|
|
2413
|
+
);
|
|
2414
|
+
}
|
|
2415
|
+
);
|
|
2416
|
+
Modal.FooterDescription = React2.forwardRef(
|
|
2417
|
+
({ className, error = false, icon, children, ...props }, ref) => {
|
|
2418
|
+
const { size } = React2.useContext(ModalContext);
|
|
2419
|
+
const isLargeFooter = size === "fullsize";
|
|
2420
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2421
|
+
"div",
|
|
2422
|
+
{
|
|
2423
|
+
ref,
|
|
2424
|
+
className: utils.cn(
|
|
2425
|
+
"flex flex-row items-center gap-1",
|
|
2426
|
+
isLargeFooter ? "text-body-2" : "text-body-3",
|
|
2427
|
+
error ? "text-text-critical" : "text-text-tertiary",
|
|
2428
|
+
className
|
|
2429
|
+
),
|
|
2430
|
+
...props,
|
|
2431
|
+
children: [
|
|
2432
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 size-4 items-center justify-center [&>svg]:size-4", children: icon }),
|
|
2433
|
+
children
|
|
2434
|
+
]
|
|
2435
|
+
}
|
|
2436
|
+
);
|
|
2437
|
+
}
|
|
2438
|
+
);
|
|
2439
|
+
Modal.Actions = React2.forwardRef(({ className, ...props }, ref) => {
|
|
2440
|
+
const { size } = React2.useContext(ModalContext);
|
|
2441
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2442
|
+
"div",
|
|
2443
|
+
{
|
|
2444
|
+
ref,
|
|
2445
|
+
className: utils.cn(
|
|
2446
|
+
"ml-auto flex flex-row items-center",
|
|
2447
|
+
size === "fullsize" ? "gap-3" : "gap-2",
|
|
2448
|
+
className
|
|
2449
|
+
),
|
|
2450
|
+
...props
|
|
2451
|
+
}
|
|
2452
|
+
);
|
|
132
2453
|
});
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
2454
|
+
Modal.Action = React2.forwardRef(
|
|
2455
|
+
({ color = "primary", size, ...props }, ref) => {
|
|
2456
|
+
const { size: modalSize } = React2.useContext(ModalContext);
|
|
2457
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2458
|
+
Button,
|
|
2459
|
+
{
|
|
2460
|
+
...props,
|
|
2461
|
+
ref,
|
|
2462
|
+
color,
|
|
2463
|
+
variant: "contained",
|
|
2464
|
+
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
2465
|
+
}
|
|
2466
|
+
) });
|
|
2467
|
+
}
|
|
2468
|
+
);
|
|
2469
|
+
Modal.Title = React2.forwardRef(
|
|
2470
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2471
|
+
DialogPrimitive__namespace.Title,
|
|
2472
|
+
{
|
|
2473
|
+
ref,
|
|
2474
|
+
className: utils.cn(
|
|
2475
|
+
"text-title-2 font-semibold leading-none tracking-tight text-text-primary",
|
|
2476
|
+
className
|
|
2477
|
+
),
|
|
2478
|
+
...props
|
|
2479
|
+
}
|
|
2480
|
+
)
|
|
2481
|
+
);
|
|
2482
|
+
Modal.Description = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2483
|
+
DialogPrimitive__namespace.Description,
|
|
2484
|
+
{
|
|
2485
|
+
ref,
|
|
2486
|
+
className: utils.cn("text-body-2 text-text-tertiary", className),
|
|
2487
|
+
...props
|
|
2488
|
+
}
|
|
2489
|
+
));
|
|
2490
|
+
Modal.displayName = "Modal";
|
|
2491
|
+
Modal.Trigger.displayName = "Modal.Trigger";
|
|
2492
|
+
Modal.Portal.displayName = "Modal.Portal";
|
|
2493
|
+
Modal.Close.displayName = "Modal.Close";
|
|
2494
|
+
Modal.Overlay.displayName = "Modal.Overlay";
|
|
2495
|
+
Modal.Content.displayName = "Modal.Content";
|
|
2496
|
+
Modal.Header.displayName = "Modal.Header";
|
|
2497
|
+
Modal.Body.displayName = "Modal.Body";
|
|
2498
|
+
Modal.Footer.displayName = "Modal.Footer";
|
|
2499
|
+
Modal.FooterDescription.displayName = "Modal.FooterDescription";
|
|
2500
|
+
Modal.Actions.displayName = "Modal.Actions";
|
|
2501
|
+
Modal.Action.displayName = "Modal.Action";
|
|
2502
|
+
Modal.Title.displayName = "Modal.Title";
|
|
2503
|
+
Modal.Description.displayName = "Modal.Description";
|
|
2504
|
+
var MessageBoxContext = React2.createContext({ variant: "default" });
|
|
2505
|
+
var MessageBoxRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { ...props });
|
|
2506
|
+
var MessageBox = MessageBoxRoot;
|
|
2507
|
+
MessageBox.Trigger = DialogPrimitive__namespace.Trigger;
|
|
2508
|
+
MessageBox.Content = React2.forwardRef(({ className, children, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(MessageBoxContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
|
|
2509
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2510
|
+
DialogPrimitive__namespace.Overlay,
|
|
2511
|
+
{
|
|
2512
|
+
className: utils.cn(
|
|
2513
|
+
"fixed inset-0 z-50 bg-component-dim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
2514
|
+
)
|
|
2515
|
+
}
|
|
2516
|
+
),
|
|
2517
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2518
|
+
DialogPrimitive__namespace.Content,
|
|
2519
|
+
{
|
|
2520
|
+
ref,
|
|
2521
|
+
className: utils.cn(
|
|
2522
|
+
"fixed left-[50%] top-[50%] z-50 flex w-[400px] translate-x-[-50%] translate-y-[-50%] flex-col items-end gap-4 rounded-medium border border-border-primary bg-elevation-elevation-0 p-4 shadow-strong duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
2523
|
+
className
|
|
2524
|
+
),
|
|
2525
|
+
...props,
|
|
2526
|
+
children
|
|
2527
|
+
}
|
|
2528
|
+
)
|
|
2529
|
+
] }) }));
|
|
2530
|
+
MessageBox.Title = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2531
|
+
DialogPrimitive__namespace.Title,
|
|
2532
|
+
{
|
|
2533
|
+
ref,
|
|
2534
|
+
className: utils.cn("w-full text-title-2 font-semibold text-text-primary", className),
|
|
2535
|
+
...props
|
|
2536
|
+
}
|
|
2537
|
+
));
|
|
2538
|
+
MessageBox.Description = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2539
|
+
DialogPrimitive__namespace.Description,
|
|
2540
|
+
{
|
|
2541
|
+
ref,
|
|
2542
|
+
className: utils.cn("w-full text-body-2 text-text-secondary", className),
|
|
2543
|
+
...props
|
|
2544
|
+
}
|
|
2545
|
+
));
|
|
2546
|
+
MessageBox.Actions = React2.forwardRef(
|
|
2547
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn("flex flex-row gap-2", className), ...props })
|
|
2548
|
+
);
|
|
2549
|
+
MessageBox.Cancel = React2.forwardRef(
|
|
2550
|
+
({ size = "medium", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ref, color: "assistive", variant: "contained", size, ...props }) })
|
|
2551
|
+
);
|
|
2552
|
+
MessageBox.Action = React2.forwardRef(
|
|
2553
|
+
({ size = "medium", ...props }, ref) => {
|
|
2554
|
+
const { variant } = React2.useContext(MessageBoxContext);
|
|
2555
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2556
|
+
Button,
|
|
2557
|
+
{
|
|
2558
|
+
ref,
|
|
2559
|
+
color: variant === "critical" ? "critical" : "primary",
|
|
2560
|
+
variant: "contained",
|
|
2561
|
+
size,
|
|
2562
|
+
...props
|
|
2563
|
+
}
|
|
2564
|
+
) });
|
|
2565
|
+
}
|
|
2566
|
+
);
|
|
2567
|
+
MessageBox.displayName = "MessageBox";
|
|
2568
|
+
MessageBox.Trigger.displayName = "MessageBox.Trigger";
|
|
2569
|
+
MessageBox.Content.displayName = "MessageBox.Content";
|
|
2570
|
+
MessageBox.Title.displayName = "MessageBox.Title";
|
|
2571
|
+
MessageBox.Description.displayName = "MessageBox.Description";
|
|
2572
|
+
MessageBox.Actions.displayName = "MessageBox.Actions";
|
|
2573
|
+
MessageBox.Cancel.displayName = "MessageBox.Cancel";
|
|
2574
|
+
MessageBox.Action.displayName = "MessageBox.Action";
|
|
2575
|
+
var containerVariants4 = utils.cva("inset-0 z-[49] flex items-center justify-center", {
|
|
2576
|
+
variants: {
|
|
2577
|
+
position: {
|
|
2578
|
+
fixed: "fixed",
|
|
2579
|
+
absolute: "absolute"
|
|
2580
|
+
},
|
|
2581
|
+
blockInteraction: {
|
|
2582
|
+
true: "pointer-events-auto",
|
|
2583
|
+
false: "pointer-events-none"
|
|
2584
|
+
}
|
|
2585
|
+
},
|
|
2586
|
+
defaultVariants: {
|
|
2587
|
+
position: "fixed",
|
|
2588
|
+
blockInteraction: false
|
|
2589
|
+
}
|
|
136
2590
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
2591
|
+
var overlayVariants = utils.cva("absolute inset-0 transition-opacity duration-150", {
|
|
2592
|
+
variants: {
|
|
2593
|
+
visible: {
|
|
2594
|
+
true: "opacity-100",
|
|
2595
|
+
false: "opacity-0"
|
|
2596
|
+
},
|
|
2597
|
+
tone: {
|
|
2598
|
+
// 대비감 높은 톤 설정 추후 디자인 시스템에서 추가 되어야함
|
|
2599
|
+
auto: "bg-black/30 dark:bg-white/10",
|
|
2600
|
+
dark: "bg-black/50",
|
|
2601
|
+
light: "bg-white/70",
|
|
2602
|
+
brand: "bg-primary/20"
|
|
2603
|
+
}
|
|
2604
|
+
},
|
|
2605
|
+
defaultVariants: {
|
|
2606
|
+
visible: true,
|
|
2607
|
+
tone: "auto"
|
|
2608
|
+
}
|
|
140
2609
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
2610
|
+
var spinnerVariants = utils.cva(
|
|
2611
|
+
"z-50 shrink-0 animate-spin rounded-full border-elevation-elevation-4 border-t-transparent",
|
|
2612
|
+
{
|
|
2613
|
+
variants: {
|
|
2614
|
+
size: {
|
|
2615
|
+
small: "size-6 border-2",
|
|
2616
|
+
medium: "size-9 border-[3px]",
|
|
2617
|
+
large: "size-12 border-4"
|
|
2618
|
+
}
|
|
2619
|
+
},
|
|
2620
|
+
defaultVariants: {
|
|
2621
|
+
size: "large"
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
);
|
|
2625
|
+
var Loading = React2.forwardRef(
|
|
2626
|
+
({
|
|
2627
|
+
isLoading = true,
|
|
2628
|
+
dim = true,
|
|
2629
|
+
blockInteraction = false,
|
|
2630
|
+
position = "fixed",
|
|
2631
|
+
size = "medium",
|
|
2632
|
+
containerClassName,
|
|
2633
|
+
overlayClassName,
|
|
2634
|
+
spinnerClassName,
|
|
2635
|
+
className,
|
|
2636
|
+
...props
|
|
2637
|
+
}, ref) => {
|
|
2638
|
+
if (!isLoading) {
|
|
2639
|
+
return null;
|
|
2640
|
+
}
|
|
2641
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2642
|
+
"div",
|
|
2643
|
+
{
|
|
2644
|
+
ref,
|
|
2645
|
+
role: "status",
|
|
2646
|
+
"aria-busy": "true",
|
|
2647
|
+
className: utils.cn(
|
|
2648
|
+
containerVariants4({ position, blockInteraction }),
|
|
2649
|
+
containerClassName,
|
|
2650
|
+
className
|
|
2651
|
+
),
|
|
2652
|
+
...props,
|
|
2653
|
+
children: [
|
|
2654
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2655
|
+
"div",
|
|
2656
|
+
{
|
|
2657
|
+
"aria-hidden": "true",
|
|
2658
|
+
className: utils.cn(overlayVariants({ visible: dim }), overlayClassName)
|
|
2659
|
+
}
|
|
2660
|
+
),
|
|
2661
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-50 flex size-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn(spinnerVariants({ size }), spinnerClassName) }) })
|
|
2662
|
+
]
|
|
2663
|
+
}
|
|
2664
|
+
);
|
|
2665
|
+
}
|
|
2666
|
+
);
|
|
2667
|
+
Loading.displayName = "Loading";
|
|
2668
|
+
var trackVariants = utils.cva("w-full overflow-hidden rounded-full bg-elevation-elevation-3", {
|
|
2669
|
+
variants: {
|
|
2670
|
+
size: {
|
|
2671
|
+
small: "h-1",
|
|
2672
|
+
medium: "h-1.5",
|
|
2673
|
+
large: "h-2"
|
|
2674
|
+
}
|
|
2675
|
+
},
|
|
2676
|
+
defaultVariants: {
|
|
2677
|
+
size: "large"
|
|
2678
|
+
}
|
|
144
2679
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
2680
|
+
var gaugeVariants = utils.cva("h-full rounded-full bg-icon-accent transition-[width] duration-300", {
|
|
2681
|
+
variants: {
|
|
2682
|
+
size: {
|
|
2683
|
+
small: "",
|
|
2684
|
+
medium: "",
|
|
2685
|
+
large: ""
|
|
2686
|
+
}
|
|
2687
|
+
},
|
|
2688
|
+
defaultVariants: {
|
|
2689
|
+
size: "medium"
|
|
2690
|
+
}
|
|
148
2691
|
});
|
|
2692
|
+
var Progress = React2.forwardRef(
|
|
2693
|
+
({ value = 0, max = 100, size = "medium", trackClassName, gaugeClassName, className, ...props }, ref) => {
|
|
2694
|
+
const clampedValue = Math.min(Math.max(value, 0), max);
|
|
2695
|
+
const percent = max > 0 ? clampedValue / max * 100 : 0;
|
|
2696
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2697
|
+
"div",
|
|
2698
|
+
{
|
|
2699
|
+
ref,
|
|
2700
|
+
role: "progressbar",
|
|
2701
|
+
"aria-valuenow": clampedValue,
|
|
2702
|
+
"aria-valuemin": 0,
|
|
2703
|
+
"aria-valuemax": max,
|
|
2704
|
+
className: utils.cn(trackVariants({ size }), trackClassName, className),
|
|
2705
|
+
...props,
|
|
2706
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2707
|
+
"div",
|
|
2708
|
+
{
|
|
2709
|
+
className: utils.cn(gaugeVariants({ size }), gaugeClassName),
|
|
2710
|
+
style: { width: `${percent}%` }
|
|
2711
|
+
}
|
|
2712
|
+
)
|
|
2713
|
+
}
|
|
2714
|
+
);
|
|
2715
|
+
}
|
|
2716
|
+
);
|
|
2717
|
+
Progress.displayName = "Progress";
|
|
2718
|
+
var positionFix = `
|
|
2719
|
+
[data-sonner-toaster][data-x-position='center'] [data-sonner-toast] {
|
|
2720
|
+
left: calc(var(--width) / 2) !important;
|
|
2721
|
+
transform: translateX(-50%) var(--y) !important;
|
|
2722
|
+
width: fit-content !important;
|
|
2723
|
+
max-width: calc(100% - var(--mobile-offset-left) * 2) !important;
|
|
2724
|
+
}
|
|
2725
|
+
@media (max-width: 600px) {
|
|
2726
|
+
[data-sonner-toaster] {
|
|
2727
|
+
left: 0 !important;
|
|
2728
|
+
right: 0 !important;
|
|
2729
|
+
}
|
|
2730
|
+
[data-sonner-toaster] [data-sonner-toast] {
|
|
2731
|
+
width: fit-content !important;
|
|
2732
|
+
max-width: calc(100% - var(--mobile-offset-left) - var(--mobile-offset-right)) !important;
|
|
2733
|
+
}
|
|
2734
|
+
[data-sonner-toaster][data-x-position='center'] [data-sonner-toast] {
|
|
2735
|
+
left: 50% !important;
|
|
2736
|
+
}
|
|
2737
|
+
[data-sonner-toaster][data-x-position='right'] [data-sonner-toast] {
|
|
2738
|
+
left: auto !important;
|
|
2739
|
+
right: var(--mobile-offset-right) !important;
|
|
2740
|
+
}
|
|
2741
|
+
[data-sonner-toaster][data-x-position='left'] [data-sonner-toast] {
|
|
2742
|
+
left: var(--mobile-offset-left) !important;
|
|
2743
|
+
right: auto !important;
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
`;
|
|
2747
|
+
var Toaster = ({ ...props }) => {
|
|
2748
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2749
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: positionFix }),
|
|
2750
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2751
|
+
sonner.Toaster,
|
|
2752
|
+
{
|
|
2753
|
+
className: "toaster group [--toast-width:auto] [&_li]:!flex [&_li]:!items-center [&_li]:!justify-between [&_li]:!gap-2",
|
|
2754
|
+
closeButton: false,
|
|
2755
|
+
toastOptions: {
|
|
2756
|
+
closeButton: false
|
|
2757
|
+
},
|
|
2758
|
+
...props
|
|
2759
|
+
}
|
|
2760
|
+
)
|
|
2761
|
+
] });
|
|
2762
|
+
};
|
|
2763
|
+
Toaster.Container = React2__namespace.forwardRef(
|
|
2764
|
+
({ className, children, ...props }, ref) => {
|
|
2765
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2766
|
+
"div",
|
|
2767
|
+
{
|
|
2768
|
+
ref,
|
|
2769
|
+
className: utils.cn(
|
|
2770
|
+
"flex items-center gap-3 rounded-medium border border-border-primary bg-component-toast py-[10px] pl-3 pr-4 text-mono-light shadow-strong",
|
|
2771
|
+
"h-10 w-auto min-w-0 max-w-none",
|
|
2772
|
+
className
|
|
2773
|
+
),
|
|
2774
|
+
...props,
|
|
2775
|
+
children
|
|
2776
|
+
}
|
|
2777
|
+
);
|
|
2778
|
+
}
|
|
2779
|
+
);
|
|
2780
|
+
Toaster.Icon = React2__namespace.forwardRef(
|
|
2781
|
+
({ className, children, ...props }, ref) => {
|
|
2782
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2783
|
+
"div",
|
|
2784
|
+
{
|
|
2785
|
+
ref,
|
|
2786
|
+
className: utils.cn("flex shrink-0 items-center justify-center", className),
|
|
2787
|
+
...props,
|
|
2788
|
+
children
|
|
2789
|
+
}
|
|
2790
|
+
);
|
|
2791
|
+
}
|
|
2792
|
+
);
|
|
2793
|
+
Toaster.Title = React2__namespace.forwardRef(
|
|
2794
|
+
({ className, children, ...props }, ref) => {
|
|
2795
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2796
|
+
"div",
|
|
2797
|
+
{
|
|
2798
|
+
ref,
|
|
2799
|
+
className: utils.cn(
|
|
2800
|
+
"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-body-2 font-medium",
|
|
2801
|
+
className
|
|
2802
|
+
),
|
|
2803
|
+
...props,
|
|
2804
|
+
children
|
|
2805
|
+
}
|
|
2806
|
+
);
|
|
2807
|
+
}
|
|
2808
|
+
);
|
|
2809
|
+
Toaster.Description = React2__namespace.forwardRef(
|
|
2810
|
+
({ className, children, ...props }, ref) => {
|
|
2811
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2812
|
+
"div",
|
|
2813
|
+
{
|
|
2814
|
+
ref,
|
|
2815
|
+
className: utils.cn(
|
|
2816
|
+
"w-full text-body-3 font-regular text-text-static-light/80",
|
|
2817
|
+
"overflow-hidden text-ellipsis",
|
|
2818
|
+
className
|
|
2819
|
+
),
|
|
2820
|
+
...props,
|
|
2821
|
+
children
|
|
2822
|
+
}
|
|
2823
|
+
);
|
|
2824
|
+
}
|
|
2825
|
+
);
|
|
2826
|
+
Toaster.Action = React2__namespace.forwardRef(
|
|
2827
|
+
({ className, children, altText, ...props }, ref) => {
|
|
2828
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2829
|
+
"button",
|
|
2830
|
+
{
|
|
2831
|
+
ref,
|
|
2832
|
+
type: "button",
|
|
2833
|
+
className: utils.cn(
|
|
2834
|
+
"flex h-7 min-h-[28px] w-auto min-w-[28px] shrink-0 items-center justify-center",
|
|
2835
|
+
"rounded-small bg-transparent px-0 py-0",
|
|
2836
|
+
"border-0 transition-colors",
|
|
2837
|
+
"hover:bg-solid-primary-hovered",
|
|
2838
|
+
"whitespace-nowrap",
|
|
2839
|
+
"cursor-pointer",
|
|
2840
|
+
"text-body-2",
|
|
2841
|
+
className
|
|
2842
|
+
),
|
|
2843
|
+
"aria-label": altText,
|
|
2844
|
+
...props,
|
|
2845
|
+
children: children || /* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.X, { type: "regular", className: "size-4" })
|
|
2846
|
+
}
|
|
2847
|
+
);
|
|
2848
|
+
}
|
|
2849
|
+
);
|
|
2850
|
+
Toaster.displayName = "Toaster";
|
|
2851
|
+
Toaster.Container.displayName = "Toaster.Container";
|
|
2852
|
+
Toaster.Icon.displayName = "Toaster.Icon";
|
|
2853
|
+
Toaster.Title.displayName = "Toaster.Title";
|
|
2854
|
+
Toaster.Description.displayName = "Toaster.Description";
|
|
2855
|
+
Toaster.Action.displayName = "Toaster.Action";
|
|
2856
|
+
var ToastProvider = ({
|
|
2857
|
+
children,
|
|
2858
|
+
expand = true,
|
|
2859
|
+
richColors = false,
|
|
2860
|
+
closeButton = false,
|
|
2861
|
+
position = "top-center",
|
|
2862
|
+
duration = 4e3,
|
|
2863
|
+
visibleToasts = 10,
|
|
2864
|
+
toasterProps
|
|
2865
|
+
}) => {
|
|
2866
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2867
|
+
children,
|
|
2868
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2869
|
+
Toaster,
|
|
2870
|
+
{
|
|
2871
|
+
position,
|
|
2872
|
+
closeButton,
|
|
2873
|
+
richColors,
|
|
2874
|
+
expand,
|
|
2875
|
+
duration,
|
|
2876
|
+
visibleToasts,
|
|
2877
|
+
...toasterProps
|
|
2878
|
+
}
|
|
2879
|
+
)
|
|
2880
|
+
] });
|
|
2881
|
+
};
|
|
2882
|
+
function isToastOptions(input) {
|
|
2883
|
+
return typeof input === "object" && input !== null && "title" in input;
|
|
2884
|
+
}
|
|
2885
|
+
function extractToastParams(input, options) {
|
|
2886
|
+
if (isToastOptions(input)) {
|
|
2887
|
+
return {
|
|
2888
|
+
title: input.title,
|
|
2889
|
+
description: input.description,
|
|
2890
|
+
action: input.action,
|
|
2891
|
+
close: input.close
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
return {
|
|
2895
|
+
title: input,
|
|
2896
|
+
description: options?.description,
|
|
2897
|
+
action: options?.action,
|
|
2898
|
+
close: options?.close
|
|
2899
|
+
};
|
|
2900
|
+
}
|
|
2901
|
+
function getSonnerOptions(options) {
|
|
2902
|
+
if (!options) {
|
|
2903
|
+
return void 0;
|
|
2904
|
+
}
|
|
2905
|
+
const { description: _description, action: _action, close: _close, ...sonnerOptions } = options;
|
|
2906
|
+
return sonnerOptions;
|
|
2907
|
+
}
|
|
2908
|
+
function ToastContent({
|
|
2909
|
+
id,
|
|
2910
|
+
icon,
|
|
2911
|
+
title,
|
|
2912
|
+
description,
|
|
2913
|
+
action,
|
|
2914
|
+
close
|
|
2915
|
+
}) {
|
|
2916
|
+
const hasExtra = description || action;
|
|
2917
|
+
if (hasExtra) {
|
|
2918
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Toaster.Container, { className: "h-auto min-h-12 flex-col items-start gap-1 py-3", children: [
|
|
2919
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-2", children: [
|
|
2920
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(Toaster.Icon, { children: icon }),
|
|
2921
|
+
/* @__PURE__ */ jsxRuntime.jsx(Toaster.Title, { children: title }),
|
|
2922
|
+
close && /* @__PURE__ */ jsxRuntime.jsx(Toaster.Action, { className: "rounded-medium", onClick: () => sonner.toast.dismiss(id) })
|
|
2923
|
+
] }),
|
|
2924
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(Toaster.Description, { children: description }),
|
|
2925
|
+
action && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2926
|
+
Toaster.Action,
|
|
2927
|
+
{
|
|
2928
|
+
className: "mt-1 text-text-info hover:text-text-info-hovered",
|
|
2929
|
+
onClick: () => {
|
|
2930
|
+
action.onClick();
|
|
2931
|
+
sonner.toast.dismiss(id);
|
|
2932
|
+
},
|
|
2933
|
+
children: action.label
|
|
2934
|
+
}
|
|
2935
|
+
)
|
|
2936
|
+
] });
|
|
2937
|
+
}
|
|
2938
|
+
if (close) {
|
|
2939
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Toaster.Container, { className: "py-1.5 pr-1.5", children: [
|
|
2940
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center gap-2 overflow-hidden", children: [
|
|
2941
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(Toaster.Icon, { children: icon }),
|
|
2942
|
+
/* @__PURE__ */ jsxRuntime.jsx(Toaster.Title, { children: title })
|
|
2943
|
+
] }),
|
|
2944
|
+
/* @__PURE__ */ jsxRuntime.jsx(Toaster.Action, { className: "rounded-medium", onClick: () => sonner.toast.dismiss(id) })
|
|
2945
|
+
] });
|
|
2946
|
+
}
|
|
2947
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Toaster.Container, { children: [
|
|
2948
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(Toaster.Icon, { children: icon }),
|
|
2949
|
+
/* @__PURE__ */ jsxRuntime.jsx(Toaster.Title, { children: title })
|
|
2950
|
+
] });
|
|
2951
|
+
}
|
|
2952
|
+
function createToast(input, options, icon) {
|
|
2953
|
+
const { title, description, action, close } = extractToastParams(input, options);
|
|
2954
|
+
return sonner.toast.custom(
|
|
2955
|
+
(id) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2956
|
+
ToastContent,
|
|
2957
|
+
{
|
|
2958
|
+
id,
|
|
2959
|
+
icon,
|
|
2960
|
+
title,
|
|
2961
|
+
description,
|
|
2962
|
+
action,
|
|
2963
|
+
close
|
|
2964
|
+
}
|
|
2965
|
+
),
|
|
2966
|
+
{ unstyled: true, ...getSonnerOptions(options) }
|
|
2967
|
+
);
|
|
2968
|
+
}
|
|
2969
|
+
var toast = Object.assign(
|
|
2970
|
+
(input, options) => createToast(input, options),
|
|
2971
|
+
{
|
|
2972
|
+
success: (input, options) => createToast(
|
|
2973
|
+
input,
|
|
2974
|
+
options,
|
|
2975
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.Check, { type: "regular", className: "size-5 text-icon-success" })
|
|
2976
|
+
),
|
|
2977
|
+
error: (input, options) => createToast(
|
|
2978
|
+
input,
|
|
2979
|
+
options,
|
|
2980
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.Error, { type: "regular", className: "size-5 text-icon-critical" })
|
|
2981
|
+
),
|
|
2982
|
+
info: (input, options) => createToast(
|
|
2983
|
+
input,
|
|
2984
|
+
options,
|
|
2985
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.Info, { type: "regular", className: "size-5 text-icon-static-light" })
|
|
2986
|
+
),
|
|
2987
|
+
warning: (input, options) => createToast(
|
|
2988
|
+
input,
|
|
2989
|
+
options,
|
|
2990
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunk5M47B2XJ_js.Warning, { type: "regular", className: "size-5 text-icon-warning" })
|
|
2991
|
+
),
|
|
2992
|
+
loading: (input, options) => createToast(input, options),
|
|
2993
|
+
dismiss: sonner.toast.dismiss,
|
|
2994
|
+
promise: sonner.toast.promise,
|
|
2995
|
+
custom: sonner.toast.custom
|
|
2996
|
+
}
|
|
2997
|
+
);
|
|
2998
|
+
function toExtended(options) {
|
|
2999
|
+
if (!options) {
|
|
3000
|
+
return void 0;
|
|
3001
|
+
}
|
|
3002
|
+
const { description: _desc, action: _act, ...rest } = options;
|
|
3003
|
+
const converted = { ...rest };
|
|
3004
|
+
if (typeof _desc === "string") {
|
|
3005
|
+
converted.description = _desc;
|
|
3006
|
+
}
|
|
3007
|
+
return converted;
|
|
3008
|
+
}
|
|
3009
|
+
var DEFAULT_MESSAGES = {
|
|
3010
|
+
success: "\uC131\uACF5",
|
|
3011
|
+
error: "\uC624\uB958",
|
|
3012
|
+
info: "\uC815\uBCF4",
|
|
3013
|
+
warning: "\uACBD\uACE0",
|
|
3014
|
+
loading: "\uB85C\uB529"
|
|
3015
|
+
};
|
|
3016
|
+
function useToast() {
|
|
3017
|
+
const show = (message, options) => toast(message, toExtended(options));
|
|
3018
|
+
const dismiss = (toastId) => toast.dismiss(toastId);
|
|
3019
|
+
const showTypedToast = (type, message, options) => {
|
|
3020
|
+
const toastMessage = message ?? DEFAULT_MESSAGES[type];
|
|
3021
|
+
return toast[type](toastMessage, toExtended(options));
|
|
3022
|
+
};
|
|
3023
|
+
const promiseToast = (promiseTask, options, toastOptions) => sonner.toast.promise(promiseTask, {
|
|
3024
|
+
loading: options.loading ?? DEFAULT_MESSAGES.loading,
|
|
3025
|
+
success: options.success ?? DEFAULT_MESSAGES.success,
|
|
3026
|
+
error: options.error ?? DEFAULT_MESSAGES.error,
|
|
3027
|
+
finally: options.finally,
|
|
3028
|
+
description: options.description,
|
|
3029
|
+
...toastOptions
|
|
3030
|
+
});
|
|
3031
|
+
const custom = (render, options) => toast.custom(render, options);
|
|
3032
|
+
return {
|
|
3033
|
+
show,
|
|
3034
|
+
dismiss,
|
|
3035
|
+
promise: promiseToast,
|
|
3036
|
+
custom,
|
|
3037
|
+
success: (message, options) => showTypedToast("success", message, options),
|
|
3038
|
+
error: (message, options) => showTypedToast("error", message, options),
|
|
3039
|
+
info: (message, options) => showTypedToast("info", message, options),
|
|
3040
|
+
warning: (message, options) => showTypedToast("warning", message, options),
|
|
3041
|
+
loading: (message, options) => showTypedToast("loading", message, options)
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
exports.Avatar = Avatar;
|
|
3046
|
+
exports.Badge = Badge;
|
|
3047
|
+
exports.Breadcrumb = Breadcrumb;
|
|
3048
|
+
exports.Button = Button;
|
|
3049
|
+
exports.ButtonGroup = ButtonGroup;
|
|
3050
|
+
exports.Checkbox = Checkbox;
|
|
3051
|
+
exports.DatePicker = DatePicker;
|
|
3052
|
+
exports.DoubleTag = DoubleTag;
|
|
3053
|
+
exports.IconButton = IconButton;
|
|
3054
|
+
exports.Loading = Loading;
|
|
3055
|
+
exports.MessageBox = MessageBox;
|
|
3056
|
+
exports.Modal = Modal;
|
|
3057
|
+
exports.Progress = Progress;
|
|
3058
|
+
exports.Radio = Radio;
|
|
3059
|
+
exports.ScrollArea = ScrollArea;
|
|
3060
|
+
exports.ScrollBar = ScrollBar;
|
|
3061
|
+
exports.Segment = Segment;
|
|
3062
|
+
exports.Select = Select;
|
|
3063
|
+
exports.Star = Star;
|
|
3064
|
+
exports.Switch = Switch;
|
|
3065
|
+
exports.Tabs = Tabs;
|
|
3066
|
+
exports.Tag = Tag;
|
|
3067
|
+
exports.TextArea = TextArea;
|
|
3068
|
+
exports.TextField = TextField;
|
|
3069
|
+
exports.ToastProvider = ToastProvider;
|
|
3070
|
+
exports.Toaster = Toaster;
|
|
3071
|
+
exports.Tooltip = Tooltip;
|
|
3072
|
+
exports.toast = toast;
|
|
3073
|
+
exports.useToast = useToast;
|
|
149
3074
|
//# sourceMappingURL=index.js.map
|
|
150
3075
|
//# sourceMappingURL=index.js.map
|