@kjun-ui/react 0.21.0 → 0.23.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/README.md +19 -5
- package/dist/index.cjs +8795 -3753
- package/dist/index.js +9349 -4284
- package/dist/styles.css +2736 -480
- package/dist/types/packages/react/src/actions.d.cts +21 -16
- package/dist/types/packages/react/src/actions.d.ts +21 -16
- package/dist/types/packages/react/src/app-navigation.d.cts +14 -4
- package/dist/types/packages/react/src/app-navigation.d.ts +14 -4
- package/dist/types/packages/react/src/avatar-group.d.cts +36 -0
- package/dist/types/packages/react/src/avatar-group.d.ts +36 -0
- package/dist/types/packages/react/src/button.d.cts +15 -6
- package/dist/types/packages/react/src/button.d.ts +15 -6
- package/dist/types/packages/react/src/calendar.d.cts +6 -2
- package/dist/types/packages/react/src/calendar.d.ts +6 -2
- package/dist/types/packages/react/src/card.d.cts +10 -3
- package/dist/types/packages/react/src/card.d.ts +10 -3
- package/dist/types/packages/react/src/carousel.d.cts +8 -1
- package/dist/types/packages/react/src/carousel.d.ts +8 -1
- package/dist/types/packages/react/src/choice-controls.d.cts +99 -0
- package/dist/types/packages/react/src/choice-controls.d.ts +99 -0
- package/dist/types/packages/react/src/collapse.d.cts +4 -1
- package/dist/types/packages/react/src/collapse.d.ts +4 -1
- package/dist/types/packages/react/src/color-picker.d.cts +8 -1
- package/dist/types/packages/react/src/color-picker.d.ts +8 -1
- package/dist/types/packages/react/src/combobox.d.cts +18 -5
- package/dist/types/packages/react/src/combobox.d.ts +18 -5
- package/dist/types/packages/react/src/controls.d.cts +7 -74
- package/dist/types/packages/react/src/controls.d.ts +7 -74
- package/dist/types/packages/react/src/data-state.d.cts +19 -6
- package/dist/types/packages/react/src/data-state.d.ts +19 -6
- package/dist/types/packages/react/src/date-picker.d.cts +8 -2
- package/dist/types/packages/react/src/date-picker.d.ts +8 -2
- package/dist/types/packages/react/src/display.d.cts +33 -8
- package/dist/types/packages/react/src/display.d.ts +33 -8
- package/dist/types/packages/react/src/drawer.d.cts +11 -2
- package/dist/types/packages/react/src/drawer.d.ts +11 -2
- package/dist/types/packages/react/src/dropdown.d.cts +21 -6
- package/dist/types/packages/react/src/dropdown.d.ts +21 -6
- package/dist/types/packages/react/src/event-calendar.d.cts +47 -0
- package/dist/types/packages/react/src/event-calendar.d.ts +47 -0
- package/dist/types/packages/react/src/fab.d.cts +2 -0
- package/dist/types/packages/react/src/fab.d.ts +2 -0
- package/dist/types/packages/react/src/file-upload-row.d.cts +23 -0
- package/dist/types/packages/react/src/file-upload-row.d.ts +23 -0
- package/dist/types/packages/react/src/file-upload.d.cts +38 -0
- package/dist/types/packages/react/src/file-upload.d.ts +38 -0
- package/dist/types/packages/react/src/financial-display.d.cts +32 -11
- package/dist/types/packages/react/src/financial-display.d.ts +32 -11
- package/dist/types/packages/react/src/floating-panel.d.cts +6 -2
- package/dist/types/packages/react/src/floating-panel.d.ts +6 -2
- package/dist/types/packages/react/src/index.d.cts +12 -1
- package/dist/types/packages/react/src/index.d.ts +12 -1
- package/dist/types/packages/react/src/input.d.cts +27 -1
- package/dist/types/packages/react/src/input.d.ts +27 -1
- package/dist/types/packages/react/src/kpi-hero.d.cts +2 -0
- package/dist/types/packages/react/src/kpi-hero.d.ts +2 -0
- package/dist/types/packages/react/src/kpi-row.d.cts +5 -0
- package/dist/types/packages/react/src/kpi-row.d.ts +5 -0
- package/dist/types/packages/react/src/layout-primitives.d.cts +71 -139
- package/dist/types/packages/react/src/layout-primitives.d.ts +71 -139
- package/dist/types/packages/react/src/list-context.d.cts +2 -1
- package/dist/types/packages/react/src/list-context.d.ts +2 -1
- package/dist/types/packages/react/src/list.d.cts +49 -12
- package/dist/types/packages/react/src/list.d.ts +49 -12
- package/dist/types/packages/react/src/market-model.d.cts +15 -1
- package/dist/types/packages/react/src/market-model.d.ts +15 -1
- package/dist/types/packages/react/src/market-parts.d.cts +9 -0
- package/dist/types/packages/react/src/market-parts.d.ts +9 -0
- package/dist/types/packages/react/src/market-skeleton.d.cts +7 -1
- package/dist/types/packages/react/src/market-skeleton.d.ts +7 -1
- package/dist/types/packages/react/src/media.d.cts +6 -2
- package/dist/types/packages/react/src/media.d.ts +6 -2
- package/dist/types/packages/react/src/modal.d.cts +11 -2
- package/dist/types/packages/react/src/modal.d.ts +11 -2
- package/dist/types/packages/react/src/navigation.d.cts +34 -5
- package/dist/types/packages/react/src/navigation.d.ts +34 -5
- package/dist/types/packages/react/src/number-display.d.cts +8 -5
- package/dist/types/packages/react/src/number-display.d.ts +8 -5
- package/dist/types/packages/react/src/number-input.d.cts +28 -0
- package/dist/types/packages/react/src/number-input.d.ts +28 -0
- package/dist/types/packages/react/src/popover.d.cts +5 -2
- package/dist/types/packages/react/src/popover.d.ts +5 -2
- package/dist/types/packages/react/src/pressable.d.cts +17 -0
- package/dist/types/packages/react/src/pressable.d.ts +17 -0
- package/dist/types/packages/react/src/quantity-stepper.d.cts +3 -1
- package/dist/types/packages/react/src/quantity-stepper.d.ts +3 -1
- package/dist/types/packages/react/src/range-input.d.cts +15 -3
- package/dist/types/packages/react/src/range-input.d.ts +15 -3
- package/dist/types/packages/react/src/search-input.d.cts +6 -3
- package/dist/types/packages/react/src/search-input.d.ts +6 -3
- package/dist/types/packages/react/src/select-control.d.cts +7 -2
- package/dist/types/packages/react/src/select-control.d.ts +7 -2
- package/dist/types/packages/react/src/side-navigation-layout-spaces.d.cts +31 -0
- package/dist/types/packages/react/src/side-navigation-layout-spaces.d.ts +31 -0
- package/dist/types/packages/react/src/side-navigation-layout.d.cts +63 -0
- package/dist/types/packages/react/src/side-navigation-layout.d.ts +63 -0
- package/dist/types/packages/react/src/side-navigation.d.cts +74 -0
- package/dist/types/packages/react/src/side-navigation.d.ts +74 -0
- package/dist/types/packages/react/src/skeletons.d.cts +18 -3
- package/dist/types/packages/react/src/skeletons.d.ts +18 -3
- package/dist/types/packages/react/src/spinner-glyph.d.cts +8 -0
- package/dist/types/packages/react/src/spinner-glyph.d.ts +8 -0
- package/dist/types/packages/react/src/split-pane.d.cts +20 -5
- package/dist/types/packages/react/src/split-pane.d.ts +20 -5
- package/dist/types/packages/react/src/stacked-bar.d.cts +3 -1
- package/dist/types/packages/react/src/stacked-bar.d.ts +3 -1
- package/dist/types/packages/react/src/steps.d.cts +27 -0
- package/dist/types/packages/react/src/steps.d.ts +27 -0
- package/dist/types/packages/react/src/table-cards.d.cts +4 -12
- package/dist/types/packages/react/src/table-cards.d.ts +4 -12
- package/dist/types/packages/react/src/table-grid.d.cts +3 -7
- package/dist/types/packages/react/src/table-grid.d.ts +3 -7
- package/dist/types/packages/react/src/table-groups.d.cts +5 -0
- package/dist/types/packages/react/src/table-groups.d.ts +5 -0
- package/dist/types/packages/react/src/table-list.d.cts +2 -9
- package/dist/types/packages/react/src/table-list.d.ts +2 -9
- package/dist/types/packages/react/src/table-model.d.cts +6 -2
- package/dist/types/packages/react/src/table-model.d.ts +6 -2
- package/dist/types/packages/react/src/tabs.d.cts +3 -1
- package/dist/types/packages/react/src/tabs.d.ts +3 -1
- package/dist/types/packages/react/src/textarea.d.cts +6 -3
- package/dist/types/packages/react/src/textarea.d.ts +6 -3
- package/dist/types/packages/react/src/tiles.d.cts +18 -0
- package/dist/types/packages/react/src/tiles.d.ts +18 -0
- package/dist/types/packages/react/src/time-picker.d.cts +12 -2
- package/dist/types/packages/react/src/time-picker.d.ts +12 -2
- package/dist/types/packages/react/src/time-wheel.d.cts +18 -0
- package/dist/types/packages/react/src/time-wheel.d.ts +18 -0
- package/dist/types/packages/react/src/use-filter-scroll.d.cts +5 -0
- package/dist/types/packages/react/src/use-filter-scroll.d.ts +5 -0
- package/dist/types/shared/package-runtime/accordion-state.d.cts +2 -0
- package/dist/types/shared/package-runtime/accordion-state.d.ts +2 -0
- package/dist/types/shared/package-runtime/action-size.d.cts +4 -0
- package/dist/types/shared/package-runtime/action-size.d.ts +4 -0
- package/dist/types/shared/package-runtime/alert-actions.d.cts +7 -0
- package/dist/types/shared/package-runtime/alert-actions.d.ts +7 -0
- package/dist/types/shared/package-runtime/alert-exit.d.cts +6 -0
- package/dist/types/shared/package-runtime/alert-exit.d.ts +6 -0
- package/dist/types/shared/package-runtime/alert-live.d.cts +2 -0
- package/dist/types/shared/package-runtime/alert-live.d.ts +2 -0
- package/dist/types/shared/package-runtime/avatar-group.d.cts +18 -0
- package/dist/types/shared/package-runtime/avatar-group.d.ts +18 -0
- package/dist/types/shared/package-runtime/badge-tone.d.cts +8 -2
- package/dist/types/shared/package-runtime/badge-tone.d.ts +8 -2
- package/dist/types/shared/package-runtime/bottom-bar.d.cts +1 -1
- package/dist/types/shared/package-runtime/bottom-bar.d.ts +1 -1
- package/dist/types/shared/package-runtime/bottom-navigation.d.cts +10 -0
- package/dist/types/shared/package-runtime/bottom-navigation.d.ts +10 -0
- package/dist/types/shared/package-runtime/calendar.d.cts +21 -7
- package/dist/types/shared/package-runtime/calendar.d.ts +21 -7
- package/dist/types/shared/package-runtime/card-layout.d.cts +8 -0
- package/dist/types/shared/package-runtime/card-layout.d.ts +8 -0
- package/dist/types/shared/package-runtime/carousel-scroll.d.cts +2 -0
- package/dist/types/shared/package-runtime/carousel-scroll.d.ts +2 -0
- package/dist/types/shared/package-runtime/carousel.d.cts +12 -2
- package/dist/types/shared/package-runtime/carousel.d.ts +12 -2
- package/dist/types/shared/package-runtime/chart-skeleton.d.cts +1 -1
- package/dist/types/shared/package-runtime/chart-skeleton.d.ts +1 -1
- package/dist/types/shared/package-runtime/clipboard.d.cts +6 -0
- package/dist/types/shared/package-runtime/clipboard.d.ts +6 -0
- package/dist/types/shared/package-runtime/combobox-options.d.cts +13 -0
- package/dist/types/shared/package-runtime/combobox-options.d.ts +13 -0
- package/dist/types/shared/package-runtime/combobox.d.cts +3 -1
- package/dist/types/shared/package-runtime/combobox.d.ts +3 -1
- package/dist/types/shared/package-runtime/copy-button.d.cts +11 -0
- package/dist/types/shared/package-runtime/copy-button.d.ts +11 -0
- package/dist/types/shared/package-runtime/data-cells.d.cts +36 -0
- package/dist/types/shared/package-runtime/data-cells.d.ts +36 -0
- package/dist/types/shared/package-runtime/development.d.cts +4 -0
- package/dist/types/shared/package-runtime/development.d.ts +4 -0
- package/dist/types/shared/package-runtime/distribution.d.cts +36 -1
- package/dist/types/shared/package-runtime/distribution.d.ts +36 -1
- package/dist/types/shared/package-runtime/drawer-geometry.d.cts +7 -0
- package/dist/types/shared/package-runtime/drawer-geometry.d.ts +7 -0
- package/dist/types/shared/package-runtime/event-calendar.d.cts +81 -0
- package/dist/types/shared/package-runtime/event-calendar.d.ts +81 -0
- package/dist/types/shared/package-runtime/external-link.d.cts +4 -0
- package/dist/types/shared/package-runtime/external-link.d.ts +4 -0
- package/dist/types/shared/package-runtime/field-group.d.cts +17 -0
- package/dist/types/shared/package-runtime/field-group.d.ts +17 -0
- package/dist/types/shared/package-runtime/file-upload.d.cts +128 -0
- package/dist/types/shared/package-runtime/file-upload.d.ts +128 -0
- package/dist/types/shared/package-runtime/filter-scroll.d.cts +5 -0
- package/dist/types/shared/package-runtime/filter-scroll.d.ts +5 -0
- package/dist/types/shared/package-runtime/filter-value.d.cts +2 -0
- package/dist/types/shared/package-runtime/filter-value.d.ts +2 -0
- package/dist/types/shared/package-runtime/input-field.d.cts +23 -0
- package/dist/types/shared/package-runtime/input-field.d.ts +23 -0
- package/dist/types/shared/package-runtime/input-variant.d.cts +7 -0
- package/dist/types/shared/package-runtime/input-variant.d.ts +7 -0
- package/dist/types/shared/package-runtime/kpi.d.cts +13 -0
- package/dist/types/shared/package-runtime/kpi.d.ts +13 -0
- package/dist/types/shared/package-runtime/layout-primitives.d.cts +115 -6
- package/dist/types/shared/package-runtime/layout-primitives.d.ts +115 -6
- package/dist/types/shared/package-runtime/list-row.d.cts +71 -8
- package/dist/types/shared/package-runtime/list-row.d.ts +71 -8
- package/dist/types/shared/package-runtime/market-layout.d.cts +3 -1
- package/dist/types/shared/package-runtime/market-layout.d.ts +3 -1
- package/dist/types/shared/package-runtime/market-query.d.cts +6 -0
- package/dist/types/shared/package-runtime/market-query.d.ts +6 -0
- package/dist/types/shared/package-runtime/market-table.d.cts +32 -0
- package/dist/types/shared/package-runtime/market-table.d.ts +32 -0
- package/dist/types/shared/package-runtime/menu-button.d.cts +4 -0
- package/dist/types/shared/package-runtime/menu-button.d.ts +4 -0
- package/dist/types/shared/package-runtime/messages/ko.d.cts +77 -1
- package/dist/types/shared/package-runtime/messages/ko.d.ts +77 -1
- package/dist/types/shared/package-runtime/messages-context.d.cts +69 -1
- package/dist/types/shared/package-runtime/messages-context.d.ts +69 -1
- package/dist/types/shared/package-runtime/minimum-loading.d.cts +3 -0
- package/dist/types/shared/package-runtime/minimum-loading.d.ts +3 -0
- package/dist/types/shared/package-runtime/modal-geometry.d.cts +15 -0
- package/dist/types/shared/package-runtime/modal-geometry.d.ts +15 -0
- package/dist/types/shared/package-runtime/navigation.d.cts +9 -2
- package/dist/types/shared/package-runtime/navigation.d.ts +9 -2
- package/dist/types/shared/package-runtime/nested-controls.d.cts +7 -0
- package/dist/types/shared/package-runtime/nested-controls.d.ts +7 -0
- package/dist/types/shared/package-runtime/node-text.d.cts +1 -0
- package/dist/types/shared/package-runtime/node-text.d.ts +1 -0
- package/dist/types/shared/package-runtime/number-input.d.cts +73 -0
- package/dist/types/shared/package-runtime/number-input.d.ts +73 -0
- package/dist/types/shared/package-runtime/options.d.cts +25 -5
- package/dist/types/shared/package-runtime/options.d.ts +25 -5
- package/dist/types/shared/package-runtime/pagination.d.cts +12 -0
- package/dist/types/shared/package-runtime/pagination.d.ts +12 -0
- package/dist/types/shared/package-runtime/press-repeat.d.cts +13 -0
- package/dist/types/shared/package-runtime/press-repeat.d.ts +13 -0
- package/dist/types/shared/package-runtime/progress-circle.d.cts +5 -0
- package/dist/types/shared/package-runtime/progress-circle.d.ts +5 -0
- package/dist/types/shared/package-runtime/progress-marker.d.cts +7 -0
- package/dist/types/shared/package-runtime/progress-marker.d.ts +7 -0
- package/dist/types/shared/package-runtime/progress-tone.d.cts +6 -0
- package/dist/types/shared/package-runtime/progress-tone.d.ts +6 -0
- package/dist/types/shared/package-runtime/select-trigger.d.cts +23 -0
- package/dist/types/shared/package-runtime/select-trigger.d.ts +23 -0
- package/dist/types/shared/package-runtime/sheet-drag.d.cts +24 -0
- package/dist/types/shared/package-runtime/sheet-drag.d.ts +24 -0
- package/dist/types/shared/package-runtime/side-navigation-keys.d.cts +23 -0
- package/dist/types/shared/package-runtime/side-navigation-keys.d.ts +23 -0
- package/dist/types/shared/package-runtime/side-navigation-layout.d.cts +24 -0
- package/dist/types/shared/package-runtime/side-navigation-layout.d.ts +24 -0
- package/dist/types/shared/package-runtime/side-navigation-scroll.d.cts +7 -0
- package/dist/types/shared/package-runtime/side-navigation-scroll.d.ts +7 -0
- package/dist/types/shared/package-runtime/side-navigation.d.cts +277 -0
- package/dist/types/shared/package-runtime/side-navigation.d.ts +277 -0
- package/dist/types/shared/package-runtime/signed-number.d.cts +33 -0
- package/dist/types/shared/package-runtime/signed-number.d.ts +33 -0
- package/dist/types/shared/package-runtime/skeleton-text.d.cts +4 -0
- package/dist/types/shared/package-runtime/skeleton-text.d.ts +4 -0
- package/dist/types/shared/package-runtime/slider-view.d.cts +17 -2
- package/dist/types/shared/package-runtime/slider-view.d.ts +17 -2
- package/dist/types/shared/package-runtime/sparkline.d.cts +8 -4
- package/dist/types/shared/package-runtime/sparkline.d.ts +8 -4
- package/dist/types/shared/package-runtime/spinner-geometry.d.cts +14 -0
- package/dist/types/shared/package-runtime/spinner-geometry.d.ts +14 -0
- package/dist/types/shared/package-runtime/split-pane.d.cts +40 -1
- package/dist/types/shared/package-runtime/split-pane.d.ts +40 -1
- package/dist/types/shared/package-runtime/steps.d.cts +51 -0
- package/dist/types/shared/package-runtime/steps.d.ts +51 -0
- package/dist/types/shared/package-runtime/tab-keyboard.d.cts +6 -0
- package/dist/types/shared/package-runtime/tab-keyboard.d.ts +6 -0
- package/dist/types/shared/package-runtime/table-columns.d.cts +8 -0
- package/dist/types/shared/package-runtime/table-columns.d.ts +8 -0
- package/dist/types/shared/package-runtime/table-model.d.cts +23 -3
- package/dist/types/shared/package-runtime/table-model.d.ts +23 -3
- package/dist/types/shared/package-runtime/table-presentation.d.cts +12 -2
- package/dist/types/shared/package-runtime/table-presentation.d.ts +12 -2
- package/dist/types/shared/package-runtime/table.d.cts +17 -2
- package/dist/types/shared/package-runtime/table.d.ts +17 -2
- package/dist/types/shared/package-runtime/textarea.d.cts +6 -4
- package/dist/types/shared/package-runtime/textarea.d.ts +6 -4
- package/dist/types/shared/package-runtime/tiles-children.d.cts +7 -0
- package/dist/types/shared/package-runtime/tiles-children.d.ts +7 -0
- package/dist/types/shared/package-runtime/tiles.d.cts +18 -0
- package/dist/types/shared/package-runtime/tiles.d.ts +18 -0
- package/dist/types/shared/package-runtime/time-segments.d.cts +24 -0
- package/dist/types/shared/package-runtime/time-segments.d.ts +24 -0
- package/dist/types/shared/package-runtime/time-wheel.d.cts +54 -0
- package/dist/types/shared/package-runtime/time-wheel.d.ts +54 -0
- package/dist/types/shared/package-runtime/trailing-overflow.d.cts +1 -0
- package/dist/types/shared/package-runtime/trailing-overflow.d.ts +1 -0
- package/dist/types/shared/package-runtime/use-color-picker.d.cts +3 -0
- package/dist/types/shared/package-runtime/use-color-picker.d.ts +3 -0
- package/dist/types/shared/package-runtime/use-copy-feedback.d.cts +10 -0
- package/dist/types/shared/package-runtime/use-copy-feedback.d.ts +10 -0
- package/dist/types/shared/package-runtime/use-open-state.d.cts +5 -0
- package/dist/types/shared/package-runtime/use-open-state.d.ts +5 -0
- package/dist/types/shared/package-runtime/use-pending-action.d.cts +6 -0
- package/dist/types/shared/package-runtime/use-pending-action.d.ts +6 -0
- package/dist/types/shared/package-runtime/use-side-navigation-state.d.cts +25 -0
- package/dist/types/shared/package-runtime/use-side-navigation-state.d.ts +25 -0
- package/dist/types/shared/package-runtime/use-slide.d.cts +3 -0
- package/dist/types/shared/package-runtime/use-slide.d.ts +3 -0
- package/package.json +3 -3
- package/dist/types/packages/react/src/compound-control.d.cts +0 -1
- package/dist/types/packages/react/src/compound-control.d.ts +0 -1
- package/dist/types/shared/package-runtime/center-option.d.cts +0 -1
- package/dist/types/shared/package-runtime/center-option.d.ts +0 -1
|
@@ -64,6 +64,37 @@ export declare function gaugeSliver(width: number, position: number, count: numb
|
|
|
64
64
|
start: number;
|
|
65
65
|
size: number;
|
|
66
66
|
} | null;
|
|
67
|
+
/**
|
|
68
|
+
* The gap the track leaves around the marker, in the axis's own length units: the marker and its ring on each side,
|
|
69
|
+
* widened over a sliver too thin to read. The background shows through it, whatever it is.
|
|
70
|
+
*/
|
|
71
|
+
export declare function gaugeHole(width: number, position: number, count: number, near: {
|
|
72
|
+
before?: GaugeBoundary;
|
|
73
|
+
after?: GaugeBoundary;
|
|
74
|
+
}, geometry: GaugeGeometry): {
|
|
75
|
+
start: number;
|
|
76
|
+
end: number;
|
|
77
|
+
};
|
|
78
|
+
export interface GaugePiece {
|
|
79
|
+
start: number;
|
|
80
|
+
size: number;
|
|
81
|
+
first: boolean;
|
|
82
|
+
last: boolean;
|
|
83
|
+
color?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The zones as drawn pieces for a renderer without masks (Native): each zone's span on a measured axis, less the hole
|
|
87
|
+
* around the marker. `first` and `last` mark the axis's own rounded ends.
|
|
88
|
+
*/
|
|
89
|
+
export declare function gaugePieces(width: number, segments: readonly GaugeSegment[], gap: number, hole?: {
|
|
90
|
+
start: number;
|
|
91
|
+
end: number;
|
|
92
|
+
}): GaugePiece[];
|
|
93
|
+
/** The CSS variables the web axis reads for its marker and hole: the position, the zone count and the neighbouring boundaries. */
|
|
94
|
+
export declare function gaugeAxisVars(position: number, count: number, near: {
|
|
95
|
+
before?: GaugeBoundary;
|
|
96
|
+
after?: GaugeBoundary;
|
|
97
|
+
}): Record<string, string>;
|
|
67
98
|
export declare function gaugeSpoken(label: string | undefined, valueText: string, zoneLabel?: string): string;
|
|
68
99
|
/** missing: nothing to show; empty: real values that add up to nothing; ready: at least one part to draw. */
|
|
69
100
|
export declare function stackedState(items: readonly StackedItem[] | null | undefined): StackedState;
|
|
@@ -101,7 +132,7 @@ export declare function gaugeModel(input: GaugeInput): {
|
|
|
101
132
|
position: number;
|
|
102
133
|
/** The caption's end: the value and the zone it falls in. */
|
|
103
134
|
caption: string;
|
|
104
|
-
/** The zone boundaries beside the marker, for the
|
|
135
|
+
/** The zone boundaries beside the marker, for the hole around it; none without a value. */
|
|
105
136
|
near: ReturnType<typeof gaugeNeighbours>;
|
|
106
137
|
/** One image for screen readers: the name, the value and the zone it falls in. */
|
|
107
138
|
spoken: string;
|
|
@@ -110,6 +141,8 @@ export interface StackedInput {
|
|
|
110
141
|
items: readonly StackedItem[] | null | undefined;
|
|
111
142
|
label?: string;
|
|
112
143
|
ariaLabel?: string;
|
|
144
|
+
/** The app's summary at the end of the caption line (a total, a verdict); read after the name. */
|
|
145
|
+
valueText?: string;
|
|
113
146
|
formatValue?: (value: number) => string;
|
|
114
147
|
missingText?: string;
|
|
115
148
|
noData: string;
|
|
@@ -120,6 +153,8 @@ export declare function stackedModel(input: StackedInput): {
|
|
|
120
153
|
state: StackedState;
|
|
121
154
|
missing: boolean;
|
|
122
155
|
mark: string;
|
|
156
|
+
/** The caption's end: the missing mark, or else the app's summary. */
|
|
157
|
+
caption: string | undefined;
|
|
123
158
|
/** One per item, in order: its key, its length on the bar (when drawn) and its legend line. */
|
|
124
159
|
parts: {
|
|
125
160
|
item: StackedItem;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** The web close button: a 32px square with its own radius. Inline, because the button sets its size and radius inline. */
|
|
2
|
+
export declare const drawerCloseStyle: {
|
|
3
|
+
borderRadius: 8;
|
|
4
|
+
width: 32;
|
|
5
|
+
height: 32;
|
|
6
|
+
padding: number;
|
|
7
|
+
};
|
|
1
8
|
export type DrawerPosition = "left" | "right" | "top" | "bottom";
|
|
2
9
|
export interface DrawerFrameInput {
|
|
3
10
|
position: DrawerPosition;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** The web close button: a 32px square with its own radius. Inline, because the button sets its size and radius inline. */
|
|
2
|
+
export declare const drawerCloseStyle: {
|
|
3
|
+
borderRadius: 8;
|
|
4
|
+
width: 32;
|
|
5
|
+
height: 32;
|
|
6
|
+
padding: number;
|
|
7
|
+
};
|
|
1
8
|
export type DrawerPosition = "left" | "right" | "top" | "bottom";
|
|
2
9
|
export interface DrawerFrameInput {
|
|
3
10
|
position: DrawerPosition;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { CalendarDay, WeekStart } from "./calendar.cjs";
|
|
2
|
+
import type { KjunMessageScope } from "./messages/index.cjs";
|
|
3
|
+
/** A bar over consecutive days; the colour is whatever the app passes. */
|
|
4
|
+
export interface DaySpan<C = string> {
|
|
5
|
+
color: C;
|
|
6
|
+
start: string;
|
|
7
|
+
end: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DayMarks<C = string> {
|
|
10
|
+
spans?: readonly DaySpan<C>[];
|
|
11
|
+
icon?: {
|
|
12
|
+
name: string;
|
|
13
|
+
color: C;
|
|
14
|
+
};
|
|
15
|
+
dots?: readonly C[];
|
|
16
|
+
count?: number;
|
|
17
|
+
}
|
|
18
|
+
/** A holiday rule: true marks the day, a string marks it and names it. */
|
|
19
|
+
export type HolidayTest = (iso: string) => string | boolean;
|
|
20
|
+
/** The app's "YYYY-MM-DD" today (server time, another time zone); missing or malformed reads as the device's today. */
|
|
21
|
+
export declare const resolveToday: (today?: string) => string;
|
|
22
|
+
/** "YYYY-MM"; a malformed value reads as the month of today. */
|
|
23
|
+
export declare const resolveMonth: (month: string | undefined, today?: string) => string;
|
|
24
|
+
/** The first day of the week holding the given day (today's week when malformed). */
|
|
25
|
+
export declare function resolveWeek(week: string | undefined, weekStart?: WeekStart, today?: string): string;
|
|
26
|
+
export declare const stepMonth: (month: string, delta: number) => string;
|
|
27
|
+
/** Seven days from the week's first day; none is outside the month. */
|
|
28
|
+
export declare const weekDays: (weekStartIso: string, today?: string) => CalendarDay[];
|
|
29
|
+
/** Whether a day belongs to the period shown (outside days of a month do not). */
|
|
30
|
+
export declare const withinPeriod: (iso: string, key: string) => boolean;
|
|
31
|
+
/** The days drawn for a period: six fixed weeks for a month, seven days for a week. */
|
|
32
|
+
export declare function periodDays(key: string, today: string, weekStart: WeekStart): CalendarDay[];
|
|
33
|
+
/** The grid's name: the month ("2026년 11월"), or a week's first and last day ("2026년 11월 16일 – 22일"). */
|
|
34
|
+
export declare function periodTitle(key: string, scope?: KjunMessageScope): string;
|
|
35
|
+
/**
|
|
36
|
+
* Helpers for the app's own title row and buttons: the calendar draws neither.
|
|
37
|
+
* key is "YYYY-MM" for a month, or any day "YYYY-MM-DD" of a week.
|
|
38
|
+
*/
|
|
39
|
+
export declare const kjunCalendarPeriod: {
|
|
40
|
+
/** The month ("YYYY-MM") or the week's first day ("YYYY-MM-DD") delta periods away. */
|
|
41
|
+
step(view: "month" | "week", key: string, delta: number, weekStart?: WeekStart): string;
|
|
42
|
+
/** The period's name as the grid reads it: "2026년 11월", or "2026년 11월 29일 – 12월 5일" for a week. locale follows KjunProvider's. */
|
|
43
|
+
title(view: "month" | "week", key: string, options?: {
|
|
44
|
+
locale?: string;
|
|
45
|
+
weekStart?: WeekStart;
|
|
46
|
+
}): string;
|
|
47
|
+
};
|
|
48
|
+
/** What a span draws on one day: null outside it; rounded at the span's ends and at the week's edges (column 0 and 6). */
|
|
49
|
+
export declare function spanSegment(span: DaySpan<unknown>, iso: string, column: number): {
|
|
50
|
+
start: boolean;
|
|
51
|
+
end: boolean;
|
|
52
|
+
} | null;
|
|
53
|
+
export declare const visibleDots: <C>(dots: readonly C[] | undefined) => C[];
|
|
54
|
+
/** The month step of a horizontal swipe: left is next (+1), right is previous (-1). */
|
|
55
|
+
export declare const swipeStep: (dx: number, dy: number) => -1 | 0 | 1;
|
|
56
|
+
/** The colour role of a day's number: holidays and Sundays danger, Saturdays info. */
|
|
57
|
+
export declare function dayTone(weekday: number, { markSunday, markSaturday, holiday }: {
|
|
58
|
+
markSunday: boolean;
|
|
59
|
+
markSaturday: boolean;
|
|
60
|
+
holiday: boolean;
|
|
61
|
+
}): "danger" | "info" | "text";
|
|
62
|
+
export declare function holidayOf(test: HolidayTest | undefined, iso: string, scope?: KjunMessageScope): {
|
|
63
|
+
holiday: boolean;
|
|
64
|
+
name?: string;
|
|
65
|
+
};
|
|
66
|
+
export declare const isPast: (iso: string, today: string) => boolean;
|
|
67
|
+
/** A spoken name for an event day: the date, then "today", the holiday name and the event count when present. */
|
|
68
|
+
export declare function eventDayLabel(iso: string, { holiday, count, today }: {
|
|
69
|
+
holiday?: string;
|
|
70
|
+
count?: number;
|
|
71
|
+
today?: boolean;
|
|
72
|
+
}, scope?: KjunMessageScope): string;
|
|
73
|
+
/** The month slide: the old month leaves, then the newest requested one enters. */
|
|
74
|
+
export interface SlideState {
|
|
75
|
+
shown: string;
|
|
76
|
+
pending: string | null;
|
|
77
|
+
phase: "idle" | "out" | "in";
|
|
78
|
+
direction: -1 | 1;
|
|
79
|
+
}
|
|
80
|
+
export declare function slideStart(state: SlideState, next: string): SlideState;
|
|
81
|
+
export declare function slideNext(state: SlideState): SlideState;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { CalendarDay, WeekStart } from "./calendar.js";
|
|
2
|
+
import type { KjunMessageScope } from "./messages/index.js";
|
|
3
|
+
/** A bar over consecutive days; the colour is whatever the app passes. */
|
|
4
|
+
export interface DaySpan<C = string> {
|
|
5
|
+
color: C;
|
|
6
|
+
start: string;
|
|
7
|
+
end: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DayMarks<C = string> {
|
|
10
|
+
spans?: readonly DaySpan<C>[];
|
|
11
|
+
icon?: {
|
|
12
|
+
name: string;
|
|
13
|
+
color: C;
|
|
14
|
+
};
|
|
15
|
+
dots?: readonly C[];
|
|
16
|
+
count?: number;
|
|
17
|
+
}
|
|
18
|
+
/** A holiday rule: true marks the day, a string marks it and names it. */
|
|
19
|
+
export type HolidayTest = (iso: string) => string | boolean;
|
|
20
|
+
/** The app's "YYYY-MM-DD" today (server time, another time zone); missing or malformed reads as the device's today. */
|
|
21
|
+
export declare const resolveToday: (today?: string) => string;
|
|
22
|
+
/** "YYYY-MM"; a malformed value reads as the month of today. */
|
|
23
|
+
export declare const resolveMonth: (month: string | undefined, today?: string) => string;
|
|
24
|
+
/** The first day of the week holding the given day (today's week when malformed). */
|
|
25
|
+
export declare function resolveWeek(week: string | undefined, weekStart?: WeekStart, today?: string): string;
|
|
26
|
+
export declare const stepMonth: (month: string, delta: number) => string;
|
|
27
|
+
/** Seven days from the week's first day; none is outside the month. */
|
|
28
|
+
export declare const weekDays: (weekStartIso: string, today?: string) => CalendarDay[];
|
|
29
|
+
/** Whether a day belongs to the period shown (outside days of a month do not). */
|
|
30
|
+
export declare const withinPeriod: (iso: string, key: string) => boolean;
|
|
31
|
+
/** The days drawn for a period: six fixed weeks for a month, seven days for a week. */
|
|
32
|
+
export declare function periodDays(key: string, today: string, weekStart: WeekStart): CalendarDay[];
|
|
33
|
+
/** The grid's name: the month ("2026년 11월"), or a week's first and last day ("2026년 11월 16일 – 22일"). */
|
|
34
|
+
export declare function periodTitle(key: string, scope?: KjunMessageScope): string;
|
|
35
|
+
/**
|
|
36
|
+
* Helpers for the app's own title row and buttons: the calendar draws neither.
|
|
37
|
+
* key is "YYYY-MM" for a month, or any day "YYYY-MM-DD" of a week.
|
|
38
|
+
*/
|
|
39
|
+
export declare const kjunCalendarPeriod: {
|
|
40
|
+
/** The month ("YYYY-MM") or the week's first day ("YYYY-MM-DD") delta periods away. */
|
|
41
|
+
step(view: "month" | "week", key: string, delta: number, weekStart?: WeekStart): string;
|
|
42
|
+
/** The period's name as the grid reads it: "2026년 11월", or "2026년 11월 29일 – 12월 5일" for a week. locale follows KjunProvider's. */
|
|
43
|
+
title(view: "month" | "week", key: string, options?: {
|
|
44
|
+
locale?: string;
|
|
45
|
+
weekStart?: WeekStart;
|
|
46
|
+
}): string;
|
|
47
|
+
};
|
|
48
|
+
/** What a span draws on one day: null outside it; rounded at the span's ends and at the week's edges (column 0 and 6). */
|
|
49
|
+
export declare function spanSegment(span: DaySpan<unknown>, iso: string, column: number): {
|
|
50
|
+
start: boolean;
|
|
51
|
+
end: boolean;
|
|
52
|
+
} | null;
|
|
53
|
+
export declare const visibleDots: <C>(dots: readonly C[] | undefined) => C[];
|
|
54
|
+
/** The month step of a horizontal swipe: left is next (+1), right is previous (-1). */
|
|
55
|
+
export declare const swipeStep: (dx: number, dy: number) => -1 | 0 | 1;
|
|
56
|
+
/** The colour role of a day's number: holidays and Sundays danger, Saturdays info. */
|
|
57
|
+
export declare function dayTone(weekday: number, { markSunday, markSaturday, holiday }: {
|
|
58
|
+
markSunday: boolean;
|
|
59
|
+
markSaturday: boolean;
|
|
60
|
+
holiday: boolean;
|
|
61
|
+
}): "danger" | "info" | "text";
|
|
62
|
+
export declare function holidayOf(test: HolidayTest | undefined, iso: string, scope?: KjunMessageScope): {
|
|
63
|
+
holiday: boolean;
|
|
64
|
+
name?: string;
|
|
65
|
+
};
|
|
66
|
+
export declare const isPast: (iso: string, today: string) => boolean;
|
|
67
|
+
/** A spoken name for an event day: the date, then "today", the holiday name and the event count when present. */
|
|
68
|
+
export declare function eventDayLabel(iso: string, { holiday, count, today }: {
|
|
69
|
+
holiday?: string;
|
|
70
|
+
count?: number;
|
|
71
|
+
today?: boolean;
|
|
72
|
+
}, scope?: KjunMessageScope): string;
|
|
73
|
+
/** The month slide: the old month leaves, then the newest requested one enters. */
|
|
74
|
+
export interface SlideState {
|
|
75
|
+
shown: string;
|
|
76
|
+
pending: string | null;
|
|
77
|
+
phase: "idle" | "out" | "in";
|
|
78
|
+
direction: -1 | 1;
|
|
79
|
+
}
|
|
80
|
+
export declare function slideStart(state: SlideState, next: string): SlideState;
|
|
81
|
+
export declare function slideNext(state: SlideState): SlideState;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Only http(s) URLs open; anything else ("javascript:", relative paths, typos) yields "". */
|
|
2
|
+
export declare function safeExternalUrl(href: string): string;
|
|
3
|
+
/** An icon-only link's name: the app's label, or the generic one. A text link is named by its own text. */
|
|
4
|
+
export declare function externalLinkIconName(label: string | undefined, fallback: string): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Only http(s) URLs open; anything else ("javascript:", relative paths, typos) yields "". */
|
|
2
|
+
export declare function safeExternalUrl(href: string): string;
|
|
3
|
+
/** An icon-only link's name: the app's label, or the generic one. A text link is named by its own text. */
|
|
4
|
+
export declare function externalLinkIconName(label: string | undefined, fallback: string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** FormGroup as="fieldset" groups several choice controls under one label. The group's id then goes to one control, so
|
|
2
|
+
* app code can focus the group with document.getElementById(id): the first control that asks for it, skipping disabled
|
|
3
|
+
* ones. Controls ask in mount order, which is their order on the page for the usual static list. */
|
|
4
|
+
export type FormGroupElement = "div" | "fieldset";
|
|
5
|
+
export interface FieldGroupClaim {
|
|
6
|
+
key: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Adds a claim at the end, or updates a held claim in place so it keeps its position. */
|
|
10
|
+
export declare function claimGroupField(claims: readonly FieldGroupClaim[], key: string, disabled: boolean): FieldGroupClaim[];
|
|
11
|
+
export declare function releaseGroupField(claims: readonly FieldGroupClaim[], key: string): FieldGroupClaim[];
|
|
12
|
+
/** The claim that takes the group's id: the first enabled one, or the first one when every control is disabled. */
|
|
13
|
+
export declare function groupFieldOwner(claims: readonly FieldGroupClaim[]): string | undefined;
|
|
14
|
+
/** Index of the option that carries the group's id inside a ButtonGroup or FilterGroup: the first enabled one. */
|
|
15
|
+
export declare function firstEnabledIndex(options: readonly {
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}[], groupDisabled?: boolean): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** FormGroup as="fieldset" groups several choice controls under one label. The group's id then goes to one control, so
|
|
2
|
+
* app code can focus the group with document.getElementById(id): the first control that asks for it, skipping disabled
|
|
3
|
+
* ones. Controls ask in mount order, which is their order on the page for the usual static list. */
|
|
4
|
+
export type FormGroupElement = "div" | "fieldset";
|
|
5
|
+
export interface FieldGroupClaim {
|
|
6
|
+
key: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Adds a claim at the end, or updates a held claim in place so it keeps its position. */
|
|
10
|
+
export declare function claimGroupField(claims: readonly FieldGroupClaim[], key: string, disabled: boolean): FieldGroupClaim[];
|
|
11
|
+
export declare function releaseGroupField(claims: readonly FieldGroupClaim[], key: string): FieldGroupClaim[];
|
|
12
|
+
/** The claim that takes the group's id: the first enabled one, or the first one when every control is disabled. */
|
|
13
|
+
export declare function groupFieldOwner(claims: readonly FieldGroupClaim[]): string | undefined;
|
|
14
|
+
/** Index of the option that carries the group's id inside a ButtonGroup or FilterGroup: the first enabled one. */
|
|
15
|
+
export declare function firstEnabledIndex(options: readonly {
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}[], groupDisabled?: boolean): number;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { KjunMessages } from "./messages/index.cjs";
|
|
2
|
+
export type KjunUploadStatus = "queued" | "uploading" | "done" | "error";
|
|
3
|
+
export interface KjunUploadFile {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Bytes. */
|
|
7
|
+
size: number;
|
|
8
|
+
status: KjunUploadStatus;
|
|
9
|
+
/** 0–100 while uploading; leave it out for an indeterminate bar. */
|
|
10
|
+
progress?: number;
|
|
11
|
+
/** Text shown on a failed row; the default message is used without it. */
|
|
12
|
+
error?: string;
|
|
13
|
+
/** Image thumbnail; the extension is shown without it. */
|
|
14
|
+
previewUrl?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
}
|
|
17
|
+
export type KjunRejectReason = "type" | "size" | "count";
|
|
18
|
+
export interface KjunRejectedFile<T> {
|
|
19
|
+
file: T;
|
|
20
|
+
reason: KjunRejectReason;
|
|
21
|
+
}
|
|
22
|
+
/** What a Native picker returns; Web hands over File objects instead. */
|
|
23
|
+
export interface KjunPickedFile {
|
|
24
|
+
name: string;
|
|
25
|
+
size: number;
|
|
26
|
+
type?: string;
|
|
27
|
+
uri?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface UploadLimits {
|
|
30
|
+
accept?: string;
|
|
31
|
+
maxSize?: number;
|
|
32
|
+
maxFiles?: number;
|
|
33
|
+
multiple?: boolean;
|
|
34
|
+
current: number;
|
|
35
|
+
}
|
|
36
|
+
export type DragVerdict = "ok" | "type" | "count" | "unknown";
|
|
37
|
+
/** The <input accept> rules: ".ext" by name, "type/*" and "type/sub" by MIME. An empty accept takes anything. */
|
|
38
|
+
export declare function matchesAccept(name: string, type: string | undefined, accept?: string): boolean;
|
|
39
|
+
/** Free places: one in single-file mode (the pick replaces the file), unlimited without maxFiles. */
|
|
40
|
+
export declare function uploadRoom({ maxFiles, multiple, current }: UploadLimits): number;
|
|
41
|
+
/** Checks type, then size, then fills the free places in order; the rest are rejected as count. */
|
|
42
|
+
export declare function screenFiles<T extends {
|
|
43
|
+
name: string;
|
|
44
|
+
size: number;
|
|
45
|
+
type?: string;
|
|
46
|
+
}>(files: T[], limits: UploadLimits): {
|
|
47
|
+
accepted: T[];
|
|
48
|
+
rejected: KjunRejectedFile<T>[];
|
|
49
|
+
};
|
|
50
|
+
/** What a drag can tell before the drop: the number of files and, in some browsers, their MIME types. Never size. */
|
|
51
|
+
export declare function dragVerdict(items: {
|
|
52
|
+
kind: string;
|
|
53
|
+
type: string;
|
|
54
|
+
}[], limits: UploadLimits): {
|
|
55
|
+
verdict: DragVerdict;
|
|
56
|
+
count: number;
|
|
57
|
+
room: number;
|
|
58
|
+
};
|
|
59
|
+
/** Middle truncation: the head may be cut, the tail (last 4 stem characters and the extension) always shows. */
|
|
60
|
+
export declare function splitFileName(name: string): {
|
|
61
|
+
head: string;
|
|
62
|
+
tail: string;
|
|
63
|
+
};
|
|
64
|
+
/** Thumbnail text for a file without a preview: the extension in capitals, at most 4 letters. */
|
|
65
|
+
export declare function extensionLabel(name: string, _type?: string): string;
|
|
66
|
+
/** 1024 steps; one decimal under 100, none from 100 up; no space before the unit. */
|
|
67
|
+
export declare function formatBytes(bytes: number, intl?: string): string;
|
|
68
|
+
export declare function clampProgress(progress: number | undefined): number | undefined;
|
|
69
|
+
export declare function uploadSummary(files: {
|
|
70
|
+
status: KjunUploadStatus;
|
|
71
|
+
}[]): {
|
|
72
|
+
total: number;
|
|
73
|
+
done: number;
|
|
74
|
+
failed: number;
|
|
75
|
+
uploading: number;
|
|
76
|
+
queued: number;
|
|
77
|
+
};
|
|
78
|
+
/** Rows that just became done or failed, for the live region. The first render (no previous state) announces nothing. */
|
|
79
|
+
export declare function uploadTransitions(prev: Record<string, KjunUploadStatus>, files: KjunUploadFile[]): {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
status: "done" | "error";
|
|
83
|
+
}[];
|
|
84
|
+
export declare const uploadStatuses: (files: KjunUploadFile[]) => Record<string, KjunUploadStatus>;
|
|
85
|
+
/** After a row is removed, focus the next row, else the previous one; null means the add button. */
|
|
86
|
+
export declare function focusAfterRemove(ids: string[], removed: string): string | null;
|
|
87
|
+
/** ".pdf,image/png,video/*" → labels ["PDF","PNG"], groups ["video"]; groups are named by the messages. */
|
|
88
|
+
export declare function acceptLabels(accept?: string): {
|
|
89
|
+
labels: string[];
|
|
90
|
+
groups: string[];
|
|
91
|
+
};
|
|
92
|
+
export type KjunUploadSize = "md" | "compact";
|
|
93
|
+
export type KjunUploadTrigger = "area" | "button";
|
|
94
|
+
export type KjunUploadLayout = "list" | "grid";
|
|
95
|
+
export type DragState = {
|
|
96
|
+
verdict: DragVerdict;
|
|
97
|
+
count: number;
|
|
98
|
+
room: number;
|
|
99
|
+
} | null;
|
|
100
|
+
/** How many rejected files are listed by name; the rest fold into one "n more" line. */
|
|
101
|
+
export declare const REJECTION_LINES = 3;
|
|
102
|
+
/** The rejection notice (and its announcement): the first three by name, then one "n more" line. */
|
|
103
|
+
export declare function rejectionLines<T extends {
|
|
104
|
+
name: string;
|
|
105
|
+
}>(m: KjunMessages, list: KjunRejectedFile<T>[], sizeText?: string): string[];
|
|
106
|
+
/** A drag that cannot add anything: a refused type, or no room left at all. */
|
|
107
|
+
export declare const dragBlocked: (drag: DragState) => boolean;
|
|
108
|
+
/** What the zone (empty) or the veil (filled) says and shows while files are dragged over the card. */
|
|
109
|
+
export declare function dragCopy(m: KjunMessages, drag: DragState, types: string, maxFiles?: number): {
|
|
110
|
+
title: string;
|
|
111
|
+
hint: string;
|
|
112
|
+
icon: string;
|
|
113
|
+
blocked: boolean;
|
|
114
|
+
} | null;
|
|
115
|
+
/** The allowed types in words: extensions and exact MIME in capitals, wildcard groups named by the messages. */
|
|
116
|
+
export declare function acceptText(m: KjunMessages, accept?: string): string;
|
|
117
|
+
/** The row's × cancels a file still waiting or uploading and removes one that finished or failed. */
|
|
118
|
+
export declare const removeLabel: (m: KjunMessages, file: {
|
|
119
|
+
name: string;
|
|
120
|
+
status: KjunUploadStatus;
|
|
121
|
+
}) => string;
|
|
122
|
+
/** A tile's name for assistive tech: the file name, then its state in words. */
|
|
123
|
+
export declare function tileLabel(m: KjunMessages, file: KjunUploadFile): string;
|
|
124
|
+
/** Grid columns that keep every tile at least `min` wide, and the tile width that fills the row. */
|
|
125
|
+
export declare function gridColumns(width: number, min: number, gap: number): {
|
|
126
|
+
columns: number;
|
|
127
|
+
tile: number;
|
|
128
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { KjunMessages } from "./messages/index.js";
|
|
2
|
+
export type KjunUploadStatus = "queued" | "uploading" | "done" | "error";
|
|
3
|
+
export interface KjunUploadFile {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Bytes. */
|
|
7
|
+
size: number;
|
|
8
|
+
status: KjunUploadStatus;
|
|
9
|
+
/** 0–100 while uploading; leave it out for an indeterminate bar. */
|
|
10
|
+
progress?: number;
|
|
11
|
+
/** Text shown on a failed row; the default message is used without it. */
|
|
12
|
+
error?: string;
|
|
13
|
+
/** Image thumbnail; the extension is shown without it. */
|
|
14
|
+
previewUrl?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
}
|
|
17
|
+
export type KjunRejectReason = "type" | "size" | "count";
|
|
18
|
+
export interface KjunRejectedFile<T> {
|
|
19
|
+
file: T;
|
|
20
|
+
reason: KjunRejectReason;
|
|
21
|
+
}
|
|
22
|
+
/** What a Native picker returns; Web hands over File objects instead. */
|
|
23
|
+
export interface KjunPickedFile {
|
|
24
|
+
name: string;
|
|
25
|
+
size: number;
|
|
26
|
+
type?: string;
|
|
27
|
+
uri?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface UploadLimits {
|
|
30
|
+
accept?: string;
|
|
31
|
+
maxSize?: number;
|
|
32
|
+
maxFiles?: number;
|
|
33
|
+
multiple?: boolean;
|
|
34
|
+
current: number;
|
|
35
|
+
}
|
|
36
|
+
export type DragVerdict = "ok" | "type" | "count" | "unknown";
|
|
37
|
+
/** The <input accept> rules: ".ext" by name, "type/*" and "type/sub" by MIME. An empty accept takes anything. */
|
|
38
|
+
export declare function matchesAccept(name: string, type: string | undefined, accept?: string): boolean;
|
|
39
|
+
/** Free places: one in single-file mode (the pick replaces the file), unlimited without maxFiles. */
|
|
40
|
+
export declare function uploadRoom({ maxFiles, multiple, current }: UploadLimits): number;
|
|
41
|
+
/** Checks type, then size, then fills the free places in order; the rest are rejected as count. */
|
|
42
|
+
export declare function screenFiles<T extends {
|
|
43
|
+
name: string;
|
|
44
|
+
size: number;
|
|
45
|
+
type?: string;
|
|
46
|
+
}>(files: T[], limits: UploadLimits): {
|
|
47
|
+
accepted: T[];
|
|
48
|
+
rejected: KjunRejectedFile<T>[];
|
|
49
|
+
};
|
|
50
|
+
/** What a drag can tell before the drop: the number of files and, in some browsers, their MIME types. Never size. */
|
|
51
|
+
export declare function dragVerdict(items: {
|
|
52
|
+
kind: string;
|
|
53
|
+
type: string;
|
|
54
|
+
}[], limits: UploadLimits): {
|
|
55
|
+
verdict: DragVerdict;
|
|
56
|
+
count: number;
|
|
57
|
+
room: number;
|
|
58
|
+
};
|
|
59
|
+
/** Middle truncation: the head may be cut, the tail (last 4 stem characters and the extension) always shows. */
|
|
60
|
+
export declare function splitFileName(name: string): {
|
|
61
|
+
head: string;
|
|
62
|
+
tail: string;
|
|
63
|
+
};
|
|
64
|
+
/** Thumbnail text for a file without a preview: the extension in capitals, at most 4 letters. */
|
|
65
|
+
export declare function extensionLabel(name: string, _type?: string): string;
|
|
66
|
+
/** 1024 steps; one decimal under 100, none from 100 up; no space before the unit. */
|
|
67
|
+
export declare function formatBytes(bytes: number, intl?: string): string;
|
|
68
|
+
export declare function clampProgress(progress: number | undefined): number | undefined;
|
|
69
|
+
export declare function uploadSummary(files: {
|
|
70
|
+
status: KjunUploadStatus;
|
|
71
|
+
}[]): {
|
|
72
|
+
total: number;
|
|
73
|
+
done: number;
|
|
74
|
+
failed: number;
|
|
75
|
+
uploading: number;
|
|
76
|
+
queued: number;
|
|
77
|
+
};
|
|
78
|
+
/** Rows that just became done or failed, for the live region. The first render (no previous state) announces nothing. */
|
|
79
|
+
export declare function uploadTransitions(prev: Record<string, KjunUploadStatus>, files: KjunUploadFile[]): {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
status: "done" | "error";
|
|
83
|
+
}[];
|
|
84
|
+
export declare const uploadStatuses: (files: KjunUploadFile[]) => Record<string, KjunUploadStatus>;
|
|
85
|
+
/** After a row is removed, focus the next row, else the previous one; null means the add button. */
|
|
86
|
+
export declare function focusAfterRemove(ids: string[], removed: string): string | null;
|
|
87
|
+
/** ".pdf,image/png,video/*" → labels ["PDF","PNG"], groups ["video"]; groups are named by the messages. */
|
|
88
|
+
export declare function acceptLabels(accept?: string): {
|
|
89
|
+
labels: string[];
|
|
90
|
+
groups: string[];
|
|
91
|
+
};
|
|
92
|
+
export type KjunUploadSize = "md" | "compact";
|
|
93
|
+
export type KjunUploadTrigger = "area" | "button";
|
|
94
|
+
export type KjunUploadLayout = "list" | "grid";
|
|
95
|
+
export type DragState = {
|
|
96
|
+
verdict: DragVerdict;
|
|
97
|
+
count: number;
|
|
98
|
+
room: number;
|
|
99
|
+
} | null;
|
|
100
|
+
/** How many rejected files are listed by name; the rest fold into one "n more" line. */
|
|
101
|
+
export declare const REJECTION_LINES = 3;
|
|
102
|
+
/** The rejection notice (and its announcement): the first three by name, then one "n more" line. */
|
|
103
|
+
export declare function rejectionLines<T extends {
|
|
104
|
+
name: string;
|
|
105
|
+
}>(m: KjunMessages, list: KjunRejectedFile<T>[], sizeText?: string): string[];
|
|
106
|
+
/** A drag that cannot add anything: a refused type, or no room left at all. */
|
|
107
|
+
export declare const dragBlocked: (drag: DragState) => boolean;
|
|
108
|
+
/** What the zone (empty) or the veil (filled) says and shows while files are dragged over the card. */
|
|
109
|
+
export declare function dragCopy(m: KjunMessages, drag: DragState, types: string, maxFiles?: number): {
|
|
110
|
+
title: string;
|
|
111
|
+
hint: string;
|
|
112
|
+
icon: string;
|
|
113
|
+
blocked: boolean;
|
|
114
|
+
} | null;
|
|
115
|
+
/** The allowed types in words: extensions and exact MIME in capitals, wildcard groups named by the messages. */
|
|
116
|
+
export declare function acceptText(m: KjunMessages, accept?: string): string;
|
|
117
|
+
/** The row's × cancels a file still waiting or uploading and removes one that finished or failed. */
|
|
118
|
+
export declare const removeLabel: (m: KjunMessages, file: {
|
|
119
|
+
name: string;
|
|
120
|
+
status: KjunUploadStatus;
|
|
121
|
+
}) => string;
|
|
122
|
+
/** A tile's name for assistive tech: the file name, then its state in words. */
|
|
123
|
+
export declare function tileLabel(m: KjunMessages, file: KjunUploadFile): string;
|
|
124
|
+
/** Grid columns that keep every tile at least `min` wide, and the tile width that fills the row. */
|
|
125
|
+
export declare function gridColumns(width: number, min: number, gap: number): {
|
|
126
|
+
columns: number;
|
|
127
|
+
tile: number;
|
|
128
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A field holds a value when it is not empty; the number 0 is a value. */
|
|
2
|
+
export declare const inputHasValue: (value: string | number | null | undefined) => boolean;
|
|
3
|
+
/** The clear button shows only while there is a value the person can remove. */
|
|
4
|
+
export declare const inputShowsClear: ({ clearable, value, disabled, readOnly }: {
|
|
5
|
+
clearable?: boolean;
|
|
6
|
+
value: string | number | null | undefined;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
}) => boolean;
|
|
10
|
+
/** A password field the person can reveal: the type it renders with and whether the reveal button shows. */
|
|
11
|
+
export declare function inputReveal(type: string | undefined, revealable: boolean | undefined, revealed: boolean): {
|
|
12
|
+
active: boolean;
|
|
13
|
+
type: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** Input's character count follows Textarea's: "length/maxLength", over the limit reads as an error. */
|
|
16
|
+
export declare function inputCount(value: string | number | null | undefined, maxLength?: number): {
|
|
17
|
+
remaining: number | null;
|
|
18
|
+
length: number;
|
|
19
|
+
text: string;
|
|
20
|
+
over: boolean;
|
|
21
|
+
};
|
|
22
|
+
/** How long a remote search waits after the last keystroke before it asks loadOptions (ms). */
|
|
23
|
+
export declare const searchLoadDelay = 300;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A field holds a value when it is not empty; the number 0 is a value. */
|
|
2
|
+
export declare const inputHasValue: (value: string | number | null | undefined) => boolean;
|
|
3
|
+
/** The clear button shows only while there is a value the person can remove. */
|
|
4
|
+
export declare const inputShowsClear: ({ clearable, value, disabled, readOnly }: {
|
|
5
|
+
clearable?: boolean;
|
|
6
|
+
value: string | number | null | undefined;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
}) => boolean;
|
|
10
|
+
/** A password field the person can reveal: the type it renders with and whether the reveal button shows. */
|
|
11
|
+
export declare function inputReveal(type: string | undefined, revealable: boolean | undefined, revealed: boolean): {
|
|
12
|
+
active: boolean;
|
|
13
|
+
type: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** Input's character count follows Textarea's: "length/maxLength", over the limit reads as an error. */
|
|
16
|
+
export declare function inputCount(value: string | number | null | undefined, maxLength?: number): {
|
|
17
|
+
remaining: number | null;
|
|
18
|
+
length: number;
|
|
19
|
+
text: string;
|
|
20
|
+
over: boolean;
|
|
21
|
+
};
|
|
22
|
+
/** How long a remote search waits after the last keystroke before it asks loadOptions (ms). */
|
|
23
|
+
export declare const searchLoadDelay = 300;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** "plain" drops the field surface: text edited in place, such as a document title or a note body. */
|
|
2
|
+
export type InputVariant = "default" | "plain";
|
|
3
|
+
/** The side inset and side border of a field. A plain field has neither, so its text lines up with the text around it. */
|
|
4
|
+
export declare function inputEdge(variant: InputVariant | undefined, padding: number): {
|
|
5
|
+
padding: number;
|
|
6
|
+
border: number;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** "plain" drops the field surface: text edited in place, such as a document title or a note body. */
|
|
2
|
+
export type InputVariant = "default" | "plain";
|
|
3
|
+
/** The side inset and side border of a field. A plain field has neither, so its text lines up with the text around it. */
|
|
4
|
+
export declare function inputEdge(variant: InputVariant | undefined, padding: number): {
|
|
5
|
+
padding: number;
|
|
6
|
+
border: number;
|
|
7
|
+
};
|