@kjun-ui/react 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 CHANGED
@@ -1586,17 +1586,6 @@ function KjunSkeleton({
1586
1586
  },
1587
1587
  row
1588
1588
  )) }),
1589
- type === "chart" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "kjun-skeleton-chart", style: { height: height || import_tokens10.tokens.extensions.skeleton.chartHeight }, children: [
1590
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "kjun-skeleton-chart-bars", children: [40, 65, 50, 80, 60, 90, 75].map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1591
- "div",
1592
- {
1593
- className: "kjun-skeleton-chart-bar",
1594
- style: { height: h + "%" }
1595
- },
1596
- i
1597
- )) }),
1598
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "kjun-skeleton-chart-axis" })
1599
- ] }),
1600
1589
  type === "stat" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "kjun-skeleton-stat", children: [
1601
1590
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "kjun-skeleton-stat-content", children: [
1602
1591
  line("40%", 0, import_tokens10.tokens.extensions.skeleton.lineHeights.sm),
@@ -4654,7 +4643,17 @@ var KjunErrorBoundary = class extends import_react39.Component {
4654
4643
 
4655
4644
  // packages/react/src/skeletons.tsx
4656
4645
  var import_tokens29 = require("@kjun-ui/tokens");
4657
- var import_react40 = require("react");
4646
+
4647
+ // shared/package-runtime/chart-skeleton.ts
4648
+ var chartFrameViewBox = "0 0 600 240";
4649
+ var chartFramePath = "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590";
4650
+ var chartSkeletonMaxCount = 100;
4651
+ function chartSkeletonCount(value) {
4652
+ return Number.isFinite(value) ? Math.min(chartSkeletonMaxCount, Math.max(1, Math.floor(value))) : 1;
4653
+ }
4654
+ function chartMatrixMuted(row, column) {
4655
+ return (row + column + 2) % 3 === 0;
4656
+ }
4658
4657
 
4659
4658
  // packages/react/src/market-skeleton.tsx
4660
4659
  var import_tokens28 = require("@kjun-ui/tokens");
@@ -4773,78 +4772,82 @@ function KjunFormSkeleton({
4773
4772
  );
4774
4773
  }
4775
4774
  function KjunChartSkeleton({
4775
+ kind = "frame",
4776
+ height = import_tokens29.tokens.extensions.chartSkeleton.height,
4776
4777
  loadingText = "\uCC28\uD2B8\uB97C \uBD88\uB7EC\uC624\uB294 \uC911",
4777
- kind = "line",
4778
- height = import_tokens29.tokens.extensions.chartSkeleton.height
4778
+ skeleton = true,
4779
+ loadingDelay = 0,
4780
+ rows = 8,
4781
+ columns = 14
4779
4782
  }) {
4780
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "kjun-chart-skeleton", style: { height }, "aria-hidden": "true", children: [
4781
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-chart-skeleton-status", children: loadingText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: loadingText }) }),
4782
- kind === "donut" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-chart-skeleton-donut", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSkeleton, { type: "block", width: import_tokens29.tokens.extensions.chartSkeleton.donutLabelWidth, height: import_tokens29.tokens.extensions.chartSkeleton.donutLabelHeight }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4783
- "svg",
4784
- {
4785
- viewBox: "0 0 600 240",
4786
- preserveAspectRatio: "none",
4787
- className: "kjun-chart-skeleton-plot",
4788
- children: [
4789
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4790
- "path",
4791
- {
4792
- d: "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590",
4793
- fill: "none",
4794
- stroke: "var(--_kjun-color-border)",
4795
- strokeWidth: 1
4796
- }
4797
- ),
4798
- kind === "line" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { d: "M20 190 L100 160 L180 172 L260 120 L340 140 L420 96 L500 110 L590 64", fill: "none", stroke: "var(--_kjun-color-skeleton)", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" }),
4799
- kind === "matrix" ? Array.from({ length: 8 }, (_, row) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: Array.from({ length: 14 }, (_2, col) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4800
- "rect",
4801
- {
4802
- x: 24 + col * 40,
4803
- y: 12 + row * 26,
4804
- width: 36,
4805
- height: 22,
4806
- rx: 2,
4807
- fill: "var(--_kjun-color-skeleton)",
4808
- opacity: (row + col + 2) % 3 === 0 ? 0.55 : 1
4783
+ const revealed = useLoadingReveal(true, loadingDelay), status = revealed && loadingText ? "status" : void 0, rowCount = chartSkeletonCount(rows), columnCount = chartSkeletonCount(columns);
4784
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4785
+ "div",
4786
+ {
4787
+ className: "kjun-chart-skeleton",
4788
+ "data-kjun-chart-kind": kind,
4789
+ "data-skeleton": skeleton ? void 0 : "false",
4790
+ "aria-hidden": revealed ? void 0 : true,
4791
+ style: { height, visibility: revealed ? void 0 : "hidden" },
4792
+ children: !skeleton ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "kjun-data-loading", "data-kjun-chart-part": "loading", role: status, children: [
4793
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(KjunSpinner, { size: "md" }) }),
4794
+ loadingText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { children: loadingText })
4795
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
4796
+ kind === "donut" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-chart-skeleton-donut", "data-kjun-chart-part": "donut", "aria-hidden": "true" }) : kind === "matrix" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4797
+ "div",
4798
+ {
4799
+ className: "kjun-chart-skeleton-matrix",
4800
+ "data-kjun-chart-part": "matrix",
4801
+ "aria-hidden": "true",
4802
+ style: {
4803
+ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`,
4804
+ gridTemplateRows: `repeat(${rowCount}, minmax(0, 1fr))`
4809
4805
  },
4810
- col
4811
- )) }, row)) : (kind === "bar" || kind === "candle") && [60, 100, 85, 140, 110, 165, 180].map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react40.Fragment, { children: [
4812
- kind === "candle" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4806
+ children: Array.from({ length: rowCount * columnCount }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4807
+ "div",
4808
+ {
4809
+ className: "kjun-chart-skeleton-cell",
4810
+ "data-kjun-chart-part": "cell",
4811
+ "data-muted": chartMatrixMuted(Math.floor(i / columnCount), i % columnCount) ? "" : void 0
4812
+ },
4813
+ i
4814
+ ))
4815
+ }
4816
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4817
+ "svg",
4818
+ {
4819
+ viewBox: chartFrameViewBox,
4820
+ preserveAspectRatio: "none",
4821
+ className: "kjun-chart-skeleton-plot",
4822
+ "data-kjun-chart-part": "plot",
4823
+ "aria-hidden": "true",
4824
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4813
4825
  "path",
4814
4826
  {
4815
- d: `M${55 + i * 75} ${195 - h}V${225 - h / 2}`,
4827
+ d: chartFramePath,
4816
4828
  fill: "none",
4817
- stroke: "var(--_kjun-color-skeleton)",
4818
- strokeWidth: 4
4819
- }
4820
- ),
4821
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4822
- "rect",
4823
- {
4824
- x: 35 + i * 75,
4825
- y: kind === "candle" ? 210 - h : 220 - h,
4826
- width: kind === "candle" ? 28 : 42,
4827
- height: kind === "candle" ? h / 2 : h,
4828
- rx: 3,
4829
- fill: "var(--_kjun-color-skeleton)"
4829
+ stroke: "var(--_kjun-color-chart-grid)",
4830
+ strokeWidth: import_tokens29.tokens.border.defaultWidth,
4831
+ vectorEffect: "non-scaling-stroke"
4830
4832
  }
4831
4833
  )
4832
- ] }, i))
4833
- ]
4834
- }
4835
- )
4836
- ] });
4834
+ }
4835
+ ),
4836
+ loadingText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "kjun-chart-skeleton-status", "data-kjun-chart-part": "status", role: status, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: loadingText }) })
4837
+ ] })
4838
+ }
4839
+ );
4837
4840
  }
4838
4841
 
4839
4842
  // packages/react/src/financial-display.tsx
4840
4843
  var import_tokens32 = require("@kjun-ui/tokens");
4841
- var import_react42 = require("react");
4844
+ var import_react41 = require("react");
4842
4845
 
4843
4846
  // packages/react/src/number-display.tsx
4844
4847
  var import_tokens31 = require("@kjun-ui/tokens");
4845
4848
 
4846
4849
  // shared/package-runtime/use-number-motion.ts
4847
- var import_react41 = require("react");
4850
+ var import_react40 = require("react");
4848
4851
 
4849
4852
  // shared/package-runtime/number-motion.ts
4850
4853
  var import_tokens30 = require("@kjun-ui/tokens");
@@ -4890,14 +4893,14 @@ function createNumberMotion(apply) {
4890
4893
 
4891
4894
  // shared/package-runtime/use-number-motion.ts
4892
4895
  function useNumberMotion(value, animated, fromPrevious, reduced) {
4893
- const [display, setDisplay] = (0, import_react41.useState)(typeof value === "string" || fromPrevious || !animated || reduced ? value : 0);
4894
- const motion = (0, import_react41.useRef)(null);
4896
+ const [display, setDisplay] = (0, import_react40.useState)(typeof value === "string" || fromPrevious || !animated || reduced ? value : 0);
4897
+ const motion = (0, import_react40.useRef)(null);
4895
4898
  if (!motion.current) motion.current = createNumberMotion(setDisplay);
4896
- (0, import_react41.useLayoutEffect)(() => {
4899
+ (0, import_react40.useLayoutEffect)(() => {
4897
4900
  if (!motion.current) motion.current = createNumberMotion(setDisplay);
4898
4901
  motion.current.update(value, animated, fromPrevious, reduced);
4899
4902
  }, [value, animated, fromPrevious, reduced]);
4900
- (0, import_react41.useLayoutEffect)(() => () => {
4903
+ (0, import_react40.useLayoutEffect)(() => () => {
4901
4904
  var _a;
4902
4905
  (_a = motion.current) == null ? void 0 : _a.cancel();
4903
4906
  motion.current = null;
@@ -5193,7 +5196,7 @@ function KjunSparkline({
5193
5196
  stretch = false,
5194
5197
  ariaLabel
5195
5198
  }) {
5196
- const id = "kjun-" + (0, import_react42.useId)().replace(/:/g, ""), values = data.filter(Number.isFinite), min = Math.min(...values), max = Math.max(...values), range = max - min || 1, points = values.map(
5199
+ const id = "kjun-" + (0, import_react41.useId)().replace(/:/g, ""), values = data.filter(Number.isFinite), min = Math.min(...values), max = Math.max(...values), range = max - min || 1, points = values.map(
5197
5200
  (v, i) => `${2 + i / Math.max(1, values.length - 1) * (width - 4)},${2 + height - 4 - (v - min) / range * (height - 4)}`
5198
5201
  ).join(" "), change = values.length > 1 ? values[values.length - 1] - values[0] : 0, line = color || `var(--_kjun-color-${change === 0 ? "text-tertiary" : semantic === "status" ? change > 0 ? "success" : "danger" : change > 0 ? "price-up" : "price-down"})`;
5199
5202
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
@@ -5241,7 +5244,7 @@ function KjunSparkline({
5241
5244
 
5242
5245
  // shared/package-runtime/table.ts
5243
5246
  var import_tokens33 = require("@kjun-ui/tokens");
5244
- var import_react43 = require("react");
5247
+ var import_react42 = require("react");
5245
5248
 
5246
5249
  // shared/package-runtime/table-model.ts
5247
5250
  function getValue(row, key) {
@@ -5285,11 +5288,11 @@ function useTableModel(props) {
5285
5288
  expandSingle = false,
5286
5289
  onExpandedRowsChange
5287
5290
  } = props;
5288
- const [internalSort, setSort] = (0, import_react43.useState)({
5291
+ const [internalSort, setSort] = (0, import_react42.useState)({
5289
5292
  key: "",
5290
5293
  order: "asc"
5291
- }), [internalExpanded, setExpanded] = (0, import_react43.useState)([]), [search, setSearch] = (0, import_react43.useState)(""), timer = (0, import_react43.useRef)(void 0);
5292
- (0, import_react43.useEffect)(() => () => clearTimeout(timer.current), []);
5294
+ }), [internalExpanded, setExpanded] = (0, import_react42.useState)([]), [search, setSearch] = (0, import_react42.useState)(""), timer = (0, import_react42.useRef)(void 0);
5295
+ (0, import_react42.useEffect)(() => () => clearTimeout(timer.current), []);
5293
5296
  const sort = props.sort === void 0 ? internalSort : (_a = props.sort) != null ? _a : { key: "", order: "asc" };
5294
5297
  const rows = sortTableRows(data, sort, { sortable, sortMode });
5295
5298
  const key = (row, index = 0) => tableRowKey(row, rowKey, index);
@@ -5431,10 +5434,10 @@ function TableToolbar({
5431
5434
 
5432
5435
  // packages/react/src/table-grid.tsx
5433
5436
  var import_tokens36 = require("@kjun-ui/tokens");
5434
- var import_react45 = require("react");
5437
+ var import_react44 = require("react");
5435
5438
 
5436
5439
  // packages/react/src/table-check.tsx
5437
- var import_react44 = require("react");
5440
+ var import_react43 = require("react");
5438
5441
 
5439
5442
  // shared/package-runtime/component-icons.ts
5440
5443
  var import_minus = __toESM(require("@kjun-ui/icons/icons/minus"), 1);
@@ -5443,7 +5446,7 @@ var componentIcons = { minus: import_minus.default };
5443
5446
  // packages/react/src/table-check.tsx
5444
5447
  var import_tokens35 = require("@kjun-ui/tokens");
5445
5448
  var import_jsx_runtime31 = require("react/jsx-runtime");
5446
- var TableCheck = (0, import_react44.forwardRef)(
5449
+ var TableCheck = (0, import_react43.forwardRef)(
5447
5450
  function TableCheck2(props, ref) {
5448
5451
  const size = import_tokens35.tokens.extensions.checkbox.iconSizes.sm;
5449
5452
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconFallbacks, { icons: componentIcons, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "kjun-table-check", children: [
@@ -5531,7 +5534,7 @@ function TableGrid({ initialLoading, skeletonRows, skeletonHidden, state, onRowC
5531
5534
  className: "kjun-table-empty",
5532
5535
  children: emptyContent || emptyText
5533
5536
  }
5534
- ) }) : state.rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react45.Fragment, { children: [
5537
+ ) }) : state.rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react44.Fragment, { children: [
5535
5538
  /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
5536
5539
  "tr",
5537
5540
  {
@@ -5675,7 +5678,7 @@ function TableCards({
5675
5678
  }
5676
5679
 
5677
5680
  // packages/react/src/table-view.tsx
5678
- var import_react46 = require("react");
5681
+ var import_react45 = require("react");
5679
5682
  var import_tokens37 = require("@kjun-ui/tokens");
5680
5683
  var import_jsx_runtime34 = require("react/jsx-runtime");
5681
5684
  function KjunTable(props) {
@@ -5705,8 +5708,8 @@ function KjunTable(props) {
5705
5708
  onRowClick,
5706
5709
  onRetry
5707
5710
  } = props;
5708
- const state = useTableModel2(props), query2 = useQueryDisplay(props), revealed = useLoadingReveal(query2.initialLoading, skeleton ? loadingDelay : 0), [mobile, setMobile] = (0, import_react46.useState)(false);
5709
- (0, import_react46.useEffect)(() => {
5711
+ const state = useTableModel2(props), query2 = useQueryDisplay(props), revealed = useLoadingReveal(query2.initialLoading, skeleton ? loadingDelay : 0), [mobile, setMobile] = (0, import_react45.useState)(false);
5712
+ (0, import_react45.useEffect)(() => {
5710
5713
  const media = matchMedia(`(width < ${import_tokens37.tokens.table.mobileBreakpoint}px)`);
5711
5714
  const update = () => setMobile(media.matches);
5712
5715
  update();
@@ -6072,7 +6075,7 @@ function KjunKpiRow({
6072
6075
  var import_tokens39 = require("@kjun-ui/tokens");
6073
6076
 
6074
6077
  // shared/package-runtime/market-cards.ts
6075
- var import_react47 = require("react");
6078
+ var import_react46 = require("react");
6076
6079
  function useMarketCardsModel(props, persistence) {
6077
6080
  const {
6078
6081
  columns,
@@ -6088,8 +6091,8 @@ function useMarketCardsModel(props, persistence) {
6088
6091
  sortKey: c.sortable ? metricConfig[c.key].sortKey : null,
6089
6092
  isDefaultSort: c.defaultSort
6090
6093
  }));
6091
- const [key, setKey] = (0, import_react47.useState)(""), restoreSignature = JSON.stringify([storageNamespace, pills]);
6092
- const mounted = (0, import_react47.useRef)("");
6094
+ const [key, setKey] = (0, import_react46.useState)(""), restoreSignature = JSON.stringify([storageNamespace, pills]);
6095
+ const mounted = (0, import_react46.useRef)("");
6093
6096
  const save = (key2) => {
6094
6097
  var _a;
6095
6098
  try {
@@ -6097,7 +6100,7 @@ function useMarketCardsModel(props, persistence) {
6097
6100
  } catch (e) {
6098
6101
  }
6099
6102
  };
6100
- (0, import_react47.useEffect)(() => {
6103
+ (0, import_react46.useEffect)(() => {
6101
6104
  var _a, _b;
6102
6105
  if (mounted.current === restoreSignature) return;
6103
6106
  mounted.current = restoreSignature;
@@ -6433,7 +6436,7 @@ function watchTrailingOverflow(element, onChange) {
6433
6436
  }
6434
6437
 
6435
6438
  // packages/react/src/market-table.tsx
6436
- var import_react48 = require("react");
6439
+ var import_react47 = require("react");
6437
6440
  var import_jsx_runtime40 = require("react/jsx-runtime");
6438
6441
  function KjunMarketTable(props) {
6439
6442
  const {
@@ -6454,8 +6457,8 @@ function KjunMarketTable(props) {
6454
6457
  formatMetric,
6455
6458
  renderCell
6456
6459
  } = props;
6457
- const scroller = (0, import_react48.useRef)(null), [fadeEnd, setFadeEnd] = (0, import_react48.useState)(false);
6458
- (0, import_react48.useEffect)(() => scroller.current ? watchTrailingOverflow(scroller.current, setFadeEnd) : void 0, [rows, columns]);
6460
+ const scroller = (0, import_react47.useRef)(null), [fadeEnd, setFadeEnd] = (0, import_react47.useState)(false);
6461
+ (0, import_react47.useEffect)(() => scroller.current ? watchTrailingOverflow(scroller.current, setFadeEnd) : void 0, [rows, columns]);
6459
6462
  const render = (row, col) => {
6460
6463
  const value = getValue(row, col.key), stale = !!getValue(row, "stale");
6461
6464
  if (cellLoading(row, col))
@@ -6652,7 +6655,7 @@ function KjunMarketTable(props) {
6652
6655
  }
6653
6656
 
6654
6657
  // packages/react/src/list.tsx
6655
- var import_react49 = require("react");
6658
+ var import_react48 = require("react");
6656
6659
  var import_jsx_runtime41 = require("react/jsx-runtime");
6657
6660
  function KjunListRow({ title, description, leading, trailing, actions, href, disabled = false, onClick }) {
6658
6661
  const contents = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
@@ -6670,7 +6673,7 @@ function KjunListRow({ title, description, leading, trailing, actions, href, dis
6670
6673
  ] });
6671
6674
  }
6672
6675
  function KjunListSection({ title, description, actions, children, ariaLabel }) {
6673
- const id = "kjun-" + (0, import_react49.useId)();
6676
+ const id = "kjun-" + (0, import_react48.useId)();
6674
6677
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "kjun-list-section", "aria-labelledby": title ? id : void 0, "aria-label": title ? void 0 : ariaLabel, children: [
6675
6678
  (title || description || actions) && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "kjun-list-heading", children: [
6676
6679
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
@@ -6725,14 +6728,14 @@ function KjunBottomActionBar({ description, children, safeAreaBottom = 0, keyboa
6725
6728
  }
6726
6729
 
6727
6730
  // packages/react/src/media.tsx
6728
- var import_react50 = require("react");
6731
+ var import_react49 = require("react");
6729
6732
  var import_tokens44 = require("@kjun-ui/tokens");
6730
6733
  var import_jsx_runtime43 = require("react/jsx-runtime");
6731
6734
  function KjunImage({ src, alt, decorative = false, aspectRatio = 1, fit = "cover", fallback: fallback2, lazy = true, onLoad, onError }) {
6732
- const current = (0, import_react50.useRef)({ src, version: 0 });
6735
+ const current = (0, import_react49.useRef)({ src, version: 0 });
6733
6736
  if (current.current.src !== src) current.current = { src, version: current.current.version + 1 };
6734
6737
  const version = current.current.version;
6735
- const [result, setResult] = (0, import_react50.useState)({ version, state: "loading" });
6738
+ const [result, setResult] = (0, import_react49.useState)({ version, state: "loading" });
6736
6739
  const state = result.version === version ? result.state : "loading";
6737
6740
  const failed = !src || state === "error";
6738
6741
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "kjun-image", style: { aspectRatio: aspectRatio > 0 ? aspectRatio : 1 }, "data-state": failed ? "error" : state, children: [
@@ -6764,7 +6767,7 @@ function KjunChip({ label, icon, removable = false, disabled = false, size = "md
6764
6767
  }
6765
6768
 
6766
6769
  // packages/react/src/range-input.tsx
6767
- var import_react51 = require("react");
6770
+ var import_react50 = require("react");
6768
6771
  var import_react_aria_components9 = require("react-aria-components");
6769
6772
  var import_tokens46 = require("@kjun-ui/tokens");
6770
6773
  var import_jsx_runtime45 = require("react/jsx-runtime");
@@ -6773,10 +6776,10 @@ function RangeInput({ value, min = 0, max = 100, step = 1, disabled = false, lab
6773
6776
  const domain = (0, import_tokens46.createSliderDomain)(min, max, step);
6774
6777
  const list = Array.isArray(value) ? value : [value];
6775
6778
  const valid = domain.valid && (!Array.isArray(value) || value.length === 2) && list.every((v) => domain.accepts(v)) && (list.length === 1 || list[0] <= list[1]);
6776
- const latest = (0, import_react51.useRef)(value);
6779
+ const latest = (0, import_react50.useRef)(value);
6777
6780
  latest.current = value;
6778
- const active = (0, import_react51.useRef)(false);
6779
- (0, import_react51.useEffect)(() => {
6781
+ const active = (0, import_react50.useRef)(false);
6782
+ (0, import_react50.useEffect)(() => {
6780
6783
  if (!valid) console.warn("KJUN Slider: \uBC94\uC704\xB7step\xB7\uAC12\uC744 \uD655\uC778\uD558\uC138\uC694.");
6781
6784
  }, [valid]);
6782
6785
  const change = (next) => {
@@ -6813,7 +6816,7 @@ function KjunRangeSlider(props) {
6813
6816
  }
6814
6817
 
6815
6818
  // packages/react/src/quantity-stepper.tsx
6816
- var import_react52 = require("react");
6819
+ var import_react51 = require("react");
6817
6820
  var import_tokens47 = require("@kjun-ui/tokens");
6818
6821
  var import_jsx_runtime46 = require("react/jsx-runtime");
6819
6822
  function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, disabled = false, error = false, size = "md", block = false, id, ariaLabel, onValueChange, onChangeCommit, onInvalidInput }) {
@@ -6821,15 +6824,15 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
6821
6824
  const buttonStyle = { width: import_tokens47.tokens.input[size].height, padding: 0 };
6822
6825
  const domain = (0, import_tokens47.createNumberDomain)({ min, max, step, precision });
6823
6826
  const valid = domain.valid && domain.accepts(value), blocked = disabled || !valid;
6824
- const [draft, setDraft] = (0, import_react52.useState)(String(value));
6827
+ const [draft, setDraft] = (0, import_react51.useState)(String(value));
6825
6828
  const field = useKjunField();
6826
- const composing = (0, import_react52.useRef)(false), dirty = (0, import_react52.useRef)(false), accepted = (0, import_react52.useRef)(value);
6827
- (0, import_react52.useEffect)(() => {
6829
+ const composing = (0, import_react51.useRef)(false), dirty = (0, import_react51.useRef)(false), accepted = (0, import_react51.useRef)(value);
6830
+ (0, import_react51.useEffect)(() => {
6828
6831
  setDraft(String(value));
6829
6832
  accepted.current = value;
6830
6833
  dirty.current = false;
6831
6834
  }, [value, precision, min, max, step]);
6832
- (0, import_react52.useEffect)(() => {
6835
+ (0, import_react51.useEffect)(() => {
6833
6836
  if (!valid) console.warn("KJUN QuantityStepper: \uBC94\uC704\xB7step\xB7\uC815\uBC00\uB3C4\xB7\uAC12\uC744 \uD655\uC778\uD558\uC138\uC694.");
6834
6837
  }, [valid]);
6835
6838
  const emit = (next) => {
@@ -6904,16 +6907,16 @@ function KjunQuantityStepper({ value, min = 0, max, step = 1, precision = 0, dis
6904
6907
  }
6905
6908
 
6906
6909
  // packages/react/src/time-picker.tsx
6907
- var import_react53 = require("react");
6910
+ var import_react52 = require("react");
6908
6911
  var import_tokens48 = require("@kjun-ui/tokens");
6909
6912
  var import_jsx_runtime47 = require("react/jsx-runtime");
6910
6913
  function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1, secondStep = 1, disabled = false, error = false, clearable = true, size = "md", ariaLabel = "\uC2DC\uAC04", onValueChange, onChangeCommit }) {
6911
- const root = (0, import_react53.useRef)(null);
6912
- const field = useKjunField(), uid = (0, import_react53.useId)();
6914
+ const root = (0, import_react52.useRef)(null);
6915
+ const field = useKjunField(), uid = (0, import_react52.useId)();
6913
6916
  const fieldId = (field == null ? void 0 : field.id) || `kjun-time-${uid}`;
6914
- const domain = (0, import_react53.useMemo)(() => (0, import_tokens48.createTimeDomain)({ precision, min, max, minuteStep, secondStep }), [precision, min, max, minuteStep, secondStep]);
6917
+ const domain = (0, import_react52.useMemo)(() => (0, import_tokens48.createTimeDomain)({ precision, min, max, minuteStep, secondStep }), [precision, min, max, minuteStep, secondStep]);
6915
6918
  const valid = domain.valid && domain.accepts(value);
6916
- (0, import_react53.useEffect)(() => {
6919
+ (0, import_react52.useEffect)(() => {
6917
6920
  if (!valid) console.warn("KJUN TimePicker: \uC2DC\uAC01 \uBC94\uC704\xB7\uAC04\uACA9\xB7\uAC12\uC744 \uD655\uC778\uD558\uC138\uC694.");
6918
6921
  }, [valid]);
6919
6922
  const change = (next) => {
@@ -6927,7 +6930,7 @@ function KjunTimePicker({ value, precision = "minute", min, max, minuteStep = 1,
6927
6930
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(CompoundControlContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "kjun-time-segments", children: ["\uC2DC", "\uBD84", "\uCD08"].slice(0, precision === "second" ? 3 : 2).map((label, index) => {
6928
6931
  const segmentId = index === 0 ? fieldId : `${fieldId}-${index}`;
6929
6932
  const labelId = `${fieldId}-segment-${index}`;
6930
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react53.Fragment, { children: [
6933
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react52.Fragment, { children: [
6931
6934
  index > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "kjun-time-separator", "aria-hidden": true, children: ":" }),
6932
6935
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FieldContext.Provider, { value: { ...field, id: segmentId, labelId: (field == null ? void 0 : field.labelId) ? `${field.labelId} ${labelId}` : void 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "kjun-time-segment", children: [
6933
6936
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { id: labelId, className: "kjun-sr-only", "aria-hidden": true, children: label }),
package/dist/index.js CHANGED
@@ -1501,17 +1501,6 @@ function KjunSkeleton({
1501
1501
  },
1502
1502
  row
1503
1503
  )) }),
1504
- type === "chart" && /* @__PURE__ */ jsxs6("div", { className: "kjun-skeleton-chart", style: { height: height || tokens7.extensions.skeleton.chartHeight }, children: [
1505
- /* @__PURE__ */ jsx8("div", { className: "kjun-skeleton-chart-bars", children: [40, 65, 50, 80, 60, 90, 75].map((h, i) => /* @__PURE__ */ jsx8(
1506
- "div",
1507
- {
1508
- className: "kjun-skeleton-chart-bar",
1509
- style: { height: h + "%" }
1510
- },
1511
- i
1512
- )) }),
1513
- /* @__PURE__ */ jsx8("div", { className: "kjun-skeleton-chart-axis" })
1514
- ] }),
1515
1504
  type === "stat" && /* @__PURE__ */ jsxs6("div", { className: "kjun-skeleton-stat", children: [
1516
1505
  /* @__PURE__ */ jsxs6("div", { className: "kjun-skeleton-stat-content", children: [
1517
1506
  line("40%", 0, tokens7.extensions.skeleton.lineHeights.sm),
@@ -4618,7 +4607,17 @@ var KjunErrorBoundary = class extends Component {
4618
4607
 
4619
4608
  // packages/react/src/skeletons.tsx
4620
4609
  import { tokens as tokens25 } from "@kjun-ui/tokens";
4621
- import { Fragment as Fragment9 } from "react";
4610
+
4611
+ // shared/package-runtime/chart-skeleton.ts
4612
+ var chartFrameViewBox = "0 0 600 240";
4613
+ var chartFramePath = "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590";
4614
+ var chartSkeletonMaxCount = 100;
4615
+ function chartSkeletonCount(value) {
4616
+ return Number.isFinite(value) ? Math.min(chartSkeletonMaxCount, Math.max(1, Math.floor(value))) : 1;
4617
+ }
4618
+ function chartMatrixMuted(row, column) {
4619
+ return (row + column + 2) % 3 === 0;
4620
+ }
4622
4621
 
4623
4622
  // packages/react/src/market-skeleton.tsx
4624
4623
  import { tokens as tokens24 } from "@kjun-ui/tokens";
@@ -4680,7 +4679,7 @@ function KjunMarketTableSkeleton({ columns = [], rows = 8, showActions = false,
4680
4679
  }
4681
4680
 
4682
4681
  // packages/react/src/skeletons.tsx
4683
- import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
4682
+ import { Fragment as Fragment9, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
4684
4683
  function KjunListSkeleton({
4685
4684
  rows = 8,
4686
4685
  variant = "market",
@@ -4737,67 +4736,71 @@ function KjunFormSkeleton({
4737
4736
  );
4738
4737
  }
4739
4738
  function KjunChartSkeleton({
4739
+ kind = "frame",
4740
+ height = tokens25.extensions.chartSkeleton.height,
4740
4741
  loadingText = "\uCC28\uD2B8\uB97C \uBD88\uB7EC\uC624\uB294 \uC911",
4741
- kind = "line",
4742
- height = tokens25.extensions.chartSkeleton.height
4742
+ skeleton = true,
4743
+ loadingDelay = 0,
4744
+ rows = 8,
4745
+ columns = 14
4743
4746
  }) {
4744
- return /* @__PURE__ */ jsxs21("div", { className: "kjun-chart-skeleton", style: { height }, "aria-hidden": "true", children: [
4745
- /* @__PURE__ */ jsx27("div", { className: "kjun-chart-skeleton-status", children: loadingText && /* @__PURE__ */ jsx27("span", { children: loadingText }) }),
4746
- kind === "donut" ? /* @__PURE__ */ jsx27("div", { className: "kjun-chart-skeleton-donut", children: /* @__PURE__ */ jsx27(KjunSkeleton, { type: "block", width: tokens25.extensions.chartSkeleton.donutLabelWidth, height: tokens25.extensions.chartSkeleton.donutLabelHeight }) }) : /* @__PURE__ */ jsxs21(
4747
- "svg",
4748
- {
4749
- viewBox: "0 0 600 240",
4750
- preserveAspectRatio: "none",
4751
- className: "kjun-chart-skeleton-plot",
4752
- children: [
4753
- /* @__PURE__ */ jsx27(
4754
- "path",
4755
- {
4756
- d: "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590",
4757
- fill: "none",
4758
- stroke: "var(--_kjun-color-border)",
4759
- strokeWidth: 1
4760
- }
4761
- ),
4762
- kind === "line" && /* @__PURE__ */ jsx27("path", { d: "M20 190 L100 160 L180 172 L260 120 L340 140 L420 96 L500 110 L590 64", fill: "none", stroke: "var(--_kjun-color-skeleton)", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" }),
4763
- kind === "matrix" ? Array.from({ length: 8 }, (_, row) => /* @__PURE__ */ jsx27("g", { children: Array.from({ length: 14 }, (_2, col) => /* @__PURE__ */ jsx27(
4764
- "rect",
4765
- {
4766
- x: 24 + col * 40,
4767
- y: 12 + row * 26,
4768
- width: 36,
4769
- height: 22,
4770
- rx: 2,
4771
- fill: "var(--_kjun-color-skeleton)",
4772
- opacity: (row + col + 2) % 3 === 0 ? 0.55 : 1
4747
+ const revealed = useLoadingReveal(true, loadingDelay), status = revealed && loadingText ? "status" : void 0, rowCount = chartSkeletonCount(rows), columnCount = chartSkeletonCount(columns);
4748
+ return /* @__PURE__ */ jsx27(
4749
+ "div",
4750
+ {
4751
+ className: "kjun-chart-skeleton",
4752
+ "data-kjun-chart-kind": kind,
4753
+ "data-skeleton": skeleton ? void 0 : "false",
4754
+ "aria-hidden": revealed ? void 0 : true,
4755
+ style: { height, visibility: revealed ? void 0 : "hidden" },
4756
+ children: !skeleton ? /* @__PURE__ */ jsxs21("div", { className: "kjun-data-loading", "data-kjun-chart-part": "loading", role: status, children: [
4757
+ /* @__PURE__ */ jsx27("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx27(KjunSpinner, { size: "md" }) }),
4758
+ loadingText && /* @__PURE__ */ jsx27("p", { children: loadingText })
4759
+ ] }) : /* @__PURE__ */ jsxs21(Fragment9, { children: [
4760
+ kind === "donut" ? /* @__PURE__ */ jsx27("div", { className: "kjun-chart-skeleton-donut", "data-kjun-chart-part": "donut", "aria-hidden": "true" }) : kind === "matrix" ? /* @__PURE__ */ jsx27(
4761
+ "div",
4762
+ {
4763
+ className: "kjun-chart-skeleton-matrix",
4764
+ "data-kjun-chart-part": "matrix",
4765
+ "aria-hidden": "true",
4766
+ style: {
4767
+ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`,
4768
+ gridTemplateRows: `repeat(${rowCount}, minmax(0, 1fr))`
4773
4769
  },
4774
- col
4775
- )) }, row)) : (kind === "bar" || kind === "candle") && [60, 100, 85, 140, 110, 165, 180].map((h, i) => /* @__PURE__ */ jsxs21(Fragment9, { children: [
4776
- kind === "candle" && /* @__PURE__ */ jsx27(
4770
+ children: Array.from({ length: rowCount * columnCount }, (_, i) => /* @__PURE__ */ jsx27(
4771
+ "div",
4772
+ {
4773
+ className: "kjun-chart-skeleton-cell",
4774
+ "data-kjun-chart-part": "cell",
4775
+ "data-muted": chartMatrixMuted(Math.floor(i / columnCount), i % columnCount) ? "" : void 0
4776
+ },
4777
+ i
4778
+ ))
4779
+ }
4780
+ ) : /* @__PURE__ */ jsx27(
4781
+ "svg",
4782
+ {
4783
+ viewBox: chartFrameViewBox,
4784
+ preserveAspectRatio: "none",
4785
+ className: "kjun-chart-skeleton-plot",
4786
+ "data-kjun-chart-part": "plot",
4787
+ "aria-hidden": "true",
4788
+ children: /* @__PURE__ */ jsx27(
4777
4789
  "path",
4778
4790
  {
4779
- d: `M${55 + i * 75} ${195 - h}V${225 - h / 2}`,
4791
+ d: chartFramePath,
4780
4792
  fill: "none",
4781
- stroke: "var(--_kjun-color-skeleton)",
4782
- strokeWidth: 4
4783
- }
4784
- ),
4785
- /* @__PURE__ */ jsx27(
4786
- "rect",
4787
- {
4788
- x: 35 + i * 75,
4789
- y: kind === "candle" ? 210 - h : 220 - h,
4790
- width: kind === "candle" ? 28 : 42,
4791
- height: kind === "candle" ? h / 2 : h,
4792
- rx: 3,
4793
- fill: "var(--_kjun-color-skeleton)"
4793
+ stroke: "var(--_kjun-color-chart-grid)",
4794
+ strokeWidth: tokens25.border.defaultWidth,
4795
+ vectorEffect: "non-scaling-stroke"
4794
4796
  }
4795
4797
  )
4796
- ] }, i))
4797
- ]
4798
- }
4799
- )
4800
- ] });
4798
+ }
4799
+ ),
4800
+ loadingText && /* @__PURE__ */ jsx27("div", { className: "kjun-chart-skeleton-status", "data-kjun-chart-part": "status", role: status, children: /* @__PURE__ */ jsx27("span", { children: loadingText }) })
4801
+ ] })
4802
+ }
4803
+ );
4801
4804
  }
