@rokkit/ui 1.3.3 → 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.d.ts +1 -1
- 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 -73
- 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/chat.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
|
-
export type ChatRole = 'user' | 'assistant' | 'system'
|
|
4
|
-
export type ChatStatus = 'streaming' | 'error' | 'done'
|
|
5
|
-
|
|
6
|
-
export interface ChatMessage<T = unknown> {
|
|
7
|
-
id: string
|
|
8
|
-
role: ChatRole
|
|
9
|
-
/** Default body, rendered as markdown by the built-in body snippet. */
|
|
10
|
-
text?: string
|
|
11
|
-
timestamp?: string
|
|
12
|
-
/** Drives the optional typing/error affordance; consumer sets it. */
|
|
13
|
-
status?: ChatStatus
|
|
14
|
-
/** Arbitrary payload (parts/blocks/chart spec/form schema) the consumer's `message` snippet reads. */
|
|
15
|
-
data?: T
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface ConversationSummary {
|
|
19
|
-
id: string
|
|
20
|
-
title: string
|
|
21
|
-
timestamp?: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ChatMessageProps {
|
|
25
|
-
message: ChatMessage
|
|
26
|
-
relativeTime?: boolean
|
|
27
|
-
body?: Snippet<[ChatMessage]>
|
|
28
|
-
avatar?: Snippet<[ChatMessage]>
|
|
29
|
-
label?: Snippet<[ChatMessage]>
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface ChatComposerProps {
|
|
33
|
-
value?: string
|
|
34
|
-
placeholder?: string
|
|
35
|
-
disabled?: boolean
|
|
36
|
-
busy?: boolean
|
|
37
|
-
onsubmit?: (text: string) => void
|
|
38
|
-
onchange?: (value: string) => void
|
|
39
|
-
suggestions?: Snippet
|
|
40
|
-
toolbar?: Snippet
|
|
41
|
-
leading?: Snippet
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface ChatHistoryProps {
|
|
45
|
-
conversations?: ConversationSummary[]
|
|
46
|
-
activeId?: string | null
|
|
47
|
-
relativeTime?: boolean
|
|
48
|
-
onselect?: (id: string) => void
|
|
49
|
-
onnew?: () => void
|
|
50
|
-
ondelete?: (id: string) => void
|
|
51
|
-
item?: Snippet<[ConversationSummary]>
|
|
52
|
-
empty?: Snippet
|
|
53
|
-
header?: Snippet
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface ChatTimelineProps {
|
|
57
|
-
messages?: ChatMessage[]
|
|
58
|
-
relativeTime?: boolean
|
|
59
|
-
autoscroll?: boolean
|
|
60
|
-
message?: Snippet<[ChatMessage]>
|
|
61
|
-
empty?: Snippet
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface ChatShellProps {
|
|
65
|
-
messages?: ChatMessage[]
|
|
66
|
-
conversations?: ConversationSummary[]
|
|
67
|
-
activeConversationId?: string | null
|
|
68
|
-
value?: string
|
|
69
|
-
placeholder?: string
|
|
70
|
-
busy?: boolean
|
|
71
|
-
onsubmit?: (text: string) => void
|
|
72
|
-
onchange?: (value: string) => void
|
|
73
|
-
onselectConversation?: (id: string) => void
|
|
74
|
-
onnew?: () => void
|
|
75
|
-
message?: Snippet<[ChatMessage]>
|
|
76
|
-
suggestions?: Snippet
|
|
77
|
-
toolbar?: Snippet
|
|
78
|
-
leading?: Snippet
|
|
79
|
-
historyItem?: Snippet<[ConversationSummary]>
|
|
80
|
-
empty?: Snippet
|
|
81
|
-
}
|
package/src/types/code.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code component types — Code, CodeBlock, CodeGroup
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Snippet } from 'svelte'
|
|
6
|
-
import { DEFAULT_STATE_ICONS } from '@rokkit/core'
|
|
7
|
-
|
|
8
|
-
/** Supported themes for code highlighting */
|
|
9
|
-
export type CodeTheme = 'light' | 'dark'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Icons configuration for code action states.
|
|
13
|
-
* Keys match the naming convention in @rokkit/core DEFAULT_STATE_ICONS.
|
|
14
|
-
*/
|
|
15
|
-
export interface CodeStateIcons {
|
|
16
|
-
/** Icon class for copy button */
|
|
17
|
-
copy?: string
|
|
18
|
-
/** Icon class for copy success state */
|
|
19
|
-
copysuccess?: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Default state icons — uses semantic names from @rokkit/core
|
|
24
|
-
* that get resolved to actual icon classes via UnoCSS shortcuts.
|
|
25
|
-
*/
|
|
26
|
-
export const defaultCodeStateIcons: CodeStateIcons = {
|
|
27
|
-
copy: DEFAULT_STATE_ICONS.action.copy,
|
|
28
|
-
copysuccess: DEFAULT_STATE_ICONS.action.copysuccess
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Props for the Code component */
|
|
32
|
-
export interface CodeProps {
|
|
33
|
-
/** The code string to display and highlight */
|
|
34
|
-
code: string
|
|
35
|
-
/** Programming language for syntax highlighting */
|
|
36
|
-
language?: string
|
|
37
|
-
/** Color theme for the code block */
|
|
38
|
-
theme?: CodeTheme
|
|
39
|
-
/** Whether to show line numbers */
|
|
40
|
-
showLineNumbers?: boolean
|
|
41
|
-
/** Whether to show the copy button */
|
|
42
|
-
showCopyButton?: boolean
|
|
43
|
-
/** Icons for copy action states */
|
|
44
|
-
icons?: CodeStateIcons
|
|
45
|
-
/** Additional CSS class */
|
|
46
|
-
class?: string
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Shiki theme mode for CodeBlock.
|
|
51
|
-
*
|
|
52
|
-
* `'auto'` follows `body[data-mode]` (light / dark). Pass `'light'` or
|
|
53
|
-
* `'dark'` to force a theme.
|
|
54
|
-
*/
|
|
55
|
-
export type CodeBlockTheme = 'auto' | 'light' | 'dark'
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Props for the CodeBlock component.
|
|
59
|
-
*
|
|
60
|
-
* Wraps a Shiki-highlighted code body in a Frame whose header carries the
|
|
61
|
-
* filename + language chip and optional action buttons.
|
|
62
|
-
*/
|
|
63
|
-
export interface CodeBlockProps {
|
|
64
|
-
/** The code body. */
|
|
65
|
-
code: string
|
|
66
|
-
|
|
67
|
-
/** Language label shown as a chip in the header and used for highlighting. */
|
|
68
|
-
language?: string
|
|
69
|
-
|
|
70
|
-
/** Filename label shown in the header. */
|
|
71
|
-
filename?: string
|
|
72
|
-
|
|
73
|
-
/** Max height (CSS length) of the scrollable code area. No cap when unset. */
|
|
74
|
-
height?: string
|
|
75
|
-
|
|
76
|
-
/** Shiki theme mode. Default `'auto'`. */
|
|
77
|
-
theme?: CodeBlockTheme
|
|
78
|
-
|
|
79
|
-
/** Show the copy-to-clipboard button. Default `false`. */
|
|
80
|
-
allowCopy?: boolean
|
|
81
|
-
|
|
82
|
-
/** Show the download-as-file button. Default `false`. */
|
|
83
|
-
allowDownload?: boolean
|
|
84
|
-
|
|
85
|
-
/** Optional extra-actions slot rendered after copy / download. */
|
|
86
|
-
actions?: Snippet
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* One file in a CodeGroup.
|
|
91
|
-
*
|
|
92
|
-
* The `path` doubles as id and tree placement (e.g. `src/lib/Button.svelte`).
|
|
93
|
-
* Intermediate segments become folder nodes; the final segment becomes a
|
|
94
|
-
* file leaf.
|
|
95
|
-
*/
|
|
96
|
-
export interface CodeGroupFile {
|
|
97
|
-
/** Full path used as id and for tree placement. */
|
|
98
|
-
path: string
|
|
99
|
-
|
|
100
|
-
/** Shiki language id. */
|
|
101
|
-
language: string
|
|
102
|
-
|
|
103
|
-
/** Source code. */
|
|
104
|
-
code: string
|
|
105
|
-
|
|
106
|
-
/** Display name override — defaults to the path's last segment. */
|
|
107
|
-
name?: string
|
|
108
|
-
|
|
109
|
-
/** File icon override (full icon class) — defaults to extension lookup. */
|
|
110
|
-
icon?: string
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Icon overrides for the CodeGroup component, grouped by semantic category.
|
|
115
|
-
*/
|
|
116
|
-
export interface CodeGroupIconOverrides {
|
|
117
|
-
doc?: Partial<typeof DEFAULT_STATE_ICONS.doc>
|
|
118
|
-
folder?: Partial<typeof DEFAULT_STATE_ICONS.folder>
|
|
119
|
-
view?: Partial<typeof DEFAULT_STATE_ICONS.view>
|
|
120
|
-
action?: Partial<typeof DEFAULT_STATE_ICONS.action>
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Props for the CodeGroup component.
|
|
125
|
-
*
|
|
126
|
-
* Renders a hierarchical tree picker over multiple files with an optional
|
|
127
|
-
* collapsible preview panel.
|
|
128
|
-
*/
|
|
129
|
-
export interface CodeGroupProps {
|
|
130
|
-
/** Files rendered in the group. */
|
|
131
|
-
files: CodeGroupFile[]
|
|
132
|
-
|
|
133
|
-
/** Path of the file selected on first render. Defaults to the first file. */
|
|
134
|
-
initialFile?: string
|
|
135
|
-
|
|
136
|
-
/** Additional CSS class. */
|
|
137
|
-
class?: string
|
|
138
|
-
|
|
139
|
-
/** Icon overrides per semantic category. */
|
|
140
|
-
icons?: CodeGroupIconOverrides
|
|
141
|
-
|
|
142
|
-
/** Optional preview content — toggled by a "Show preview" action. */
|
|
143
|
-
preview?: Snippet
|
|
144
|
-
|
|
145
|
-
/** Show the copy button on the inner CodeBlock. Default `true`. */
|
|
146
|
-
showCopyButton?: boolean
|
|
147
|
-
}
|
package/src/types/connector.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connector Component Types
|
|
3
|
-
*
|
|
4
|
-
* The `Connector` component renders tree-line connectors used by hierarchical
|
|
5
|
-
* visualizations (Tree, lists with indent guides). The underlying connector
|
|
6
|
-
* type values are defined in `./tree.ts` and re-exported here for ergonomics.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import type { ConnectorType } from './tree.js'
|
|
10
|
-
|
|
11
|
-
export type { ConnectorType } from './tree.js'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Props for the Connector component.
|
|
15
|
-
*/
|
|
16
|
-
export interface ConnectorProps {
|
|
17
|
-
/** The type of connector to render. Default `'empty'`. */
|
|
18
|
-
type?: ConnectorType
|
|
19
|
-
|
|
20
|
-
/** Right-to-left layout support. */
|
|
21
|
-
rtl?: boolean
|
|
22
|
-
}
|
package/src/types/divider.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Divider Component Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/** Divider orientation. */
|
|
6
|
-
export type DividerOrientation = 'horizontal' | 'vertical'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Props for the Divider component.
|
|
10
|
-
*/
|
|
11
|
-
export interface DividerProps {
|
|
12
|
-
/** Orientation of the divider. */
|
|
13
|
-
orientation?: DividerOrientation
|
|
14
|
-
|
|
15
|
-
/** Optional label text rendered inline with the divider. */
|
|
16
|
-
label?: string
|
|
17
|
-
|
|
18
|
-
/** Additional CSS class. */
|
|
19
|
-
class?: string
|
|
20
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Field mapping for FloatingAction items
|
|
5
|
-
*/
|
|
6
|
-
export type FloatingActionFields = Record<string, string>
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Default field mappings
|
|
10
|
-
*/
|
|
11
|
-
export const defaultFloatingActionFields: Required<
|
|
12
|
-
Pick<FloatingActionFields, 'text' | 'value' | 'icon' | 'label' | 'disabled'>
|
|
13
|
-
> = {
|
|
14
|
-
text: 'text',
|
|
15
|
-
value: 'value',
|
|
16
|
-
icon: 'icon',
|
|
17
|
-
label: 'label',
|
|
18
|
-
disabled: 'disabled'
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A single action item
|
|
23
|
-
*/
|
|
24
|
-
export type FloatingActionItem = Record<string, unknown>
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Event handlers passed to custom snippets
|
|
28
|
-
*/
|
|
29
|
-
export interface FloatingActionItemHandlers {
|
|
30
|
-
onclick: () => void
|
|
31
|
-
onkeydown: (event: KeyboardEvent) => void
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Custom snippet for rendering an action item
|
|
36
|
-
*/
|
|
37
|
-
export type FloatingActionItemSnippet = Snippet<
|
|
38
|
-
[item: FloatingActionItem, fields: FloatingActionFields, handlers: FloatingActionItemHandlers]
|
|
39
|
-
>
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Position options for the FAB
|
|
43
|
-
*/
|
|
44
|
-
export type FloatingActionPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Expansion direction for action items
|
|
48
|
-
*/
|
|
49
|
-
export type FloatingActionExpand = 'radial' | 'vertical' | 'horizontal'
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Alignment for action items in the menu
|
|
53
|
-
*/
|
|
54
|
-
export type FloatingActionItemAlign = 'start' | 'center' | 'end'
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Icons for the FloatingAction trigger button
|
|
58
|
-
*/
|
|
59
|
-
export interface FloatingActionIcons {
|
|
60
|
-
/** Icon for the main trigger (add action) */
|
|
61
|
-
add?: string
|
|
62
|
-
/** Icon shown when menu is open (close action) */
|
|
63
|
-
close?: string
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Props for the FloatingAction component
|
|
68
|
-
*/
|
|
69
|
-
export interface FloatingActionProps {
|
|
70
|
-
/** Array of action items */
|
|
71
|
-
items?: FloatingActionItem[]
|
|
72
|
-
|
|
73
|
-
/** Field mapping configuration */
|
|
74
|
-
fields?: FloatingActionFields
|
|
75
|
-
|
|
76
|
-
/** Custom icons for the trigger button */
|
|
77
|
-
icons?: FloatingActionIcons
|
|
78
|
-
|
|
79
|
-
/** Accessible label for the trigger */
|
|
80
|
-
label?: string
|
|
81
|
-
|
|
82
|
-
/** Size variant */
|
|
83
|
-
size?: 'sm' | 'md' | 'lg'
|
|
84
|
-
|
|
85
|
-
/** Position on screen */
|
|
86
|
-
position?: FloatingActionPosition
|
|
87
|
-
|
|
88
|
-
/** How items expand when opened */
|
|
89
|
-
expand?: FloatingActionExpand
|
|
90
|
-
|
|
91
|
-
/** Alignment of items in the menu (start/center/end) */
|
|
92
|
-
itemAlign?: FloatingActionItemAlign
|
|
93
|
-
|
|
94
|
-
/** Disable the FAB */
|
|
95
|
-
disabled?: boolean
|
|
96
|
-
|
|
97
|
-
/** Whether the menu is open (bindable) */
|
|
98
|
-
open?: boolean
|
|
99
|
-
|
|
100
|
-
/** Show backdrop overlay when open */
|
|
101
|
-
backdrop?: boolean
|
|
102
|
-
|
|
103
|
-
/** Position relative to nearest positioned ancestor instead of viewport */
|
|
104
|
-
contained?: boolean
|
|
105
|
-
|
|
106
|
-
/** Called when an action is selected */
|
|
107
|
-
onselect?: (value: unknown, item: FloatingActionItem) => void
|
|
108
|
-
|
|
109
|
-
/** Called when menu opens */
|
|
110
|
-
onopen?: () => void
|
|
111
|
-
|
|
112
|
-
/** Called when menu closes */
|
|
113
|
-
onclose?: () => void
|
|
114
|
-
|
|
115
|
-
/** Additional CSS classes */
|
|
116
|
-
class?: string
|
|
117
|
-
|
|
118
|
-
/** Custom snippet for rendering action items */
|
|
119
|
-
item?: FloatingActionItemSnippet
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Re-export getSnippet for convenience
|
|
123
|
-
export { getSnippet } from './menu.js'
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Position on the screen edge
|
|
5
|
-
*/
|
|
6
|
-
export type FloatingNavigationPosition = 'left' | 'right' | 'top' | 'bottom'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Size variant
|
|
10
|
-
*/
|
|
11
|
-
export type FloatingNavigationSize = 'sm' | 'md' | 'lg'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A single navigation item
|
|
15
|
-
*/
|
|
16
|
-
export type FloatingNavigationItem = Record<string, unknown>
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Custom snippet for rendering a navigation item
|
|
20
|
-
*/
|
|
21
|
-
export type FloatingNavigationItemSnippet = Snippet<
|
|
22
|
-
[item: FloatingNavigationItem, proxy: { text: string; icon: string; active: boolean }]
|
|
23
|
-
>
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Icons for the FloatingNavigation pin button
|
|
27
|
-
*/
|
|
28
|
-
export interface FloatingNavigationIcons {
|
|
29
|
-
/** Icon for pin action */
|
|
30
|
-
pin?: string
|
|
31
|
-
/** Icon for unpin action */
|
|
32
|
-
unpin?: string
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Props for the FloatingNavigation component
|
|
37
|
-
*/
|
|
38
|
-
export interface FloatingNavigationProps {
|
|
39
|
-
/** Navigation items (data-driven) */
|
|
40
|
-
items?: FloatingNavigationItem[]
|
|
41
|
-
|
|
42
|
-
/** Field mapping configuration */
|
|
43
|
-
fields?: Record<string, string>
|
|
44
|
-
|
|
45
|
-
/** Custom icons for pin/unpin */
|
|
46
|
-
icons?: FloatingNavigationIcons
|
|
47
|
-
|
|
48
|
-
/** Active item value (bindable) */
|
|
49
|
-
value?: unknown
|
|
50
|
-
|
|
51
|
-
/** Screen edge to anchor to */
|
|
52
|
-
position?: FloatingNavigationPosition
|
|
53
|
-
|
|
54
|
-
/** Whether nav is pinned open (bindable) */
|
|
55
|
-
pinned?: boolean
|
|
56
|
-
|
|
57
|
-
/** Auto-track active section via IntersectionObserver */
|
|
58
|
-
observe?: boolean
|
|
59
|
-
|
|
60
|
-
/** IntersectionObserver config */
|
|
61
|
-
observerOptions?: IntersectionObserverInit
|
|
62
|
-
|
|
63
|
-
/** Size variant */
|
|
64
|
-
size?: FloatingNavigationSize
|
|
65
|
-
|
|
66
|
-
/** Accessible label */
|
|
67
|
-
label?: string
|
|
68
|
-
|
|
69
|
-
/** Called when an item is selected */
|
|
70
|
-
onselect?: (value: unknown, item: FloatingNavigationItem) => void
|
|
71
|
-
|
|
72
|
-
/** Called when pin state changes */
|
|
73
|
-
onpinchange?: (pinned: boolean) => void
|
|
74
|
-
|
|
75
|
-
/** Custom snippet for rendering items */
|
|
76
|
-
item?: FloatingNavigationItemSnippet
|
|
77
|
-
|
|
78
|
-
/** Additional CSS classes */
|
|
79
|
-
class?: string
|
|
80
|
-
}
|
package/src/types/frame.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Frame Component Types
|
|
3
|
-
*
|
|
4
|
-
* Generic header / body / footer container primitive — used by CodeBlock,
|
|
5
|
-
* PlotPlugin and other "card-shaped UI block" surfaces. For an interactive
|
|
6
|
-
* card (link / button) prefer `<Card/>`.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import type { Snippet } from 'svelte'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Props for the Frame component.
|
|
13
|
-
*/
|
|
14
|
-
export interface FrameProps {
|
|
15
|
-
/** Top slot — title, action chips, status badges, etc. */
|
|
16
|
-
header?: Snippet
|
|
17
|
-
|
|
18
|
-
/** Main content. */
|
|
19
|
-
children?: Snippet
|
|
20
|
-
|
|
21
|
-
/** Bottom slot — metadata, actions, secondary controls. */
|
|
22
|
-
footer?: Snippet
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* When true the body slot has zero padding so the inner artifact
|
|
26
|
-
* (a chart, a `<pre>`, a table) controls its own padding.
|
|
27
|
-
*/
|
|
28
|
-
flush?: boolean
|
|
29
|
-
}
|
package/src/types/index.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Button Types
|
|
2
|
-
export * from './button.js'
|
|
3
|
-
|
|
4
|
-
// Code Types
|
|
5
|
-
export * from './code.js'
|
|
6
|
-
|
|
7
|
-
// Menu Types
|
|
8
|
-
export * from './menu.js'
|
|
9
|
-
|
|
10
|
-
// Select Types
|
|
11
|
-
export * from './select.js'
|
|
12
|
-
|
|
13
|
-
// Toolbar Types
|
|
14
|
-
export * from './toolbar.js'
|
|
15
|
-
|
|
16
|
-
// Tabs Types
|
|
17
|
-
export * from './tabs.js'
|
|
18
|
-
|
|
19
|
-
// Toggle Types
|
|
20
|
-
export * from './toggle.js'
|
|
21
|
-
|
|
22
|
-
// Switch Types
|
|
23
|
-
export * from './switch.js'
|
|
24
|
-
|
|
25
|
-
// List Types
|
|
26
|
-
export * from './list.js'
|
|
27
|
-
|
|
28
|
-
// LockMode Types
|
|
29
|
-
export * from './lock-mode.js'
|
|
30
|
-
|
|
31
|
-
// Tree Types
|
|
32
|
-
export * from './tree.js'
|
|
33
|
-
|
|
34
|
-
// Floating Action Types
|
|
35
|
-
export * from './floating-action.js'
|
|
36
|
-
|
|
37
|
-
// Palette Types
|
|
38
|
-
export * from './palette.js'
|
|
39
|
-
|
|
40
|
-
// Table Types
|
|
41
|
-
export * from './table.js'
|
|
42
|
-
export * from './tree-table.js'
|
|
43
|
-
|
|
44
|
-
// SearchFilter Types
|
|
45
|
-
export * from './search-filter.js'
|
|
46
|
-
|
|
47
|
-
// Range Types
|
|
48
|
-
export * from './range.js'
|
|
49
|
-
|
|
50
|
-
// Timeline Types
|
|
51
|
-
export * from './timeline.js'
|
|
52
|
-
|
|
53
|
-
// FloatingNavigation Types
|
|
54
|
-
export * from './floating-navigation.js'
|
|
55
|
-
|
|
56
|
-
// Upload Types
|
|
57
|
-
export * from './upload-target.js'
|
|
58
|
-
export * from './upload-file-status.js'
|
|
59
|
-
export * from './upload-progress.js'
|
|
60
|
-
|
|
61
|
-
// Tooltip Types
|
|
62
|
-
export * from './tooltip.js'
|
|
63
|
-
|
|
64
|
-
// ItemContent Types
|
|
65
|
-
export * from './item-content.js'
|
|
66
|
-
|
|
67
|
-
// ItemSwitch Types
|
|
68
|
-
export * from './item-switch.js'
|
|
69
|
-
|
|
70
|
-
// ItemToggle Types
|
|
71
|
-
export * from './item-toggle.js'
|
|
72
|
-
|
|
73
|
-
// StatusList Types
|
|
74
|
-
export * from './status-list.js'
|
|
75
|
-
|
|
76
|
-
// AlertList Types
|
|
77
|
-
export * from './alert-list.js'
|
|
78
|
-
|
|
79
|
-
// Avatar Types
|
|
80
|
-
export * from './avatar.js'
|
|
81
|
-
|
|
82
|
-
// Badge Types
|
|
83
|
-
export * from './badge.js'
|
|
84
|
-
|
|
85
|
-
// BreadCrumbs Types
|
|
86
|
-
export * from './breadcrumbs.js'
|
|
87
|
-
|
|
88
|
-
// Card Types
|
|
89
|
-
export * from './card.js'
|
|
90
|
-
|
|
91
|
-
// Carousel Types
|
|
92
|
-
export * from './carousel.js'
|
|
93
|
-
|
|
94
|
-
// Connector Types
|
|
95
|
-
export * from './connector.js'
|
|
96
|
-
|
|
97
|
-
// Divider Types
|
|
98
|
-
export * from './divider.js'
|
|
99
|
-
|
|
100
|
-
// Frame Types
|
|
101
|
-
export * from './frame.js'
|
|
102
|
-
|
|
103
|
-
// Message Types
|
|
104
|
-
export * from './message.js'
|
|
105
|
-
|
|
106
|
-
// NavContent Types
|
|
107
|
-
export * from './nav-content.js'
|
|
108
|
-
|
|
109
|
-
// Pill Types
|
|
110
|
-
export * from './pill.js'
|
|
111
|
-
|
|
112
|
-
// ProgressBar Types
|
|
113
|
-
export * from './progress-bar.js'
|
|
114
|
-
|
|
115
|
-
// Rating Types
|
|
116
|
-
export * from './rating.js'
|
|
117
|
-
|
|
118
|
-
// ResponsiveGrid Types
|
|
119
|
-
export * from './responsive-grid.js'
|
|
120
|
-
|
|
121
|
-
// Reveal Types
|
|
122
|
-
export * from './reveal.js'
|
|
123
|
-
|
|
124
|
-
// Shine Types
|
|
125
|
-
export * from './shine.js'
|
|
126
|
-
|
|
127
|
-
// Stack Types
|
|
128
|
-
export * from './stack.js'
|
|
129
|
-
|
|
130
|
-
// Stepper Types
|
|
131
|
-
export * from './stepper.js'
|
|
132
|
-
|
|
133
|
-
// Tilt Types
|
|
134
|
-
export * from './tilt.js'
|
|
135
|
-
|
|
136
|
-
// Chat Types
|
|
137
|
-
export * from './chat.js'
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ItemContent Component Types
|
|
3
|
-
*
|
|
4
|
-
* Default inner content for List / Menu / Tree / Toolbar items.
|
|
5
|
-
* Renders avatar/icon, label + subtext, optional badge and shortcut from a
|
|
6
|
-
* ProxyItem wrapper that exposes field access and reactive state.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import type { ProxyItem } from '@rokkit/states'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Props for the ItemContent component.
|
|
13
|
-
*/
|
|
14
|
-
export interface ItemContentProps {
|
|
15
|
-
/**
|
|
16
|
-
* ProxyItem wrapper around the underlying data — exposes `label`,
|
|
17
|
-
* `get(field)`, and the item's reactive selection / expansion state.
|
|
18
|
-
*/
|
|
19
|
-
proxy: ProxyItem
|
|
20
|
-
|
|
21
|
-
/** Render the avatar / icon slot. Default: `true`. */
|
|
22
|
-
showIcon?: boolean
|
|
23
|
-
|
|
24
|
-
/** Render the description / subtext line under the label. Default: `true`. */
|
|
25
|
-
showSubtext?: boolean
|
|
26
|
-
}
|
package/src/types/item-switch.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ItemSwitch Component Types
|
|
3
|
-
*
|
|
4
|
-
* Renders a switch-shaped visual inside a data-driven item snippet
|
|
5
|
-
* (List / Menu / Tree). The whole row is the interactive target — clicking it
|
|
6
|
-
* toggles the underlying data through the parent's onselect flow. ItemSwitch
|
|
7
|
-
* itself renders inert markup (spans + attributes), so it never introduces a
|
|
8
|
-
* nested interactive element inside the item's `<button>` wrapper.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type { ProxyItem } from '@rokkit/states'
|
|
12
|
-
|
|
13
|
-
export interface ItemSwitchProps {
|
|
14
|
-
/** ProxyItem for the current row. */
|
|
15
|
-
proxy: ProxyItem
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Field on the item that holds the boolean checked state.
|
|
19
|
-
* @default 'checked'
|
|
20
|
-
*/
|
|
21
|
-
field?: string
|
|
22
|
-
|
|
23
|
-
/** Size variant — feeds into `data-switch-size` for theming. */
|
|
24
|
-
size?: 'sm' | 'md' | 'lg'
|
|
25
|
-
|
|
26
|
-
/** Render the leading avatar / icon (via ItemContent). @default true */
|
|
27
|
-
showIcon?: boolean
|
|
28
|
-
|
|
29
|
-
/** Render subtext under the label (via ItemContent). @default true */
|
|
30
|
-
showSubtext?: boolean
|
|
31
|
-
|
|
32
|
-
/** Optional class on the wrapper span. */
|
|
33
|
-
class?: string
|
|
34
|
-
}
|