@kjun-ui/react 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.cjs +337 -337
- package/dist/index.js +337 -337
- package/dist/styles.css +2057 -2133
- package/dist/types/packages/react/src/actions.d.cts +13 -13
- package/dist/types/packages/react/src/actions.d.ts +13 -13
- package/dist/types/packages/react/src/app-navigation.d.cts +6 -6
- package/dist/types/packages/react/src/app-navigation.d.ts +6 -6
- package/dist/types/packages/react/src/button.d.cts +4 -4
- package/dist/types/packages/react/src/button.d.ts +4 -4
- package/dist/types/packages/react/src/card.d.cts +2 -2
- package/dist/types/packages/react/src/card.d.ts +2 -2
- package/dist/types/packages/react/src/chip.d.cts +2 -2
- package/dist/types/packages/react/src/chip.d.ts +2 -2
- package/dist/types/packages/react/src/combobox.d.cts +2 -2
- package/dist/types/packages/react/src/combobox.d.ts +2 -2
- package/dist/types/packages/react/src/controls.d.cts +14 -14
- package/dist/types/packages/react/src/controls.d.ts +14 -14
- package/dist/types/packages/react/src/data-state.d.cts +6 -6
- package/dist/types/packages/react/src/data-state.d.ts +6 -6
- package/dist/types/packages/react/src/date-picker.d.cts +2 -2
- package/dist/types/packages/react/src/date-picker.d.ts +2 -2
- package/dist/types/packages/react/src/display.d.cts +15 -15
- package/dist/types/packages/react/src/display.d.ts +15 -15
- package/dist/types/packages/react/src/drawer.d.cts +2 -2
- package/dist/types/packages/react/src/drawer.d.ts +2 -2
- package/dist/types/packages/react/src/dropdown.d.cts +12 -12
- package/dist/types/packages/react/src/dropdown.d.ts +12 -12
- package/dist/types/packages/react/src/financial-display.d.cts +12 -12
- package/dist/types/packages/react/src/financial-display.d.ts +12 -12
- package/dist/types/packages/react/src/financial.d.cts +4 -4
- package/dist/types/packages/react/src/financial.d.ts +4 -4
- package/dist/types/packages/react/src/index.d.cts +22 -22
- package/dist/types/packages/react/src/index.d.ts +22 -22
- package/dist/types/packages/react/src/input.d.cts +4 -4
- package/dist/types/packages/react/src/input.d.ts +4 -4
- package/dist/types/packages/react/src/kpi.d.cts +4 -4
- package/dist/types/packages/react/src/kpi.d.ts +4 -4
- package/dist/types/packages/react/src/layers.d.cts +3 -3
- package/dist/types/packages/react/src/layers.d.ts +3 -3
- package/dist/types/packages/react/src/list.d.cts +4 -4
- package/dist/types/packages/react/src/list.d.ts +4 -4
- package/dist/types/packages/react/src/market-cards.d.cts +2 -2
- package/dist/types/packages/react/src/market-cards.d.ts +2 -2
- package/dist/types/packages/react/src/market-list.d.cts +2 -2
- package/dist/types/packages/react/src/market-list.d.ts +2 -2
- package/dist/types/packages/react/src/market-model.d.cts +4 -4
- package/dist/types/packages/react/src/market-model.d.ts +4 -4
- package/dist/types/packages/react/src/market-panel.d.cts +1 -1
- package/dist/types/packages/react/src/market-panel.d.ts +1 -1
- package/dist/types/packages/react/src/market-skeleton.d.cts +2 -2
- package/dist/types/packages/react/src/market-skeleton.d.ts +2 -2
- package/dist/types/packages/react/src/market-table.d.cts +2 -2
- package/dist/types/packages/react/src/market-table.d.ts +2 -2
- package/dist/types/packages/react/src/market.d.cts +5 -5
- package/dist/types/packages/react/src/market.d.ts +5 -5
- package/dist/types/packages/react/src/media.d.cts +4 -4
- package/dist/types/packages/react/src/media.d.ts +4 -4
- package/dist/types/packages/react/src/modal.d.cts +4 -4
- package/dist/types/packages/react/src/modal.d.ts +4 -4
- package/dist/types/packages/react/src/navigation.d.cts +12 -12
- package/dist/types/packages/react/src/navigation.d.ts +12 -12
- package/dist/types/packages/react/src/number-display.d.cts +8 -8
- package/dist/types/packages/react/src/number-display.d.ts +8 -8
- package/dist/types/packages/react/src/popover.d.cts +4 -4
- package/dist/types/packages/react/src/popover.d.ts +4 -4
- package/dist/types/packages/react/src/quantity-stepper.d.cts +2 -2
- package/dist/types/packages/react/src/quantity-stepper.d.ts +2 -2
- package/dist/types/packages/react/src/range-input.d.cts +4 -4
- package/dist/types/packages/react/src/range-input.d.ts +4 -4
- package/dist/types/packages/react/src/search-input.d.cts +2 -2
- package/dist/types/packages/react/src/search-input.d.ts +2 -2
- package/dist/types/packages/react/src/select-control.d.cts +2 -2
- package/dist/types/packages/react/src/select-control.d.ts +2 -2
- package/dist/types/packages/react/src/select.d.cts +8 -8
- package/dist/types/packages/react/src/select.d.ts +8 -8
- package/dist/types/packages/react/src/skeletons.d.cts +8 -8
- package/dist/types/packages/react/src/skeletons.d.ts +8 -8
- package/dist/types/packages/react/src/table-check.d.cts +1 -1
- package/dist/types/packages/react/src/table-check.d.ts +1 -1
- package/dist/types/packages/react/src/table-model.d.cts +2 -2
- package/dist/types/packages/react/src/table-model.d.ts +2 -2
- package/dist/types/packages/react/src/table-view.d.cts +2 -2
- package/dist/types/packages/react/src/table-view.d.ts +2 -2
- package/dist/types/packages/react/src/table.d.cts +2 -2
- package/dist/types/packages/react/src/table.d.ts +2 -2
- package/dist/types/packages/react/src/time-picker.d.cts +2 -2
- package/dist/types/packages/react/src/time-picker.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -30,85 +30,85 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// packages/react/src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
DsFilterGroup: () => DsFilterGroup,
|
|
63
|
-
DsFormActions: () => DsFormActions,
|
|
64
|
-
DsFormGroup: () => DsFormGroup,
|
|
65
|
-
DsFormSkeleton: () => DsFormSkeleton,
|
|
66
|
-
DsFreshness: () => DsFreshness,
|
|
67
|
-
DsHeatmapCell: () => DsHeatmapCell,
|
|
68
|
-
DsIcon: () => DsIcon,
|
|
69
|
-
DsIconToggle: () => DsIconToggle,
|
|
70
|
-
DsImage: () => DsImage,
|
|
71
|
-
DsInput: () => DsInput,
|
|
72
|
-
DsKpiHero: () => DsKpiHero,
|
|
73
|
-
DsKpiRow: () => DsKpiRow,
|
|
74
|
-
DsListRow: () => DsListRow,
|
|
75
|
-
DsListSection: () => DsListSection,
|
|
76
|
-
DsListSkeleton: () => DsListSkeleton,
|
|
77
|
-
DsMarketCards: () => DsMarketCards,
|
|
78
|
-
DsMarketListPanel: () => DsMarketListPanel,
|
|
79
|
-
DsMarketSimpleList: () => DsMarketSimpleList,
|
|
80
|
-
DsMarketTable: () => DsMarketTable,
|
|
81
|
-
DsMarketTableSkeleton: () => DsMarketTableSkeleton,
|
|
82
|
-
DsMenuButton: () => DsMenuButton,
|
|
83
|
-
DsModal: () => DsModal,
|
|
84
|
-
DsPagination: () => DsPagination,
|
|
85
|
-
DsPopover: () => DsPopover,
|
|
86
|
-
DsPriceCell: () => DsPriceCell,
|
|
87
|
-
DsProgress: () => DsProgress,
|
|
88
|
-
DsProgressCell: () => DsProgressCell,
|
|
89
|
-
DsQuantityStepper: () => DsQuantityStepper,
|
|
90
|
-
DsRadio: () => DsRadio,
|
|
91
|
-
DsRadioGroup: () => DsRadioGroup,
|
|
92
|
-
DsRangeSlider: () => DsRangeSlider,
|
|
93
|
-
DsRefreshButton: () => DsRefreshButton,
|
|
94
|
-
DsScrollFade: () => DsScrollFade,
|
|
95
|
-
DsSearchInput: () => DsSearchInput,
|
|
96
|
-
DsSelect: () => DsSelect,
|
|
97
|
-
DsSignedValue: () => DsSignedValue,
|
|
98
|
-
DsSkeleton: () => DsSkeleton,
|
|
99
|
-
DsSlider: () => DsSlider,
|
|
100
|
-
DsSparkline: () => DsSparkline,
|
|
101
|
-
DsSpinner: () => DsSpinner,
|
|
102
|
-
DsSwitch: () => DsSwitch,
|
|
103
|
-
DsTabPane: () => DsTabPane,
|
|
104
|
-
DsTable: () => DsTable,
|
|
105
|
-
DsTabs: () => DsTabs,
|
|
106
|
-
DsTextarea: () => DsTextarea,
|
|
107
|
-
DsTimePicker: () => DsTimePicker,
|
|
108
|
-
DsTooltip: () => DsTooltip,
|
|
109
|
-
DsTopNavigation: () => DsTopNavigation,
|
|
33
|
+
KjunAccordion: () => KjunAccordion,
|
|
34
|
+
KjunAccordionItem: () => KjunAccordionItem,
|
|
35
|
+
KjunAlert: () => KjunAlert,
|
|
36
|
+
KjunAnimatedNumber: () => KjunAnimatedNumber,
|
|
37
|
+
KjunAvatar: () => KjunAvatar,
|
|
38
|
+
KjunBadge: () => KjunBadge,
|
|
39
|
+
KjunBottomActionBar: () => KjunBottomActionBar,
|
|
40
|
+
KjunBottomNavigation: () => KjunBottomNavigation,
|
|
41
|
+
KjunBreadcrumb: () => KjunBreadcrumb,
|
|
42
|
+
KjunButton: () => KjunButton,
|
|
43
|
+
KjunButtonGroup: () => KjunButtonGroup,
|
|
44
|
+
KjunCard: () => KjunCard,
|
|
45
|
+
KjunChartSkeleton: () => KjunChartSkeleton,
|
|
46
|
+
KjunCheckbox: () => KjunCheckbox,
|
|
47
|
+
KjunChip: () => KjunChip,
|
|
48
|
+
KjunCollectionMark: () => KjunCollectionMark,
|
|
49
|
+
KjunCombobox: () => KjunCombobox,
|
|
50
|
+
KjunCopyButton: () => KjunCopyButton,
|
|
51
|
+
KjunDataState: () => KjunDataState,
|
|
52
|
+
KjunDatePicker: () => KjunDatePicker,
|
|
53
|
+
KjunDeviation: () => KjunDeviation,
|
|
54
|
+
KjunDrawer: () => KjunDrawer,
|
|
55
|
+
KjunDropdown: () => KjunDropdown,
|
|
56
|
+
KjunDropdownDivider: () => KjunDropdownDivider,
|
|
57
|
+
KjunDropdownItem: () => KjunDropdownItem,
|
|
58
|
+
KjunEmpty: () => KjunEmpty,
|
|
59
|
+
KjunErrorBoundary: () => KjunErrorBoundary,
|
|
60
|
+
KjunExecutionStatusBadge: () => KjunExecutionStatusBadge,
|
|
61
|
+
KjunExternalLink: () => KjunExternalLink,
|
|
110
62
|
KjunFeedbackProvider: () => KjunFeedbackProvider,
|
|
63
|
+
KjunFilterGroup: () => KjunFilterGroup,
|
|
64
|
+
KjunFormActions: () => KjunFormActions,
|
|
65
|
+
KjunFormGroup: () => KjunFormGroup,
|
|
66
|
+
KjunFormSkeleton: () => KjunFormSkeleton,
|
|
67
|
+
KjunFreshness: () => KjunFreshness,
|
|
68
|
+
KjunHeatmapCell: () => KjunHeatmapCell,
|
|
69
|
+
KjunIcon: () => KjunIcon,
|
|
70
|
+
KjunIconToggle: () => KjunIconToggle,
|
|
71
|
+
KjunImage: () => KjunImage,
|
|
72
|
+
KjunInput: () => KjunInput,
|
|
73
|
+
KjunKpiHero: () => KjunKpiHero,
|
|
74
|
+
KjunKpiRow: () => KjunKpiRow,
|
|
75
|
+
KjunListRow: () => KjunListRow,
|
|
76
|
+
KjunListSection: () => KjunListSection,
|
|
77
|
+
KjunListSkeleton: () => KjunListSkeleton,
|
|
78
|
+
KjunMarketCards: () => KjunMarketCards,
|
|
79
|
+
KjunMarketListPanel: () => KjunMarketListPanel,
|
|
80
|
+
KjunMarketSimpleList: () => KjunMarketSimpleList,
|
|
81
|
+
KjunMarketTable: () => KjunMarketTable,
|
|
82
|
+
KjunMarketTableSkeleton: () => KjunMarketTableSkeleton,
|
|
83
|
+
KjunMenuButton: () => KjunMenuButton,
|
|
84
|
+
KjunModal: () => KjunModal,
|
|
85
|
+
KjunPagination: () => KjunPagination,
|
|
86
|
+
KjunPopover: () => KjunPopover,
|
|
87
|
+
KjunPriceCell: () => KjunPriceCell,
|
|
88
|
+
KjunProgress: () => KjunProgress,
|
|
89
|
+
KjunProgressCell: () => KjunProgressCell,
|
|
111
90
|
KjunProvider: () => KjunProvider,
|
|
91
|
+
KjunQuantityStepper: () => KjunQuantityStepper,
|
|
92
|
+
KjunRadio: () => KjunRadio,
|
|
93
|
+
KjunRadioGroup: () => KjunRadioGroup,
|
|
94
|
+
KjunRangeSlider: () => KjunRangeSlider,
|
|
95
|
+
KjunRefreshButton: () => KjunRefreshButton,
|
|
96
|
+
KjunScrollFade: () => KjunScrollFade,
|
|
97
|
+
KjunSearchInput: () => KjunSearchInput,
|
|
98
|
+
KjunSelect: () => KjunSelect,
|
|
99
|
+
KjunSignedValue: () => KjunSignedValue,
|
|
100
|
+
KjunSkeleton: () => KjunSkeleton,
|
|
101
|
+
KjunSlider: () => KjunSlider,
|
|
102
|
+
KjunSparkline: () => KjunSparkline,
|
|
103
|
+
KjunSpinner: () => KjunSpinner,
|
|
104
|
+
KjunSwitch: () => KjunSwitch,
|
|
105
|
+
KjunTabPane: () => KjunTabPane,
|
|
106
|
+
KjunTable: () => KjunTable,
|
|
107
|
+
KjunTabs: () => KjunTabs,
|
|
108
|
+
KjunTextarea: () => KjunTextarea,
|
|
109
|
+
KjunTimePicker: () => KjunTimePicker,
|
|
110
|
+
KjunTooltip: () => KjunTooltip,
|
|
111
|
+
KjunTopNavigation: () => KjunTopNavigation,
|
|
112
112
|
groupKeydown: () => groupKeydown,
|
|
113
113
|
useKjunFeedback: () => useKjunFeedback
|
|
114
114
|
});
|
|
@@ -607,7 +607,7 @@ function useActionSize(requested, fallback2) {
|
|
|
607
607
|
var import_tokens5 = require("@kjun-ui/tokens");
|
|
608
608
|
var import_react6 = require("react");
|
|
609
609
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
610
|
-
function
|
|
610
|
+
function KjunIcon({
|
|
611
611
|
name,
|
|
612
612
|
size = "1em",
|
|
613
613
|
spin = false,
|
|
@@ -653,8 +653,8 @@ function useMinimumLoading(loading) {
|
|
|
653
653
|
}, [loading]);
|
|
654
654
|
return loading || active;
|
|
655
655
|
}
|
|
656
|
-
var
|
|
657
|
-
function
|
|
656
|
+
var KjunButton = (0, import_react6.forwardRef)(
|
|
657
|
+
function KjunButton2(props, ref) {
|
|
658
658
|
var _a, _b;
|
|
659
659
|
const {
|
|
660
660
|
variant = "primary",
|
|
@@ -727,7 +727,7 @@ var DsButton = (0, import_react6.forwardRef)(
|
|
|
727
727
|
},
|
|
728
728
|
children: [
|
|
729
729
|
before && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
730
|
-
|
|
730
|
+
KjunIcon,
|
|
731
731
|
{
|
|
732
732
|
name: before,
|
|
733
733
|
filled: !busy && prefixIconFilled,
|
|
@@ -737,7 +737,7 @@ var DsButton = (0, import_react6.forwardRef)(
|
|
|
737
737
|
),
|
|
738
738
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kjun-button-label", style: { opacity: overlayLoading ? 0 : 1 }, children }),
|
|
739
739
|
suffixIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
740
|
-
|
|
740
|
+
KjunIcon,
|
|
741
741
|
{
|
|
742
742
|
name: busy && !prefixIcon ? "loader-2" : suffixIcon,
|
|
743
743
|
filled: !busy && suffixIconFilled,
|
|
@@ -746,7 +746,7 @@ var DsButton = (0, import_react6.forwardRef)(
|
|
|
746
746
|
size: iconSize
|
|
747
747
|
}
|
|
748
748
|
),
|
|
749
|
-
overlayLoading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kjun-button-loader", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
749
|
+
overlayLoading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "kjun-button-loader", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(KjunIcon, { name: "loader-2", spin: true, size: iconSize }) })
|
|
750
750
|
]
|
|
751
751
|
}
|
|
752
752
|
);
|
|
@@ -777,7 +777,7 @@ function useCompositionGuard() {
|
|
|
777
777
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
778
778
|
var FieldContext = (0, import_react8.createContext)(null);
|
|
779
779
|
var useKjunField = () => (0, import_react8.useContext)(FieldContext);
|
|
780
|
-
function
|
|
780
|
+
function KjunFormGroup({
|
|
781
781
|
label,
|
|
782
782
|
id,
|
|
783
783
|
required = false,
|
|
@@ -800,15 +800,15 @@ function DsFormGroup({
|
|
|
800
800
|
] }),
|
|
801
801
|
children,
|
|
802
802
|
error ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { id: describedBy, className: "kjun-form-error", role: "alert", children: [
|
|
803
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KjunIcon, { name: "alert-circle", size: import_tokens7.tokens.extensions.form.messageIconSize }),
|
|
804
804
|
error
|
|
805
805
|
] }) : hint ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { id: describedBy, className: "kjun-form-hint", children: hint }) : null
|
|
806
806
|
] })
|
|
807
807
|
}
|
|
808
808
|
);
|
|
809
809
|
}
|
|
810
|
-
var
|
|
811
|
-
function
|
|
810
|
+
var KjunInput = (0, import_react8.forwardRef)(
|
|
811
|
+
function KjunInput2({
|
|
812
812
|
size = "md",
|
|
813
813
|
value,
|
|
814
814
|
error = false,
|
|
@@ -835,7 +835,7 @@ var DsInput = (0, import_react8.forwardRef)(
|
|
|
835
835
|
...props
|
|
836
836
|
}, ref) {
|
|
837
837
|
const field = (0, import_react8.useContext)(FieldContext);
|
|
838
|
-
const uid = (0, import_react8.useId)().replace(/:/g, "");
|
|
838
|
+
const uid = "kjun-" + (0, import_react8.useId)().replace(/:/g, "");
|
|
839
839
|
const input = (0, import_react8.useRef)(null);
|
|
840
840
|
const composition = useCompositionGuard();
|
|
841
841
|
const before = (0, import_react8.useRef)(null);
|
|
@@ -873,7 +873,7 @@ var DsInput = (0, import_react8.forwardRef)(
|
|
|
873
873
|
ref: before,
|
|
874
874
|
className: "kjun-input-affix",
|
|
875
875
|
style: { left: spec.padding, pointerEvents: "none" },
|
|
876
|
-
children: prefix || /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
876
|
+
children: prefix || /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KjunIcon, { name: prefixIcon, size: spec.iconSize })
|
|
877
877
|
}
|
|
878
878
|
),
|
|
879
879
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -898,7 +898,7 @@ var DsInput = (0, import_react8.forwardRef)(
|
|
|
898
898
|
borderRadius: spec.radius,
|
|
899
899
|
paddingLeft: widths.before ? spec.padding + widths.before + spec.affixGap - import_tokens7.tokens.border.controlWidth : spec.padding - import_tokens7.tokens.border.controlWidth,
|
|
900
900
|
paddingRight: widths.after ? spec.padding + widths.after + spec.affixGap - import_tokens7.tokens.border.controlWidth : spec.padding - import_tokens7.tokens.border.controlWidth,
|
|
901
|
-
"--placeholder-size": spec.placeholderSize / 16 + "rem",
|
|
901
|
+
"--_kjun-placeholder-size": spec.placeholderSize / 16 + "rem",
|
|
902
902
|
...style
|
|
903
903
|
},
|
|
904
904
|
onChange: (e) => {
|
|
@@ -928,7 +928,7 @@ var DsInput = (0, import_react8.forwardRef)(
|
|
|
928
928
|
style: { right: spec.padding },
|
|
929
929
|
children: [
|
|
930
930
|
clearable && !!value && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
931
|
-
|
|
931
|
+
KjunButton,
|
|
932
932
|
{
|
|
933
933
|
variant: "ghost",
|
|
934
934
|
size: "sm",
|
|
@@ -954,10 +954,10 @@ var DsInput = (0, import_react8.forwardRef)(
|
|
|
954
954
|
onClear == null ? void 0 : onClear();
|
|
955
955
|
el.focus();
|
|
956
956
|
},
|
|
957
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
957
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KjunIcon, { name: "x", size: spec.iconSize })
|
|
958
958
|
}
|
|
959
959
|
),
|
|
960
|
-
suffix || suffixIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
960
|
+
suffix || suffixIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KjunIcon, { name: suffixIcon, size: spec.iconSize })
|
|
961
961
|
]
|
|
962
962
|
}
|
|
963
963
|
)
|
|
@@ -1077,14 +1077,14 @@ function FeedbackLayerOutlet() {
|
|
|
1077
1077
|
const layers = useLayerState(), scope = (0, import_react11.useContext)(LayerScope);
|
|
1078
1078
|
const entry = scope ? layers.entries.get(scope) : void 0;
|
|
1079
1079
|
const active = !!entry && layers.isActive(entry.id), order = (_a = entry == null ? void 0 : entry.order) != null ? _a : 0;
|
|
1080
|
-
const host = (0, import_react11.useContext)(FeedbackOverlayContext), id = (0, import_react11.useId)(), register = host == null ? void 0 : host.register;
|
|
1080
|
+
const host = (0, import_react11.useContext)(FeedbackOverlayContext), id = "kjun-" + (0, import_react11.useId)(), register = host == null ? void 0 : host.register;
|
|
1081
1081
|
(0, import_react11.useLayoutEffect)(() => active ? register == null ? void 0 : register(id, order) : void 0, [register, id, active, order]);
|
|
1082
1082
|
return (host == null ? void 0 : host.top) === id ? host.render() : null;
|
|
1083
1083
|
}
|
|
1084
1084
|
|
|
1085
1085
|
// packages/react/src/modal.tsx
|
|
1086
1086
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1087
|
-
function
|
|
1087
|
+
function KjunFormActions({
|
|
1088
1088
|
size = "lg",
|
|
1089
1089
|
cancelText = "\uCDE8\uC18C",
|
|
1090
1090
|
confirmText = "\uC800\uC7A5",
|
|
@@ -1102,7 +1102,7 @@ function DsFormActions({
|
|
|
1102
1102
|
(0, import_react12.useLayoutEffect)(() => observeFormActions(ref.current), []);
|
|
1103
1103
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "kjun-form-actions", ref, children: [
|
|
1104
1104
|
showCancel && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1105
|
-
|
|
1105
|
+
KjunButton,
|
|
1106
1106
|
{
|
|
1107
1107
|
size,
|
|
1108
1108
|
variant: cancelVariant,
|
|
@@ -1112,7 +1112,7 @@ function DsFormActions({
|
|
|
1112
1112
|
}
|
|
1113
1113
|
),
|
|
1114
1114
|
showConfirm && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1115
|
-
|
|
1115
|
+
KjunButton,
|
|
1116
1116
|
{
|
|
1117
1117
|
size,
|
|
1118
1118
|
variant,
|
|
@@ -1124,7 +1124,7 @@ function DsFormActions({
|
|
|
1124
1124
|
)
|
|
1125
1125
|
] });
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function KjunModal({
|
|
1128
1128
|
open,
|
|
1129
1129
|
onOpenChange,
|
|
1130
1130
|
onClose,
|
|
@@ -1154,7 +1154,7 @@ function DsModal({
|
|
|
1154
1154
|
}) {
|
|
1155
1155
|
const motion = usePresence(open, useReducedMotion());
|
|
1156
1156
|
const portalContainer = useKjunPortalContainer();
|
|
1157
|
-
const id = (0, import_react12.useId)();
|
|
1157
|
+
const id = "kjun-" + (0, import_react12.useId)();
|
|
1158
1158
|
const explicitLabel = ariaLabel == null ? void 0 : ariaLabel.trim();
|
|
1159
1159
|
const heading = header || title;
|
|
1160
1160
|
const labelledByHeading = showHeader && !explicitLabel && (typeof heading === "string" ? !!heading.trim() : !!heading);
|
|
@@ -1215,7 +1215,7 @@ function DsModal({
|
|
|
1215
1215
|
className: "kjun-modal-close",
|
|
1216
1216
|
"aria-label": "\uB2EB\uAE30",
|
|
1217
1217
|
onClick: close,
|
|
1218
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1218
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(KjunIcon, { name: "x", size: import_tokens9.tokens.modal.closeIconSize })
|
|
1219
1219
|
}
|
|
1220
1220
|
)
|
|
1221
1221
|
] }),
|
|
@@ -1228,7 +1228,7 @@ function DsModal({
|
|
|
1228
1228
|
}
|
|
1229
1229
|
),
|
|
1230
1230
|
(showFooter || footer) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "kjun-modal-footer", children: footer || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1231
|
-
|
|
1231
|
+
KjunFormActions,
|
|
1232
1232
|
{
|
|
1233
1233
|
size: footerSize,
|
|
1234
1234
|
cancelVariant: "secondary",
|
|
@@ -1273,7 +1273,7 @@ var import_react14 = require("react");
|
|
|
1273
1273
|
|
|
1274
1274
|
// packages/react/src/card.tsx
|
|
1275
1275
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1276
|
-
function
|
|
1276
|
+
function KjunCard({
|
|
1277
1277
|
title,
|
|
1278
1278
|
subtitle,
|
|
1279
1279
|
header,
|
|
@@ -1331,7 +1331,7 @@ function DsCard({
|
|
|
1331
1331
|
// packages/react/src/display.tsx
|
|
1332
1332
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1333
1333
|
var role = (name) => `var(--_kjun-color-${name})`;
|
|
1334
|
-
function
|
|
1334
|
+
function KjunBadge({
|
|
1335
1335
|
variant = "default",
|
|
1336
1336
|
size = "sm",
|
|
1337
1337
|
dot = false,
|
|
@@ -1365,20 +1365,20 @@ function DsBadge({
|
|
|
1365
1365
|
}
|
|
1366
1366
|
);
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1368
|
+
function KjunEmpty({
|
|
1369
1369
|
text = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
1370
1370
|
description,
|
|
1371
1371
|
icon,
|
|
1372
1372
|
children
|
|
1373
1373
|
}) {
|
|
1374
1374
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "kjun-empty", children: [
|
|
1375
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1375
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(KjunIcon, { name: icon, size: import_tokens10.tokens.extensions.empty.iconSize }),
|
|
1376
1376
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: text }),
|
|
1377
1377
|
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: description }),
|
|
1378
1378
|
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children })
|
|
1379
1379
|
] });
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function KjunSpinner({ size = "md", text }) {
|
|
1382
1382
|
const stroke = import_tokens10.tokens.extensions.spinner.strokeWidths[size] * 24 / import_tokens10.tokens.extensions.spinner.sizes[size];
|
|
1383
1383
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { role: "status", "aria-label": text || "\uB85C\uB529 \uC911", className: "kjun-spinner", children: [
|
|
1384
1384
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
@@ -1416,7 +1416,7 @@ function DsSpinner({ size = "md", text }) {
|
|
|
1416
1416
|
text && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: text })
|
|
1417
1417
|
] });
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function KjunAlert({
|
|
1420
1420
|
type = "info",
|
|
1421
1421
|
variant,
|
|
1422
1422
|
size = "md",
|
|
@@ -1441,7 +1441,7 @@ function DsAlert({
|
|
|
1441
1441
|
},
|
|
1442
1442
|
children: [
|
|
1443
1443
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "kjun-alert-icon", style: { color: role(tone === "primary" ? "brand" : tone + "-accent") }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1444
|
-
|
|
1444
|
+
KjunIcon,
|
|
1445
1445
|
{
|
|
1446
1446
|
name: {
|
|
1447
1447
|
info: "info-circle",
|
|
@@ -1468,14 +1468,14 @@ function DsAlert({
|
|
|
1468
1468
|
setVisible(false);
|
|
1469
1469
|
onClose == null ? void 0 : onClose();
|
|
1470
1470
|
},
|
|
1471
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1471
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(KjunIcon, { name: "x", size: import_tokens10.tokens.extensions.alert.closeIconSize })
|
|
1472
1472
|
}
|
|
1473
1473
|
)
|
|
1474
1474
|
]
|
|
1475
1475
|
}
|
|
1476
1476
|
);
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function KjunProgress({
|
|
1479
1479
|
value = 0,
|
|
1480
1480
|
max = 100,
|
|
1481
1481
|
size = "md",
|
|
@@ -1517,7 +1517,7 @@ function DsProgress({
|
|
|
1517
1517
|
subLabel && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "kjun-progress-sub", children: subLabel })
|
|
1518
1518
|
] });
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function KjunSkeleton({
|
|
1521
1521
|
type = "text",
|
|
1522
1522
|
rows = 3,
|
|
1523
1523
|
columns = 4,
|
|
@@ -1831,7 +1831,7 @@ function ToastView({
|
|
|
1831
1831
|
{
|
|
1832
1832
|
className: "kjun-toast-icon",
|
|
1833
1833
|
style: { color: `var(--_kjun-color-${tone}-accent)` },
|
|
1834
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(KjunIcon, { name: icon })
|
|
1835
1835
|
}
|
|
1836
1836
|
),
|
|
1837
1837
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "kjun-toast-content", children: [
|
|
@@ -1861,7 +1861,7 @@ function ToastView({
|
|
|
1861
1861
|
className: "kjun-toast-close",
|
|
1862
1862
|
"aria-label": "\uC54C\uB9BC \uB2EB\uAE30",
|
|
1863
1863
|
onClick: () => dismiss(),
|
|
1864
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(KjunIcon, { name: "x" })
|
|
1865
1865
|
}
|
|
1866
1866
|
),
|
|
1867
1867
|
toast.showProgress !== false && !!toast.duration && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1870,7 +1870,7 @@ function ToastView({
|
|
|
1870
1870
|
"aria-hidden": "true",
|
|
1871
1871
|
className: "kjun-toast-progress",
|
|
1872
1872
|
style: {
|
|
1873
|
-
"--toast-start": `${toast.remaining / toast.duration * 100}%`,
|
|
1873
|
+
"--_kjun-toast-start": `${toast.remaining / toast.duration * 100}%`,
|
|
1874
1874
|
animationDuration: `${toast.remaining}ms`,
|
|
1875
1875
|
animationPlayState: toast.paused ? "paused" : "running",
|
|
1876
1876
|
background: `var(--_kjun-color-${tone})`
|
|
@@ -1957,7 +1957,7 @@ function FeedbackDialog({
|
|
|
1957
1957
|
}) {
|
|
1958
1958
|
const { options, value, error, busy, edit, cancel, submit } = useFeedbackDialog(controller, request);
|
|
1959
1959
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1960
|
-
|
|
1960
|
+
KjunModal,
|
|
1961
1961
|
{
|
|
1962
1962
|
open,
|
|
1963
1963
|
onOpenChange: (open2) => {
|
|
@@ -1976,7 +1976,7 @@ function FeedbackDialog({
|
|
|
1976
1976
|
children: [
|
|
1977
1977
|
options.message && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: options.message }),
|
|
1978
1978
|
request.kind === "prompt" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1979
|
-
|
|
1979
|
+
KjunInput,
|
|
1980
1980
|
{
|
|
1981
1981
|
autoFocus: true,
|
|
1982
1982
|
value,
|
|
@@ -2130,7 +2130,7 @@ function useSelectionIndicator(tabs = false) {
|
|
|
2130
2130
|
|
|
2131
2131
|
// packages/react/src/controls.tsx
|
|
2132
2132
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2133
|
-
function
|
|
2133
|
+
function KjunCheckbox({
|
|
2134
2134
|
value,
|
|
2135
2135
|
val,
|
|
2136
2136
|
label,
|
|
@@ -2148,7 +2148,7 @@ function DsCheckbox({
|
|
|
2148
2148
|
isSelected: checked,
|
|
2149
2149
|
isDisabled: disabled,
|
|
2150
2150
|
"aria-label": ariaLabel,
|
|
2151
|
-
className: "kjun-choice
|
|
2151
|
+
className: "kjun-choice" + (disabled ? " kjun-choice--disabled" : ""),
|
|
2152
2152
|
onChange: (next) => {
|
|
2153
2153
|
const result = Array.isArray(value) ? next ? [...value, val] : value.filter((v) => v !== val) : next;
|
|
2154
2154
|
onValueChange == null ? void 0 : onValueChange(result);
|
|
@@ -2158,16 +2158,16 @@ function DsCheckbox({
|
|
|
2158
2158
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2159
2159
|
"span",
|
|
2160
2160
|
{
|
|
2161
|
-
className: `
|
|
2162
|
-
children: checked && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2161
|
+
className: `kjun-choice-control kjun-checkbox kjun-checkbox--${size}${checked ? " kjun-checkbox--checked" : ""}`,
|
|
2162
|
+
children: checked && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(KjunIcon, { name: "check", size: import_tokens16.tokens.extensions.checkbox.iconSizes[size] })
|
|
2163
2163
|
}
|
|
2164
2164
|
),
|
|
2165
|
-
(children || label) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "
|
|
2165
|
+
(children || label) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "kjun-choice-label", children: children || label })
|
|
2166
2166
|
]
|
|
2167
2167
|
}
|
|
2168
2168
|
);
|
|
2169
2169
|
}
|
|
2170
|
-
function
|
|
2170
|
+
function KjunSwitch({
|
|
2171
2171
|
value,
|
|
2172
2172
|
label,
|
|
2173
2173
|
ariaLabel,
|
|
@@ -2183,7 +2183,7 @@ function DsSwitch({
|
|
|
2183
2183
|
isSelected: value,
|
|
2184
2184
|
isDisabled: disabled,
|
|
2185
2185
|
"aria-label": ariaLabel || label,
|
|
2186
|
-
className: "kjun-choice
|
|
2186
|
+
className: "kjun-choice" + (disabled ? " kjun-choice--disabled" : ""),
|
|
2187
2187
|
onChange: (next) => {
|
|
2188
2188
|
onValueChange == null ? void 0 : onValueChange(next);
|
|
2189
2189
|
onChange == null ? void 0 : onChange(next);
|
|
@@ -2192,17 +2192,17 @@ function DsSwitch({
|
|
|
2192
2192
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2193
2193
|
"span",
|
|
2194
2194
|
{
|
|
2195
|
-
className: `
|
|
2196
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "
|
|
2195
|
+
className: `kjun-switch kjun-switch--${size}${value ? " kjun-switch--on" : ""}`,
|
|
2196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "kjun-switch-thumb" })
|
|
2197
2197
|
}
|
|
2198
2198
|
),
|
|
2199
|
-
(children || label) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "
|
|
2199
|
+
(children || label) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "kjun-choice-label", children: children || label })
|
|
2200
2200
|
]
|
|
2201
2201
|
}
|
|
2202
2202
|
);
|
|
2203
2203
|
}
|
|
2204
2204
|
var RadioContext = (0, import_react22.createContext)(null);
|
|
2205
|
-
function
|
|
2205
|
+
function KjunRadio({
|
|
2206
2206
|
value,
|
|
2207
2207
|
val,
|
|
2208
2208
|
label,
|
|
@@ -2214,7 +2214,7 @@ function DsRadio({
|
|
|
2214
2214
|
onChange
|
|
2215
2215
|
}) {
|
|
2216
2216
|
const group = (0, import_react22.useContext)(RadioContext), selected = (group ? group.value : value) === val;
|
|
2217
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "kjun-choice
|
|
2217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "kjun-choice" + (disabled ? " kjun-choice--disabled" : ""), children: [
|
|
2218
2218
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2219
2219
|
"input",
|
|
2220
2220
|
{
|
|
@@ -2236,14 +2236,14 @@ function DsRadio({
|
|
|
2236
2236
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2237
2237
|
"span",
|
|
2238
2238
|
{
|
|
2239
|
-
className: "
|
|
2240
|
-
children: selected && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "
|
|
2239
|
+
className: "kjun-choice-control kjun-radio" + (selected ? " kjun-radio--checked" : ""),
|
|
2240
|
+
children: selected && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "kjun-radio-dot" })
|
|
2241
2241
|
}
|
|
2242
2242
|
),
|
|
2243
|
-
(children || label) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "
|
|
2243
|
+
(children || label) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "kjun-choice-label", children: children || label })
|
|
2244
2244
|
] });
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2246
|
+
function KjunRadioGroup({
|
|
2247
2247
|
value,
|
|
2248
2248
|
options = [],
|
|
2249
2249
|
direction = "horizontal",
|
|
@@ -2252,7 +2252,7 @@ function DsRadioGroup({
|
|
|
2252
2252
|
onValueChange,
|
|
2253
2253
|
onChange
|
|
2254
2254
|
}) {
|
|
2255
|
-
const name = (0, import_react22.useId)();
|
|
2255
|
+
const name = "kjun-" + (0, import_react22.useId)();
|
|
2256
2256
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2257
2257
|
RadioContext.Provider,
|
|
2258
2258
|
{
|
|
@@ -2276,7 +2276,7 @@ function DsRadioGroup({
|
|
|
2276
2276
|
gap: direction === "vertical" ? import_tokens16.tokens.dimension.value8 : import_tokens16.tokens.dimension.value16
|
|
2277
2277
|
},
|
|
2278
2278
|
children: children || options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2279
|
-
|
|
2279
|
+
KjunRadio,
|
|
2280
2280
|
{
|
|
2281
2281
|
val: option.value,
|
|
2282
2282
|
label: option.label,
|
|
@@ -2289,8 +2289,8 @@ function DsRadioGroup({
|
|
|
2289
2289
|
}
|
|
2290
2290
|
);
|
|
2291
2291
|
}
|
|
2292
|
-
var
|
|
2293
|
-
function
|
|
2292
|
+
var KjunTextarea = (0, import_react22.forwardRef)(
|
|
2293
|
+
function KjunTextarea2({
|
|
2294
2294
|
value,
|
|
2295
2295
|
size = "md",
|
|
2296
2296
|
error = false,
|
|
@@ -2352,7 +2352,7 @@ function groupKeydown(event) {
|
|
|
2352
2352
|
const next = event.key === "Home" ? 0 : event.key === "End" ? buttons.length - 1 : (current + (event.key === "ArrowRight" ? direction : -direction) + buttons.length) % buttons.length;
|
|
2353
2353
|
(_a = buttons[next]) == null ? void 0 : _a.focus();
|
|
2354
2354
|
}
|
|
2355
|
-
function
|
|
2355
|
+
function KjunButtonGroup({
|
|
2356
2356
|
value,
|
|
2357
2357
|
options,
|
|
2358
2358
|
size = "md",
|
|
@@ -2405,7 +2405,7 @@ function DsButtonGroup({
|
|
|
2405
2405
|
onChange == null ? void 0 : onChange(option.value);
|
|
2406
2406
|
},
|
|
2407
2407
|
children: [
|
|
2408
|
-
option.icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2408
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(KjunIcon, { name: option.icon, size: import_tokens16.tokens.extensions.selection.iconSize }),
|
|
2409
2409
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "kjun-button-group-label", children: [
|
|
2410
2410
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": "true", style: typeStyle(import_tokens16.tokens.button.typography[size]), children: option.label }),
|
|
2411
2411
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: option.label })
|
|
@@ -2418,7 +2418,7 @@ function DsButtonGroup({
|
|
|
2418
2418
|
}
|
|
2419
2419
|
);
|
|
2420
2420
|
}
|
|
2421
|
-
function
|
|
2421
|
+
function KjunFilterGroup({
|
|
2422
2422
|
value,
|
|
2423
2423
|
options,
|
|
2424
2424
|
size = "sm",
|
|
@@ -2461,7 +2461,7 @@ function DsFilterGroup({
|
|
|
2461
2461
|
},
|
|
2462
2462
|
children: [
|
|
2463
2463
|
option.dot && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { style: { background: option.dot } }),
|
|
2464
|
-
option.icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2464
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(KjunIcon, { name: option.icon, size: import_tokens16.tokens.extensions.selection.iconSize }),
|
|
2465
2465
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "kjun-filter-label", children: [
|
|
2466
2466
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": "true", style: typeStyle(import_tokens16.tokens.button.typography[size]), children: option.label }),
|
|
2467
2467
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: option.label })
|
|
@@ -2549,7 +2549,7 @@ var import_tokens18 = require("@kjun-ui/tokens");
|
|
|
2549
2549
|
var import_react24 = require("react");
|
|
2550
2550
|
var import_react_aria_components4 = require("react-aria-components");
|
|
2551
2551
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2552
|
-
function
|
|
2552
|
+
function KjunPopover({
|
|
2553
2553
|
noPadding = false,
|
|
2554
2554
|
open: controlled,
|
|
2555
2555
|
onOpenChange,
|
|
@@ -2563,7 +2563,7 @@ function DsPopover({
|
|
|
2563
2563
|
trigger,
|
|
2564
2564
|
children
|
|
2565
2565
|
}) {
|
|
2566
|
-
const [internal, setInternal] = (0, import_react24.useState)(false), open = controlled != null ? controlled : internal, ref = (0, import_react24.useRef)(null), id = (0, import_react24.useId)();
|
|
2566
|
+
const [internal, setInternal] = (0, import_react24.useState)(false), open = controlled != null ? controlled : internal, ref = (0, import_react24.useRef)(null), id = "kjun-" + (0, import_react24.useId)();
|
|
2567
2567
|
const expanded = usePopupExpanded(open, ref);
|
|
2568
2568
|
const focusOnMount = (0, import_react24.useRef)(focusOnOpen);
|
|
2569
2569
|
focusOnMount.current = focusOnOpen;
|
|
@@ -2624,7 +2624,7 @@ function DsPopover({
|
|
|
2624
2624
|
)
|
|
2625
2625
|
] });
|
|
2626
2626
|
}
|
|
2627
|
-
function
|
|
2627
|
+
function KjunTooltip({
|
|
2628
2628
|
content = "",
|
|
2629
2629
|
placement = "top",
|
|
2630
2630
|
delay = 0,
|
|
@@ -2658,7 +2658,7 @@ var import_react25 = require("react");
|
|
|
2658
2658
|
var import_react_aria_components5 = require("react-aria-components");
|
|
2659
2659
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2660
2660
|
var DropdownContext = (0, import_react25.createContext)(null);
|
|
2661
|
-
function
|
|
2661
|
+
function KjunDropdown({
|
|
2662
2662
|
disabled = false,
|
|
2663
2663
|
placement = "bottom-start",
|
|
2664
2664
|
menuId,
|
|
@@ -2669,7 +2669,7 @@ function DsDropdown({
|
|
|
2669
2669
|
onOpen,
|
|
2670
2670
|
onClose
|
|
2671
2671
|
}) {
|
|
2672
|
-
const [open, setOpen] = (0, import_react25.useState)(false), currentOpen = (0, import_react25.useRef)(false), ref = (0, import_react25.useRef)(null), id = (0, import_react25.useId)();
|
|
2672
|
+
const [open, setOpen] = (0, import_react25.useState)(false), currentOpen = (0, import_react25.useRef)(false), ref = (0, import_react25.useRef)(null), id = "kjun-" + (0, import_react25.useId)();
|
|
2673
2673
|
const menuFocusCleanup = (0, import_react25.useRef)(() => {
|
|
2674
2674
|
});
|
|
2675
2675
|
const bindMenu = (0, import_react25.useCallback)((menu) => {
|
|
@@ -2694,14 +2694,14 @@ function DsDropdown({
|
|
|
2694
2694
|
};
|
|
2695
2695
|
}, []);
|
|
2696
2696
|
let control = trigger;
|
|
2697
|
-
while ((0, import_react25.isValidElement)(control) && control.type ===
|
|
2697
|
+
while ((0, import_react25.isValidElement)(control) && control.type === KjunTooltip)
|
|
2698
2698
|
control = control.props.children;
|
|
2699
2699
|
const unavailable = disabled || (0, import_react25.isValidElement)(control) && !!(control.props.disabled || control.props.loading);
|
|
2700
2700
|
const controlId = triggerId || (0, import_react25.isValidElement)(control) && control.props.id || id;
|
|
2701
2701
|
const popupId = menuId || id + "-menu";
|
|
2702
2702
|
const bindTrigger = (node) => {
|
|
2703
2703
|
if (!(0, import_react25.isValidElement)(node)) return node;
|
|
2704
|
-
if (node.type ===
|
|
2704
|
+
if (node.type === KjunTooltip) {
|
|
2705
2705
|
const tooltip = node;
|
|
2706
2706
|
return (0, import_react25.cloneElement)(tooltip, {}, bindTrigger(tooltip.props.children));
|
|
2707
2707
|
}
|
|
@@ -2766,7 +2766,7 @@ function DsDropdown({
|
|
|
2766
2766
|
)
|
|
2767
2767
|
] });
|
|
2768
2768
|
}
|
|
2769
|
-
function
|
|
2769
|
+
function KjunDropdownItem({
|
|
2770
2770
|
id,
|
|
2771
2771
|
variant = "default",
|
|
2772
2772
|
icon,
|
|
@@ -2791,10 +2791,10 @@ function DsDropdownItem({
|
|
|
2791
2791
|
close == null ? void 0 : close();
|
|
2792
2792
|
},
|
|
2793
2793
|
children: [
|
|
2794
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2794
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(KjunIcon, { name: icon, className: "kjun-menu-icon", size: import_tokens19.tokens.extensions.menu.iconSize }),
|
|
2795
2795
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children }),
|
|
2796
2796
|
selected !== null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2797
|
-
|
|
2797
|
+
KjunIcon,
|
|
2798
2798
|
{
|
|
2799
2799
|
name: "check",
|
|
2800
2800
|
className: "kjun-menu-check",
|
|
@@ -2806,10 +2806,10 @@ function DsDropdownItem({
|
|
|
2806
2806
|
}
|
|
2807
2807
|
);
|
|
2808
2808
|
}
|
|
2809
|
-
function
|
|
2809
|
+
function KjunDropdownDivider() {
|
|
2810
2810
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_aria_components5.Separator, { className: "kjun-menu-divider" });
|
|
2811
2811
|
}
|
|
2812
|
-
function
|
|
2812
|
+
function KjunMenuButton({
|
|
2813
2813
|
label,
|
|
2814
2814
|
size = "md",
|
|
2815
2815
|
variant = "secondary",
|
|
@@ -2825,7 +2825,7 @@ function DsMenuButton({
|
|
|
2825
2825
|
}) {
|
|
2826
2826
|
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
2827
2827
|
const button = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2828
|
-
|
|
2828
|
+
KjunButton,
|
|
2829
2829
|
{
|
|
2830
2830
|
className: "kjun-menu-button",
|
|
2831
2831
|
size,
|
|
@@ -2839,7 +2839,7 @@ function DsMenuButton({
|
|
|
2839
2839
|
}
|
|
2840
2840
|
);
|
|
2841
2841
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2842
|
-
|
|
2842
|
+
KjunDropdown,
|
|
2843
2843
|
{
|
|
2844
2844
|
...props,
|
|
2845
2845
|
onOpen: () => {
|
|
@@ -2851,7 +2851,7 @@ function DsMenuButton({
|
|
|
2851
2851
|
onClose == null ? void 0 : onClose();
|
|
2852
2852
|
},
|
|
2853
2853
|
trigger: tooltip ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2854
|
-
|
|
2854
|
+
KjunTooltip,
|
|
2855
2855
|
{
|
|
2856
2856
|
content: open ? "" : tooltip,
|
|
2857
2857
|
placement: tooltipPlacement,
|
|
@@ -2867,7 +2867,7 @@ function DsMenuButton({
|
|
|
2867
2867
|
var import_tokens20 = require("@kjun-ui/tokens");
|
|
2868
2868
|
var import_react_aria_components6 = require("react-aria-components");
|
|
2869
2869
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2870
|
-
function
|
|
2870
|
+
function KjunDrawer({
|
|
2871
2871
|
open,
|
|
2872
2872
|
onOpenChange,
|
|
2873
2873
|
title,
|
|
@@ -2932,14 +2932,14 @@ function DsDrawer({
|
|
|
2932
2932
|
(title || header || closable) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "kjun-drawer-header", children: [
|
|
2933
2933
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: header || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { children: title }) }),
|
|
2934
2934
|
closable && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2935
|
-
|
|
2935
|
+
KjunButton,
|
|
2936
2936
|
{
|
|
2937
2937
|
size: "sm",
|
|
2938
2938
|
variant: "ghost",
|
|
2939
2939
|
ariaLabel: "\uB2EB\uAE30",
|
|
2940
2940
|
onClick: close,
|
|
2941
2941
|
style: { borderRadius: import_tokens20.tokens.extensions.drawer.closeRadius, width: import_tokens20.tokens.extensions.drawer.closeSize, height: import_tokens20.tokens.extensions.drawer.closeSize, padding: 0 },
|
|
2942
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2942
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(KjunIcon, { name: "x", size: import_tokens20.tokens.extensions.drawer.closeIconSize })
|
|
2943
2943
|
}
|
|
2944
2944
|
)
|
|
2945
2945
|
] }),
|
|
@@ -3064,7 +3064,7 @@ function useComboboxModel({
|
|
|
3064
3064
|
// packages/react/src/combobox.tsx
|
|
3065
3065
|
var import_react27 = require("react");
|
|
3066
3066
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3067
|
-
function
|
|
3067
|
+
function KjunCombobox({
|
|
3068
3068
|
value,
|
|
3069
3069
|
options = [],
|
|
3070
3070
|
placeholder = "\uAC80\uC0C9 \uB610\uB294 \uC120\uD0DD",
|
|
@@ -3143,7 +3143,7 @@ function SearchField({
|
|
|
3143
3143
|
}) {
|
|
3144
3144
|
const composition = useCompositionGuard();
|
|
3145
3145
|
const clearing = (0, import_react27.useRef)(false);
|
|
3146
|
-
const ref = (0, import_react27.useRef)(null), [highlighted, setActive] = (0, import_react27.useState)(-1), id = (0, import_react27.useId)();
|
|
3146
|
+
const ref = (0, import_react27.useRef)(null), [highlighted, setActive] = (0, import_react27.useState)(-1), id = "kjun-" + (0, import_react27.useId)();
|
|
3147
3147
|
const focusGuard = usePopupFocusGuard(ref);
|
|
3148
3148
|
const active = !disabled && !loading && highlighted >= 0 && highlighted < options.length && !optionDisabled(options[highlighted]) ? highlighted : -1;
|
|
3149
3149
|
(0, import_react27.useEffect)(() => setActive(-1), [value, options.length]);
|
|
@@ -3170,7 +3170,7 @@ function SearchField({
|
|
|
3170
3170
|
};
|
|
3171
3171
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
3172
3172
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3173
|
-
|
|
3173
|
+
KjunInput,
|
|
3174
3174
|
{
|
|
3175
3175
|
error,
|
|
3176
3176
|
ref,
|
|
@@ -3262,7 +3262,7 @@ function SearchField({
|
|
|
3262
3262
|
role: "listbox",
|
|
3263
3263
|
"aria-label": ariaLabel || placeholder,
|
|
3264
3264
|
onMouseDown: (e) => e.preventDefault(),
|
|
3265
|
-
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "kjun-select-empty", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3265
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "kjun-select-empty", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(KjunSpinner, { size: "sm", text: "\uAC80\uC0C9 \uC911..." }) }) : failed ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "kjun-select-empty", role: "alert", children: errorText }) : options.length ? options.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3266
3266
|
"div",
|
|
3267
3267
|
{
|
|
3268
3268
|
id: id + "-" + i,
|
|
@@ -3296,7 +3296,7 @@ var import_jsx_runtime18 = (
|
|
|
3296
3296
|
// (sized by these variables) so clicking the icon still opens the browser picker.
|
|
3297
3297
|
require("react/jsx-runtime")
|
|
3298
3298
|
);
|
|
3299
|
-
function
|
|
3299
|
+
function KjunDatePicker({
|
|
3300
3300
|
value,
|
|
3301
3301
|
size = "md",
|
|
3302
3302
|
placeholder = "\uB0A0\uC9DC \uC120\uD0DD",
|
|
@@ -3314,7 +3314,7 @@ function DsDatePicker({
|
|
|
3314
3314
|
["--_kjun-date-icon-size"]: import_tokens21.tokens.input[size].iconSize + "px"
|
|
3315
3315
|
}, children: [
|
|
3316
3316
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3317
|
-
|
|
3317
|
+
KjunInput,
|
|
3318
3318
|
{
|
|
3319
3319
|
...props,
|
|
3320
3320
|
value,
|
|
@@ -3444,7 +3444,7 @@ function useSearchInputModel({
|
|
|
3444
3444
|
|
|
3445
3445
|
// packages/react/src/search-input.tsx
|
|
3446
3446
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3447
|
-
function
|
|
3447
|
+
function KjunSearchInput({
|
|
3448
3448
|
value,
|
|
3449
3449
|
placeholder = "\uAC80\uC0C9...",
|
|
3450
3450
|
ariaLabel,
|
|
@@ -3480,7 +3480,7 @@ function DsSearchInput({
|
|
|
3480
3480
|
};
|
|
3481
3481
|
if (!loadOptions)
|
|
3482
3482
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3483
|
-
|
|
3483
|
+
KjunInput,
|
|
3484
3484
|
{
|
|
3485
3485
|
error,
|
|
3486
3486
|
value: query2,
|
|
@@ -3572,7 +3572,7 @@ var CompoundControlContext = (0, import_react32.createContext)(null);
|
|
|
3572
3572
|
|
|
3573
3573
|
// packages/react/src/select-control.tsx
|
|
3574
3574
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3575
|
-
function
|
|
3575
|
+
function KjunSelect({
|
|
3576
3576
|
value,
|
|
3577
3577
|
options = [],
|
|
3578
3578
|
placeholder = "\uC120\uD0DD",
|
|
@@ -3600,7 +3600,7 @@ function DsSelect({
|
|
|
3600
3600
|
}) {
|
|
3601
3601
|
const { open, query: query2, limit, session, changeOpen, search, showMore } = useSelectState(controlled, disabled, optionPageSize, onOpenChange);
|
|
3602
3602
|
const composition = useCompositionGuard();
|
|
3603
|
-
const ref = (0, import_react33.useRef)(null), menu = (0, import_react33.useRef)(null), field = useKjunField(), id = (0, import_react33.useId)();
|
|
3603
|
+
const ref = (0, import_react33.useRef)(null), menu = (0, import_react33.useRef)(null), field = useKjunField(), id = "kjun-" + (0, import_react33.useId)();
|
|
3604
3604
|
const segment = (0, import_react33.useContext)(CompoundControlContext) !== null;
|
|
3605
3605
|
const spec = import_tokens22.tokens.input[size];
|
|
3606
3606
|
const expanded = usePopupExpanded(open, ref);
|
|
@@ -3658,12 +3658,12 @@ function DsSelect({
|
|
|
3658
3658
|
},
|
|
3659
3659
|
children: [
|
|
3660
3660
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: !label ? "kjun-placeholder" : void 0, style: { flex: 1, paddingRight: clearable && label ? spec.clearSize + spec.affixGap : void 0 }, children: (renderSelected == null ? void 0 : renderSelected(selectedOption)) || label || placeholder }),
|
|
3661
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3661
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(KjunIcon, { name: "chevron-down", className: "kjun-select-indicator", "data-open": expanded || void 0, size: segment ? import_tokens22.tokens.extensions.timePicker.iconSize : spec.iconSize, style: { flexShrink: 0, color: disabled ? "var(--_kjun-color-text-disabled)" : "var(--_kjun-color-text-tertiary)" } })
|
|
3662
3662
|
]
|
|
3663
3663
|
}
|
|
3664
3664
|
),
|
|
3665
3665
|
clearable && !!label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3666
|
-
|
|
3666
|
+
KjunButton,
|
|
3667
3667
|
{
|
|
3668
3668
|
size: "sm",
|
|
3669
3669
|
variant: "ghost",
|
|
@@ -3684,7 +3684,7 @@ function DsSelect({
|
|
|
3684
3684
|
onClear == null ? void 0 : onClear();
|
|
3685
3685
|
(_a = ref.current) == null ? void 0 : _a.focus();
|
|
3686
3686
|
},
|
|
3687
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(KjunIcon, { name: "x", size: spec.iconSize })
|
|
3688
3688
|
}
|
|
3689
3689
|
)
|
|
3690
3690
|
] }),
|
|
@@ -3701,7 +3701,7 @@ function DsSelect({
|
|
|
3701
3701
|
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FieldContext.Provider, { value: null, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ref: menu, className: "kjun-select-content", children: [
|
|
3702
3702
|
menuHeader && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "kjun-select-header", children: menuHeader }),
|
|
3703
3703
|
searchable && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "kjun-select-search", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3704
|
-
|
|
3704
|
+
KjunInput,
|
|
3705
3705
|
{
|
|
3706
3706
|
autoFocus: true,
|
|
3707
3707
|
value: query2,
|
|
@@ -3731,7 +3731,7 @@ function DsSelect({
|
|
|
3731
3731
|
}
|
|
3732
3732
|
}
|
|
3733
3733
|
) }),
|
|
3734
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "kjun-select-empty", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3734
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "kjun-select-empty", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(KjunSpinner, { size: "sm", text: "\uAC80\uC0C9 \uC911..." }) }),
|
|
3735
3735
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3736
3736
|
import_react_aria_components7.ListBox,
|
|
3737
3737
|
{
|
|
@@ -3762,7 +3762,7 @@ function DsSelect({
|
|
|
3762
3762
|
className: "kjun-option",
|
|
3763
3763
|
children: [
|
|
3764
3764
|
(renderOption == null ? void 0 : renderOption(o, selected(o))) || /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: optionLabel(o, labelKey) }),
|
|
3765
|
-
selected(o) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3765
|
+
selected(o) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(KjunIcon, { name: "check", size: import_tokens22.tokens.extensions.menu.iconSize })
|
|
3766
3766
|
]
|
|
3767
3767
|
},
|
|
3768
3768
|
key
|
|
@@ -3772,7 +3772,7 @@ function DsSelect({
|
|
|
3772
3772
|
),
|
|
3773
3773
|
!loading && !matching.length && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "kjun-select-empty", children: "\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }),
|
|
3774
3774
|
!loading && visible.length < matching.length && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3775
|
-
|
|
3775
|
+
KjunButton,
|
|
3776
3776
|
{
|
|
3777
3777
|
size: "sm",
|
|
3778
3778
|
variant: "ghost",
|
|
@@ -3959,7 +3959,7 @@ function manageTabList(list, select, keyboard = true) {
|
|
|
3959
3959
|
var import_react36 = require("react");
|
|
3960
3960
|
var import_react_aria_components8 = require("react-aria-components");
|
|
3961
3961
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3962
|
-
function
|
|
3962
|
+
function KjunTabs({
|
|
3963
3963
|
value,
|
|
3964
3964
|
items = [],
|
|
3965
3965
|
density = "comfortable",
|
|
@@ -3976,7 +3976,7 @@ function DsTabs({
|
|
|
3976
3976
|
const panes = import_react36.Children.toArray(children).filter(
|
|
3977
3977
|
import_react36.isValidElement
|
|
3978
3978
|
);
|
|
3979
|
-
const tabs = items.length ? items : panes.filter((child) => child.type ===
|
|
3979
|
+
const tabs = items.length ? items : panes.filter((child) => child.type === KjunTabPane).map((child) => child.props);
|
|
3980
3980
|
(0, import_react36.useLayoutEffect)(() => {
|
|
3981
3981
|
var _a2;
|
|
3982
3982
|
const list = (_a2 = group.current) == null ? void 0 : _a2.querySelector('[role="tablist"]');
|
|
@@ -3985,7 +3985,7 @@ function DsTabs({
|
|
|
3985
3985
|
}, [group]);
|
|
3986
3986
|
(0, import_react36.useLayoutEffect)(() => {
|
|
3987
3987
|
var _a2;
|
|
3988
|
-
const panelNames = new Set(panes.filter((child) => child.type ===
|
|
3988
|
+
const panelNames = new Set(panes.filter((child) => child.type === KjunTabPane).map((child) => child.props.name));
|
|
3989
3989
|
for (const tab of ((_a2 = group.current) == null ? void 0 : _a2.querySelectorAll('[role="tab"]')) || []) {
|
|
3990
3990
|
if (!panelNames.has(tab.dataset.tabName)) tab.removeAttribute("aria-controls");
|
|
3991
3991
|
}
|
|
@@ -4058,7 +4058,7 @@ function DsTabs({
|
|
|
4058
4058
|
onTouchEnd: clear,
|
|
4059
4059
|
onTouchCancel: clear,
|
|
4060
4060
|
children: [
|
|
4061
|
-
tab.icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4061
|
+
tab.icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(KjunIcon, { name: tab.icon, size: import_tokens24.tokens.extensions.tabs.iconSize }),
|
|
4062
4062
|
" ",
|
|
4063
4063
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "kjun-motion-label", "data-label": tab.label, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: tab.label }) }),
|
|
4064
4064
|
tab.badge != null && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
@@ -4084,7 +4084,7 @@ function DsTabs({
|
|
|
4084
4084
|
}
|
|
4085
4085
|
);
|
|
4086
4086
|
}
|
|
4087
|
-
function
|
|
4087
|
+
function KjunTabPane({ name, children }) {
|
|
4088
4088
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4089
4089
|
import_react_aria_components8.TabPanel,
|
|
4090
4090
|
{
|
|
@@ -4097,7 +4097,7 @@ function DsTabPane({ name, children }) {
|
|
|
4097
4097
|
);
|
|
4098
4098
|
}
|
|
4099
4099
|
var AccordionContext = (0, import_react36.createContext)(null);
|
|
4100
|
-
function
|
|
4100
|
+
function KjunAccordion({
|
|
4101
4101
|
multiple = false,
|
|
4102
4102
|
tone = "card",
|
|
4103
4103
|
children
|
|
@@ -4111,14 +4111,14 @@ function DsAccordion({
|
|
|
4111
4111
|
}
|
|
4112
4112
|
);
|
|
4113
4113
|
}
|
|
4114
|
-
function
|
|
4114
|
+
function KjunAccordionItem({
|
|
4115
4115
|
title = "",
|
|
4116
4116
|
defaultOpen = false,
|
|
4117
4117
|
disabled = false,
|
|
4118
4118
|
header,
|
|
4119
4119
|
children
|
|
4120
4120
|
}) {
|
|
4121
|
-
const group = (0, import_react36.useContext)(AccordionContext), id = (0, import_react36.useId)(), [own, setOwn] = (0, import_react36.useState)(defaultOpen), open = group ? group.opened.has(id) : own;
|
|
4121
|
+
const group = (0, import_react36.useContext)(AccordionContext), id = "kjun-" + (0, import_react36.useId)(), [own, setOwn] = (0, import_react36.useState)(defaultOpen), open = group ? group.opened.has(id) : own;
|
|
4122
4122
|
(0, import_react36.useEffect)(() => {
|
|
4123
4123
|
return group == null ? void 0 : group.register(id, defaultOpen);
|
|
4124
4124
|
}, []);
|
|
@@ -4136,7 +4136,7 @@ function DsAccordionItem({
|
|
|
4136
4136
|
children: [
|
|
4137
4137
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "kjun-accordion-heading", children: header || title }),
|
|
4138
4138
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4139
|
-
|
|
4139
|
+
KjunIcon,
|
|
4140
4140
|
{
|
|
4141
4141
|
name: "chevron-down",
|
|
4142
4142
|
className: "kjun-accordion-chevron",
|
|
@@ -4159,25 +4159,25 @@ function DsAccordionItem({
|
|
|
4159
4159
|
) })
|
|
4160
4160
|
] });
|
|
4161
4161
|
}
|
|
4162
|
-
function
|
|
4162
|
+
function KjunBreadcrumb({
|
|
4163
4163
|
items,
|
|
4164
4164
|
renderLink,
|
|
4165
4165
|
ariaLabel = "\uD604\uC7AC \uC704\uCE58"
|
|
4166
4166
|
}) {
|
|
4167
4167
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("nav", { "aria-label": ariaLabel, className: "kjun-breadcrumb", children: items.map((item, i) => {
|
|
4168
4168
|
const label = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
4169
|
-
item.icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4169
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(KjunIcon, { name: item.icon, size: import_tokens24.tokens.extensions.breadcrumb.iconSize }),
|
|
4170
4170
|
" ",
|
|
4171
4171
|
item.label
|
|
4172
4172
|
] });
|
|
4173
4173
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react36.Fragment, { children: [
|
|
4174
|
-
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4174
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(KjunIcon, { name: "chevron-right", size: import_tokens24.tokens.extensions.breadcrumb.separatorSize }),
|
|
4175
4175
|
" ",
|
|
4176
4176
|
item.to && i < items.length - 1 ? (renderLink == null ? void 0 : renderLink(item, label)) || /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { href: item.to, children: label }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { "aria-current": i === items.length - 1 ? "page" : void 0, children: label })
|
|
4177
4177
|
] }, i);
|
|
4178
4178
|
}) });
|
|
4179
4179
|
}
|
|
4180
|
-
function
|
|
4180
|
+
function KjunPagination({
|
|
4181
4181
|
currentPage,
|
|
4182
4182
|
page,
|
|
4183
4183
|
totalPages,
|
|
@@ -4217,7 +4217,7 @@ function DsPagination({
|
|
|
4217
4217
|
"aria-label": label,
|
|
4218
4218
|
disabled: target < 1 || target > totalPages || target === current,
|
|
4219
4219
|
onClick: () => change(target),
|
|
4220
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4220
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(KjunIcon, { name: icon, size: import_tokens24.tokens.extensions.pagination.iconSize })
|
|
4221
4221
|
}
|
|
4222
4222
|
);
|
|
4223
4223
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("nav", { "aria-label": "\uD398\uC774\uC9C0 \uD0D0\uC0C9", className: "kjun-pagination", children: [
|
|
@@ -4232,7 +4232,7 @@ function DsPagination({
|
|
|
4232
4232
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", {}),
|
|
4233
4233
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "kjun-pagination-controls", children: [
|
|
4234
4234
|
showSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "kjun-pagination-size", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4235
|
-
|
|
4235
|
+
KjunSelect,
|
|
4236
4236
|
{
|
|
4237
4237
|
size: "sm",
|
|
4238
4238
|
ariaLabel: "\uD398\uC774\uC9C0\uB2F9 \uD56D\uBAA9 \uC218",
|
|
@@ -4281,7 +4281,7 @@ function DsPagination({
|
|
|
4281
4281
|
var import_tokens25 = require("@kjun-ui/tokens");
|
|
4282
4282
|
var import_react37 = require("react");
|
|
4283
4283
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4284
|
-
function
|
|
4284
|
+
function KjunIconToggle({
|
|
4285
4285
|
active = false,
|
|
4286
4286
|
activeIcon,
|
|
4287
4287
|
inactiveIcon,
|
|
@@ -4300,7 +4300,7 @@ function DsIconToggle({
|
|
|
4300
4300
|
}) {
|
|
4301
4301
|
var _a;
|
|
4302
4302
|
const navigation = (0, import_react37.useContext)(TopNavigationContext);
|
|
4303
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(KjunTooltip, { content: disabled || loading ? "" : tooltip != null ? tooltip : ariaLabel, placement: tooltipPlacement, delay: tooltipDelay, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4304
4304
|
"button",
|
|
4305
4305
|
{
|
|
4306
4306
|
type: "button",
|
|
@@ -4315,8 +4315,8 @@ function DsIconToggle({
|
|
|
4315
4315
|
e.stopPropagation();
|
|
4316
4316
|
onToggle == null ? void 0 : onToggle();
|
|
4317
4317
|
},
|
|
4318
|
-
children: loading ? navigation ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4319
|
-
|
|
4318
|
+
children: loading ? navigation ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(KjunIcon, { name: "loader-2", spin: true, size: navigation.iconSize }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(KjunSpinner, { size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4319
|
+
KjunIcon,
|
|
4320
4320
|
{
|
|
4321
4321
|
name: active ? activeIcon : inactiveIcon || activeIcon,
|
|
4322
4322
|
filled: active,
|
|
@@ -4345,7 +4345,7 @@ async function browserCopy(value) {
|
|
|
4345
4345
|
previous == null ? void 0 : previous.focus();
|
|
4346
4346
|
}
|
|
4347
4347
|
}
|
|
4348
|
-
function
|
|
4348
|
+
function KjunCopyButton({
|
|
4349
4349
|
value,
|
|
4350
4350
|
ariaLabel,
|
|
4351
4351
|
text,
|
|
@@ -4406,7 +4406,7 @@ function DsCopyButton({
|
|
|
4406
4406
|
},
|
|
4407
4407
|
children: [
|
|
4408
4408
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4409
|
-
|
|
4409
|
+
KjunIcon,
|
|
4410
4410
|
{
|
|
4411
4411
|
name: copied ? "check" : "copy",
|
|
4412
4412
|
size: import_tokens25.tokens.button.iconSizes[size],
|
|
@@ -4420,7 +4420,7 @@ function DsCopyButton({
|
|
|
4420
4420
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { role: feedback ? void 0 : "status", "aria-hidden": feedback ? true : void 0, className: "kjun-sr-only", children: copied ? successText : failed ? "\uBCF5\uC0AC \uC2E4\uD328" : "" })
|
|
4421
4421
|
] });
|
|
4422
4422
|
}
|
|
4423
|
-
function
|
|
4423
|
+
function KjunRefreshButton({
|
|
4424
4424
|
targetName = "",
|
|
4425
4425
|
mode = "icon",
|
|
4426
4426
|
text = "\uC0C8\uB85C\uACE0\uCE68",
|
|
@@ -4439,8 +4439,8 @@ function DsRefreshButton({
|
|
|
4439
4439
|
const reduced = useReducedMotion();
|
|
4440
4440
|
const label = ariaLabel || [targetName, "\uC0C8\uB85C\uACE0\uCE68"].filter(Boolean).join(" ");
|
|
4441
4441
|
const hint = (_a = tooltip != null ? tooltip : title) != null ? _a : mode === "icon" ? label : "";
|
|
4442
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4443
|
-
|
|
4442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(KjunTooltip, { content: props.disabled || props.loading ? "" : hint, placement: tooltipPlacement, delay: tooltipDelay, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4443
|
+
KjunButton,
|
|
4444
4444
|
{
|
|
4445
4445
|
...props,
|
|
4446
4446
|
size,
|
|
@@ -4461,13 +4461,13 @@ function safeExternalUrl(href) {
|
|
|
4461
4461
|
return "";
|
|
4462
4462
|
}
|
|
4463
4463
|
}
|
|
4464
|
-
function
|
|
4464
|
+
function KjunExternalLink({
|
|
4465
4465
|
href = "",
|
|
4466
4466
|
mode = "text",
|
|
4467
4467
|
label,
|
|
4468
4468
|
children
|
|
4469
4469
|
}) {
|
|
4470
|
-
const url = safeExternalUrl(href), name = label || (mode === "icon" ? "\uC678\uBD80 \uB9C1\uD06C" : void 0), body = mode === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4470
|
+
const url = safeExternalUrl(href), name = label || (mode === "icon" ? "\uC678\uBD80 \uB9C1\uD06C" : void 0), body = mode === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(KjunIcon, { name: "external-link" }) : children;
|
|
4471
4471
|
return url ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4472
4472
|
"a",
|
|
4473
4473
|
{
|
|
@@ -4480,13 +4480,13 @@ function DsExternalLink({
|
|
|
4480
4480
|
onClick: (e) => e.stopPropagation(),
|
|
4481
4481
|
children: [
|
|
4482
4482
|
body,
|
|
4483
|
-
mode === "text" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4483
|
+
mode === "text" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(KjunIcon, { name: "external-link", size: import_tokens25.tokens.iconSizes.small, className: "kjun-external-link-icon" }),
|
|
4484
4484
|
!name && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "kjun-sr-only", children: " (\uC0C8 \uCC3D)" })
|
|
4485
4485
|
]
|
|
4486
4486
|
}
|
|
4487
4487
|
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { "aria-label": name, children: body });
|
|
4488
4488
|
}
|
|
4489
|
-
function
|
|
4489
|
+
function KjunScrollFade({ children }) {
|
|
4490
4490
|
const ref = (0, import_react37.useRef)(null), [edges, setEdges] = (0, import_react37.useState)({ left: false, right: false });
|
|
4491
4491
|
const update = () => {
|
|
4492
4492
|
const el = ref.current;
|
|
@@ -4535,7 +4535,7 @@ function useQueryDisplay(props) {
|
|
|
4535
4535
|
}
|
|
4536
4536
|
return (0, import_tokens26.queryDisplayStatus)(next, props);
|
|
4537
4537
|
}
|
|
4538
|
-
function
|
|
4538
|
+
function KjunDataState({
|
|
4539
4539
|
preserveContent = false,
|
|
4540
4540
|
refreshing = false,
|
|
4541
4541
|
refreshError,
|
|
@@ -4562,7 +4562,7 @@ function DsDataState({
|
|
|
4562
4562
|
const state = useQueryDisplay(query2), blockingError = query2.error && !(state.usesQueryState && state.hasCurrentResult), visibleRefreshError = refreshError || (state.usesQueryState && state.hasCurrentResult ? query2.error : null), concealed = state.initialLoading || !!blockingError || empty, padding = import_tokens26.tokens.extensions.state.padding[size];
|
|
4563
4563
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kjun-data-state", "aria-busy": !!query2.loading || refreshing, children: [
|
|
4564
4564
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: (refreshing || state.queryRefreshing) && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kjun-data-status", role: "status", children: [
|
|
4565
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunSpinner, { size: "xs" }),
|
|
4566
4566
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: refreshingText })
|
|
4567
4567
|
] }) }),
|
|
4568
4568
|
state.initialLoading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -4571,12 +4571,12 @@ function DsDataState({
|
|
|
4571
4571
|
role: "status",
|
|
4572
4572
|
"aria-label": loadingText,
|
|
4573
4573
|
style: { paddingBlock: loadingPadding === "none" ? 0 : padding },
|
|
4574
|
-
children: loadingContent || (skeleton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "grid", gap: import_tokens26.tokens.dimension.value12 }, children: Array.from({ length: skeletonCount }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4575
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4574
|
+
children: loadingContent || (skeleton ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "grid", gap: import_tokens26.tokens.dimension.value12 }, children: Array.from({ length: skeletonCount }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunSkeleton, { type: skeletonType }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "kjun-data-loading", children: [
|
|
4575
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunSpinner, { size: "md" }),
|
|
4576
4576
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: loadingText })
|
|
4577
4577
|
] }))
|
|
4578
4578
|
}
|
|
4579
|
-
) : blockingError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "kjun-state-actions", style: { paddingBlock: padding }, children: errorContent || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4579
|
+
) : blockingError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "kjun-state-actions", style: { paddingBlock: padding }, children: errorContent || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunAlert, { type: "danger", title: "\uC624\uB958 \uBC1C\uC0DD", actions: onRetry && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunButton, { variant: "secondary", onClick: onRetry, children: retryText }), children: query2.error }) }) : empty ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "kjun-data-empty kjun-state-actions", style: { paddingBlock: padding }, children: emptyContent || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunEmpty, { text: emptyText, icon: emptyIcon, children: emptyActionText && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunButton, { onClick: onEmptyAction, children: emptyActionText }) }) }) : null,
|
|
4580
4580
|
(!concealed || preserveContent && state.hasQueryResult) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4581
4581
|
"div",
|
|
4582
4582
|
{
|
|
@@ -4590,13 +4590,13 @@ function DsDataState({
|
|
|
4590
4590
|
},
|
|
4591
4591
|
"content"
|
|
4592
4592
|
),
|
|
4593
|
-
visibleRefreshError && !state.initialLoading && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "kjun-data-warning kjun-state-actions", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4593
|
+
visibleRefreshError && !state.initialLoading && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "kjun-data-warning kjun-state-actions", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(KjunAlert, { type: "warning", size: "sm", actions: onRetry && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(KjunButton, { variant: "secondary", onClick: onRetry, children: retryText }), children: [
|
|
4594
4594
|
visibleRefreshError,
|
|
4595
4595
|
" \xB7 \uC774\uC804 \uC870\uD68C \uACB0\uACFC\uB97C \uD45C\uC2DC\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4."
|
|
4596
4596
|
] }) })
|
|
4597
4597
|
] });
|
|
4598
4598
|
}
|
|
4599
|
-
var
|
|
4599
|
+
var KjunErrorBoundary = class extends import_react38.Component {
|
|
4600
4600
|
constructor() {
|
|
4601
4601
|
super(...arguments);
|
|
4602
4602
|
this.state = { error: false };
|
|
@@ -4613,7 +4613,7 @@ var DsErrorBoundary = class extends import_react38.Component {
|
|
|
4613
4613
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { children: this.props.fallbackMessage || "\uBB38\uC81C\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4" }),
|
|
4614
4614
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: "\uB2E4\uC2DC \uC2DC\uB3C4\uD558\uBA74 \uBB38\uC81C\uAC00 \uD574\uACB0\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4." }),
|
|
4615
4615
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4616
|
-
|
|
4616
|
+
KjunButton,
|
|
4617
4617
|
{
|
|
4618
4618
|
onClick: () => {
|
|
4619
4619
|
var _a, _b;
|
|
@@ -4672,27 +4672,27 @@ function MarketColumns({ columns, showActions, widthClass }) {
|
|
|
4672
4672
|
|
|
4673
4673
|
// packages/react/src/market-skeleton.tsx
|
|
4674
4674
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4675
|
-
function
|
|
4675
|
+
function KjunMarketTableSkeleton({ columns = [], rows = 8, showActions = false, alignClass, widthClass }) {
|
|
4676
4676
|
const cols = normalizeMarketColumns(columns);
|
|
4677
4677
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "aria-hidden": "true", className: "kjun-table-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("table", { className: "kjun-market-table-grid", style: webMarketLayout(cols, showActions, widthClass).tableStyle, children: [
|
|
4678
4678
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MarketColumns, { columns: cols, showActions, widthClass }),
|
|
4679
4679
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("tr", { children: [
|
|
4680
|
-
showActions && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", { className: "kjun-market-actions", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4680
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", { className: "kjun-market-actions", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KjunSkeleton, { type: "block", width: import_tokens28.tokens.extensions.marketTable.actionSkeletonWidth, height: import_tokens28.tokens.extensions.marketTable.headerSkeletonHeight }) }) }),
|
|
4681
4681
|
cols.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", { className: alignClass == null ? void 0 : alignClass(col.align), style: { textAlign: col.align }, children: col.label }, col.key || i))
|
|
4682
4682
|
] }) }),
|
|
4683
4683
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tbody", { children: Array.from({ length: Math.max(0, rows) }, (_, row) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("tr", { children: [
|
|
4684
|
-
showActions && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { className: "kjun-market-actions", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4684
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { className: "kjun-market-actions", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KjunSkeleton, { type: "block", width: import_tokens28.tokens.extensions.marketTable.actionSkeletonWidth, height: import_tokens28.tokens.extensions.financial.priceSkeletonHeight }) }) }),
|
|
4685
4685
|
cols.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { className: alignClass == null ? void 0 : alignClass(col.align), style: { textAlign: col.align }, children: isMarketIdentity(col.key) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "kjun-market-skeleton-identity", children: [
|
|
4686
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4687
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4688
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KjunSkeleton, { type: "block", width: "80%", height: import_tokens28.tokens.extensions.skeleton.lineHeights.md }),
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KjunSkeleton, { type: "block", width: "60%", height: import_tokens28.tokens.extensions.skeleton.lineHeights.sm })
|
|
4688
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "kjun-market-skeleton-value", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KjunSkeleton, { type: "block", width: import_tokens28.tokens.extensions.financial.priceSkeletonWidth, height: import_tokens28.tokens.extensions.financial.priceSkeletonHeight }) }) }, col.key || i))
|
|
4689
4689
|
] }, row)) })
|
|
4690
4690
|
] }) });
|
|
4691
4691
|
}
|
|
4692
4692
|
|
|
4693
4693
|
// packages/react/src/skeletons.tsx
|
|
4694
4694
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4695
|
-
function
|
|
4695
|
+
function KjunListSkeleton({
|
|
4696
4696
|
rows = 8,
|
|
4697
4697
|
variant = "market",
|
|
4698
4698
|
avatar = true,
|
|
@@ -4700,25 +4700,25 @@ function DsListSkeleton({
|
|
|
4700
4700
|
quote = true
|
|
4701
4701
|
}) {
|
|
4702
4702
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { "aria-hidden": "true", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "kjun-list-skeleton-row", "data-variant": variant, children: [
|
|
4703
|
-
avatar && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4703
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSkeleton, { type: "avatar", width: avatarSize, height: avatarSize }),
|
|
4704
4704
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "kjun-list-skeleton-label", children: [
|
|
4705
4705
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4706
|
-
|
|
4706
|
+
KjunSkeleton,
|
|
4707
4707
|
{
|
|
4708
4708
|
type: "block",
|
|
4709
4709
|
height: import_tokens29.tokens.extensions.skeleton.lineHeights.md,
|
|
4710
4710
|
width: i % 2 ? "80%" : "65%"
|
|
4711
4711
|
}
|
|
4712
4712
|
),
|
|
4713
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4713
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSkeleton, { type: "block", height: import_tokens29.tokens.extensions.skeleton.lineHeights.sm, width: "50%" })
|
|
4714
4714
|
] }),
|
|
4715
4715
|
quote && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "kjun-list-skeleton-quote", children: [
|
|
4716
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4717
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSkeleton, { type: "block", height: import_tokens29.tokens.extensions.skeleton.quoteHeight, width: import_tokens29.tokens.extensions.skeleton.quoteWidth }),
|
|
4717
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSkeleton, { type: "block", height: import_tokens29.tokens.extensions.skeleton.lineHeights.sm, width: import_tokens29.tokens.extensions.skeleton.detailWidth })
|
|
4718
4718
|
] })
|
|
4719
4719
|
] }, i)) });
|
|
4720
4720
|
}
|
|
4721
|
-
function
|
|
4721
|
+
function KjunFormSkeleton({
|
|
4722
4722
|
fields = ["", "", "", ""],
|
|
4723
4723
|
columns = 1,
|
|
4724
4724
|
multiline = false,
|
|
@@ -4730,14 +4730,14 @@ function DsFormSkeleton({
|
|
|
4730
4730
|
"aria-hidden": "true",
|
|
4731
4731
|
className: "kjun-form-skeleton",
|
|
4732
4732
|
"data-columns": columns,
|
|
4733
|
-
style: { "--form-skeleton-radius": `${import_tokens29.tokens.input[size].radius}px` },
|
|
4733
|
+
style: { "--_kjun-form-skeleton-radius": `${import_tokens29.tokens.input[size].radius}px` },
|
|
4734
4734
|
children: fields.map((field, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
4735
4735
|
field ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-form-skeleton-label", children: typeof field === "string" ? field : field.label }) : (
|
|
4736
4736
|
// The bar sits in a label-line slot so the field starts where the real input will.
|
|
4737
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-form-skeleton-label-slot", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4737
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-form-skeleton-label-slot", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSkeleton, { type: "block", height: import_tokens29.tokens.extensions.skeleton.formLabelHeight, width: import_tokens29.tokens.extensions.skeleton.formLabelWidth }) })
|
|
4738
4738
|
),
|
|
4739
4739
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4740
|
-
|
|
4740
|
+
KjunSkeleton,
|
|
4741
4741
|
{
|
|
4742
4742
|
type: "block",
|
|
4743
4743
|
height: typeof field === "object" && field.height != null ? field.height : multiline ? import_tokens29.tokens.input[size].lineHeight * 3 + import_tokens29.tokens.input[size].textareaPaddingY * 2 + 2 * import_tokens29.tokens.border.controlWidth : import_tokens29.tokens.input[size].height
|
|
@@ -4747,14 +4747,14 @@ function DsFormSkeleton({
|
|
|
4747
4747
|
}
|
|
4748
4748
|
);
|
|
4749
4749
|
}
|
|
4750
|
-
function
|
|
4750
|
+
function KjunChartSkeleton({
|
|
4751
4751
|
loadingText = "\uCC28\uD2B8\uB97C \uBD88\uB7EC\uC624\uB294 \uC911",
|
|
4752
4752
|
kind = "line",
|
|
4753
4753
|
height = import_tokens29.tokens.extensions.chartSkeleton.height
|
|
4754
4754
|
}) {
|
|
4755
4755
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "kjun-chart-skeleton", style: { height }, "aria-hidden": "true", children: [
|
|
4756
4756
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-chart-skeleton-status", children: loadingText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: loadingText }) }),
|
|
4757
|
-
kind === "donut" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-chart-skeleton-donut", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4757
|
+
kind === "donut" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-chart-skeleton-donut", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSkeleton, { type: "block", width: import_tokens29.tokens.extensions.chartSkeleton.donutLabelWidth, height: import_tokens29.tokens.extensions.chartSkeleton.donutLabelHeight }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4758
4758
|
"svg",
|
|
4759
4759
|
{
|
|
4760
4760
|
viewBox: "0 0 600 240",
|
|
@@ -4911,7 +4911,7 @@ var format = (value, decimals = 0) => new Intl.NumberFormat(void 0, {
|
|
|
4911
4911
|
function useCountUp(value, animated, fromPrevious) {
|
|
4912
4912
|
return useNumberMotion(value, animated, fromPrevious, useReducedMotion());
|
|
4913
4913
|
}
|
|
4914
|
-
function
|
|
4914
|
+
function KjunAnimatedNumber({
|
|
4915
4915
|
value,
|
|
4916
4916
|
decimals = 0,
|
|
4917
4917
|
prefix = "",
|
|
@@ -4928,21 +4928,21 @@ function DsAnimatedNumber({
|
|
|
4928
4928
|
suffix && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "kjun-number-affix", "data-side": "suffix", children: suffix })
|
|
4929
4929
|
] });
|
|
4930
4930
|
}
|
|
4931
|
-
function
|
|
4931
|
+
function KjunFreshness({
|
|
4932
4932
|
stale = false,
|
|
4933
4933
|
source,
|
|
4934
4934
|
fetchedAt,
|
|
4935
4935
|
formatter
|
|
4936
4936
|
}) {
|
|
4937
4937
|
return stale ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4938
|
-
|
|
4938
|
+
KjunTooltip,
|
|
4939
4939
|
{
|
|
4940
4940
|
content: (source === "close" ? "\uC2E4\uC2DC\uAC04 \uC2DC\uC138 \uC5C6\uC74C \xB7 \uCD5C\uADFC \uC885\uAC00 \uD45C\uC2DC" : "\uC2E4\uC2DC\uAC04 \uC2DC\uC138 \uC9C0\uC5F0") + (fetchedAt ? " \xB7 " + ((formatter == null ? void 0 : formatter(fetchedAt)) || formatRelativeTime(fetchedAt)) : ""),
|
|
4941
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { tabIndex: 0, className: "kjun-freshness", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4941
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { tabIndex: 0, className: "kjun-freshness", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunBadge, { variant: "warning", size: "xs", children: source === "close" ? "\uC885\uAC00" : "\uC9C0\uC5F0" }) })
|
|
4942
4942
|
}
|
|
4943
4943
|
) : null;
|
|
4944
4944
|
}
|
|
4945
|
-
function
|
|
4945
|
+
function KjunPriceCell({
|
|
4946
4946
|
value,
|
|
4947
4947
|
formatter,
|
|
4948
4948
|
stale = false,
|
|
@@ -4952,15 +4952,15 @@ function DsPriceCell({
|
|
|
4952
4952
|
flashClass = "",
|
|
4953
4953
|
fromPrevious = true
|
|
4954
4954
|
}) {
|
|
4955
|
-
return value == null ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4955
|
+
return value == null ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunSkeleton, { type: "block", height: import_tokens31.tokens.extensions.financial.priceSkeletonHeight, width: import_tokens31.tokens.extensions.financial.priceSkeletonWidth }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
4956
4956
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4957
4957
|
"span",
|
|
4958
4958
|
{
|
|
4959
4959
|
className: "kjun-price-cell " + flashClass,
|
|
4960
|
-
ref: domainColorRef(/\
|
|
4960
|
+
ref: domainColorRef(/\bkjun-price-flash-(up|down)/.test(flashClass)),
|
|
4961
4961
|
style: { color: stale ? "var(--_kjun-color-text-tertiary)" : void 0 },
|
|
4962
4962
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4963
|
-
|
|
4963
|
+
KjunAnimatedNumber,
|
|
4964
4964
|
{
|
|
4965
4965
|
value,
|
|
4966
4966
|
formatter,
|
|
@@ -4969,10 +4969,10 @@ function DsPriceCell({
|
|
|
4969
4969
|
)
|
|
4970
4970
|
}
|
|
4971
4971
|
),
|
|
4972
|
-
showFreshness && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4972
|
+
showFreshness && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunFreshness, { stale, source, fetchedAt })
|
|
4973
4973
|
] });
|
|
4974
4974
|
}
|
|
4975
|
-
function
|
|
4975
|
+
function KjunSignedValue({
|
|
4976
4976
|
value,
|
|
4977
4977
|
format: kind = "number",
|
|
4978
4978
|
isRaw = false,
|
|
@@ -5000,8 +5000,8 @@ function DsSignedValue({
|
|
|
5000
5000
|
background: tone === "pill" && !stale && n !== null ? `var(--_kjun-color-${role2}-bg)` : void 0
|
|
5001
5001
|
},
|
|
5002
5002
|
children: [
|
|
5003
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5004
|
-
!loading && showFreshness && stale && n !== null && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5003
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunSkeleton, { type: "block", width: import_tokens31.tokens.extensions.financial.signedSkeletonWidth, height: "1lh" }) : display,
|
|
5004
|
+
!loading && showFreshness && stale && n !== null && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunFreshness, { stale: true })
|
|
5005
5005
|
]
|
|
5006
5006
|
}
|
|
5007
5007
|
);
|
|
@@ -5009,7 +5009,7 @@ function DsSignedValue({
|
|
|
5009
5009
|
|
|
5010
5010
|
// packages/react/src/financial-display.tsx
|
|
5011
5011
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5012
|
-
function
|
|
5012
|
+
function KjunDeviation({
|
|
5013
5013
|
value,
|
|
5014
5014
|
variant = "pill",
|
|
5015
5015
|
signalThreshold = 1,
|
|
@@ -5023,7 +5023,7 @@ function DsDeviation({
|
|
|
5023
5023
|
if (variant === "badge")
|
|
5024
5024
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "kjun-deviation-badge", children: [
|
|
5025
5025
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5026
|
-
|
|
5026
|
+
KjunBadge,
|
|
5027
5027
|
{
|
|
5028
5028
|
variant: neutral ? "secondary" : n > 0 ? "price-up" : "price-down",
|
|
5029
5029
|
size: "sm",
|
|
@@ -5032,11 +5032,11 @@ function DsDeviation({
|
|
|
5032
5032
|
}
|
|
5033
5033
|
),
|
|
5034
5034
|
!signal ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "kjun-deviation-signal-slot", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5035
|
-
|
|
5035
|
+
KjunTooltip,
|
|
5036
5036
|
{
|
|
5037
5037
|
content: `\uAD34\uB9AC\uC728 ${signalThreshold}% \uCD08\uACFC \u2014 \uCC28\uC775\uAC70\uB798 \uAE30\uD68C \uAC00\uB2A5`,
|
|
5038
5038
|
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { tabIndex: 0, role: "img", "aria-label": "\uCC28\uC775\uAC70\uB798 \uAE30\uD68C", className: "kjun-deviation-signal", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5039
|
-
|
|
5039
|
+
KjunIcon,
|
|
5040
5040
|
{
|
|
5041
5041
|
name: "alert-triangle",
|
|
5042
5042
|
size: import_tokens32.tokens.extensions.financial.warningIconSize,
|
|
@@ -5070,7 +5070,7 @@ function DsDeviation({
|
|
|
5070
5070
|
}
|
|
5071
5071
|
);
|
|
5072
5072
|
}
|
|
5073
|
-
function
|
|
5073
|
+
function KjunHeatmapCell({
|
|
5074
5074
|
value = 0,
|
|
5075
5075
|
min = 0,
|
|
5076
5076
|
max = 1,
|
|
@@ -5093,7 +5093,7 @@ function DsHeatmapCell({
|
|
|
5093
5093
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: children != null ? children : value })
|
|
5094
5094
|
] });
|
|
5095
5095
|
}
|
|
5096
|
-
function
|
|
5096
|
+
function KjunProgressCell({
|
|
5097
5097
|
value = 0,
|
|
5098
5098
|
max = 100,
|
|
5099
5099
|
showLabel = true,
|
|
@@ -5118,14 +5118,14 @@ function DsProgressCell({
|
|
|
5118
5118
|
] })
|
|
5119
5119
|
] });
|
|
5120
5120
|
}
|
|
5121
|
-
function
|
|
5121
|
+
function KjunCollectionMark({
|
|
5122
5122
|
kind,
|
|
5123
5123
|
active = false,
|
|
5124
5124
|
size = "md"
|
|
5125
5125
|
}) {
|
|
5126
5126
|
const box = import_tokens32.tokens.extensions.financial.markSizes[size], glyph = kind === "interest" ? import_tokens32.tokens.extensions.financial.heartMarkSizes[size] : box;
|
|
5127
5127
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5128
|
-
|
|
5128
|
+
KjunIcon,
|
|
5129
5129
|
{
|
|
5130
5130
|
ref: domainColorRef(active),
|
|
5131
5131
|
name: kind === "favorite" ? "star" : "heart",
|
|
@@ -5148,15 +5148,15 @@ var executionStates = {
|
|
|
5148
5148
|
completed_with_errors: ["warning", "\uC644\uB8CC (\uC624\uB958)"],
|
|
5149
5149
|
failed: ["danger", "\uC2E4\uD328"]
|
|
5150
5150
|
};
|
|
5151
|
-
function
|
|
5151
|
+
function KjunExecutionStatusBadge({
|
|
5152
5152
|
status,
|
|
5153
5153
|
label,
|
|
5154
5154
|
size = "md"
|
|
5155
5155
|
}) {
|
|
5156
5156
|
const state = status ? executionStates[status] : void 0;
|
|
5157
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(KjunBadge, { variant: (state == null ? void 0 : state[0]) || "secondary", size, dot: status === "running", children: label || (state == null ? void 0 : state[1]) || (status ? "\uC54C \uC218 \uC5C6\uC74C" : "\uC2E4\uD589 \uC774\uB825 \uC5C6\uC74C") });
|
|
5158
5158
|
}
|
|
5159
|
-
function
|
|
5159
|
+
function KjunSparkline({
|
|
5160
5160
|
data = [],
|
|
5161
5161
|
width = import_tokens32.tokens.extensions.financial.sparklineWidth,
|
|
5162
5162
|
height = import_tokens32.tokens.extensions.financial.sparklineHeight,
|
|
@@ -5167,7 +5167,7 @@ function DsSparkline({
|
|
|
5167
5167
|
stretch = false,
|
|
5168
5168
|
ariaLabel
|
|
5169
5169
|
}) {
|
|
5170
|
-
const id = (0, import_react41.useId)().replace(/:/g, ""), values = data.filter(Number.isFinite), min = Math.min(...values), max = Math.max(...values), range = max - min || 1, points = values.map(
|
|
5170
|
+
const id = "kjun-" + (0, import_react41.useId)().replace(/:/g, ""), values = data.filter(Number.isFinite), min = Math.min(...values), max = Math.max(...values), range = max - min || 1, points = values.map(
|
|
5171
5171
|
(v, i) => `${2 + i / Math.max(1, values.length - 1) * (width - 4)},${2 + height - 4 - (v - min) / range * (height - 4)}`
|
|
5172
5172
|
).join(" "), change = values.length > 1 ? values[values.length - 1] - values[0] : 0, line = color || `var(--_kjun-color-${change === 0 ? "text-tertiary" : semantic === "status" ? change > 0 ? "success" : "danger" : change > 0 ? "price-up" : "price-down"})`;
|
|
5173
5173
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
@@ -5357,9 +5357,9 @@ function TableToolbar({
|
|
|
5357
5357
|
selected.length,
|
|
5358
5358
|
"\uAC1C \uC120\uD0DD"
|
|
5359
5359
|
] }),
|
|
5360
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5360
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(KjunButton, { size: "xs", variant: "ghost", onClick: toggleAll, children: "\uC804\uCCB4 \uC120\uD0DD" }),
|
|
5361
5361
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5362
|
-
|
|
5362
|
+
KjunButton,
|
|
5363
5363
|
{
|
|
5364
5364
|
size: "xs",
|
|
5365
5365
|
variant: "ghost",
|
|
@@ -5373,7 +5373,7 @@ function TableToolbar({
|
|
|
5373
5373
|
),
|
|
5374
5374
|
(searchable || toolbar) && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "kjun-table-toolbar", children: [
|
|
5375
5375
|
searchable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5376
|
-
|
|
5376
|
+
KjunInput,
|
|
5377
5377
|
{
|
|
5378
5378
|
size: "sm",
|
|
5379
5379
|
style: { width: import_tokens34.tokens.table.searchWidth, maxWidth: "100%" },
|
|
@@ -5410,8 +5410,8 @@ var TableCheck = (0, import_react43.forwardRef)(
|
|
|
5410
5410
|
const size = import_tokens35.tokens.extensions.checkbox.iconSizes.sm;
|
|
5411
5411
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconFallbacks, { icons: componentIcons, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "kjun-table-check", children: [
|
|
5412
5412
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("input", { ...props, ref, type: "checkbox" }),
|
|
5413
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5414
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5413
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(KjunIcon, { name: "check", size, className: "kjun-table-check-mark" }),
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(KjunIcon, { name: "minus", size, className: "kjun-table-check-dash" })
|
|
5415
5415
|
] }) });
|
|
5416
5416
|
}
|
|
5417
5417
|
);
|
|
@@ -5460,7 +5460,7 @@ function TableGrid({ initialLoading, skeletonRows, state, onRowClick, selectable
|
|
|
5460
5460
|
children: [
|
|
5461
5461
|
col.label,
|
|
5462
5462
|
state.sort.key === col.key && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5463
|
-
|
|
5463
|
+
KjunIcon,
|
|
5464
5464
|
{
|
|
5465
5465
|
name: state.sort.order === "asc" ? "sort-ascending" : "sort-descending",
|
|
5466
5466
|
size: import_tokens36.tokens.table.sortIconSize
|
|
@@ -5476,10 +5476,10 @@ function TableGrid({ initialLoading, skeletonRows, state, onRowClick, selectable
|
|
|
5476
5476
|
}
|
|
5477
5477
|
),
|
|
5478
5478
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("tbody", { children: initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("tr", { "aria-hidden": "true", children: [
|
|
5479
|
-
selectable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "kjun-table-action-cell", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5479
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "kjun-table-action-cell", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(KjunSkeleton, { type: "block", height: import_tokens36.tokens.table.selectionSize, width: import_tokens36.tokens.table.selectionSize }) }),
|
|
5480
5480
|
expandable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "kjun-table-action-cell" }),
|
|
5481
5481
|
visible.map((col) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5482
|
-
|
|
5482
|
+
KjunSkeleton,
|
|
5483
5483
|
{
|
|
5484
5484
|
type: "block",
|
|
5485
5485
|
height: import_tokens36.tokens.table.skeletonHeight,
|
|
@@ -5553,7 +5553,7 @@ function TableCards({
|
|
|
5553
5553
|
}) {
|
|
5554
5554
|
const { title, subtitle, badges, inline, sections, actions, columnsForSection } = layout;
|
|
5555
5555
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "kjun-table-cards", role: "list", "aria-label": ariaLabel, children: [
|
|
5556
|
-
initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "kjun-table-card", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5556
|
+
initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "kjun-table-card", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(KjunSkeleton, { type: "card" }) }, i)) : state.rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
5557
5557
|
"div",
|
|
5558
5558
|
{
|
|
5559
5559
|
role: "listitem",
|
|
@@ -5629,7 +5629,7 @@ function TableCards({
|
|
|
5629
5629
|
var import_react45 = require("react");
|
|
5630
5630
|
var import_tokens37 = require("@kjun-ui/tokens");
|
|
5631
5631
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5632
|
-
function
|
|
5632
|
+
function KjunTable(props) {
|
|
5633
5633
|
const {
|
|
5634
5634
|
skeletonRows = 8,
|
|
5635
5635
|
emptyText = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
@@ -5691,7 +5691,7 @@ function DsTable(props) {
|
|
|
5691
5691
|
}
|
|
5692
5692
|
);
|
|
5693
5693
|
const expand = (row, i) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5694
|
-
|
|
5694
|
+
KjunButton,
|
|
5695
5695
|
{
|
|
5696
5696
|
variant: "ghost",
|
|
5697
5697
|
size: "xs",
|
|
@@ -5723,7 +5723,7 @@ function DsTable(props) {
|
|
|
5723
5723
|
}
|
|
5724
5724
|
),
|
|
5725
5725
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5726
|
-
|
|
5726
|
+
KjunDataState,
|
|
5727
5727
|
{
|
|
5728
5728
|
queryKey: props.queryKey,
|
|
5729
5729
|
resultKey: query2.usesQueryState ? query2.hasCurrentResult ? props.queryKey : null : void 0,
|
|
@@ -5735,7 +5735,7 @@ function DsTable(props) {
|
|
|
5735
5735
|
children: [
|
|
5736
5736
|
card ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TableCards, { ...{ initialLoading: query2.initialLoading, skeletonRows, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown } }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TableGrid, { ...{ initialLoading: query2.initialLoading, skeletonRows, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, compact, striped, hoverable, ariaLabel, customClass, rowKeyDown }, sortable: props.sortable }),
|
|
5737
5737
|
pagination && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5738
|
-
|
|
5738
|
+
KjunPagination,
|
|
5739
5739
|
{
|
|
5740
5740
|
currentPage: pagination.page,
|
|
5741
5741
|
totalPages: Math.ceil(
|
|
@@ -5766,7 +5766,7 @@ var kpiFormat = (item, value = item.value) => {
|
|
|
5766
5766
|
}).format(item.semantic === "price" ? Math.abs(value) : value);
|
|
5767
5767
|
};
|
|
5768
5768
|
var kpiColor = (value, semantic, neutral = "text") => semantic === "price" && Number(value) !== 0 ? `var(--_kjun-color-price-${Number(value) > 0 ? "up" : "down"})` : `var(--_kjun-color-${neutral})`;
|
|
5769
|
-
function
|
|
5769
|
+
function KjunKpiHero(props) {
|
|
5770
5770
|
const {
|
|
5771
5771
|
loading = false,
|
|
5772
5772
|
label,
|
|
@@ -5807,10 +5807,10 @@ function DsKpiHero(props) {
|
|
|
5807
5807
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "kjun-kpi-hero__layout", children: [
|
|
5808
5808
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "kjun-kpi-hero__main", children: [
|
|
5809
5809
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kjun-kpi-hero__label", children: label }),
|
|
5810
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kjun-kpi-hero__value", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5810
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kjun-kpi-hero__value", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", height: "1lh", width: "7ch" }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
5811
5811
|
prefix && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kjun-kpi-hero__affix", children: prefix }),
|
|
5812
5812
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5813
|
-
|
|
5813
|
+
KjunAnimatedNumber,
|
|
5814
5814
|
{
|
|
5815
5815
|
value,
|
|
5816
5816
|
decimals,
|
|
@@ -5822,7 +5822,7 @@ function DsKpiHero(props) {
|
|
|
5822
5822
|
] }) }),
|
|
5823
5823
|
showDelta && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kjun-kpi-hero__delta-line", children: loading ? (
|
|
5824
5824
|
// The placeholder takes the delta numbers' line height, like Vue, so the hero keeps its loaded height.
|
|
5825
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kjun-kpi-hero__delta-abs", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5825
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kjun-kpi-hero__delta-abs", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", height: "1lh", width: import_tokens38.tokens.extensions.kpiHero.deltaSkeletonWidth }) })
|
|
5826
5826
|
) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
5827
5827
|
deltaAbsolute !== null && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5828
5828
|
"span",
|
|
@@ -5860,7 +5860,7 @@ function DsKpiHero(props) {
|
|
|
5860
5860
|
{
|
|
5861
5861
|
className: "kjun-kpi-hero__sec-value",
|
|
5862
5862
|
style: { color: kpiColor(item.value, item.semantic) },
|
|
5863
|
-
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5863
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", height: "1lh", width: "5ch" }) : (renderSecondary == null ? void 0 : renderSecondary(item, i)) || /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
5864
5864
|
item.prefix && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kjun-kpi-hero__sec-affix", children: item.prefix }),
|
|
5865
5865
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: kpiFormat(item) }),
|
|
5866
5866
|
item.suffix && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kjun-kpi-hero__sec-affix", children: item.suffix })
|
|
@@ -5872,7 +5872,7 @@ function DsKpiHero(props) {
|
|
|
5872
5872
|
{
|
|
5873
5873
|
className: "kjun-kpi-hero__sec-desc " + (item.descClass || ""),
|
|
5874
5874
|
style: { color: "var(--_kjun-color-text-tertiary)" },
|
|
5875
|
-
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5875
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", width: "7ch", height: "1lh" }) : item.desc
|
|
5876
5876
|
}
|
|
5877
5877
|
)
|
|
5878
5878
|
] }, i)) })
|
|
@@ -5880,7 +5880,7 @@ function DsKpiHero(props) {
|
|
|
5880
5880
|
}
|
|
5881
5881
|
);
|
|
5882
5882
|
}
|
|
5883
|
-
function
|
|
5883
|
+
function KjunKpiRow({
|
|
5884
5884
|
loading = false,
|
|
5885
5885
|
items,
|
|
5886
5886
|
size = "md",
|
|
@@ -5952,7 +5952,7 @@ function DsKpiRow({
|
|
|
5952
5952
|
},
|
|
5953
5953
|
children: [
|
|
5954
5954
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "kjun-kpi-row__label-row", children: [
|
|
5955
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kjun-kpi-row__label", children: busy && !item.label ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5955
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "kjun-kpi-row__label", children: busy && !item.label ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", width: import_tokens38.tokens.extensions.kpiRow.labelSkeletonWidth, height: import_tokens38.tokens.extensions.kpiRow.labelSkeletonHeight }) : item.label }),
|
|
5956
5956
|
!busy && item.badgePlacement !== "value" && badge(item)
|
|
5957
5957
|
] }),
|
|
5958
5958
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "kjun-kpi-row__value-row", children: [
|
|
@@ -5970,14 +5970,14 @@ function DsKpiRow({
|
|
|
5970
5970
|
className: (seg.class || "") + (seg.label ? " kjun-kpi-row__segment--labeled" : "") + (seg.separator ? " kjun-kpi-row__segment--separator" : ""),
|
|
5971
5971
|
children: [
|
|
5972
5972
|
seg.label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kjun-kpi-row__segment-label", children: seg.label }),
|
|
5973
|
-
busy && !seg.separator ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5973
|
+
busy && !seg.separator ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", height: "1lh", width: "3ch" }) : seg.text
|
|
5974
5974
|
]
|
|
5975
5975
|
},
|
|
5976
5976
|
j
|
|
5977
|
-
)) : busy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5977
|
+
)) : busy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", height: "1lh", width: "5ch" }) : (renderValue == null ? void 0 : renderValue(item, i)) || /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
5978
5978
|
item.prefix && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "kjun-kpi-row__affix", children: item.prefix }),
|
|
5979
5979
|
item.animated && typeof item.value === "number" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5980
|
-
|
|
5980
|
+
KjunAnimatedNumber,
|
|
5981
5981
|
{
|
|
5982
5982
|
fromPrevious: true,
|
|
5983
5983
|
value: item.value,
|
|
@@ -5997,7 +5997,7 @@ function DsKpiRow({
|
|
|
5997
5997
|
style: {
|
|
5998
5998
|
color: item.descClass ? void 0 : kpiColor(item.value, item.semantic, "text-secondary")
|
|
5999
5999
|
},
|
|
6000
|
-
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6000
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunSkeleton, { type: "block", height: "1lh", width: "7ch" }) : item.desc
|
|
6001
6001
|
}
|
|
6002
6002
|
)
|
|
6003
6003
|
]
|
|
@@ -6087,8 +6087,8 @@ function MarketIdentity({
|
|
|
6087
6087
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "kjun-market-identity-text", children: [
|
|
6088
6088
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "kjun-market-name", children: [
|
|
6089
6089
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { title: label, children: label }),
|
|
6090
|
-
((_f = props.interestKeys) == null ? void 0 : _f.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6091
|
-
((_g = props.favoriteKeys) == null ? void 0 : _g.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6090
|
+
((_f = props.interestKeys) == null ? void 0 : _f.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunCollectionMark, { kind: "interest", size: "sm", active: true }),
|
|
6091
|
+
((_g = props.favoriteKeys) == null ? void 0 : _g.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunCollectionMark, { kind: "favorite", size: "sm", active: true }),
|
|
6092
6092
|
(_h = props.renderNameSuffix) == null ? void 0 : _h.call(props, row)
|
|
6093
6093
|
] }),
|
|
6094
6094
|
(meta || props.renderSubMeta) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "kjun-market-meta", children: ((_i = props.renderSubMeta) == null ? void 0 : _i.call(props, row)) || meta })
|
|
@@ -6111,7 +6111,7 @@ function MarketFooter({
|
|
|
6111
6111
|
} = props;
|
|
6112
6112
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
6113
6113
|
pagination && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6114
|
-
|
|
6114
|
+
KjunPagination,
|
|
6115
6115
|
{
|
|
6116
6116
|
currentPage: pagination.page,
|
|
6117
6117
|
totalPages: Math.ceil(pagination.total / pagination.size),
|
|
@@ -6135,7 +6135,7 @@ function MarketFooter({
|
|
|
6135
6135
|
|
|
6136
6136
|
// packages/react/src/market-cards.tsx
|
|
6137
6137
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6138
|
-
function
|
|
6138
|
+
function KjunMarketCards(props) {
|
|
6139
6139
|
const {
|
|
6140
6140
|
rows = [],
|
|
6141
6141
|
rowKey = "id",
|
|
@@ -6186,13 +6186,13 @@ function DsMarketCards(props) {
|
|
|
6186
6186
|
metricDisplay: display
|
|
6187
6187
|
}) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
6188
6188
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6189
|
-
|
|
6189
|
+
KjunDataState,
|
|
6190
6190
|
{
|
|
6191
6191
|
...props,
|
|
6192
6192
|
loadingPadding: "none",
|
|
6193
6193
|
empty: !rows.length,
|
|
6194
|
-
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6195
|
-
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6194
|
+
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunListSkeleton, { variant: "compact" }),
|
|
6195
|
+
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
6196
6196
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { children: [
|
|
6197
6197
|
state.pill && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "kjun-market-column-label", children: state.pill.label }),
|
|
6198
6198
|
rows.map((row, i) => {
|
|
@@ -6217,21 +6217,21 @@ function DsMarketCards(props) {
|
|
|
6217
6217
|
children: [
|
|
6218
6218
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MarketIdentity, { row, props }),
|
|
6219
6219
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "kjun-market-quote", children: ((_b = state.pill) == null ? void 0 : _b.format) === "sparkline" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6220
|
-
|
|
6220
|
+
KjunSparkline,
|
|
6221
6221
|
{
|
|
6222
6222
|
data: getValue(row, state.key) || [],
|
|
6223
6223
|
width: import_tokens39.tokens.extensions.marketTable.sparklineWidth,
|
|
6224
6224
|
height: import_tokens39.tokens.extensions.marketTable.sparklineHeight
|
|
6225
6225
|
}
|
|
6226
|
-
) : state.pill ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: metricLoading(row, state.key) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6227
|
-
|
|
6226
|
+
) : state.pill ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: metricLoading(row, state.key) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunSkeleton, { type: "block", height: import_tokens39.tokens.extensions.marketTable.valueSkeletonHeight, width: import_tokens39.tokens.extensions.marketTable.valueSkeletonWidth }) : isChange && getValue(row, state.key) != null ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6227
|
+
KjunSignedValue,
|
|
6228
6228
|
{
|
|
6229
6229
|
value: finiteNumber(getValue(row, state.key)),
|
|
6230
6230
|
formatter: () => display(row),
|
|
6231
6231
|
stale: !!getValue(row, "stale"),
|
|
6232
6232
|
tone: "pill"
|
|
6233
6233
|
}
|
|
6234
|
-
) : isPrice && getValue(row, state.key) == null ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6234
|
+
) : isPrice && getValue(row, state.key) == null ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunSkeleton, { type: "block", height: import_tokens39.tokens.extensions.financial.priceSkeletonHeight, width: import_tokens39.tokens.extensions.financial.priceSkeletonWidth }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "kjun-market-metric", children: [
|
|
6235
6235
|
(_c = props.renderMetricPrefix) == null ? void 0 : _c.call(
|
|
6236
6236
|
props,
|
|
6237
6237
|
row,
|
|
@@ -6256,7 +6256,7 @@ function DsMarketCards(props) {
|
|
|
6256
6256
|
// packages/react/src/market-list.tsx
|
|
6257
6257
|
var import_tokens40 = require("@kjun-ui/tokens");
|
|
6258
6258
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6259
|
-
function
|
|
6259
|
+
function KjunMarketSimpleList(props) {
|
|
6260
6260
|
const {
|
|
6261
6261
|
rows = [],
|
|
6262
6262
|
rowKey = "id",
|
|
@@ -6270,14 +6270,14 @@ function DsMarketSimpleList(props) {
|
|
|
6270
6270
|
} = props;
|
|
6271
6271
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "kjun-market-simple-list", children: [
|
|
6272
6272
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6273
|
-
|
|
6273
|
+
KjunDataState,
|
|
6274
6274
|
{
|
|
6275
6275
|
...props,
|
|
6276
6276
|
loadingPadding: "none",
|
|
6277
6277
|
empty: !rows.length,
|
|
6278
6278
|
emptyText: emptyMessage,
|
|
6279
|
-
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6280
|
-
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6279
|
+
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunListSkeleton, {}),
|
|
6280
|
+
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
6281
6281
|
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: rows.map((row, i) => {
|
|
6282
6282
|
var _a, _b;
|
|
6283
6283
|
const price = priceValue(row), change = changeValue(row), stale = !!getValue(row, "stale"), source = String(getValue(row, "source") || ""), fetchedAt = String(getValue(row, "fetched_at") || "");
|
|
@@ -6302,7 +6302,7 @@ function DsMarketSimpleList(props) {
|
|
|
6302
6302
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MarketIdentity, { row, props }),
|
|
6303
6303
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "kjun-market-quote", children: [
|
|
6304
6304
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "kjun-market-price", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6305
|
-
|
|
6305
|
+
KjunPriceCell,
|
|
6306
6306
|
{
|
|
6307
6307
|
value: price,
|
|
6308
6308
|
formatter: priceFormatter,
|
|
@@ -6312,16 +6312,16 @@ function DsMarketSimpleList(props) {
|
|
|
6312
6312
|
) }),
|
|
6313
6313
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "kjun-market-change", children: [
|
|
6314
6314
|
price !== null && ((_b = props.renderPricePrefix) == null ? void 0 : _b.call(props, row)),
|
|
6315
|
-
(finiteNumber(price) !== null || !changeLoading(row) && finiteNumber(change) !== null) && (closingPrice && !stale ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6316
|
-
|
|
6315
|
+
(finiteNumber(price) !== null || !changeLoading(row) && finiteNumber(change) !== null) && (closingPrice && !stale ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunBadge, { variant: "secondary", size: "xs", children: "\uC885\uAC00" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6316
|
+
KjunFreshness,
|
|
6317
6317
|
{
|
|
6318
6318
|
stale,
|
|
6319
6319
|
source: closingPrice ? "close" : source,
|
|
6320
6320
|
fetchedAt
|
|
6321
6321
|
}
|
|
6322
6322
|
)),
|
|
6323
|
-
changeLoading(row) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6324
|
-
|
|
6323
|
+
changeLoading(row) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunSkeleton, { type: "block", height: import_tokens40.tokens.extensions.marketList.changeSkeletonHeight, width: import_tokens40.tokens.extensions.marketList.changeSkeletonWidth }) : change !== null ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6324
|
+
KjunSignedValue,
|
|
6325
6325
|
{
|
|
6326
6326
|
value: change,
|
|
6327
6327
|
stale,
|
|
@@ -6346,11 +6346,11 @@ function DsMarketSimpleList(props) {
|
|
|
6346
6346
|
// packages/react/src/market-panel.tsx
|
|
6347
6347
|
var import_tokens41 = require("@kjun-ui/tokens");
|
|
6348
6348
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6349
|
-
function
|
|
6349
|
+
function KjunMarketListPanel({
|
|
6350
6350
|
controls,
|
|
6351
6351
|
children
|
|
6352
6352
|
}) {
|
|
6353
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(KjunCard, { children: [
|
|
6354
6354
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: controls }),
|
|
6355
6355
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { style: { marginTop: import_tokens41.tokens.dimension.value16, borderTop: `${import_tokens41.tokens.border.defaultWidth}px solid var(--_kjun-color-border)` }, children })
|
|
6356
6356
|
] });
|
|
@@ -6376,7 +6376,7 @@ function watchTrailingOverflow(element, onChange) {
|
|
|
6376
6376
|
// packages/react/src/market-table.tsx
|
|
6377
6377
|
var import_react47 = require("react");
|
|
6378
6378
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6379
|
-
function
|
|
6379
|
+
function KjunMarketTable(props) {
|
|
6380
6380
|
const {
|
|
6381
6381
|
rows = [],
|
|
6382
6382
|
columns,
|
|
@@ -6400,13 +6400,13 @@ function DsMarketTable(props) {
|
|
|
6400
6400
|
const render = (row, col) => {
|
|
6401
6401
|
const value = getValue(row, col.key), stale = !!getValue(row, "stale");
|
|
6402
6402
|
if (cellLoading(row, col))
|
|
6403
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunSkeleton, { type: "block", height: import_tokens42.tokens.extensions.marketTable.valueSkeletonHeight, width: import_tokens42.tokens.extensions.marketTable.valueSkeletonWidth });
|
|
6404
6404
|
if (renderCell) return renderCell(row, col);
|
|
6405
6405
|
if (["stock_name", "name", "symbol"].includes(col.key))
|
|
6406
6406
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MarketIdentity, { row, props });
|
|
6407
6407
|
if (col.type === "sparkline")
|
|
6408
6408
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6409
|
-
|
|
6409
|
+
KjunSparkline,
|
|
6410
6410
|
{
|
|
6411
6411
|
data: Array.isArray(value) ? value : [],
|
|
6412
6412
|
width: import_tokens42.tokens.extensions.marketTable.sparklineWidth,
|
|
@@ -6415,7 +6415,7 @@ function DsMarketTable(props) {
|
|
|
6415
6415
|
);
|
|
6416
6416
|
if (col.type === "price")
|
|
6417
6417
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6418
|
-
|
|
6418
|
+
KjunPriceCell,
|
|
6419
6419
|
{
|
|
6420
6420
|
value: finiteNumber(value),
|
|
6421
6421
|
formatter: priceFormatter,
|
|
@@ -6425,7 +6425,7 @@ function DsMarketTable(props) {
|
|
|
6425
6425
|
);
|
|
6426
6426
|
if (col.type === "percent")
|
|
6427
6427
|
return value == null ? "-" : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6428
|
-
|
|
6428
|
+
KjunSignedValue,
|
|
6429
6429
|
{
|
|
6430
6430
|
value: finiteNumber(value),
|
|
6431
6431
|
format: "percent",
|
|
@@ -6441,7 +6441,7 @@ function DsMarketTable(props) {
|
|
|
6441
6441
|
);
|
|
6442
6442
|
const text = formatMetric ? formatMetric(value, col.type || "text", { currency, row, column: col }) : value == null ? "-" : String(value);
|
|
6443
6443
|
return ["investor", "net_amount", "net_volume"].includes(col.type || "") ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6444
|
-
|
|
6444
|
+
KjunSignedValue,
|
|
6445
6445
|
{
|
|
6446
6446
|
value: finiteNumber(value),
|
|
6447
6447
|
formatter: () => text,
|
|
@@ -6458,20 +6458,20 @@ function DsMarketTable(props) {
|
|
|
6458
6458
|
ref: domainColorRef(showActions && rows.length > 0 && !props.loading),
|
|
6459
6459
|
children: [
|
|
6460
6460
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6461
|
-
|
|
6461
|
+
KjunDataState,
|
|
6462
6462
|
{
|
|
6463
6463
|
...props,
|
|
6464
6464
|
loadingPadding: "none",
|
|
6465
6465
|
empty: !rows.length,
|
|
6466
6466
|
emptyText: emptyMessage,
|
|
6467
|
-
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6468
|
-
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6467
|
+
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunMarketTableSkeleton, { columns, showActions }),
|
|
6468
|
+
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
6469
6469
|
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "kjun-table-scroll", ref: scroller, "data-fade-end": fadeEnd || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("table", { "aria-label": "\uC2DC\uC7A5 \uB370\uC774\uD130", className: "kjun-market-table-grid", style: webMarketLayout(columns, showActions).tableStyle, children: [
|
|
6470
6470
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MarketColumns, { columns, showActions }),
|
|
6471
6471
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("tr", { children: [
|
|
6472
6472
|
showActions && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("th", { className: "kjun-market-actions", children: [
|
|
6473
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "kjun-market-actions-mark", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6474
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "kjun-market-actions-mark", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6473
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "kjun-market-actions-mark", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunCollectionMark, { kind: "interest", size: "md" }) }),
|
|
6474
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "kjun-market-actions-mark", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunCollectionMark, { kind: "favorite", size: "md" }) })
|
|
6475
6475
|
] }),
|
|
6476
6476
|
columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6477
6477
|
"th",
|
|
@@ -6489,7 +6489,7 @@ function DsMarketTable(props) {
|
|
|
6489
6489
|
children: [
|
|
6490
6490
|
col.label,
|
|
6491
6491
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6492
|
-
|
|
6492
|
+
KjunIcon,
|
|
6493
6493
|
{
|
|
6494
6494
|
name: sortKey === col.key ? sortOrder === "asc" ? "sort-ascending" : "sort-descending" : "arrows-sort",
|
|
6495
6495
|
size: import_tokens42.tokens.extensions.marketTable.sortIconSize
|
|
@@ -6517,7 +6517,7 @@ function DsMarketTable(props) {
|
|
|
6517
6517
|
children: [
|
|
6518
6518
|
showActions && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("td", { className: "kjun-market-actions", children: [
|
|
6519
6519
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6520
|
-
|
|
6520
|
+
KjunIconToggle,
|
|
6521
6521
|
{
|
|
6522
6522
|
size: "xs",
|
|
6523
6523
|
active: (_a = props.interestKeys) == null ? void 0 : _a.has(id),
|
|
@@ -6536,7 +6536,7 @@ function DsMarketTable(props) {
|
|
|
6536
6536
|
}
|
|
6537
6537
|
),
|
|
6538
6538
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6539
|
-
|
|
6539
|
+
KjunIconToggle,
|
|
6540
6540
|
{
|
|
6541
6541
|
size: "xs",
|
|
6542
6542
|
active: (_d = props.favoriteKeys) == null ? void 0 : _d.has(id),
|
|
@@ -6565,7 +6565,7 @@ function DsMarketTable(props) {
|
|
|
6565
6565
|
children: [
|
|
6566
6566
|
render(row, col),
|
|
6567
6567
|
col.key === (priceCol == null ? void 0 : priceCol.key) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6568
|
-
|
|
6568
|
+
KjunFreshness,
|
|
6569
6569
|
{
|
|
6570
6570
|
stale: !!getValue(row, "stale"),
|
|
6571
6571
|
source: String(getValue(row, "source") || ""),
|
|
@@ -6595,7 +6595,7 @@ function DsMarketTable(props) {
|
|
|
6595
6595
|
// packages/react/src/list.tsx
|
|
6596
6596
|
var import_react48 = require("react");
|
|
6597
6597
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6598
|
-
function
|
|
6598
|
+
function KjunListRow({ title, description, leading, trailing, actions, href, disabled = false, onClick }) {
|
|
6599
6599
|
const contents = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
6600
6600
|
leading && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "kjun-list-leading", children: leading }),
|
|
6601
6601
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "kjun-list-body", children: [
|
|
@@ -6610,8 +6610,8 @@ function DsListRow({ title, description, leading, trailing, actions, href, disab
|
|
|
6610
6610
|
actions && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "kjun-list-actions", "data-disabled": disabled || void 0, inert: disabled || void 0, children: actions })
|
|
6611
6611
|
] });
|
|
6612
6612
|
}
|
|
6613
|
-
function
|
|
6614
|
-
const id = (0, import_react48.useId)();
|
|
6613
|
+
function KjunListSection({ title, description, actions, children, ariaLabel }) {
|
|
6614
|
+
const id = "kjun-" + (0, import_react48.useId)();
|
|
6615
6615
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "kjun-list-section", "aria-labelledby": title ? id : void 0, "aria-label": title ? void 0 : ariaLabel, children: [
|
|
6616
6616
|
(title || description || actions) && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "kjun-list-heading", children: [
|
|
6617
6617
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
@@ -6627,7 +6627,7 @@ function DsListSection({ title, description, actions, children, ariaLabel }) {
|
|
|
6627
6627
|
// packages/react/src/app-navigation.tsx
|
|
6628
6628
|
var import_tokens43 = require("@kjun-ui/tokens");
|
|
6629
6629
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6630
|
-
function
|
|
6630
|
+
function KjunTopNavigation({ title, description, leading, actions, safeAreaTop = 0 }) {
|
|
6631
6631
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TopNavigationContext.Provider, { value: import_tokens43.tokens.extensions.topNavigation, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("header", { className: "kjun-top-navigation", style: { paddingTop: Math.max(0, safeAreaTop) }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "kjun-navigation-content", children: [
|
|
6632
6632
|
leading && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "kjun-navigation-leading", children: leading }),
|
|
6633
6633
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "kjun-navigation-title", children: [
|
|
@@ -6637,7 +6637,7 @@ function DsTopNavigation({ title, description, leading, actions, safeAreaTop = 0
|
|
|
6637
6637
|
actions && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "kjun-navigation-actions", children: actions })
|
|
6638
6638
|
] }) }) });
|
|
6639
6639
|
}
|
|
6640
|
-
function
|
|
6640
|
+
function KjunBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\uC0C9", safeAreaBottom = 0, keyboardVisible = false, hideOnKeyboard = true, onNavigate }) {
|
|
6641
6641
|
const hasIcons = items.some((item) => item.icon);
|
|
6642
6642
|
if (keyboardVisible && hideOnKeyboard) return null;
|
|
6643
6643
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("nav", { className: "kjun-bottom-navigation", "data-icons": hasIcons || void 0, "aria-label": ariaLabel, style: { paddingBottom: Math.max(0, safeAreaBottom) }, children: items.map((item) => {
|
|
@@ -6647,7 +6647,7 @@ function DsBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\uC0
|
|
|
6647
6647
|
else onNavigate == null ? void 0 : onNavigate(item.key, event);
|
|
6648
6648
|
}, children: [
|
|
6649
6649
|
hasIcons && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "kjun-navigation-icon", children: [
|
|
6650
|
-
item.icon && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6650
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(KjunIcon, { name: item.icon, size: import_tokens43.tokens.extensions.bottomNavigation.iconSize }),
|
|
6651
6651
|
badge
|
|
6652
6652
|
] }),
|
|
6653
6653
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "kjun-navigation-label", children: [
|
|
@@ -6657,7 +6657,7 @@ function DsBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\uC0
|
|
|
6657
6657
|
] }, item.key);
|
|
6658
6658
|
}) });
|
|
6659
6659
|
}
|
|
6660
|
-
function
|
|
6660
|
+
function KjunBottomActionBar({ description, children, safeAreaBottom = 0, keyboardVisible = false, hideOnKeyboard = false }) {
|
|
6661
6661
|
if (keyboardVisible && hideOnKeyboard) return null;
|
|
6662
6662
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "kjun-bottom-action-bar", style: { paddingBottom: import_tokens43.tokens.extensions.navigation.padding + Math.max(0, safeAreaBottom) }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "kjun-bottom-action-content", children: [
|
|
6663
6663
|
description && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: description }),
|
|
@@ -6669,7 +6669,7 @@ function DsBottomActionBar({ description, children, safeAreaBottom = 0, keyboard
|
|
|
6669
6669
|
var import_react49 = require("react");
|
|
6670
6670
|
var import_tokens44 = require("@kjun-ui/tokens");
|
|
6671
6671
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6672
|
-
function
|
|
6672
|
+
function KjunImage({ src, alt, decorative = false, aspectRatio = 1, fit = "cover", fallback: fallback2, lazy = true, onLoad, onError }) {
|
|
6673
6673
|
const current = (0, import_react49.useRef)({ src, version: 0 });
|
|
6674
6674
|
if (current.current.src !== src) current.current = { src, version: current.current.version + 1 };
|
|
6675
6675
|
const version = current.current.version;
|
|
@@ -6686,21 +6686,21 @@ function DsImage({ src, alt, decorative = false, aspectRatio = 1, fit = "cover",
|
|
|
6686
6686
|
setResult({ version, state: "error" });
|
|
6687
6687
|
onError == null ? void 0 : onError();
|
|
6688
6688
|
} }, version),
|
|
6689
|
-
failed && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "kjun-image-fallback", role: decorative ? void 0 : "img", "aria-label": decorative ? void 0 : alt, "aria-hidden": decorative || void 0, children: fallback2 != null ? fallback2 : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6689
|
+
failed && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "kjun-image-fallback", role: decorative ? void 0 : "img", "aria-label": decorative ? void 0 : alt, "aria-hidden": decorative || void 0, children: fallback2 != null ? fallback2 : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(KjunIcon, { name: "image", size: import_tokens44.tokens.extensions.image.fallbackIconSize }) })
|
|
6690
6690
|
] });
|
|
6691
6691
|
}
|
|
6692
|
-
function
|
|
6693
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "kjun-avatar", "data-shape": shape, "data-size": size, style: { width: import_tokens44.tokens.extensions.avatar[size], height: import_tokens44.tokens.extensions.avatar[size] }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6692
|
+
function KjunAvatar({ src, name = "", alt, decorative = false, size = "md", shape = "circle", fallback: fallback2, onLoad, onError }) {
|
|
6693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "kjun-avatar", "data-shape": shape, "data-size": size, style: { width: import_tokens44.tokens.extensions.avatar[size], height: import_tokens44.tokens.extensions.avatar[size] }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(KjunImage, { src, alt: alt || name || "\uC0AC\uC6A9\uC790", decorative, fallback: fallback2 != null ? fallback2 : Array.from(name.trim())[0] || /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(KjunIcon, { name: "user", size: import_tokens44.tokens.extensions.avatar.fallbackIconSizes[size] }), onLoad, onError }) });
|
|
6694
6694
|
}
|
|
6695
6695
|
|
|
6696
6696
|
// packages/react/src/chip.tsx
|
|
6697
6697
|
var import_tokens45 = require("@kjun-ui/tokens");
|
|
6698
6698
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6699
|
-
function
|
|
6699
|
+
function KjunChip({ label, icon, removable = false, disabled = false, size = "md", removeLabel, onRemove }) {
|
|
6700
6700
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "kjun-chip", "data-size": size, "data-disabled": disabled, "data-removable": removable, children: [
|
|
6701
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6701
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(KjunIcon, { name: icon, size: import_tokens45.tokens.extensions.chip.iconSizes[size] }),
|
|
6702
6702
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: label }),
|
|
6703
|
-
removable && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", "aria-label": removeLabel || label + " \uC0AD\uC81C", disabled, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6703
|
+
removable && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", "aria-label": removeLabel || label + " \uC0AD\uC81C", disabled, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(KjunIcon, { name: "x", size: import_tokens45.tokens.extensions.chip.removeIconSizes[size] }) })
|
|
6704
6704
|
] });
|
|
6705
6705
|
}
|
|
6706
6706
|
|
|
@@ -6746,10 +6746,10 @@ function RangeInput({ value, min = 0, max = 100, step = 1, disabled = false, lab
|
|
|
6746
6746
|
] }) })
|
|
6747
6747
|
] });
|
|
6748
6748
|
}
|
|
6749
|
-
function
|
|
6749
|
+
function KjunSlider(props) {
|
|
6750
6750
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RangeInput, { ...props });
|
|
6751
6751
|
}
|
|
6752
|
-
function
|
|
6752
|
+
function KjunRangeSlider(props) {
|
|
6753
6753
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RangeInput, { ...props });
|
|
6754
6754
|
}
|
|
6755
6755
|
|
|
@@ -6757,7 +6757,7 @@ function DsRangeSlider(props) {
|
|
|
6757
6757
|
var import_react51 = require("react");
|
|
6758
6758
|
var import_tokens47 = require("@kjun-ui/tokens");
|
|
6759
6759
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6760
|
-
function
|
|
6760
|
+
function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disabled = false, error = false, size = "md", block = false, id, ariaLabel, onValueChange, onChangeCommit, onInvalidInput }) {
|
|
6761
6761
|
const geometry = import_tokens47.tokens.extensions.compound;
|
|
6762
6762
|
const buttonStyle = { width: import_tokens47.tokens.input[size].height, padding: 0 };
|
|
6763
6763
|
const domain = (0, import_tokens47.createNumberDomain)({ min, max, step, precision });
|
|
@@ -6805,7 +6805,7 @@ function DsQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disab
|
|
|
6805
6805
|
else move(action === "increment" ? 1 : -1);
|
|
6806
6806
|
};
|
|
6807
6807
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(IconFallbacks, { icons: componentIcons, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "kjun-quantity", "data-size": size, "data-block": block, "data-error": error || !!(field == null ? void 0 : field.error), children: [
|
|
6808
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(KjunButton, { size, style: buttonStyle, variant: "ghost", ariaLabel: "\uC218\uB7C9 \uC904\uC774\uAE30", disabled: blocked || value <= min, onMouseDown: (e) => e.preventDefault(), onClick: () => move(-1), prefixIcon: "minus" }),
|
|
6809
6809
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6810
6810
|
"input",
|
|
6811
6811
|
{
|
|
@@ -6840,7 +6840,7 @@ function DsQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disab
|
|
|
6840
6840
|
"aria-required": (field == null ? void 0 : field.required) || void 0
|
|
6841
6841
|
}
|
|
6842
6842
|
),
|
|
6843
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6843
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(KjunButton, { size, style: buttonStyle, variant: "ghost", ariaLabel: "\uC218\uB7C9 \uB298\uB9AC\uAE30", disabled: blocked || max !== void 0 && value >= max, onMouseDown: (e) => e.preventDefault(), onClick: () => move(1), prefixIcon: "plus" })
|
|
6844
6844
|
] }) });
|
|
6845
6845
|
}
|
|
6846
6846
|
|
|
@@ -6848,7 +6848,7 @@ function DsQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disab
|
|
|
6848
6848
|
var import_react52 = require("react");
|
|
6849
6849
|
var import_tokens48 = require("@kjun-ui/tokens");
|
|
6850
6850
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6851
|
-
function
|
|
6851
|
+
function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1, secondStep = 1, disabled = false, error = false, clearable = true, size = "md", ariaLabel = "\uC2DC\uAC04", onValueChange, onChangeCommit }) {
|
|
6852
6852
|
const root = (0, import_react52.useRef)(null);
|
|
6853
6853
|
const field = useKjunField(), uid = (0, import_react52.useId)();
|
|
6854
6854
|
const fieldId = (field == null ? void 0 : field.id) || `kjun-time-${uid}`;
|
|
@@ -6873,7 +6873,7 @@ function DsTimePicker({ value, precision = "minute", min, max, minuteStep = 1, s
|
|
|
6873
6873
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FieldContext.Provider, { value: { ...field, id: segmentId, labelId: (field == null ? void 0 : field.labelId) ? `${field.labelId} ${labelId}` : void 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "kjun-time-segment", children: [
|
|
6874
6874
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { id: labelId, className: "kjun-sr-only", "aria-hidden": true, children: label }),
|
|
6875
6875
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6876
|
-
|
|
6876
|
+
KjunSelect,
|
|
6877
6877
|
{
|
|
6878
6878
|
value: time === null ? null : domain.part(time, index),
|
|
6879
6879
|
options: domain.options(value, index).map((n) => ({ value: n, label: String(n).padStart(2, "0") })),
|
|
@@ -6892,7 +6892,7 @@ function DsTimePicker({ value, precision = "minute", min, max, minuteStep = 1, s
|
|
|
6892
6892
|
] }) })
|
|
6893
6893
|
] }, label);
|
|
6894
6894
|
}) }) }),
|
|
6895
|
-
clearable && value !== null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6895
|
+
clearable && value !== null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(KjunButton, { className: "kjun-time-clear", size, variant: "ghost", prefixIcon: "x", ariaLabel: ariaLabel + " \uC9C0\uC6B0\uAE30", disabled: disabled || !valid, onClick: () => {
|
|
6896
6896
|
var _a, _b;
|
|
6897
6897
|
change(null);
|
|
6898
6898
|
(_b = (_a = root.current) == null ? void 0 : _a.querySelector(".kjun-select-trigger")) == null ? void 0 : _b.focus();
|