@rokkit/ui 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +63 -0
- package/dist/index.js +8 -0
- package/dist/markdown-plugin.js +1 -0
- package/dist/types/alert-list.js +7 -0
- package/dist/types/avatar.js +4 -0
- package/dist/types/badge.js +4 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +7 -0
- package/dist/types/card.js +4 -0
- package/dist/types/carousel.js +4 -0
- package/dist/types/chat.js +1 -0
- package/dist/types/code.js +12 -0
- package/dist/types/connector.js +8 -0
- package/dist/types/divider.js +4 -0
- package/dist/types/floating-action.js +12 -0
- package/dist/types/floating-navigation.js +1 -0
- package/dist/types/frame.js +8 -0
- package/dist/types/index.js +93 -0
- package/dist/types/item-content.js +8 -0
- package/dist/types/item-switch.js +10 -0
- package/dist/types/item-toggle.js +12 -0
- package/dist/types/list.js +36 -0
- package/dist/types/lock-mode.js +1 -0
- package/dist/types/menu.js +25 -0
- package/dist/types/message.js +4 -0
- package/dist/types/nav-content.js +4 -0
- package/dist/types/palette.js +54 -0
- package/dist/types/pill.js +4 -0
- package/dist/types/progress-bar.js +4 -0
- package/dist/types/range.js +7 -0
- package/dist/types/rating.js +4 -0
- package/dist/types/responsive-grid.js +4 -0
- package/dist/types/reveal.js +4 -0
- package/dist/types/search-filter.js +7 -0
- package/dist/types/select.js +21 -0
- package/dist/types/shine.js +7 -0
- package/dist/types/stack.js +4 -0
- package/dist/types/status-list.js +7 -0
- package/dist/types/stepper.js +4 -0
- package/dist/types/switch.js +7 -0
- package/dist/types/table.js +23 -0
- package/dist/types/tabs.js +7 -0
- package/dist/types/tilt.js +4 -0
- package/dist/types/timeline.js +14 -0
- package/dist/types/toggle.js +7 -0
- package/dist/types/toolbar.js +20 -0
- package/dist/types/tooltip.js +1 -0
- package/dist/types/tree-table.js +10 -0
- package/dist/types/tree.js +94 -0
- package/dist/types/upload-file-status.js +8 -0
- package/dist/types/upload-progress.js +8 -0
- package/dist/types/upload-target.js +7 -0
- package/dist/utils/palette.js +641 -0
- package/dist/utils/relative-time.js +17 -0
- package/dist/utils/shiki.js +118 -0
- package/package.json +13 -14
- package/src/components/index.ts +0 -63
- package/src/index.ts +0 -75
- package/src/markdown-plugin.ts +0 -12
- package/src/types/alert-list.ts +0 -28
- package/src/types/avatar.ts +0 -41
- package/src/types/badge.ts +0 -37
- package/src/types/breadcrumbs.ts +0 -43
- package/src/types/button.ts +0 -92
- package/src/types/card.ts +0 -38
- package/src/types/carousel.ts +0 -49
- package/src/types/chat.ts +0 -81
- package/src/types/code.ts +0 -147
- package/src/types/connector.ts +0 -22
- package/src/types/divider.ts +0 -20
- package/src/types/floating-action.ts +0 -123
- package/src/types/floating-navigation.ts +0 -80
- package/src/types/frame.ts +0 -29
- package/src/types/index.ts +0 -137
- package/src/types/item-content.ts +0 -26
- package/src/types/item-switch.ts +0 -34
- package/src/types/item-toggle.ts +0 -52
- package/src/types/list.ts +0 -200
- package/src/types/lock-mode.ts +0 -16
- package/src/types/menu.ts +0 -95
- package/src/types/message.ts +0 -54
- package/src/types/nav-content.ts +0 -31
- package/src/types/palette.ts +0 -160
- package/src/types/pill.ts +0 -43
- package/src/types/progress-bar.ts +0 -19
- package/src/types/range.ts +0 -51
- package/src/types/rating.ts +0 -43
- package/src/types/responsive-grid.ts +0 -25
- package/src/types/reveal.ts +0 -49
- package/src/types/search-filter.ts +0 -67
- package/src/types/select.ts +0 -176
- package/src/types/shine.ts +0 -37
- package/src/types/stack.ts +0 -40
- package/src/types/status-list.ts +0 -42
- package/src/types/stepper.ts +0 -74
- package/src/types/switch.ts +0 -68
- package/src/types/table.ts +0 -219
- package/src/types/tabs.ts +0 -103
- package/src/types/tilt.ts +0 -28
- package/src/types/timeline.ts +0 -53
- package/src/types/toggle.ts +0 -81
- package/src/types/toolbar.ts +0 -167
- package/src/types/tooltip.ts +0 -21
- package/src/types/tree-table.ts +0 -103
- package/src/types/tree.ts +0 -302
- package/src/types/upload-file-status.ts +0 -45
- package/src/types/upload-progress.ts +0 -111
- package/src/types/upload-target.ts +0 -71
- package/src/utils/palette.ts +0 -750
- package/src/utils/relative-time.ts +0 -12
- package/src/utils/shiki.ts +0 -137
- /package/{src → dist}/MarkdownRenderer.svelte +0 -0
- /package/{src → dist}/components/AlertList.svelte +0 -0
- /package/{src → dist}/components/Avatar.svelte +0 -0
- /package/{src → dist}/components/Badge.svelte +0 -0
- /package/{src → dist}/components/BreadCrumbs.svelte +0 -0
- /package/{src → dist}/components/Button.svelte +0 -0
- /package/{src → dist}/components/ButtonGroup.svelte +0 -0
- /package/{src → dist}/components/Card.svelte +0 -0
- /package/{src → dist}/components/Carousel.svelte +0 -0
- /package/{src → dist}/components/ChatComposer.svelte +0 -0
- /package/{src → dist}/components/ChatHistory.svelte +0 -0
- /package/{src → dist}/components/ChatMessage.svelte +0 -0
- /package/{src → dist}/components/ChatShell.svelte +0 -0
- /package/{src → dist}/components/ChatTimeline.svelte +0 -0
- /package/{src → dist}/components/Code.svelte +0 -0
- /package/{src → dist}/components/CodeBlock.svelte +0 -0
- /package/{src → dist}/components/CodeGroup.svelte +0 -0
- /package/{src → dist}/components/CommandPalette.svelte +0 -0
- /package/{src → dist}/components/Connector.svelte +0 -0
- /package/{src → dist}/components/Divider.svelte +0 -0
- /package/{src → dist}/components/Dropdown.svelte +0 -0
- /package/{src → dist}/components/FloatingAction.svelte +0 -0
- /package/{src → dist}/components/FloatingNavigation.svelte +0 -0
- /package/{src → dist}/components/Frame.svelte +0 -0
- /package/{src → dist}/components/Grid.svelte +0 -0
- /package/{src → dist}/components/ItemContent.svelte +0 -0
- /package/{src → dist}/components/ItemSwitch.svelte +0 -0
- /package/{src → dist}/components/ItemToggle.svelte +0 -0
- /package/{src → dist}/components/LazyTree.svelte +0 -0
- /package/{src → dist}/components/List.svelte +0 -0
- /package/{src → dist}/components/LockMode.svelte +0 -0
- /package/{src → dist}/components/Menu.svelte +0 -0
- /package/{src → dist}/components/Message.svelte +0 -0
- /package/{src → dist}/components/MultiSelect.svelte +0 -0
- /package/{src → dist}/components/NavContent.svelte +0 -0
- /package/{src → dist}/components/PaletteManager.svelte +0 -0
- /package/{src → dist}/components/Pill.svelte +0 -0
- /package/{src → dist}/components/ProgressBar.svelte +0 -0
- /package/{src → dist}/components/Range.svelte +0 -0
- /package/{src → dist}/components/Rating.svelte +0 -0
- /package/{src → dist}/components/ResponsiveGrid.svelte +0 -0
- /package/{src → dist}/components/Reveal.svelte +0 -0
- /package/{src → dist}/components/SearchFilter.svelte +0 -0
- /package/{src → dist}/components/Select.svelte +0 -0
- /package/{src → dist}/components/Shine.svelte +0 -0
- /package/{src → dist}/components/Stack.svelte +0 -0
- /package/{src → dist}/components/StatusList.svelte +0 -0
- /package/{src → dist}/components/Stepper.svelte +0 -0
- /package/{src → dist}/components/Swatch.svelte +0 -0
- /package/{src → dist}/components/Switch.svelte +0 -0
- /package/{src → dist}/components/Table.svelte +0 -0
- /package/{src → dist}/components/Tabs.svelte +0 -0
- /package/{src → dist}/components/Tilt.svelte +0 -0
- /package/{src → dist}/components/Timeline.svelte +0 -0
- /package/{src → dist}/components/Toggle.svelte +0 -0
- /package/{src → dist}/components/Toolbar.svelte +0 -0
- /package/{src → dist}/components/ToolbarGroup.svelte +0 -0
- /package/{src → dist}/components/Tooltip.svelte +0 -0
- /package/{src → dist}/components/Tree.svelte +0 -0
- /package/{src → dist}/components/TreeTable.svelte +0 -0
- /package/{src → dist}/components/UploadFileStatus.svelte +0 -0
- /package/{src → dist}/components/UploadProgress.svelte +0 -0
- /package/{src → dist}/components/UploadTarget.svelte +0 -0
- /package/{src → dist}/utils/upload.js +0 -0
package/src/types/table.ts
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
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
|
-
import { DEFAULT_STATE_ICONS } from '@rokkit/core'
|
|
10
|
-
|
|
11
|
-
// =============================================================================
|
|
12
|
-
// Column Types
|
|
13
|
-
// =============================================================================
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Column definition for the Table component.
|
|
17
|
-
* Can be auto-derived from data or provided explicitly.
|
|
18
|
-
*/
|
|
19
|
-
export interface TableColumn {
|
|
20
|
-
/** Data key for this column */
|
|
21
|
-
name: string
|
|
22
|
-
|
|
23
|
-
/** Display header text (defaults to name) */
|
|
24
|
-
label?: string
|
|
25
|
-
|
|
26
|
-
/** Data type (auto-derived: 'string', 'number', etc.) */
|
|
27
|
-
type?: string
|
|
28
|
-
|
|
29
|
-
/** Whether this column is sortable — default: true */
|
|
30
|
-
sortable?: boolean
|
|
31
|
-
|
|
32
|
-
/** Current sort direction */
|
|
33
|
-
sorted?: 'none' | 'ascending' | 'descending'
|
|
34
|
-
|
|
35
|
-
/** CSS width (e.g., '200px', '20%') */
|
|
36
|
-
width?: string
|
|
37
|
-
|
|
38
|
-
/** Text alignment */
|
|
39
|
-
align?: 'left' | 'center' | 'right'
|
|
40
|
-
|
|
41
|
-
/** Field mapping — maps ProxyItem slots to data keys */
|
|
42
|
-
fields?: {
|
|
43
|
-
text?: string
|
|
44
|
-
icon?: string
|
|
45
|
-
badge?: string
|
|
46
|
-
description?: string
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** Value formatter for display */
|
|
50
|
-
formatter?: (value: unknown, row: Record<string, unknown>) => string
|
|
51
|
-
|
|
52
|
-
/** Icon formatter — transforms icon field value to icon class */
|
|
53
|
-
iconFormatter?: (value: unknown) => string
|
|
54
|
-
|
|
55
|
-
/** Named snippet for custom cell rendering */
|
|
56
|
-
snippet?: string
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// =============================================================================
|
|
60
|
-
// Sort Types
|
|
61
|
-
// =============================================================================
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Represents the sort state for a single column.
|
|
65
|
-
*/
|
|
66
|
-
export interface SortState {
|
|
67
|
-
/** Column name */
|
|
68
|
-
column: string
|
|
69
|
-
|
|
70
|
-
/** Sort direction */
|
|
71
|
-
direction: 'ascending' | 'descending'
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// =============================================================================
|
|
75
|
-
// Field Mapping Types
|
|
76
|
-
// =============================================================================
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Row-level field mapping configuration.
|
|
80
|
-
*/
|
|
81
|
-
export interface TableFields {
|
|
82
|
-
/** Field for row value used in selection matching — default: 'id' */
|
|
83
|
-
value?: string
|
|
84
|
-
|
|
85
|
-
/** Field for disabled state — default: 'disabled' */
|
|
86
|
-
disabled?: string
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Default row-level field mapping values.
|
|
91
|
-
*/
|
|
92
|
-
export const defaultTableFields: Required<TableFields> = {
|
|
93
|
-
value: 'id',
|
|
94
|
-
disabled: 'disabled'
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// =============================================================================
|
|
98
|
-
// Sort Icons
|
|
99
|
-
// =============================================================================
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Icons for sort state indicators.
|
|
103
|
-
*/
|
|
104
|
-
export interface TableSortIcons {
|
|
105
|
-
/** Icon for unsorted column */
|
|
106
|
-
none?: string
|
|
107
|
-
|
|
108
|
-
/** Icon for ascending sort */
|
|
109
|
-
ascending?: string
|
|
110
|
-
|
|
111
|
-
/** Icon for descending sort */
|
|
112
|
-
descending?: string
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Default sort icons from @rokkit/core state icons.
|
|
117
|
-
*/
|
|
118
|
-
export const defaultTableSortIcons: TableSortIcons = {
|
|
119
|
-
none: DEFAULT_STATE_ICONS.sort.none,
|
|
120
|
-
ascending: DEFAULT_STATE_ICONS.sort.ascending,
|
|
121
|
-
descending: DEFAULT_STATE_ICONS.sort.descending
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// =============================================================================
|
|
125
|
-
// Snippet Types
|
|
126
|
-
// =============================================================================
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Snippet for custom header rendering.
|
|
130
|
-
* Parameters: columns, sortState
|
|
131
|
-
*/
|
|
132
|
-
export type TableHeaderSnippet = import('svelte').Snippet<[TableColumn[], SortState[]]>
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Snippet for custom row rendering.
|
|
136
|
-
* Parameters: row, columns, index, isSelected
|
|
137
|
-
*/
|
|
138
|
-
export type TableRowSnippet = import('svelte').Snippet<
|
|
139
|
-
[Record<string, unknown>, TableColumn[], number, boolean]
|
|
140
|
-
>
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Snippet for custom cell rendering.
|
|
144
|
-
* Parameters: value, column, row
|
|
145
|
-
*/
|
|
146
|
-
export type TableCellSnippet = import('svelte').Snippet<
|
|
147
|
-
[unknown, TableColumn, Record<string, unknown>]
|
|
148
|
-
>
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Snippet for empty state.
|
|
152
|
-
*/
|
|
153
|
-
export type TableEmptySnippet = import('svelte').Snippet<[]>
|
|
154
|
-
|
|
155
|
-
// =============================================================================
|
|
156
|
-
// Component Props
|
|
157
|
-
// =============================================================================
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Props for the Table component.
|
|
161
|
-
*/
|
|
162
|
-
export interface TableProps {
|
|
163
|
-
/** Data array — each object is a row */
|
|
164
|
-
data?: Record<string, unknown>[]
|
|
165
|
-
|
|
166
|
-
/** Column definitions (auto-derived from data if not provided) */
|
|
167
|
-
columns?: TableColumn[]
|
|
168
|
-
|
|
169
|
-
/** Currently selected row value (single-select) */
|
|
170
|
-
value?: unknown
|
|
171
|
-
|
|
172
|
-
/** Currently selected row values (multi-select, bindable) */
|
|
173
|
-
values?: unknown[]
|
|
174
|
-
|
|
175
|
-
/** Selection mode: 'single' (default), 'multi', or false (no selection) */
|
|
176
|
-
selectable?: 'single' | 'multi' | false
|
|
177
|
-
|
|
178
|
-
/** Table caption for accessibility */
|
|
179
|
-
caption?: string
|
|
180
|
-
|
|
181
|
-
/** Size variant */
|
|
182
|
-
size?: 'sm' | 'md' | 'lg'
|
|
183
|
-
|
|
184
|
-
/** Enable alternating row colors */
|
|
185
|
-
striped?: boolean
|
|
186
|
-
|
|
187
|
-
/** Enable responsive card layout on mobile (< 640px) */
|
|
188
|
-
responsive?: boolean
|
|
189
|
-
|
|
190
|
-
/** Whether the entire table is disabled */
|
|
191
|
-
disabled?: boolean
|
|
192
|
-
|
|
193
|
-
/** Row-level field mapping */
|
|
194
|
-
fields?: TableFields
|
|
195
|
-
|
|
196
|
-
/** Called when a row is selected */
|
|
197
|
-
onselect?: (value: unknown, row: Record<string, unknown>) => void
|
|
198
|
-
|
|
199
|
-
/** Called when sort state changes */
|
|
200
|
-
onsort?: (sortState: SortState[]) => void
|
|
201
|
-
|
|
202
|
-
/** Additional CSS classes */
|
|
203
|
-
class?: string
|
|
204
|
-
|
|
205
|
-
/** Sort indicator icons */
|
|
206
|
-
icons?: TableSortIcons
|
|
207
|
-
|
|
208
|
-
/** Custom header snippet */
|
|
209
|
-
header?: TableHeaderSnippet
|
|
210
|
-
|
|
211
|
-
/** Custom row snippet */
|
|
212
|
-
row?: TableRowSnippet
|
|
213
|
-
|
|
214
|
-
/** Custom cell snippet */
|
|
215
|
-
cell?: TableCellSnippet
|
|
216
|
-
|
|
217
|
-
/** Empty state snippet */
|
|
218
|
-
empty?: TableEmptySnippet
|
|
219
|
-
}
|
package/src/types/tabs.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
import type { Snippet } from 'svelte'
|
|
9
|
-
import type { ProxyItem } from '@rokkit/states'
|
|
10
|
-
|
|
11
|
-
// =============================================================================
|
|
12
|
-
// Tabs Item Types
|
|
13
|
-
// =============================================================================
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Generic tab item - can be any object with mapped fields
|
|
17
|
-
*/
|
|
18
|
-
export type TabsItem = Record<string, unknown>
|
|
19
|
-
|
|
20
|
-
// =============================================================================
|
|
21
|
-
// Snippet Types — ProxyItem-based API
|
|
22
|
-
// =============================================================================
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Snippet type for rendering tab triggers (headers).
|
|
26
|
-
* The component renders the focusable wrapper; the snippet renders the inner content.
|
|
27
|
-
* Navigator handles click selection via data-path — no handlers needed in snippet.
|
|
28
|
-
* Receives the ProxyItem and whether this item is currently selected.
|
|
29
|
-
*/
|
|
30
|
-
export type TabsItemSnippet = Snippet<[ProxyItem, boolean]>
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Snippet type for rendering tab panel content.
|
|
34
|
-
*/
|
|
35
|
-
export type TabsPanelSnippet = Snippet<[ProxyItem]>
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Snippet type for rendering the empty state.
|
|
39
|
-
*/
|
|
40
|
-
export type TabsEmptySnippet = Snippet<[]>
|
|
41
|
-
|
|
42
|
-
// =============================================================================
|
|
43
|
-
// Component Props Types
|
|
44
|
-
// =============================================================================
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Props for the Tabs component
|
|
48
|
-
*/
|
|
49
|
-
export interface TabsProps {
|
|
50
|
-
/** Array of tab options */
|
|
51
|
-
options?: TabsItem[]
|
|
52
|
-
|
|
53
|
-
/** Field mapping — overrides BASE_FIELDS defaults (text → 'label', value → 'value', …) */
|
|
54
|
-
fields?: Record<string, string>
|
|
55
|
-
|
|
56
|
-
/** Currently selected tab value */
|
|
57
|
-
value?: unknown
|
|
58
|
-
|
|
59
|
-
/** Orientation of the tab list */
|
|
60
|
-
orientation?: 'horizontal' | 'vertical'
|
|
61
|
-
|
|
62
|
-
/** Position of the tab list relative to panels */
|
|
63
|
-
position?: 'before' | 'after'
|
|
64
|
-
|
|
65
|
-
/** Alignment of tabs within the tab list */
|
|
66
|
-
align?: 'start' | 'center' | 'end'
|
|
67
|
-
|
|
68
|
-
/** Accessible name for the tab list */
|
|
69
|
-
name?: string
|
|
70
|
-
|
|
71
|
-
/** Whether tabs can be added/removed */
|
|
72
|
-
editable?: boolean
|
|
73
|
-
|
|
74
|
-
/** Placeholder text when no tab is selected */
|
|
75
|
-
placeholder?: string
|
|
76
|
-
|
|
77
|
-
/** Whether the entire tab component is disabled */
|
|
78
|
-
disabled?: boolean
|
|
79
|
-
|
|
80
|
-
/** Additional CSS classes */
|
|
81
|
-
class?: string
|
|
82
|
-
|
|
83
|
-
/** Called when selection changes — receives the value and the tab's ProxyItem */
|
|
84
|
-
onchange?: (value: unknown, item: ProxyItem) => void
|
|
85
|
-
|
|
86
|
-
/** Called when a tab is selected (fires on every click, including same tab) — receives the value and the tab's ProxyItem */
|
|
87
|
-
onselect?: (value: unknown, item: ProxyItem) => void
|
|
88
|
-
|
|
89
|
-
/** Called when a new tab is requested (editable mode) */
|
|
90
|
-
onadd?: () => void
|
|
91
|
-
|
|
92
|
-
/** Called when a tab removal is requested (editable mode) */
|
|
93
|
-
onremove?: (value: unknown) => void
|
|
94
|
-
|
|
95
|
-
/** Custom snippet for rendering tab triggers */
|
|
96
|
-
tabItem?: TabsItemSnippet
|
|
97
|
-
|
|
98
|
-
/** Custom snippet for rendering tab panel content */
|
|
99
|
-
tabPanel?: TabsPanelSnippet
|
|
100
|
-
|
|
101
|
-
/** Custom snippet for rendering the empty state */
|
|
102
|
-
empty?: TabsEmptySnippet
|
|
103
|
-
}
|
package/src/types/tilt.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tilt Component Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Snippet } from 'svelte'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Props for the Tilt component.
|
|
9
|
-
*
|
|
10
|
-
* Wraps content in a container that rotates in response to pointer
|
|
11
|
-
* movement, with optional brightness modulation.
|
|
12
|
-
*/
|
|
13
|
-
export interface TiltProps {
|
|
14
|
-
/** Maximum rotation angle in degrees. Default `10`. */
|
|
15
|
-
maxRotation?: number
|
|
16
|
-
|
|
17
|
-
/** Whether to adjust brightness based on pointer Y position. */
|
|
18
|
-
setBrightness?: boolean
|
|
19
|
-
|
|
20
|
-
/** CSS perspective value in pixels. Default `600`. */
|
|
21
|
-
perspective?: number
|
|
22
|
-
|
|
23
|
-
/** Additional CSS class. */
|
|
24
|
-
class?: string
|
|
25
|
-
|
|
26
|
-
/** Content to tilt. */
|
|
27
|
-
children?: Snippet
|
|
28
|
-
}
|
package/src/types/timeline.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeline Component Types
|
|
3
|
-
*
|
|
4
|
-
* View-only vertical steps for instructions, changelogs,
|
|
5
|
-
* or process visualization. No interaction.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { Snippet } from 'svelte'
|
|
9
|
-
// =============================================================================
|
|
10
|
-
// Field Mapping Types
|
|
11
|
-
// =============================================================================
|
|
12
|
-
|
|
13
|
-
export interface TimelineFields {
|
|
14
|
-
label?: string
|
|
15
|
-
icon?: string
|
|
16
|
-
subtext?: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const defaultTimelineFields: Required<TimelineFields> = {
|
|
20
|
-
label: 'label',
|
|
21
|
-
icon: 'icon',
|
|
22
|
-
subtext: 'description'
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// =============================================================================
|
|
26
|
-
// Component Props Types
|
|
27
|
-
// =============================================================================
|
|
28
|
-
|
|
29
|
-
export interface TimelineIcons {
|
|
30
|
-
/** Icon class for completed state (default: i-lucide:check) */
|
|
31
|
-
completed?: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const defaultTimelineIcons: Required<TimelineIcons> = {
|
|
35
|
-
completed: 'i-lucide:check'
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface TimelineProps {
|
|
39
|
-
/** Array of timeline items */
|
|
40
|
-
items?: Record<string, unknown>[]
|
|
41
|
-
|
|
42
|
-
/** Field mapping configuration */
|
|
43
|
-
fields?: TimelineFields
|
|
44
|
-
|
|
45
|
-
/** Custom icons */
|
|
46
|
-
icons?: TimelineIcons
|
|
47
|
-
|
|
48
|
-
/** Additional CSS class */
|
|
49
|
-
class?: string
|
|
50
|
-
|
|
51
|
-
/** Custom content snippet for each item: (item, index) */
|
|
52
|
-
content?: Snippet<[Record<string, unknown>, number]>
|
|
53
|
-
}
|
package/src/types/toggle.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
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
|
-
|
|
8
|
-
import type { Snippet } from 'svelte'
|
|
9
|
-
import type { ProxyItem } from '@rokkit/states'
|
|
10
|
-
|
|
11
|
-
// =============================================================================
|
|
12
|
-
// Toggle Item Types
|
|
13
|
-
// =============================================================================
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Generic toggle item — data-driven, so it accepts primitives
|
|
17
|
-
* (string/number) as well as objects with mapped fields.
|
|
18
|
-
*/
|
|
19
|
-
export type ToggleItem = string | number | Record<string, unknown>
|
|
20
|
-
|
|
21
|
-
// =============================================================================
|
|
22
|
-
// Snippet Types
|
|
23
|
-
// =============================================================================
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Snippet for rendering a toggle option.
|
|
27
|
-
* The component renders the button wrapper; the snippet renders inner content.
|
|
28
|
-
* Receives the ProxyItem and whether this item is currently selected.
|
|
29
|
-
*/
|
|
30
|
-
export type ToggleItemSnippet = Snippet<[ProxyItem, boolean]>
|
|
31
|
-
|
|
32
|
-
// =============================================================================
|
|
33
|
-
// Component Props Types
|
|
34
|
-
// =============================================================================
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Visual variant of the Toggle.
|
|
38
|
-
* - `'group'` (default) — segmented radio-group rendering, one button per option.
|
|
39
|
-
* - `'button'` — single button that cycles through the options on each click.
|
|
40
|
-
* The rendered content represents the *next* option (the one you'd switch to),
|
|
41
|
-
* so users can read the click destination at a glance.
|
|
42
|
-
*/
|
|
43
|
-
export type ToggleVariant = 'group' | 'button'
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Props for the Toggle component
|
|
47
|
-
*/
|
|
48
|
-
export interface ToggleProps {
|
|
49
|
-
/** Visual variant. Default: 'group'. */
|
|
50
|
-
variant?: ToggleVariant
|
|
51
|
-
|
|
52
|
-
/** Array of toggle options (strings, numbers, or objects) */
|
|
53
|
-
options?: ToggleItem[]
|
|
54
|
-
|
|
55
|
-
/** Field mapping — overrides BASE_FIELDS defaults (text → 'label', value → 'value', …) */
|
|
56
|
-
fields?: Record<string, string>
|
|
57
|
-
|
|
58
|
-
/** Currently selected value (bindable) */
|
|
59
|
-
value?: unknown
|
|
60
|
-
|
|
61
|
-
/** Called when selection changes */
|
|
62
|
-
onchange?: (value: unknown, item: ToggleItem) => void
|
|
63
|
-
|
|
64
|
-
/** Whether to show text labels alongside icons */
|
|
65
|
-
showLabels?: boolean
|
|
66
|
-
|
|
67
|
-
/** Size variant */
|
|
68
|
-
size?: 'sm' | 'md' | 'lg'
|
|
69
|
-
|
|
70
|
-
/** Whether the entire toggle is disabled */
|
|
71
|
-
disabled?: boolean
|
|
72
|
-
|
|
73
|
-
/** Accessible label for the radiogroup. Default: messages.toggle.label */
|
|
74
|
-
label?: string
|
|
75
|
-
|
|
76
|
-
/** Additional CSS classes */
|
|
77
|
-
class?: string
|
|
78
|
-
|
|
79
|
-
/** Custom snippet for rendering toggle options */
|
|
80
|
-
item?: ToggleItemSnippet
|
|
81
|
-
}
|
package/src/types/toolbar.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Toolbar Component Types
|
|
3
|
-
*
|
|
4
|
-
* Provides types for the data-driven Toolbar component.
|
|
5
|
-
* Field mapping and data access is handled by ProxyItem from @rokkit/states.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// =============================================================================
|
|
9
|
-
// Field Mapping Types
|
|
10
|
-
// =============================================================================
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Field mapping configuration for toolbar data.
|
|
14
|
-
* Maps custom data field names to the component's expected properties.
|
|
15
|
-
*/
|
|
16
|
-
export interface ToolbarFields {
|
|
17
|
-
/** Field for display text/tooltip - default: 'text' */
|
|
18
|
-
text?: string
|
|
19
|
-
|
|
20
|
-
/** Field for the value to emit on click - default: 'value' */
|
|
21
|
-
value?: string
|
|
22
|
-
|
|
23
|
-
/** Field for icon class name - default: 'icon' */
|
|
24
|
-
icon?: string
|
|
25
|
-
|
|
26
|
-
/** Field for disabled state - default: 'disabled' */
|
|
27
|
-
disabled?: string
|
|
28
|
-
|
|
29
|
-
/** Field for active/pressed state - default: 'active' */
|
|
30
|
-
active?: string
|
|
31
|
-
|
|
32
|
-
/** Field for item type (button, toggle, separator, spacer, custom) - default: 'type' */
|
|
33
|
-
type?: string
|
|
34
|
-
|
|
35
|
-
/** Field for custom snippet name - default: 'snippet' */
|
|
36
|
-
snippet?: string
|
|
37
|
-
|
|
38
|
-
/** Field for aria-label override - default: 'label' */
|
|
39
|
-
label?: string
|
|
40
|
-
|
|
41
|
-
/** Field for keyboard shortcut display - default: 'shortcut' */
|
|
42
|
-
shortcut?: string
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Default field mapping values
|
|
47
|
-
*/
|
|
48
|
-
export const defaultToolbarFields: Required<ToolbarFields> = {
|
|
49
|
-
text: 'text',
|
|
50
|
-
value: 'value',
|
|
51
|
-
icon: 'icon',
|
|
52
|
-
disabled: 'disabled',
|
|
53
|
-
active: 'active',
|
|
54
|
-
type: 'type',
|
|
55
|
-
snippet: 'snippet',
|
|
56
|
-
label: 'label',
|
|
57
|
-
shortcut: 'shortcut'
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// =============================================================================
|
|
61
|
-
// Toolbar Item Types
|
|
62
|
-
// =============================================================================
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Generic toolbar item - can be any object with mapped fields
|
|
66
|
-
*/
|
|
67
|
-
export type ToolbarItem = Record<string, unknown>
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Built-in toolbar item types
|
|
71
|
-
*/
|
|
72
|
-
export type ToolbarItemType = 'button' | 'toggle' | 'separator' | 'spacer' | 'custom'
|
|
73
|
-
|
|
74
|
-
// =============================================================================
|
|
75
|
-
// Snippet Types
|
|
76
|
-
// =============================================================================
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Handlers passed to custom item snippets
|
|
80
|
-
*/
|
|
81
|
-
export interface ToolbarItemHandlers {
|
|
82
|
-
/** Call to trigger item action */
|
|
83
|
-
onclick: () => void
|
|
84
|
-
/** Forward keyboard events for accessibility */
|
|
85
|
-
onkeydown: (event: KeyboardEvent) => void
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Snippet type for rendering toolbar items
|
|
90
|
-
*/
|
|
91
|
-
export type ToolbarItemSnippet = import('svelte').Snippet<
|
|
92
|
-
[ToolbarItem, ToolbarFields, ToolbarItemHandlers]
|
|
93
|
-
>
|
|
94
|
-
|
|
95
|
-
// =============================================================================
|
|
96
|
-
// Component Props Types
|
|
97
|
-
// =============================================================================
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Props for the Toolbar component
|
|
101
|
-
*/
|
|
102
|
-
export interface ToolbarProps {
|
|
103
|
-
/** Array of toolbar items */
|
|
104
|
-
items?: ToolbarItem[]
|
|
105
|
-
|
|
106
|
-
/** Field mapping configuration */
|
|
107
|
-
fields?: ToolbarFields
|
|
108
|
-
|
|
109
|
-
/** Position of toolbar - affects border and sticky positioning */
|
|
110
|
-
position?: 'top' | 'bottom' | 'left' | 'right'
|
|
111
|
-
|
|
112
|
-
/** Size variant */
|
|
113
|
-
size?: 'sm' | 'md' | 'lg'
|
|
114
|
-
|
|
115
|
-
/** Width behaviour: full stretches to container, fit sizes to content */
|
|
116
|
-
width?: 'full' | 'fit'
|
|
117
|
-
|
|
118
|
-
/** Whether toolbar should stick to its position */
|
|
119
|
-
sticky?: boolean
|
|
120
|
-
|
|
121
|
-
/** Compact mode with reduced padding */
|
|
122
|
-
compact?: boolean
|
|
123
|
-
|
|
124
|
-
/** Show dividers between sections */
|
|
125
|
-
showDividers?: boolean
|
|
126
|
-
|
|
127
|
-
/** Whether the entire toolbar is disabled */
|
|
128
|
-
disabled?: boolean
|
|
129
|
-
|
|
130
|
-
/** Called when an item is clicked */
|
|
131
|
-
onclick?: (value: unknown, item: ToolbarItem) => void
|
|
132
|
-
|
|
133
|
-
/** Additional CSS classes */
|
|
134
|
-
class?: string
|
|
135
|
-
|
|
136
|
-
/** Custom snippet for rendering toolbar items */
|
|
137
|
-
item?: ToolbarItemSnippet
|
|
138
|
-
|
|
139
|
-
/** Slot for start section content */
|
|
140
|
-
start?: import('svelte').Snippet
|
|
141
|
-
|
|
142
|
-
/** Slot for center section content */
|
|
143
|
-
center?: import('svelte').Snippet
|
|
144
|
-
|
|
145
|
-
/** Slot for end section content */
|
|
146
|
-
end?: import('svelte').Snippet
|
|
147
|
-
|
|
148
|
-
/** Default slot for children */
|
|
149
|
-
children?: import('svelte').Snippet
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Props for the ToolbarGroup component
|
|
154
|
-
*/
|
|
155
|
-
export interface ToolbarGroupProps {
|
|
156
|
-
/** Accessibility label for the group */
|
|
157
|
-
label?: string
|
|
158
|
-
|
|
159
|
-
/** Gap between items in the group */
|
|
160
|
-
gap?: 'none' | 'sm' | 'md' | 'lg'
|
|
161
|
-
|
|
162
|
-
/** Additional CSS classes */
|
|
163
|
-
class?: string
|
|
164
|
-
|
|
165
|
-
/** Group content */
|
|
166
|
-
children?: import('svelte').Snippet
|
|
167
|
-
}
|
package/src/types/tooltip.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
|
-
export interface TooltipProps {
|
|
4
|
-
/** Tooltip text (alternative: use tooltipContent snippet for rich content) */
|
|
5
|
-
content?: string
|
|
6
|
-
|
|
7
|
-
/** Preferred position — auto-flips when the preferred side overflows the viewport */
|
|
8
|
-
position?: 'top' | 'bottom' | 'left' | 'right'
|
|
9
|
-
|
|
10
|
-
/** Show delay in ms (default: 300) */
|
|
11
|
-
delay?: number
|
|
12
|
-
|
|
13
|
-
/** Additional CSS classes on the root wrapper */
|
|
14
|
-
class?: string
|
|
15
|
-
|
|
16
|
-
/** Trigger element(s) */
|
|
17
|
-
children?: Snippet
|
|
18
|
-
|
|
19
|
-
/** Rich tooltip content — overrides the content string */
|
|
20
|
-
tooltipContent?: Snippet
|
|
21
|
-
}
|