@kjun-ui/react 0.21.0 → 0.22.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 +8405 -3740
- package/dist/index.js +8199 -3512
- package/dist/styles.css +2610 -454
- 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 +6 -2
- package/dist/types/packages/react/src/app-navigation.d.ts +6 -2
- 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 +14 -6
- package/dist/types/packages/react/src/button.d.ts +14 -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 +26 -6
- package/dist/types/packages/react/src/display.d.ts +26 -6
- 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 +19 -5
- package/dist/types/packages/react/src/dropdown.d.ts +19 -5
- 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 +14 -1
- package/dist/types/packages/react/src/input.d.ts +14 -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 +39 -8
- package/dist/types/packages/react/src/list.d.ts +39 -8
- package/dist/types/packages/react/src/market-model.d.cts +13 -1
- package/dist/types/packages/react/src/market-model.d.ts +13 -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.d.cts +47 -0
- package/dist/types/packages/react/src/side-navigation-layout.d.ts +47 -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 +18 -5
- package/dist/types/packages/react/src/split-pane.d.ts +18 -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 +26 -0
- package/dist/types/packages/react/src/steps.d.ts +26 -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 +5 -0
- package/dist/types/shared/package-runtime/bottom-navigation.d.ts +5 -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/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 +43 -6
- package/dist/types/shared/package-runtime/list-row.d.ts +43 -6
- 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 +74 -1
- package/dist/types/shared/package-runtime/messages/ko.d.ts +74 -1
- package/dist/types/shared/package-runtime/messages-context.d.cts +66 -1
- package/dist/types/shared/package-runtime/messages-context.d.ts +66 -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/number-input.d.cts +63 -0
- package/dist/types/shared/package-runtime/number-input.d.ts +63 -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/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-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 +37 -0
- package/dist/types/shared/package-runtime/steps.d.ts +37 -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 +11 -2
- package/dist/types/shared/package-runtime/table-presentation.d.ts +11 -2
- package/dist/types/shared/package-runtime/table.d.cts +15 -2
- package/dist/types/shared/package-runtime/table.d.ts +15 -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
|
@@ -23,8 +23,17 @@ export declare function stopDots(stops: readonly number[] | undefined, count: nu
|
|
|
23
23
|
target: number;
|
|
24
24
|
current: boolean;
|
|
25
25
|
}[];
|
|
26
|
+
/**
|
|
27
|
+
* Where previous or next leads: the first slide of the neighbouring stop, so slides that share the end of a card rail
|
|
28
|
+
* are passed over in one step instead of moving nothing. undefined when there is no stop that way.
|
|
29
|
+
*/
|
|
30
|
+
export declare function stepTarget(stops: readonly number[] | undefined, current: number, count: number, direction: "previous" | "next"): number | undefined;
|
|
26
31
|
/** Where focus goes after a button moves to an end: the scroller for side buttons, which vanish, or the other header button. */
|
|
27
|
-
export declare function stepFocus(target: number, count: number, header: boolean): "viewport" | "previous" | "next" | undefined;
|
|
32
|
+
export declare function stepFocus(stops: readonly number[] | undefined, target: number, count: number, header: boolean): "viewport" | "previous" | "next" | undefined;
|
|
33
|
+
/** How many slides fit side by side when each must be at least `min` wide (never fewer than one). */
|
|
34
|
+
export declare function slidesPerView(width: number, min: number, gap: number): number;
|
|
35
|
+
/** The slide width that puts `perView` slides across `width` with `gap` between them. */
|
|
36
|
+
export declare function perViewWidth(width: number, perView: number, gap: number): number;
|
|
28
37
|
/** Slide starts as scroll positions the scroller can actually reach; starts past the end stop at the end. */
|
|
29
38
|
export declare function reachableOffsets(offsets: readonly number[], max: number): number[];
|
|
30
39
|
/** Where a mouse drag lands: wherever the position is nearest, or one slide on once the drag passes a fifth of the view. */
|
|
@@ -36,7 +45,8 @@ export declare function dragTarget({ start, nearest, distance, width, count }: {
|
|
|
36
45
|
count: number;
|
|
37
46
|
}): number;
|
|
38
47
|
export declare function carouselKey(key: string): CarouselMove | undefined;
|
|
39
|
-
|
|
48
|
+
/** Arrow keys step by stop like the buttons; Home and End go to either end. */
|
|
49
|
+
export declare function carouselTarget(move: CarouselMove, index: number, count: number, stops?: readonly number[]): number;
|
|
40
50
|
export declare function warnUnnamedCarousel(named: boolean): void;
|
|
41
51
|
/** Development-only hints for setups that leave some people unable to move or name the carousel. */
|
|
42
52
|
export declare function warnCarouselSetup({ controls, dots, mouseDrag, named }: {
|
|
@@ -23,8 +23,17 @@ export declare function stopDots(stops: readonly number[] | undefined, count: nu
|
|
|
23
23
|
target: number;
|
|
24
24
|
current: boolean;
|
|
25
25
|
}[];
|
|
26
|
+
/**
|
|
27
|
+
* Where previous or next leads: the first slide of the neighbouring stop, so slides that share the end of a card rail
|
|
28
|
+
* are passed over in one step instead of moving nothing. undefined when there is no stop that way.
|
|
29
|
+
*/
|
|
30
|
+
export declare function stepTarget(stops: readonly number[] | undefined, current: number, count: number, direction: "previous" | "next"): number | undefined;
|
|
26
31
|
/** Where focus goes after a button moves to an end: the scroller for side buttons, which vanish, or the other header button. */
|
|
27
|
-
export declare function stepFocus(target: number, count: number, header: boolean): "viewport" | "previous" | "next" | undefined;
|
|
32
|
+
export declare function stepFocus(stops: readonly number[] | undefined, target: number, count: number, header: boolean): "viewport" | "previous" | "next" | undefined;
|
|
33
|
+
/** How many slides fit side by side when each must be at least `min` wide (never fewer than one). */
|
|
34
|
+
export declare function slidesPerView(width: number, min: number, gap: number): number;
|
|
35
|
+
/** The slide width that puts `perView` slides across `width` with `gap` between them. */
|
|
36
|
+
export declare function perViewWidth(width: number, perView: number, gap: number): number;
|
|
28
37
|
/** Slide starts as scroll positions the scroller can actually reach; starts past the end stop at the end. */
|
|
29
38
|
export declare function reachableOffsets(offsets: readonly number[], max: number): number[];
|
|
30
39
|
/** Where a mouse drag lands: wherever the position is nearest, or one slide on once the drag passes a fifth of the view. */
|
|
@@ -36,7 +45,8 @@ export declare function dragTarget({ start, nearest, distance, width, count }: {
|
|
|
36
45
|
count: number;
|
|
37
46
|
}): number;
|
|
38
47
|
export declare function carouselKey(key: string): CarouselMove | undefined;
|
|
39
|
-
|
|
48
|
+
/** Arrow keys step by stop like the buttons; Home and End go to either end. */
|
|
49
|
+
export declare function carouselTarget(move: CarouselMove, index: number, count: number, stops?: readonly number[]): number;
|
|
40
50
|
export declare function warnUnnamedCarousel(named: boolean): void;
|
|
41
51
|
/** Development-only hints for setups that leave some people unable to move or name the carousel. */
|
|
42
52
|
export declare function warnCarouselSetup({ controls, dots, mouseDrag, named }: {
|
|
@@ -20,7 +20,7 @@ export declare const chartSkeletonMaxCount = 100;
|
|
|
20
20
|
export declare function chartSkeletonCount(value: number): number;
|
|
21
21
|
/** Every third diagonal cell is drawn at the pending opacity so the matrix reads as a heatmap. */
|
|
22
22
|
export declare function chartMatrixMuted(row: number, column: number): boolean;
|
|
23
|
-
/** Donut ring diameter as a share of the skeleton height;
|
|
23
|
+
/** Donut ring diameter as a share of the skeleton height; skeleton.css repeats it as 80% and 80cqh. */
|
|
24
24
|
export declare const chartDonutRatio = 0.8;
|
|
25
25
|
/** Inner diameter of the donut ring. */
|
|
26
26
|
export declare function chartDonutHole(height: number, thickness: number): number;
|
|
@@ -20,7 +20,7 @@ export declare const chartSkeletonMaxCount = 100;
|
|
|
20
20
|
export declare function chartSkeletonCount(value: number): number;
|
|
21
21
|
/** Every third diagonal cell is drawn at the pending opacity so the matrix reads as a heatmap. */
|
|
22
22
|
export declare function chartMatrixMuted(row: number, column: number): boolean;
|
|
23
|
-
/** Donut ring diameter as a share of the skeleton height;
|
|
23
|
+
/** Donut ring diameter as a share of the skeleton height; skeleton.css repeats it as 80% and 80cqh. */
|
|
24
24
|
export declare const chartDonutRatio = 0.8;
|
|
25
25
|
/** Inner diameter of the donut ring. */
|
|
26
26
|
export declare function chartDonutHole(height: number, thickness: number): number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** How long a copy button shows its success state before it can copy again. */
|
|
2
|
+
export declare const copyFeedbackDuration = 1500;
|
|
3
|
+
/** Web copy: the async Clipboard API in secure contexts, else a hidden textarea and execCommand. */
|
|
4
|
+
export declare function browserCopy(value: string): Promise<void>;
|
|
5
|
+
/** True for a handler result that settles later, so a control can stay busy until it does. */
|
|
6
|
+
export declare function isPending(result: unknown): result is PromiseLike<unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** How long a copy button shows its success state before it can copy again. */
|
|
2
|
+
export declare const copyFeedbackDuration = 1500;
|
|
3
|
+
/** Web copy: the async Clipboard API in secure contexts, else a hidden textarea and execCommand. */
|
|
4
|
+
export declare function browserCopy(value: string): Promise<void>;
|
|
5
|
+
/** True for a handler result that settles later, so a control can stay busy until it does. */
|
|
6
|
+
export declare function isPending(result: unknown): result is PromiseLike<unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SelectOption } from "./options.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Combobox candidates: every option until the user types after opening, then Select's ranked match
|
|
4
|
+
* (label prefix, label contains, searchKeys contains). A caller's filterFn owns matching and keeps the original order.
|
|
5
|
+
*/
|
|
6
|
+
export declare function comboboxOptions<T extends SelectOption>({ options, query, typed, labelKey, filterFn, searchKeys }: {
|
|
7
|
+
options: T[];
|
|
8
|
+
query: string;
|
|
9
|
+
typed: boolean;
|
|
10
|
+
labelKey: string;
|
|
11
|
+
filterFn?: (option: T, query: string) => boolean;
|
|
12
|
+
searchKeys?: readonly string[];
|
|
13
|
+
}): T[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SelectOption } from "./options.js";
|
|
2
|
+
/**
|
|
3
|
+
* Combobox candidates: every option until the user types after opening, then Select's ranked match
|
|
4
|
+
* (label prefix, label contains, searchKeys contains). A caller's filterFn owns matching and keeps the original order.
|
|
5
|
+
*/
|
|
6
|
+
export declare function comboboxOptions<T extends SelectOption>({ options, query, typed, labelKey, filterFn, searchKeys }: {
|
|
7
|
+
options: T[];
|
|
8
|
+
query: string;
|
|
9
|
+
typed: boolean;
|
|
10
|
+
labelKey: string;
|
|
11
|
+
filterFn?: (option: T, query: string) => boolean;
|
|
12
|
+
searchKeys?: readonly string[];
|
|
13
|
+
}): T[];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type OptionValue, type SelectOption } from "./options.cjs";
|
|
2
|
-
export declare function useComboboxModel<T extends SelectOption>({ value, options, labelKey, valueKey, disabled, filterFn, onValueChange, onChange, onSearch, onClear, }: {
|
|
2
|
+
export declare function useComboboxModel<T extends SelectOption>({ value, options, labelKey, valueKey, disabled, filterFn, searchKeys, onValueChange, onChange, onSearch, onClear, }: {
|
|
3
3
|
value: OptionValue | null;
|
|
4
4
|
options: T[];
|
|
5
5
|
labelKey: string;
|
|
6
6
|
valueKey: string;
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
filterFn?: (option: T, query: string) => boolean;
|
|
9
|
+
searchKeys?: readonly string[];
|
|
9
10
|
onValueChange?: (value: OptionValue | null) => void;
|
|
10
11
|
onChange?: (value: OptionValue | null) => void;
|
|
11
12
|
onSearch?: (value: string) => void;
|
|
@@ -14,6 +15,7 @@ export declare function useComboboxModel<T extends SelectOption>({ value, option
|
|
|
14
15
|
open: boolean;
|
|
15
16
|
displayValue: string;
|
|
16
17
|
options: T[];
|
|
18
|
+
isSelected: (option: T) => boolean;
|
|
17
19
|
changeOpen(next: boolean): void;
|
|
18
20
|
search(next: string, openOnInput: boolean): void;
|
|
19
21
|
select(option: T): void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type OptionValue, type SelectOption } from "./options.js";
|
|
2
|
-
export declare function useComboboxModel<T extends SelectOption>({ value, options, labelKey, valueKey, disabled, filterFn, onValueChange, onChange, onSearch, onClear, }: {
|
|
2
|
+
export declare function useComboboxModel<T extends SelectOption>({ value, options, labelKey, valueKey, disabled, filterFn, searchKeys, onValueChange, onChange, onSearch, onClear, }: {
|
|
3
3
|
value: OptionValue | null;
|
|
4
4
|
options: T[];
|
|
5
5
|
labelKey: string;
|
|
6
6
|
valueKey: string;
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
filterFn?: (option: T, query: string) => boolean;
|
|
9
|
+
searchKeys?: readonly string[];
|
|
9
10
|
onValueChange?: (value: OptionValue | null) => void;
|
|
10
11
|
onChange?: (value: OptionValue | null) => void;
|
|
11
12
|
onSearch?: (value: string) => void;
|
|
@@ -14,6 +15,7 @@ export declare function useComboboxModel<T extends SelectOption>({ value, option
|
|
|
14
15
|
open: boolean;
|
|
15
16
|
displayValue: string;
|
|
16
17
|
options: T[];
|
|
18
|
+
isSelected: (option: T) => boolean;
|
|
17
19
|
changeOpen(next: boolean): void;
|
|
18
20
|
search(next: string, openOnInput: boolean): void;
|
|
19
21
|
select(option: T): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type CopyButtonSize = "xs" | "sm" | "md";
|
|
2
|
+
/** CopyButton takes ghost-button geometry for its size: an icon-only control is a square of the button
|
|
3
|
+
* height, a labelled one has the icon-side and label-side insets and the content gap. */
|
|
4
|
+
export declare function copyButtonGeometry(size: CopyButtonSize, labelled: boolean): {
|
|
5
|
+
height: 40 | 24 | 32;
|
|
6
|
+
radius: 10 | 12 | 8;
|
|
7
|
+
gap: 4;
|
|
8
|
+
width: 40 | 24 | 32 | undefined;
|
|
9
|
+
paddingStart: number;
|
|
10
|
+
paddingEnd: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type CopyButtonSize = "xs" | "sm" | "md";
|
|
2
|
+
/** CopyButton takes ghost-button geometry for its size: an icon-only control is a square of the button
|
|
3
|
+
* height, a labelled one has the icon-side and label-side insets and the content gap. */
|
|
4
|
+
export declare function copyButtonGeometry(size: CopyButtonSize, labelled: boolean): {
|
|
5
|
+
height: 40 | 24 | 32;
|
|
6
|
+
radius: 10 | 12 | 8;
|
|
7
|
+
gap: 4;
|
|
8
|
+
width: 40 | 24 | 32 | undefined;
|
|
9
|
+
paddingStart: number;
|
|
10
|
+
paddingEnd: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type HeatCellMode = "diverging" | "sequential" | "price";
|
|
2
|
+
export type HeatCellColor = "brand" | "success" | "danger" | "warning";
|
|
3
|
+
/**
|
|
4
|
+
* How a heatmap cell is filled. `role` is the web colour role (`--_kjun-color-<role>`); Native maps it.
|
|
5
|
+
* Diverging and price cells measure the distance from `center` (the middle of min..max when left out) on one scale,
|
|
6
|
+
* the longer of the two sides, so the same strength means the same size on either side.
|
|
7
|
+
*/
|
|
8
|
+
export declare function heatCell(value: number | null | undefined, min: number, max: number, mode: HeatCellMode, color: HeatCellColor, center?: number | null): {
|
|
9
|
+
missing: true;
|
|
10
|
+
role: null;
|
|
11
|
+
magnitude: number;
|
|
12
|
+
opacity: number;
|
|
13
|
+
} | {
|
|
14
|
+
missing: false;
|
|
15
|
+
role: "price-up" | "price-down" | HeatCellColor;
|
|
16
|
+
magnitude: number;
|
|
17
|
+
opacity: number;
|
|
18
|
+
};
|
|
19
|
+
export type ProgressCellColor = "auto" | "brand" | "success" | "danger" | "warning" | "custom";
|
|
20
|
+
/**
|
|
21
|
+
* The bar's width and fill. `custom` is the app's colour when one applies: customColor with color "custom", or
|
|
22
|
+
* customColor alone (color left on "auto"). color "custom" without a customColor falls back to the auto colour.
|
|
23
|
+
*/
|
|
24
|
+
export declare function progressCellState<C>(value: number, max: number, color: ProgressCellColor, customColor?: C | null): {
|
|
25
|
+
percent: number;
|
|
26
|
+
rounded: number;
|
|
27
|
+
role: "brand" | "danger" | "success" | "warning";
|
|
28
|
+
custom: NonNullable<C> | undefined;
|
|
29
|
+
};
|
|
30
|
+
export type PriceFlash = boolean | "text" | "background";
|
|
31
|
+
/** Which way a price moved, for its flash; null when either side is not a finite number or nothing changed. */
|
|
32
|
+
export declare function priceFlashDirection(previous: number | null | undefined, next: number | null | undefined): "up" | "down" | null;
|
|
33
|
+
/** The flash's kind, or null when it is off. true means the text colour. */
|
|
34
|
+
export declare const priceFlashKind: (flash: PriceFlash | undefined) => "text" | "background" | null;
|
|
35
|
+
/** The web keyframe class for a flash (price-motion.css). */
|
|
36
|
+
export declare const priceFlashClass: (kind: "text" | "background", direction: "up" | "down") => string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type HeatCellMode = "diverging" | "sequential" | "price";
|
|
2
|
+
export type HeatCellColor = "brand" | "success" | "danger" | "warning";
|
|
3
|
+
/**
|
|
4
|
+
* How a heatmap cell is filled. `role` is the web colour role (`--_kjun-color-<role>`); Native maps it.
|
|
5
|
+
* Diverging and price cells measure the distance from `center` (the middle of min..max when left out) on one scale,
|
|
6
|
+
* the longer of the two sides, so the same strength means the same size on either side.
|
|
7
|
+
*/
|
|
8
|
+
export declare function heatCell(value: number | null | undefined, min: number, max: number, mode: HeatCellMode, color: HeatCellColor, center?: number | null): {
|
|
9
|
+
missing: true;
|
|
10
|
+
role: null;
|
|
11
|
+
magnitude: number;
|
|
12
|
+
opacity: number;
|
|
13
|
+
} | {
|
|
14
|
+
missing: false;
|
|
15
|
+
role: "price-up" | "price-down" | HeatCellColor;
|
|
16
|
+
magnitude: number;
|
|
17
|
+
opacity: number;
|
|
18
|
+
};
|
|
19
|
+
export type ProgressCellColor = "auto" | "brand" | "success" | "danger" | "warning" | "custom";
|
|
20
|
+
/**
|
|
21
|
+
* The bar's width and fill. `custom` is the app's colour when one applies: customColor with color "custom", or
|
|
22
|
+
* customColor alone (color left on "auto"). color "custom" without a customColor falls back to the auto colour.
|
|
23
|
+
*/
|
|
24
|
+
export declare function progressCellState<C>(value: number, max: number, color: ProgressCellColor, customColor?: C | null): {
|
|
25
|
+
percent: number;
|
|
26
|
+
rounded: number;
|
|
27
|
+
role: "brand" | "danger" | "success" | "warning";
|
|
28
|
+
custom: NonNullable<C> | undefined;
|
|
29
|
+
};
|
|
30
|
+
export type PriceFlash = boolean | "text" | "background";
|
|
31
|
+
/** Which way a price moved, for its flash; null when either side is not a finite number or nothing changed. */
|
|
32
|
+
export declare function priceFlashDirection(previous: number | null | undefined, next: number | null | undefined): "up" | "down" | null;
|
|
33
|
+
/** The flash's kind, or null when it is off. true means the text colour. */
|
|
34
|
+
export declare const priceFlashKind: (flash: PriceFlash | undefined) => "text" | "background" | null;
|
|
35
|
+
/** The web keyframe class for a flash (price-motion.css). */
|
|
36
|
+
export declare const priceFlashClass: (kind: "text" | "background", direction: "up" | "down") => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** True in a development build, where KJUN warns about misuse; bundlers replace NODE_ENV, and without it this is false. */
|
|
2
|
+
export declare function developmentMode(): boolean;
|
|
3
|
+
/** The warning for a FAB with neither a label nor an accessible name, or "" when it has one. */
|
|
4
|
+
export declare function fabNameWarning(label: unknown, ariaLabel: unknown): "" | "[KJUN] KjunFab needs a label or ariaLabel: an icon alone gives the button no name.";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** True in a development build, where KJUN warns about misuse; bundlers replace NODE_ENV, and without it this is false. */
|
|
2
|
+
export declare function developmentMode(): boolean;
|
|
3
|
+
/** The warning for a FAB with neither a label nor an accessible name, or "" when it has one. */
|
|
4
|
+
export declare function fabNameWarning(label: unknown, ariaLabel: unknown): "" | "[KJUN] KjunFab needs a label or ariaLabel: an icon alone gives the button no name.";
|
|
@@ -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;
|
|
@@ -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;
|