@rokkit/ui 1.1.18 → 1.2.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 (124) hide show
  1. package/dist/MarkdownRenderer.svelte.d.ts +15 -0
  2. package/dist/components/AlertList.svelte.d.ts +4 -0
  3. package/dist/components/Avatar.svelte.d.ts +4 -0
  4. package/dist/components/Badge.svelte.d.ts +4 -0
  5. package/dist/components/BreadCrumbs.svelte.d.ts +4 -0
  6. package/dist/components/Button.svelte.d.ts +4 -0
  7. package/dist/components/ButtonGroup.svelte.d.ts +4 -0
  8. package/dist/components/Card.svelte.d.ts +4 -0
  9. package/dist/components/Carousel.svelte.d.ts +4 -0
  10. package/dist/components/Code.svelte.d.ts +7 -0
  11. package/dist/components/CodeBlock.svelte.d.ts +4 -0
  12. package/dist/components/CodeGroup.svelte.d.ts +4 -0
  13. package/dist/components/CommandPalette.svelte.d.ts +7 -0
  14. package/dist/components/Connector.svelte.d.ts +4 -0
  15. package/dist/components/Divider.svelte.d.ts +4 -0
  16. package/dist/components/Dropdown.svelte.d.ts +22 -0
  17. package/dist/components/FloatingAction.svelte.d.ts +7 -0
  18. package/dist/components/FloatingNavigation.svelte.d.ts +7 -0
  19. package/dist/components/Frame.svelte.d.ts +17 -0
  20. package/dist/components/Grid.svelte.d.ts +45 -0
  21. package/dist/components/ItemContent.svelte.d.ts +4 -0
  22. package/dist/components/LazyTree.svelte.d.ts +30 -0
  23. package/dist/components/List.svelte.d.ts +49 -0
  24. package/dist/components/Menu.svelte.d.ts +68 -0
  25. package/dist/components/Message.svelte.d.ts +4 -0
  26. package/dist/components/MultiSelect.svelte.d.ts +25 -0
  27. package/dist/components/NavContent.svelte.d.ts +4 -0
  28. package/dist/components/PaletteManager.svelte.d.ts +4 -0
  29. package/dist/components/Pill.svelte.d.ts +4 -0
  30. package/dist/components/ProgressBar.svelte.d.ts +4 -0
  31. package/dist/components/Range.svelte.d.ts +7 -0
  32. package/dist/components/Rating.svelte.d.ts +4 -0
  33. package/dist/components/ResponsiveGrid.svelte.d.ts +4 -0
  34. package/dist/components/Reveal.svelte.d.ts +4 -0
  35. package/dist/components/SearchFilter.svelte.d.ts +7 -0
  36. package/dist/components/Select.svelte.d.ts +26 -0
  37. package/dist/components/Shine.svelte.d.ts +4 -0
  38. package/dist/components/Stack.svelte.d.ts +4 -0
  39. package/dist/components/StatusList.svelte.d.ts +4 -0
  40. package/dist/components/Stepper.svelte.d.ts +4 -0
  41. package/dist/components/Swatch.svelte.d.ts +30 -0
  42. package/dist/components/Switch.svelte.d.ts +4 -0
  43. package/dist/components/Table.svelte.d.ts +4 -0
  44. package/dist/components/Tabs.svelte.d.ts +26 -0
  45. package/dist/components/Tilt.svelte.d.ts +4 -0
  46. package/dist/components/Timeline.svelte.d.ts +4 -0
  47. package/dist/components/Toggle.svelte.d.ts +7 -0
  48. package/dist/components/Toolbar.svelte.d.ts +8 -0
  49. package/dist/components/ToolbarGroup.svelte.d.ts +4 -0
  50. package/dist/components/Tooltip.svelte.d.ts +17 -0
  51. package/dist/components/Tree.svelte.d.ts +31 -0
  52. package/dist/components/TreeTable.svelte.d.ts +4 -0
  53. package/dist/components/UploadFileStatus.svelte.d.ts +19 -0
  54. package/dist/components/UploadProgress.svelte.d.ts +7 -0
  55. package/dist/components/UploadTarget.svelte.d.ts +7 -0
  56. package/dist/components/index.d.ts +54 -0
  57. package/dist/index.d.ts +6 -0
  58. package/dist/markdown-plugin.d.ts +13 -0
  59. package/dist/types/alert-list.d.ts +19 -0
  60. package/dist/types/avatar.d.ts +30 -0
  61. package/dist/types/badge.d.ts +29 -0
  62. package/dist/types/breadcrumbs.d.ts +34 -0
  63. package/dist/types/button.d.ts +63 -0
  64. package/dist/types/card.d.ts +29 -0
  65. package/dist/types/carousel.d.ts +35 -0
  66. package/dist/types/code.d.ts +118 -0
  67. package/dist/types/connector.d.ts +18 -0
  68. package/dist/types/divider.d.ts +16 -0
  69. package/dist/types/floating-action.d.ts +89 -0
  70. package/dist/types/floating-navigation.d.ts +66 -0
  71. package/dist/types/frame.d.ts +24 -0
  72. package/dist/types/index.d.ts +44 -0
  73. package/dist/types/item-content.d.ts +22 -0
  74. package/dist/types/list.d.ts +128 -0
  75. package/dist/types/menu.d.ts +53 -0
  76. package/dist/types/message.d.ts +42 -0
  77. package/dist/types/nav-content.d.ts +23 -0
  78. package/dist/types/palette.d.ts +98 -0
  79. package/dist/types/pill.d.ts +33 -0
  80. package/dist/types/progress-bar.d.ts +16 -0
  81. package/dist/types/range.d.ts +35 -0
  82. package/dist/types/rating.d.ts +33 -0
  83. package/dist/types/responsive-grid.d.ts +19 -0
  84. package/dist/types/reveal.d.ts +37 -0
  85. package/dist/types/search-filter.d.ts +43 -0
  86. package/dist/types/select.d.ts +114 -0
  87. package/dist/types/shine.d.ts +28 -0
  88. package/dist/types/stack.d.ts +29 -0
  89. package/dist/types/status-list.d.ts +35 -0
  90. package/dist/types/stepper.d.ts +56 -0
  91. package/dist/types/switch.d.ts +46 -0
  92. package/dist/types/table.d.ts +148 -0
  93. package/dist/types/tabs.d.ts +68 -0
  94. package/dist/types/tilt.d.ts +22 -0
  95. package/dist/types/timeline.d.ts +30 -0
  96. package/dist/types/toggle.d.ts +54 -0
  97. package/dist/types/toolbar.d.ts +109 -0
  98. package/dist/types/tooltip.d.ts +15 -0
  99. package/dist/types/tree-table.d.ts +79 -0
  100. package/dist/types/tree.d.ts +183 -0
  101. package/dist/types/upload-file-status.d.ts +31 -0
  102. package/dist/types/upload-progress.d.ts +71 -0
  103. package/dist/types/upload-target.d.ts +46 -0
  104. package/dist/utils/palette.d.ts +100 -0
  105. package/dist/utils/shiki.d.ts +20 -0
  106. package/dist/utils/upload.d.ts +21 -0
  107. package/package.json +14 -11
  108. package/src/MarkdownRenderer.svelte +6 -4
  109. package/src/components/Button.svelte +7 -1
  110. package/src/components/LazyTree.svelte +3 -4
  111. package/src/components/List.svelte +1 -1
  112. package/src/components/MultiSelect.svelte +3 -3
  113. package/src/components/Pill.svelte +10 -5
  114. package/src/components/Select.svelte +3 -3
  115. package/src/components/Swatch.svelte +35 -8
  116. package/src/components/Table.svelte +2 -1
  117. package/src/components/Tabs.svelte +1 -2
  118. package/src/components/Toggle.svelte +2 -2
  119. package/src/components/Tree.svelte +1 -2
  120. package/src/components/TreeTable.svelte +2 -1
  121. package/src/components/UploadTarget.svelte +2 -1
  122. package/src/types/button.ts +8 -2
  123. package/src/types/tabs.ts +4 -4
  124. package/src/types/toggle.ts +3 -2