4802
4805
 
4803
4806
  // packages/react/src/financial-display.tsx
package/dist/styles.css CHANGED
@@ -482,9 +482,6 @@
482
482
  --_kjun-extension-skeleton-avatar-size: 48px;
483
483
  --_kjun-extension-skeleton-card-avatar-size: 40px;
484
484
  --_kjun-extension-skeleton-table-line-height: 14px;
485
- --_kjun-extension-skeleton-chart-height: 200px;
486
- --_kjun-extension-skeleton-chart-bar-max-width: 40px;
487
- --_kjun-extension-skeleton-chart-axis-height: 2px;
488
485
  --_kjun-extension-skeleton-stat-width: 80px;
489
486
  --_kjun-extension-skeleton-stat-height: 40px;
490
487
  --_kjun-extension-skeleton-block-height: 100px;
@@ -678,8 +675,6 @@
678
675
  --_kjun-extension-market-list-change-skeleton-height: 14px;
679
676
  --_kjun-extension-chart-skeleton-height: 240px;
680
677
  --_kjun-extension-chart-skeleton-donut-thickness: 22px;
681
- --_kjun-extension-chart-skeleton-donut-label-width: 76px;
682
- --_kjun-extension-chart-skeleton-donut-label-height: 14px;
683
678
  --_kjun-state-opacity-disabled: 0.5;
