@stn-uiux/pub-ui-react 0.1.67 → 0.1.69
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 +23 -3
- package/dist/index.js +68 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1493,12 +1493,22 @@ type StnCardProps = StnWithoutStyle<HTMLAttributes<HTMLDivElement>> & {
|
|
|
1493
1493
|
padding?: StnCardPadding;
|
|
1494
1494
|
/** 마우스 호버 및 클릭 인터랙션 활성화 여부 @default false */
|
|
1495
1495
|
interactive?: boolean;
|
|
1496
|
+
/** 너비 100% 채움 여부 @default false */
|
|
1497
|
+
fullWidth?: boolean;
|
|
1498
|
+
/** 높이 100% 채움 여부 @default false */
|
|
1499
|
+
fullHeight?: boolean;
|
|
1496
1500
|
className?: string;
|
|
1497
1501
|
};
|
|
1502
|
+
type StnCardTitleSize = 'sm' | 'md' | 'lg';
|
|
1503
|
+
type StnCardTitleWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
1498
1504
|
type StnCardHeaderProps = StnWithoutStyle<Omit<HTMLAttributes<HTMLDivElement>, 'title'>> & {
|
|
1499
1505
|
children?: ReactNode;
|
|
1500
1506
|
/** 간편 타이틀 전달용 */
|
|
1501
1507
|
title?: ReactNode;
|
|
1508
|
+
/** 타이틀 크기 ('sm': 14px, 'md': 16px 기본, 'lg': 18px) @default 'md' */
|
|
1509
|
+
titleSize?: StnCardTitleSize;
|
|
1510
|
+
/** 타이틀 굵기 ('regular': 400, 'medium': 500, 'semibold': 600 기본, 'bold': 700) @default 'semibold' */
|
|
1511
|
+
titleWeight?: StnCardTitleWeight;
|
|
1502
1512
|
/** 우측 액션 버튼 등 추가 요소 */
|
|
1503
1513
|
extra?: ReactNode;
|
|
1504
1514
|
className?: string;
|
|
@@ -1511,7 +1521,7 @@ type StnCardFooterProps = StnWithoutStyle<HTMLAttributes<HTMLDivElement>> & {
|
|
|
1511
1521
|
children?: ReactNode;
|
|
1512
1522
|
className?: string;
|
|
1513
1523
|
};
|
|
1514
|
-
declare function StnCardHeader({ children, title, extra, className, ...rest }: StnCardHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1524
|
+
declare function StnCardHeader({ children, title, titleSize, titleWeight, extra, className, ...rest }: StnCardHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1515
1525
|
declare function StnCardBody({ children, className, ...rest }: StnCardBodyProps): react_jsx_runtime.JSX.Element;
|
|
1516
1526
|
declare function StnCardFooter({ children, className, ...rest }: StnCardFooterProps): react_jsx_runtime.JSX.Element;
|
|
1517
1527
|
interface StnCardComponent extends React.ForwardRefExoticComponent<StnCardProps & React.RefAttributes<HTMLDivElement>> {
|
|
@@ -2760,6 +2770,8 @@ declare function StnTopologyNodePreview({ width, height, size, showLabel, showSt
|
|
|
2760
2770
|
type StnWidgetBackground = boolean | StnWidgetBackgroundMode;
|
|
2761
2771
|
type StnWidgetStatus = 'default' | 'critical' | 'major' | 'minor' | 'warning';
|
|
2762
2772
|
type StnWidgetPadding = 'default' | 'compact' | 'none';
|
|
2773
|
+
type StnWidgetTitleSize = 'sm' | 'md' | 'lg';
|
|
2774
|
+
type StnWidgetTitleWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
2763
2775
|
type StnWidgetProps = Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title'> & {
|
|
2764
2776
|
className?: string;
|
|
2765
2777
|
/** Pub 위젯 셸 — card | fault-panel | board | board-item | canvas (맵/토폴로지 마운트 셸) */
|
|
@@ -2783,6 +2795,10 @@ type StnWidgetProps = Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title'
|
|
|
2783
2795
|
/** 위젯 종류 id (sample PNG 파일명 · data-stn-widget-kind) */
|
|
2784
2796
|
kind?: string;
|
|
2785
2797
|
title?: ReactNode;
|
|
2798
|
+
/** 타이틀 크기 ('sm': 14px, 'md': 16px 기본, 'lg': 18px) @default 'md' */
|
|
2799
|
+
titleSize?: StnWidgetTitleSize;
|
|
2800
|
+
/** 타이틀 굵기 ('regular': 400, 'medium': 500, 'semibold': 600 기본, 'bold': 700) @default 'semibold' */
|
|
2801
|
+
titleWeight?: StnWidgetTitleWeight;
|
|
2786
2802
|
/** 타이틀 우측에 붙는 뱃지 슬롯 (예: <StnStatus.Severity />) */
|
|
2787
2803
|
badge?: ReactNode;
|
|
2788
2804
|
titleActions?: ReactNode;
|
|
@@ -2841,13 +2857,17 @@ declare function StnWidgetPeriodPager({ label, className, onPrev, onNext, prevLa
|
|
|
2841
2857
|
prevLabel?: string;
|
|
2842
2858
|
nextLabel?: string;
|
|
2843
2859
|
} & HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
2844
|
-
declare function StnWidgetRoot({ shell: shellProp, variant, appearance, background, status, isCritical, kind, title, badge, titleActions, showHeaderIcon, headerIconName, headerIcon, periodLabel, periodActions, children, className, contentClassName, padding, noPadding, loading, empty, emptyMessage, footer, banner, interactive, docHover, fullWidth, fullHeight, wrapActions, style, ...rest }: StnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
2860
|
+
declare function StnWidgetRoot({ shell: shellProp, variant, appearance, background, status, isCritical, kind, title, titleSize, titleWeight, badge, titleActions, showHeaderIcon, headerIconName, headerIcon, periodLabel, periodActions, children, className, contentClassName, padding, noPadding, loading, empty, emptyMessage, footer, banner, interactive, docHover, fullWidth, fullHeight, wrapActions, style, ...rest }: StnWidgetProps): react_jsx_runtime.JSX.Element;
|
|
2845
2861
|
type StnWidgetHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
2846
2862
|
/** 헤더 우측 컨트롤이 많을 때 아랫줄로 개행(2행 구조) 허용 여부 */
|
|
2847
2863
|
wrap?: boolean;
|
|
2848
2864
|
};
|
|
2849
2865
|
declare function StnWidgetHeader({ className, wrap, children, ...rest }: StnWidgetHeaderProps): react_jsx_runtime.JSX.Element;
|
|
2850
|
-
|
|
2866
|
+
type StnWidgetTitleProps = HTMLAttributes<HTMLHeadingElement> & {
|
|
2867
|
+
size?: StnWidgetTitleSize;
|
|
2868
|
+
weight?: StnWidgetTitleWeight;
|
|
2869
|
+
};
|
|
2870
|
+
declare function StnWidgetTitle({ className, children, title, size, weight, ...rest }: StnWidgetTitleProps): react_jsx_runtime.JSX.Element;
|
|
2851
2871
|
declare function StnWidgetActions({ className, children, ...rest }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
2852
2872
|
type StnWidgetBodyProps = HTMLAttributes<HTMLDivElement> & {
|
|
2853
2873
|
/** 본문 내부 여백 규격 — 기본 12px, compact 8px, none 0px */
|
package/dist/index.js
CHANGED
|
@@ -2806,9 +2806,17 @@ var StnTree = forwardRef14(function StnTree2({
|
|
|
2806
2806
|
// src/components/StnCard.tsx
|
|
2807
2807
|
import { forwardRef as forwardRef15 } from "react";
|
|
2808
2808
|
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2809
|
-
function StnCardHeader({
|
|
2809
|
+
function StnCardHeader({
|
|
2810
|
+
children,
|
|
2811
|
+
title,
|
|
2812
|
+
titleSize = "md",
|
|
2813
|
+
titleWeight = "semibold",
|
|
2814
|
+
extra,
|
|
2815
|
+
className,
|
|
2816
|
+
...rest
|
|
2817
|
+
}) {
|
|
2810
2818
|
return /* @__PURE__ */ jsxs14("div", { className: cn("stn-card__header", className), ...rest, children: [
|
|
2811
|
-
title ? /* @__PURE__ */ jsx20("div", { className: "stn-card__header-title", children: title }) : null,
|
|
2819
|
+
title ? /* @__PURE__ */ jsx20("div", { className: cn("stn-card__header-title", titleSize, titleWeight), children: title }) : null,
|
|
2812
2820
|
children,
|
|
2813
2821
|
extra ? /* @__PURE__ */ jsx20("div", { className: "stn-card__header-extra", children: extra }) : null
|
|
2814
2822
|
] });
|
|
@@ -2825,6 +2833,8 @@ var StnCard = forwardRef15(function StnCard2({
|
|
|
2825
2833
|
radius = "md",
|
|
2826
2834
|
padding = "md",
|
|
2827
2835
|
interactive = false,
|
|
2836
|
+
fullWidth = false,
|
|
2837
|
+
fullHeight = false,
|
|
2828
2838
|
className,
|
|
2829
2839
|
role,
|
|
2830
2840
|
tabIndex,
|
|
@@ -2843,6 +2853,8 @@ var StnCard = forwardRef15(function StnCard2({
|
|
|
2843
2853
|
`radius-${radius}`,
|
|
2844
2854
|
`pad-${padding}`,
|
|
2845
2855
|
isClickable && "interactive",
|
|
2856
|
+
fullWidth && "is-full-width",
|
|
2857
|
+
fullHeight && "is-full-height",
|
|
2846
2858
|
className
|
|
2847
2859
|
),
|
|
2848
2860
|
...rest,
|
|
@@ -3224,7 +3236,7 @@ function StnChip(props) {
|
|
|
3224
3236
|
const resolvedShape = rawShape === "rounded" || rawShape === "square" ? "square" : rawShape;
|
|
3225
3237
|
const isOutline = variant === "outline" || variant === "outlined" || variant === "border";
|
|
3226
3238
|
const isSubtle = bgOpacity === 50 || bgOpacity === "50" || bgOpacity === "50%" || bgOpacity === 0.5 || variant === "subtle" || variant === "soft" || variant === "tinted" || variant === "contained-50" || variant === "filled-50";
|
|
3227
|
-
const variantClass7 = isOutline ? "outline" : isSubtle ? "
|
|
3239
|
+
const variantClass7 = isOutline ? "outline" : isSubtle ? "soft" : "filled";
|
|
3228
3240
|
const resolvedColor = color ?? grade;
|
|
3229
3241
|
let content = children ?? label;
|
|
3230
3242
|
if (!content && grade && STN_GRADE_SOURCE[grade]) {
|
|
@@ -3245,8 +3257,8 @@ function StnChip(props) {
|
|
|
3245
3257
|
onClick?.(e);
|
|
3246
3258
|
}
|
|
3247
3259
|
};
|
|
3248
|
-
const iconElement = icon ? /* @__PURE__ */ jsx26("span", { className: "stn-chip__icon", children: icon }) : null;
|
|
3249
|
-
const contentElement = /* @__PURE__ */ jsx26("span", { className: "stn-chip__label", children: content });
|
|
3260
|
+
const iconElement = icon ? /* @__PURE__ */ jsx26("span", { className: "stn-chip__icon", children: icon }, "icon") : null;
|
|
3261
|
+
const contentElement = /* @__PURE__ */ jsx26("span", { className: "stn-chip__label", children: content }, "content");
|
|
3250
3262
|
const deleteElement = onDelete ? /* @__PURE__ */ jsx26(
|
|
3251
3263
|
"button",
|
|
3252
3264
|
{
|
|
@@ -3258,7 +3270,8 @@ function StnChip(props) {
|
|
|
3258
3270
|
onDelete(e);
|
|
3259
3271
|
},
|
|
3260
3272
|
children: deleteIcon ?? /* @__PURE__ */ jsx26(DefaultDeleteIcon, {})
|
|
3261
|
-
}
|
|
3273
|
+
},
|
|
3274
|
+
"delete"
|
|
3262
3275
|
) : null;
|
|
3263
3276
|
const elements = [];
|
|
3264
3277
|
if (deleteElement && deleteIconPosition === "left") {
|
|
@@ -3742,6 +3755,7 @@ function variantClass(variant = "outline") {
|
|
|
3742
3755
|
if (variant === "standard") return "standard";
|
|
3743
3756
|
if (variant === "filled") return "filled";
|
|
3744
3757
|
if (variant === "transparent") return "transparent";
|
|
3758
|
+
if (variant === "translucent") return "translucent";
|
|
3745
3759
|
return "outline";
|
|
3746
3760
|
}
|
|
3747
3761
|
function useControllable(controlled, defaultValue, onChange) {
|
|
@@ -5345,6 +5359,12 @@ function StnLayer0Background({
|
|
|
5345
5359
|
if (variant === "dashboard") {
|
|
5346
5360
|
src = src ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.dashboard;
|
|
5347
5361
|
srcDark = srcDark ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.dashboardDark;
|
|
5362
|
+
} else if (variant === "infomap") {
|
|
5363
|
+
src = src ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.infomap;
|
|
5364
|
+
srcDark = srcDark ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.infomapDark;
|
|
5365
|
+
} else if (variant === "infomap-none") {
|
|
5366
|
+
src = src ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.infomapNone;
|
|
5367
|
+
srcDark = srcDark ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.infomapNoneDark;
|
|
5348
5368
|
} else if (variant === "showroom-a") {
|
|
5349
5369
|
src = src ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.showroomA;
|
|
5350
5370
|
srcDark = srcDark ?? STN_LAYER0_BACKGROUND_DEMO_IMAGES.showroomADark;
|
|
@@ -5379,7 +5399,15 @@ function StnLayer0Background({
|
|
|
5379
5399
|
className: cn("stn-layer0-bg__img", paired && "light"),
|
|
5380
5400
|
src,
|
|
5381
5401
|
alt,
|
|
5382
|
-
decoding: "async"
|
|
5402
|
+
decoding: "async",
|
|
5403
|
+
onError: (e) => {
|
|
5404
|
+
if (src && src.startsWith("http") && src.includes("/images/layer0/")) {
|
|
5405
|
+
const fallback = src.substring(src.indexOf("/images/layer0/"));
|
|
5406
|
+
if (typeof window !== "undefined" && e.currentTarget.src !== window.location.origin + fallback) {
|
|
5407
|
+
e.currentTarget.src = fallback;
|
|
5408
|
+
}
|
|
5409
|
+
}
|
|
5410
|
+
}
|
|
5383
5411
|
}
|
|
5384
5412
|
) : null,
|
|
5385
5413
|
srcDark ? /* @__PURE__ */ jsx43(
|
|
@@ -5388,7 +5416,15 @@ function StnLayer0Background({
|
|
|
5388
5416
|
className: cn("stn-layer0-bg__img", paired ? "dark" : void 0),
|
|
5389
5417
|
src: srcDark,
|
|
5390
5418
|
alt,
|
|
5391
|
-
decoding: "async"
|
|
5419
|
+
decoding: "async",
|
|
5420
|
+
onError: (e) => {
|
|
5421
|
+
if (srcDark && srcDark.startsWith("http") && srcDark.includes("/images/layer0/")) {
|
|
5422
|
+
const fallback = srcDark.substring(srcDark.indexOf("/images/layer0/"));
|
|
5423
|
+
if (typeof window !== "undefined" && e.currentTarget.src !== window.location.origin + fallback) {
|
|
5424
|
+
e.currentTarget.src = fallback;
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
}
|
|
5392
5428
|
}
|
|
5393
5429
|
) : null,
|
|
5394
5430
|
overlay != null && overlay > 0 ? /* @__PURE__ */ jsx43("div", { className: "stn-layer0-bg__overlay", "aria-hidden": "true" }) : null,
|
|
@@ -6531,6 +6567,8 @@ function StnWidgetPeriodPager({
|
|
|
6531
6567
|
function StnWidgetHeaderInner({
|
|
6532
6568
|
appearance,
|
|
6533
6569
|
title,
|
|
6570
|
+
titleSize = "md",
|
|
6571
|
+
titleWeight = "semibold",
|
|
6534
6572
|
badge,
|
|
6535
6573
|
titleActions,
|
|
6536
6574
|
periodLabel,
|
|
@@ -6540,12 +6578,17 @@ function StnWidgetHeaderInner({
|
|
|
6540
6578
|
headerIcon,
|
|
6541
6579
|
wrapActions = false
|
|
6542
6580
|
}) {
|
|
6581
|
+
const hasStart = showHeaderIcon || title != null || badge != null;
|
|
6582
|
+
const hasEnd = titleActions != null || periodActions != null || periodLabel != null && periodLabel !== "";
|
|
6583
|
+
if (!hasStart && !hasEnd) {
|
|
6584
|
+
return null;
|
|
6585
|
+
}
|
|
6543
6586
|
const resolvedIconName = headerIconName ?? defaultHeaderIconName(appearance);
|
|
6544
6587
|
return /* @__PURE__ */ jsxs40("div", { className: cn("stn-widget__head", wrapActions && "stn-widget__head--wrap"), children: [
|
|
6545
6588
|
/* @__PURE__ */ jsxs40("div", { className: "stn-widget__head-start", children: [
|
|
6546
6589
|
showHeaderIcon ? headerIcon != null ? /* @__PURE__ */ jsx49(StnWidgetInsetIcon, { size: "sm", children: headerIcon }) : resolvedIconName ? /* @__PURE__ */ jsx49(StnWidgetInsetIcon, { size: "sm", icon: resolvedIconName }) : null : null,
|
|
6547
6590
|
title != null || badge != null ? typeof title === "string" || title == null ? /* @__PURE__ */ jsxs40("div", { className: "stn-widget__title-wrap", children: [
|
|
6548
|
-
typeof title === "string" ? /* @__PURE__ */ jsx49("p", { className: "stn-widget__title", title, children: title }) : null,
|
|
6591
|
+
typeof title === "string" ? /* @__PURE__ */ jsx49("p", { className: cn("stn-widget__title", titleSize, titleWeight), title, children: title }) : null,
|
|
6549
6592
|
badge
|
|
6550
6593
|
] }) : /* @__PURE__ */ jsxs40(Fragment5, { children: [
|
|
6551
6594
|
title,
|
|
@@ -6564,6 +6607,8 @@ function StnWidgetRoot({
|
|
|
6564
6607
|
isCritical = false,
|
|
6565
6608
|
kind,
|
|
6566
6609
|
title,
|
|
6610
|
+
titleSize = "md",
|
|
6611
|
+
titleWeight = "semibold",
|
|
6567
6612
|
badge,
|
|
6568
6613
|
titleActions,
|
|
6569
6614
|
showHeaderIcon,
|
|
@@ -6596,7 +6641,8 @@ function StnWidgetRoot({
|
|
|
6596
6641
|
const defaultBg = isCanvas ? false : true;
|
|
6597
6642
|
const bgMode = resolveStnWidgetBackground(background ?? defaultBg);
|
|
6598
6643
|
const pubShell = SHELL_PUB_CLASS[shell];
|
|
6599
|
-
const
|
|
6644
|
+
const hasHeaderContent = title != null || badge != null || titleActions != null || periodActions != null || periodLabel != null && periodLabel !== "";
|
|
6645
|
+
const resolvedShowIcon = showHeaderIcon ?? (isFigmaShell && !isCanvas && hasHeaderContent);
|
|
6600
6646
|
const resolvedCritical = isCritical || status === "critical";
|
|
6601
6647
|
const emptyText = typeof empty === "string" ? empty : emptyMessage;
|
|
6602
6648
|
const isEmptyState = Boolean(empty);
|
|
@@ -6640,6 +6686,8 @@ function StnWidgetRoot({
|
|
|
6640
6686
|
{
|
|
6641
6687
|
appearance,
|
|
6642
6688
|
title,
|
|
6689
|
+
titleSize,
|
|
6690
|
+
titleWeight,
|
|
6643
6691
|
badge,
|
|
6644
6692
|
titleActions,
|
|
6645
6693
|
periodLabel,
|
|
@@ -6651,7 +6699,7 @@ function StnWidgetRoot({
|
|
|
6651
6699
|
}
|
|
6652
6700
|
) : title != null || badge != null || titleActions ? /* @__PURE__ */ jsxs40("div", { className: cn("stn-widget__head", wrapActions && "stn-widget__head--wrap"), children: [
|
|
6653
6701
|
/* @__PURE__ */ jsxs40("div", { className: "stn-widget__head-start", children: [
|
|
6654
|
-
title != null ? typeof title === "string" ? /* @__PURE__ */ jsx49("p", { className: "stn-widget__title", title, children: title }) : title : null,
|
|
6702
|
+
title != null ? typeof title === "string" ? /* @__PURE__ */ jsx49("p", { className: cn("stn-widget__title", titleSize, titleWeight), title, children: title }) : title : null,
|
|
6655
6703
|
badge
|
|
6656
6704
|
] }),
|
|
6657
6705
|
titleActions ? /* @__PURE__ */ jsx49("div", { className: "stn-widget__head-end", children: titleActions }) : null
|
|
@@ -6685,9 +6733,16 @@ function StnWidgetHeader({ className, wrap = false, children, ...rest }) {
|
|
|
6685
6733
|
return /* @__PURE__ */ jsx49("div", { className: cn("stn-widget__head", wrap && "stn-widget__head--wrap", className), ...rest, children });
|
|
6686
6734
|
}
|
|
6687
6735
|
markWidgetSlot(StnWidgetHeader, "header");
|
|
6688
|
-
function StnWidgetTitle({
|
|
6736
|
+
function StnWidgetTitle({
|
|
6737
|
+
className,
|
|
6738
|
+
children,
|
|
6739
|
+
title,
|
|
6740
|
+
size = "md",
|
|
6741
|
+
weight = "semibold",
|
|
6742
|
+
...rest
|
|
6743
|
+
}) {
|
|
6689
6744
|
const titleAttr = title ?? (typeof children === "string" ? children : void 0);
|
|
6690
|
-
return /* @__PURE__ */ jsx49("p", { className: cn("stn-widget__title", className), title: titleAttr, ...rest, children });
|
|
6745
|
+
return /* @__PURE__ */ jsx49("p", { className: cn("stn-widget__title", size, weight, className), title: titleAttr, ...rest, children });
|
|
6691
6746
|
}
|
|
6692
6747
|
function StnWidgetActions({ className, children, ...rest }) {
|
|
6693
6748
|
return /* @__PURE__ */ jsx49("div", { className: cn("stn-widget__head-end", className), ...rest, children });
|