@k2b/ui 0.1.0-rc.0 → 0.1.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 (135) hide show
  1. package/dist/types/actions/Button.d.ts +38 -0
  2. package/dist/types/actions/ContextMenu.d.ts +17 -0
  3. package/dist/types/actions/CopyButton.d.ts +20 -0
  4. package/dist/types/actions/Disclosure.d.ts +15 -0
  5. package/dist/types/actions/Dropdown.d.ts +100 -0
  6. package/dist/types/actions/FilterChip.d.ts +27 -0
  7. package/dist/types/actions/RemoveButton.d.ts +7 -0
  8. package/dist/types/actions/SegmentedControl.d.ts +20 -0
  9. package/dist/types/actions/SplitButton.d.ts +13 -0
  10. package/dist/types/actions/SpotlightSearch.d.ts +25 -0
  11. package/dist/types/actions/Tabs.d.ts +27 -0
  12. package/dist/types/actions/Toolbar.d.ts +23 -0
  13. package/dist/types/actions/index.d.ts +24 -0
  14. package/dist/types/chat/ChatComposer.d.ts +57 -0
  15. package/dist/types/chat/ChatPrimitives.d.ts +48 -0
  16. package/dist/types/chat/ChatRoot.d.ts +7 -0
  17. package/dist/types/chat/ChatTimeline.d.ts +52 -0
  18. package/dist/types/chat/chat-behavior.d.ts +29 -0
  19. package/dist/types/chat/index.d.ts +21 -0
  20. package/dist/types/chat/types.d.ts +62 -0
  21. package/dist/types/content/Calendar.d.ts +115 -0
  22. package/dist/types/content/Chart.d.ts +90 -0
  23. package/dist/types/content/CodeDisplay.d.ts +11 -0
  24. package/dist/types/content/DataTable.d.ts +113 -0
  25. package/dist/types/content/Docs.d.ts +52 -0
  26. package/dist/types/content/FileBrowser.d.ts +40 -0
  27. package/dist/types/content/FileTree.d.ts +29 -0
  28. package/dist/types/content/FileView.d.ts +59 -0
  29. package/dist/types/content/Lightbox.d.ts +16 -0
  30. package/dist/types/content/LogEntriesTable.d.ts +14 -0
  31. package/dist/types/content/MarkdownView.d.ts +46 -0
  32. package/dist/types/content/Pagination.d.ts +10 -0
  33. package/dist/types/content/PdfPreview.d.ts +11 -0
  34. package/dist/types/content/RangePicker.d.ts +29 -0
  35. package/dist/types/content/StructuredDataPreview.d.ts +20 -0
  36. package/dist/types/content/calendar-event-layout.d.ts +16 -0
  37. package/dist/types/content/calendar-pointer.d.ts +22 -0
  38. package/dist/types/content/chart-map-viewport.d.ts +5 -0
  39. package/dist/types/content/chart-state-timeline.d.ts +42 -0
  40. package/dist/types/content/code-highlight.d.ts +14 -0
  41. package/dist/types/content/file-tree.d.ts +41 -0
  42. package/dist/types/content/file-view-preview.d.ts +22 -0
  43. package/dist/types/content/index.d.ts +26 -0
  44. package/dist/types/feedback/InlineGuidance.d.ts +10 -0
  45. package/dist/types/feedback/Tooltip.d.ts +18 -0
  46. package/dist/types/feedback/dialog-core.d.ts +19 -0
  47. package/dist/types/feedback/index.d.ts +10 -0
  48. package/dist/types/feedback/prompts.d.ts +164 -0
  49. package/dist/types/feedback/toast.d.ts +25 -0
  50. package/dist/types/feedback/tooltip-position.d.ts +2 -0
  51. package/dist/types/index.d.ts +10 -0
  52. package/dist/types/inputs/AutocompleteEditor.d.ts +21 -0
  53. package/dist/types/inputs/AutocompleteSelect.d.ts +30 -0
  54. package/dist/types/inputs/Checkbox.d.ts +9 -0
  55. package/dist/types/inputs/CheckboxCard.d.ts +9 -0
  56. package/dist/types/inputs/ChoiceGroups.d.ts +13 -0
  57. package/dist/types/inputs/ChoiceInputs.d.ts +24 -0
  58. package/dist/types/inputs/Combobox.d.ts +18 -0
  59. package/dist/types/inputs/DatePicker.d.ts +31 -0
  60. package/dist/types/inputs/FileInputs.d.ts +31 -0
  61. package/dist/types/inputs/MultiSelectInput.d.ts +41 -0
  62. package/dist/types/inputs/NumberInput.d.ts +24 -0
  63. package/dist/types/inputs/Select.d.ts +50 -0
  64. package/dist/types/inputs/SelectChip.d.ts +25 -0
  65. package/dist/types/inputs/SpecialInputs.d.ts +21 -0
  66. package/dist/types/inputs/Switch.d.ts +7 -0
  67. package/dist/types/inputs/TagEditor.d.ts +35 -0
  68. package/dist/types/inputs/TagsInput.d.ts +11 -0
  69. package/dist/types/inputs/TemplateEditor.d.ts +28 -0
  70. package/dist/types/inputs/TextInput.d.ts +26 -0
  71. package/dist/types/inputs/choice.d.ts +32 -0
  72. package/dist/types/inputs/completion/behaviors.d.ts +13 -0
  73. package/dist/types/inputs/completion/engine.d.ts +54 -0
  74. package/dist/types/inputs/completion/index.d.ts +3 -0
  75. package/dist/types/inputs/completion/overlay.d.ts +11 -0
  76. package/dist/types/inputs/date-picker.d.ts +42 -0
  77. package/dist/types/inputs/editor-dom.d.ts +6 -0
  78. package/dist/types/inputs/field-contract.d.ts +24 -0
  79. package/dist/types/inputs/icon-options.d.ts +37 -0
  80. package/dist/types/inputs/image-crop.d.ts +44 -0
  81. package/dist/types/inputs/index.d.ts +45 -0
  82. package/dist/types/inputs/markdown/MarkdownEditor.d.ts +25 -0
  83. package/dist/types/inputs/markdown/Toolbar.d.ts +9 -0
  84. package/dist/types/inputs/markdown/actions.d.ts +8 -0
  85. package/dist/types/inputs/markdown/active-formats.d.ts +1 -0
  86. package/dist/types/inputs/markdown/behaviors.d.ts +3 -0
  87. package/dist/types/inputs/markdown/code-zone.d.ts +1 -0
  88. package/dist/types/internal/color.d.ts +4 -0
  89. package/dist/types/internal/field.d.ts +27 -0
  90. package/dist/types/internal/portal.d.ts +1 -0
  91. package/dist/types/intl/Format.d.ts +84 -0
  92. package/dist/types/intl/index.d.ts +4 -0
  93. package/dist/types/intl/locale.d.ts +42 -0
  94. package/dist/types/intl/messages.d.ts +375 -0
  95. package/dist/types/layout/AppOverview.d.ts +29 -0
  96. package/dist/types/layout/AppWorkspace.d.ts +254 -0
  97. package/dist/types/layout/DataPanel.d.ts +16 -0
  98. package/dist/types/layout/DetailPanel.d.ts +89 -0
  99. package/dist/types/layout/Discussion.d.ts +52 -0
  100. package/dist/types/layout/FloatingWindow.d.ts +19 -0
  101. package/dist/types/layout/PanelDialog.d.ts +72 -0
  102. package/dist/types/layout/PanelHeader.d.ts +10 -0
  103. package/dist/types/layout/Panes.d.ts +48 -0
  104. package/dist/types/layout/ScrollArea.d.ts +8 -0
  105. package/dist/types/layout/Settings.d.ts +72 -0
  106. package/dist/types/layout/SettingsCollection.d.ts +41 -0
  107. package/dist/types/layout/SettingsModal.d.ts +39 -0
  108. package/dist/types/layout/app-workspace-controller.d.ts +7 -0
  109. package/dist/types/layout/app-workspace-state.d.ts +57 -0
  110. package/dist/types/layout/floating-window-geometry.d.ts +11 -0
  111. package/dist/types/layout/index.d.ts +32 -0
  112. package/dist/types/layout/panes-layout.d.ts +63 -0
  113. package/dist/types/layout/stable-id.d.ts +3 -0
  114. package/dist/types/semantics.d.ts +4 -0
  115. package/dist/types/surfaces/Avatar.d.ts +14 -0
  116. package/dist/types/surfaces/DescriptionList.d.ts +17 -0
  117. package/dist/types/surfaces/LinkCard.d.ts +11 -0
  118. package/dist/types/surfaces/NotFoundState.d.ts +15 -0
  119. package/dist/types/surfaces/NoticeCard.d.ts +39 -0
  120. package/dist/types/surfaces/Paper.d.ts +13 -0
  121. package/dist/types/surfaces/Placeholder.d.ts +17 -0
  122. package/dist/types/surfaces/ProgressBar.d.ts +13 -0
  123. package/dist/types/surfaces/StatCell.d.ts +22 -0
  124. package/dist/types/surfaces/StatGrid.d.ts +21 -0
  125. package/dist/types/surfaces/StatusBadge.d.ts +12 -0
  126. package/dist/types/surfaces/Tag.d.ts +16 -0
  127. package/dist/types/surfaces/index.d.ts +24 -0
  128. package/dist/types/widgets/Widget.d.ts +12 -0
  129. package/dist/types/widgets/WidgetHero.d.ts +11 -0
  130. package/dist/types/widgets/WidgetList.d.ts +17 -0
  131. package/dist/types/widgets/WidgetPills.d.ts +14 -0
  132. package/dist/types/widgets/WidgetStat.d.ts +17 -0
  133. package/dist/types/widgets/WidgetStatus.d.ts +12 -0
  134. package/dist/types/widgets/index.d.ts +6 -0
  135. package/package.json +1 -1
