@kjun-ui/react 0.17.0 → 0.18.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.
Files changed (106) hide show
  1. package/dist/index.cjs +3279 -1407
  2. package/dist/index.js +3226 -1353
  3. package/dist/styles.css +993 -191
  4. package/dist/types/packages/react/src/actions.d.cts +12 -3
  5. package/dist/types/packages/react/src/actions.d.ts +12 -3
  6. package/dist/types/packages/react/src/app-navigation.d.cts +22 -3
  7. package/dist/types/packages/react/src/app-navigation.d.ts +22 -3
  8. package/dist/types/packages/react/src/calendar.d.cts +30 -0
  9. package/dist/types/packages/react/src/calendar.d.ts +30 -0
  10. package/dist/types/packages/react/src/carousel.d.cts +39 -0
  11. package/dist/types/packages/react/src/carousel.d.ts +39 -0
  12. package/dist/types/packages/react/src/controls.d.cts +16 -11
  13. package/dist/types/packages/react/src/controls.d.ts +16 -11
  14. package/dist/types/packages/react/src/date-picker.d.cts +34 -6
  15. package/dist/types/packages/react/src/date-picker.d.ts +34 -6
  16. package/dist/types/packages/react/src/display.d.cts +7 -1
  17. package/dist/types/packages/react/src/display.d.ts +7 -1
  18. package/dist/types/packages/react/src/dropdown.d.cts +35 -3
  19. package/dist/types/packages/react/src/dropdown.d.ts +35 -3
  20. package/dist/types/packages/react/src/financial-display.d.cts +10 -1
  21. package/dist/types/packages/react/src/financial-display.d.ts +10 -1
  22. package/dist/types/packages/react/src/financial.d.cts +2 -2
  23. package/dist/types/packages/react/src/financial.d.ts +2 -2
  24. package/dist/types/packages/react/src/index.d.cts +8 -6
  25. package/dist/types/packages/react/src/index.d.ts +8 -6
  26. package/dist/types/packages/react/src/layers.d.cts +1 -1
  27. package/dist/types/packages/react/src/layers.d.ts +1 -1
  28. package/dist/types/packages/react/src/list.d.cts +27 -4
  29. package/dist/types/packages/react/src/list.d.ts +27 -4
  30. package/dist/types/packages/react/src/market-model.d.cts +8 -1
  31. package/dist/types/packages/react/src/market-model.d.ts +8 -1
  32. package/dist/types/packages/react/src/navigation.d.cts +24 -42
  33. package/dist/types/packages/react/src/navigation.d.ts +24 -42
  34. package/dist/types/packages/react/src/number-display.d.cts +12 -12
  35. package/dist/types/packages/react/src/number-display.d.ts +12 -12
  36. package/dist/types/packages/react/src/popover.d.cts +9 -4
  37. package/dist/types/packages/react/src/popover.d.ts +9 -4
  38. package/dist/types/packages/react/src/select-control.d.cts +3 -1
  39. package/dist/types/packages/react/src/select-control.d.ts +3 -1
  40. package/dist/types/packages/react/src/select.d.cts +2 -2
  41. package/dist/types/packages/react/src/select.d.ts +2 -2
  42. package/dist/types/packages/react/src/table-cards.d.cts +1 -1
  43. package/dist/types/packages/react/src/table-cards.d.ts +1 -1
  44. package/dist/types/packages/react/src/table-grid.d.cts +1 -1
  45. package/dist/types/packages/react/src/table-grid.d.ts +1 -1
  46. package/dist/types/packages/react/src/table-list.d.cts +14 -0
  47. package/dist/types/packages/react/src/table-list.d.ts +14 -0
  48. package/dist/types/packages/react/src/table-model.d.cts +1 -0
  49. package/dist/types/packages/react/src/table-model.d.ts +1 -0
  50. package/dist/types/packages/react/src/table-toolbar.d.cts +1 -1
  51. package/dist/types/packages/react/src/table-toolbar.d.ts +1 -1
  52. package/dist/types/packages/react/src/tabs.d.cts +38 -0
  53. package/dist/types/packages/react/src/tabs.d.ts +38 -0
  54. package/dist/types/packages/react/src/textarea.d.cts +29 -0
  55. package/dist/types/packages/react/src/textarea.d.ts +29 -0
  56. package/dist/types/packages/react/src/time-picker.d.cts +10 -1
  57. package/dist/types/packages/react/src/time-picker.d.ts +10 -1
  58. package/dist/types/shared/package-runtime/accordion-state.d.cts +11 -0
  59. package/dist/types/shared/package-runtime/accordion-state.d.ts +11 -0
  60. package/dist/types/shared/package-runtime/action-size.d.cts +1 -1
  61. package/dist/types/shared/package-runtime/action-size.d.ts +1 -1
  62. package/dist/types/shared/package-runtime/alert-action-size.d.cts +2 -0
  63. package/dist/types/shared/package-runtime/alert-action-size.d.ts +2 -0
  64. package/dist/types/shared/package-runtime/badge-tone.d.cts +59 -0
  65. package/dist/types/shared/package-runtime/badge-tone.d.ts +59 -0
  66. package/dist/types/shared/package-runtime/breadcrumb.d.cts +20 -0
  67. package/dist/types/shared/package-runtime/breadcrumb.d.ts +20 -0
  68. package/dist/types/shared/package-runtime/calendar.d.cts +106 -0
  69. package/dist/types/shared/package-runtime/calendar.d.ts +106 -0
  70. package/dist/types/shared/package-runtime/carousel-scroll.d.cts +22 -0
  71. package/dist/types/shared/package-runtime/carousel-scroll.d.ts +22 -0
  72. package/dist/types/shared/package-runtime/carousel.d.cts +47 -0
  73. package/dist/types/shared/package-runtime/carousel.d.ts +47 -0
  74. package/dist/types/shared/package-runtime/center-option.d.cts +1 -0
  75. package/dist/types/shared/package-runtime/center-option.d.ts +1 -0
  76. package/dist/types/shared/package-runtime/list-row.d.cts +14 -0
  77. package/dist/types/shared/package-runtime/list-row.d.ts +14 -0
  78. package/dist/types/shared/package-runtime/messages/ko.d.cts +38 -5
  79. package/dist/types/shared/package-runtime/messages/ko.d.ts +38 -5
  80. package/dist/types/shared/package-runtime/messages-context.d.cts +38 -5
  81. package/dist/types/shared/package-runtime/messages-context.d.ts +38 -5
  82. package/dist/types/shared/package-runtime/navigation-badge.d.cts +12 -0
  83. package/dist/types/shared/package-runtime/navigation-badge.d.ts +12 -0
  84. package/dist/types/shared/package-runtime/navigation.d.cts +1 -1
  85. package/dist/types/shared/package-runtime/navigation.d.ts +1 -1
  86. package/dist/types/shared/package-runtime/scroll-fade.d.cts +25 -0
  87. package/dist/types/shared/package-runtime/scroll-fade.d.ts +25 -0
  88. package/dist/types/shared/package-runtime/sparkline.d.cts +58 -0
  89. package/dist/types/shared/package-runtime/sparkline.d.ts +58 -0
  90. package/dist/types/shared/package-runtime/table-groups.d.cts +11 -0
  91. package/dist/types/shared/package-runtime/table-groups.d.ts +11 -0
  92. package/dist/types/shared/package-runtime/table-model.d.cts +25 -2
  93. package/dist/types/shared/package-runtime/table-model.d.ts +25 -2
  94. package/dist/types/shared/package-runtime/table-presentation.d.cts +30 -4
  95. package/dist/types/shared/package-runtime/table-presentation.d.ts +30 -4
  96. package/dist/types/shared/package-runtime/table.d.cts +18 -2
  97. package/dist/types/shared/package-runtime/table.d.ts +18 -2
  98. package/dist/types/shared/package-runtime/textarea-grow.d.cts +1 -0
  99. package/dist/types/shared/package-runtime/textarea-grow.d.ts +1 -0
  100. package/dist/types/shared/package-runtime/textarea.d.cts +53 -0
  101. package/dist/types/shared/package-runtime/textarea.d.ts +53 -0
  102. package/dist/types/shared/package-runtime/time-segments.d.cts +25 -0
  103. package/dist/types/shared/package-runtime/time-segments.d.ts +25 -0
  104. package/package.json +3 -3
  105. package/dist/types/shared/package-runtime/relative-time.d.cts +0 -1
  106. package/dist/types/shared/package-runtime/relative-time.d.ts +0 -1
