@kjun-ui/react 0.19.0 → 0.20.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 +423 -90
- package/dist/index.js +405 -72
- package/dist/styles.css +127 -61
- package/dist/types/packages/react/src/list.d.cts +1 -1
- package/dist/types/packages/react/src/list.d.ts +1 -1
- package/dist/types/packages/react/src/range-input.d.cts +12 -1
- package/dist/types/packages/react/src/range-input.d.ts +12 -1
- package/dist/types/packages/react/src/table-cards.d.cts +1 -1
- package/dist/types/packages/react/src/table-cards.d.ts +1 -1
- package/dist/types/shared/package-runtime/slider-view.d.cts +90 -0
- package/dist/types/shared/package-runtime/slider-view.d.ts +90 -0
- package/dist/types/shared/package-runtime/table-groups.d.cts +9 -0
- package/dist/types/shared/package-runtime/table-groups.d.ts +9 -0
- package/dist/types/shared/package-runtime/table-presentation.d.cts +2 -0
- package/dist/types/shared/package-runtime/table-presentation.d.ts +2 -0
- package/dist/types/shared/package-runtime/table.d.cts +3 -0
- package/dist/types/shared/package-runtime/table.d.ts +3 -0
- package/dist/types/shared/package-runtime/use-table-group-expansion.d.cts +6 -0
- package/dist/types/shared/package-runtime/use-table-group-expansion.d.ts +6 -0
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -239,6 +239,7 @@
|
|
|
239
239
|
--_kjun-card-elevation-raised: 0px 1px 2px 0px var(--_kjun-color-shadow-subtle);
|
|
240
240
|
--_kjun-modal-elevation: 0px 2px 8px 0px var(--_kjun-color-shadow-subtle);
|
|
241
241
|
--_kjun-popover-elevation: 0px 2px 8px 0px var(--_kjun-color-shadow-subtle);
|
|
242
|
+
--_kjun-slider-elevation: 0px 1px 3px 0px var(--_kjun-color-shadow);
|
|
242
243
|
--_kjun-menu-elevation: 0px 8px 24px 0px var(--_kjun-color-shadow), 0px 2px 4px 0px var(--_kjun-color-shadow-subtle);
|
|
243
244
|
--_kjun-drawer-elevation: 0px 2px 8px 0px var(--_kjun-color-shadow-subtle);
|
|
244
245
|
--_kjun-toast-elevation: 0px 2px 8px 0px var(--_kjun-color-shadow-subtle);
|
|
@@ -397,6 +398,17 @@
|
|
|
397
398
|
--_kjun-extension-chip-remove-icon-sizes-lg: 16px;
|
|
398
399
|
--_kjun-extension-slider-track: 6px;
|
|
399
400
|
--_kjun-extension-slider-thumb: 20px;
|
|
401
|
+
--_kjun-extension-slider-track-height: 28px;
|
|
402
|
+
--_kjun-extension-slider-caption-gap: 4px;
|
|
403
|
+
--_kjun-extension-slider-halo-size: 8px;
|
|
404
|
+
--_kjun-extension-slider-pressed-thumb: 22px;
|
|
405
|
+
--_kjun-extension-slider-mark-size: 4px;
|
|
406
|
+
--_kjun-extension-slider-mark-label-gap: 2px;
|
|
407
|
+
--_kjun-extension-slider-vertical-length: 160px;
|
|
408
|
+
--_kjun-extension-slider-small-track: 4px;
|
|
409
|
+
--_kjun-extension-slider-small-thumb: 16px;
|
|
410
|
+
--_kjun-extension-slider-small-pressed-thumb: 18px;
|
|
411
|
+
--_kjun-extension-slider-small-track-height: 24px;
|
|
400
412
|
--_kjun-extension-slider-minimum-width: 100px;
|
|
401
413
|
--_kjun-extension-radio-size: 20px;
|
|
402
414
|
--_kjun-extension-radio-dot: 8px;
|
|
@@ -4104,12 +4116,13 @@
|
|
|
4104
4116
|
.kjun-table-card-group {
|
|
4105
4117
|
padding: var(--_kjun-geometry-dimension-value8) var(--_kjun-geometry-dimension-value4) 0;
|
|
4106
4118
|
display: flex;
|
|
4107
|
-
align-items:
|
|
4119
|
+
align-items: center;
|
|
4108
4120
|
color: var(--_kjun-text-secondary);
|
|
4109
4121
|
font-size: var(--_kjun-type-caption-size);
|
|
4110
4122
|
line-height: var(--_kjun-type-caption-line);
|
|
4111
4123
|
font-weight: var(--_kjun-type-control-weight);
|
|
4112
4124
|
}
|
|
4125
|
+
.kjun-table-card-group > .kjun-button { flex-shrink: 0; margin-inline-end: var(--_kjun-geometry-dimension-value4); }
|
|
4113
4126
|
.kjun-table-card-group-total { margin-inline-start: auto; color: var(--_kjun-text-secondary); font-variant-numeric: tabular-nums; text-align: end; }
|
|
4114
4127
|
.kjun-table-card-group-total > span + span::before { content: " · "; }
|
|
4115
4128
|
.kjun-table-card-group-count { margin-inline-start: var(--_kjun-geometry-dimension-value4); color: var(--_kjun-text-tertiary); font-weight: var(--_kjun-type-caption-weight); }
|
|
@@ -4876,13 +4889,27 @@
|
|
|
4876
4889
|
border-radius: var(--_kjun-extension-kpi-row-radius);
|
|
4877
4890
|
}
|
|
4878
4891
|
.kjun-kpi-row__item {
|
|
4892
|
+
--_kjun-kpi-row-divider-left: var(--_kjun-border-default-width);
|
|
4893
|
+
--_kjun-kpi-row-divider-top: 0px;
|
|
4894
|
+
position: relative;
|
|
4879
4895
|
flex: 1;
|
|
4880
4896
|
padding: var(--_kjun-extension-kpi-row-md-item-padding-y) var(--_kjun-extension-kpi-row-md-item-padding-x);
|
|
4881
|
-
|
|
4897
|
+
/* Reserve the separator space without rounding its paint with the click target. */
|
|
4898
|
+
border-left: var(--_kjun-kpi-row-divider-left) solid transparent;
|
|
4899
|
+
border-top: var(--_kjun-kpi-row-divider-top) solid transparent;
|
|
4882
4900
|
min-width: 0;
|
|
4883
4901
|
}
|
|
4902
|
+
.kjun-kpi-row__item::before {
|
|
4903
|
+
content: "";
|
|
4904
|
+
position: absolute;
|
|
4905
|
+
inset: calc(-1 * var(--_kjun-kpi-row-divider-top)) 0 0 calc(-1 * var(--_kjun-kpi-row-divider-left));
|
|
4906
|
+
border-left: var(--_kjun-kpi-row-divider-left) solid var(--_kjun-border-primary);
|
|
4907
|
+
border-top: var(--_kjun-kpi-row-divider-top) solid var(--_kjun-border-primary);
|
|
4908
|
+
border-radius: 0;
|
|
4909
|
+
pointer-events: none;
|
|
4910
|
+
}
|
|
4884
4911
|
.kjun-kpi-row__item:first-child {
|
|
4885
|
-
|
|
4912
|
+
--_kjun-kpi-row-divider-left: 0px;
|
|
4886
4913
|
}
|
|
4887
4914
|
.kjun-kpi-row__item--clickable {
|
|
4888
4915
|
cursor: pointer;
|
|
@@ -4963,20 +4990,20 @@
|
|
|
4963
4990
|
}
|
|
4964
4991
|
.kjun-kpi-row:not(.kjun-kpi-row--sm) .kjun-kpi-row__item {
|
|
4965
4992
|
padding: var(--_kjun-extension-kpi-row-mobile-item-padding-y) var(--_kjun-extension-kpi-row-mobile-item-padding-x);
|
|
4966
|
-
|
|
4967
|
-
|
|
4993
|
+
--_kjun-kpi-row-divider-left: 0px;
|
|
4994
|
+
--_kjun-kpi-row-divider-top: 0px;
|
|
4968
4995
|
}
|
|
4969
4996
|
.kjun-kpi-row:not(.kjun-kpi-row--sm) .kjun-kpi-row__item:nth-child(even) {
|
|
4970
|
-
|
|
4997
|
+
--_kjun-kpi-row-divider-left: var(--_kjun-border-default-width);
|
|
4971
4998
|
}
|
|
4972
4999
|
.kjun-kpi-row:not(.kjun-kpi-row--sm) .kjun-kpi-row__item:nth-child(n + 3) {
|
|
4973
|
-
|
|
5000
|
+
--_kjun-kpi-row-divider-top: var(--_kjun-border-default-width);
|
|
4974
5001
|
}
|
|
4975
5002
|
/* 홀수 개수의 마지막 항목은 전폭으로 마감해 빈 반쪽 셀을 남기지 않는다. */
|
|
4976
5003
|
.kjun-kpi-row:not(.kjun-kpi-row--sm):not(.kjun-kpi-row--hero-first)
|
|
4977
5004
|
.kjun-kpi-row__item:last-child:nth-child(odd) {
|
|
4978
5005
|
grid-column: 1 / -1;
|
|
4979
|
-
|
|
5006
|
+
--_kjun-kpi-row-divider-left: 0px;
|
|
4980
5007
|
}
|
|
4981
5008
|
/* hero-first는 전폭 헤드라인 아래에 나머지 항목을 2열로 배치한다. */
|
|
4982
5009
|
.kjun-kpi-row:not(.kjun-kpi-row--sm) .kjun-kpi-row__item--full {
|
|
@@ -4984,12 +5011,12 @@
|
|
|
4984
5011
|
}
|
|
4985
5012
|
.kjun-kpi-row:not(.kjun-kpi-row--sm).kjun-kpi-row--hero-first
|
|
4986
5013
|
.kjun-kpi-row__item:nth-child(2) {
|
|
4987
|
-
|
|
4988
|
-
|
|
5014
|
+
--_kjun-kpi-row-divider-left: 0px;
|
|
5015
|
+
--_kjun-kpi-row-divider-top: var(--_kjun-border-default-width);
|
|
4989
5016
|
}
|
|
4990
5017
|
.kjun-kpi-row:not(.kjun-kpi-row--sm).kjun-kpi-row--hero-first
|
|
4991
5018
|
.kjun-kpi-row__item:nth-child(3) {
|
|
4992
|
-
|
|
5019
|
+
--_kjun-kpi-row-divider-left: var(--_kjun-border-default-width);
|
|
4993
5020
|
}
|
|
4994
5021
|
.kjun-kpi-row:not(.kjun-kpi-row--sm) .kjun-kpi-row__label-row {
|
|
4995
5022
|
gap: var(--_kjun-extension-kpi-row-mobile-label-gap);
|
|
@@ -5020,7 +5047,8 @@
|
|
|
5020
5047
|
.kjun-kpi-row__item:nth-child(n) {
|
|
5021
5048
|
flex: 0 0 calc((100% - var(--_kjun-extension-kpi-row-summary-gap-x)) / 2);
|
|
5022
5049
|
padding: 0;
|
|
5023
|
-
|
|
5050
|
+
--_kjun-kpi-row-divider-left: 0px;
|
|
5051
|
+
--_kjun-kpi-row-divider-top: 0px;
|
|
5024
5052
|
}
|
|
5025
5053
|
.kjun-kpi-row.kjun-kpi-row--mobile-summary:not(.kjun-kpi-row--sm)
|
|
5026
5054
|
.kjun-kpi-row__item--full:nth-child(n),
|
|
@@ -5140,20 +5168,20 @@
|
|
|
5140
5168
|
.kjun-kpi-row--sm .kjun-kpi-row__item {
|
|
5141
5169
|
flex: 1 1 50%;
|
|
5142
5170
|
padding: var(--_kjun-extension-kpi-row-small-mobile-item-padding-y) var(--_kjun-extension-kpi-row-small-mobile-item-padding-x);
|
|
5143
|
-
|
|
5144
|
-
|
|
5171
|
+
--_kjun-kpi-row-divider-left: 0px;
|
|
5172
|
+
--_kjun-kpi-row-divider-top: var(--_kjun-border-default-width);
|
|
5145
5173
|
}
|
|
5146
5174
|
.kjun-kpi-row--sm:not(.kjun-kpi-row--hero-first)
|
|
5147
5175
|
.kjun-kpi-row__item:first-child,
|
|
5148
5176
|
.kjun-kpi-row--sm:not(.kjun-kpi-row--hero-first)
|
|
5149
5177
|
.kjun-kpi-row__item:nth-child(2) {
|
|
5150
|
-
|
|
5178
|
+
--_kjun-kpi-row-divider-top: 0px;
|
|
5151
5179
|
}
|
|
5152
5180
|
.kjun-kpi-row--sm .kjun-kpi-row__item--full {
|
|
5153
5181
|
flex-basis: 100%;
|
|
5154
5182
|
}
|
|
5155
5183
|
.kjun-kpi-row--sm.kjun-kpi-row--hero-first .kjun-kpi-row__item:first-child {
|
|
5156
|
-
|
|
5184
|
+
--_kjun-kpi-row-divider-top: 0px;
|
|
5157
5185
|
}
|
|
5158
5186
|
.kjun-kpi-row--sm .kjun-kpi-row__value {
|
|
5159
5187
|
}
|
|
@@ -5490,10 +5518,11 @@ button.kjun-toast-more:focus-visible { outline: var(--_kjun-state-focus-width) s
|
|
|
5490
5518
|
|
|
5491
5519
|
.kjun-list-section,.kjun-top-navigation,.kjun-bottom-navigation,.kjun-floating-navigation,.kjun-bottom-action-bar{min-width:0;max-width:100%;color:var(--_kjun-color-text);background:var(--_kjun-color-surface)}
|
|
5492
5520
|
.kjun-list-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--_kjun-extension-list-gap);padding:var(--_kjun-extension-list-padding)}.kjun-list-heading :is(h2,h3,h4){font-size:var(--_kjun-type-card-title-size);margin:0;line-height:var(--_kjun-type-card-title-line);font-weight:var(--_kjun-type-card-title-weight);letter-spacing:var(--_kjun-type-card-title-tracking)}.kjun-list-heading p{margin:var(--_kjun-geometry-dimension-value4) 0 0;font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);overflow-wrap:anywhere;line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}
|
|
5493
|
-
.kjun-list{list-style:none;padding:0;margin:0}.kjun-list-row{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);position:relative;min-width:0}/* Dividers start where the text does
|
|
5521
|
+
.kjun-list{list-style:none;padding:0;margin:0}.kjun-list-row{--_kjun-list-leading-width:var(--_kjun-extension-list-leading-width);display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);position:relative;min-width:0}/* Dividers start where the text does, after the icon or custom leading column. */
|
|
5522
|
+
.kjun-list-row[data-leading=icon]{--_kjun-list-leading-width:var(--_kjun-geometry-dimension-value24)}
|
|
5494
5523
|
.kjun-list-row:not(:last-child)::after,.kjun-list-item:not(:last-child)::after{content:"";position:absolute;inset-inline:var(--_kjun-list-divider-inset,var(--_kjun-extension-list-padding)) 0;bottom:0;height:var(--_kjun-border-default-width);background:var(--_kjun-color-divider);pointer-events:none}
|
|
5495
|
-
.kjun-list-row[data-leading]{--_kjun-list-divider-inset:calc(var(--_kjun-extension-list-padding) + var(--_kjun-
|
|
5496
|
-
.kjun-list-leading{flex-shrink:0;display:flex;align-items:center;justify-content:center;min-width:var(--_kjun-
|
|
5524
|
+
.kjun-list-row[data-leading]{--_kjun-list-divider-inset:calc(var(--_kjun-extension-list-padding) + var(--_kjun-list-leading-width) + var(--_kjun-extension-list-gap))}.kjun-list[data-divider=false]>:is(.kjun-list-row,.kjun-list-item)::after{content:none}.kjun-list[data-density=compact] .kjun-list-main{min-height:var(--_kjun-extension-list-compact-minimum-height);padding-block:var(--_kjun-extension-list-compact-padding-y)}.kjun-list-main{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);flex:1;min-width:0;min-height:var(--_kjun-extension-list-minimum-height);padding:var(--_kjun-extension-list-padding);text-align:start;color:inherit;text-decoration:none;background:transparent;border:0;font:inherit}.kjun-list-main:is(button,a):not(:disabled,[aria-disabled=true]):hover{background:var(--_kjun-color-hover)}.kjun-list-main:is(button,a):not(:disabled,[aria-disabled=true]):active{background:var(--_kjun-color-active)}.kjun-list-body{flex:1;min-width:0}.kjun-list-content{display:block;margin-top:var(--_kjun-extension-list-description-gap)}.kjun-list-title,.kjun-list-description{display:block;overflow-wrap:anywhere;line-height:1.5}.kjun-list-title{font-size:var(--_kjun-type-control-size);line-height:var(--_kjun-type-control-line);font-weight:var(--_kjun-type-control-weight);letter-spacing:var(--_kjun-type-control-tracking)}.kjun-list-description{font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}/* Icons use 24px; custom leading content, including avatars and images, keeps a 40px minimum. */
|
|
5525
|
+
.kjun-list-leading{flex-shrink:0;display:flex;align-items:center;justify-content:center;min-width:var(--_kjun-list-leading-width)}
|
|
5497
5526
|
.kjun-list-icon{color:var(--_kjun-color-text-secondary)}.kjun-list-trailing{overflow-wrap:anywhere;max-width:35%}.kjun-list-actions{display:flex;flex-wrap:wrap;gap:var(--_kjun-extension-list-actions-gap);padding-inline-end:var(--_kjun-extension-list-actions-padding);max-width:45%}
|
|
5498
5527
|
/* A disabled row disables its actions too, so the row never reads as partly available. */
|
|
5499
5528
|
.kjun-list-actions[data-disabled]{opacity:var(--_kjun-state-opacity-disabled)}
|
|
@@ -5526,8 +5555,19 @@ button.kjun-toast-more:focus-visible { outline: var(--_kjun-state-focus-width) s
|
|
|
5526
5555
|
/* Bottom bars meet the screen edges, so their items draw the ring inside, like tabs. */
|
|
5527
5556
|
.kjun-scope .kjun-bottom-navigation a:focus-visible{outline-offset:var(--_kjun-state-focus-inset-offset)}
|
|
5528
5557
|
.kjun-scope :is(.kjun-list-main[aria-disabled=true],.kjun-bottom-navigation a[aria-disabled=true],.kjun-floating-navigation a[aria-disabled=true],.kjun-list-main:disabled){opacity:var(--_kjun-state-opacity-disabled);cursor:default}
|
|
5558
|
+
/* Slider: the rail runs the full width under the label and value; thumbs travel inside it, so the track keeps half a thumb of
|
|
5559
|
+
margin and the rail reaches back out to the edges. The touch area stays 44px while the visible band sits captionGap under the
|
|
5560
|
+
caption. */
|
|
5529
5561
|
.kjun-slider {
|
|
5530
|
-
|
|
5562
|
+
--_kjun-slider-track:var(--_kjun-extension-slider-track); --_kjun-slider-thumb:var(--_kjun-extension-slider-thumb);
|
|
5563
|
+
--_kjun-slider-band:var(--_kjun-extension-slider-track-height); --_kjun-slider-pressed:var(--_kjun-extension-slider-pressed-thumb);
|
|
5564
|
+
/* The lift plus a hairline in the border role, so a white thumb still reads on a white surface. */
|
|
5565
|
+
--_kjun-slider-thumb-shadow:0 0 0 var(--_kjun-border-default-width) var(--_kjun-color-border), var(--_kjun-slider-elevation);
|
|
5566
|
+
width:100%; min-width:var(--_kjun-extension-slider-minimum-width); display:grid;
|
|
5567
|
+
}
|
|
5568
|
+
.kjun-slider[data-size=sm] {
|
|
5569
|
+
--_kjun-slider-track:var(--_kjun-extension-slider-small-track); --_kjun-slider-thumb:var(--_kjun-extension-slider-small-thumb);
|
|
5570
|
+
--_kjun-slider-band:var(--_kjun-extension-slider-small-track-height); --_kjun-slider-pressed:var(--_kjun-extension-slider-small-pressed-thumb);
|
|
5531
5571
|
}
|
|
5532
5572
|
.kjun-slider-caption {
|
|
5533
5573
|
display:flex; align-items:baseline; justify-content:space-between;
|
|
@@ -5545,55 +5585,81 @@ button.kjun-toast-more:focus-visible { outline: var(--_kjun-state-focus-width) s
|
|
|
5545
5585
|
font-size:var(--_kjun-type-control-size); line-height:var(--_kjun-type-control-line);
|
|
5546
5586
|
font-weight:var(--_kjun-type-control-weight); letter-spacing:var(--_kjun-type-control-tracking);
|
|
5547
5587
|
}
|
|
5588
|
+
.kjun-slider[data-size=sm] :is(.kjun-slider-label, .kjun-slider-value) {
|
|
5589
|
+
font-size:var(--_kjun-type-control-small-size); line-height:var(--_kjun-type-control-small-line); letter-spacing:var(--_kjun-type-control-small-tracking);
|
|
5590
|
+
}
|
|
5548
5591
|
.kjun-slider-track {
|
|
5549
|
-
height:var(--_kjun-geometry-native-minimum-touch-target); position:relative; margin-inline:calc(var(--_kjun-
|
|
5592
|
+
height:var(--_kjun-geometry-native-minimum-touch-target); position:relative; margin-inline:calc(var(--_kjun-slider-thumb) / 2);
|
|
5593
|
+
}
|
|
5594
|
+
.kjun-slider-caption + .kjun-slider-track {
|
|
5595
|
+
margin-top:calc(var(--_kjun-extension-slider-caption-gap) - (var(--_kjun-geometry-native-minimum-touch-target) - var(--_kjun-slider-band)) / 2);
|
|
5550
5596
|
}
|
|
5551
5597
|
.kjun-slider-rail, .kjun-slider-fill {
|
|
5552
|
-
position:absolute; top:calc(50% - var(--_kjun-
|
|
5553
|
-
height:var(--_kjun-
|
|
5554
|
-
left:0; right:0; background:var(--_kjun-color-border);
|
|
5598
|
+
position:absolute; top:calc(50% - var(--_kjun-slider-track) / 2);
|
|
5599
|
+
height:var(--_kjun-slider-track); border-radius:var(--_kjun-geometry-radius-radius9999);
|
|
5555
5600
|
}
|
|
5556
|
-
.kjun-slider-
|
|
5601
|
+
.kjun-slider-rail {
|
|
5602
|
+
left:calc(var(--_kjun-slider-thumb) / -2); right:calc(var(--_kjun-slider-thumb) / -2);
|
|
5603
|
+
background:color-mix(in srgb, var(--_kjun-color-text) calc(var(--_kjun-state-opacity-tint-active) * 100%), transparent);
|
|
5604
|
+
}
|
|
5605
|
+
.kjun-slider-fill { background:var(--_kjun-color-brand); }
|
|
5606
|
+
/* One white thumb lifted by a contact shadow, like the switch thumb; pressing adds a brand halo and grows it to pressedThumb. */
|
|
5557
5607
|
.kjun-slider-thumb {
|
|
5558
|
-
top:50%; width:var(--_kjun-
|
|
5559
|
-
|
|
5560
|
-
|
|
5608
|
+
top:50%; width:var(--_kjun-slider-thumb); height:var(--_kjun-slider-thumb); border-radius:50%;
|
|
5609
|
+
background:var(--_kjun-color-switch-thumb); box-shadow:var(--_kjun-slider-thumb-shadow); touch-action:none; cursor:grab;
|
|
5610
|
+
transition:box-shadow var(--_kjun-motion-control) var(--_kjun-ease-out), width var(--_kjun-motion-control) var(--_kjun-ease-out), height var(--_kjun-motion-control) var(--_kjun-ease-out);
|
|
5611
|
+
}
|
|
5612
|
+
.kjun-slider-thumb[data-front] { z-index:1; }
|
|
5613
|
+
@media (hover: hover) {
|
|
5614
|
+
.kjun-slider:not([data-disabled=true]) .kjun-slider-thumb:hover {
|
|
5615
|
+
box-shadow:0 0 0 var(--_kjun-extension-slider-halo-size) color-mix(in srgb, var(--_kjun-color-brand) calc(var(--_kjun-state-opacity-tint-control) * 100%), transparent), var(--_kjun-slider-thumb-shadow);
|
|
5616
|
+
}
|
|
5617
|
+
}
|
|
5618
|
+
.kjun-slider:not([data-disabled=true]) .kjun-slider-thumb:is([data-dragging], .kjun-slider-thumb--dragging) {
|
|
5619
|
+
box-shadow:0 0 0 var(--_kjun-extension-slider-halo-size) color-mix(in srgb, var(--_kjun-color-brand) calc(var(--_kjun-state-opacity-tint-active) * 100%), transparent), var(--_kjun-slider-thumb-shadow);
|
|
5620
|
+
width:var(--_kjun-slider-pressed); height:var(--_kjun-slider-pressed); cursor:grabbing;
|
|
5561
5621
|
}
|
|
5562
|
-
.kjun-slider
|
|
5563
|
-
.kjun-slider:not([data-disabled=true]) .kjun-slider-thumb[data-dragging] { border-color:var(--_kjun-color-brand-active); cursor:grabbing; }
|
|
5564
|
-
.kjun-slider-thumb[data-focus-visible] { outline:var(--_kjun-state-focus-width) solid var(--_kjun-color-focus-ring); outline-offset:var(--_kjun-state-focus-choice-offset); z-index:1; }
|
|
5622
|
+
.kjun-slider-thumb[data-focus-visible] { outline:var(--_kjun-state-focus-width) solid var(--_kjun-color-focus-ring); outline-offset:var(--_kjun-state-focus-choice-offset); z-index:2; }
|
|
5565
5623
|
.kjun-slider[data-disabled=true] { opacity:var(--_kjun-state-opacity-disabled); }
|
|
5566
5624
|
.kjun-slider[data-disabled=true] .kjun-slider-thumb { cursor:default; }
|
|
5567
|
-
/*
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
}
|
|
5583
|
-
|
|
5584
|
-
.kjun-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
}
|
|
5589
|
-
.kjun-
|
|
5590
|
-
.kjun-
|
|
5591
|
-
.kjun-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
.kjun-
|
|
5595
|
-
.kjun-
|
|
5596
|
-
|
|
5625
|
+
/* marks: a dot at each mark on the rail (light on the fill), and its label under the band. Edge labels align to the rail ends. */
|
|
5626
|
+
.kjun-slider-mark {
|
|
5627
|
+
position:absolute; top:calc(50% - var(--_kjun-extension-slider-mark-size) / 2); width:var(--_kjun-extension-slider-mark-size); height:var(--_kjun-extension-slider-mark-size);
|
|
5628
|
+
margin-inline-start:calc(var(--_kjun-extension-slider-mark-size) / -2); border-radius:50%; background:var(--_kjun-color-text-tertiary); pointer-events:none;
|
|
5629
|
+
}
|
|
5630
|
+
.kjun-slider-mark[data-active] { background:var(--_kjun-color-switch-thumb); }
|
|
5631
|
+
.kjun-slider-marks {
|
|
5632
|
+
position:relative; margin-inline:calc(var(--_kjun-slider-thumb) / 2); height:var(--_kjun-type-caption-line);
|
|
5633
|
+
margin-top:calc(var(--_kjun-extension-slider-mark-label-gap) - (var(--_kjun-geometry-native-minimum-touch-target) - var(--_kjun-slider-band)) / 2);
|
|
5634
|
+
color:var(--_kjun-color-text-tertiary); font-size:var(--_kjun-type-caption-size); line-height:var(--_kjun-type-caption-line);
|
|
5635
|
+
}
|
|
5636
|
+
.kjun-slider-mark-label { position:absolute; top:0; transform:translateX(-50%); white-space:nowrap; }
|
|
5637
|
+
/* A mark label moves the nearer thumb to its value. */
|
|
5638
|
+
.kjun-slider:not([data-disabled=true]) .kjun-slider-mark-label { cursor:pointer; }
|
|
5639
|
+
.kjun-slider-mark-label[data-edge=start] { transform:translateX(calc(var(--_kjun-slider-thumb) / -2)); }
|
|
5640
|
+
.kjun-slider-mark-label[data-edge=end] { transform:translateX(calc(var(--_kjun-slider-thumb) / 2 - 100%)); }
|
|
5641
|
+
/* Vertical: the caption stacks above a rail that runs bottom (min) to top (max), length long; mark labels sit beside it. */
|
|
5642
|
+
.kjun-slider[data-orientation=vertical] {
|
|
5643
|
+
--_kjun-slider-length:var(--_kjun-extension-slider-vertical-length);
|
|
5644
|
+
width:auto; min-width:0; justify-items:center;
|
|
5645
|
+
}
|
|
5646
|
+
.kjun-slider[data-orientation=vertical]:has(.kjun-slider-marks) { grid-template-columns:auto auto; justify-content:center; column-gap:var(--_kjun-extension-slider-mark-label-gap); }
|
|
5647
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-caption { grid-column:1 / -1; flex-direction:column; align-items:center; gap:0; }
|
|
5648
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-value { margin-inline-start:0; }
|
|
5649
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-track {
|
|
5650
|
+
width:var(--_kjun-geometry-native-minimum-touch-target); height:var(--_kjun-slider-length); margin:calc(var(--_kjun-slider-thumb) / 2) 0;
|
|
5651
|
+
}
|
|
5652
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-caption + .kjun-slider-track { margin-top:calc(var(--_kjun-extension-slider-caption-gap) + var(--_kjun-slider-thumb) / 2); }
|
|
5653
|
+
.kjun-slider[data-orientation=vertical] :is(.kjun-slider-rail, .kjun-slider-fill) {
|
|
5654
|
+
top:auto; right:auto; height:auto; left:calc(50% - var(--_kjun-slider-track) / 2); width:var(--_kjun-slider-track);
|
|
5655
|
+
}
|
|
5656
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-rail { top:calc(var(--_kjun-slider-thumb) / -2); bottom:calc(var(--_kjun-slider-thumb) / -2); }
|
|
5657
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-thumb { left:50%; }
|
|
5658
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-mark { left:calc(50% - var(--_kjun-extension-slider-mark-size) / 2); margin:calc(var(--_kjun-extension-slider-mark-size) / -2) 0 0; }
|
|
5659
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-marks {
|
|
5660
|
+
justify-self:start; align-self:end; height:var(--_kjun-slider-length); margin:0 0 calc(var(--_kjun-slider-thumb) / 2);
|
|
5661
|
+
}
|
|
5662
|
+
.kjun-slider[data-orientation=vertical] .kjun-slider-mark-label { left:0; transform:translateY(-50%); }
|
|
5597
5663
|
|
|
5598
5664
|
.kjun-top-navigation { flex-shrink:0; }
|
|
5599
5665
|
.kjun-navigation-content {
|
|
@@ -3,7 +3,7 @@ import { type MouseEvent, type ReactNode } from "react";
|
|
|
3
3
|
export interface KjunListRowProps {
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
|
-
/** Icon name drawn in
|
|
6
|
+
/** Icon name drawn in a 24px column; custom `leading` content uses a minimum 40px column and takes priority. */
|
|
7
7
|
icon?: string;
|
|
8
8
|
leading?: ReactNode;
|
|
9
9
|
trailing?: ReactNode;
|
|
@@ -3,7 +3,7 @@ import { type MouseEvent, type ReactNode } from "react";
|
|
|
3
3
|
export interface KjunListRowProps {
|
|
4
4
|
title: string;
|
|
5
5
|
description?: string;
|
|
6
|
-
/** Icon name drawn in
|
|
6
|
+
/** Icon name drawn in a 24px column; custom `leading` content uses a minimum 40px column and takes priority. */
|
|
7
7
|
icon?: string;
|
|
8
8
|
leading?: ReactNode;
|
|
9
9
|
trailing?: ReactNode;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type SliderMarks, type SliderOrientation } from "../../../shared/package-runtime/slider-view.cjs";
|
|
2
|
+
export type { KjunSliderMark } from "../../../shared/package-runtime/slider-view.cjs";
|
|
1
3
|
export interface KjunSliderProps {
|
|
2
4
|
value: number;
|
|
3
5
|
min?: number;
|
|
@@ -8,8 +10,15 @@ export interface KjunSliderProps {
|
|
|
8
10
|
ariaLabel?: string;
|
|
9
11
|
/** Hides the visible value only; each thumb still reports its value to assistive technology. */
|
|
10
12
|
showValue?: boolean;
|
|
11
|
-
/** Formats the visible value and each thumb's accessible value text. Values stay numeric. */
|
|
13
|
+
/** Formats the visible value and each thumb's accessible value text. Values stay numeric. Defaults to the locale's number format with the step's decimals. */
|
|
12
14
|
formatValue?: (value: number) => string;
|
|
15
|
+
/** Dots on the rail: true for every step (up to 24), or values with optional labels beside the rail. Pressing a label moves the nearer thumb there. */
|
|
16
|
+
marks?: SliderMarks;
|
|
17
|
+
/** sm: 12px text, 4px rail, 16px thumb. The touch area stays 44px. */
|
|
18
|
+
size?: "sm" | "md";
|
|
19
|
+
/** vertical: the rail runs bottom (min) to top (max), `length` px long. */
|
|
20
|
+
orientation?: SliderOrientation;
|
|
21
|
+
length?: number;
|
|
13
22
|
onValueChange?: (value: number) => void;
|
|
14
23
|
onChangeCommit?: (value: number) => void;
|
|
15
24
|
}
|
|
@@ -22,6 +31,8 @@ export interface KjunRangeSliderProps extends Omit<KjunSliderProps, "value" | "o
|
|
|
22
31
|
string,
|
|
23
32
|
string
|
|
24
33
|
];
|
|
34
|
+
/** The visible text for the whole range, e.g. "20만~80만 원". Each thumb keeps formatValue. */
|
|
35
|
+
formatRange?: (start: number, end: number) => string;
|
|
25
36
|
onValueChange?: (value: [
|
|
26
37
|
number,
|
|
27
38
|
number
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type SliderMarks, type SliderOrientation } from "../../../shared/package-runtime/slider-view.js";
|
|
2
|
+
export type { KjunSliderMark } from "../../../shared/package-runtime/slider-view.js";
|
|
1
3
|
export interface KjunSliderProps {
|
|
2
4
|
value: number;
|
|
3
5
|
min?: number;
|
|
@@ -8,8 +10,15 @@ export interface KjunSliderProps {
|
|
|
8
10
|
ariaLabel?: string;
|
|
9
11
|
/** Hides the visible value only; each thumb still reports its value to assistive technology. */
|
|
10
12
|
showValue?: boolean;
|
|
11
|
-
/** Formats the visible value and each thumb's accessible value text. Values stay numeric. */
|
|
13
|
+
/** Formats the visible value and each thumb's accessible value text. Values stay numeric. Defaults to the locale's number format with the step's decimals. */
|
|
12
14
|
formatValue?: (value: number) => string;
|
|
15
|
+
/** Dots on the rail: true for every step (up to 24), or values with optional labels beside the rail. Pressing a label moves the nearer thumb there. */
|
|
16
|
+
marks?: SliderMarks;
|
|
17
|
+
/** sm: 12px text, 4px rail, 16px thumb. The touch area stays 44px. */
|
|
18
|
+
size?: "sm" | "md";
|
|
19
|
+
/** vertical: the rail runs bottom (min) to top (max), `length` px long. */
|
|
20
|
+
orientation?: SliderOrientation;
|
|
21
|
+
length?: number;
|
|
13
22
|
onValueChange?: (value: number) => void;
|
|
14
23
|
onChangeCommit?: (value: number) => void;
|
|
15
24
|
}
|
|
@@ -22,6 +31,8 @@ export interface KjunRangeSliderProps extends Omit<KjunSliderProps, "value" | "o
|
|
|
22
31
|
string,
|
|
23
32
|
string
|
|
24
33
|
];
|
|
34
|
+
/** The visible text for the whole range, e.g. "20만~80만 원". Each thumb keeps formatValue. */
|
|
35
|
+
formatRange?: (start: number, end: number) => string;
|
|
25
36
|
onValueChange?: (value: [
|
|
26
37
|
number,
|
|
27
38
|
number
|
|
@@ -7,6 +7,6 @@ interface Props<Row extends object> extends TableCardsProps<Row> {
|
|
|
7
7
|
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
8
8
|
}
|
|
9
9
|
/** Groups as labelled groups, each a header line over its own list; ungrouped rows stay one list. */
|
|
10
|
-
export declare function useTableGroups<Row extends object>({ groupLabel, groupTotals, state }: Pick<TableCardsProps<Row>, "groupLabel" | "groupTotals" | "state">, className: string, itemsClass: string | undefined, item: (row: Row, index: number) => ReactNode): (list: TableRowGroup<Row>[]) => import("react/jsx-runtime").JSX.Element[];
|
|
10
|
+
export declare function useTableGroups<Row extends object>({ groupLabel, groupTotals, state, collapsed, toggleGroup }: Pick<TableCardsProps<Row>, "groupLabel" | "groupTotals" | "state" | "collapsed" | "toggleGroup">, className: string, itemsClass: string | undefined, item: (row: Row, index: number) => ReactNode): (list: TableRowGroup<Row>[]) => import("react/jsx-runtime").JSX.Element[];
|
|
11
11
|
export declare function TableCards<Row extends object>(props: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -7,6 +7,6 @@ interface Props<Row extends object> extends TableCardsProps<Row> {
|
|
|
7
7
|
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
8
8
|
}
|
|
9
9
|
/** Groups as labelled groups, each a header line over its own list; ungrouped rows stay one list. */
|
|
10
|
-
export declare function useTableGroups<Row extends object>({ groupLabel, groupTotals, state }: Pick<TableCardsProps<Row>, "groupLabel" | "groupTotals" | "state">, className: string, itemsClass: string | undefined, item: (row: Row, index: number) => ReactNode): (list: TableRowGroup<Row>[]) => import("react/jsx-runtime").JSX.Element[];
|
|
10
|
+
export declare function useTableGroups<Row extends object>({ groupLabel, groupTotals, state, collapsed, toggleGroup }: Pick<TableCardsProps<Row>, "groupLabel" | "groupTotals" | "state" | "collapsed" | "toggleGroup">, className: string, itemsClass: string | undefined, item: (row: Row, index: number) => ReactNode): (list: TableRowGroup<Row>[]) => import("react/jsx-runtime").JSX.Element[];
|
|
11
11
|
export declare function TableCards<Row extends object>(props: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export interface KjunSliderMark {
|
|
2
|
+
value: number;
|
|
3
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export type SliderMarks = boolean | KjunSliderMark[];
|
|
7
|
+
export type SliderOrientation = "horizontal" | "vertical";
|
|
8
|
+
/**
|
|
9
|
+
* Without formatValue the value follows the locale's number grouping with as many decimals as min and step use, so
|
|
10
|
+
* 0.5 steps read 1.0 · 1.5 and the text keeps its width while dragging. Formatters are cached per locale and precision.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sliderFormatter(formatValue: ((value: number) => string) | undefined, locale?: string, min?: number, step?: number): (value: number) => string;
|
|
13
|
+
/** The visible value: formatRange for a range when given, else two equal values read as one. */
|
|
14
|
+
export declare function sliderValueText(values: readonly number[], format: (value: number) => string, formatRange?: (start: number, end: number) => string): string;
|
|
15
|
+
/**
|
|
16
|
+
* marks={true} puts a dot on every step (up to 24 of them); an array places dots, and labels, at the given values.
|
|
17
|
+
* The rail's own ends need no dot, so marks at min and max keep only their labels.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sliderMarks(marks: SliderMarks | undefined, min: number, max: number, step: number, values: readonly number[], layout?: SliderLayout): {
|
|
20
|
+
fraction: number;
|
|
21
|
+
/** Offset from the left (or the top when vertical), like the thumbs. */
|
|
22
|
+
position: number;
|
|
23
|
+
active: boolean;
|
|
24
|
+
dot: boolean;
|
|
25
|
+
edge: "end" | "start" | undefined;
|
|
26
|
+
value: number;
|
|
27
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
28
|
+
label?: string;
|
|
29
|
+
}[];
|
|
30
|
+
export interface SliderLayout {
|
|
31
|
+
rtl?: boolean;
|
|
32
|
+
vertical?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function localeIsRtl(locale?: string): boolean;
|
|
35
|
+
/** A fraction as an offset from the left (or the top): right-to-left and vertical sliders run the other way, like React Aria. */
|
|
36
|
+
export declare function sliderAxis(fraction: number, { rtl, vertical }?: SliderLayout): number;
|
|
37
|
+
/**
|
|
38
|
+
* The fill as leading and trailing offsets (percent of the track, from the left/top and from the right/bottom). null is
|
|
39
|
+
* the rail's own end, half a thumb past the track: a single slider fills from there, a range between its thumbs.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sliderFillBox(fractions: readonly number[], layout?: SliderLayout): {
|
|
42
|
+
lead: number | null;
|
|
43
|
+
trail: number | null;
|
|
44
|
+
};
|
|
45
|
+
/** PageUp/PageDown move a tenth of the range, on the step grid and at least one step, like React Aria. */
|
|
46
|
+
export declare function sliderPageSize(min: number, max: number, step: number): number;
|
|
47
|
+
/** The key's next value, or null. Right-to-left layouts swap the meaning of the horizontal arrows. */
|
|
48
|
+
export declare function sliderKeyValue(key: string, value: number, min: number, max: number, step: number, rtl?: boolean): number | null;
|
|
49
|
+
/** The value under a pointer, from its offset along the track (from the left, or the top when vertical). */
|
|
50
|
+
export declare function sliderValueAt(offset: number, length: number, min: number, max: number, { rtl, vertical }?: {
|
|
51
|
+
rtl?: boolean | undefined;
|
|
52
|
+
vertical?: boolean | undefined;
|
|
53
|
+
}): number;
|
|
54
|
+
/** Where each thumb sits (0–1). Invalid settings keep the app's values in view, clamped to the given range when it has one. */
|
|
55
|
+
export declare function sliderFractions(values: readonly number[], min: number, max: number): number[];
|
|
56
|
+
/** Overlapping range thumbs: the one that can still move goes on top (the start thumb near the top end, the end thumb elsewhere). */
|
|
57
|
+
export declare function sliderFrontThumb(values: readonly number[], min: number, max: number): 0 | 1 | null;
|
|
58
|
+
/** The thumb a press moves: the nearer one, or with both on one value, the side of the press ("pending" when on the value itself). */
|
|
59
|
+
export declare function sliderPick(values: readonly number[], number: number, snapped: number): {
|
|
60
|
+
index: 0 | 1;
|
|
61
|
+
pending: boolean;
|
|
62
|
+
};
|
|
63
|
+
export interface SliderSessionOptions {
|
|
64
|
+
min(): number;
|
|
65
|
+
max(): number;
|
|
66
|
+
step(): number;
|
|
67
|
+
snap(value: number): number;
|
|
68
|
+
blocked(): boolean;
|
|
69
|
+
emit(values: number[]): void;
|
|
70
|
+
commit(values: number[]): void;
|
|
71
|
+
/** Moves keyboard focus to the thumb a press or a direction choice picked. */
|
|
72
|
+
focus?(index: number): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* One slider's value changes: clamping against the other thumb, the overlapping-thumb direction choice, and one commit
|
|
76
|
+
* per gesture or key. `sync` takes the app's values between gestures; during a gesture the session leads them.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createSliderSession(initial: readonly number[], options: SliderSessionOptions): {
|
|
79
|
+
readonly values: number[];
|
|
80
|
+
readonly active: number | null;
|
|
81
|
+
sync(values: readonly number[]): void;
|
|
82
|
+
update: (index: number, number: number) => void;
|
|
83
|
+
commit: () => void;
|
|
84
|
+
press(number: number): number | null;
|
|
85
|
+
move(number: number): number | null;
|
|
86
|
+
release(): void;
|
|
87
|
+
cancel(): void;
|
|
88
|
+
key(index: number, key: string, rtl?: boolean): boolean;
|
|
89
|
+
};
|
|
90
|
+
export type SliderSession = ReturnType<typeof createSliderSession>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export interface KjunSliderMark {
|
|
2
|
+
value: number;
|
|
3
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export type SliderMarks = boolean | KjunSliderMark[];
|
|
7
|
+
export type SliderOrientation = "horizontal" | "vertical";
|
|
8
|
+
/**
|
|
9
|
+
* Without formatValue the value follows the locale's number grouping with as many decimals as min and step use, so
|
|
10
|
+
* 0.5 steps read 1.0 · 1.5 and the text keeps its width while dragging. Formatters are cached per locale and precision.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sliderFormatter(formatValue: ((value: number) => string) | undefined, locale?: string, min?: number, step?: number): (value: number) => string;
|
|
13
|
+
/** The visible value: formatRange for a range when given, else two equal values read as one. */
|
|
14
|
+
export declare function sliderValueText(values: readonly number[], format: (value: number) => string, formatRange?: (start: number, end: number) => string): string;
|
|
15
|
+
/**
|
|
16
|
+
* marks={true} puts a dot on every step (up to 24 of them); an array places dots, and labels, at the given values.
|
|
17
|
+
* The rail's own ends need no dot, so marks at min and max keep only their labels.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sliderMarks(marks: SliderMarks | undefined, min: number, max: number, step: number, values: readonly number[], layout?: SliderLayout): {
|
|
20
|
+
fraction: number;
|
|
21
|
+
/** Offset from the left (or the top when vertical), like the thumbs. */
|
|
22
|
+
position: number;
|
|
23
|
+
active: boolean;
|
|
24
|
+
dot: boolean;
|
|
25
|
+
edge: "end" | "start" | undefined;
|
|
26
|
+
value: number;
|
|
27
|
+
/** Drawn beside the rail; leave it out for a dot only. Pressing a label moves the nearer thumb there. */
|
|
28
|
+
label?: string;
|
|
29
|
+
}[];
|
|
30
|
+
export interface SliderLayout {
|
|
31
|
+
rtl?: boolean;
|
|
32
|
+
vertical?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function localeIsRtl(locale?: string): boolean;
|
|
35
|
+
/** A fraction as an offset from the left (or the top): right-to-left and vertical sliders run the other way, like React Aria. */
|
|
36
|
+
export declare function sliderAxis(fraction: number, { rtl, vertical }?: SliderLayout): number;
|
|
37
|
+
/**
|
|
38
|
+
* The fill as leading and trailing offsets (percent of the track, from the left/top and from the right/bottom). null is
|
|
39
|
+
* the rail's own end, half a thumb past the track: a single slider fills from there, a range between its thumbs.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sliderFillBox(fractions: readonly number[], layout?: SliderLayout): {
|
|
42
|
+
lead: number | null;
|
|
43
|
+
trail: number | null;
|
|
44
|
+
};
|
|
45
|
+
/** PageUp/PageDown move a tenth of the range, on the step grid and at least one step, like React Aria. */
|
|
46
|
+
export declare function sliderPageSize(min: number, max: number, step: number): number;
|
|
47
|
+
/** The key's next value, or null. Right-to-left layouts swap the meaning of the horizontal arrows. */
|
|
48
|
+
export declare function sliderKeyValue(key: string, value: number, min: number, max: number, step: number, rtl?: boolean): number | null;
|
|
49
|
+
/** The value under a pointer, from its offset along the track (from the left, or the top when vertical). */
|
|
50
|
+
export declare function sliderValueAt(offset: number, length: number, min: number, max: number, { rtl, vertical }?: {
|
|
51
|
+
rtl?: boolean | undefined;
|
|
52
|
+
vertical?: boolean | undefined;
|
|
53
|
+
}): number;
|
|
54
|
+
/** Where each thumb sits (0–1). Invalid settings keep the app's values in view, clamped to the given range when it has one. */
|
|
55
|
+
export declare function sliderFractions(values: readonly number[], min: number, max: number): number[];
|
|
56
|
+
/** Overlapping range thumbs: the one that can still move goes on top (the start thumb near the top end, the end thumb elsewhere). */
|
|
57
|
+
export declare function sliderFrontThumb(values: readonly number[], min: number, max: number): 0 | 1 | null;
|
|
58
|
+
/** The thumb a press moves: the nearer one, or with both on one value, the side of the press ("pending" when on the value itself). */
|
|
59
|
+
export declare function sliderPick(values: readonly number[], number: number, snapped: number): {
|
|
60
|
+
index: 0 | 1;
|
|
61
|
+
pending: boolean;
|
|
62
|
+
};
|
|
63
|
+
export interface SliderSessionOptions {
|
|
64
|
+
min(): number;
|
|
65
|
+
max(): number;
|
|
66
|
+
step(): number;
|
|
67
|
+
snap(value: number): number;
|
|
68
|
+
blocked(): boolean;
|
|
69
|
+
emit(values: number[]): void;
|
|
70
|
+
commit(values: number[]): void;
|
|
71
|
+
/** Moves keyboard focus to the thumb a press or a direction choice picked. */
|
|
72
|
+
focus?(index: number): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* One slider's value changes: clamping against the other thumb, the overlapping-thumb direction choice, and one commit
|
|
76
|
+
* per gesture or key. `sync` takes the app's values between gestures; during a gesture the session leads them.
|
|
77
|
+
*/
|
|
78
|
+
export declare function createSliderSession(initial: readonly number[], options: SliderSessionOptions): {
|
|
79
|
+
readonly values: number[];
|
|
80
|
+
readonly active: number | null;
|
|
81
|
+
sync(values: readonly number[]): void;
|
|
82
|
+
update: (index: number, number: number) => void;
|
|
83
|
+
commit: () => void;
|
|
84
|
+
press(number: number): number | null;
|
|
85
|
+
move(number: number): number | null;
|
|
86
|
+
release(): void;
|
|
87
|
+
cancel(): void;
|
|
88
|
+
key(index: number, key: string, rtl?: boolean): boolean;
|
|
89
|
+
};
|
|
90
|
+
export type SliderSession = ReturnType<typeof createSliderSession>;
|
|
@@ -4,8 +4,17 @@ export interface TableRowGroup<Row extends object> {
|
|
|
4
4
|
value: unknown;
|
|
5
5
|
rows: Row[];
|
|
6
6
|
}
|
|
7
|
+
export declare const tableGroupKey: (value: unknown) => string;
|
|
7
8
|
/** Groups keep the order their first row appears in, so a sorted table sorts inside each group. */
|
|
8
9
|
export declare function groupTableRows<Row extends object>(rows: readonly Row[], groupBy?: string | null): TableRowGroup<Row>[] | null;
|
|
10
|
+
/** undefined uses internal collapsed keys; a supplied array contains the original groupBy values. */
|
|
11
|
+
export declare function tableGroupExpansion<Row extends object>(groups: TableRowGroup<Row>[] | null, expanded: unknown[] | undefined, internalCollapsed: string[]): {
|
|
12
|
+
collapsed: string[];
|
|
13
|
+
toggle(key: string): {
|
|
14
|
+
expanded: unknown[];
|
|
15
|
+
collapsed: string[];
|
|
16
|
+
} | null;
|
|
17
|
+
};
|
|
9
18
|
/** count counts rows; the other kinds read finite numbers only and give null when a column has none. */
|
|
10
19
|
export declare function summarizeColumn<Row extends object>(rows: readonly Row[], key: string, kind: TableSummaryKind): number | null;
|
|
11
20
|
export declare function formatSummary(value: number | null, kind: TableSummaryKind, locale?: string): string;
|