@k2b/ui 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/content/DataTable.js +25 -10
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/inputs/MultiSelectInput.js +258 -174
- package/dist/browser/inputs/MultiSelectInput.js.map +1 -1
- package/dist/browser/inputs/choice.js +27 -0
- package/dist/browser/inputs/choice.js.map +1 -1
- package/dist/browser/intl/messages.js +6 -0
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/surfaces/Placeholder.js +3 -0
- package/dist/browser/surfaces/Placeholder.js.map +1 -1
- package/dist/ssr/content/DataTable.js +25 -10
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/inputs/MultiSelectInput.js +87 -42
- package/dist/ssr/inputs/MultiSelectInput.js.map +1 -1
- package/dist/ssr/inputs/choice.js +27 -0
- package/dist/ssr/inputs/choice.js.map +1 -1
- package/dist/ssr/intl/messages.js +6 -0
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/surfaces/Placeholder.js +3 -0
- package/dist/ssr/surfaces/Placeholder.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/inputs/choice.d.ts +12 -0
- package/dist/types/intl/messages.d.ts +3 -0
- package/dist/types/surfaces/Placeholder.d.ts +2 -1
- package/package.json +1 -1
|
@@ -12,6 +12,18 @@ export type ChoiceOption<T extends string = string> = {
|
|
|
12
12
|
export type ChoiceOptionsLoader<T extends string = string> = (query: string, signal: AbortSignal) => Promise<readonly ChoiceOption<T>[]>;
|
|
13
13
|
export declare const filterChoiceOptions: <T extends string>(options: readonly ChoiceOption<T>[], query: string) => readonly ChoiceOption<T>[];
|
|
14
14
|
export declare const nextEnabledChoiceIndex: <T extends string>(options: readonly ChoiceOption<T>[], current: number, direction: 1 | -1) => number;
|
|
15
|
+
/**
|
|
16
|
+
* Counts the leading pills that fit into `available` pixels and measures the
|
|
17
|
+
* whole row. When not all of them fit, the rest collapse into a summary pill
|
|
18
|
+
* of width `more`; the first pill always stays and truncates when even it does
|
|
19
|
+
* not fit. Without a measured width (no layout yet) every pill stays. Half a
|
|
20
|
+
* pixel of slack absorbs layout rounding, so a row given exactly its own
|
|
21
|
+
* `rowWidth` always fits.
|
|
22
|
+
*/
|
|
23
|
+
export declare const fitChoicePills: (available: number, widths: readonly number[], gap: number, more: number) => {
|
|
24
|
+
visible: number;
|
|
25
|
+
rowWidth: number;
|
|
26
|
+
};
|
|
15
27
|
export declare function createChoiceLoader<T extends string>(loader: () => ChoiceOptionsLoader<T> | undefined, debounceMs: () => number): {
|
|
16
28
|
options: () => readonly ChoiceOption<T>[];
|
|
17
29
|
loading: () => boolean;
|
|
@@ -2,7 +2,8 @@ import { type JSX } from "solid-js";
|
|
|
2
2
|
export type PlaceholderAlign = "center" | "left";
|
|
3
3
|
export type PlaceholderSurface = "none" | "paper";
|
|
4
4
|
export type PlaceholderState = "empty" | "loading" | "error";
|
|
5
|
-
|
|
5
|
+
/** `compact` stacks inside a section, `inline` is one row in a list or sidebar, `panel` fills a work area. */
|
|
6
|
+
export type PlaceholderVariant = "compact" | "inline" | "panel";
|
|
6
7
|
export type PlaceholderProps = {
|
|
7
8
|
title?: JSX.Element;
|
|
8
9
|
description?: JSX.Element;
|