684
679
  --_kjun-state-opacity-disabled-strong: 0.4;
685
680
  --_kjun-state-opacity-pressed: 0.8;
@@ -1950,37 +1945,6 @@
1950
1945
  height: var(--_kjun-extension-skeleton-table-line-height);
1951
1946
  }
1952
1947
 
1953
- /* Chart */
1954
- .kjun-skeleton-chart {
1955
- display: flex;
1956
- flex-direction: column;
1957
- padding: var(--_kjun-extension-skeleton-padding);
1958
- border: var(--_kjun-border-default-width) solid var(--_kjun-border-primary);
1959
- border-radius: var(--_kjun-extension-skeleton-radius);
1960
- background: var(--_kjun-bg-primary);
1961
- }
1962
-
1963
- .kjun-skeleton-chart-bars {
1964
- flex: 1;
1965
- display: flex;
1966
- align-items: flex-end;
1967
- justify-content: space-around;
1968
- gap: var(--_kjun-extension-skeleton-gap);
1969
- /* Bars stand on the axis line, like ChartSkeleton. */
1970
- }
1971
-
1972
- .kjun-skeleton-chart-bar {
1973
- flex: 1;
1974
- max-width: var(--_kjun-extension-skeleton-chart-bar-max-width);
1975
- background: var(--_kjun-skeleton);
1976
- border-radius: var(--_kjun-extension-skeleton-line-radius) var(--_kjun-geometry-radius-radius4) 0 0;
1977
- }
1978
-
1979
- .kjun-skeleton-chart-axis {
1980
- height: var(--_kjun-extension-skeleton-chart-axis-height);
1981
- background: var(--_kjun-border-primary);
1982
- }
1983
-
1984
1948
  /* Stat Card */
