@k2b/ui 0.33.0 → 0.34.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/base.css +14 -1
- package/dist/browser/actions/ContextMenu.js +13 -0
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +15 -4
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/SelectionToolbar.js +129 -0
- package/dist/browser/actions/SelectionToolbar.js.map +1 -0
- package/dist/browser/actions/index.js +1 -0
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/charts.js +6 -0
- package/dist/browser/charts.js.map +1 -0
- package/dist/browser/chat/ChatComposer.js +525 -407
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +4 -0
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/composer-document.js +19 -0
- package/dist/browser/chat/composer-document.js.map +1 -1
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/content/Chart.js +8 -0
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/FileGrid.js +231 -9
- package/dist/browser/content/FileGrid.js.map +1 -1
- package/dist/browser/content/FileTypeIcon.js +15 -0
- package/dist/browser/content/FileTypeIcon.js.map +1 -1
- package/dist/browser/content/FileView.js +11 -4
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/MessageRow.js +73 -53
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/ReactionBar.js +3 -1
- package/dist/browser/content/ReactionBar.js.map +1 -1
- package/dist/browser/content/calendar-day-scroll.js +4 -3
- package/dist/browser/content/calendar-day-scroll.js.map +1 -1
- package/dist/browser/content/chart-bar.js +476 -0
- package/dist/browser/content/chart-bar.js.map +1 -0
- package/dist/browser/content/file-list-messages.js +52 -0
- package/dist/browser/content/file-list-messages.js.map +1 -0
- package/dist/browser/content/index.js +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/Tooltip.js +31 -14
- package/dist/browser/feedback/Tooltip.js.map +1 -1
- package/dist/browser/inputs/ChoiceList.js +178 -0
- package/dist/browser/inputs/ChoiceList.js.map +1 -0
- package/dist/browser/inputs/ChoiceSlider.js +314 -0
- package/dist/browser/inputs/ChoiceSlider.js.map +1 -0
- package/dist/browser/inputs/ChoiceTiles.js +135 -0
- package/dist/browser/inputs/ChoiceTiles.js.map +1 -0
- package/dist/browser/inputs/ColorChoices.js +120 -0
- package/dist/browser/inputs/ColorChoices.js.map +1 -0
- package/dist/browser/inputs/QrScanner.js +95 -13
- package/dist/browser/inputs/QrScanner.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +15 -13
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/index.js +4 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/qr-messages.js +2 -0
- package/dist/browser/inputs/qr-messages.js.map +1 -1
- package/dist/browser/internal/radio-keys.js +13 -0
- package/dist/browser/internal/radio-keys.js.map +1 -0
- package/dist/browser/layout/AnchoredPopover.js +180 -0
- package/dist/browser/layout/AnchoredPopover.js.map +1 -0
- package/dist/browser/layout/AppWorkspace.js +155 -20
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +443 -333
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/MobileShell.js +21 -7
- package/dist/browser/layout/MobileShell.js.map +1 -1
- package/dist/browser/layout/Settings.js +283 -175
- package/dist/browser/layout/Settings.js.map +1 -1
- package/dist/browser/layout/SidebarRailHint.js +79 -0
- package/dist/browser/layout/SidebarRailHint.js.map +1 -0
- package/dist/browser/layout/SidebarSwitcher.js +79 -66
- package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
- package/dist/browser/layout/TabBar.js +18 -4
- package/dist/browser/layout/TabBar.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +11 -4
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/detail-panel-messages.js +4 -2
- package/dist/browser/layout/detail-panel-messages.js.map +1 -1
- package/dist/browser/layout/index.js +2 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/settings-messages.js +26 -2
- package/dist/browser/layout/settings-messages.js.map +1 -1
- package/dist/browser/surfaces/Avatar.js +2 -14
- package/dist/browser/surfaces/Avatar.js.map +1 -1
- package/dist/browser/surfaces/DotStrip.js +70 -0
- package/dist/browser/surfaces/DotStrip.js.map +1 -0
- package/dist/browser/surfaces/ProgressRing.js +3 -0
- package/dist/browser/surfaces/ProgressRing.js.map +1 -1
- package/dist/browser/surfaces/ResourceCard.js +125 -68
- package/dist/browser/surfaces/ResourceCard.js.map +1 -1
- package/dist/browser/surfaces/index.js +2 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/browser/surfaces/person-color.js +18 -0
- package/dist/browser/surfaces/person-color.js.map +1 -0
- package/dist/browser/surfaces/resource-messages.js +6 -2
- package/dist/browser/surfaces/resource-messages.js.map +1 -1
- package/dist/browser/widgets/Widget.js +3 -2
- package/dist/browser/widgets/Widget.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +9 -0
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +14 -4
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/SelectionToolbar.js +104 -0
- package/dist/ssr/actions/SelectionToolbar.js.map +1 -0
- package/dist/ssr/actions/index.js +1 -0
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/charts.js +6 -0
- package/dist/ssr/charts.js.map +1 -0
- package/dist/ssr/chat/ChatComposer.js +132 -53
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +4 -0
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/composer-document.js +19 -0
- package/dist/ssr/chat/composer-document.js.map +1 -1
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/content/Chart.js +8 -0
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/FileGrid.js +132 -5
- package/dist/ssr/content/FileGrid.js.map +1 -1
- package/dist/ssr/content/FileTypeIcon.js +15 -0
- package/dist/ssr/content/FileTypeIcon.js.map +1 -1
- package/dist/ssr/content/FileView.js +11 -4
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +16 -6
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/ReactionBar.js +3 -1
- package/dist/ssr/content/ReactionBar.js.map +1 -1
- package/dist/ssr/content/calendar-day-scroll.js +4 -3
- package/dist/ssr/content/calendar-day-scroll.js.map +1 -1
- package/dist/ssr/content/chart-bar.js +476 -0
- package/dist/ssr/content/chart-bar.js.map +1 -0
- package/dist/ssr/content/file-list-messages.js +52 -0
- package/dist/ssr/content/file-list-messages.js.map +1 -0
- package/dist/ssr/content/index.js +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/Tooltip.js +31 -14
- package/dist/ssr/feedback/Tooltip.js.map +1 -1
- package/dist/ssr/inputs/ChoiceList.js +95 -0
- package/dist/ssr/inputs/ChoiceList.js.map +1 -0
- package/dist/ssr/inputs/ChoiceSlider.js +191 -0
- package/dist/ssr/inputs/ChoiceSlider.js.map +1 -0
- package/dist/ssr/inputs/ChoiceTiles.js +61 -0
- package/dist/ssr/inputs/ChoiceTiles.js.map +1 -0
- package/dist/ssr/inputs/ColorChoices.js +60 -0
- package/dist/ssr/inputs/ColorChoices.js.map +1 -0
- package/dist/ssr/inputs/QrScanner.js +89 -10
- package/dist/ssr/inputs/QrScanner.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js +13 -1
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/index.js +4 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/qr-messages.js +2 -0
- package/dist/ssr/inputs/qr-messages.js.map +1 -1
- package/dist/ssr/internal/radio-keys.js +13 -0
- package/dist/ssr/internal/radio-keys.js.map +1 -0
- package/dist/ssr/layout/AnchoredPopover.js +142 -0
- package/dist/ssr/layout/AnchoredPopover.js.map +1 -0
- package/dist/ssr/layout/AppWorkspace.js +154 -20
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +181 -108
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/MobileShell.js +20 -6
- package/dist/ssr/layout/MobileShell.js.map +1 -1
- package/dist/ssr/layout/Settings.js +122 -45
- package/dist/ssr/layout/Settings.js.map +1 -1
- package/dist/ssr/layout/SidebarRailHint.js +79 -0
- package/dist/ssr/layout/SidebarRailHint.js.map +1 -0
- package/dist/ssr/layout/SidebarSwitcher.js +13 -3
- package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
- package/dist/ssr/layout/TabBar.js +11 -3
- package/dist/ssr/layout/TabBar.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +11 -4
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/detail-panel-messages.js +4 -2
- package/dist/ssr/layout/detail-panel-messages.js.map +1 -1
- package/dist/ssr/layout/index.js +2 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/settings-messages.js +26 -2
- package/dist/ssr/layout/settings-messages.js.map +1 -1
- package/dist/ssr/surfaces/Avatar.js +2 -14
- package/dist/ssr/surfaces/Avatar.js.map +1 -1
- package/dist/ssr/surfaces/DotStrip.js +31 -0
- package/dist/ssr/surfaces/DotStrip.js.map +1 -0
- package/dist/ssr/surfaces/ProgressRing.js +3 -0
- package/dist/ssr/surfaces/ProgressRing.js.map +1 -1
- package/dist/ssr/surfaces/ResourceCard.js +40 -15
- package/dist/ssr/surfaces/ResourceCard.js.map +1 -1
- package/dist/ssr/surfaces/index.js +2 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/ssr/surfaces/person-color.js +18 -0
- package/dist/ssr/surfaces/person-color.js.map +1 -0
- package/dist/ssr/surfaces/resource-messages.js +6 -2
- package/dist/ssr/surfaces/resource-messages.js.map +1 -1
- package/dist/ssr/widgets/Widget.js +3 -2
- package/dist/ssr/widgets/Widget.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/ContextMenu.d.ts +5 -0
- package/dist/types/actions/Dropdown.d.ts +5 -0
- package/dist/types/actions/SelectionToolbar.d.ts +38 -0
- package/dist/types/actions/index.d.ts +2 -0
- package/dist/types/charts.d.ts +5 -0
- package/dist/types/chat/ChatComposer.d.ts +15 -0
- package/dist/types/chat/chat-messages.d.ts +2 -0
- package/dist/types/chat/composer-document.d.ts +5 -0
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/content/Chart.d.ts +2 -1
- package/dist/types/content/FileGrid.d.ts +43 -3
- package/dist/types/content/FileTypeIcon.d.ts +10 -0
- package/dist/types/content/FileView.d.ts +5 -1
- package/dist/types/content/MessageRow.d.ts +2 -0
- package/dist/types/content/calendar-day-scroll.d.ts +2 -1
- package/dist/types/content/chart-bar.d.ts +60 -0
- package/dist/types/content/file-list-messages.d.ts +24 -0
- package/dist/types/content/index.d.ts +2 -2
- package/dist/types/feedback/Tooltip.d.ts +8 -2
- package/dist/types/inputs/ChoiceList.d.ts +28 -0
- package/dist/types/inputs/ChoiceSlider.d.ts +36 -0
- package/dist/types/inputs/ChoiceTiles.d.ts +25 -0
- package/dist/types/inputs/ColorChoices.d.ts +19 -0
- package/dist/types/inputs/index.d.ts +8 -0
- package/dist/types/inputs/qr-messages.d.ts +1 -0
- package/dist/types/internal/radio-keys.d.ts +5 -0
- package/dist/types/layout/AnchoredPopover.d.ts +31 -0
- package/dist/types/layout/AppWorkspace.d.ts +10 -0
- package/dist/types/layout/DetailPanel.d.ts +17 -0
- package/dist/types/layout/MobileShell.d.ts +5 -2
- package/dist/types/layout/Settings.d.ts +22 -0
- package/dist/types/layout/SidebarRailHint.d.ts +26 -0
- package/dist/types/layout/TabBar.d.ts +5 -0
- package/dist/types/layout/detail-panel-messages.d.ts +1 -0
- package/dist/types/layout/index.d.ts +3 -2
- package/dist/types/layout/settings-messages.d.ts +12 -0
- package/dist/types/surfaces/DotStrip.d.ts +22 -0
- package/dist/types/surfaces/ProgressRing.d.ts +2 -1
- package/dist/types/surfaces/ResourceCard.d.ts +9 -0
- package/dist/types/surfaces/index.d.ts +4 -1
- package/dist/types/surfaces/person-color.d.ts +10 -0
- package/dist/types/surfaces/resource-messages.d.ts +2 -0
- package/dist/types/widgets/Widget.d.ts +3 -2
- package/package.json +6 -1
|
@@ -11,6 +11,11 @@ export type ContextMenuProps = {
|
|
|
11
11
|
onOpen?: () => void;
|
|
12
12
|
id?: string;
|
|
13
13
|
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Links, form fields, editable text, and selected text inside the host keep the browser's own menu, with its Copy,
|
|
16
|
+
* Paste, and Open link. Use it where the host wraps readable content rather than one row.
|
|
17
|
+
*/
|
|
18
|
+
keepNativeMenu?: boolean;
|
|
14
19
|
};
|
|
15
20
|
/** Right-click menu with keyboard invocation, one-open-at-a-time behavior, and viewport clamping. */
|
|
16
21
|
export declare function ContextMenu(props: ContextMenuProps): JSX.Element;
|
|
@@ -102,6 +102,11 @@ export type DropdownProps = {
|
|
|
102
102
|
* Defaults to `menu`. A controlled menu (`open`) always stays a menu.
|
|
103
103
|
*/
|
|
104
104
|
phone?: "menu" | "sheet";
|
|
105
|
+
/**
|
|
106
|
+
* Renders the entries only once the menu first opens, for a menu repeated on every row of a long list: the page
|
|
107
|
+
* then carries each row's trigger, not each row's entries. Fixed for the menu's lifetime.
|
|
108
|
+
*/
|
|
109
|
+
lazy?: boolean;
|
|
105
110
|
};
|
|
106
111
|
export type DropdownTriggerProps = Omit<ButtonProps, "aria-controls" | "aria-expanded" | "aria-haspopup" | "children" | "disabled" | "onClick" | "onKeyDown"> & {
|
|
107
112
|
children: JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export type SelectionToolbarProps = {
|
|
3
|
+
/**
|
|
4
|
+
* The selection's box in viewport coordinates, or nothing while the toolbar is closed. It is read again on every
|
|
5
|
+
* scroll and resize while the toolbar is open, so a function that measures the selection keeps it attached.
|
|
6
|
+
*/
|
|
7
|
+
anchor: () => DOMRect | null | undefined;
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* `above` (default) places the toolbar over the selection and below it when the space above is too small. `below`
|
|
11
|
+
* always places it below, for touch, where the system's own selection menu sits above.
|
|
12
|
+
*/
|
|
13
|
+
placement?: "above" | "below";
|
|
14
|
+
/** The area the toolbar stays in, such as the editor's scroll area under its toolbar: it goes below the selection when the space above inside this area is too small. */
|
|
15
|
+
boundary?: () => HTMLElement | null | undefined;
|
|
16
|
+
/** Escape inside the toolbar; the application closes it and returns focus to the text. */
|
|
17
|
+
onEscape?: () => void;
|
|
18
|
+
children: JSX.Element;
|
|
19
|
+
class?: string;
|
|
20
|
+
};
|
|
21
|
+
/** Where the toolbar goes for a selection box: centered on its first line, inside the viewport. */
|
|
22
|
+
export declare const selectionToolbarPosition: (anchor: Pick<DOMRect, "top" | "bottom" | "left" | "width">, toolbar: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}, viewport: {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
top?: number;
|
|
29
|
+
}, placement?: "above" | "below") => {
|
|
30
|
+
left: number;
|
|
31
|
+
top: number;
|
|
32
|
+
side: "above" | "below";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A toolbar that floats at a text selection, such as formatting and comment actions over selected text. It lies in
|
|
36
|
+
* the top layer, so no scroll container clips it, and pressing its buttons keeps the selection.
|
|
37
|
+
*/
|
|
38
|
+
export declare function SelectionToolbar(props: SelectionToolbarProps): JSX.Element;
|
|
@@ -18,6 +18,8 @@ export type { RemoveButtonProps } from "./RemoveButton";
|
|
|
18
18
|
export { RemoveButton } from "./RemoveButton";
|
|
19
19
|
export type { SegmentedControlProps, SegmentOption } from "./SegmentedControl";
|
|
20
20
|
export { SegmentedControl } from "./SegmentedControl";
|
|
21
|
+
export type { SelectionToolbarProps } from "./SelectionToolbar";
|
|
22
|
+
export { SelectionToolbar } from "./SelectionToolbar";
|
|
21
23
|
export type { SplitButtonProps } from "./SplitButton";
|
|
22
24
|
export { SplitButton } from "./SplitButton";
|
|
23
25
|
export type { SpotlightButtonProps, SpotlightButtonVariant, SpotlightSearchOptions, SpotlightSearchResolver, } from "./SpotlightSearch";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure chart renderers that share the `Chart` component's drawing without its Solid wrapper, for hosts that draw
|
|
3
|
+
* SVG themselves, such as server previews and app frames.
|
|
4
|
+
*/
|
|
5
|
+
export { type BarChartLayout, type BarChartOptions, barChartLayout, renderBarChartSvg } from "./content/chart-bar";
|
|
@@ -129,6 +129,17 @@ export type ChatFileSelection = {
|
|
|
129
129
|
disabled?: boolean;
|
|
130
130
|
label?: string;
|
|
131
131
|
};
|
|
132
|
+
/** A person `@` can mention: a member of the conversation, a person or an agent. */
|
|
133
|
+
export type ChatPersonSuggestion = {
|
|
134
|
+
id: string;
|
|
135
|
+
name: string;
|
|
136
|
+
agent?: boolean;
|
|
137
|
+
};
|
|
138
|
+
/** Suggests people for `@`; the composer inserts the chosen one as a mention named "@Name". */
|
|
139
|
+
export type ChatComposerPeople = {
|
|
140
|
+
/** At most 8 matches are shown; a rejection only means no suggestions. */
|
|
141
|
+
search: (query: string, signal: AbortSignal) => Promise<readonly ChatPersonSuggestion[]>;
|
|
142
|
+
};
|
|
132
143
|
export type ChatPasteHandler = (event: ClipboardEvent & {
|
|
133
144
|
currentTarget: HTMLTextAreaElement;
|
|
134
145
|
target: Element;
|
|
@@ -184,6 +195,8 @@ export type ChatComposerProps = {
|
|
|
184
195
|
}) => ChatCommand | undefined;
|
|
185
196
|
mentions?: readonly ChatMention[];
|
|
186
197
|
onMentionsChange?: (mentions: readonly ChatMention[]) => void;
|
|
198
|
+
/** Suggests people after `@`; needs `mentions` and `onMentionsChange`. */
|
|
199
|
+
people?: ChatComposerPeople;
|
|
187
200
|
/** Shared surface above the editor; suggestions temporarily replace this content. */
|
|
188
201
|
accessory?: JSX.Element;
|
|
189
202
|
contextUsage?: ChatContextUsageData;
|
|
@@ -200,6 +213,8 @@ export type ChatComposerProps = {
|
|
|
200
213
|
label?: string;
|
|
201
214
|
inputLabel?: string;
|
|
202
215
|
disabled?: boolean;
|
|
216
|
+
/** Keeps the draft editable but holds it back, such as while the chosen model cannot answer. */
|
|
217
|
+
submitDisabled?: boolean;
|
|
203
218
|
error?: string;
|
|
204
219
|
focusToken?: unknown;
|
|
205
220
|
draftKey?: unknown;
|
|
@@ -118,6 +118,8 @@ export declare const chatMessages: import("@k2b/stdlib").Catalog<{
|
|
|
118
118
|
composerFormatting: string;
|
|
119
119
|
insertEmoji: string;
|
|
120
120
|
emojiSuggestions: string;
|
|
121
|
+
peopleSuggestions: string;
|
|
122
|
+
agentLabel: string;
|
|
121
123
|
dictate: string;
|
|
122
124
|
dictateOrHold: string;
|
|
123
125
|
stopDictation: string;
|
|
@@ -6,6 +6,11 @@ export type ChatCommandQuery = {
|
|
|
6
6
|
};
|
|
7
7
|
/** Only the token at the caret; URLs, paths and inline/fenced code are ordinary text. */
|
|
8
8
|
export declare function chatCommandQuery(text: string, caret: number, selectionEnd?: number): ChatCommandQuery | null;
|
|
9
|
+
/**
|
|
10
|
+
* The `@name` being typed at the caret, for person suggestions: after the start, a space or an opening parenthesis,
|
|
11
|
+
* outside code and outside an existing mention. The query stops at whitespace, so "@Mar" suggests "Mara Schulz".
|
|
12
|
+
*/
|
|
13
|
+
export declare function chatPeopleQuery(text: string, caret: number, selectionEnd?: number, mentions?: readonly ChatMention[]): ChatCommandQuery | null;
|
|
9
14
|
/** An edit inside a mention removes its identity; edits around it shift the range. */
|
|
10
15
|
export declare function reconcileChatMentions(before: string, after: string, mentions: readonly ChatMention[]): ChatMention[];
|
|
11
16
|
export declare function chatMentionSegments(text: string, mentions: readonly ChatMention[]): {
|
|
@@ -7,7 +7,7 @@ import { ChatDecision, ChatMark, ChatOutcome } from "./ChatDecision";
|
|
|
7
7
|
import { ChatActivity, ChatActivityToggle, ChatContextUsage, ChatMessage } from "./ChatPrimitives";
|
|
8
8
|
import { ChatRoot } from "./ChatRoot";
|
|
9
9
|
import { ChatTimeline } from "./ChatTimeline";
|
|
10
|
-
export type { ChatCommand, ChatCommandContext, ChatCommandDraft, ChatCommandOpenResult, ChatCommandResult, ChatCommandScope, ChatCommandSearch, ChatCommandSection, ChatComposerProps, ChatComposerReply, ChatFileSelection, ChatPasteHandler, } from "./ChatComposer";
|
|
10
|
+
export type { ChatCommand, ChatCommandContext, ChatCommandDraft, ChatCommandOpenResult, ChatCommandResult, ChatCommandScope, ChatCommandSearch, ChatCommandSection, ChatComposerPeople, ChatComposerProps, ChatComposerReply, ChatFileSelection, ChatPasteHandler, ChatPersonSuggestion, } from "./ChatComposer";
|
|
11
11
|
export type { ChatDecisionProps, ChatMarkProps, ChatOutcomeProps, ChatPreviewExcerptProps, ChatPreviewHeaderProps, ChatPreviewLineProps, ChatPreviewPeopleProps, ChatPreviewProps, ChatPreviewReadMoreProps, ChatPreviewShowAllProps, ChatPreviewTitleProps, } from "./ChatDecision";
|
|
12
12
|
export type { ChatActivityProps, ChatActivityToggleProps, ChatContextUsageProps, ChatMessageProps } from "./ChatPrimitives";
|
|
13
13
|
export { formatChatTokens } from "./ChatPrimitives";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MapViewport } from "@k2b/stdlib";
|
|
2
2
|
import { charts } from "@k2b/stdlib";
|
|
3
3
|
import type { JSX } from "solid-js";
|
|
4
|
+
import { type BarChartOptions } from "./chart-bar";
|
|
4
5
|
import type { ChartCursor } from "./chart-cursor";
|
|
5
6
|
import { type ChartDatumRef, type ChartKind, type ChartSelection, type ChartTooltipFormatter } from "./chart-inspection-core";
|
|
6
7
|
import { type StateTimelineChartOptions, type StateTimelineDomain } from "./chart-state-timeline";
|
|
@@ -95,7 +96,7 @@ export type ChartProps = {
|
|
|
95
96
|
/** Largest connected X distance; positive, finite, without area/errorBand fills. */ maxGap?: number;
|
|
96
97
|
/** Wrap the legend above the plot inside the caller's total chart height. Requires legend=true. */
|
|
97
98
|
legendPlacement?: "top-start";
|
|
98
|
-
} : {}) & (K extends "stateTimeline" ? StateTimelineChartOptions : Omit<Parameters<(typeof charts)[K]>[0], "width" | "height" | "inspect">);
|
|
99
|
+
} : {}) & (K extends "stateTimeline" ? StateTimelineChartOptions : K extends "bar" ? BarChartOptions : Omit<Parameters<(typeof charts)[K]>[0], "width" | "height" | "inspect">);
|
|
99
100
|
}[ChartKind];
|
|
100
101
|
/** Pure renderer options: component layout, events and inspection are configured elsewhere. */
|
|
101
102
|
export type ChartRenderOptions = {
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
2
|
import type { CollectionSelection } from "./collection-selection";
|
|
3
|
-
|
|
3
|
+
/** One part of an open file list, such as its files as rows and its images as tiles. */
|
|
4
|
+
export type FileGridGroup<T> = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: JSX.Element;
|
|
7
|
+
rows: readonly T[];
|
|
8
|
+
/** `tiles` fills each item with its preview and lays the name over it. Defaults to `list`. */
|
|
9
|
+
layout?: "list" | "tiles";
|
|
10
|
+
};
|
|
11
|
+
type FileGridBaseProps<T> = {
|
|
4
12
|
rows: readonly T[];
|
|
5
13
|
getRowId: (row: T) => string;
|
|
6
|
-
selection: CollectionSelection;
|
|
7
14
|
label: string;
|
|
8
15
|
size?: "sm" | "md" | "lg";
|
|
9
16
|
/** `list` shows one compact row per item: preview, name, and meta beside each other. Defaults to `grid`. */
|
|
@@ -12,15 +19,48 @@ export type FileGridProps<T> = {
|
|
|
12
19
|
renderLabel: (row: T) => JSX.Element;
|
|
13
20
|
renderMeta?: (row: T) => JSX.Element;
|
|
14
21
|
renderActions?: (row: T) => JSX.Element;
|
|
15
|
-
|
|
22
|
+
/**
|
|
23
|
+
* `progressive` shows the actions on hover, keyboard focus, or an open menu with a mouse or trackpad, and always
|
|
24
|
+
* on touch. Their slot is reserved in both states, so nothing moves. Defaults to `always`.
|
|
25
|
+
*/
|
|
26
|
+
actionVisibility?: "always" | "progressive";
|
|
16
27
|
onOpen: (row: T) => void;
|
|
17
28
|
onContextMenu?: (row: T) => void;
|
|
18
29
|
/** Extra attributes for one tile, for example drag-and-drop handlers or data attributes the host styles. */
|
|
19
30
|
itemProps?: (row: T) => JSX.HTMLAttributes<HTMLDivElement>;
|
|
20
31
|
class?: string;
|
|
21
32
|
};
|
|
33
|
+
/** A browser or picker: items are selected, and Enter or a double click opens them. */
|
|
34
|
+
export type FileGridSelectableProps<T> = FileGridBaseProps<T> & {
|
|
35
|
+
selection: CollectionSelection;
|
|
36
|
+
onRowClick?: (row: T) => void;
|
|
37
|
+
limit?: never;
|
|
38
|
+
expanded?: never;
|
|
39
|
+
onExpandedChange?: never;
|
|
40
|
+
moreMeta?: never;
|
|
41
|
+
toolbar?: never;
|
|
42
|
+
groups?: never;
|
|
43
|
+
};
|
|
44
|
+
/** A list without selection, as in a details panel: one click on an item opens it. */
|
|
45
|
+
export type FileGridOpenProps<T> = FileGridBaseProps<T> & {
|
|
46
|
+
selection?: never;
|
|
47
|
+
onRowClick?: never;
|
|
48
|
+
/** Shows the first `limit` items, then "Show all N", which opens the full list in place. Without it, the list is always full. */
|
|
49
|
+
limit?: number;
|
|
50
|
+
/** Controls whether the full list is open. Without it, the list keeps its own state. */
|
|
51
|
+
expanded?: boolean;
|
|
52
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
53
|
+
/** A quiet note at the end of "Show all N", such as how many duplicates were merged. */
|
|
54
|
+
moreMeta?: JSX.Element;
|
|
55
|
+
/** Shown above the full list, such as a count, an arrangement switch, or "Download all"; not in the short list. */
|
|
56
|
+
toolbar?: JSX.Element;
|
|
57
|
+
/** How the full list arranges its items, such as files as rows, then images as tiles; the short list stays one list. */
|
|
58
|
+
groups?: (rows: readonly T[]) => readonly FileGridGroup<T>[];
|
|
59
|
+
};
|
|
60
|
+
export type FileGridProps<T> = FileGridSelectableProps<T> | FileGridOpenProps<T>;
|
|
22
61
|
/**
|
|
23
62
|
* File presentation only; the host owns data, menus, leases and permissions. Items the selection marks with
|
|
24
63
|
* `isDisabled` stay reachable by keyboard but cannot be selected or opened; say why in `renderMeta`.
|
|
25
64
|
*/
|
|
26
65
|
export declare function FileGrid<T>(props: FileGridProps<T>): JSX.Element;
|
|
66
|
+
export {};
|
|
@@ -20,6 +20,16 @@ export declare const fileTypeOf: (file: {
|
|
|
20
20
|
mediaType?: string;
|
|
21
21
|
folder?: boolean;
|
|
22
22
|
}) => FileType;
|
|
23
|
+
/**
|
|
24
|
+
* The readable kind of a file in `locale`, such as "PDF", "Image", or "Spreadsheet", for a meta line like
|
|
25
|
+
* "PDF · 4.2 MB" instead of a media type. An unknown kind names the file's extension ("ICC"), and a file without
|
|
26
|
+
* one reads "File".
|
|
27
|
+
*/
|
|
28
|
+
export declare const fileKindLabel: (file: {
|
|
29
|
+
name: string;
|
|
30
|
+
mediaType?: string;
|
|
31
|
+
folder?: boolean;
|
|
32
|
+
}, locale: string) => string;
|
|
23
33
|
/**
|
|
24
34
|
* A file or folder glyph in a soft chip of its type colour. Folders take the app accent hook
|
|
25
35
|
* `--k2b-app-workspace-active`; code, text, and unknown files a neutral ink. The box size is fixed per `size`.
|
|
@@ -76,5 +76,9 @@ export type FileViewRenderer = {
|
|
|
76
76
|
/** Text renderers that support the edit affordance when `save` is present. */
|
|
77
77
|
editable?: boolean;
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
/**
|
|
80
|
+
* A file size such as "4.2 MB". With `locale`, the number follows that language ("4,2 MB") and drops a trailing
|
|
81
|
+
* zero ("64 KB"); without it, the output stays as before.
|
|
82
|
+
*/
|
|
83
|
+
export declare const formatFileViewSize: (bytes: number, locale?: string) => string;
|
|
80
84
|
export default function FileView(props: FileViewProps): JSX.Element;
|
|
@@ -177,6 +177,8 @@ export type MessageEventRowProps = {
|
|
|
177
177
|
icon?: string;
|
|
178
178
|
/** Where the change belongs, such as its thread, where several threads mix. */
|
|
179
179
|
origin?: MessageRowOrigin;
|
|
180
|
+
/** Opens what the change is about, such as the commented passage; the sentence becomes the link. */
|
|
181
|
+
href?: string;
|
|
180
182
|
/** Visible time, formatted by the caller. */
|
|
181
183
|
time?: string;
|
|
182
184
|
dateTime?: string | Date;
|
|
@@ -42,6 +42,7 @@ export declare const wheelDelta: (axis: WheelAxis, deltaX: number, deltaY: numbe
|
|
|
42
42
|
/**
|
|
43
43
|
* The day start nearest to `position` in a strip of equal columns, or with `room` the nearer day edge at either end of
|
|
44
44
|
* the visible room; ties keep the start. A `heading` of 1 or -1 only looks ahead or back, for a scroll that brought
|
|
45
|
-
* something into view and must not slide back over it.
|
|
45
|
+
* something into view and must not slide back over it. The result is a whole pixel: a drawer can leave a fractional
|
|
46
|
+
* room, and WebKit drops the fraction of a scroll position, which would leave the strip short of the edge (#1713).
|
|
46
47
|
*/
|
|
47
48
|
export declare const snapToColumn: (position: number, width: number, room?: number, heading?: number) => number;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type AxisOptions, type BarItem, type ReferenceLine } from "@k2b/stdlib";
|
|
2
|
+
/**
|
|
3
|
+
* Bar chart options: stdlib's `charts.bar` options plus a title for the category axis and a separate value format.
|
|
4
|
+
* The wrapper owns size and inspection.
|
|
5
|
+
*/
|
|
6
|
+
export type BarChartOptions = {
|
|
7
|
+
data: BarItem[];
|
|
8
|
+
/** Value axis. `label` titles it, `format` writes its ticks and, without `valueFormat`, the printed values. */
|
|
9
|
+
yAxis?: AxisOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Category axis. `label` titles it. `ordered` marks categories that follow each other, such as days or steps: they
|
|
12
|
+
* stay columns, and only every n-th label shows when they would not fit, as on a time axis. Unordered categories each
|
|
13
|
+
* keep their label and turn into rows instead.
|
|
14
|
+
*/
|
|
15
|
+
xAxis?: {
|
|
16
|
+
label?: string;
|
|
17
|
+
ordered?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/** Writes printed values and tooltip values. Defaults to `yAxis.format`. */
|
|
20
|
+
valueFormat?: (value: number) => string;
|
|
21
|
+
colorByBar?: boolean;
|
|
22
|
+
references?: ReferenceLine[];
|
|
23
|
+
/** Print every value at its bar. Default: whenever the values stay readable; rows always print them. */
|
|
24
|
+
showValues?: boolean;
|
|
25
|
+
/** A legend of the bar colors; used only with `colorByBar` in columns, where labels sit below the plot. */
|
|
26
|
+
legend?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
subtitle?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The narrowest width in CSS pixels at which the drawing is shown; labels are laid out to fit it. Defaults to a
|
|
32
|
+
* 320px phone column. A host that draws at its measured width passes that width.
|
|
33
|
+
*/
|
|
34
|
+
displayWidth?: number;
|
|
35
|
+
/** Logical insets of the column layout. Rows place their labels and values themselves. */
|
|
36
|
+
padding?: number | {
|
|
37
|
+
top?: number;
|
|
38
|
+
right?: number;
|
|
39
|
+
bottom?: number;
|
|
40
|
+
left?: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type BarChartLayout = "columns" | "rows";
|
|
44
|
+
/** Estimated width of `text` at `size` pixels in the UI sans font with tabular figures; a little wide on purpose. */
|
|
45
|
+
export declare const chartTextWidth: (text: string, size?: number) => number;
|
|
46
|
+
/** The layout a bar chart takes and its logical height, so server and browser reserve the same box. */
|
|
47
|
+
export declare const barChartLayout: (opts: BarChartOptions, width?: number) => {
|
|
48
|
+
layout: BarChartLayout;
|
|
49
|
+
height: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Render a bar chart in which every category has its label. Few short labels stand below vertical columns; otherwise
|
|
53
|
+
* each category becomes a horizontal row with its label left of the bar and its value at the bar's end. Rows grow the
|
|
54
|
+
* drawing instead of dropping labels: use {@link barChartLayout} for its logical height.
|
|
55
|
+
*/
|
|
56
|
+
export declare const renderBarChartSvg: (opts: BarChartOptions & {
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
inspect?: boolean;
|
|
60
|
+
}) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** File kinds and list folding shared by `FileGrid` and `fileKindLabel`. */
|
|
2
|
+
declare const fileListMessages: import("@k2b/stdlib").Catalog<{
|
|
3
|
+
folder: string;
|
|
4
|
+
pdf: string;
|
|
5
|
+
image: string;
|
|
6
|
+
sheet: string;
|
|
7
|
+
document: string;
|
|
8
|
+
slides: string;
|
|
9
|
+
video: string;
|
|
10
|
+
audio: string;
|
|
11
|
+
archive: string;
|
|
12
|
+
file: string;
|
|
13
|
+
files: string;
|
|
14
|
+
images: string;
|
|
15
|
+
showAll: ({ count }: {
|
|
16
|
+
count: number;
|
|
17
|
+
}) => string;
|
|
18
|
+
showLess: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type FileListMessages = ReturnType<(typeof fileListMessages)["resolve"]>["t"];
|
|
21
|
+
export declare const resolveFileListMessages: (locale: string) => FileListMessages;
|
|
22
|
+
export declare const useFileListMessages: () => (() => FileListMessages);
|
|
23
|
+
export declare const checkFileListMessages: () => import("@k2b/stdlib").CatalogIssue[];
|
|
24
|
+
export {};
|
|
@@ -24,9 +24,9 @@ export { default as DataTable } from "./DataTable";
|
|
|
24
24
|
export type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from "./Docs";
|
|
25
25
|
export { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from "./Docs";
|
|
26
26
|
export { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from "./FileBrowser";
|
|
27
|
-
export { FileGrid, type FileGridProps } from "./FileGrid";
|
|
27
|
+
export { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from "./FileGrid";
|
|
28
28
|
export { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from "./FileTree";
|
|
29
|
-
export { type FileType, FileTypeIcon, type FileTypeIconProps, fileTypeOf } from "./FileTypeIcon";
|
|
29
|
+
export { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from "./FileTypeIcon";
|
|
30
30
|
export { canPreviewFile, default as FileView, type FileViewContent, type FileViewFile, type FileViewPreviewKind, type FileViewProps, type FileViewRenderer, type FileViewRendererProps, formatFileViewSize, getFileViewPreviewKind, } from "./FileView";
|
|
31
31
|
export type { KbdProps } from "./Kbd";
|
|
32
32
|
export { Kbd } from "./Kbd";
|
|
@@ -6,9 +6,15 @@ export type TooltipProps = {
|
|
|
6
6
|
placement?: TooltipPlacement;
|
|
7
7
|
delay?: number;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The element whose keyboard focus opens the hint, when a container holds
|
|
11
|
+
* the focus instead of `target` (a tree item around its row). Defaults to
|
|
12
|
+
* `target`.
|
|
13
|
+
*/
|
|
14
|
+
focusTarget?: () => HTMLElement | undefined;
|
|
9
15
|
};
|
|
10
|
-
export type TooltipAnchorProps = Omit<JSX.HTMLAttributes<HTMLSpanElement>, "content"> & Omit<TooltipProps, "target">;
|
|
11
|
-
export type TooltipTriggerProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "content"> & Omit<TooltipProps, "target">;
|
|
16
|
+
export type TooltipAnchorProps = Omit<JSX.HTMLAttributes<HTMLSpanElement>, "content"> & Omit<TooltipProps, "target" | "focusTarget">;
|
|
17
|
+
export type TooltipTriggerProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "content"> & Omit<TooltipProps, "target" | "focusTarget">;
|
|
12
18
|
/**
|
|
13
19
|
* The hint an icon-only control shows by default: its label, unless the caller
|
|
14
20
|
* passes its own `tooltip` (or `false`) or an enclosing Tooltip.Anchor already
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { ValueFieldProps } from "./field-contract";
|
|
3
|
+
export type ChoiceListOption<T extends string = string> = {
|
|
4
|
+
value: T;
|
|
5
|
+
label: string;
|
|
6
|
+
/** One sentence on what the choice means. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** A quiet tag after the label, such as "Default" for the choice that applies without one. */
|
|
9
|
+
marker?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ChoiceListProps<T extends string = string> = Omit<ValueFieldProps<T | null>, "onValueChange" | "onValueCommit"> & {
|
|
12
|
+
options: readonly ChoiceListOption<T>[];
|
|
13
|
+
/** The chosen value is being saved: a spinner beside its label, and the group is busy. Choosing again is still possible. */
|
|
14
|
+
busy?: boolean;
|
|
15
|
+
/** Busy spinner's name for screen readers, such as "Saving". */
|
|
16
|
+
busyLabel?: string;
|
|
17
|
+
/** Follow-up controls for the chosen option, shown under it and indented to its text, such as a duration. */
|
|
18
|
+
details?: JSX.Element;
|
|
19
|
+
onValueChange?: (value: T) => void;
|
|
20
|
+
onValueCommit?: (value: T) => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A labeled single choice shown as a short list of rows, each with a radio, a label and one sentence on what it
|
|
24
|
+
* means, for a few choices whose consequences need words. Choosing changes only paint, so no row moves; `details`
|
|
25
|
+
* opens under the chosen row. Use `ChoiceChips` for quick picks without explanation, `RichSelect` for longer lists
|
|
26
|
+
* in a dropdown, and `ChoiceTiles` when a preview decides.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ChoiceList<T extends string = string>(props: ChoiceListProps<T>): JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type MaybeAccessor } from "./field-contract";
|
|
3
|
+
export type ChoiceSliderOption = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** One short line shown below the label line while this stop is active. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Makes the stop unavailable. The text replaces the description when someone reaches the stop. */
|
|
9
|
+
disabledReason?: string;
|
|
10
|
+
/** Spoken value; defaults to the label and the description or reason. */
|
|
11
|
+
valueText?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ChoiceSliderProps = {
|
|
14
|
+
options: readonly ChoiceSliderOption[];
|
|
15
|
+
/** The chosen stop. `null` shows no thumb, for a choice that is none of the stops. */
|
|
16
|
+
value: MaybeAccessor<string | null>;
|
|
17
|
+
/** A person released the thumb on a stop or moved to one with the keyboard. */
|
|
18
|
+
onValueChange?: (value: string) => void;
|
|
19
|
+
/** The stop the slider shows while someone drags or arrows through it; `null` when it shows `value` again. */
|
|
20
|
+
onActiveChange?: (value: string | null) => void;
|
|
21
|
+
/** Line text while no stop is chosen. */
|
|
22
|
+
description?: string;
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
"aria-labelledby"?: string;
|
|
25
|
+
id?: string;
|
|
26
|
+
class?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** `lg` gives a 44 px track and a 28 px thumb for touch sheets. */
|
|
29
|
+
size?: "md" | "lg";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* A slider over a few named stops. The fixed line above the track always shows
|
|
33
|
+
* the active stop's description, or why a stop cannot be chosen; its height
|
|
34
|
+
* never changes. Unavailable stops stay visible and are skipped.
|
|
35
|
+
*/
|
|
36
|
+
export declare function ChoiceSlider(props: ChoiceSliderProps): JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { ValueFieldProps } from "./field-contract";
|
|
3
|
+
export type ChoiceTileOption<T extends string = string> = {
|
|
4
|
+
value: T;
|
|
5
|
+
label: string;
|
|
6
|
+
/** What the choice looks like, such as a preview image; decorative, the label names the choice. */
|
|
7
|
+
visual: JSX.Element;
|
|
8
|
+
/** A short state under the label, such as "Active"; keeps its line, so tiles never change height. */
|
|
9
|
+
status?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ChoiceTilesProps<T extends string = string> = Omit<ValueFieldProps<T | null>, "onValueChange" | "onValueCommit"> & {
|
|
12
|
+
options: readonly ChoiceTileOption<T>[];
|
|
13
|
+
/** `grid`: preview over label in as many columns as fit. `row`: preview beside label in one row, stacked on phones. */
|
|
14
|
+
layout?: "grid" | "row";
|
|
15
|
+
/** The choice is kept but has no visible effect right now; previews are dimmed, choosing still works. */
|
|
16
|
+
dimmed?: boolean;
|
|
17
|
+
onValueChange?: (value: T) => void;
|
|
18
|
+
onValueCommit?: (value: T) => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A labeled single choice shown as tiles with a preview, for picking how something looks: a face shape, a frame, a
|
|
22
|
+
* kind of picture. Every tile keeps its size when chosen, so nothing moves. Use `ChoiceChips` for text choices and
|
|
23
|
+
* `ColorChoices` for named colours.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ChoiceTiles<T extends string = string>(props: ChoiceTilesProps<T>): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { ValueFieldProps } from "./field-contract";
|
|
3
|
+
export type ColorChoiceOption<T extends string = string> = {
|
|
4
|
+
value: T;
|
|
5
|
+
/** The colour's name; screen readers and the tooltip use it, so colour is never the only signal. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Any CSS colour. */
|
|
8
|
+
color: string;
|
|
9
|
+
};
|
|
10
|
+
export type ColorChoicesProps<T extends string = string> = Omit<ValueFieldProps<T | null>, "onValueChange" | "onValueCommit"> & {
|
|
11
|
+
options: readonly ColorChoiceOption<T>[];
|
|
12
|
+
onValueChange?: (value: T) => void;
|
|
13
|
+
onValueCommit?: (value: T) => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A labeled single choice from a fixed palette of named colours, shown as round swatches. Use `ColorInput` when any
|
|
17
|
+
* colour is allowed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ColorChoices<T extends string = string>(props: ColorChoicesProps<T>): JSX.Element;
|
|
@@ -10,6 +10,14 @@ export type { ChoiceChipOption, ChoiceChipsProps } from "./ChoiceChips";
|
|
|
10
10
|
export { ChoiceChips } from "./ChoiceChips";
|
|
11
11
|
export type { ColorInputProps, PinInputProps, SliderProps, } from "./ChoiceInputs";
|
|
12
12
|
export { ColorInput, PinInput, Slider } from "./ChoiceInputs";
|
|
13
|
+
export type { ChoiceListOption, ChoiceListProps } from "./ChoiceList";
|
|
14
|
+
export { ChoiceList } from "./ChoiceList";
|
|
15
|
+
export type { ChoiceSliderOption, ChoiceSliderProps } from "./ChoiceSlider";
|
|
16
|
+
export { ChoiceSlider } from "./ChoiceSlider";
|
|
17
|
+
export type { ChoiceTileOption, ChoiceTilesProps } from "./ChoiceTiles";
|
|
18
|
+
export { ChoiceTiles } from "./ChoiceTiles";
|
|
19
|
+
export type { ColorChoiceOption, ColorChoicesProps } from "./ColorChoices";
|
|
20
|
+
export { ColorChoices } from "./ColorChoices";
|
|
13
21
|
export type { ComboboxOption, ComboboxProps } from "./Combobox";
|
|
14
22
|
export { Combobox } from "./Combobox";
|
|
15
23
|
export type { ChoiceOption, ChoiceOptionsLoader } from "./choice";
|
|
@@ -2,6 +2,7 @@ declare const qrMessages: import("@k2b/stdlib").Catalog<{
|
|
|
2
2
|
qrCameraPreview: string;
|
|
3
3
|
qrCameraStarting: string;
|
|
4
4
|
qrCameraInstructions: string;
|
|
5
|
+
qrCameraStalled: string;
|
|
5
6
|
qrCameraPrivacy: string;
|
|
6
7
|
}>;
|
|
7
8
|
export type QrMessages = ReturnType<(typeof qrMessages)["resolve"]>["t"];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Roving focus for a single-choice radio group: arrows move and select with wrapping, Home and End select the first
|
|
3
|
+
* and last option. Returns the index to select, or `undefined` for keys the group does not handle.
|
|
4
|
+
*/
|
|
5
|
+
export declare const radioKeyTarget: (key: string, index: number, count: number) => number | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export type AnchoredPopoverProps = {
|
|
3
|
+
/** The control the panel belongs to. The panel is open while this is set. */
|
|
4
|
+
anchor: HTMLElement | null | undefined;
|
|
5
|
+
/** Called on Escape, a click outside, another press of the anchor, and when the anchor leaves the page. */
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/** The panel's accessible name; it is a non-modal dialog. */
|
|
8
|
+
label: string;
|
|
9
|
+
children: JSX.Element;
|
|
10
|
+
/** Which edge lines up with the anchor. Defaults to `end`, like a menu at the end of a toolbar. */
|
|
11
|
+
align?: "start" | "end";
|
|
12
|
+
/** The side tried first; the panel flips only when the other side has more room. Defaults to `below`. */
|
|
13
|
+
side?: "below" | "above";
|
|
14
|
+
/**
|
|
15
|
+
* The tallest the panel gets while open, in px, such as a list it can switch to. The side is chosen for this height
|
|
16
|
+
* and kept, so a panel that grows never flips. Defaults to its height when it opens.
|
|
17
|
+
*/
|
|
18
|
+
plannedHeight?: number;
|
|
19
|
+
/** Width of the panel on wide screens, such as `21rem`. On a phone it is a bottom sheet across the screen. */
|
|
20
|
+
width?: string;
|
|
21
|
+
/** Moves the focus into the panel when it opens; defaults to the panel itself. */
|
|
22
|
+
initialFocus?: () => HTMLElement | null | undefined;
|
|
23
|
+
class?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A panel anchored to a control, for content that is more than a menu, such as a card with a slider. It opens on the
|
|
27
|
+
* side with room and keeps that side while open, so a panel that changes its content never jumps to the other side.
|
|
28
|
+
* Escape, a click outside and another press of the anchor close it; the focus returns to where it was. On a phone it
|
|
29
|
+
* is a bottom sheet.
|
|
30
|
+
*/
|
|
31
|
+
export declare function AnchoredPopover(props: AnchoredPopoverProps): JSX.Element;
|
|
@@ -100,6 +100,11 @@ export type AppWorkspaceMainPaneProps = {
|
|
|
100
100
|
resizable?: boolean;
|
|
101
101
|
resizeShadow?: boolean;
|
|
102
102
|
defaultSize?: number | AppWorkspaceWidthShare;
|
|
103
|
+
/**
|
|
104
|
+
* The narrowest width in px, also for a person resizing it. Levels mode: the level needs it to be shown; when the
|
|
105
|
+
* deepest levels do not fit side by side at their minimum widths, the shallowest of them gives way, so a wide list
|
|
106
|
+
* pushes earlier columns aside.
|
|
107
|
+
*/
|
|
103
108
|
minSize?: number;
|
|
104
109
|
maxSize?: number;
|
|
105
110
|
class?: string;
|
|
@@ -398,6 +403,11 @@ export type AppWorkspaceNavTreeItemProps = {
|
|
|
398
403
|
class?: string;
|
|
399
404
|
/** With the tree's `onMove`, the item can change its place among its siblings. Other items keep theirs, and no item moves past them. */
|
|
400
405
|
movable?: boolean;
|
|
406
|
+
/**
|
|
407
|
+
* Shows the item as a branch before its children are rendered, for a tree that loads a branch when it opens. The
|
|
408
|
+
* application renders the children, or a row that says they load, once the item is expanded.
|
|
409
|
+
*/
|
|
410
|
+
hasChildren?: boolean;
|
|
401
411
|
onDragEnter?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;
|
|
402
412
|
onDragOver?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;
|
|
403
413
|
onDragLeave?: JSX.EventHandlerUnion<HTMLDivElement, DragEvent>;
|