@@ -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;
@@ -0,0 +1,11 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { ValueFieldProps } from "./field-contract";
3
+ export type TagsInputProps = ValueFieldProps<string[]> & {
4
+ placeholder?: string;
5
+ icon?: string;
6
+ activeIcon?: string;
7
+ maxTags?: number;
8
+ name?: string;
9
+ };
10
+ export declare function TagsInput(props: TagsInputProps): JSX.Element;
11
+ export default TagsInput;
@@ -0,0 +1,28 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type PanesLayout } from "../layout/panes-layout";
3
+ import { type AutocompleteEditorProps } from "./AutocompleteEditor";
4
+ export type TemplateVariableKind = "string" | "email" | "url" | "number" | "boolean" | "array" | "object";
5
+ export type TemplateVariable = {
6
+ name: string;
7
+ kind?: TemplateVariableKind;
8
+ description?: string;
9
+ };
10
+ export type TemplateEditorProps = Omit<AutocompleteEditorProps, "completions" | "highlight"> & {
11
+ variables: readonly TemplateVariable[];
12
+ };
13
+ export type TemplatePreviewProps = {
14
+ html: string;
15
+ title?: string;
16
+ class?: string;
17
+ };
18
+ export type TemplateSampleDataProps = {
19
+ variables: readonly TemplateVariable[];
20
+ values: Readonly<Record<string, string>>;
21
+ onValueChange: (name: string, value: string) => void;
22
+ class?: string;
23
+ };
24
+ export type TemplateEditorLayout = PanesLayout;
25
+ export declare const createTemplateEditorPanesLayout: () => TemplateEditorLayout;
26
+ export declare function TemplateEditor(props: TemplateEditorProps): JSX.Element;
27
+ export declare function TemplatePreview(props: TemplatePreviewProps): JSX.Element;
28
+ export declare function TemplateSampleData(props: TemplateSampleDataProps): JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { Completion } from "./completion";
3
+ import type { ValueFieldProps } from "./field-contract";
4
+ export type TextInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "onChange" | "onInput" | "prefix" | "suffix" | "type" | "value" | keyof ValueFieldProps<string>> & ValueFieldProps<string> & {
5
+ minLength?: number;
6
+ maxLength?: number;
7
+ type?: "text" | "search" | "email" | "url" | "tel";
8
+ variant?: "default" | "ai";
9
+ icon?: string;
10
+ activeIcon?: string;
11
+ prefix?: JSX.Element;
12
+ suffix?: JSX.Element;
13
+ clearable?: boolean;
14
+ onClear?: () => void;
15
+ clearLabel?: string;
16
+ multiline?: boolean;
17
+ monospace?: boolean;
18
+ password?: boolean;
19
+ markdown?: boolean;
20
+ onSubmit?: () => void;
21
+ lines?: number;
22
+ abbreviations?: Record<string, string>;
23
+ completions?: readonly Completion[];
24
+ };
25
+ export declare function TextInput(props: TextInputProps): JSX.Element;
26
+ export default TextInput;
@@ -0,0 +1,32 @@
1
+ import { type Setter } from "solid-js";
2
+ export type ChoiceOption<T extends string = string> = {
3
+ value: T;
4
+ label: string;
5
+ description?: string;
6
+ icon?: string;
7
+ color?: string;
8
+ disabled?: boolean;
9
+ /** Optional overlapping groups used by choice controls that expose group filtering. */
10
+ groups?: readonly string[];
11
+ };
12
+ export type ChoiceOptionsLoader<T extends string = string> = (query: string, signal: AbortSignal) => Promise<readonly ChoiceOption<T>[]>;
13
+ export declare const filterChoiceOptions: <T extends string>(options: readonly ChoiceOption<T>[], query: string) => readonly ChoiceOption<T>[];
14
+ export declare const nextEnabledChoiceIndex: <T extends string>(options: readonly ChoiceOption<T>[], current: number, direction: 1 | -1) => number;
15
+ export declare function createChoiceLoader<T extends string>(loader: () => ChoiceOptionsLoader<T> | undefined, debounceMs: () => number): {
16
+ options: () => readonly ChoiceOption<T>[];
17
+ loading: () => boolean;
18
+ error: () => string | undefined;
19
+ load: (query: string, immediate?: boolean) => void;
20
+ retry: () => void;
21
+ cancel: () => void;
22
+ };
23
+ export declare const placeChoicePopover: (trigger: HTMLElement, popover: HTMLElement) => void;
24
+ export declare function createChoicePopover(disabled: () => boolean): {
25
+ open: () => boolean;
26
+ setTrigger: Setter<HTMLElement | undefined>;
27
+ setPopover: Setter<HTMLElement | undefined>;
28
+ show: () => void;
29
+ hide: (restoreFocus?: boolean) => void;
30
+ toggle: () => void;
31
+ trigger: () => HTMLElement | undefined;
32
+ };
@@ -0,0 +1,13 @@
1
+ import { type Completion, type QueryContext, type Suggestion } from "./engine";
2
+ export type TryExpandOptions = {
3
+ isExcluded?: (text: string, position: number) => boolean;
4
+ };
5
+ /** Keeps abbreviation restoration isolated to one editor instance. */
6
+ export declare const createCompletionBehaviorState: () => {
7
+ applySuggestion: (textarea: HTMLTextAreaElement, context: QueryContext, suggestion: Suggestion, options?: {
8
+ trackExpansion?: boolean;
9
+ }) => boolean;
10
+ reset: () => void;
11
+ tryExpand: (textarea: HTMLTextAreaElement, completions: readonly Completion[] | undefined, options?: TryExpandOptions) => boolean;
12
+ tryRestore: (textarea: HTMLTextAreaElement) => boolean;
13
+ };
@@ -0,0 +1,54 @@
1
+ export type Suggestion = {
2
+ text: string;
3
+ label?: string;
4
+ expansion?: string;
5
+ appendSpace?: boolean;
6
+ hint?: string;
7
+ textEdit?: {
8
+ start: number;
9
+ end: number;
10
+ text: string;
11
+ };
12
+ };
13
+ export type SuggestContext = {
14
+ fullText: string;
15
+ caret: number;
16
+ tokenStart: number;
17
+ };
18
+ export type Completion = {
19
+ trigger?: string;
20
+ suggest: (query: string, context: SuggestContext, signal: AbortSignal) => readonly Suggestion[] | Promise<readonly Suggestion[]>;
21
+ /** Static labels used by editor highlighting. Providers are never invoked to derive metadata. */
22
+ knownLabels?: readonly string[];
23
+ debounceMs?: number;
24
+ dropdown?: boolean;
25
+ allowAfterWord?: boolean;
26
+ };
27
+ export type QueryContext = {
28
+ start: number;
29
+ end: number;
30
+ text: string;
31
+ query: string;
32
+ completion: Completion;
33
+ };
34
+ export type DetectOptions = {
35
+ isExcluded?: (text: string, position: number) => boolean;
36
+ };
37
+ export type ResolveResult = {
38
+ kind: "sync";
39
+ data: readonly Suggestion[];
40
+ } | {
41
+ kind: "async";
42
+ promise: Promise<readonly Suggestion[]>;
43
+ };
44
+ export declare const TRIGGER_CHARS: Set<string>;
45
+ export declare const WORD_CHAR: RegExp;
46
+ export declare const GHOST_SENTINEL: string;
47
+ export declare const abbreviations: (dictionary: Record<string, string>) => Completion;
48
+ export declare const detectQuery: (textarea: HTMLTextAreaElement, completions: readonly Completion[] | undefined, options?: DetectOptions) => QueryContext | null;
49
+ export declare const resolveSuggestions: (completion: Completion, query: string, context: SuggestContext, signal: AbortSignal) => ResolveResult;
50
+ export declare const suggestSync: (completion: Completion, query: string, context: SuggestContext) => readonly Suggestion[] | null;
51
+ export declare const pickGhost: (suggestions: readonly Suggestion[], typed: string) => Suggestion | null;
52
+ export declare const collectKnownLabels: (completions: readonly Completion[] | undefined) => Set<string>;
53
+ export declare const displayLabel: (suggestion: Suggestion, completion: Completion) => string;
54
+ export declare const buildSuggestContext: (textarea: HTMLTextAreaElement, context: QueryContext) => SuggestContext;
@@ -0,0 +1,3 @@
1
+ export { createCompletionBehaviorState, type TryExpandOptions, } from "./behaviors";
2
+ export { abbreviations, buildSuggestContext, type Completion, collectKnownLabels, type DetectOptions, detectQuery, displayLabel, GHOST_SENTINEL, pickGhost, type QueryContext, type ResolveResult, resolveSuggestions, type SuggestContext, type Suggestion, suggestSync, TRIGGER_CHARS, WORD_CHAR, } from "./engine";
3
+ export { plainTextHighlight, type RenderOptions, renderWithOverlay, } from "./overlay";
@@ -0,0 +1,11 @@
1
+ export declare const plainTextHighlight: (value: string) => string;
2
+ export type RenderOptions = {
3
+ ghost?: {
4
+ at: number;
5
+ text: string;
6
+ };
7
+ anchor?: {
8
+ at: number;
9
+ };
10
+ };
11
+ export declare const renderWithOverlay: (text: string, highlighter: (text: string) => string, options?: RenderOptions) => string;
@@ -0,0 +1,42 @@
1
+ import { type DateContext } from "@k2b/stdlib";
2
+ export type DateRangeValue = {
3
+ start: string | null;
4
+ end: string | null;
5
+ };
6
+ export declare const pickerContext: (context?: DateContext) => DateContext;
7
+ export declare const hasInstantOffset: (value: string) => boolean;
8
+ export declare const dateKey: (date: Date | string, context?: DateContext) => string;
9
+ /**
10
+ * Short month names for the month panel. `dates.months()` only returns the long
11
+ * form ("September"), which overflows the three-column month grid, so the short
12
+ * form is derived here while staying locale aware.
13
+ */
14
+ export declare const monthNames: (context?: DateContext) => string[];
15
+ /**
16
+ * Picks the roving-tabindex day for a rendered month grid. The preferred day is
17
+ * used when the grid actually contains it, otherwise the first day of the
18
+ * visible month keeps exactly one cell reachable by Tab.
19
+ */
20
+ export declare const resolveFocusDay: (monthDayKeys: readonly string[], preferred: string | null | undefined) => string | undefined;
21
+ export declare const yearMonth: (date: Date, context?: DateContext) => {
22
+ year: number;
23
+ month: number;
24
+ };
25
+ export declare const monthDate: (year: number, month: number, context?: DateContext) => Date;
26
+ export declare const parseDateValue: (value: string | null | undefined, context?: DateContext) => Date;
27
+ export declare const displayDate: (value: string | null | undefined, context?: DateContext) => string;
28
+ export declare const dateTimeInput: (value: string | null | undefined, context?: DateContext) => string;
29
+ export declare const splitDateTime: (value: string | null | undefined, context?: DateContext) => {
30
+ date: string;
31
+ time: string;
32
+ };
33
+ export declare const isCompleteTime: (value: string) => boolean;
34
+ export declare const toDateTimeValue: (date: string, time: string, context?: DateContext) => string | null;
35
+ export declare const formatDateTimeValue: (value: string | null | undefined, context?: DateContext) => string;
36
+ export declare const normalizeTimeInput: (value: string) => string;
37
+ export declare const filterTimeInput: (value: string) => string;
38
+ export declare const orderedRange: (start: string, end: string) => DateRangeValue;
39
+ export declare const previewRange: (range: DateRangeValue, preview: string | null) => DateRangeValue;
40
+ export declare const inRange: (day: string, range: DateRangeValue) => boolean;
41
+ export declare const isRangeEdge: (day: string, range: DateRangeValue) => boolean;
42
+ export declare const formatDateOnlyRangeDuration: (range: DateRangeValue, context?: DateContext) => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Replaces one textarea range while preserving the browser's native undo path
3
+ * where possible. The fallback emits the input event that the editing command
4
+ * would have emitted, so callers never need a second dispatch.
5
+ */
6
+ export declare const replaceTextareaRange: (textarea: HTMLTextAreaElement, start: number, end: number, replacement: string) => boolean;
@@ -0,0 +1,24 @@
1
+ import type { DateContext as StdlibDateContext } from "@k2b/stdlib";
2
+ import type { JSX } from "solid-js";
3
+ export type DateContext = StdlibDateContext;
4
+ export type MaybeAccessor<T> = T | (() => T);
5
+ export type FieldProps = {
6
+ id?: string;
7
+ class?: string;
8
+ label?: JSX.Element;
9
+ description?: JSX.Element;
10
+ error?: MaybeAccessor<JSX.Element | undefined>;
11
+ required?: boolean;
12
+ disabled?: boolean;
13
+ "aria-label"?: string;
14
+ "aria-describedby"?: string;
15
+ };
16
+ export type ValueFieldProps<T> = FieldProps & {
17
+ value: MaybeAccessor<T>;
18
+ onValueChange?: (value: T) => void;
19
+ onValueCommit?: (value: T) => void;
20
+ };
21
+ /** Reports one atomic edit as both the current and committed field value. */
22
+ export declare const commitFieldValue: <T>(owner: Pick<ValueFieldProps<T>, "onValueChange" | "onValueCommit">, value: T) => void;
23
+ export declare function resolveMaybeAccessor<T>(value: MaybeAccessor<T>): T;
24
+ export declare function resolveMaybeAccessor<T>(value: MaybeAccessor<T> | undefined): T | undefined;
@@ -0,0 +1,37 @@
1
+ import type { IconOption } from "./SpecialInputs";
2
+ export declare const DEFAULT_ICON_GROUPS: readonly [{
3
+ readonly value: "recommended";
4
+ readonly label: "Recommended";
5
+ }, {
6
+ readonly value: "people";
7
+ readonly label: "People";
8
+ }, {
9
+ readonly value: "work";
10
+ readonly label: "Work";
11
+ }, {
12
+ readonly value: "communication";
13
+ readonly label: "Communication";
14
+ }, {
15
+ readonly value: "files";
16
+ readonly label: "Files";
17
+ }, {
18
+ readonly value: "data";
19
+ readonly label: "Data & tech";
20
+ }, {
21
+ readonly value: "commerce";
22
+ readonly label: "Commerce";
23
+ }, {
24
+ readonly value: "places";
25
+ readonly label: "Places";
26
+ }, {
27
+ readonly value: "food";
28
+ readonly label: "Food";
29
+ }, {
30
+ readonly value: "media";
31
+ readonly label: "Media";
32
+ }, {
33
+ readonly value: "devices";
34
+ readonly label: "Devices";
35
+ }];
36
+ /** A curated, application-neutral Tabler catalogue for IconInput. */
37
+ export declare const DEFAULT_ICON_OPTIONS: readonly IconOption[];
@@ -0,0 +1,44 @@
1
+ export type ImageCropAspect = "free" | {
2
+ width: number;
3
+ height: number;
4
+ };
5
+ export type ImageCropRotation = 0 | 90 | 180 | 270;
6
+ export type ImageCropRect = {
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ };
12
+ export type ImageCropState = {
13
+ crop: ImageCropRect;
14
+ rotation: ImageCropRotation;
15
+ };
16
+ export type ImageCropSource = File | Blob | HTMLImageElement | HTMLCanvasElement | string;
17
+ export type ImageCropOutput = {
18
+ width?: number;
19
+ height?: number;
20
+ maxWidth?: number;
21
+ maxHeight?: number;
22
+ format?: "webp" | "jpeg" | "png";
23
+ quality?: number;
24
+ };
25
+ export type ImageCropSize = {
26
+ width: number;
27
+ height: number;
28
+ };
29
+ export type ImageCropResizeHandle = "nw" | "ne" | "sw" | "se";
30
+ export declare const normalizeImageCropRotation: (rotation: number) => ImageCropRotation;
31
+ export declare const rotateImageCropRight: (rotation: ImageCropRotation) => ImageCropRotation;
32
+ export declare const getInitialImageCropRect: (imageSize: ImageCropSize, aspect?: ImageCropAspect) => ImageCropRect;
33
+ export declare const clampImageCropRect: (rect: ImageCropRect, imageSize: ImageCropSize, aspect?: ImageCropAspect) => ImageCropRect;
34
+ export declare const resizeImageCropAroundCenter: (rect: ImageCropRect, imageSize: ImageCropSize, aspect: ImageCropAspect, scale: number) => ImageCropRect;
35
+ /** Resizes a crop from one corner while keeping the opposite corner anchored. */
36
+ export declare const resizeImageCropFromCorner: (rect: ImageCropRect, imageSize: ImageCropSize, aspect: ImageCropAspect, handle: ImageCropResizeHandle, dx: number, dy: number) => ImageCropRect;
37
+ export declare const imageCropRectToPixels: (rect: ImageCropRect, imageSize: ImageCropSize) => {
38
+ x: number;
39
+ y: number;
40
+ width: number;
41
+ height: number;
42
+ };
43
+ export declare const createCroppedImageCanvas: (source: ImageCropSource, state: ImageCropState, output?: ImageCropOutput) => Promise<HTMLCanvasElement>;
44
+ export declare const createCroppedImageDataUrl: (source: ImageCropSource, state: ImageCropState, output?: ImageCropOutput) => Promise<string>;
@@ -0,0 +1,45 @@
1
+ export type { AutocompleteEditorProps } from "./AutocompleteEditor";
2
+ export { AutocompleteEditor } from "./AutocompleteEditor";
3
+ export type { AutocompleteSelectOption, AutocompleteSelectProps, AutocompleteSelectSearchResult, } from "./AutocompleteSelect";
4
+ export { AutocompleteSelect } from "./AutocompleteSelect";
5
+ export type { CheckboxProps } from "./Checkbox";
6
+ export { Checkbox } from "./Checkbox";
7
+ export type { CheckboxCardProps } from "./CheckboxCard";
8
+ export { CheckboxCard } from "./CheckboxCard";
9
+ export type { ColorInputProps, PinInputProps, SliderProps, } from "./ChoiceInputs";
10
+ export { ColorInput, PinInput, Slider } from "./ChoiceInputs";
11
+ export type { ComboboxOption, ComboboxProps } from "./Combobox";
12
+ export { Combobox } from "./Combobox";
13
+ export type { ChoiceOption, ChoiceOptionsLoader } from "./choice";
14
+ export type { Completion, QueryContext, SuggestContext, Suggestion, } from "./completion";
15
+ export { abbreviations } from "./completion";
16
+ export type { DatePickerBaseProps, DatePickerProps, DatePreset, DateRangePickerProps, DateRangeValue, DateTimePickerProps, DurationPreset, } from "./DatePicker";
17
+ export { DatePicker, DateRangePicker, DateTimePicker } from "./DatePicker";
18
+ export type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from "./FileInputs";
19
+ export { FileDropzone, ImageCropper, ImageInput } from "./FileInputs";
20
+ export type { DateContext, FieldProps, MaybeAccessor, ValueFieldProps } from "./field-contract";
21
+ export { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from "./icon-options";
22
+ export type { ImageCropAspect, ImageCropOutput, ImageCropRect, ImageCropRotation, ImageCropSize, ImageCropSource, ImageCropState, } from "./image-crop";
23
+ export { clampImageCropRect, createCroppedImageCanvas, createCroppedImageDataUrl, getInitialImageCropRect, imageCropRectToPixels, normalizeImageCropRotation, resizeImageCropAroundCenter, rotateImageCropRight, } from "./image-crop";
24
+ export type { MultiSelectFetchDataFn, MultiSelectInputProps, MultiSelectOption, } from "./MultiSelectInput";
25
+ export { MultiSelectInput } from "./MultiSelectInput";
26
+ export type { MarkdownEditorProps } from "./markdown/MarkdownEditor";
27
+ export { MarkdownEditor } from "./markdown/MarkdownEditor";
28
+ export type { NumberInputProps } from "./NumberInput";
29
+ export { NumberInput } from "./NumberInput";
30
+ export type { SelectGridSize, SelectGroup, SelectOption, SelectProps, SelectSourceOption, SelectView } from "./Select";
31
+ export { Select } from "./Select";
32
+ export type { SelectChipOption, SelectChipProps } from "./SelectChip";
33
+ export { SelectChip } from "./SelectChip";
34
+ export type { IconInputProps, IconOption } from "./SpecialInputs";
35
+ export { IconInput } from "./SpecialInputs";
36
+ export type { SwitchProps } from "./Switch";
37
+ export { Switch } from "./Switch";
38
+ export type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from "./TagEditor";
39
+ export { TagEditor } from "./TagEditor";
40
+ export type { TagsInputProps } from "./TagsInput";
41
+ export { TagsInput } from "./TagsInput";
42
+ export type { TemplateEditorLayout, TemplateEditorProps, TemplatePreviewProps, TemplateSampleDataProps, TemplateVariable, TemplateVariableKind, } from "./TemplateEditor";
43
+ export { createTemplateEditorPanesLayout, TemplateEditor, TemplatePreview, TemplateSampleData, } from "./TemplateEditor";
44
+ export type { TextInputProps } from "./TextInput";
45
+ export { TextInput } from "./TextInput";