@k2b/ui 0.9.1 → 0.10.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/actions/Button.js +15 -7
- package/dist/browser/actions/Button.js.map +1 -1
- package/dist/browser/actions/ContextMenu.js +55 -15
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +39 -15
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/FilterChip.js +1 -7
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/actions/SplitButton.js +0 -3
- package/dist/browser/actions/SplitButton.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +78 -91
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatContextPopup.js +47 -21
- package/dist/browser/chat/ChatContextPopup.js.map +1 -1
- package/dist/browser/chat/ChatPrimitives.js +221 -232
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/chat/index.js +3 -2
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/content/Chart.js +99 -106
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/ChartExplorer.js +3 -6
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/FileBrowser.js +1 -1
- package/dist/browser/content/FileBrowser.js.map +1 -1
- package/dist/browser/content/FileTree.js +1 -1
- package/dist/browser/content/FileTree.js.map +1 -1
- package/dist/browser/content/FileView.js +304 -287
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/Lightbox.js +18 -0
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/PdfPreview.js +68 -43
- package/dist/browser/content/PdfPreview.js.map +1 -1
- package/dist/browser/content/ZoomPanViewport.js +51 -52
- package/dist/browser/content/ZoomPanViewport.js.map +1 -1
- package/dist/browser/feedback/HoverPreview.js +391 -0
- package/dist/browser/feedback/HoverPreview.js.map +1 -0
- package/dist/browser/feedback/Tooltip.js +50 -8
- package/dist/browser/feedback/Tooltip.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +21 -3
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/index.js +1 -0
- package/dist/browser/feedback/index.js.map +1 -1
- package/dist/browser/inputs/AutocompleteEditor.js +5 -4
- package/dist/browser/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/browser/inputs/DatePicker.js +10 -0
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/FileInputs.js +46 -36
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +2 -1
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/inputs/choice.js +5 -1
- package/dist/browser/inputs/choice.js.map +1 -1
- package/dist/browser/inputs/markdown/MarkdownEditor.js +173 -173
- package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/browser/inputs/markdown/Toolbar.js +31 -34
- package/dist/browser/inputs/markdown/Toolbar.js.map +1 -1
- package/dist/browser/internal/focus-return.js +61 -0
- package/dist/browser/internal/focus-return.js.map +1 -0
- package/dist/browser/layout/AppOverview.js +1 -1
- package/dist/browser/layout/AppOverview.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +16 -15
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/FloatingWindow.js +3 -1
- package/dist/browser/layout/FloatingWindow.js.map +1 -1
- package/dist/browser/layout/PanelDialog.js +10 -9
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/Panes.js +82 -81
- package/dist/browser/layout/Panes.js.map +1 -1
- package/dist/browser/layout/SidebarItemPreview.js +48 -136
- package/dist/browser/layout/SidebarItemPreview.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +5 -2
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/surfaces/ProgressBar.js.map +1 -1
- package/dist/browser/surfaces/ProgressRing.js +72 -0
- package/dist/browser/surfaces/ProgressRing.js.map +1 -0
- package/dist/browser/surfaces/index.js +1 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/Button.js +15 -7
- package/dist/ssr/actions/Button.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +55 -15
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +31 -12
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +1 -7
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/actions/SplitButton.js +0 -3
- package/dist/ssr/actions/SplitButton.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +61 -10
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatContextPopup.js +19 -5
- package/dist/ssr/chat/ChatContextPopup.js.map +1 -1
- package/dist/ssr/chat/ChatPrimitives.js +104 -74
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/chat/index.js +3 -2
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/content/Chart.js +22 -11
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/ChartExplorer.js +3 -6
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/FileBrowser.js +1 -1
- package/dist/ssr/content/FileBrowser.js.map +1 -1
- package/dist/ssr/content/FileTree.js +1 -1
- package/dist/ssr/content/FileTree.js.map +1 -1
- package/dist/ssr/content/FileView.js +105 -33
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +17 -0
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/PdfPreview.js +44 -14
- package/dist/ssr/content/PdfPreview.js.map +1 -1
- package/dist/ssr/content/ZoomPanViewport.js +11 -3
- package/dist/ssr/content/ZoomPanViewport.js.map +1 -1
- package/dist/ssr/feedback/HoverPreview.js +360 -0
- package/dist/ssr/feedback/HoverPreview.js.map +1 -0
- package/dist/ssr/feedback/Tooltip.js +50 -8
- package/dist/ssr/feedback/Tooltip.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +21 -3
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/index.js +1 -0
- package/dist/ssr/feedback/index.js.map +1 -1
- package/dist/ssr/inputs/AutocompleteEditor.js +5 -4
- package/dist/ssr/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/ssr/inputs/DatePicker.js +5 -0
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/FileInputs.js +29 -11
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +2 -1
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/inputs/choice.js +5 -1
- package/dist/ssr/inputs/choice.js.map +1 -1
- package/dist/ssr/inputs/markdown/MarkdownEditor.js +46 -10
- package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/ssr/inputs/markdown/Toolbar.js +30 -2
- package/dist/ssr/inputs/markdown/Toolbar.js.map +1 -1
- package/dist/ssr/internal/focus-return.js +61 -0
- package/dist/ssr/internal/focus-return.js.map +1 -0
- package/dist/ssr/layout/AppOverview.js +1 -1
- package/dist/ssr/layout/AppOverview.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +16 -15
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/FloatingWindow.js +3 -1
- package/dist/ssr/layout/FloatingWindow.js.map +1 -1
- package/dist/ssr/layout/PanelDialog.js +10 -9
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/Panes.js +39 -8
- package/dist/ssr/layout/Panes.js.map +1 -1
- package/dist/ssr/layout/SidebarItemPreview.js +36 -108
- package/dist/ssr/layout/SidebarItemPreview.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +5 -2
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/surfaces/ProgressBar.js.map +1 -1
- package/dist/ssr/surfaces/ProgressRing.js +31 -0
- package/dist/ssr/surfaces/ProgressRing.js.map +1 -0
- package/dist/ssr/surfaces/index.js +1 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Button.d.ts +5 -0
- package/dist/types/actions/Dropdown.d.ts +5 -1
- package/dist/types/actions/SplitButton.d.ts +1 -0
- package/dist/types/chat/ChatContextPopup.d.ts +8 -0
- package/dist/types/chat/index.d.ts +3 -2
- package/dist/types/feedback/HoverPreview.d.ts +83 -0
- package/dist/types/feedback/Tooltip.d.ts +6 -0
- package/dist/types/feedback/index.d.ts +2 -0
- package/dist/types/feedback/prompts.d.ts +9 -6
- package/dist/types/inputs/SelectChip.d.ts +1 -0
- package/dist/types/inputs/completion/overlay.d.ts +3 -1
- package/dist/types/internal/focus-return.d.ts +20 -0
- package/dist/types/intl/Format.d.ts +16 -8
- package/dist/types/layout/BottomSheet.d.ts +6 -1
- package/dist/types/layout/SidebarItemPreview.d.ts +1 -1
- package/dist/types/surfaces/ProgressBar.d.ts +1 -1
- package/dist/types/surfaces/ProgressRing.d.ts +13 -0
- package/dist/types/surfaces/index.d.ts +2 -0
- package/package.json +3 -2
|
@@ -43,5 +43,10 @@ export type IconButtonLinkProps = Omit<ButtonLinkProps, "children"> & {
|
|
|
43
43
|
children: JSX.Element;
|
|
44
44
|
label: string;
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* The native title is only the server-rendered, no-JavaScript hint; the
|
|
48
|
+
* hydrated tooltip removes it. Without a tooltip, an explicit title stays.
|
|
49
|
+
*/
|
|
50
|
+
export declare const iconTitle: (title: string | undefined, tooltip: JSX.Element | false | undefined) => string | undefined;
|
|
46
51
|
export declare function IconButton(props: IconButtonProps): JSX.Element;
|
|
47
52
|
export declare function IconButtonLink(props: IconButtonLinkProps): JSX.Element;
|
|
@@ -44,7 +44,11 @@ export type DropdownProps = {
|
|
|
44
44
|
position?: DropdownPosition | (() => DropdownPosition);
|
|
45
45
|
/** Larger menu rows and typography for touch. Defaults to `default`. */
|
|
46
46
|
variant?: "default" | "touch";
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Exact menu width as a CSS length. Without it the menu sizes to its longest
|
|
49
|
+
* entry: at least `12rem` (`18rem` for touch), at most the viewport width
|
|
50
|
+
* less `1rem` per side, where longer entries wrap.
|
|
51
|
+
*/
|
|
48
52
|
width?: string;
|
|
49
53
|
class?: string;
|
|
50
54
|
menuClass?: string;
|
|
@@ -13,6 +13,7 @@ export type SplitButtonProps = Omit<ButtonProps, "align"> & {
|
|
|
13
13
|
/** Accessible name and title for the icon-only menu trigger. */
|
|
14
14
|
menuLabel: string;
|
|
15
15
|
menuPosition?: DropdownPosition | (() => DropdownPosition);
|
|
16
|
+
/** Exact width of both menus as a CSS length. Without it the menus size to their entries. */
|
|
16
17
|
menuWidth?: string;
|
|
17
18
|
};
|
|
18
19
|
/** One primary button action with a separate menu of related alternatives. */
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
2
|
export type ChatContextPopupProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "content" | "ref" | "onClick" | "onPointerEnter" | "onPointerLeave"> & {
|
|
3
3
|
content: JSX.Element;
|
|
4
|
+
/** Runs each time the panel opens, for example to refresh its data. */
|
|
5
|
+
onOpen?: () => void;
|
|
4
6
|
};
|
|
7
|
+
export type ChatContextPanelProps = {
|
|
8
|
+
title: string;
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
/** Panel body shared by context details: a title, then progress, `dl` rows, and short `p` notes, grouped in `section`s when repeated. */
|
|
12
|
+
export declare function ChatContextPanel(props: ChatContextPanelProps): JSX.Element;
|
|
5
13
|
/** Context details support hover preview and deliberate click-to-pin without changing tooltip behavior. */
|
|
6
14
|
export declare function ChatContextPopup(props: ChatContextPopupProps): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { ChatContextPopupProps } from "./ChatContextPopup";
|
|
2
|
-
import { ChatContextPopup } from "./ChatContextPopup";
|
|
1
|
+
export type { ChatContextPanelProps, ChatContextPopupProps } from "./ChatContextPopup";
|
|
2
|
+
import { ChatContextPanel, ChatContextPopup } from "./ChatContextPopup";
|
|
3
3
|
import { ChatTasks } from "./ChatTasks";
|
|
4
4
|
export type { ChatTask, ChatTasksProps } from "./ChatTasks";
|
|
5
5
|
import { ChatComposer } from "./ChatComposer";
|
|
@@ -24,5 +24,6 @@ export declare const Chat: typeof ChatRoot & {
|
|
|
24
24
|
Composer: typeof ChatComposer;
|
|
25
25
|
ContextUsage: typeof ChatContextUsage;
|
|
26
26
|
ContextPopup: typeof ChatContextPopup;
|
|
27
|
+
ContextPanel: typeof ChatContextPanel;
|
|
27
28
|
};
|
|
28
29
|
export { reconcileChatMentions } from "./composer-document";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type Accessor, type JSX } from "solid-js";
|
|
2
|
+
/** Keys the wiring between a controller and its `<HoverPreview>`. */
|
|
3
|
+
declare const INTERNALS: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Where the card opens. By default it opens to the right of its anchor,
|
|
6
|
+
* centered on it or aligned with its bottom edge, and flips or clamps to stay
|
|
7
|
+
* in the viewport. With `beside`, it opens right of that region, such as a list
|
|
8
|
+
* column, top-aligned with the anchor and clamped into `within` (default: the
|
|
9
|
+
* viewport); when the card does not fit there, it does not open at all.
|
|
10
|
+
*/
|
|
11
|
+
export type HoverPreviewPlacement = {
|
|
12
|
+
align?: "center" | "end";
|
|
13
|
+
} | {
|
|
14
|
+
beside: () => HTMLElement | null | undefined;
|
|
15
|
+
within?: () => HTMLElement | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type HoverPreviewOptions<T> = {
|
|
18
|
+
/** Milliseconds a resting mouse waits on an anchor before the card opens. Defaults to 250. */
|
|
19
|
+
openDelay?: number;
|
|
20
|
+
/**
|
|
21
|
+
* How keyboard users open the card: `"space"` (default) toggles it with Space
|
|
22
|
+
* on the focused anchor and leaves focus there; `"focus"` opens it after the
|
|
23
|
+
* open delay whenever an anchor receives focus.
|
|
24
|
+
*/
|
|
25
|
+
keyboard?: "space" | "focus";
|
|
26
|
+
placement?: HoverPreviewPlacement;
|
|
27
|
+
/** Anchors whose value is disabled open no card; an open card closes once its value becomes disabled. */
|
|
28
|
+
disabled?: (value: T) => boolean;
|
|
29
|
+
/** Runs whenever the card opens or closes, including light dismissal by the browser. */
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
};
|
|
32
|
+
export type HoverPreviewController<T> = {
|
|
33
|
+
/** Id of the card element, for `aria-controls`. */
|
|
34
|
+
readonly id: string;
|
|
35
|
+
/**
|
|
36
|
+
* Registers an anchor element for `value`; use the result as a `ref`.
|
|
37
|
+
* `trigger` is the control that toggles the card for this anchor; Escape
|
|
38
|
+
* returns focus there when focus is inside the card. Defaults to the anchor.
|
|
39
|
+
*/
|
|
40
|
+
anchor: (value: T, trigger?: () => HTMLElement | null | undefined) => (element: HTMLElement) => void;
|
|
41
|
+
/** The value whose card is open, or `undefined` while closed. */
|
|
42
|
+
active: Accessor<T | undefined>;
|
|
43
|
+
/** Opens the card for `value` at once and moves focus into it, or closes it when it is already pinned open. */
|
|
44
|
+
toggle: (value: T) => void;
|
|
45
|
+
/** Closes the card; it reopens for the same anchor only after the pointer left it. */
|
|
46
|
+
close: () => void;
|
|
47
|
+
/** Wiring for `<HoverPreview>`; not part of the public contract. */
|
|
48
|
+
readonly [INTERNALS]: Internals<T>;
|
|
49
|
+
};
|
|
50
|
+
type Anchor<T> = {
|
|
51
|
+
value: T;
|
|
52
|
+
element: HTMLElement;
|
|
53
|
+
trigger?: () => HTMLElement | null | undefined;
|
|
54
|
+
};
|
|
55
|
+
type Internals<T> = {
|
|
56
|
+
current: Accessor<Anchor<T> | undefined>;
|
|
57
|
+
bind: (surface: HTMLElement) => void;
|
|
58
|
+
enterSurface: () => void;
|
|
59
|
+
leave: () => void;
|
|
60
|
+
focusOut: (event: FocusEvent) => void;
|
|
61
|
+
toggled: (open: boolean) => void;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Creates the behavior of one hover preview card shared by a group of anchors,
|
|
65
|
+
* such as the rows of a list. Render the card with `<HoverPreview preview={…}>`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function createHoverPreview<T>(options?: HoverPreviewOptions<T>): HoverPreviewController<T>;
|
|
68
|
+
export type HoverPreviewProps<T> = {
|
|
69
|
+
preview: HoverPreviewController<T>;
|
|
70
|
+
/** Accessible name of the card. */
|
|
71
|
+
label: string;
|
|
72
|
+
/** `"content"` (default) sizes the card to its content up to 32rem; `"fixed"` keeps one 22rem × 20rem box for every anchor. */
|
|
73
|
+
size?: "content" | "fixed";
|
|
74
|
+
class?: string;
|
|
75
|
+
/** Plain content stays mounted while the card is closed; a function renders the open anchor's value. */
|
|
76
|
+
children: JSX.Element | ((value: T) => JSX.Element);
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* A non-modal card that opens beside the anchor a resting mouse points at.
|
|
80
|
+
* Native popover owns the top layer and light dismissal.
|
|
81
|
+
*/
|
|
82
|
+
export declare function HoverPreview<T>(props: HoverPreviewProps<T>): JSX.Element;
|
|
83
|
+
export {};
|
|
@@ -9,6 +9,12 @@ export type TooltipProps = {
|
|
|
9
9
|
};
|
|
10
10
|
export type TooltipAnchorProps = Omit<JSX.HTMLAttributes<HTMLSpanElement>, "content"> & Omit<TooltipProps, "target">;
|
|
11
11
|
export type TooltipTriggerProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "content"> & Omit<TooltipProps, "target">;
|
|
12
|
+
/**
|
|
13
|
+
* The hint an icon-only control shows by default: its label, unless the caller
|
|
14
|
+
* passes its own `tooltip` (or `false`) or an enclosing Tooltip.Anchor already
|
|
15
|
+
* owns the hint.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useLabelTooltip: (tooltip: () => JSX.Element | false | undefined, label: () => string | undefined) => () => JSX.Element | false | undefined;
|
|
12
18
|
type TooltipComponent = ((props: TooltipProps) => JSX.Element) & {
|
|
13
19
|
Anchor: (props: TooltipAnchorProps) => JSX.Element;
|
|
14
20
|
Trigger: (props: TooltipTriggerProps) => JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { DialogClose, DialogCore, DialogRender, OpenDialogOptions } from "./dialog-core";
|
|
2
2
|
export { dialogCore } from "./dialog-core";
|
|
3
|
+
export type { HoverPreviewController, HoverPreviewOptions, HoverPreviewPlacement, HoverPreviewProps } from "./HoverPreview";
|
|
4
|
+
export { createHoverPreview, HoverPreview } from "./HoverPreview";
|
|
3
5
|
export type { InlineGuidanceProps } from "./InlineGuidance";
|
|
4
6
|
export { default as InlineGuidance } from "./InlineGuidance";
|
|
5
7
|
export type { ConfirmOptions, DialogOptions, FieldSchema, PromptFieldBase, PromptSearchInput, PromptSearchItem, PromptSearchOptions, } from "./prompts";
|
|
@@ -150,18 +150,21 @@ export declare const DialogHeader: (props: {
|
|
|
150
150
|
icon?: string;
|
|
151
151
|
}) => JSX.Element;
|
|
152
152
|
type CloudSearchResolver<T> = (input: PromptSearchInput) => Promise<PromptSearchItem<T>[]> | PromptSearchItem<T>[];
|
|
153
|
+
declare const openSearchPrompt: <T extends unknown = unknown>(resolver: CloudSearchResolver<T>, options?: PromptSearchOptions) => Promise<PromptSearchItem<T> | undefined>;
|
|
154
|
+
declare const promptText: (content: string, defaultValue?: string, options?: DialogOptions) => Promise<string | null>;
|
|
155
|
+
declare const promptNumber: (content: string, defaultValue?: number, options?: DialogOptions & {
|
|
156
|
+
min?: number;
|
|
157
|
+
max?: number;
|
|
158
|
+
}) => Promise<number | null>;
|
|
153
159
|
export declare const prompts: {
|
|
154
160
|
alert: (content: PromptContent, options?: DialogOptions) => Promise<void | undefined>;
|
|
155
161
|
success: (content: PromptContent, options?: Omit<DialogOptions, "variant">) => Promise<void | undefined>;
|
|
156
162
|
confirm: (content: PromptContent, options?: ConfirmOptions) => Promise<boolean | undefined>;
|
|
157
|
-
prompt:
|
|
158
|
-
promptNumber:
|
|
159
|
-
min?: number;
|
|
160
|
-
max?: number;
|
|
161
|
-
}) => Promise<number | null>;
|
|
163
|
+
prompt: typeof promptText;
|
|
164
|
+
promptNumber: typeof promptNumber;
|
|
162
165
|
form: <T extends Record<string, FieldSchema>>(config: PromptFormOptions<T>) => Promise<InferFormValues<T> | null>;
|
|
163
166
|
dialog: <T extends unknown = unknown>(component: (close: (result?: T) => void) => JSX.Element, options?: DialogOptions) => Promise<T | undefined>;
|
|
164
|
-
search:
|
|
167
|
+
search: typeof openSearchPrompt;
|
|
165
168
|
error: (content: string | HTMLElement, options?: DialogOptions) => Promise<unknown>;
|
|
166
169
|
};
|
|
167
170
|
export {};
|
|
@@ -18,6 +18,7 @@ export type SelectChipProps<T extends string | number = string> = ValueFieldProp
|
|
|
18
18
|
size?: ButtonSize;
|
|
19
19
|
placeholder?: string;
|
|
20
20
|
position?: DropdownPosition;
|
|
21
|
+
/** Exact menu width as a CSS length. Without it the menu sizes to its options, at least `10rem`. */
|
|
21
22
|
menuWidth?: string;
|
|
22
23
|
name?: string;
|
|
23
24
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
declare const escapeHtml: (value: string) => string;
|
|
2
|
+
export declare const plainTextHighlight: typeof escapeHtml;
|
|
2
3
|
export type RenderOptions = {
|
|
3
4
|
ghost?: {
|
|
4
5
|
at: number;
|
|
@@ -9,3 +10,4 @@ export type RenderOptions = {
|
|
|
9
10
|
};
|
|
10
11
|
};
|
|
11
12
|
export declare const renderWithOverlay: (text: string, highlighter: (text: string) => string, options?: RenderOptions) => string;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlays return focus to the control that opened them, and the ring comes
|
|
3
|
+
* back only for a keyboard user: a pointer user gets focus back silently, a
|
|
4
|
+
* keyboard user keeps seeing where they are.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Read as an overlay opens, while its trigger still holds focus: whether the
|
|
8
|
+
* keyboard opened it. The trigger's ring answers before the first input.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ringOnReturn: (trigger: Element | null | undefined) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Moves focus back to `trigger`. It shows a ring when the keyboard opened the
|
|
13
|
+
* overlay (`openedByKeyboard`, what `ringOnReturn` reported as it opened) or
|
|
14
|
+
* worked it since, so a pointer open closed with Escape alone returns silently.
|
|
15
|
+
* Engines without the option focus as before.
|
|
16
|
+
*
|
|
17
|
+
* Call it before the overlay hides: a native popover or dialog that closes
|
|
18
|
+
* with focus inside restores it on its own, with a ring of the browser's choosing.
|
|
19
|
+
*/
|
|
20
|
+
export declare const returnFocus: (trigger: HTMLElement | null | undefined, openedByKeyboard: boolean) => void;
|
|
@@ -67,6 +67,14 @@ export type FormatDurationMsProps = TimeElementProps & LocaleProp & FallbackProp
|
|
|
67
67
|
/** Duration in milliseconds. */
|
|
68
68
|
value: number | null | undefined;
|
|
69
69
|
};
|
|
70
|
+
declare const FormatNumber: (props: FormatNumberProps) => JSX.Element;
|
|
71
|
+
declare const FormatPercent: (props: FormatPercentProps) => JSX.Element;
|
|
72
|
+
declare const FormatCurrency: (props: FormatCurrencyProps) => JSX.Element;
|
|
73
|
+
declare const FormatBytes: (props: FormatBytesProps) => JSX.Element;
|
|
74
|
+
declare const FormatRelativeTime: (props: FormatRelativeTimeProps) => JSX.Element;
|
|
75
|
+
declare const FormatRelativeDate: (props: FormatRelativeDateProps) => JSX.Element;
|
|
76
|
+
declare const FormatDuration: (props: FormatDurationProps) => JSX.Element;
|
|
77
|
+
declare const FormatDurationMs: (props: FormatDurationMsProps) => JSX.Element;
|
|
70
78
|
/**
|
|
71
79
|
* Unstyled semantic formatter components backed by `@k2b/stdlib`.
|
|
72
80
|
*
|
|
@@ -78,16 +86,16 @@ export type FormatDurationMsProps = TimeElementProps & LocaleProp & FallbackProp
|
|
|
78
86
|
* with the runtime timezone.
|
|
79
87
|
*/
|
|
80
88
|
export declare const Format: {
|
|
81
|
-
readonly Number:
|
|
82
|
-
readonly Percent:
|
|
83
|
-
readonly Currency:
|
|
84
|
-
readonly Bytes:
|
|
89
|
+
readonly Number: typeof FormatNumber;
|
|
90
|
+
readonly Percent: typeof FormatPercent;
|
|
91
|
+
readonly Currency: typeof FormatCurrency;
|
|
92
|
+
readonly Bytes: typeof FormatBytes;
|
|
85
93
|
readonly Date: (props: FormatDateProps) => JSX.Element;
|
|
86
94
|
readonly Time: (props: FormatDateProps) => JSX.Element;
|
|
87
95
|
readonly DateTime: (props: FormatDateProps) => JSX.Element;
|
|
88
|
-
readonly RelativeTime:
|
|
89
|
-
readonly RelativeDate:
|
|
90
|
-
readonly Duration:
|
|
91
|
-
readonly DurationMs:
|
|
96
|
+
readonly RelativeTime: typeof FormatRelativeTime;
|
|
97
|
+
readonly RelativeDate: typeof FormatRelativeDate;
|
|
98
|
+
readonly Duration: typeof FormatDuration;
|
|
99
|
+
readonly DurationMs: typeof FormatDurationMs;
|
|
92
100
|
};
|
|
93
101
|
export {};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
|
+
/** Initial focus goes to the first input of the top sheet, otherwise to the
|
|
3
|
+
* dialog element itself. Native `showModal()` focuses the first focusable
|
|
4
|
+
* descendant, which is the drag handle; iOS shows a ring for that programmatic
|
|
5
|
+
* focus, so the sheet moves it to the ring-less dialog before the next paint. */
|
|
6
|
+
declare const sheetInitialFocus: (dialog: HTMLDialogElement) => HTMLElement;
|
|
2
7
|
export declare const bottomSheetOptions: {
|
|
3
8
|
panelClassName: string;
|
|
4
9
|
contentClassName: string;
|
|
5
|
-
initialFocus:
|
|
10
|
+
initialFocus: typeof sheetInitialFocus;
|
|
6
11
|
};
|
|
7
12
|
export type BottomSheetProps = {
|
|
8
13
|
children: JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
2
|
import { type ScrollAreaProps } from "./ScrollArea";
|
|
3
|
-
/** A non-modal, interactive row preview
|
|
3
|
+
/** A non-modal, interactive row preview built on the shared hover preview card. */
|
|
4
4
|
export declare function SidebarItemPreview(props: {
|
|
5
5
|
label: string;
|
|
6
6
|
children: JSX.Element | ((close: () => void) => JSX.Element);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JSX } from "solid-js";
|
|
2
2
|
import type { IntentTone } from "../semantics";
|
|
3
|
-
export type ProgressBarTone = Extract<IntentTone, "info" | "success" | "danger">;
|
|
3
|
+
export type ProgressBarTone = Extract<IntentTone, "info" | "success" | "warning" | "danger">;
|
|
4
4
|
export type ProgressBarProps = {
|
|
5
5
|
value: number;
|
|
6
6
|
size?: "xs" | "sm" | "md";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { IntentTone } from "../semantics";
|
|
3
|
+
export type ProgressRingTone = Extract<IntentTone, "info" | "warning" | "danger">;
|
|
4
|
+
export type ProgressRingProps = {
|
|
5
|
+
value: number;
|
|
6
|
+
tone?: ProgressRingTone;
|
|
7
|
+
/** Names the ring as a progressbar. Omit it inside a control that already carries the name and value. */
|
|
8
|
+
label?: string;
|
|
9
|
+
class?: string;
|
|
10
|
+
};
|
|
11
|
+
/** Compact determinate ring without a number. Warning and danger add a centre mark, so tone is never colour alone. */
|
|
12
|
+
export declare function ProgressRing(props: ProgressRingProps): JSX.Element;
|
|
13
|
+
export default ProgressRing;
|
|
@@ -14,6 +14,8 @@ export type { PlaceholderAlign, PlaceholderProps, PlaceholderState, PlaceholderS
|
|
|
14
14
|
export { default as Placeholder } from "./Placeholder";
|
|
15
15
|
export type { ProgressBarProps, ProgressBarTone } from "./ProgressBar";
|
|
16
16
|
export { ProgressBar } from "./ProgressBar";
|
|
17
|
+
export type { ProgressRingProps, ProgressRingTone } from "./ProgressRing";
|
|
18
|
+
export { ProgressRing } from "./ProgressRing";
|
|
17
19
|
export type { StatCellAccent, StatCellProps, StatCellTone } from "./StatCell";
|
|
18
20
|
export { StatCell } from "./StatCell";
|
|
19
21
|
export type { StatGridAction, StatGridColumns, StatGridProps, StatGridSize, StatGridSurface, } from "./StatGrid";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k2b/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Production-ready components for SolidJS applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
"seroval": "1.6.7",
|
|
67
67
|
"solid-js": "1.9.15",
|
|
68
68
|
"tailwindcss": "4.3.3",
|
|
69
|
-
"typescript": "
|
|
69
|
+
"typescript": "7.0.2",
|
|
70
|
+
"@typescript/typescript6": "6.0.2"
|
|
70
71
|
},
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"access": "public"
|