@kjun-ui/native 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 +316 -316
- package/dist/index.js +316 -316
- package/dist/index.web.cjs +316 -316
- package/dist/index.web.js +316 -316
- package/dist/styles.css +2057 -2133
- package/dist/types/packages/native/src/actions.d.cts +13 -13
- package/dist/types/packages/native/src/actions.d.ts +13 -13
- package/dist/types/packages/native/src/app-navigation.d.cts +6 -6
- package/dist/types/packages/native/src/app-navigation.d.ts +6 -6
- package/dist/types/packages/native/src/button.d.cts +3 -3
- package/dist/types/packages/native/src/button.d.ts +3 -3
- package/dist/types/packages/native/src/card.d.cts +2 -2
- package/dist/types/packages/native/src/card.d.ts +2 -2
- package/dist/types/packages/native/src/chip.d.cts +2 -2
- package/dist/types/packages/native/src/chip.d.ts +2 -2
- package/dist/types/packages/native/src/choice-controls.d.cts +8 -8
- package/dist/types/packages/native/src/choice-controls.d.ts +8 -8
- package/dist/types/packages/native/src/combobox.d.cts +2 -2
- package/dist/types/packages/native/src/combobox.d.ts +2 -2
- package/dist/types/packages/native/src/controls.d.cts +6 -6
- package/dist/types/packages/native/src/controls.d.ts +6 -6
- package/dist/types/packages/native/src/data-state.d.cts +6 -6
- package/dist/types/packages/native/src/data-state.d.ts +6 -6
- package/dist/types/packages/native/src/date-picker.d.cts +2 -2
- package/dist/types/packages/native/src/date-picker.d.ts +2 -2
- package/dist/types/packages/native/src/display-primitives.d.cts +12 -12
- package/dist/types/packages/native/src/display-primitives.d.ts +12 -12
- package/dist/types/packages/native/src/display.d.cts +6 -6
- package/dist/types/packages/native/src/display.d.ts +6 -6
- package/dist/types/packages/native/src/drawer.d.cts +2 -2
- package/dist/types/packages/native/src/drawer.d.ts +2 -2
- package/dist/types/packages/native/src/dropdown.d.cts +12 -12
- package/dist/types/packages/native/src/dropdown.d.ts +12 -12
- package/dist/types/packages/native/src/financial-display.d.cts +12 -12
- package/dist/types/packages/native/src/financial-display.d.ts +12 -12
- package/dist/types/packages/native/src/financial.d.cts +4 -4
- package/dist/types/packages/native/src/financial.d.ts +4 -4
- package/dist/types/packages/native/src/index.d.cts +22 -22
- package/dist/types/packages/native/src/index.d.ts +22 -22
- package/dist/types/packages/native/src/input.d.cts +5 -5
- package/dist/types/packages/native/src/input.d.ts +5 -5
- package/dist/types/packages/native/src/kpi-hero.d.cts +2 -2
- package/dist/types/packages/native/src/kpi-hero.d.ts +2 -2
- package/dist/types/packages/native/src/kpi-row.d.cts +2 -2
- package/dist/types/packages/native/src/kpi-row.d.ts +2 -2
- package/dist/types/packages/native/src/kpi.d.cts +4 -4
- package/dist/types/packages/native/src/kpi.d.ts +4 -4
- package/dist/types/packages/native/src/layers.d.cts +6 -6
- package/dist/types/packages/native/src/layers.d.ts +6 -6
- package/dist/types/packages/native/src/list.d.cts +4 -4
- package/dist/types/packages/native/src/list.d.ts +4 -4
- package/dist/types/packages/native/src/market-cards.d.cts +2 -2
- package/dist/types/packages/native/src/market-cards.d.ts +2 -2
- package/dist/types/packages/native/src/market-list.d.cts +2 -2
- package/dist/types/packages/native/src/market-list.d.ts +2 -2
- package/dist/types/packages/native/src/market-model.d.cts +4 -4
- package/dist/types/packages/native/src/market-model.d.ts +4 -4
- package/dist/types/packages/native/src/market-panel.d.cts +1 -1
- package/dist/types/packages/native/src/market-panel.d.ts +1 -1
- package/dist/types/packages/native/src/market-skeleton.d.cts +2 -2
- package/dist/types/packages/native/src/market-skeleton.d.ts +2 -2
- package/dist/types/packages/native/src/market-table.d.cts +2 -2
- package/dist/types/packages/native/src/market-table.d.ts +2 -2
- package/dist/types/packages/native/src/market.d.cts +5 -5
- package/dist/types/packages/native/src/market.d.ts +5 -5
- package/dist/types/packages/native/src/media.d.cts +4 -4
- package/dist/types/packages/native/src/media.d.ts +4 -4
- package/dist/types/packages/native/src/modal.d.cts +4 -4
- package/dist/types/packages/native/src/modal.d.ts +4 -4
- package/dist/types/packages/native/src/navigation.d.cts +9 -9
- package/dist/types/packages/native/src/navigation.d.ts +9 -9
- package/dist/types/packages/native/src/number-display.d.cts +8 -8
- package/dist/types/packages/native/src/number-display.d.ts +8 -8
- package/dist/types/packages/native/src/popover.d.cts +4 -4
- package/dist/types/packages/native/src/popover.d.ts +4 -4
- package/dist/types/packages/native/src/quantity-stepper.d.cts +2 -2
- package/dist/types/packages/native/src/quantity-stepper.d.ts +2 -2
- package/dist/types/packages/native/src/range-input.d.cts +4 -4
- package/dist/types/packages/native/src/range-input.d.ts +4 -4
- package/dist/types/packages/native/src/search-input.d.cts +2 -2
- package/dist/types/packages/native/src/search-input.d.ts +2 -2
- package/dist/types/packages/native/src/select-control.d.cts +2 -2
- package/dist/types/packages/native/src/select-control.d.ts +2 -2
- package/dist/types/packages/native/src/select.d.cts +8 -8
- package/dist/types/packages/native/src/select.d.ts +8 -8
- package/dist/types/packages/native/src/selection-groups.d.cts +4 -4
- package/dist/types/packages/native/src/selection-groups.d.ts +4 -4
- package/dist/types/packages/native/src/skeleton-base.d.cts +2 -2
- package/dist/types/packages/native/src/skeleton-base.d.ts +2 -2
- package/dist/types/packages/native/src/skeletons.d.cts +8 -8
- package/dist/types/packages/native/src/skeletons.d.ts +8 -8
- package/dist/types/packages/native/src/table-model.d.cts +2 -2
- package/dist/types/packages/native/src/table-model.d.ts +2 -2
- package/dist/types/packages/native/src/table-view.d.cts +2 -2
- package/dist/types/packages/native/src/table-view.d.ts +2 -2
- package/dist/types/packages/native/src/table.d.cts +2 -2
- package/dist/types/packages/native/src/table.d.ts +2 -2
- package/dist/types/packages/native/src/tabs.d.cts +4 -4
- package/dist/types/packages/native/src/tabs.d.ts +4 -4
- package/dist/types/packages/native/src/textarea.d.cts +2 -2
- package/dist/types/packages/native/src/textarea.d.ts +2 -2
- package/dist/types/packages/native/src/time-picker.d.cts +2 -2
- package/dist/types/packages/native/src/time-picker.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -30,86 +30,86 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// packages/native/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
|
-
DsFormLayout: () => DsFormLayout,
|
|
66
|
-
DsFormSkeleton: () => DsFormSkeleton,
|
|
67
|
-
DsFreshness: () => DsFreshness,
|
|
68
|
-
DsHeatmapCell: () => DsHeatmapCell,
|
|
69
|
-
DsIcon: () => DsIcon,
|
|
70
|
-
DsIconToggle: () => DsIconToggle,
|
|
71
|
-
DsImage: () => DsImage,
|
|
72
|
-
DsInput: () => DsInput,
|
|
73
|
-
DsKpiHero: () => DsKpiHero,
|
|
74
|
-
DsKpiRow: () => DsKpiRow,
|
|
75
|
-
DsListRow: () => DsListRow,
|
|
76
|
-
DsListSection: () => DsListSection,
|
|
77
|
-
DsListSkeleton: () => DsListSkeleton,
|
|
78
|
-
DsMarketCards: () => DsMarketCards,
|
|
79
|
-
DsMarketListPanel: () => DsMarketListPanel,
|
|
80
|
-
DsMarketSimpleList: () => DsMarketSimpleList,
|
|
81
|
-
DsMarketTable: () => DsMarketTable,
|
|
82
|
-
DsMarketTableSkeleton: () => DsMarketTableSkeleton,
|
|
83
|
-
DsMenuButton: () => DsMenuButton,
|
|
84
|
-
DsModal: () => DsModal,
|
|
85
|
-
DsPagination: () => DsPagination,
|
|
86
|
-
DsPopover: () => DsPopover,
|
|
87
|
-
DsPriceCell: () => DsPriceCell,
|
|
88
|
-
DsProgress: () => DsProgress,
|
|
89
|
-
DsProgressCell: () => DsProgressCell,
|
|
90
|
-
DsQuantityStepper: () => DsQuantityStepper,
|
|
91
|
-
DsRadio: () => DsRadio,
|
|
92
|
-
DsRadioGroup: () => DsRadioGroup,
|
|
93
|
-
DsRangeSlider: () => DsRangeSlider,
|
|
94
|
-
DsRefreshButton: () => DsRefreshButton,
|
|
95
|
-
DsScrollFade: () => DsScrollFade,
|
|
96
|
-
DsSearchInput: () => DsSearchInput,
|
|
97
|
-
DsSelect: () => DsSelect,
|
|
98
|
-
DsSignedValue: () => DsSignedValue,
|
|
99
|
-
DsSkeleton: () => DsSkeleton,
|
|
100
|
-
DsSlider: () => DsSlider,
|
|
101
|
-
DsSparkline: () => DsSparkline,
|
|
102
|
-
DsSpinner: () => DsSpinner,
|
|
103
|
-
DsSwitch: () => DsSwitch,
|
|
104
|
-
DsTabPane: () => DsTabPane,
|
|
105
|
-
DsTable: () => DsTable,
|
|
106
|
-
DsTabs: () => DsTabs,
|
|
107
|
-
DsTextarea: () => DsTextarea,
|
|
108
|
-
DsTimePicker: () => DsTimePicker,
|
|
109
|
-
DsTooltip: () => DsTooltip,
|
|
110
|
-
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,
|
|
111
62
|
KjunFeedbackProvider: () => KjunFeedbackProvider,
|
|
63
|
+
KjunFilterGroup: () => KjunFilterGroup,
|
|
64
|
+
KjunFormActions: () => KjunFormActions,
|
|
65
|
+
KjunFormGroup: () => KjunFormGroup,
|
|
66
|
+
KjunFormLayout: () => KjunFormLayout,
|
|
67
|
+
KjunFormSkeleton: () => KjunFormSkeleton,
|
|
68
|
+
KjunFreshness: () => KjunFreshness,
|
|
69
|
+
KjunHeatmapCell: () => KjunHeatmapCell,
|
|
70
|
+
KjunIcon: () => KjunIcon,
|
|
71
|
+
KjunIconToggle: () => KjunIconToggle,
|
|
72
|
+
KjunImage: () => KjunImage,
|
|
73
|
+
KjunInput: () => KjunInput,
|
|
74
|
+
KjunKpiHero: () => KjunKpiHero,
|
|
75
|
+
KjunKpiRow: () => KjunKpiRow,
|
|
76
|
+
KjunListRow: () => KjunListRow,
|
|
77
|
+
KjunListSection: () => KjunListSection,
|
|
78
|
+
KjunListSkeleton: () => KjunListSkeleton,
|
|
79
|
+
KjunMarketCards: () => KjunMarketCards,
|
|
80
|
+
KjunMarketListPanel: () => KjunMarketListPanel,
|
|
81
|
+
KjunMarketSimpleList: () => KjunMarketSimpleList,
|
|
82
|
+
KjunMarketTable: () => KjunMarketTable,
|
|
83
|
+
KjunMarketTableSkeleton: () => KjunMarketTableSkeleton,
|
|
84
|
+
KjunMenuButton: () => KjunMenuButton,
|
|
85
|
+
KjunModal: () => KjunModal,
|
|
86
|
+
KjunPagination: () => KjunPagination,
|
|
87
|
+
KjunPopover: () => KjunPopover,
|
|
88
|
+
KjunPriceCell: () => KjunPriceCell,
|
|
89
|
+
KjunProgress: () => KjunProgress,
|
|
90
|
+
KjunProgressCell: () => KjunProgressCell,
|
|
112
91
|
KjunProvider: () => KjunProvider,
|
|
92
|
+
KjunQuantityStepper: () => KjunQuantityStepper,
|
|
93
|
+
KjunRadio: () => KjunRadio,
|
|
94
|
+
KjunRadioGroup: () => KjunRadioGroup,
|
|
95
|
+
KjunRangeSlider: () => KjunRangeSlider,
|
|
96
|
+
KjunRefreshButton: () => KjunRefreshButton,
|
|
97
|
+
KjunScrollFade: () => KjunScrollFade,
|
|
98
|
+
KjunSearchInput: () => KjunSearchInput,
|
|
99
|
+
KjunSelect: () => KjunSelect,
|
|
100
|
+
KjunSignedValue: () => KjunSignedValue,
|
|
101
|
+
KjunSkeleton: () => KjunSkeleton,
|
|
102
|
+
KjunSlider: () => KjunSlider,
|
|
103
|
+
KjunSparkline: () => KjunSparkline,
|
|
104
|
+
KjunSpinner: () => KjunSpinner,
|
|
105
|
+
KjunSwitch: () => KjunSwitch,
|
|
106
|
+
KjunTabPane: () => KjunTabPane,
|
|
107
|
+
KjunTable: () => KjunTable,
|
|
108
|
+
KjunTabs: () => KjunTabs,
|
|
109
|
+
KjunTextarea: () => KjunTextarea,
|
|
110
|
+
KjunTimePicker: () => KjunTimePicker,
|
|
111
|
+
KjunTooltip: () => KjunTooltip,
|
|
112
|
+
KjunTopNavigation: () => KjunTopNavigation,
|
|
113
113
|
useKjunFeedback: () => useKjunFeedback,
|
|
114
114
|
useKjunStyles: () => useKjunStyles
|
|
115
115
|
});
|
|
@@ -654,7 +654,7 @@ var AccessiblePressable = (0, import_react11.forwardRef)(
|
|
|
654
654
|
|
|
655
655
|
// packages/native/src/button.tsx
|
|
656
656
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
657
|
-
function
|
|
657
|
+
function KjunIcon({
|
|
658
658
|
name,
|
|
659
659
|
size = import_tokens5.tokens.iconSizes.default,
|
|
660
660
|
color,
|
|
@@ -759,7 +759,7 @@ function useMinimumLoading(loading) {
|
|
|
759
759
|
}, [loading]);
|
|
760
760
|
return loading || active;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function KjunButton(input) {
|
|
763
763
|
var _a, _b;
|
|
764
764
|
const {
|
|
765
765
|
children,
|
|
@@ -869,7 +869,7 @@ function DsButton(input) {
|
|
|
869
869
|
const color = paint(pressed, hovered && import_react_native3.Platform.OS === "web").ink;
|
|
870
870
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
871
871
|
before && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
872
|
-
|
|
872
|
+
KjunIcon,
|
|
873
873
|
{
|
|
874
874
|
name: before,
|
|
875
875
|
filled: !busy && prefixIconFilled,
|
|
@@ -886,7 +886,7 @@ function DsButton(input) {
|
|
|
886
886
|
...multiline || navigation ? { flexShrink: 1, minWidth: 0, textAlign: "center" } : {}
|
|
887
887
|
}, children }),
|
|
888
888
|
suffixIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native3.View, { style: { opacity: busy && prefixIcon ? 0 : 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
889
|
-
|
|
889
|
+
KjunIcon,
|
|
890
890
|
{
|
|
891
891
|
name: busy && !prefixIcon ? "loader-2" : suffixIcon,
|
|
892
892
|
filled: !busy && suffixIconFilled,
|
|
@@ -903,7 +903,7 @@ function DsButton(input) {
|
|
|
903
903
|
right: 0,
|
|
904
904
|
alignItems: "center",
|
|
905
905
|
justifyContent: "center"
|
|
906
|
-
}, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
906
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KjunIcon, { name: "loader-2", spin: true, size: iconSize, color }) })
|
|
907
907
|
] });
|
|
908
908
|
}
|
|
909
909
|
}
|
|
@@ -943,7 +943,7 @@ function FieldClear({ size, disabled, label, onPress }) {
|
|
|
943
943
|
alignItems: "center",
|
|
944
944
|
justifyContent: "center",
|
|
945
945
|
backgroundColor: disabled ? "transparent" : pressed ? colors.active : hovered ? colors.hover : "transparent"
|
|
946
|
-
}, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
946
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(KjunIcon, { name: "x", size: spec.iconSize, color: disabled ? colors.textDisabled : colors.textSecondary }) })
|
|
947
947
|
}
|
|
948
948
|
);
|
|
949
949
|
}
|
|
@@ -1110,7 +1110,7 @@ var import_react_native8 = require("react-native");
|
|
|
1110
1110
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1111
1111
|
var FieldContext = (0, import_react16.createContext)(null);
|
|
1112
1112
|
var useKjunField = () => (0, import_react16.useContext)(FieldContext);
|
|
1113
|
-
function
|
|
1113
|
+
function KjunFormGroup({
|
|
1114
1114
|
label,
|
|
1115
1115
|
id,
|
|
1116
1116
|
required = false,
|
|
@@ -1154,7 +1154,7 @@ function DsFormGroup({
|
|
|
1154
1154
|
marginTop: import_tokens9.tokens.extensions.form.messageGap
|
|
1155
1155
|
},
|
|
1156
1156
|
children: [
|
|
1157
|
-
!!error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1157
|
+
!!error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(KjunIcon, { name: "alert-circle", size: import_tokens9.tokens.extensions.form.messageIconSize, color: c.danger }),
|
|
1158
1158
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1159
1159
|
import_react_native8.Text,
|
|
1160
1160
|
{
|
|
@@ -1176,7 +1176,7 @@ function DsFormGroup({
|
|
|
1176
1176
|
}
|
|
1177
1177
|
);
|
|
1178
1178
|
}
|
|
1179
|
-
var
|
|
1179
|
+
var KjunInput = (0, import_react16.forwardRef)(function KjunInput2({
|
|
1180
1180
|
value,
|
|
1181
1181
|
size = "md",
|
|
1182
1182
|
error = false,
|
|
@@ -1290,7 +1290,7 @@ var DsInput = (0, import_react16.forwardRef)(function DsInput2({
|
|
|
1290
1290
|
justifyContent: "center"
|
|
1291
1291
|
},
|
|
1292
1292
|
children: prefix || /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1293
|
-
|
|
1293
|
+
KjunIcon,
|
|
1294
1294
|
{
|
|
1295
1295
|
name: prefixIcon,
|
|
1296
1296
|
size: spec.iconSize,
|
|
@@ -1321,7 +1321,7 @@ var DsInput = (0, import_react16.forwardRef)(function DsInput2({
|
|
|
1321
1321
|
(_a = input.current) == null ? void 0 : _a.focus();
|
|
1322
1322
|
} }),
|
|
1323
1323
|
suffix || suffixIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1324
|
-
|
|
1324
|
+
KjunIcon,
|
|
1325
1325
|
{
|
|
1326
1326
|
name: suffixIcon,
|
|
1327
1327
|
size: spec.iconSize,
|
|
@@ -1348,13 +1348,13 @@ var DsInput = (0, import_react16.forwardRef)(function DsInput2({
|
|
|
1348
1348
|
)
|
|
1349
1349
|
] });
|
|
1350
1350
|
});
|
|
1351
|
-
function
|
|
1351
|
+
function KjunFormLayout({
|
|
1352
1352
|
children,
|
|
1353
1353
|
gap = import_tokens9.tokens.extensions.form.itemGap
|
|
1354
1354
|
}) {
|
|
1355
1355
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native8.View, { style: { gap }, children: import_react16.Children.map(
|
|
1356
1356
|
children,
|
|
1357
|
-
(child) => (0, import_react16.isValidElement)(child) && child.type ===
|
|
1357
|
+
(child) => (0, import_react16.isValidElement)(child) && child.type === KjunFormGroup ? (0, import_react16.cloneElement)(child, {
|
|
1358
1358
|
style: [{ marginBottom: 0 }, child.props.style]
|
|
1359
1359
|
}) : child
|
|
1360
1360
|
) });
|
|
@@ -1406,7 +1406,7 @@ function ScopedNativeModal({ children, visible, ...props }) {
|
|
|
1406
1406
|
const entry = scope ? layers.entries.get(scope) : void 0;
|
|
1407
1407
|
const generation = (_a = entry == null ? void 0 : entry.order) != null ? _a : 0;
|
|
1408
1408
|
const inactive = !!scope && !layers.isActive(scope);
|
|
1409
|
-
const host = (0, import_react17.useContext)(FeedbackOverlayContext), id = (0, import_react17.useId)(), register = host == null ? void 0 : host.register;
|
|
1409
|
+
const host = (0, import_react17.useContext)(FeedbackOverlayContext), id = "kjun-" + (0, import_react17.useId)(), register = host == null ? void 0 : host.register;
|
|
1410
1410
|
(0, import_react17.useEffect)(
|
|
1411
1411
|
() => visible && register ? register(id) : void 0,
|
|
1412
1412
|
[visible, register, id, generation]
|
|
@@ -1438,7 +1438,7 @@ function ScopedNativeModal({ children, visible, ...props }) {
|
|
|
1438
1438
|
|
|
1439
1439
|
// packages/native/src/modal.tsx
|
|
1440
1440
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1441
|
-
function
|
|
1441
|
+
function KjunFormActions({
|
|
1442
1442
|
size = "lg",
|
|
1443
1443
|
cancelText = "\uCDE8\uC18C",
|
|
1444
1444
|
confirmText = "\uC800\uC7A5",
|
|
@@ -1497,7 +1497,7 @@ function DsFormActions({
|
|
|
1497
1497
|
}
|
|
1498
1498
|
),
|
|
1499
1499
|
showCancel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1500
|
-
|
|
1500
|
+
KjunButton,
|
|
1501
1501
|
{
|
|
1502
1502
|
size,
|
|
1503
1503
|
variant: cancelVariant,
|
|
@@ -1507,7 +1507,7 @@ function DsFormActions({
|
|
|
1507
1507
|
}
|
|
1508
1508
|
),
|
|
1509
1509
|
showConfirm && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1510
|
-
|
|
1510
|
+
KjunButton,
|
|
1511
1511
|
{
|
|
1512
1512
|
size,
|
|
1513
1513
|
variant,
|
|
@@ -1521,7 +1521,7 @@ function DsFormActions({
|
|
|
1521
1521
|
}
|
|
1522
1522
|
) });
|
|
1523
1523
|
}
|
|
1524
|
-
function
|
|
1524
|
+
function KjunModal({
|
|
1525
1525
|
open,
|
|
1526
1526
|
onOpenChange,
|
|
1527
1527
|
onClose,
|
|
@@ -1662,14 +1662,14 @@ function DsModal({
|
|
|
1662
1662
|
}
|
|
1663
1663
|
) }),
|
|
1664
1664
|
closable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1665
|
-
|
|
1665
|
+
KjunButton,
|
|
1666
1666
|
{
|
|
1667
1667
|
variant: "ghost",
|
|
1668
1668
|
size: "sm",
|
|
1669
1669
|
ariaLabel: "\uB2EB\uAE30",
|
|
1670
1670
|
onPress: close,
|
|
1671
1671
|
style: { borderRadius: import_tokens10.tokens.modal.closeRadius, width: import_tokens10.tokens.modal.closeSize, height: import_tokens10.tokens.modal.closeSize, paddingHorizontal: 0, paddingVertical: 0 },
|
|
1672
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(KjunIcon, { name: "x", size: import_tokens10.tokens.modal.closeIconSize })
|
|
1673
1673
|
}
|
|
1674
1674
|
)
|
|
1675
1675
|
]
|
|
@@ -1698,7 +1698,7 @@ function DsModal({
|
|
|
1698
1698
|
borderTopColor: c.border
|
|
1699
1699
|
},
|
|
1700
1700
|
children: footer || /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1701
|
-
|
|
1701
|
+
KjunFormActions,
|
|
1702
1702
|
{
|
|
1703
1703
|
size: footerSize,
|
|
1704
1704
|
cancelVariant: "secondary",
|
|
@@ -1747,7 +1747,7 @@ function hasContent(node) {
|
|
|
1747
1747
|
|
|
1748
1748
|
// packages/native/src/card.tsx
|
|
1749
1749
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1750
|
-
function
|
|
1750
|
+
function KjunCard({
|
|
1751
1751
|
title,
|
|
1752
1752
|
subtitle,
|
|
1753
1753
|
header,
|
|
@@ -1765,7 +1765,7 @@ function DsCard({
|
|
|
1765
1765
|
style
|
|
1766
1766
|
}) {
|
|
1767
1767
|
const { colors } = useKjunStyles();
|
|
1768
|
-
const id = (0, import_react20.useId)().replace(/[^a-z0-9]/gi, "");
|
|
1768
|
+
const id = "kjun-" + (0, import_react20.useId)().replace(/[^a-z0-9]/gi, "");
|
|
1769
1769
|
const inset = import_tokens11.tokens.card.padding[padding], bodyInset = import_tokens11.tokens.card.padding[bodyPadding];
|
|
1770
1770
|
const corner = import_tokens11.tokens.card.radii[radius];
|
|
1771
1771
|
const paint = import_tokens11.tokens.cardSurfaces[surface];
|
|
@@ -1833,7 +1833,7 @@ var import_react21 = require("react");
|
|
|
1833
1833
|
var import_react_native15 = require("react-native");
|
|
1834
1834
|
var import_react_native_svg3 = __toESM(require("react-native-svg"), 1);
|
|
1835
1835
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1836
|
-
function
|
|
1836
|
+
function KjunBadge(props) {
|
|
1837
1837
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(BadgeView, { ...props });
|
|
1838
1838
|
}
|
|
1839
1839
|
function BadgeView({
|
|
@@ -1895,7 +1895,7 @@ function BadgeView({
|
|
|
1895
1895
|
}
|
|
1896
1896
|
);
|
|
1897
1897
|
}
|
|
1898
|
-
function
|
|
1898
|
+
function KjunEmpty({
|
|
1899
1899
|
text = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
1900
1900
|
description,
|
|
1901
1901
|
icon,
|
|
@@ -1913,7 +1913,7 @@ function DsEmpty({
|
|
|
1913
1913
|
paddingVertical: stateContent === "empty" ? 0 : import_tokens12.tokens.dimension.value32
|
|
1914
1914
|
},
|
|
1915
1915
|
children: [
|
|
1916
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native15.View, { style: { marginBottom: spec.iconGap }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1916
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native15.View, { style: { marginBottom: spec.iconGap }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(KjunIcon, { name: icon, size: spec.iconSize, color: colors.textSecondary }) }),
|
|
1917
1917
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(KText, { style: { ...typeStyle("cardTitle"), color: colors.text, fontSize: spec.titleSize, lineHeight: spec.titleLineHeight, textAlign: "center", maxWidth: spec.textMaxWidth }, children: text }),
|
|
1918
1918
|
description && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1919
1919
|
KText,
|
|
@@ -1935,7 +1935,7 @@ function DsEmpty({
|
|
|
1935
1935
|
}
|
|
1936
1936
|
);
|
|
1937
1937
|
}
|
|
1938
|
-
function
|
|
1938
|
+
function KjunSpinner({ size = "md", text }) {
|
|
1939
1939
|
const { colors } = useKjunStyles(), reduced = useReducedMotion(), rotation = (0, import_react21.useRef)(new import_react_native15.Animated.Value(0)).current;
|
|
1940
1940
|
(0, import_react21.useEffect)(() => {
|
|
1941
1941
|
if (reduced) return;
|
|
@@ -2013,7 +2013,7 @@ function DsSpinner({ size = "md", text }) {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
);
|
|
2015
2015
|
}
|
|
2016
|
-
function
|
|
2016
|
+
function KjunAlert({
|
|
2017
2017
|
type = "info",
|
|
2018
2018
|
variant,
|
|
2019
2019
|
size = "md",
|
|
@@ -2049,7 +2049,7 @@ function DsAlert({
|
|
|
2049
2049
|
},
|
|
2050
2050
|
children: [
|
|
2051
2051
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native15.View, { style: { height: lineHeight, justifyContent: "center", flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2052
|
-
|
|
2052
|
+
KjunIcon,
|
|
2053
2053
|
{
|
|
2054
2054
|
name: {
|
|
2055
2055
|
info: "info-circle",
|
|
@@ -2093,7 +2093,7 @@ function DsAlert({
|
|
|
2093
2093
|
onClose == null ? void 0 : onClose();
|
|
2094
2094
|
},
|
|
2095
2095
|
children: ({ pressed, hovered }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2096
|
-
|
|
2096
|
+
KjunIcon,
|
|
2097
2097
|
{
|
|
2098
2098
|
name: "x",
|
|
2099
2099
|
size: geometry2.closeIconSize,
|
|
@@ -2106,7 +2106,7 @@ function DsAlert({
|
|
|
2106
2106
|
}
|
|
2107
2107
|
);
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function KjunProgress({
|
|
2110
2110
|
value = 0,
|
|
2111
2111
|
max = 100,
|
|
2112
2112
|
size = "md",
|
|
@@ -2185,7 +2185,7 @@ var import_tokens13 = require("@kjun-ui/tokens");
|
|
|
2185
2185
|
var import_react22 = require("react");
|
|
2186
2186
|
var import_react_native16 = require("react-native");
|
|
2187
2187
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2188
|
-
function
|
|
2188
|
+
function KjunSkeleton({
|
|
2189
2189
|
type = "text",
|
|
2190
2190
|
rows = 3,
|
|
2191
2191
|
columns = 4,
|
|
@@ -2561,7 +2561,7 @@ function ToastView({
|
|
|
2561
2561
|
overflow: "hidden"
|
|
2562
2562
|
},
|
|
2563
2563
|
children: [
|
|
2564
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(KjunIcon, { name: icon, color: colors[`${tone}Accent`] }),
|
|
2565
2565
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native17.View, { style: { flex: 1, minWidth: 0 }, children: [
|
|
2566
2566
|
toast.title && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(KText, { style: { fontWeight: typeStyle("control").fontWeight, marginBottom: import_tokens15.tokens.extensions.toast.titleGap }, children: toast.title }),
|
|
2567
2567
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(KText, { style: { color: colors.textSecondary }, children: toast.message }),
|
|
@@ -2609,7 +2609,7 @@ function ToastView({
|
|
|
2609
2609
|
justifyContent: "center",
|
|
2610
2610
|
borderRadius: import_tokens15.tokens.extensions.toast.closeRadius
|
|
2611
2611
|
},
|
|
2612
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(KjunIcon, { name: "x", color: colors.textTertiary })
|
|
2613
2613
|
}
|
|
2614
2614
|
),
|
|
2615
2615
|
toast.showProgress !== false && !!toast.duration && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
@@ -2724,7 +2724,7 @@ function FeedbackDialog({
|
|
|
2724
2724
|
}) {
|
|
2725
2725
|
const { options, value, error, busy, edit, cancel, submit } = useFeedbackDialog(controller, request);
|
|
2726
2726
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2727
|
-
|
|
2727
|
+
KjunModal,
|
|
2728
2728
|
{
|
|
2729
2729
|
open,
|
|
2730
2730
|
onOpenChange: (open2) => {
|
|
@@ -2743,7 +2743,7 @@ function FeedbackDialog({
|
|
|
2743
2743
|
children: [
|
|
2744
2744
|
options.message && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(KText, { style: { marginBottom: import_tokens17.tokens.dimension.value16 }, children: options.message }),
|
|
2745
2745
|
request.kind === "prompt" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2746
|
-
|
|
2746
|
+
KjunInput,
|
|
2747
2747
|
{
|
|
2748
2748
|
autoFocus: true,
|
|
2749
2749
|
value,
|
|
@@ -2812,7 +2812,7 @@ var import_tokens18 = require("@kjun-ui/tokens");
|
|
|
2812
2812
|
var import_react29 = require("react");
|
|
2813
2813
|
var import_react_native21 = require("react-native");
|
|
2814
2814
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2815
|
-
function
|
|
2815
|
+
function KjunCheckbox({
|
|
2816
2816
|
value,
|
|
2817
2817
|
val,
|
|
2818
2818
|
label,
|
|
@@ -2861,7 +2861,7 @@ function DsCheckbox({
|
|
|
2861
2861
|
backgroundColor: checked ? colors.brand : colors.surface
|
|
2862
2862
|
},
|
|
2863
2863
|
children: checked && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2864
|
-
|
|
2864
|
+
KjunIcon,
|
|
2865
2865
|
{
|
|
2866
2866
|
name: "check",
|
|
2867
2867
|
size: import_tokens18.tokens.extensions.checkbox.iconSizes[size],
|
|
@@ -2890,7 +2890,7 @@ function useControlFocus(disabled) {
|
|
|
2890
2890
|
ring: focused && !disabled ? { outlineStyle: "solid", outlineWidth: import_tokens18.tokens.states.focus.width, outlineOffset: import_tokens18.tokens.states.focus.choiceOffset, outlineColor: colors.focusRing } : {}
|
|
2891
2891
|
};
|
|
2892
2892
|
}
|
|
2893
|
-
function
|
|
2893
|
+
function KjunSwitch({
|
|
2894
2894
|
value,
|
|
2895
2895
|
label,
|
|
2896
2896
|
ariaLabel,
|
|
@@ -2990,7 +2990,7 @@ function DsSwitch({
|
|
|
2990
2990
|
);
|
|
2991
2991
|
}
|
|
2992
2992
|
var RadioContext = (0, import_react29.createContext)(null);
|
|
2993
|
-
function
|
|
2993
|
+
function KjunRadio({
|
|
2994
2994
|
value,
|
|
2995
2995
|
val,
|
|
2996
2996
|
label,
|
|
@@ -3066,7 +3066,7 @@ function DsRadio({
|
|
|
3066
3066
|
}
|
|
3067
3067
|
);
|
|
3068
3068
|
}
|
|
3069
|
-
function
|
|
3069
|
+
function KjunRadioGroup({
|
|
3070
3070
|
value,
|
|
3071
3071
|
options = [],
|
|
3072
3072
|
direction = "horizontal",
|
|
@@ -3099,7 +3099,7 @@ function DsRadioGroup({
|
|
|
3099
3099
|
gap: direction === "vertical" ? import_tokens18.tokens.dimension.value8 : import_tokens18.tokens.dimension.value16
|
|
3100
3100
|
},
|
|
3101
3101
|
children: children || options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3102
|
-
|
|
3102
|
+
KjunRadio,
|
|
3103
3103
|
{
|
|
3104
3104
|
val: option.value,
|
|
3105
3105
|
label: option.label,
|
|
@@ -3201,7 +3201,7 @@ function ButtonGroupLabel({ label, active, size, reduced }) {
|
|
|
3201
3201
|
|
|
3202
3202
|
// packages/native/src/selection-groups.tsx
|
|
3203
3203
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3204
|
-
function
|
|
3204
|
+
function KjunButtonGroup({
|
|
3205
3205
|
value,
|
|
3206
3206
|
options,
|
|
3207
3207
|
size = "md",
|
|
@@ -3302,7 +3302,7 @@ function DsButtonGroup({
|
|
|
3302
3302
|
}),
|
|
3303
3303
|
children: [
|
|
3304
3304
|
option.icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3305
|
-
|
|
3305
|
+
KjunIcon,
|
|
3306
3306
|
{
|
|
3307
3307
|
name: option.icon,
|
|
3308
3308
|
size: import_tokens20.tokens.extensions.selection.iconSize,
|
|
@@ -3329,7 +3329,7 @@ function DsButtonGroup({
|
|
|
3329
3329
|
}
|
|
3330
3330
|
);
|
|
3331
3331
|
}
|
|
3332
|
-
function
|
|
3332
|
+
function KjunFilterGroup({
|
|
3333
3333
|
value,
|
|
3334
3334
|
options,
|
|
3335
3335
|
size = "sm",
|
|
@@ -3399,7 +3399,7 @@ function DsFilterGroup({
|
|
|
3399
3399
|
}
|
|
3400
3400
|
),
|
|
3401
3401
|
option.icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3402
|
-
|
|
3402
|
+
KjunIcon,
|
|
3403
3403
|
{
|
|
3404
3404
|
name: option.icon,
|
|
3405
3405
|
size: import_tokens20.tokens.extensions.selection.iconSize,
|
|
@@ -3457,8 +3457,8 @@ var import_tokens21 = require("@kjun-ui/tokens");
|
|
|
3457
3457
|
var import_react32 = require("react");
|
|
3458
3458
|
var import_react_native24 = require("react-native");
|
|
3459
3459
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3460
|
-
var
|
|
3461
|
-
function
|
|
3460
|
+
var KjunTextarea = (0, import_react32.forwardRef)(
|
|
3461
|
+
function KjunTextarea2({
|
|
3462
3462
|
value,
|
|
3463
3463
|
size = "md",
|
|
3464
3464
|
error = false,
|
|
@@ -3531,7 +3531,7 @@ var import_react33 = require("react");
|
|
|
3531
3531
|
var import_react_native25 = require("react-native");
|
|
3532
3532
|
var import_react_native26 = require("react-native");
|
|
3533
3533
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3534
|
-
function
|
|
3534
|
+
function KjunDrawer({
|
|
3535
3535
|
open,
|
|
3536
3536
|
onOpenChange,
|
|
3537
3537
|
title,
|
|
@@ -3639,14 +3639,14 @@ function DsDrawer({
|
|
|
3639
3639
|
}
|
|
3640
3640
|
) }),
|
|
3641
3641
|
closable && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3642
|
-
|
|
3642
|
+
KjunButton,
|
|
3643
3643
|
{
|
|
3644
3644
|
size: "sm",
|
|
3645
3645
|
variant: "ghost",
|
|
3646
3646
|
ariaLabel: "\uB2EB\uAE30",
|
|
3647
3647
|
onPress: close,
|
|
3648
3648
|
style: { borderRadius: import_tokens22.tokens.extensions.drawer.closeRadius, width: import_tokens22.tokens.extensions.drawer.closeSize, height: import_tokens22.tokens.extensions.drawer.closeSize, paddingHorizontal: 0, paddingVertical: 0 },
|
|
3649
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3649
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(KjunIcon, { name: "x", size: import_tokens22.tokens.extensions.drawer.closeIconSize })
|
|
3650
3650
|
}
|
|
3651
3651
|
)
|
|
3652
3652
|
]
|
|
@@ -3938,7 +3938,7 @@ var import_react35 = require("react");
|
|
|
3938
3938
|
var import_react_native29 = require("react-native");
|
|
3939
3939
|
var import_tokens24 = require("@kjun-ui/tokens");
|
|
3940
3940
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3941
|
-
function
|
|
3941
|
+
function KjunPopover({
|
|
3942
3942
|
noPadding = false,
|
|
3943
3943
|
open: controlled,
|
|
3944
3944
|
onOpenChange,
|
|
@@ -3988,7 +3988,7 @@ function DsPopover({
|
|
|
3988
3988
|
)
|
|
3989
3989
|
] });
|
|
3990
3990
|
}
|
|
3991
|
-
function
|
|
3991
|
+
function KjunTooltip({
|
|
3992
3992
|
content: message = "",
|
|
3993
3993
|
placement = "top",
|
|
3994
3994
|
delay = 0,
|
|
@@ -4105,9 +4105,9 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
|
4105
4105
|
var DropdownContext = (0, import_react36.createContext)(null);
|
|
4106
4106
|
var MenuIconSlotContext = (0, import_react36.createContext)(false);
|
|
4107
4107
|
function hasLeadingIcon(node) {
|
|
4108
|
-
return import_react36.Children.toArray(node).some((child) => (0, import_react36.isValidElement)(child) && (child.type === import_react36.Fragment ? hasLeadingIcon(child.props.children) : child.type ===
|
|
4108
|
+
return import_react36.Children.toArray(node).some((child) => (0, import_react36.isValidElement)(child) && (child.type === import_react36.Fragment ? hasLeadingIcon(child.props.children) : child.type === KjunDropdownItem && !!child.props.icon));
|
|
4109
4109
|
}
|
|
4110
|
-
function
|
|
4110
|
+
function KjunDropdown({
|
|
4111
4111
|
disabled = false,
|
|
4112
4112
|
placement = "bottom-start",
|
|
4113
4113
|
trigger,
|
|
@@ -4117,7 +4117,7 @@ function DsDropdown({
|
|
|
4117
4117
|
}) {
|
|
4118
4118
|
const [open, setOpen] = (0, import_react36.useState)(false), currentOpen = (0, import_react36.useRef)(false), ref = (0, import_react36.useRef)(null);
|
|
4119
4119
|
let control = trigger;
|
|
4120
|
-
while ((0, import_react36.isValidElement)(control) && control.type ===
|
|
4120
|
+
while ((0, import_react36.isValidElement)(control) && control.type === KjunTooltip)
|
|
4121
4121
|
control = control.props.children;
|
|
4122
4122
|
const unavailable = disabled || (0, import_react36.isValidElement)(control) && !!(control.props.disabled || control.props.loading);
|
|
4123
4123
|
const change = (v) => {
|
|
@@ -4153,7 +4153,7 @@ function DsDropdown({
|
|
|
4153
4153
|
)
|
|
4154
4154
|
] });
|
|
4155
4155
|
}
|
|
4156
|
-
function
|
|
4156
|
+
function KjunDropdownItem({
|
|
4157
4157
|
variant = "default",
|
|
4158
4158
|
icon,
|
|
4159
4159
|
disabled = false,
|
|
@@ -4191,14 +4191,14 @@ function DsDropdownItem({
|
|
|
4191
4191
|
opacity: disabled ? import_tokens25.tokens.states.opacity.disabled : 1
|
|
4192
4192
|
}),
|
|
4193
4193
|
children: [
|
|
4194
|
-
icon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4194
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KjunIcon, { name: icon, size: import_tokens25.tokens.extensions.menu.iconSize, color: iconColor }) : reserveIcon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native30.View, { style: { width: import_tokens25.tokens.extensions.menu.iconSize }, accessible: false }),
|
|
4195
4195
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native30.View, { style: { flexGrow: 1, flexShrink: 1 }, children: content(children, { color, fontSize: import_tokens25.tokens.extensions.menu.optionFontSize, lineHeight: import_tokens25.tokens.extensions.menu.optionLineHeight }) }),
|
|
4196
|
-
selected !== null && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native30.View, { style: { opacity: selected ? 1 : 0 }, accessible: false, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4196
|
+
selected !== null && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native30.View, { style: { opacity: selected ? 1 : 0 }, accessible: false, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(KjunIcon, { name: "check", size: import_tokens25.tokens.extensions.menu.iconSize, color: colors.brand }) })
|
|
4197
4197
|
]
|
|
4198
4198
|
}
|
|
4199
4199
|
);
|
|
4200
4200
|
}
|
|
4201
|
-
function
|
|
4201
|
+
function KjunDropdownDivider() {
|
|
4202
4202
|
const { colors } = useKjunStyles();
|
|
4203
4203
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4204
4204
|
import_react_native30.View,
|
|
@@ -4208,7 +4208,7 @@ function DsDropdownDivider() {
|
|
|
4208
4208
|
}
|
|
4209
4209
|
);
|
|
4210
4210
|
}
|
|
4211
|
-
function
|
|
4211
|
+
function KjunMenuButton({
|
|
4212
4212
|
label,
|
|
4213
4213
|
size = "md",
|
|
4214
4214
|
variant = "secondary",
|
|
@@ -4224,7 +4224,7 @@ function DsMenuButton({
|
|
|
4224
4224
|
}) {
|
|
4225
4225
|
const [open, setOpen] = (0, import_react36.useState)(false);
|
|
4226
4226
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4227
|
-
|
|
4227
|
+
KjunDropdown,
|
|
4228
4228
|
{
|
|
4229
4229
|
...props,
|
|
4230
4230
|
onOpen: () => {
|
|
@@ -4236,13 +4236,13 @@ function DsMenuButton({
|
|
|
4236
4236
|
onClose == null ? void 0 : onClose();
|
|
4237
4237
|
},
|
|
4238
4238
|
trigger: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4239
|
-
|
|
4239
|
+
KjunTooltip,
|
|
4240
4240
|
{
|
|
4241
4241
|
content: open ? "" : tooltip,
|
|
4242
4242
|
placement: tooltipPlacement,
|
|
4243
4243
|
delay: tooltipDelay,
|
|
4244
4244
|
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4245
|
-
|
|
4245
|
+
KjunButton,
|
|
4246
4246
|
{
|
|
4247
4247
|
size,
|
|
4248
4248
|
variant,
|
|
@@ -4402,7 +4402,7 @@ function OptionRow({
|
|
|
4402
4402
|
}),
|
|
4403
4403
|
children: [
|
|
4404
4404
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_native31.View, { style: { flex: 1 }, children: content(children || label, { fontSize: import_tokens26.tokens.extensions.menu.optionFontSize, lineHeight: import_tokens26.tokens.extensions.menu.optionLineHeight }) }),
|
|
4405
|
-
selected && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4405
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunIcon, { name: "check", size: import_tokens26.tokens.extensions.menu.iconSize, color: colors.brand })
|
|
4406
4406
|
]
|
|
4407
4407
|
}
|
|
4408
4408
|
);
|
|
@@ -4410,7 +4410,7 @@ function OptionRow({
|
|
|
4410
4410
|
|
|
4411
4411
|
// packages/native/src/combobox.tsx
|
|
4412
4412
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4413
|
-
function
|
|
4413
|
+
function KjunCombobox({
|
|
4414
4414
|
value,
|
|
4415
4415
|
options = [],
|
|
4416
4416
|
placeholder = "\uAC80\uC0C9 \uB610\uB294 \uC120\uD0DD",
|
|
@@ -4518,7 +4518,7 @@ function SearchField({
|
|
|
4518
4518
|
onSubmitEditing: onEnter
|
|
4519
4519
|
};
|
|
4520
4520
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
4521
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_native32.View, { ref, collapsable: false, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4521
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_native32.View, { ref, collapsable: false, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunInput, { ...inputProps, ...import_react_native32.Platform.OS === "web" ? { onClick: openFromPress } : { onPressIn: openFromPress }, "aria-expanded": open && !disabled, onBlur: focusGuard.clear, onFocus: () => {
|
|
4522
4522
|
if (!clearing.current && focusGuard.canOpen()) onOpenChange(true);
|
|
4523
4523
|
} }) }),
|
|
4524
4524
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -4540,12 +4540,12 @@ function SearchField({
|
|
|
4540
4540
|
borderBottomWidth: import_tokens27.tokens.border.defaultWidth,
|
|
4541
4541
|
borderBottomColor: colors.border
|
|
4542
4542
|
},
|
|
4543
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunInput, { ...inputProps, nativeID: searchId, autoFocus: true })
|
|
4544
4544
|
}
|
|
4545
4545
|
),
|
|
4546
4546
|
loading ? (
|
|
4547
4547
|
// Centered like the Select loading row on every platform.
|
|
4548
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_native32.View, { style: { padding: import_tokens27.tokens.dimension.value12, alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_native32.View, { style: { padding: import_tokens27.tokens.dimension.value12, alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(KjunSpinner, { size: "sm", text: "\uAC80\uC0C9 \uC911..." }) })
|
|
4549
4549
|
) : failed ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4550
4550
|
KText,
|
|
4551
4551
|
{
|
|
@@ -4596,7 +4596,7 @@ function displayMonth(value) {
|
|
|
4596
4596
|
const date = /* @__PURE__ */ new Date(value + "T12:00:00");
|
|
4597
4597
|
return Number.isNaN(date.getTime()) ? /* @__PURE__ */ new Date() : date;
|
|
4598
4598
|
}
|
|
4599
|
-
function
|
|
4599
|
+
function KjunDatePicker({
|
|
4600
4600
|
value,
|
|
4601
4601
|
min,
|
|
4602
4602
|
max,
|
|
@@ -4661,7 +4661,7 @@ function DsDatePicker({
|
|
|
4661
4661
|
}
|
|
4662
4662
|
),
|
|
4663
4663
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4664
|
-
|
|
4664
|
+
KjunIcon,
|
|
4665
4665
|
{
|
|
4666
4666
|
name: "calendar",
|
|
4667
4667
|
size: spec.iconSize,
|
|
@@ -4692,7 +4692,7 @@ function DsDatePicker({
|
|
|
4692
4692
|
},
|
|
4693
4693
|
children: [
|
|
4694
4694
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4695
|
-
|
|
4695
|
+
KjunButton,
|
|
4696
4696
|
{
|
|
4697
4697
|
size: "sm",
|
|
4698
4698
|
variant: "ghost",
|
|
@@ -4708,7 +4708,7 @@ function DsDatePicker({
|
|
|
4708
4708
|
"\uC6D4"
|
|
4709
4709
|
] }),
|
|
4710
4710
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4711
|
-
|
|
4711
|
+
KjunButton,
|
|
4712
4712
|
{
|
|
4713
4713
|
size: "sm",
|
|
4714
4714
|
variant: "ghost",
|
|
@@ -4873,7 +4873,7 @@ function useSearchInputModel({
|
|
|
4873
4873
|
|
|
4874
4874
|
// packages/native/src/search-input.tsx
|
|
4875
4875
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4876
|
-
function
|
|
4876
|
+
function KjunSearchInput({
|
|
4877
4877
|
value,
|
|
4878
4878
|
placeholder = "\uAC80\uC0C9...",
|
|
4879
4879
|
ariaLabel,
|
|
@@ -4908,7 +4908,7 @@ function DsSearchInput({
|
|
|
4908
4908
|
};
|
|
4909
4909
|
if (!loadOptions)
|
|
4910
4910
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4911
|
-
|
|
4911
|
+
KjunInput,
|
|
4912
4912
|
{
|
|
4913
4913
|
error,
|
|
4914
4914
|
value: query,
|
|
@@ -5007,7 +5007,7 @@ function useSelectState(controlled, disabled, pageSize, onOpenChange) {
|
|
|
5007
5007
|
// packages/native/src/select-control.tsx
|
|
5008
5008
|
var import_react_native35 = require("react-native");
|
|
5009
5009
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5010
|
-
function
|
|
5010
|
+
function KjunSelect({
|
|
5011
5011
|
value,
|
|
5012
5012
|
options = [],
|
|
5013
5013
|
placeholder = "\uC120\uD0DD",
|
|
@@ -5118,7 +5118,7 @@ function DsSelect({
|
|
|
5118
5118
|
}, children: label || placeholder })
|
|
5119
5119
|
] }),
|
|
5120
5120
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_native35.View, { style: { transform: [{ rotate: expanded ? "180deg" : "0deg" }] }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5121
|
-
|
|
5121
|
+
KjunIcon,
|
|
5122
5122
|
{
|
|
5123
5123
|
name: "chevron-down",
|
|
5124
5124
|
size: compound ? import_tokens30.tokens.extensions.timePicker.iconSize : spec.iconSize,
|
|
@@ -5170,7 +5170,7 @@ function DsSelect({
|
|
|
5170
5170
|
borderBottomColor: colors.border
|
|
5171
5171
|
},
|
|
5172
5172
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5173
|
-
|
|
5173
|
+
KjunInput,
|
|
5174
5174
|
{
|
|
5175
5175
|
autoFocus: true,
|
|
5176
5176
|
value: query,
|
|
@@ -5186,7 +5186,7 @@ function DsSelect({
|
|
|
5186
5186
|
)
|
|
5187
5187
|
}
|
|
5188
5188
|
),
|
|
5189
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_native35.View, { style: { padding: import_tokens30.tokens.dimension.value12 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5189
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_native35.View, { style: { padding: import_tokens30.tokens.dimension.value12 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(KjunSpinner, { size: "sm", text: "\uAC80\uC0C9 \uC911..." }) }) : visible.map(({ option: o, key }, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5190
5190
|
OptionRow,
|
|
5191
5191
|
{
|
|
5192
5192
|
selected: selected(o),
|
|
@@ -5216,7 +5216,7 @@ function DsSelect({
|
|
|
5216
5216
|
}
|
|
5217
5217
|
),
|
|
5218
5218
|
!loading && visible.length < matching.length && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5219
|
-
|
|
5219
|
+
KjunButton,
|
|
5220
5220
|
{
|
|
5221
5221
|
size: "sm",
|
|
5222
5222
|
variant: "ghost",
|
|
@@ -5342,7 +5342,7 @@ function usePanelFocus(_root) {
|
|
|
5342
5342
|
// packages/native/src/tabs.tsx
|
|
5343
5343
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5344
5344
|
var TabContext = (0, import_react47.createContext)({ value: "", id: "", names: [] });
|
|
5345
|
-
function
|
|
5345
|
+
function KjunTabs({
|
|
5346
5346
|
value,
|
|
5347
5347
|
items = [],
|
|
5348
5348
|
density = "comfortable",
|
|
@@ -5358,15 +5358,15 @@ function DsTabs({
|
|
|
5358
5358
|
const { colors } = useKjunStyles(), panes = import_react47.Children.toArray(children).filter(
|
|
5359
5359
|
import_react47.isValidElement
|
|
5360
5360
|
);
|
|
5361
|
-
const tabs = items.length ? items : panes.filter((child) => child.type ===
|
|
5362
|
-
const id = (0, import_react47.useId)(), root = (0, import_react47.useRef)(null);
|
|
5361
|
+
const tabs = items.length ? items : panes.filter((child) => child.type === KjunTabPane).map((child) => child.props);
|
|
5362
|
+
const id = "kjun-" + (0, import_react47.useId)(), root = (0, import_react47.useRef)(null);
|
|
5363
5363
|
const menuState = (0, import_react47.useRef)({ tabs, onTabMenu });
|
|
5364
5364
|
menuState.current = { tabs, onTabMenu };
|
|
5365
5365
|
const pressedMenu = (0, import_react47.useRef)(null);
|
|
5366
5366
|
(0, import_react47.useLayoutEffect)(() => {
|
|
5367
5367
|
if (!onTabMenu || !tabs.some((tab) => tab.name === pressedMenu.current && !tab.disabled)) pressedMenu.current = null;
|
|
5368
5368
|
}, [tabs, onTabMenu]);
|
|
5369
|
-
const panelNames = panes.filter((child) => child.type ===
|
|
5369
|
+
const panelNames = panes.filter((child) => child.type === KjunTabPane).map((child) => child.props.name);
|
|
5370
5370
|
const geometry2 = import_tokens32.tokens.extensions.tabs;
|
|
5371
5371
|
const underline = variant === "underline";
|
|
5372
5372
|
const [hoveredTab, setHoveredTab] = (0, import_react47.useState)(null);
|
|
@@ -5497,7 +5497,7 @@ function DsTabs({
|
|
|
5497
5497
|
},
|
|
5498
5498
|
children: [
|
|
5499
5499
|
tab.icon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5500
|
-
|
|
5500
|
+
KjunIcon,
|
|
5501
5501
|
{
|
|
5502
5502
|
name: tab.icon,
|
|
5503
5503
|
size: geometry2.iconSize,
|
|
@@ -5548,7 +5548,7 @@ function DsTabs({
|
|
|
5548
5548
|
children && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_native37.View, { style: { marginTop: geometry2.contentGap }, children })
|
|
5549
5549
|
] }) });
|
|
5550
5550
|
}
|
|
5551
|
-
function
|
|
5551
|
+
function KjunTabPane({ name, children }) {
|
|
5552
5552
|
const { value, id, names } = (0, import_react47.useContext)(TabContext);
|
|
5553
5553
|
const root = (0, import_react47.useRef)(null);
|
|
5554
5554
|
usePanelFocus(root);
|
|
@@ -5574,7 +5574,7 @@ function DsTabPane({ name, children }) {
|
|
|
5574
5574
|
// packages/native/src/navigation.tsx
|
|
5575
5575
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5576
5576
|
var AccordionContext = (0, import_react48.createContext)(null);
|
|
5577
|
-
function
|
|
5577
|
+
function KjunAccordion({
|
|
5578
5578
|
multiple = false,
|
|
5579
5579
|
tone = "card",
|
|
5580
5580
|
children
|
|
@@ -5598,14 +5598,14 @@ function DsAccordion({
|
|
|
5598
5598
|
}
|
|
5599
5599
|
);
|
|
5600
5600
|
}
|
|
5601
|
-
function
|
|
5601
|
+
function KjunAccordionItem({
|
|
5602
5602
|
title = "",
|
|
5603
5603
|
defaultOpen = false,
|
|
5604
5604
|
disabled = false,
|
|
5605
5605
|
header,
|
|
5606
5606
|
children
|
|
5607
5607
|
}) {
|
|
5608
|
-
const { colors } = useKjunStyles(), group = (0, import_react48.useContext)(AccordionContext), id = (0, import_react48.useId)(), [own, setOwn] = (0, import_react48.useState)(defaultOpen), open = group ? group.opened.has(id) : own;
|
|
5608
|
+
const { colors } = useKjunStyles(), group = (0, import_react48.useContext)(AccordionContext), id = "kjun-" + (0, import_react48.useId)(), [own, setOwn] = (0, import_react48.useState)(defaultOpen), open = group ? group.opened.has(id) : own;
|
|
5609
5609
|
const rotation = useMotionValue(open ? 1 : 0, import_tokens33.tokens.motion.collapse, void 0, void 0, true);
|
|
5610
5610
|
const geometry2 = import_tokens33.tokens.extensions.accordion;
|
|
5611
5611
|
const [hovered, setHovered] = (0, import_react48.useState)(false);
|
|
@@ -5640,7 +5640,7 @@ function DsAccordionItem({
|
|
|
5640
5640
|
}),
|
|
5641
5641
|
children: [
|
|
5642
5642
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native38.View, { style: { flex: 1, minWidth: 0 }, children: content(header || title, { ...typeStyle("control"), ...wrapping }) }),
|
|
5643
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native38.Animated.View, { style: { flexShrink: 0, transform: [{ rotate: rotation.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "180deg"] }) }] }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5643
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native38.Animated.View, { style: { flexShrink: 0, transform: [{ rotate: rotation.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "180deg"] }) }] }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunIcon, { name: "chevron-down", size: geometry2.iconSize, color: colors.textSecondary }) })
|
|
5644
5644
|
]
|
|
5645
5645
|
}
|
|
5646
5646
|
),
|
|
@@ -5654,7 +5654,7 @@ function DsAccordionItem({
|
|
|
5654
5654
|
) })
|
|
5655
5655
|
] });
|
|
5656
5656
|
}
|
|
5657
|
-
function
|
|
5657
|
+
function KjunBreadcrumb({
|
|
5658
5658
|
items,
|
|
5659
5659
|
renderLink,
|
|
5660
5660
|
onNavigate,
|
|
@@ -5673,7 +5673,7 @@ function DsBreadcrumb({
|
|
|
5673
5673
|
},
|
|
5674
5674
|
children: items.map((item, i) => {
|
|
5675
5675
|
const label = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_native38.View, { style: { flexDirection: "row", alignItems: "center", gap: import_tokens33.tokens.dimension.value4 }, children: [
|
|
5676
|
-
item.icon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5676
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KjunIcon, { name: item.icon, size: import_tokens33.tokens.extensions.breadcrumb.iconSize, color: colors.textSecondary }),
|
|
5677
5677
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5678
5678
|
KText,
|
|
5679
5679
|
{
|
|
@@ -5687,7 +5687,7 @@ function DsBreadcrumb({
|
|
|
5687
5687
|
] });
|
|
5688
5688
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react48.Fragment, { children: [
|
|
5689
5689
|
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5690
|
-
|
|
5690
|
+
KjunIcon,
|
|
5691
5691
|
{
|
|
5692
5692
|
name: "chevron-right",
|
|
5693
5693
|
size: import_tokens33.tokens.extensions.breadcrumb.separatorSize,
|
|
@@ -5709,7 +5709,7 @@ function DsBreadcrumb({
|
|
|
5709
5709
|
}
|
|
5710
5710
|
);
|
|
5711
5711
|
}
|
|
5712
|
-
function
|
|
5712
|
+
function KjunPagination({
|
|
5713
5713
|
currentPage,
|
|
5714
5714
|
page,
|
|
5715
5715
|
totalPages,
|
|
@@ -5751,7 +5751,7 @@ function DsPagination({
|
|
|
5751
5751
|
};
|
|
5752
5752
|
const arrowSize = (_b = Object.keys(import_tokens33.tokens.button.iconSizes).find((size) => import_tokens33.tokens.button.iconSizes[size] === import_tokens33.tokens.extensions.pagination.iconSize)) != null ? _b : "sm";
|
|
5753
5753
|
const button = (target, label, icon) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5754
|
-
|
|
5754
|
+
KjunButton,
|
|
5755
5755
|
{
|
|
5756
5756
|
style: pageButtonStyle,
|
|
5757
5757
|
size: arrowSize,
|
|
@@ -5796,7 +5796,7 @@ function DsPagination({
|
|
|
5796
5796
|
},
|
|
5797
5797
|
children: [
|
|
5798
5798
|
showSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_native38.View, { style: { minWidth: import_tokens33.tokens.extensions.pagination.selectorMinimumWidth }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5799
|
-
|
|
5799
|
+
KjunSelect,
|
|
5800
5800
|
{
|
|
5801
5801
|
size: "sm",
|
|
5802
5802
|
ariaLabel: "\uD398\uC774\uC9C0\uB2F9 \uD56D\uBAA9 \uC218",
|
|
@@ -5821,7 +5821,7 @@ function DsPagination({
|
|
|
5821
5821
|
totalPages
|
|
5822
5822
|
] }) : pages.map(
|
|
5823
5823
|
(n, i) => typeof n === "string" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(KText, { children: "..." }, "dots" + i) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5824
|
-
|
|
5824
|
+
KjunButton,
|
|
5825
5825
|
{
|
|
5826
5826
|
style: pageButtonStyle,
|
|
5827
5827
|
size: "sm",
|
|
@@ -5849,7 +5849,7 @@ var import_tokens34 = require("@kjun-ui/tokens");
|
|
|
5849
5849
|
var import_react49 = require("react");
|
|
5850
5850
|
var import_react_native39 = require("react-native");
|
|
5851
5851
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5852
|
-
function
|
|
5852
|
+
function KjunIconToggle({
|
|
5853
5853
|
active = false,
|
|
5854
5854
|
activeIcon,
|
|
5855
5855
|
inactiveIcon,
|
|
@@ -5867,7 +5867,7 @@ function DsIconToggle({
|
|
|
5867
5867
|
const { colors } = useKjunStyles();
|
|
5868
5868
|
const navigation = (0, import_react49.useContext)(TopNavigationContext);
|
|
5869
5869
|
const box = navigation ? navigation.controlSize : size === "xs" ? import_tokens34.tokens.extensions.iconToggle.compactSize : import_tokens34.tokens.extensions.iconToggle.sizes[size];
|
|
5870
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunTooltip, { content: disabled || loading ? "" : tooltip != null ? tooltip : ariaLabel, placement: tooltipPlacement, delay: tooltipDelay, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5871
5871
|
AccessiblePressable,
|
|
5872
5872
|
{
|
|
5873
5873
|
accessibilityRole: "button",
|
|
@@ -5904,8 +5904,8 @@ function DsIconToggle({
|
|
|
5904
5904
|
}),
|
|
5905
5905
|
children: ({ pressed, hovered }) => {
|
|
5906
5906
|
var _a;
|
|
5907
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_native39.View, { style: { width: box, height: box, alignItems: "center", justifyContent: "center", borderRadius: import_tokens34.tokens.extensions.iconToggle.radii[size], backgroundColor: !disabled && !loading && (pressed || hovered) ? colors.hover : "transparent" }, children: loading ? navigation ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5908
|
-
|
|
5907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_native39.View, { style: { width: box, height: box, alignItems: "center", justifyContent: "center", borderRadius: import_tokens34.tokens.extensions.iconToggle.radii[size], backgroundColor: !disabled && !loading && (pressed || hovered) ? colors.hover : "transparent" }, children: loading ? navigation ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunIcon, { name: "loader-2", spin: true, size: navigation.iconSize }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunSpinner, { size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5908
|
+
KjunIcon,
|
|
5909
5909
|
{
|
|
5910
5910
|
name: active ? activeIcon : inactiveIcon || activeIcon,
|
|
5911
5911
|
filled: active,
|
|
@@ -5917,7 +5917,7 @@ function DsIconToggle({
|
|
|
5917
5917
|
}
|
|
5918
5918
|
) });
|
|
5919
5919
|
}
|
|
5920
|
-
function
|
|
5920
|
+
function KjunCopyButton({
|
|
5921
5921
|
value,
|
|
5922
5922
|
ariaLabel,
|
|
5923
5923
|
text,
|
|
@@ -5982,7 +5982,7 @@ function DsCopyButton({
|
|
|
5982
5982
|
}),
|
|
5983
5983
|
children: [
|
|
5984
5984
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5985
|
-
|
|
5985
|
+
KjunIcon,
|
|
5986
5986
|
{
|
|
5987
5987
|
name: copied ? "check" : "copy",
|
|
5988
5988
|
size: import_tokens34.tokens.button.iconSizes[size],
|
|
@@ -6003,7 +6003,7 @@ function DsCopyButton({
|
|
|
6003
6003
|
}
|
|
6004
6004
|
) });
|
|
6005
6005
|
}
|
|
6006
|
-
function
|
|
6006
|
+
function KjunRefreshButton({
|
|
6007
6007
|
targetName = "",
|
|
6008
6008
|
mode = "icon",
|
|
6009
6009
|
text = "\uC0C8\uB85C\uACE0\uCE68",
|
|
@@ -6020,8 +6020,8 @@ function DsRefreshButton({
|
|
|
6020
6020
|
const reduced = useReducedMotion();
|
|
6021
6021
|
const label = ariaLabel || [targetName, "\uC0C8\uB85C\uACE0\uCE68"].filter(Boolean).join(" ");
|
|
6022
6022
|
const hint = tooltip != null ? tooltip : mode === "icon" ? label : "";
|
|
6023
|
-
const button = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6024
|
-
|
|
6023
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunTooltip, { content: props.disabled || props.loading ? "" : hint, placement: tooltipPlacement, delay: tooltipDelay, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6024
|
+
KjunButton,
|
|
6025
6025
|
{
|
|
6026
6026
|
...props,
|
|
6027
6027
|
size,
|
|
@@ -6043,14 +6043,14 @@ function safeExternalUrl(href) {
|
|
|
6043
6043
|
return "";
|
|
6044
6044
|
}
|
|
6045
6045
|
}
|
|
6046
|
-
function
|
|
6046
|
+
function KjunExternalLink({
|
|
6047
6047
|
href = "",
|
|
6048
6048
|
mode = "text",
|
|
6049
6049
|
label,
|
|
6050
6050
|
children,
|
|
6051
6051
|
openUrl
|
|
6052
6052
|
}) {
|
|
6053
|
-
const { colors } = useKjunStyles(), url = safeExternalUrl(href), name = label || (mode === "icon" ? "\uC678\uBD80 \uB9C1\uD06C" : void 0), body = mode === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6053
|
+
const { colors } = useKjunStyles(), url = safeExternalUrl(href), name = label || (mode === "icon" ? "\uC678\uBD80 \uB9C1\uD06C" : void 0), body = mode === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunIcon, { name: "external-link", color: colors.text }) : content(children);
|
|
6054
6054
|
return url ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6055
6055
|
AccessiblePressable,
|
|
6056
6056
|
{
|
|
@@ -6062,13 +6062,13 @@ function DsExternalLink({
|
|
|
6062
6062
|
// Like Web, text links show the new-window cue after the text.
|
|
6063
6063
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react_native39.View, { style: { flexDirection: "row", alignItems: "center", gap: import_tokens34.tokens.dimension.value4 }, children: [
|
|
6064
6064
|
body,
|
|
6065
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6065
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KjunIcon, { name: "external-link", size: import_tokens34.tokens.iconSizes.small, color: colors.text })
|
|
6066
6066
|
] })
|
|
6067
6067
|
) : body
|
|
6068
6068
|
}
|
|
6069
6069
|
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_native39.View, { children: body });
|
|
6070
6070
|
}
|
|
6071
|
-
function
|
|
6071
|
+
function KjunScrollFade({ children }) {
|
|
6072
6072
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6073
6073
|
import_react_native39.ScrollView,
|
|
6074
6074
|
{
|
|
@@ -6095,7 +6095,7 @@ function useQueryDisplay(props) {
|
|
|
6095
6095
|
}
|
|
6096
6096
|
return (0, import_tokens35.queryDisplayStatus)(next, props);
|
|
6097
6097
|
}
|
|
6098
|
-
function
|
|
6098
|
+
function KjunDataState({
|
|
6099
6099
|
preserveContent = false,
|
|
6100
6100
|
refreshing = false,
|
|
6101
6101
|
refreshError,
|
|
@@ -6144,7 +6144,7 @@ function DsDataState({
|
|
|
6144
6144
|
backgroundColor: colors.surface
|
|
6145
6145
|
},
|
|
6146
6146
|
children: [
|
|
6147
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6147
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunSpinner, { size: "xs" }),
|
|
6148
6148
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KText, { style: { ...typeStyle("caption"), color: colors.textTertiary, flexShrink: 1, minWidth: 0 }, children: refreshingText })
|
|
6149
6149
|
]
|
|
6150
6150
|
}
|
|
@@ -6154,12 +6154,12 @@ function DsDataState({
|
|
|
6154
6154
|
{
|
|
6155
6155
|
accessibilityLabel: loadingText,
|
|
6156
6156
|
style: { paddingVertical: loadingPadding === "none" ? 0 : padding },
|
|
6157
|
-
children: loadingContent || (skeleton ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native40.View, { style: { gap: import_tokens35.tokens.dimension.value12 }, children: Array.from({ length: skeletonCount }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6158
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6157
|
+
children: loadingContent || (skeleton ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native40.View, { style: { gap: import_tokens35.tokens.dimension.value12 }, children: Array.from({ length: skeletonCount }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunSkeleton, { type: skeletonType }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_native40.View, { style: { alignItems: "center", gap: import_tokens35.tokens.dimension.value12 }, children: [
|
|
6158
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunSpinner, { size: "md" }),
|
|
6159
6159
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KText, { style: { ...typeStyle("body"), color: colors.textSecondary, textAlign: "center", maxWidth: "100%" }, children: loadingText })
|
|
6160
6160
|
] }))
|
|
6161
6161
|
}
|
|
6162
|
-
) : blockingError ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataStateContentContext.Provider, { value: "message", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native40.View, { style: { paddingVertical: padding }, children: errorContent || /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6162
|
+
) : blockingError ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataStateContentContext.Provider, { value: "message", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native40.View, { style: { paddingVertical: padding }, children: errorContent || /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunAlert, { type: "danger", title: "\uC624\uB958 \uBC1C\uC0DD", actions: onRetry && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunButton, { variant: "secondary", onPress: onRetry, children: retryText }), children: query.error }) }) }) : empty ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataStateContentContext.Provider, { value: "empty", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native40.View, { style: { paddingVertical: padding }, children: emptyContent || /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunEmpty, { text: emptyText, icon: emptyIcon, children: emptyActionText && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunButton, { onPress: onEmptyAction, children: emptyActionText }) }) }) }) : null,
|
|
6163
6163
|
(!concealed || preserveContent && state.hasQueryResult) && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6164
6164
|
import_react_native40.View,
|
|
6165
6165
|
{
|
|
@@ -6178,7 +6178,7 @@ function DsDataState({
|
|
|
6178
6178
|
},
|
|
6179
6179
|
"content"
|
|
6180
6180
|
),
|
|
6181
|
-
visibleRefreshError && !state.initialLoading && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataStateContentContext.Provider, { value: "message", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native40.View, { style: { marginTop: import_tokens35.tokens.dimension.value12 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6181
|
+
visibleRefreshError && !state.initialLoading && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DataStateContentContext.Provider, { value: "message", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native40.View, { style: { marginTop: import_tokens35.tokens.dimension.value12 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunAlert, { type: "warning", size: "sm", actions: onRetry && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KjunButton, { variant: "secondary", onPress: onRetry, children: retryText }), children: `${visibleRefreshError} \xB7 \uC774\uC804 \uC870\uD68C \uACB0\uACFC\uB97C \uD45C\uC2DC\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4.` }) }) })
|
|
6182
6182
|
]
|
|
6183
6183
|
}
|
|
6184
6184
|
);
|
|
@@ -6187,7 +6187,7 @@ function BoundaryDescription() {
|
|
|
6187
6187
|
const { colors } = useKjunStyles();
|
|
6188
6188
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(KText, { style: { ...typeStyle({ ...import_tokens35.tokens.typography.caption, fontSizePx: import_tokens35.tokens.extensions.state.descriptionSize }), color: colors.textSecondary, textAlign: "center" }, children: "\uB2E4\uC2DC \uC2DC\uB3C4\uD558\uBA74 \uBB38\uC81C\uAC00 \uD574\uACB0\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4." });
|
|
6189
6189
|
}
|
|
6190
|
-
var
|
|
6190
|
+
var KjunErrorBoundary = class extends import_react50.Component {
|
|
6191
6191
|
constructor() {
|
|
6192
6192
|
super(...arguments);
|
|
6193
6193
|
this.state = { error: false };
|
|
@@ -6215,7 +6215,7 @@ var DsErrorBoundary = class extends import_react50.Component {
|
|
|
6215
6215
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(BoundaryDescription, {})
|
|
6216
6216
|
] }),
|
|
6217
6217
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6218
|
-
|
|
6218
|
+
KjunButton,
|
|
6219
6219
|
{
|
|
6220
6220
|
style: { alignSelf: "center" },
|
|
6221
6221
|
onPress: () => {
|
|
@@ -6274,28 +6274,28 @@ var marketRowStyle = { minHeight: marketGeometry.rowHeight, flexDirection: "row"
|
|
|
6274
6274
|
|
|
6275
6275
|
// packages/native/src/market-skeleton.tsx
|
|
6276
6276
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6277
|
-
function
|
|
6277
|
+
function KjunMarketTableSkeleton({ columns = [], rows = 8, showActions = false }) {
|
|
6278
6278
|
const { colors } = useKjunStyles();
|
|
6279
6279
|
const cols = normalizeMarketColumns(columns), layout = useMarketLayout(cols, showActions);
|
|
6280
6280
|
const actions = { width: marketGeometry.actionsWidth, paddingVertical: import_tokens38.tokens.dimension.value12, paddingHorizontal: import_tokens38.tokens.dimension.value4, justifyContent: "center", alignItems: "center" };
|
|
6281
6281
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.ScrollView, { horizontal: true, onLayout: layout.onLayout, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_native41.View, { style: { width: layout.width }, children: [
|
|
6282
6282
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_native41.View, { style: { ...marketHeaderStyle, borderBottomColor: colors.border }, children: [
|
|
6283
|
-
showActions && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: actions, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6283
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: actions, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunSkeleton, { type: "block", width: import_tokens38.tokens.extensions.marketTable.actionSkeletonWidth, height: import_tokens38.tokens.extensions.marketTable.headerSkeletonHeight }) }),
|
|
6284
6284
|
cols.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: { width: layout.widths[i], padding: import_tokens38.tokens.dimension.value12, justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KText, { style: { ...typeStyle("meta"), color: colors.textTertiary, textAlign: col.align }, children: col.label }) }, col.key || i))
|
|
6285
6285
|
] }),
|
|
6286
6286
|
Array.from({ length: Math.max(0, rows) }, (_, row) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_native41.View, { style: { ...marketRowStyle, borderBottomColor: colors.border }, children: [
|
|
6287
|
-
showActions && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: actions, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6287
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: actions, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunSkeleton, { type: "block", width: import_tokens38.tokens.extensions.marketTable.actionSkeletonWidth, height: import_tokens38.tokens.extensions.financial.priceSkeletonHeight }) }),
|
|
6288
6288
|
cols.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: { width: layout.widths[i], paddingVertical: import_tokens38.tokens.dimension.value14, paddingHorizontal: import_tokens38.tokens.dimension.value12, justifyContent: "center", alignItems: isMarketIdentity(col.key) ? void 0 : col.align === "right" ? "flex-end" : col.align === "center" ? "center" : "flex-start" }, children: isMarketIdentity(col.key) ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_native41.View, { style: { gap: import_tokens38.tokens.dimension.value2 }, children: [
|
|
6289
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: { height: import_tokens38.tokens.typography.body.lineHeightPx, justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6290
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: { height: import_tokens38.tokens.typography.caption.lineHeightPx, justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6291
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6289
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: { height: import_tokens38.tokens.typography.body.lineHeightPx, justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunSkeleton, { type: "block", width: "80%", height: import_tokens38.tokens.extensions.skeleton.lineHeights.md }) }),
|
|
6290
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_native41.View, { style: { height: import_tokens38.tokens.typography.caption.lineHeightPx, justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunSkeleton, { type: "block", width: "60%", height: import_tokens38.tokens.extensions.skeleton.lineHeights.sm }) })
|
|
6291
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(KjunSkeleton, { type: "block", width: import_tokens38.tokens.extensions.financial.priceSkeletonWidth, height: import_tokens38.tokens.extensions.financial.priceSkeletonHeight }) }, col.key || i))
|
|
6292
6292
|
] }, row))
|
|
6293
6293
|
] }) });
|
|
6294
6294
|
}
|
|
6295
6295
|
|
|
6296
6296
|
// packages/native/src/skeletons.tsx
|
|
6297
6297
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6298
|
-
function
|
|
6298
|
+
function KjunListSkeleton({
|
|
6299
6299
|
rows = 8,
|
|
6300
6300
|
variant = "market",
|
|
6301
6301
|
avatar = true,
|
|
@@ -6325,21 +6325,21 @@ function DsListSkeleton({
|
|
|
6325
6325
|
borderBottomColor: colors.border
|
|
6326
6326
|
},
|
|
6327
6327
|
children: [
|
|
6328
|
-
avatar && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6328
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KjunSkeleton, { type: "avatar", width: avatarSize, height: avatarSize }),
|
|
6329
6329
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_native42.View, { style: { flex: 1, minWidth: 0, gap: market ? import_tokens39.tokens.dimension.value2 : import_tokens39.tokens.extensions.skeleton.detailGap }, children: [
|
|
6330
6330
|
slot(0, /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6331
|
-
|
|
6331
|
+
KjunSkeleton,
|
|
6332
6332
|
{
|
|
6333
6333
|
type: "block",
|
|
6334
6334
|
height: import_tokens39.tokens.extensions.skeleton.lineHeights.md,
|
|
6335
6335
|
width: i % 2 ? "80%" : "65%"
|
|
6336
6336
|
}
|
|
6337
6337
|
)),
|
|
6338
|
-
slot(1, /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6338
|
+
slot(1, /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KjunSkeleton, { type: "block", height: import_tokens39.tokens.extensions.skeleton.lineHeights.sm, width: "50%" }))
|
|
6339
6339
|
] }),
|
|
6340
6340
|
quote && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_native42.View, { style: { alignItems: "flex-end", gap: market ? import_tokens39.tokens.dimension.value2 : import_tokens39.tokens.extensions.skeleton.detailGap }, children: [
|
|
6341
|
-
slot(0, /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6342
|
-
slot(1, /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6341
|
+
slot(0, /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KjunSkeleton, { type: "block", height: import_tokens39.tokens.extensions.skeleton.quoteHeight, width: import_tokens39.tokens.extensions.skeleton.quoteWidth })),
|
|
6342
|
+
slot(1, /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KjunSkeleton, { type: "block", height: import_tokens39.tokens.extensions.skeleton.lineHeights.sm, width: import_tokens39.tokens.extensions.skeleton.detailWidth }))
|
|
6343
6343
|
] })
|
|
6344
6344
|
]
|
|
6345
6345
|
},
|
|
@@ -6348,7 +6348,7 @@ function DsListSkeleton({
|
|
|
6348
6348
|
}
|
|
6349
6349
|
);
|
|
6350
6350
|
}
|
|
6351
|
-
function
|
|
6351
|
+
function KjunFormSkeleton({
|
|
6352
6352
|
fields = ["", "", "", ""],
|
|
6353
6353
|
columns = 1,
|
|
6354
6354
|
multiline = false,
|
|
@@ -6379,10 +6379,10 @@ function DsFormSkeleton({
|
|
|
6379
6379
|
children: [
|
|
6380
6380
|
field ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KText, { style: { color: colors.text, ...typeStyle("label") }, children: typeof field === "string" ? field : field.label }) : (
|
|
6381
6381
|
// The bar sits in a label-line slot so the field starts where the real input will.
|
|
6382
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_native42.View, { style: { height: typeStyle("label").lineHeight, justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6382
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_native42.View, { style: { height: typeStyle("label").lineHeight, justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KjunSkeleton, { type: "block", height: import_tokens39.tokens.extensions.skeleton.formLabelHeight, width: import_tokens39.tokens.extensions.skeleton.formLabelWidth }) })
|
|
6383
6383
|
),
|
|
6384
6384
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_native42.View, { style: { borderRadius: import_tokens39.tokens.input[size].radius, overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6385
|
-
|
|
6385
|
+
KjunSkeleton,
|
|
6386
6386
|
{
|
|
6387
6387
|
type: "block",
|
|
6388
6388
|
height: typeof field === "object" && field.height != null ? field.height : multiline ? import_tokens39.tokens.input[size].lineHeight * 3 + import_tokens39.tokens.input[size].textareaPaddingY * 2 + 2 * import_tokens39.tokens.border.controlWidth : import_tokens39.tokens.input[size].height
|
|
@@ -6395,7 +6395,7 @@ function DsFormSkeleton({
|
|
|
6395
6395
|
}
|
|
6396
6396
|
);
|
|
6397
6397
|
}
|
|
6398
|
-
function
|
|
6398
|
+
function KjunChartSkeleton({
|
|
6399
6399
|
loadingText = "\uCC28\uD2B8\uB97C \uBD88\uB7EC\uC624\uB294 \uC911",
|
|
6400
6400
|
kind = "line",
|
|
6401
6401
|
height = import_tokens39.tokens.extensions.chartSkeleton.height
|
|
@@ -6449,7 +6449,7 @@ function DsChartSkeleton({
|
|
|
6449
6449
|
alignItems: "center",
|
|
6450
6450
|
justifyContent: "center"
|
|
6451
6451
|
},
|
|
6452
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(KjunSkeleton, { type: "block", width: import_tokens39.tokens.extensions.chartSkeleton.donutLabelWidth, height: import_tokens39.tokens.extensions.chartSkeleton.donutLabelHeight })
|
|
6453
6453
|
}
|
|
6454
6454
|
) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
6455
6455
|
import_react_native_svg5.default,
|
|
@@ -6619,7 +6619,7 @@ function useCountUp(value, animated, fromPrevious) {
|
|
|
6619
6619
|
return useNumberMotion(value, animated, fromPrevious, useReducedMotion());
|
|
6620
6620
|
}
|
|
6621
6621
|
var MarketQuoteTypeContext = (0, import_react54.createContext)(null);
|
|
6622
|
-
function
|
|
6622
|
+
function KjunAnimatedNumber({
|
|
6623
6623
|
value,
|
|
6624
6624
|
decimals = 0,
|
|
6625
6625
|
prefix = "",
|
|
@@ -6654,7 +6654,7 @@ function DsAnimatedNumber({
|
|
|
6654
6654
|
}
|
|
6655
6655
|
);
|
|
6656
6656
|
}
|
|
6657
|
-
function
|
|
6657
|
+
function KjunFreshness({
|
|
6658
6658
|
stale = false,
|
|
6659
6659
|
source,
|
|
6660
6660
|
fetchedAt,
|
|
@@ -6662,14 +6662,14 @@ function DsFreshness({
|
|
|
6662
6662
|
}) {
|
|
6663
6663
|
const label = source === "close" ? "\uC885\uAC00" : "\uC9C0\uC5F0";
|
|
6664
6664
|
return stale ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6665
|
-
|
|
6665
|
+
KjunTooltip,
|
|
6666
6666
|
{
|
|
6667
6667
|
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)) : ""),
|
|
6668
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AccessiblePressable, { accessibilityLabel: label, focusRingRadius: import_tokens41.tokens.extensions.badge.radius, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AccessiblePressable, { accessibilityLabel: label, focusRingRadius: import_tokens41.tokens.extensions.badge.radius, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunBadge, { variant: "warning", size: "xs", children: label }) })
|
|
6669
6669
|
}
|
|
6670
6670
|
) : null;
|
|
6671
6671
|
}
|
|
6672
|
-
function
|
|
6672
|
+
function KjunPriceCell({
|
|
6673
6673
|
value,
|
|
6674
6674
|
formatter,
|
|
6675
6675
|
stale = false,
|
|
@@ -6679,13 +6679,13 @@ function DsPriceCell({
|
|
|
6679
6679
|
fromPrevious = true
|
|
6680
6680
|
}) {
|
|
6681
6681
|
const { colors } = useKjunStyles(), quoteType = (0, import_react54.useContext)(MarketQuoteTypeContext);
|
|
6682
|
-
return value == null ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6682
|
+
return value == null ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunSkeleton, { type: "block", height: import_tokens41.tokens.extensions.financial.priceSkeletonHeight, width: import_tokens41.tokens.extensions.financial.priceSkeletonWidth }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react_native43.View, { style: { flexDirection: "row", alignItems: "center", gap: import_tokens41.tokens.extensions.financial.affixGap }, children: [
|
|
6683
6683
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6684
6684
|
import_react_native43.View,
|
|
6685
6685
|
{
|
|
6686
6686
|
style: quoteType ? void 0 : { paddingVertical: import_tokens41.tokens.extensions.financial.pillPaddingY, paddingHorizontal: import_tokens41.tokens.extensions.financial.pillPaddingX, borderRadius: import_tokens41.tokens.radius.radius9999 },
|
|
6687
6687
|
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6688
|
-
|
|
6688
|
+
KjunAnimatedNumber,
|
|
6689
6689
|
{
|
|
6690
6690
|
value,
|
|
6691
6691
|
formatter,
|
|
@@ -6695,10 +6695,10 @@ function DsPriceCell({
|
|
|
6695
6695
|
)
|
|
6696
6696
|
}
|
|
6697
6697
|
),
|
|
6698
|
-
showFreshness && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_native43.View, { style: { alignSelf: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6698
|
+
showFreshness && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_native43.View, { style: { alignSelf: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunFreshness, { stale, source, fetchedAt }) })
|
|
6699
6699
|
] });
|
|
6700
6700
|
}
|
|
6701
|
-
function
|
|
6701
|
+
function KjunSignedValue({
|
|
6702
6702
|
value,
|
|
6703
6703
|
format: kind = "number",
|
|
6704
6704
|
isRaw = false,
|
|
@@ -6729,7 +6729,7 @@ function DsSignedValue({
|
|
|
6729
6729
|
backgroundColor: tone === "pill" && !stale && !loading && n !== null ? domainColor(domainColors, role + "Bg") : void 0
|
|
6730
6730
|
},
|
|
6731
6731
|
children: [
|
|
6732
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6732
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunSkeleton, { type: "block", width: import_tokens41.tokens.extensions.financial.signedSkeletonWidth, height: import_tokens41.tokens.extensions.financial.signedSkeletonHeight }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6733
6733
|
KText,
|
|
6734
6734
|
{
|
|
6735
6735
|
style: {
|
|
@@ -6743,7 +6743,7 @@ function DsSignedValue({
|
|
|
6743
6743
|
children: display
|
|
6744
6744
|
}
|
|
6745
6745
|
),
|
|
6746
|
-
!loading && showFreshness && stale && n !== null && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_native43.View, { style: { alignSelf: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6746
|
+
!loading && showFreshness && stale && n !== null && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_native43.View, { style: { alignSelf: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(KjunFreshness, { stale: true }) })
|
|
6747
6747
|
]
|
|
6748
6748
|
}
|
|
6749
6749
|
);
|
|
@@ -6751,7 +6751,7 @@ function DsSignedValue({
|
|
|
6751
6751
|
|
|
6752
6752
|
// packages/native/src/financial-display.tsx
|
|
6753
6753
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6754
|
-
function
|
|
6754
|
+
function KjunDeviation({
|
|
6755
6755
|
value,
|
|
6756
6756
|
variant = "pill",
|
|
6757
6757
|
signalThreshold = 1,
|
|
@@ -6774,7 +6774,7 @@ function DsDeviation({
|
|
|
6774
6774
|
},
|
|
6775
6775
|
children: [
|
|
6776
6776
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6777
|
-
|
|
6777
|
+
KjunBadge,
|
|
6778
6778
|
{
|
|
6779
6779
|
variant: neutral ? "secondary" : n > 0 ? "price-up" : "price-down",
|
|
6780
6780
|
size: "sm",
|
|
@@ -6790,7 +6790,7 @@ function DsDeviation({
|
|
|
6790
6790
|
}
|
|
6791
6791
|
),
|
|
6792
6792
|
!signal && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_native44.View, { style: { width: import_tokens42.tokens.extensions.financial.warningIconSize, flexShrink: 0 } }),
|
|
6793
|
-
signal && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_native44.View, { style: { alignSelf: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6793
|
+
signal && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_native44.View, { style: { alignSelf: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(KjunTooltip, { content: `\uAD34\uB9AC\uC728 ${signalThreshold}% \uCD08\uACFC \u2014 \uCC28\uC775\uAC70\uB798 \uAE30\uD68C \uAC00\uB2A5`, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6794
6794
|
AccessiblePressable,
|
|
6795
6795
|
{
|
|
6796
6796
|
accessibilityRole: "image",
|
|
@@ -6804,7 +6804,7 @@ function DsDeviation({
|
|
|
6804
6804
|
alignItems: "center",
|
|
6805
6805
|
justifyContent: "center"
|
|
6806
6806
|
},
|
|
6807
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6807
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(KjunIcon, { name: "alert-triangle", size: import_tokens42.tokens.extensions.financial.warningIconSize, color: colors.warning })
|
|
6808
6808
|
}
|
|
6809
6809
|
) }) }) })
|
|
6810
6810
|
]
|
|
@@ -6852,7 +6852,7 @@ function DsDeviation({
|
|
|
6852
6852
|
}
|
|
6853
6853
|
);
|
|
6854
6854
|
}
|
|
6855
|
-
function
|
|
6855
|
+
function KjunHeatmapCell({
|
|
6856
6856
|
value = 0,
|
|
6857
6857
|
min = 0,
|
|
6858
6858
|
max = 1,
|
|
@@ -6896,7 +6896,7 @@ function DsHeatmapCell({
|
|
|
6896
6896
|
}
|
|
6897
6897
|
);
|
|
6898
6898
|
}
|
|
6899
|
-
function
|
|
6899
|
+
function KjunProgressCell({
|
|
6900
6900
|
value = 0,
|
|
6901
6901
|
max = 100,
|
|
6902
6902
|
showLabel = true,
|
|
@@ -6959,7 +6959,7 @@ function DsProgressCell({
|
|
|
6959
6959
|
}
|
|
6960
6960
|
);
|
|
6961
6961
|
}
|
|
6962
|
-
function
|
|
6962
|
+
function KjunCollectionMark({
|
|
6963
6963
|
kind,
|
|
6964
6964
|
active = false,
|
|
6965
6965
|
size = "md"
|
|
@@ -6967,7 +6967,7 @@ function DsCollectionMark({
|
|
|
6967
6967
|
const { colors, domainColors } = useKjunStyles();
|
|
6968
6968
|
const box = import_tokens42.tokens.extensions.financial.markSizes[size], glyph = kind === "interest" ? import_tokens42.tokens.extensions.financial.heartMarkSizes[size] : box;
|
|
6969
6969
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_native44.View, { style: { width: box, height: box, alignItems: "center", justifyContent: "center", overflow: "visible" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6970
|
-
|
|
6970
|
+
KjunIcon,
|
|
6971
6971
|
{
|
|
6972
6972
|
name: kind === "favorite" ? "star" : "heart",
|
|
6973
6973
|
filled: active,
|
|
@@ -6986,15 +6986,15 @@ var executionStates = {
|
|
|
6986
6986
|
completed_with_errors: ["warning", "\uC644\uB8CC (\uC624\uB958)"],
|
|
6987
6987
|
failed: ["danger", "\uC2E4\uD328"]
|
|
6988
6988
|
};
|
|
6989
|
-
function
|
|
6989
|
+
function KjunExecutionStatusBadge({
|
|
6990
6990
|
status,
|
|
6991
6991
|
label,
|
|
6992
6992
|
size = "md"
|
|
6993
6993
|
}) {
|
|
6994
6994
|
const state = status ? executionStates[status] : void 0;
|
|
6995
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.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") });
|
|
6996
6996
|
}
|
|
6997
|
-
function
|
|
6997
|
+
function KjunSparkline({
|
|
6998
6998
|
data = [],
|
|
6999
6999
|
width = import_tokens42.tokens.extensions.financial.sparklineWidth,
|
|
7000
7000
|
height = import_tokens42.tokens.extensions.financial.sparklineHeight,
|
|
@@ -7005,7 +7005,7 @@ function DsSparkline({
|
|
|
7005
7005
|
stretch = false,
|
|
7006
7006
|
ariaLabel
|
|
7007
7007
|
}) {
|
|
7008
|
-
const { colors, domainColors } = useKjunStyles(), id = (0, import_react55.useId)().replace(/:/g, ""), values = data.filter(Number.isFinite), min = Math.min(...values), max = Math.max(...values), range = max - min || 1, points = values.map(
|
|
7008
|
+
const { colors, domainColors } = useKjunStyles(), id = "kjun-" + (0, import_react55.useId)().replace(/:/g, ""), values = data.filter(Number.isFinite), min = Math.min(...values), max = Math.max(...values), range = max - min || 1, points = values.map(
|
|
7009
7009
|
(v, i) => `${2 + i / Math.max(1, values.length - 1) * (width - 4)},${2 + height - 4 - (v - min) / range * (height - 4)}`
|
|
7010
7010
|
).join(" "), change = values.length > 1 ? values[values.length - 1] - values[0] : 0, line = color || (change === 0 ? colors.textTertiary : semantic === "status" ? change > 0 ? colors.success : colors.danger : domainColor(domainColors, change > 0 ? "priceUp" : "priceDown"));
|
|
7011
7011
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
@@ -7206,9 +7206,9 @@ function TableToolbar({
|
|
|
7206
7206
|
selected.length,
|
|
7207
7207
|
"\uAC1C \uC120\uD0DD"
|
|
7208
7208
|
] }),
|
|
7209
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7209
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(KjunButton, { size: "xs", variant: "ghost", onPress: toggleAll, children: "\uC804\uCCB4 \uC120\uD0DD" }),
|
|
7210
7210
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7211
|
-
|
|
7211
|
+
KjunButton,
|
|
7212
7212
|
{
|
|
7213
7213
|
size: "xs",
|
|
7214
7214
|
variant: "ghost",
|
|
@@ -7223,7 +7223,7 @@ function TableToolbar({
|
|
|
7223
7223
|
(searchable || toolbar) && // Like Web: the search toolbar sits on the surface so the filled search field stands out from it.
|
|
7224
7224
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react_native45.View, { style: { ...toolbarStyle, backgroundColor: colors.surface }, children: [
|
|
7225
7225
|
searchable && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_native45.View, { style: { width: import_tokens44.tokens.table.searchWidth, maxWidth: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7226
|
-
|
|
7226
|
+
KjunInput,
|
|
7227
7227
|
{
|
|
7228
7228
|
size: "sm",
|
|
7229
7229
|
value: search,
|
|
@@ -7285,7 +7285,7 @@ function TableGrid({ initialLoading, skeletonRows, state, onRowClick, selectable
|
|
|
7285
7285
|
},
|
|
7286
7286
|
children: [
|
|
7287
7287
|
selectable && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_native46.View, { style: { width: geometry2.actionColumnWidth, alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7288
|
-
|
|
7288
|
+
KjunCheckbox,
|
|
7289
7289
|
{
|
|
7290
7290
|
size: "sm",
|
|
7291
7291
|
value: state.all,
|
|
@@ -7324,7 +7324,7 @@ function TableGrid({ initialLoading, skeletonRows, state, onRowClick, selectable
|
|
|
7324
7324
|
}
|
|
7325
7325
|
),
|
|
7326
7326
|
sortable !== false && state.sort.key === col.key && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7327
|
-
|
|
7327
|
+
KjunIcon,
|
|
7328
7328
|
{
|
|
7329
7329
|
name: state.sort.order === "asc" ? "sort-ascending" : "sort-descending",
|
|
7330
7330
|
size: import_tokens45.tokens.table.sortIconSize,
|
|
@@ -7350,7 +7350,7 @@ function TableGrid({ initialLoading, skeletonRows, state, onRowClick, selectable
|
|
|
7350
7350
|
paddingHorizontal: cellPadding.x
|
|
7351
7351
|
},
|
|
7352
7352
|
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7353
|
-
|
|
7353
|
+
KjunSkeleton,
|
|
7354
7354
|
{
|
|
7355
7355
|
type: "block",
|
|
7356
7356
|
height: geometry2.skeletonHeight,
|
|
@@ -7466,7 +7466,7 @@ function TableCards({
|
|
|
7466
7466
|
const { colors } = useKjunStyles();
|
|
7467
7467
|
const { title, subtitle, badges, inline, sections, actions, columnsForSection } = layout;
|
|
7468
7468
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_native47.View, { style: { gap: import_tokens46.tokens.extensions.tableCard.gap, padding: import_tokens46.tokens.extensions.tableCard.listPadding }, children: [
|
|
7469
|
-
initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7469
|
+
initialLoading ? Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(KjunSkeleton, { type: "card" }, i)) : state.rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7470
7470
|
AccessiblePressable,
|
|
7471
7471
|
{
|
|
7472
7472
|
accessible: false,
|
|
@@ -7612,7 +7612,7 @@ function TableCards({
|
|
|
7612
7612
|
|
|
7613
7613
|
// packages/native/src/table-view.tsx
|
|
7614
7614
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7615
|
-
function
|
|
7615
|
+
function KjunTable(props) {
|
|
7616
7616
|
const {
|
|
7617
7617
|
skeletonRows = 8,
|
|
7618
7618
|
emptyText = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
@@ -7666,7 +7666,7 @@ function DsTable(props) {
|
|
|
7666
7666
|
});
|
|
7667
7667
|
};
|
|
7668
7668
|
const checkbox = (row, i) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7669
|
-
|
|
7669
|
+
KjunCheckbox,
|
|
7670
7670
|
{
|
|
7671
7671
|
value: state.selectedRow(row),
|
|
7672
7672
|
ariaLabel: `\uD589 \uC120\uD0DD ${i + 1}`,
|
|
@@ -7675,7 +7675,7 @@ function DsTable(props) {
|
|
|
7675
7675
|
}
|
|
7676
7676
|
);
|
|
7677
7677
|
const expand = (row, i) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7678
|
-
|
|
7678
|
+
KjunButton,
|
|
7679
7679
|
{
|
|
7680
7680
|
variant: "ghost",
|
|
7681
7681
|
size: "xs",
|
|
@@ -7705,7 +7705,7 @@ function DsTable(props) {
|
|
|
7705
7705
|
}
|
|
7706
7706
|
),
|
|
7707
7707
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
7708
|
-
|
|
7708
|
+
KjunDataState,
|
|
7709
7709
|
{
|
|
7710
7710
|
queryKey: props.queryKey,
|
|
7711
7711
|
resultKey: query.usesQueryState ? query.hasCurrentResult ? props.queryKey : null : void 0,
|
|
@@ -7717,7 +7717,7 @@ function DsTable(props) {
|
|
|
7717
7717
|
children: [
|
|
7718
7718
|
card ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TableCards, { ...{ initialLoading: query.initialLoading, skeletonRows, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout } }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TableGrid, { ...{ initialLoading: query.initialLoading, skeletonRows, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, compact, striped, hoverable }, sortable: props.sortable }),
|
|
7719
7719
|
pagination && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7720
|
-
|
|
7720
|
+
KjunPagination,
|
|
7721
7721
|
{
|
|
7722
7722
|
currentPage: pagination.page,
|
|
7723
7723
|
totalPages: Math.ceil(
|
|
@@ -7759,7 +7759,7 @@ var kpiFormat = (item, value = item.value) => {
|
|
|
7759
7759
|
maximumFractionDigits: (_b = item.decimals) != null ? _b : 0
|
|
7760
7760
|
}).format(item.semantic === "price" ? Math.abs(value) : value);
|
|
7761
7761
|
};
|
|
7762
|
-
function
|
|
7762
|
+
function KjunKpiHero(props) {
|
|
7763
7763
|
const {
|
|
7764
7764
|
loading = false,
|
|
7765
7765
|
label,
|
|
@@ -7838,7 +7838,7 @@ function DsKpiHero(props) {
|
|
|
7838
7838
|
),
|
|
7839
7839
|
loading ? (
|
|
7840
7840
|
// Placeholders fill each line's height, like Web's 1lh; the value width approximates Web's 7ch.
|
|
7841
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7841
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(KjunSkeleton, { type: "block", height: typeStyle(numberRole).lineHeight, width: font * 4.8 })
|
|
7842
7842
|
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7843
7843
|
KpiNumberLine,
|
|
7844
7844
|
{
|
|
@@ -7848,7 +7848,7 @@ function DsKpiHero(props) {
|
|
|
7848
7848
|
suffixGap: geometry2.suffixGap,
|
|
7849
7849
|
style: { ...numeric, ...typeStyle(numberRole) },
|
|
7850
7850
|
unitStyle,
|
|
7851
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(KjunAnimatedNumber, { value, decimals, animated, formatter, style: typeStyle(numberRole) })
|
|
7852
7852
|
}
|
|
7853
7853
|
),
|
|
7854
7854
|
showDelta && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -7861,7 +7861,7 @@ function DsKpiHero(props) {
|
|
|
7861
7861
|
alignItems: "baseline",
|
|
7862
7862
|
gap: spec.deltaGap
|
|
7863
7863
|
},
|
|
7864
|
-
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7864
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(KjunSkeleton, { type: "block", height: typeStyle("numberMd").lineHeight, width: geometry2.deltaSkeletonWidth }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
7865
7865
|
deltaAbsolute !== null && delta(deltaAbsolute, "absolute", { ...numeric, color: direction(deltaAbsolute), ...typeStyle("numberMd") }),
|
|
7866
7866
|
deltaPercent !== null && delta(deltaPercent, "percent", { ...numeric, color: direction(deltaPercent), ...typeStyle("numberMd"), opacity: 0.9 }),
|
|
7867
7867
|
deltaDescription && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -7918,7 +7918,7 @@ function DsKpiHero(props) {
|
|
|
7918
7918
|
}
|
|
7919
7919
|
),
|
|
7920
7920
|
loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7921
|
-
|
|
7921
|
+
KjunSkeleton,
|
|
7922
7922
|
{
|
|
7923
7923
|
type: "block",
|
|
7924
7924
|
height: typeStyle("numberMd").lineHeight,
|
|
@@ -7937,7 +7937,7 @@ function DsKpiHero(props) {
|
|
|
7937
7937
|
}
|
|
7938
7938
|
),
|
|
7939
7939
|
item.desc && (loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7940
|
-
|
|
7940
|
+
KjunSkeleton,
|
|
7941
7941
|
{
|
|
7942
7942
|
type: "block",
|
|
7943
7943
|
width: geometry2.descriptionSkeletonWidth,
|
|
@@ -7970,7 +7970,7 @@ var import_tokens49 = require("@kjun-ui/tokens");
|
|
|
7970
7970
|
var import_react58 = require("react");
|
|
7971
7971
|
var import_react_native51 = require("react-native");
|
|
7972
7972
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7973
|
-
function
|
|
7973
|
+
function KjunKpiRow({
|
|
7974
7974
|
loading = false,
|
|
7975
7975
|
items,
|
|
7976
7976
|
size = "md",
|
|
@@ -8075,7 +8075,7 @@ function DsKpiRow({
|
|
|
8075
8075
|
marginBottom: sub ? 0 : spec.labelMargin
|
|
8076
8076
|
},
|
|
8077
8077
|
children: [
|
|
8078
|
-
busy && !item.label ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8078
|
+
busy && !item.label ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(KjunSkeleton, { type: "block", width: geometry2.labelSkeletonWidth, height: geometry2.labelSkeletonHeight }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(KText, { style: { minWidth: 0, flexShrink: 1, color: colors.textSecondary, ...typeStyle("caption") }, children: item.label }),
|
|
8079
8079
|
!busy && item.badgePlacement !== "value" && badge(item)
|
|
8080
8080
|
]
|
|
8081
8081
|
}
|
|
@@ -8104,7 +8104,7 @@ function DsKpiRow({
|
|
|
8104
8104
|
}
|
|
8105
8105
|
),
|
|
8106
8106
|
busy && !seg.separator ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8107
|
-
|
|
8107
|
+
KjunSkeleton,
|
|
8108
8108
|
{
|
|
8109
8109
|
type: "block",
|
|
8110
8110
|
height: valueStyle.lineHeight,
|
|
@@ -8126,7 +8126,7 @@ function DsKpiRow({
|
|
|
8126
8126
|
// Like Web's 1lh × 5ch: the placeholder fills the value line, and its width (set for the display
|
|
8127
8127
|
// number) scales with the value's font so a text value gets a text-sized bar.
|
|
8128
8128
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8129
|
-
|
|
8129
|
+
KjunSkeleton,
|
|
8130
8130
|
{
|
|
8131
8131
|
type: "block",
|
|
8132
8132
|
height: valueStyle.lineHeight,
|
|
@@ -8148,7 +8148,7 @@ function DsKpiRow({
|
|
|
8148
8148
|
}
|
|
8149
8149
|
),
|
|
8150
8150
|
item.animated && typeof item.value === "number" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8151
|
-
|
|
8151
|
+
KjunAnimatedNumber,
|
|
8152
8152
|
{
|
|
8153
8153
|
fromPrevious: true,
|
|
8154
8154
|
value: item.value,
|
|
@@ -8172,7 +8172,7 @@ function DsKpiRow({
|
|
|
8172
8172
|
]
|
|
8173
8173
|
}
|
|
8174
8174
|
),
|
|
8175
|
-
item.desc && (busy ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8175
|
+
item.desc && (busy ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(KjunSkeleton, { type: "block", height: typeStyle("caption").lineHeight, width: geometry2.descriptionSkeletonWidth }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8176
8176
|
KText,
|
|
8177
8177
|
{
|
|
8178
8178
|
style: {
|
|
@@ -8295,8 +8295,8 @@ function MarketIdentity({
|
|
|
8295
8295
|
children: label
|
|
8296
8296
|
}
|
|
8297
8297
|
),
|
|
8298
|
-
((_f = props.interestKeys) == null ? void 0 : _f.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8299
|
-
((_g = props.favoriteKeys) == null ? void 0 : _g.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8298
|
+
((_f = props.interestKeys) == null ? void 0 : _f.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(KjunCollectionMark, { kind: "interest", size: "sm", active: true }),
|
|
8299
|
+
((_g = props.favoriteKeys) == null ? void 0 : _g.has(id)) && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(KjunCollectionMark, { kind: "favorite", size: "sm", active: true }),
|
|
8300
8300
|
(_h = props.renderNameSuffix) == null ? void 0 : _h.call(props, row)
|
|
8301
8301
|
]
|
|
8302
8302
|
}
|
|
@@ -8343,7 +8343,7 @@ function MarketFooter({
|
|
|
8343
8343
|
} = props;
|
|
8344
8344
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
8345
8345
|
pagination && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8346
|
-
|
|
8346
|
+
KjunPagination,
|
|
8347
8347
|
{
|
|
8348
8348
|
currentPage: pagination.page,
|
|
8349
8349
|
totalPages: Math.ceil(pagination.total / pagination.size),
|
|
@@ -8381,7 +8381,7 @@ function MarketFooter({
|
|
|
8381
8381
|
|
|
8382
8382
|
// packages/native/src/market-cards.tsx
|
|
8383
8383
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
8384
|
-
function
|
|
8384
|
+
function KjunMarketCards(props) {
|
|
8385
8385
|
const {
|
|
8386
8386
|
rows = [],
|
|
8387
8387
|
rowKey = "id",
|
|
@@ -8459,13 +8459,13 @@ function DsMarketCards(props) {
|
|
|
8459
8459
|
metricDisplay: display
|
|
8460
8460
|
}) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
8461
8461
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8462
|
-
|
|
8462
|
+
KjunDataState,
|
|
8463
8463
|
{
|
|
8464
8464
|
...props,
|
|
8465
8465
|
loadingPadding: "none",
|
|
8466
8466
|
empty: !rows.length,
|
|
8467
|
-
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8468
|
-
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8467
|
+
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(KjunListSkeleton, { variant: "compact" }),
|
|
8468
|
+
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
8469
8469
|
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_react_native53.View, { children: [
|
|
8470
8470
|
state.pill && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(KText, { style: { textAlign: "right", paddingHorizontal: import_tokens51.tokens.dimension.value16, paddingVertical: import_tokens51.tokens.dimension.value8, ...typeStyle("caption"), color: colors.textSecondary }, children: state.pill.label }),
|
|
8471
8471
|
rows.map((row, i) => {
|
|
@@ -8491,21 +8491,21 @@ function DsMarketCards(props) {
|
|
|
8491
8491
|
children: [
|
|
8492
8492
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MarketIdentity, { row, props, compact: true }),
|
|
8493
8493
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_native53.View, { style: { marginLeft: import_tokens51.tokens.dimension.value12, alignItems: "flex-end" }, children: ((_b = state.pill) == null ? void 0 : _b.format) === "sparkline" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8494
|
-
|
|
8494
|
+
KjunSparkline,
|
|
8495
8495
|
{
|
|
8496
8496
|
data: getValue(row, state.key) || [],
|
|
8497
8497
|
width: import_tokens51.tokens.extensions.marketTable.sparklineWidth,
|
|
8498
8498
|
height: import_tokens51.tokens.extensions.marketTable.sparklineHeight
|
|
8499
8499
|
}
|
|
8500
|
-
) : state.pill ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: metricLoading(row, state.key) ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8501
|
-
|
|
8500
|
+
) : state.pill ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: metricLoading(row, state.key) ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(KjunSkeleton, { type: "block", height: import_tokens51.tokens.extensions.marketTable.valueSkeletonHeight, width: import_tokens51.tokens.extensions.marketTable.valueSkeletonWidth }) : isChange && getValue(row, state.key) != null ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8501
|
+
KjunSignedValue,
|
|
8502
8502
|
{
|
|
8503
8503
|
value: finiteNumber(getValue(row, state.key)),
|
|
8504
8504
|
formatter: () => display(row),
|
|
8505
8505
|
stale: !!getValue(row, "stale"),
|
|
8506
8506
|
tone: "pill"
|
|
8507
8507
|
}
|
|
8508
|
-
) : isPrice && getValue(row, state.key) == null ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8508
|
+
) : isPrice && getValue(row, state.key) == null ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(KjunSkeleton, { type: "block", height: import_tokens51.tokens.extensions.financial.priceSkeletonHeight, width: import_tokens51.tokens.extensions.financial.priceSkeletonWidth }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
8509
8509
|
import_react_native53.View,
|
|
8510
8510
|
{
|
|
8511
8511
|
style: {
|
|
@@ -8555,7 +8555,7 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
|
8555
8555
|
var changeWeight = { fontWeight: typeStyle("label").fontWeight };
|
|
8556
8556
|
var quoteDesktop = { price: typeStyle("control"), change: { ...typeStyle("caption"), ...changeWeight } };
|
|
8557
8557
|
var quoteMobile = { price: typeStyle("input"), change: { ...typeStyle("body"), ...changeWeight } };
|
|
8558
|
-
function
|
|
8558
|
+
function KjunMarketSimpleList(props) {
|
|
8559
8559
|
const {
|
|
8560
8560
|
rows = [],
|
|
8561
8561
|
rowKey = "id",
|
|
@@ -8569,14 +8569,14 @@ function DsMarketSimpleList(props) {
|
|
|
8569
8569
|
} = props, { colors } = useKjunStyles(), mobile = (0, import_react_native54.useWindowDimensions)().width < import_tokens52.tokens.responsive.market;
|
|
8570
8570
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_react_native54.View, { children: [
|
|
8571
8571
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8572
|
-
|
|
8572
|
+
KjunDataState,
|
|
8573
8573
|
{
|
|
8574
8574
|
...props,
|
|
8575
8575
|
loadingPadding: "none",
|
|
8576
8576
|
empty: !rows.length,
|
|
8577
8577
|
emptyText: emptyMessage,
|
|
8578
|
-
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8579
|
-
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8578
|
+
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(KjunListSkeleton, {}),
|
|
8579
|
+
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
8580
8580
|
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native54.View, { children: rows.map((row, i) => {
|
|
8581
8581
|
var _a, _b;
|
|
8582
8582
|
const price = priceValue(row), change = changeValue(row), stale = !!getValue(row, "stale"), source = String(getValue(row, "source") || ""), fetchedAt = String(getValue(row, "fetched_at") || "");
|
|
@@ -8613,7 +8613,7 @@ function DsMarketSimpleList(props) {
|
|
|
8613
8613
|
},
|
|
8614
8614
|
children: [
|
|
8615
8615
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8616
|
-
|
|
8616
|
+
KjunPriceCell,
|
|
8617
8617
|
{
|
|
8618
8618
|
value: price,
|
|
8619
8619
|
formatter: priceFormatter,
|
|
@@ -8634,16 +8634,16 @@ function DsMarketSimpleList(props) {
|
|
|
8634
8634
|
},
|
|
8635
8635
|
children: [
|
|
8636
8636
|
price !== null && ((_b = props.renderPricePrefix) == null ? void 0 : _b.call(props, row)),
|
|
8637
|
-
(finiteNumber(price) !== null || !changeLoading(row) && finiteNumber(change) !== null) && (closingPrice && !stale ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8638
|
-
|
|
8637
|
+
(finiteNumber(price) !== null || !changeLoading(row) && finiteNumber(change) !== null) && (closingPrice && !stale ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(KjunBadge, { variant: "secondary", size: "xs", children: "\uC885\uAC00" }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8638
|
+
KjunFreshness,
|
|
8639
8639
|
{
|
|
8640
8640
|
stale,
|
|
8641
8641
|
source: closingPrice ? "close" : source,
|
|
8642
8642
|
fetchedAt
|
|
8643
8643
|
}
|
|
8644
8644
|
)),
|
|
8645
|
-
changeLoading(row) ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8646
|
-
|
|
8645
|
+
changeLoading(row) ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(KjunSkeleton, { type: "block", height: import_tokens52.tokens.extensions.marketList.changeSkeletonHeight, width: import_tokens52.tokens.extensions.marketList.changeSkeletonWidth }) : change !== null ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8646
|
+
KjunSignedValue,
|
|
8647
8647
|
{
|
|
8648
8648
|
value: change,
|
|
8649
8649
|
stale,
|
|
@@ -8679,12 +8679,12 @@ function DsMarketSimpleList(props) {
|
|
|
8679
8679
|
var import_tokens53 = require("@kjun-ui/tokens");
|
|
8680
8680
|
var import_react_native55 = require("react-native");
|
|
8681
8681
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8682
|
-
function
|
|
8682
|
+
function KjunMarketListPanel({
|
|
8683
8683
|
controls,
|
|
8684
8684
|
children
|
|
8685
8685
|
}) {
|
|
8686
8686
|
const { colors } = useKjunStyles();
|
|
8687
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
8687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(KjunCard, { children: [
|
|
8688
8688
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_native55.View, { children: controls }),
|
|
8689
8689
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8690
8690
|
import_react_native55.View,
|
|
@@ -8706,7 +8706,7 @@ var import_react60 = require("react");
|
|
|
8706
8706
|
var import_react_native56 = require("react-native");
|
|
8707
8707
|
var import_react_native_svg8 = __toESM(require("react-native-svg"), 1);
|
|
8708
8708
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
8709
|
-
function
|
|
8709
|
+
function KjunMarketTable(props) {
|
|
8710
8710
|
const {
|
|
8711
8711
|
rows = [],
|
|
8712
8712
|
columns,
|
|
@@ -8728,13 +8728,13 @@ function DsMarketTable(props) {
|
|
|
8728
8728
|
const render = (row, col) => {
|
|
8729
8729
|
const value = getValue(row, col.key), stale = !!getValue(row, "stale");
|
|
8730
8730
|
if (cellLoading(row, col))
|
|
8731
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(KjunSkeleton, { type: "block", height: import_tokens54.tokens.extensions.marketTable.valueSkeletonHeight, width: import_tokens54.tokens.extensions.marketTable.valueSkeletonWidth });
|
|
8732
8732
|
if (renderCell) return content(renderCell(row, col));
|
|
8733
8733
|
if (["stock_name", "name", "symbol"].includes(col.key))
|
|
8734
8734
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(MarketIdentity, { row, props, table: true });
|
|
8735
8735
|
if (col.type === "sparkline")
|
|
8736
8736
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8737
|
-
|
|
8737
|
+
KjunSparkline,
|
|
8738
8738
|
{
|
|
8739
8739
|
data: Array.isArray(value) ? value : [],
|
|
8740
8740
|
width: import_tokens54.tokens.extensions.marketTable.sparklineWidth,
|
|
@@ -8743,7 +8743,7 @@ function DsMarketTable(props) {
|
|
|
8743
8743
|
);
|
|
8744
8744
|
if (col.type === "price")
|
|
8745
8745
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8746
|
-
|
|
8746
|
+
KjunPriceCell,
|
|
8747
8747
|
{
|
|
8748
8748
|
value: finiteNumber(value),
|
|
8749
8749
|
formatter: priceFormatter,
|
|
@@ -8753,7 +8753,7 @@ function DsMarketTable(props) {
|
|
|
8753
8753
|
);
|
|
8754
8754
|
if (col.type === "percent")
|
|
8755
8755
|
return value == null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(KText, { children: "-" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8756
|
-
|
|
8756
|
+
KjunSignedValue,
|
|
8757
8757
|
{
|
|
8758
8758
|
value: finiteNumber(value),
|
|
8759
8759
|
format: "percent",
|
|
@@ -8769,7 +8769,7 @@ function DsMarketTable(props) {
|
|
|
8769
8769
|
);
|
|
8770
8770
|
const text = formatMetric ? formatMetric(value, col.type || "text", { currency, row, column: col }) : value == null ? "-" : String(value);
|
|
8771
8771
|
return ["investor", "net_amount", "net_volume"].includes(col.type || "") ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8772
|
-
|
|
8772
|
+
KjunSignedValue,
|
|
8773
8773
|
{
|
|
8774
8774
|
value: finiteNumber(value),
|
|
8775
8775
|
formatter: () => text,
|
|
@@ -8800,14 +8800,14 @@ function DsMarketTable(props) {
|
|
|
8800
8800
|
},
|
|
8801
8801
|
children: [
|
|
8802
8802
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8803
|
-
|
|
8803
|
+
KjunDataState,
|
|
8804
8804
|
{
|
|
8805
8805
|
...props,
|
|
8806
8806
|
loadingPadding: "none",
|
|
8807
8807
|
empty: !rows.length,
|
|
8808
8808
|
emptyText: emptyMessage,
|
|
8809
|
-
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8810
|
-
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8809
|
+
loadingContent: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(KjunMarketTableSkeleton, { columns, showActions }),
|
|
8810
|
+
emptyContent: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(KjunEmpty, { text: emptyMessage, description: emptySubMessage }),
|
|
8811
8811
|
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(MarketQuoteTypeContext.Provider, { value: tableQuote, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react_native56.View, { style: { position: "relative", minWidth: 0 }, children: [
|
|
8812
8812
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8813
8813
|
import_react_native56.ScrollView,
|
|
@@ -8842,7 +8842,7 @@ function DsMarketTable(props) {
|
|
|
8842
8842
|
alignItems: "center",
|
|
8843
8843
|
justifyContent: "center"
|
|
8844
8844
|
},
|
|
8845
|
-
children: ["interest", "favorite"].map((kind) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_native56.View, { style: { width: Math.max(import_tokens54.tokens.native.minimumTouchTarget, import_tokens54.tokens.extensions.iconToggle.sizes.xs), alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8845
|
+
children: ["interest", "favorite"].map((kind) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_native56.View, { style: { width: Math.max(import_tokens54.tokens.native.minimumTouchTarget, import_tokens54.tokens.extensions.iconToggle.sizes.xs), alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(KjunCollectionMark, { kind, size: "md" }) }, kind))
|
|
8846
8846
|
}
|
|
8847
8847
|
),
|
|
8848
8848
|
columns.map((col, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
@@ -8875,7 +8875,7 @@ function DsMarketTable(props) {
|
|
|
8875
8875
|
}
|
|
8876
8876
|
),
|
|
8877
8877
|
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8878
|
-
|
|
8878
|
+
KjunIcon,
|
|
8879
8879
|
{
|
|
8880
8880
|
name: sortKey === col.key ? sortOrder === "asc" ? "sort-ascending" : "sort-descending" : "arrows-sort",
|
|
8881
8881
|
size: import_tokens54.tokens.extensions.marketTable.sortIconSize,
|
|
@@ -8921,7 +8921,7 @@ function DsMarketTable(props) {
|
|
|
8921
8921
|
},
|
|
8922
8922
|
children: [
|
|
8923
8923
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8924
|
-
|
|
8924
|
+
KjunIconToggle,
|
|
8925
8925
|
{
|
|
8926
8926
|
size: "xs",
|
|
8927
8927
|
active: (_a = props.interestKeys) == null ? void 0 : _a.has(id),
|
|
@@ -8940,7 +8940,7 @@ function DsMarketTable(props) {
|
|
|
8940
8940
|
}
|
|
8941
8941
|
),
|
|
8942
8942
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8943
|
-
|
|
8943
|
+
KjunIconToggle,
|
|
8944
8944
|
{
|
|
8945
8945
|
size: "xs",
|
|
8946
8946
|
active: (_d = props.favoriteKeys) == null ? void 0 : _d.has(id),
|
|
@@ -8974,7 +8974,7 @@ function DsMarketTable(props) {
|
|
|
8974
8974
|
children: [
|
|
8975
8975
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_native56.View, { style: { alignSelf: col.align === "right" ? "flex-end" : col.align === "center" ? "center" : void 0 }, children: render(row, col) }),
|
|
8976
8976
|
col.key === (priceCol == null ? void 0 : priceCol.key) && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8977
|
-
|
|
8977
|
+
KjunFreshness,
|
|
8978
8978
|
{
|
|
8979
8979
|
stale: !!getValue(row, "stale"),
|
|
8980
8980
|
source: String(getValue(row, "source") || ""),
|
|
@@ -9015,7 +9015,7 @@ var import_react61 = require("react");
|
|
|
9015
9015
|
var import_react_native57 = require("react-native");
|
|
9016
9016
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
9017
9017
|
var LastListRow = (0, import_react61.createContext)(false);
|
|
9018
|
-
function
|
|
9018
|
+
function KjunListRow({ title, description, leading, trailing, actions, href, disabled = false, onPress }) {
|
|
9019
9019
|
const { colors } = useKjunStyles(), last = (0, import_react61.useContext)(LastListRow);
|
|
9020
9020
|
const parts = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
9021
9021
|
leading && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react_native57.View, { children: content(leading) }),
|
|
@@ -9031,7 +9031,7 @@ function DsListRow({ title, description, leading, trailing, actions, href, disab
|
|
|
9031
9031
|
actions && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react_native57.View, { pointerEvents: disabled ? "none" : "auto", ...disabled && import_react_native57.Platform.OS === "web" ? { inert: true } : {}, style: { maxWidth: "45%", flexDirection: "row", flexWrap: "wrap", gap: import_tokens55.tokens.extensions.list.actionsGap, paddingRight: import_tokens55.tokens.extensions.list.actionsPadding, opacity: disabled ? import_tokens55.tokens.states.opacity.disabled : 1 }, children: content(actions) })
|
|
9032
9032
|
] });
|
|
9033
9033
|
}
|
|
9034
|
-
function
|
|
9034
|
+
function KjunListSection({ title, description, actions, children, ariaLabel }) {
|
|
9035
9035
|
const { colors } = useKjunStyles();
|
|
9036
9036
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react_native57.View, { style: { minWidth: 0, backgroundColor: colors.surface }, children: [
|
|
9037
9037
|
(title || description || actions) && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react_native57.View, { style: { flexDirection: "row", alignItems: "center", gap: import_tokens55.tokens.extensions.list.gap, padding: import_tokens55.tokens.extensions.list.padding }, children: [
|
|
@@ -9050,7 +9050,7 @@ var import_tokens56 = require("@kjun-ui/tokens");
|
|
|
9050
9050
|
var import_react62 = require("react");
|
|
9051
9051
|
var import_react_native58 = require("react-native");
|
|
9052
9052
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
9053
|
-
function
|
|
9053
|
+
function KjunTopNavigation({ title, description, leading, actions, safeAreaTop = 0 }) {
|
|
9054
9054
|
const { colors } = useKjunStyles();
|
|
9055
9055
|
const geometry2 = import_tokens56.tokens.extensions.topNavigation;
|
|
9056
9056
|
const titleInset = Math.max(0, (geometry2.controlSize - import_tokens56.tokens.typography.sectionTitle.lineHeightPx) / 2);
|
|
@@ -9073,7 +9073,7 @@ function DsTopNavigation({ title, description, leading, actions, safeAreaTop = 0
|
|
|
9073
9073
|
actions && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TopNavigationContext.Provider, { value: { ...geometry2, slot: "actions" }, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react_native58.View, { style: { minHeight: geometry2.controlSize, minWidth: 0, maxWidth: "100%", marginLeft: "auto", flexShrink: 1, flexDirection: "row", flexWrap: "wrap", alignItems: "center", justifyContent: "flex-end", gap: geometry2.actionsGap }, children: actionList.map((action, index) => index < actionList.length - 1 ? content(action) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react_native58.View, { onLayout: square("trailing"), style: { flexShrink: 1, minWidth: 0, maxWidth: "100%", marginRight: iconEdges.trailing ? -edgeInset : 0 }, children: content(action) }, "trailing")) }) })
|
|
9074
9074
|
] }) }) });
|
|
9075
9075
|
}
|
|
9076
|
-
function
|
|
9076
|
+
function KjunBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\uC0C9", safeAreaBottom = 0, keyboardVisible = false, hideOnKeyboard = true, onNavigate }) {
|
|
9077
9077
|
const { colors } = useKjunStyles();
|
|
9078
9078
|
const geometry2 = import_tokens56.tokens.extensions.bottomNavigation;
|
|
9079
9079
|
const hasIcons = items.some((item) => item.icon);
|
|
@@ -9120,7 +9120,7 @@ function DsBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\uC0
|
|
|
9120
9120
|
},
|
|
9121
9121
|
children: [
|
|
9122
9122
|
hasIcons && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react_native58.View, { style: { width: geometry2.iconSize, height: geometry2.iconSize, flexShrink: 0 }, children: [
|
|
9123
|
-
item.icon && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
9123
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(KjunIcon, { name: item.icon, size: geometry2.iconSize, color: ink }),
|
|
9124
9124
|
badge
|
|
9125
9125
|
] }),
|
|
9126
9126
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react_native58.View, { style: { maxWidth: "100%" }, children: [
|
|
@@ -9134,7 +9134,7 @@ function DsBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\uC0
|
|
|
9134
9134
|
);
|
|
9135
9135
|
}) });
|
|
9136
9136
|
}
|
|
9137
|
-
function
|
|
9137
|
+
function KjunBottomActionBar({ description, children, safeAreaBottom = 0, keyboardVisible = false, hideOnKeyboard = false }) {
|
|
9138
9138
|
const { colors } = useKjunStyles();
|
|
9139
9139
|
const [width, setWidth] = (0, import_react62.useState)(0);
|
|
9140
9140
|
const geometry2 = import_tokens56.tokens.extensions.navigation;
|
|
@@ -9162,7 +9162,7 @@ var import_react63 = require("react");
|
|
|
9162
9162
|
var import_react_native59 = require("react-native");
|
|
9163
9163
|
var import_tokens57 = require("@kjun-ui/tokens");
|
|
9164
9164
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
9165
|
-
function
|
|
9165
|
+
function KjunImage({ src, source, alt, decorative = false, aspectRatio = 1, fit = "cover", fallback: fallback2, onLoad, onError }) {
|
|
9166
9166
|
const { colors } = useKjunStyles();
|
|
9167
9167
|
const request = JSON.stringify(source != null ? source : src), current = (0, import_react63.useRef)({ request, version: 0 });
|
|
9168
9168
|
if (current.current.request !== request) current.current = { request, version: current.current.version + 1 };
|
|
@@ -9176,23 +9176,23 @@ function DsImage({ src, source, alt, decorative = false, aspectRatio = 1, fit =
|
|
|
9176
9176
|
setFailed(version);
|
|
9177
9177
|
onError == null ? void 0 : onError();
|
|
9178
9178
|
}
|
|
9179
|
-
} }, version) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_native59.View, { accessible: !decorative, accessibilityRole: "image", accessibilityLabel: decorative ? void 0 : alt, "aria-hidden": decorative || void 0, style: { flex: 1, alignItems: "center", justifyContent: "center" }, children: content(fallback2 != null ? fallback2 : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9179
|
+
} }, version) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_native59.View, { accessible: !decorative, accessibilityRole: "image", accessibilityLabel: decorative ? void 0 : alt, "aria-hidden": decorative || void 0, style: { flex: 1, alignItems: "center", justifyContent: "center" }, children: content(fallback2 != null ? fallback2 : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(KjunIcon, { name: "image", size: import_tokens57.tokens.extensions.image.fallbackIconSize, color: colors.textSecondary }), { color: colors.textSecondary, fontWeight: typeStyle("control").fontWeight, textAlign: "center" }) }) });
|
|
9180
9180
|
}
|
|
9181
|
-
function
|
|
9181
|
+
function KjunAvatar({ src, source, name = "", alt, decorative = false, size = "md", shape = "circle", fallback: fallback2, onLoad, onError }) {
|
|
9182
9182
|
const { colors } = useKjunStyles(), initial = Array.from(name.trim())[0];
|
|
9183
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_native59.View, { style: { width: import_tokens57.tokens.extensions.avatar[size], height: import_tokens57.tokens.extensions.avatar[size], borderRadius: shape === "circle" ? import_tokens57.tokens.radius.radius9999 : import_tokens57.tokens.radius.radius8, overflow: "hidden", flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_native59.View, { style: { width: import_tokens57.tokens.extensions.avatar[size], height: import_tokens57.tokens.extensions.avatar[size], borderRadius: shape === "circle" ? import_tokens57.tokens.radius.radius9999 : import_tokens57.tokens.radius.radius8, overflow: "hidden", flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(KjunImage, { src, source, alt: alt || name || "\uC0AC\uC6A9\uC790", decorative, fallback: fallback2 != null ? fallback2 : initial ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(KText, { style: { ...typeStyle(size === "sm" ? "control" : size === "lg" ? "sectionTitle" : "input"), fontWeight: typeStyle("control").fontWeight, color: colors.textSecondary }, children: initial.toLocaleUpperCase() }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(KjunIcon, { name: "user", size: import_tokens57.tokens.extensions.avatar.fallbackIconSizes[size] }), onLoad, onError }) });
|
|
9184
9184
|
}
|
|
9185
9185
|
|
|
9186
9186
|
// packages/native/src/chip.tsx
|
|
9187
9187
|
var import_react_native60 = require("react-native");
|
|
9188
9188
|
var import_tokens58 = require("@kjun-ui/tokens");
|
|
9189
9189
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
9190
|
-
function
|
|
9190
|
+
function KjunChip({ label, icon, removable = false, disabled = false, size = "md", removeLabel, onRemove }) {
|
|
9191
9191
|
const { colors } = useKjunStyles();
|
|
9192
9192
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react_native60.View, { style: { alignSelf: "flex-start", maxWidth: "100%", minWidth: 0, flexShrink: 1, flexDirection: "row", alignItems: "center", gap: import_tokens58.tokens.extensions.chip.gap, minHeight: removable ? import_tokens58.tokens.extensions.chip.nativeRemoveSize : import_tokens58.tokens.extensions.chip[size], paddingVertical: removable ? 0 : import_tokens58.tokens.extensions.chip.paddingY, paddingLeft: import_tokens58.tokens.extensions.chip.paddingX, paddingRight: removable ? 0 : import_tokens58.tokens.extensions.chip.paddingX, borderRadius: import_tokens58.tokens.extensions.chip.radius, backgroundColor: colors.secondary, opacity: disabled ? import_tokens58.tokens.states.opacity.disabled : 1 }, children: [
|
|
9193
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9193
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(KjunIcon, { name: icon, size: import_tokens58.tokens.extensions.chip.iconSizes[size] }),
|
|
9194
9194
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(KText, { style: { ...typeStyle(import_tokens58.tokens.extensions.chip.typography[size]), flexShrink: 1, minWidth: 0 }, children: label }),
|
|
9195
|
-
removable && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(AccessiblePressable, { accessibilityRole: "button", accessibilityLabel: removeLabel || label + " \uC0AD\uC81C", disabled, accessibilityState: { disabled }, onPress: onRemove, style: { width: import_tokens58.tokens.extensions.chip.nativeRemoveSize, height: import_tokens58.tokens.extensions.chip.nativeRemoveSize, borderRadius: import_tokens58.tokens.extensions.chip.radius, alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9195
|
+
removable && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(AccessiblePressable, { accessibilityRole: "button", accessibilityLabel: removeLabel || label + " \uC0AD\uC81C", disabled, accessibilityState: { disabled }, onPress: onRemove, style: { width: import_tokens58.tokens.extensions.chip.nativeRemoveSize, height: import_tokens58.tokens.extensions.chip.nativeRemoveSize, borderRadius: import_tokens58.tokens.extensions.chip.radius, alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(KjunIcon, { name: "x", size: import_tokens58.tokens.extensions.chip.removeIconSizes[size] }) })
|
|
9196
9196
|
] });
|
|
9197
9197
|
}
|
|
9198
9198
|
|
|
@@ -9489,10 +9489,10 @@ function RangeInput({
|
|
|
9489
9489
|
}
|
|
9490
9490
|
);
|
|
9491
9491
|
}
|
|
9492
|
-
function
|
|
9492
|
+
function KjunSlider(props) {
|
|
9493
9493
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(RangeInput, { ...props });
|
|
9494
9494
|
}
|
|
9495
|
-
function
|
|
9495
|
+
function KjunRangeSlider(props) {
|
|
9496
9496
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(RangeInput, { ...props });
|
|
9497
9497
|
}
|
|
9498
9498
|
|
|
@@ -9507,7 +9507,7 @@ var componentIcons = { minus: import_minus.default };
|
|
|
9507
9507
|
|
|
9508
9508
|
// packages/native/src/quantity-stepper.tsx
|
|
9509
9509
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
9510
|
-
function
|
|
9510
|
+
function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disabled = false, error = false, size = "md", block = false, id, ariaLabel, onValueChange, onChangeCommit, onInvalidInput }) {
|
|
9511
9511
|
const { colors, fontFamily } = useKjunStyles();
|
|
9512
9512
|
const field = useKjunField();
|
|
9513
9513
|
const invalid = error || !!(field == null ? void 0 : field.error);
|
|
@@ -9605,7 +9605,7 @@ function DsQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disab
|
|
|
9605
9605
|
const surfaceBox = { position: "absolute", left: 0, right: 0, top: "50%", height: import_tokens60.tokens.input[size].height, marginTop: -import_tokens60.tokens.input[size].height / 2, borderRadius: surface.spec.radius };
|
|
9606
9606
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(IconFallbacks, { icons: componentIcons, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_react_native62.View, { style: { flexDirection: "row", alignItems: "center", alignSelf: block ? "stretch" : "flex-start", maxWidth: "100%" }, children: [
|
|
9607
9607
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_native62.View, { pointerEvents: "none", "aria-hidden": true, style: { ...surfaceBox, backgroundColor: colors.inputBg } }),
|
|
9608
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CompoundTarget, { square: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9608
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CompoundTarget, { square: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(KjunButton, { size, style: decreaseStyle, variant: "ghost", ariaLabel: "\uC218\uB7C9 \uC904\uC774\uAE30", disabled: blocked || value <= min, onPress: () => move(-1), prefixIcon: "minus" }) }),
|
|
9609
9609
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_native62.View, { style: { flex: block ? 1 : void 0, width: block ? void 0 : geometry2.valueWidth, minWidth: 0, minHeight: finePointer() ? void 0 : import_tokens60.tokens.native.minimumTouchTarget, justifyContent: "center" }, ...fieldTarget(() => {
|
|
9610
9610
|
var _a;
|
|
9611
9611
|
return (_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -9638,7 +9638,7 @@ function DsQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disab
|
|
|
9638
9638
|
style: { width: "100%", minWidth: 0, ...surface.style, borderRadius: 0, borderTopColor: "transparent", borderBottomColor: "transparent", borderLeftColor: "transparent", borderRightColor: "transparent", backgroundColor: !blocked && (surface.active || surface.hovered) ? colors.hover : "transparent", outlineWidth: 0, color: surface.ink, fontFamily, ...inputTypeStyle(size), textAlign: "center", paddingHorizontal: surface.spec.padding - import_tokens60.tokens.border.controlWidth, paddingVertical: 0 }
|
|
9639
9639
|
}
|
|
9640
9640
|
) }),
|
|
9641
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CompoundTarget, { square: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9641
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(CompoundTarget, { square: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(KjunButton, { size, style: increaseStyle, variant: "ghost", ariaLabel: "\uC218\uB7C9 \uB298\uB9AC\uAE30", disabled: blocked || max !== void 0 && value >= max, onPress: () => move(1), prefixIcon: "plus" }) }),
|
|
9642
9642
|
(invalid || surface.active) && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_native62.View, { pointerEvents: "none", "aria-hidden": true, style: { ...surfaceBox, borderWidth: invalid ? import_tokens60.tokens.border.controlWidth : import_tokens60.tokens.states.focus.width, borderColor: invalid ? colors.danger : colors.focusRing } })
|
|
9643
9643
|
] }) });
|
|
9644
9644
|
}
|
|
@@ -9648,7 +9648,7 @@ var import_react66 = require("react");
|
|
|
9648
9648
|
var import_react_native63 = require("react-native");
|
|
9649
9649
|
var import_tokens61 = require("@kjun-ui/tokens");
|
|
9650
9650
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
9651
|
-
function
|
|
9651
|
+
function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1, secondStep = 1, disabled = false, error = false, clearable = true, size = "md", ariaLabel = "\uC2DC\uAC04", onValueChange, onChangeCommit }) {
|
|
9652
9652
|
const geometry2 = import_tokens61.tokens.extensions.timePicker, spec = import_tokens61.tokens.input[size];
|
|
9653
9653
|
const { colors } = useKjunStyles();
|
|
9654
9654
|
const first = (0, import_react66.useRef)(null);
|
|
@@ -9669,7 +9669,7 @@ function DsTimePicker({ value, precision = "minute", min, max, minuteStep = 1, s
|
|
|
9669
9669
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_react_native63.View, { accessibilityLabel: ariaLabel, style: { flexDirection: "row", alignItems: "center", maxWidth: "100%", minWidth: 0, backgroundColor: colors.inputBg, borderRadius: spec.radius }, children: [
|
|
9670
9670
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react_native63.View, { style: { flex: 1, flexDirection: "row", alignItems: "center", minWidth: 0 }, children: ["\uC2DC", "\uBD84", "\uCD08"].slice(0, precision === "second" ? 3 : 2).map((label, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_react66.Fragment, { children: [
|
|
9671
9671
|
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(KText, { "aria-hidden": true, style: { ...inputTypeStyle(size), width: geometry2.separatorWidth, textAlign: "center", color: disabled || !valid ? colors.textDisabled : colors.textSecondary }, children: ":" }),
|
|
9672
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FieldContext.Provider, { value: { ...field, id: index === 0 ? fieldId : `${fieldId}-${index}` }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CompoundControlContext.Provider, { value: { size, focusRef: index === 0 ? first : void 0, onFocusChange: setFocused, leading: index === 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react_native63.View, { style: { flexShrink: 0, minWidth: geometry2.segmentMinimumWidth }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9672
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FieldContext.Provider, { value: { ...field, id: index === 0 ? fieldId : `${fieldId}-${index}` }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CompoundControlContext.Provider, { value: { size, focusRef: index === 0 ? first : void 0, onFocusChange: setFocused, leading: index === 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react_native63.View, { style: { flexShrink: 0, minWidth: geometry2.segmentMinimumWidth }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(KjunSelect, { value: time === null ? null : domain.part(time, index), options: domain.options(value, index).map((n) => ({ value: n, label: String(n).padStart(2, "0") })), onValueChange: (next) => {
|
|
9673
9673
|
if (typeof next === "number") change(domain.select(value, index, next));
|
|
9674
9674
|
}, onOpenChange: (open) => setOpened(open ? index : null), ariaLabel: ((field == null ? void 0 : field.label) || ariaLabel) + " " + label, placeholder: label, disabled: disabled || !valid, error, size, clearable: false, searchable: false }) }) }) })
|
|
9675
9675
|
] }, label)) }),
|