@rokkit/ui 1.1.18 → 1.1.19
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/MarkdownRenderer.svelte.d.ts +15 -0
- package/dist/components/AlertList.svelte.d.ts +4 -0
- package/dist/components/Avatar.svelte.d.ts +4 -0
- package/dist/components/Badge.svelte.d.ts +4 -0
- package/dist/components/BreadCrumbs.svelte.d.ts +4 -0
- package/dist/components/Button.svelte.d.ts +4 -0
- package/dist/components/ButtonGroup.svelte.d.ts +4 -0
- package/dist/components/Card.svelte.d.ts +4 -0
- package/dist/components/Carousel.svelte.d.ts +4 -0
- package/dist/components/Code.svelte.d.ts +7 -0
- package/dist/components/CodeBlock.svelte.d.ts +4 -0
- package/dist/components/CodeGroup.svelte.d.ts +4 -0
- package/dist/components/CommandPalette.svelte.d.ts +7 -0
- package/dist/components/Connector.svelte.d.ts +4 -0
- package/dist/components/Divider.svelte.d.ts +4 -0
- package/dist/components/Dropdown.svelte.d.ts +22 -0
- package/dist/components/FloatingAction.svelte.d.ts +7 -0
- package/dist/components/FloatingNavigation.svelte.d.ts +7 -0
- package/dist/components/Frame.svelte.d.ts +17 -0
- package/dist/components/Grid.svelte.d.ts +45 -0
- package/dist/components/ItemContent.svelte.d.ts +4 -0
- package/dist/components/LazyTree.svelte.d.ts +30 -0
- package/dist/components/List.svelte.d.ts +49 -0
- package/dist/components/Menu.svelte.d.ts +68 -0
- package/dist/components/Message.svelte.d.ts +4 -0
- package/dist/components/MultiSelect.svelte.d.ts +25 -0
- package/dist/components/NavContent.svelte.d.ts +4 -0
- package/dist/components/PaletteManager.svelte.d.ts +4 -0
- package/dist/components/Pill.svelte.d.ts +4 -0
- package/dist/components/ProgressBar.svelte.d.ts +4 -0
- package/dist/components/Range.svelte.d.ts +7 -0
- package/dist/components/Rating.svelte.d.ts +4 -0
- package/dist/components/ResponsiveGrid.svelte.d.ts +4 -0
- package/dist/components/Reveal.svelte.d.ts +4 -0
- package/dist/components/SearchFilter.svelte.d.ts +7 -0
- package/dist/components/Select.svelte.d.ts +26 -0
- package/dist/components/Shine.svelte.d.ts +4 -0
- package/dist/components/Stack.svelte.d.ts +4 -0
- package/dist/components/StatusList.svelte.d.ts +4 -0
- package/dist/components/Stepper.svelte.d.ts +4 -0
- package/dist/components/Swatch.svelte.d.ts +30 -0
- package/dist/components/Switch.svelte.d.ts +4 -0
- package/dist/components/Table.svelte.d.ts +4 -0
- package/dist/components/Tabs.svelte.d.ts +26 -0
- package/dist/components/Tilt.svelte.d.ts +4 -0
- package/dist/components/Timeline.svelte.d.ts +4 -0
- package/dist/components/Toggle.svelte.d.ts +7 -0
- package/dist/components/Toolbar.svelte.d.ts +8 -0
- package/dist/components/ToolbarGroup.svelte.d.ts +4 -0
- package/dist/components/Tooltip.svelte.d.ts +17 -0
- package/dist/components/Tree.svelte.d.ts +31 -0
- package/dist/components/TreeTable.svelte.d.ts +4 -0
- package/dist/components/UploadFileStatus.svelte.d.ts +19 -0
- package/dist/components/UploadProgress.svelte.d.ts +7 -0
- package/dist/components/UploadTarget.svelte.d.ts +7 -0
- package/dist/components/index.d.ts +54 -0
- package/dist/index.d.ts +6 -0
- package/dist/markdown-plugin.d.ts +13 -0
- package/dist/types/alert-list.d.ts +19 -0
- package/dist/types/avatar.d.ts +30 -0
- package/dist/types/badge.d.ts +29 -0
- package/dist/types/breadcrumbs.d.ts +34 -0
- package/dist/types/button.d.ts +63 -0
- package/dist/types/card.d.ts +29 -0
- package/dist/types/carousel.d.ts +35 -0
- package/dist/types/code.d.ts +118 -0
- package/dist/types/connector.d.ts +18 -0
- package/dist/types/divider.d.ts +16 -0
- package/dist/types/floating-action.d.ts +89 -0
- package/dist/types/floating-navigation.d.ts +66 -0
- package/dist/types/frame.d.ts +24 -0
- package/dist/types/index.d.ts +44 -0
- package/dist/types/item-content.d.ts +22 -0
- package/dist/types/list.d.ts +128 -0
- package/dist/types/menu.d.ts +53 -0
- package/dist/types/message.d.ts +42 -0
- package/dist/types/nav-content.d.ts +23 -0
- package/dist/types/palette.d.ts +98 -0
- package/dist/types/pill.d.ts +33 -0
- package/dist/types/progress-bar.d.ts +16 -0
- package/dist/types/range.d.ts +35 -0
- package/dist/types/rating.d.ts +33 -0
- package/dist/types/responsive-grid.d.ts +19 -0
- package/dist/types/reveal.d.ts +37 -0
- package/dist/types/search-filter.d.ts +43 -0
- package/dist/types/select.d.ts +114 -0
- package/dist/types/shine.d.ts +28 -0
- package/dist/types/stack.d.ts +29 -0
- package/dist/types/status-list.d.ts +35 -0
- package/dist/types/stepper.d.ts +56 -0
- package/dist/types/switch.d.ts +46 -0
- package/dist/types/table.d.ts +148 -0
- package/dist/types/tabs.d.ts +68 -0
- package/dist/types/tilt.d.ts +22 -0
- package/dist/types/timeline.d.ts +30 -0
- package/dist/types/toggle.d.ts +54 -0
- package/dist/types/toolbar.d.ts +109 -0
- package/dist/types/tooltip.d.ts +15 -0
- package/dist/types/tree-table.d.ts +79 -0
- package/dist/types/tree.d.ts +183 -0
- package/dist/types/upload-file-status.d.ts +31 -0
- package/dist/types/upload-progress.d.ts +71 -0
- package/dist/types/upload-target.d.ts +46 -0
- package/dist/utils/palette.d.ts +100 -0
- package/dist/utils/shiki.d.ts +20 -0
- package/dist/utils/upload.d.ts +21 -0
- package/package.json +14 -11
- package/src/MarkdownRenderer.svelte +6 -4
- package/src/components/Button.svelte +7 -1
- package/src/components/LazyTree.svelte +3 -4
- package/src/components/List.svelte +1 -1
- package/src/components/MultiSelect.svelte +3 -3
- package/src/components/Pill.svelte +10 -5
- package/src/components/Select.svelte +3 -3
- package/src/components/Swatch.svelte +35 -8
- package/src/components/Table.svelte +2 -1
- package/src/components/Tabs.svelte +1 -2
- package/src/components/Toggle.svelte +2 -2
- package/src/components/Tree.svelte +1 -2
- package/src/components/TreeTable.svelte +2 -1
- package/src/components/UploadTarget.svelte +2 -1
- package/src/types/button.ts +8 -2
- package/src/types/tabs.ts +4 -4
- package/src/types/toggle.ts +3 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip — contextual text revealed on hover or focus.
|
|
3
|
+
*
|
|
4
|
+
* Wraps any trigger element. Tooltip appears after a configurable delay
|
|
5
|
+
* on mouseenter/focusin, hides immediately on mouseleave/focusout/Escape.
|
|
6
|
+
* Position auto-flips when the preferred side would overflow the viewport.
|
|
7
|
+
*
|
|
8
|
+
* Data attributes:
|
|
9
|
+
* data-tooltip-root — wrapper element (position: relative)
|
|
10
|
+
* data-tooltip-content — tooltip bubble
|
|
11
|
+
* data-tooltip-position — actual position after auto-flip
|
|
12
|
+
* data-tooltip-visible — "true" while visible
|
|
13
|
+
*/
|
|
14
|
+
import type { TooltipProps } from '../types/tooltip.js';
|
|
15
|
+
declare const Tooltip: import("svelte").Component<TooltipProps, {}, "">;
|
|
16
|
+
type Tooltip = ReturnType<typeof Tooltip>;
|
|
17
|
+
export default Tooltip;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree — Hierarchical data navigation with tree lines and keyboard navigation.
|
|
3
|
+
*
|
|
4
|
+
* Architecture:
|
|
5
|
+
* LazyWrapper — owns focusedKey $state + flatView $derived (with lineTypes)
|
|
6
|
+
* Navigator — attaches DOM event handlers, calls wrapper[action](path)
|
|
7
|
+
* flatView — single flat {#each}, connectors rendered from node.lineTypes
|
|
8
|
+
*
|
|
9
|
+
* Default item content: icon + label + badge + shortcut (no avatar/description).
|
|
10
|
+
* Parent nodes hide their icon by default (showIcon=false) so only the
|
|
11
|
+
* expand/collapse chevron + label are shown, aligning with leaf icon + label.
|
|
12
|
+
*/
|
|
13
|
+
import type { ProxyItem } from '@rokkit/states';
|
|
14
|
+
type $$ComponentProps = {
|
|
15
|
+
items?: unknown[];
|
|
16
|
+
fields?: Record<string, string>;
|
|
17
|
+
value?: unknown;
|
|
18
|
+
size?: string;
|
|
19
|
+
lineStyle?: 'none' | 'solid' | 'dashed' | 'dotted';
|
|
20
|
+
labels?: Record<string, string>;
|
|
21
|
+
icons?: {
|
|
22
|
+
opened?: string;
|
|
23
|
+
closed?: string;
|
|
24
|
+
};
|
|
25
|
+
onselect?: (value: unknown, proxy: ProxyItem) => void;
|
|
26
|
+
class?: string;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
declare const Tree: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
30
|
+
type Tree = ReturnType<typeof Tree>;
|
|
31
|
+
export default Tree;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UploadFileStatus — Renders a single file's upload status and action buttons.
|
|
3
|
+
*
|
|
4
|
+
* Data attributes:
|
|
5
|
+
* data-upload-file-status — root
|
|
6
|
+
* data-upload-file-icon — file type icon
|
|
7
|
+
* data-upload-status — status text badge
|
|
8
|
+
* data-upload-bar — progress bar track
|
|
9
|
+
* data-upload-fill — progress bar fill
|
|
10
|
+
* data-upload-actions — action buttons wrapper
|
|
11
|
+
* data-upload-cancel — cancel button
|
|
12
|
+
* data-upload-retry — retry button
|
|
13
|
+
* data-upload-remove — remove button
|
|
14
|
+
* data-status — status value on root (for CSS theming)
|
|
15
|
+
*/
|
|
16
|
+
import type { UploadFileStatusProps } from '../types/upload-file-status.js';
|
|
17
|
+
declare const UploadFileStatus: import("svelte").Component<UploadFileStatusProps, {}, "">;
|
|
18
|
+
type UploadFileStatus = ReturnType<typeof UploadFileStatus>;
|
|
19
|
+
export default UploadFileStatus;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UploadProgressProps } from '../types/upload-progress.js';
|
|
2
|
+
type $$ComponentProps = UploadProgressProps & {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const UploadProgress: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type UploadProgress = ReturnType<typeof UploadProgress>;
|
|
7
|
+
export default UploadProgress;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UploadTargetProps } from '../types/upload-target.js';
|
|
2
|
+
type $$ComponentProps = UploadTargetProps & {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const UploadTarget: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type UploadTarget = ReturnType<typeof UploadTarget>;
|
|
7
|
+
export default UploadTarget;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export { default as Button } from './Button.svelte';
|
|
2
|
+
export { default as ButtonGroup } from './ButtonGroup.svelte';
|
|
3
|
+
export { default as Code } from './Code.svelte';
|
|
4
|
+
export { default as CodeBlock } from './CodeBlock.svelte';
|
|
5
|
+
export { default as CodeGroup } from './CodeGroup.svelte';
|
|
6
|
+
export { default as Frame } from './Frame.svelte';
|
|
7
|
+
export { default as Menu } from './Menu.svelte';
|
|
8
|
+
export { default as Dropdown } from './Dropdown.svelte';
|
|
9
|
+
export { default as Select } from './Select.svelte';
|
|
10
|
+
export { default as MultiSelect } from './MultiSelect.svelte';
|
|
11
|
+
export { default as Toolbar } from './Toolbar.svelte';
|
|
12
|
+
export { default as ToolbarGroup } from './ToolbarGroup.svelte';
|
|
13
|
+
export { default as Tabs } from './Tabs.svelte';
|
|
14
|
+
export { default as Toggle } from './Toggle.svelte';
|
|
15
|
+
export { default as Swatch } from './Swatch.svelte';
|
|
16
|
+
export { default as List } from './List.svelte';
|
|
17
|
+
export { default as Tree } from './Tree.svelte';
|
|
18
|
+
export { default as LazyTree } from './LazyTree.svelte';
|
|
19
|
+
export { default as Connector } from './Connector.svelte';
|
|
20
|
+
export { default as ItemContent } from './ItemContent.svelte';
|
|
21
|
+
export { default as FloatingAction } from './FloatingAction.svelte';
|
|
22
|
+
export { default as PaletteManager } from './PaletteManager.svelte';
|
|
23
|
+
export { default as Tilt } from './Tilt.svelte';
|
|
24
|
+
export { default as Shine } from './Shine.svelte';
|
|
25
|
+
export { default as BreadCrumbs } from './BreadCrumbs.svelte';
|
|
26
|
+
export { default as Card } from './Card.svelte';
|
|
27
|
+
export { default as ProgressBar } from './ProgressBar.svelte';
|
|
28
|
+
export { default as Carousel } from './Carousel.svelte';
|
|
29
|
+
export { default as CommandPalette } from './CommandPalette.svelte';
|
|
30
|
+
export { default as Pill } from './Pill.svelte';
|
|
31
|
+
export { default as Rating } from './Rating.svelte';
|
|
32
|
+
export { default as Stepper } from './Stepper.svelte';
|
|
33
|
+
export { default as Switch } from './Switch.svelte';
|
|
34
|
+
export { default as Table } from './Table.svelte';
|
|
35
|
+
export { default as TreeTable } from './TreeTable.svelte';
|
|
36
|
+
export { default as SearchFilter } from './SearchFilter.svelte';
|
|
37
|
+
export { default as Range } from './Range.svelte';
|
|
38
|
+
export { default as Timeline } from './Timeline.svelte';
|
|
39
|
+
export { default as Reveal } from './Reveal.svelte';
|
|
40
|
+
export { default as Grid } from './Grid.svelte';
|
|
41
|
+
export { default as UploadTarget } from './UploadTarget.svelte';
|
|
42
|
+
export { default as UploadFileStatus } from './UploadFileStatus.svelte';
|
|
43
|
+
export { default as UploadProgress } from './UploadProgress.svelte';
|
|
44
|
+
export { default as FloatingNavigation } from './FloatingNavigation.svelte';
|
|
45
|
+
export { default as StatusList } from './StatusList.svelte';
|
|
46
|
+
export { default as Message } from './Message.svelte';
|
|
47
|
+
export { default as AlertList } from './AlertList.svelte';
|
|
48
|
+
export { default as Divider } from './Divider.svelte';
|
|
49
|
+
export { default as Stack } from './Stack.svelte';
|
|
50
|
+
export { default as Badge } from './Badge.svelte';
|
|
51
|
+
export { default as Avatar } from './Avatar.svelte';
|
|
52
|
+
export { default as Tooltip } from './Tooltip.svelte';
|
|
53
|
+
export { default as NavContent } from './NavContent.svelte';
|
|
54
|
+
export { default as ResponsiveGrid } from './ResponsiveGrid.svelte';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Button, ButtonGroup, Code, CodeBlock, CodeGroup, Frame, Menu, Dropdown, Select, MultiSelect, Toolbar, ToolbarGroup, Tabs, Toggle, Swatch, List, Tree, LazyTree, FloatingAction, FloatingNavigation, PaletteManager, Tilt, Shine, BreadCrumbs, Card, ProgressBar, Carousel, Pill, Rating, Connector, ItemContent, Stepper, Switch, Table, TreeTable, SearchFilter, Range, Timeline, Reveal, Grid, UploadTarget, UploadFileStatus, UploadProgress, StatusList, Message, AlertList, Divider, Stack, Badge, Avatar, Tooltip, NavContent, ResponsiveGrid, CommandPalette } from './components/index.js';
|
|
2
|
+
export { default as MarkdownRenderer } from './MarkdownRenderer.svelte';
|
|
3
|
+
export type { MarkdownPlugin } from './markdown-plugin.js';
|
|
4
|
+
export { highlightCode, preloadHighlighter, getSupportedLanguages } from './utils/shiki.js';
|
|
5
|
+
export * from './utils/palette.js';
|
|
6
|
+
export * from './types/index.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
/**
|
|
3
|
+
* A plugin that renders a fenced code block as a Svelte component.
|
|
4
|
+
* The component receives { code: string } as props.
|
|
5
|
+
*/
|
|
6
|
+
export interface MarkdownPlugin {
|
|
7
|
+
/** Fenced code block language to match (e.g. 'plot', 'table', 'sparkline') */
|
|
8
|
+
language: string;
|
|
9
|
+
/** Svelte component to render the block. Receives { code: string } */
|
|
10
|
+
component: Component<{
|
|
11
|
+
code: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AlertList Component Types
|
|
3
|
+
*
|
|
4
|
+
* Renders a portalled toast stack at a screen-edge position, reading from
|
|
5
|
+
* the shared `alerts` state.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Screen position for the toast stack.
|
|
9
|
+
*/
|
|
10
|
+
export type AlertListPosition = 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left';
|
|
11
|
+
/**
|
|
12
|
+
* Props for the AlertList component.
|
|
13
|
+
*/
|
|
14
|
+
export interface AlertListProps {
|
|
15
|
+
/** Screen position for the toast stack. */
|
|
16
|
+
position?: AlertListPosition;
|
|
17
|
+
/** Additional CSS class. */
|
|
18
|
+
class?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar Component Types
|
|
3
|
+
*/
|
|
4
|
+
/** Avatar size scale. */
|
|
5
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
/** Avatar shape. */
|
|
7
|
+
export type AvatarShape = 'circle' | 'square';
|
|
8
|
+
/** Online presence status. */
|
|
9
|
+
export type AvatarStatus = 'online' | 'offline' | 'away' | 'busy';
|
|
10
|
+
/**
|
|
11
|
+
* Props for the Avatar component.
|
|
12
|
+
*/
|
|
13
|
+
export interface AvatarProps {
|
|
14
|
+
/** Image source URL. */
|
|
15
|
+
src?: string;
|
|
16
|
+
/** Alt text for the image. */
|
|
17
|
+
alt?: string;
|
|
18
|
+
/** Explicit initials to display as fallback. */
|
|
19
|
+
initials?: string;
|
|
20
|
+
/** Full name — auto-derives initials if `initials` prop not provided. */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Size variant. */
|
|
23
|
+
size?: AvatarSize;
|
|
24
|
+
/** Online presence status. */
|
|
25
|
+
status?: AvatarStatus;
|
|
26
|
+
/** Shape variant. */
|
|
27
|
+
shape?: AvatarShape;
|
|
28
|
+
/** Additional CSS class. */
|
|
29
|
+
class?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Badge Component Types
|
|
3
|
+
*/
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
/** Semantic color variant for a badge. */
|
|
6
|
+
export type BadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'error';
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Badge component.
|
|
9
|
+
*
|
|
10
|
+
* Badge can be used standalone or wrapped around a child via the `children`
|
|
11
|
+
* snippet, in which case it positions itself absolutely over the child.
|
|
12
|
+
*/
|
|
13
|
+
export interface BadgeProps {
|
|
14
|
+
/** Numeric count to display. */
|
|
15
|
+
count?: number;
|
|
16
|
+
/** Maximum count before rendering as `${max}+`. Default `99`. */
|
|
17
|
+
max?: number;
|
|
18
|
+
/** Visual variant. */
|
|
19
|
+
variant?: BadgeVariant;
|
|
20
|
+
/** Render as a small dot without content. */
|
|
21
|
+
dot?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Content to wrap. When provided, the badge positions absolutely over
|
|
24
|
+
* the rendered child.
|
|
25
|
+
*/
|
|
26
|
+
children?: Snippet;
|
|
27
|
+
/** Additional CSS class. */
|
|
28
|
+
class?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BreadCrumbs Component Types
|
|
3
|
+
*/
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import type { ProxyItem } from '@rokkit/states';
|
|
6
|
+
/**
|
|
7
|
+
* Icon overrides for the BreadCrumbs component.
|
|
8
|
+
*/
|
|
9
|
+
export interface BreadCrumbsIcons {
|
|
10
|
+
/** Icon class used for the separator between crumbs. */
|
|
11
|
+
separator?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Props for the BreadCrumbs component.
|
|
15
|
+
*/
|
|
16
|
+
export interface BreadCrumbsProps {
|
|
17
|
+
/** Array of breadcrumb items. */
|
|
18
|
+
items?: unknown[];
|
|
19
|
+
/** Custom field mappings used by the internal `ProxyItem`. */
|
|
20
|
+
fields?: Record<string, string>;
|
|
21
|
+
/** Accessible label for the surrounding `<nav>`. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Custom icon overrides. */
|
|
24
|
+
icons?: BreadCrumbsIcons;
|
|
25
|
+
/** Called when a crumb is clicked. */
|
|
26
|
+
onclick?: (value: unknown, item: unknown) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Custom snippet for rendering each crumb. Receives the crumb's
|
|
29
|
+
* `ProxyItem` and a flag indicating whether it is the last (current) crumb.
|
|
30
|
+
*/
|
|
31
|
+
crumb?: Snippet<[ProxyItem, boolean]>;
|
|
32
|
+
/** Additional CSS class. */
|
|
33
|
+
class?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button Component Types
|
|
3
|
+
*
|
|
4
|
+
* Provides types for the Button and ButtonGroup components.
|
|
5
|
+
* Supports variants, styles, sizes, loading state, link buttons, and custom content.
|
|
6
|
+
*/
|
|
7
|
+
import type { Snippet } from 'svelte';
|
|
8
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
9
|
+
/** Semantic color variant */
|
|
10
|
+
export type ButtonVariant = 'default' | 'primary' | 'secondary' | 'accent' | 'danger';
|
|
11
|
+
/** Visual style treatment */
|
|
12
|
+
export type ButtonStyle = 'default' | 'outline' | 'ghost' | 'gradient' | 'link';
|
|
13
|
+
/**
|
|
14
|
+
* Props for the Button component.
|
|
15
|
+
*
|
|
16
|
+
* Extends native `<button>` attributes so consumers can pass `aria-*`,
|
|
17
|
+
* `onclick`, `title`, `name`, `form`, etc. The native `style` and `type`
|
|
18
|
+
* keys are omitted because this component repurposes `style` (visual
|
|
19
|
+
* treatment) and narrows `type` to the valid button types.
|
|
20
|
+
*/
|
|
21
|
+
export interface ButtonProps extends Omit<HTMLButtonAttributes, 'style' | 'type'> {
|
|
22
|
+
/** Semantic color variant */
|
|
23
|
+
variant?: ButtonVariant;
|
|
24
|
+
/** Visual style treatment */
|
|
25
|
+
style?: ButtonStyle;
|
|
26
|
+
/** Size variant */
|
|
27
|
+
size?: 'sm' | 'md' | 'lg';
|
|
28
|
+
/** HTML button type */
|
|
29
|
+
type?: 'button' | 'submit' | 'reset';
|
|
30
|
+
/** Button label text */
|
|
31
|
+
label?: string;
|
|
32
|
+
/** Leading icon class */
|
|
33
|
+
icon?: string;
|
|
34
|
+
/** Trailing icon class */
|
|
35
|
+
iconRight?: string;
|
|
36
|
+
/** Navigates as link instead of button */
|
|
37
|
+
href?: string;
|
|
38
|
+
/** Link target (when href is set) */
|
|
39
|
+
target?: string;
|
|
40
|
+
/** Native tooltip shown on hover */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** Disabled state */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** Loading state — shows spinner, disables interaction */
|
|
45
|
+
loading?: boolean;
|
|
46
|
+
/** Additional CSS classes */
|
|
47
|
+
class?: string;
|
|
48
|
+
/** Click handler */
|
|
49
|
+
onclick?: (event: MouseEvent) => void;
|
|
50
|
+
/** Custom content snippet */
|
|
51
|
+
children?: Snippet;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Props for the ButtonGroup component
|
|
55
|
+
*/
|
|
56
|
+
export interface ButtonGroupProps {
|
|
57
|
+
/** Size applied to all buttons in the group */
|
|
58
|
+
size?: 'sm' | 'md' | 'lg';
|
|
59
|
+
/** Additional CSS classes */
|
|
60
|
+
class?: string;
|
|
61
|
+
/** Content snippet (buttons) */
|
|
62
|
+
children?: Snippet;
|
|
63
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card Component Types
|
|
3
|
+
*/
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
/** Semantic color variant for a card. */
|
|
6
|
+
export type CardVariant = 'default' | 'primary' | 'secondary' | 'tertiary';
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Card component.
|
|
9
|
+
*
|
|
10
|
+
* When `href` is provided the card renders as an anchor. When `onclick` is
|
|
11
|
+
* provided (and no `href`) it renders as a button. Otherwise it renders as
|
|
12
|
+
* a plain container.
|
|
13
|
+
*/
|
|
14
|
+
export interface CardProps {
|
|
15
|
+
/** Optional href — renders the card as an `<a>` link. */
|
|
16
|
+
href?: string;
|
|
17
|
+
/** Click handler — applies only when no `href` is provided. */
|
|
18
|
+
onclick?: () => void;
|
|
19
|
+
/** Visual variant. */
|
|
20
|
+
variant?: CardVariant;
|
|
21
|
+
/** Additional CSS class. */
|
|
22
|
+
class?: string;
|
|
23
|
+
/** Card header snippet. */
|
|
24
|
+
header?: Snippet;
|
|
25
|
+
/** Card footer snippet. */
|
|
26
|
+
footer?: Snippet;
|
|
27
|
+
/** Card body content. */
|
|
28
|
+
children?: Snippet;
|
|
29
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carousel Component Types
|
|
3
|
+
*/
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
/** Transition effect between carousel slides. */
|
|
6
|
+
export type CarouselTransition = 'slide' | 'fade' | 'none';
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Carousel component.
|
|
9
|
+
*/
|
|
10
|
+
export interface CarouselProps {
|
|
11
|
+
/** Number of slides (required when using the `children` snippet). */
|
|
12
|
+
count?: number;
|
|
13
|
+
/** Current slide index (bindable). */
|
|
14
|
+
current?: number;
|
|
15
|
+
/** Auto-advance slides. */
|
|
16
|
+
autoplay?: boolean;
|
|
17
|
+
/** Autoplay interval in milliseconds. Default `5000`. */
|
|
18
|
+
interval?: number;
|
|
19
|
+
/** Wrap around at the ends. Default `true`. */
|
|
20
|
+
loop?: boolean;
|
|
21
|
+
/** Show navigation dots. Default `true`. */
|
|
22
|
+
showDots?: boolean;
|
|
23
|
+
/** Show prev / next arrow buttons. Default `true`. */
|
|
24
|
+
showArrows?: boolean;
|
|
25
|
+
/** Transition effect. Default `'slide'`. */
|
|
26
|
+
transition?: CarouselTransition;
|
|
27
|
+
/** Accessible label overrides for built-in controls. */
|
|
28
|
+
labels?: Record<string, string>;
|
|
29
|
+
/** Additional CSS class. */
|
|
30
|
+
class?: string;
|
|
31
|
+
/** Slide content — receives `(index, current)`. */
|
|
32
|
+
slide?: Snippet<[number, number]>;
|
|
33
|
+
/** Children snippet (alternative to `slide`). */
|
|
34
|
+
children?: Snippet;
|
|
35
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code component types — Code, CodeBlock, CodeGroup
|
|
3
|
+
*/
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import { DEFAULT_STATE_ICONS } from '@rokkit/core';
|
|
6
|
+
/** Supported themes for code highlighting */
|
|
7
|
+
export type CodeTheme = 'light' | 'dark';
|
|
8
|
+
/**
|
|
9
|
+
* Icons configuration for code action states.
|
|
10
|
+
* Keys match the naming convention in @rokkit/core DEFAULT_STATE_ICONS.
|
|
11
|
+
*/
|
|
12
|
+
export interface CodeStateIcons {
|
|
13
|
+
/** Icon class for copy button */
|
|
14
|
+
copy?: string;
|
|
15
|
+
/** Icon class for copy success state */
|
|
16
|
+
copysuccess?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Default state icons — uses semantic names from @rokkit/core
|
|
20
|
+
* that get resolved to actual icon classes via UnoCSS shortcuts.
|
|
21
|
+
*/
|
|
22
|
+
export declare const defaultCodeStateIcons: CodeStateIcons;
|
|
23
|
+
/** Props for the Code component */
|
|
24
|
+
export interface CodeProps {
|
|
25
|
+
/** The code string to display and highlight */
|
|
26
|
+
code: string;
|
|
27
|
+
/** Programming language for syntax highlighting */
|
|
28
|
+
language?: string;
|
|
29
|
+
/** Color theme for the code block */
|
|
30
|
+
theme?: CodeTheme;
|
|
31
|
+
/** Whether to show line numbers */
|
|
32
|
+
showLineNumbers?: boolean;
|
|
33
|
+
/** Whether to show the copy button */
|
|
34
|
+
showCopyButton?: boolean;
|
|
35
|
+
/** Icons for copy action states */
|
|
36
|
+
icons?: CodeStateIcons;
|
|
37
|
+
/** Additional CSS class */
|
|
38
|
+
class?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Shiki theme mode for CodeBlock.
|
|
42
|
+
*
|
|
43
|
+
* `'auto'` follows `body[data-mode]` (light / dark). Pass `'light'` or
|
|
44
|
+
* `'dark'` to force a theme.
|
|
45
|
+
*/
|
|
46
|
+
export type CodeBlockTheme = 'auto' | 'light' | 'dark';
|
|
47
|
+
/**
|
|
48
|
+
* Props for the CodeBlock component.
|
|
49
|
+
*
|
|
50
|
+
* Wraps a Shiki-highlighted code body in a Frame whose header carries the
|
|
51
|
+
* filename + language chip and optional action buttons.
|
|
52
|
+
*/
|
|
53
|
+
export interface CodeBlockProps {
|
|
54
|
+
/** The code body. */
|
|
55
|
+
code: string;
|
|
56
|
+
/** Language label shown as a chip in the header and used for highlighting. */
|
|
57
|
+
language?: string;
|
|
58
|
+
/** Filename label shown in the header. */
|
|
59
|
+
filename?: string;
|
|
60
|
+
/** Max height (CSS length) of the scrollable code area. No cap when unset. */
|
|
61
|
+
height?: string;
|
|
62
|
+
/** Shiki theme mode. Default `'auto'`. */
|
|
63
|
+
theme?: CodeBlockTheme;
|
|
64
|
+
/** Show the copy-to-clipboard button. Default `false`. */
|
|
65
|
+
allowCopy?: boolean;
|
|
66
|
+
/** Show the download-as-file button. Default `false`. */
|
|
67
|
+
allowDownload?: boolean;
|
|
68
|
+
/** Optional extra-actions slot rendered after copy / download. */
|
|
69
|
+
actions?: Snippet;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* One file in a CodeGroup.
|
|
73
|
+
*
|
|
74
|
+
* The `path` doubles as id and tree placement (e.g. `src/lib/Button.svelte`).
|
|
75
|
+
* Intermediate segments become folder nodes; the final segment becomes a
|
|
76
|
+
* file leaf.
|
|
77
|
+
*/
|
|
78
|
+
export interface CodeGroupFile {
|
|
79
|
+
/** Full path used as id and for tree placement. */
|
|
80
|
+
path: string;
|
|
81
|
+
/** Shiki language id. */
|
|
82
|
+
language: string;
|
|
83
|
+
/** Source code. */
|
|
84
|
+
code: string;
|
|
85
|
+
/** Display name override — defaults to the path's last segment. */
|
|
86
|
+
name?: string;
|
|
87
|
+
/** File icon override (full icon class) — defaults to extension lookup. */
|
|
88
|
+
icon?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Icon overrides for the CodeGroup component, grouped by semantic category.
|
|
92
|
+
*/
|
|
93
|
+
export interface CodeGroupIconOverrides {
|
|
94
|
+
doc?: Partial<typeof DEFAULT_STATE_ICONS.doc>;
|
|
95
|
+
folder?: Partial<typeof DEFAULT_STATE_ICONS.folder>;
|
|
96
|
+
view?: Partial<typeof DEFAULT_STATE_ICONS.view>;
|
|
97
|
+
action?: Partial<typeof DEFAULT_STATE_ICONS.action>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Props for the CodeGroup component.
|
|
101
|
+
*
|
|
102
|
+
* Renders a hierarchical tree picker over multiple files with an optional
|
|
103
|
+
* collapsible preview panel.
|
|
104
|
+
*/
|
|
105
|
+
export interface CodeGroupProps {
|
|
106
|
+
/** Files rendered in the group. */
|
|
107
|
+
files: CodeGroupFile[];
|
|
108
|
+
/** Path of the file selected on first render. Defaults to the first file. */
|
|
109
|
+
initialFile?: string;
|
|
110
|
+
/** Additional CSS class. */
|
|
111
|
+
class?: string;
|
|
112
|
+
/** Icon overrides per semantic category. */
|
|
113
|
+
icons?: CodeGroupIconOverrides;
|
|
114
|
+
/** Optional preview content — toggled by a "Show preview" action. */
|
|
115
|
+
preview?: Snippet;
|
|
116
|
+
/** Show the copy button on the inner CodeBlock. Default `true`. */
|
|
117
|
+
showCopyButton?: boolean;
|
|
118
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
import type { ConnectorType } from './tree.js';
|
|
9
|
+
export type { ConnectorType } from './tree.js';
|
|
10
|
+
/**
|
|
11
|
+
* Props for the Connector component.
|
|
12
|
+
*/
|
|
13
|
+
export interface ConnectorProps {
|
|
14
|
+
/** The type of connector to render. Default `'empty'`. */
|
|
15
|
+
type?: ConnectorType;
|
|
16
|
+
/** Right-to-left layout support. */
|
|
17
|
+
rtl?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Divider Component Types
|
|
3
|
+
*/
|
|
4
|
+
/** Divider orientation. */
|
|
5
|
+
export type DividerOrientation = 'horizontal' | 'vertical';
|
|
6
|
+
/**
|
|
7
|
+
* Props for the Divider component.
|
|
8
|
+
*/
|
|
9
|
+
export interface DividerProps {
|
|
10
|
+
/** Orientation of the divider. */
|
|
11
|
+
orientation?: DividerOrientation;
|
|
12
|
+
/** Optional label text rendered inline with the divider. */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Additional CSS class. */
|
|
15
|
+
class?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
/**
|
|
3
|
+
* Field mapping for FloatingAction items
|
|
4
|
+
*/
|
|
5
|
+
export type FloatingActionFields = Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Default field mappings
|
|
8
|
+
*/
|
|
9
|
+
export declare const defaultFloatingActionFields: Required<Pick<FloatingActionFields, 'text' | 'value' | 'icon' | 'label' | 'disabled'>>;
|
|
10
|
+
/**
|
|
11
|
+
* A single action item
|
|
12
|
+
*/
|
|
13
|
+
export type FloatingActionItem = Record<string, unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* Event handlers passed to custom snippets
|
|
16
|
+
*/
|
|
17
|
+
export interface FloatingActionItemHandlers {
|
|
18
|
+
onclick: () => void;
|
|
19
|
+
onkeydown: (event: KeyboardEvent) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Custom snippet for rendering an action item
|
|
23
|
+
*/
|
|
24
|
+
export type FloatingActionItemSnippet = Snippet<[
|
|
25
|
+
item: FloatingActionItem,
|
|
26
|
+
fields: FloatingActionFields,
|
|
27
|
+
handlers: FloatingActionItemHandlers
|
|
28
|
+
]>;
|
|
29
|
+
/**
|
|
30
|
+
* Position options for the FAB
|
|
31
|
+
*/
|
|
32
|
+
export type FloatingActionPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
33
|
+
/**
|
|
34
|
+
* Expansion direction for action items
|
|
35
|
+
*/
|
|
36
|
+
export type FloatingActionExpand = 'radial' | 'vertical' | 'horizontal';
|
|
37
|
+
/**
|
|
38
|
+
* Alignment for action items in the menu
|
|
39
|
+
*/
|
|
40
|
+
export type FloatingActionItemAlign = 'start' | 'center' | 'end';
|
|
41
|
+
/**
|
|
42
|
+
* Icons for the FloatingAction trigger button
|
|
43
|
+
*/
|
|
44
|
+
export interface FloatingActionIcons {
|
|
45
|
+
/** Icon for the main trigger (add action) */
|
|
46
|
+
add?: string;
|
|
47
|
+
/** Icon shown when menu is open (close action) */
|
|
48
|
+
close?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Props for the FloatingAction component
|
|
52
|
+
*/
|
|
53
|
+
export interface FloatingActionProps {
|
|
54
|
+
/** Array of action items */
|
|
55
|
+
items?: FloatingActionItem[];
|
|
56
|
+
/** Field mapping configuration */
|
|
57
|
+
fields?: FloatingActionFields;
|
|
58
|
+
/** Custom icons for the trigger button */
|
|
59
|
+
icons?: FloatingActionIcons;
|
|
60
|
+
/** Accessible label for the trigger */
|
|
61
|
+
label?: string;
|
|
62
|
+
/** Size variant */
|
|
63
|
+
size?: 'sm' | 'md' | 'lg';
|
|
64
|
+
/** Position on screen */
|
|
65
|
+
position?: FloatingActionPosition;
|
|
66
|
+
/** How items expand when opened */
|
|
67
|
+
expand?: FloatingActionExpand;
|
|
68
|
+
/** Alignment of items in the menu (start/center/end) */
|
|
69
|
+
itemAlign?: FloatingActionItemAlign;
|
|
70
|
+
/** Disable the FAB */
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
/** Whether the menu is open (bindable) */
|
|
73
|
+
open?: boolean;
|
|
74
|
+
/** Show backdrop overlay when open */
|
|
75
|
+
backdrop?: boolean;
|
|
76
|
+
/** Position relative to nearest positioned ancestor instead of viewport */
|
|
77
|
+
contained?: boolean;
|
|
78
|
+
/** Called when an action is selected */
|
|
79
|
+
onselect?: (value: unknown, item: FloatingActionItem) => void;
|
|
80
|
+
/** Called when menu opens */
|
|
81
|
+
onopen?: () => void;
|
|
82
|
+
/** Called when menu closes */
|
|
83
|
+
onclose?: () => void;
|
|
84
|
+
/** Additional CSS classes */
|
|
85
|
+
class?: string;
|
|
86
|
+
/** Custom snippet for rendering action items */
|
|
87
|
+
item?: FloatingActionItemSnippet;
|
|
88
|
+
}
|
|
89
|
+
export { getSnippet } from './menu.js';
|