@@ -0,0 +1,43 @@
1
+ /**
2
+ * SearchFilter Component Types
3
+ *
4
+ * Provides types for the standalone SearchFilter component.
5
+ * Parses user input into structured filter objects using parseFilters() from @rokkit/data.
6
+ */
7
+ /**
8
+ * A parsed filter condition.
9
+ */
10
+ export interface FilterObject {
11
+ /** Column to filter (undefined = search all columns) */
12
+ column?: string;
13
+ /** Comparison operator */
14
+ operator: string;
15
+ /** Filter value */
16
+ value: string | number | RegExp;
17
+ }
18
+ /**
19
+ * Snippet for custom filter tag rendering.
20
+ * Parameters: filter, remove callback
21
+ */
22
+ export type SearchFilterTagSnippet = import('svelte').Snippet<[FilterObject, () => void]>;
23
+ /**
24
+ * Props for the SearchFilter component.
25
+ */
26
+ export interface SearchFilterProps {
27
+ /** Parsed filter array (bindable) */
28
+ filters?: FilterObject[];
29
+ /** Debounce delay in ms — default: 300 */
30
+ debounce?: number;
31
+ /** Input placeholder text */
32
+ placeholder?: string;
33
+ /** Column name hints for autocomplete (future use) */
34
+ columns?: string[];
35
+ /** Called when filters change */
36
+ onfilter?: (filters: FilterObject[]) => void;
37
+ /** Additional CSS classes */
38
+ class?: string;
39
+ /** Size variant */
40
+ size?: 'sm' | 'md' | 'lg';
41
+ /** Custom filter tag snippet */
42
+ tag?: SearchFilterTagSnippet;
43
+ }
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Select Component Types
3
+ *
4
+ * Provides types for the data-driven Select and MultiSelect components.
5
+ * Field mapping and data access is handled by ProxyItem from @rokkit/states.
6
+ */
7
+ import type { Snippet } from 'svelte';
8
+ import type { ProxyItem } from '@rokkit/states';
9
+ /**
10
+ * Generic select item - can be any object with mapped fields
11
+ */
12
+ export type SelectItem = Record<string, unknown>;
13
+ /** @deprecated Legacy handlers — will be removed when PaletteManager migrates to Navigator stack */
14
+ export interface SelectItemHandlers {
15
+ onclick: () => void;
16
+ onkeydown: (event: KeyboardEvent) => void;
17
+ }
18
+ /**
19
+ * Snippet type for rendering a single option in the dropdown.
20
+ * The component renders the focusable wrapper; the snippet renders the inner content.
21
+ * Navigator handles click selection via data-path — no handlers needed in snippet.
22
+ */
23
+ export type SelectOptionSnippet = Snippet<[ProxyItem]>;
24
+ /**
25
+ * Snippet type for rendering a group header label.
26
+ */
27
+ export type SelectGroupLabelSnippet = Snippet<[ProxyItem]>;
28
+ /**
29
+ * Snippet type for rendering the selected value display in the trigger button.
30
+ */
31
+ export type SelectValueSnippet = Snippet<[ProxyItem]>;
32
+ /**
33
+ * Snippet type for rendering selected values in MultiSelect trigger.
34
+ * Receives the array of selected ProxyItems.
35
+ */
36
+ export type MultiSelectValueSnippet = Snippet<[ProxyItem[]]>;
37
+ /**
38
+ * Common props shared between Select and MultiSelect
39
+ */
40
+ export interface SelectBaseProps {
41
+ /** Array of select options or groups */
42
+ options?: SelectItem[];
43
+ /** Field mapping — overrides BASE_FIELDS defaults (text → 'label', value → 'value', …) */
44
+ fields?: Record<string, string>;
45
+ /** Placeholder text when no selection */
46
+ placeholder?: string;
47
+ /** Size variant */
48
+ size?: 'sm' | 'md' | 'lg';
49
+ /** Dropdown alignment relative to trigger */
50
+ align?: 'left' | 'right' | 'start' | 'end';
51
+ /** Dropdown slide direction */
52
+ direction?: 'up' | 'down';
53
+ /** Maximum visible rows in dropdown (default: 5) */
54
+ maxRows?: number;
55
+ /** Whether the select is disabled */
56
+ disabled?: boolean;
57
+ /** Additional CSS classes on root element */
58
+ class?: string;
59
+ /** Icons for select states (dropdown arrow, check, remove) */
60
+ icons?: SelectStateIcons;
61
+ /** Custom snippet for rendering options in dropdown */
62
+ option?: SelectOptionSnippet;
63
+ /** Custom snippet for rendering group labels */
64
+ groupLabel?: SelectGroupLabelSnippet;
65
+ /** Enable typeahead filter input in dropdown header */
66
+ filterable?: boolean;
67
+ /** Placeholder text for the filter input */
68
+ filterPlaceholder?: string;
69
+ }
70
+ /**
71
+ * Props for the Select component (single selection)
72
+ */
73
+ export interface SelectProps extends SelectBaseProps {
74
+ /** Currently selected value (bindable) — extracted via item[fields.value] */
75
+ value?: unknown;
76
+ /** Currently selected raw item (bindable) — full object from options array */
77
+ selected?: SelectItem | null;
78
+ /** Called when selection changes */
79
+ onchange?: (value: unknown, item: SelectItem) => void;
80
+ /** Custom snippet for rendering the selected value in the trigger */
81
+ selectedValue?: SelectValueSnippet;
82
+ }
83
+ /**
84
+ * Props for the MultiSelect component (multiple selection)
85
+ */
86
+ export interface MultiSelectProps extends SelectBaseProps {
87
+ /** Currently selected values (bindable) - extracted primitives */
88
+ value?: unknown[];
89
+ /** Currently selected items (bindable) - full item objects for convenience */
90
+ selected?: SelectItem[];
91
+ /** Called when selection changes */
92
+ onchange?: (values: unknown[], items: SelectItem[]) => void;
93
+ /** Maximum number of tags to show before collapsing to count */
94
+ maxDisplay?: number;
95
+ }
96
+ /**
97
+ * Icons configuration for select expand/collapse and selection states.
98
+ */
99
+ export interface SelectStateIcons {
100
+ /** Icon class for dropdown arrow (open state) */
101
+ opened?: string;
102
+ /** Icon class for dropdown arrow (closed state) */
103
+ closed?: string;
104
+ /** Icon class for selected item indicator */
105
+ checked?: string;
106
+ /** Icon class for tag remove button (MultiSelect) */
107
+ remove?: string;
108
+ }
109
+ /**
110
+ * Default state icons — uses semantic names from @rokkit/core
111
+ * that get resolved to actual icon classes via UnoCSS shortcuts.
112
+ */
113
+ export declare const defaultSelectStateIcons: SelectStateIcons;
114
+ export { getSnippet } from './menu.js';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Shine Component Types
3
+ *
4
+ * Renders an SVG specular-lighting filter that tracks pointer position to
5
+ * give wrapped content a moving highlight.
6
+ */
7
+ import type { Snippet } from 'svelte';
8
+ /**
9
+ * Props for the Shine component.
10
+ */
11
+ export interface ShineProps {
12
+ /** Light color. Default `'rgb(var(--primary-500))'`. */
13
+ color?: string;
14
+ /** Light source distance / height — controls highlight spread. Default `300`. */
15
+ radius?: number;
16
+ /** Gaussian blur depth applied to the highlight. Default `1`. */
17
+ depth?: number;
18
+ /** Surface height for the light filter. Default `2`. */
19
+ surfaceScale?: number;
20
+ /** Reflection size — bigger = bigger reflection. Default `0.75`. */
21
+ specularConstant?: number;
22
+ /** Light source focus — bigger = brighter. Default `120`. */
23
+ specularExponent?: number;
24
+ /** Additional CSS class. */
25
+ class?: string;
26
+ /** Content the highlight wraps. */
27
+ children?: Snippet;
28
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Stack Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ /** Layout direction. */
6
+ export type StackDirection = 'vertical' | 'horizontal';
7
+ /** Gap size between children — maps to the theme's spacing scale. */
8
+ export type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
+ /** Cross-axis alignment. */
10
+ export type StackAlign = 'start' | 'center' | 'end' | 'stretch';
11
+ /** Main-axis justification. */
12
+ export type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around';
13
+ /**
14
+ * Props for the Stack component.
15
+ */
16
+ export interface StackProps {
17
+ /** Layout direction. */
18
+ direction?: StackDirection;
19
+ /** Gap size between children. */
20
+ gap?: StackGap;
21
+ /** Cross-axis alignment. */
22
+ align?: StackAlign;
23
+ /** Main-axis justification. */
24
+ justify?: StackJustify;
25
+ /** Stack children. */
26
+ children: Snippet;
27
+ /** Additional CSS class. */
28
+ class?: string;
29
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * StatusList Component Types
3
+ *
4
+ * Renders a vertical list of status rows — each with a label and a status
5
+ * keyword that maps to a badge icon (e.g. `pass`, `fail`, `warn`).
6
+ */
7
+ import { DEFAULT_STATE_ICONS } from '@rokkit/core';
8
+ /**
9
+ * Built-in badge status keys provided by `@rokkit/core`. Consumers may also
10
+ * pass any other string and supply a matching entry via the `icons` prop.
11
+ */
12
+ export type StatusListStatus = keyof typeof DEFAULT_STATE_ICONS.badge | (string & {});
13
+ /**
14
+ * One row in a StatusList — a label paired with a status keyword.
15
+ */
16
+ export interface StatusListItem {
17
+ /** Text rendered for this row. */
18
+ text: string;
19
+ /** Status keyword used to look up the badge icon. */
20
+ status: StatusListStatus;
21
+ }
22
+ /**
23
+ * Props for the StatusList component.
24
+ */
25
+ export interface StatusListProps {
26
+ /** Additional CSS class applied to the root element. */
27
+ class?: string;
28
+ /** Rows to render. */
29
+ items: StatusListItem[];
30
+ /**
31
+ * Override the default badge icon map (`pass` / `fail` / `warn` / `unknown`).
32
+ * Merged on top of `DEFAULT_STATE_ICONS.badge` from `@rokkit/core`.
33
+ */
34
+ icons?: Partial<Record<string, string>>;
35
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Stepper Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ /** Layout orientation for the stepper. */
6
+ export type StepperOrientation = 'horizontal' | 'vertical';
7
+ /**
8
+ * Definition for a single step in the stepper.
9
+ */
10
+ export interface StepperStep {
11
+ /** Step label (shown below the circle). */
12
+ text: string;
13
+ /** Short text shown inside the circle. Default: step number. */
14
+ label?: string;
15
+ /** Step is finished — shows the check icon. */
16
+ completed?: boolean;
17
+ /** Step cannot be navigated to. */
18
+ disabled?: boolean;
19
+ /** Number of sub-stages within this step. Default `1`. */
20
+ stages?: number;
21
+ }
22
+ /**
23
+ * Icon overrides for the Stepper component.
24
+ */
25
+ export interface StepperIcons {
26
+ /** Icon class for the check / completed state. */
27
+ check?: string;
28
+ }
29
+ /**
30
+ * Props for the Stepper component.
31
+ */
32
+ export interface StepperProps {
33
+ /** Array of step definitions. */
34
+ steps?: StepperStep[];
35
+ /** Current step index (bindable). */
36
+ current?: number;
37
+ /** Current sub-stage within the step (bindable, 0-based). */
38
+ currentStage?: number;
39
+ /**
40
+ * In linear mode only completed steps + the first incomplete step
41
+ * are clickable.
42
+ */
43
+ linear?: boolean;
44
+ /** Layout orientation. */
45
+ orientation?: StepperOrientation;
46
+ /** Accessible label for the surrounding group. */
47
+ label?: string;
48
+ /** Custom icon overrides. */
49
+ icons?: StepperIcons;
50
+ /** Called when a step (or sub-stage dot) is clicked. */
51
+ onclick?: (step: number, stage?: number) => void;
52
+ /** Content snippet rendered below the stepper. */
53
+ content?: Snippet<[StepperStep, number]>;
54
+ /** Additional CSS class. */
55
+ class?: string;
56
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Switch Component Types
3
+ *
4
+ * Provides types for the iOS-style Switch component.
5
+ * Field mapping and data access is handled by ProxyItem from @rokkit/states.
6
+ */
7
+ /**
8
+ * Field mapping configuration for switch option data.
9
+ * Maps custom data field names to the component's expected properties.
10
+ */
11
+ export interface SwitchFields {
12
+ text?: string;
13
+ value?: string;
14
+ icon?: string;
15
+ disabled?: string;
16
+ description?: string;
17
+ }
18
+ /**
19
+ * A switch option — can be any object, primitive, or boolean.
20
+ * Processed through ProxyItem for field resolution.
21
+ */
22
+ export type SwitchItem = Record<string, unknown> | string | number | boolean;
23
+ /**
24
+ * Props for the Switch component
25
+ */
26
+ export interface SwitchProps {
27
+ /**
28
+ * Exactly two options. First = off/unchecked. Second = on/checked.
29
+ * @default [false, true]
30
+ */
31
+ options?: [SwitchItem, SwitchItem];
32
+ /** Field mapping configuration */
33
+ fields?: SwitchFields;
34
+ /** Currently selected value */
35
+ value?: unknown;
36
+ /** Called when the switch changes */
37
+ onchange?: (value: unknown, item: SwitchItem) => void;
38
+ /** Whether to show text labels beside the track */
39
+ showLabels?: boolean;
40
+ /** Size variant */
41
+ size?: 'sm' | 'md' | 'lg';
42
+ /** Whether the switch is disabled */
43
+ disabled?: boolean;
44
+ /** Additional CSS classes */
45
+ class?: string;
46
+ }
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Table Component Types
3
+ *
4
+ * Provides types for the data-driven Table component.
5
+ * Supports flat tables with sortable columns, row selection, and keyboard navigation.
6
+ * Field mapping and data access is handled by ProxyItem from @rokkit/states per cell.
7
+ */
8
+ /**
9
+ * Column definition for the Table component.
10
+ * Can be auto-derived from data or provided explicitly.
11
+ */
12
+ export interface TableColumn {
13
+ /** Data key for this column */
14
+ name: string;
15
+ /** Display header text (defaults to name) */
16
+ label?: string;
17
+ /** Data type (auto-derived: 'string', 'number', etc.) */
18
+ type?: string;
19
+ /** Whether this column is sortable — default: true */
20
+ sortable?: boolean;
21
+ /** Current sort direction */
22
+ sorted?: 'none' | 'ascending' | 'descending';
23
+ /** CSS width (e.g., '200px', '20%') */
24
+ width?: string;
25
+ /** Text alignment */
26
+ align?: 'left' | 'center' | 'right';
27
+ /** Field mapping — maps ProxyItem slots to data keys */
28
+ fields?: {
29
+ text?: string;
30
+ icon?: string;
31
+ badge?: string;
32
+ description?: string;
33
+ };
34
+ /** Value formatter for display */
35
+ formatter?: (value: unknown, row: Record<string, unknown>) => string;
36
+ /** Icon formatter — transforms icon field value to icon class */
37
+ iconFormatter?: (value: unknown) => string;
38
+ /** Named snippet for custom cell rendering */
39
+ snippet?: string;
40
+ }
41
+ /**
42
+ * Represents the sort state for a single column.
43
+ */
44
+ export interface SortState {
45
+ /** Column name */
46
+ column: string;
47
+ /** Sort direction */
48
+ direction: 'ascending' | 'descending';
49
+ }
50
+ /**
51
+ * Row-level field mapping configuration.
52
+ */
53
+ export interface TableFields {
54
+ /** Field for row value used in selection matching — default: 'id' */
55
+ value?: string;
56
+ /** Field for disabled state — default: 'disabled' */
57
+ disabled?: string;
58
+ }
59
+ /**
60
+ * Default row-level field mapping values.
61
+ */
62
+ export declare const defaultTableFields: Required<TableFields>;
63
+ /**
64
+ * Icons for sort state indicators.
65
+ */
66
+ export interface TableSortIcons {
67
+ /** Icon for unsorted column */
68
+ none?: string;
69
+ /** Icon for ascending sort */
70
+ ascending?: string;
71
+ /** Icon for descending sort */
72
+ descending?: string;
73
+ }
74
+ /**
75
+ * Default sort icons from @rokkit/core state icons.
76
+ */
77
+ export declare const defaultTableSortIcons: TableSortIcons;
78
+ /**
79
+ * Snippet for custom header rendering.
80
+ * Parameters: columns, sortState
81
+ */
82
+ export type TableHeaderSnippet = import('svelte').Snippet<[TableColumn[], SortState[]]>;
83
+ /**
84
+ * Snippet for custom row rendering.
85
+ * Parameters: row, columns, index, isSelected
86
+ */
87
+ export type TableRowSnippet = import('svelte').Snippet<[
88
+ Record<string, unknown>,
89
+ TableColumn[],
90
+ number,
91
+ boolean
92
+ ]>;
93
+ /**
94
+ * Snippet for custom cell rendering.
95
+ * Parameters: value, column, row
96
+ */
97
+ export type TableCellSnippet = import('svelte').Snippet<[
98
+ unknown,
99
+ TableColumn,
100
+ Record<string, unknown>
101
+ ]>;
102
+ /**
103
+ * Snippet for empty state.
104
+ */
105
+ export type TableEmptySnippet = import('svelte').Snippet<[]>;
106
+ /**
107
+ * Props for the Table component.
108
+ */
109
+ export interface TableProps {
110
+ /** Data array — each object is a row */
111
+ data?: Record<string, unknown>[];
112
+ /** Column definitions (auto-derived from data if not provided) */
113
+ columns?: TableColumn[];
114
+ /** Currently selected row value (single-select) */
115
+ value?: unknown;
116
+ /** Currently selected row values (multi-select, bindable) */
117
+ values?: unknown[];
118
+ /** Selection mode: 'single' (default), 'multi', or false (no selection) */
119
+ selectable?: 'single' | 'multi' | false;
120
+ /** Table caption for accessibility */
121
+ caption?: string;
122
+ /** Size variant */
123
+ size?: 'sm' | 'md' | 'lg';
124
+ /** Enable alternating row colors */
125
+ striped?: boolean;
126
+ /** Enable responsive card layout on mobile (< 640px) */
127
+ responsive?: boolean;
128
+ /** Whether the entire table is disabled */
129
+ disabled?: boolean;
130
+ /** Row-level field mapping */
131
+ fields?: TableFields;
132
+ /** Called when a row is selected */
133
+ onselect?: (value: unknown, row: Record<string, unknown>) => void;
134
+ /** Called when sort state changes */
135
+ onsort?: (sortState: SortState[]) => void;
136
+ /** Additional CSS classes */
137
+ class?: string;
138
+ /** Sort indicator icons */
139
+ icons?: TableSortIcons;
140
+ /** Custom header snippet */
141
+ header?: TableHeaderSnippet;
142
+ /** Custom row snippet */
143
+ row?: TableRowSnippet;
144
+ /** Custom cell snippet */
145
+ cell?: TableCellSnippet;
146
+ /** Empty state snippet */
147
+ empty?: TableEmptySnippet;
148
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Tabs Component Types
3
+ *
4
+ * Provides types for the data-driven Tabs component.
5
+ * Field mapping and data access is handled by ProxyItem from @rokkit/states.
6
+ */
7
+ import type { Snippet } from 'svelte';
8
+ import type { ProxyItem } from '@rokkit/states';
9
+ /**
10
+ * Generic tab item - can be any object with mapped fields
11
+ */
12
+ export type TabsItem = Record<string, unknown>;
13
+ /**
14
+ * Snippet type for rendering tab triggers (headers).
15
+ * The component renders the focusable wrapper; the snippet renders the inner content.
16
+ * Navigator handles click selection via data-path — no handlers needed in snippet.
17
+ * Receives the ProxyItem and whether this item is currently selected.
18
+ */
19
+ export type TabsItemSnippet = Snippet<[ProxyItem, boolean]>;
20
+ /**
21
+ * Snippet type for rendering tab panel content.
22
+ */
23
+ export type TabsPanelSnippet = Snippet<[ProxyItem]>;
24
+ /**
25
+ * Snippet type for rendering the empty state.
26
+ */
27
+ export type TabsEmptySnippet = Snippet<[]>;
28
+ /**
29
+ * Props for the Tabs component
30
+ */
31
+ export interface TabsProps {
32
+ /** Array of tab options */
33
+ options?: TabsItem[];
34
+ /** Field mapping — overrides BASE_FIELDS defaults (text → 'label', value → 'value', …) */
35
+ fields?: Record<string, string>;
36
+ /** Currently selected tab value */
37
+ value?: unknown;
38
+ /** Orientation of the tab list */
39
+ orientation?: 'horizontal' | 'vertical';
40
+ /** Position of the tab list relative to panels */
41
+ position?: 'before' | 'after';
42
+ /** Alignment of tabs within the tab list */
43
+ align?: 'start' | 'center' | 'end';
44
+ /** Accessible name for the tab list */
45
+ name?: string;
46
+ /** Whether tabs can be added/removed */
47
+ editable?: boolean;
48
+ /** Placeholder text when no tab is selected */
49
+ placeholder?: string;
50
+ /** Whether the entire tab component is disabled */
51
+ disabled?: boolean;
52
+ /** Additional CSS classes */
53
+ class?: string;
54
+ /** Called when selection changes — receives the value and the tab's ProxyItem */
55
+ onchange?: (value: unknown, item: ProxyItem) => void;
56
+ /** Called when a tab is selected (fires on every click, including same tab) — receives the value and the tab's ProxyItem */
57
+ onselect?: (value: unknown, item: ProxyItem) => void;
58
+ /** Called when a new tab is requested (editable mode) */
59
+ onadd?: () => void;
60
+ /** Called when a tab removal is requested (editable mode) */
61
+ onremove?: (value: unknown) => void;
62
+ /** Custom snippet for rendering tab triggers */
63
+ tabItem?: TabsItemSnippet;
64
+ /** Custom snippet for rendering tab panel content */
65
+ tabPanel?: TabsPanelSnippet;
66
+ /** Custom snippet for rendering the empty state */
67
+ empty?: TabsEmptySnippet;
68
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tilt Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ /**
6
+ * Props for the Tilt component.
7
+ *
8
+ * Wraps content in a container that rotates in response to pointer
9
+ * movement, with optional brightness modulation.
10
+ */
11
+ export interface TiltProps {
12
+ /** Maximum rotation angle in degrees. Default `10`. */
13
+ maxRotation?: number;
14
+ /** Whether to adjust brightness based on pointer Y position. */
15
+ setBrightness?: boolean;
16
+ /** CSS perspective value in pixels. Default `600`. */
17
+ perspective?: number;
18
+ /** Additional CSS class. */
19
+ class?: string;
20
+ /** Content to tilt. */
21
+ children?: Snippet;
22
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Timeline Component Types
3
+ *
4
+ * View-only vertical steps for instructions, changelogs,
5
+ * or process visualization. No interaction.
6
+ */
7
+ import type { Snippet } from 'svelte';
8
+ export interface TimelineFields {
9
+ label?: string;
10
+ icon?: string;
11
+ subtext?: string;
12
+ }
13
+ export declare const defaultTimelineFields: Required<TimelineFields>;
14
+ export interface TimelineIcons {
15
+ /** Icon class for completed state (default: i-lucide:check) */
16
+ completed?: string;
17
+ }
18
+ export declare const defaultTimelineIcons: Required<TimelineIcons>;
19
+ export interface TimelineProps {
20
+ /** Array of timeline items */
21
+ items?: Record<string, unknown>[];
22
+ /** Field mapping configuration */
23
+ fields?: TimelineFields;
24
+ /** Custom icons */
25
+ icons?: TimelineIcons;
26
+ /** Additional CSS class */
27
+ class?: string;
28
+ /** Custom content snippet for each item: (item, index) */
29
+ content?: Snippet<[Record<string, unknown>, number]>;
30
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Toggle Component Types
3
+ *
4
+ * Provides types for the data-driven Toggle component.
5
+ * Field mapping and data access is handled by ProxyItem from @rokkit/states.
6
+ */
7
+ import type { Snippet } from 'svelte';
8
+ import type { ProxyItem } from '@rokkit/states';
9
+ /**
10
+ * Generic toggle item — data-driven, so it accepts primitives
11
+ * (string/number) as well as objects with mapped fields.
12
+ */
13
+ export type ToggleItem = string | number | Record<string, unknown>;
14
+ /**
15
+ * Snippet for rendering a toggle option.
16
+ * The component renders the button wrapper; the snippet renders inner content.
17
+ * Receives the ProxyItem and whether this item is currently selected.
18
+ */
19
+ export type ToggleItemSnippet = Snippet<[ProxyItem, boolean]>;
20
+ /**
21
+ * Visual variant of the Toggle.
22
+ * - `'group'` (default) — segmented radio-group rendering, one button per option.
23
+ * - `'button'` — single button that cycles through the options on each click.
24
+ * The rendered content represents the *next* option (the one you'd switch to),
25
+ * so users can read the click destination at a glance.
26
+ */
27
+ export type ToggleVariant = 'group' | 'button';
28
+ /**
29
+ * Props for the Toggle component
30
+ */
31
+ export interface ToggleProps {
32
+ /** Visual variant. Default: 'group'. */
33
+ variant?: ToggleVariant;
34
+ /** Array of toggle options (strings, numbers, or objects) */
35
+ options?: ToggleItem[];
36
+ /** Field mapping — overrides BASE_FIELDS defaults (text → 'label', value → 'value', …) */
37
+ fields?: Record<string, string>;
38
+ /** Currently selected value (bindable) */
39
+ value?: unknown;
40
+ /** Called when selection changes */
41
+ onchange?: (value: unknown, item: ToggleItem) => void;
42
+ /** Whether to show text labels alongside icons */
43
+ showLabels?: boolean;
44
+ /** Size variant */
45
+ size?: 'sm' | 'md' | 'lg';
46
+ /** Whether the entire toggle is disabled */
47
+ disabled?: boolean;
48
+ /** Accessible label for the radiogroup. Default: messages.toggle.label */
49
+ label?: string;
50
+ /** Additional CSS classes */
51
+ class?: string;
52
+ /** Custom snippet for rendering toggle options */
53
+ item?: ToggleItemSnippet;
54
+ }