@kjun-ui/native 0.7.0 → 0.8.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/dist/index.cjs +77 -121
- package/dist/index.js +128 -172
- package/dist/index.web.cjs +77 -121
- package/dist/index.web.js +128 -172
- package/dist/styles.css +24 -42
- package/dist/types/packages/native/src/skeleton-base.d.cts +1 -1
- package/dist/types/packages/native/src/skeleton-base.d.ts +1 -1
- package/dist/types/packages/native/src/skeletons.d.cts +8 -3
- package/dist/types/packages/native/src/skeletons.d.ts +8 -3
- package/dist/types/shared/package-runtime/chart-skeleton.d.cts +12 -0
- package/dist/types/shared/package-runtime/chart-skeleton.d.ts +12 -0
- package/package.json +3 -3
package/dist/index.web.js
CHANGED
|
@@ -2366,36 +2366,6 @@ function KjunSkeleton({
|
|
|
2366
2366
|
))
|
|
2367
2367
|
}
|
|
2368
2368
|
),
|
|
2369
|
-
type === "chart" && /* @__PURE__ */ jsxs8(View11, { style: [frame, { height: height || tokens11.extensions.skeleton.chartHeight }], children: [
|
|
2370
|
-
/* @__PURE__ */ jsx15(
|
|
2371
|
-
View11,
|
|
2372
|
-
{
|
|
2373
|
-
style: {
|
|
2374
|
-
flex: 1,
|
|
2375
|
-
flexDirection: "row",
|
|
2376
|
-
alignItems: "flex-end",
|
|
2377
|
-
justifyContent: "space-around",
|
|
2378
|
-
gap: tokens11.extensions.skeleton.gap
|
|
2379
|
-
// Bars stand on the axis line, like ChartSkeleton.
|
|
2380
|
-
},
|
|
2381
|
-
children: [40, 65, 50, 80, 60, 90, 75].map((h, i) => /* @__PURE__ */ jsx15(
|
|
2382
|
-
Animated6.View,
|
|
2383
|
-
{
|
|
2384
|
-
style: {
|
|
2385
|
-
flex: 1,
|
|
2386
|
-
maxWidth: tokens11.extensions.skeleton.chartBarMaxWidth,
|
|
2387
|
-
height: `${h}%`,
|
|
2388
|
-
backgroundColor: shimmer,
|
|
2389
|
-
borderTopLeftRadius: tokens11.radius.radius4,
|
|
2390
|
-
borderTopRightRadius: tokens11.radius.radius4
|
|
2391
|
-
}
|
|
2392
|
-
},
|
|
2393
|
-
i
|
|
2394
|
-
))
|
|
2395
|
-
}
|
|
2396
|
-
),
|
|
2397
|
-
block("100%", tokens11.extensions.skeleton.chartAxisHeight, { backgroundColor: colors.border })
|
|
2398
|
-
] }),
|
|
2399
2369
|
type === "stat" && /* @__PURE__ */ jsxs8(
|
|
2400
2370
|
View11,
|
|
2401
2371
|
{
|
|
@@ -6534,9 +6504,23 @@ var KjunErrorBoundary = class extends Component {
|
|
|
6534
6504
|
|
|
6535
6505
|
// packages/native/src/skeletons.tsx
|
|
6536
6506
|
import { tokens as tokens38 } from "@kjun-ui/tokens";
|
|
6537
|
-
import {
|
|
6538
|
-
import { Animated as Animated17, View as View33, useWindowDimensions as useWindowDimensions6 } from "react-native";
|
|
6539
|
-
import Svg5, {
|
|
6507
|
+
import { useEffect as useEffect22, useRef as useRef30, useState as useState33 } from "react";
|
|
6508
|
+
import { Animated as Animated17, Platform as Platform24, View as View33, useWindowDimensions as useWindowDimensions6 } from "react-native";
|
|
6509
|
+
import Svg5, { Path as Path4 } from "react-native-svg";
|
|
6510
|
+
|
|
6511
|
+
// shared/package-runtime/chart-skeleton.ts
|
|
6512
|
+
var chartFrameViewBox = "0 0 600 240";
|
|
6513
|
+
var chartFramePath = "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590";
|
|
6514
|
+
var chartSkeletonMaxCount = 100;
|
|
6515
|
+
function chartSkeletonCount(value) {
|
|
6516
|
+
return Number.isFinite(value) ? Math.min(chartSkeletonMaxCount, Math.max(1, Math.floor(value))) : 1;
|
|
6517
|
+
}
|
|
6518
|
+
function chartMatrixMuted(row, column) {
|
|
6519
|
+
return (row + column + 2) % 3 === 0;
|
|
6520
|
+
}
|
|
6521
|
+
function chartDonutHole(height, thickness) {
|
|
6522
|
+
return Math.max(0, height * 0.8 - 2 * thickness);
|
|
6523
|
+
}
|
|
6540
6524
|
|
|
6541
6525
|
// packages/native/src/market-skeleton.tsx
|
|
6542
6526
|
import { tokens as tokens37 } from "@kjun-ui/tokens";
|
|
@@ -6594,7 +6578,7 @@ function KjunMarketTableSkeleton({ columns = [], rows = 8, showActions = false }
|
|
|
6594
6578
|
}
|
|
6595
6579
|
|
|
6596
6580
|
// packages/native/src/skeletons.tsx
|
|
6597
|
-
import { jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6581
|
+
import { Fragment as Fragment12, jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6598
6582
|
function KjunListSkeleton({
|
|
6599
6583
|
rows = 8,
|
|
6600
6584
|
variant = "market",
|
|
@@ -6695,26 +6679,23 @@ function KjunFormSkeleton({
|
|
|
6695
6679
|
}
|
|
6696
6680
|
);
|
|
6697
6681
|
}
|
|
6682
|
+
var chartPart = (name) => Platform24.OS === "web" ? { dataSet: { kjunChartPart: name } } : {};
|
|
6698
6683
|
function KjunChartSkeleton({
|
|
6684
|
+
kind = "frame",
|
|
6685
|
+
height = tokens38.extensions.chartSkeleton.height,
|
|
6699
6686
|
loadingText = "\uCC28\uD2B8\uB97C \uBD88\uB7EC\uC624\uB294 \uC911",
|
|
6700
|
-
|
|
6701
|
-
|
|
6687
|
+
skeleton = true,
|
|
6688
|
+
loadingDelay = 0,
|
|
6689
|
+
rows = 8,
|
|
6690
|
+
columns = 14
|
|
6702
6691
|
}) {
|
|
6703
|
-
const { colors } = useKjunStyles(), reduced = useReducedMotion(), opacity = useRef30(new Animated17.Value(1)).current;
|
|
6692
|
+
const { colors } = useKjunStyles(), reduced = useReducedMotion(), opacity = useRef30(new Animated17.Value(1)).current, revealed = useLoadingReveal(true, loadingDelay), [measured, setMeasured] = useState33(0), thickness = tokens38.extensions.chartSkeleton.donutThickness, boxHeight = typeof height === "number" ? height : measured, hole = boxHeight > 0 ? chartDonutHole(boxHeight, thickness) : void 0, rowCount = chartSkeletonCount(rows), columnCount = chartSkeletonCount(columns), status = revealed && loadingText ? "status" : void 0, hidden = { "aria-hidden": true, importantForAccessibility: "no-hide-descendants" };
|
|
6704
6693
|
useEffect22(() => {
|
|
6705
|
-
if (reduced) return;
|
|
6694
|
+
if (reduced || !skeleton) return;
|
|
6706
6695
|
const loop = Animated17.loop(
|
|
6707
6696
|
Animated17.sequence([
|
|
6708
|
-
Animated17.timing(opacity, {
|
|
6709
|
-
|
|
6710
|
-
duration: tokens38.motion.shimmer / 2,
|
|
6711
|
-
useNativeDriver: true
|
|
6712
|
-
}),
|
|
6713
|
-
Animated17.timing(opacity, {
|
|
6714
|
-
toValue: 1,
|
|
6715
|
-
duration: tokens38.motion.shimmer / 2,
|
|
6716
|
-
useNativeDriver: true
|
|
6717
|
-
})
|
|
6697
|
+
Animated17.timing(opacity, { toValue: 0.55, duration: tokens38.motion.shimmer / 2, useNativeDriver: true }),
|
|
6698
|
+
Animated17.timing(opacity, { toValue: 1, duration: tokens38.motion.shimmer / 2, useNativeDriver: true })
|
|
6718
6699
|
])
|
|
6719
6700
|
);
|
|
6720
6701
|
loop.start();
|
|
@@ -6722,92 +6703,67 @@ function KjunChartSkeleton({
|
|
|
6722
6703
|
loop.stop();
|
|
6723
6704
|
opacity.setValue(1);
|
|
6724
6705
|
};
|
|
6725
|
-
}, [opacity, reduced]);
|
|
6726
|
-
return /* @__PURE__ */
|
|
6706
|
+
}, [opacity, reduced, skeleton]);
|
|
6707
|
+
return /* @__PURE__ */ jsx39(
|
|
6727
6708
|
Animated17.View,
|
|
6728
6709
|
{
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
importantForAccessibility: "no-hide-descendants",
|
|
6739
|
-
children: [
|
|
6710
|
+
onLayout: typeof height === "number" ? void 0 : (event) => setMeasured(event.nativeEvent.layout.height),
|
|
6711
|
+
style: { height, alignItems: "center", justifyContent: "center", width: "100%", minWidth: 0, opacity: revealed ? opacity : 0 },
|
|
6712
|
+
"aria-hidden": revealed ? void 0 : true,
|
|
6713
|
+
importantForAccessibility: revealed ? void 0 : "no-hide-descendants",
|
|
6714
|
+
...Platform24.OS === "web" ? { dataSet: { kjunChartKind: kind, skeleton: skeleton ? void 0 : "false" } } : {},
|
|
6715
|
+
children: !skeleton ? /* @__PURE__ */ jsxs27(View33, { ...chartPart("loading"), role: status, style: { alignItems: "center", gap: tokens38.dimension.value12 }, children: [
|
|
6716
|
+
/* @__PURE__ */ jsx39(View33, { ...hidden, children: /* @__PURE__ */ jsx39(KjunSpinner, { size: "md" }) }),
|
|
6717
|
+
!!loadingText && /* @__PURE__ */ jsx39(KText, { style: { ...typeStyle("body"), color: colors.textSecondary, textAlign: "center", maxWidth: "100%" }, children: loadingText })
|
|
6718
|
+
] }) : /* @__PURE__ */ jsxs27(Fragment12, { children: [
|
|
6740
6719
|
kind === "donut" ? /* @__PURE__ */ jsx39(
|
|
6741
6720
|
View33,
|
|
6742
6721
|
{
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
borderWidth: tokens38.extensions.chartSkeleton.donutThickness,
|
|
6747
|
-
borderColor: colors.skeleton,
|
|
6748
|
-
borderRadius: tokens38.radius.radius9999,
|
|
6749
|
-
alignItems: "center",
|
|
6750
|
-
justifyContent: "center"
|
|
6751
|
-
},
|
|
6752
|
-
children: /* @__PURE__ */ jsx39(KjunSkeleton, { type: "block", width: tokens38.extensions.chartSkeleton.donutLabelWidth, height: tokens38.extensions.chartSkeleton.donutLabelHeight })
|
|
6722
|
+
...chartPart("donut"),
|
|
6723
|
+
...hidden,
|
|
6724
|
+
style: { height: "80%", aspectRatio: 1, borderWidth: thickness, borderColor: colors.skeleton, borderRadius: tokens38.radius.radius9999 }
|
|
6753
6725
|
}
|
|
6754
|
-
) : /* @__PURE__ */
|
|
6755
|
-
|
|
6726
|
+
) : kind === "matrix" ? /* @__PURE__ */ jsx39(View33, { ...chartPart("matrix"), ...hidden, style: { alignSelf: "stretch", flex: 1, gap: tokens38.dimension.value4 }, children: Array.from({ length: rowCount }, (_, row) => /* @__PURE__ */ jsx39(View33, { style: { flex: 1, flexDirection: "row", gap: tokens38.dimension.value4 }, children: Array.from({ length: columnCount }, (_2, column) => /* @__PURE__ */ jsx39(
|
|
6727
|
+
View33,
|
|
6756
6728
|
{
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6729
|
+
...chartPart("cell"),
|
|
6730
|
+
style: {
|
|
6731
|
+
flex: 1,
|
|
6732
|
+
borderRadius: tokens38.extensions.skeleton.lineRadius,
|
|
6733
|
+
backgroundColor: colors.skeleton,
|
|
6734
|
+
opacity: chartMatrixMuted(row, column) ? tokens38.states.opacity.pending : 1
|
|
6735
|
+
}
|
|
6736
|
+
},
|
|
6737
|
+
column
|
|
6738
|
+
)) }, row)) }) : /* @__PURE__ */ jsx39(View33, { ...chartPart("plot"), ...hidden, style: { alignSelf: "stretch", flex: 1 }, children: /* @__PURE__ */ jsx39(Svg5, { viewBox: chartFrameViewBox, preserveAspectRatio: "none", width: "100%", height: "100%", children: /* @__PURE__ */ jsx39(Path4, { d: chartFramePath, fill: "none", stroke: colors.chartGrid, strokeWidth: tokens38.border.defaultWidth, vectorEffect: "non-scaling-stroke" }) }) }),
|
|
6739
|
+
!!loadingText && /* @__PURE__ */ jsx39(
|
|
6740
|
+
View33,
|
|
6741
|
+
{
|
|
6742
|
+
...chartPart("status"),
|
|
6743
|
+
role: status,
|
|
6744
|
+
pointerEvents: "none",
|
|
6745
|
+
style: { position: "absolute", inset: 0, alignItems: "center", justifyContent: "center" },
|
|
6746
|
+
children: /* @__PURE__ */ jsx39(
|
|
6747
|
+
KText,
|
|
6748
|
+
{
|
|
6749
|
+
style: {
|
|
6750
|
+
...typeStyle("body"),
|
|
6751
|
+
paddingHorizontal: tokens38.dimension.value12,
|
|
6752
|
+
paddingVertical: tokens38.dimension.value4,
|
|
6753
|
+
borderRadius: tokens38.radius.radius6,
|
|
6754
|
+
borderWidth: kind === "donut" ? 0 : tokens38.border.defaultWidth,
|
|
6755
|
+
borderColor: colors.chartGrid,
|
|
6756
|
+
backgroundColor: colors.surface,
|
|
6757
|
+
color: colors.textSecondary,
|
|
6758
|
+
maxWidth: kind === "donut" && hole != null ? hole : "90%",
|
|
6759
|
+
textAlign: "center"
|
|
6782
6760
|
},
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
Path4,
|
|
6787
|
-
{
|
|
6788
|
-
d: `M${55 + i * 75} ${195 - h}V${225 - h / 2}`,
|
|
6789
|
-
fill: "none",
|
|
6790
|
-
stroke: colors.skeleton,
|
|
6791
|
-
strokeWidth: 4
|
|
6792
|
-
}
|
|
6793
|
-
),
|
|
6794
|
-
/* @__PURE__ */ jsx39(
|
|
6795
|
-
Rect3,
|
|
6796
|
-
{
|
|
6797
|
-
x: 35 + i * 75,
|
|
6798
|
-
y: kind === "candle" ? 210 - h : 220 - h,
|
|
6799
|
-
width: kind === "candle" ? 28 : 42,
|
|
6800
|
-
height: kind === "candle" ? h / 2 : h,
|
|
6801
|
-
rx: 3,
|
|
6802
|
-
fill: colors.skeleton
|
|
6803
|
-
}
|
|
6804
|
-
)
|
|
6805
|
-
] }, i))
|
|
6806
|
-
]
|
|
6761
|
+
children: loadingText
|
|
6762
|
+
}
|
|
6763
|
+
)
|
|
6807
6764
|
}
|
|
6808
|
-
)
|
|
6809
|
-
|
|
6810
|
-
]
|
|
6765
|
+
)
|
|
6766
|
+
] })
|
|
6811
6767
|
}
|
|
6812
6768
|
);
|
|
6813
6769
|
}
|
|
@@ -6831,7 +6787,7 @@ import Svg6, {
|
|
|
6831
6787
|
import { tokens as tokens40 } from "@kjun-ui/tokens";
|
|
6832
6788
|
|
|
6833
6789
|
// shared/package-runtime/use-number-motion.ts
|
|
6834
|
-
import { useLayoutEffect as useLayoutEffect16, useRef as useRef31, useState as
|
|
6790
|
+
import { useLayoutEffect as useLayoutEffect16, useRef as useRef31, useState as useState34 } from "react";
|
|
6835
6791
|
|
|
6836
6792
|
// shared/package-runtime/number-motion.ts
|
|
6837
6793
|
import { tokens as tokens39 } from "@kjun-ui/tokens";
|
|
@@ -6877,7 +6833,7 @@ function createNumberMotion(apply) {
|
|
|
6877
6833
|
|
|
6878
6834
|
// shared/package-runtime/use-number-motion.ts
|
|
6879
6835
|
function useNumberMotion(value, animated, fromPrevious, reduced) {
|
|
6880
|
-
const [display, setDisplay] =
|
|
6836
|
+
const [display, setDisplay] = useState34(typeof value === "string" || fromPrevious || !animated || reduced ? value : 0);
|
|
6881
6837
|
const motion = useRef31(null);
|
|
6882
6838
|
if (!motion.current) motion.current = createNumberMotion(setDisplay);
|
|
6883
6839
|
useLayoutEffect16(() => {
|
|
@@ -7364,7 +7320,7 @@ function KjunSparkline({
|
|
|
7364
7320
|
|
|
7365
7321
|
// shared/package-runtime/table.ts
|
|
7366
7322
|
import { nextTableSort } from "@kjun-ui/tokens";
|
|
7367
|
-
import { useEffect as useEffect24, useRef as useRef33, useState as
|
|
7323
|
+
import { useEffect as useEffect24, useRef as useRef33, useState as useState36 } from "react";
|
|
7368
7324
|
|
|
7369
7325
|
// shared/package-runtime/table-model.ts
|
|
7370
7326
|
function getValue(row, key) {
|
|
@@ -7408,10 +7364,10 @@ function useTableModel(props) {
|
|
|
7408
7364
|
expandSingle = false,
|
|
7409
7365
|
onExpandedRowsChange
|
|
7410
7366
|
} = props;
|
|
7411
|
-
const [internalSort, setSort] =
|
|
7367
|
+
const [internalSort, setSort] = useState36({
|
|
7412
7368
|
key: "",
|
|
7413
7369
|
order: "asc"
|
|
7414
|
-
}), [internalExpanded, setExpanded] =
|
|
7370
|
+
}), [internalExpanded, setExpanded] = useState36([]), [search, setSearch] = useState36(""), timer = useRef33(void 0);
|
|
7415
7371
|
useEffect24(() => () => clearTimeout(timer.current), []);
|
|
7416
7372
|
const sort = props.sort === void 0 ? internalSort : (_a = props.sort) != null ? _a : { key: "", order: "asc" };
|
|
7417
7373
|
const rows = sortTableRows(data, sort, { sortable, sortMode });
|
|
@@ -7566,14 +7522,14 @@ function TableToolbar({
|
|
|
7566
7522
|
|
|
7567
7523
|
// packages/native/src/table-grid.tsx
|
|
7568
7524
|
import { tokens as tokens43 } from "@kjun-ui/tokens";
|
|
7569
|
-
import { Fragment as Fragment15, useId as useId9, useState as
|
|
7570
|
-
import Svg7, { Defs as Defs3, LinearGradient as LinearGradient3, Rect as
|
|
7525
|
+
import { Fragment as Fragment15, useId as useId9, useState as useState37 } from "react";
|
|
7526
|
+
import Svg7, { Defs as Defs3, LinearGradient as LinearGradient3, Rect as Rect3, Stop as Stop3 } from "react-native-svg";
|
|
7571
7527
|
import { ScrollView as ScrollView9, View as View37 } from "react-native";
|
|
7572
7528
|
import { jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7573
7529
|
function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, sortable, compact, striped, hoverable }) {
|
|
7574
7530
|
const { colors } = useKjunStyles();
|
|
7575
7531
|
const geometry2 = tokens43.table;
|
|
7576
|
-
const [scroll, setScroll] =
|
|
7532
|
+
const [scroll, setScroll] = useState37({ viewport: 0, x: 0 }), fadeId = "kjun-table-fade-" + useId9().replace(/[^a-z0-9]/gi, "");
|
|
7577
7533
|
const cellPadding = geometry2.cellPadding[compact ? "compact" : "regular"];
|
|
7578
7534
|
const width = (col) => typeof col.width === "number" ? col.width : typeof col.width === "string" && /^\d+(px)?$/.test(col.width) ? parseFloat(col.width) : geometry2.columnWidth;
|
|
7579
7535
|
const totalWidth = visible.reduce((sum, col) => sum + width(col), 0) + (selectable ? geometry2.actionColumnWidth : 0) + (expandable ? geometry2.actionColumnWidth : 0);
|
|
@@ -7760,7 +7716,7 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
|
|
|
7760
7716
|
/* @__PURE__ */ jsx43(Stop3, { offset: "0", stopColor: colors.surface, stopOpacity: 0 }),
|
|
7761
7717
|
/* @__PURE__ */ jsx43(Stop3, { offset: "1", stopColor: colors.surface, stopOpacity: 1 })
|
|
7762
7718
|
] }) }),
|
|
7763
|
-
/* @__PURE__ */ jsx43(
|
|
7719
|
+
/* @__PURE__ */ jsx43(Rect3, { width: "100%", height: "100%", fill: `url(#${fadeId})` })
|
|
7764
7720
|
] }) })
|
|
7765
7721
|
] });
|
|
7766
7722
|
}
|
|
@@ -8323,7 +8279,7 @@ function KjunKpiHero(props) {
|
|
|
8323
8279
|
|
|
8324
8280
|
// packages/native/src/kpi-row.tsx
|
|
8325
8281
|
import { tokens as tokens47 } from "@kjun-ui/tokens";
|
|
8326
|
-
import { useState as
|
|
8282
|
+
import { useState as useState38 } from "react";
|
|
8327
8283
|
import {
|
|
8328
8284
|
Text as Text6,
|
|
8329
8285
|
View as View42,
|
|
@@ -8342,7 +8298,7 @@ function KjunKpiRow({
|
|
|
8342
8298
|
const { colors, domainColors, numericFontFamily, fontFamily } = useKjunStyles(), mobile = useWindowDimensions9().width <= tokens47.responsive.kpiRow, small = size === "sm", summary = mobileSummary && mobile && !small;
|
|
8343
8299
|
const geometry2 = tokens47.extensions.kpiRow;
|
|
8344
8300
|
const spec = small ? geometry2.sm : mobile ? geometry2.mobile : geometry2.md;
|
|
8345
|
-
const [width, setWidth] =
|
|
8301
|
+
const [width, setWidth] = useState38(0);
|
|
8346
8302
|
const paddingX = summary ? geometry2.summary.paddingX : spec.paddingX;
|
|
8347
8303
|
const gapX = summary ? geometry2.summary.gapX : 0;
|
|
8348
8304
|
const explicit = items.some(
|
|
@@ -8561,7 +8517,7 @@ import { tokens as tokens49 } from "@kjun-ui/tokens";
|
|
|
8561
8517
|
import { ScrollView as ScrollView10, View as View44 } from "react-native";
|
|
8562
8518
|
|
|
8563
8519
|
// shared/package-runtime/market-cards.ts
|
|
8564
|
-
import { useEffect as useEffect25, useRef as useRef34, useState as
|
|
8520
|
+
import { useEffect as useEffect25, useRef as useRef34, useState as useState39 } from "react";
|
|
8565
8521
|
function useMarketCardsModel(props, persistence) {
|
|
8566
8522
|
const {
|
|
8567
8523
|
columns,
|
|
@@ -8577,7 +8533,7 @@ function useMarketCardsModel(props, persistence) {
|
|
|
8577
8533
|
sortKey: c.sortable ? metricConfig[c.key].sortKey : null,
|
|
8578
8534
|
isDefaultSort: c.defaultSort
|
|
8579
8535
|
}));
|
|
8580
|
-
const [key, setKey] =
|
|
8536
|
+
const [key, setKey] = useState39(""), restoreSignature = JSON.stringify([storageNamespace, pills]);
|
|
8581
8537
|
const mounted = useRef34("");
|
|
8582
8538
|
const save = (key2) => {
|
|
8583
8539
|
var _a;
|
|
@@ -9066,9 +9022,9 @@ function KjunMarketListPanel({
|
|
|
9066
9022
|
|
|
9067
9023
|
// packages/native/src/market-table.tsx
|
|
9068
9024
|
import { tokens as tokens52 } from "@kjun-ui/tokens";
|
|
9069
|
-
import { useId as useId10, useState as
|
|
9025
|
+
import { useId as useId10, useState as useState40 } from "react";
|
|
9070
9026
|
import { ScrollView as ScrollView11, View as View47 } from "react-native";
|
|
9071
|
-
import Svg8, { Defs as Defs4, LinearGradient as LinearGradient4, Rect as
|
|
9027
|
+
import Svg8, { Defs as Defs4, LinearGradient as LinearGradient4, Rect as Rect4, Stop as Stop4 } from "react-native-svg";
|
|
9072
9028
|
import { jsx as jsx53, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9073
9029
|
function KjunMarketTable(props) {
|
|
9074
9030
|
const {
|
|
@@ -9152,7 +9108,7 @@ function KjunMarketTable(props) {
|
|
|
9152
9108
|
);
|
|
9153
9109
|
};
|
|
9154
9110
|
const layout = useMarketLayout(columns, showActions);
|
|
9155
|
-
const [scroll, setScroll] =
|
|
9111
|
+
const [scroll, setScroll] = useState40({ viewport: 0, x: 0 }), fadeId = "kjun-market-fade-" + useId10().replace(/[^a-z0-9]/gi, "");
|
|
9156
9112
|
const tableQuote = { price: {}, change: { fontWeight: typeStyle("body").fontWeight } };
|
|
9157
9113
|
return /* @__PURE__ */ jsxs41(
|
|
9158
9114
|
View47,
|
|
@@ -9362,7 +9318,7 @@ function KjunMarketTable(props) {
|
|
|
9362
9318
|
/* @__PURE__ */ jsx53(Stop4, { offset: "0", stopColor: colors.surface, stopOpacity: 0 }),
|
|
9363
9319
|
/* @__PURE__ */ jsx53(Stop4, { offset: "1", stopColor: colors.surface, stopOpacity: 1 })
|
|
9364
9320
|
] }) }),
|
|
9365
|
-
/* @__PURE__ */ jsx53(
|
|
9321
|
+
/* @__PURE__ */ jsx53(Rect4, { width: "100%", height: "100%", fill: `url(#${fadeId})` })
|
|
9366
9322
|
] }) })
|
|
9367
9323
|
] }) })
|
|
9368
9324
|
}
|
|
@@ -9376,7 +9332,7 @@ function KjunMarketTable(props) {
|
|
|
9376
9332
|
// packages/native/src/list.tsx
|
|
9377
9333
|
import { tokens as tokens53 } from "@kjun-ui/tokens";
|
|
9378
9334
|
import { Children as Children4, createContext as createContext20, useContext as useContext17 } from "react";
|
|
9379
|
-
import { View as View48, Platform as
|
|
9335
|
+
import { View as View48, Platform as Platform25 } from "react-native";
|
|
9380
9336
|
import { Fragment as Fragment19, jsx as jsx54, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9381
9337
|
var LastListRow = createContext20(false);
|
|
9382
9338
|
function KjunListRow({ title, description, leading, trailing, actions, href, disabled = false, onPress }) {
|
|
@@ -9391,8 +9347,8 @@ function KjunListRow({ title, description, leading, trailing, actions, href, dis
|
|
|
9391
9347
|
] });
|
|
9392
9348
|
const style = { flex: 1, minWidth: 0, minHeight: tokens53.extensions.list.minimumHeight, flexDirection: "row", alignItems: "center", gap: tokens53.extensions.list.gap, padding: tokens53.extensions.list.padding };
|
|
9393
9349
|
return /* @__PURE__ */ jsxs42(View48, { role: "listitem", style: { flexDirection: "row", alignItems: "center", gap: tokens53.extensions.list.gap, borderBottomWidth: last ? 0 : tokens53.border.defaultWidth, borderBottomColor: colors.divider }, children: [
|
|
9394
|
-
onPress || href ? /* @__PURE__ */ jsx54(AccessiblePressable, { ...
|
|
9395
|
-
actions && /* @__PURE__ */ jsx54(View48, { pointerEvents: disabled ? "none" : "auto", ...disabled &&
|
|
9350
|
+
onPress || href ? /* @__PURE__ */ jsx54(AccessiblePressable, { ...Platform25.OS === "web" && href && !disabled ? { href } : {}, accessibilityRole: href ? "link" : "button", accessibilityLabel: title + (description ? ", " + description : ""), disabled, accessibilityState: { disabled }, onPress, style: ({ pressed }) => ({ ...style, opacity: disabled ? tokens53.states.opacity.disabled : 1, backgroundColor: pressed ? colors.hover : "transparent" }), children: parts }) : /* @__PURE__ */ jsx54(View48, { style, children: parts }),
|
|
9351
|
+
actions && /* @__PURE__ */ jsx54(View48, { pointerEvents: disabled ? "none" : "auto", ...disabled && Platform25.OS === "web" ? { inert: true } : {}, style: { maxWidth: "45%", flexDirection: "row", flexWrap: "wrap", gap: tokens53.extensions.list.actionsGap, paddingRight: tokens53.extensions.list.actionsPadding, opacity: disabled ? tokens53.states.opacity.disabled : 1 }, children: content(actions) })
|
|
9396
9352
|
] });
|
|
9397
9353
|
}
|
|
9398
9354
|
function KjunListSection({ title, description, actions, children, ariaLabel }) {
|
|
@@ -9411,16 +9367,16 @@ function KjunListSection({ title, description, actions, children, ariaLabel }) {
|
|
|
9411
9367
|
|
|
9412
9368
|
// packages/native/src/app-navigation.tsx
|
|
9413
9369
|
import { tokens as tokens54 } from "@kjun-ui/tokens";
|
|
9414
|
-
import { Children as Children5, Fragment as Fragment20, isValidElement as isValidElement7, useState as
|
|
9415
|
-
import { View as View49, Platform as
|
|
9370
|
+
import { Children as Children5, Fragment as Fragment20, isValidElement as isValidElement7, useState as useState41 } from "react";
|
|
9371
|
+
import { View as View49, Platform as Platform26 } from "react-native";
|
|
9416
9372
|
import { jsx as jsx55, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9417
9373
|
function KjunTopNavigation({ title, description, leading, actions, safeAreaTop = 0 }) {
|
|
9418
9374
|
const { colors } = useKjunStyles();
|
|
9419
9375
|
const geometry2 = tokens54.extensions.topNavigation;
|
|
9420
9376
|
const titleInset = Math.max(0, (geometry2.controlSize - tokens54.typography.sectionTitle.lineHeightPx) / 2);
|
|
9421
|
-
const wrapping =
|
|
9377
|
+
const wrapping = Platform26.OS === "web" ? { wordBreak: "keep-all", overflowWrap: "anywhere" } : {};
|
|
9422
9378
|
const edgeInset = (geometry2.controlSize - geometry2.iconSize) / 2;
|
|
9423
|
-
const [iconEdges, setIconEdges] =
|
|
9379
|
+
const [iconEdges, setIconEdges] = useState41({ leading: false, trailing: false });
|
|
9424
9380
|
const square = (key) => (event) => {
|
|
9425
9381
|
const { width, height } = event.nativeEvent.layout;
|
|
9426
9382
|
const next = Math.abs(width - height) < 1 && Math.abs(height - geometry2.controlSize) < 1;
|
|
@@ -9465,8 +9421,8 @@ function KjunBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\u
|
|
|
9465
9421
|
AccessiblePressable,
|
|
9466
9422
|
{
|
|
9467
9423
|
focusRingInset: true,
|
|
9468
|
-
...
|
|
9469
|
-
accessibilityRole:
|
|
9424
|
+
...Platform26.OS === "web" ? { href: item.disabled ? void 0 : item.href, "aria-current": selected ? "page" : void 0 } : {},
|
|
9425
|
+
accessibilityRole: Platform26.OS === "web" && item.href ? "link" : "button",
|
|
9470
9426
|
accessibilityLabel: item.label + (item.badge != null ? ", " + item.badge : ""),
|
|
9471
9427
|
accessibilityState: { selected, disabled: !!item.disabled },
|
|
9472
9428
|
disabled: item.disabled,
|
|
@@ -9500,10 +9456,10 @@ function KjunBottomNavigation({ items, value, ariaLabel = "\uC8FC\uC694 \uD0D0\u
|
|
|
9500
9456
|
}
|
|
9501
9457
|
function KjunBottomActionBar({ description, children, safeAreaBottom = 0, keyboardVisible = false, hideOnKeyboard = false }) {
|
|
9502
9458
|
const { colors } = useKjunStyles();
|
|
9503
|
-
const [width, setWidth] =
|
|
9459
|
+
const [width, setWidth] = useState41(0);
|
|
9504
9460
|
const geometry2 = tokens54.extensions.navigation;
|
|
9505
9461
|
const wide = width >= tokens54.responsive.bottomAction + geometry2.padding * 2;
|
|
9506
|
-
const wrapping =
|
|
9462
|
+
const wrapping = Platform26.OS === "web" ? { wordBreak: "keep-all", overflowWrap: "anywhere" } : {};
|
|
9507
9463
|
if (keyboardVisible && hideOnKeyboard) return null;
|
|
9508
9464
|
return /* @__PURE__ */ jsx55(BottomActionBarContext.Provider, { value: !wide, children: /* @__PURE__ */ jsxs43(View49, { onLayout: (event) => setWidth(event.nativeEvent.layout.width), style: {
|
|
9509
9465
|
flexShrink: 0,
|
|
@@ -9522,7 +9478,7 @@ function KjunBottomActionBar({ description, children, safeAreaBottom = 0, keyboa
|
|
|
9522
9478
|
}
|
|
9523
9479
|
|
|
9524
9480
|
// packages/native/src/media.tsx
|
|
9525
|
-
import { useRef as useRef35, useState as
|
|
9481
|
+
import { useRef as useRef35, useState as useState42 } from "react";
|
|
9526
9482
|
import { Image, View as View50 } from "react-native";
|
|
9527
9483
|
import { tokens as tokens55 } from "@kjun-ui/tokens";
|
|
9528
9484
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
@@ -9531,7 +9487,7 @@ function KjunImage({ src, source, alt, decorative = false, aspectRatio = 1, fit
|
|
|
9531
9487
|
const request = JSON.stringify(source != null ? source : src), current = useRef35({ request, version: 0 });
|
|
9532
9488
|
if (current.current.request !== request) current.current = { request, version: current.current.version + 1 };
|
|
9533
9489
|
const version = current.current.version;
|
|
9534
|
-
const [failed, setFailed] =
|
|
9490
|
+
const [failed, setFailed] = useState42(null);
|
|
9535
9491
|
const missing = !source && !src;
|
|
9536
9492
|
return /* @__PURE__ */ jsx56(View50, { accessibilityElementsHidden: decorative, importantForAccessibility: decorative ? "no-hide-descendants" : "auto", "aria-hidden": decorative || void 0, style: { width: "100%", aspectRatio: aspectRatio > 0 ? aspectRatio : 1, overflow: "hidden", backgroundColor: colors.secondary }, children: !missing && failed !== version ? /* @__PURE__ */ jsx56(Image, { source: source != null ? source : { uri: src }, accessible: !decorative, accessibilityLabel: decorative ? void 0 : alt, resizeMode: fit, style: { position: "absolute", inset: 0, width: "100%", height: "100%" }, onLoad: () => {
|
|
9537
9493
|
if (version === current.current.version) onLoad == null ? void 0 : onLoad();
|
|
@@ -9561,8 +9517,8 @@ function KjunChip({ label, icon, removable = false, disabled = false, size = "md
|
|
|
9561
9517
|
}
|
|
9562
9518
|
|
|
9563
9519
|
// packages/native/src/range-input.tsx
|
|
9564
|
-
import { useEffect as useEffect26, useMemo as useMemo2, useRef as useRef36, useState as
|
|
9565
|
-
import { PanResponder, Platform as
|
|
9520
|
+
import { useEffect as useEffect26, useMemo as useMemo2, useRef as useRef36, useState as useState43 } from "react";
|
|
9521
|
+
import { PanResponder, Platform as Platform27, Pressable as Pressable3, View as View52 } from "react-native";
|
|
9566
9522
|
import { tokens as tokens57, createSliderDomain, sliderKey } from "@kjun-ui/tokens";
|
|
9567
9523
|
import { jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9568
9524
|
var geometry = tokens57.extensions.slider;
|
|
@@ -9585,9 +9541,9 @@ function RangeInput({
|
|
|
9585
9541
|
const valid = domain.valid && (!Array.isArray(value) || value.length === 2) && values.every(domain.accepts) && (values.length === 1 || values[0] <= values[1]);
|
|
9586
9542
|
const blocked = disabled || !valid;
|
|
9587
9543
|
const effectiveMax = valid ? domain.snap(max) : min;
|
|
9588
|
-
const [hovered, setHovered] =
|
|
9589
|
-
const [dragging, setDragging] =
|
|
9590
|
-
const [focused, setFocused] =
|
|
9544
|
+
const [hovered, setHovered] = useState43(null);
|
|
9545
|
+
const [dragging, setDragging] = useState43(null);
|
|
9546
|
+
const [focused, setFocused] = useState43(null);
|
|
9591
9547
|
const track = useRef36(null), measured = useRef36({ x: 0, width: 1 }), selected = useRef36(0), dirty = useRef36(false);
|
|
9592
9548
|
const latest = useRef36(values);
|
|
9593
9549
|
latest.current = values;
|
|
@@ -9793,7 +9749,7 @@ function RangeInput({
|
|
|
9793
9749
|
setFocused(null);
|
|
9794
9750
|
commit();
|
|
9795
9751
|
},
|
|
9796
|
-
...
|
|
9752
|
+
...Platform27.OS === "web" ? {
|
|
9797
9753
|
"aria-valuenow": number,
|
|
9798
9754
|
"aria-valuemin": index === 1 ? values[0] : min,
|
|
9799
9755
|
"aria-valuemax": values.length === 2 && index === 0 ? values[1] : domain.snap(max),
|
|
@@ -9817,7 +9773,7 @@ function RangeInput({
|
|
|
9817
9773
|
alignItems: "center",
|
|
9818
9774
|
justifyContent: "center",
|
|
9819
9775
|
zIndex: focused === index || dragging === index ? 1 : 0,
|
|
9820
|
-
...
|
|
9776
|
+
...Platform27.OS === "web" ? {
|
|
9821
9777
|
outlineStyle: "solid",
|
|
9822
9778
|
outlineWidth: 0,
|
|
9823
9779
|
cursor: blocked ? "default" : dragging === index ? "grabbing" : "grab"
|
|
@@ -9834,7 +9790,7 @@ function RangeInput({
|
|
|
9834
9790
|
borderWidth: tokens57.border.controlWidth,
|
|
9835
9791
|
borderColor: !blocked && dragging === index ? colors.brandActive : !blocked && hovered === index ? colors.brandHover : colors.brand,
|
|
9836
9792
|
backgroundColor: colors.surface,
|
|
9837
|
-
...
|
|
9793
|
+
...Platform27.OS === "web" && !blocked && focused === index ? {
|
|
9838
9794
|
outlineStyle: "solid",
|
|
9839
9795
|
outlineWidth: tokens57.states.focus.width,
|
|
9840
9796
|
outlineOffset: tokens57.states.focus.choiceOffset,
|
|
@@ -9861,8 +9817,8 @@ function KjunRangeSlider(props) {
|
|
|
9861
9817
|
}
|
|
9862
9818
|
|
|
9863
9819
|
// packages/native/src/quantity-stepper.tsx
|
|
9864
|
-
import { useEffect as useEffect27, useRef as useRef37, useState as
|
|
9865
|
-
import { Platform as
|
|
9820
|
+
import { useEffect as useEffect27, useRef as useRef37, useState as useState44 } from "react";
|
|
9821
|
+
import { Platform as Platform28, View as View53 } from "react-native";
|
|
9866
9822
|
import { createNumberDomain, quantityKeyAction, tokens as tokens58 } from "@kjun-ui/tokens";
|
|
9867
9823
|
|
|
9868
9824
|
// shared/package-runtime/component-icons.ts
|
|
@@ -9883,7 +9839,7 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
|
|
|
9883
9839
|
const increaseStyle = { ...buttonStyle, borderRadius: 0, borderTopRightRadius: outer, borderBottomRightRadius: outer };
|
|
9884
9840
|
const domain = createNumberDomain({ min, max, step, precision }), valid = domain.valid && domain.accepts(value), blocked = disabled || !valid;
|
|
9885
9841
|
const surface = useFieldSurface(size, { disabled: blocked, invalid });
|
|
9886
|
-
const [draft, setDraft] =
|
|
9842
|
+
const [draft, setDraft] = useState44(String(value));
|
|
9887
9843
|
const inputRef = useRef37(null);
|
|
9888
9844
|
const composing = useRef37(false), dirty = useRef37(false), accepted = useRef37(value);
|
|
9889
9845
|
const cancelledEscape = useRef37(false);
|
|
@@ -9938,7 +9894,7 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
|
|
|
9938
9894
|
setDraft(text);
|
|
9939
9895
|
} };
|
|
9940
9896
|
useEffect27(() => {
|
|
9941
|
-
if (
|
|
9897
|
+
if (Platform28.OS !== "web") return;
|
|
9942
9898
|
const input = inputRef.current;
|
|
9943
9899
|
const keydown = (event) => handlers.current.key(event);
|
|
9944
9900
|
const keyup = (event) => {
|
|
@@ -9967,7 +9923,7 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
|
|
|
9967
9923
|
};
|
|
9968
9924
|
}, []);
|
|
9969
9925
|
const surfaceBox = { position: "absolute", left: 0, right: 0, top: "50%", height: tokens58.input[size].height, marginTop: -tokens58.input[size].height / 2, borderRadius: surface.spec.radius };
|
|
9970
|
-
const hug =
|
|
9926
|
+
const hug = Platform28.OS === "web" && !block ? { width: "fit-content" } : {};
|
|
9971
9927
|
return /* @__PURE__ */ jsx59(IconFallbacks, { icons: componentIcons, children: /* @__PURE__ */ jsxs46(View53, { style: { flexDirection: "row", alignItems: "center", alignSelf: block ? "stretch" : "flex-start", maxWidth: "100%", borderRadius: surface.spec.radius, ...hug }, children: [
|
|
9972
9928
|
/* @__PURE__ */ jsx59(View53, { pointerEvents: "none", "aria-hidden": true, style: { ...surfaceBox, backgroundColor: colors.inputBg } }),
|
|
9973
9929
|
/* @__PURE__ */ jsx59(CompoundTarget, { square: true, children: /* @__PURE__ */ jsx59(KjunButton, { size, style: decreaseStyle, variant: "ghost", ariaLabel: "\uC218\uB7C9 \uC904\uC774\uAE30", disabled: blocked || value <= min, onPress: () => move(-1), prefixIcon: "minus" }) }),
|
|
@@ -9998,8 +9954,8 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
|
|
|
9998
9954
|
surface.setFocused(false);
|
|
9999
9955
|
commit();
|
|
10000
9956
|
},
|
|
10001
|
-
onSubmitEditing:
|
|
10002
|
-
...
|
|
9957
|
+
onSubmitEditing: Platform28.OS === "web" ? void 0 : commit,
|
|
9958
|
+
...Platform28.OS === "web" ? { "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, "aria-labelledby": labelledBy, "aria-describedby": field == null ? void 0 : field.describedBy, "aria-invalid": invalid || void 0, "aria-required": (field == null ? void 0 : field.required) || void 0 } : { onKeyPress: key },
|
|
10003
9959
|
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 - tokens58.border.controlWidth, paddingVertical: 0 }
|
|
10004
9960
|
}
|
|
10005
9961
|
) }),
|
|
@@ -10009,7 +9965,7 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
|
|
|
10009
9965
|
}
|
|
10010
9966
|
|
|
10011
9967
|
// packages/native/src/time-picker.tsx
|
|
10012
|
-
import { Fragment as Fragment21, useEffect as useEffect28, useId as useId11, useMemo as useMemo3, useRef as useRef38, useState as
|
|
9968
|
+
import { Fragment as Fragment21, useEffect as useEffect28, useId as useId11, useMemo as useMemo3, useRef as useRef38, useState as useState45 } from "react";
|
|
10013
9969
|
import { View as View54 } from "react-native";
|
|
10014
9970
|
import { createTimeDomain, tokens as tokens59 } from "@kjun-ui/tokens";
|
|
10015
9971
|
import { jsx as jsx60, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
@@ -10017,7 +9973,7 @@ function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1,
|
|
|
10017
9973
|
const geometry2 = tokens59.extensions.timePicker, spec = tokens59.input[size];
|
|
10018
9974
|
const { colors } = useKjunStyles();
|
|
10019
9975
|
const first = useRef38(null);
|
|
10020
|
-
const [focused, setFocused] =
|
|
9976
|
+
const [focused, setFocused] = useState45(false), [opened, setOpened] = useState45(null);
|
|
10021
9977
|
const field = useKjunField(), uid = useId11();
|
|
10022
9978
|
const fieldId = (field == null ? void 0 : field.id) || `kjun-time-${uid}`;
|
|
10023
9979
|
const domain = useMemo3(() => createTimeDomain({ precision, min, max, minuteStep, secondStep }), [precision, min, max, minuteStep, secondStep]), valid = domain.valid && domain.accepts(value);
|