1985
1949
  .kjun-skeleton-stat {
1986
1950
  display: flex;
@@ -2021,7 +1985,6 @@
2021
1985
  /* Animation */
2022
1986
  .kjun-skeleton-animated .kjun-skeleton-line,
2023
1987
  .kjun-skeleton-animated .kjun-skeleton-avatar,
2024
- .kjun-skeleton-animated .kjun-skeleton-chart-bar,
2025
1988
  .kjun-skeleton-animated .kjun-skeleton-sparkline,
2026
1989
  .kjun-skeleton-animated .kjun-skeleton-block {
2027
1990
  background: linear-gradient(
@@ -3116,7 +3079,7 @@
3116
3079
  }
3117
3080
  }
3118
3081
  .kjun-chart-skeleton {
3119
- position:relative;
3082
+ position: relative;
3120
3083
  display: flex;
3121
3084
  align-items: center;
3122
3085
  justify-content: center;
@@ -3124,6 +3087,14 @@
3124
3087
  min-width: 0;
3125
3088
  animation: kjun-chart-pulse var(--_kjun-motion-shimmer) ease-in-out infinite;
3126
3089
  }
3090
+ .kjun-chart-skeleton[data-kjun-chart-kind="donut"] {
3091
+ /* Only the donut label measures the hole against this box's height; size containment elsewhere would
3092
+ drop the frame's intrinsic width inside shrink-to-fit parents. */
3093
+ container-type: size;
3094
+ }
3095
+ .kjun-chart-skeleton[data-skeleton="false"] {
3096
+ animation: none;
3097
+ }
3127
3098
  .kjun-chart-skeleton-plot {
3128
3099
  width: 100%;
3129
3100
  height: 100%;
@@ -3133,9 +3104,19 @@
3133
3104
  aspect-ratio: 1;
3134
3105
  border: var(--_kjun-extension-chart-skeleton-donut-thickness) solid var(--_kjun-color-skeleton);
3135
3106
  border-radius: 50%;
3136
- display: flex;
3137
- align-items: center;
3138
- justify-content: center;
3107
+ }
3108
+ .kjun-chart-skeleton-matrix {
3109
+ display: grid;
3110
+ width: 100%;
3111
+ height: 100%;
3112
+ gap: var(--_kjun-geometry-dimension-value4);
3113
+ }
3114
+ .kjun-chart-skeleton-cell {
3115
+ background: var(--_kjun-color-skeleton);
3116
+ border-radius: var(--_kjun-extension-skeleton-line-radius);
3117
+ }
3118
+ .kjun-chart-skeleton-cell[data-muted] {
3119
+ opacity: var(--_kjun-state-opacity-pending);
3139
3120
  }
3140
3121
  @keyframes kjun-chart-pulse {
3141
3122
  50% {
@@ -3153,7 +3134,8 @@
3153
3134
  .kjun-error-fallback p { margin:var(--_kjun-geometry-dimension-value8) 0 var(--_kjun-geometry-dimension-value16); font-size:var(--_kjun-extension-state-description-size); line-height:var(--_kjun-type-caption-line); color:var(--_kjun-color-text-secondary); font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking);}
3154
3135
 
3155
3136
  .kjun-chart-skeleton-status { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:var(--_kjun-extension-skeleton-gap); pointer-events:none; }
3156
- .kjun-chart-skeleton-status>span { max-width:90%; padding:var(--_kjun-geometry-dimension-value4) var(--_kjun-geometry-dimension-value12); border-radius:var(--_kjun-geometry-radius-radius6); font-size:var(--_kjun-type-body-size); text-align:center; overflow-wrap:anywhere; background:var(--_kjun-color-surface); color:var(--_kjun-color-text-secondary); line-height: var(--_kjun-type-body-line); font-weight: var(--_kjun-type-body-weight); letter-spacing: var(--_kjun-type-body-tracking); }
3137
+ .kjun-chart-skeleton-status>span { max-width:90%; padding:var(--_kjun-geometry-dimension-value4) var(--_kjun-geometry-dimension-value12); border-radius:var(--_kjun-geometry-radius-radius6); font-size:var(--_kjun-type-body-size); text-align:center; overflow-wrap:anywhere; background:var(--_kjun-color-surface); color:var(--_kjun-color-text-secondary); line-height: var(--_kjun-type-body-line); font-weight: var(--_kjun-type-body-weight); letter-spacing: var(--_kjun-type-body-tracking); border:var(--_kjun-border-default-width) solid var(--_kjun-color-chart-grid); }
3138
+ .kjun-chart-skeleton[data-kjun-chart-kind="donut"] .kjun-chart-skeleton-status>span { border:0; max-width:calc(80cqh - 2 * var(--_kjun-extension-chart-skeleton-donut-thickness)); }
3157
3139
 
3158
3140
  .kjun-data-status > .kjun-spinner { flex-shrink: 0; }
3159
3141
  .kjun-data-status > span:last-child { min-width: 0; overflow-wrap: anywhere; }
@@ -44,7 +44,7 @@ export interface KjunProgressProps {
44
44
  }
45
45
  export declare function KjunProgress({ value, max, size, variant, showLabel, label, subLabel, }: KjunProgressProps): import("react/jsx-runtime").JSX.Element;
46
46
  export interface KjunSkeletonProps {
47
- type?: "text" | "avatar" | "card" | "table" | "chart" | "stat" | "block";
47
+ type?: "text" | "avatar" | "card" | "table" | "stat" | "block";
48
48
  rows?: number;
49
49
  columns?: number;
50
50
  height?: CSSProperties["height"];
@@ -44,7 +44,7 @@ export interface KjunProgressProps {
44
44
  }
45
45
  export declare function KjunProgress({ value, max, size, variant, showLabel, label, subLabel, }: KjunProgressProps): import("react/jsx-runtime").JSX.Element;
46
46
  export interface KjunSkeletonProps {
47
- type?: "text" | "avatar" | "card" | "table" | "chart" | "stat" | "block";
47
+ type?: "text" | "avatar" | "card" | "table" | "stat" | "block";
48
48
  rows?: number;
49
49
  columns?: number;
50
50
  height?: CSSProperties["height"];
@@ -1,5 +1,6 @@
1
1
  import { type InputSize } from "@kjun-ui/tokens";
2
2
  import { type CSSProperties } from "react";
3
+ import { type KjunChartSkeletonKind } from "../../../shared/package-runtime/chart-skeleton.cjs";
3
4
  export interface KjunListSkeletonProps {
4
5
  rows?: number;
5
6
  variant?: "market" | "compact" | "notification";
@@ -19,10 +20,14 @@ export interface KjunFormSkeletonProps {
19
20
  }
20
21
  export declare function KjunFormSkeleton({ fields, columns, multiline, size, }: KjunFormSkeletonProps): import("react/jsx-runtime").JSX.Element;
21
22
  export interface KjunChartSkeletonProps {
22
- loadingText?: string;
23
- kind?: "grid" | "line" | "bar" | "donut" | "candle" | "matrix";
23
+ kind?: KjunChartSkeletonKind;
24
24
  height?: CSSProperties["height"];
25
+ loadingText?: string;
26
+ skeleton?: boolean;
27
+ loadingDelay?: number;
28
+ rows?: number;
29
+ columns?: number;
25
30
  }
26
- export declare function KjunChartSkeleton({ loadingText, kind, height, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function KjunChartSkeleton({ kind, height, loadingText, skeleton, loadingDelay, rows, columns, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
27
32
  export { KjunMarketTableSkeleton } from "./market-skeleton.cjs";
28
33
  export type { KjunMarketTableSkeletonProps } from "./market-skeleton.cjs";
@@ -1,5 +1,6 @@
1
1
  import { type InputSize } from "@kjun-ui/tokens";
2
2
  import { type CSSProperties } from "react";
3
+ import { type KjunChartSkeletonKind } from "../../../shared/package-runtime/chart-skeleton.js";
3
4
  export interface KjunListSkeletonProps {
4
5
  rows?: number;
5
6
  variant?: "market" | "compact" | "notification";
@@ -19,10 +20,14 @@ export interface KjunFormSkeletonProps {
19
20
  }
20
21
  export declare function KjunFormSkeleton({ fields, columns, multiline, size, }: KjunFormSkeletonProps): import("react/jsx-runtime").JSX.Element;
21
22
  export interface KjunChartSkeletonProps {
22
- loadingText?: string;
23
- kind?: "grid" | "line" | "bar" | "donut" | "candle" | "matrix";
23
+ kind?: KjunChartSkeletonKind;
24
24
  height?: CSSProperties["height"];
25
+ loadingText?: string;
26
+ skeleton?: boolean;
27
+ loadingDelay?: number;
28
+ rows?: number;
29
+ columns?: number;
25
30
  }
26
- export declare function KjunChartSkeleton({ loadingText, kind, height, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function KjunChartSkeleton({ kind, height, loadingText, skeleton, loadingDelay, rows, columns, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
27
32
  export { KjunMarketTableSkeleton } from "./market-skeleton.js";
28
33
  export type { KjunMarketTableSkeletonProps } from "./market-skeleton.js";
@@ -0,0 +1,12 @@
1
+ export type KjunChartSkeletonKind = "frame" | "donut" | "matrix";
2
+ /** Axes plus three horizontal grid lines in the frame's 600×240 viewBox. */
3
+ export declare const chartFrameViewBox = "0 0 600 240";
4
+ export declare const chartFramePath = "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590";
5
+ /** Upper bound for matrix rows and columns, so counts derived from data never render an unbounded grid. */
6
+ export declare const chartSkeletonMaxCount = 100;
7
+ /** Matrix rows and columns: finite values floor into 1–100; anything else is 1. */
8
+ export declare function chartSkeletonCount(value: number): number;
9
+ /** Every third diagonal cell is drawn at the pending opacity so the matrix reads as a heatmap. */
10
+ export declare function chartMatrixMuted(row: number, column: number): boolean;
11
+ /** Inner diameter of the donut ring, which is 80% of the skeleton height. */
12
+ export declare function chartDonutHole(height: number, thickness: number): number;
@@ -0,0 +1,12 @@
1
+ export type KjunChartSkeletonKind = "frame" | "donut" | "matrix";
2
+ /** Axes plus three horizontal grid lines in the frame's 600×240 viewBox. */
3
+ export declare const chartFrameViewBox = "0 0 600 240";
4
+ export declare const chartFramePath = "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590";
5
+ /** Upper bound for matrix rows and columns, so counts derived from data never render an unbounded grid. */
6
+ export declare const chartSkeletonMaxCount = 100;
7
+ /** Matrix rows and columns: finite values floor into 1–100; anything else is 1. */
8
+ export declare function chartSkeletonCount(value: number): number;
9
+ /** Every third diagonal cell is drawn at the pending opacity so the matrix reads as a heatmap. */
10
+ export declare function chartMatrixMuted(row: number, column: number): boolean;
11
+ /** Inner diameter of the donut ring, which is 80% of the skeleton height. */
12
+ export declare function chartDonutHole(height: number, thickness: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kjun-ui/react",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://ui.kjun.dev",
6
6
  "repository": {
@@ -41,9 +41,9 @@
41
41
  "./package.json": "./package.json"
42
42
  },
43
43
  "dependencies": {
44
- "@kjun-ui/tokens": "0.7.0",
44
+ "@kjun-ui/tokens": "0.8.0",
45
45
  "react-aria-components": "1.21.1",
46
- "@kjun-ui/icons": "0.7.0"
46
+ "@kjun-ui/icons": "0.8.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": "^19.2.3",