@k2b/ui 0.9.0 → 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.
Files changed (181) hide show
  1. package/dist/browser/actions/Button.js +15 -7
  2. package/dist/browser/actions/Button.js.map +1 -1
  3. package/dist/browser/actions/ContextMenu.js +55 -15
  4. package/dist/browser/actions/ContextMenu.js.map +1 -1
  5. package/dist/browser/actions/Dropdown.js +39 -15
  6. package/dist/browser/actions/Dropdown.js.map +1 -1
  7. package/dist/browser/actions/FilterChip.js +1 -7
  8. package/dist/browser/actions/FilterChip.js.map +1 -1
  9. package/dist/browser/actions/SplitButton.js +0 -3
  10. package/dist/browser/actions/SplitButton.js.map +1 -1
  11. package/dist/browser/chat/ChatComposer.js +78 -91
  12. package/dist/browser/chat/ChatComposer.js.map +1 -1
  13. package/dist/browser/chat/ChatContextPopup.js +47 -21
  14. package/dist/browser/chat/ChatContextPopup.js.map +1 -1
  15. package/dist/browser/chat/ChatPrimitives.js +221 -232
  16. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  17. package/dist/browser/chat/index.js +3 -2
  18. package/dist/browser/chat/index.js.map +1 -1
  19. package/dist/browser/content/Chart.js +99 -106
  20. package/dist/browser/content/Chart.js.map +1 -1
  21. package/dist/browser/content/ChartExplorer.js +3 -6
  22. package/dist/browser/content/ChartExplorer.js.map +1 -1
  23. package/dist/browser/content/FileBrowser.js +1 -1
  24. package/dist/browser/content/FileBrowser.js.map +1 -1
  25. package/dist/browser/content/FileTree.js +1 -1
  26. package/dist/browser/content/FileTree.js.map +1 -1
  27. package/dist/browser/content/FileView.js +304 -287
  28. package/dist/browser/content/FileView.js.map +1 -1
  29. package/dist/browser/content/Lightbox.js +18 -0
  30. package/dist/browser/content/Lightbox.js.map +1 -1
  31. package/dist/browser/content/MarkdownView.js +8 -1
  32. package/dist/browser/content/MarkdownView.js.map +1 -1
  33. package/dist/browser/content/PdfPreview.js +68 -43
  34. package/dist/browser/content/PdfPreview.js.map +1 -1
  35. package/dist/browser/content/ZoomPanViewport.js +51 -52
  36. package/dist/browser/content/ZoomPanViewport.js.map +1 -1
  37. package/dist/browser/feedback/HoverPreview.js +391 -0
  38. package/dist/browser/feedback/HoverPreview.js.map +1 -0
  39. package/dist/browser/feedback/Tooltip.js +50 -8
  40. package/dist/browser/feedback/Tooltip.js.map +1 -1
  41. package/dist/browser/feedback/dialog-core.js +21 -3
  42. package/dist/browser/feedback/dialog-core.js.map +1 -1
  43. package/dist/browser/feedback/index.js +1 -0
  44. package/dist/browser/feedback/index.js.map +1 -1
  45. package/dist/browser/inputs/AutocompleteEditor.js +5 -4
  46. package/dist/browser/inputs/AutocompleteEditor.js.map +1 -1
  47. package/dist/browser/inputs/DatePicker.js +10 -0
  48. package/dist/browser/inputs/DatePicker.js.map +1 -1
  49. package/dist/browser/inputs/FileInputs.js +46 -36
  50. package/dist/browser/inputs/FileInputs.js.map +1 -1
  51. package/dist/browser/inputs/SelectChip.js +2 -1
  52. package/dist/browser/inputs/SelectChip.js.map +1 -1
  53. package/dist/browser/inputs/choice.js +5 -1
  54. package/dist/browser/inputs/choice.js.map +1 -1
  55. package/dist/browser/inputs/markdown/MarkdownEditor.js +173 -173
  56. package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
  57. package/dist/browser/inputs/markdown/Toolbar.js +31 -34
  58. package/dist/browser/inputs/markdown/Toolbar.js.map +1 -1
  59. package/dist/browser/internal/focus-return.js +61 -0
  60. package/dist/browser/internal/focus-return.js.map +1 -0
  61. package/dist/browser/layout/AppOverview.js +1 -1
  62. package/dist/browser/layout/AppOverview.js.map +1 -1
  63. package/dist/browser/layout/DetailPanel.js +16 -15
  64. package/dist/browser/layout/DetailPanel.js.map +1 -1
  65. package/dist/browser/layout/FloatingWindow.js +3 -1
  66. package/dist/browser/layout/FloatingWindow.js.map +1 -1
  67. package/dist/browser/layout/PanelDialog.js +10 -9
  68. package/dist/browser/layout/PanelDialog.js.map +1 -1
  69. package/dist/browser/layout/Panes.js +82 -81
  70. package/dist/browser/layout/Panes.js.map +1 -1
  71. package/dist/browser/layout/SidebarItemPreview.js +48 -136
  72. package/dist/browser/layout/SidebarItemPreview.js.map +1 -1
  73. package/dist/browser/layout/app-workspace-controller.js +5 -2
  74. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  75. package/dist/browser/surfaces/ProgressBar.js.map +1 -1
  76. package/dist/browser/surfaces/ProgressRing.js +72 -0
  77. package/dist/browser/surfaces/ProgressRing.js.map +1 -0
  78. package/dist/browser/surfaces/index.js +1 -0
  79. package/dist/browser/surfaces/index.js.map +1 -1
  80. package/dist/ssr/actions/Button.js +15 -7
  81. package/dist/ssr/actions/Button.js.map +1 -1
  82. package/dist/ssr/actions/ContextMenu.js +55 -15
  83. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  84. package/dist/ssr/actions/Dropdown.js +31 -12
  85. package/dist/ssr/actions/Dropdown.js.map +1 -1
  86. package/dist/ssr/actions/FilterChip.js +1 -7
  87. package/dist/ssr/actions/FilterChip.js.map +1 -1
  88. package/dist/ssr/actions/SplitButton.js +0 -3
  89. package/dist/ssr/actions/SplitButton.js.map +1 -1
  90. package/dist/ssr/chat/ChatComposer.js +61 -10
  91. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  92. package/dist/ssr/chat/ChatContextPopup.js +19 -5
  93. package/dist/ssr/chat/ChatContextPopup.js.map +1 -1
  94. package/dist/ssr/chat/ChatPrimitives.js +104 -74
  95. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  96. package/dist/ssr/chat/index.js +3 -2
  97. package/dist/ssr/chat/index.js.map +1 -1
  98. package/dist/ssr/content/Chart.js +22 -11
  99. package/dist/ssr/content/Chart.js.map +1 -1
  100. package/dist/ssr/content/ChartExplorer.js +3 -6
  101. package/dist/ssr/content/ChartExplorer.js.map +1 -1
  102. package/dist/ssr/content/FileBrowser.js +1 -1
  103. package/dist/ssr/content/FileBrowser.js.map +1 -1
  104. package/dist/ssr/content/FileTree.js +1 -1
  105. package/dist/ssr/content/FileTree.js.map +1 -1
  106. package/dist/ssr/content/FileView.js +105 -33
  107. package/dist/ssr/content/FileView.js.map +1 -1
  108. package/dist/ssr/content/Lightbox.js +17 -0
  109. package/dist/ssr/content/Lightbox.js.map +1 -1
  110. package/dist/ssr/content/MarkdownView.js +8 -1
  111. package/dist/ssr/content/MarkdownView.js.map +1 -1
  112. package/dist/ssr/content/PdfPreview.js +44 -14
  113. package/dist/ssr/content/PdfPreview.js.map +1 -1
  114. package/dist/ssr/content/ZoomPanViewport.js +11 -3
  115. package/dist/ssr/content/ZoomPanViewport.js.map +1 -1
  116. package/dist/ssr/feedback/HoverPreview.js +360 -0
  117. package/dist/ssr/feedback/HoverPreview.js.map +1 -0
  118. package/dist/ssr/feedback/Tooltip.js +50 -8
  119. package/dist/ssr/feedback/Tooltip.js.map +1 -1
  120. package/dist/ssr/feedback/dialog-core.js +21 -3
  121. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  122. package/dist/ssr/feedback/index.js +1 -0
  123. package/dist/ssr/feedback/index.js.map +1 -1
  124. package/dist/ssr/inputs/AutocompleteEditor.js +5 -4
  125. package/dist/ssr/inputs/AutocompleteEditor.js.map +1 -1
  126. package/dist/ssr/inputs/DatePicker.js +5 -0
  127. package/dist/ssr/inputs/DatePicker.js.map +1 -1
  128. package/dist/ssr/inputs/FileInputs.js +29 -11
  129. package/dist/ssr/inputs/FileInputs.js.map +1 -1
  130. package/dist/ssr/inputs/SelectChip.js +2 -1
  131. package/dist/ssr/inputs/SelectChip.js.map +1 -1
  132. package/dist/ssr/inputs/choice.js +5 -1
  133. package/dist/ssr/inputs/choice.js.map +1 -1
  134. package/dist/ssr/inputs/markdown/MarkdownEditor.js +46 -10
  135. package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
  136. package/dist/ssr/inputs/markdown/Toolbar.js +30 -2
  137. package/dist/ssr/inputs/markdown/Toolbar.js.map +1 -1
  138. package/dist/ssr/internal/focus-return.js +61 -0
  139. package/dist/ssr/internal/focus-return.js.map +1 -0
  140. package/dist/ssr/layout/AppOverview.js +1 -1
  141. package/dist/ssr/layout/AppOverview.js.map +1 -1
  142. package/dist/ssr/layout/DetailPanel.js +16 -15
  143. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  144. package/dist/ssr/layout/FloatingWindow.js +3 -1
  145. package/dist/ssr/layout/FloatingWindow.js.map +1 -1
  146. package/dist/ssr/layout/PanelDialog.js +10 -9
  147. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  148. package/dist/ssr/layout/Panes.js +39 -8
  149. package/dist/ssr/layout/Panes.js.map +1 -1
  150. package/dist/ssr/layout/SidebarItemPreview.js +36 -108
  151. package/dist/ssr/layout/SidebarItemPreview.js.map +1 -1
  152. package/dist/ssr/layout/app-workspace-controller.js +5 -2
  153. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  154. package/dist/ssr/surfaces/ProgressBar.js.map +1 -1
  155. package/dist/ssr/surfaces/ProgressRing.js +31 -0
  156. package/dist/ssr/surfaces/ProgressRing.js.map +1 -0
  157. package/dist/ssr/surfaces/index.js +1 -0
  158. package/dist/ssr/surfaces/index.js.map +1 -1
  159. package/dist/styles.css +1 -1
  160. package/dist/tabler-icons-15sezdfp.woff2 +0 -0
  161. package/dist/tabler.css +2 -2
  162. package/dist/types/actions/Button.d.ts +5 -0
  163. package/dist/types/actions/Dropdown.d.ts +5 -1
  164. package/dist/types/actions/SplitButton.d.ts +1 -0
  165. package/dist/types/chat/ChatContextPopup.d.ts +8 -0
  166. package/dist/types/chat/index.d.ts +3 -2
  167. package/dist/types/feedback/HoverPreview.d.ts +83 -0
  168. package/dist/types/feedback/Tooltip.d.ts +6 -0
  169. package/dist/types/feedback/index.d.ts +2 -0
  170. package/dist/types/feedback/prompts.d.ts +9 -6
  171. package/dist/types/inputs/SelectChip.d.ts +1 -0
  172. package/dist/types/inputs/completion/overlay.d.ts +3 -1
  173. package/dist/types/internal/focus-return.d.ts +20 -0
  174. package/dist/types/intl/Format.d.ts +16 -8
  175. package/dist/types/layout/BottomSheet.d.ts +6 -1
  176. package/dist/types/layout/SidebarItemPreview.d.ts +1 -1
  177. package/dist/types/surfaces/ProgressBar.d.ts +1 -1
  178. package/dist/types/surfaces/ProgressRing.d.ts +13 -0
  179. package/dist/types/surfaces/index.d.ts +2 -0
  180. package/package.json +9 -8
  181. package/dist/tabler-icons-q30jt7jk.woff2 +0 -0