@@ -10,7 +10,9 @@ export declare const kjunMessagesKo: {
10
10
  dialog: string;
11
11
  panel: string;
12
12
  details: string;
13
+ dismiss: string;
13
14
  menu: string;
15
+ back: string;
14
16
  remove: (label: string) => string;
15
17
  user: string;
16
18
  loading: string;
@@ -45,10 +47,29 @@ export declare const kjunMessagesKo: {
45
47
  weekdays: string;
46
48
  previousMonth: string;
47
49
  nextMonth: string;
50
+ previousYear: string;
51
+ nextYear: string;
52
+ chooseMonth: string;
53
+ chooseYear: string;
54
+ clearDates: string;
55
+ rangeStartDay: string;
56
+ rangeEndDay: string;
57
+ inRangeDay: string;
58
+ chooseEndDate: string;
59
+ today: string;
60
+ apply: string;
61
+ rangePlaceholder: string;
62
+ yearTitle: (year: number) => string;
63
+ monthName: (month: number) => string;
64
+ dateLabel: (year: number, month: number, day: number, weekday: number) => string;
48
65
  time: string;
66
+ period: string;
67
+ am: string;
68
+ pm: string;
49
69
  hour: string;
50
70
  minute: string;
51
71
  second: string;
72
+ timePlaceholder: string;
52
73
  value: string;
53
74
  minimum: string;
54
75
  maximum: string;
@@ -65,12 +86,16 @@ export declare const kjunMessagesKo: {
65
86
  externalLink: string;
66
87
  newWindow: string;
67
88
  dataTable: string;
68
- selectRow: (row: number) => string;
89
+ selectRow: (row: number | string) => string;
69
90
  selectAll: string;
70
91
  selectAllPartial: string;
71
92
  deselectAll: string;
72
93
  selectionActions: string;
73
94
  selectedItems: (count: number) => string;
95
+ tableSubtotal: string;
96
+ tableTotal: string;
97
+ groupCount: (count: number) => string;
98
+ toggleGroup: (label: string, open: boolean) => string;
74
99
  searchTable: string;
75
100
  expandRow: string;
76
101
  collapse: string;
@@ -78,8 +103,13 @@ export declare const kjunMessagesKo: {
78
103
  ascending: string;
79
104
  descending: string;
80
105
  tabs: string;
106
+ showPath: string;
81
107
  breadcrumb: string;
82
108
  mainNavigation: string;
109
+ newCount: (count: number) => string;
110
+ saving: string;
111
+ charactersLeft: (count: number) => string;
112
+ newContent: string;
83
113
  pagination: string;
84
114
  itemsPerPage: string;
85
115
  perPage: (count: number) => string;
@@ -89,6 +119,13 @@ export declare const kjunMessagesKo: {
89
119
  previousPage: string;
90
120
  nextPage: string;
91
121
  lastPage: string;
122
+ carousel: string;
123
+ slide: string;
124
+ slides: string;
125
+ previousSlide: string;
126
+ nextSlide: string;
127
+ goToSlide: (slide: number) => string;
128
+ slideOf: (slide: number, total: number) => string;
92
129
  marketData: string;
93
130
  metrics: string;
94
131
  watchToggle: (name: string, active: boolean) => string;
@@ -96,10 +133,6 @@ export declare const kjunMessagesKo: {
96
133
  lastUpdated: string;
97
134
  unitLabel: string;
98
135
  totalCount: (count: number, unit: string) => string;
99
- closePrice: string;
100
- delayed: string;
101
- noRealtimeQuote: string;
102
- realtimeDelayed: string;
103
136
  arbitrage: string;
104
137
  deviationWarning: (threshold: number) => string;
105
138
  statusQueued: string;
@@ -19,7 +19,9 @@ export declare const useKjunMessages: () => {
19
19
  dialog: string;
20
20
  panel: string;
21
21
  details: string;
22
+ dismiss: string;
22
23
  menu: string;
24
+ back: string;
23
25
  remove: (label: string) => string;
24
26
  user: string;
25
27
  loading: string;
@@ -54,10 +56,29 @@ export declare const useKjunMessages: () => {
54
56
  weekdays: string;
55
57
  previousMonth: string;
56
58
  nextMonth: string;
59
+ previousYear: string;
60
+ nextYear: string;
61
+ chooseMonth: string;
62
+ chooseYear: string;
63
+ clearDates: string;
64
+ rangeStartDay: string;
65
+ rangeEndDay: string;
66
+ inRangeDay: string;
67
+ chooseEndDate: string;
68
+ today: string;
69
+ apply: string;
70
+ rangePlaceholder: string;
71
+ yearTitle: (year: number) => string;
72
+ monthName: (month: number) => string;
73
+ dateLabel: (year: number, month: number, day: number, weekday: number) => string;
57
74
  time: string;
75
+ period: string;
76
+ am: string;
77
+ pm: string;
58
78
  hour: string;
59
79
  minute: string;
60
80
  second: string;
81
+ timePlaceholder: string;
61
82
  value: string;
62
83
  minimum: string;
63
84
  maximum: string;
@@ -74,12 +95,16 @@ export declare const useKjunMessages: () => {
74
95
  externalLink: string;
75
96
  newWindow: string;
76
97
  dataTable: string;
77
- selectRow: (row: number) => string;
98
+ selectRow: (row: number | string) => string;
78
99
  selectAll: string;
79
100
  selectAllPartial: string;
80
101
  deselectAll: string;
81
102
  selectionActions: string;
82
103
  selectedItems: (count: number) => string;
104
+ tableSubtotal: string;
105
+ tableTotal: string;
106
+ groupCount: (count: number) => string;
107
+ toggleGroup: (label: string, open: boolean) => string;
83
108
  searchTable: string;
84
109
  expandRow: string;
85
110
  collapse: string;
@@ -87,8 +112,13 @@ export declare const useKjunMessages: () => {
87
112
  ascending: string;
88
113
  descending: string;
89
114
  tabs: string;
115
+ showPath: string;
90
116
  breadcrumb: string;
91
117
  mainNavigation: string;
118
+ newCount: (count: number) => string;
119
+ saving: string;
120
+ charactersLeft: (count: number) => string;
121
+ newContent: string;
92
122
  pagination: string;
93
123
  itemsPerPage: string;
94
124
  perPage: (count: number) => string;
@@ -98,6 +128,13 @@ export declare const useKjunMessages: () => {
98
128
  previousPage: string;
99
129
  nextPage: string;
100
130
  lastPage: string;
131
+ carousel: string;
132
+ slide: string;
133
+ slides: string;
134
+ previousSlide: string;
135
+ nextSlide: string;
136
+ goToSlide: (slide: number) => string;
137
+ slideOf: (slide: number, total: number) => string;
101
138
  marketData: string;
102
139
  metrics: string;
103
140
  watchToggle: (name: string, active: boolean) => string;
@@ -105,10 +142,6 @@ export declare const useKjunMessages: () => {
105
142
  lastUpdated: string;
106
143
  unitLabel: string;
107
144
  totalCount: (count: number, unit: string) => string;
108
- closePrice: string;
109
- delayed: string;
110
- noRealtimeQuote: string;
111
- realtimeDelayed: string;
112
145
  arbitrage: string;
113
146
  deviationWarning: (threshold: number) => string;
114
147
  statusQueued: string;
@@ -19,7 +19,9 @@ export declare const useKjunMessages: () => {
19
19
  dialog: string;
20
20
  panel: string;
21
21
  details: string;
22
+ dismiss: string;
22
23
  menu: string;
24
+ back: string;
23
25
  remove: (label: string) => string;
24
26
  user: string;
25
27
  loading: string;
@@ -54,10 +56,29 @@ export declare const useKjunMessages: () => {
54
56
  weekdays: string;
55
57
  previousMonth: string;
56
58
  nextMonth: string;
59
+ previousYear: string;
60
+ nextYear: string;
61
+ chooseMonth: string;
62
+ chooseYear: string;
63
+ clearDates: string;
64
+ rangeStartDay: string;
65
+ rangeEndDay: string;
66
+ inRangeDay: string;
67
+ chooseEndDate: string;
68
+ today: string;
69
+ apply: string;
70
+ rangePlaceholder: string;
71
+ yearTitle: (year: number) => string;
72
+ monthName: (month: number) => string;
73
+ dateLabel: (year: number, month: number, day: number, weekday: number) => string;
57
74
  time: string;
75
+ period: string;
76
+ am: string;
77
+ pm: string;
58
78
  hour: string;
59
79
  minute: string;
60
80
  second: string;
81
+ timePlaceholder: string;
61
82
  value: string;
62
83
  minimum: string;
63
84
  maximum: string;
@@ -74,12 +95,16 @@ export declare const useKjunMessages: () => {
74
95
  externalLink: string;
75
96
  newWindow: string;
76
97
  dataTable: string;
77
- selectRow: (row: number) => string;
98
+ selectRow: (row: number | string) => string;
78
99
  selectAll: string;
79
100
  selectAllPartial: string;
80
101
  deselectAll: string;
81
102
  selectionActions: string;
82
103
  selectedItems: (count: number) => string;
104
+ tableSubtotal: string;
105
+ tableTotal: string;
106
+ groupCount: (count: number) => string;
107
+ toggleGroup: (label: string, open: boolean) => string;
83
108
  searchTable: string;
84
109
  expandRow: string;
85
110
  collapse: string;
@@ -87,8 +112,13 @@ export declare const useKjunMessages: () => {
87
112
  ascending: string;
88
113
  descending: string;
89
114
  tabs: string;
115
+ showPath: string;
90
116
  breadcrumb: string;
91
117
  mainNavigation: string;
118
+ newCount: (count: number) => string;
119
+ saving: string;
120
+ charactersLeft: (count: number) => string;
121
+ newContent: string;
92
122
  pagination: string;
93
123
  itemsPerPage: string;
94
124
  perPage: (count: number) => string;
@@ -98,6 +128,13 @@ export declare const useKjunMessages: () => {
98
128
  previousPage: string;
99
129
  nextPage: string;
100
130
  lastPage: string;
131
+ carousel: string;
132
+ slide: string;
133
+ slides: string;
134
+ previousSlide: string;
135
+ nextSlide: string;
136
+ goToSlide: (slide: number) => string;
137
+ slideOf: (slide: number, total: number) => string;
101
138
  marketData: string;
102
139
  metrics: string;
103
140
  watchToggle: (name: string, active: boolean) => string;
@@ -105,10 +142,6 @@ export declare const useKjunMessages: () => {
105
142
  lastUpdated: string;
106
143
  unitLabel: string;
107
144
  totalCount: (count: number, unit: string) => string;
108
- closePrice: string;
109
- delayed: string;
110
- noRealtimeQuote: string;
111
- realtimeDelayed: string;
112
145
  arbitrage: string;
113
146
  deviationWarning: (threshold: number) => string;
114
147
  statusQueued: string;
@@ -0,0 +1,12 @@
1
+ export type NavigationBadge = string | number | boolean;
2
+ export declare const navigationBadgeMaximum = 99;
3
+ /** The text a count badge shows, or null when there is nothing to count. */
4
+ export declare function badgeCount(count: number | null | undefined, max?: number): string | null;
5
+ export declare function navigationBadge(badge: NavigationBadge | null | undefined, max?: number): {
6
+ dot: boolean;
7
+ text: string;
8
+ } | null;
9
+ /** What a badge says to a screen reader: "new" for a dot, the full count for a number, or its text; "" for none. */
10
+ export declare function badgeSpoken(badge: NavigationBadge | null | undefined, newContent: string, newCount?: (count: number) => string): string;
11
+ /** The destination's accessible name: its label, then what its badge says. */
12
+ export declare function navigationLabel(label: string, badge: NavigationBadge | null | undefined, newContent: string, newCount?: (count: number) => string): string;
@@ -0,0 +1,12 @@
1
+ export type NavigationBadge = string | number | boolean;
2
+ export declare const navigationBadgeMaximum = 99;
3
+ /** The text a count badge shows, or null when there is nothing to count. */
4
+ export declare function badgeCount(count: number | null | undefined, max?: number): string | null;
5
+ export declare function navigationBadge(badge: NavigationBadge | null | undefined, max?: number): {
6
+ dot: boolean;
7
+ text: string;
8
+ } | null;
9
+ /** What a badge says to a screen reader: "new" for a dot, the full count for a number, or its text; "" for none. */
10
+ export declare function badgeSpoken(badge: NavigationBadge | null | undefined, newContent: string, newCount?: (count: number) => string): string;
11
+ /** The destination's accessible name: its label, then what its badge says. */
12
+ export declare function navigationLabel(label: string, badge: NavigationBadge | null | undefined, newContent: string, newCount?: (count: number) => string): string;
@@ -1,6 +1,6 @@
1
1
  export declare function useInitialTab(value: string, candidate: string | undefined, change: (name: string) => void): void;
2
2
  export declare function useAccordionState(multiple: boolean): {
3
- opened: Set<string>;
3
+ opened: ReadonlySet<string>;
4
4
  toggle: (id: string) => void;
5
5
  register: (id: string, defaultOpen: boolean) => () => void;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  export declare function useInitialTab(value: string, candidate: string | undefined, change: (name: string) => void): void;
2
2
  export declare function useAccordionState(multiple: boolean): {
3
- opened: Set<string>;
3
+ opened: ReadonlySet<string>;
4
4
  toggle: (id: string) => void;
5
5
  register: (id: string, defaultOpen: boolean) => () => void;
6
6
  };
@@ -0,0 +1,25 @@
1
+ export type ScrollFadeDirection = "horizontal" | "vertical";
2
+ export interface ScrollEdges {
3
+ start: boolean;
4
+ end: boolean;
5
+ }
6
+ interface ScrollBox {
7
+ scrollLeft: number;
8
+ scrollTop: number;
9
+ clientWidth: number;
10
+ clientHeight: number;
11
+ scrollWidth: number;
12
+ scrollHeight: number;
13
+ }
14
+ /** Edges in reading order: in a right-to-left layout scrollLeft runs from 0 to negative and the start is on the right. */
15
+ export declare function scrollEdges(el: ScrollBox, direction: ScrollFadeDirection, rtl?: boolean): ScrollEdges;
16
+ export declare const sameEdges: (a: ScrollEdges, b: ScrollEdges) => boolean;
17
+ /**
18
+ * Watches a scroller for anything that can move its edges: its size, its children's sizes, children added or
19
+ * removed, images loading late and web fonts arriving. Reports only when an edge changes.
20
+ */
21
+ export declare function trackScrollFade(el: HTMLElement, direction: () => ScrollFadeDirection, onEdges: (edges: ScrollEdges) => void): {
22
+ update: () => void;
23
+ destroy: () => void;
24
+ };
25
+ export {};
@@ -0,0 +1,25 @@
1
+ export type ScrollFadeDirection = "horizontal" | "vertical";
2
+ export interface ScrollEdges {
3
+ start: boolean;
4
+ end: boolean;
5
+ }
6
+ interface ScrollBox {
7
+ scrollLeft: number;
8
+ scrollTop: number;
9
+ clientWidth: number;
10
+ clientHeight: number;
11
+ scrollWidth: number;
12
+ scrollHeight: number;
13
+ }
14
+ /** Edges in reading order: in a right-to-left layout scrollLeft runs from 0 to negative and the start is on the right. */
15
+ export declare function scrollEdges(el: ScrollBox, direction: ScrollFadeDirection, rtl?: boolean): ScrollEdges;
16
+ export declare const sameEdges: (a: ScrollEdges, b: ScrollEdges) => boolean;
17
+ /**
18
+ * Watches a scroller for anything that can move its edges: its size, its children's sizes, children added or
19
+ * removed, images loading late and web fonts arriving. Reports only when an edge changes.
20
+ */
21
+ export declare function trackScrollFade(el: HTMLElement, direction: () => ScrollFadeDirection, onEdges: (edges: ScrollEdges) => void): {
22
+ update: () => void;
23
+ destroy: () => void;
24
+ };
25
+ export {};
@@ -0,0 +1,58 @@
1
+ export interface SparkPoint {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface SparkBar {
6
+ x: number;
7
+ y: number;
8
+ width: number;
9
+ height: number;
10
+ last: boolean;
11
+ }
12
+ export interface SparklineGeometry {
13
+ /** Unbroken runs of finite values; a run of one value is drawn as a dot. */
14
+ segments: SparkPoint[][];
15
+ /** Closed area polygons ("x,y x,y …") under each run of two or more points. */
16
+ areas: string[];
17
+ end?: SparkPoint;
18
+ baselineY?: number;
19
+ bars: SparkBar[];
20
+ /** Direction for the color: the last value against the baseline, or else the first value. */
21
+ direction: -1 | 0 | 1;
22
+ empty: boolean;
23
+ }
24
+ export interface SparklineOptions {
25
+ width: number;
26
+ height: number;
27
+ strokeWidth: number;
28
+ /** Token defaults; tests pass their own. */
29
+ dotRadius?: number;
30
+ barGap?: number;
31
+ barMinHeight?: number;
32
+ variant?: "line" | "bar";
33
+ baseline?: number;
34
+ min?: number;
35
+ max?: number;
36
+ endDot?: boolean;
37
+ }
38
+ export declare function sparklineGeometry(data: readonly number[], options: SparklineOptions): SparklineGeometry;
39
+ /** One vertical range for every row of a column, so their sparklines compare on the same scale. */
40
+ export type SparklineTone = "text-tertiary" | "success" | "danger" | "price-up" | "price-down";
41
+ /** The color role for a direction: price up/down, or success/danger for status, and quiet when flat. */
42
+ export declare function sparklineTone(direction: -1 | 0 | 1, semantic?: "price" | "status"): SparklineTone;
43
+ /** The dash pattern for the empty line and the baseline. */
44
+ export declare const sparklineDash: () => string;
45
+ export declare function sparklineRange(series: readonly unknown[], baselines?: readonly unknown[]): {
46
+ min?: number;
47
+ max?: number;
48
+ };
49
+ export interface SparklineColumn {
50
+ key: string;
51
+ baselineKey?: string;
52
+ sharedRange?: boolean;
53
+ }
54
+ /** Sparkline props for one market row: its series, its reference value and (optionally) the column's shared range. */
55
+ export declare function sparklineCell<Row extends object>(rows: readonly Row[], row: Row, column: SparklineColumn, read: (row: Row, key: string) => unknown): {
56
+ data: number[];
57
+ baseline: number | undefined;
58
+ };
@@ -0,0 +1,58 @@
1
+ export interface SparkPoint {
2
+ x: number;
3
+ y: number;
4
+ }
5
+ export interface SparkBar {
6
+ x: number;
7
+ y: number;
8
+ width: number;
9
+ height: number;
10
+ last: boolean;
11
+ }
12
+ export interface SparklineGeometry {
13
+ /** Unbroken runs of finite values; a run of one value is drawn as a dot. */
14
+ segments: SparkPoint[][];
15
+ /** Closed area polygons ("x,y x,y …") under each run of two or more points. */
16
+ areas: string[];
17
+ end?: SparkPoint;
18
+ baselineY?: number;
19
+ bars: SparkBar[];
20
+ /** Direction for the color: the last value against the baseline, or else the first value. */
21
+ direction: -1 | 0 | 1;
22
+ empty: boolean;
23
+ }
24
+ export interface SparklineOptions {
25
+ width: number;
26
+ height: number;
27
+ strokeWidth: number;
28
+ /** Token defaults; tests pass their own. */
29
+ dotRadius?: number;
30
+ barGap?: number;
31
+ barMinHeight?: number;
32
+ variant?: "line" | "bar";
33
+ baseline?: number;
34
+ min?: number;
35
+ max?: number;
36
+ endDot?: boolean;
37
+ }
38
+ export declare function sparklineGeometry(data: readonly number[], options: SparklineOptions): SparklineGeometry;
39
+ /** One vertical range for every row of a column, so their sparklines compare on the same scale. */
40
+ export type SparklineTone = "text-tertiary" | "success" | "danger" | "price-up" | "price-down";
41
+ /** The color role for a direction: price up/down, or success/danger for status, and quiet when flat. */
42
+ export declare function sparklineTone(direction: -1 | 0 | 1, semantic?: "price" | "status"): SparklineTone;
43
+ /** The dash pattern for the empty line and the baseline. */
44
+ export declare const sparklineDash: () => string;
45
+ export declare function sparklineRange(series: readonly unknown[], baselines?: readonly unknown[]): {
46
+ min?: number;
47
+ max?: number;
48
+ };
49
+ export interface SparklineColumn {
50
+ key: string;
51
+ baselineKey?: string;
52
+ sharedRange?: boolean;
53
+ }
54
+ /** Sparkline props for one market row: its series, its reference value and (optionally) the column's shared range. */
55
+ export declare function sparklineCell<Row extends object>(rows: readonly Row[], row: Row, column: SparklineColumn, read: (row: Row, key: string) => unknown): {
56
+ data: number[];
57
+ baseline: number | undefined;
58
+ };
@@ -0,0 +1,11 @@
1
+ export type TableSummaryKind = "sum" | "count" | "average" | "min" | "max";
2
+ export interface TableRowGroup<Row extends object> {
3
+ key: string;
4
+ value: unknown;
5
+ rows: Row[];
6
+ }
7
+ /** Groups keep the order their first row appears in, so a sorted table sorts inside each group. */
8
+ export declare function groupTableRows<Row extends object>(rows: readonly Row[], groupBy?: string | null): TableRowGroup<Row>[] | null;
9
+ /** count counts rows; the other kinds read finite numbers only and give null when a column has none. */
10
+ export declare function summarizeColumn<Row extends object>(rows: readonly Row[], key: string, kind: TableSummaryKind): number | null;
11
+ export declare function formatSummary(value: number | null, kind: TableSummaryKind, locale?: string): string;
@@ -0,0 +1,11 @@
1
+ export type TableSummaryKind = "sum" | "count" | "average" | "min" | "max";
2
+ export interface TableRowGroup<Row extends object> {
3
+ key: string;
4
+ value: unknown;
5
+ rows: Row[];
6
+ }
7
+ /** Groups keep the order their first row appears in, so a sorted table sorts inside each group. */
8
+ export declare function groupTableRows<Row extends object>(rows: readonly Row[], groupBy?: string | null): TableRowGroup<Row>[] | null;
9
+ /** count counts rows; the other kinds read finite numbers only and give null when a column has none. */
10
+ export declare function summarizeColumn<Row extends object>(rows: readonly Row[], key: string, kind: TableSummaryKind): number | null;
11
+ export declare function formatSummary(value: number | null, kind: TableSummaryKind, locale?: string): string;
@@ -1,15 +1,38 @@
1
1
  import type { TableSort } from "@kjun-ui/tokens";
2
2
  export declare function getValue(row: object, key: string): unknown;
3
- export declare function sortTableRows<Row extends object>(data: readonly Row[], sort: TableSort, { sortable, sortMode }: {
3
+ /**
4
+ * One ascending order for every column: dates by time, numbers numerically, text by the locale with numbers inside it
5
+ * ("item2" before "item10"), booleans false first. Empty values are left for the caller to put last.
6
+ */
7
+ export declare function compareTableValues(x: unknown, y: unknown, locale?: string): number;
8
+ /** A column's own order for its cell values, replacing the shared one. */
9
+ export type TableCompare = (a: unknown, b: unknown) => number;
10
+ export declare function sortTableRows<Row extends object>(data: readonly Row[], sort: TableSort, { sortable, sortMode, compare, locale }: {
4
11
  sortable?: boolean;
5
12
  sortMode?: "client" | "server";
13
+ compare?: TableCompare;
14
+ locale?: string;
6
15
  }): readonly Row[];
7
16
  export declare const tableRowKey: (row: object, rowKey: string, index?: number) => string | number;
17
+ /** What tells rows apart for selection: the rowKey value, or the row object itself when it has none. */
18
+ export declare const tableRowIdentity: (row: object, rowKey: string) => unknown;
8
19
  export declare function tableSelection<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string): {
9
20
  isSelected: (row: Row) => boolean;
10
21
  all: boolean;
11
22
  some: boolean;
12
23
  };
13
24
  export declare const toggleSelectedRow: <Row extends object>(selected: readonly Row[], row: Row, rowKey: string) => Row[];
14
- export declare const toggleAllRows: <Row extends object>(rows: readonly Row[], all: boolean) => Row[];
25
+ /**
26
+ * The header checkbox: with every shown row selected it clears just those rows, otherwise it adds the shown rows
27
+ * that are missing. Rows selected on other pages or outside the current search stay selected.
28
+ */
29
+ export declare function toggleAllRows<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, all: boolean): Row[];
30
+ /** Each row's position in the sorted rows, so grouped bodies need not search for it. */
31
+ export declare const tableRowIndex: <Row extends object>(rows: readonly Row[]) => (row: Row) => number;
15
32
  export declare const toggleExpandedRow: (expanded: readonly (string | number)[], id: string | number, single: boolean) => (string | number)[];
33
+ /** A row's name for its checkbox: the title column's text ("행 선택 한빛테크"), or its position when that is not text. */
34
+ export declare function tableRowLabel(row: object, titleKey: string | undefined, index: number): string | number;
35
+ /** The scroller a page-level sticky header sticks under: the nearest scrolling ancestor, or the viewport (null). */
36
+ export declare function stickyScroller(element: Element | null): Element | null;
37
+ /** Whether rows have scrolled under a page-level sticky header, measured against its own scroller. */
38
+ export declare function stickyHeaderStuck(table: Element | null, offset: number): boolean;
@@ -1,15 +1,38 @@
1
1
  import type { TableSort } from "@kjun-ui/tokens";
2
2
  export declare function getValue(row: object, key: string): unknown;
3
- export declare function sortTableRows<Row extends object>(data: readonly Row[], sort: TableSort, { sortable, sortMode }: {
3
+ /**
4
+ * One ascending order for every column: dates by time, numbers numerically, text by the locale with numbers inside it
5
+ * ("item2" before "item10"), booleans false first. Empty values are left for the caller to put last.
6
+ */
7
+ export declare function compareTableValues(x: unknown, y: unknown, locale?: string): number;
8
+ /** A column's own order for its cell values, replacing the shared one. */
9
+ export type TableCompare = (a: unknown, b: unknown) => number;
10
+ export declare function sortTableRows<Row extends object>(data: readonly Row[], sort: TableSort, { sortable, sortMode, compare, locale }: {
4
11
  sortable?: boolean;
5
12
  sortMode?: "client" | "server";
13
+ compare?: TableCompare;
14
+ locale?: string;
6
15
  }): readonly Row[];
7
16
  export declare const tableRowKey: (row: object, rowKey: string, index?: number) => string | number;
17
+ /** What tells rows apart for selection: the rowKey value, or the row object itself when it has none. */
18
+ export declare const tableRowIdentity: (row: object, rowKey: string) => unknown;
8
19
  export declare function tableSelection<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string): {
9
20
  isSelected: (row: Row) => boolean;
10
21
  all: boolean;
11
22
  some: boolean;
12
23
  };
13
24
  export declare const toggleSelectedRow: <Row extends object>(selected: readonly Row[], row: Row, rowKey: string) => Row[];
14
- export declare const toggleAllRows: <Row extends object>(rows: readonly Row[], all: boolean) => Row[];
25
+ /**
26
+ * The header checkbox: with every shown row selected it clears just those rows, otherwise it adds the shown rows
27
+ * that are missing. Rows selected on other pages or outside the current search stay selected.
28
+ */
29
+ export declare function toggleAllRows<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string, all: boolean): Row[];
30
+ /** Each row's position in the sorted rows, so grouped bodies need not search for it. */
31
+ export declare const tableRowIndex: <Row extends object>(rows: readonly Row[]) => (row: Row) => number;
15
32
  export declare const toggleExpandedRow: (expanded: readonly (string | number)[], id: string | number, single: boolean) => (string | number)[];
33
+ /** A row's name for its checkbox: the title column's text ("행 선택 한빛테크"), or its position when that is not text. */
34
+ export declare function tableRowLabel(row: object, titleKey: string | undefined, index: number): string | number;
35
+ /** The scroller a page-level sticky header sticks under: the nearest scrolling ancestor, or the viewport (null). */
36
+ export declare function stickyScroller(element: Element | null): Element | null;
37
+ /** Whether rows have scrolled under a page-level sticky header, measured against its own scroller. */
38
+ export declare function stickyHeaderStuck(table: Element | null, offset: number): boolean;