@stn-uiux/pub-ui-react 0.1.81 → 0.1.82
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/dist/index.d.ts +403 -36
- package/dist/index.js +1976 -429
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8190,8 +8190,109 @@ StnTopologyGraph.Toolbar = StnTopologyGraphToolbar;
|
|
|
8190
8190
|
StnTopologyGraph.Minimap = StnTopologyGraphMinimap;
|
|
8191
8191
|
StnTopologyGraph.Viewport = StnTopologyGraphViewport;
|
|
8192
8192
|
|
|
8193
|
+
// src/patterns/widget/StnGradeRow.tsx
|
|
8194
|
+
import "react";
|
|
8195
|
+
import { jsx as jsx57, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
8196
|
+
var GRADE_ROW_ICON = {
|
|
8197
|
+
critical: "fill/alert4",
|
|
8198
|
+
major: "fill/alert3",
|
|
8199
|
+
minor: "fill/alert2",
|
|
8200
|
+
default: "fill/alert1"
|
|
8201
|
+
};
|
|
8202
|
+
function formatGradePercent(percent, decimals) {
|
|
8203
|
+
if (decimals !== void 0) {
|
|
8204
|
+
return `${percent.toFixed(decimals)}%`;
|
|
8205
|
+
}
|
|
8206
|
+
const rounded = Math.round(percent * 10) / 10;
|
|
8207
|
+
return Number.isInteger(rounded) ? `${rounded}%` : `${rounded.toFixed(1)}%`;
|
|
8208
|
+
}
|
|
8209
|
+
function StnGradeRow({
|
|
8210
|
+
grade,
|
|
8211
|
+
label,
|
|
8212
|
+
value,
|
|
8213
|
+
percent,
|
|
8214
|
+
percentLabel,
|
|
8215
|
+
decimals,
|
|
8216
|
+
className,
|
|
8217
|
+
...rest
|
|
8218
|
+
}) {
|
|
8219
|
+
const clamped = Math.max(0, Math.min(100, percent));
|
|
8220
|
+
const resolvedPercentLabel = percentLabel ?? formatGradePercent(clamped, decimals);
|
|
8221
|
+
return /* @__PURE__ */ jsxs45(
|
|
8222
|
+
"div",
|
|
8223
|
+
{
|
|
8224
|
+
className: cn(
|
|
8225
|
+
"stn-grade-row",
|
|
8226
|
+
`stn-grade-row--${grade}`,
|
|
8227
|
+
className
|
|
8228
|
+
),
|
|
8229
|
+
...rest,
|
|
8230
|
+
children: [
|
|
8231
|
+
/* @__PURE__ */ jsxs45("div", { className: "stn-grade-row__left", children: [
|
|
8232
|
+
/* @__PURE__ */ jsxs45("span", { className: "stn-grade-row__label", children: [
|
|
8233
|
+
/* @__PURE__ */ jsx57(StnIcon, { name: GRADE_ROW_ICON[grade], size: 20, className: "stn-grade-row__icon", "aria-hidden": true }),
|
|
8234
|
+
label
|
|
8235
|
+
] }),
|
|
8236
|
+
/* @__PURE__ */ jsx57("div", { className: "stn-grade-row__track", "aria-hidden": true, children: /* @__PURE__ */ jsx57("span", { className: "stn-grade-row__fill", style: { width: `${clamped}%` } }) })
|
|
8237
|
+
] }),
|
|
8238
|
+
/* @__PURE__ */ jsxs45("div", { className: "stn-grade-row__right", children: [
|
|
8239
|
+
/* @__PURE__ */ jsx57("span", { className: "stn-grade-row__value", children: value }),
|
|
8240
|
+
/* @__PURE__ */ jsx57("span", { className: "stn-grade-row__percent", children: resolvedPercentLabel })
|
|
8241
|
+
] })
|
|
8242
|
+
]
|
|
8243
|
+
}
|
|
8244
|
+
);
|
|
8245
|
+
}
|
|
8246
|
+
function StnGradeRowList({ className, children, ...rest }) {
|
|
8247
|
+
return /* @__PURE__ */ jsx57("div", { className: cn("stn-grade-row-list", className), ...rest, children });
|
|
8248
|
+
}
|
|
8249
|
+
|
|
8250
|
+
// src/patterns/widget/StnStatCard.tsx
|
|
8251
|
+
import "react";
|
|
8252
|
+
import { jsx as jsx58, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
8253
|
+
function StnStatCard({ label, count, className, ...rest }) {
|
|
8254
|
+
return /* @__PURE__ */ jsxs46("div", { className: cn("stn-stat-card", className), ...rest, children: [
|
|
8255
|
+
/* @__PURE__ */ jsx58("span", { className: "stn-stat-label", children: label }),
|
|
8256
|
+
/* @__PURE__ */ jsx58("span", { className: "stn-stat-count", children: count })
|
|
8257
|
+
] });
|
|
8258
|
+
}
|
|
8259
|
+
function StnStatGroup({ className, children, ...rest }) {
|
|
8260
|
+
return /* @__PURE__ */ jsx58("div", { className: cn("stn-stat-group", className), ...rest, children });
|
|
8261
|
+
}
|
|
8262
|
+
|
|
8263
|
+
// src/patterns/widget/StnStatusList.tsx
|
|
8264
|
+
import "react";
|
|
8265
|
+
import { jsx as jsx59, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
8266
|
+
function StnStatusItem({
|
|
8267
|
+
label,
|
|
8268
|
+
value,
|
|
8269
|
+
grade: gradeProp,
|
|
8270
|
+
status,
|
|
8271
|
+
showDot = true,
|
|
8272
|
+
className,
|
|
8273
|
+
...rest
|
|
8274
|
+
}) {
|
|
8275
|
+
const grade = gradeProp ?? (status === "warning" ? "minor" : status) ?? "normal";
|
|
8276
|
+
return /* @__PURE__ */ jsxs47("div", { className: cn("stn-status-item", className), ...rest, children: [
|
|
8277
|
+
/* @__PURE__ */ jsxs47("span", { className: "stn-status-item__label", children: [
|
|
8278
|
+
showDot ? /* @__PURE__ */ jsx59(
|
|
8279
|
+
"span",
|
|
8280
|
+
{
|
|
8281
|
+
className: cn("stn-status-item__dot", `stn-status-item__dot--${grade}`),
|
|
8282
|
+
"aria-hidden": "true"
|
|
8283
|
+
}
|
|
8284
|
+
) : null,
|
|
8285
|
+
label
|
|
8286
|
+
] }),
|
|
8287
|
+
/* @__PURE__ */ jsx59("span", { className: "stn-status-item__val", children: value })
|
|
8288
|
+
] });
|
|
8289
|
+
}
|
|
8290
|
+
function StnStatusList({ className, children, ...rest }) {
|
|
8291
|
+
return /* @__PURE__ */ jsx59("div", { className: cn("stn-status-list", className), ...rest, children });
|
|
8292
|
+
}
|
|
8293
|
+
|
|
8193
8294
|
// src/components/StnWidget.tsx
|
|
8194
|
-
import { Fragment as Fragment8, jsx as
|
|
8295
|
+
import { Fragment as Fragment8, jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
8195
8296
|
var SHELL_PUB_CLASS = {
|
|
8196
8297
|
card: "",
|
|
8197
8298
|
"fault-panel": "",
|
|
@@ -8274,20 +8375,20 @@ function StnWidgetPeriodText({
|
|
|
8274
8375
|
className,
|
|
8275
8376
|
...rest
|
|
8276
8377
|
}) {
|
|
8277
|
-
return /* @__PURE__ */
|
|
8378
|
+
return /* @__PURE__ */ jsx60("span", { className: cn("stn-widget__period-text", className), ...rest, children });
|
|
8278
8379
|
}
|
|
8279
8380
|
function StnWidgetPeriodSelect({
|
|
8280
8381
|
label,
|
|
8281
8382
|
className,
|
|
8282
8383
|
...rest
|
|
8283
8384
|
}) {
|
|
8284
|
-
return /* @__PURE__ */
|
|
8385
|
+
return /* @__PURE__ */ jsx60(
|
|
8285
8386
|
StnButton,
|
|
8286
8387
|
{
|
|
8287
8388
|
variant: "ghost",
|
|
8288
8389
|
size: "sm",
|
|
8289
8390
|
shape: "square",
|
|
8290
|
-
icon: /* @__PURE__ */
|
|
8391
|
+
icon: /* @__PURE__ */ jsx60(StnIcon, { name: "line/chevron-down" }),
|
|
8291
8392
|
iconPosition: "right",
|
|
8292
8393
|
className,
|
|
8293
8394
|
...rest,
|
|
@@ -8304,26 +8405,26 @@ function StnWidgetPeriodPager({
|
|
|
8304
8405
|
nextLabel = "\uB2E4\uC74C",
|
|
8305
8406
|
...rest
|
|
8306
8407
|
}) {
|
|
8307
|
-
return /* @__PURE__ */
|
|
8308
|
-
/* @__PURE__ */
|
|
8408
|
+
return /* @__PURE__ */ jsxs48("div", { className: cn("stn-widget__period-pager", className), ...rest, children: [
|
|
8409
|
+
/* @__PURE__ */ jsx60(
|
|
8309
8410
|
StnButton,
|
|
8310
8411
|
{
|
|
8311
8412
|
variant: "ghost",
|
|
8312
8413
|
size: "sm",
|
|
8313
8414
|
shape: "square",
|
|
8314
|
-
icon: /* @__PURE__ */
|
|
8415
|
+
icon: /* @__PURE__ */ jsx60(StnIcon, { name: "line/arrow-narrow-left" }),
|
|
8315
8416
|
onClick: onPrev,
|
|
8316
8417
|
"aria-label": prevLabel
|
|
8317
8418
|
}
|
|
8318
8419
|
),
|
|
8319
|
-
/* @__PURE__ */
|
|
8320
|
-
/* @__PURE__ */
|
|
8420
|
+
/* @__PURE__ */ jsx60("span", { className: "stn-widget__period-pager-label", children: label }),
|
|
8421
|
+
/* @__PURE__ */ jsx60(
|
|
8321
8422
|
StnButton,
|
|
8322
8423
|
{
|
|
8323
8424
|
variant: "ghost",
|
|
8324
8425
|
size: "sm",
|
|
8325
8426
|
shape: "square",
|
|
8326
|
-
icon: /* @__PURE__ */
|
|
8427
|
+
icon: /* @__PURE__ */ jsx60(StnIcon, { name: "line/arrow-narrow-right" }),
|
|
8327
8428
|
onClick: onNext,
|
|
8328
8429
|
"aria-label": nextLabel
|
|
8329
8430
|
}
|
|
@@ -8350,18 +8451,18 @@ function StnWidgetHeaderInner({
|
|
|
8350
8451
|
return null;
|
|
8351
8452
|
}
|
|
8352
8453
|
const resolvedIconName = headerIconName ?? defaultHeaderIconName(appearance);
|
|
8353
|
-
return /* @__PURE__ */
|
|
8354
|
-
/* @__PURE__ */
|
|
8355
|
-
showHeaderIcon ? headerIcon != null ? /* @__PURE__ */
|
|
8356
|
-
title != null || badge != null ? typeof title === "string" || title == null ? /* @__PURE__ */
|
|
8357
|
-
typeof title === "string" ? /* @__PURE__ */
|
|
8454
|
+
return /* @__PURE__ */ jsxs48("div", { className: cn("stn-widget__head", wrapActions && "stn-widget__head--wrap"), children: [
|
|
8455
|
+
/* @__PURE__ */ jsxs48("div", { className: "stn-widget__head-start", children: [
|
|
8456
|
+
showHeaderIcon ? headerIcon != null ? /* @__PURE__ */ jsx60(StnWidgetInsetIcon, { size: "sm", children: headerIcon }) : resolvedIconName ? /* @__PURE__ */ jsx60(StnWidgetInsetIcon, { size: "sm", icon: resolvedIconName }) : null : null,
|
|
8457
|
+
title != null || badge != null ? typeof title === "string" || title == null ? /* @__PURE__ */ jsxs48("div", { className: "stn-widget__title-wrap", children: [
|
|
8458
|
+
typeof title === "string" ? /* @__PURE__ */ jsx60("p", { className: cn("stn-widget__title", titleSize, titleWeight), title, children: title }) : null,
|
|
8358
8459
|
badge
|
|
8359
|
-
] }) : /* @__PURE__ */
|
|
8460
|
+
] }) : /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
8360
8461
|
title,
|
|
8361
8462
|
badge
|
|
8362
8463
|
] }) : null
|
|
8363
8464
|
] }),
|
|
8364
|
-
titleActions != null || periodActions != null || periodLabel != null && periodLabel !== "" ? /* @__PURE__ */
|
|
8465
|
+
titleActions != null || periodActions != null || periodLabel != null && periodLabel !== "" ? /* @__PURE__ */ jsx60("div", { className: "stn-widget__head-end", children: titleActions ?? (periodActions != null ? periodActions : periodLabel != null && periodLabel !== "" ? /* @__PURE__ */ jsx60(StnWidgetPeriodText, { children: periodLabel }) : null) }) : null
|
|
8365
8466
|
] });
|
|
8366
8467
|
}
|
|
8367
8468
|
function StnWidgetRoot({
|
|
@@ -8444,10 +8545,10 @@ function StnWidgetRoot({
|
|
|
8444
8545
|
...rest
|
|
8445
8546
|
};
|
|
8446
8547
|
const slots = partitionWidgetChildren(children);
|
|
8447
|
-
const propHead = shell === "fault-panel" && !isFigmaShell ? title != null || titleActions ? /* @__PURE__ */
|
|
8448
|
-
/* @__PURE__ */
|
|
8548
|
+
const propHead = shell === "fault-panel" && !isFigmaShell ? title != null || titleActions ? /* @__PURE__ */ jsxs48("div", { className: "app_bar", children: [
|
|
8549
|
+
/* @__PURE__ */ jsx60("div", { className: "fault_title_box", children: typeof title === "string" ? /* @__PURE__ */ jsx60("span", { children: title }) : title }),
|
|
8449
8550
|
titleActions
|
|
8450
|
-
] }) : null : shell === "board" || shell === "board-item" ? title != null ? /* @__PURE__ */
|
|
8551
|
+
] }) : null : shell === "board" || shell === "board-item" ? title != null ? /* @__PURE__ */ jsx60("div", { className: "stn-widget__head", children: typeof title === "string" ? /* @__PURE__ */ jsx60("p", { children: title }) : title }) : null : isFigmaShell ? /* @__PURE__ */ jsx60(
|
|
8451
8552
|
StnWidgetHeaderInner,
|
|
8452
8553
|
{
|
|
8453
8554
|
appearance,
|
|
@@ -8463,40 +8564,40 @@ function StnWidgetRoot({
|
|
|
8463
8564
|
headerIcon,
|
|
8464
8565
|
wrapActions
|
|
8465
8566
|
}
|
|
8466
|
-
) : title != null || badge != null || titleActions ? /* @__PURE__ */
|
|
8467
|
-
/* @__PURE__ */
|
|
8468
|
-
title != null ? typeof title === "string" ? /* @__PURE__ */
|
|
8567
|
+
) : title != null || badge != null || titleActions ? /* @__PURE__ */ jsxs48("div", { className: cn("stn-widget__head", wrapActions && "stn-widget__head--wrap"), children: [
|
|
8568
|
+
/* @__PURE__ */ jsxs48("div", { className: "stn-widget__head-start", children: [
|
|
8569
|
+
title != null ? typeof title === "string" ? /* @__PURE__ */ jsx60("p", { className: cn("stn-widget__title", titleSize, titleWeight), title, children: title }) : title : null,
|
|
8469
8570
|
badge
|
|
8470
8571
|
] }),
|
|
8471
|
-
titleActions ? /* @__PURE__ */
|
|
8572
|
+
titleActions ? /* @__PURE__ */ jsx60("div", { className: "stn-widget__head-end", children: titleActions }) : null
|
|
8472
8573
|
] }) : null;
|
|
8473
8574
|
const head = slots.headers.length > 0 ? slots.headers : propHead;
|
|
8474
8575
|
const autoBodyClass = shell === "fault-panel" && !isFigmaShell ? "table_area" : void 0;
|
|
8475
8576
|
let body;
|
|
8476
8577
|
if (loading) {
|
|
8477
|
-
body = /* @__PURE__ */
|
|
8578
|
+
body = /* @__PURE__ */ jsx60("div", { className: cn("stn-widget__body", autoBodyClass, contentClassName), children: /* @__PURE__ */ jsx60(StnWidgetLoading, {}) });
|
|
8478
8579
|
} else if (slots.bodies.length > 0) {
|
|
8479
8580
|
body = slots.bodies.map(
|
|
8480
8581
|
(slot, index) => mergeBodySlot(slot, index === 0 ? slots.rest : [], contentClassName, isEmptyState, emptyStyle)
|
|
8481
8582
|
);
|
|
8482
8583
|
} else {
|
|
8483
|
-
body = /* @__PURE__ */
|
|
8584
|
+
body = /* @__PURE__ */ jsx60("div", { className: cn("stn-widget__body", autoBodyClass, isEmptyState && "empty", contentClassName), style: emptyStyle, children: slots.rest });
|
|
8484
8585
|
}
|
|
8485
|
-
const footerNode = slots.footers.length > 0 ? slots.footers : footer ? /* @__PURE__ */
|
|
8486
|
-
const card = /* @__PURE__ */
|
|
8487
|
-
isFigmaShell && appearanceShell === "overlay" ? /* @__PURE__ */
|
|
8586
|
+
const footerNode = slots.footers.length > 0 ? slots.footers : footer ? /* @__PURE__ */ jsx60("div", { className: "stn-widget__footer", children: footer }) : null;
|
|
8587
|
+
const card = /* @__PURE__ */ jsxs48("div", { ...rootProps, children: [
|
|
8588
|
+
isFigmaShell && appearanceShell === "overlay" ? /* @__PURE__ */ jsx60("div", { className: "stn-widget__map-deco", "aria-hidden": true }) : null,
|
|
8488
8589
|
head,
|
|
8489
8590
|
body,
|
|
8490
8591
|
footerNode
|
|
8491
8592
|
] });
|
|
8492
8593
|
if (banner == null || banner === false) return card;
|
|
8493
|
-
return /* @__PURE__ */
|
|
8594
|
+
return /* @__PURE__ */ jsxs48("div", { className: "stn-widget-anchor", children: [
|
|
8494
8595
|
withBannerSeverity(banner, bannerSeverityFromStatus(status, isCritical)),
|
|
8495
8596
|
card
|
|
8496
8597
|
] });
|
|
8497
8598
|
}
|
|
8498
8599
|
function StnWidgetHeader({ className, wrap = false, children, ...rest }) {
|
|
8499
|
-
return /* @__PURE__ */
|
|
8600
|
+
return /* @__PURE__ */ jsx60("div", { className: cn("stn-widget__head", wrap && "stn-widget__head--wrap", className), ...rest, children });
|
|
8500
8601
|
}
|
|
8501
8602
|
markWidgetSlot(StnWidgetHeader, "header");
|
|
8502
8603
|
function StnWidgetTitle({
|
|
@@ -8508,10 +8609,10 @@ function StnWidgetTitle({
|
|
|
8508
8609
|
...rest
|
|
8509
8610
|
}) {
|
|
8510
8611
|
const titleAttr = title ?? (typeof children === "string" ? children : void 0);
|
|
8511
|
-
return /* @__PURE__ */
|
|
8612
|
+
return /* @__PURE__ */ jsx60("p", { className: cn("stn-widget__title", size, weight, className), title: titleAttr, ...rest, children });
|
|
8512
8613
|
}
|
|
8513
8614
|
function StnWidgetActions({ className, children, ...rest }) {
|
|
8514
|
-
return /* @__PURE__ */
|
|
8615
|
+
return /* @__PURE__ */ jsx60("div", { className: cn("stn-widget__head-end", className), ...rest, children });
|
|
8515
8616
|
}
|
|
8516
8617
|
function StnWidgetBody({
|
|
8517
8618
|
padding,
|
|
@@ -8525,7 +8626,7 @@ function StnWidgetBody({
|
|
|
8525
8626
|
}) {
|
|
8526
8627
|
const emptyText = typeof empty === "string" ? empty : void 0;
|
|
8527
8628
|
const mergedStyle = emptyText ? { ["--stn-widget-empty-text"]: `"${emptyText}"`, ...style } : style;
|
|
8528
|
-
return /* @__PURE__ */
|
|
8629
|
+
return /* @__PURE__ */ jsx60(
|
|
8529
8630
|
"div",
|
|
8530
8631
|
{
|
|
8531
8632
|
className: cn(
|
|
@@ -8547,104 +8648,36 @@ function StnWidgetBody({
|
|
|
8547
8648
|
}
|
|
8548
8649
|
markWidgetSlot(StnWidgetBody, "body");
|
|
8549
8650
|
function StnWidgetChartSlot({ label = "select chart", className, children, ...rest }) {
|
|
8550
|
-
return /* @__PURE__ */
|
|
8551
|
-
}
|
|
8552
|
-
function StnWidgetStatusItem({
|
|
8553
|
-
label,
|
|
8554
|
-
value,
|
|
8555
|
-
grade: gradeProp,
|
|
8556
|
-
status,
|
|
8557
|
-
showDot = true,
|
|
8558
|
-
className,
|
|
8559
|
-
...rest
|
|
8560
|
-
}) {
|
|
8561
|
-
const grade = gradeProp ?? (status === "warning" ? "minor" : status) ?? "normal";
|
|
8562
|
-
return /* @__PURE__ */ jsxs45("div", { className: cn("stn-widget__status-item", className), ...rest, children: [
|
|
8563
|
-
/* @__PURE__ */ jsxs45("span", { className: "stn-widget__status-label", children: [
|
|
8564
|
-
showDot ? /* @__PURE__ */ jsx57(
|
|
8565
|
-
"span",
|
|
8566
|
-
{
|
|
8567
|
-
className: cn("stn-widget__status-dot", `stn-widget__status-dot--${grade}`),
|
|
8568
|
-
"aria-hidden": "true"
|
|
8569
|
-
}
|
|
8570
|
-
) : null,
|
|
8571
|
-
label
|
|
8572
|
-
] }),
|
|
8573
|
-
/* @__PURE__ */ jsx57("span", { className: "stn-widget__status-val", children: value })
|
|
8574
|
-
] });
|
|
8575
|
-
}
|
|
8576
|
-
function StnWidgetStatusList({ className, children, ...rest }) {
|
|
8577
|
-
return /* @__PURE__ */ jsx57("div", { className: cn("stn-widget__status-list", className), ...rest, children });
|
|
8578
|
-
}
|
|
8579
|
-
function StnWidgetStatGroup({ className, children, ...rest }) {
|
|
8580
|
-
return /* @__PURE__ */ jsx57("div", { className: cn("stn-widget__stat-group", className), ...rest, children });
|
|
8581
|
-
}
|
|
8582
|
-
function StnWidgetStatCard({ label, count, className, ...rest }) {
|
|
8583
|
-
return /* @__PURE__ */ jsxs45("div", { className: cn("stn-widget__stat-card", className), ...rest, children: [
|
|
8584
|
-
/* @__PURE__ */ jsx57("span", { className: "stn-widget__stat-label", children: label }),
|
|
8585
|
-
/* @__PURE__ */ jsx57("span", { className: "stn-widget__stat-count", children: count })
|
|
8586
|
-
] });
|
|
8651
|
+
return /* @__PURE__ */ jsx60("div", { className: cn("stn-widget__chart-slot", className), "data-stn-widget-chart-slot": true, ...rest, children: children ?? /* @__PURE__ */ jsx60("span", { className: "stn-widget__chart-slot-label", children: label }) });
|
|
8587
8652
|
}
|
|
8588
8653
|
function StnWidgetPlaceholder({ label = "\uCF58\uD150\uCE20 \uC601\uC5ED" }) {
|
|
8589
|
-
return /* @__PURE__ */
|
|
8590
|
-
}
|
|
8591
|
-
var
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
function formatGradePercent(percent) {
|
|
8598
|
-
const rounded = Math.round(percent * 10) / 10;
|
|
8599
|
-
return Number.isInteger(rounded) ? `${rounded}%` : `${rounded.toFixed(1)}%`;
|
|
8600
|
-
}
|
|
8601
|
-
function StnWidgetGradeRow({
|
|
8602
|
-
grade,
|
|
8603
|
-
label,
|
|
8604
|
-
value,
|
|
8605
|
-
percent,
|
|
8606
|
-
percentLabel,
|
|
8607
|
-
className,
|
|
8608
|
-
...rest
|
|
8609
|
-
}) {
|
|
8610
|
-
const clamped = Math.max(0, Math.min(100, percent));
|
|
8611
|
-
const resolvedPercentLabel = percentLabel ?? formatGradePercent(clamped);
|
|
8612
|
-
return /* @__PURE__ */ jsxs45("div", { className: cn("stn-widget__grade-row", `stn-widget__grade-row--${grade}`, className), ...rest, children: [
|
|
8613
|
-
/* @__PURE__ */ jsxs45("div", { className: "stn-widget__grade-row-left", children: [
|
|
8614
|
-
/* @__PURE__ */ jsxs45("span", { className: "stn-widget__grade-row-label", children: [
|
|
8615
|
-
/* @__PURE__ */ jsx57(StnIcon, { name: GRADE_ROW_ICON[grade], size: 20, className: "stn-widget__grade-row-icon", "aria-hidden": true }),
|
|
8616
|
-
label
|
|
8617
|
-
] }),
|
|
8618
|
-
/* @__PURE__ */ jsx57("div", { className: "stn-widget__grade-row-track", "aria-hidden": true, children: /* @__PURE__ */ jsx57("span", { className: "stn-widget__grade-row-fill", style: { width: `${clamped}%` } }) })
|
|
8619
|
-
] }),
|
|
8620
|
-
/* @__PURE__ */ jsxs45("div", { className: "stn-widget__grade-row-right", children: [
|
|
8621
|
-
/* @__PURE__ */ jsx57("span", { className: "stn-widget__grade-row-value", children: value }),
|
|
8622
|
-
/* @__PURE__ */ jsx57("span", { className: "stn-widget__grade-row-percent", children: resolvedPercentLabel })
|
|
8623
|
-
] })
|
|
8624
|
-
] });
|
|
8625
|
-
}
|
|
8626
|
-
function StnWidgetGradeRowList({ className, children, ...rest }) {
|
|
8627
|
-
return /* @__PURE__ */ jsx57("div", { className: cn("stn-widget__grade-row-list", className), ...rest, children });
|
|
8628
|
-
}
|
|
8654
|
+
return /* @__PURE__ */ jsx60("div", { className: "stn-widget__placeholder", children: label });
|
|
8655
|
+
}
|
|
8656
|
+
var StnWidgetStatusItem = StnStatusItem;
|
|
8657
|
+
var StnWidgetStatusList = StnStatusList;
|
|
8658
|
+
var StnWidgetStatGroup = StnStatGroup;
|
|
8659
|
+
var StnWidgetStatCard = StnStatCard;
|
|
8660
|
+
var StnWidgetGradeRow = StnGradeRow;
|
|
8661
|
+
var StnWidgetGradeRowList = StnGradeRowList;
|
|
8629
8662
|
function StnWidgetFooter({ className, children, ...rest }) {
|
|
8630
|
-
return /* @__PURE__ */
|
|
8663
|
+
return /* @__PURE__ */ jsx60("div", { className: cn("stn-widget__footer", className), ...rest, children });
|
|
8631
8664
|
}
|
|
8632
8665
|
markWidgetSlot(StnWidgetFooter, "footer");
|
|
8633
8666
|
function StnWidgetEmpty({ className, children, ...rest }) {
|
|
8634
|
-
return /* @__PURE__ */
|
|
8635
|
-
/* @__PURE__ */
|
|
8636
|
-
/* @__PURE__ */
|
|
8637
|
-
/* @__PURE__ */
|
|
8638
|
-
/* @__PURE__ */
|
|
8667
|
+
return /* @__PURE__ */ jsxs48("div", { className: cn("stn-widget__empty", className), ...rest, children: [
|
|
8668
|
+
/* @__PURE__ */ jsxs48("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", style: { opacity: 0.6 }, children: [
|
|
8669
|
+
/* @__PURE__ */ jsx60("circle", { cx: "12", cy: "12", r: "10" }),
|
|
8670
|
+
/* @__PURE__ */ jsx60("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
8671
|
+
/* @__PURE__ */ jsx60("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
8639
8672
|
] }),
|
|
8640
|
-
/* @__PURE__ */
|
|
8673
|
+
/* @__PURE__ */ jsx60("div", { children: children ?? "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4." })
|
|
8641
8674
|
] });
|
|
8642
8675
|
}
|
|
8643
8676
|
function StnWidgetLoading({ lines = 3, className, children, ...rest }) {
|
|
8644
|
-
return /* @__PURE__ */
|
|
8677
|
+
return /* @__PURE__ */ jsx60("div", { className: cn("stn-widget__loading", className), ...rest, children: children ?? /* @__PURE__ */ jsx60(StnLoadingSkeleton.Widget, { lines }) });
|
|
8645
8678
|
}
|
|
8646
8679
|
function StnWidgetInsetIcon({ className, size = "sm", ...rest }) {
|
|
8647
|
-
return /* @__PURE__ */
|
|
8680
|
+
return /* @__PURE__ */ jsx60(StnIconBox, { size, className: cn("stn-widget__inset-icon", className), ...rest });
|
|
8648
8681
|
}
|
|
8649
8682
|
var StnWidget = Object.assign(StnWidgetRoot, {
|
|
8650
8683
|
Header: StnWidgetHeader,
|
|
@@ -8689,7 +8722,7 @@ import {
|
|
|
8689
8722
|
} from "@stn-uiux/pub-ui/data/stnWidget";
|
|
8690
8723
|
|
|
8691
8724
|
// src/patterns/dashboard/AlertCenterDashboard.tsx
|
|
8692
|
-
import { jsx as
|
|
8725
|
+
import { jsx as jsx61, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
8693
8726
|
var TOP5_ROWS = [
|
|
8694
8727
|
{ label: "\uADF8\uB791\uC2DC\uC544", percent: 80, value: "80\uAC74", grade: "critical" },
|
|
8695
8728
|
{ label: "\uC5F0\uB9BD\uC8FC\uD0DD 15\uC138\uB300", percent: 74, value: "74\uAC74", grade: "major" },
|
|
@@ -8698,7 +8731,7 @@ var TOP5_ROWS = [
|
|
|
8698
8731
|
{ label: "PRADA", percent: 68, value: "68\uAC74", grade: "default" }
|
|
8699
8732
|
];
|
|
8700
8733
|
function AlertCenterDashboard({ className, appearance = "translucent", loading = false }) {
|
|
8701
|
-
return /* @__PURE__ */
|
|
8734
|
+
return /* @__PURE__ */ jsxs49(
|
|
8702
8735
|
StnStack,
|
|
8703
8736
|
{
|
|
8704
8737
|
direction: "column",
|
|
@@ -8707,17 +8740,17 @@ function AlertCenterDashboard({ className, appearance = "translucent", loading =
|
|
|
8707
8740
|
style: { flex: "1 1 0%", minHeight: 0, height: "100%", width: "100%" },
|
|
8708
8741
|
"data-stn-dashboard": "alert-widgets",
|
|
8709
8742
|
children: [
|
|
8710
|
-
/* @__PURE__ */
|
|
8711
|
-
/* @__PURE__ */
|
|
8712
|
-
/* @__PURE__ */
|
|
8713
|
-
/* @__PURE__ */
|
|
8743
|
+
/* @__PURE__ */ jsx61(StnWidget, { title: "\uC2DC\uC124 \uD604\uD669", appearance, interactive: true, children: loading ? /* @__PURE__ */ jsx61(StnLoadingSkeleton.Widget, { lines: 3 }) : /* @__PURE__ */ jsxs49(StnWidget.StatusList, { children: [
|
|
8744
|
+
/* @__PURE__ */ jsx61(StnWidget.StatusItem, { label: "PTN", value: "179", showDot: false }),
|
|
8745
|
+
/* @__PURE__ */ jsx61(StnWidget.StatusItem, { label: "MSPP", value: "63", showDot: false }),
|
|
8746
|
+
/* @__PURE__ */ jsx61(StnWidget.StatusItem, { label: "L3\uC2A4\uC704\uCE58", value: "27", showDot: false })
|
|
8714
8747
|
] }) }),
|
|
8715
|
-
/* @__PURE__ */
|
|
8716
|
-
/* @__PURE__ */
|
|
8717
|
-
/* @__PURE__ */
|
|
8718
|
-
/* @__PURE__ */
|
|
8748
|
+
/* @__PURE__ */ jsx61(StnWidget, { title: "\uC7A5\uC560 \uD604\uD669", appearance, interactive: true, children: loading ? /* @__PURE__ */ jsx61(StnLoadingSkeleton.Widget, { lines: 3 }) : /* @__PURE__ */ jsxs49(StnWidget.StatusList, { children: [
|
|
8749
|
+
/* @__PURE__ */ jsx61(StnWidget.StatusItem, { label: "Critical", value: "43", grade: "critical" }),
|
|
8750
|
+
/* @__PURE__ */ jsx61(StnWidget.StatusItem, { label: "Major", value: "79", grade: "major" }),
|
|
8751
|
+
/* @__PURE__ */ jsx61(StnWidget.StatusItem, { label: "Minor", value: "3", grade: "minor" })
|
|
8719
8752
|
] }) }),
|
|
8720
|
-
/* @__PURE__ */
|
|
8753
|
+
/* @__PURE__ */ jsx61(StnWidget, { title: "\uC77C\uC77C \uC7A5\uBE44\uBCC4 \uC7A5\uC560 TOP5", appearance, interactive: true, children: loading ? /* @__PURE__ */ jsx61(StnLoadingSkeleton.Widget, { lines: 4 }) : /* @__PURE__ */ jsx61(StnWidget.GradeRowList, { children: TOP5_ROWS.map((row) => /* @__PURE__ */ jsx61(
|
|
8721
8754
|
StnWidget.GradeRow,
|
|
8722
8755
|
{
|
|
8723
8756
|
grade: row.grade,
|
|
@@ -8727,50 +8760,50 @@ function AlertCenterDashboard({ className, appearance = "translucent", loading =
|
|
|
8727
8760
|
},
|
|
8728
8761
|
row.label
|
|
8729
8762
|
)) }) }),
|
|
8730
|
-
/* @__PURE__ */
|
|
8763
|
+
/* @__PURE__ */ jsx61(StnWidget, { title: "\uC77C\uC77C \uC7A5\uC560 \uD1B5\uACC4", appearance, interactive: true, children: loading ? /* @__PURE__ */ jsx61(StnLoadingSkeleton.Widget, { lines: 3 }) : /* @__PURE__ */ jsx61(StnWidget.ChartSlot, { label: "\uC77C\uC77C \uC7A5\uC560 \uD1B5\uACC4 \uCC28\uD2B8" }) })
|
|
8731
8764
|
]
|
|
8732
8765
|
}
|
|
8733
8766
|
);
|
|
8734
8767
|
}
|
|
8735
8768
|
|
|
8736
8769
|
// src/patterns/dashboard/PubDashboardWidgetBodies.tsx
|
|
8737
|
-
import { jsx as
|
|
8770
|
+
import { jsx as jsx62, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
8738
8771
|
function PubDisabilityStatusList({ items, summary }) {
|
|
8739
|
-
return /* @__PURE__ */
|
|
8740
|
-
/* @__PURE__ */
|
|
8772
|
+
return /* @__PURE__ */ jsxs50("div", { className: "ds-disability-status", children: [
|
|
8773
|
+
/* @__PURE__ */ jsx62("ul", { className: "ds-disability-status__list", children: items.map((item, i) => /* @__PURE__ */ jsxs50(
|
|
8741
8774
|
"li",
|
|
8742
8775
|
{
|
|
8743
8776
|
className: ["ds-disability-status__item", item.grade].filter(Boolean).join(" "),
|
|
8744
8777
|
children: [
|
|
8745
|
-
/* @__PURE__ */
|
|
8746
|
-
item.showDot !== false && item.grade ? /* @__PURE__ */
|
|
8778
|
+
/* @__PURE__ */ jsxs50("span", { children: [
|
|
8779
|
+
item.showDot !== false && item.grade ? /* @__PURE__ */ jsx62("span", { className: "dot", "aria-hidden": true }) : null,
|
|
8747
8780
|
item.label
|
|
8748
8781
|
] }),
|
|
8749
|
-
/* @__PURE__ */
|
|
8782
|
+
/* @__PURE__ */ jsx62("p", { children: item.value })
|
|
8750
8783
|
]
|
|
8751
8784
|
},
|
|
8752
8785
|
i
|
|
8753
8786
|
)) }),
|
|
8754
|
-
summary && summary.length > 0 ? /* @__PURE__ */
|
|
8787
|
+
summary && summary.length > 0 ? /* @__PURE__ */ jsx62("div", { className: "ds-disability-status__summary", children: summary.map((row, i) => /* @__PURE__ */ jsxs50("p", { className: "ds-disability-status__value", children: [
|
|
8755
8788
|
row.label,
|
|
8756
|
-
/* @__PURE__ */
|
|
8789
|
+
/* @__PURE__ */ jsx62("span", { children: row.value })
|
|
8757
8790
|
] }, i)) }) : null
|
|
8758
8791
|
] });
|
|
8759
8792
|
}
|
|
8760
8793
|
function PubTrafficTop5Bars({ rows }) {
|
|
8761
8794
|
const maxPercent = Math.max(...rows.map((row) => row.percent), 0);
|
|
8762
|
-
return /* @__PURE__ */
|
|
8763
|
-
/* @__PURE__ */
|
|
8764
|
-
/* @__PURE__ */
|
|
8765
|
-
/* @__PURE__ */
|
|
8795
|
+
return /* @__PURE__ */ jsx62("div", { className: "ds-bar-group", children: rows.map((row) => /* @__PURE__ */ jsxs50("div", { className: ["ds-bar", row.percent === maxPercent ? "max" : ""].filter(Boolean).join(" "), children: [
|
|
8796
|
+
/* @__PURE__ */ jsx62("p", { className: "ds-bar-name", title: row.label, children: row.label }),
|
|
8797
|
+
/* @__PURE__ */ jsx62("div", { className: "ds-bar-con", title: `${row.percent}%`, children: /* @__PURE__ */ jsx62("span", { className: "ds-bar-gauge", style: { "--percent": `${row.percent}%` } }) }),
|
|
8798
|
+
/* @__PURE__ */ jsx62("p", { className: "ds-bar-value", title: row.value, children: row.value })
|
|
8766
8799
|
] }, row.label)) });
|
|
8767
8800
|
}
|
|
8768
8801
|
function PubTop5EquipmentBars({ rows }) {
|
|
8769
|
-
return /* @__PURE__ */
|
|
8770
|
-
/* @__PURE__ */
|
|
8771
|
-
/* @__PURE__ */
|
|
8772
|
-
/* @__PURE__ */
|
|
8773
|
-
/* @__PURE__ */
|
|
8802
|
+
return /* @__PURE__ */ jsxs50("div", { className: "ds-group", children: [
|
|
8803
|
+
/* @__PURE__ */ jsx62("div", { className: "ds-group-box", children: /* @__PURE__ */ jsx62("div", { className: "ds-equipment-ico", children: /* @__PURE__ */ jsx62("span", { className: "blind", children: "\uC7A5\uBE44 \uC774\uBBF8\uC9C0" }) }) }),
|
|
8804
|
+
/* @__PURE__ */ jsx62("div", { className: "ds-group-box", children: /* @__PURE__ */ jsx62("div", { className: "ds-bar-group", children: rows.map((row) => /* @__PURE__ */ jsx62("div", { className: "ds-bar type-2", children: /* @__PURE__ */ jsxs50("div", { className: "ds-bar-con", title: `${row.percent}%`, children: [
|
|
8805
|
+
/* @__PURE__ */ jsx62("span", { className: "ds-bar-gauge", style: { "--percent": `${row.percent}%` } }),
|
|
8806
|
+
/* @__PURE__ */ jsx62("div", { className: "ds-bar-status", children: row.status })
|
|
8774
8807
|
] }) }, row.label)) }) })
|
|
8775
8808
|
] });
|
|
8776
8809
|
}
|
|
@@ -8779,7 +8812,7 @@ function PubChartSample({
|
|
|
8779
8812
|
alt = "\uCC28\uD2B8",
|
|
8780
8813
|
onError
|
|
8781
8814
|
}) {
|
|
8782
|
-
return /* @__PURE__ */
|
|
8815
|
+
return /* @__PURE__ */ jsx62("div", { className: "ds-chart", children: /* @__PURE__ */ jsx62("img", { src, alt, className: "chart_sample", onError }) });
|
|
8783
8816
|
}
|
|
8784
8817
|
|
|
8785
8818
|
// src/patterns/alertCenter/StnAlertCenterPanel.tsx
|
|
@@ -8787,7 +8820,7 @@ import { useState as useState16 } from "react";
|
|
|
8787
8820
|
import {
|
|
8788
8821
|
STN_ALERT_CENTER_TABS
|
|
8789
8822
|
} from "@stn-uiux/pub-ui/data/stnAlertCenter";
|
|
8790
|
-
import { jsx as
|
|
8823
|
+
import { jsx as jsx63, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
8791
8824
|
function resolveAlertIcon(item) {
|
|
8792
8825
|
if (item.icon) {
|
|
8793
8826
|
if (item.icon === "line/arrow-down") return "line/arrow-narrow-down";
|
|
@@ -8814,7 +8847,7 @@ function StnAlertCard({
|
|
|
8814
8847
|
}) {
|
|
8815
8848
|
const iconNode = resolveAlertIcon(item);
|
|
8816
8849
|
const gradeLabel = resolveGradeLabel(item.grade);
|
|
8817
|
-
return /* @__PURE__ */
|
|
8850
|
+
return /* @__PURE__ */ jsx63(
|
|
8818
8851
|
StnCard,
|
|
8819
8852
|
{
|
|
8820
8853
|
variant: "elevated",
|
|
@@ -8823,8 +8856,8 @@ function StnAlertCard({
|
|
|
8823
8856
|
interactive: true,
|
|
8824
8857
|
className: cn("stn-alert-card", className),
|
|
8825
8858
|
onClick,
|
|
8826
|
-
children: /* @__PURE__ */
|
|
8827
|
-
/* @__PURE__ */
|
|
8859
|
+
children: /* @__PURE__ */ jsxs51("div", { className: "stn-alert-card__row", children: [
|
|
8860
|
+
/* @__PURE__ */ jsx63(
|
|
8828
8861
|
StnIcon,
|
|
8829
8862
|
{
|
|
8830
8863
|
name: iconNode,
|
|
@@ -8833,9 +8866,9 @@ function StnAlertCard({
|
|
|
8833
8866
|
className: "stn-alert-card__icon"
|
|
8834
8867
|
}
|
|
8835
8868
|
),
|
|
8836
|
-
/* @__PURE__ */
|
|
8837
|
-
/* @__PURE__ */
|
|
8838
|
-
/* @__PURE__ */
|
|
8869
|
+
/* @__PURE__ */ jsxs51("div", { className: "stn-alert-card__body", children: [
|
|
8870
|
+
/* @__PURE__ */ jsxs51(StnStack, { direction: "row", alignItems: "center", spacing: 1, className: "stn-alert-card__header-line", children: [
|
|
8871
|
+
/* @__PURE__ */ jsx63(
|
|
8839
8872
|
StnChip,
|
|
8840
8873
|
{
|
|
8841
8874
|
shape: "pill",
|
|
@@ -8845,25 +8878,25 @@ function StnAlertCard({
|
|
|
8845
8878
|
children: gradeLabel
|
|
8846
8879
|
}
|
|
8847
8880
|
),
|
|
8848
|
-
/* @__PURE__ */
|
|
8881
|
+
/* @__PURE__ */ jsx63(
|
|
8849
8882
|
"span",
|
|
8850
8883
|
{
|
|
8851
8884
|
className: cn("stn-alert-card__title", titleOverflow),
|
|
8852
8885
|
title: item.title,
|
|
8853
|
-
children: /* @__PURE__ */
|
|
8886
|
+
children: /* @__PURE__ */ jsx63("span", { className: "stn-alert-card__text-inner", children: item.title })
|
|
8854
8887
|
}
|
|
8855
8888
|
)
|
|
8856
8889
|
] }),
|
|
8857
|
-
/* @__PURE__ */
|
|
8858
|
-
/* @__PURE__ */
|
|
8890
|
+
/* @__PURE__ */ jsxs51(StnStack, { direction: "row", alignItems: "center", spacing: 2, wrap: "wrap", className: "stn-alert-card__desc-line", children: [
|
|
8891
|
+
/* @__PURE__ */ jsx63(
|
|
8859
8892
|
"span",
|
|
8860
8893
|
{
|
|
8861
8894
|
className: cn("stn-alert-card__desc", descOverflow),
|
|
8862
8895
|
title: item.description,
|
|
8863
|
-
children: /* @__PURE__ */
|
|
8896
|
+
children: /* @__PURE__ */ jsx63("span", { className: "stn-alert-card__text-inner", children: item.description })
|
|
8864
8897
|
}
|
|
8865
8898
|
),
|
|
8866
|
-
item.occurredAt && /* @__PURE__ */
|
|
8899
|
+
item.occurredAt && /* @__PURE__ */ jsxs51(
|
|
8867
8900
|
StnChip,
|
|
8868
8901
|
{
|
|
8869
8902
|
shape: "pill",
|
|
@@ -8879,9 +8912,9 @@ function StnAlertCard({
|
|
|
8879
8912
|
)
|
|
8880
8913
|
] })
|
|
8881
8914
|
] }),
|
|
8882
|
-
/* @__PURE__ */
|
|
8883
|
-
/* @__PURE__ */
|
|
8884
|
-
item.unread !== false && /* @__PURE__ */
|
|
8915
|
+
/* @__PURE__ */ jsxs51("div", { className: "stn-alert-card__meta", children: [
|
|
8916
|
+
/* @__PURE__ */ jsx63("span", { className: "stn-alert-card__time", children: item.time }),
|
|
8917
|
+
item.unread !== false && /* @__PURE__ */ jsx63(
|
|
8885
8918
|
"span",
|
|
8886
8919
|
{
|
|
8887
8920
|
className: cn(
|
|
@@ -8919,7 +8952,7 @@ function StnAlertCenterPanel({
|
|
|
8919
8952
|
const alertCount = alerts.length;
|
|
8920
8953
|
const resolvedTitleOverflow = titleOverflow ?? textOverflow;
|
|
8921
8954
|
const resolvedDescOverflow = descOverflow ?? textOverflow;
|
|
8922
|
-
return /* @__PURE__ */
|
|
8955
|
+
return /* @__PURE__ */ jsxs51(
|
|
8923
8956
|
"div",
|
|
8924
8957
|
{
|
|
8925
8958
|
className: cn(
|
|
@@ -8931,13 +8964,13 @@ function StnAlertCenterPanel({
|
|
|
8931
8964
|
),
|
|
8932
8965
|
"data-stn-alert-center": true,
|
|
8933
8966
|
children: [
|
|
8934
|
-
/* @__PURE__ */
|
|
8935
|
-
/* @__PURE__ */
|
|
8936
|
-
/* @__PURE__ */
|
|
8937
|
-
/* @__PURE__ */
|
|
8938
|
-
alertCount > 0 && /* @__PURE__ */
|
|
8967
|
+
/* @__PURE__ */ jsxs51("div", { className: "stn-alert-center__header", children: [
|
|
8968
|
+
/* @__PURE__ */ jsxs51("div", { className: "stn-alert-center__header-left", children: [
|
|
8969
|
+
/* @__PURE__ */ jsx63(StnIcon, { name: "line/bell", size: 20, color: "var(--stn-primary)" }),
|
|
8970
|
+
/* @__PURE__ */ jsx63("span", { className: "stn-alert-center__title", children: title }),
|
|
8971
|
+
alertCount > 0 && /* @__PURE__ */ jsx63(StnChip, { shape: "pill", size: "sm", variant: "subtle", color: "primary", children: alertCount })
|
|
8939
8972
|
] }),
|
|
8940
|
-
/* @__PURE__ */
|
|
8973
|
+
/* @__PURE__ */ jsx63(
|
|
8941
8974
|
StnSegmented,
|
|
8942
8975
|
{
|
|
8943
8976
|
size: "md",
|
|
@@ -8950,8 +8983,8 @@ function StnAlertCenterPanel({
|
|
|
8950
8983
|
}))
|
|
8951
8984
|
}
|
|
8952
8985
|
),
|
|
8953
|
-
/* @__PURE__ */
|
|
8954
|
-
/* @__PURE__ */
|
|
8986
|
+
/* @__PURE__ */ jsxs51("div", { className: "stn-alert-center__header-right", children: [
|
|
8987
|
+
/* @__PURE__ */ jsx63(
|
|
8955
8988
|
StnButton,
|
|
8956
8989
|
{
|
|
8957
8990
|
variant: "text",
|
|
@@ -8961,8 +8994,8 @@ function StnAlertCenterPanel({
|
|
|
8961
8994
|
children: "\uBAA8\uB450 \uC77D\uC74C"
|
|
8962
8995
|
}
|
|
8963
8996
|
),
|
|
8964
|
-
/* @__PURE__ */
|
|
8965
|
-
/* @__PURE__ */
|
|
8997
|
+
/* @__PURE__ */ jsx63("div", { className: "stn-alert-center__divider", "aria-hidden": true }),
|
|
8998
|
+
/* @__PURE__ */ jsx63(
|
|
8966
8999
|
StnButton,
|
|
8967
9000
|
{
|
|
8968
9001
|
icon: "line/x",
|
|
@@ -8974,14 +9007,14 @@ function StnAlertCenterPanel({
|
|
|
8974
9007
|
)
|
|
8975
9008
|
] })
|
|
8976
9009
|
] }),
|
|
8977
|
-
/* @__PURE__ */
|
|
9010
|
+
/* @__PURE__ */ jsxs51(
|
|
8978
9011
|
StnScroll,
|
|
8979
9012
|
{
|
|
8980
9013
|
orientation: "vertical",
|
|
8981
9014
|
size: "thin",
|
|
8982
9015
|
className: "stn-alert-center__list-wrap",
|
|
8983
9016
|
children: [
|
|
8984
|
-
activeTab === "error" && /* @__PURE__ */
|
|
9017
|
+
activeTab === "error" && /* @__PURE__ */ jsx63("ul", { className: "stn-alert-center__list", children: alerts.map((item) => /* @__PURE__ */ jsx63("li", { children: /* @__PURE__ */ jsx63(
|
|
8985
9018
|
StnAlertCard,
|
|
8986
9019
|
{
|
|
8987
9020
|
item,
|
|
@@ -8990,35 +9023,35 @@ function StnAlertCenterPanel({
|
|
|
8990
9023
|
onClick: () => onItemClick?.(item)
|
|
8991
9024
|
}
|
|
8992
9025
|
) }, item.id ?? item.title)) }),
|
|
8993
|
-
activeTab === "work" && /* @__PURE__ */
|
|
8994
|
-
/* @__PURE__ */
|
|
8995
|
-
/* @__PURE__ */
|
|
8996
|
-
/* @__PURE__ */
|
|
8997
|
-
/* @__PURE__ */
|
|
9026
|
+
activeTab === "work" && /* @__PURE__ */ jsx63("ul", { className: "stn-alert-center__list", children: workItems.map((row) => /* @__PURE__ */ jsx63("li", { children: /* @__PURE__ */ jsx63(StnCard, { variant: "elevated", radius: "md", padding: "md", interactive: true, className: "stn-alert-card", children: /* @__PURE__ */ jsxs51("div", { className: "stn-alert-card__row", children: [
|
|
9027
|
+
/* @__PURE__ */ jsx63(StnIcon, { name: "line/clock", size: 24, color: "var(--stn-text-secondary)", className: "stn-alert-card__icon" }),
|
|
9028
|
+
/* @__PURE__ */ jsxs51("div", { className: "stn-alert-card__body", children: [
|
|
9029
|
+
/* @__PURE__ */ jsx63("span", { className: "stn-alert-card__type-label work", children: row.typeLabel }),
|
|
9030
|
+
/* @__PURE__ */ jsx63("span", { className: cn("stn-alert-card__desc", resolvedDescOverflow), title: row.text, children: /* @__PURE__ */ jsx63("span", { className: "stn-alert-card__text-inner", children: row.text }) })
|
|
8998
9031
|
] }),
|
|
8999
|
-
/* @__PURE__ */
|
|
9032
|
+
/* @__PURE__ */ jsx63("span", { className: "stn-alert-card__time", children: row.time })
|
|
9000
9033
|
] }) }) }, row.id ?? row.text)) }),
|
|
9001
|
-
activeTab === "deploy" && /* @__PURE__ */
|
|
9002
|
-
/* @__PURE__ */
|
|
9003
|
-
/* @__PURE__ */
|
|
9004
|
-
/* @__PURE__ */
|
|
9005
|
-
/* @__PURE__ */
|
|
9034
|
+
activeTab === "deploy" && /* @__PURE__ */ jsx63("ul", { className: "stn-alert-center__list", children: deployItems.map((row) => /* @__PURE__ */ jsx63("li", { children: /* @__PURE__ */ jsx63(StnCard, { variant: "elevated", radius: "md", padding: "md", interactive: true, className: "stn-alert-card", children: /* @__PURE__ */ jsxs51("div", { className: "stn-alert-card__row", children: [
|
|
9035
|
+
/* @__PURE__ */ jsx63(StnIcon, { name: "line/settings", size: 24, color: "var(--stn-secondary)", className: "stn-alert-card__icon" }),
|
|
9036
|
+
/* @__PURE__ */ jsxs51("div", { className: "stn-alert-card__body", children: [
|
|
9037
|
+
/* @__PURE__ */ jsx63("span", { className: "stn-alert-card__type-label stn-alert-card__type-label--deploy", children: row.typeLabel }),
|
|
9038
|
+
/* @__PURE__ */ jsx63("span", { className: cn("stn-alert-card__desc", resolvedDescOverflow), title: row.text, children: /* @__PURE__ */ jsx63("span", { className: "stn-alert-card__text-inner", children: row.text }) })
|
|
9006
9039
|
] }),
|
|
9007
|
-
/* @__PURE__ */
|
|
9040
|
+
/* @__PURE__ */ jsx63("span", { className: "stn-alert-card__time", children: row.time })
|
|
9008
9041
|
] }) }) }, row.id ?? row.text)) })
|
|
9009
9042
|
]
|
|
9010
9043
|
}
|
|
9011
9044
|
),
|
|
9012
|
-
/* @__PURE__ */
|
|
9045
|
+
/* @__PURE__ */ jsx63("div", { className: "stn-alert-center__footer", children: /* @__PURE__ */ jsxs51(
|
|
9013
9046
|
"button",
|
|
9014
9047
|
{
|
|
9015
9048
|
type: "button",
|
|
9016
9049
|
className: "stn-alert-center__footer-link",
|
|
9017
9050
|
onClick: onManageSettings,
|
|
9018
9051
|
children: [
|
|
9019
|
-
/* @__PURE__ */
|
|
9020
|
-
/* @__PURE__ */
|
|
9021
|
-
/* @__PURE__ */
|
|
9052
|
+
/* @__PURE__ */ jsx63("span", { children: "\uC54C\uB9BC \uC124\uC815 \uAD00\uB9AC" }),
|
|
9053
|
+
/* @__PURE__ */ jsx63(StnIcon, { name: "line/settings", size: 14 }),
|
|
9054
|
+
/* @__PURE__ */ jsx63(StnIcon, { name: "line/chevron-right", size: 14 })
|
|
9022
9055
|
]
|
|
9023
9056
|
}
|
|
9024
9057
|
) })
|
|
@@ -9028,7 +9061,7 @@ function StnAlertCenterPanel({
|
|
|
9028
9061
|
}
|
|
9029
9062
|
|
|
9030
9063
|
// src/patterns/alertCenter/StnAlertCenterDocPreview.tsx
|
|
9031
|
-
import { jsx as
|
|
9064
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
9032
9065
|
function StnAlertCenterDocPreview({
|
|
9033
9066
|
mode = "light",
|
|
9034
9067
|
theme,
|
|
@@ -9036,11 +9069,11 @@ function StnAlertCenterDocPreview({
|
|
|
9036
9069
|
children,
|
|
9037
9070
|
...panelProps
|
|
9038
9071
|
}) {
|
|
9039
|
-
const panel = children ?? /* @__PURE__ */
|
|
9072
|
+
const panel = children ?? /* @__PURE__ */ jsx64(StnAlertCenterPanel, { ...panelProps });
|
|
9040
9073
|
if (!withDocChrome) {
|
|
9041
|
-
return /* @__PURE__ */
|
|
9074
|
+
return /* @__PURE__ */ jsx64(StnProvider, { mode, theme, applyModeToDocument: false, children: panel });
|
|
9042
9075
|
}
|
|
9043
|
-
return /* @__PURE__ */
|
|
9076
|
+
return /* @__PURE__ */ jsx64("div", { className: "stn-doc-frame stn-doc-frame--alert-center", "data-mode": mode, "data-theme": theme, children: /* @__PURE__ */ jsx64("div", { className: "stn-alert-center-preview-shell", children: panel }) });
|
|
9044
9077
|
}
|
|
9045
9078
|
|
|
9046
9079
|
// src/index.ts
|
|
@@ -9067,7 +9100,7 @@ var useSideNav = () => useContext5(SideNavContext);
|
|
|
9067
9100
|
// src/components/sideNav/StnSideNavItem.tsx
|
|
9068
9101
|
import { forwardRef as forwardRef33 } from "react";
|
|
9069
9102
|
import { STN_NAV_MENU_SUB_ICON } from "@stn-uiux/pub-ui/data/stnSideNavItem";
|
|
9070
|
-
import { jsx as
|
|
9103
|
+
import { jsx as jsx65, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
9071
9104
|
function maskStyle2(src) {
|
|
9072
9105
|
return { maskImage: `url('${src}')`, WebkitMaskImage: `url('${src}')` };
|
|
9073
9106
|
}
|
|
@@ -9114,13 +9147,13 @@ var StnSideNavItem = forwardRef33(function StnSideNavItem2({
|
|
|
9114
9147
|
sideNav.onSelect(id);
|
|
9115
9148
|
}
|
|
9116
9149
|
};
|
|
9117
|
-
const iconElement = hasIcon && !isSub ? /* @__PURE__ */
|
|
9118
|
-
/* @__PURE__ */
|
|
9119
|
-
showDot ? /* @__PURE__ */
|
|
9150
|
+
const iconElement = hasIcon && !isSub ? /* @__PURE__ */ jsxs52("span", { className: "stn-side-nav-item__icon-wrap", children: [
|
|
9151
|
+
/* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__icon", "aria-hidden": "true", children: icon ?? (resolvedIconSrc ? /* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__icon-glyph", style: maskStyle2(resolvedIconSrc) }) : null) }),
|
|
9152
|
+
showDot ? /* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__dot-wrap", "aria-hidden": "true", children: /* @__PURE__ */ jsx65(StnBadge, { variant: "dot", color: "error" }) }) : null
|
|
9120
9153
|
] }) : null;
|
|
9121
|
-
const subIconElement = hasIcon && isSub ? /* @__PURE__ */
|
|
9154
|
+
const subIconElement = hasIcon && isSub ? /* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__sub-icon", "aria-hidden": "true", children: icon ?? (resolvedIconSrc ? /* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__icon-glyph", style: maskStyle2(resolvedIconSrc) }) : null) }) : null;
|
|
9122
9155
|
const activeIconElement = isSub ? subIconElement : iconElement;
|
|
9123
|
-
return /* @__PURE__ */
|
|
9156
|
+
return /* @__PURE__ */ jsx65(
|
|
9124
9157
|
"button",
|
|
9125
9158
|
{
|
|
9126
9159
|
ref,
|
|
@@ -9139,10 +9172,10 @@ var StnSideNavItem = forwardRef33(function StnSideNavItem2({
|
|
|
9139
9172
|
title: collapsed ? label : void 0,
|
|
9140
9173
|
onClick: handleClick,
|
|
9141
9174
|
...rest,
|
|
9142
|
-
children: /* @__PURE__ */
|
|
9143
|
-
/* @__PURE__ */
|
|
9144
|
-
isSub && showSubIndent ? /* @__PURE__ */
|
|
9145
|
-
shouldShowSubDot ? /* @__PURE__ */
|
|
9175
|
+
children: /* @__PURE__ */ jsxs52("span", { className: cn("stn-side-nav-item__inner", spreadTrail && "spread"), children: [
|
|
9176
|
+
/* @__PURE__ */ jsxs52("span", { className: "stn-side-nav-item__lead", children: [
|
|
9177
|
+
isSub && showSubIndent ? /* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__sub-indent", "aria-hidden": "true" }) : null,
|
|
9178
|
+
shouldShowSubDot ? /* @__PURE__ */ jsx65(
|
|
9146
9179
|
"span",
|
|
9147
9180
|
{
|
|
9148
9181
|
className: cn(
|
|
@@ -9150,14 +9183,14 @@ var StnSideNavItem = forwardRef33(function StnSideNavItem2({
|
|
|
9150
9183
|
hasIcon && iconPosition === "left" && "compact"
|
|
9151
9184
|
),
|
|
9152
9185
|
"aria-hidden": "true",
|
|
9153
|
-
children: /* @__PURE__ */
|
|
9186
|
+
children: /* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__sub-dot-glyph", style: maskStyle2(STN_NAV_MENU_SUB_ICON) })
|
|
9154
9187
|
}
|
|
9155
9188
|
) : null,
|
|
9156
9189
|
iconPosition === "left" ? activeIconElement : null,
|
|
9157
|
-
/* @__PURE__ */
|
|
9190
|
+
/* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__label", children: label })
|
|
9158
9191
|
] }),
|
|
9159
9192
|
iconPosition === "right" ? activeIconElement : null,
|
|
9160
|
-
renderBadge ? typeof badge === "string" || typeof badge === "number" ? /* @__PURE__ */
|
|
9193
|
+
renderBadge ? typeof badge === "string" || typeof badge === "number" ? /* @__PURE__ */ jsx65(
|
|
9161
9194
|
StnBadge,
|
|
9162
9195
|
{
|
|
9163
9196
|
badgeContent: badge,
|
|
@@ -9165,7 +9198,7 @@ var StnSideNavItem = forwardRef33(function StnSideNavItem2({
|
|
|
9165
9198
|
appearance: "subtle",
|
|
9166
9199
|
className: "stn-side-nav-item__badge"
|
|
9167
9200
|
}
|
|
9168
|
-
) : badge ? /* @__PURE__ */
|
|
9201
|
+
) : badge ? /* @__PURE__ */ jsx65("span", { className: "stn-side-nav-item__badge", children: badge }) : showBadgeDot ? /* @__PURE__ */ jsx65(
|
|
9169
9202
|
StnBadge,
|
|
9170
9203
|
{
|
|
9171
9204
|
variant: "dot",
|
|
@@ -9173,7 +9206,7 @@ var StnSideNavItem = forwardRef33(function StnSideNavItem2({
|
|
|
9173
9206
|
className: "stn-side-nav-item__badge"
|
|
9174
9207
|
}
|
|
9175
9208
|
) : null : null,
|
|
9176
|
-
!isSub && showChevron && !collapsed ? /* @__PURE__ */
|
|
9209
|
+
!isSub && showChevron && !collapsed ? /* @__PURE__ */ jsx65(
|
|
9177
9210
|
"span",
|
|
9178
9211
|
{
|
|
9179
9212
|
className: cn(
|
|
@@ -9194,11 +9227,11 @@ import { forwardRef as forwardRef35 } from "react";
|
|
|
9194
9227
|
|
|
9195
9228
|
// src/components/sideNav/StnSideNavLogo.tsx
|
|
9196
9229
|
import { forwardRef as forwardRef34 } from "react";
|
|
9197
|
-
import { jsx as
|
|
9230
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
9198
9231
|
var StnSideNavLogo = forwardRef34(
|
|
9199
9232
|
function StnSideNavLogo2({ className, logoProps, ...rest }, ref) {
|
|
9200
9233
|
const { collapsed } = useSideNav();
|
|
9201
|
-
return /* @__PURE__ */
|
|
9234
|
+
return /* @__PURE__ */ jsx66(
|
|
9202
9235
|
"div",
|
|
9203
9236
|
{
|
|
9204
9237
|
ref,
|
|
@@ -9209,7 +9242,7 @@ var StnSideNavLogo = forwardRef34(
|
|
|
9209
9242
|
),
|
|
9210
9243
|
title: "InfoMap",
|
|
9211
9244
|
...rest,
|
|
9212
|
-
children: /* @__PURE__ */
|
|
9245
|
+
children: /* @__PURE__ */ jsx66(
|
|
9213
9246
|
StnLogo,
|
|
9214
9247
|
{
|
|
9215
9248
|
variant: collapsed ? "onlyimg" : "horizontal",
|
|
@@ -9223,7 +9256,7 @@ var StnSideNavLogo = forwardRef34(
|
|
|
9223
9256
|
);
|
|
9224
9257
|
|
|
9225
9258
|
// src/components/sideNav/StnSideNavHeader.tsx
|
|
9226
|
-
import { Fragment as Fragment9, jsx as
|
|
9259
|
+
import { Fragment as Fragment9, jsx as jsx67, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9227
9260
|
var StnSideNavHeader = forwardRef35(function StnSideNavHeader2({
|
|
9228
9261
|
children,
|
|
9229
9262
|
border = false,
|
|
@@ -9236,7 +9269,7 @@ var StnSideNavHeader = forwardRef35(function StnSideNavHeader2({
|
|
|
9236
9269
|
const { collapsed, onToggleCollapse, isDrawer, setMobileOpen } = useSideNav();
|
|
9237
9270
|
const withBorder = Boolean(border || hasBorder);
|
|
9238
9271
|
const shouldShowClose = showClose ?? Boolean(isDrawer);
|
|
9239
|
-
return /* @__PURE__ */
|
|
9272
|
+
return /* @__PURE__ */ jsx67(
|
|
9240
9273
|
"div",
|
|
9241
9274
|
{
|
|
9242
9275
|
ref,
|
|
@@ -9247,9 +9280,9 @@ var StnSideNavHeader = forwardRef35(function StnSideNavHeader2({
|
|
|
9247
9280
|
className
|
|
9248
9281
|
),
|
|
9249
9282
|
...rest,
|
|
9250
|
-
children: children ?? /* @__PURE__ */
|
|
9251
|
-
/* @__PURE__ */
|
|
9252
|
-
shouldShowClose ? /* @__PURE__ */
|
|
9283
|
+
children: children ?? /* @__PURE__ */ jsxs53(Fragment9, { children: [
|
|
9284
|
+
/* @__PURE__ */ jsx67(StnSideNavLogo, {}),
|
|
9285
|
+
shouldShowClose ? /* @__PURE__ */ jsx67(
|
|
9253
9286
|
StnButton,
|
|
9254
9287
|
{
|
|
9255
9288
|
size: "sm",
|
|
@@ -9261,7 +9294,7 @@ var StnSideNavHeader = forwardRef35(function StnSideNavHeader2({
|
|
|
9261
9294
|
className: "stn-side-nav__collapse-btn",
|
|
9262
9295
|
onClick: () => setMobileOpen?.(false)
|
|
9263
9296
|
}
|
|
9264
|
-
) : showToggle ? /* @__PURE__ */
|
|
9297
|
+
) : showToggle ? /* @__PURE__ */ jsx67(
|
|
9265
9298
|
StnButton,
|
|
9266
9299
|
{
|
|
9267
9300
|
size: "sm",
|
|
@@ -9281,7 +9314,7 @@ var StnSideNavHeader = forwardRef35(function StnSideNavHeader2({
|
|
|
9281
9314
|
|
|
9282
9315
|
// src/components/sideNav/StnSideNavMenu.tsx
|
|
9283
9316
|
import { forwardRef as forwardRef36 } from "react";
|
|
9284
|
-
import { jsx as
|
|
9317
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
9285
9318
|
var StnSideNavMenu = forwardRef36(function StnSideNavMenu2({
|
|
9286
9319
|
children,
|
|
9287
9320
|
className,
|
|
@@ -9289,7 +9322,7 @@ var StnSideNavMenu = forwardRef36(function StnSideNavMenu2({
|
|
|
9289
9322
|
scrollColor = "fade",
|
|
9290
9323
|
...rest
|
|
9291
9324
|
}, ref) {
|
|
9292
|
-
return /* @__PURE__ */
|
|
9325
|
+
return /* @__PURE__ */ jsx68(
|
|
9293
9326
|
"nav",
|
|
9294
9327
|
{
|
|
9295
9328
|
ref,
|
|
@@ -9315,7 +9348,7 @@ import {
|
|
|
9315
9348
|
useRef as useRef9,
|
|
9316
9349
|
useState as useState17
|
|
9317
9350
|
} from "react";
|
|
9318
|
-
import { jsx as
|
|
9351
|
+
import { jsx as jsx69, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
9319
9352
|
var StnSideNavGroup = forwardRef37(function StnSideNavGroup2({
|
|
9320
9353
|
label,
|
|
9321
9354
|
parent,
|
|
@@ -9360,7 +9393,7 @@ var StnSideNavGroup = forwardRef37(function StnSideNavGroup2({
|
|
|
9360
9393
|
}
|
|
9361
9394
|
onOpenChange?.(next);
|
|
9362
9395
|
};
|
|
9363
|
-
const subnavNode = children && (!collapsed && isOpen) ? /* @__PURE__ */
|
|
9396
|
+
const subnavNode = children && (!collapsed && isOpen) ? /* @__PURE__ */ jsx69(
|
|
9364
9397
|
"div",
|
|
9365
9398
|
{
|
|
9366
9399
|
className: cn(
|
|
@@ -9375,7 +9408,7 @@ var StnSideNavGroup = forwardRef37(function StnSideNavGroup2({
|
|
|
9375
9408
|
children
|
|
9376
9409
|
}
|
|
9377
9410
|
) : null;
|
|
9378
|
-
return /* @__PURE__ */
|
|
9411
|
+
return /* @__PURE__ */ jsxs54(
|
|
9379
9412
|
"div",
|
|
9380
9413
|
{
|
|
9381
9414
|
ref: (node) => {
|
|
@@ -9396,7 +9429,7 @@ var StnSideNavGroup = forwardRef37(function StnSideNavGroup2({
|
|
|
9396
9429
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
9397
9430
|
...rest,
|
|
9398
9431
|
children: [
|
|
9399
|
-
label && !collapsed ? /* @__PURE__ */
|
|
9432
|
+
label && !collapsed ? /* @__PURE__ */ jsx69("span", { className: "stn-side-nav__group-label", onClick: handleToggle, children: label }) : null,
|
|
9400
9433
|
isUp ? subnavNode : null,
|
|
9401
9434
|
parent,
|
|
9402
9435
|
!isUp ? subnavNode : null
|
|
@@ -9407,9 +9440,9 @@ var StnSideNavGroup = forwardRef37(function StnSideNavGroup2({
|
|
|
9407
9440
|
|
|
9408
9441
|
// src/components/sideNav/StnSideNavSpacer.tsx
|
|
9409
9442
|
import { forwardRef as forwardRef38 } from "react";
|
|
9410
|
-
import { jsx as
|
|
9443
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
9411
9444
|
var StnSideNavSpacer = forwardRef38(function StnSideNavSpacer2({ className, style, ...rest }, ref) {
|
|
9412
|
-
return /* @__PURE__ */
|
|
9445
|
+
return /* @__PURE__ */ jsx70(
|
|
9413
9446
|
"div",
|
|
9414
9447
|
{
|
|
9415
9448
|
ref,
|
|
@@ -9423,9 +9456,9 @@ var StnSideNavSpacer = forwardRef38(function StnSideNavSpacer2({ className, styl
|
|
|
9423
9456
|
|
|
9424
9457
|
// src/components/sideNav/StnSideNavFooter.tsx
|
|
9425
9458
|
import { forwardRef as forwardRef39 } from "react";
|
|
9426
|
-
import { jsx as
|
|
9459
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
9427
9460
|
var StnSideNavFooter = forwardRef39(function StnSideNavFooter2({ curved = false, children, className, ...rest }, ref) {
|
|
9428
|
-
return /* @__PURE__ */
|
|
9461
|
+
return /* @__PURE__ */ jsx71(
|
|
9429
9462
|
"nav",
|
|
9430
9463
|
{
|
|
9431
9464
|
ref,
|
|
@@ -9439,11 +9472,11 @@ var StnSideNavFooter = forwardRef39(function StnSideNavFooter2({ curved = false,
|
|
|
9439
9472
|
|
|
9440
9473
|
// src/components/sideNav/StnSideNavToggle.tsx
|
|
9441
9474
|
import { forwardRef as forwardRef40 } from "react";
|
|
9442
|
-
import { jsx as
|
|
9475
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
9443
9476
|
var StnSideNavToggle = forwardRef40(
|
|
9444
9477
|
function StnSideNavToggle2({ className, onClick, ...rest }, ref) {
|
|
9445
9478
|
const { collapsed, onToggleCollapse } = useSideNav();
|
|
9446
|
-
return /* @__PURE__ */
|
|
9479
|
+
return /* @__PURE__ */ jsx72(
|
|
9447
9480
|
"button",
|
|
9448
9481
|
{
|
|
9449
9482
|
ref,
|
|
@@ -9456,7 +9489,7 @@ var StnSideNavToggle = forwardRef40(
|
|
|
9456
9489
|
"aria-label": collapsed ? "\uC0AC\uC774\uB4DC\uBC14 \uD3BC\uCE58\uAE30" : "\uC0AC\uC774\uB4DC\uBC14 \uC811\uAE30",
|
|
9457
9490
|
title: collapsed ? "\uC0AC\uC774\uB4DC\uBC14 \uD3BC\uCE58\uAE30" : "\uC0AC\uC774\uB4DC\uBC14 \uC811\uAE30",
|
|
9458
9491
|
...rest,
|
|
9459
|
-
children: /* @__PURE__ */
|
|
9492
|
+
children: /* @__PURE__ */ jsx72(
|
|
9460
9493
|
"svg",
|
|
9461
9494
|
{
|
|
9462
9495
|
width: "12",
|
|
@@ -9467,7 +9500,7 @@ var StnSideNavToggle = forwardRef40(
|
|
|
9467
9500
|
strokeWidth: "2.5",
|
|
9468
9501
|
strokeLinecap: "round",
|
|
9469
9502
|
strokeLinejoin: "round",
|
|
9470
|
-
children: /* @__PURE__ */
|
|
9503
|
+
children: /* @__PURE__ */ jsx72("path", { d: "M9 18l6-6-6-6" })
|
|
9471
9504
|
}
|
|
9472
9505
|
)
|
|
9473
9506
|
}
|
|
@@ -9477,17 +9510,17 @@ var StnSideNavToggle = forwardRef40(
|
|
|
9477
9510
|
|
|
9478
9511
|
// src/components/sideNav/StnSideNavWatermark.tsx
|
|
9479
9512
|
import { forwardRef as forwardRef41 } from "react";
|
|
9480
|
-
import { jsx as
|
|
9513
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9481
9514
|
var StnSideNavWatermark = forwardRef41(
|
|
9482
9515
|
function StnSideNavWatermark2({ size = "xl", mode, theme, className, ...rest }, ref) {
|
|
9483
|
-
return /* @__PURE__ */
|
|
9516
|
+
return /* @__PURE__ */ jsx73(
|
|
9484
9517
|
"div",
|
|
9485
9518
|
{
|
|
9486
9519
|
ref,
|
|
9487
9520
|
className: cn("stn-side-nav__watermark", className),
|
|
9488
9521
|
"aria-hidden": "true",
|
|
9489
9522
|
...rest,
|
|
9490
|
-
children: /* @__PURE__ */
|
|
9523
|
+
children: /* @__PURE__ */ jsx73(StnLogo, { variant: "watermark", size, mode: mode ?? theme })
|
|
9491
9524
|
}
|
|
9492
9525
|
);
|
|
9493
9526
|
}
|
|
@@ -9495,7 +9528,7 @@ var StnSideNavWatermark = forwardRef41(
|
|
|
9495
9528
|
|
|
9496
9529
|
// src/components/sideNav/StnSideNavMobileTrigger.tsx
|
|
9497
9530
|
import { forwardRef as forwardRef42, useEffect as useEffect14, useState as useState18 } from "react";
|
|
9498
|
-
import { jsx as
|
|
9531
|
+
import { jsx as jsx74, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
9499
9532
|
var StnSideNavMobileTrigger = forwardRef42(
|
|
9500
9533
|
function StnSideNavMobileTrigger2({ floating = false, className, children, onClick, ...rest }, ref) {
|
|
9501
9534
|
const { onToggleMobileOpen, mobileOpen: contextMobileOpen } = useSideNav();
|
|
@@ -9514,7 +9547,7 @@ var StnSideNavMobileTrigger = forwardRef42(
|
|
|
9514
9547
|
};
|
|
9515
9548
|
}, [onToggleMobileOpen]);
|
|
9516
9549
|
const isMobileOpen = onToggleMobileOpen ? contextMobileOpen : fallbackMobileOpen;
|
|
9517
|
-
return /* @__PURE__ */
|
|
9550
|
+
return /* @__PURE__ */ jsx74(
|
|
9518
9551
|
"button",
|
|
9519
9552
|
{
|
|
9520
9553
|
ref,
|
|
@@ -9536,10 +9569,10 @@ var StnSideNavMobileTrigger = forwardRef42(
|
|
|
9536
9569
|
}
|
|
9537
9570
|
},
|
|
9538
9571
|
...rest,
|
|
9539
|
-
children: children ?? /* @__PURE__ */
|
|
9540
|
-
/* @__PURE__ */
|
|
9541
|
-
/* @__PURE__ */
|
|
9542
|
-
/* @__PURE__ */
|
|
9572
|
+
children: children ?? /* @__PURE__ */ jsxs55("span", { className: "stn-side-nav__hamburger-bars", "aria-hidden": "true", children: [
|
|
9573
|
+
/* @__PURE__ */ jsx74("span", {}),
|
|
9574
|
+
/* @__PURE__ */ jsx74("span", {}),
|
|
9575
|
+
/* @__PURE__ */ jsx74("span", {})
|
|
9543
9576
|
] })
|
|
9544
9577
|
}
|
|
9545
9578
|
);
|
|
@@ -9550,10 +9583,10 @@ var StnSideNavMobileTrigger = forwardRef42(
|
|
|
9550
9583
|
import {
|
|
9551
9584
|
forwardRef as forwardRef43
|
|
9552
9585
|
} from "react";
|
|
9553
|
-
import { jsx as
|
|
9586
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
9554
9587
|
var StnSideNavSub = forwardRef43(
|
|
9555
9588
|
function StnSideNavSub2({ children, className, ...rest }, ref) {
|
|
9556
|
-
return /* @__PURE__ */
|
|
9589
|
+
return /* @__PURE__ */ jsx75(
|
|
9557
9590
|
"div",
|
|
9558
9591
|
{
|
|
9559
9592
|
ref,
|
|
@@ -9582,14 +9615,14 @@ var StnSideNavSubItem = forwardRef43(
|
|
|
9582
9615
|
const { collapsed } = useSideNav();
|
|
9583
9616
|
const content = children ?? label;
|
|
9584
9617
|
const computedTitle = title ?? (typeof content === "string" ? content : void 0);
|
|
9585
|
-
const resolvedIcon = icon ?? (iconSrc ? /* @__PURE__ */
|
|
9618
|
+
const resolvedIcon = icon ?? (iconSrc ? /* @__PURE__ */ jsx75("span", { className: "stn-side-nav__sub-icon", children: /* @__PURE__ */ jsx75(
|
|
9586
9619
|
"span",
|
|
9587
9620
|
{
|
|
9588
9621
|
className: "stn-side-nav__sub-glyph",
|
|
9589
9622
|
style: { maskImage: `url('${iconSrc}')`, WebkitMaskImage: `url('${iconSrc}')` }
|
|
9590
9623
|
}
|
|
9591
9624
|
) }) : null);
|
|
9592
|
-
return /* @__PURE__ */
|
|
9625
|
+
return /* @__PURE__ */ jsx75(
|
|
9593
9626
|
StnButton,
|
|
9594
9627
|
{
|
|
9595
9628
|
ref,
|
|
@@ -9609,7 +9642,7 @@ var StnSideNavSubItem = forwardRef43(
|
|
|
9609
9642
|
|
|
9610
9643
|
// src/components/sideNav/StnSideNavSubNav.tsx
|
|
9611
9644
|
import { forwardRef as forwardRef44 } from "react";
|
|
9612
|
-
import { jsx as
|
|
9645
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
9613
9646
|
var StnSideNavSubNav = forwardRef44(
|
|
9614
9647
|
function StnSideNavSubNav2({
|
|
9615
9648
|
dropdown = false,
|
|
@@ -9622,7 +9655,7 @@ var StnSideNavSubNav = forwardRef44(
|
|
|
9622
9655
|
}, ref) {
|
|
9623
9656
|
const isUp = direction === "up";
|
|
9624
9657
|
const isTransparent = variant === "transparent" || background === false;
|
|
9625
|
-
return /* @__PURE__ */
|
|
9658
|
+
return /* @__PURE__ */ jsx76(
|
|
9626
9659
|
"div",
|
|
9627
9660
|
{
|
|
9628
9661
|
ref,
|
|
@@ -9651,7 +9684,7 @@ import {
|
|
|
9651
9684
|
useMemo as useMemo5,
|
|
9652
9685
|
useState as useState19
|
|
9653
9686
|
} from "react";
|
|
9654
|
-
import { jsx as
|
|
9687
|
+
import { jsx as jsx77, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
9655
9688
|
function useControllableState(controlledValue, defaultValue, onChange) {
|
|
9656
9689
|
const [internalState, setInternalState] = useState19(defaultValue);
|
|
9657
9690
|
const isControlled = controlledValue !== void 0;
|
|
@@ -9744,9 +9777,9 @@ var StnSideNavigationRoot = forwardRef45(function StnSideNavigationRoot2({
|
|
|
9744
9777
|
}),
|
|
9745
9778
|
[isEffectiveCollapsed, activeId, setActiveId, handleToggleCollapse, mobileOpen, handleToggleMobileOpen, setMobileOpen, isDrawerMode]
|
|
9746
9779
|
);
|
|
9747
|
-
return /* @__PURE__ */
|
|
9748
|
-
showMobileTrigger && /* @__PURE__ */
|
|
9749
|
-
(drawer || responsiveDrawer) && /* @__PURE__ */
|
|
9780
|
+
return /* @__PURE__ */ jsxs56(SideNavContext.Provider, { value: contextValue, children: [
|
|
9781
|
+
showMobileTrigger && /* @__PURE__ */ jsx77(StnSideNavMobileTrigger, { floating: true }),
|
|
9782
|
+
(drawer || responsiveDrawer) && /* @__PURE__ */ jsx77(
|
|
9750
9783
|
"div",
|
|
9751
9784
|
{
|
|
9752
9785
|
className: cn("stn-side-nav__backdrop", mobileOpen && "is-open"),
|
|
@@ -9754,7 +9787,7 @@ var StnSideNavigationRoot = forwardRef45(function StnSideNavigationRoot2({
|
|
|
9754
9787
|
"aria-hidden": !mobileOpen
|
|
9755
9788
|
}
|
|
9756
9789
|
),
|
|
9757
|
-
/* @__PURE__ */
|
|
9790
|
+
/* @__PURE__ */ jsx77(
|
|
9758
9791
|
"aside",
|
|
9759
9792
|
{
|
|
9760
9793
|
ref,
|
|
@@ -9803,7 +9836,7 @@ import {
|
|
|
9803
9836
|
import {
|
|
9804
9837
|
STN_BREADCRUMB_ICON_SRC
|
|
9805
9838
|
} from "@stn-uiux/pub-ui/data/stnBreadcrumb";
|
|
9806
|
-
import { Fragment as Fragment11, jsx as
|
|
9839
|
+
import { Fragment as Fragment11, jsx as jsx78, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
9807
9840
|
function maskStyle3(src) {
|
|
9808
9841
|
return { maskImage: `url('${src}')`, WebkitMaskImage: `url('${src}')` };
|
|
9809
9842
|
}
|
|
@@ -9816,13 +9849,13 @@ function hasSegmentMenu(item) {
|
|
|
9816
9849
|
return Boolean(item.menu || item.menuItems && item.menuItems.length > 0);
|
|
9817
9850
|
}
|
|
9818
9851
|
function BreadcrumbSeparator() {
|
|
9819
|
-
return /* @__PURE__ */
|
|
9852
|
+
return /* @__PURE__ */ jsx78("li", { className: "separator", "aria-hidden": "true", children: /* @__PURE__ */ jsx78("span", { style: maskStyle3(STN_BREADCRUMB_ICON_SRC.separator) }) });
|
|
9820
9853
|
}
|
|
9821
9854
|
function BreadcrumbIcon({ src }) {
|
|
9822
|
-
return /* @__PURE__ */
|
|
9855
|
+
return /* @__PURE__ */ jsx78("span", { className: "stn-breadcrumb__icon-glyph", style: maskStyle3(src), "aria-hidden": "true" });
|
|
9823
9856
|
}
|
|
9824
9857
|
function BreadcrumbCaret() {
|
|
9825
|
-
return /* @__PURE__ */
|
|
9858
|
+
return /* @__PURE__ */ jsx78(
|
|
9826
9859
|
"span",
|
|
9827
9860
|
{
|
|
9828
9861
|
className: "stn-breadcrumb__caret",
|
|
@@ -9836,10 +9869,10 @@ function SegmentContent({
|
|
|
9836
9869
|
label,
|
|
9837
9870
|
menu
|
|
9838
9871
|
}) {
|
|
9839
|
-
return /* @__PURE__ */
|
|
9840
|
-
iconSrc ? /* @__PURE__ */
|
|
9841
|
-
/* @__PURE__ */
|
|
9842
|
-
menu ? /* @__PURE__ */
|
|
9872
|
+
return /* @__PURE__ */ jsxs57(Fragment11, { children: [
|
|
9873
|
+
iconSrc ? /* @__PURE__ */ jsx78(BreadcrumbIcon, { src: iconSrc }) : null,
|
|
9874
|
+
/* @__PURE__ */ jsx78("span", { className: "stn-breadcrumb__label", children: label }),
|
|
9875
|
+
menu ? /* @__PURE__ */ jsx78(BreadcrumbCaret, {}) : null
|
|
9843
9876
|
] });
|
|
9844
9877
|
}
|
|
9845
9878
|
function BreadcrumbMenuList({
|
|
@@ -9847,7 +9880,7 @@ function BreadcrumbMenuList({
|
|
|
9847
9880
|
items,
|
|
9848
9881
|
onPick
|
|
9849
9882
|
}) {
|
|
9850
|
-
return /* @__PURE__ */
|
|
9883
|
+
return /* @__PURE__ */ jsx78("ul", { id, className: "stn-breadcrumb__menu", role: "menu", children: items.map((option) => /* @__PURE__ */ jsx78("li", { role: "none", children: option.href ? /* @__PURE__ */ jsx78(
|
|
9851
9884
|
"a",
|
|
9852
9885
|
{
|
|
9853
9886
|
role: "menuitem",
|
|
@@ -9859,7 +9892,7 @@ function BreadcrumbMenuList({
|
|
|
9859
9892
|
},
|
|
9860
9893
|
children: option.label
|
|
9861
9894
|
}
|
|
9862
|
-
) : /* @__PURE__ */
|
|
9895
|
+
) : /* @__PURE__ */ jsx78(
|
|
9863
9896
|
"button",
|
|
9864
9897
|
{
|
|
9865
9898
|
type: "button",
|
|
@@ -9903,13 +9936,13 @@ function BreadcrumbSegment({
|
|
|
9903
9936
|
const canOpenMenu = showMenu && menuItems.length > 0;
|
|
9904
9937
|
const rootRef = useDismissibleMenu(open, () => setOpen(false));
|
|
9905
9938
|
const iconSrc = resolveIconSrc(item);
|
|
9906
|
-
const content = /* @__PURE__ */
|
|
9939
|
+
const content = /* @__PURE__ */ jsx78(SegmentContent, { iconSrc, label: item.label, menu: showMenu });
|
|
9907
9940
|
if (isCurrent) {
|
|
9908
|
-
return /* @__PURE__ */
|
|
9941
|
+
return /* @__PURE__ */ jsx78("span", { className: "stn-breadcrumb__segment", "aria-current": "page", "aria-label": item.label, children: content });
|
|
9909
9942
|
}
|
|
9910
9943
|
if (canOpenMenu) {
|
|
9911
|
-
return /* @__PURE__ */
|
|
9912
|
-
/* @__PURE__ */
|
|
9944
|
+
return /* @__PURE__ */ jsxs57("span", { ref: rootRef, className: "stn-breadcrumb__segment-wrap", children: [
|
|
9945
|
+
/* @__PURE__ */ jsx78(
|
|
9913
9946
|
"button",
|
|
9914
9947
|
{
|
|
9915
9948
|
type: "button",
|
|
@@ -9925,7 +9958,7 @@ function BreadcrumbSegment({
|
|
|
9925
9958
|
children: content
|
|
9926
9959
|
}
|
|
9927
9960
|
),
|
|
9928
|
-
open ? /* @__PURE__ */
|
|
9961
|
+
open ? /* @__PURE__ */ jsx78(BreadcrumbMenuList, { id: menuId, items: menuItems, onPick: () => setOpen(false) }) : null
|
|
9929
9962
|
] });
|
|
9930
9963
|
}
|
|
9931
9964
|
if (item.menu || item.onClick) {
|
|
@@ -9937,7 +9970,7 @@ function BreadcrumbSegment({
|
|
|
9937
9970
|
"aria-haspopup": item.menu ? "menu" : void 0,
|
|
9938
9971
|
"aria-expanded": item.menu ? false : void 0
|
|
9939
9972
|
};
|
|
9940
|
-
return /* @__PURE__ */
|
|
9973
|
+
return /* @__PURE__ */ jsx78("button", { ...buttonProps, children: content });
|
|
9941
9974
|
}
|
|
9942
9975
|
if (item.href) {
|
|
9943
9976
|
const linkProps = {
|
|
@@ -9946,17 +9979,17 @@ function BreadcrumbSegment({
|
|
|
9946
9979
|
onClick: item.onClick,
|
|
9947
9980
|
"aria-label": item.label
|
|
9948
9981
|
};
|
|
9949
|
-
return /* @__PURE__ */
|
|
9982
|
+
return /* @__PURE__ */ jsx78("a", { ...linkProps, children: content });
|
|
9950
9983
|
}
|
|
9951
|
-
return /* @__PURE__ */
|
|
9984
|
+
return /* @__PURE__ */ jsx78("span", { className: "stn-breadcrumb__segment", "aria-label": item.label, children: content });
|
|
9952
9985
|
}
|
|
9953
9986
|
function BreadcrumbBack({
|
|
9954
9987
|
label,
|
|
9955
9988
|
href,
|
|
9956
9989
|
onClick
|
|
9957
9990
|
}) {
|
|
9958
|
-
const content = /* @__PURE__ */
|
|
9959
|
-
/* @__PURE__ */
|
|
9991
|
+
const content = /* @__PURE__ */ jsxs57(Fragment11, { children: [
|
|
9992
|
+
/* @__PURE__ */ jsx78(
|
|
9960
9993
|
"span",
|
|
9961
9994
|
{
|
|
9962
9995
|
className: "stn-breadcrumb__back-glyph",
|
|
@@ -9964,12 +9997,12 @@ function BreadcrumbBack({
|
|
|
9964
9997
|
"aria-hidden": "true"
|
|
9965
9998
|
}
|
|
9966
9999
|
),
|
|
9967
|
-
/* @__PURE__ */
|
|
10000
|
+
/* @__PURE__ */ jsx78("span", { className: "stn-breadcrumb__label", children: label })
|
|
9968
10001
|
] });
|
|
9969
10002
|
if (href) {
|
|
9970
|
-
return /* @__PURE__ */
|
|
10003
|
+
return /* @__PURE__ */ jsx78("a", { className: "stn-breadcrumb__back", href, onClick, "aria-label": `\uB4A4\uB85C: ${label}`, children: content });
|
|
9971
10004
|
}
|
|
9972
|
-
return /* @__PURE__ */
|
|
10005
|
+
return /* @__PURE__ */ jsx78("button", { type: "button", className: "stn-breadcrumb__back", onClick, "aria-label": `\uB4A4\uB85C: ${label}`, children: content });
|
|
9973
10006
|
}
|
|
9974
10007
|
function splitCollapsedItems(items, maxItems, itemsBeforeCollapse, itemsAfterCollapse) {
|
|
9975
10008
|
if (!maxItems || items.length <= maxItems) {
|
|
@@ -10000,8 +10033,8 @@ function BreadcrumbCollapsed({
|
|
|
10000
10033
|
onClick: item.onClick,
|
|
10001
10034
|
current: item.current
|
|
10002
10035
|
}));
|
|
10003
|
-
return /* @__PURE__ */
|
|
10004
|
-
/* @__PURE__ */
|
|
10036
|
+
return /* @__PURE__ */ jsxs57("li", { className: "stn-breadcrumb__item", ref: rootRef, children: [
|
|
10037
|
+
/* @__PURE__ */ jsx78(
|
|
10005
10038
|
"button",
|
|
10006
10039
|
{
|
|
10007
10040
|
type: "button",
|
|
@@ -10014,7 +10047,7 @@ function BreadcrumbCollapsed({
|
|
|
10014
10047
|
children: "\u22EF"
|
|
10015
10048
|
}
|
|
10016
10049
|
),
|
|
10017
|
-
open ? /* @__PURE__ */
|
|
10050
|
+
open ? /* @__PURE__ */ jsx78(BreadcrumbMenuList, { id: menuId, items: menuItems, onPick: () => setOpen(false) }) : null
|
|
10018
10051
|
] });
|
|
10019
10052
|
}
|
|
10020
10053
|
function StnBreadcrumb({
|
|
@@ -10046,8 +10079,8 @@ function StnBreadcrumb({
|
|
|
10046
10079
|
const lastId = items[items.length - 1]?.id;
|
|
10047
10080
|
const renderTrailItem = (item) => {
|
|
10048
10081
|
const isCurrent = Boolean(item.current) || item.id === lastId;
|
|
10049
|
-
const segment = /* @__PURE__ */
|
|
10050
|
-
return /* @__PURE__ */
|
|
10082
|
+
const segment = /* @__PURE__ */ jsx78(BreadcrumbSegment, { item, isCurrent });
|
|
10083
|
+
return /* @__PURE__ */ jsx78(
|
|
10051
10084
|
"li",
|
|
10052
10085
|
{
|
|
10053
10086
|
className: cn(
|
|
@@ -10058,27 +10091,27 @@ function StnBreadcrumb({
|
|
|
10058
10091
|
}
|
|
10059
10092
|
);
|
|
10060
10093
|
};
|
|
10061
|
-
return /* @__PURE__ */
|
|
10094
|
+
return /* @__PURE__ */ jsx78(
|
|
10062
10095
|
"nav",
|
|
10063
10096
|
{
|
|
10064
10097
|
className: cn("stn-breadcrumb", size, variant === "chip" && "chip", className),
|
|
10065
10098
|
"aria-label": "Breadcrumb",
|
|
10066
|
-
children: /* @__PURE__ */
|
|
10067
|
-
currentItem ? /* @__PURE__ */
|
|
10068
|
-
showHome ? /* @__PURE__ */
|
|
10069
|
-
/* @__PURE__ */
|
|
10070
|
-
/* @__PURE__ */
|
|
10099
|
+
children: /* @__PURE__ */ jsxs57("ol", { className: "stn-breadcrumb__list", children: [
|
|
10100
|
+
currentItem ? /* @__PURE__ */ jsx78("li", { className: "stn-breadcrumb__item stn-breadcrumb__item--back", children: /* @__PURE__ */ jsx78(BreadcrumbBack, { label: currentItem.label, href: backHref, onClick: backOnClick }) }) : null,
|
|
10101
|
+
showHome ? /* @__PURE__ */ jsx78("li", { className: "stn-breadcrumb__item stn-breadcrumb__item--home", children: /* @__PURE__ */ jsxs57("a", { className: "stn-breadcrumb__home", href: homeHref, onClick: onHomeClick, children: [
|
|
10102
|
+
/* @__PURE__ */ jsx78(BreadcrumbIcon, { src: STN_BREADCRUMB_ICON_SRC.home }),
|
|
10103
|
+
/* @__PURE__ */ jsx78("span", { className: "blind", children: homeLabel })
|
|
10071
10104
|
] }) }) : null,
|
|
10072
|
-
head.map((item, index) => /* @__PURE__ */
|
|
10073
|
-
showHome || index > 0 ? /* @__PURE__ */
|
|
10105
|
+
head.map((item, index) => /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
10106
|
+
showHome || index > 0 ? /* @__PURE__ */ jsx78(BreadcrumbSeparator, {}) : null,
|
|
10074
10107
|
renderTrailItem(item)
|
|
10075
10108
|
] }, item.id)),
|
|
10076
|
-
hidden.length > 0 ? /* @__PURE__ */
|
|
10077
|
-
/* @__PURE__ */
|
|
10078
|
-
/* @__PURE__ */
|
|
10109
|
+
hidden.length > 0 ? /* @__PURE__ */ jsxs57(Fragment11, { children: [
|
|
10110
|
+
/* @__PURE__ */ jsx78(BreadcrumbSeparator, {}),
|
|
10111
|
+
/* @__PURE__ */ jsx78(BreadcrumbCollapsed, { items: hidden, menuId })
|
|
10079
10112
|
] }) : null,
|
|
10080
|
-
tail.map((item) => /* @__PURE__ */
|
|
10081
|
-
/* @__PURE__ */
|
|
10113
|
+
tail.map((item) => /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
10114
|
+
/* @__PURE__ */ jsx78(BreadcrumbSeparator, {}),
|
|
10082
10115
|
renderTrailItem(item)
|
|
10083
10116
|
] }, item.id))
|
|
10084
10117
|
] })
|
|
@@ -10089,7 +10122,7 @@ function StnBreadcrumb({
|
|
|
10089
10122
|
// src/components/StnHeaderTitle.tsx
|
|
10090
10123
|
import { useEffect as useEffect17, useState as useState21 } from "react";
|
|
10091
10124
|
import { STN_HEADER_TITLE_FRAME } from "@stn-uiux/pub-ui/data/stnHeaderTitle";
|
|
10092
|
-
import { jsx as
|
|
10125
|
+
import { jsx as jsx79, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
10093
10126
|
var KO_WEEKDAY_SHORT = ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
|
|
10094
10127
|
var KO_WEEKDAY_LONG = [
|
|
10095
10128
|
"\uC77C\uC694\uC77C",
|
|
@@ -10128,8 +10161,8 @@ function formatStnHeaderTitleTime(date, options) {
|
|
|
10128
10161
|
}
|
|
10129
10162
|
function HeaderTitleFrame({ preview = false }) {
|
|
10130
10163
|
const frameClass = preview ? "stn-header-title__frame-preview" : "stn-header-title__frame";
|
|
10131
|
-
return /* @__PURE__ */
|
|
10132
|
-
/* @__PURE__ */
|
|
10164
|
+
return /* @__PURE__ */ jsxs58("div", { className: frameClass, "aria-hidden": "true", children: [
|
|
10165
|
+
/* @__PURE__ */ jsx79("div", { className: "stn-header-title__frame-bleed stn-header-title__frame-bleed--outer", children: /* @__PURE__ */ jsx79(
|
|
10133
10166
|
"img",
|
|
10134
10167
|
{
|
|
10135
10168
|
className: "stn-header-title__frame-img",
|
|
@@ -10138,8 +10171,8 @@ function HeaderTitleFrame({ preview = false }) {
|
|
|
10138
10171
|
draggable: false
|
|
10139
10172
|
}
|
|
10140
10173
|
) }),
|
|
10141
|
-
/* @__PURE__ */
|
|
10142
|
-
/* @__PURE__ */
|
|
10174
|
+
/* @__PURE__ */ jsxs58("div", { className: "stn-header-title__frame-bleed stn-header-title__frame-bleed--inner", children: [
|
|
10175
|
+
/* @__PURE__ */ jsx79(
|
|
10143
10176
|
"img",
|
|
10144
10177
|
{
|
|
10145
10178
|
className: "stn-header-title__frame-img stn-header-title__frame-img--dark",
|
|
@@ -10148,7 +10181,7 @@ function HeaderTitleFrame({ preview = false }) {
|
|
|
10148
10181
|
draggable: false
|
|
10149
10182
|
}
|
|
10150
10183
|
),
|
|
10151
|
-
/* @__PURE__ */
|
|
10184
|
+
/* @__PURE__ */ jsx79(
|
|
10152
10185
|
"img",
|
|
10153
10186
|
{
|
|
10154
10187
|
className: "stn-header-title__frame-img stn-header-title__frame-img--light",
|
|
@@ -10161,7 +10194,7 @@ function HeaderTitleFrame({ preview = false }) {
|
|
|
10161
10194
|
] });
|
|
10162
10195
|
}
|
|
10163
10196
|
function StnHeaderTitleFramePreview({ className }) {
|
|
10164
|
-
return /* @__PURE__ */
|
|
10197
|
+
return /* @__PURE__ */ jsx79("div", { className: cn("stn-header-title__frame-only", className), children: /* @__PURE__ */ jsx79(HeaderTitleFrame, { preview: true }) });
|
|
10165
10198
|
}
|
|
10166
10199
|
function useLiveClock(enabled) {
|
|
10167
10200
|
const [now, setNow] = useState21(() => /* @__PURE__ */ new Date());
|
|
@@ -10177,35 +10210,35 @@ function StnHeaderTitleMainText({
|
|
|
10177
10210
|
children,
|
|
10178
10211
|
...rest
|
|
10179
10212
|
}) {
|
|
10180
|
-
return /* @__PURE__ */
|
|
10213
|
+
return /* @__PURE__ */ jsx79("h1", { className: cn("stn-header-title__text", className), ...rest, children });
|
|
10181
10214
|
}
|
|
10182
10215
|
function StnHeaderTitleSubText({
|
|
10183
10216
|
className,
|
|
10184
10217
|
children,
|
|
10185
10218
|
...rest
|
|
10186
10219
|
}) {
|
|
10187
|
-
return /* @__PURE__ */
|
|
10220
|
+
return /* @__PURE__ */ jsx79("span", { className: cn("stn-header-title__sub-text", className), ...rest, children });
|
|
10188
10221
|
}
|
|
10189
10222
|
function StnHeaderTitleDate({
|
|
10190
10223
|
className,
|
|
10191
10224
|
children,
|
|
10192
10225
|
...rest
|
|
10193
10226
|
}) {
|
|
10194
|
-
return /* @__PURE__ */
|
|
10227
|
+
return /* @__PURE__ */ jsx79("time", { className: cn("stn-header-title__date", className), ...rest, children });
|
|
10195
10228
|
}
|
|
10196
10229
|
function StnHeaderTitleWeekday({
|
|
10197
10230
|
className,
|
|
10198
10231
|
children,
|
|
10199
10232
|
...rest
|
|
10200
10233
|
}) {
|
|
10201
|
-
return /* @__PURE__ */
|
|
10234
|
+
return /* @__PURE__ */ jsx79("span", { className: cn("stn-header-title__weekday", className), ...rest, children });
|
|
10202
10235
|
}
|
|
10203
10236
|
function StnHeaderTitleTime({
|
|
10204
10237
|
className,
|
|
10205
10238
|
children,
|
|
10206
10239
|
...rest
|
|
10207
10240
|
}) {
|
|
10208
|
-
return /* @__PURE__ */
|
|
10241
|
+
return /* @__PURE__ */ jsx79("span", { className: cn("stn-header-title__time", className), "aria-label": "\uD604\uC7AC \uC2DC\uAC01", ...rest, children });
|
|
10209
10242
|
}
|
|
10210
10243
|
function StnHeaderTitleClock({
|
|
10211
10244
|
className,
|
|
@@ -10228,7 +10261,7 @@ function StnHeaderTitleClock({
|
|
|
10228
10261
|
}) {
|
|
10229
10262
|
const now = useLiveClock(live);
|
|
10230
10263
|
if (children != null) {
|
|
10231
|
-
return /* @__PURE__ */
|
|
10264
|
+
return /* @__PURE__ */ jsxs58(
|
|
10232
10265
|
"header",
|
|
10233
10266
|
{
|
|
10234
10267
|
className: cn(
|
|
@@ -10240,8 +10273,8 @@ function StnHeaderTitleClock({
|
|
|
10240
10273
|
),
|
|
10241
10274
|
...rest,
|
|
10242
10275
|
children: [
|
|
10243
|
-
framed ? /* @__PURE__ */
|
|
10244
|
-
/* @__PURE__ */
|
|
10276
|
+
framed ? /* @__PURE__ */ jsx79(HeaderTitleFrame, {}) : null,
|
|
10277
|
+
/* @__PURE__ */ jsx79("div", { className: "stn-header-title__content", children })
|
|
10245
10278
|
]
|
|
10246
10279
|
}
|
|
10247
10280
|
);
|
|
@@ -10271,7 +10304,7 @@ function StnHeaderTitleClock({
|
|
|
10271
10304
|
resolvedTime = formatStnHeaderTitleTime(now, { showSeconds });
|
|
10272
10305
|
}
|
|
10273
10306
|
}
|
|
10274
|
-
return /* @__PURE__ */
|
|
10307
|
+
return /* @__PURE__ */ jsxs58(
|
|
10275
10308
|
"header",
|
|
10276
10309
|
{
|
|
10277
10310
|
className: cn(
|
|
@@ -10283,11 +10316,11 @@ function StnHeaderTitleClock({
|
|
|
10283
10316
|
),
|
|
10284
10317
|
...rest,
|
|
10285
10318
|
children: [
|
|
10286
|
-
framed ? /* @__PURE__ */
|
|
10287
|
-
/* @__PURE__ */
|
|
10288
|
-
resolvedDate ? /* @__PURE__ */
|
|
10289
|
-
showWeekdayOnly ? /* @__PURE__ */
|
|
10290
|
-
resolvedTime ? /* @__PURE__ */
|
|
10319
|
+
framed ? /* @__PURE__ */ jsx79(HeaderTitleFrame, {}) : null,
|
|
10320
|
+
/* @__PURE__ */ jsxs58("div", { className: "stn-header-title__content", children: [
|
|
10321
|
+
resolvedDate ? /* @__PURE__ */ jsx79("time", { className: "stn-header-title__date", dateTime: resolvedDate, children: resolvedDate }) : null,
|
|
10322
|
+
showWeekdayOnly ? /* @__PURE__ */ jsx79("span", { className: "stn-header-title__weekday", children: resolvedWeekday }) : null,
|
|
10323
|
+
resolvedTime ? /* @__PURE__ */ jsx79("span", { className: "stn-header-title__time", "aria-label": "\uD604\uC7AC \uC2DC\uAC01", children: resolvedTime }) : null
|
|
10291
10324
|
] })
|
|
10292
10325
|
]
|
|
10293
10326
|
}
|
|
@@ -10304,7 +10337,7 @@ function StnHeaderTitleDual({
|
|
|
10304
10337
|
...rest
|
|
10305
10338
|
}) {
|
|
10306
10339
|
const resolvedMain = mainText ?? title ?? children;
|
|
10307
|
-
return /* @__PURE__ */
|
|
10340
|
+
return /* @__PURE__ */ jsxs58(
|
|
10308
10341
|
"header",
|
|
10309
10342
|
{
|
|
10310
10343
|
className: cn(
|
|
@@ -10316,10 +10349,10 @@ function StnHeaderTitleDual({
|
|
|
10316
10349
|
),
|
|
10317
10350
|
...rest,
|
|
10318
10351
|
children: [
|
|
10319
|
-
framed ? /* @__PURE__ */
|
|
10320
|
-
/* @__PURE__ */
|
|
10321
|
-
subText != null ? /* @__PURE__ */
|
|
10322
|
-
resolvedMain != null ? typeof resolvedMain === "string" || typeof resolvedMain === "number" ? /* @__PURE__ */
|
|
10352
|
+
framed ? /* @__PURE__ */ jsx79(HeaderTitleFrame, {}) : null,
|
|
10353
|
+
/* @__PURE__ */ jsxs58("div", { className: "stn-header-title__content", children: [
|
|
10354
|
+
subText != null ? /* @__PURE__ */ jsx79("span", { className: "stn-header-title__sub-text", children: subText }) : null,
|
|
10355
|
+
resolvedMain != null ? typeof resolvedMain === "string" || typeof resolvedMain === "number" ? /* @__PURE__ */ jsx79("h1", { className: "stn-header-title__text", children: resolvedMain }) : resolvedMain : null
|
|
10323
10356
|
] })
|
|
10324
10357
|
]
|
|
10325
10358
|
}
|
|
@@ -10334,7 +10367,7 @@ function StnHeaderTitleText({
|
|
|
10334
10367
|
...rest
|
|
10335
10368
|
}) {
|
|
10336
10369
|
const resolved = title ?? children;
|
|
10337
|
-
return /* @__PURE__ */
|
|
10370
|
+
return /* @__PURE__ */ jsxs58(
|
|
10338
10371
|
"header",
|
|
10339
10372
|
{
|
|
10340
10373
|
className: cn(
|
|
@@ -10346,20 +10379,20 @@ function StnHeaderTitleText({
|
|
|
10346
10379
|
),
|
|
10347
10380
|
...rest,
|
|
10348
10381
|
children: [
|
|
10349
|
-
framed ? /* @__PURE__ */
|
|
10350
|
-
/* @__PURE__ */
|
|
10382
|
+
framed ? /* @__PURE__ */ jsx79(HeaderTitleFrame, {}) : null,
|
|
10383
|
+
/* @__PURE__ */ jsx79("div", { className: "stn-header-title__content", children: typeof resolved === "string" || typeof resolved === "number" ? /* @__PURE__ */ jsx79("h1", { className: "stn-header-title__text", children: resolved }) : resolved })
|
|
10351
10384
|
]
|
|
10352
10385
|
}
|
|
10353
10386
|
);
|
|
10354
10387
|
}
|
|
10355
10388
|
function StnHeaderTitleRoot(props) {
|
|
10356
10389
|
if (props.variant === "clock") {
|
|
10357
|
-
return /* @__PURE__ */
|
|
10390
|
+
return /* @__PURE__ */ jsx79(StnHeaderTitleClock, { ...props });
|
|
10358
10391
|
}
|
|
10359
10392
|
if (props.variant === "dual" || "subText" in props && props.subText != null) {
|
|
10360
|
-
return /* @__PURE__ */
|
|
10393
|
+
return /* @__PURE__ */ jsx79(StnHeaderTitleDual, { ...props });
|
|
10361
10394
|
}
|
|
10362
|
-
return /* @__PURE__ */
|
|
10395
|
+
return /* @__PURE__ */ jsx79(StnHeaderTitleText, { ...props });
|
|
10363
10396
|
}
|
|
10364
10397
|
var StnHeaderTitle = Object.assign(StnHeaderTitleRoot, {
|
|
10365
10398
|
Text: StnHeaderTitleMainText,
|
|
@@ -10374,7 +10407,7 @@ var StnHeaderTitle = Object.assign(StnHeaderTitleRoot, {
|
|
|
10374
10407
|
import {
|
|
10375
10408
|
forwardRef as forwardRef46
|
|
10376
10409
|
} from "react";
|
|
10377
|
-
import { jsx as
|
|
10410
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
10378
10411
|
var StnContainer = forwardRef46(function StnContainer2({
|
|
10379
10412
|
component,
|
|
10380
10413
|
as,
|
|
@@ -10390,7 +10423,7 @@ var StnContainer = forwardRef46(function StnContainer2({
|
|
|
10390
10423
|
const Component = component ?? as ?? "div";
|
|
10391
10424
|
const maxWidthClass = maxWidth ? `stn-container--${maxWidth} stn-container--max-width-${maxWidth}` : "stn-container--fluid stn-container--max-width-false";
|
|
10392
10425
|
const classKey = maxWidth ? `maxWidth${maxWidth.charAt(0).toUpperCase() + maxWidth.slice(1)}` : "maxWidthFalse";
|
|
10393
|
-
return /* @__PURE__ */
|
|
10426
|
+
return /* @__PURE__ */ jsx80(
|
|
10394
10427
|
Component,
|
|
10395
10428
|
{
|
|
10396
10429
|
ref,
|
|
@@ -10414,7 +10447,7 @@ var StnContainer = forwardRef46(function StnContainer2({
|
|
|
10414
10447
|
|
|
10415
10448
|
// src/layouts/StnGrid.tsx
|
|
10416
10449
|
import { forwardRef as forwardRef47 } from "react";
|
|
10417
|
-
import { jsx as
|
|
10450
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
10418
10451
|
var BREAKPOINTS2 = ["xs", "sm", "md", "lg", "xl"];
|
|
10419
10452
|
var SPACING_CLASS = {
|
|
10420
10453
|
"0": "0",
|
|
@@ -10500,7 +10533,7 @@ var StnGrid = forwardRef47(function StnGrid2({
|
|
|
10500
10533
|
const Component = component ?? as ?? "div";
|
|
10501
10534
|
const justify = typeof justifyContent === "string" && JUSTIFY_CLASS2.has(justifyContent) ? justifyContent : void 0;
|
|
10502
10535
|
const align = typeof alignItems === "string" && ALIGN_CLASS2.has(alignItems) ? alignItems : void 0;
|
|
10503
|
-
return /* @__PURE__ */
|
|
10536
|
+
return /* @__PURE__ */ jsx81(
|
|
10504
10537
|
Component,
|
|
10505
10538
|
{
|
|
10506
10539
|
ref,
|
|
@@ -10524,7 +10557,7 @@ var StnGrid = forwardRef47(function StnGrid2({
|
|
|
10524
10557
|
});
|
|
10525
10558
|
|
|
10526
10559
|
// src/layouts/StnLayerShell.tsx
|
|
10527
|
-
import { jsx as
|
|
10560
|
+
import { jsx as jsx82, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
10528
10561
|
function StnLayerShell({
|
|
10529
10562
|
gnb,
|
|
10530
10563
|
gnbSide = "left",
|
|
@@ -10545,7 +10578,7 @@ function StnLayerShell({
|
|
|
10545
10578
|
const resolvedMainContent = layer1 ?? children;
|
|
10546
10579
|
const resolvedModal = layer2;
|
|
10547
10580
|
const isGnbRight = gnbSide === "right";
|
|
10548
|
-
return /* @__PURE__ */
|
|
10581
|
+
return /* @__PURE__ */ jsxs59(
|
|
10549
10582
|
"div",
|
|
10550
10583
|
{
|
|
10551
10584
|
id: wrapId,
|
|
@@ -10553,8 +10586,8 @@ function StnLayerShell({
|
|
|
10553
10586
|
className: cn("stn-wrap", isGnbRight && "stn-wrap--gnb-right", wrapClassName),
|
|
10554
10587
|
children: [
|
|
10555
10588
|
layer0,
|
|
10556
|
-
utilities ? /* @__PURE__ */
|
|
10557
|
-
/* @__PURE__ */
|
|
10589
|
+
utilities ? /* @__PURE__ */ jsx82("div", { className: "stn-page-utilities", "data-stn-layer-role": "utility", children: utilities }) : null,
|
|
10590
|
+
/* @__PURE__ */ jsxs59(
|
|
10558
10591
|
"main",
|
|
10559
10592
|
{
|
|
10560
10593
|
id: containerId,
|
|
@@ -10563,9 +10596,9 @@ function StnLayerShell({
|
|
|
10563
10596
|
className: cn("stn-layer-1", scrollable && "scroll", containerClassName),
|
|
10564
10597
|
children: [
|
|
10565
10598
|
!isGnbRight && gnb,
|
|
10566
|
-
/* @__PURE__ */
|
|
10567
|
-
header ? /* @__PURE__ */
|
|
10568
|
-
/* @__PURE__ */
|
|
10599
|
+
/* @__PURE__ */ jsxs59("div", { className: "stn-layer-1__main", children: [
|
|
10600
|
+
header ? /* @__PURE__ */ jsx82("header", { className: "stn-layer-1__header", children: header }) : null,
|
|
10601
|
+
/* @__PURE__ */ jsx82("div", { className: cn("stn-layer-1__body", scrollable && "stn-scroll", contentClassName), children: resolvedMainContent })
|
|
10569
10602
|
] }),
|
|
10570
10603
|
isGnbRight && gnb
|
|
10571
10604
|
]
|
|
@@ -10578,7 +10611,7 @@ function StnLayerShell({
|
|
|
10578
10611
|
}
|
|
10579
10612
|
|
|
10580
10613
|
// src/layouts/StnListViewLayout.tsx
|
|
10581
|
-
import { jsx as
|
|
10614
|
+
import { jsx as jsx83, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
10582
10615
|
function StnListViewLayoutBody({
|
|
10583
10616
|
search,
|
|
10584
10617
|
sidebar,
|
|
@@ -10589,13 +10622,13 @@ function StnListViewLayoutBody({
|
|
|
10589
10622
|
className
|
|
10590
10623
|
}) {
|
|
10591
10624
|
const lnbClass = lnbSide === "right" ? "stn-page-scaffold__lnb lnb_box lnb_box_right" : "stn-page-scaffold__lnb lnb_box";
|
|
10592
|
-
const sidebarAside = sidebar ? /* @__PURE__ */
|
|
10593
|
-
return /* @__PURE__ */
|
|
10625
|
+
const sidebarAside = sidebar ? /* @__PURE__ */ jsx83("aside", { className: lnbClass, children: sidebar }) : null;
|
|
10626
|
+
return /* @__PURE__ */ jsx83(
|
|
10594
10627
|
StnContainer,
|
|
10595
10628
|
{
|
|
10596
10629
|
maxWidth: false,
|
|
10597
10630
|
className: cn("stn-list-view-layout__body", className),
|
|
10598
|
-
children: /* @__PURE__ */
|
|
10631
|
+
children: /* @__PURE__ */ jsxs60(
|
|
10599
10632
|
StnStack,
|
|
10600
10633
|
{
|
|
10601
10634
|
direction: "row",
|
|
@@ -10603,19 +10636,19 @@ function StnListViewLayoutBody({
|
|
|
10603
10636
|
className: "stn-list-view__main",
|
|
10604
10637
|
children: [
|
|
10605
10638
|
lnbSide === "left" ? sidebarAside : null,
|
|
10606
|
-
/* @__PURE__ */
|
|
10639
|
+
/* @__PURE__ */ jsxs60(
|
|
10607
10640
|
StnStack,
|
|
10608
10641
|
{
|
|
10609
10642
|
direction: "column",
|
|
10610
10643
|
spacing: 2,
|
|
10611
10644
|
className: "stn-list-view__content-stack",
|
|
10612
10645
|
children: [
|
|
10613
|
-
search ? /* @__PURE__ */
|
|
10614
|
-
/* @__PURE__ */
|
|
10646
|
+
search ? /* @__PURE__ */ jsx83("div", { className: "stn-page-scaffold__search search_area", children: search }) : null,
|
|
10647
|
+
/* @__PURE__ */ jsx83(
|
|
10615
10648
|
"div",
|
|
10616
10649
|
{
|
|
10617
10650
|
className: "stn-page-scaffold__content content_box",
|
|
10618
|
-
children: children ?? /* @__PURE__ */
|
|
10651
|
+
children: children ?? /* @__PURE__ */ jsxs60("div", { className: "stn-table stn-table--fill", children: [
|
|
10619
10652
|
table,
|
|
10620
10653
|
pagination
|
|
10621
10654
|
] })
|
|
@@ -10647,7 +10680,7 @@ function StnListViewLayoutRoot({
|
|
|
10647
10680
|
}) {
|
|
10648
10681
|
const bare = bareProp ?? noShell ?? false;
|
|
10649
10682
|
const hasLnbClass = lnbSide === "right" ? "has_lnb_right" : "has_lnb";
|
|
10650
|
-
const body = /* @__PURE__ */
|
|
10683
|
+
const body = /* @__PURE__ */ jsx83(
|
|
10651
10684
|
StnListViewLayoutBody,
|
|
10652
10685
|
{
|
|
10653
10686
|
search,
|
|
@@ -10662,10 +10695,10 @@ function StnListViewLayoutRoot({
|
|
|
10662
10695
|
if (bare) {
|
|
10663
10696
|
return body;
|
|
10664
10697
|
}
|
|
10665
|
-
const renderedHeader = header === null ? null : header !== void 0 ? header : /* @__PURE__ */
|
|
10666
|
-
return /* @__PURE__ */
|
|
10698
|
+
const renderedHeader = header === null ? null : header !== void 0 ? header : /* @__PURE__ */ jsx83("div", { className: "stn-layer-1__header", children: /* @__PURE__ */ jsx83(StnHeader, { variant: "page", children: /* @__PURE__ */ jsx83(StnHeader.Left, { children: /* @__PURE__ */ jsx83(StnHeaderPageTitle, { children: title }) }) }) });
|
|
10699
|
+
return /* @__PURE__ */ jsxs60("div", { className: cn("stn-list-view-layout", "stn-layer-1", className), ...rest, children: [
|
|
10667
10700
|
renderedHeader,
|
|
10668
|
-
/* @__PURE__ */
|
|
10701
|
+
/* @__PURE__ */ jsx83(
|
|
10669
10702
|
"div",
|
|
10670
10703
|
{
|
|
10671
10704
|
className: cn("stn-content-area", sidebar ? hasLnbClass : null, search ? "has_sch" : null),
|
|
@@ -10675,10 +10708,10 @@ function StnListViewLayoutRoot({
|
|
|
10675
10708
|
] });
|
|
10676
10709
|
}
|
|
10677
10710
|
function StnListViewLayoutHeader({ className, children, ...rest }) {
|
|
10678
|
-
return /* @__PURE__ */
|
|
10711
|
+
return /* @__PURE__ */ jsx83("div", { className: cn("stn-layer-1__header", className), ...rest, children });
|
|
10679
10712
|
}
|
|
10680
10713
|
function StnListViewLayoutSearch({ className, children, ...rest }) {
|
|
10681
|
-
return /* @__PURE__ */
|
|
10714
|
+
return /* @__PURE__ */ jsx83("div", { className: cn("search_area", className), ...rest, children });
|
|
10682
10715
|
}
|
|
10683
10716
|
function StnListViewLayoutSidebar({
|
|
10684
10717
|
side = "left",
|
|
@@ -10687,16 +10720,16 @@ function StnListViewLayoutSidebar({
|
|
|
10687
10720
|
...rest
|
|
10688
10721
|
}) {
|
|
10689
10722
|
const lnbClass = side === "right" ? "lnb_box_right" : "lnb_box";
|
|
10690
|
-
return /* @__PURE__ */
|
|
10723
|
+
return /* @__PURE__ */ jsx83("aside", { className: cn(lnbClass, className), ...rest, children });
|
|
10691
10724
|
}
|
|
10692
10725
|
function StnListViewLayoutContent({ className, children, ...rest }) {
|
|
10693
|
-
return /* @__PURE__ */
|
|
10726
|
+
return /* @__PURE__ */ jsx83("div", { className: cn("content_box", className), ...rest, children });
|
|
10694
10727
|
}
|
|
10695
10728
|
function StnListViewLayoutTable({ className, children, ...rest }) {
|
|
10696
|
-
return /* @__PURE__ */
|
|
10729
|
+
return /* @__PURE__ */ jsx83("div", { className: cn("stn-table", className), ...rest, children });
|
|
10697
10730
|
}
|
|
10698
10731
|
function StnListViewLayoutPagination({ className, children, ...rest }) {
|
|
10699
|
-
return /* @__PURE__ */
|
|
10732
|
+
return /* @__PURE__ */ jsx83("div", { className: cn("stn-list-view-layout__pagination-wrap", className), ...rest, children });
|
|
10700
10733
|
}
|
|
10701
10734
|
var StnListViewLayout = Object.assign(StnListViewLayoutRoot, {
|
|
10702
10735
|
Body: StnListViewLayoutBody,
|
|
@@ -10730,13 +10763,13 @@ import {
|
|
|
10730
10763
|
} from "@stn-uiux/pub-ui/data/stnLayout";
|
|
10731
10764
|
|
|
10732
10765
|
// src/patterns/dashboard/StnMapCanvas.tsx
|
|
10733
|
-
import { jsx as
|
|
10766
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
10734
10767
|
function StnMapCanvas({
|
|
10735
10768
|
children,
|
|
10736
10769
|
className,
|
|
10737
10770
|
...rest
|
|
10738
10771
|
}) {
|
|
10739
|
-
return /* @__PURE__ */
|
|
10772
|
+
return /* @__PURE__ */ jsx84(
|
|
10740
10773
|
"div",
|
|
10741
10774
|
{
|
|
10742
10775
|
className: cn("stn-map-canvas", className),
|
|
@@ -10748,7 +10781,7 @@ function StnMapCanvas({
|
|
|
10748
10781
|
}
|
|
10749
10782
|
|
|
10750
10783
|
// src/patterns/dashboard/StnDashboard.tsx
|
|
10751
|
-
import { jsx as
|
|
10784
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
10752
10785
|
var fillStyle = {
|
|
10753
10786
|
flex: "1 1 0%",
|
|
10754
10787
|
minHeight: 0,
|
|
@@ -10767,7 +10800,7 @@ function StnDashboardRoot({
|
|
|
10767
10800
|
}) {
|
|
10768
10801
|
const isLeft = widgetPosition === "left";
|
|
10769
10802
|
const isBoth = widgetPosition === "both";
|
|
10770
|
-
return /* @__PURE__ */
|
|
10803
|
+
return /* @__PURE__ */ jsx85(
|
|
10771
10804
|
"div",
|
|
10772
10805
|
{
|
|
10773
10806
|
className: cn(
|
|
@@ -10796,7 +10829,7 @@ function StnDashboardLeft({
|
|
|
10796
10829
|
style,
|
|
10797
10830
|
...rest
|
|
10798
10831
|
}) {
|
|
10799
|
-
return /* @__PURE__ */
|
|
10832
|
+
return /* @__PURE__ */ jsx85(
|
|
10800
10833
|
"div",
|
|
10801
10834
|
{
|
|
10802
10835
|
className: cn("stn-dashboard__left", className),
|
|
@@ -10822,7 +10855,7 @@ function StnDashboardRight({
|
|
|
10822
10855
|
style,
|
|
10823
10856
|
...rest
|
|
10824
10857
|
}) {
|
|
10825
|
-
return /* @__PURE__ */
|
|
10858
|
+
return /* @__PURE__ */ jsx85(
|
|
10826
10859
|
"div",
|
|
10827
10860
|
{
|
|
10828
10861
|
className: cn("stn-dashboard__right", className),
|
|
@@ -10850,7 +10883,7 @@ function StnDashboardTopRight({
|
|
|
10850
10883
|
className,
|
|
10851
10884
|
...rest
|
|
10852
10885
|
}) {
|
|
10853
|
-
return /* @__PURE__ */
|
|
10886
|
+
return /* @__PURE__ */ jsx85(
|
|
10854
10887
|
"div",
|
|
10855
10888
|
{
|
|
10856
10889
|
className: cn("stn-dashboard__top-right", className),
|
|
@@ -10869,9 +10902,9 @@ var StnDashboard = Object.assign(StnDashboardRoot, {
|
|
|
10869
10902
|
});
|
|
10870
10903
|
|
|
10871
10904
|
// src/patterns/scaffold/StnPageScaffold.tsx
|
|
10872
|
-
import { jsx as
|
|
10905
|
+
import { jsx as jsx86, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
10873
10906
|
function StnPageScaffoldRoot({ children, className, ...rest }) {
|
|
10874
|
-
return /* @__PURE__ */
|
|
10907
|
+
return /* @__PURE__ */ jsx86(
|
|
10875
10908
|
"div",
|
|
10876
10909
|
{
|
|
10877
10910
|
className: cn("stn-page-scaffold", className),
|
|
@@ -10888,9 +10921,9 @@ function StnPageScaffoldRegion({
|
|
|
10888
10921
|
className,
|
|
10889
10922
|
...rest
|
|
10890
10923
|
}) {
|
|
10891
|
-
return /* @__PURE__ */
|
|
10892
|
-
/* @__PURE__ */
|
|
10893
|
-
hint ? /* @__PURE__ */
|
|
10924
|
+
return /* @__PURE__ */ jsxs61("div", { className: cn("stn-page-scaffold__region", className), "data-stn-page-scaffold": "region", ...rest, children: [
|
|
10925
|
+
/* @__PURE__ */ jsx86("span", { className: "stn-page-scaffold__region-label", children: label }),
|
|
10926
|
+
hint ? /* @__PURE__ */ jsx86("span", { className: "stn-page-scaffold__region-hint", children: hint }) : null,
|
|
10894
10927
|
children
|
|
10895
10928
|
] });
|
|
10896
10929
|
}
|
|
@@ -10901,7 +10934,7 @@ function StnPageScaffoldMapPlaceholder({
|
|
|
10901
10934
|
children,
|
|
10902
10935
|
...rest
|
|
10903
10936
|
}) {
|
|
10904
|
-
return /* @__PURE__ */
|
|
10937
|
+
return /* @__PURE__ */ jsx86("div", { className: "stn-widget shell-canvas stn-map-canvas", "data-stn-dashboard": "canvas", children: /* @__PURE__ */ jsxs61(
|
|
10905
10938
|
"div",
|
|
10906
10939
|
{
|
|
10907
10940
|
className: cn("stn-page-scaffold__canvas-placeholder", className),
|
|
@@ -10909,8 +10942,8 @@ function StnPageScaffoldMapPlaceholder({
|
|
|
10909
10942
|
role: "status",
|
|
10910
10943
|
...rest,
|
|
10911
10944
|
children: [
|
|
10912
|
-
/* @__PURE__ */
|
|
10913
|
-
note ? /* @__PURE__ */
|
|
10945
|
+
/* @__PURE__ */ jsx86("p", { className: "stn-page-scaffold__canvas-placeholder-title", children: message }),
|
|
10946
|
+
note ? /* @__PURE__ */ jsx86("p", { className: "stn-page-scaffold__canvas-placeholder-note", children: note }) : null,
|
|
10914
10947
|
children
|
|
10915
10948
|
]
|
|
10916
10949
|
}
|
|
@@ -10921,7 +10954,7 @@ function StnPageScaffoldMapCanvas({
|
|
|
10921
10954
|
children,
|
|
10922
10955
|
...rest
|
|
10923
10956
|
}) {
|
|
10924
|
-
return /* @__PURE__ */
|
|
10957
|
+
return /* @__PURE__ */ jsx86(
|
|
10925
10958
|
"div",
|
|
10926
10959
|
{
|
|
10927
10960
|
className: cn("stn-widget", "shell-canvas", "stn-map-canvas", "stn-page-scaffold__canvas", className),
|
|
@@ -10934,7 +10967,7 @@ function StnPageScaffoldMapCanvas({
|
|
|
10934
10967
|
}
|
|
10935
10968
|
function StnPageScaffoldLayer({ label, hint, children, className, ...layerProps }) {
|
|
10936
10969
|
const labelText = label ? hint ? `${label} \xB7 ${hint}` : label : void 0;
|
|
10937
|
-
return /* @__PURE__ */
|
|
10970
|
+
return /* @__PURE__ */ jsx86(
|
|
10938
10971
|
StnLayer2,
|
|
10939
10972
|
{
|
|
10940
10973
|
className: cn(
|
|
@@ -10981,25 +11014,25 @@ function DashboardPageScaffold({
|
|
|
10981
11014
|
const isLeft = widgetPosition === "left";
|
|
10982
11015
|
const isBoth = widgetPosition === "both";
|
|
10983
11016
|
const isNone = widgetPosition === "none" || !showRightRegion;
|
|
10984
|
-
const mapColumn = /* @__PURE__ */
|
|
10985
|
-
/* @__PURE__ */
|
|
11017
|
+
const mapColumn = /* @__PURE__ */ jsxs61(StnDashboard.Left, { children: [
|
|
11018
|
+
/* @__PURE__ */ jsx86(StnPageScaffold.MapPlaceholder, { message: finalMapMessage, note: finalMapNote }),
|
|
10986
11019
|
faultPanel
|
|
10987
11020
|
] });
|
|
10988
|
-
const rightWidgets = right ?? /* @__PURE__ */
|
|
10989
|
-
const leftWidgets = left ?? right ?? /* @__PURE__ */
|
|
10990
|
-
const dashboardGrid = bodyEmpty ? /* @__PURE__ */
|
|
10991
|
-
/* @__PURE__ */
|
|
11021
|
+
const rightWidgets = right ?? /* @__PURE__ */ jsx86(StnPageScaffold.Region, { label: "dashboard_right", hint: "\uC704\uC82F\xB7\uC7A5\uC560 \uD328\uB110" });
|
|
11022
|
+
const leftWidgets = left ?? right ?? /* @__PURE__ */ jsx86(StnPageScaffold.Region, { label: "dashboard_right", hint: "\uC88C\uCE21 \uC704\uC82F\xB7\uC7A5\uC560 \uD328\uB110" });
|
|
11023
|
+
const dashboardGrid = bodyEmpty ? /* @__PURE__ */ jsx86(StnDashboard, { empty: true, widgetPosition, "data-stn-page-scaffold": "dashboard-empty" }) : isBoth ? /* @__PURE__ */ jsxs61(StnDashboard, { widgetPosition: "both", children: [
|
|
11024
|
+
/* @__PURE__ */ jsx86(StnDashboard.Right, { children: leftWidgets }),
|
|
10992
11025
|
mapColumn,
|
|
10993
|
-
/* @__PURE__ */
|
|
10994
|
-
] }) : isLeft ? /* @__PURE__ */
|
|
10995
|
-
/* @__PURE__ */
|
|
11026
|
+
/* @__PURE__ */ jsx86(StnDashboard.Right, { children: rightWidgets })
|
|
11027
|
+
] }) : isLeft ? /* @__PURE__ */ jsxs61(StnDashboard, { widgetPosition: "left", children: [
|
|
11028
|
+
/* @__PURE__ */ jsx86(StnDashboard.Right, { children: leftWidgets }),
|
|
10996
11029
|
mapColumn
|
|
10997
|
-
] }) : /* @__PURE__ */
|
|
11030
|
+
] }) : /* @__PURE__ */ jsxs61(StnDashboard, { widgetPosition: isNone ? "none" : "right", children: [
|
|
10998
11031
|
mapColumn,
|
|
10999
|
-
!isNone ? /* @__PURE__ */
|
|
11032
|
+
!isNone ? /* @__PURE__ */ jsx86(StnDashboard.Right, { children: rightWidgets }) : null
|
|
11000
11033
|
] });
|
|
11001
11034
|
const contentNode = children ?? dashboardGrid;
|
|
11002
|
-
return /* @__PURE__ */
|
|
11035
|
+
return /* @__PURE__ */ jsx86(
|
|
11003
11036
|
StnLayerShell,
|
|
11004
11037
|
{
|
|
11005
11038
|
gnb,
|
|
@@ -11008,7 +11041,7 @@ function DashboardPageScaffold({
|
|
|
11008
11041
|
layer0,
|
|
11009
11042
|
layer2,
|
|
11010
11043
|
...shellProps,
|
|
11011
|
-
children: /* @__PURE__ */
|
|
11044
|
+
children: /* @__PURE__ */ jsx86(
|
|
11012
11045
|
StnContainer,
|
|
11013
11046
|
{
|
|
11014
11047
|
maxWidth: false,
|
|
@@ -11029,9 +11062,9 @@ import {
|
|
|
11029
11062
|
STN_ALERT_CENTER_DEMO_WORK
|
|
11030
11063
|
} from "@stn-uiux/pub-ui/data/stnAlertCenter";
|
|
11031
11064
|
import { systemIconSrc } from "@stn-uiux/pub-ui/data/stnSystemIcons";
|
|
11032
|
-
import { Fragment as Fragment12, jsx as
|
|
11065
|
+
import { Fragment as Fragment12, jsx as jsx87, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
11033
11066
|
function defaultTopologyHeader(_clock) {
|
|
11034
|
-
return /* @__PURE__ */
|
|
11067
|
+
return /* @__PURE__ */ jsx87(StnHeader, { variant: "widget" });
|
|
11035
11068
|
}
|
|
11036
11069
|
function AlertCenterPageScaffold({
|
|
11037
11070
|
gnbAlertPanel,
|
|
@@ -11050,7 +11083,7 @@ function AlertCenterPageScaffold({
|
|
|
11050
11083
|
}) {
|
|
11051
11084
|
const [gnbOpen, setGnbOpen] = useState22(defaultGnbOpen);
|
|
11052
11085
|
const panel = useMemo6(
|
|
11053
|
-
() => gnbAlertPanel ?? /* @__PURE__ */
|
|
11086
|
+
() => gnbAlertPanel ?? /* @__PURE__ */ jsx87(
|
|
11054
11087
|
StnAlertCenterPanel,
|
|
11055
11088
|
{
|
|
11056
11089
|
alerts: STN_ALERT_CENTER_DEMO_ALERTS,
|
|
@@ -11061,26 +11094,26 @@ function AlertCenterPageScaffold({
|
|
|
11061
11094
|
[gnbAlertPanel]
|
|
11062
11095
|
);
|
|
11063
11096
|
const sideNav = useMemo6(
|
|
11064
|
-
() => gnbProp ?? /* @__PURE__ */
|
|
11065
|
-
/* @__PURE__ */
|
|
11097
|
+
() => gnbProp ?? /* @__PURE__ */ jsxs62(Fragment12, { children: [
|
|
11098
|
+
/* @__PURE__ */ jsxs62(
|
|
11066
11099
|
StnSideNavigation,
|
|
11067
11100
|
{
|
|
11068
11101
|
collapsed: !gnbOpen,
|
|
11069
11102
|
onCollapseChange: (col) => setGnbOpen(!col),
|
|
11070
11103
|
children: [
|
|
11071
|
-
/* @__PURE__ */
|
|
11072
|
-
/* @__PURE__ */
|
|
11073
|
-
/* @__PURE__ */
|
|
11104
|
+
/* @__PURE__ */ jsxs62(StnSideNavigation.Header, { children: [
|
|
11105
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Logo, {}),
|
|
11106
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Toggle, {})
|
|
11074
11107
|
] }),
|
|
11075
|
-
/* @__PURE__ */
|
|
11076
|
-
/* @__PURE__ */
|
|
11077
|
-
/* @__PURE__ */
|
|
11078
|
-
/* @__PURE__ */
|
|
11108
|
+
/* @__PURE__ */ jsxs62(StnSideNavigation.Menu, { children: [
|
|
11109
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Item, { iconSrc: systemIconSrc("line/layout-grid"), label: "\uBA54\uC778 \uB300\uC2DC\uBCF4\uB4DC", active: true }),
|
|
11110
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Item, { iconSrc: systemIconSrc("line/server_2"), label: "\uC11C\uBC84 \uBAA8\uB2C8\uD130\uB9C1" }),
|
|
11111
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Item, { iconSrc: systemIconSrc("line/activity"), label: "\uB124\uD2B8\uC6CC\uD06C \uBD84\uC11D" })
|
|
11079
11112
|
] }),
|
|
11080
|
-
/* @__PURE__ */
|
|
11081
|
-
/* @__PURE__ */
|
|
11082
|
-
/* @__PURE__ */
|
|
11083
|
-
/* @__PURE__ */
|
|
11113
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Spacer, {}),
|
|
11114
|
+
/* @__PURE__ */ jsxs62(StnSideNavigation.Footer, { curved: true, children: [
|
|
11115
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Watermark, {}),
|
|
11116
|
+
/* @__PURE__ */ jsx87(
|
|
11084
11117
|
StnSideNavigation.Item,
|
|
11085
11118
|
{
|
|
11086
11119
|
iconSrc: systemIconSrc("line/bell"),
|
|
@@ -11089,7 +11122,7 @@ function AlertCenterPageScaffold({
|
|
|
11089
11122
|
onClick: void 0
|
|
11090
11123
|
}
|
|
11091
11124
|
),
|
|
11092
|
-
/* @__PURE__ */
|
|
11125
|
+
/* @__PURE__ */ jsx87(StnSideNavigation.Item, { iconSrc: systemIconSrc("line/settings"), label: "\uC124\uC815" })
|
|
11093
11126
|
] })
|
|
11094
11127
|
]
|
|
11095
11128
|
}
|
|
@@ -11098,8 +11131,8 @@ function AlertCenterPageScaffold({
|
|
|
11098
11131
|
] }),
|
|
11099
11132
|
[gnbProp, gnbOpen, panel]
|
|
11100
11133
|
);
|
|
11101
|
-
const faultSlot = faultPanel ?? (showFaultPanelPlaceholder ? /* @__PURE__ */
|
|
11102
|
-
return /* @__PURE__ */
|
|
11134
|
+
const faultSlot = faultPanel ?? (showFaultPanelPlaceholder ? /* @__PURE__ */ jsx87("div", { className: "wrap_real_time stn-page-scaffold__fault-ph", children: /* @__PURE__ */ jsx87(StnPageScaffold.Region, { label: "\uC2E4\uC2DC\uAC04 \uC7A5\uC560 \uD604\uD669", hint: "StnWidget shell=fault-panel \xB7 \uC120\uD0DD" }) }) : null);
|
|
11135
|
+
return /* @__PURE__ */ jsx87(
|
|
11103
11136
|
DashboardPageScaffold,
|
|
11104
11137
|
{
|
|
11105
11138
|
gnb: sideNav,
|
|
@@ -11107,7 +11140,7 @@ function AlertCenterPageScaffold({
|
|
|
11107
11140
|
mapMessage,
|
|
11108
11141
|
mapNote,
|
|
11109
11142
|
faultPanel: faultSlot,
|
|
11110
|
-
right: right ?? /* @__PURE__ */
|
|
11143
|
+
right: right ?? /* @__PURE__ */ jsx87(AlertCenterDashboard, {}),
|
|
11111
11144
|
wrapId,
|
|
11112
11145
|
wrapClassName: "stn-page--map-bg",
|
|
11113
11146
|
...shellProps
|
|
@@ -11117,7 +11150,7 @@ function AlertCenterPageScaffold({
|
|
|
11117
11150
|
|
|
11118
11151
|
// src/patterns/scaffold/LoginPageScaffold.tsx
|
|
11119
11152
|
import { useState as useState23 } from "react";
|
|
11120
|
-
import { jsx as
|
|
11153
|
+
import { jsx as jsx88, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
11121
11154
|
var LOGIN_TABS = [
|
|
11122
11155
|
{ value: "normal", label: "\uC77C\uBC18 \uB85C\uADF8\uC778" },
|
|
11123
11156
|
{ value: "social", label: "\uC18C\uC15C \uB85C\uADF8\uC778" }
|
|
@@ -11135,8 +11168,8 @@ function DefaultLoginForm({
|
|
|
11135
11168
|
e.preventDefault();
|
|
11136
11169
|
onLogin?.(userId, password);
|
|
11137
11170
|
}
|
|
11138
|
-
return /* @__PURE__ */
|
|
11139
|
-
/* @__PURE__ */
|
|
11171
|
+
return /* @__PURE__ */ jsxs63(StnLoginFormStack, { onSubmit: handleSubmit, children: [
|
|
11172
|
+
/* @__PURE__ */ jsx88(
|
|
11140
11173
|
StnSegmented,
|
|
11141
11174
|
{
|
|
11142
11175
|
"aria-label": "\uB85C\uADF8\uC778 \uBC29\uC2DD",
|
|
@@ -11145,8 +11178,8 @@ function DefaultLoginForm({
|
|
|
11145
11178
|
options: LOGIN_TABS
|
|
11146
11179
|
}
|
|
11147
11180
|
),
|
|
11148
|
-
mode === "normal" ? /* @__PURE__ */
|
|
11149
|
-
/* @__PURE__ */
|
|
11181
|
+
mode === "normal" ? /* @__PURE__ */ jsxs63(StnLoginFormFields, { children: [
|
|
11182
|
+
/* @__PURE__ */ jsx88(
|
|
11150
11183
|
StnLoginTextField,
|
|
11151
11184
|
{
|
|
11152
11185
|
icon: "line/user",
|
|
@@ -11158,7 +11191,7 @@ function DefaultLoginForm({
|
|
|
11158
11191
|
"aria-label": "\uC544\uC774\uB514"
|
|
11159
11192
|
}
|
|
11160
11193
|
),
|
|
11161
|
-
/* @__PURE__ */
|
|
11194
|
+
/* @__PURE__ */ jsx88(
|
|
11162
11195
|
StnLoginTextField,
|
|
11163
11196
|
{
|
|
11164
11197
|
icon: "line/lock",
|
|
@@ -11171,11 +11204,11 @@ function DefaultLoginForm({
|
|
|
11171
11204
|
"aria-label": "\uBE44\uBC00\uBC88\uD638"
|
|
11172
11205
|
}
|
|
11173
11206
|
)
|
|
11174
|
-
] }) : socialContent ?? /* @__PURE__ */
|
|
11175
|
-
/* @__PURE__ */
|
|
11176
|
-
/* @__PURE__ */
|
|
11177
|
-
/* @__PURE__ */
|
|
11178
|
-
/* @__PURE__ */
|
|
11207
|
+
] }) : socialContent ?? /* @__PURE__ */ jsx88(StnLoginPlaceholder, {}),
|
|
11208
|
+
/* @__PURE__ */ jsx88(StnButton, { type: "submit", size: "xl", fullWidth: true, children: "\uB85C\uADF8\uC778" }),
|
|
11209
|
+
/* @__PURE__ */ jsxs63(StnLoginFormLinks, { children: [
|
|
11210
|
+
/* @__PURE__ */ jsx88("a", { href: signUpHref, children: "\uD68C\uC6D0\uAC00\uC785" }),
|
|
11211
|
+
/* @__PURE__ */ jsx88("a", { href: recoverHref, children: "\uC544\uC774\uB514 / \uBE44\uBC00\uBC88\uD638 \uCC3E\uAE30" })
|
|
11179
11212
|
] })
|
|
11180
11213
|
] });
|
|
11181
11214
|
}
|
|
@@ -11189,16 +11222,16 @@ function DefaultLoginCard({
|
|
|
11189
11222
|
signUpHref,
|
|
11190
11223
|
recoverHref
|
|
11191
11224
|
}) {
|
|
11192
|
-
return /* @__PURE__ */
|
|
11225
|
+
return /* @__PURE__ */ jsx88(
|
|
11193
11226
|
StnLoginCard,
|
|
11194
11227
|
{
|
|
11195
11228
|
glow,
|
|
11196
11229
|
variant,
|
|
11197
|
-
brand: /* @__PURE__ */
|
|
11198
|
-
logo ?? /* @__PURE__ */
|
|
11199
|
-
/* @__PURE__ */
|
|
11230
|
+
brand: /* @__PURE__ */ jsxs63(StnLoginBrandStack, { children: [
|
|
11231
|
+
logo ?? /* @__PURE__ */ jsx88(StnLogo, { variant: "vertical", size: "xl" }),
|
|
11232
|
+
/* @__PURE__ */ jsx88("p", { className: "stn-login-card__caption", children: productCaption })
|
|
11200
11233
|
] }),
|
|
11201
|
-
children: /* @__PURE__ */
|
|
11234
|
+
children: /* @__PURE__ */ jsx88(
|
|
11202
11235
|
DefaultLoginForm,
|
|
11203
11236
|
{
|
|
11204
11237
|
onLogin,
|
|
@@ -11224,8 +11257,8 @@ function LoginPageScaffold({
|
|
|
11224
11257
|
recoverHref,
|
|
11225
11258
|
...shellProps
|
|
11226
11259
|
}) {
|
|
11227
|
-
const resolvedLayer0 = layer0 ?? /* @__PURE__ */
|
|
11228
|
-
const resolvedCard = children ?? /* @__PURE__ */
|
|
11260
|
+
const resolvedLayer0 = layer0 ?? /* @__PURE__ */ jsx88(StnLayer0Background, { variant: "login" });
|
|
11261
|
+
const resolvedCard = children ?? /* @__PURE__ */ jsx88(
|
|
11229
11262
|
DefaultLoginCard,
|
|
11230
11263
|
{
|
|
11231
11264
|
logo,
|
|
@@ -11238,14 +11271,14 @@ function LoginPageScaffold({
|
|
|
11238
11271
|
recoverHref
|
|
11239
11272
|
}
|
|
11240
11273
|
);
|
|
11241
|
-
return /* @__PURE__ */
|
|
11274
|
+
return /* @__PURE__ */ jsxs63(
|
|
11242
11275
|
"div",
|
|
11243
11276
|
{
|
|
11244
11277
|
className: cn("stn-wrap stn-page--login", wrapClassName),
|
|
11245
11278
|
...shellProps,
|
|
11246
11279
|
children: [
|
|
11247
11280
|
resolvedLayer0,
|
|
11248
|
-
/* @__PURE__ */
|
|
11281
|
+
/* @__PURE__ */ jsx88("div", { className: "stn-login", children: resolvedCard })
|
|
11249
11282
|
]
|
|
11250
11283
|
}
|
|
11251
11284
|
);
|
|
@@ -11271,11 +11304,1507 @@ import {
|
|
|
11271
11304
|
STN_LAYER_ROLE_USAGE,
|
|
11272
11305
|
STN_ELEVATION_Z_INDEX
|
|
11273
11306
|
} from "@stn-uiux/pub-ui/data/stnLayer";
|
|
11307
|
+
|
|
11308
|
+
// src/components/chartTypes.tsx
|
|
11309
|
+
import { jsx as jsx89, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
11310
|
+
var SEVERITY_COLOR_TOKENS = {
|
|
11311
|
+
critical: "var(--stn-chart-status-critical)",
|
|
11312
|
+
major: "var(--stn-chart-status-major)",
|
|
11313
|
+
minor: "var(--stn-chart-status-minor)",
|
|
11314
|
+
warning: "var(--stn-chart-status-warning)"
|
|
11315
|
+
};
|
|
11316
|
+
var STATUS_COLOR_TOKENS = {
|
|
11317
|
+
critical: "var(--stn-chart-status-critical)",
|
|
11318
|
+
major: "var(--stn-chart-status-major)",
|
|
11319
|
+
minor: "var(--stn-chart-status-minor)",
|
|
11320
|
+
warning: "var(--stn-chart-status-warning)",
|
|
11321
|
+
success: "var(--stn-chart-status-success)",
|
|
11322
|
+
normal: "var(--stn-chart-status-success)",
|
|
11323
|
+
info: "var(--stn-chart-status-info)",
|
|
11324
|
+
neutral: "var(--stn-chart-status-neutral)",
|
|
11325
|
+
primary: "var(--stn-primary)",
|
|
11326
|
+
secondary: "var(--stn-secondary)",
|
|
11327
|
+
error: "var(--stn-chart-status-critical)"
|
|
11328
|
+
};
|
|
11329
|
+
var STN_CHART_STATUS_COLORS = STATUS_COLOR_TOKENS;
|
|
11330
|
+
var STN_CHART_COLORS = [
|
|
11331
|
+
"var(--stn-chart-color-1)",
|
|
11332
|
+
"var(--stn-chart-color-2)",
|
|
11333
|
+
"var(--stn-chart-color-3)",
|
|
11334
|
+
"var(--stn-chart-color-4)",
|
|
11335
|
+
"var(--stn-chart-color-5)",
|
|
11336
|
+
"var(--stn-chart-color-6)",
|
|
11337
|
+
"var(--stn-chart-color-7)",
|
|
11338
|
+
"var(--stn-chart-color-8)",
|
|
11339
|
+
"var(--stn-chart-color-9)",
|
|
11340
|
+
"var(--stn-chart-color-10)"
|
|
11341
|
+
];
|
|
11342
|
+
var DEFAULT_CHART_COLORS = STN_CHART_COLORS;
|
|
11343
|
+
var LEGACY_CHART_COLOR_ALIASES = {
|
|
11344
|
+
"var(--stn-chart-bar-1)": "var(--stn-chart-color-1)",
|
|
11345
|
+
"var(--stn-chart-bar-2)": "var(--stn-chart-color-2)",
|
|
11346
|
+
"var(--stn-chart-bar-3)": "var(--stn-chart-color-3)",
|
|
11347
|
+
"var(--stn-chart-bar-4)": "var(--stn-chart-color-4)",
|
|
11348
|
+
"var(--stn-chart-bar-5)": "var(--stn-chart-color-5)",
|
|
11349
|
+
"var(--stn-chart-bar-6)": "var(--stn-chart-color-6)",
|
|
11350
|
+
"var(--stn-chart-line-1)": "var(--stn-chart-color-1)",
|
|
11351
|
+
"var(--stn-chart-line-2)": "var(--stn-chart-color-2)",
|
|
11352
|
+
"var(--stn-chart-line-3)": "var(--stn-chart-color-3)",
|
|
11353
|
+
"var(--stn-chart-line-4)": "var(--stn-chart-color-4)",
|
|
11354
|
+
"var(--stn-chart-line-5)": "var(--stn-chart-color-5)",
|
|
11355
|
+
"var(--stn-chart-line-6)": "var(--stn-chart-color-6)",
|
|
11356
|
+
"var(--stn-chart-line-stroke)": "var(--stn-chart-color-1)",
|
|
11357
|
+
"var(--stn-chart-gauge-seg-1)": "var(--stn-chart-color-1)",
|
|
11358
|
+
"var(--stn-chart-gauge-seg-2)": "var(--stn-chart-color-2)",
|
|
11359
|
+
"var(--stn-chart-gauge-seg-3)": "var(--stn-chart-color-3)",
|
|
11360
|
+
"var(--stn-chart-gauge-seg-4)": "var(--stn-chart-color-4)",
|
|
11361
|
+
"var(--stn-chart-gauge-seg-5)": "var(--stn-chart-color-5)",
|
|
11362
|
+
"var(--stn-chart-gauge-seg-6)": "var(--stn-chart-color-6)",
|
|
11363
|
+
"var(--stn-chart-gauge-seg-7)": "var(--stn-chart-color-7)",
|
|
11364
|
+
"var(--stn-chart-gauge-seg-8)": "var(--stn-chart-color-8)",
|
|
11365
|
+
"var(--stn-chart-gauge-seg-9)": "var(--stn-chart-color-9)",
|
|
11366
|
+
"var(--stn-chart-gauge-seg-10)": "var(--stn-chart-color-10)"
|
|
11367
|
+
};
|
|
11368
|
+
function resolveChartColor(color, severityOrFallback, status, fallbackColor) {
|
|
11369
|
+
if (color) {
|
|
11370
|
+
const normalized = color.toLowerCase().trim();
|
|
11371
|
+
if (normalized in STATUS_COLOR_TOKENS) {
|
|
11372
|
+
return STATUS_COLOR_TOKENS[normalized];
|
|
11373
|
+
}
|
|
11374
|
+
if (normalized in LEGACY_CHART_COLOR_ALIASES) {
|
|
11375
|
+
return LEGACY_CHART_COLOR_ALIASES[normalized];
|
|
11376
|
+
}
|
|
11377
|
+
return color;
|
|
11378
|
+
}
|
|
11379
|
+
if (typeof severityOrFallback === "string") {
|
|
11380
|
+
if (severityOrFallback in SEVERITY_COLOR_TOKENS) {
|
|
11381
|
+
return SEVERITY_COLOR_TOKENS[severityOrFallback];
|
|
11382
|
+
}
|
|
11383
|
+
if (severityOrFallback in STATUS_COLOR_TOKENS) {
|
|
11384
|
+
return STATUS_COLOR_TOKENS[severityOrFallback];
|
|
11385
|
+
}
|
|
11386
|
+
}
|
|
11387
|
+
if (status && STATUS_COLOR_TOKENS[status]) {
|
|
11388
|
+
return STATUS_COLOR_TOKENS[status];
|
|
11389
|
+
}
|
|
11390
|
+
if (typeof severityOrFallback === "number") {
|
|
11391
|
+
return STN_CHART_COLORS[severityOrFallback % STN_CHART_COLORS.length];
|
|
11392
|
+
}
|
|
11393
|
+
if (fallbackColor) {
|
|
11394
|
+
return fallbackColor;
|
|
11395
|
+
}
|
|
11396
|
+
if (typeof severityOrFallback === "string" && severityOrFallback.startsWith("var(")) {
|
|
11397
|
+
return severityOrFallback;
|
|
11398
|
+
}
|
|
11399
|
+
return STN_CHART_COLORS[0];
|
|
11400
|
+
}
|
|
11401
|
+
function formatChartValue(value, decimals) {
|
|
11402
|
+
if (value === 0) return "0";
|
|
11403
|
+
if (value >= 1e6) {
|
|
11404
|
+
const m = value / 1e6;
|
|
11405
|
+
const resolvedDecimals2 = decimals !== void 0 ? decimals : m % 1 === 0 ? 0 : 1;
|
|
11406
|
+
return `${m.toFixed(resolvedDecimals2)}M`;
|
|
11407
|
+
}
|
|
11408
|
+
if (value >= 1e3) {
|
|
11409
|
+
const k = value / 1e3;
|
|
11410
|
+
const resolvedDecimals2 = decimals !== void 0 ? decimals : k % 1 === 0 ? 0 : 1;
|
|
11411
|
+
return `${k.toFixed(resolvedDecimals2)}k`;
|
|
11412
|
+
}
|
|
11413
|
+
const resolvedDecimals = decimals !== void 0 ? decimals : value % 1 === 0 ? 0 : 1;
|
|
11414
|
+
return value.toFixed(resolvedDecimals);
|
|
11415
|
+
}
|
|
11416
|
+
function renderChartState(loading, hasData, emptyText = "\uC870\uD68C\uB41C \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4") {
|
|
11417
|
+
if (loading) {
|
|
11418
|
+
return /* @__PURE__ */ jsxs64("div", { className: "stn-chart-skeleton", "aria-busy": "true", "aria-label": "\uCC28\uD2B8 \uB85C\uB529 \uC911", children: [
|
|
11419
|
+
/* @__PURE__ */ jsxs64("div", { className: "stn-chart-skeleton__bars", children: [
|
|
11420
|
+
/* @__PURE__ */ jsx89("div", { className: "stn-chart-skeleton__bar", style: { height: "45%" } }),
|
|
11421
|
+
/* @__PURE__ */ jsx89("div", { className: "stn-chart-skeleton__bar", style: { height: "75%" } }),
|
|
11422
|
+
/* @__PURE__ */ jsx89("div", { className: "stn-chart-skeleton__bar", style: { height: "30%" } }),
|
|
11423
|
+
/* @__PURE__ */ jsx89("div", { className: "stn-chart-skeleton__bar", style: { height: "90%" } }),
|
|
11424
|
+
/* @__PURE__ */ jsx89("div", { className: "stn-chart-skeleton__bar", style: { height: "60%" } })
|
|
11425
|
+
] }),
|
|
11426
|
+
/* @__PURE__ */ jsx89("div", { className: "stn-chart-skeleton__axis" })
|
|
11427
|
+
] });
|
|
11428
|
+
}
|
|
11429
|
+
if (!hasData) {
|
|
11430
|
+
return /* @__PURE__ */ jsxs64("div", { className: "stn-chart-empty", role: "status", "aria-label": "\uB370\uC774\uD130 \uC5C6\uC74C", children: [
|
|
11431
|
+
/* @__PURE__ */ jsxs64(
|
|
11432
|
+
"svg",
|
|
11433
|
+
{
|
|
11434
|
+
className: "stn-chart-empty__icon",
|
|
11435
|
+
viewBox: "0 0 24 24",
|
|
11436
|
+
fill: "none",
|
|
11437
|
+
stroke: "currentColor",
|
|
11438
|
+
strokeWidth: "1.5",
|
|
11439
|
+
strokeLinecap: "round",
|
|
11440
|
+
strokeLinejoin: "round",
|
|
11441
|
+
"aria-hidden": "true",
|
|
11442
|
+
children: [
|
|
11443
|
+
/* @__PURE__ */ jsx89("path", { d: "M3 3v18h18" }),
|
|
11444
|
+
/* @__PURE__ */ jsx89("path", { d: "M18 9l-5 5-4-4-3 3" })
|
|
11445
|
+
]
|
|
11446
|
+
}
|
|
11447
|
+
),
|
|
11448
|
+
/* @__PURE__ */ jsx89("span", { children: emptyText })
|
|
11449
|
+
] });
|
|
11450
|
+
}
|
|
11451
|
+
return null;
|
|
11452
|
+
}
|
|
11453
|
+
|
|
11454
|
+
// src/components/StnBarChart.tsx
|
|
11455
|
+
import {
|
|
11456
|
+
useState as useState24
|
|
11457
|
+
} from "react";
|
|
11458
|
+
import { Fragment as Fragment13, jsx as jsx90, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
11459
|
+
var DEFAULT_BAR_COLORS = STN_CHART_COLORS;
|
|
11460
|
+
var SIZE_WIDTH_MAP = {
|
|
11461
|
+
sm: "var(--stn-chart-bar-width-sm)",
|
|
11462
|
+
md: "var(--stn-chart-bar-width-md)",
|
|
11463
|
+
lg: "var(--stn-chart-bar-width-lg)"
|
|
11464
|
+
};
|
|
11465
|
+
function StnBarChart({
|
|
11466
|
+
data = [],
|
|
11467
|
+
direction = "vertical",
|
|
11468
|
+
orientation,
|
|
11469
|
+
size,
|
|
11470
|
+
colorBy = "series",
|
|
11471
|
+
showXAxis = true,
|
|
11472
|
+
showYAxis = true,
|
|
11473
|
+
showTooltip = true,
|
|
11474
|
+
showValue = false,
|
|
11475
|
+
yAxis = {},
|
|
11476
|
+
legend,
|
|
11477
|
+
highlightIndex: controlledHighlight,
|
|
11478
|
+
onColumnClick,
|
|
11479
|
+
compact = false,
|
|
11480
|
+
barWidth: customBarWidth,
|
|
11481
|
+
height,
|
|
11482
|
+
decimals,
|
|
11483
|
+
loading = false,
|
|
11484
|
+
emptyText,
|
|
11485
|
+
className,
|
|
11486
|
+
style,
|
|
11487
|
+
...rest
|
|
11488
|
+
}) {
|
|
11489
|
+
const [internalHighlight, setInternalHighlight] = useState24(null);
|
|
11490
|
+
const [hoveredIndex, setHoveredIndex] = useState24(null);
|
|
11491
|
+
const isHorizontal = direction === "horizontal" || orientation === "horizontal";
|
|
11492
|
+
if (loading || !data || data.length === 0) {
|
|
11493
|
+
const emptyContainerStyle = {
|
|
11494
|
+
...style,
|
|
11495
|
+
...height ? { height: typeof height === "number" ? `${height}px` : height } : {}
|
|
11496
|
+
};
|
|
11497
|
+
return /* @__PURE__ */ jsx90(
|
|
11498
|
+
"div",
|
|
11499
|
+
{
|
|
11500
|
+
className: cn(
|
|
11501
|
+
"stn-chart-bar",
|
|
11502
|
+
isHorizontal ? "stn-chart-bar--horizontal" : "stn-chart-bar--vertical",
|
|
11503
|
+
size && `stn-chart-bar--${size}`,
|
|
11504
|
+
className
|
|
11505
|
+
),
|
|
11506
|
+
style: { ...emptyContainerStyle, minHeight: height || 160 },
|
|
11507
|
+
...rest,
|
|
11508
|
+
children: renderChartState(loading, Boolean(data && data.length > 0), emptyText)
|
|
11509
|
+
}
|
|
11510
|
+
);
|
|
11511
|
+
}
|
|
11512
|
+
let maxBarsPerCol = 1;
|
|
11513
|
+
const allValues = data.flatMap((d) => {
|
|
11514
|
+
if (d.values.length > maxBarsPerCol) {
|
|
11515
|
+
maxBarsPerCol = d.values.length;
|
|
11516
|
+
}
|
|
11517
|
+
return d.values.map((v) => typeof v === "number" ? v : v.value);
|
|
11518
|
+
});
|
|
11519
|
+
const computedMax = allValues.length > 0 ? Math.max(...allValues) : 100;
|
|
11520
|
+
const max = yAxis.max ?? (computedMax > 0 ? computedMax : 100);
|
|
11521
|
+
const steps = yAxis.steps ?? 5;
|
|
11522
|
+
const formatter = yAxis.format ?? ((val) => formatChartValue(val, decimals));
|
|
11523
|
+
const resolvedBarWidth = customBarWidth !== void 0 ? typeof customBarWidth === "number" ? `${customBarWidth}px` : customBarWidth === "sm" || customBarWidth === "md" || customBarWidth === "lg" ? SIZE_WIDTH_MAP[customBarWidth] : customBarWidth : size !== void 0 ? SIZE_WIDTH_MAP[size] : compact ? "var(--stn-chart-bar-width-sm)" : maxBarsPerCol >= 5 ? "var(--stn-chart-bar-width-sm)" : maxBarsPerCol >= 3 ? "var(--stn-chart-bar-width-sm)" : "var(--stn-chart-bar-width-md)";
|
|
11524
|
+
const gridRows = [];
|
|
11525
|
+
for (let i = steps; i >= 0; i--) {
|
|
11526
|
+
const val = max / steps * i;
|
|
11527
|
+
gridRows.push({
|
|
11528
|
+
label: formatter(val),
|
|
11529
|
+
isZero: i === 0
|
|
11530
|
+
});
|
|
11531
|
+
}
|
|
11532
|
+
const gridCols = [];
|
|
11533
|
+
for (let i = 0; i <= steps; i++) {
|
|
11534
|
+
const val = max / steps * i;
|
|
11535
|
+
gridCols.push({
|
|
11536
|
+
label: formatter(val),
|
|
11537
|
+
isZero: i === 0
|
|
11538
|
+
});
|
|
11539
|
+
}
|
|
11540
|
+
const isHighlighted = (idx, item) => {
|
|
11541
|
+
if (controlledHighlight !== void 0) return controlledHighlight === idx;
|
|
11542
|
+
if (internalHighlight !== null) return internalHighlight === idx;
|
|
11543
|
+
return Boolean(item.highlight);
|
|
11544
|
+
};
|
|
11545
|
+
const handleColClick = (item, idx) => {
|
|
11546
|
+
setInternalHighlight(idx);
|
|
11547
|
+
onColumnClick?.(item, idx);
|
|
11548
|
+
};
|
|
11549
|
+
const containerStyle = {
|
|
11550
|
+
...style,
|
|
11551
|
+
...height ? { height } : {},
|
|
11552
|
+
["--stn-chart-bar-width"]: resolvedBarWidth
|
|
11553
|
+
};
|
|
11554
|
+
return /* @__PURE__ */ jsxs65(
|
|
11555
|
+
"div",
|
|
11556
|
+
{
|
|
11557
|
+
className: cn(
|
|
11558
|
+
"stn-chart-bar",
|
|
11559
|
+
isHorizontal && "stn-chart-bar--horizontal",
|
|
11560
|
+
size && `stn-chart-bar--${size}`,
|
|
11561
|
+
!showXAxis && "stn-chart-bar--no-x-axis",
|
|
11562
|
+
!showYAxis && "stn-chart-bar--no-y-axis",
|
|
11563
|
+
!showTooltip && "stn-chart--no-tooltip",
|
|
11564
|
+
className
|
|
11565
|
+
),
|
|
11566
|
+
style: containerStyle,
|
|
11567
|
+
...rest,
|
|
11568
|
+
children: [
|
|
11569
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__body", children: isHorizontal ? (
|
|
11570
|
+
/* ==================== 가로 막대 (Horizontal) ==================== */
|
|
11571
|
+
/* @__PURE__ */ jsxs65(Fragment13, { children: [
|
|
11572
|
+
showXAxis && /* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__grid-v", "aria-hidden": "true", children: gridCols.map((col, cIdx) => /* @__PURE__ */ jsxs65("div", { className: "stn-chart-bar__grid-v-col", children: [
|
|
11573
|
+
/* @__PURE__ */ jsx90(
|
|
11574
|
+
"div",
|
|
11575
|
+
{
|
|
11576
|
+
className: cn(
|
|
11577
|
+
"stn-chart-bar__grid-v-line",
|
|
11578
|
+
col.isZero && "stn-chart-bar__grid-v-line--zero"
|
|
11579
|
+
)
|
|
11580
|
+
}
|
|
11581
|
+
),
|
|
11582
|
+
/* @__PURE__ */ jsx90("span", { className: "stn-chart-bar__grid-v-label", children: col.label })
|
|
11583
|
+
] }, cIdx)) }),
|
|
11584
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__rows", role: "list", children: data.map((item, idx) => {
|
|
11585
|
+
const active = isHighlighted(idx, item);
|
|
11586
|
+
const isHovered = hoveredIndex === idx;
|
|
11587
|
+
const rawVals = item.values.map((v, vIdx) => {
|
|
11588
|
+
const colorIndex = colorBy === "category" ? idx : vIdx;
|
|
11589
|
+
if (typeof v === "number") {
|
|
11590
|
+
return {
|
|
11591
|
+
value: v,
|
|
11592
|
+
color: resolveChartColor(void 0, colorIndex),
|
|
11593
|
+
label: legend?.[colorIndex]?.label || (colorBy === "category" ? item.label : `Series ${vIdx + 1}`)
|
|
11594
|
+
};
|
|
11595
|
+
}
|
|
11596
|
+
return {
|
|
11597
|
+
value: v.value,
|
|
11598
|
+
color: resolveChartColor(v.color, colorIndex),
|
|
11599
|
+
label: v.label || legend?.[colorIndex]?.label || (colorBy === "category" ? item.label : `Series ${vIdx + 1}`)
|
|
11600
|
+
};
|
|
11601
|
+
});
|
|
11602
|
+
const summaryValues = rawVals.map((v) => v.value).join(", ");
|
|
11603
|
+
const isFirstRow = idx === 0;
|
|
11604
|
+
return /* @__PURE__ */ jsxs65(
|
|
11605
|
+
"button",
|
|
11606
|
+
{
|
|
11607
|
+
type: "button",
|
|
11608
|
+
className: cn(
|
|
11609
|
+
"stn-chart-bar__row",
|
|
11610
|
+
compact && "stn-chart-bar__row--compact",
|
|
11611
|
+
active && "is-active"
|
|
11612
|
+
),
|
|
11613
|
+
onClick: () => handleColClick(item, idx),
|
|
11614
|
+
onMouseEnter: () => setHoveredIndex(idx),
|
|
11615
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
11616
|
+
onFocus: () => setHoveredIndex(idx),
|
|
11617
|
+
onBlur: () => setHoveredIndex(null),
|
|
11618
|
+
"aria-label": `${item.label} (${summaryValues})`,
|
|
11619
|
+
role: "listitem",
|
|
11620
|
+
children: [
|
|
11621
|
+
showYAxis && /* @__PURE__ */ jsx90("span", { className: "stn-chart-bar__row-label", title: item.label, children: item.label }),
|
|
11622
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__row-track", children: rawVals.map((bar, bIdx) => {
|
|
11623
|
+
const pct = Math.max(0, Math.min(100, bar.value / max * 100));
|
|
11624
|
+
return /* @__PURE__ */ jsx90(
|
|
11625
|
+
"div",
|
|
11626
|
+
{
|
|
11627
|
+
className: "stn-chart-bar__item",
|
|
11628
|
+
style: {
|
|
11629
|
+
width: `${pct}%`,
|
|
11630
|
+
backgroundColor: bar.color
|
|
11631
|
+
}
|
|
11632
|
+
},
|
|
11633
|
+
bIdx
|
|
11634
|
+
);
|
|
11635
|
+
}) }),
|
|
11636
|
+
showValue && rawVals.length === 1 && /* @__PURE__ */ jsx90("span", { className: "stn-chart-bar__row-val", children: formatter(rawVals[0].value) }),
|
|
11637
|
+
showTooltip && isHovered && /* @__PURE__ */ jsxs65(
|
|
11638
|
+
"div",
|
|
11639
|
+
{
|
|
11640
|
+
className: "stn-chart-tooltip",
|
|
11641
|
+
style: {
|
|
11642
|
+
left: "50%",
|
|
11643
|
+
top: isFirstRow ? "100%" : "0px",
|
|
11644
|
+
transform: isFirstRow ? "translate(-50%, 8px)" : "translate(-50%, -100%)",
|
|
11645
|
+
marginTop: isFirstRow ? "0px" : "-8px"
|
|
11646
|
+
},
|
|
11647
|
+
role: "tooltip",
|
|
11648
|
+
children: [
|
|
11649
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-tooltip__header", children: item.label }),
|
|
11650
|
+
rawVals.map((bar, bIdx) => /* @__PURE__ */ jsxs65("div", { className: "stn-chart-tooltip__row", children: [
|
|
11651
|
+
/* @__PURE__ */ jsxs65("div", { className: "stn-chart-tooltip__group", children: [
|
|
11652
|
+
/* @__PURE__ */ jsx90(
|
|
11653
|
+
"span",
|
|
11654
|
+
{
|
|
11655
|
+
className: "stn-chart-tooltip__dot",
|
|
11656
|
+
style: { backgroundColor: bar.color }
|
|
11657
|
+
}
|
|
11658
|
+
),
|
|
11659
|
+
/* @__PURE__ */ jsx90("span", { className: "stn-chart-tooltip__label", children: bar.label })
|
|
11660
|
+
] }),
|
|
11661
|
+
/* @__PURE__ */ jsx90("span", { className: "stn-chart-tooltip__value", children: formatter(bar.value) })
|
|
11662
|
+
] }, bIdx))
|
|
11663
|
+
]
|
|
11664
|
+
}
|
|
11665
|
+
)
|
|
11666
|
+
]
|
|
11667
|
+
},
|
|
11668
|
+
item.id ?? idx
|
|
11669
|
+
);
|
|
11670
|
+
}) })
|
|
11671
|
+
] })
|
|
11672
|
+
) : (
|
|
11673
|
+
/* ==================== 세로 막대 (Vertical) ==================== */
|
|
11674
|
+
/* @__PURE__ */ jsxs65(Fragment13, { children: [
|
|
11675
|
+
showYAxis && /* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__grid", "aria-hidden": "true", children: gridRows.map((row, rIdx) => /* @__PURE__ */ jsxs65("div", { className: "stn-chart-bar__grid-row", children: [
|
|
11676
|
+
/* @__PURE__ */ jsx90("span", { className: "stn-chart-bar__axis-label", children: row.label }),
|
|
11677
|
+
/* @__PURE__ */ jsx90(
|
|
11678
|
+
"div",
|
|
11679
|
+
{
|
|
11680
|
+
className: cn(
|
|
11681
|
+
"stn-chart-bar__grid-line",
|
|
11682
|
+
row.isZero && "stn-chart-bar__grid-line--zero"
|
|
11683
|
+
)
|
|
11684
|
+
}
|
|
11685
|
+
)
|
|
11686
|
+
] }, rIdx)) }),
|
|
11687
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__columns", role: "list", children: data.map((item, idx) => {
|
|
11688
|
+
const active = isHighlighted(idx, item);
|
|
11689
|
+
const isHovered = hoveredIndex === idx;
|
|
11690
|
+
const rawVals = item.values.map((v, vIdx) => {
|
|
11691
|
+
const colorIndex = colorBy === "category" ? idx : vIdx;
|
|
11692
|
+
if (typeof v === "number") {
|
|
11693
|
+
return {
|
|
11694
|
+
value: v,
|
|
11695
|
+
color: resolveChartColor(void 0, colorIndex),
|
|
11696
|
+
label: legend?.[colorIndex]?.label || (colorBy === "category" ? item.label : `Series ${vIdx + 1}`)
|
|
11697
|
+
};
|
|
11698
|
+
}
|
|
11699
|
+
return {
|
|
11700
|
+
value: v.value,
|
|
11701
|
+
color: resolveChartColor(v.color, colorIndex),
|
|
11702
|
+
label: v.label || legend?.[colorIndex]?.label || (colorBy === "category" ? item.label : `Series ${vIdx + 1}`)
|
|
11703
|
+
};
|
|
11704
|
+
});
|
|
11705
|
+
const summaryValues = rawVals.map((v) => v.value).join(", ");
|
|
11706
|
+
return /* @__PURE__ */ jsxs65(
|
|
11707
|
+
"button",
|
|
11708
|
+
{
|
|
11709
|
+
type: "button",
|
|
11710
|
+
className: cn(
|
|
11711
|
+
"stn-chart-bar__col",
|
|
11712
|
+
compact && "stn-chart-bar__col--compact",
|
|
11713
|
+
active && "is-active"
|
|
11714
|
+
),
|
|
11715
|
+
onClick: () => handleColClick(item, idx),
|
|
11716
|
+
onMouseEnter: () => setHoveredIndex(idx),
|
|
11717
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
11718
|
+
onFocus: () => setHoveredIndex(idx),
|
|
11719
|
+
onBlur: () => setHoveredIndex(null),
|
|
11720
|
+
"aria-label": `${item.label} (${summaryValues})`,
|
|
11721
|
+
role: "listitem",
|
|
11722
|
+
children: [
|
|
11723
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__highlight" }),
|
|
11724
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-bar__bars-wrap", children: rawVals.map((bar, bIdx) => {
|
|
11725
|
+
const pct = Math.max(0, Math.min(100, bar.value / max * 100));
|
|
11726
|
+
return /* @__PURE__ */ jsx90(
|
|
11727
|
+
"div",
|
|
11728
|
+
{
|
|
11729
|
+
className: "stn-chart-bar__item",
|
|
11730
|
+
style: {
|
|
11731
|
+
height: `${pct}%`,
|
|
11732
|
+
backgroundColor: bar.color
|
|
11733
|
+
}
|
|
11734
|
+
},
|
|
11735
|
+
bIdx
|
|
11736
|
+
);
|
|
11737
|
+
}) }),
|
|
11738
|
+
showXAxis && /* @__PURE__ */ jsx90("span", { className: "stn-chart-bar__label", children: item.label }),
|
|
11739
|
+
showTooltip && isHovered && /* @__PURE__ */ jsxs65(
|
|
11740
|
+
"div",
|
|
11741
|
+
{
|
|
11742
|
+
className: cn(
|
|
11743
|
+
"stn-chart-tooltip",
|
|
11744
|
+
idx >= data.length - 2 && data.length > 3 && "stn-chart-tooltip--flip-x",
|
|
11745
|
+
idx === 0 && "stn-chart-tooltip--align-left"
|
|
11746
|
+
),
|
|
11747
|
+
style: {
|
|
11748
|
+
left: "50%",
|
|
11749
|
+
top: "0px"
|
|
11750
|
+
},
|
|
11751
|
+
role: "tooltip",
|
|
11752
|
+
children: [
|
|
11753
|
+
/* @__PURE__ */ jsx90("div", { className: "stn-chart-tooltip__header", children: item.label }),
|
|
11754
|
+
rawVals.map((bar, bIdx) => /* @__PURE__ */ jsxs65("div", { className: "stn-chart-tooltip__row", children: [
|
|
11755
|
+
/* @__PURE__ */ jsxs65("div", { className: "stn-chart-tooltip__group", children: [
|
|
11756
|
+
/* @__PURE__ */ jsx90(
|
|
11757
|
+
"span",
|
|
11758
|
+
{
|
|
11759
|
+
className: "stn-chart-tooltip__dot",
|
|
11760
|
+
style: { backgroundColor: bar.color }
|
|
11761
|
+
}
|
|
11762
|
+
),
|
|
11763
|
+
/* @__PURE__ */ jsx90("span", { className: "stn-chart-tooltip__label", children: bar.label })
|
|
11764
|
+
] }),
|
|
11765
|
+
/* @__PURE__ */ jsx90("span", { className: "stn-chart-tooltip__value", children: formatter(bar.value) })
|
|
11766
|
+
] }, bIdx))
|
|
11767
|
+
]
|
|
11768
|
+
}
|
|
11769
|
+
)
|
|
11770
|
+
]
|
|
11771
|
+
},
|
|
11772
|
+
item.id ?? idx
|
|
11773
|
+
);
|
|
11774
|
+
}) })
|
|
11775
|
+
] })
|
|
11776
|
+
) }),
|
|
11777
|
+
legend && legend.length > 0 && /* @__PURE__ */ jsx90("div", { className: "stn-chart-legend-pill", "aria-label": "\uCC28\uD2B8 \uBC94\uB840", children: legend.map((leg, lIdx) => /* @__PURE__ */ jsxs65("div", { className: "stn-chart-legend-pill__item", children: [
|
|
11778
|
+
/* @__PURE__ */ jsx90(
|
|
11779
|
+
"span",
|
|
11780
|
+
{
|
|
11781
|
+
className: "stn-chart-legend-pill__bar",
|
|
11782
|
+
style: { backgroundColor: resolveChartColor(leg.color, lIdx) }
|
|
11783
|
+
}
|
|
11784
|
+
),
|
|
11785
|
+
/* @__PURE__ */ jsx90("span", { className: "stn-chart-legend-pill__label", children: leg.label })
|
|
11786
|
+
] }, lIdx)) })
|
|
11787
|
+
]
|
|
11788
|
+
}
|
|
11789
|
+
);
|
|
11790
|
+
}
|
|
11791
|
+
|
|
11792
|
+
// src/components/StnPieChart.tsx
|
|
11793
|
+
import {
|
|
11794
|
+
useId as useId18,
|
|
11795
|
+
useState as useState25
|
|
11796
|
+
} from "react";
|
|
11797
|
+
import { Fragment as Fragment14, jsx as jsx91, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
11798
|
+
var DEFAULT_PIE_COLORS = STN_CHART_COLORS;
|
|
11799
|
+
var R = 38;
|
|
11800
|
+
var CIRCUMFERENCE = 2 * Math.PI * R;
|
|
11801
|
+
var STROKE_WIDTH_MAP = {
|
|
11802
|
+
sm: 3,
|
|
11803
|
+
md: 5,
|
|
11804
|
+
lg: 8
|
|
11805
|
+
};
|
|
11806
|
+
function StnPieChart({
|
|
11807
|
+
data = [],
|
|
11808
|
+
loading = false,
|
|
11809
|
+
emptyText,
|
|
11810
|
+
variant = "gauge",
|
|
11811
|
+
strokeWidth: customStrokeWidth,
|
|
11812
|
+
thickness,
|
|
11813
|
+
showTooltip = true,
|
|
11814
|
+
centerLabel,
|
|
11815
|
+
centerSubLabel,
|
|
11816
|
+
showLegend = true,
|
|
11817
|
+
size = 90,
|
|
11818
|
+
decimals,
|
|
11819
|
+
format,
|
|
11820
|
+
className,
|
|
11821
|
+
style,
|
|
11822
|
+
...rest
|
|
11823
|
+
}) {
|
|
11824
|
+
const filterId = useId18().replace(/:/g, "");
|
|
11825
|
+
const [hoveredIndex, setHoveredIndex] = useState25(null);
|
|
11826
|
+
const hasData = Boolean(data && data.length > 0);
|
|
11827
|
+
if (loading || !hasData) {
|
|
11828
|
+
return /* @__PURE__ */ jsx91(
|
|
11829
|
+
"div",
|
|
11830
|
+
{
|
|
11831
|
+
className: cn("stn-chart-gauge", className),
|
|
11832
|
+
style: { ...style, position: "relative", minWidth: size, minHeight: size },
|
|
11833
|
+
...rest,
|
|
11834
|
+
children: renderChartState(loading, hasData, emptyText)
|
|
11835
|
+
}
|
|
11836
|
+
);
|
|
11837
|
+
}
|
|
11838
|
+
const strokeInput = customStrokeWidth ?? thickness;
|
|
11839
|
+
const resolvedStrokeSize = typeof strokeInput === "string" && strokeInput in STROKE_WIDTH_MAP ? strokeInput : void 0;
|
|
11840
|
+
const baseStrokeWidth = typeof strokeInput === "number" ? strokeInput : STROKE_WIDTH_MAP[resolvedStrokeSize ?? "md"] ?? 5;
|
|
11841
|
+
const hoverStrokeWidth = baseStrokeWidth + (baseStrokeWidth >= 8 ? 2.5 : 2);
|
|
11842
|
+
const total = data.reduce((acc, cur) => acc + (cur.value || 0), 0);
|
|
11843
|
+
const resolvedTotal = total > 0 ? total : 1;
|
|
11844
|
+
let accumulatedOffset = 0;
|
|
11845
|
+
const segments = data.map((item, idx) => {
|
|
11846
|
+
const ratio = Math.max(0, item.value / resolvedTotal);
|
|
11847
|
+
const segmentLength = ratio * CIRCUMFERENCE;
|
|
11848
|
+
const offset = -accumulatedOffset;
|
|
11849
|
+
accumulatedOffset += segmentLength;
|
|
11850
|
+
const color = resolveChartColor(item.color, idx);
|
|
11851
|
+
return {
|
|
11852
|
+
...item,
|
|
11853
|
+
color,
|
|
11854
|
+
segmentLength: Number(segmentLength.toFixed(2)),
|
|
11855
|
+
offset: Number(offset.toFixed(2)),
|
|
11856
|
+
ratio
|
|
11857
|
+
};
|
|
11858
|
+
});
|
|
11859
|
+
const containerStyle = {
|
|
11860
|
+
...style,
|
|
11861
|
+
position: "relative"
|
|
11862
|
+
};
|
|
11863
|
+
const activeSeg = hoveredIndex !== null ? segments[hoveredIndex] : null;
|
|
11864
|
+
return /* @__PURE__ */ jsxs66(
|
|
11865
|
+
"div",
|
|
11866
|
+
{
|
|
11867
|
+
className: cn(
|
|
11868
|
+
"stn-chart-gauge",
|
|
11869
|
+
resolvedStrokeSize && `stn-chart-gauge--${resolvedStrokeSize}`,
|
|
11870
|
+
!showTooltip && "stn-chart--no-tooltip",
|
|
11871
|
+
className
|
|
11872
|
+
),
|
|
11873
|
+
style: containerStyle,
|
|
11874
|
+
...rest,
|
|
11875
|
+
children: [
|
|
11876
|
+
/* @__PURE__ */ jsxs66(
|
|
11877
|
+
"svg",
|
|
11878
|
+
{
|
|
11879
|
+
className: "stn-chart-gauge__svg",
|
|
11880
|
+
viewBox: "0 0 90 90",
|
|
11881
|
+
style: { width: size, height: size },
|
|
11882
|
+
"aria-hidden": "true",
|
|
11883
|
+
children: [
|
|
11884
|
+
/* @__PURE__ */ jsx91("defs", { children: /* @__PURE__ */ jsx91("filter", { id: `gauge_shadow_${filterId}`, x: "-30%", y: "-30%", width: "160%", height: "160%", children: /* @__PURE__ */ jsx91("feDropShadow", { dx: "0", dy: "2", stdDeviation: "3", floodColor: "var(--stn-opacity-black-30)" }) }) }),
|
|
11885
|
+
/* @__PURE__ */ jsx91(
|
|
11886
|
+
"circle",
|
|
11887
|
+
{
|
|
11888
|
+
className: "stn-chart-gauge__track",
|
|
11889
|
+
cx: "45",
|
|
11890
|
+
cy: "45",
|
|
11891
|
+
r: R,
|
|
11892
|
+
style: resolvedStrokeSize ? void 0 : { strokeWidth: baseStrokeWidth }
|
|
11893
|
+
}
|
|
11894
|
+
),
|
|
11895
|
+
segments.map((seg, sIdx) => {
|
|
11896
|
+
const isHovered = hoveredIndex === sIdx;
|
|
11897
|
+
return /* @__PURE__ */ jsx91(
|
|
11898
|
+
"circle",
|
|
11899
|
+
{
|
|
11900
|
+
className: "stn-chart-gauge__seg",
|
|
11901
|
+
cx: "45",
|
|
11902
|
+
cy: "45",
|
|
11903
|
+
r: R,
|
|
11904
|
+
stroke: seg.color,
|
|
11905
|
+
strokeWidth: isHovered ? hoverStrokeWidth : resolvedStrokeSize ? void 0 : baseStrokeWidth,
|
|
11906
|
+
strokeDasharray: `${seg.segmentLength} ${CIRCUMFERENCE.toFixed(2)}`,
|
|
11907
|
+
strokeDashoffset: seg.offset,
|
|
11908
|
+
onMouseEnter: () => setHoveredIndex(sIdx),
|
|
11909
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
11910
|
+
onFocus: () => setHoveredIndex(sIdx),
|
|
11911
|
+
onBlur: () => setHoveredIndex(null),
|
|
11912
|
+
tabIndex: 0,
|
|
11913
|
+
role: "graphics-symbol",
|
|
11914
|
+
"aria-label": `${seg.label}: ${seg.value}`,
|
|
11915
|
+
style: {
|
|
11916
|
+
cursor: showTooltip ? "pointer" : "default",
|
|
11917
|
+
transition: "stroke-width 0.15s ease",
|
|
11918
|
+
outline: "none"
|
|
11919
|
+
}
|
|
11920
|
+
},
|
|
11921
|
+
seg.id ?? sIdx
|
|
11922
|
+
);
|
|
11923
|
+
}),
|
|
11924
|
+
variant === "gauge" ? /* @__PURE__ */ jsxs66(Fragment14, { children: [
|
|
11925
|
+
/* @__PURE__ */ jsx91("circle", { className: "stn-chart-gauge__center-outer", cx: "45", cy: "45", r: "31" }),
|
|
11926
|
+
/* @__PURE__ */ jsx91(
|
|
11927
|
+
"circle",
|
|
11928
|
+
{
|
|
11929
|
+
className: "stn-chart-gauge__center-inner",
|
|
11930
|
+
cx: "45",
|
|
11931
|
+
cy: "45",
|
|
11932
|
+
r: "25",
|
|
11933
|
+
filter: `url(#gauge_shadow_${filterId})`
|
|
11934
|
+
}
|
|
11935
|
+
),
|
|
11936
|
+
centerLabel && /* @__PURE__ */ jsx91("text", { className: "stn-chart-gauge__center-text", x: "45", y: "49", children: centerLabel })
|
|
11937
|
+
] }) : /* @__PURE__ */ jsxs66(Fragment14, { children: [
|
|
11938
|
+
/* @__PURE__ */ jsx91("circle", { className: "stn-chart-gauge__center-outer", cx: "45", cy: "45", r: "30" }),
|
|
11939
|
+
centerLabel && /* @__PURE__ */ jsx91("text", { className: "stn-chart-gauge__center-text", x: "45", y: centerSubLabel ? "46" : "49", children: centerLabel }),
|
|
11940
|
+
centerSubLabel && /* @__PURE__ */ jsx91(
|
|
11941
|
+
"text",
|
|
11942
|
+
{
|
|
11943
|
+
x: "45",
|
|
11944
|
+
y: "58",
|
|
11945
|
+
textAnchor: "middle",
|
|
11946
|
+
fill: "var(--stn-text-secondary)",
|
|
11947
|
+
fontSize: "8",
|
|
11948
|
+
fontFamily: "var(--stn-font-body)",
|
|
11949
|
+
children: centerSubLabel
|
|
11950
|
+
}
|
|
11951
|
+
)
|
|
11952
|
+
] })
|
|
11953
|
+
]
|
|
11954
|
+
}
|
|
11955
|
+
),
|
|
11956
|
+
showTooltip && activeSeg && /* @__PURE__ */ jsxs66(
|
|
11957
|
+
"div",
|
|
11958
|
+
{
|
|
11959
|
+
className: "stn-chart-tooltip",
|
|
11960
|
+
style: {
|
|
11961
|
+
left: "50%",
|
|
11962
|
+
top: "0px"
|
|
11963
|
+
},
|
|
11964
|
+
role: "tooltip",
|
|
11965
|
+
children: [
|
|
11966
|
+
/* @__PURE__ */ jsx91("div", { className: "stn-chart-tooltip__header", children: activeSeg.label }),
|
|
11967
|
+
/* @__PURE__ */ jsxs66("div", { className: "stn-chart-tooltip__row", children: [
|
|
11968
|
+
/* @__PURE__ */ jsxs66("div", { className: "stn-chart-tooltip__group", children: [
|
|
11969
|
+
/* @__PURE__ */ jsx91("span", { className: "stn-chart-tooltip__dot", style: { backgroundColor: activeSeg.color } }),
|
|
11970
|
+
/* @__PURE__ */ jsx91("span", { className: "stn-chart-tooltip__label", children: "\uC218\uCE58" })
|
|
11971
|
+
] }),
|
|
11972
|
+
/* @__PURE__ */ jsx91("span", { className: "stn-chart-tooltip__value", children: format ? format(activeSeg.value, activeSeg.ratio) : `${activeSeg.value.toLocaleString()} (${(activeSeg.ratio * 100).toFixed(decimals !== void 0 ? decimals : 1)}%)` })
|
|
11973
|
+
] })
|
|
11974
|
+
]
|
|
11975
|
+
}
|
|
11976
|
+
),
|
|
11977
|
+
showLegend && segments.length > 0 && /* @__PURE__ */ jsx91("div", { className: "stn-chart-gauge-legend", role: "list", children: segments.map((seg, lIdx) => /* @__PURE__ */ jsxs66(
|
|
11978
|
+
"div",
|
|
11979
|
+
{
|
|
11980
|
+
className: "stn-chart-gauge-legend__item",
|
|
11981
|
+
onMouseEnter: () => setHoveredIndex(lIdx),
|
|
11982
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
11983
|
+
onFocus: () => setHoveredIndex(lIdx),
|
|
11984
|
+
onBlur: () => setHoveredIndex(null),
|
|
11985
|
+
tabIndex: 0,
|
|
11986
|
+
style: { cursor: "pointer", outline: "none" },
|
|
11987
|
+
role: "listitem",
|
|
11988
|
+
children: [
|
|
11989
|
+
/* @__PURE__ */ jsx91(
|
|
11990
|
+
"span",
|
|
11991
|
+
{
|
|
11992
|
+
className: "stn-chart-gauge-legend__dot",
|
|
11993
|
+
style: { backgroundColor: seg.color }
|
|
11994
|
+
}
|
|
11995
|
+
),
|
|
11996
|
+
/* @__PURE__ */ jsx91("span", { className: "stn-chart-gauge-legend__label", children: seg.label })
|
|
11997
|
+
]
|
|
11998
|
+
},
|
|
11999
|
+
seg.id ?? lIdx
|
|
12000
|
+
)) })
|
|
12001
|
+
]
|
|
12002
|
+
}
|
|
12003
|
+
);
|
|
12004
|
+
}
|
|
12005
|
+
var StnGaugeChart = StnPieChart;
|
|
12006
|
+
|
|
12007
|
+
// src/components/StnLineChart.tsx
|
|
12008
|
+
import {
|
|
12009
|
+
useId as useId19,
|
|
12010
|
+
useRef as useRef11,
|
|
12011
|
+
useState as useState26
|
|
12012
|
+
} from "react";
|
|
12013
|
+
import { jsx as jsx92, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
12014
|
+
var DEFAULT_LINE_COLORS = STN_CHART_COLORS;
|
|
12015
|
+
var VIEW_W = 300;
|
|
12016
|
+
var VIEW_H = 84;
|
|
12017
|
+
var Y_TOP = 8;
|
|
12018
|
+
var Y_BOTTOM = 78;
|
|
12019
|
+
var STROKE_WIDTH_MAP2 = {
|
|
12020
|
+
sm: 1.5,
|
|
12021
|
+
md: 2,
|
|
12022
|
+
lg: 3
|
|
12023
|
+
};
|
|
12024
|
+
var DOT_RADIUS_MAP = {
|
|
12025
|
+
sm: 2,
|
|
12026
|
+
md: 2.5,
|
|
12027
|
+
lg: 3.5
|
|
12028
|
+
};
|
|
12029
|
+
function StnLineChart({
|
|
12030
|
+
data = [],
|
|
12031
|
+
loading = false,
|
|
12032
|
+
emptyText,
|
|
12033
|
+
variant = "line",
|
|
12034
|
+
size = "md",
|
|
12035
|
+
showDots,
|
|
12036
|
+
showPoints,
|
|
12037
|
+
dots,
|
|
12038
|
+
showXAxis = true,
|
|
12039
|
+
showYAxis = true,
|
|
12040
|
+
showTooltip = true,
|
|
12041
|
+
xAxisLabels = [],
|
|
12042
|
+
yAxis = {},
|
|
12043
|
+
legend,
|
|
12044
|
+
height,
|
|
12045
|
+
decimals,
|
|
12046
|
+
format,
|
|
12047
|
+
className,
|
|
12048
|
+
style,
|
|
12049
|
+
...rest
|
|
12050
|
+
}) {
|
|
12051
|
+
const chartId = useId19().replace(/:/g, "");
|
|
12052
|
+
const svgRef = useRef11(null);
|
|
12053
|
+
const [hoverIndex, setHoverIndex] = useState26(null);
|
|
12054
|
+
const valueFormatter = format ?? ((v) => formatChartValue(v, decimals));
|
|
12055
|
+
const hasDots = Boolean(showDots ?? showPoints ?? dots ?? false);
|
|
12056
|
+
const dotRadius = DOT_RADIUS_MAP[size] || 3;
|
|
12057
|
+
const resolvedHeight = height ?? (variant === "sparkline" ? 36 : 180);
|
|
12058
|
+
const seriesList = Array.isArray(data) && data.length > 0 && typeof data[0] === "number" ? [{ data, color: resolveChartColor(void 0, 0) }] : data.map((s, idx) => ({
|
|
12059
|
+
...s,
|
|
12060
|
+
color: resolveChartColor(s.color, idx)
|
|
12061
|
+
}));
|
|
12062
|
+
const hasData = seriesList.length > 0 && seriesList.some((s) => Array.isArray(s.data) && s.data.length > 0);
|
|
12063
|
+
if (loading || !hasData) {
|
|
12064
|
+
return /* @__PURE__ */ jsx92(
|
|
12065
|
+
"div",
|
|
12066
|
+
{
|
|
12067
|
+
className: cn("stn-chart-line", `stn-chart-line--${size}`, className),
|
|
12068
|
+
style: { ...style, height: resolvedHeight, position: "relative" },
|
|
12069
|
+
...rest,
|
|
12070
|
+
children: renderChartState(loading, hasData, emptyText)
|
|
12071
|
+
}
|
|
12072
|
+
);
|
|
12073
|
+
}
|
|
12074
|
+
const allNumbers = seriesList.flatMap((s) => s.data);
|
|
12075
|
+
const computedMax = allNumbers.length > 0 ? Math.max(...allNumbers) : 100;
|
|
12076
|
+
const computedMin = allNumbers.length > 0 ? Math.min(...allNumbers) : 0;
|
|
12077
|
+
const max = yAxis.max ?? (computedMax > 0 ? computedMax : 100);
|
|
12078
|
+
const min = yAxis.min ?? (computedMin < 0 ? computedMin : 0);
|
|
12079
|
+
const range = max - min || 1;
|
|
12080
|
+
const xStart = showYAxis ? 38 : 8;
|
|
12081
|
+
const xEnd = 295;
|
|
12082
|
+
const xDist = xEnd - xStart;
|
|
12083
|
+
const yDist = Y_BOTTOM - Y_TOP;
|
|
12084
|
+
const buildPathString = (points) => {
|
|
12085
|
+
if (!points || points.length === 0) return "";
|
|
12086
|
+
const count = points.length;
|
|
12087
|
+
return points.map((val, idx) => {
|
|
12088
|
+
const x = xStart + idx / Math.max(1, count - 1) * xDist;
|
|
12089
|
+
const y = Y_BOTTOM - (val - min) / range * yDist;
|
|
12090
|
+
return `${idx === 0 ? "M" : "L"} ${x.toFixed(1)},${y.toFixed(1)}`;
|
|
12091
|
+
}).join(" ");
|
|
12092
|
+
};
|
|
12093
|
+
const buildAreaPathString = (points) => {
|
|
12094
|
+
const linePath = buildPathString(points);
|
|
12095
|
+
if (!linePath) return "";
|
|
12096
|
+
return `${linePath} L ${xEnd},${Y_BOTTOM} L ${xStart},${Y_BOTTOM} Z`;
|
|
12097
|
+
};
|
|
12098
|
+
const gridYPositions = [6, 16, 26, 36, 46, 56, 66, 78];
|
|
12099
|
+
const strokeWidth = STROKE_WIDTH_MAP2[size] || 2;
|
|
12100
|
+
const containerStyle = {
|
|
12101
|
+
...style,
|
|
12102
|
+
height: resolvedHeight
|
|
12103
|
+
};
|
|
12104
|
+
const resolvedLegend = legend ?? (seriesList.length > 1 && seriesList.some((s) => s.label) ? seriesList.map((s, idx) => ({
|
|
12105
|
+
label: s.label || `Line ${idx + 1}`,
|
|
12106
|
+
color: resolveChartColor(s.color, idx)
|
|
12107
|
+
})) : []);
|
|
12108
|
+
const pointCount = seriesList[0]?.data.length || 0;
|
|
12109
|
+
const handleMouseMove = (e) => {
|
|
12110
|
+
if (!showTooltip || pointCount <= 0 || !svgRef.current) return;
|
|
12111
|
+
const rect = svgRef.current.getBoundingClientRect();
|
|
12112
|
+
if (rect.width <= 0) return;
|
|
12113
|
+
const svgX = (e.clientX - rect.left) / rect.width * VIEW_W;
|
|
12114
|
+
const clampedX = Math.max(xStart, Math.min(xEnd, svgX));
|
|
12115
|
+
const ratio = (clampedX - xStart) / xDist;
|
|
12116
|
+
const idx = Math.round(ratio * (pointCount - 1));
|
|
12117
|
+
setHoverIndex(Math.max(0, Math.min(pointCount - 1, idx)));
|
|
12118
|
+
};
|
|
12119
|
+
const handleMouseLeave = () => {
|
|
12120
|
+
setHoverIndex(null);
|
|
12121
|
+
};
|
|
12122
|
+
if (variant === "sparkline") {
|
|
12123
|
+
const firstSeries = seriesList[0] || { data: [] };
|
|
12124
|
+
const points = firstSeries.data;
|
|
12125
|
+
const count = points.length;
|
|
12126
|
+
const sW = 126;
|
|
12127
|
+
const sH = 32;
|
|
12128
|
+
const strokeColor = firstSeries.color || DEFAULT_LINE_COLORS[0];
|
|
12129
|
+
const polyPoints = points.map((v, i) => {
|
|
12130
|
+
const x = i / Math.max(1, count - 1) * sW;
|
|
12131
|
+
const y = sH - 4 - (v - min) / range * (sH - 8);
|
|
12132
|
+
return `${x.toFixed(1)},${y.toFixed(1)}`;
|
|
12133
|
+
}).join(" ");
|
|
12134
|
+
const areaPoints = `0,${sH} ${polyPoints} ${sW},${sH}`;
|
|
12135
|
+
const lastPoint = points[points.length - 1] ?? 0;
|
|
12136
|
+
const lastX = sW - 2;
|
|
12137
|
+
const lastY = sH - 4 - (lastPoint - min) / range * (sH - 8);
|
|
12138
|
+
return /* @__PURE__ */ jsx92(
|
|
12139
|
+
"div",
|
|
12140
|
+
{
|
|
12141
|
+
className: cn("stn-chart-sparkline", `stn-chart-line--${size}`, className),
|
|
12142
|
+
style: { ...containerStyle, position: "relative", overflow: "hidden" },
|
|
12143
|
+
...rest,
|
|
12144
|
+
children: /* @__PURE__ */ jsxs67(
|
|
12145
|
+
"svg",
|
|
12146
|
+
{
|
|
12147
|
+
width: "100%",
|
|
12148
|
+
height: "100%",
|
|
12149
|
+
viewBox: `0 0 ${sW} ${sH}`,
|
|
12150
|
+
style: { display: "block" },
|
|
12151
|
+
"aria-hidden": "true",
|
|
12152
|
+
children: [
|
|
12153
|
+
/* @__PURE__ */ jsx92("defs", { children: /* @__PURE__ */ jsxs67("linearGradient", { id: `spark_grad_${chartId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
12154
|
+
/* @__PURE__ */ jsx92("stop", { offset: "0%", stopColor: strokeColor, stopOpacity: "0.45" }),
|
|
12155
|
+
/* @__PURE__ */ jsx92("stop", { offset: "100%", stopColor: strokeColor, stopOpacity: "0" })
|
|
12156
|
+
] }) }),
|
|
12157
|
+
/* @__PURE__ */ jsx92("polygon", { points: areaPoints, fill: `url(#spark_grad_${chartId})` }),
|
|
12158
|
+
/* @__PURE__ */ jsx92(
|
|
12159
|
+
"polyline",
|
|
12160
|
+
{
|
|
12161
|
+
points: polyPoints,
|
|
12162
|
+
fill: "none",
|
|
12163
|
+
stroke: strokeColor,
|
|
12164
|
+
strokeWidth,
|
|
12165
|
+
strokeLinejoin: "round",
|
|
12166
|
+
strokeLinecap: "round",
|
|
12167
|
+
vectorEffect: "non-scaling-stroke"
|
|
12168
|
+
}
|
|
12169
|
+
),
|
|
12170
|
+
/* @__PURE__ */ jsx92("circle", { cx: lastX, cy: lastY, r: "3", fill: strokeColor })
|
|
12171
|
+
]
|
|
12172
|
+
}
|
|
12173
|
+
)
|
|
12174
|
+
}
|
|
12175
|
+
);
|
|
12176
|
+
}
|
|
12177
|
+
const hoverSvgX = hoverIndex !== null && pointCount > 1 ? xStart + hoverIndex / (pointCount - 1) * xDist : null;
|
|
12178
|
+
const hoverPct = hoverSvgX !== null ? hoverSvgX / VIEW_W * 100 : 0;
|
|
12179
|
+
const isNearRight = hoverPct > 68;
|
|
12180
|
+
const isNearLeft = hoverPct < 15;
|
|
12181
|
+
return /* @__PURE__ */ jsxs67(
|
|
12182
|
+
"div",
|
|
12183
|
+
{
|
|
12184
|
+
className: cn(
|
|
12185
|
+
"stn-chart-line",
|
|
12186
|
+
`stn-chart-line--${size}`,
|
|
12187
|
+
hasDots ? "stn-chart-line--dots" : "stn-chart-line--no-dots",
|
|
12188
|
+
!showXAxis && "stn-chart-line--no-x-axis",
|
|
12189
|
+
!showYAxis && "stn-chart-line--no-y-axis",
|
|
12190
|
+
!showTooltip && "stn-chart--no-tooltip",
|
|
12191
|
+
className
|
|
12192
|
+
),
|
|
12193
|
+
style: containerStyle,
|
|
12194
|
+
...rest,
|
|
12195
|
+
children: [
|
|
12196
|
+
/* @__PURE__ */ jsxs67("div", { className: "stn-chart-line__body", children: [
|
|
12197
|
+
showYAxis && /* @__PURE__ */ jsx92("div", { className: "stn-chart-line__axis-y", "aria-hidden": "true", children: (yAxis.labels && yAxis.labels.length > 0 ? yAxis.labels : [max, min + (max - min) * 0.66, min + (max - min) * 0.33, min].map((v) => valueFormatter(v))).map((lbl, idx) => /* @__PURE__ */ jsx92("span", { children: lbl }, idx)) }),
|
|
12198
|
+
/* @__PURE__ */ jsxs67("div", { className: "stn-chart-line__plot-area", style: { position: "relative", width: "100%", flex: "1 1 0%", minHeight: 0 }, children: [
|
|
12199
|
+
/* @__PURE__ */ jsxs67(
|
|
12200
|
+
"svg",
|
|
12201
|
+
{
|
|
12202
|
+
ref: svgRef,
|
|
12203
|
+
className: "stn-chart-line__svg",
|
|
12204
|
+
viewBox: `0 0 ${VIEW_W} ${VIEW_H}`,
|
|
12205
|
+
preserveAspectRatio: "none",
|
|
12206
|
+
onMouseMove: handleMouseMove,
|
|
12207
|
+
onMouseLeave: handleMouseLeave,
|
|
12208
|
+
"aria-hidden": "true",
|
|
12209
|
+
children: [
|
|
12210
|
+
/* @__PURE__ */ jsx92("defs", { children: variant === "area" && seriesList.map((series, sIdx) => {
|
|
12211
|
+
const color = series.color || DEFAULT_LINE_COLORS[sIdx % DEFAULT_LINE_COLORS.length];
|
|
12212
|
+
return /* @__PURE__ */ jsxs67(
|
|
12213
|
+
"linearGradient",
|
|
12214
|
+
{
|
|
12215
|
+
id: `line_area_grad_${chartId}_${sIdx}`,
|
|
12216
|
+
x1: "0",
|
|
12217
|
+
y1: "0",
|
|
12218
|
+
x2: "0",
|
|
12219
|
+
y2: "1",
|
|
12220
|
+
children: [
|
|
12221
|
+
/* @__PURE__ */ jsx92("stop", { offset: "0%", stopColor: color, stopOpacity: "0.35" }),
|
|
12222
|
+
/* @__PURE__ */ jsx92("stop", { offset: "100%", stopColor: color, stopOpacity: "0" })
|
|
12223
|
+
]
|
|
12224
|
+
},
|
|
12225
|
+
`grad-${sIdx}`
|
|
12226
|
+
);
|
|
12227
|
+
}) }),
|
|
12228
|
+
gridYPositions.map((yPos, idx) => {
|
|
12229
|
+
const isZero = yPos === Y_BOTTOM || idx === 1;
|
|
12230
|
+
return /* @__PURE__ */ jsx92(
|
|
12231
|
+
"line",
|
|
12232
|
+
{
|
|
12233
|
+
x1: xStart,
|
|
12234
|
+
y1: yPos,
|
|
12235
|
+
x2: xEnd,
|
|
12236
|
+
y2: yPos,
|
|
12237
|
+
stroke: isZero ? "var(--stn-chart-zero-line)" : "var(--stn-chart-grid-line)",
|
|
12238
|
+
strokeDasharray: isZero ? void 0 : "2 2"
|
|
12239
|
+
},
|
|
12240
|
+
idx
|
|
12241
|
+
);
|
|
12242
|
+
}),
|
|
12243
|
+
variant === "area" && seriesList.map((series, sIdx) => /* @__PURE__ */ jsx92(
|
|
12244
|
+
"path",
|
|
12245
|
+
{
|
|
12246
|
+
d: buildAreaPathString(series.data),
|
|
12247
|
+
fill: `url(#line_area_grad_${chartId}_${sIdx})`
|
|
12248
|
+
},
|
|
12249
|
+
`area-${series.id ?? sIdx}`
|
|
12250
|
+
)),
|
|
12251
|
+
seriesList.map((series, sIdx) => {
|
|
12252
|
+
const color = series.color || DEFAULT_LINE_COLORS[sIdx % DEFAULT_LINE_COLORS.length];
|
|
12253
|
+
return /* @__PURE__ */ jsx92(
|
|
12254
|
+
"path",
|
|
12255
|
+
{
|
|
12256
|
+
className: "stn-chart-line__path",
|
|
12257
|
+
d: buildPathString(series.data),
|
|
12258
|
+
style: { stroke: color },
|
|
12259
|
+
vectorEffect: "non-scaling-stroke"
|
|
12260
|
+
},
|
|
12261
|
+
`line-${series.id ?? sIdx}`
|
|
12262
|
+
);
|
|
12263
|
+
}),
|
|
12264
|
+
showTooltip && hoverSvgX !== null && hoverIndex !== null && /* @__PURE__ */ jsx92("g", { className: "stn-chart-line__hover-group", children: /* @__PURE__ */ jsx92(
|
|
12265
|
+
"line",
|
|
12266
|
+
{
|
|
12267
|
+
x1: hoverSvgX,
|
|
12268
|
+
y1: Y_TOP,
|
|
12269
|
+
x2: hoverSvgX,
|
|
12270
|
+
y2: Y_BOTTOM,
|
|
12271
|
+
stroke: "var(--stn-chart-highlight-border)",
|
|
12272
|
+
strokeDasharray: "2 2",
|
|
12273
|
+
strokeWidth: "1",
|
|
12274
|
+
vectorEffect: "non-scaling-stroke"
|
|
12275
|
+
}
|
|
12276
|
+
) }),
|
|
12277
|
+
/* @__PURE__ */ jsx92(
|
|
12278
|
+
"rect",
|
|
12279
|
+
{
|
|
12280
|
+
x: "0",
|
|
12281
|
+
y: "0",
|
|
12282
|
+
width: VIEW_W,
|
|
12283
|
+
height: VIEW_H,
|
|
12284
|
+
fill: "transparent",
|
|
12285
|
+
style: { cursor: showTooltip ? "crosshair" : "default" }
|
|
12286
|
+
}
|
|
12287
|
+
)
|
|
12288
|
+
]
|
|
12289
|
+
}
|
|
12290
|
+
),
|
|
12291
|
+
hasDots && /* @__PURE__ */ jsx92("div", { className: "stn-chart-line__dots", "aria-hidden": "true", style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: seriesList.map((series, sIdx) => {
|
|
12292
|
+
const color = series.color || DEFAULT_LINE_COLORS[sIdx % DEFAULT_LINE_COLORS.length];
|
|
12293
|
+
const count = series.data.length;
|
|
12294
|
+
return series.data.map((val, pIdx) => {
|
|
12295
|
+
const xPct = (xStart + pIdx / Math.max(1, count - 1) * xDist) / VIEW_W * 100;
|
|
12296
|
+
const yPct = (Y_BOTTOM - (val - min) / range * yDist) / VIEW_H * 100;
|
|
12297
|
+
const isHoveredPoint = hoverIndex === pIdx;
|
|
12298
|
+
const r = isHoveredPoint ? dotRadius + 1.2 : dotRadius;
|
|
12299
|
+
return /* @__PURE__ */ jsx92(
|
|
12300
|
+
"span",
|
|
12301
|
+
{
|
|
12302
|
+
className: cn("stn-chart-line__dot", isHoveredPoint && "is-active"),
|
|
12303
|
+
style: {
|
|
12304
|
+
position: "absolute",
|
|
12305
|
+
left: `${xPct}%`,
|
|
12306
|
+
top: `${yPct}%`,
|
|
12307
|
+
width: `${r * 2}px`,
|
|
12308
|
+
height: `${r * 2}px`,
|
|
12309
|
+
borderRadius: "var(--stn-radius-full)",
|
|
12310
|
+
backgroundColor: color,
|
|
12311
|
+
transform: "translate(-50%, -50%)",
|
|
12312
|
+
boxShadow: isHoveredPoint ? "0 0 0 2px var(--stn-surface-primary)" : void 0,
|
|
12313
|
+
display: "inline-block"
|
|
12314
|
+
}
|
|
12315
|
+
},
|
|
12316
|
+
`dot-${sIdx}-${pIdx}`
|
|
12317
|
+
);
|
|
12318
|
+
});
|
|
12319
|
+
}) })
|
|
12320
|
+
] }),
|
|
12321
|
+
showXAxis && xAxisLabels.length > 0 && /* @__PURE__ */ jsx92("div", { className: "stn-chart-line__axis-x", "aria-hidden": "true", children: xAxisLabels.map((lbl, idx) => /* @__PURE__ */ jsx92("span", { children: lbl }, idx)) }),
|
|
12322
|
+
showTooltip && hoverIndex !== null && hoverSvgX !== null && /* @__PURE__ */ jsxs67(
|
|
12323
|
+
"div",
|
|
12324
|
+
{
|
|
12325
|
+
className: cn(
|
|
12326
|
+
"stn-chart-tooltip",
|
|
12327
|
+
isNearRight && "stn-chart-tooltip--flip-x",
|
|
12328
|
+
isNearLeft && "stn-chart-tooltip--align-left"
|
|
12329
|
+
),
|
|
12330
|
+
style: {
|
|
12331
|
+
left: `${hoverPct}%`,
|
|
12332
|
+
top: "10px"
|
|
12333
|
+
},
|
|
12334
|
+
role: "tooltip",
|
|
12335
|
+
children: [
|
|
12336
|
+
xAxisLabels[hoverIndex] && /* @__PURE__ */ jsx92("div", { className: "stn-chart-tooltip__header", children: xAxisLabels[hoverIndex] }),
|
|
12337
|
+
seriesList.map((series, sIdx) => {
|
|
12338
|
+
const val = series.data[hoverIndex];
|
|
12339
|
+
if (val === void 0) return null;
|
|
12340
|
+
const color = series.color || DEFAULT_LINE_COLORS[sIdx % DEFAULT_LINE_COLORS.length];
|
|
12341
|
+
return /* @__PURE__ */ jsxs67("div", { className: "stn-chart-tooltip__row", children: [
|
|
12342
|
+
/* @__PURE__ */ jsxs67("div", { className: "stn-chart-tooltip__group", children: [
|
|
12343
|
+
/* @__PURE__ */ jsx92("span", { className: "stn-chart-tooltip__dot", style: { backgroundColor: color } }),
|
|
12344
|
+
/* @__PURE__ */ jsx92("span", { className: "stn-chart-tooltip__label", children: series.label || `Series ${sIdx + 1}` })
|
|
12345
|
+
] }),
|
|
12346
|
+
/* @__PURE__ */ jsx92("span", { className: "stn-chart-tooltip__value", children: valueFormatter(val) })
|
|
12347
|
+
] }, sIdx);
|
|
12348
|
+
})
|
|
12349
|
+
]
|
|
12350
|
+
}
|
|
12351
|
+
)
|
|
12352
|
+
] }),
|
|
12353
|
+
resolvedLegend.length > 0 && /* @__PURE__ */ jsx92("div", { className: "stn-chart-legend-pill", "aria-label": "\uB77C\uC778 \uCC28\uD2B8 \uBC94\uB840", children: resolvedLegend.map((item, idx) => /* @__PURE__ */ jsxs67("div", { className: "stn-chart-legend-pill__item", children: [
|
|
12354
|
+
/* @__PURE__ */ jsx92(
|
|
12355
|
+
"span",
|
|
12356
|
+
{
|
|
12357
|
+
className: "stn-chart-legend-pill__bar",
|
|
12358
|
+
style: { backgroundColor: item.color }
|
|
12359
|
+
}
|
|
12360
|
+
),
|
|
12361
|
+
/* @__PURE__ */ jsx92("span", { className: "stn-chart-legend-pill__label", children: item.label })
|
|
12362
|
+
] }, idx)) })
|
|
12363
|
+
]
|
|
12364
|
+
}
|
|
12365
|
+
);
|
|
12366
|
+
}
|
|
12367
|
+
|
|
12368
|
+
// src/components/StnComboChart.tsx
|
|
12369
|
+
import {
|
|
12370
|
+
useId as useId20,
|
|
12371
|
+
useState as useState27
|
|
12372
|
+
} from "react";
|
|
12373
|
+
import { jsx as jsx93, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
12374
|
+
var BAR_WIDTH_MAP = {
|
|
12375
|
+
sm: "var(--stn-chart-combo-bar-width-sm)",
|
|
12376
|
+
md: "var(--stn-chart-combo-bar-width-md)",
|
|
12377
|
+
lg: "var(--stn-chart-combo-bar-width-lg)"
|
|
12378
|
+
};
|
|
12379
|
+
var DOT_RADIUS_MAP2 = {
|
|
12380
|
+
sm: 2,
|
|
12381
|
+
md: 2.5,
|
|
12382
|
+
lg: 3.5
|
|
12383
|
+
};
|
|
12384
|
+
var VIEW_W2 = 300;
|
|
12385
|
+
var VIEW_H2 = 100;
|
|
12386
|
+
var Y_TOP2 = 8;
|
|
12387
|
+
var Y_BOTTOM2 = 92;
|
|
12388
|
+
function StnComboChart({
|
|
12389
|
+
data = [],
|
|
12390
|
+
loading = false,
|
|
12391
|
+
emptyText,
|
|
12392
|
+
lines = [],
|
|
12393
|
+
size = "md",
|
|
12394
|
+
showDots = false,
|
|
12395
|
+
showXAxis = true,
|
|
12396
|
+
showLeftYAxis = true,
|
|
12397
|
+
showRightYAxis: controlledShowRightYAxis,
|
|
12398
|
+
showTooltip = true,
|
|
12399
|
+
leftYAxis = {},
|
|
12400
|
+
rightYAxis,
|
|
12401
|
+
legend,
|
|
12402
|
+
height = 220,
|
|
12403
|
+
barWidth: customBarWidth,
|
|
12404
|
+
highlightIndex: controlledHighlight,
|
|
12405
|
+
onColumnClick,
|
|
12406
|
+
decimals,
|
|
12407
|
+
className,
|
|
12408
|
+
style,
|
|
12409
|
+
...rest
|
|
12410
|
+
}) {
|
|
12411
|
+
const chartId = useId20().replace(/:/g, "");
|
|
12412
|
+
const [internalHighlight, setInternalHighlight] = useState27(null);
|
|
12413
|
+
const [hoverIndex, setHoverIndex] = useState27(null);
|
|
12414
|
+
const hasData = Boolean(data && data.length > 0);
|
|
12415
|
+
if (loading || !hasData) {
|
|
12416
|
+
return /* @__PURE__ */ jsx93(
|
|
12417
|
+
"div",
|
|
12418
|
+
{
|
|
12419
|
+
className: cn("stn-chart-combo", `stn-chart-combo--${size}`, className),
|
|
12420
|
+
style: { ...style, height, position: "relative" },
|
|
12421
|
+
...rest,
|
|
12422
|
+
children: renderChartState(loading, hasData, emptyText)
|
|
12423
|
+
}
|
|
12424
|
+
);
|
|
12425
|
+
}
|
|
12426
|
+
const showRightYAxis = controlledShowRightYAxis ?? Boolean(rightYAxis);
|
|
12427
|
+
const hasRightAxis = Boolean(rightYAxis);
|
|
12428
|
+
const parsedData = data.map((d) => {
|
|
12429
|
+
let rawVals = [];
|
|
12430
|
+
if (d.bar !== void 0) {
|
|
12431
|
+
rawVals = [{ value: d.bar, color: resolveChartColor(void 0, 0), label: "Bar" }];
|
|
12432
|
+
} else if (d.barValues !== void 0) {
|
|
12433
|
+
if (typeof d.barValues === "number") {
|
|
12434
|
+
rawVals = [{ value: d.barValues, color: resolveChartColor(void 0, 0), label: "Bar" }];
|
|
12435
|
+
} else if (Array.isArray(d.barValues)) {
|
|
12436
|
+
rawVals = d.barValues.map((v, vIdx) => {
|
|
12437
|
+
if (typeof v === "number") {
|
|
12438
|
+
return { value: v, color: resolveChartColor(void 0, vIdx), label: `Bar ${vIdx + 1}` };
|
|
12439
|
+
}
|
|
12440
|
+
return {
|
|
12441
|
+
value: v.value,
|
|
12442
|
+
color: resolveChartColor(v.color, vIdx),
|
|
12443
|
+
label: v.label || `Bar ${vIdx + 1}`
|
|
12444
|
+
};
|
|
12445
|
+
});
|
|
12446
|
+
}
|
|
12447
|
+
}
|
|
12448
|
+
return {
|
|
12449
|
+
...d,
|
|
12450
|
+
bars: rawVals
|
|
12451
|
+
};
|
|
12452
|
+
});
|
|
12453
|
+
const colCount = parsedData.length;
|
|
12454
|
+
const safeLines = lines.map((l, lIdx) => ({
|
|
12455
|
+
...l,
|
|
12456
|
+
color: resolveChartColor(l.color, (lIdx + 1) % DEFAULT_LINE_COLORS.length),
|
|
12457
|
+
data: colCount > 0 && l.data.length > colCount ? l.data.slice(0, colCount) : l.data
|
|
12458
|
+
}));
|
|
12459
|
+
const allBarValues = parsedData.flatMap((d) => d.bars.map((b) => b.value));
|
|
12460
|
+
const leftLineValues = safeLines.filter((l) => (l.yAxis ?? "left") === "left").flatMap((l) => l.data);
|
|
12461
|
+
const rightLineValues = safeLines.filter((l) => l.yAxis === "right").flatMap((l) => l.data);
|
|
12462
|
+
const allLeftValues = [...allBarValues, ...leftLineValues];
|
|
12463
|
+
const computedLeftMax = allLeftValues.length > 0 ? Math.max(...allLeftValues) : 100;
|
|
12464
|
+
const computedLeftMin = allLeftValues.length > 0 ? Math.min(...allLeftValues) : 0;
|
|
12465
|
+
const leftMax = leftYAxis.max ?? (computedLeftMax > 0 ? computedLeftMax : 100);
|
|
12466
|
+
const leftMin = leftYAxis.min ?? (computedLeftMin < 0 ? computedLeftMin : 0);
|
|
12467
|
+
const leftRange = leftMax - leftMin || 1;
|
|
12468
|
+
const leftSteps = leftYAxis.steps ?? 4;
|
|
12469
|
+
const leftFormatter = leftYAxis.format ?? ((val) => `${formatChartValue(val, decimals)}${leftYAxis.unit ?? ""}`);
|
|
12470
|
+
const computedRightMax = rightLineValues.length > 0 ? Math.max(...rightLineValues) : 100;
|
|
12471
|
+
const computedRightMin = rightLineValues.length > 0 ? Math.min(...rightLineValues) : 0;
|
|
12472
|
+
const rightMax = rightYAxis?.max ?? (computedRightMax > 0 ? computedRightMax : 100);
|
|
12473
|
+
const rightMin = rightYAxis?.min ?? (computedRightMin < 0 ? computedRightMin : 0);
|
|
12474
|
+
const rightRange = rightMax - rightMin || 1;
|
|
12475
|
+
const rightSteps = rightYAxis?.steps ?? leftSteps;
|
|
12476
|
+
const rightFormatter = rightYAxis?.format ?? ((val) => `${formatChartValue(val, decimals)}${rightYAxis?.unit ?? ""}`);
|
|
12477
|
+
const resolvedBarWidth = customBarWidth !== void 0 ? typeof customBarWidth === "number" ? `${customBarWidth}px` : customBarWidth === "sm" || customBarWidth === "md" || customBarWidth === "lg" ? BAR_WIDTH_MAP[customBarWidth] : customBarWidth : BAR_WIDTH_MAP[size] || "var(--stn-chart-combo-bar-width-md)";
|
|
12478
|
+
const dotRadius = DOT_RADIUS_MAP2[size] || 2.5;
|
|
12479
|
+
const leftGridRows = [];
|
|
12480
|
+
if (leftYAxis.labels && leftYAxis.labels.length > 0) {
|
|
12481
|
+
leftYAxis.labels.forEach((lbl, idx) => {
|
|
12482
|
+
leftGridRows.push({ label: lbl, isZero: idx === leftYAxis.labels.length - 1 });
|
|
12483
|
+
});
|
|
12484
|
+
} else {
|
|
12485
|
+
for (let i = leftSteps; i >= 0; i--) {
|
|
12486
|
+
const rawVal = leftMin + leftRange / leftSteps * i;
|
|
12487
|
+
const val = Math.abs(rawVal - Math.round(rawVal)) < 1e-9 ? Math.round(rawVal) : Number(rawVal.toFixed(6));
|
|
12488
|
+
leftGridRows.push({
|
|
12489
|
+
label: leftFormatter(val),
|
|
12490
|
+
isZero: val === 0
|
|
12491
|
+
});
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
12494
|
+
const rightGridRows = [];
|
|
12495
|
+
if (hasRightAxis) {
|
|
12496
|
+
if (rightYAxis?.labels && rightYAxis.labels.length > 0) {
|
|
12497
|
+
rightGridRows.push(...rightYAxis.labels);
|
|
12498
|
+
} else {
|
|
12499
|
+
for (let i = rightSteps; i >= 0; i--) {
|
|
12500
|
+
const rawVal = rightMin + rightRange / rightSteps * i;
|
|
12501
|
+
const val = Math.abs(rawVal - Math.round(rawVal)) < 1e-9 ? Math.round(rawVal) : Number(rawVal.toFixed(6));
|
|
12502
|
+
rightGridRows.push(rightFormatter(val));
|
|
12503
|
+
}
|
|
12504
|
+
}
|
|
12505
|
+
}
|
|
12506
|
+
const colW = colCount > 0 ? VIEW_W2 / colCount : VIEW_W2;
|
|
12507
|
+
const getLineX = (index) => (index + 0.5) * colW;
|
|
12508
|
+
const getLineY = (val, isRightAxis) => {
|
|
12509
|
+
const curMin = isRightAxis ? rightMin : leftMin;
|
|
12510
|
+
const curRange = isRightAxis ? rightRange : leftRange;
|
|
12511
|
+
const pct = (val - curMin) / curRange;
|
|
12512
|
+
return Y_BOTTOM2 - pct * (Y_BOTTOM2 - Y_TOP2);
|
|
12513
|
+
};
|
|
12514
|
+
const buildPathString = (points, isRightAxis) => {
|
|
12515
|
+
if (!points || points.length === 0) return "";
|
|
12516
|
+
return points.map((val, idx) => {
|
|
12517
|
+
const x = getLineX(idx);
|
|
12518
|
+
const y = getLineY(val, isRightAxis);
|
|
12519
|
+
return `${idx === 0 ? "M" : "L"} ${x.toFixed(1)},${y.toFixed(1)}`;
|
|
12520
|
+
}).join(" ");
|
|
12521
|
+
};
|
|
12522
|
+
const buildAreaPathString = (points, isRightAxis) => {
|
|
12523
|
+
const linePath = buildPathString(points, isRightAxis);
|
|
12524
|
+
if (!linePath || points.length === 0) return "";
|
|
12525
|
+
const startX = getLineX(0);
|
|
12526
|
+
const endX = getLineX(points.length - 1);
|
|
12527
|
+
return `${linePath} L ${endX.toFixed(1)},${Y_BOTTOM2} L ${startX.toFixed(1)},${Y_BOTTOM2} Z`;
|
|
12528
|
+
};
|
|
12529
|
+
const resolvedLegend = legend ?? [
|
|
12530
|
+
...(parsedData[0]?.bars.length ?? 0) > 0 ? parsedData[0].bars.map((b, bIdx) => ({
|
|
12531
|
+
label: b.label || (bIdx === 0 ? "\uB9C9\uB300" : `\uB9C9\uB300 ${bIdx + 1}`),
|
|
12532
|
+
color: b.color || DEFAULT_BAR_COLORS[bIdx % DEFAULT_BAR_COLORS.length],
|
|
12533
|
+
type: "bar"
|
|
12534
|
+
})) : [],
|
|
12535
|
+
...safeLines.map((l, lIdx) => ({
|
|
12536
|
+
label: l.label || `\uC120 ${lIdx + 1}`,
|
|
12537
|
+
color: l.color || DEFAULT_LINE_COLORS[(lIdx + 1) % DEFAULT_LINE_COLORS.length],
|
|
12538
|
+
type: "line"
|
|
12539
|
+
}))
|
|
12540
|
+
];
|
|
12541
|
+
const isHighlighted = (idx, item) => {
|
|
12542
|
+
if (controlledHighlight !== void 0) return controlledHighlight === idx;
|
|
12543
|
+
if (internalHighlight !== null) return internalHighlight === idx;
|
|
12544
|
+
return Boolean(item.highlight);
|
|
12545
|
+
};
|
|
12546
|
+
const handleColClick = (item, idx) => {
|
|
12547
|
+
setInternalHighlight(idx);
|
|
12548
|
+
onColumnClick?.(item, idx);
|
|
12549
|
+
};
|
|
12550
|
+
const containerStyle = {
|
|
12551
|
+
...style,
|
|
12552
|
+
height,
|
|
12553
|
+
["--stn-chart-combo-bar-width"]: resolvedBarWidth
|
|
12554
|
+
};
|
|
12555
|
+
const hoverGuideX = hoverIndex !== null ? getLineX(hoverIndex) : null;
|
|
12556
|
+
return /* @__PURE__ */ jsxs68(
|
|
12557
|
+
"div",
|
|
12558
|
+
{
|
|
12559
|
+
className: cn(
|
|
12560
|
+
"stn-chart-combo",
|
|
12561
|
+
`stn-chart-combo--${size}`,
|
|
12562
|
+
!showXAxis && "stn-chart-combo--no-x-axis",
|
|
12563
|
+
!showLeftYAxis && "stn-chart-combo--no-left-y-axis",
|
|
12564
|
+
(!showRightYAxis || !hasRightAxis) && "stn-chart-combo--no-right-y-axis",
|
|
12565
|
+
!showTooltip && "stn-chart--no-tooltip",
|
|
12566
|
+
className
|
|
12567
|
+
),
|
|
12568
|
+
style: containerStyle,
|
|
12569
|
+
...rest,
|
|
12570
|
+
children: [
|
|
12571
|
+
/* @__PURE__ */ jsxs68("div", { className: "stn-chart-combo__body", children: [
|
|
12572
|
+
showLeftYAxis && /* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__axis-y-left", "aria-hidden": "true", children: leftGridRows.map((row, rIdx) => /* @__PURE__ */ jsx93("span", { children: row.label }, rIdx)) }),
|
|
12573
|
+
showRightYAxis && hasRightAxis && /* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__axis-y-right", "aria-hidden": "true", children: rightGridRows.map((lbl, rIdx) => /* @__PURE__ */ jsx93("span", { children: lbl }, rIdx)) }),
|
|
12574
|
+
/* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__grid", "aria-hidden": "true", children: leftGridRows.map((row, rIdx) => /* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__grid-row", children: /* @__PURE__ */ jsx93(
|
|
12575
|
+
"div",
|
|
12576
|
+
{
|
|
12577
|
+
className: cn(
|
|
12578
|
+
"stn-chart-combo__grid-line",
|
|
12579
|
+
row.isZero && "stn-chart-combo__grid-line--zero"
|
|
12580
|
+
)
|
|
12581
|
+
}
|
|
12582
|
+
) }, rIdx)) }),
|
|
12583
|
+
/* @__PURE__ */ jsxs68("div", { className: "stn-chart-combo__content", children: [
|
|
12584
|
+
/* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__columns", role: "list", children: parsedData.map((item, idx) => {
|
|
12585
|
+
const active = isHighlighted(idx, item);
|
|
12586
|
+
return /* @__PURE__ */ jsxs68(
|
|
12587
|
+
"button",
|
|
12588
|
+
{
|
|
12589
|
+
type: "button",
|
|
12590
|
+
className: cn("stn-chart-combo__col", active && "is-active"),
|
|
12591
|
+
onClick: () => handleColClick(item, idx),
|
|
12592
|
+
onMouseEnter: () => setHoverIndex(idx),
|
|
12593
|
+
onMouseLeave: () => setHoverIndex(null),
|
|
12594
|
+
"aria-label": item.label,
|
|
12595
|
+
role: "listitem",
|
|
12596
|
+
children: [
|
|
12597
|
+
/* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__highlight" }),
|
|
12598
|
+
/* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__bars-wrap", children: item.bars.map((b, bIdx) => {
|
|
12599
|
+
const pct = Math.max(0, Math.min(100, (b.value - leftMin) / leftRange * 100));
|
|
12600
|
+
return /* @__PURE__ */ jsx93(
|
|
12601
|
+
"div",
|
|
12602
|
+
{
|
|
12603
|
+
className: "stn-chart-combo__bar",
|
|
12604
|
+
style: {
|
|
12605
|
+
height: `${pct}%`,
|
|
12606
|
+
backgroundColor: b.color
|
|
12607
|
+
}
|
|
12608
|
+
},
|
|
12609
|
+
bIdx
|
|
12610
|
+
);
|
|
12611
|
+
}) })
|
|
12612
|
+
]
|
|
12613
|
+
},
|
|
12614
|
+
item.id ?? idx
|
|
12615
|
+
);
|
|
12616
|
+
}) }),
|
|
12617
|
+
/* @__PURE__ */ jsxs68(
|
|
12618
|
+
"svg",
|
|
12619
|
+
{
|
|
12620
|
+
className: "stn-chart-combo__svg-overlay",
|
|
12621
|
+
viewBox: `0 0 ${VIEW_W2} ${VIEW_H2}`,
|
|
12622
|
+
preserveAspectRatio: "none",
|
|
12623
|
+
"aria-hidden": "true",
|
|
12624
|
+
children: [
|
|
12625
|
+
/* @__PURE__ */ jsx93("defs", { children: safeLines.map((series, sIdx) => {
|
|
12626
|
+
if (!series.area) return null;
|
|
12627
|
+
const color = series.color || DEFAULT_LINE_COLORS[(sIdx + 1) % DEFAULT_LINE_COLORS.length];
|
|
12628
|
+
return /* @__PURE__ */ jsxs68(
|
|
12629
|
+
"linearGradient",
|
|
12630
|
+
{
|
|
12631
|
+
id: `combo_area_grad_${chartId}_${sIdx}`,
|
|
12632
|
+
x1: "0",
|
|
12633
|
+
y1: "0",
|
|
12634
|
+
x2: "0",
|
|
12635
|
+
y2: "1",
|
|
12636
|
+
children: [
|
|
12637
|
+
/* @__PURE__ */ jsx93("stop", { offset: "0%", stopColor: color, stopOpacity: "0.32" }),
|
|
12638
|
+
/* @__PURE__ */ jsx93("stop", { offset: "100%", stopColor: color, stopOpacity: "0.0" })
|
|
12639
|
+
]
|
|
12640
|
+
},
|
|
12641
|
+
`grad-${sIdx}`
|
|
12642
|
+
);
|
|
12643
|
+
}) }),
|
|
12644
|
+
safeLines.map((series, sIdx) => {
|
|
12645
|
+
if (!series.area) return null;
|
|
12646
|
+
const isRight = series.yAxis === "right";
|
|
12647
|
+
return /* @__PURE__ */ jsx93(
|
|
12648
|
+
"path",
|
|
12649
|
+
{
|
|
12650
|
+
d: buildAreaPathString(series.data, isRight),
|
|
12651
|
+
fill: `url(#combo_area_grad_${chartId}_${sIdx})`
|
|
12652
|
+
},
|
|
12653
|
+
`area-${series.id ?? sIdx}`
|
|
12654
|
+
);
|
|
12655
|
+
}),
|
|
12656
|
+
safeLines.map((series, sIdx) => {
|
|
12657
|
+
const color = series.color || DEFAULT_LINE_COLORS[(sIdx + 1) % DEFAULT_LINE_COLORS.length];
|
|
12658
|
+
const isRight = series.yAxis === "right";
|
|
12659
|
+
return /* @__PURE__ */ jsx93(
|
|
12660
|
+
"path",
|
|
12661
|
+
{
|
|
12662
|
+
className: "stn-chart-combo__path",
|
|
12663
|
+
d: buildPathString(series.data, isRight),
|
|
12664
|
+
style: { stroke: color },
|
|
12665
|
+
vectorEffect: "non-scaling-stroke"
|
|
12666
|
+
},
|
|
12667
|
+
`line-${series.id ?? sIdx}`
|
|
12668
|
+
);
|
|
12669
|
+
}),
|
|
12670
|
+
showTooltip && hoverGuideX !== null && /* @__PURE__ */ jsx93("g", { className: "stn-chart-line__hover-group", children: /* @__PURE__ */ jsx93(
|
|
12671
|
+
"line",
|
|
12672
|
+
{
|
|
12673
|
+
x1: hoverGuideX,
|
|
12674
|
+
y1: Y_TOP2,
|
|
12675
|
+
x2: hoverGuideX,
|
|
12676
|
+
y2: Y_BOTTOM2,
|
|
12677
|
+
stroke: "var(--stn-chart-highlight-border)",
|
|
12678
|
+
strokeDasharray: "2 2",
|
|
12679
|
+
strokeWidth: "1",
|
|
12680
|
+
vectorEffect: "non-scaling-stroke"
|
|
12681
|
+
}
|
|
12682
|
+
) })
|
|
12683
|
+
]
|
|
12684
|
+
}
|
|
12685
|
+
),
|
|
12686
|
+
/* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__dots-layer", "aria-hidden": "true", style: { position: "absolute", inset: 0, pointerEvents: "none", zIndex: 3 }, children: safeLines.map((series, sIdx) => {
|
|
12687
|
+
const shouldShowDots = series.showDots ?? showDots;
|
|
12688
|
+
if (!shouldShowDots) return null;
|
|
12689
|
+
const color = series.color || DEFAULT_LINE_COLORS[(sIdx + 1) % DEFAULT_LINE_COLORS.length];
|
|
12690
|
+
const isRight = series.yAxis === "right";
|
|
12691
|
+
return series.data.map((val, pIdx) => {
|
|
12692
|
+
const xPct = getLineX(pIdx) / VIEW_W2 * 100;
|
|
12693
|
+
const yPct = getLineY(val, isRight) / VIEW_H2 * 100;
|
|
12694
|
+
const isHovered = hoverIndex === pIdx;
|
|
12695
|
+
const r = isHovered ? dotRadius + 1.2 : dotRadius;
|
|
12696
|
+
return /* @__PURE__ */ jsx93(
|
|
12697
|
+
"span",
|
|
12698
|
+
{
|
|
12699
|
+
className: cn("stn-chart-line__dot", isHovered && "is-active"),
|
|
12700
|
+
style: {
|
|
12701
|
+
position: "absolute",
|
|
12702
|
+
left: `${xPct}%`,
|
|
12703
|
+
top: `${yPct}%`,
|
|
12704
|
+
width: `${r * 2}px`,
|
|
12705
|
+
height: `${r * 2}px`,
|
|
12706
|
+
borderRadius: "var(--stn-radius-full)",
|
|
12707
|
+
backgroundColor: color,
|
|
12708
|
+
transform: "translate(-50%, -50%)",
|
|
12709
|
+
boxShadow: isHovered ? "0 0 0 2px var(--stn-surface-primary)" : void 0,
|
|
12710
|
+
display: "inline-block"
|
|
12711
|
+
}
|
|
12712
|
+
},
|
|
12713
|
+
`combo-dot-${sIdx}-${pIdx}`
|
|
12714
|
+
);
|
|
12715
|
+
});
|
|
12716
|
+
}) }),
|
|
12717
|
+
showTooltip && hoverIndex !== null && parsedData[hoverIndex] && (() => {
|
|
12718
|
+
const colPct = (hoverIndex + 0.5) / colCount * 100;
|
|
12719
|
+
const isNearRight = colPct > 68;
|
|
12720
|
+
const isNearLeft = colPct < 15;
|
|
12721
|
+
return /* @__PURE__ */ jsxs68(
|
|
12722
|
+
"div",
|
|
12723
|
+
{
|
|
12724
|
+
className: cn(
|
|
12725
|
+
"stn-chart-tooltip",
|
|
12726
|
+
isNearRight && "stn-chart-tooltip--flip-x",
|
|
12727
|
+
isNearLeft && "stn-chart-tooltip--align-left"
|
|
12728
|
+
),
|
|
12729
|
+
style: {
|
|
12730
|
+
left: `${colPct}%`,
|
|
12731
|
+
top: "0px"
|
|
12732
|
+
},
|
|
12733
|
+
role: "tooltip",
|
|
12734
|
+
children: [
|
|
12735
|
+
/* @__PURE__ */ jsx93("div", { className: "stn-chart-tooltip__header", children: parsedData[hoverIndex].label }),
|
|
12736
|
+
parsedData[hoverIndex].bars.map((b, bIdx) => /* @__PURE__ */ jsxs68("div", { className: "stn-chart-tooltip__row", children: [
|
|
12737
|
+
/* @__PURE__ */ jsxs68("div", { className: "stn-chart-tooltip__group", children: [
|
|
12738
|
+
/* @__PURE__ */ jsx93(
|
|
12739
|
+
"span",
|
|
12740
|
+
{
|
|
12741
|
+
className: "stn-chart-tooltip__bar-mark",
|
|
12742
|
+
style: {
|
|
12743
|
+
backgroundColor: b.color
|
|
12744
|
+
}
|
|
12745
|
+
}
|
|
12746
|
+
),
|
|
12747
|
+
/* @__PURE__ */ jsx93("span", { className: "stn-chart-tooltip__label", children: b.label })
|
|
12748
|
+
] }),
|
|
12749
|
+
/* @__PURE__ */ jsx93("span", { className: "stn-chart-tooltip__value", children: leftFormatter(b.value) })
|
|
12750
|
+
] }, `tip-bar-${bIdx}`)),
|
|
12751
|
+
safeLines.map((series, sIdx) => {
|
|
12752
|
+
const val = series.data[hoverIndex];
|
|
12753
|
+
if (val === void 0) return null;
|
|
12754
|
+
const color = series.color || DEFAULT_LINE_COLORS[(sIdx + 1) % DEFAULT_LINE_COLORS.length];
|
|
12755
|
+
const isRight = series.yAxis === "right";
|
|
12756
|
+
const formatter = isRight ? rightFormatter : leftFormatter;
|
|
12757
|
+
return /* @__PURE__ */ jsxs68("div", { className: "stn-chart-tooltip__row", children: [
|
|
12758
|
+
/* @__PURE__ */ jsxs68("div", { className: "stn-chart-tooltip__group", children: [
|
|
12759
|
+
/* @__PURE__ */ jsx93("span", { className: "stn-chart-tooltip__dot", style: { backgroundColor: color } }),
|
|
12760
|
+
/* @__PURE__ */ jsx93("span", { className: "stn-chart-tooltip__label", children: series.label || `\uC120 ${sIdx + 1}` })
|
|
12761
|
+
] }),
|
|
12762
|
+
/* @__PURE__ */ jsx93("span", { className: "stn-chart-tooltip__value", children: formatter(val) })
|
|
12763
|
+
] }, `tip-line-${sIdx}`);
|
|
12764
|
+
})
|
|
12765
|
+
]
|
|
12766
|
+
}
|
|
12767
|
+
);
|
|
12768
|
+
})()
|
|
12769
|
+
] }),
|
|
12770
|
+
showXAxis && /* @__PURE__ */ jsx93("div", { className: "stn-chart-combo__axis-x", "aria-hidden": "true", children: parsedData.map((item, idx) => /* @__PURE__ */ jsx93("span", { className: "stn-chart-combo__axis-x-item", title: item.label, children: item.label }, item.id ?? idx)) })
|
|
12771
|
+
] }),
|
|
12772
|
+
resolvedLegend.length > 0 && /* @__PURE__ */ jsx93("div", { className: "stn-chart-legend-pill", "aria-label": "\uBCF5\uD569 \uCC28\uD2B8 \uBC94\uB840", children: resolvedLegend.map((item, idx) => /* @__PURE__ */ jsxs68("div", { className: "stn-chart-legend-pill__item", children: [
|
|
12773
|
+
item.type === "line" ? /* @__PURE__ */ jsx93(
|
|
12774
|
+
"span",
|
|
12775
|
+
{
|
|
12776
|
+
className: "stn-chart-legend-pill__line-marker",
|
|
12777
|
+
style: { backgroundColor: item.color },
|
|
12778
|
+
children: /* @__PURE__ */ jsx93(
|
|
12779
|
+
"span",
|
|
12780
|
+
{
|
|
12781
|
+
className: "stn-chart-legend-pill__line-dot",
|
|
12782
|
+
style: { backgroundColor: item.color }
|
|
12783
|
+
}
|
|
12784
|
+
)
|
|
12785
|
+
}
|
|
12786
|
+
) : /* @__PURE__ */ jsx93(
|
|
12787
|
+
"span",
|
|
12788
|
+
{
|
|
12789
|
+
className: "stn-chart-legend-pill__bar",
|
|
12790
|
+
style: { backgroundColor: item.color }
|
|
12791
|
+
}
|
|
12792
|
+
),
|
|
12793
|
+
/* @__PURE__ */ jsx93("span", { className: "stn-chart-legend-pill__label", children: item.label })
|
|
12794
|
+
] }, idx)) })
|
|
12795
|
+
]
|
|
12796
|
+
}
|
|
12797
|
+
);
|
|
12798
|
+
}
|
|
11274
12799
|
export {
|
|
11275
12800
|
AlertCenterDashboard,
|
|
11276
12801
|
AlertCenterPageScaffold,
|
|
11277
12802
|
DEFAULT_3D_GRAPH_LINKS,
|
|
11278
12803
|
DEFAULT_3D_GRAPH_NODES,
|
|
12804
|
+
DEFAULT_BAR_COLORS,
|
|
12805
|
+
DEFAULT_CHART_COLORS,
|
|
12806
|
+
DEFAULT_LINE_COLORS,
|
|
12807
|
+
DEFAULT_PIE_COLORS,
|
|
11279
12808
|
DashboardPageScaffold,
|
|
11280
12809
|
Divider,
|
|
11281
12810
|
LoginPageScaffold,
|
|
@@ -11283,6 +12812,8 @@ export {
|
|
|
11283
12812
|
PubDisabilityStatusList,
|
|
11284
12813
|
PubTop5EquipmentBars,
|
|
11285
12814
|
PubTrafficTop5Bars,
|
|
12815
|
+
SEVERITY_COLOR_TOKENS,
|
|
12816
|
+
STATUS_COLOR_TOKENS,
|
|
11286
12817
|
STN_ALERT_CENTER_DASHBOARD_USAGE,
|
|
11287
12818
|
STN_ALERT_CENTER_DASHBOARD_WIDGETS,
|
|
11288
12819
|
STN_ALERT_CENTER_DEMO_ALERTS2 as STN_ALERT_CENTER_DEMO_ALERTS,
|
|
@@ -11294,6 +12825,8 @@ export {
|
|
|
11294
12825
|
STN_ALERT_CENTER_TAB_IDS,
|
|
11295
12826
|
STN_ALERT_CENTER_USAGE,
|
|
11296
12827
|
STN_ALERT_CENTER_USAGE_HTML,
|
|
12828
|
+
STN_CHART_COLORS,
|
|
12829
|
+
STN_CHART_STATUS_COLORS,
|
|
11297
12830
|
STN_DATE_PICKER_INTRO,
|
|
11298
12831
|
STN_DATE_PICKER_KO_NAME,
|
|
11299
12832
|
STN_DATE_PICKER_NAME,
|
|
@@ -11402,6 +12935,7 @@ export {
|
|
|
11402
12935
|
StnAlertCenterDocPreview,
|
|
11403
12936
|
StnAlertCenterPanel,
|
|
11404
12937
|
StnBadge,
|
|
12938
|
+
StnBarChart,
|
|
11405
12939
|
StnBreadcrumb,
|
|
11406
12940
|
StnButton,
|
|
11407
12941
|
StnCard,
|
|
@@ -11411,6 +12945,7 @@ export {
|
|
|
11411
12945
|
StnCheckbox,
|
|
11412
12946
|
StnChip,
|
|
11413
12947
|
StnCircularProgress,
|
|
12948
|
+
StnComboChart,
|
|
11414
12949
|
StnContainer,
|
|
11415
12950
|
StnContext,
|
|
11416
12951
|
StnDashboard,
|
|
@@ -11427,6 +12962,9 @@ export {
|
|
|
11427
12962
|
StnEventBanner,
|
|
11428
12963
|
StnFloatingToolbar,
|
|
11429
12964
|
StnFloatingToolbarPreset,
|
|
12965
|
+
StnGaugeChart,
|
|
12966
|
+
StnGradeRow,
|
|
12967
|
+
StnGradeRowList,
|
|
11430
12968
|
StnGrid,
|
|
11431
12969
|
StnHeader,
|
|
11432
12970
|
StnHeaderContextTitle,
|
|
@@ -11450,6 +12988,7 @@ export {
|
|
|
11450
12988
|
StnLayerDim,
|
|
11451
12989
|
StnLayerModal,
|
|
11452
12990
|
StnLayerShell,
|
|
12991
|
+
StnLineChart,
|
|
11453
12992
|
StnListViewLayout,
|
|
11454
12993
|
StnListViewLayoutBody,
|
|
11455
12994
|
StnListViewLayoutContent,
|
|
@@ -11484,6 +13023,7 @@ export {
|
|
|
11484
13023
|
StnPageScaffoldRegion,
|
|
11485
13024
|
StnPageScaffoldRoot,
|
|
11486
13025
|
StnPagination,
|
|
13026
|
+
StnPieChart,
|
|
11487
13027
|
StnPopup,
|
|
11488
13028
|
StnProgressBar,
|
|
11489
13029
|
StnProvider,
|
|
@@ -11512,10 +13052,14 @@ export {
|
|
|
11512
13052
|
StnSideNavigation,
|
|
11513
13053
|
StnSlider,
|
|
11514
13054
|
StnStack,
|
|
13055
|
+
StnStatCard,
|
|
13056
|
+
StnStatGroup,
|
|
11515
13057
|
StnStatus,
|
|
11516
13058
|
StnStatusDot,
|
|
11517
13059
|
StnStatusDotGroup,
|
|
11518
13060
|
StnStatusFlow,
|
|
13061
|
+
StnStatusItem,
|
|
13062
|
+
StnStatusList,
|
|
11519
13063
|
StnStatusSeverity,
|
|
11520
13064
|
StnStatusSwitch,
|
|
11521
13065
|
StnSwitch,
|
|
@@ -11581,6 +13125,7 @@ export {
|
|
|
11581
13125
|
cn,
|
|
11582
13126
|
collectExpandableIds,
|
|
11583
13127
|
flattenStnTree,
|
|
13128
|
+
formatChartValue,
|
|
11584
13129
|
formatStnDateRangeFieldValue3 as formatStnDateRangeFieldValue,
|
|
11585
13130
|
formatStnHeaderTitleDate,
|
|
11586
13131
|
formatStnHeaderTitleTime,
|
|
@@ -11589,6 +13134,8 @@ export {
|
|
|
11589
13134
|
getStnWidgetKind,
|
|
11590
13135
|
isStnWidgetKindSlug,
|
|
11591
13136
|
parseStnDateRangeFieldValue2 as parseStnDateRangeFieldValue,
|
|
13137
|
+
renderChartState,
|
|
13138
|
+
resolveChartColor,
|
|
11592
13139
|
resolveStnWidgetBackground2 as resolveStnWidgetBackground,
|
|
11593
13140
|
resolveSystemIconSrcFromName3 as resolveSystemIconSrcFromName,
|
|
11594
13141
|
stnWidgetSampleUrl,
|