@@ -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
- /** Menu width as a CSS length. Defaults to `12rem`, or `18rem` for touch. */
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: (content: string, defaultValue?: string, options?: DialogOptions) => Promise<string | null>;
158
- promptNumber: (content: string, defaultValue?: number, options?: DialogOptions & {
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: <T extends unknown = unknown>(resolver: CloudSearchResolver<T>, options?: PromptSearchOptions) => Promise<PromptSearchItem<T> | undefined>;
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
- export declare const plainTextHighlight: (value: string) => string;
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: (props: FormatNumberProps) => JSX.Element;
82
- readonly Percent: (props: FormatPercentProps) => JSX.Element;
83
- readonly Currency: (props: FormatCurrencyProps) => JSX.Element;
84
- readonly Bytes: (props: FormatBytesProps) => JSX.Element;
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: (props: FormatRelativeTimeProps) => JSX.Element;
89
- readonly RelativeDate: (props: FormatRelativeDateProps) => JSX.Element;
90
- readonly Duration: (props: FormatDurationProps) => JSX.Element;
91
- readonly DurationMs: (props: FormatDurationMsProps) => JSX.Element;
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: (dialog: HTMLDialogElement) => HTMLElement;
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. Native popover owns light dismissal. */
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.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Production-ready components for SolidJS applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,9 +44,9 @@
44
44
  "dependencies": {
45
45
  "@fontsource/ibm-plex-mono": "5.3.0",
46
46
  "@fontsource/ibm-plex-sans": "5.3.0",
47
- "@k2b/stdlib": "0.26.0",
48
- "@tabler/icons-webfont": "3.46.0",
49
- "marked": "17.0.6"
47
+ "@k2b/stdlib": "0.27.0",
48
+ "@tabler/icons-webfont": "3.48.0",
49
+ "marked": "18.0.14"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@k2b/ssr": "^0.12.0 || ^0.13.0 || ^0.14.0",
@@ -60,13 +60,14 @@
60
60
  "@types/bun": "1.4.2",
61
61
  "babel-preset-solid": "1.9.15",
62
62
  "bun-plugin-tailwind": "0.1.2",
63
- "happy-dom": "20.11.2",
64
- "hono": "4.13.8",
65
- "playwright": "1.62.0",
63
+ "happy-dom": "20.14.5",
64
+ "hono": "4.13.9",
65
+ "playwright": "1.63.0",
66
66
  "seroval": "1.6.7",
67
67
  "solid-js": "1.9.15",
68
68
  "tailwindcss": "4.3.3",
69
- "typescript": "5.9.3"
69
+ "typescript": "7.0.2",
70
+ "@typescript/typescript6": "6.0.2"
70
71
  },
71
72
  "publishConfig": {
72
73
  "access": "public"
Binary file