@k2b/ui 0.1.0-rc.0 → 0.1.1

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 (136) hide show
  1. package/README.md +77 -312
  2. package/dist/types/actions/Button.d.ts +38 -0
  3. package/dist/types/actions/ContextMenu.d.ts +17 -0
  4. package/dist/types/actions/CopyButton.d.ts +20 -0
  5. package/dist/types/actions/Disclosure.d.ts +15 -0
  6. package/dist/types/actions/Dropdown.d.ts +100 -0
  7. package/dist/types/actions/FilterChip.d.ts +27 -0
  8. package/dist/types/actions/RemoveButton.d.ts +7 -0
  9. package/dist/types/actions/SegmentedControl.d.ts +20 -0
  10. package/dist/types/actions/SplitButton.d.ts +13 -0
  11. package/dist/types/actions/SpotlightSearch.d.ts +25 -0
  12. package/dist/types/actions/Tabs.d.ts +27 -0
  13. package/dist/types/actions/Toolbar.d.ts +23 -0
  14. package/dist/types/actions/index.d.ts +24 -0
  15. package/dist/types/chat/ChatComposer.d.ts +57 -0
  16. package/dist/types/chat/ChatPrimitives.d.ts +48 -0
  17. package/dist/types/chat/ChatRoot.d.ts +7 -0
  18. package/dist/types/chat/ChatTimeline.d.ts +52 -0
  19. package/dist/types/chat/chat-behavior.d.ts +29 -0
  20. package/dist/types/chat/index.d.ts +21 -0
  21. package/dist/types/chat/types.d.ts +62 -0
  22. package/dist/types/content/Calendar.d.ts +115 -0
  23. package/dist/types/content/Chart.d.ts +90 -0
  24. package/dist/types/content/CodeDisplay.d.ts +11 -0
  25. package/dist/types/content/DataTable.d.ts +113 -0
  26. package/dist/types/content/Docs.d.ts +52 -0
  27. package/dist/types/content/FileBrowser.d.ts +40 -0
  28. package/dist/types/content/FileTree.d.ts +29 -0
  29. package/dist/types/content/FileView.d.ts +59 -0
  30. package/dist/types/content/Lightbox.d.ts +16 -0
  31. package/dist/types/content/LogEntriesTable.d.ts +14 -0
  32. package/dist/types/content/MarkdownView.d.ts +46 -0
  33. package/dist/types/content/Pagination.d.ts +10 -0
  34. package/dist/types/content/PdfPreview.d.ts +11 -0
  35. package/dist/types/content/RangePicker.d.ts +29 -0
  36. package/dist/types/content/StructuredDataPreview.d.ts +20 -0
  37. package/dist/types/content/calendar-event-layout.d.ts +16 -0
  38. package/dist/types/content/calendar-pointer.d.ts +22 -0
  39. package/dist/types/content/chart-map-viewport.d.ts +5 -0
  40. package/dist/types/content/chart-state-timeline.d.ts +42 -0
  41. package/dist/types/content/code-highlight.d.ts +14 -0
  42. package/dist/types/content/file-tree.d.ts +41 -0
  43. package/dist/types/content/file-view-preview.d.ts +22 -0
  44. package/dist/types/content/index.d.ts +26 -0
  45. package/dist/types/feedback/InlineGuidance.d.ts +10 -0
  46. package/dist/types/feedback/Tooltip.d.ts +18 -0
  47. package/dist/types/feedback/dialog-core.d.ts +19 -0
  48. package/dist/types/feedback/index.d.ts +10 -0
  49. package/dist/types/feedback/prompts.d.ts +164 -0
  50. package/dist/types/feedback/toast.d.ts +25 -0
  51. package/dist/types/feedback/tooltip-position.d.ts +2 -0
  52. package/dist/types/index.d.ts +10 -0
  53. package/dist/types/inputs/AutocompleteEditor.d.ts +21 -0
  54. package/dist/types/inputs/AutocompleteSelect.d.ts +30 -0
  55. package/dist/types/inputs/Checkbox.d.ts +9 -0
  56. package/dist/types/inputs/CheckboxCard.d.ts +9 -0
  57. package/dist/types/inputs/ChoiceGroups.d.ts +13 -0
  58. package/dist/types/inputs/ChoiceInputs.d.ts +24 -0
  59. package/dist/types/inputs/Combobox.d.ts +18 -0
  60. package/dist/types/inputs/DatePicker.d.ts +31 -0
  61. package/dist/types/inputs/FileInputs.d.ts +31 -0
  62. package/dist/types/inputs/MultiSelectInput.d.ts +41 -0
  63. package/dist/types/inputs/NumberInput.d.ts +24 -0
  64. package/dist/types/inputs/Select.d.ts +50 -0
  65. package/dist/types/inputs/SelectChip.d.ts +25 -0
  66. package/dist/types/inputs/SpecialInputs.d.ts +21 -0
  67. package/dist/types/inputs/Switch.d.ts +7 -0
  68. package/dist/types/inputs/TagEditor.d.ts +35 -0
  69. package/dist/types/inputs/TagsInput.d.ts +11 -0
  70. package/dist/types/inputs/TemplateEditor.d.ts +28 -0
  71. package/dist/types/inputs/TextInput.d.ts +26 -0
  72. package/dist/types/inputs/choice.d.ts +32 -0
  73. package/dist/types/inputs/completion/behaviors.d.ts +13 -0
  74. package/dist/types/inputs/completion/engine.d.ts +54 -0
  75. package/dist/types/inputs/completion/index.d.ts +3 -0
  76. package/dist/types/inputs/completion/overlay.d.ts +11 -0
  77. package/dist/types/inputs/date-picker.d.ts +42 -0
  78. package/dist/types/inputs/editor-dom.d.ts +6 -0
  79. package/dist/types/inputs/field-contract.d.ts +24 -0
  80. package/dist/types/inputs/icon-options.d.ts +37 -0
  81. package/dist/types/inputs/image-crop.d.ts +44 -0
  82. package/dist/types/inputs/index.d.ts +45 -0
  83. package/dist/types/inputs/markdown/MarkdownEditor.d.ts +25 -0
  84. package/dist/types/inputs/markdown/Toolbar.d.ts +9 -0
  85. package/dist/types/inputs/markdown/actions.d.ts +8 -0
  86. package/dist/types/inputs/markdown/active-formats.d.ts +1 -0
  87. package/dist/types/inputs/markdown/behaviors.d.ts +3 -0
  88. package/dist/types/inputs/markdown/code-zone.d.ts +1 -0
  89. package/dist/types/internal/color.d.ts +4 -0
  90. package/dist/types/internal/field.d.ts +27 -0
  91. package/dist/types/internal/portal.d.ts +1 -0
  92. package/dist/types/intl/Format.d.ts +84 -0
  93. package/dist/types/intl/index.d.ts +4 -0
  94. package/dist/types/intl/locale.d.ts +42 -0
  95. package/dist/types/intl/messages.d.ts +375 -0
  96. package/dist/types/layout/AppOverview.d.ts +29 -0
  97. package/dist/types/layout/AppWorkspace.d.ts +254 -0
  98. package/dist/types/layout/DataPanel.d.ts +16 -0
  99. package/dist/types/layout/DetailPanel.d.ts +89 -0
  100. package/dist/types/layout/Discussion.d.ts +52 -0
  101. package/dist/types/layout/FloatingWindow.d.ts +19 -0
  102. package/dist/types/layout/PanelDialog.d.ts +72 -0
  103. package/dist/types/layout/PanelHeader.d.ts +10 -0
  104. package/dist/types/layout/Panes.d.ts +48 -0
  105. package/dist/types/layout/ScrollArea.d.ts +8 -0
  106. package/dist/types/layout/Settings.d.ts +72 -0
  107. package/dist/types/layout/SettingsCollection.d.ts +41 -0
  108. package/dist/types/layout/SettingsModal.d.ts +39 -0
  109. package/dist/types/layout/app-workspace-controller.d.ts +7 -0
  110. package/dist/types/layout/app-workspace-state.d.ts +57 -0
  111. package/dist/types/layout/floating-window-geometry.d.ts +11 -0
  112. package/dist/types/layout/index.d.ts +32 -0
  113. package/dist/types/layout/panes-layout.d.ts +63 -0
  114. package/dist/types/layout/stable-id.d.ts +3 -0
  115. package/dist/types/semantics.d.ts +4 -0
  116. package/dist/types/surfaces/Avatar.d.ts +14 -0
  117. package/dist/types/surfaces/DescriptionList.d.ts +17 -0
  118. package/dist/types/surfaces/LinkCard.d.ts +11 -0
  119. package/dist/types/surfaces/NotFoundState.d.ts +15 -0
  120. package/dist/types/surfaces/NoticeCard.d.ts +39 -0
  121. package/dist/types/surfaces/Paper.d.ts +13 -0
  122. package/dist/types/surfaces/Placeholder.d.ts +17 -0
  123. package/dist/types/surfaces/ProgressBar.d.ts +13 -0
  124. package/dist/types/surfaces/StatCell.d.ts +22 -0
  125. package/dist/types/surfaces/StatGrid.d.ts +21 -0
  126. package/dist/types/surfaces/StatusBadge.d.ts +12 -0
  127. package/dist/types/surfaces/Tag.d.ts +16 -0
  128. package/dist/types/surfaces/index.d.ts +24 -0
  129. package/dist/types/widgets/Widget.d.ts +12 -0
  130. package/dist/types/widgets/WidgetHero.d.ts +11 -0
  131. package/dist/types/widgets/WidgetList.d.ts +17 -0
  132. package/dist/types/widgets/WidgetPills.d.ts +14 -0
  133. package/dist/types/widgets/WidgetStat.d.ts +17 -0
  134. package/dist/types/widgets/WidgetStatus.d.ts +12 -0
  135. package/dist/types/widgets/index.d.ts +6 -0
  136. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type TooltipPlacement } from "./tooltip-position";
