sellmate-design-system-react 9.0.0-beta.30 → 9.0.0-beta.32
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/AGENTS.md +111 -21
- package/dist/components/SAccountListBox/AccountListBoxPortal.d.ts +31 -0
- package/dist/components/SAccountListBox/README.md +86 -0
- package/dist/components/SAccountListBox/SAccountListBox.d.ts +79 -0
- package/dist/components/SAccountListBox/SystemMenuPortal.d.ts +58 -0
- package/dist/components/SAccountListBox/accountListBox.config.d.ts +64 -0
- package/dist/components/SAccountListBox/index.d.ts +2 -0
- package/dist/components/SChipFilter/README.md +16 -3
- package/dist/components/SChipFilter/SChipFilter.d.ts +22 -4
- package/dist/components/SGnb/README.md +1 -1
- package/dist/components/SGnb/SGnb.d.ts +29 -7
- package/dist/components/SGnbSystem/README.md +29 -6
- package/dist/components/SGnbSystem/SGnbSystem.d.ts +57 -17
- package/dist/components/SGnbSystem/gnbSystem.config.d.ts +34 -1
- package/dist/components/SGnbSystem/index.d.ts +1 -1
- package/dist/components/SIcon/README.md +2 -0
- package/dist/components/SIcon/icons.gen.d.ts +2 -0
- package/dist/components/SPortal/README.md +2 -0
- package/dist/components/SSystemActionButton/README.md +96 -9
- package/dist/components/SSystemActionButton/SSystemActionButton.d.ts +97 -15
- package/dist/components/SSystemActionButton/index.d.ts +1 -1
- package/dist/index.cjs +1131 -398
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1125 -400
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +333 -40
- package/dist/llms.txt +113 -23
- package/dist/styles.css +66 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
4
|
-
import { forwardRef, useState, useRef, useEffect, createContext, useContext, useCallback, useMemo, useId, Children, cloneElement, useImperativeHandle,
|
|
4
|
+
import { forwardRef, useState, useRef, useEffect, createContext, useContext, useCallback, useMemo, useId, Children, cloneElement, useImperativeHandle, Fragment as Fragment$1, useLayoutEffect, isValidElement, useSyncExternalStore, Component } from 'react';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
7
7
|
import * as RCheckbox from '@radix-ui/react-checkbox';
|
|
@@ -242,6 +242,47 @@ var fieldWidthValue = (v) => {
|
|
|
242
242
|
if (isFieldWidthGrade(v)) return `var(--cmp-field-width-${v})`;
|
|
243
243
|
return typeof v === "number" ? `${v}px` : v;
|
|
244
244
|
};
|
|
245
|
+
var Icon_account = (p) => {
|
|
246
|
+
const { size = 24, ...rest } = p;
|
|
247
|
+
return /* @__PURE__ */ jsxs(
|
|
248
|
+
"svg",
|
|
249
|
+
{
|
|
250
|
+
width: size,
|
|
251
|
+
height: size,
|
|
252
|
+
viewBox: "0 0 24 24",
|
|
253
|
+
fill: "none",
|
|
254
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
255
|
+
...rest,
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ jsx(
|
|
258
|
+
"path",
|
|
259
|
+
{
|
|
260
|
+
d: "M11.75 13.75H9.35547C7.96612 13.75 6.68824 14.3982 5.74609 15.373C4.80587 16.346 4.25975 17.5818 4.25 18.6846C4.25175 18.6862 4.25343 18.6884 4.25586 18.6904C4.28703 18.7161 4.35523 18.75 4.4541 18.75H12.5V20.25H4.4541C3.65662 20.25 2.75016 19.692 2.75 18.7148C2.75 17.144 3.50242 15.5362 4.66699 14.3311C5.83832 13.119 7.48832 12.25 9.35547 12.25H11.75V13.75Z",
|
|
261
|
+
fill: "currentColor"
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
/* @__PURE__ */ jsx(
|
|
265
|
+
"path",
|
|
266
|
+
{
|
|
267
|
+
fillRule: "evenodd",
|
|
268
|
+
clipRule: "evenodd",
|
|
269
|
+
d: "M17.4854 11C17.6175 11.0001 17.7358 11.0828 17.7803 11.2061L18.0977 12.0859C18.2115 12.1143 18.3098 12.1432 18.3926 12.1729C18.483 12.2052 18.5994 12.2543 18.7432 12.3213L19.4834 11.9297C19.5436 11.8979 19.6124 11.886 19.6797 11.8965C19.7471 11.9071 19.8098 11.9394 19.8574 11.9883L20.5078 12.6611C20.5942 12.7507 20.6188 12.8818 20.5703 12.9961L20.2236 13.8096C20.2811 13.9152 20.3272 14.0055 20.3623 14.0811C20.4001 14.1633 20.4462 14.2768 20.502 14.4229L21.3105 14.7695C21.432 14.8213 21.5071 14.9432 21.499 15.0732L21.4404 16.0068C21.4363 16.0674 21.4137 16.1255 21.377 16.1738C21.3402 16.2221 21.2906 16.2592 21.2334 16.2793L20.4668 16.5508C20.4447 16.6565 20.4218 16.7477 20.3975 16.8242C20.3583 16.9421 20.3137 17.0582 20.2637 17.1719L20.6484 18.0225C20.6756 18.0822 20.6825 18.1497 20.6689 18.2139C20.6553 18.2779 20.6222 18.3364 20.5732 18.3799L19.8408 19.0332C19.7927 19.0758 19.7328 19.1026 19.6689 19.1104C19.6051 19.1181 19.5403 19.1062 19.4834 19.0762L18.7285 18.6768C18.6106 18.7392 18.4889 18.7943 18.3643 18.8418L18.0352 18.9648L17.7422 19.7744C17.7205 19.8337 17.6813 19.8852 17.6299 19.9219C17.5785 19.9585 17.5172 19.9792 17.4541 19.9805L16.5996 20C16.5348 20.0017 16.4709 19.9833 16.417 19.9473C16.3631 19.9113 16.3221 19.8593 16.2988 19.7988L15.9541 18.8867C15.8365 18.8465 15.7196 18.8026 15.6045 18.7559C15.5104 18.7151 15.4173 18.6711 15.3262 18.624L14.4717 18.9893C14.4154 19.0133 14.3533 19.0204 14.293 19.0098C14.2326 18.9991 14.1766 18.9715 14.1318 18.9297L13.499 18.3359C13.452 18.292 13.4197 18.234 13.4072 18.1709C13.3949 18.1079 13.4031 18.0428 13.4297 17.9844L13.7969 17.1826C13.7481 17.088 13.7027 16.9916 13.6611 16.8936C13.6125 16.7733 13.5677 16.6512 13.5264 16.5283L12.7207 16.2832C12.6554 16.2635 12.5985 16.2224 12.5586 16.167C12.5187 16.1114 12.4978 16.0439 12.5 15.9756L12.5312 15.1113C12.5335 15.0549 12.5519 15.0002 12.583 14.9531C12.6141 14.906 12.657 14.868 12.708 14.8438L13.5527 14.4375C13.5918 14.2943 13.6262 14.1829 13.6562 14.1016C13.6987 13.9929 13.7462 13.8859 13.7979 13.7812L13.4316 13.0068C13.4039 12.9481 13.3952 12.8821 13.4072 12.8184C13.4194 12.7545 13.4516 12.6959 13.499 12.6514L14.1309 12.0547C14.175 12.013 14.2303 11.9847 14.29 11.9736C14.3499 11.9626 14.4125 11.9699 14.4688 11.9932L15.3223 12.3457C15.4168 12.2827 15.5027 12.2314 15.5801 12.1904C15.6722 12.1415 15.7953 12.0904 15.9502 12.0352L16.248 11.207C16.27 11.1465 16.3096 11.0936 16.3623 11.0566C16.4151 11.0197 16.4785 10.9999 16.543 11H17.4854ZM17.0107 14.1582C16.2606 14.1582 15.6523 14.7594 15.6523 15.501C15.6524 16.2425 16.2607 16.8437 17.0107 16.8438C17.7604 16.8438 18.3681 16.2425 18.3682 15.501C18.3682 14.7594 17.7609 14.1582 17.0107 14.1582Z",
|
|
270
|
+
fill: "currentColor"
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
/* @__PURE__ */ jsx(
|
|
274
|
+
"path",
|
|
275
|
+
{
|
|
276
|
+
fillRule: "evenodd",
|
|
277
|
+
clipRule: "evenodd",
|
|
278
|
+
d: "M10.5 3.5C12.6875 3.5 14.5 5.3125 14.5 7.5C14.5 9.71875 12.6875 11.5 10.5 11.5C8.28125 11.5 6.5 9.71875 6.5 7.5C6.5 5.3125 8.28125 3.5 10.5 3.5ZM10.5 5C9.11729 5 8 6.13329 8 7.5C8 8.89032 9.10968 10 10.5 10C11.8667 10 13 8.88271 13 7.5C13 6.14093 11.8591 5 10.5 5Z",
|
|
279
|
+
fill: "currentColor"
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
};
|
|
245
286
|
var Icon_add = (p) => {
|
|
246
287
|
const { size = 24, ...rest } = p;
|
|
247
288
|
return /* @__PURE__ */ jsx(
|
|
@@ -571,6 +612,38 @@ var Icon_bell = (p) => {
|
|
|
571
612
|
}
|
|
572
613
|
);
|
|
573
614
|
};
|
|
615
|
+
var Icon_bellRinging = (p) => {
|
|
616
|
+
const { size = 24, ...rest } = p;
|
|
617
|
+
return /* @__PURE__ */ jsxs(
|
|
618
|
+
"svg",
|
|
619
|
+
{
|
|
620
|
+
width: size,
|
|
621
|
+
height: size,
|
|
622
|
+
viewBox: "0 0 24 24",
|
|
623
|
+
fill: "none",
|
|
624
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
625
|
+
...rest,
|
|
626
|
+
children: [
|
|
627
|
+
/* @__PURE__ */ jsx(
|
|
628
|
+
"path",
|
|
629
|
+
{
|
|
630
|
+
fillRule: "evenodd",
|
|
631
|
+
clipRule: "evenodd",
|
|
632
|
+
d: "M14.7569 2.38727C15.5529 2.61577 16.0134 3.44651 15.7853 4.24262L15.6017 4.88283C18.2685 6.33275 19.6863 9.40776 18.8414 12.3553L17.8242 15.9028L17.7839 16.0822C17.615 17.0352 17.9736 18.7681 18.418 19.5394C18.8918 20.3618 17.8729 20.9656 16.9454 20.6999L12.9492 19.554C12.9484 19.5568 12.9478 19.5597 12.9468 19.5625C12.3934 21.1403 10.776 22.0516 9.24413 21.6125C7.71218 21.1732 6.82362 19.5434 7.19047 17.9119C7.19112 17.909 7.19212 17.9062 7.19289 17.9034L3.19671 16.7575L3.02761 16.6989C2.20629 16.3626 1.77717 15.4116 2.56283 14.993C3.34841 14.5742 4.57093 13.2947 4.93263 12.3972L4.99356 12.2237L6.01078 8.6762C6.85627 5.72841 9.68793 3.8709 12.7182 4.05498L12.9015 3.41571C13.13 2.61953 13.9606 2.15895 14.7569 2.38727ZM13.7922 5.75169C10.9998 4.951 8.19452 6.50346 7.45267 9.08965L6.43545 12.6371C6.2092 13.4258 5.61733 14.2164 5.11212 14.7792C4.88445 15.0328 4.62615 15.2903 4.35646 15.5296L16.6125 19.044C16.5106 18.698 16.4281 18.343 16.3694 18.0071C16.2392 17.2621 16.1562 16.2782 16.3823 15.4893L17.3995 11.9419C18.1408 9.35565 16.5842 6.55254 13.7922 5.75169Z",
|
|
633
|
+
fill: "currentColor"
|
|
634
|
+
}
|
|
635
|
+
),
|
|
636
|
+
/* @__PURE__ */ jsx(
|
|
637
|
+
"path",
|
|
638
|
+
{
|
|
639
|
+
d: "M18.7143 4.09705C19.0365 3.83687 19.5097 3.88767 19.77 4.2098C20.8724 5.57421 21.6644 7.17777 22.0725 8.89915C22.1677 9.30202 21.9178 9.70642 21.515 9.80193C21.1123 9.89711 20.7087 9.64808 20.6129 9.24559C20.2569 7.74423 19.5651 6.34446 18.6025 5.15304C18.3423 4.83086 18.3922 4.35736 18.7143 4.09705Z",
|
|
640
|
+
fill: "currentColor"
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
);
|
|
646
|
+
};
|
|
574
647
|
var Icon_bill = (p) => {
|
|
575
648
|
const { size = 24, ...rest } = p;
|
|
576
649
|
return /* @__PURE__ */ jsxs(
|
|
@@ -3070,6 +3143,7 @@ var Icon_youtube = (p) => {
|
|
|
3070
3143
|
);
|
|
3071
3144
|
};
|
|
3072
3145
|
var ICONS = {
|
|
3146
|
+
account: Icon_account,
|
|
3073
3147
|
add: Icon_add,
|
|
3074
3148
|
alert: Icon_alert,
|
|
3075
3149
|
alignKorean: Icon_alignKorean,
|
|
@@ -3082,6 +3156,7 @@ var ICONS = {
|
|
|
3082
3156
|
attachFile: Icon_attachFile,
|
|
3083
3157
|
barcode: Icon_barcode,
|
|
3084
3158
|
bell: Icon_bell,
|
|
3159
|
+
bellRinging: Icon_bellRinging,
|
|
3085
3160
|
bill: Icon_bill,
|
|
3086
3161
|
board: Icon_board,
|
|
3087
3162
|
box: Icon_box,
|
|
@@ -4232,7 +4307,7 @@ function moveWithDepth(items, fromIndex, target, getDepth, setDepth, maxDepth) {
|
|
|
4232
4307
|
const nextDepth = target.intent === "inside" ? targetDepth + 1 : targetDepth;
|
|
4233
4308
|
const depthDelta = clampDepth(nextDepth, maxDepth) - sourceDepth;
|
|
4234
4309
|
const nextMovedItems = setDepth && depthDelta !== 0 ? movedItems.map(
|
|
4235
|
-
(
|
|
4310
|
+
(item4, index) => setDepth(item4, clampDepth(getDepth(item4, fromIndex + index) + depthDelta, maxDepth))
|
|
4236
4311
|
) : movedItems;
|
|
4237
4312
|
return [
|
|
4238
4313
|
...remainingItems.slice(0, insertionIndex),
|
|
@@ -4280,7 +4355,7 @@ function SDraggableListInner({
|
|
|
4280
4355
|
setDropTarget({ index, intent: "before" });
|
|
4281
4356
|
}, []);
|
|
4282
4357
|
const readDepth = useCallback(
|
|
4283
|
-
(
|
|
4358
|
+
(item4, index) => clampDepth(getDepth?.(item4, index) ?? 1, maxDepth),
|
|
4284
4359
|
[getDepth, maxDepth]
|
|
4285
4360
|
);
|
|
4286
4361
|
useEffect(() => {
|
|
@@ -4315,8 +4390,8 @@ function SDraggableListInner({
|
|
|
4315
4390
|
nextDropTarget = ratio < 0.5 ? { index, intent: "before" } : { index, intent: "after" };
|
|
4316
4391
|
break;
|
|
4317
4392
|
}
|
|
4318
|
-
const
|
|
4319
|
-
const canHaveChildren = (getCanHaveChildren?.(
|
|
4393
|
+
const item4 = items[index];
|
|
4394
|
+
const canHaveChildren = (getCanHaveChildren?.(item4, index) ?? true) && readDepth(item4, index) < maxDepth;
|
|
4320
4395
|
if (ratio < 0.25) {
|
|
4321
4396
|
nextDropTarget = { index, intent: "before" };
|
|
4322
4397
|
} else if (ratio > 0.75 || !canHaveChildren) {
|
|
@@ -4416,10 +4491,10 @@ function SDraggableListInner({
|
|
|
4416
4491
|
"data-drag-active": dragActive || void 0,
|
|
4417
4492
|
"data-draggable-group": dragContext ? dragGroup : void 0,
|
|
4418
4493
|
"data-draggable-list-id": dragContext ? listId : void 0,
|
|
4419
|
-
children: items.map((
|
|
4420
|
-
const itemKey = getKey(
|
|
4421
|
-
const disabled = (getDisabled?.(
|
|
4422
|
-
const depth = depthEnabled ? readDepth(
|
|
4494
|
+
children: items.map((item4, index) => {
|
|
4495
|
+
const itemKey = getKey(item4, index);
|
|
4496
|
+
const disabled = (getDisabled?.(item4, index) ?? false) || isDescendant(items, index, draggedSubtreeStart, depthEnabled ? readDepth : void 0);
|
|
4497
|
+
const depth = depthEnabled ? readDepth(item4, index) : 1;
|
|
4423
4498
|
const showBefore = isDropTarget && currentDropIndex === index && (dragContext || currentDropIntent === "before");
|
|
4424
4499
|
const showInside = isDropTarget && currentDropIndex === index && !dragContext && depthEnabled && currentDropIntent === "inside";
|
|
4425
4500
|
const showAfter = isDropTarget && (dragContext ? currentDropIndex === items.length && index === items.length - 1 : currentDropIndex === index && currentDropIntent === "after");
|
|
@@ -4473,7 +4548,7 @@ function SDraggableListInner({
|
|
|
4473
4548
|
}
|
|
4474
4549
|
}
|
|
4475
4550
|
),
|
|
4476
|
-
renderItem(
|
|
4551
|
+
renderItem(item4, index, {
|
|
4477
4552
|
onDragHandleMouseDown: (event) => {
|
|
4478
4553
|
if (disabled) return;
|
|
4479
4554
|
if (dragContext && dragGroup && listId) {
|
|
@@ -5046,7 +5121,7 @@ function SGhostButton({
|
|
|
5046
5121
|
const contentColor = disabled ? intent === "inverse" ? "var(--cmp-ghostButton-inverse-disabled)" : "var(--cmp-ghostButton-icon-disabled)" : `var(--cmp-ghostButton-${intent}-content)`;
|
|
5047
5122
|
const text = (tooltipText ?? "").trim();
|
|
5048
5123
|
const hasTooltip = text !== "";
|
|
5049
|
-
const
|
|
5124
|
+
const btn2 = /* @__PURE__ */ jsxs(
|
|
5050
5125
|
"button",
|
|
5051
5126
|
{
|
|
5052
5127
|
type: "button",
|
|
@@ -5088,7 +5163,7 @@ function SGhostButton({
|
|
|
5088
5163
|
]
|
|
5089
5164
|
}
|
|
5090
5165
|
);
|
|
5091
|
-
if (!hasTooltip) return
|
|
5166
|
+
if (!hasTooltip) return btn2;
|
|
5092
5167
|
return /* @__PURE__ */ jsxs(RPopover11.Root, { open, onOpenChange: setOpen, children: [
|
|
5093
5168
|
/* @__PURE__ */ jsx(RPopover11.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
5094
5169
|
"span",
|
|
@@ -5099,7 +5174,7 @@ function SGhostButton({
|
|
|
5099
5174
|
onMouseLeave: startHide,
|
|
5100
5175
|
onFocus: openNow,
|
|
5101
5176
|
onBlur: startHide,
|
|
5102
|
-
children:
|
|
5177
|
+
children: btn2
|
|
5103
5178
|
}
|
|
5104
5179
|
) }),
|
|
5105
5180
|
/* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
@@ -5398,7 +5473,7 @@ var STreeImpl = /* @__PURE__ */ forwardRef(function STree({
|
|
|
5398
5473
|
}, ref) {
|
|
5399
5474
|
const [internalValue, setInternalValue] = useState(defaultValue ?? []);
|
|
5400
5475
|
const [internalExpandedIds, setInternalExpandedIds] = useState(
|
|
5401
|
-
defaultExpandedIds ?? items.filter((
|
|
5476
|
+
defaultExpandedIds ?? items.filter((item4) => item4.children?.length).map((item4) => item4.id)
|
|
5402
5477
|
);
|
|
5403
5478
|
const currentValue = value ?? internalValue;
|
|
5404
5479
|
const currentExpandedIds = expandedIds ?? internalExpandedIds;
|
|
@@ -6782,6 +6857,456 @@ function SSwitch({
|
|
|
6782
6857
|
);
|
|
6783
6858
|
}
|
|
6784
6859
|
|
|
6860
|
+
// src/lib/is-dev.ts
|
|
6861
|
+
function isDev() {
|
|
6862
|
+
return typeof process === "undefined" || process?.env?.NODE_ENV !== "production";
|
|
6863
|
+
}
|
|
6864
|
+
function SPortal({
|
|
6865
|
+
open,
|
|
6866
|
+
onClose,
|
|
6867
|
+
onOpenChange,
|
|
6868
|
+
anchorRef,
|
|
6869
|
+
placement = "bottom",
|
|
6870
|
+
align = "start",
|
|
6871
|
+
offset = 4,
|
|
6872
|
+
alignOffset = 0,
|
|
6873
|
+
fit = false,
|
|
6874
|
+
maxHeight,
|
|
6875
|
+
autoClose = false,
|
|
6876
|
+
persistent = false,
|
|
6877
|
+
viewportPadding = 0,
|
|
6878
|
+
onOpenAutoFocus,
|
|
6879
|
+
onCloseAutoFocus,
|
|
6880
|
+
onPointerDownOutside,
|
|
6881
|
+
children,
|
|
6882
|
+
className,
|
|
6883
|
+
style,
|
|
6884
|
+
ariaLabel
|
|
6885
|
+
}) {
|
|
6886
|
+
const portalContainer = usePortalContainer();
|
|
6887
|
+
const { minWidth: styleMinWidth, maxWidth: styleMaxWidth, ...restStyle } = style ?? {};
|
|
6888
|
+
return /* @__PURE__ */ jsxs(
|
|
6889
|
+
RPopover11.Root,
|
|
6890
|
+
{
|
|
6891
|
+
open,
|
|
6892
|
+
onOpenChange: (next) => {
|
|
6893
|
+
onOpenChange?.(next);
|
|
6894
|
+
if (!next) onClose?.();
|
|
6895
|
+
},
|
|
6896
|
+
children: [
|
|
6897
|
+
/* @__PURE__ */ jsx(RPopover11.Anchor, { virtualRef: anchorRef }),
|
|
6898
|
+
/* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
6899
|
+
RPopover11.Content,
|
|
6900
|
+
{
|
|
6901
|
+
side: placement,
|
|
6902
|
+
align,
|
|
6903
|
+
sideOffset: offset,
|
|
6904
|
+
alignOffset,
|
|
6905
|
+
collisionPadding: viewportPadding,
|
|
6906
|
+
"aria-label": ariaLabel,
|
|
6907
|
+
onPointerDownOutside: (e) => {
|
|
6908
|
+
if (persistent || anchorRef.current?.contains(e.target)) {
|
|
6909
|
+
e.preventDefault();
|
|
6910
|
+
return;
|
|
6911
|
+
}
|
|
6912
|
+
onPointerDownOutside?.(e);
|
|
6913
|
+
},
|
|
6914
|
+
onFocusOutside: (e) => {
|
|
6915
|
+
if (persistent || anchorRef.current?.contains(e.target)) {
|
|
6916
|
+
e.preventDefault();
|
|
6917
|
+
}
|
|
6918
|
+
},
|
|
6919
|
+
onEscapeKeyDown: persistent ? (e) => e.preventDefault() : void 0,
|
|
6920
|
+
onOpenAutoFocus,
|
|
6921
|
+
onCloseAutoFocus,
|
|
6922
|
+
onClick: autoClose ? () => onClose?.() : void 0,
|
|
6923
|
+
className: cn(
|
|
6924
|
+
"z-50 overflow-hidden rounded-(--cmp-listBox-radius) bg-(--cmp-listBox-bg) shadow-normal-sm",
|
|
6925
|
+
maxHeight != null && "overflow-y-auto",
|
|
6926
|
+
// 앵커가 창보다 넓을 수 있는 자리(가로 스크롤 안의 트리거 등)에서도 하한이 상한을
|
|
6927
|
+
// 이기지 않도록, 앵커 너비 역시 가용 폭으로 가둔다.
|
|
6928
|
+
fit && "min-w-[min(var(--radix-popover-trigger-width),var(--radix-popover-content-available-width))]",
|
|
6929
|
+
FLOATING_SLIDE_ANIM,
|
|
6930
|
+
className
|
|
6931
|
+
),
|
|
6932
|
+
style: {
|
|
6933
|
+
maxHeight,
|
|
6934
|
+
...restStyle,
|
|
6935
|
+
...styleMinWidth != null ? { minWidth: clampToAvailableWidth(styleMinWidth, POPOVER_AVAILABLE_WIDTH) } : {},
|
|
6936
|
+
maxWidth: clampToAvailableWidth(styleMaxWidth, POPOVER_AVAILABLE_WIDTH)
|
|
6937
|
+
},
|
|
6938
|
+
children
|
|
6939
|
+
}
|
|
6940
|
+
) })
|
|
6941
|
+
]
|
|
6942
|
+
}
|
|
6943
|
+
);
|
|
6944
|
+
}
|
|
6945
|
+
|
|
6946
|
+
// src/components/SAccountListBox/accountListBox.config.ts
|
|
6947
|
+
var box = (p) => `var(--cmp-gnb-system-accountListBox-${p})`;
|
|
6948
|
+
var btn = (p) => `var(--cmp-gnb-system-accountButton-${p})`;
|
|
6949
|
+
var item = (p) => `var(--cmp-listBoxItem-${p})`;
|
|
6950
|
+
var sys = (p) => `var(--sys-color-${p})`;
|
|
6951
|
+
var ACCOUNT_LIST_BOX_ITEM_TONES = ["default", "negative"];
|
|
6952
|
+
var ACCOUNT_LIST_BOX_ICONS = {
|
|
6953
|
+
accountSetting: "account",
|
|
6954
|
+
language: "global",
|
|
6955
|
+
logout: "logout"
|
|
6956
|
+
};
|
|
6957
|
+
var ACCOUNT_LIST_BOX_LABELS = {
|
|
6958
|
+
accountSetting: "\uACC4\uC815 \uC124\uC815",
|
|
6959
|
+
language: "\uC5B8\uC5B4 \uBCC0\uACBD",
|
|
6960
|
+
logout: "\uACC4\uC815 \uB85C\uADF8\uC544\uC6C3"
|
|
6961
|
+
};
|
|
6962
|
+
var ACCOUNT_LIST_BOX_TONE_CONFIG = {
|
|
6963
|
+
default: {
|
|
6964
|
+
bg: btn("bg-default"),
|
|
6965
|
+
bgHover: btn("bg-hover"),
|
|
6966
|
+
text: btn("content-default"),
|
|
6967
|
+
// TODO: 행 아이콘 전용 색 토큰이 없다. content.default 는 글자색(#222222)이고
|
|
6968
|
+
// 시안의 아이콘은 한 단계 물러난 #555555 라, 그에 맞는 시맨틱 토큰으로 둔다.
|
|
6969
|
+
icon: sys("fg-secondary")
|
|
6970
|
+
},
|
|
6971
|
+
negative: {
|
|
6972
|
+
bg: btn("bg-default"),
|
|
6973
|
+
bgHover: btn("bg-negativeHover"),
|
|
6974
|
+
// 되돌릴 수 없는 행은 글자와 아이콘이 같은 경고색으로 함께 물든다(시안).
|
|
6975
|
+
text: btn("content-negative"),
|
|
6976
|
+
icon: btn("content-negative")
|
|
6977
|
+
}
|
|
6978
|
+
};
|
|
6979
|
+
var ACCOUNT_LIST_BOX_LAYOUT = {
|
|
6980
|
+
/** 패널 고정 폭 */
|
|
6981
|
+
width: box("width"),
|
|
6982
|
+
/** 패널 배경 */
|
|
6983
|
+
bg: box("bg"),
|
|
6984
|
+
/** 패널 라운드 */
|
|
6985
|
+
radius: box("radius"),
|
|
6986
|
+
/** 사용자정보 영역 배경 */
|
|
6987
|
+
userdataBg: box("userdata-bg"),
|
|
6988
|
+
/** 사용자정보 영역 좌우 여백 */
|
|
6989
|
+
userdataPaddingX: box("userdata-paddingX"),
|
|
6990
|
+
/** 사용자정보 영역 상하 여백 */
|
|
6991
|
+
userdataPaddingY: box("userdata-paddingY"),
|
|
6992
|
+
/** 이메일 글자색 */
|
|
6993
|
+
emailColor: box("userdata-email-color"),
|
|
6994
|
+
/** 이름 글자색 */
|
|
6995
|
+
nameColor: box("userdata-name-color"),
|
|
6996
|
+
/** 권한 글자색 */
|
|
6997
|
+
roleColor: box("userdata-role-color"),
|
|
6998
|
+
/** 행 묶음의 상하 여백 */
|
|
6999
|
+
listPaddingY: box("list-paddingY"),
|
|
7000
|
+
/** 행 좌우 여백 */
|
|
7001
|
+
itemPaddingX: btn("paddingX"),
|
|
7002
|
+
/** 행 상하 여백 */
|
|
7003
|
+
itemPaddingY: btn("paddingY"),
|
|
7004
|
+
/** 행 아이콘 ↔ 라벨 간격 */
|
|
7005
|
+
itemGap: btn("gap"),
|
|
7006
|
+
/** 행 아이콘 크기 */
|
|
7007
|
+
itemIcon: btn("icon"),
|
|
7008
|
+
/** 우측 값 ↔ 화살표 간격 */
|
|
7009
|
+
selectDataGap: btn("selectData-gap"),
|
|
7010
|
+
/** 우측 화살표 크기 */
|
|
7011
|
+
selectDataIcon: btn("selectData-icon"),
|
|
7012
|
+
/** 우측 값 글자색 */
|
|
7013
|
+
selectDataText: btn("selectData-text"),
|
|
7014
|
+
/** 시스템 메뉴에서 지금 값인 칸의 글자색 — 계정 행이 아니라 목록 항목이라
|
|
7015
|
+
* listBoxItem 의 선택 색을 그대로 따른다(다른 목록의 선택 표시와 같은 색) */
|
|
7016
|
+
menuSelectedText: item("content-selected"),
|
|
7017
|
+
// TODO: 우측 화살표 전용 색 토큰이 없다. 시안(#888888)에 맞는 시맨틱 토큰으로 둔다.
|
|
7018
|
+
/** 우측 화살표색 */
|
|
7019
|
+
selectDataIconColor: sys("fg-tertiary")
|
|
7020
|
+
};
|
|
7021
|
+
function SystemMenuPortal({
|
|
7022
|
+
open,
|
|
7023
|
+
onOpenChange,
|
|
7024
|
+
anchorRef,
|
|
7025
|
+
placement = "bottom",
|
|
7026
|
+
align,
|
|
7027
|
+
triggerRef,
|
|
7028
|
+
ariaLabel,
|
|
7029
|
+
value,
|
|
7030
|
+
options,
|
|
7031
|
+
onSelect
|
|
7032
|
+
}) {
|
|
7033
|
+
const t = ACCOUNT_LIST_BOX_TONE_CONFIG.default;
|
|
7034
|
+
return /* @__PURE__ */ jsx(
|
|
7035
|
+
SPortal,
|
|
7036
|
+
{
|
|
7037
|
+
open,
|
|
7038
|
+
onClose: () => onOpenChange(false),
|
|
7039
|
+
anchorRef,
|
|
7040
|
+
placement,
|
|
7041
|
+
align,
|
|
7042
|
+
offset: 4,
|
|
7043
|
+
viewportPadding: 8,
|
|
7044
|
+
ariaLabel,
|
|
7045
|
+
onPointerDownOutside: (event) => {
|
|
7046
|
+
if (triggerRef?.current?.contains(event.target)) event.preventDefault();
|
|
7047
|
+
},
|
|
7048
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
7049
|
+
className: "w-auto min-w-[100px] rounded-(--cmp-gnb-system-accountListBox-radius) bg-(--cmp-gnb-system-accountListBox-bg)",
|
|
7050
|
+
children: /* @__PURE__ */ jsx("div", { role: "menu", className: "flex flex-col", style: { paddingBlock: ACCOUNT_LIST_BOX_LAYOUT.listPaddingY }, children: options.map((option) => {
|
|
7051
|
+
const selected = option.value === value;
|
|
7052
|
+
const color = option.color ? `var(--cmp-tag-${option.color}-content)` : selected ? ACCOUNT_LIST_BOX_LAYOUT.menuSelectedText : t.text;
|
|
7053
|
+
return /* @__PURE__ */ jsxs(
|
|
7054
|
+
"button",
|
|
7055
|
+
{
|
|
7056
|
+
type: "button",
|
|
7057
|
+
role: "menuitemradio",
|
|
7058
|
+
"aria-checked": selected,
|
|
7059
|
+
onClick: () => onSelect(option.value),
|
|
7060
|
+
className: cn(
|
|
7061
|
+
selected ? "typo-field-sm-bold" : "typo-field-sm-medium",
|
|
7062
|
+
"flex w-full cursor-pointer items-center whitespace-nowrap border-none bg-(--alb-bg) text-left transition-colors hover:bg-(--alb-bg-hover)"
|
|
7063
|
+
),
|
|
7064
|
+
style: {
|
|
7065
|
+
"--alb-bg": t.bg,
|
|
7066
|
+
"--alb-bg-hover": t.bgHover,
|
|
7067
|
+
"paddingInline": ACCOUNT_LIST_BOX_LAYOUT.itemPaddingX,
|
|
7068
|
+
"paddingBlock": ACCOUNT_LIST_BOX_LAYOUT.itemPaddingY,
|
|
7069
|
+
"gap": ACCOUNT_LIST_BOX_LAYOUT.itemGap,
|
|
7070
|
+
color
|
|
7071
|
+
},
|
|
7072
|
+
children: [
|
|
7073
|
+
option.color && /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center", children: /* @__PURE__ */ jsx(SIcon, { name: "dot", size: "100%", style: { width: ACCOUNT_LIST_BOX_LAYOUT.itemIcon, height: ACCOUNT_LIST_BOX_LAYOUT.itemIcon } }) }),
|
|
7074
|
+
option.label
|
|
7075
|
+
]
|
|
7076
|
+
},
|
|
7077
|
+
option.value
|
|
7078
|
+
);
|
|
7079
|
+
}) })
|
|
7080
|
+
}
|
|
7081
|
+
);
|
|
7082
|
+
}
|
|
7083
|
+
function TokenIcon({ name, size }) {
|
|
7084
|
+
return /* @__PURE__ */ jsx(SIcon, { name, size: "100%", style: { width: size, height: size } });
|
|
7085
|
+
}
|
|
7086
|
+
function Row({
|
|
7087
|
+
tone = "default",
|
|
7088
|
+
icon,
|
|
7089
|
+
label,
|
|
7090
|
+
value,
|
|
7091
|
+
trailingRef,
|
|
7092
|
+
rowRef,
|
|
7093
|
+
hasMenu,
|
|
7094
|
+
expanded,
|
|
7095
|
+
onClick
|
|
7096
|
+
}) {
|
|
7097
|
+
const t = ACCOUNT_LIST_BOX_TONE_CONFIG[tone];
|
|
7098
|
+
return /* @__PURE__ */ jsxs(
|
|
7099
|
+
"button",
|
|
7100
|
+
{
|
|
7101
|
+
ref: rowRef,
|
|
7102
|
+
type: "button",
|
|
7103
|
+
"aria-haspopup": hasMenu && "menu",
|
|
7104
|
+
"aria-expanded": hasMenu && expanded,
|
|
7105
|
+
onClick,
|
|
7106
|
+
className: "flex w-full cursor-pointer items-center border-none bg-(--alb-bg) text-left transition-colors hover:bg-(--alb-bg-hover)",
|
|
7107
|
+
style: {
|
|
7108
|
+
"--alb-bg": t.bg,
|
|
7109
|
+
"--alb-bg-hover": t.bgHover,
|
|
7110
|
+
"paddingInline": ACCOUNT_LIST_BOX_LAYOUT.itemPaddingX,
|
|
7111
|
+
"paddingBlock": ACCOUNT_LIST_BOX_LAYOUT.itemPaddingY,
|
|
7112
|
+
"gap": ACCOUNT_LIST_BOX_LAYOUT.itemGap
|
|
7113
|
+
},
|
|
7114
|
+
children: [
|
|
7115
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center", style: { color: t.icon }, children: /* @__PURE__ */ jsx(TokenIcon, { name: icon, size: ACCOUNT_LIST_BOX_LAYOUT.itemIcon }) }),
|
|
7116
|
+
/* @__PURE__ */ jsx("span", { className: "typo-field-sm-medium min-w-0 flex-1 truncate", style: { color: t.text }, children: label }),
|
|
7117
|
+
(value != null || hasMenu) && /* @__PURE__ */ jsxs(
|
|
7118
|
+
"span",
|
|
7119
|
+
{
|
|
7120
|
+
ref: trailingRef,
|
|
7121
|
+
className: "inline-flex shrink-0 items-center",
|
|
7122
|
+
style: { gap: ACCOUNT_LIST_BOX_LAYOUT.selectDataGap },
|
|
7123
|
+
children: [
|
|
7124
|
+
value != null && /* @__PURE__ */ jsx(
|
|
7125
|
+
"span",
|
|
7126
|
+
{
|
|
7127
|
+
className: "typo-control-xs-medium whitespace-nowrap",
|
|
7128
|
+
style: { color: ACCOUNT_LIST_BOX_LAYOUT.selectDataText },
|
|
7129
|
+
children: value
|
|
7130
|
+
}
|
|
7131
|
+
),
|
|
7132
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0", style: { color: ACCOUNT_LIST_BOX_LAYOUT.selectDataIconColor }, children: /* @__PURE__ */ jsx(TokenIcon, { name: "chevronRight", size: ACCOUNT_LIST_BOX_LAYOUT.selectDataIcon }) })
|
|
7133
|
+
]
|
|
7134
|
+
}
|
|
7135
|
+
)
|
|
7136
|
+
]
|
|
7137
|
+
}
|
|
7138
|
+
);
|
|
7139
|
+
}
|
|
7140
|
+
var SAccountListBox = /* @__PURE__ */ forwardRef(
|
|
7141
|
+
function SAccountListBox2({ email, name, authority, accountSetting, language, logout, className, style, ...rest }, ref) {
|
|
7142
|
+
const hasUserdata = email != null || name != null || authority != null;
|
|
7143
|
+
const languageOptions = language?.options ?? [];
|
|
7144
|
+
const hasLanguageMenu = languageOptions.length > 0;
|
|
7145
|
+
const [languageMenuOpen, setLanguageMenuOpen] = useState(false);
|
|
7146
|
+
const languageValueRef = useRef(null);
|
|
7147
|
+
const languageRowRef = useRef(null);
|
|
7148
|
+
const languageLabel = language?.label ?? ACCOUNT_LIST_BOX_LABELS.language;
|
|
7149
|
+
const languageDoesNothing = Boolean(language) && !hasLanguageMenu && !language?.onClick;
|
|
7150
|
+
useEffect(() => {
|
|
7151
|
+
if (isDev() && languageDoesNothing) {
|
|
7152
|
+
console.warn(
|
|
7153
|
+
"[SAccountListBox] language \uC5D0 options \uB3C4 onClick \uB3C4 \uC5C6\uC2B5\uB2C8\uB2E4. \uC571 \uC548\uC5D0\uC11C \uACE0\uB974\uAC8C \uD558\uB824\uBA74 options \uB97C, \uC5B8\uC5B4 \uD654\uBA74\uC73C\uB85C \uBCF4\uB0BC \uAC83\uC774\uBA74 onClick \uC744 \uC8FC\uC138\uC694 \u2014 \uB458 \uB2E4 \uC5C6\uC73C\uBA74 \uD654\uC0B4\uD45C\uB9CC \uC788\uACE0 \uB20C\uB7EC\uB3C4 \uC544\uBB34 \uC77C\uC774 \uC5C6\uB294 \uD589\uC774 \uB429\uB2C8\uB2E4."
|
|
7154
|
+
);
|
|
7155
|
+
}
|
|
7156
|
+
}, [languageDoesNothing]);
|
|
7157
|
+
const languageText = languageOptions.find((option) => option.value === language?.value)?.label ?? language?.value;
|
|
7158
|
+
return /* @__PURE__ */ jsxs(
|
|
7159
|
+
"div",
|
|
7160
|
+
{
|
|
7161
|
+
ref,
|
|
7162
|
+
className: cn("box-border flex flex-col overflow-hidden", className),
|
|
7163
|
+
style: {
|
|
7164
|
+
width: ACCOUNT_LIST_BOX_LAYOUT.width,
|
|
7165
|
+
backgroundColor: ACCOUNT_LIST_BOX_LAYOUT.bg,
|
|
7166
|
+
borderRadius: ACCOUNT_LIST_BOX_LAYOUT.radius,
|
|
7167
|
+
...style
|
|
7168
|
+
},
|
|
7169
|
+
...rest,
|
|
7170
|
+
children: [
|
|
7171
|
+
hasUserdata && /* @__PURE__ */ jsxs(
|
|
7172
|
+
"div",
|
|
7173
|
+
{
|
|
7174
|
+
className: "flex flex-col",
|
|
7175
|
+
style: {
|
|
7176
|
+
backgroundColor: ACCOUNT_LIST_BOX_LAYOUT.userdataBg,
|
|
7177
|
+
paddingInline: ACCOUNT_LIST_BOX_LAYOUT.userdataPaddingX,
|
|
7178
|
+
paddingBlock: ACCOUNT_LIST_BOX_LAYOUT.userdataPaddingY
|
|
7179
|
+
},
|
|
7180
|
+
children: [
|
|
7181
|
+
email != null && /* @__PURE__ */ jsx("span", { className: "typo-body-sm-medium truncate", style: { color: ACCOUNT_LIST_BOX_LAYOUT.emailColor }, children: email }),
|
|
7182
|
+
(name != null || authority != null) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", style: { gap: ACCOUNT_LIST_BOX_LAYOUT.itemGap }, children: [
|
|
7183
|
+
/* @__PURE__ */ jsx("span", { className: "typo-body-sm-bold min-w-0 truncate", style: { color: ACCOUNT_LIST_BOX_LAYOUT.nameColor }, children: name }),
|
|
7184
|
+
authority != null && /* @__PURE__ */ jsx(
|
|
7185
|
+
"span",
|
|
7186
|
+
{
|
|
7187
|
+
className: "typo-body-sm-medium shrink-0 whitespace-nowrap",
|
|
7188
|
+
style: { color: ACCOUNT_LIST_BOX_LAYOUT.roleColor },
|
|
7189
|
+
children: authority
|
|
7190
|
+
}
|
|
7191
|
+
)
|
|
7192
|
+
] })
|
|
7193
|
+
]
|
|
7194
|
+
}
|
|
7195
|
+
),
|
|
7196
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", style: { paddingBlock: ACCOUNT_LIST_BOX_LAYOUT.listPaddingY }, children: [
|
|
7197
|
+
accountSetting && /* @__PURE__ */ jsx(
|
|
7198
|
+
Row,
|
|
7199
|
+
{
|
|
7200
|
+
icon: ACCOUNT_LIST_BOX_ICONS.accountSetting,
|
|
7201
|
+
label: accountSetting.label ?? ACCOUNT_LIST_BOX_LABELS.accountSetting,
|
|
7202
|
+
onClick: accountSetting.onClick
|
|
7203
|
+
}
|
|
7204
|
+
),
|
|
7205
|
+
language && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7206
|
+
/* @__PURE__ */ jsx(
|
|
7207
|
+
Row,
|
|
7208
|
+
{
|
|
7209
|
+
icon: ACCOUNT_LIST_BOX_ICONS.language,
|
|
7210
|
+
label: languageLabel,
|
|
7211
|
+
value: languageText,
|
|
7212
|
+
trailingRef: languageValueRef,
|
|
7213
|
+
rowRef: languageRowRef,
|
|
7214
|
+
hasMenu: hasLanguageMenu,
|
|
7215
|
+
expanded: languageMenuOpen,
|
|
7216
|
+
onClick: () => {
|
|
7217
|
+
language.onClick?.();
|
|
7218
|
+
if (hasLanguageMenu) setLanguageMenuOpen((open) => !open);
|
|
7219
|
+
}
|
|
7220
|
+
}
|
|
7221
|
+
),
|
|
7222
|
+
hasLanguageMenu && /* @__PURE__ */ jsx(
|
|
7223
|
+
SystemMenuPortal,
|
|
7224
|
+
{
|
|
7225
|
+
open: languageMenuOpen,
|
|
7226
|
+
onOpenChange: setLanguageMenuOpen,
|
|
7227
|
+
anchorRef: languageValueRef,
|
|
7228
|
+
triggerRef: languageRowRef,
|
|
7229
|
+
align: "end",
|
|
7230
|
+
ariaLabel: languageLabel,
|
|
7231
|
+
value: language.value,
|
|
7232
|
+
options: languageOptions,
|
|
7233
|
+
onSelect: (next) => {
|
|
7234
|
+
setLanguageMenuOpen(false);
|
|
7235
|
+
language.onChange?.(next);
|
|
7236
|
+
}
|
|
7237
|
+
}
|
|
7238
|
+
)
|
|
7239
|
+
] }),
|
|
7240
|
+
/* @__PURE__ */ jsx(
|
|
7241
|
+
Row,
|
|
7242
|
+
{
|
|
7243
|
+
tone: "negative",
|
|
7244
|
+
icon: ACCOUNT_LIST_BOX_ICONS.logout,
|
|
7245
|
+
label: logout?.label ?? ACCOUNT_LIST_BOX_LABELS.logout,
|
|
7246
|
+
onClick: logout?.onClick
|
|
7247
|
+
}
|
|
7248
|
+
)
|
|
7249
|
+
] })
|
|
7250
|
+
]
|
|
7251
|
+
}
|
|
7252
|
+
);
|
|
7253
|
+
}
|
|
7254
|
+
);
|
|
7255
|
+
var AccountListBoxAnchorContext = /* @__PURE__ */ createContext("panel");
|
|
7256
|
+
var AccountListBoxAnchorProvider = AccountListBoxAnchorContext.Provider;
|
|
7257
|
+
var ANCHOR_PLACEMENT = {
|
|
7258
|
+
// 판: 계정 행 위로, 행의 왼쪽 끝에 맞춰
|
|
7259
|
+
panel: { placement: "top", align: "start" },
|
|
7260
|
+
// 상단바: 계정 이름 아래로, 이름의 오른쪽 끝에 맞춰
|
|
7261
|
+
top: { placement: "bottom", align: "end" }
|
|
7262
|
+
};
|
|
7263
|
+
function AccountListBoxPortal({
|
|
7264
|
+
open,
|
|
7265
|
+
onOpenChange,
|
|
7266
|
+
anchorRef,
|
|
7267
|
+
ariaLabel,
|
|
7268
|
+
content
|
|
7269
|
+
}) {
|
|
7270
|
+
const { placement, align } = ANCHOR_PLACEMENT[useContext(AccountListBoxAnchorContext)];
|
|
7271
|
+
const closeAfter = (item4) => item4 && {
|
|
7272
|
+
...item4,
|
|
7273
|
+
onClick: () => {
|
|
7274
|
+
item4.onClick?.();
|
|
7275
|
+
onOpenChange(false);
|
|
7276
|
+
}
|
|
7277
|
+
};
|
|
7278
|
+
return /* @__PURE__ */ jsx(
|
|
7279
|
+
SPortal,
|
|
7280
|
+
{
|
|
7281
|
+
open,
|
|
7282
|
+
onClose: () => onOpenChange(false),
|
|
7283
|
+
anchorRef,
|
|
7284
|
+
placement,
|
|
7285
|
+
align,
|
|
7286
|
+
offset: 4,
|
|
7287
|
+
viewportPadding: 8,
|
|
7288
|
+
ariaLabel,
|
|
7289
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
7290
|
+
className: "w-auto rounded-(--cmp-gnb-system-accountListBox-radius) bg-(--cmp-gnb-system-accountListBox-bg)",
|
|
7291
|
+
children: /* @__PURE__ */ jsx(
|
|
7292
|
+
SAccountListBox,
|
|
7293
|
+
{
|
|
7294
|
+
...content,
|
|
7295
|
+
accountSetting: closeAfter(content.accountSetting),
|
|
7296
|
+
language: content.language && (content.language.options?.length ? {
|
|
7297
|
+
...content.language,
|
|
7298
|
+
onChange: (next) => {
|
|
7299
|
+
content.language?.onChange?.(next);
|
|
7300
|
+
onOpenChange(false);
|
|
7301
|
+
}
|
|
7302
|
+
} : closeAfter(content.language)),
|
|
7303
|
+
logout: closeAfter(content.logout) ?? { onClick: () => onOpenChange(false) }
|
|
7304
|
+
}
|
|
7305
|
+
)
|
|
7306
|
+
}
|
|
7307
|
+
);
|
|
7308
|
+
}
|
|
7309
|
+
|
|
6785
7310
|
// src/components/SSystemActionButton/systemActionButton.config.ts
|
|
6786
7311
|
var SYSTEM_ACTION_BUTTON_COLORS = ["light", "dark", "darker"];
|
|
6787
7312
|
var SYSTEM_ACTION_BUTTON_TYPES = [
|
|
@@ -6791,57 +7316,57 @@ var SYSTEM_ACTION_BUTTON_TYPES = [
|
|
|
6791
7316
|
"subSelect",
|
|
6792
7317
|
"status"
|
|
6793
7318
|
];
|
|
6794
|
-
var
|
|
7319
|
+
var item2 = (p) => `var(--cmp-gnb-system-item-${p})`;
|
|
6795
7320
|
var action = (p) => `var(--cmp-gnb-system-actionButton-${p})`;
|
|
6796
|
-
var
|
|
7321
|
+
var sys2 = (p) => `var(--sys-color-${p})`;
|
|
6797
7322
|
var SYSTEM_ACTION_BUTTON_COLOR_CONFIG = {
|
|
6798
7323
|
light: {
|
|
6799
|
-
bg:
|
|
6800
|
-
bgHover:
|
|
7324
|
+
bg: item2("light-bg-default"),
|
|
7325
|
+
bgHover: item2("light-bg-hover"),
|
|
6801
7326
|
// light 의 아이콘 프레임 배경은 기본·hover 공통 한 값이다 (흰 면 위 흰 프레임)
|
|
6802
|
-
iconBg:
|
|
6803
|
-
iconBgHover:
|
|
6804
|
-
iconGlyph:
|
|
6805
|
-
iconGlyphHover:
|
|
6806
|
-
text:
|
|
7327
|
+
iconBg: item2("light-icon-bg"),
|
|
7328
|
+
iconBgHover: item2("light-icon-bg"),
|
|
7329
|
+
iconGlyph: item2("light-icon-default"),
|
|
7330
|
+
iconGlyphHover: item2("light-icon-default"),
|
|
7331
|
+
text: item2("light-text"),
|
|
6807
7332
|
actionText: {
|
|
6808
7333
|
switch: action("switch-text-light"),
|
|
6809
7334
|
selectData: action("selectData-text-light")
|
|
6810
7335
|
},
|
|
6811
7336
|
// 트레일링 아이콘 전용 색 토큰이 없다. light 는 item.icon.default 가
|
|
6812
7337
|
// "actionButton/alertButton/setting 공통 글리프색"이라고 토큰에 명시돼 있다.
|
|
6813
|
-
actionIcon:
|
|
7338
|
+
actionIcon: item2("light-icon-default")
|
|
6814
7339
|
},
|
|
6815
7340
|
dark: {
|
|
6816
|
-
bg:
|
|
6817
|
-
bgHover:
|
|
6818
|
-
iconBg:
|
|
6819
|
-
iconBgHover:
|
|
7341
|
+
bg: item2("dark-bg-default"),
|
|
7342
|
+
bgHover: item2("dark-bg-hover"),
|
|
7343
|
+
iconBg: item2("dark-icon-bg-default"),
|
|
7344
|
+
iconBgHover: item2("dark-icon-bg-hover"),
|
|
6820
7345
|
// 어두운 면에는 글리프색 토큰이 없다. 기본은 프레임이 배경과 블렌딩되므로 라벨색(흰색),
|
|
6821
7346
|
// hover 는 프레임이 흰색이 되므로 그 위에 표면색을 그대로 얹는다.
|
|
6822
|
-
iconGlyph:
|
|
6823
|
-
iconGlyphHover:
|
|
6824
|
-
text:
|
|
7347
|
+
iconGlyph: item2("dark-text"),
|
|
7348
|
+
iconGlyphHover: item2("dark-bg-hover"),
|
|
7349
|
+
text: item2("dark-text"),
|
|
6825
7350
|
actionText: {
|
|
6826
7351
|
switch: action("switch-text-dark"),
|
|
6827
7352
|
selectData: action("selectData-text-dark")
|
|
6828
7353
|
},
|
|
6829
7354
|
// TODO: 어두운 면의 트레일링 아이콘 색 토큰이 없다. 시안(#AAAAAA)에 맞는 시맨틱 토큰으로 둔다.
|
|
6830
|
-
actionIcon:
|
|
7355
|
+
actionIcon: sys2("fg-quaternary")
|
|
6831
7356
|
},
|
|
6832
7357
|
darker: {
|
|
6833
|
-
bg:
|
|
6834
|
-
bgHover:
|
|
6835
|
-
iconBg:
|
|
6836
|
-
iconBgHover:
|
|
6837
|
-
iconGlyph:
|
|
6838
|
-
iconGlyphHover:
|
|
6839
|
-
text:
|
|
7358
|
+
bg: item2("darker-bg-default"),
|
|
7359
|
+
bgHover: item2("darker-bg-hover"),
|
|
7360
|
+
iconBg: item2("darker-icon-bg-default"),
|
|
7361
|
+
iconBgHover: item2("darker-icon-bg-hover"),
|
|
7362
|
+
iconGlyph: item2("darker-text"),
|
|
7363
|
+
iconGlyphHover: item2("darker-bg-hover"),
|
|
7364
|
+
text: item2("darker-text"),
|
|
6840
7365
|
actionText: {
|
|
6841
7366
|
switch: action("switch-text-dark"),
|
|
6842
7367
|
selectData: action("selectData-text-dark")
|
|
6843
7368
|
},
|
|
6844
|
-
actionIcon:
|
|
7369
|
+
actionIcon: sys2("fg-quaternary")
|
|
6845
7370
|
}
|
|
6846
7371
|
};
|
|
6847
7372
|
var SYSTEM_ACTION_BUTTON_TYPE_CONFIG = {
|
|
@@ -6864,17 +7389,17 @@ var SYSTEM_ACTION_BUTTON_TYPE_CONFIG = {
|
|
|
6864
7389
|
};
|
|
6865
7390
|
var SYSTEM_ACTION_BUTTON_LAYOUT = {
|
|
6866
7391
|
/** 행 높이 */
|
|
6867
|
-
height:
|
|
7392
|
+
height: item2("height"),
|
|
6868
7393
|
/** 행 라운드 */
|
|
6869
|
-
radius:
|
|
7394
|
+
radius: item2("radius"),
|
|
6870
7395
|
/** 아이콘 프레임 한 변 */
|
|
6871
|
-
iconFrame:
|
|
7396
|
+
iconFrame: item2("icon-frame"),
|
|
6872
7397
|
/** 아이콘 글리프 크기 */
|
|
6873
|
-
iconGlyph:
|
|
7398
|
+
iconGlyph: item2("icon-glyph"),
|
|
6874
7399
|
/** 아이콘 프레임 라운드 */
|
|
6875
|
-
iconRadius:
|
|
7400
|
+
iconRadius: item2("icon-radius"),
|
|
6876
7401
|
/** 아이콘 프레임 ↔ 라벨 간격 */
|
|
6877
|
-
iconLabelGap:
|
|
7402
|
+
iconLabelGap: item2("iconLabelGap"),
|
|
6878
7403
|
/** 좌측 여백 */
|
|
6879
7404
|
paddingLeft: action("paddingLeft"),
|
|
6880
7405
|
/** 우측 여백 */
|
|
@@ -6882,17 +7407,44 @@ var SYSTEM_ACTION_BUTTON_LAYOUT = {
|
|
|
6882
7407
|
/** 액션 텍스트 ↔ 액션 아이콘 간격 */
|
|
6883
7408
|
actionGap: action("selectData-gap")
|
|
6884
7409
|
};
|
|
6885
|
-
function
|
|
7410
|
+
function TokenIcon2({ name, size }) {
|
|
6886
7411
|
return /* @__PURE__ */ jsx(SIcon, { name, size: "100%", style: { width: size, height: size } });
|
|
6887
7412
|
}
|
|
6888
7413
|
var SSystemActionButton = /* @__PURE__ */ forwardRef(
|
|
6889
7414
|
function SSystemActionButton2({ color = "light", type, label, option, disabled = false, className, style, ...rest }, ref) {
|
|
6890
7415
|
const c = SYSTEM_ACTION_BUTTON_COLOR_CONFIG[color];
|
|
6891
7416
|
const spec = SYSTEM_ACTION_BUTTON_TYPE_CONFIG[type];
|
|
7417
|
+
const listBox = type === "account" ? option ?? {} : void 0;
|
|
7418
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
|
|
7419
|
+
const listBoxOpen = listBox?.open ?? uncontrolledOpen;
|
|
7420
|
+
const commitListBoxOpen = (next) => {
|
|
7421
|
+
setUncontrolledOpen(next);
|
|
7422
|
+
listBox?.onOpenChange?.(next);
|
|
7423
|
+
};
|
|
7424
|
+
const anchorRef = useRef(null);
|
|
7425
|
+
const setRefs2 = (node) => {
|
|
7426
|
+
anchorRef.current = node;
|
|
7427
|
+
if (typeof ref === "function") ref(node);
|
|
7428
|
+
else if (ref) ref.current = node;
|
|
7429
|
+
};
|
|
6892
7430
|
const hoverable = !disabled;
|
|
6893
7431
|
const status = type === "status" ? option : void 0;
|
|
7432
|
+
const subSelect = type === "subSelect" ? option : void 0;
|
|
7433
|
+
const menu = subSelect ?? status;
|
|
7434
|
+
const menuOptions = menu?.options ?? [];
|
|
7435
|
+
const hasMenu = menuOptions.length > 0;
|
|
7436
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
7437
|
+
const selected = menuOptions.find((item4) => item4.value === menu?.value);
|
|
6894
7438
|
const resolvedIcon = spec.fixedIcon ?? option?.icon;
|
|
6895
|
-
const actionText = spec.actionText ? option?.text : void 0;
|
|
7439
|
+
const actionText = spec.actionText ? subSelect ? selected?.label ?? subSelect.value : option?.text : void 0;
|
|
7440
|
+
const menuIsEmpty = Boolean(menu) && !hasMenu;
|
|
7441
|
+
useEffect(() => {
|
|
7442
|
+
if (isDev() && menuIsEmpty) {
|
|
7443
|
+
console.warn(
|
|
7444
|
+
`[SSystemActionButton] type="${type}" \uC758 option.options \uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4. \uC774 \uD589\uC740 \uACE0\uB978 \uAC12\uC744 \uBC14\uAFB8\uB294 \uBA54\uB274\uC758 \uD2B8\uB9AC\uAC70\uC774\uBBC0\uB85C \uACE0\uB97C \uBAA9\uB85D\uC774 \uD544\uC694\uD569\uB2C8\uB2E4 \u2014 \uB20C\uB7EC\uC11C \uD654\uBA74\uC73C\uB85C \uBCF4\uB0BC \uAC83\uC774\uBA74 type="select" \uB97C, \uBCF4\uC5EC\uC8FC\uAE30\uB9CC \uD560 \uAC83\uC774\uBA74 STag \uB97C \uC4F0\uC138\uC694.`
|
|
7445
|
+
);
|
|
7446
|
+
}
|
|
7447
|
+
}, [menuIsEmpty, type]);
|
|
6896
7448
|
const cssVars = {
|
|
6897
7449
|
"--sab-bg": c.bg,
|
|
6898
7450
|
"--sab-bg-hover": hoverable ? c.bgHover : c.bg,
|
|
@@ -6910,12 +7462,14 @@ var SSystemActionButton = /* @__PURE__ */ forwardRef(
|
|
|
6910
7462
|
"gap": SYSTEM_ACTION_BUTTON_LAYOUT.iconLabelGap,
|
|
6911
7463
|
...style
|
|
6912
7464
|
};
|
|
6913
|
-
|
|
7465
|
+
const button = /* @__PURE__ */ jsxs(
|
|
6914
7466
|
"button",
|
|
6915
7467
|
{
|
|
6916
|
-
ref,
|
|
7468
|
+
ref: setRefs2,
|
|
6917
7469
|
type: "button",
|
|
6918
7470
|
disabled,
|
|
7471
|
+
"aria-haspopup": listBox ? "dialog" : hasMenu ? "menu" : void 0,
|
|
7472
|
+
"aria-expanded": listBox ? listBoxOpen : hasMenu ? menuOpen : void 0,
|
|
6919
7473
|
className: cn(
|
|
6920
7474
|
"group box-border flex w-full items-center border-none bg-(--sab-bg) text-left transition-colors",
|
|
6921
7475
|
"hover:bg-(--sab-bg-hover)",
|
|
@@ -6924,16 +7478,28 @@ var SSystemActionButton = /* @__PURE__ */ forwardRef(
|
|
|
6924
7478
|
),
|
|
6925
7479
|
style: cssVars,
|
|
6926
7480
|
...rest,
|
|
7481
|
+
onClick: (event) => {
|
|
7482
|
+
rest.onClick?.(event);
|
|
7483
|
+
if (listBox) commitListBoxOpen(!listBoxOpen);
|
|
7484
|
+
else if (hasMenu) setMenuOpen((open) => !open);
|
|
7485
|
+
},
|
|
6927
7486
|
children: [
|
|
6928
7487
|
resolvedIcon && /* @__PURE__ */ jsx(
|
|
6929
7488
|
"span",
|
|
6930
7489
|
{
|
|
6931
7490
|
className: "inline-flex shrink-0 items-center justify-center bg-(--sab-icon-bg) text-(--sab-icon-glyph) transition-colors group-hover:bg-(--sab-icon-bg-hover) group-hover:text-(--sab-icon-glyph-hover)",
|
|
6932
7491
|
style: { width: SYSTEM_ACTION_BUTTON_LAYOUT.iconFrame, height: SYSTEM_ACTION_BUTTON_LAYOUT.iconFrame, borderRadius: SYSTEM_ACTION_BUTTON_LAYOUT.iconRadius },
|
|
6933
|
-
children: /* @__PURE__ */ jsx(
|
|
7492
|
+
children: /* @__PURE__ */ jsx(TokenIcon2, { name: resolvedIcon, size: SYSTEM_ACTION_BUTTON_LAYOUT.iconGlyph })
|
|
6934
7493
|
}
|
|
6935
7494
|
),
|
|
6936
|
-
/* @__PURE__ */ jsx("span", { className: "typo-body-sm-semibold flex min-w-0 flex-1 items-center text-(--sab-text)", children: status ? /* @__PURE__ */ jsx(
|
|
7495
|
+
/* @__PURE__ */ jsx("span", { className: "typo-body-sm-semibold flex min-w-0 flex-1 items-center text-(--sab-text)", children: status ? /* @__PURE__ */ jsx(
|
|
7496
|
+
STag,
|
|
7497
|
+
{
|
|
7498
|
+
color: selected?.color ?? "blue",
|
|
7499
|
+
icon: "dot",
|
|
7500
|
+
label: selected?.label ?? status.value
|
|
7501
|
+
}
|
|
7502
|
+
) : /* @__PURE__ */ jsx("span", { className: "truncate", children: label }) }),
|
|
6937
7503
|
(actionText != null || spec.actionIcon) && /* @__PURE__ */ jsxs("span", { className: "inline-flex shrink-0 items-center", style: { gap: SYSTEM_ACTION_BUTTON_LAYOUT.actionGap }, children: [
|
|
6938
7504
|
actionText != null && spec.actionText && /* @__PURE__ */ jsx(
|
|
6939
7505
|
"span",
|
|
@@ -6942,11 +7508,48 @@ var SSystemActionButton = /* @__PURE__ */ forwardRef(
|
|
|
6942
7508
|
children: actionText
|
|
6943
7509
|
}
|
|
6944
7510
|
),
|
|
6945
|
-
spec.actionIcon && /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center text-(--sab-action-icon)", children: /* @__PURE__ */ jsx(
|
|
7511
|
+
spec.actionIcon && /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center text-(--sab-action-icon)", children: /* @__PURE__ */ jsx(TokenIcon2, { name: spec.actionIcon.name, size: spec.actionIcon.size }) })
|
|
6946
7512
|
] })
|
|
6947
7513
|
]
|
|
6948
7514
|
}
|
|
6949
7515
|
);
|
|
7516
|
+
if (!listBox) {
|
|
7517
|
+
if (!hasMenu) return button;
|
|
7518
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7519
|
+
button,
|
|
7520
|
+
/* @__PURE__ */ jsx(
|
|
7521
|
+
SystemMenuPortal,
|
|
7522
|
+
{
|
|
7523
|
+
open: menuOpen,
|
|
7524
|
+
onOpenChange: setMenuOpen,
|
|
7525
|
+
anchorRef,
|
|
7526
|
+
placement: "right",
|
|
7527
|
+
align: "start",
|
|
7528
|
+
ariaLabel: label ?? selected?.label ?? menu?.value,
|
|
7529
|
+
value: menu?.value,
|
|
7530
|
+
options: menuOptions,
|
|
7531
|
+
onSelect: (next) => {
|
|
7532
|
+
setMenuOpen(false);
|
|
7533
|
+
menu?.onChange?.(next);
|
|
7534
|
+
}
|
|
7535
|
+
}
|
|
7536
|
+
)
|
|
7537
|
+
] });
|
|
7538
|
+
}
|
|
7539
|
+
const { open: _open, onOpenChange: _onOpenChange, ...content } = listBox;
|
|
7540
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7541
|
+
button,
|
|
7542
|
+
/* @__PURE__ */ jsx(
|
|
7543
|
+
AccountListBoxPortal,
|
|
7544
|
+
{
|
|
7545
|
+
open: listBoxOpen,
|
|
7546
|
+
onOpenChange: commitListBoxOpen,
|
|
7547
|
+
anchorRef,
|
|
7548
|
+
ariaLabel: label,
|
|
7549
|
+
content
|
|
7550
|
+
}
|
|
7551
|
+
)
|
|
7552
|
+
] });
|
|
6950
7553
|
}
|
|
6951
7554
|
);
|
|
6952
7555
|
var SIZE_CLASSES = {
|
|
@@ -7101,87 +7704,6 @@ function SPopover({
|
|
|
7101
7704
|
) })
|
|
7102
7705
|
] });
|
|
7103
7706
|
}
|
|
7104
|
-
function SPortal({
|
|
7105
|
-
open,
|
|
7106
|
-
onClose,
|
|
7107
|
-
onOpenChange,
|
|
7108
|
-
anchorRef,
|
|
7109
|
-
placement = "bottom",
|
|
7110
|
-
align = "start",
|
|
7111
|
-
offset = 4,
|
|
7112
|
-
alignOffset = 0,
|
|
7113
|
-
fit = false,
|
|
7114
|
-
maxHeight,
|
|
7115
|
-
autoClose = false,
|
|
7116
|
-
persistent = false,
|
|
7117
|
-
viewportPadding = 0,
|
|
7118
|
-
onOpenAutoFocus,
|
|
7119
|
-
onCloseAutoFocus,
|
|
7120
|
-
onPointerDownOutside,
|
|
7121
|
-
children,
|
|
7122
|
-
className,
|
|
7123
|
-
style,
|
|
7124
|
-
ariaLabel
|
|
7125
|
-
}) {
|
|
7126
|
-
const portalContainer = usePortalContainer();
|
|
7127
|
-
const { minWidth: styleMinWidth, maxWidth: styleMaxWidth, ...restStyle } = style ?? {};
|
|
7128
|
-
return /* @__PURE__ */ jsxs(
|
|
7129
|
-
RPopover11.Root,
|
|
7130
|
-
{
|
|
7131
|
-
open,
|
|
7132
|
-
onOpenChange: (next) => {
|
|
7133
|
-
onOpenChange?.(next);
|
|
7134
|
-
if (!next) onClose?.();
|
|
7135
|
-
},
|
|
7136
|
-
children: [
|
|
7137
|
-
/* @__PURE__ */ jsx(RPopover11.Anchor, { virtualRef: anchorRef }),
|
|
7138
|
-
/* @__PURE__ */ jsx(RPopover11.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
7139
|
-
RPopover11.Content,
|
|
7140
|
-
{
|
|
7141
|
-
side: placement,
|
|
7142
|
-
align,
|
|
7143
|
-
sideOffset: offset,
|
|
7144
|
-
alignOffset,
|
|
7145
|
-
collisionPadding: viewportPadding,
|
|
7146
|
-
"aria-label": ariaLabel,
|
|
7147
|
-
onPointerDownOutside: (e) => {
|
|
7148
|
-
if (persistent || anchorRef.current?.contains(e.target)) {
|
|
7149
|
-
e.preventDefault();
|
|
7150
|
-
return;
|
|
7151
|
-
}
|
|
7152
|
-
onPointerDownOutside?.(e);
|
|
7153
|
-
},
|
|
7154
|
-
onFocusOutside: (e) => {
|
|
7155
|
-
if (persistent || anchorRef.current?.contains(e.target)) {
|
|
7156
|
-
e.preventDefault();
|
|
7157
|
-
}
|
|
7158
|
-
},
|
|
7159
|
-
onEscapeKeyDown: persistent ? (e) => e.preventDefault() : void 0,
|
|
7160
|
-
onOpenAutoFocus,
|
|
7161
|
-
onCloseAutoFocus,
|
|
7162
|
-
onClick: autoClose ? () => onClose?.() : void 0,
|
|
7163
|
-
className: cn(
|
|
7164
|
-
"z-50 overflow-hidden rounded-(--cmp-listBox-radius) bg-(--cmp-listBox-bg) shadow-normal-sm",
|
|
7165
|
-
maxHeight != null && "overflow-y-auto",
|
|
7166
|
-
// 앵커가 창보다 넓을 수 있는 자리(가로 스크롤 안의 트리거 등)에서도 하한이 상한을
|
|
7167
|
-
// 이기지 않도록, 앵커 너비 역시 가용 폭으로 가둔다.
|
|
7168
|
-
fit && "min-w-[min(var(--radix-popover-trigger-width),var(--radix-popover-content-available-width))]",
|
|
7169
|
-
FLOATING_SLIDE_ANIM,
|
|
7170
|
-
className
|
|
7171
|
-
),
|
|
7172
|
-
style: {
|
|
7173
|
-
maxHeight,
|
|
7174
|
-
...restStyle,
|
|
7175
|
-
...styleMinWidth != null ? { minWidth: clampToAvailableWidth(styleMinWidth, POPOVER_AVAILABLE_WIDTH) } : {},
|
|
7176
|
-
maxWidth: clampToAvailableWidth(styleMaxWidth, POPOVER_AVAILABLE_WIDTH)
|
|
7177
|
-
},
|
|
7178
|
-
children
|
|
7179
|
-
}
|
|
7180
|
-
) })
|
|
7181
|
-
]
|
|
7182
|
-
}
|
|
7183
|
-
);
|
|
7184
|
-
}
|
|
7185
7707
|
var SPopup = /* @__PURE__ */ forwardRef(function SPopup2({
|
|
7186
7708
|
popupTitle = "",
|
|
7187
7709
|
type = "default",
|
|
@@ -8129,11 +8651,6 @@ function SDrawer({
|
|
|
8129
8651
|
] }) }) });
|
|
8130
8652
|
}
|
|
8131
8653
|
|
|
8132
|
-
// src/lib/is-dev.ts
|
|
8133
|
-
function isDev() {
|
|
8134
|
-
return typeof process === "undefined" || process?.env?.NODE_ENV !== "production";
|
|
8135
|
-
}
|
|
8136
|
-
|
|
8137
8654
|
// src/lib/modal-outlet.ts
|
|
8138
8655
|
var EMPTY = [];
|
|
8139
8656
|
var entries2 = EMPTY;
|
|
@@ -8594,7 +9111,7 @@ var SLayout = /* @__PURE__ */ forwardRef(function SLayout2({
|
|
|
8594
9111
|
|
|
8595
9112
|
// src/components/SGnb/gnb.config.ts
|
|
8596
9113
|
var gnb = (p) => `var(--cmp-gnb-${p})`;
|
|
8597
|
-
var
|
|
9114
|
+
var box2 = (p) => `var(--cmp-gnb-box-${p})`;
|
|
8598
9115
|
var belt = (p) => `var(--cmp-gnb-belt-${p})`;
|
|
8599
9116
|
var light = (p) => `var(--cmp-gnb-light-${p})`;
|
|
8600
9117
|
var dark = (p) => `var(--cmp-gnb-dark-${p})`;
|
|
@@ -8615,14 +9132,14 @@ var GNB_MENU = {
|
|
|
8615
9132
|
itemMarginX: gnb("body-padding"),
|
|
8616
9133
|
// 전방향 토큰 → 아이템 좌우 여백에도 사용
|
|
8617
9134
|
itemPaddingY: gnb("item-paddingY"),
|
|
8618
|
-
itemPaddingRight:
|
|
8619
|
-
itemGap:
|
|
8620
|
-
itemRadius:
|
|
9135
|
+
itemPaddingRight: box2("item-paddingRight"),
|
|
9136
|
+
itemGap: box2("item-gap"),
|
|
9137
|
+
itemRadius: box2("item-radius"),
|
|
8621
9138
|
itemArrow: gnb("item-chevron-size"),
|
|
8622
|
-
depth1PaddingLeft:
|
|
8623
|
-
depth2PaddingLeft:
|
|
8624
|
-
depth3PaddingLeft:
|
|
8625
|
-
depth1Icon:
|
|
9139
|
+
depth1PaddingLeft: box2("item-depth1-paddingLeft"),
|
|
9140
|
+
depth2PaddingLeft: box2("item-depth2-paddingLeft"),
|
|
9141
|
+
depth3PaddingLeft: box2("item-depth3-paddingLeft"),
|
|
9142
|
+
depth1Icon: box2("item-depth1-icon"),
|
|
8626
9143
|
// box 는 depth1 전용 타이포 토큰이 없어 depth1 도 selected 타이포를 따른다
|
|
8627
9144
|
depth1FontSize: 14,
|
|
8628
9145
|
// token: gnb.box.item.typography.selected.fontSize
|
|
@@ -8735,17 +9252,17 @@ var GNB_TOP_ICON_GAP = 8;
|
|
|
8735
9252
|
var GNB_TOP_ICON_SIZE = 24;
|
|
8736
9253
|
var GNB_FULL_LOGO_WIDTH_NO_LAUNCHER = GNB_FULL_LOGO_WIDTH + GNB_TOP_ICON_SIZE + GNB_TOP_ICON_GAP;
|
|
8737
9254
|
function findGnbRailValue(items, value) {
|
|
8738
|
-
if (items.some((
|
|
9255
|
+
if (items.some((item4) => item4.value === value)) return value;
|
|
8739
9256
|
return findGnbAncestors(items, value)[0];
|
|
8740
9257
|
}
|
|
8741
9258
|
function findGnbSiblingValues(items, value) {
|
|
8742
9259
|
const walk = (list) => {
|
|
8743
|
-
if (list.some((
|
|
8744
|
-
return list.filter((
|
|
9260
|
+
if (list.some((item4) => item4.value === value)) {
|
|
9261
|
+
return list.filter((item4) => item4.value !== value).map((item4) => item4.value);
|
|
8745
9262
|
}
|
|
8746
|
-
for (const
|
|
8747
|
-
if (
|
|
8748
|
-
const found = walk(
|
|
9263
|
+
for (const item4 of list) {
|
|
9264
|
+
if (item4.children) {
|
|
9265
|
+
const found = walk(item4.children);
|
|
8749
9266
|
if (found) return found;
|
|
8750
9267
|
}
|
|
8751
9268
|
}
|
|
@@ -8755,10 +9272,10 @@ function findGnbSiblingValues(items, value) {
|
|
|
8755
9272
|
}
|
|
8756
9273
|
function findGnbAncestors(items, value) {
|
|
8757
9274
|
const walk = (list, trail) => {
|
|
8758
|
-
for (const
|
|
8759
|
-
if (
|
|
8760
|
-
if (
|
|
8761
|
-
const found = walk(
|
|
9275
|
+
for (const item4 of list) {
|
|
9276
|
+
if (item4.value === value) return trail;
|
|
9277
|
+
if (item4.children) {
|
|
9278
|
+
const found = walk(item4.children, [...trail, item4.value]);
|
|
8762
9279
|
if (found) return found;
|
|
8763
9280
|
}
|
|
8764
9281
|
}
|
|
@@ -8768,20 +9285,20 @@ function findGnbAncestors(items, value) {
|
|
|
8768
9285
|
}
|
|
8769
9286
|
function findGnbDescendantBranchValues(items, value) {
|
|
8770
9287
|
const find = (list) => {
|
|
8771
|
-
for (const
|
|
8772
|
-
if (
|
|
8773
|
-
if (
|
|
8774
|
-
const found = find(
|
|
9288
|
+
for (const item4 of list) {
|
|
9289
|
+
if (item4.value === value) return item4;
|
|
9290
|
+
if (item4.children) {
|
|
9291
|
+
const found = find(item4.children);
|
|
8775
9292
|
if (found) return found;
|
|
8776
9293
|
}
|
|
8777
9294
|
}
|
|
8778
9295
|
return void 0;
|
|
8779
9296
|
};
|
|
8780
9297
|
const collect = (list, acc) => {
|
|
8781
|
-
for (const
|
|
8782
|
-
if (
|
|
8783
|
-
acc.push(
|
|
8784
|
-
collect(
|
|
9298
|
+
for (const item4 of list) {
|
|
9299
|
+
if (item4.children && item4.children.length > 0) {
|
|
9300
|
+
acc.push(item4.value);
|
|
9301
|
+
collect(item4.children, acc);
|
|
8785
9302
|
}
|
|
8786
9303
|
}
|
|
8787
9304
|
return acc;
|
|
@@ -8826,7 +9343,7 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
8826
9343
|
const type = typeProp ?? layout?.type ?? "box";
|
|
8827
9344
|
const folded = foldedProp ?? layout?.folded ?? false;
|
|
8828
9345
|
const useRail = useRailProp ?? layout?.useRail ?? false;
|
|
8829
|
-
const railHasLeaf = useRail && items.some((
|
|
9346
|
+
const railHasLeaf = useRail && items.some((item4) => !item4.children || item4.children.length === 0);
|
|
8830
9347
|
const header = railHasLeaf ? "full" : headerProp ?? layout?.header ?? "fix";
|
|
8831
9348
|
const H = GNB_HEADER[header];
|
|
8832
9349
|
const M = GNB_MENU[type];
|
|
@@ -8869,13 +9386,13 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
8869
9386
|
labelTipHideRef.current = setTimeout(() => setLabelTip(null), LABEL_TIP_HIDE_DELAY_MS);
|
|
8870
9387
|
};
|
|
8871
9388
|
useEffect(() => cancelLabelTipHide, []);
|
|
8872
|
-
const rowHoverProps = (
|
|
9389
|
+
const rowHoverProps = (item4) => ({
|
|
8873
9390
|
onMouseEnter: (event) => {
|
|
8874
|
-
setHoveredKey(
|
|
8875
|
-
showLabelTipIfTruncated(event.currentTarget,
|
|
9391
|
+
setHoveredKey(item4.value);
|
|
9392
|
+
showLabelTipIfTruncated(event.currentTarget, item4.label);
|
|
8876
9393
|
},
|
|
8877
9394
|
onMouseLeave: () => {
|
|
8878
|
-
setHoveredKey((prev) => prev ===
|
|
9395
|
+
setHoveredKey((prev) => prev === item4.value ? null : prev);
|
|
8879
9396
|
startLabelTipHide();
|
|
8880
9397
|
}
|
|
8881
9398
|
});
|
|
@@ -8901,7 +9418,7 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
8901
9418
|
}, [items, value]);
|
|
8902
9419
|
useEffect(() => {
|
|
8903
9420
|
setActiveRail(
|
|
8904
|
-
(prev) => prev !== void 0 && items.some((
|
|
9421
|
+
(prev) => prev !== void 0 && items.some((item4) => item4.value === prev) ? prev : items[0]?.value
|
|
8905
9422
|
);
|
|
8906
9423
|
}, [items]);
|
|
8907
9424
|
const toggleExpand = (key) => {
|
|
@@ -8918,33 +9435,33 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
8918
9435
|
return next;
|
|
8919
9436
|
});
|
|
8920
9437
|
};
|
|
8921
|
-
const handleItemClick = (
|
|
8922
|
-
if (
|
|
8923
|
-
if (
|
|
8924
|
-
toggleExpand(
|
|
9438
|
+
const handleItemClick = (item4) => {
|
|
9439
|
+
if (item4.disabled) return;
|
|
9440
|
+
if (item4.children && item4.children.length > 0) {
|
|
9441
|
+
toggleExpand(item4.value);
|
|
8925
9442
|
return;
|
|
8926
9443
|
}
|
|
8927
|
-
onValueChange?.(
|
|
9444
|
+
onValueChange?.(item4.value);
|
|
8928
9445
|
};
|
|
8929
|
-
const handleRailClick = (
|
|
8930
|
-
if (
|
|
8931
|
-
setActiveRail(
|
|
8932
|
-
onRailChange?.(
|
|
8933
|
-
if (!
|
|
9446
|
+
const handleRailClick = (item4) => {
|
|
9447
|
+
if (item4.disabled) return;
|
|
9448
|
+
setActiveRail(item4.value);
|
|
9449
|
+
onRailChange?.(item4.value);
|
|
9450
|
+
if (!item4.children || item4.children.length === 0) onValueChange?.(item4.value);
|
|
8934
9451
|
};
|
|
8935
9452
|
const handleFoldToggle = () => {
|
|
8936
9453
|
const next = !folded;
|
|
8937
9454
|
onFoldChange?.(next);
|
|
8938
9455
|
if (foldedProp === void 0) layout?.setFolded(next);
|
|
8939
9456
|
};
|
|
8940
|
-
const renderRailItem = (
|
|
8941
|
-
const isActive =
|
|
8942
|
-
const isHovered = hoveredKey ===
|
|
9457
|
+
const renderRailItem = (item4) => {
|
|
9458
|
+
const isActive = item4.value === activeRail;
|
|
9459
|
+
const isHovered = hoveredKey === item4.value && !item4.disabled;
|
|
8943
9460
|
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
8944
9461
|
"button",
|
|
8945
9462
|
{
|
|
8946
9463
|
type: "button",
|
|
8947
|
-
disabled:
|
|
9464
|
+
disabled: item4.disabled,
|
|
8948
9465
|
"aria-current": isActive ? "true" : void 0,
|
|
8949
9466
|
className: "box-border flex select-none flex-col items-center border-none bg-transparent transition-colors duration-150",
|
|
8950
9467
|
style: {
|
|
@@ -8959,31 +9476,31 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
8959
9476
|
fontSize: GNB_RAIL.itemFontSize,
|
|
8960
9477
|
lineHeight: `${GNB_RAIL.itemLineHeight}px`,
|
|
8961
9478
|
fontWeight: isActive ? GNB_RAIL.itemFontWeightSelected : GNB_RAIL.itemFontWeight,
|
|
8962
|
-
opacity:
|
|
8963
|
-
cursor:
|
|
9479
|
+
opacity: item4.disabled ? 0.4 : 1,
|
|
9480
|
+
cursor: item4.disabled ? "not-allowed" : "pointer"
|
|
8964
9481
|
},
|
|
8965
|
-
onClick: () => handleRailClick(
|
|
8966
|
-
...rowHoverProps(
|
|
9482
|
+
onClick: () => handleRailClick(item4),
|
|
9483
|
+
...rowHoverProps(item4),
|
|
8967
9484
|
children: [
|
|
8968
|
-
|
|
9485
|
+
item4.icon && /* @__PURE__ */ jsx(SIcon, { name: item4.icon, size: GNB_RAIL.itemIcon, className: "shrink-0" }),
|
|
8969
9486
|
/* @__PURE__ */ jsx(
|
|
8970
9487
|
"span",
|
|
8971
9488
|
{
|
|
8972
9489
|
"data-gnb-label": true,
|
|
8973
9490
|
className: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-center",
|
|
8974
|
-
children:
|
|
9491
|
+
children: item4.label
|
|
8975
9492
|
}
|
|
8976
9493
|
)
|
|
8977
9494
|
]
|
|
8978
9495
|
}
|
|
8979
|
-
) },
|
|
9496
|
+
) }, item4.value);
|
|
8980
9497
|
};
|
|
8981
|
-
const renderItem = (
|
|
8982
|
-
const hasChildren = !!(
|
|
8983
|
-
const isSelected = !hasChildren &&
|
|
8984
|
-
const isExpanded = expandedKeys.has(
|
|
8985
|
-
const isHovered = hoveredKey ===
|
|
8986
|
-
const iconBranch = depth === 1 ? !!
|
|
9498
|
+
const renderItem = (item4, depth, branchHasIcon = false) => {
|
|
9499
|
+
const hasChildren = !!(item4.children && item4.children.length > 0);
|
|
9500
|
+
const isSelected = !hasChildren && item4.value === value;
|
|
9501
|
+
const isExpanded = expandedKeys.has(item4.value);
|
|
9502
|
+
const isHovered = hoveredKey === item4.value && !item4.disabled;
|
|
9503
|
+
const iconBranch = depth === 1 ? !!item4.icon : branchHasIcon;
|
|
8987
9504
|
const itemStyle = {
|
|
8988
9505
|
gap: M.itemGap,
|
|
8989
9506
|
paddingTop: M.itemPaddingY,
|
|
@@ -9000,8 +9517,8 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9000
9517
|
fontSize: depth === 1 ? M.depth1FontSize : M.itemFontSize,
|
|
9001
9518
|
lineHeight: `${depth === 1 ? M.depth1LineHeight : M.itemLineHeight}px`,
|
|
9002
9519
|
fontWeight: depth === 1 ? M.depth1FontWeight : isSelected ? M.itemFontWeightSelected : M.itemFontWeight,
|
|
9003
|
-
opacity:
|
|
9004
|
-
cursor:
|
|
9520
|
+
opacity: item4.disabled ? 0.4 : 1,
|
|
9521
|
+
cursor: item4.disabled ? "not-allowed" : "pointer"
|
|
9005
9522
|
};
|
|
9006
9523
|
return (
|
|
9007
9524
|
// li 를 flex-col 로 둬야 버튼이 좌우 마진만큼 안쪽으로 들어가고,
|
|
@@ -9011,18 +9528,18 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9011
9528
|
"button",
|
|
9012
9529
|
{
|
|
9013
9530
|
type: "button",
|
|
9014
|
-
disabled:
|
|
9531
|
+
disabled: item4.disabled,
|
|
9015
9532
|
"aria-expanded": hasChildren ? isExpanded : void 0,
|
|
9016
9533
|
"aria-current": isSelected ? "page" : void 0,
|
|
9017
9534
|
className: "box-border flex select-none items-center border-none bg-transparent text-left transition-colors duration-150",
|
|
9018
9535
|
style: itemStyle,
|
|
9019
|
-
onClick: () => handleItemClick(
|
|
9020
|
-
...rowHoverProps(
|
|
9536
|
+
onClick: () => handleItemClick(item4),
|
|
9537
|
+
...rowHoverProps(item4),
|
|
9021
9538
|
children: [
|
|
9022
|
-
depth === 1 &&
|
|
9539
|
+
depth === 1 && item4.icon && /* @__PURE__ */ jsx(
|
|
9023
9540
|
SIcon,
|
|
9024
9541
|
{
|
|
9025
|
-
name:
|
|
9542
|
+
name: item4.icon,
|
|
9026
9543
|
size: M.depth1Icon,
|
|
9027
9544
|
color: isSelected ? C.itemColorActive : C.itemIcon,
|
|
9028
9545
|
className: "shrink-0"
|
|
@@ -9042,17 +9559,17 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9042
9559
|
{
|
|
9043
9560
|
"data-gnb-label": true,
|
|
9044
9561
|
className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
9045
|
-
children:
|
|
9562
|
+
children: item4.label
|
|
9046
9563
|
}
|
|
9047
9564
|
)
|
|
9048
9565
|
] }),
|
|
9049
|
-
|
|
9566
|
+
item4.tag !== void 0 && item4.tag !== "" && /* @__PURE__ */ jsx(
|
|
9050
9567
|
STag,
|
|
9051
9568
|
{
|
|
9052
9569
|
shape: "square",
|
|
9053
9570
|
size: "xs",
|
|
9054
|
-
color:
|
|
9055
|
-
label:
|
|
9571
|
+
color: item4.tagColor ?? "blue",
|
|
9572
|
+
label: item4.tag,
|
|
9056
9573
|
className: "shrink-0"
|
|
9057
9574
|
}
|
|
9058
9575
|
),
|
|
@@ -9085,16 +9602,16 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9085
9602
|
visibility: isExpanded ? "visible" : "hidden",
|
|
9086
9603
|
transition: `visibility 0s linear ${isExpanded ? "0s" : `${GNB_EXPAND_MS}ms`}`
|
|
9087
9604
|
},
|
|
9088
|
-
children:
|
|
9605
|
+
children: item4.children.map((child) => renderItem(child, depth + 1, iconBranch))
|
|
9089
9606
|
}
|
|
9090
9607
|
)
|
|
9091
9608
|
}
|
|
9092
9609
|
)
|
|
9093
|
-
] },
|
|
9610
|
+
] }, item4.value)
|
|
9094
9611
|
);
|
|
9095
9612
|
};
|
|
9096
9613
|
const railItems = useRail ? items : [];
|
|
9097
|
-
const menuItems = useRail ? items.find((
|
|
9614
|
+
const menuItems = useRail ? items.find((item4) => item4.value === activeRail)?.children ?? [] : items;
|
|
9098
9615
|
const showMenu = !useRail || menuItems.length > 0;
|
|
9099
9616
|
const [uncontrolledMenuWidth, setUncontrolledMenuWidth] = useState(
|
|
9100
9617
|
() => defaultMenuWidth ?? GNB_MENU_WIDTH
|
|
@@ -9285,13 +9802,26 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9285
9802
|
"topContent"
|
|
9286
9803
|
) : null;
|
|
9287
9804
|
const systemMenuContext = useMemo(
|
|
9288
|
-
() => ({ color, folded: false }),
|
|
9289
|
-
[color]
|
|
9805
|
+
() => ({ color, folded: false, placement: "panel", active: !railFolded }),
|
|
9806
|
+
[color, railFolded]
|
|
9290
9807
|
);
|
|
9291
9808
|
const systemFoldedContext = useMemo(
|
|
9292
|
-
() => ({ color, folded: true }),
|
|
9809
|
+
() => ({ color, folded: true, placement: "panel", active: true }),
|
|
9293
9810
|
[color]
|
|
9294
9811
|
);
|
|
9812
|
+
const systemTopContext = useMemo(
|
|
9813
|
+
() => ({ color, folded: false, placement: "top", active: true }),
|
|
9814
|
+
[color]
|
|
9815
|
+
);
|
|
9816
|
+
const systemTopBox = header === "full" && system ? /* @__PURE__ */ jsx(
|
|
9817
|
+
"div",
|
|
9818
|
+
{
|
|
9819
|
+
className: "flex shrink-0 items-center",
|
|
9820
|
+
style: { marginLeft: topContentBox ? H.topGap : "auto" },
|
|
9821
|
+
children: /* @__PURE__ */ jsx(SGnbSystemContext.Provider, { value: systemTopContext, children: system })
|
|
9822
|
+
},
|
|
9823
|
+
"system"
|
|
9824
|
+
) : null;
|
|
9295
9825
|
return /* @__PURE__ */ jsxs(
|
|
9296
9826
|
"div",
|
|
9297
9827
|
{
|
|
@@ -9333,7 +9863,8 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9333
9863
|
launcherButton,
|
|
9334
9864
|
foldButton,
|
|
9335
9865
|
logoBox,
|
|
9336
|
-
topContentBox
|
|
9866
|
+
topContentBox,
|
|
9867
|
+
systemTopBox
|
|
9337
9868
|
] })
|
|
9338
9869
|
}
|
|
9339
9870
|
),
|
|
@@ -9409,11 +9940,11 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9409
9940
|
paddingTop: M.bodyPaddingY,
|
|
9410
9941
|
paddingBottom: M.bodyPaddingY
|
|
9411
9942
|
},
|
|
9412
|
-
children: /* @__PURE__ */ jsx("ul", { className: "m-0 flex list-none flex-col p-0", children: menuItems.map((
|
|
9943
|
+
children: /* @__PURE__ */ jsx("ul", { className: "m-0 flex list-none flex-col p-0", children: menuItems.map((item4) => renderItem(item4, 1)) })
|
|
9413
9944
|
}
|
|
9414
9945
|
),
|
|
9415
9946
|
menuFooter && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: menuFooter }),
|
|
9416
|
-
system && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(SGnbSystemContext.Provider, { value: systemMenuContext, children: system }) })
|
|
9947
|
+
!isFull && system && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(SGnbSystemContext.Provider, { value: systemMenuContext, children: system }) })
|
|
9417
9948
|
]
|
|
9418
9949
|
}
|
|
9419
9950
|
)
|
|
@@ -9450,9 +9981,10 @@ var SGnb = /* @__PURE__ */ forwardRef(function SGnb2({
|
|
|
9450
9981
|
|
|
9451
9982
|
// src/components/SGnbSystem/gnbSystem.config.ts
|
|
9452
9983
|
var GNB_SYSTEM_COLORS = ["light", "dark"];
|
|
9984
|
+
var GNB_SYSTEM_PLACEMENTS = ["panel", "top"];
|
|
9453
9985
|
var panel = (p) => `var(--cmp-gnb-system-panel-${p})`;
|
|
9454
9986
|
var domain = (p) => `var(--cmp-gnb-system-domainTag-${p})`;
|
|
9455
|
-
var
|
|
9987
|
+
var item3 = (p) => `var(--cmp-gnb-system-item-${p})`;
|
|
9456
9988
|
var alert = (p) => `var(--cmp-gnb-system-alertButton-${p})`;
|
|
9457
9989
|
var GNB_SYSTEM_COLOR_CONFIG = {
|
|
9458
9990
|
light: {
|
|
@@ -9480,6 +10012,27 @@ var GNB_SYSTEM_COLOR_CONFIG = {
|
|
|
9480
10012
|
alertHoverBg: void 0
|
|
9481
10013
|
}
|
|
9482
10014
|
};
|
|
10015
|
+
var GNB_SYSTEM_TOP_COLOR_CONFIG = {
|
|
10016
|
+
light: {
|
|
10017
|
+
item: "light",
|
|
10018
|
+
divider: panel("divider-color-light"),
|
|
10019
|
+
domainBg: domain("light-bg"),
|
|
10020
|
+
domainText: domain("light-text"),
|
|
10021
|
+
alertIcon: alert("icon-color-notification-light"),
|
|
10022
|
+
alertCount: alert("count-color-light"),
|
|
10023
|
+
alertHoverBg: alert("bg-notificationHover-light")
|
|
10024
|
+
},
|
|
10025
|
+
dark: {
|
|
10026
|
+
item: "darker",
|
|
10027
|
+
divider: panel("divider-color-darker"),
|
|
10028
|
+
domainBg: domain("darker-bg"),
|
|
10029
|
+
domainText: domain("darker-text"),
|
|
10030
|
+
alertIcon: alert("icon-color-notification-dark"),
|
|
10031
|
+
alertCount: alert("count-color-dark"),
|
|
10032
|
+
// darker 면에는 알림 hover 배경 토큰이 없다 → 행 기본 hover 를 그대로 쓴다.
|
|
10033
|
+
alertHoverBg: void 0
|
|
10034
|
+
}
|
|
10035
|
+
};
|
|
9483
10036
|
var GNB_SYSTEM_LAYOUT = {
|
|
9484
10037
|
/** 펼친 패널의 안쪽 여백 */
|
|
9485
10038
|
padding: "var(--cmp-gnb-system-project-padding)",
|
|
@@ -9491,17 +10044,17 @@ var GNB_SYSTEM_LAYOUT = {
|
|
|
9491
10044
|
*/
|
|
9492
10045
|
gap: panel("gap"),
|
|
9493
10046
|
/** 행 높이 */
|
|
9494
|
-
itemHeight:
|
|
10047
|
+
itemHeight: item3("height"),
|
|
9495
10048
|
/** 행 라운드 */
|
|
9496
|
-
itemRadius:
|
|
10049
|
+
itemRadius: item3("radius"),
|
|
9497
10050
|
/** 아이콘 프레임 한 변 */
|
|
9498
|
-
iconFrame:
|
|
10051
|
+
iconFrame: item3("icon-frame"),
|
|
9499
10052
|
/** 아이콘 글리프 크기 */
|
|
9500
|
-
iconGlyph:
|
|
10053
|
+
iconGlyph: item3("icon-glyph"),
|
|
9501
10054
|
/** 아이콘 프레임 라운드 */
|
|
9502
|
-
iconRadius:
|
|
10055
|
+
iconRadius: item3("icon-radius"),
|
|
9503
10056
|
/** 아이콘 프레임 ↔ 라벨 간격 */
|
|
9504
|
-
iconLabelGap:
|
|
10057
|
+
iconLabelGap: item3("iconLabelGap"),
|
|
9505
10058
|
/** 알림 버튼 좌우 여백 */
|
|
9506
10059
|
alertPaddingX: alert("paddingX"),
|
|
9507
10060
|
/** 설정 버튼 좌우 여백 */
|
|
@@ -9514,7 +10067,7 @@ var GNB_SYSTEM_LAYOUT = {
|
|
|
9514
10067
|
var GNB_SYSTEM_ALERT_DOT_SIZE = 6;
|
|
9515
10068
|
var GNB_SYSTEM_ALERT_LABEL = "\uC54C\uB9BC";
|
|
9516
10069
|
var GNB_SYSTEM_SETTING_LABEL = "\uC124\uC815";
|
|
9517
|
-
function
|
|
10070
|
+
function TokenIcon3({ name, size }) {
|
|
9518
10071
|
return /* @__PURE__ */ jsx(SIcon, { name, size: "100%", style: { width: size, height: size } });
|
|
9519
10072
|
}
|
|
9520
10073
|
function SystemButton({
|
|
@@ -9529,14 +10082,20 @@ function SystemButton({
|
|
|
9529
10082
|
dot,
|
|
9530
10083
|
accentColor,
|
|
9531
10084
|
stretch,
|
|
10085
|
+
buttonRef,
|
|
10086
|
+
hasPopup,
|
|
10087
|
+
expanded,
|
|
9532
10088
|
onClick
|
|
9533
10089
|
}) {
|
|
9534
10090
|
const c = SYSTEM_ACTION_BUTTON_COLOR_CONFIG[color];
|
|
9535
10091
|
return /* @__PURE__ */ jsxs(
|
|
9536
10092
|
"button",
|
|
9537
10093
|
{
|
|
10094
|
+
ref: buttonRef,
|
|
9538
10095
|
type: "button",
|
|
9539
10096
|
"aria-label": label ? void 0 : ariaLabel,
|
|
10097
|
+
"aria-haspopup": hasPopup ? "dialog" : void 0,
|
|
10098
|
+
"aria-expanded": hasPopup ? expanded : void 0,
|
|
9540
10099
|
onClick,
|
|
9541
10100
|
className: cn(
|
|
9542
10101
|
"group box-border flex cursor-pointer items-center border-none bg-(--gsb-bg) text-(--gsb-text) transition-colors hover:bg-(--gsb-bg-hover)",
|
|
@@ -9565,7 +10124,7 @@ function SystemButton({
|
|
|
9565
10124
|
className: "relative inline-flex shrink-0 items-center justify-center bg-(--gsb-icon-bg) text-(--gsb-icon) transition-colors group-hover:bg-(--gsb-icon-bg-hover) group-hover:text-(--gsb-icon-hover)",
|
|
9566
10125
|
style: { width: GNB_SYSTEM_LAYOUT.iconFrame, height: GNB_SYSTEM_LAYOUT.iconFrame, borderRadius: GNB_SYSTEM_LAYOUT.iconRadius },
|
|
9567
10126
|
children: [
|
|
9568
|
-
/* @__PURE__ */ jsx(
|
|
10127
|
+
/* @__PURE__ */ jsx(TokenIcon3, { name: icon, size: GNB_SYSTEM_LAYOUT.iconGlyph }),
|
|
9569
10128
|
dot && /* @__PURE__ */ jsx(
|
|
9570
10129
|
"span",
|
|
9571
10130
|
{
|
|
@@ -9603,11 +10162,33 @@ var SGnbSystem = /* @__PURE__ */ forwardRef(function SGnbSystem2({
|
|
|
9603
10162
|
}, ref) {
|
|
9604
10163
|
const gnb2 = useContext(SGnbSystemContext);
|
|
9605
10164
|
const color = colorProp ?? gnb2?.color ?? "light";
|
|
9606
|
-
const
|
|
10165
|
+
const placement = gnb2?.placement ?? "panel";
|
|
10166
|
+
const isTop = placement === "top";
|
|
10167
|
+
const folded = !isTop && (foldedProp ?? gnb2?.folded ?? false);
|
|
10168
|
+
const active = gnb2?.active ?? true;
|
|
9607
10169
|
const c = GNB_SYSTEM_COLOR_CONFIG[color];
|
|
10170
|
+
const t = GNB_SYSTEM_TOP_COLOR_CONFIG[color];
|
|
10171
|
+
const itemColor = isTop ? t.item : color;
|
|
10172
|
+
const dividerColor = isTop ? t.divider : c.divider;
|
|
10173
|
+
const domainBg = isTop ? t.domainBg : c.domainBg;
|
|
10174
|
+
const domainText = isTop ? t.domainText : c.domainText;
|
|
10175
|
+
const alertIconColor = isTop ? t.alertIcon : c.alertIcon;
|
|
10176
|
+
const alertCountColor = isTop ? t.alertCount : c.alertCount;
|
|
10177
|
+
const alertHoverBg = isTop ? t.alertHoverBg : c.alertHoverBg;
|
|
9608
10178
|
const hasActions = (actions?.length ?? 0) > 0;
|
|
9609
10179
|
const hasDomain = domain2 != null;
|
|
9610
10180
|
const hasUserBlock = Boolean(alert2 || setting || account);
|
|
10181
|
+
const foldedAccountRef = useRef(null);
|
|
10182
|
+
const [accountOpen, setAccountOpen] = useState(false);
|
|
10183
|
+
const commitAccountOpen = (next) => {
|
|
10184
|
+
setAccountOpen(next);
|
|
10185
|
+
account?.onOpenChange?.(next);
|
|
10186
|
+
};
|
|
10187
|
+
useEffect(() => {
|
|
10188
|
+
if (active || !accountOpen) return;
|
|
10189
|
+
setAccountOpen(false);
|
|
10190
|
+
account?.onOpenChange?.(false);
|
|
10191
|
+
}, [active, accountOpen, account]);
|
|
9611
10192
|
const alertCount = alert2?.count ?? 0;
|
|
9612
10193
|
const notified = alertCount > 0;
|
|
9613
10194
|
const alertLabel = alert2?.label ?? GNB_SYSTEM_ALERT_LABEL;
|
|
@@ -9615,20 +10196,113 @@ var SGnbSystem = /* @__PURE__ */ forwardRef(function SGnbSystem2({
|
|
|
9615
10196
|
const alertButton = alert2 && /* @__PURE__ */ jsx(
|
|
9616
10197
|
SystemButton,
|
|
9617
10198
|
{
|
|
9618
|
-
color,
|
|
9619
|
-
icon: notified ? "
|
|
9620
|
-
label: folded ? void 0 : alertLabel,
|
|
10199
|
+
color: itemColor,
|
|
10200
|
+
icon: notified ? "bellRinging" : "bell",
|
|
10201
|
+
label: folded || isTop ? void 0 : alertLabel,
|
|
9621
10202
|
ariaLabel: alertLabel,
|
|
9622
10203
|
paddingX: GNB_SYSTEM_LAYOUT.alertPaddingX,
|
|
9623
|
-
iconColor: notified ?
|
|
9624
|
-
hoverBg: notified ?
|
|
10204
|
+
iconColor: notified ? alertIconColor : void 0,
|
|
10205
|
+
hoverBg: notified ? alertHoverBg : void 0,
|
|
9625
10206
|
count: folded ? void 0 : alertCount,
|
|
9626
10207
|
dot: folded && notified,
|
|
9627
|
-
accentColor:
|
|
9628
|
-
stretch: !folded,
|
|
10208
|
+
accentColor: alertCountColor,
|
|
10209
|
+
stretch: !folded && !isTop,
|
|
9629
10210
|
onClick: alert2.onClick
|
|
9630
10211
|
}
|
|
9631
10212
|
);
|
|
10213
|
+
const settingButton = setting && /* @__PURE__ */ jsx(
|
|
10214
|
+
SystemButton,
|
|
10215
|
+
{
|
|
10216
|
+
color: itemColor,
|
|
10217
|
+
icon: "setting",
|
|
10218
|
+
label: isTop ? void 0 : settingLabel,
|
|
10219
|
+
ariaLabel: settingLabel,
|
|
10220
|
+
paddingX: GNB_SYSTEM_LAYOUT.settingPaddingX,
|
|
10221
|
+
stretch: !isTop && !alert2,
|
|
10222
|
+
onClick: setting.onClick
|
|
10223
|
+
}
|
|
10224
|
+
);
|
|
10225
|
+
const accountButton = account && /* @__PURE__ */ jsx(
|
|
10226
|
+
SSystemActionButton,
|
|
10227
|
+
{
|
|
10228
|
+
color: itemColor,
|
|
10229
|
+
type: "account",
|
|
10230
|
+
label: account.label,
|
|
10231
|
+
onClick: account.onClick,
|
|
10232
|
+
option: { ...account.listBox, open: accountOpen, onOpenChange: commitAccountOpen },
|
|
10233
|
+
className: isTop ? "w-auto shrink-0" : void 0
|
|
10234
|
+
}
|
|
10235
|
+
);
|
|
10236
|
+
const domainTag = hasDomain && /* @__PURE__ */ jsx(
|
|
10237
|
+
"div",
|
|
10238
|
+
{
|
|
10239
|
+
className: cn(
|
|
10240
|
+
"typo-body-sm-medium box-border",
|
|
10241
|
+
isTop ? "shrink-0 whitespace-nowrap" : "w-full truncate text-center"
|
|
10242
|
+
),
|
|
10243
|
+
style: {
|
|
10244
|
+
paddingInline: GNB_SYSTEM_LAYOUT.domainPaddingX,
|
|
10245
|
+
paddingBlock: GNB_SYSTEM_LAYOUT.domainPaddingY,
|
|
10246
|
+
borderRadius: GNB_SYSTEM_LAYOUT.domainRadius,
|
|
10247
|
+
backgroundColor: domainBg,
|
|
10248
|
+
color: domainText
|
|
10249
|
+
},
|
|
10250
|
+
children: domain2
|
|
10251
|
+
}
|
|
10252
|
+
);
|
|
10253
|
+
if (isTop) {
|
|
10254
|
+
const segments = [];
|
|
10255
|
+
actions?.forEach(
|
|
10256
|
+
({ value, ...action2 }, index) => segments.push({
|
|
10257
|
+
key: `action-${value ?? index}`,
|
|
10258
|
+
node: /* @__PURE__ */ jsx(
|
|
10259
|
+
SSystemActionButton,
|
|
10260
|
+
{
|
|
10261
|
+
color: itemColor,
|
|
10262
|
+
...action2,
|
|
10263
|
+
className: cn("w-auto shrink-0", action2.className)
|
|
10264
|
+
}
|
|
10265
|
+
)
|
|
10266
|
+
})
|
|
10267
|
+
);
|
|
10268
|
+
if (alertButton) segments.push({ key: "alert", node: alertButton });
|
|
10269
|
+
if (settingButton) segments.push({ key: "setting", node: settingButton });
|
|
10270
|
+
if (domainTag || accountButton) {
|
|
10271
|
+
segments.push({
|
|
10272
|
+
key: "user",
|
|
10273
|
+
node: /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center", style: { gap: GNB_SYSTEM_LAYOUT.gap }, children: [
|
|
10274
|
+
domainTag,
|
|
10275
|
+
accountButton
|
|
10276
|
+
] })
|
|
10277
|
+
});
|
|
10278
|
+
}
|
|
10279
|
+
if (segments.length === 0) return null;
|
|
10280
|
+
return (
|
|
10281
|
+
// 상단바 줄은 화면 맨 위에 있다 — 계정 리스트박스가 위가 아니라 아래로 펼쳐져야 한다.
|
|
10282
|
+
/* @__PURE__ */ jsx(AccountListBoxAnchorProvider, { value: "top", children: /* @__PURE__ */ jsx(
|
|
10283
|
+
"div",
|
|
10284
|
+
{
|
|
10285
|
+
ref,
|
|
10286
|
+
className: cn("flex items-center", className),
|
|
10287
|
+
style: { gap: GNB_SYSTEM_LAYOUT.gap, ...style },
|
|
10288
|
+
"data-color": color,
|
|
10289
|
+
"data-placement": "top",
|
|
10290
|
+
...rest,
|
|
10291
|
+
children: segments.map(({ key, node }, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
10292
|
+
index > 0 && /* @__PURE__ */ jsx(
|
|
10293
|
+
"span",
|
|
10294
|
+
{
|
|
10295
|
+
className: "h-sd-16 w-px shrink-0",
|
|
10296
|
+
style: { backgroundColor: dividerColor },
|
|
10297
|
+
"aria-hidden": true
|
|
10298
|
+
}
|
|
10299
|
+
),
|
|
10300
|
+
node
|
|
10301
|
+
] }, key))
|
|
10302
|
+
}
|
|
10303
|
+
) })
|
|
10304
|
+
);
|
|
10305
|
+
}
|
|
9632
10306
|
const panelStyle = {
|
|
9633
10307
|
backgroundColor: c.bg,
|
|
9634
10308
|
// 색에 따라 경계선이 없을 수 있다 — 배경 차이만으로 경계가 읽히는 dark 가 그렇다.
|
|
@@ -9645,6 +10319,7 @@ var SGnbSystem = /* @__PURE__ */ forwardRef(function SGnbSystem2({
|
|
|
9645
10319
|
className: cn("box-border flex w-full flex-col", className),
|
|
9646
10320
|
style: panelStyle,
|
|
9647
10321
|
"data-color": color,
|
|
10322
|
+
"data-placement": "panel",
|
|
9648
10323
|
"data-folded": "",
|
|
9649
10324
|
...rest,
|
|
9650
10325
|
children: [
|
|
@@ -9652,11 +10327,27 @@ var SGnbSystem = /* @__PURE__ */ forwardRef(function SGnbSystem2({
|
|
|
9652
10327
|
account && /* @__PURE__ */ jsx(
|
|
9653
10328
|
SystemButton,
|
|
9654
10329
|
{
|
|
9655
|
-
color,
|
|
10330
|
+
color: itemColor,
|
|
9656
10331
|
icon: "user",
|
|
9657
10332
|
ariaLabel: account.label ?? "account",
|
|
9658
10333
|
paddingX: GNB_SYSTEM_LAYOUT.alertPaddingX,
|
|
9659
|
-
|
|
10334
|
+
buttonRef: foldedAccountRef,
|
|
10335
|
+
hasPopup: true,
|
|
10336
|
+
expanded: accountOpen,
|
|
10337
|
+
onClick: () => {
|
|
10338
|
+
account.onClick?.();
|
|
10339
|
+
commitAccountOpen(!accountOpen);
|
|
10340
|
+
}
|
|
10341
|
+
}
|
|
10342
|
+
),
|
|
10343
|
+
account && /* @__PURE__ */ jsx(
|
|
10344
|
+
AccountListBoxPortal,
|
|
10345
|
+
{
|
|
10346
|
+
open: accountOpen,
|
|
10347
|
+
onOpenChange: commitAccountOpen,
|
|
10348
|
+
anchorRef: foldedAccountRef,
|
|
10349
|
+
ariaLabel: account.label,
|
|
10350
|
+
content: account.listBox ?? {}
|
|
9660
10351
|
}
|
|
9661
10352
|
)
|
|
9662
10353
|
]
|
|
@@ -9671,31 +10362,19 @@ var SGnbSystem = /* @__PURE__ */ forwardRef(function SGnbSystem2({
|
|
|
9671
10362
|
className: cn("box-border flex w-full flex-col", className),
|
|
9672
10363
|
style: { ...panelStyle, gap: GNB_SYSTEM_LAYOUT.gap },
|
|
9673
10364
|
"data-color": color,
|
|
10365
|
+
"data-placement": "panel",
|
|
9674
10366
|
...rest,
|
|
9675
10367
|
children: [
|
|
9676
10368
|
actions?.map(({ value, ...action2 }, index) => /* @__PURE__ */ jsx(
|
|
9677
10369
|
SSystemActionButton,
|
|
9678
10370
|
{
|
|
9679
|
-
color,
|
|
10371
|
+
color: itemColor,
|
|
9680
10372
|
...action2
|
|
9681
10373
|
},
|
|
9682
10374
|
value ?? index
|
|
9683
10375
|
)),
|
|
9684
|
-
hasActions && (hasDomain || hasUserBlock) && /* @__PURE__ */ jsx("div", { className: "h-px shrink-0", style: { backgroundColor:
|
|
9685
|
-
|
|
9686
|
-
"div",
|
|
9687
|
-
{
|
|
9688
|
-
className: "typo-body-sm-medium box-border w-full truncate text-center",
|
|
9689
|
-
style: {
|
|
9690
|
-
paddingInline: GNB_SYSTEM_LAYOUT.domainPaddingX,
|
|
9691
|
-
paddingBlock: GNB_SYSTEM_LAYOUT.domainPaddingY,
|
|
9692
|
-
borderRadius: GNB_SYSTEM_LAYOUT.domainRadius,
|
|
9693
|
-
backgroundColor: c.domainBg,
|
|
9694
|
-
color: c.domainText
|
|
9695
|
-
},
|
|
9696
|
-
children: domain2
|
|
9697
|
-
}
|
|
9698
|
-
),
|
|
10376
|
+
hasActions && (hasDomain || hasUserBlock) && /* @__PURE__ */ jsx("div", { className: "h-px shrink-0", style: { backgroundColor: dividerColor } }),
|
|
10377
|
+
domainTag,
|
|
9699
10378
|
hasUserBlock && /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
9700
10379
|
(alert2 || setting) && /* @__PURE__ */ jsxs("div", { className: "flex items-center", style: { gap: GNB_SYSTEM_LAYOUT.gap }, children: [
|
|
9701
10380
|
alertButton,
|
|
@@ -9703,32 +10382,13 @@ var SGnbSystem = /* @__PURE__ */ forwardRef(function SGnbSystem2({
|
|
|
9703
10382
|
"span",
|
|
9704
10383
|
{
|
|
9705
10384
|
className: "h-sd-16 w-px shrink-0",
|
|
9706
|
-
style: { backgroundColor:
|
|
10385
|
+
style: { backgroundColor: dividerColor },
|
|
9707
10386
|
"aria-hidden": true
|
|
9708
10387
|
}
|
|
9709
10388
|
),
|
|
9710
|
-
|
|
9711
|
-
SystemButton,
|
|
9712
|
-
{
|
|
9713
|
-
color,
|
|
9714
|
-
icon: "setting",
|
|
9715
|
-
label: settingLabel,
|
|
9716
|
-
ariaLabel: settingLabel,
|
|
9717
|
-
paddingX: GNB_SYSTEM_LAYOUT.settingPaddingX,
|
|
9718
|
-
stretch: !alert2,
|
|
9719
|
-
onClick: setting.onClick
|
|
9720
|
-
}
|
|
9721
|
-
)
|
|
10389
|
+
settingButton
|
|
9722
10390
|
] }),
|
|
9723
|
-
|
|
9724
|
-
SSystemActionButton,
|
|
9725
|
-
{
|
|
9726
|
-
color,
|
|
9727
|
-
type: "account",
|
|
9728
|
-
label: account.label,
|
|
9729
|
-
onClick: account.onClick
|
|
9730
|
-
}
|
|
9731
|
-
)
|
|
10391
|
+
accountButton
|
|
9732
10392
|
] })
|
|
9733
10393
|
]
|
|
9734
10394
|
}
|
|
@@ -10349,19 +11009,19 @@ var STEPPER_VERTICAL_COLORS = {
|
|
|
10349
11009
|
errorBadge: "#FB4444"
|
|
10350
11010
|
};
|
|
10351
11011
|
var ERROR_TOOLTIP_MESSAGE = "\uD655\uC778\uC774 \uD544\uC694\uD55C \uD56D\uBAA9\uC774 \uC788\uC2B5\uB2C8\uB2E4.";
|
|
10352
|
-
function getItemValue(
|
|
10353
|
-
return
|
|
11012
|
+
function getItemValue(item4, index) {
|
|
11013
|
+
return item4.value ?? String(index + 1);
|
|
10354
11014
|
}
|
|
10355
11015
|
function groupAdjacentItems(items) {
|
|
10356
11016
|
return items.reduce(
|
|
10357
|
-
(groups,
|
|
10358
|
-
const currentGroup =
|
|
11017
|
+
(groups, item4, index) => {
|
|
11018
|
+
const currentGroup = item4.group;
|
|
10359
11019
|
const previous = groups[groups.length - 1];
|
|
10360
11020
|
if (currentGroup && previous?.group === currentGroup) {
|
|
10361
|
-
previous.items.push(
|
|
11021
|
+
previous.items.push(item4);
|
|
10362
11022
|
return groups;
|
|
10363
11023
|
}
|
|
10364
|
-
groups.push({ group: currentGroup, startIndex: index, items: [
|
|
11024
|
+
groups.push({ group: currentGroup, startIndex: index, items: [item4] });
|
|
10365
11025
|
return groups;
|
|
10366
11026
|
},
|
|
10367
11027
|
[]
|
|
@@ -10391,15 +11051,15 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10391
11051
|
const verticalItemRefs = useRef([]);
|
|
10392
11052
|
const activeIndex = Math.max(
|
|
10393
11053
|
0,
|
|
10394
|
-
items.findIndex((
|
|
11054
|
+
items.findIndex((item4, index) => getItemValue(item4, index) === value)
|
|
10395
11055
|
);
|
|
10396
11056
|
const lastCompletedIndex = items.reduce(
|
|
10397
|
-
(lastIndex,
|
|
11057
|
+
(lastIndex, item4, index) => item4.completed === true ? index : lastIndex,
|
|
10398
11058
|
-1
|
|
10399
11059
|
);
|
|
10400
11060
|
const resolvedClickableIndex = lastCompletedIndex + 1;
|
|
10401
11061
|
const [visitedMaxIndex, setVisitedMaxIndex] = useState(activeIndex);
|
|
10402
|
-
const firstErrorIndex = items.findIndex((
|
|
11062
|
+
const firstErrorIndex = items.findIndex((item4) => item4.error === true);
|
|
10403
11063
|
useImperativeHandle(
|
|
10404
11064
|
ref,
|
|
10405
11065
|
() => ({
|
|
@@ -10427,18 +11087,18 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10427
11087
|
transform: `translateY(${activeItem.offsetTop}px)`
|
|
10428
11088
|
});
|
|
10429
11089
|
}, [activeIndex, vertical, items]);
|
|
10430
|
-
const getState = (
|
|
11090
|
+
const getState = (item4, index) => {
|
|
10431
11091
|
if (index === activeIndex) return "active";
|
|
10432
|
-
if (
|
|
11092
|
+
if (item4.completed != null) return item4.completed ? "completed" : "default";
|
|
10433
11093
|
return "default";
|
|
10434
11094
|
};
|
|
10435
|
-
const emitValueChange = (
|
|
10436
|
-
onValueChange?.(getItemValue(
|
|
11095
|
+
const emitValueChange = (item4, index) => {
|
|
11096
|
+
onValueChange?.(getItemValue(item4, index), item4, index);
|
|
10437
11097
|
};
|
|
10438
11098
|
const isWithinClickableIndex = (index) => index <= resolvedClickableIndex;
|
|
10439
|
-
const renderStepContent = (
|
|
11099
|
+
const renderStepContent = (item4, index, options = {}) => {
|
|
10440
11100
|
const { isVertical = false, roleListItem = true, hovered = false } = options;
|
|
10441
|
-
const state2 = getState(
|
|
11101
|
+
const state2 = getState(item4, index);
|
|
10442
11102
|
const isHorizontalCompleted = !isVertical && state2 === "completed";
|
|
10443
11103
|
const isVerticalCompleted = isVertical && state2 === "completed";
|
|
10444
11104
|
const isVerticalLastActive = isVertical && state2 === "default" && index === visitedMaxIndex;
|
|
@@ -10513,12 +11173,12 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10513
11173
|
children: showsCheckIcon ? /* @__PURE__ */ jsx(SIcon, { name: "check", size: STEPPER_LAYOUT.sequenceIcon, color: "currentColor" }) : index + 1
|
|
10514
11174
|
}
|
|
10515
11175
|
),
|
|
10516
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
11176
|
+
/* @__PURE__ */ jsx("span", { children: item4.label })
|
|
10517
11177
|
]
|
|
10518
11178
|
}
|
|
10519
11179
|
);
|
|
10520
11180
|
};
|
|
10521
|
-
const renderClickableStepContent = (
|
|
11181
|
+
const renderClickableStepContent = (item4, index, isVertical = false) => {
|
|
10522
11182
|
const isDisabled = !isWithinClickableIndex(index);
|
|
10523
11183
|
return /* @__PURE__ */ jsx(
|
|
10524
11184
|
"button",
|
|
@@ -10531,9 +11191,9 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10531
11191
|
),
|
|
10532
11192
|
style: { font: "inherit", color: "inherit" },
|
|
10533
11193
|
onClick: () => {
|
|
10534
|
-
if (!isDisabled) emitValueChange(
|
|
11194
|
+
if (!isDisabled) emitValueChange(item4, index);
|
|
10535
11195
|
},
|
|
10536
|
-
children: renderStepContent(
|
|
11196
|
+
children: renderStepContent(item4, index, { isVertical, roleListItem: false })
|
|
10537
11197
|
}
|
|
10538
11198
|
);
|
|
10539
11199
|
};
|
|
@@ -10592,10 +11252,10 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10592
11252
|
children: /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: group.group })
|
|
10593
11253
|
}
|
|
10594
11254
|
),
|
|
10595
|
-
group.items.map((
|
|
11255
|
+
group.items.map((item4, itemIndex) => {
|
|
10596
11256
|
const index = group.startIndex + itemIndex;
|
|
10597
|
-
const state2 = getState(
|
|
10598
|
-
const itemValue = getItemValue(
|
|
11257
|
+
const state2 = getState(item4, index);
|
|
11258
|
+
const itemValue = getItemValue(item4, index);
|
|
10599
11259
|
const canClickItem = isClickable && isWithinClickableIndex(index);
|
|
10600
11260
|
const isDisabled = !canClickItem;
|
|
10601
11261
|
const isHovered = hoveredIndex === index && canClickItem && state2 !== "active";
|
|
@@ -10613,12 +11273,12 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10613
11273
|
const handleMouseLeave = () => {
|
|
10614
11274
|
setHoveredIndex((current) => current === index ? null : current);
|
|
10615
11275
|
};
|
|
10616
|
-
const stepContent = renderStepContent(
|
|
11276
|
+
const stepContent = renderStepContent(item4, index, {
|
|
10617
11277
|
isVertical: true,
|
|
10618
11278
|
roleListItem: false,
|
|
10619
11279
|
hovered: isHovered
|
|
10620
11280
|
});
|
|
10621
|
-
const errorBadge =
|
|
11281
|
+
const errorBadge = item4.error ? /* @__PURE__ */ jsx(
|
|
10622
11282
|
"span",
|
|
10623
11283
|
{
|
|
10624
11284
|
"aria-hidden": "true",
|
|
@@ -10633,7 +11293,7 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10633
11293
|
) : null;
|
|
10634
11294
|
const isTooltipHovered = tooltipHoverValue === itemValue;
|
|
10635
11295
|
const isCustomTooltipOpen = customTooltipOpen && index === firstErrorIndex;
|
|
10636
|
-
const showTooltip =
|
|
11296
|
+
const showTooltip = item4.error === true && (isTooltipHovered || isCustomTooltipOpen);
|
|
10637
11297
|
const handleTooltipMouseEnter = () => setTooltipHoverValue(itemValue);
|
|
10638
11298
|
const handleTooltipMouseLeave = () => {
|
|
10639
11299
|
setTooltipHoverValue((current) => current === itemValue ? null : current);
|
|
@@ -10657,7 +11317,7 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10657
11317
|
onMouseEnter: handleTooltipMouseEnter,
|
|
10658
11318
|
onMouseLeave: handleTooltipMouseLeave,
|
|
10659
11319
|
onClick: isClickable ? () => {
|
|
10660
|
-
if (!isDisabled) emitValueChange(
|
|
11320
|
+
if (!isDisabled) emitValueChange(item4, index);
|
|
10661
11321
|
} : void 0,
|
|
10662
11322
|
children: [
|
|
10663
11323
|
stepContent,
|
|
@@ -10689,13 +11349,13 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10689
11349
|
{
|
|
10690
11350
|
type: "button",
|
|
10691
11351
|
disabled: isDisabled,
|
|
10692
|
-
"aria-label":
|
|
11352
|
+
"aria-label": item4.label,
|
|
10693
11353
|
className: cn(
|
|
10694
11354
|
"absolute inset-0 z-[2] m-0 border-0 bg-transparent p-0 text-left outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-(--sys-color-border-accent)",
|
|
10695
11355
|
isDisabled ? "cursor-default" : "cursor-pointer"
|
|
10696
11356
|
),
|
|
10697
11357
|
onClick: () => {
|
|
10698
|
-
if (!isDisabled) emitValueChange(
|
|
11358
|
+
if (!isDisabled) emitValueChange(item4, index);
|
|
10699
11359
|
}
|
|
10700
11360
|
}
|
|
10701
11361
|
),
|
|
@@ -10746,9 +11406,9 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10746
11406
|
lineHeight: config.lineHeight,
|
|
10747
11407
|
...style
|
|
10748
11408
|
},
|
|
10749
|
-
children: items.map((
|
|
10750
|
-
const state2 = getState(
|
|
10751
|
-
const content = isClickable ? /* @__PURE__ */ jsx("span", { role: "listitem", "aria-current": state2 === "active" ? "step" : void 0, children: renderClickableStepContent(
|
|
11409
|
+
children: items.map((item4, index) => {
|
|
11410
|
+
const state2 = getState(item4, index);
|
|
11411
|
+
const content = isClickable ? /* @__PURE__ */ jsx("span", { role: "listitem", "aria-current": state2 === "active" ? "step" : void 0, children: renderClickableStepContent(item4, index) }) : renderStepContent(item4, index);
|
|
10752
11412
|
return /* @__PURE__ */ jsxs(
|
|
10753
11413
|
"span",
|
|
10754
11414
|
{
|
|
@@ -10782,7 +11442,7 @@ var SStepper = /* @__PURE__ */ forwardRef(function SStepper2({
|
|
|
10782
11442
|
)
|
|
10783
11443
|
]
|
|
10784
11444
|
},
|
|
10785
|
-
getItemValue(
|
|
11445
|
+
getItemValue(item4, index)
|
|
10786
11446
|
);
|
|
10787
11447
|
})
|
|
10788
11448
|
}
|
|
@@ -11333,7 +11993,7 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
11333
11993
|
const selectedAnchorIndex = useMemo(() => {
|
|
11334
11994
|
if (selected.length === 0) return -1;
|
|
11335
11995
|
const selectedSet = new Set(selected);
|
|
11336
|
-
return navigableItems.findIndex((
|
|
11996
|
+
return navigableItems.findIndex((item4) => item4.value != null && selectedSet.has(item4.value));
|
|
11337
11997
|
}, [navigableItems, selected]);
|
|
11338
11998
|
selectedAnchorRef.current = selectedAnchorIndex;
|
|
11339
11999
|
const triggerText = (() => {
|
|
@@ -11627,7 +12287,7 @@ var SSelectImpl = /* @__PURE__ */ forwardRef(function SSelect({
|
|
|
11627
12287
|
setFocusedIndex(-1);
|
|
11628
12288
|
return;
|
|
11629
12289
|
}
|
|
11630
|
-
const index = navigableItems.findIndex((
|
|
12290
|
+
const index = navigableItems.findIndex((item4) => item4.key === key);
|
|
11631
12291
|
if (index >= 0) setFocusedIndex(index);
|
|
11632
12292
|
}
|
|
11633
12293
|
}
|
|
@@ -13397,7 +14057,9 @@ function SRadio({
|
|
|
13397
14057
|
{
|
|
13398
14058
|
...labelInteractiveProps,
|
|
13399
14059
|
className: cn(
|
|
13400
|
-
|
|
14060
|
+
// align-middle: 텍스트 baseline 이 아니라 줄 중앙에 맞춘다 — SCheckbox 와 같은 규칙.
|
|
14061
|
+
// td 처럼 strut(셀 폰트의 줄 상자)이 라디오보다 큰 곳에서 위로 치우치지 않게 한다.
|
|
14062
|
+
"inline-flex items-center gap-(--cmp-radio-gap) align-middle",
|
|
13401
14063
|
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
13402
14064
|
className
|
|
13403
14065
|
),
|
|
@@ -13419,17 +14081,21 @@ function SRadio({
|
|
|
13419
14081
|
"span",
|
|
13420
14082
|
{
|
|
13421
14083
|
className: cn(
|
|
13422
|
-
"flex h-
|
|
13423
|
-
!disabled && !checked && "hover:border-
|
|
14084
|
+
"relative flex h-(--cmp-radio-size) w-(--cmp-radio-size) shrink-0 items-center justify-center rounded-(--cmp-radio-radius) border-(length:--cmp-radio-borderWidth) border-solid border-(--rd-border) bg-(--rd-bg)",
|
|
14085
|
+
!disabled && !checked && "hover:border-(--cmp-radio-border-hover) hover:bg-(--cmp-radio-bg-hover)"
|
|
13424
14086
|
),
|
|
13425
14087
|
style: {
|
|
13426
14088
|
"--rd-bg": disabled ? "var(--cmp-radio-bg-disabled)" : "var(--cmp-radio-bg-default)",
|
|
13427
14089
|
"--rd-border": disabled ? "var(--cmp-radio-border-disabled)" : checked ? "var(--cmp-radio-border-active)" : "var(--cmp-radio-border-default)"
|
|
13428
14090
|
},
|
|
13429
|
-
children: checked &&
|
|
14091
|
+
children: checked && // dot 은 반드시 flow 밖(absolute)에 둔다. in-flow 자식으로 넣으면 동그라미(flex 컨테이너)의
|
|
14092
|
+
// 합성 baseline 이 "border-box 하단"에서 "dot 하단"으로 옮겨가고, inline-flex 인 SRadio·
|
|
14093
|
+
// SRadioGroup 의 baseline 까지 따라 움직여 선택할 때마다 줄 상자가 3px 흔들린다
|
|
14094
|
+
// (SKeyValueTable 의 td 처럼 baseline 정렬되는 곳에서 눈에 띈다).
|
|
14095
|
+
/* @__PURE__ */ jsx(
|
|
13430
14096
|
"span",
|
|
13431
14097
|
{
|
|
13432
|
-
className: "h-
|
|
14098
|
+
className: "absolute top-1/2 left-1/2 h-(--cmp-radio-dot-size) w-(--cmp-radio-dot-size) -translate-x-1/2 -translate-y-1/2 rounded-(--cmp-radio-radius)",
|
|
13433
14099
|
style: {
|
|
13434
14100
|
background: disabled ? "var(--cmp-radio-dot-disabled)" : "var(--cmp-radio-dot-default)"
|
|
13435
14101
|
}
|
|
@@ -13440,13 +14106,20 @@ function SRadio({
|
|
|
13440
14106
|
label && /* @__PURE__ */ jsxs(
|
|
13441
14107
|
"span",
|
|
13442
14108
|
{
|
|
13443
|
-
className: "grid
|
|
14109
|
+
className: "grid",
|
|
13444
14110
|
style: {
|
|
13445
14111
|
color: disabled ? "var(--cmp-radio-label-disabled)" : "var(--cmp-radio-label-default)"
|
|
13446
14112
|
},
|
|
13447
14113
|
children: [
|
|
13448
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "
|
|
13449
|
-
/* @__PURE__ */ jsx(
|
|
14114
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "typo-body-sm-medium invisible", style: { gridArea: "1 / 1" }, children: label }),
|
|
14115
|
+
/* @__PURE__ */ jsx(
|
|
14116
|
+
"span",
|
|
14117
|
+
{
|
|
14118
|
+
className: checked ? "typo-body-sm-medium" : "typo-body-sm-default",
|
|
14119
|
+
style: { gridArea: "1 / 1" },
|
|
14120
|
+
children: label
|
|
14121
|
+
}
|
|
14122
|
+
)
|
|
13450
14123
|
]
|
|
13451
14124
|
}
|
|
13452
14125
|
)
|
|
@@ -13469,7 +14142,8 @@ function SRadioGroup({
|
|
|
13469
14142
|
{
|
|
13470
14143
|
role: "radiogroup",
|
|
13471
14144
|
className: cn(
|
|
13472
|
-
|
|
14145
|
+
// align-middle 은 SRadio 와 같은 이유 — inline 문맥(td 등)에서 줄 중앙에 맞춘다.
|
|
14146
|
+
"inline-flex align-middle",
|
|
13473
14147
|
direction === "vertical" ? "flex-col gap-[var(--cmp-radio-group-gap-vertical)]" : "flex-row gap-[var(--cmp-radio-group-gap-horizontal)]",
|
|
13474
14148
|
className
|
|
13475
14149
|
),
|
|
@@ -13705,7 +14379,7 @@ function SCalendar({
|
|
|
13705
14379
|
}) }),
|
|
13706
14380
|
legend.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13707
14381
|
/* @__PURE__ */ jsx(SDivider, {}),
|
|
13708
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-center gap-x-[var(--cmp-datepicker-calendar-legend-group-gap)] gap-y-[4px] text-[11px] leading-[18px]", children: legend.map((
|
|
14382
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-center gap-x-[var(--cmp-datepicker-calendar-legend-group-gap)] gap-y-[4px] text-[11px] leading-[18px]", children: legend.map((item4) => /* @__PURE__ */ jsxs(
|
|
13709
14383
|
"span",
|
|
13710
14384
|
{
|
|
13711
14385
|
className: "inline-flex items-center gap-[var(--cmp-datepicker-calendar-legend-gap)]",
|
|
@@ -13714,14 +14388,14 @@ function SCalendar({
|
|
|
13714
14388
|
"span",
|
|
13715
14389
|
{
|
|
13716
14390
|
className: "h-[var(--cmp-datepicker-calendar-day-dot-size)] w-[var(--cmp-datepicker-calendar-day-dot-size)] rounded-full",
|
|
13717
|
-
style: { backgroundColor: resolveColor(
|
|
14391
|
+
style: { backgroundColor: resolveColor(item4.color) },
|
|
13718
14392
|
"aria-hidden": true
|
|
13719
14393
|
}
|
|
13720
14394
|
),
|
|
13721
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
14395
|
+
/* @__PURE__ */ jsx("span", { children: item4.label })
|
|
13722
14396
|
]
|
|
13723
14397
|
},
|
|
13724
|
-
`${
|
|
14398
|
+
`${item4.color}|${item4.label}`
|
|
13725
14399
|
)) })
|
|
13726
14400
|
] })
|
|
13727
14401
|
]
|
|
@@ -16843,19 +17517,19 @@ function EditorToolbarBar({
|
|
|
16843
17517
|
closeLinkEditor();
|
|
16844
17518
|
};
|
|
16845
17519
|
const visible = [];
|
|
16846
|
-
for (const
|
|
16847
|
-
if (
|
|
16848
|
-
if (
|
|
16849
|
-
visible.push(
|
|
17520
|
+
for (const item4 of items) {
|
|
17521
|
+
if (item4 === "image" && !onImageUpload) continue;
|
|
17522
|
+
if (item4 === "|" && (visible.length === 0 || visible[visible.length - 1] === "|")) continue;
|
|
17523
|
+
visible.push(item4);
|
|
16850
17524
|
}
|
|
16851
17525
|
while (visible.length > 0 && visible[visible.length - 1] === "|") visible.pop();
|
|
16852
17526
|
const groups = [[]];
|
|
16853
|
-
for (const
|
|
16854
|
-
if (
|
|
16855
|
-
else groups[groups.length - 1].push(
|
|
17527
|
+
for (const item4 of visible) {
|
|
17528
|
+
if (item4 === "|") groups.push([]);
|
|
17529
|
+
else groups[groups.length - 1].push(item4);
|
|
16856
17530
|
}
|
|
16857
|
-
const node = (
|
|
16858
|
-
switch (
|
|
17531
|
+
const node = (item4) => {
|
|
17532
|
+
switch (item4) {
|
|
16859
17533
|
case "heading":
|
|
16860
17534
|
return /* @__PURE__ */ jsxs(RDropdown2.Root, { modal: !insideModal, children: [
|
|
16861
17535
|
/* @__PURE__ */ jsx(RDropdown2.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxs(
|
|
@@ -16890,7 +17564,7 @@ function EditorToolbarBar({
|
|
|
16890
17564
|
level
|
|
16891
17565
|
))
|
|
16892
17566
|
] }) })
|
|
16893
|
-
] },
|
|
17567
|
+
] }, item4);
|
|
16894
17568
|
case "fontSize":
|
|
16895
17569
|
return /* @__PURE__ */ jsxs(RDropdown2.Root, { modal: !insideModal, children: [
|
|
16896
17570
|
/* @__PURE__ */ jsx(RDropdown2.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsxs(ToolbarButton, { label: "\uAE00\uC790 \uD06C\uAE30", disabled: off, className: "px-[6px]", children: [
|
|
@@ -16929,7 +17603,7 @@ function EditorToolbarBar({
|
|
|
16929
17603
|
]
|
|
16930
17604
|
}
|
|
16931
17605
|
) })
|
|
16932
|
-
] },
|
|
17606
|
+
] }, item4);
|
|
16933
17607
|
case "bold":
|
|
16934
17608
|
return /* @__PURE__ */ jsx(
|
|
16935
17609
|
ToolbarButton,
|
|
@@ -16941,7 +17615,7 @@ function EditorToolbarBar({
|
|
|
16941
17615
|
onClick: () => chain()?.toggleBold().run(),
|
|
16942
17616
|
children: /* @__PURE__ */ jsx(IconBold, { size: ICON_SIZE })
|
|
16943
17617
|
},
|
|
16944
|
-
|
|
17618
|
+
item4
|
|
16945
17619
|
);
|
|
16946
17620
|
case "italic":
|
|
16947
17621
|
return /* @__PURE__ */ jsx(
|
|
@@ -16954,7 +17628,7 @@ function EditorToolbarBar({
|
|
|
16954
17628
|
onClick: () => chain()?.toggleItalic().run(),
|
|
16955
17629
|
children: /* @__PURE__ */ jsx(IconItalic, { size: ICON_SIZE })
|
|
16956
17630
|
},
|
|
16957
|
-
|
|
17631
|
+
item4
|
|
16958
17632
|
);
|
|
16959
17633
|
case "underline":
|
|
16960
17634
|
return /* @__PURE__ */ jsx(
|
|
@@ -16967,7 +17641,7 @@ function EditorToolbarBar({
|
|
|
16967
17641
|
onClick: () => chain()?.toggleUnderline().run(),
|
|
16968
17642
|
children: /* @__PURE__ */ jsx(IconUnderline, { size: ICON_SIZE })
|
|
16969
17643
|
},
|
|
16970
|
-
|
|
17644
|
+
item4
|
|
16971
17645
|
);
|
|
16972
17646
|
case "strike":
|
|
16973
17647
|
return /* @__PURE__ */ jsx(
|
|
@@ -16980,7 +17654,7 @@ function EditorToolbarBar({
|
|
|
16980
17654
|
onClick: () => chain()?.toggleStrike().run(),
|
|
16981
17655
|
children: /* @__PURE__ */ jsx(IconStrike, { size: ICON_SIZE })
|
|
16982
17656
|
},
|
|
16983
|
-
|
|
17657
|
+
item4
|
|
16984
17658
|
);
|
|
16985
17659
|
case "code":
|
|
16986
17660
|
return /* @__PURE__ */ jsx(
|
|
@@ -16993,7 +17667,7 @@ function EditorToolbarBar({
|
|
|
16993
17667
|
onClick: () => chain()?.toggleCode().run(),
|
|
16994
17668
|
children: /* @__PURE__ */ jsx(IconCode, { size: ICON_SIZE })
|
|
16995
17669
|
},
|
|
16996
|
-
|
|
17670
|
+
item4
|
|
16997
17671
|
);
|
|
16998
17672
|
case "color":
|
|
16999
17673
|
if (mobile)
|
|
@@ -17005,7 +17679,7 @@ function EditorToolbarBar({
|
|
|
17005
17679
|
onClick: () => setMobileView("color"),
|
|
17006
17680
|
children: /* @__PURE__ */ jsx(ColorIndicator, { color: off ? "currentColor" : activeColor, children: /* @__PURE__ */ jsx(IconTextColor, { size: ICON_SIZE }) })
|
|
17007
17681
|
},
|
|
17008
|
-
|
|
17682
|
+
item4
|
|
17009
17683
|
);
|
|
17010
17684
|
return /* @__PURE__ */ jsxs(RDropdown2.Root, { modal: !insideModal, children: [
|
|
17011
17685
|
/* @__PURE__ */ jsx(RDropdown2.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsx(ToolbarButton, { label: "\uAE00\uC790\uC0C9", disabled: off, children: /* @__PURE__ */ jsx(ColorIndicator, { color: off ? "currentColor" : activeColor, children: /* @__PURE__ */ jsx(IconTextColor, { size: ICON_SIZE }) }) }) }),
|
|
@@ -17020,7 +17694,7 @@ function EditorToolbarBar({
|
|
|
17020
17694
|
onClear: clearColor
|
|
17021
17695
|
}
|
|
17022
17696
|
) }) })
|
|
17023
|
-
] },
|
|
17697
|
+
] }, item4);
|
|
17024
17698
|
case "alignLeft":
|
|
17025
17699
|
return /* @__PURE__ */ jsx(
|
|
17026
17700
|
ToolbarButton,
|
|
@@ -17032,7 +17706,7 @@ function EditorToolbarBar({
|
|
|
17032
17706
|
onClick: () => chain()?.setTextAlign("left").run(),
|
|
17033
17707
|
children: /* @__PURE__ */ jsx(IconAlignLeft, { size: ICON_SIZE })
|
|
17034
17708
|
},
|
|
17035
|
-
|
|
17709
|
+
item4
|
|
17036
17710
|
);
|
|
17037
17711
|
case "alignCenter":
|
|
17038
17712
|
return /* @__PURE__ */ jsx(
|
|
@@ -17045,7 +17719,7 @@ function EditorToolbarBar({
|
|
|
17045
17719
|
onClick: () => chain()?.setTextAlign("center").run(),
|
|
17046
17720
|
children: /* @__PURE__ */ jsx(IconAlignCenter, { size: ICON_SIZE })
|
|
17047
17721
|
},
|
|
17048
|
-
|
|
17722
|
+
item4
|
|
17049
17723
|
);
|
|
17050
17724
|
case "alignRight":
|
|
17051
17725
|
return /* @__PURE__ */ jsx(
|
|
@@ -17058,7 +17732,7 @@ function EditorToolbarBar({
|
|
|
17058
17732
|
onClick: () => chain()?.setTextAlign("right").run(),
|
|
17059
17733
|
children: /* @__PURE__ */ jsx(IconAlignRight, { size: ICON_SIZE })
|
|
17060
17734
|
},
|
|
17061
|
-
|
|
17735
|
+
item4
|
|
17062
17736
|
);
|
|
17063
17737
|
case "alignJustify":
|
|
17064
17738
|
return /* @__PURE__ */ jsx(
|
|
@@ -17071,7 +17745,7 @@ function EditorToolbarBar({
|
|
|
17071
17745
|
onClick: () => chain()?.setTextAlign("justify").run(),
|
|
17072
17746
|
children: /* @__PURE__ */ jsx(IconAlignJustify, { size: ICON_SIZE })
|
|
17073
17747
|
},
|
|
17074
|
-
|
|
17748
|
+
item4
|
|
17075
17749
|
);
|
|
17076
17750
|
case "bulletList":
|
|
17077
17751
|
return /* @__PURE__ */ jsx(
|
|
@@ -17084,7 +17758,7 @@ function EditorToolbarBar({
|
|
|
17084
17758
|
onClick: () => chain()?.toggleBulletList().run(),
|
|
17085
17759
|
children: /* @__PURE__ */ jsx(IconBulletList, { size: ICON_SIZE })
|
|
17086
17760
|
},
|
|
17087
|
-
|
|
17761
|
+
item4
|
|
17088
17762
|
);
|
|
17089
17763
|
case "orderedList":
|
|
17090
17764
|
return /* @__PURE__ */ jsx(
|
|
@@ -17097,7 +17771,7 @@ function EditorToolbarBar({
|
|
|
17097
17771
|
onClick: () => chain()?.toggleOrderedList().run(),
|
|
17098
17772
|
children: /* @__PURE__ */ jsx(IconOrderedList, { size: ICON_SIZE })
|
|
17099
17773
|
},
|
|
17100
|
-
|
|
17774
|
+
item4
|
|
17101
17775
|
);
|
|
17102
17776
|
case "taskList":
|
|
17103
17777
|
return /* @__PURE__ */ jsx(
|
|
@@ -17110,7 +17784,7 @@ function EditorToolbarBar({
|
|
|
17110
17784
|
onClick: () => chain()?.toggleTaskList().run(),
|
|
17111
17785
|
children: /* @__PURE__ */ jsx(IconTaskList, { size: ICON_SIZE })
|
|
17112
17786
|
},
|
|
17113
|
-
|
|
17787
|
+
item4
|
|
17114
17788
|
);
|
|
17115
17789
|
case "list": {
|
|
17116
17790
|
const ListIcon = state2.orderedList ? IconOrderedList : state2.taskList ? IconTaskList : IconBulletList;
|
|
@@ -17155,7 +17829,7 @@ function EditorToolbarBar({
|
|
|
17155
17829
|
}
|
|
17156
17830
|
)
|
|
17157
17831
|
] }) })
|
|
17158
|
-
] },
|
|
17832
|
+
] }, item4);
|
|
17159
17833
|
}
|
|
17160
17834
|
case "blockquote":
|
|
17161
17835
|
return /* @__PURE__ */ jsx(
|
|
@@ -17168,7 +17842,7 @@ function EditorToolbarBar({
|
|
|
17168
17842
|
onClick: () => chain()?.toggleBlockquote().run(),
|
|
17169
17843
|
children: /* @__PURE__ */ jsx(IconBlockquote, { size: ICON_SIZE })
|
|
17170
17844
|
},
|
|
17171
|
-
|
|
17845
|
+
item4
|
|
17172
17846
|
);
|
|
17173
17847
|
case "codeBlock":
|
|
17174
17848
|
return /* @__PURE__ */ jsx(
|
|
@@ -17181,7 +17855,7 @@ function EditorToolbarBar({
|
|
|
17181
17855
|
onClick: () => chain()?.toggleCodeBlock().run(),
|
|
17182
17856
|
children: /* @__PURE__ */ jsx(IconCodeBlock, { size: ICON_SIZE })
|
|
17183
17857
|
},
|
|
17184
|
-
|
|
17858
|
+
item4
|
|
17185
17859
|
);
|
|
17186
17860
|
case "horizontalRule":
|
|
17187
17861
|
return /* @__PURE__ */ jsx(
|
|
@@ -17192,7 +17866,7 @@ function EditorToolbarBar({
|
|
|
17192
17866
|
onClick: () => chain()?.setHorizontalRule().run(),
|
|
17193
17867
|
children: /* @__PURE__ */ jsx(IconHorizontalRule, { size: ICON_SIZE })
|
|
17194
17868
|
},
|
|
17195
|
-
|
|
17869
|
+
item4
|
|
17196
17870
|
);
|
|
17197
17871
|
case "link":
|
|
17198
17872
|
if (mobile)
|
|
@@ -17205,7 +17879,7 @@ function EditorToolbarBar({
|
|
|
17205
17879
|
onClick: () => setMobileView("link"),
|
|
17206
17880
|
children: /* @__PURE__ */ jsx(IconLink, { size: ICON_SIZE })
|
|
17207
17881
|
},
|
|
17208
|
-
|
|
17882
|
+
item4
|
|
17209
17883
|
);
|
|
17210
17884
|
return /* @__PURE__ */ jsxs(RPopover11.Root, { open: linkOpen, onOpenChange: setLinkOpen, children: [
|
|
17211
17885
|
/* @__PURE__ */ jsx(RPopover11.Trigger, { asChild: true, disabled: off, children: /* @__PURE__ */ jsx(ToolbarButton, { label: "\uB9C1\uD06C", active: state2.link, disabled: off, children: /* @__PURE__ */ jsx(IconLink, { size: ICON_SIZE }) }) }),
|
|
@@ -17230,7 +17904,7 @@ function EditorToolbarBar({
|
|
|
17230
17904
|
)
|
|
17231
17905
|
}
|
|
17232
17906
|
) })
|
|
17233
|
-
] },
|
|
17907
|
+
] }, item4);
|
|
17234
17908
|
case "image":
|
|
17235
17909
|
return /* @__PURE__ */ jsxs(
|
|
17236
17910
|
ToolbarButton,
|
|
@@ -17244,7 +17918,7 @@ function EditorToolbarBar({
|
|
|
17244
17918
|
/* @__PURE__ */ jsx("span", { className: "text-[12px] leading-[20px]", children: "\uC774\uBBF8\uC9C0" })
|
|
17245
17919
|
]
|
|
17246
17920
|
},
|
|
17247
|
-
|
|
17921
|
+
item4
|
|
17248
17922
|
);
|
|
17249
17923
|
case "table":
|
|
17250
17924
|
return /* @__PURE__ */ jsxs(
|
|
@@ -17365,7 +18039,7 @@ function EditorToolbarBar({
|
|
|
17365
18039
|
] }) })
|
|
17366
18040
|
]
|
|
17367
18041
|
},
|
|
17368
|
-
|
|
18042
|
+
item4
|
|
17369
18043
|
);
|
|
17370
18044
|
case "undo":
|
|
17371
18045
|
return /* @__PURE__ */ jsx(
|
|
@@ -17376,7 +18050,7 @@ function EditorToolbarBar({
|
|
|
17376
18050
|
onClick: () => chain()?.undo().run(),
|
|
17377
18051
|
children: /* @__PURE__ */ jsx(IconUndo, { size: ICON_SIZE })
|
|
17378
18052
|
},
|
|
17379
|
-
|
|
18053
|
+
item4
|
|
17380
18054
|
);
|
|
17381
18055
|
case "redo":
|
|
17382
18056
|
return /* @__PURE__ */ jsx(
|
|
@@ -17387,7 +18061,7 @@ function EditorToolbarBar({
|
|
|
17387
18061
|
onClick: () => chain()?.redo().run(),
|
|
17388
18062
|
children: /* @__PURE__ */ jsx(IconRedo, { size: ICON_SIZE })
|
|
17389
18063
|
},
|
|
17390
|
-
|
|
18064
|
+
item4
|
|
17391
18065
|
);
|
|
17392
18066
|
default:
|
|
17393
18067
|
return null;
|
|
@@ -17968,6 +18642,13 @@ var keywordEntries = (value) => {
|
|
|
17968
18642
|
}
|
|
17969
18643
|
return [];
|
|
17970
18644
|
};
|
|
18645
|
+
var CSV_PASTE_SEPARATOR = /[,\r\n\t]+/;
|
|
18646
|
+
var newKeywordEntries = (entries3, candidates) => candidates.reduce((acc, raw) => {
|
|
18647
|
+
const next = raw.trim();
|
|
18648
|
+
if (next === "" || entries3.includes(next) || acc.includes(next)) return acc;
|
|
18649
|
+
return [...acc, next];
|
|
18650
|
+
}, []);
|
|
18651
|
+
var withKeywordEntries = (field, current, nextEntries) => field.matchModes ? { keywords: nextEntries, mode: isKeywordValue(current) ? current.mode : "contains" } : nextEntries;
|
|
17971
18652
|
var isEmptyValue = (value) => {
|
|
17972
18653
|
if (value == null) return true;
|
|
17973
18654
|
if (Array.isArray(value)) return value.length === 0 || value.every((v) => v == null || v === "");
|
|
@@ -18018,8 +18699,18 @@ var createPeriodValue = (unit, maxRange) => ({
|
|
|
18018
18699
|
unit,
|
|
18019
18700
|
value: getDefaultPeriodInputValue(unit, maxRange)
|
|
18020
18701
|
});
|
|
18702
|
+
var singleOptionValue = (field) => {
|
|
18703
|
+
if (field.type !== "select" && field.type !== "select-multi") return void 0;
|
|
18704
|
+
const options = field.options ?? [];
|
|
18705
|
+
if (options.length !== 1 || options[0].disabled === true) return void 0;
|
|
18706
|
+
return options[0].value;
|
|
18707
|
+
};
|
|
18021
18708
|
var resolveFieldDefault = (field) => {
|
|
18022
18709
|
if (field.defaultValue !== void 0 && isFixedField(field)) return field.defaultValue;
|
|
18710
|
+
if (isFixedField(field)) {
|
|
18711
|
+
const only = singleOptionValue(field);
|
|
18712
|
+
if (only !== void 0) return field.type === "select-multi" ? [only] : only;
|
|
18713
|
+
}
|
|
18023
18714
|
if (field.type === "datepicker-range") {
|
|
18024
18715
|
if (!isInlineDateField(field) && !field.required) return void 0;
|
|
18025
18716
|
const today = todayIso();
|
|
@@ -18118,7 +18809,7 @@ var displayValue = (field, value) => {
|
|
|
18118
18809
|
if (field.type === "select-multi") {
|
|
18119
18810
|
const values = toArrayValue(value);
|
|
18120
18811
|
const selectableValues = (field.options ?? []).filter((option) => !option.disabled).map((option) => option.value);
|
|
18121
|
-
if (selectableValues.length >
|
|
18812
|
+
if (selectableValues.length > 1 && selectableValues.every((selectableValue) => values.includes(selectableValue))) {
|
|
18122
18813
|
return "\uC804\uCCB4";
|
|
18123
18814
|
}
|
|
18124
18815
|
return formatValueList(values.map((v) => optionLabel(field, v)));
|
|
@@ -18182,7 +18873,7 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
|
|
|
18182
18873
|
const prevOpenKeyRef = useRef(null);
|
|
18183
18874
|
const valuesRef = useRef(values);
|
|
18184
18875
|
valuesRef.current = values;
|
|
18185
|
-
const lastSearchedValuesRef = useRef(
|
|
18876
|
+
const lastSearchedValuesRef = useRef(null);
|
|
18186
18877
|
const invalidGroups = useMemo(() => {
|
|
18187
18878
|
const invalid = /* @__PURE__ */ new Set();
|
|
18188
18879
|
groups.forEach((group, groupIndex) => {
|
|
@@ -18200,7 +18891,8 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
|
|
|
18200
18891
|
);
|
|
18201
18892
|
const runSearch = useCallback(
|
|
18202
18893
|
(next) => {
|
|
18203
|
-
|
|
18894
|
+
const last = lastSearchedValuesRef.current;
|
|
18895
|
+
if (last != null && valuesMapEqual(last, next)) return;
|
|
18204
18896
|
if (!isGroupsValid(next)) return;
|
|
18205
18897
|
if (!isRequiredSatisfied(next)) return;
|
|
18206
18898
|
lastSearchedValuesRef.current = next;
|
|
@@ -18208,13 +18900,36 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
|
|
|
18208
18900
|
},
|
|
18209
18901
|
[isGroupsValid, isRequiredSatisfied, onSearch]
|
|
18210
18902
|
);
|
|
18903
|
+
const keywordDraftRef = useRef(null);
|
|
18904
|
+
const commitKeywordDraft = useCallback(
|
|
18905
|
+
(key) => {
|
|
18906
|
+
const draft = keywordDraftRef.current;
|
|
18907
|
+
keywordDraftRef.current = null;
|
|
18908
|
+
if (draft == null || draft.key !== key) return null;
|
|
18909
|
+
const field = fields.find((f) => f.key === key);
|
|
18910
|
+
if (field == null || field.type !== "keyword" || disabled || field.disabled) return null;
|
|
18911
|
+
const current = valuesRef.current[key];
|
|
18912
|
+
const entries3 = keywordEntries(current);
|
|
18913
|
+
const added = newKeywordEntries(
|
|
18914
|
+
entries3,
|
|
18915
|
+
field.input === "csv" ? draft.text.split(CSV_PASTE_SEPARATOR) : [draft.text]
|
|
18916
|
+
);
|
|
18917
|
+
if (added.length === 0) return null;
|
|
18918
|
+
const nextValue = withKeywordEntries(field, current, [...entries3, ...added]);
|
|
18919
|
+
const next = { ...valuesRef.current, [key]: nextValue };
|
|
18920
|
+
onValueChange?.(next);
|
|
18921
|
+
onFilterChange?.({ key, value: nextValue, values: next });
|
|
18922
|
+
return next;
|
|
18923
|
+
},
|
|
18924
|
+
[disabled, fields, onFilterChange, onValueChange]
|
|
18925
|
+
);
|
|
18211
18926
|
useEffect(() => {
|
|
18212
18927
|
const prevKey = prevOpenKeyRef.current;
|
|
18213
18928
|
if (prevKey != null && prevKey !== openKey) {
|
|
18214
|
-
runSearch(valuesRef.current);
|
|
18929
|
+
runSearch(commitKeywordDraft(prevKey) ?? valuesRef.current);
|
|
18215
18930
|
}
|
|
18216
18931
|
prevOpenKeyRef.current = openKey;
|
|
18217
|
-
}, [openKey, runSearch]);
|
|
18932
|
+
}, [commitKeywordDraft, openKey, runSearch]);
|
|
18218
18933
|
useEffect(() => {
|
|
18219
18934
|
fields.forEach((field) => {
|
|
18220
18935
|
if (isEmptyValue(values[field.key])) dismissedRef.current.delete(field.key);
|
|
@@ -18313,6 +19028,7 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
|
|
|
18313
19028
|
runSearch(emitValue(key, def !== void 0 ? def : null));
|
|
18314
19029
|
};
|
|
18315
19030
|
const removeField = (key) => {
|
|
19031
|
+
keywordDraftRef.current = null;
|
|
18316
19032
|
const nextValues = emitValue(key, null);
|
|
18317
19033
|
dismissedRef.current.add(key);
|
|
18318
19034
|
setInternalActiveKeys((current) => current.filter((activeKey) => activeKey !== key));
|
|
@@ -18325,6 +19041,7 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
|
|
|
18325
19041
|
return acc;
|
|
18326
19042
|
}, {});
|
|
18327
19043
|
dismissedRef.current.clear();
|
|
19044
|
+
keywordDraftRef.current = null;
|
|
18328
19045
|
setInternalActiveKeys(fields.filter(isFixedField).map((field) => field.key));
|
|
18329
19046
|
setOpenKey(null);
|
|
18330
19047
|
onValueChange?.(next);
|
|
@@ -18592,6 +19309,9 @@ var SChipFilter = /* @__PURE__ */ forwardRef(function SChipFilter2({
|
|
|
18592
19309
|
disabled: disabled || currentOpenField.disabled,
|
|
18593
19310
|
onValueChange: (next) => emitValue(currentOpenField.key, next),
|
|
18594
19311
|
onValueCommit: (next) => emitValueAndSearch(currentOpenField.key, next),
|
|
19312
|
+
onDraftChange: (text) => {
|
|
19313
|
+
keywordDraftRef.current = text.trim() === "" ? null : { key: currentOpenField.key, text };
|
|
19314
|
+
},
|
|
18595
19315
|
onClose: () => setOpenKey(null)
|
|
18596
19316
|
}
|
|
18597
19317
|
)
|
|
@@ -18743,6 +19463,7 @@ function EditorPanel({
|
|
|
18743
19463
|
disabled,
|
|
18744
19464
|
onValueChange,
|
|
18745
19465
|
onValueCommit,
|
|
19466
|
+
onDraftChange,
|
|
18746
19467
|
onClose
|
|
18747
19468
|
}) {
|
|
18748
19469
|
const wrapsInPaddedTop = field.type === "datepicker-day" || field.type === "datepicker-range" || field.type === "datepicker-statistics";
|
|
@@ -18764,7 +19485,8 @@ function EditorPanel({
|
|
|
18764
19485
|
value,
|
|
18765
19486
|
disabled,
|
|
18766
19487
|
onValueChange,
|
|
18767
|
-
onValueCommit
|
|
19488
|
+
onValueCommit,
|
|
19489
|
+
onDraftChange
|
|
18768
19490
|
}
|
|
18769
19491
|
) }) : /* @__PURE__ */ jsx(
|
|
18770
19492
|
FilterEditor,
|
|
@@ -18773,7 +19495,8 @@ function EditorPanel({
|
|
|
18773
19495
|
value,
|
|
18774
19496
|
disabled,
|
|
18775
19497
|
onValueChange,
|
|
18776
|
-
onValueCommit
|
|
19498
|
+
onValueCommit,
|
|
19499
|
+
onDraftChange
|
|
18777
19500
|
}
|
|
18778
19501
|
),
|
|
18779
19502
|
/* @__PURE__ */ jsxs(
|
|
@@ -18826,7 +19549,8 @@ function FilterEditor({
|
|
|
18826
19549
|
value,
|
|
18827
19550
|
disabled,
|
|
18828
19551
|
onValueChange,
|
|
18829
|
-
onValueCommit
|
|
19552
|
+
onValueCommit,
|
|
19553
|
+
onDraftChange
|
|
18830
19554
|
}) {
|
|
18831
19555
|
if (field.type === "datepicker-statistics") {
|
|
18832
19556
|
return /* @__PURE__ */ jsx(
|
|
@@ -18872,7 +19596,8 @@ function FilterEditor({
|
|
|
18872
19596
|
value: isKeywordValue(value) ? value : keywordEntries(value),
|
|
18873
19597
|
disabled,
|
|
18874
19598
|
onValueChange,
|
|
18875
|
-
onValueCommit
|
|
19599
|
+
onValueCommit,
|
|
19600
|
+
onDraftChange
|
|
18876
19601
|
}
|
|
18877
19602
|
);
|
|
18878
19603
|
}
|
|
@@ -19195,7 +19920,6 @@ function InlineDatePresetFilter({
|
|
|
19195
19920
|
) : badge)
|
|
19196
19921
|
] });
|
|
19197
19922
|
}
|
|
19198
|
-
var CSV_PASTE_SEPARATOR = /[,\r\n\t]+/;
|
|
19199
19923
|
var MATCH_MODE_OPTIONS = [
|
|
19200
19924
|
{ value: "contains", label: "\uD3EC\uD568" },
|
|
19201
19925
|
{ value: "exact", label: "\uC77C\uCE58" }
|
|
@@ -19209,14 +19933,19 @@ function KeywordEditor({
|
|
|
19209
19933
|
value,
|
|
19210
19934
|
disabled,
|
|
19211
19935
|
onValueChange,
|
|
19212
|
-
onValueCommit
|
|
19936
|
+
onValueCommit,
|
|
19937
|
+
onDraftChange
|
|
19213
19938
|
}) {
|
|
19214
19939
|
const entries3 = keywordEntries(value);
|
|
19215
|
-
const [
|
|
19940
|
+
const [draftText, setDraftText] = useState("");
|
|
19216
19941
|
const [mode, setMode] = useState(
|
|
19217
19942
|
isKeywordValue(value) ? value.mode : "contains"
|
|
19218
19943
|
);
|
|
19219
19944
|
const inputRef = useRef(null);
|
|
19945
|
+
const setDraft = (next) => {
|
|
19946
|
+
setDraftText(next);
|
|
19947
|
+
onDraftChange(next);
|
|
19948
|
+
};
|
|
19220
19949
|
useEffect(() => {
|
|
19221
19950
|
if (disabled) return;
|
|
19222
19951
|
inputRef.current?.focus();
|
|
@@ -19231,11 +19960,7 @@ function KeywordEditor({
|
|
|
19231
19960
|
setMode(next);
|
|
19232
19961
|
emit3(entries3, next);
|
|
19233
19962
|
};
|
|
19234
|
-
const newEntries = (candidates) =>
|
|
19235
|
-
const next = raw.trim();
|
|
19236
|
-
if (next === "" || entries3.includes(next) || acc.includes(next)) return acc;
|
|
19237
|
-
return [...acc, next];
|
|
19238
|
-
}, []);
|
|
19963
|
+
const newEntries = (candidates) => newKeywordEntries(entries3, candidates);
|
|
19239
19964
|
const addEntry = (raw) => {
|
|
19240
19965
|
const added = newEntries([raw]);
|
|
19241
19966
|
if (added.length === 0) {
|
|
@@ -19261,7 +19986,7 @@ function KeywordEditor({
|
|
|
19261
19986
|
const text = event.clipboardData.getData("text");
|
|
19262
19987
|
if (!CSV_PASTE_SEPARATOR.test(text)) return;
|
|
19263
19988
|
event.preventDefault();
|
|
19264
|
-
const added = newEntries((
|
|
19989
|
+
const added = newEntries((draftText + text).split(CSV_PASTE_SEPARATOR));
|
|
19265
19990
|
if (added.length > 0) commit([...entries3, ...added]);
|
|
19266
19991
|
setDraft("");
|
|
19267
19992
|
};
|
|
@@ -19272,7 +19997,7 @@ function KeywordEditor({
|
|
|
19272
19997
|
if (event.key === "Enter") {
|
|
19273
19998
|
if (event.nativeEvent.isComposing) return;
|
|
19274
19999
|
event.preventDefault();
|
|
19275
|
-
addEntry(
|
|
20000
|
+
addEntry(draftText);
|
|
19276
20001
|
}
|
|
19277
20002
|
};
|
|
19278
20003
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -19304,7 +20029,7 @@ function KeywordEditor({
|
|
|
19304
20029
|
"input",
|
|
19305
20030
|
{
|
|
19306
20031
|
ref: inputRef,
|
|
19307
|
-
value:
|
|
20032
|
+
value: draftText,
|
|
19308
20033
|
disabled,
|
|
19309
20034
|
placeholder: field.placeholder ?? (field.input === "csv" ? "\uB2E4\uC911 \uD0A4\uC6CC\uB4DC\uB294 \uCF64\uB9C8(,)\uB85C \uAD6C\uBD84" : "\uC785\uB825 \uD6C4 Enter\uB85C \uCD94\uAC00"),
|
|
19310
20035
|
onChange: (event) => changeDraft(event.target.value),
|
|
@@ -19907,8 +20632,8 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
19907
20632
|
onMouseDown: (e) => e.preventDefault(),
|
|
19908
20633
|
children: [
|
|
19909
20634
|
loading2 && /* @__PURE__ */ jsx("div", { className: "s-chip-input__suggestions-empty p-sd-12 text-center text-12 leading-sd-20 text-(--color-grey-65)", children: "\uBD88\uB7EC\uC624\uB294 \uC911..." }),
|
|
19910
|
-
!effectiveAutocomplete ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-sd-8 px-sd-12 py-sd-6", children: items.map((
|
|
19911
|
-
const selected = values.includes(
|
|
20635
|
+
!effectiveAutocomplete ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-sd-8 px-sd-12 py-sd-6", children: items.map((item4, i) => {
|
|
20636
|
+
const selected = values.includes(item4);
|
|
19912
20637
|
const active = i === activeIndex && !selected;
|
|
19913
20638
|
return /* @__PURE__ */ jsx(
|
|
19914
20639
|
"div",
|
|
@@ -19919,14 +20644,14 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
19919
20644
|
style: active ? { outline: "2px solid var(--color-border-accent)", outlineOffset: 1 } : void 0,
|
|
19920
20645
|
onMouseDown: (e) => {
|
|
19921
20646
|
e.preventDefault();
|
|
19922
|
-
if (!selected) addChip(
|
|
20647
|
+
if (!selected) addChip(item4);
|
|
19923
20648
|
},
|
|
19924
|
-
children: /* @__PURE__ */ jsx(SChip2, { value:
|
|
20649
|
+
children: /* @__PURE__ */ jsx(SChip2, { value: item4, disabled: selected, editable: false, showRemove: false })
|
|
19925
20650
|
},
|
|
19926
|
-
|
|
20651
|
+
item4
|
|
19927
20652
|
);
|
|
19928
|
-
}) }) : items.map((
|
|
19929
|
-
const selected = values.includes(
|
|
20653
|
+
}) }) : items.map((item4, i) => {
|
|
20654
|
+
const selected = values.includes(item4);
|
|
19930
20655
|
const active = i === activeIndex && !selected;
|
|
19931
20656
|
return /* @__PURE__ */ jsxs(
|
|
19932
20657
|
"div",
|
|
@@ -19939,10 +20664,10 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
19939
20664
|
),
|
|
19940
20665
|
onMouseDown: (e) => {
|
|
19941
20666
|
e.preventDefault();
|
|
19942
|
-
if (!selected) addChip(
|
|
20667
|
+
if (!selected) addChip(item4);
|
|
19943
20668
|
},
|
|
19944
20669
|
children: [
|
|
19945
|
-
/* @__PURE__ */ jsx("span", { className: "flex-1", children:
|
|
20670
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1", children: item4 }),
|
|
19946
20671
|
selected && /* @__PURE__ */ jsx(
|
|
19947
20672
|
SIcon,
|
|
19948
20673
|
{
|
|
@@ -19953,7 +20678,7 @@ var SChipInput = /* @__PURE__ */ forwardRef(function SChipInput2({
|
|
|
19953
20678
|
)
|
|
19954
20679
|
]
|
|
19955
20680
|
},
|
|
19956
|
-
|
|
20681
|
+
item4
|
|
19957
20682
|
);
|
|
19958
20683
|
})
|
|
19959
20684
|
]
|
|
@@ -20337,22 +21062,22 @@ function TimeSelector({
|
|
|
20337
21062
|
style: {
|
|
20338
21063
|
padding: "var(--cmp-timepicker-selector-section-paddingY) var(--cmp-timepicker-selector-section-paddingX)"
|
|
20339
21064
|
},
|
|
20340
|
-
children: /* @__PURE__ */ jsx("div", { className: "isolate flex", children: ["AM", "PM"].map((
|
|
20341
|
-
const selected =
|
|
21065
|
+
children: /* @__PURE__ */ jsx("div", { className: "isolate flex", children: ["AM", "PM"].map((item4, index) => {
|
|
21066
|
+
const selected = item4 === meridiem;
|
|
20342
21067
|
return /* @__PURE__ */ jsx(
|
|
20343
21068
|
"button",
|
|
20344
21069
|
{
|
|
20345
21070
|
type: "button",
|
|
20346
|
-
onClick: () => setMeridiem(
|
|
21071
|
+
onClick: () => setMeridiem(item4),
|
|
20347
21072
|
className: cn(
|
|
20348
21073
|
"box-border h-[var(--cmp-textinput-sm-height)] w-[61px] cursor-pointer border border-solid bg-white text-center text-[12px] font-medium leading-[20px]",
|
|
20349
21074
|
index === 0 ? "rounded-l-[var(--cmp-select-sm-radius)]" : "rounded-r-[var(--cmp-select-sm-radius)]",
|
|
20350
21075
|
index === 0 ? "-mr-px" : "",
|
|
20351
21076
|
selected ? "z-[1] border-[var(--cmp-timepicker-border-focus)] text-[var(--cmp-timepicker-border-focus)]" : "border-[var(--cmp-timepicker-border-default)] text-[var(--cmp-field-hint-color)]"
|
|
20352
21077
|
),
|
|
20353
|
-
children:
|
|
21078
|
+
children: item4 === "AM" ? "\uC624\uC804" : "\uC624\uD6C4"
|
|
20354
21079
|
},
|
|
20355
|
-
|
|
21080
|
+
item4
|
|
20356
21081
|
);
|
|
20357
21082
|
}) })
|
|
20358
21083
|
}
|
|
@@ -20573,8 +21298,8 @@ function getTimeMinutes(value) {
|
|
|
20573
21298
|
}
|
|
20574
21299
|
function normalizeTimeRangeValue(value, rangeOrder = "strict") {
|
|
20575
21300
|
if (value == null) return null;
|
|
20576
|
-
const normalized = value.map((
|
|
20577
|
-
const parsed = parseTimeValue(
|
|
21301
|
+
const normalized = value.map((item4) => {
|
|
21302
|
+
const parsed = parseTimeValue(item4);
|
|
20578
21303
|
return formatTimeValue(parsed.hour, parsed.minute);
|
|
20579
21304
|
});
|
|
20580
21305
|
if (rangeOrder === "strict" && getTimeMinutes(normalized[0]) > getTimeMinutes(normalized[1])) {
|
|
@@ -20784,21 +21509,21 @@ function RangeTimeSelector({
|
|
|
20784
21509
|
style: { gap: "var(--cmp-timepicker-selector-range-heading-gap)" },
|
|
20785
21510
|
children: [
|
|
20786
21511
|
/* @__PURE__ */ jsx("div", { className: "whitespace-nowrap text-center text-[12px] font-bold leading-[20px] text-[var(--cmp-timepicker-selector-range-heading-color)]", children: title }),
|
|
20787
|
-
useMeridiem && /* @__PURE__ */ jsx("div", { className: "isolate flex", children: ["AM", "PM"].map((
|
|
20788
|
-
const selected =
|
|
21512
|
+
useMeridiem && /* @__PURE__ */ jsx("div", { className: "isolate flex", children: ["AM", "PM"].map((item4, index) => {
|
|
21513
|
+
const selected = item4 === getMeridiem(side);
|
|
20789
21514
|
return /* @__PURE__ */ jsx(
|
|
20790
21515
|
"button",
|
|
20791
21516
|
{
|
|
20792
21517
|
type: "button",
|
|
20793
|
-
onClick: () => setMeridiem(side,
|
|
21518
|
+
onClick: () => setMeridiem(side, item4),
|
|
20794
21519
|
className: cn(
|
|
20795
21520
|
"box-border h-[var(--cmp-textinput-sm-height)] w-[61px] cursor-pointer border border-solid bg-white text-center text-[12px] font-medium leading-[20px]",
|
|
20796
21521
|
index === 0 ? "rounded-l-[var(--cmp-select-sm-radius)] -mr-px" : "rounded-r-[var(--cmp-select-sm-radius)]",
|
|
20797
21522
|
selected ? "z-[1] border-[var(--cmp-timepicker-border-focus)] text-[var(--cmp-timepicker-border-focus)]" : "border-[var(--cmp-timepicker-border-default)] text-[var(--cmp-field-hint-color)]"
|
|
20798
21523
|
),
|
|
20799
|
-
children:
|
|
21524
|
+
children: item4 === "AM" ? "\uC624\uC804" : "\uC624\uD6C4"
|
|
20800
21525
|
},
|
|
20801
|
-
|
|
21526
|
+
item4
|
|
20802
21527
|
);
|
|
20803
21528
|
}) })
|
|
20804
21529
|
]
|
|
@@ -21034,6 +21759,6 @@ function STimeRangePicker({
|
|
|
21034
21759
|
);
|
|
21035
21760
|
}
|
|
21036
21761
|
|
|
21037
|
-
export { BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, COLOR_KEYS, FIELD_WIDTH_GRADES, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_FULL_LOGO_WIDTH, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, GNB_SYSTEM_COLORS, GNB_SYSTEM_COLOR_CONFIG, GNB_SYSTEM_LAYOUT, ICONS, IMAGE_FITS, PAGE_BACKGROUNDS, PAGE_CONTENT_HEIGHTS, RangeCalendar, SActionModal, SBadge, SBarcodeInput, SButton, SCROLL_AREA_AXES, SCalendar, SCallout, SCard, SCheckbox, SChip2 as SChip, SChipFilter, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDatePickerMonthListbox, SDatePickerYearListbox, SDateRangePicker, SDivider, SDraggableGroup, SDraggableItem2 as SDraggableItem, SDraggableList, SDraggableProvider, SDrawer, SDropdownButton2 as SDropdownButton, SEDITOR_DEFAULT_FONT_SIZE, SEDITOR_HEADING_LABELS, SEDITOR_HEADING_LEVELS, SEditor, SExpansionItem, SExpansionList2 as SExpansionList, SField, SFilePicker, SForm, SGhostButton, SGnb, SGnbSystem, SGnbSystemContext, SGuide, SIcon, SImage, SInput, SKeyValueTable, SLAYOUT_MIN_WIDTH, SLayout, SLayoutContext, SLinearProgress, SList2 as SList, SListItem2 as SListItem, SLoadingContainer, SLoadingModal, SLoadingViewport, SModal, SModalOutlet, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioCard, SRadioCardGroup, SRadioGroup, SSPLITTER_UNITS, SScrollArea, SSearchInput, SSectionHeaderCard2 as SSectionHeaderCard, SSelect2 as SSelect, SSplitter2 as SSplitter, SStepper, SSwitch, SSystemActionButton, STEPPER_SIZES, STable, STableBar, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip2 as STooltip, STree2 as STree, STreeItem2 as STreeItem, SYSTEM_ACTION_BUTTON_COLORS, SYSTEM_ACTION_BUTTON_COLOR_CONFIG, SYSTEM_ACTION_BUTTON_LAYOUT, SYSTEM_ACTION_BUTTON_TYPES, SYSTEM_ACTION_BUTTON_TYPE_CONFIG, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, fieldWidthValue, findGnbAncestors, findGnbRailValue, isColorKey, isFieldWidthGrade, loading, resolveColor, useSLayout };
|
|
21762
|
+
export { ACCOUNT_LIST_BOX_ICONS, ACCOUNT_LIST_BOX_ITEM_TONES, ACCOUNT_LIST_BOX_LABELS, ACCOUNT_LIST_BOX_LAYOUT, ACCOUNT_LIST_BOX_TONE_CONFIG, BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, COLOR_KEYS, FIELD_WIDTH_GRADES, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_FULL_LOGO_WIDTH, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, GNB_SYSTEM_COLORS, GNB_SYSTEM_COLOR_CONFIG, GNB_SYSTEM_LAYOUT, GNB_SYSTEM_PLACEMENTS, GNB_SYSTEM_TOP_COLOR_CONFIG, ICONS, IMAGE_FITS, PAGE_BACKGROUNDS, PAGE_CONTENT_HEIGHTS, RangeCalendar, SAccountListBox, SActionModal, SBadge, SBarcodeInput, SButton, SCROLL_AREA_AXES, SCalendar, SCallout, SCard, SCheckbox, SChip2 as SChip, SChipFilter, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDatePickerMonthListbox, SDatePickerYearListbox, SDateRangePicker, SDivider, SDraggableGroup, SDraggableItem2 as SDraggableItem, SDraggableList, SDraggableProvider, SDrawer, SDropdownButton2 as SDropdownButton, SEDITOR_DEFAULT_FONT_SIZE, SEDITOR_HEADING_LABELS, SEDITOR_HEADING_LEVELS, SEditor, SExpansionItem, SExpansionList2 as SExpansionList, SField, SFilePicker, SForm, SGhostButton, SGnb, SGnbSystem, SGnbSystemContext, SGuide, SIcon, SImage, SInput, SKeyValueTable, SLAYOUT_MIN_WIDTH, SLayout, SLayoutContext, SLinearProgress, SList2 as SList, SListItem2 as SListItem, SLoadingContainer, SLoadingModal, SLoadingViewport, SModal, SModalOutlet, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioCard, SRadioCardGroup, SRadioGroup, SSPLITTER_UNITS, SScrollArea, SSearchInput, SSectionHeaderCard2 as SSectionHeaderCard, SSelect2 as SSelect, SSplitter2 as SSplitter, SStepper, SSwitch, SSystemActionButton, STEPPER_SIZES, STable, STableBar, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip2 as STooltip, STree2 as STree, STreeItem2 as STreeItem, SYSTEM_ACTION_BUTTON_COLORS, SYSTEM_ACTION_BUTTON_COLOR_CONFIG, SYSTEM_ACTION_BUTTON_LAYOUT, SYSTEM_ACTION_BUTTON_TYPES, SYSTEM_ACTION_BUTTON_TYPE_CONFIG, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, fieldWidthValue, findGnbAncestors, findGnbRailValue, isColorKey, isFieldWidthGrade, loading, resolveColor, useSLayout };
|
|
21038
21763
|
//# sourceMappingURL=index.js.map
|
|
21039
21764
|
//# sourceMappingURL=index.js.map
|