@kjun-ui/native 0.7.0 → 0.8.1

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/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,18 +3087,38 @@
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%;
3130
3101
  }
3131
3102
  .kjun-chart-skeleton-donut {
3103
+ /* The hole is 80% − 2 × thickness only in border-box, whatever the app's reset. */
3104
+ box-sizing: border-box;
3132
3105
  height: 80%;
3133
3106
  aspect-ratio: 1;
3134
3107
  border: var(--_kjun-extension-chart-skeleton-donut-thickness) solid var(--_kjun-color-skeleton);
3135
3108
  border-radius: 50%;
3136
- display: flex;
3137
- align-items: center;
3138
- justify-content: center;
3109
+ }
3110
+ .kjun-chart-skeleton-matrix {
3111
+ display: grid;
3112
+ width: 100%;
3113
+ height: 100%;
3114
+ gap: var(--_kjun-geometry-dimension-value4);
3115
+ }
3116
+ .kjun-chart-skeleton-cell {
3117
+ background: var(--_kjun-color-skeleton);
3118
+ border-radius: var(--_kjun-extension-skeleton-line-radius);
3119
+ }
3120
+ .kjun-chart-skeleton-cell[data-muted] {
3121
+ opacity: var(--_kjun-state-opacity-pending);
3139
3122
  }
3140
3123
  @keyframes kjun-chart-pulse {
3141
3124
  50% {
@@ -3153,7 +3136,8 @@
3153
3136
  .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
3137
 
3155
3138
  .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); }
3139
+ .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); }
3140
+ .kjun-chart-skeleton[data-kjun-chart-kind="donut"] .kjun-chart-skeleton-status>span { box-sizing:border-box; border:0; max-width:calc(80cqh - 2 * var(--_kjun-extension-chart-skeleton-donut-thickness)); }
3157
3141
 
3158
3142
  .kjun-data-status > .kjun-spinner { flex-shrink: 0; }
3159
3143
  .kjun-data-status > span:last-child { min-width: 0; overflow-wrap: anywhere; }
@@ -1,6 +1,6 @@
1
1
  import { type DimensionValue } from "react-native";
2
2
  export interface KjunSkeletonProps {
3
- type?: "text" | "avatar" | "card" | "table" | "chart" | "stat" | "block";
3
+ type?: "text" | "avatar" | "card" | "table" | "stat" | "block";
4
4
  rows?: number;
5
5
  columns?: number;
6
6
  height?: DimensionValue;
@@ -1,6 +1,6 @@
1
1
  import { type DimensionValue } from "react-native";
2
2
  export interface KjunSkeletonProps {
3
- type?: "text" | "avatar" | "card" | "table" | "chart" | "stat" | "block";
3
+ type?: "text" | "avatar" | "card" | "table" | "stat" | "block";
4
4
  rows?: number;
5
5
  columns?: number;
6
6
  height?: DimensionValue;
@@ -1,5 +1,6 @@
1
1
  import { type InputSize } from "@kjun-ui/tokens";
2
2
  import { type DimensionValue } from "react-native";
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?: DimensionValue;
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: requestedKind, 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 DimensionValue } from "react-native";
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?: DimensionValue;
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: requestedKind, 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,16 @@
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
+ /** Donut ring diameter as a share of the skeleton height; data-state.css repeats it as 80% and 80cqh. */
12
+ export declare const chartDonutRatio = 0.8;
13
+ /** Inner diameter of the donut ring. */
14
+ export declare function chartDonutHole(height: number, thickness: number): number;
15
+ /** Kinds removed in 0.8.0 (line, bar, candle, grid) or any other value draw, and are named, frame. */
16
+ export declare function chartSkeletonKind(kind: unknown): KjunChartSkeletonKind;
@@ -0,0 +1,16 @@
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
+ /** Donut ring diameter as a share of the skeleton height; data-state.css repeats it as 80% and 80cqh. */
12
+ export declare const chartDonutRatio = 0.8;
13
+ /** Inner diameter of the donut ring. */
14
+ export declare function chartDonutHole(height: number, thickness: number): number;
15
+ /** Kinds removed in 0.8.0 (line, bar, candle, grid) or any other value draw, and are named, frame. */
16
+ export declare function chartSkeletonKind(kind: unknown): KjunChartSkeletonKind;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kjun-ui/native",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://ui.kjun.dev",
6
6
  "repository": {
@@ -47,8 +47,8 @@
47
47
  "./package.json": "./package.json"
48
48
  },
49
49
  "dependencies": {
50
- "@kjun-ui/tokens": "0.7.0",
51
- "@kjun-ui/icons": "0.7.0"
50
+ "@kjun-ui/tokens": "0.8.1",
51
+ "@kjun-ui/icons": "0.8.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": "^19.2.3",