3
+ export type TooltipProps = {
4
+ content: JSX.Element;
5
+ target: () => HTMLElement | undefined;
6
+ placement?: TooltipPlacement;
7
+ delay?: number;
8
+ disabled?: boolean;
9
+ };
10
+ export type TooltipAnchorProps = Omit<JSX.HTMLAttributes<HTMLSpanElement>, "content"> & Omit<TooltipProps, "target">;
11
+ export type TooltipTriggerProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "content"> & Omit<TooltipProps, "target">;
12
+ type TooltipComponent = ((props: TooltipProps) => JSX.Element) & {
13
+ Anchor: (props: TooltipAnchorProps) => JSX.Element;
14
+ Trigger: (props: TooltipTriggerProps) => JSX.Element;
15
+ };
16
+ export declare const Tooltip: TooltipComponent;
17
+ export type { TooltipPlacement } from "./tooltip-position";
18
+ export default Tooltip;
@@ -0,0 +1,19 @@
1
+ import type { JSX } from "solid-js";
2
+ export type DialogClose<T> = (result?: T) => void;
3
+ export type OpenDialogOptions = {
4
+ panelClassName?: string;
5
+ contentClassName?: string;
6
+ initialFocus?: "first-input" | "none" | ((dialog: HTMLDialogElement) => HTMLElement | null);
7
+ cancelBehavior?: "resolve-undefined" | "ignore";
8
+ ariaLabel?: string;
9
+ };
10
+ export type DialogRender<T> = (close: DialogClose<T>, context: {
11
+ dialog: HTMLDialogElement;
12
+ }) => JSX.Element;
13
+ export type DialogCore = {
14
+ open: <T>(view: DialogRender<T>, options?: OpenDialogOptions) => Promise<T | undefined>;
15
+ close: (result?: unknown) => void;
16
+ isOpen: () => boolean;
17
+ };
18
+ export declare const createDialogCore: () => DialogCore;
19
+ export declare const dialogCore: DialogCore;
@@ -0,0 +1,10 @@
1
+ export type { DialogClose, DialogCore, DialogRender, OpenDialogOptions } from "./dialog-core";
2
+ export { dialogCore } from "./dialog-core";
3
+ export type { InlineGuidanceProps } from "./InlineGuidance";
4
+ export { default as InlineGuidance } from "./InlineGuidance";
5
+ export type { ConfirmOptions, DialogOptions, FieldSchema, PromptFieldBase, PromptSearchInput, PromptSearchItem, PromptSearchOptions, } from "./prompts";
6
+ export { createFormState, DialogHeader, prompts } from "./prompts";
7
+ export type { TooltipAnchorProps, TooltipPlacement, TooltipProps, TooltipTriggerProps } from "./Tooltip";
8
+ export { Tooltip } from "./Tooltip";
9
+ export type { ToastAction, ToastFn, ToastHandle, ToastOptions, ToastVariant } from "./toast";
10
+ export { isPointInsideToast, toast } from "./toast";
@@ -0,0 +1,164 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type OpenDialogOptions } from "./dialog-core";
3
+ export interface DialogOptions {
4
+ title?: string;
5
+ ariaLabel?: string;
6
+ icon?: string;
7
+ confirmText?: string;
8
+ cancelText?: string | false;
9
+ variant?: "danger" | "primary" | "success";
10
+ size?: "small" | "medium" | "large" | "wide";
11
+ surface?: "default" | "bare";
12
+ header?: false;
13
+ cancelBehavior?: OpenDialogOptions["cancelBehavior"];
14
+ }
15
+ export interface ConfirmOptions extends DialogOptions {
16
+ confirmationPhrase?: string;
17
+ }
18
+ type PromptContent = string | HTMLElement | JSX.Element;
19
+ export type PromptSearchItem<T = unknown> = {
20
+ label: string;
21
+ desc?: string;
22
+ icon?: string;
23
+ previewUrl?: string;
24
+ value?: T;
25
+ };
26
+ export type PromptSearchInput = {
27
+ query: string;
28
+ abortSignal: AbortSignal;
29
+ };
30
+ export type PromptSearchOptions = DialogOptions & {
31
+ placeholder?: string;
32
+ icon?: string;
33
+ initialQuery?: string;
34
+ minQueryLength?: number;
35
+ debounceMs?: number;
36
+ emptyText?: string;
37
+ noResultsText?: string;
38
+ };
39
+ export type PromptFieldBase<T = any> = {
40
+ label?: string | false;
41
+ description?: string;
42
+ placeholder?: string;
43
+ required?: boolean;
44
+ default?: T;
45
+ validate?: (value: T | undefined) => string | null;
46
+ };
47
+ export type FieldSchema = (PromptFieldBase<string> & {
48
+ type: "text";
49
+ multiline?: boolean;
50
+ lines?: number;
51
+ maxLength?: number;
52
+ minLength?: number;
53
+ icon?: string;
54
+ activeIcon?: string;
55
+ password?: boolean;
56
+ markdown?: boolean;
57
+ }) | (PromptFieldBase<number> & {
58
+ type: "number";
59
+ min?: number;
60
+ max?: number;
61
+ step?: number;
62
+ }) | (PromptFieldBase<string> & {
63
+ type: "image";
64
+ round?: boolean;
65
+ ariaLabel?: string;
66
+ accept?: string;
67
+ }) | (PromptFieldBase<string> & {
68
+ type: "pin";
69
+ length?: number;
70
+ stretch?: boolean;
71
+ }) | (PromptFieldBase<string> & {
72
+ type: "select";
73
+ options: string[] | {
74
+ id: string;
75
+ label?: string;
76
+ description?: string;
77
+ icon?: string;
78
+ }[];
79
+ icon?: string;
80
+ activeIcon?: string;
81
+ clearable?: boolean;
82
+ }) | (PromptFieldBase<string[]> & {
83
+ type: "tags";
84
+ maxTags?: number;
85
+ minTags?: number;
86
+ icon?: string;
87
+ activeIcon?: string;
88
+ }) | (PromptFieldBase<boolean> & {
89
+ type: "boolean";
90
+ }) | (PromptFieldBase<string> & {
91
+ type: "datetime";
92
+ dateOnly?: boolean;
93
+ }) | {
94
+ type: "info";
95
+ content: string | JSX.Element | (() => JSX.Element);
96
+ };
97
+ type InferFieldType<T extends FieldSchema> = T extends {
98
+ type: "text";
99
+ } ? string : T extends {
100
+ type: "number";
101
+ } ? number : T extends {
102
+ type: "image";
103
+ } ? string : T extends {
104
+ type: "pin";
105
+ } ? string : T extends {
106
+ type: "select";
107
+ } ? string : T extends {
108
+ type: "tags";
109
+ } ? string[] : T extends {
110
+ type: "boolean";
111
+ } ? boolean : T extends {
112
+ type: "datetime";
113
+ } ? string : T extends {
114
+ type: "currency";
115
+ } ? number : T extends {
116
+ type: "info";
117
+ } ? never : never;
118
+ type InferFormValues<T extends Record<string, FieldSchema>> = {
119
+ [K in keyof T as T[K] extends {
120
+ type: "info";
121
+ } ? never : K]: T[K] extends {
122
+ required: true;
123
+ } ? InferFieldType<T[K]> : InferFieldType<T[K]> | undefined;
124
+ };
125
+ type PromptFormValue = string | number | boolean | string[] | undefined;
126
+ type PromptFormOptions<T extends Record<string, FieldSchema>> = {
127
+ title?: string;
128
+ ariaLabel?: string;
129
+ icon?: string;
130
+ fields: T;
131
+ confirmText?: string;
132
+ cancelText?: string | false;
133
+ variant?: "danger" | "primary" | "success";
134
+ size?: DialogOptions["size"];
135
+ cancelBehavior?: DialogOptions["cancelBehavior"];
136
+ };
137
+ export declare const createFormState: <T extends Record<string, FieldSchema>>(schema: T) => {
138
+ values: Record<string, PromptFormValue>;
139
+ errors: Record<string, string | undefined>;
140
+ updateField: (key: string, value: PromptFormValue) => void;
141
+ validateAll: () => boolean;
142
+ reset: () => void;
143
+ };
144
+ export declare const DialogHeader: (props: {
145
+ close: () => void;
146
+ title?: string;
147
+ icon?: string;
148
+ }) => JSX.Element;
149
+ type CloudSearchResolver<T> = (input: PromptSearchInput) => Promise<PromptSearchItem<T>[]> | PromptSearchItem<T>[];
150
+ export declare const prompts: {
151
+ alert: (content: PromptContent, options?: DialogOptions) => Promise<void | undefined>;
152
+ success: (content: PromptContent, options?: Omit<DialogOptions, "variant">) => Promise<void | undefined>;
153
+ confirm: (content: PromptContent, options?: ConfirmOptions) => Promise<boolean | undefined>;
154
+ prompt: (content: string, defaultValue?: string, options?: DialogOptions) => Promise<string | null>;
155
+ promptNumber: (content: string, defaultValue?: number, options?: DialogOptions & {
156
+ min?: number;
157
+ max?: number;
158
+ }) => Promise<number | null>;
159
+ form: <T extends Record<string, FieldSchema>>(config: PromptFormOptions<T>) => Promise<InferFormValues<T> | null>;
160
+ dialog: <T = unknown>(component: (close: (result?: T) => void) => JSX.Element, options?: DialogOptions) => Promise<T | undefined>;
161
+ search: <T = unknown>(resolver: CloudSearchResolver<T>, options?: PromptSearchOptions) => Promise<PromptSearchItem<T> | undefined>;
162
+ error: (content: string | HTMLElement, options?: DialogOptions) => Promise<unknown>;
163
+ };
164
+ export {};
@@ -0,0 +1,25 @@
1
+ export type ToastVariant = "default" | "success" | "error";
2
+ export type ToastAction = {
3
+ label: string;
4
+ href: string;
5
+ };
6
+ export type ToastOptions = {
7
+ variant?: ToastVariant;
8
+ duration?: number;
9
+ iconClass?: string;
10
+ title?: string;
11
+ action?: ToastAction | null;
12
+ };
13
+ export type ToastHandle = {
14
+ dismiss: () => void;
15
+ update: (description: string, options?: ToastOptions) => void;
16
+ };
17
+ export interface ToastFn {
18
+ (description: string, options?: ToastOptions): ToastHandle;
19
+ success: (description: string, options?: Omit<ToastOptions, "variant">) => ToastHandle;
20
+ error: (description: string, options?: Omit<ToastOptions, "variant">) => ToastHandle;
21
+ dismissAll: () => void;
22
+ }
23
+ export declare const K2B_TOAST_CONTAINER_ID = "k2b-ui-toast-container";
24
+ export declare const isPointInsideToast: (x: number, y: number) => boolean;
25
+ export declare const toast: ToastFn;
@@ -0,0 +1,2 @@
1
+ export type TooltipPlacement = "top" | "bottom";
2
+ export declare const positionTooltipSurface: (tooltip: HTMLElement, target: HTMLElement, placement?: TooltipPlacement) => void;
@@ -0,0 +1,10 @@
1
+ export * from "./actions";
2
+ export * from "./chat";
3
+ export * from "./content";
4
+ export * from "./feedback";
5
+ export * from "./inputs";
6
+ export * from "./intl";
7
+ export * from "./layout";
8
+ export type { AccentColor, IntentTone } from "./semantics";
9
+ export * from "./surfaces";
10
+ export * from "./widgets";
@@ -0,0 +1,21 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type Completion } from "./completion";
3
+ import type { ValueFieldProps } from "./field-contract";
4
+ export type AutocompleteEditorProps = ValueFieldProps<string> & {
5
+ onSubmit?: () => void;
6
+ completions?: readonly Completion[];
7
+ restoreExpansionOnBackspace?: boolean;
8
+ highlight?: (text: string) => string;
9
+ singleLine?: boolean;
10
+ lines?: number;
11
+ fill?: boolean;
12
+ placeholder?: string;
13
+ spellcheck?: boolean;
14
+ name?: string;
15
+ maxLength?: number;
16
+ textareaRef?: (element: HTMLTextAreaElement) => void;
17
+ variant?: "default" | "paper";
18
+ };
19
+ export declare function AutocompleteEditor(props: AutocompleteEditorProps): JSX.Element;
20
+ export type { Completion, SuggestContext, Suggestion } from "./completion";
21
+ export { abbreviations } from "./completion";
@@ -0,0 +1,30 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type ChoiceOption } from "./choice";
3
+ import type { ValueFieldProps } from "./field-contract";
4
+ import type { SelectGroup } from "./Select";
5
+ export type AutocompleteSelectOption = ChoiceOption<string>;
6
+ export type AutocompleteSelectSearchResult = {
7
+ /** Ranked suggestions shown in the popup. */
8
+ options: readonly AutocompleteSelectOption[];
9
+ /** The authoritative option that Tab or blur may accept automatically. */
10
+ match?: AutocompleteSelectOption;
11
+ };
12
+ export type AutocompleteSelectProps = ValueFieldProps<string | null> & {
13
+ search: (query: string, signal: AbortSignal, group: string | null) => Promise<AutocompleteSelectSearchResult>;
14
+ selectedOption?: AutocompleteSelectOption;
15
+ formatValue?: (option: AutocompleteSelectOption) => string;
16
+ groups?: readonly SelectGroup[];
17
+ defaultGroup?: string;
18
+ groupsAriaLabel?: string;
19
+ allGroupLabel?: string;
20
+ placeholder?: string;
21
+ debounceMs?: number;
22
+ clearable?: boolean;
23
+ name?: string;
24
+ autofocus?: boolean;
25
+ noMatchText?: string;
26
+ checkingText?: string;
27
+ noOptionsText?: string;
28
+ };
29
+ export declare function AutocompleteSelect(props: AutocompleteSelectProps): JSX.Element;
30
+ export default AutocompleteSelect;
@@ -0,0 +1,9 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { ValueFieldProps } from "./field-contract";
3
+ export type CheckboxProps = ValueFieldProps<boolean> & {
4
+ /** Visual and accessible mixed state for partial bulk selections. */
5
+ indeterminate?: boolean;
6
+ name?: string;
7
+ };
8
+ export declare function Checkbox(props: CheckboxProps): JSX.Element;
9
+ export default Checkbox;
@@ -0,0 +1,9 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { ValueFieldProps } from "./field-contract";
3
+ export type CheckboxCardProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "checked" | "onChange" | "type" | "value" | keyof ValueFieldProps<boolean>> & ValueFieldProps<boolean> & {
4
+ icon?: string;
5
+ color?: string;
6
+ variant?: "card" | "input";
7
+ };
8
+ export declare function CheckboxCard(props: CheckboxCardProps): JSX.Element;
9
+ export default CheckboxCard;
@@ -0,0 +1,13 @@
1
+ import { type JSX } from "solid-js";
2
+ type ChoiceGroup = {
3
+ value: string | null;
4
+ label: string;
5
+ };
6
+ export declare function ChoiceGroups(props: {
7
+ choices: readonly ChoiceGroup[];
8
+ value: string | null;
9
+ onValueChange: (value: string | null) => void;
10
+ ariaLabel: string;
11
+ controls: string;
12
+ }): JSX.Element;
13
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { FieldProps, MaybeAccessor, ValueFieldProps } from "./field-contract";
3
+ export type PinInputProps = ValueFieldProps<string> & {
4
+ length?: number;
5
+ name?: string;
6
+ stretch?: boolean;
7
+ };
8
+ export declare function PinInput(props: PinInputProps): JSX.Element;
9
+ export type SliderProps = FieldProps & Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onInput" | "onChange" | keyof FieldProps> & ValueFieldProps<number> & {
10
+ value: MaybeAccessor<number>;
11
+ formatValue?: (value: number) => string;
12
+ showValue?: boolean;
13
+ center?: boolean;
14
+ defaultValue?: number;
15
+ };
16
+ export declare function Slider(props: SliderProps): JSX.Element;
17
+ export type ColorInputProps = ValueFieldProps<string> & {
18
+ name?: string;
19
+ compact?: boolean;
20
+ transparent?: boolean;
21
+ transparentValue?: MaybeAccessor<boolean>;
22
+ onTransparentValueChange?: (value: boolean) => void;
23
+ };
24
+ export declare function ColorInput(props: ColorInputProps): JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { FieldProps, MaybeAccessor } from "./field-contract";
3
+ export type ComboboxOption = {
4
+ id: string;
5
+ label: string;
6
+ description?: string;
7
+ icon?: string;
8
+ };
9
+ export type ComboboxProps = FieldProps & {
10
+ query?: MaybeAccessor<string>;
11
+ onQueryChange?: (query: string) => void;
12
+ placeholder?: string;
13
+ fetchData: (query: string, signal: AbortSignal) => Promise<ComboboxOption[]>;
14
+ onSelect: (option: ComboboxOption) => void;
15
+ debounceMs?: number;
16
+ };
17
+ export declare function Combobox(props: ComboboxProps): JSX.Element;
18
+ export default Combobox;
@@ -0,0 +1,31 @@
1
+ import { type DateContext } from "@k2b/stdlib";
2
+ import { type JSX } from "solid-js";
3
+ import { type DateRangeValue } from "./date-picker";
4
+ import type { MaybeAccessor, ValueFieldProps } from "./field-contract";
5
+ export type { DateRangeValue } from "./date-picker";
6
+ export type DatePreset<T> = {
7
+ label: string;
8
+ value: T;
9
+ };
10
+ export type DurationPreset = {
11
+ label: string;
12
+ minutes: number;
13
+ };
14
+ export type DatePickerBaseProps<T> = Omit<ValueFieldProps<T>, "value"> & {
15
+ placeholder?: string;
16
+ value: MaybeAccessor<T>;
17
+ presets?: readonly DatePreset<T>[];
18
+ dateConfig?: DateContext;
19
+ clearable?: boolean;
20
+ };
21
+ export type DatePickerProps = DatePickerBaseProps<string | null>;
22
+ export type DateTimePickerProps = DatePickerBaseProps<string | null>;
23
+ export type DateRangePickerProps = DatePickerBaseProps<DateRangeValue> & {
24
+ withTime?: boolean;
25
+ datePresets?: readonly DatePreset<string | null>[];
26
+ durationPresets?: readonly DurationPreset[];
27
+ };
28
+ export declare const placeDatePopover: (trigger: HTMLElement, popover: HTMLElement, wide: boolean) => void;
29
+ export declare function DatePicker(props: DatePickerProps): JSX.Element;
30
+ export declare function DateTimePicker(props: DateTimePickerProps): JSX.Element;
31
+ export declare function DateRangePicker(props: DateRangePickerProps): JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { FieldProps, ValueFieldProps } from "./field-contract";
3
+ import { type ImageCropAspect, type ImageCropSource, type ImageCropState } from "./image-crop";
4
+ export type FileDropzoneProps = FieldProps & {
5
+ accept?: string;
6
+ multiple?: boolean;
7
+ busy?: boolean;
8
+ icon?: string;
9
+ title?: JSX.Element;
10
+ subtitle?: JSX.Element;
11
+ hint?: JSX.Element;
12
+ onDrop: (files: File[]) => void | Promise<void>;
13
+ };
14
+ export declare function FileDropzone(props: FileDropzoneProps): JSX.Element;
15
+ export type ImageInputProps = ValueFieldProps<string | null> & {
16
+ round?: boolean;
17
+ variant?: "default" | "small";
18
+ transform?: (file: File) => Promise<string>;
19
+ accept?: string;
20
+ fallbackMarker?: string;
21
+ };
22
+ export declare function ImageInput(props: ImageInputProps): JSX.Element;
23
+ export type ImageCropperProps = {
24
+ source: ImageCropSource;
25
+ aspect?: ImageCropAspect;
26
+ previewShape?: "rect" | "circle";
27
+ disabled?: boolean;
28
+ onValueChange?: (state: ImageCropState | null) => void;
29
+ class?: string;
30
+ };
31
+ export declare function ImageCropper(props: ImageCropperProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type ChoiceOption } from "./choice";
3
+ import type { ValueFieldProps } from "./field-contract";
4
+ import type { SelectGroup } from "./Select";
5
+ export type MultiSelectOption = string | {
6
+ id: string;
7
+ label?: string;
8
+ description?: string;
9
+ icon?: string;
10
+ color?: string;
11
+ groups?: readonly string[];
12
+ } | ChoiceOption<string>;
13
+ export type MultiSelectFetchDataFn = (query: string, signal: AbortSignal, group: string | null) => Promise<MultiSelectOption[]>;
14
+ export type MultiSelectInputProps = ValueFieldProps<string[]> & {
15
+ options?: MultiSelectOption[];
16
+ fetchData?: MultiSelectFetchDataFn;
17
+ selectedOptions?: () => MultiSelectOption[];
18
+ placeholder?: string;
19
+ icon?: string;
20
+ activeIcon?: string;
21
+ fetchDebounceMs?: number;
22
+ debounceMs?: number;
23
+ loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;
24
+ groups?: readonly SelectGroup[];
25
+ defaultGroup?: string;
26
+ groupsAriaLabel?: string;
27
+ allGroupLabel?: string;
28
+ searchable?: boolean;
29
+ clearable?: boolean;
30
+ name?: string;
31
+ renderOption?: (option: ChoiceOption<string>) => JSX.Element;
32
+ renderValue?: (option: ChoiceOption<string>) => JSX.Element;
33
+ searchPlaceholder?: string;
34
+ loadingLabel?: string;
35
+ noResultsLabel?: string;
36
+ emptyLabel?: string;
37
+ retryLabel?: string;
38
+ clearLabel?: string;
39
+ };
40
+ export declare function MultiSelectInput(props: MultiSelectInputProps): JSX.Element;
41
+ export default MultiSelectInput;
@@ -0,0 +1,24 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { ValueFieldProps } from "./field-contract";
3
+ export type NumberInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "max" | "min" | "onChange" | "onInput" | "prefix" | "step" | "type" | "value" | keyof ValueFieldProps<number | null>> & ValueFieldProps<number | null> & {
4
+ max?: number;
5
+ min?: number;
6
+ step?: number;
7
+ decimalPlaces?: number;
8
+ allowNegative?: boolean;
9
+ clearable?: boolean;
10
+ onClear?: () => void;
11
+ clearLabel?: string;
12
+ increaseLabel?: string;
13
+ decreaseLabel?: string;
14
+ /** Explicit locale for the decimal separator; defaults to the inherited render locale. */
15
+ locale?: string;
16
+ showSteppers?: boolean;
17
+ disableSteppers?: boolean;
18
+ icon?: string;
19
+ activeIcon?: string;
20
+ prefix?: JSX.Element;
21
+ suffix?: JSX.Element;
22
+ };
23
+ export declare function NumberInput(props: NumberInputProps): JSX.Element;
24
+ export default NumberInput;
@@ -0,0 +1,50 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type ChoiceOption } from "./choice";
3
+ import type { ValueFieldProps } from "./field-contract";
4
+ export type SelectOption = ChoiceOption<string>;
5
+ export type SelectGroup = {
6
+ value: string;
7
+ label: string;
8
+ };
9
+ export type SelectView = "list" | "grid";
10
+ export type SelectGridSize = "sm" | "md" | "lg";
11
+ export type SelectSourceOption = string | {
12
+ id: string;
13
+ label?: string;
14
+ description?: string;
15
+ icon?: string;
16
+ color?: string;
17
+ groups?: readonly string[];
18
+ } | SelectOption;
19
+ export type SelectProps = ValueFieldProps<string | null> & {
20
+ placeholder?: string;
21
+ icon?: string;
22
+ activeIcon?: string;
23
+ options?: SelectSourceOption[];
24
+ fetchData?: (query: string, signal: AbortSignal, group: string | null) => Promise<SelectSourceOption[]>;
25
+ loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;
26
+ selectedOption?: ChoiceOption<string>;
27
+ selectedLabel?: () => string | undefined;
28
+ fetchDebounceMs?: number;
29
+ debounceMs?: number;
30
+ searchable?: boolean;
31
+ /** Optional synchronous filter for static options. */
32
+ filterOptions?: (options: readonly SelectOption[], query: string) => readonly SelectOption[];
33
+ /** Optional filters. An option may belong to more than one group. */
34
+ groups?: readonly SelectGroup[];
35
+ /** Group selected when the component is created. Omit to start with all options. */
36
+ defaultGroup?: string;
37
+ groupsAriaLabel?: string;
38
+ allGroupLabel?: string;
39
+ /** Show a local list/grid layout toggle in the dropdown. */
40
+ viewToggle?: boolean;
41
+ /** Initial dropdown layout when `viewToggle` is enabled. */
42
+ defaultView?: SelectView;
43
+ /** Tile density for the grid layout. */
44
+ gridSize?: SelectGridSize;
45
+ searchPlaceholder?: string;
46
+ clearable?: boolean;
47
+ name?: string;
48
+ };
49
+ export declare function Select(props: SelectProps): JSX.Element;
50
+ export default Select;
@@ -0,0 +1,25 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { ButtonSize } from "../actions/Button";
3
+ import { type DropdownPosition } from "../actions/Dropdown";
4
+ import type { MaybeAccessor, ValueFieldProps } from "./field-contract";
5
+ export type SelectChipOption<T extends string | number = string> = {
6
+ value: T;
7
+ label: string;
8
+ description?: string;
9
+ icon?: string;
10
+ image?: string;
11
+ disabled?: boolean;
12
+ };
13
+ export type SelectChipProps<T extends string | number = string> = ValueFieldProps<T> & {
14
+ value: MaybeAccessor<T>;
15
+ options: SelectChipOption<T>[];
16
+ icon?: string;
17
+ iconOnly?: boolean;
18
+ size?: ButtonSize;
19
+ placeholder?: string;
20
+ position?: DropdownPosition;
21
+ menuWidth?: string;
22
+ name?: string;
23
+ };
24
+ export declare function SelectChip<T extends string | number = string>(props: SelectChipProps<T>): JSX.Element;
25
+ export default SelectChip;
@@ -0,0 +1,21 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { ValueFieldProps } from "./field-contract";
3
+ import { type SelectGridSize, type SelectGroup, type SelectOption, type SelectView } from "./Select";
4
+ export type IconOption = SelectOption & {
5
+ keywords?: readonly string[];
6
+ };
7
+ export type IconInputProps = ValueFieldProps<string | null> & {
8
+ options?: readonly IconOption[];
9
+ placeholder?: string;
10
+ clearable?: boolean;
11
+ searchLimit?: number;
12
+ groups?: readonly SelectGroup[];
13
+ defaultGroup?: string;
14
+ groupsAriaLabel?: string;
15
+ allGroupLabel?: string;
16
+ viewToggle?: boolean;
17
+ defaultView?: SelectView;
18
+ gridSize?: SelectGridSize;
19
+ name?: string;
20
+ };
21
+ export declare function IconInput(props: IconInputProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { ValueFieldProps } from "./field-contract";
3
+ export type SwitchProps = ValueFieldProps<boolean> & {
4
+ name?: string;
5
+ };
6
+ export declare function Switch(props: SwitchProps): JSX.Element;
7
+ export default Switch;
@@ -0,0 +1,35 @@
1
+ import { type JSX } from "solid-js";
2
+ export type TagEditorItem = {
3
+ id: string;
4
+ name: string;
5
+ color?: string | null;
6
+ };
7
+ export type TagEditorValue = {
8
+ name: string;
9
+ color: string;
10
+ };
11
+ export type TagEditorLabels = {
12
+ create: string;
13
+ empty: string;
14
+ name: string;
15
+ namePlaceholder: string;
16
+ color: string;
17
+ save: string;
18
+ cancel: string;
19
+ edit: string;
20
+ remove: string;
21
+ };
22
+ export type TagEditorProps<T extends TagEditorItem = TagEditorItem> = {
23
+ items: readonly T[];
24
+ onCreate?: (value: TagEditorValue) => void | Promise<void>;
25
+ onUpdate?: (item: T, value: TagEditorValue) => void | Promise<void>;
26
+ onDelete?: (item: T) => void | Promise<void>;
27
+ labels?: Partial<TagEditorLabels>;
28
+ defaultColor?: string;
29
+ disabled?: boolean;
30
+ onDirtyChange?: (dirty: boolean) => void;
31
+ class?: string;
32
+ };
33
+ /** Controlled tag manager. Persistence, authorization, confirmation, and toasts stay with the consumer. */
34
+ export declare function TagEditor<T extends TagEditorItem = TagEditorItem>(props: TagEditorProps<T>): JSX.Element;
35
+ export default TagEditor;