@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.
Files changed (124) hide show
  1. package/dist/MarkdownRenderer.svelte.d.ts +15 -0
  2. package/dist/components/AlertList.svelte.d.ts +4 -0
  3. package/dist/components/Avatar.svelte.d.ts +4 -0
  4. package/dist/components/Badge.svelte.d.ts +4 -0
  5. package/dist/components/BreadCrumbs.svelte.d.ts +4 -0
  6. package/dist/components/Button.svelte.d.ts +4 -0
  7. package/dist/components/ButtonGroup.svelte.d.ts +4 -0
  8. package/dist/components/Card.svelte.d.ts +4 -0
  9. package/dist/components/Carousel.svelte.d.ts +4 -0
  10. package/dist/components/Code.svelte.d.ts +7 -0
  11. package/dist/components/CodeBlock.svelte.d.ts +4 -0
  12. package/dist/components/CodeGroup.svelte.d.ts +4 -0
  13. package/dist/components/CommandPalette.svelte.d.ts +7 -0
  14. package/dist/components/Connector.svelte.d.ts +4 -0
  15. package/dist/components/Divider.svelte.d.ts +4 -0
  16. package/dist/components/Dropdown.svelte.d.ts +22 -0
  17. package/dist/components/FloatingAction.svelte.d.ts +7 -0
  18. package/dist/components/FloatingNavigation.svelte.d.ts +7 -0
  19. package/dist/components/Frame.svelte.d.ts +17 -0
  20. package/dist/components/Grid.svelte.d.ts +45 -0
  21. package/dist/components/ItemContent.svelte.d.ts +4 -0
  22. package/dist/components/LazyTree.svelte.d.ts +30 -0
  23. package/dist/components/List.svelte.d.ts +49 -0
  24. package/dist/components/Menu.svelte.d.ts +68 -0
  25. package/dist/components/Message.svelte.d.ts +4 -0
  26. package/dist/components/MultiSelect.svelte.d.ts +25 -0
  27. package/dist/components/NavContent.svelte.d.ts +4 -0
  28. package/dist/components/PaletteManager.svelte.d.ts +4 -0
  29. package/dist/components/Pill.svelte.d.ts +4 -0
  30. package/dist/components/ProgressBar.svelte.d.ts +4 -0
  31. package/dist/components/Range.svelte.d.ts +7 -0
  32. package/dist/components/Rating.svelte.d.ts +4 -0
  33. package/dist/components/ResponsiveGrid.svelte.d.ts +4 -0
  34. package/dist/components/Reveal.svelte.d.ts +4 -0
  35. package/dist/components/SearchFilter.svelte.d.ts +7 -0
  36. package/dist/components/Select.svelte.d.ts +26 -0
  37. package/dist/components/Shine.svelte.d.ts +4 -0
  38. package/dist/components/Stack.svelte.d.ts +4 -0
  39. package/dist/components/StatusList.svelte.d.ts +4 -0
  40. package/dist/components/Stepper.svelte.d.ts +4 -0
  41. package/dist/components/Swatch.svelte.d.ts +30 -0
  42. package/dist/components/Switch.svelte.d.ts +4 -0
  43. package/dist/components/Table.svelte.d.ts +4 -0
  44. package/dist/components/Tabs.svelte.d.ts +26 -0
  45. package/dist/components/Tilt.svelte.d.ts +4 -0
  46. package/dist/components/Timeline.svelte.d.ts +4 -0
  47. package/dist/components/Toggle.svelte.d.ts +7 -0
  48. package/dist/components/Toolbar.svelte.d.ts +8 -0
  49. package/dist/components/ToolbarGroup.svelte.d.ts +4 -0
  50. package/dist/components/Tooltip.svelte.d.ts +17 -0
  51. package/dist/components/Tree.svelte.d.ts +31 -0
  52. package/dist/components/TreeTable.svelte.d.ts +4 -0
  53. package/dist/components/UploadFileStatus.svelte.d.ts +19 -0
  54. package/dist/components/UploadProgress.svelte.d.ts +7 -0
  55. package/dist/components/UploadTarget.svelte.d.ts +7 -0
  56. package/dist/components/index.d.ts +54 -0
  57. package/dist/index.d.ts +6 -0
  58. package/dist/markdown-plugin.d.ts +13 -0
  59. package/dist/types/alert-list.d.ts +19 -0
  60. package/dist/types/avatar.d.ts +30 -0
  61. package/dist/types/badge.d.ts +29 -0
  62. package/dist/types/breadcrumbs.d.ts +34 -0
  63. package/dist/types/button.d.ts +63 -0
  64. package/dist/types/card.d.ts +29 -0
  65. package/dist/types/carousel.d.ts +35 -0
  66. package/dist/types/code.d.ts +118 -0
  67. package/dist/types/connector.d.ts +18 -0
  68. package/dist/types/divider.d.ts +16 -0
  69. package/dist/types/floating-action.d.ts +89 -0
  70. package/dist/types/floating-navigation.d.ts +66 -0
  71. package/dist/types/frame.d.ts +24 -0
  72. package/dist/types/index.d.ts +44 -0
  73. package/dist/types/item-content.d.ts +22 -0
  74. package/dist/types/list.d.ts +128 -0
  75. package/dist/types/menu.d.ts +53 -0
  76. package/dist/types/message.d.ts +42 -0
  77. package/dist/types/nav-content.d.ts +23 -0
  78. package/dist/types/palette.d.ts +98 -0
  79. package/dist/types/pill.d.ts +33 -0
  80. package/dist/types/progress-bar.d.ts +16 -0
  81. package/dist/types/range.d.ts +35 -0
  82. package/dist/types/rating.d.ts +33 -0
  83. package/dist/types/responsive-grid.d.ts +19 -0
  84. package/dist/types/reveal.d.ts +37 -0
  85. package/dist/types/search-filter.d.ts +43 -0
  86. package/dist/types/select.d.ts +114 -0
  87. package/dist/types/shine.d.ts +28 -0
  88. package/dist/types/stack.d.ts +29 -0
  89. package/dist/types/status-list.d.ts +35 -0
  90. package/dist/types/stepper.d.ts +56 -0
  91. package/dist/types/switch.d.ts +46 -0
  92. package/dist/types/table.d.ts +148 -0
  93. package/dist/types/tabs.d.ts +68 -0
  94. package/dist/types/tilt.d.ts +22 -0
  95. package/dist/types/timeline.d.ts +30 -0
  96. package/dist/types/toggle.d.ts +54 -0
  97. package/dist/types/toolbar.d.ts +109 -0
  98. package/dist/types/tooltip.d.ts +15 -0
  99. package/dist/types/tree-table.d.ts +79 -0
  100. package/dist/types/tree.d.ts +183 -0
  101. package/dist/types/upload-file-status.d.ts +31 -0
  102. package/dist/types/upload-progress.d.ts +71 -0
  103. package/dist/types/upload-target.d.ts +46 -0
  104. package/dist/utils/palette.d.ts +100 -0
  105. package/dist/utils/shiki.d.ts +20 -0
  106. package/dist/utils/upload.d.ts +21 -0
  107. package/package.json +14 -11
  108. package/src/MarkdownRenderer.svelte +6 -4
  109. package/src/components/Button.svelte +7 -1
  110. package/src/components/LazyTree.svelte +3 -4
  111. package/src/components/List.svelte +1 -1
  112. package/src/components/MultiSelect.svelte +3 -3
  113. package/src/components/Pill.svelte +10 -5
  114. package/src/components/Select.svelte +3 -3
  115. package/src/components/Swatch.svelte +35 -8
  116. package/src/components/Table.svelte +2 -1
  117. package/src/components/Tabs.svelte +1 -2
  118. package/src/components/Toggle.svelte +2 -2
  119. package/src/components/Tree.svelte +1 -2
  120. package/src/components/TreeTable.svelte +2 -1
  121. package/src/components/UploadTarget.svelte +2 -1
  122. package/src/types/button.ts +8 -2
  123. package/src/types/tabs.ts +4 -4
  124. package/src/types/toggle.ts +3 -2
@@ -0,0 +1,66 @@
1
+ import type { Snippet } from 'svelte';
2
+ /**
3
+ * Position on the screen edge
4
+ */
5
+ export type FloatingNavigationPosition = 'left' | 'right' | 'top' | 'bottom';
6
+ /**
7
+ * Size variant
8
+ */
9
+ export type FloatingNavigationSize = 'sm' | 'md' | 'lg';
10
+ /**
11
+ * A single navigation item
12
+ */
13
+ export type FloatingNavigationItem = Record<string, unknown>;
14
+ /**
15
+ * Custom snippet for rendering a navigation item
16
+ */
17
+ export type FloatingNavigationItemSnippet = Snippet<[
18
+ item: FloatingNavigationItem,
19
+ proxy: {
20
+ text: string;
21
+ icon: string;
22
+ 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
+ * Props for the FloatingNavigation component
36
+ */
37
+ export interface FloatingNavigationProps {
38
+ /** Navigation items (data-driven) */
39
+ items?: FloatingNavigationItem[];
40
+ /** Field mapping configuration */
41
+ fields?: Record<string, string>;
42
+ /** Custom icons for pin/unpin */
43
+ icons?: FloatingNavigationIcons;
44
+ /** Active item value (bindable) */
45
+ value?: unknown;
46
+ /** Screen edge to anchor to */
47
+ position?: FloatingNavigationPosition;
48
+ /** Whether nav is pinned open (bindable) */
49
+ pinned?: boolean;
50
+ /** Auto-track active section via IntersectionObserver */
51
+ observe?: boolean;
52
+ /** IntersectionObserver config */
53
+ observerOptions?: IntersectionObserverInit;
54
+ /** Size variant */
55
+ size?: FloatingNavigationSize;
56
+ /** Accessible label */
57
+ label?: string;
58
+ /** Called when an item is selected */
59
+ onselect?: (value: unknown, item: FloatingNavigationItem) => void;
60
+ /** Called when pin state changes */
61
+ onpinchange?: (pinned: boolean) => void;
62
+ /** Custom snippet for rendering items */
63
+ item?: FloatingNavigationItemSnippet;
64
+ /** Additional CSS classes */
65
+ class?: string;
66
+ }
@@ -0,0 +1,24 @@
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
+ import type { Snippet } from 'svelte';
9
+ /**
10
+ * Props for the Frame component.
11
+ */
12
+ export interface FrameProps {
13
+ /** Top slot — title, action chips, status badges, etc. */
14
+ header?: Snippet;
15
+ /** Main content. */
16
+ children?: Snippet;
17
+ /** Bottom slot — metadata, actions, secondary controls. */
18
+ footer?: Snippet;
19
+ /**
20
+ * When true the body slot has zero padding so the inner artifact
21
+ * (a chart, a `<pre>`, a table) controls its own padding.
22
+ */
23
+ flush?: boolean;
24
+ }
@@ -0,0 +1,44 @@
1
+ export * from './button.js';
2
+ export * from './code.js';
3
+ export * from './menu.js';
4
+ export * from './select.js';
5
+ export * from './toolbar.js';
6
+ export * from './tabs.js';
7
+ export * from './toggle.js';
8
+ export * from './switch.js';
9
+ export * from './list.js';
10
+ export * from './tree.js';
11
+ export * from './floating-action.js';
12
+ export * from './palette.js';
13
+ export * from './table.js';
14
+ export * from './tree-table.js';
15
+ export * from './search-filter.js';
16
+ export * from './range.js';
17
+ export * from './timeline.js';
18
+ export * from './floating-navigation.js';
19
+ export * from './upload-target.js';
20
+ export * from './upload-file-status.js';
21
+ export * from './upload-progress.js';
22
+ export * from './tooltip.js';
23
+ export * from './item-content.js';
24
+ export * from './status-list.js';
25
+ export * from './alert-list.js';
26
+ export * from './avatar.js';
27
+ export * from './badge.js';
28
+ export * from './breadcrumbs.js';
29
+ export * from './card.js';
30
+ export * from './carousel.js';
31
+ export * from './connector.js';
32
+ export * from './divider.js';
33
+ export * from './frame.js';
34
+ export * from './message.js';
35
+ export * from './nav-content.js';
36
+ export * from './pill.js';
37
+ export * from './progress-bar.js';
38
+ export * from './rating.js';
39
+ export * from './responsive-grid.js';
40
+ export * from './reveal.js';
41
+ export * from './shine.js';
42
+ export * from './stack.js';
43
+ export * from './stepper.js';
44
+ export * from './tilt.js';
@@ -0,0 +1,22 @@
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
+ import type { ProxyItem } from '@rokkit/states';
9
+ /**
10
+ * Props for the ItemContent component.
11
+ */
12
+ export interface ItemContentProps {
13
+ /**
14
+ * ProxyItem wrapper around the underlying data — exposes `label`,
15
+ * `get(field)`, and the item's reactive selection / expansion state.
16
+ */
17
+ proxy: ProxyItem;
18
+ /** Render the avatar / icon slot. Default: `true`. */
19
+ showIcon?: boolean;
20
+ /** Render the description / subtext line under the label. Default: `true`. */
21
+ showSubtext?: boolean;
22
+ }
@@ -0,0 +1,128 @@
1
+ /**
2
+ * List Component Types
3
+ *
4
+ * Provides types for the data-driven List component.
5
+ * Supports navigation links, button items, and grouped items with collapsible sections.
6
+ * Field mapping and data access is handled by ProxyItem from @rokkit/states.
7
+ */
8
+ /**
9
+ * Field mapping configuration for list data.
10
+ */
11
+ export interface ListFields {
12
+ /** Field for display text - default: 'text' */
13
+ text?: string;
14
+ /** Field for the value to use for selection matching - default: 'value' */
15
+ value?: string;
16
+ /** Field for navigation URL (renders as <a>) - default: 'href' */
17
+ href?: string;
18
+ /** Field for icon class name - default: 'icon' */
19
+ icon?: string;
20
+ /** Field for secondary descriptive text - default: 'description' */
21
+ description?: string;
22
+ /** Field for aria-label override - default: 'label' */
23
+ label?: string;
24
+ /** Field for disabled state - default: 'disabled' */
25
+ disabled?: string;
26
+ /** Field for children array (for grouping) - default: 'children' */
27
+ children?: string;
28
+ /** Field for custom snippet name - default: 'snippet' */
29
+ snippet?: string;
30
+ /** Field for badge/indicator content - default: 'badge' */
31
+ badge?: string;
32
+ /** Field for tooltip text (HTML title attribute) - default: 'title' */
33
+ title?: string;
34
+ /** Nested field mapping for children - default: inherits parent */
35
+ fields?: ListFields;
36
+ }
37
+ /**
38
+ * Default field mapping values
39
+ */
40
+ export declare const defaultListFields: Required<Omit<ListFields, 'fields'>>;
41
+ /**
42
+ * Generic list item - can be any object with mapped fields
43
+ */
44
+ export type ListItem = Record<string, unknown>;
45
+ /**
46
+ * Handlers passed to custom item snippets
47
+ */
48
+ export interface ListItemHandlers {
49
+ /** Call to trigger item selection (for button items) */
50
+ onclick: () => void;
51
+ /** Forward keyboard events for accessibility */
52
+ onkeydown: (event: KeyboardEvent) => void;
53
+ }
54
+ /**
55
+ * Snippet type for rendering list items.
56
+ * Parameters: item, fields, handlers, isActive
57
+ */
58
+ export type ListItemSnippet = import('svelte').Snippet<[
59
+ ListItem,
60
+ ListFields,
61
+ ListItemHandlers,
62
+ boolean
63
+ ]>;
64
+ /**
65
+ * Snippet type for rendering group labels
66
+ * Parameters: item (group), fields, toggleExpanded, isExpanded
67
+ */
68
+ export type ListGroupLabelSnippet = import('svelte').Snippet<[
69
+ ListItem,
70
+ ListFields,
71
+ () => void,
72
+ boolean
73
+ ]>;
74
+ /**
75
+ * Props for the List component
76
+ */
77
+ export interface ListProps {
78
+ /** Array of list items or groups */
79
+ items?: ListItem[];
80
+ /** Field mapping configuration */
81
+ fields?: ListFields;
82
+ /** Currently selected value (for highlighting button items) */
83
+ value?: unknown;
84
+ /** Size variant */
85
+ size?: 'sm' | 'md' | 'lg';
86
+ /** Whether the entire list is disabled */
87
+ disabled?: boolean;
88
+ /** Whether groups can be collapsed */
89
+ collapsible?: boolean;
90
+ /** Enable multiple item selection (Ctrl+click toggle, Shift+click range) */
91
+ multiselect?: boolean;
92
+ /** Which groups are expanded (bindable) - keyed by group value/text */
93
+ expanded?: Record<string, boolean>;
94
+ /** Selected items array (bindable) - populated in multiselect mode */
95
+ selected?: unknown[];
96
+ /** Active item value - List looks up item by this value to highlight it */
97
+ active?: unknown;
98
+ /** Called when a button item is selected */
99
+ onselect?: (value: unknown, item: ListItem) => void;
100
+ /** Called when selected items change in multiselect mode */
101
+ onselectedchange?: (selected: unknown[]) => void;
102
+ /** Called when expanded state changes (for bindable expanded) */
103
+ onexpandedchange?: (expanded: Record<string, boolean>) => void;
104
+ /** Additional CSS classes */
105
+ class?: string;
106
+ /** Icons for list group states (expand/collapse arrow) */
107
+ icons?: ListStateIcons;
108
+ /** Custom snippet for rendering list items */
109
+ item?: ListItemSnippet;
110
+ /** Custom snippet for rendering group labels/headers */
111
+ groupLabel?: ListGroupLabelSnippet;
112
+ }
113
+ /**
114
+ * Icons configuration for list collapsible group states.
115
+ * Keys match the naming convention in @rokkit/core DEFAULT_STATE_ICONS.
116
+ */
117
+ export interface ListStateIcons {
118
+ /** Icon class for expanded group */
119
+ opened?: string;
120
+ /** Icon class for collapsed group */
121
+ closed?: string;
122
+ }
123
+ /**
124
+ * Default state icons — uses semantic names from @rokkit/core
125
+ * that get resolved to actual icon classes via UnoCSS shortcuts.
126
+ */
127
+ export declare const defaultListStateIcons: ListStateIcons;
128
+ export { getSnippet } from './menu.js';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Menu Component Types
3
+ *
4
+ * The new Menu uses the same Wrapper + Navigator stack as List.
5
+ * Trigger action manages open/close. Dropdown content is identical to List.
6
+ */
7
+ import type { ProxyItem } from '@rokkit/states';
8
+ /**
9
+ * Props for the Menu component.
10
+ * Content props (items, fields, value, size, disabled, collapsible, icons, onselect, class, snippets)
11
+ * are identical to List. Additional props: label, icon, showArrow, align, direction.
12
+ */
13
+ export interface MenuProps {
14
+ /** Array of items (same as List: supports groups, separators, nested children) */
15
+ items?: unknown[];
16
+ /** Field mapping — overrides BASE_FIELDS defaults (label → 'label', value → 'value', …) */
17
+ fields?: Record<string, string>;
18
+ /** Current active value (highlights matching item) */
19
+ value?: unknown;
20
+ /** Size variant */
21
+ size?: 'sm' | 'md' | 'lg';
22
+ /** Whether the entire menu is disabled */
23
+ disabled?: boolean;
24
+ /** Whether groups are collapsible (same as List) */
25
+ collapsible?: boolean;
26
+ /** Trigger button label text */
27
+ label?: string;
28
+ /** Trigger button icon class */
29
+ icon?: string;
30
+ /** Whether to show dropdown arrow indicator on trigger */
31
+ showArrow?: boolean;
32
+ /** Dropdown alignment relative to trigger */
33
+ align?: 'start' | 'end';
34
+ /** Dropdown direction */
35
+ direction?: 'up' | 'down';
36
+ /** Icons for expand/collapse states */
37
+ icons?: MenuStateIcons;
38
+ /** Called when a leaf item is selected */
39
+ onselect?: (value: unknown, proxy: ProxyItem) => void;
40
+ /** Additional CSS classes */
41
+ class?: string;
42
+ }
43
+ export interface MenuStateIcons {
44
+ /** Icon class for open state */
45
+ opened?: string;
46
+ /** Icon class for closed state */
47
+ closed?: string;
48
+ }
49
+ export declare const defaultMenuStateIcons: MenuStateIcons;
50
+ /**
51
+ * Retrieve a named snippet from a snippets record, with type/null safety.
52
+ */
53
+ export declare function getSnippet<T>(snippets: Record<string, T | undefined>, name: string | null): T | null;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Message Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ /** Semantic message type — drives color treatment and the default icon. */
6
+ export type MessageType = 'error' | 'info' | 'success' | 'warning';
7
+ /**
8
+ * Icon overrides for the Message component, keyed by message type.
9
+ */
10
+ export interface MessageIcons {
11
+ error?: string;
12
+ info?: string;
13
+ success?: string;
14
+ warning?: string;
15
+ }
16
+ /**
17
+ * Props for the Message component.
18
+ */
19
+ export interface MessageProps {
20
+ /** Message type — controls color and the default icon. */
21
+ type?: MessageType;
22
+ /** Icon class overrides per type. */
23
+ icons?: MessageIcons;
24
+ /** Text content (shorthand). `children` takes precedence when both provided. */
25
+ text?: string;
26
+ /** Show a dismiss button. */
27
+ dismissible?: boolean;
28
+ /**
29
+ * Auto-dismiss after N milliseconds. Defaults to `4000` when not
30
+ * `dismissible`, otherwise persistent (no auto-dismiss). Pass `0`
31
+ * to disable auto-dismissal explicitly.
32
+ */
33
+ timeout?: number;
34
+ /** Optional action buttons snippet. */
35
+ actions?: Snippet;
36
+ /** Rich content (takes precedence over `text`). */
37
+ children?: Snippet;
38
+ /** Called when dismissed — via button click or timeout. */
39
+ ondismiss?: () => void;
40
+ /** Additional CSS class. */
41
+ class?: string;
42
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * NavContent Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ /** Layout orientation. */
6
+ export type NavContentOrientation = 'horizontal' | 'vertical';
7
+ /**
8
+ * Props for the NavContent component.
9
+ */
10
+ export interface NavContentProps {
11
+ /** Layout orientation. */
12
+ orientation?: NavContentOrientation;
13
+ /** Nav panel width (horizontal) or height (vertical) — CSS length value. */
14
+ navSize?: string;
15
+ /** Collapse the nav panel on small screens. */
16
+ collapsible?: boolean;
17
+ /** Nav panel snippet. */
18
+ nav: Snippet;
19
+ /** Content panel snippet. */
20
+ content: Snippet;
21
+ /** Additional CSS class. */
22
+ class?: string;
23
+ }
@@ -0,0 +1,98 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ColorRole, Shades } from '../utils/palette.js';
3
+ /**
4
+ * Configuration for a complete color palette
5
+ */
6
+ export interface PaletteConfig {
7
+ /** Name of the palette (e.g., "Vibrant", "Ocean", "Custom 1") */
8
+ name: string;
9
+ /** Mapping of color roles to Tailwind color names or hex values */
10
+ mapping: Partial<Record<ColorRole, string>>;
11
+ }
12
+ /**
13
+ * A preset palette (built-in)
14
+ */
15
+ export interface PalettePreset {
16
+ /** Display name */
17
+ name: string;
18
+ /** Tailwind color name */
19
+ color: string;
20
+ /** Preview hex color (usually the 500 shade) */
21
+ preview: string;
22
+ }
23
+ /**
24
+ * Icons for the PaletteManager component
25
+ */
26
+ export interface PaletteManagerIcons {
27
+ /** Icon for the save button */
28
+ save?: string;
29
+ /** Icon for the apply/check button */
30
+ check?: string;
31
+ /** Icon for the presets toggle */
32
+ presets?: string;
33
+ /** Icon for the hex input toggle */
34
+ hex?: string;
35
+ }
36
+ /**
37
+ * Props for the PaletteManager component
38
+ */
39
+ export interface PaletteManagerProps {
40
+ /** Current palette configuration (bindable) */
41
+ value?: PaletteConfig;
42
+ /** Built-in preset palettes */
43
+ presets?: PalettePreset[];
44
+ /** User-saved custom palettes */
45
+ custom?: PaletteConfig[];
46
+ /** localStorage key for persistence */
47
+ storageKey?: string;
48
+ /** Roles to show in the editor */
49
+ roles?: ColorRole[];
50
+ /** Custom icons */
51
+ icons?: PaletteManagerIcons;
52
+ /** Auto-apply changes in real-time */
53
+ autoApply?: boolean;
54
+ /** Show preset selector */
55
+ showPresets?: boolean;
56
+ /** Show save button */
57
+ showSave?: boolean;
58
+ /** Compact mode (fewer controls) */
59
+ compact?: boolean;
60
+ /** Additional CSS classes */
61
+ class?: string;
62
+ /** Called when palette changes */
63
+ onchange?: (palette: PaletteConfig) => void;
64
+ /** Called when user saves a custom palette */
65
+ onsave?: (palette: PaletteConfig) => void;
66
+ /** Called when palette is applied */
67
+ onapply?: (palette: PaletteConfig) => void;
68
+ /** Custom snippet for rendering a color role row */
69
+ roleRow?: PaletteRoleRowSnippet;
70
+ }
71
+ /**
72
+ * Handlers passed to custom role row snippet
73
+ */
74
+ export interface PaletteRoleRowHandlers {
75
+ onColorChange: (color: string) => void;
76
+ onHexInput: (hex: string) => void;
77
+ }
78
+ /**
79
+ * Custom snippet for rendering a palette role row
80
+ */
81
+ export type PaletteRoleRowSnippet = Snippet<[
82
+ role: ColorRole,
83
+ currentColor: string,
84
+ shades: Shades,
85
+ handlers: PaletteRoleRowHandlers
86
+ ]>;
87
+ /**
88
+ * Default color roles to display
89
+ */
90
+ export declare const defaultRoles: ColorRole[];
91
+ /**
92
+ * Default palette presets using Tailwind colors
93
+ */
94
+ export declare const defaultPresets: PalettePreset[];
95
+ /**
96
+ * Default palette configuration
97
+ */
98
+ export declare const defaultPaletteConfig: PaletteConfig;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Pill Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ import type { ProxyItem } from '@rokkit/states';
6
+ /**
7
+ * Icon overrides for the Pill component.
8
+ */
9
+ export interface PillIcons {
10
+ /** Icon class for the remove button. */
11
+ remove?: string;
12
+ }
13
+ /**
14
+ * Props for the Pill component.
15
+ */
16
+ export interface PillProps {
17
+ /** Item data — primitive (string / number) or an object. */
18
+ value: unknown;
19
+ /** Custom field mappings used by the internal `ProxyItem`. */
20
+ fields?: Record<string, string>;
21
+ /** Show the remove button (and enable Delete / Backspace shortcuts). */
22
+ removable?: boolean;
23
+ /** Disabled state. */
24
+ disabled?: boolean;
25
+ /** Custom icon overrides. */
26
+ icons?: PillIcons;
27
+ /** Called when remove is triggered — via click or Delete / Backspace. */
28
+ onremove?: (value: unknown) => void;
29
+ /** Custom content snippet — receives the pill's `ProxyItem`. */
30
+ content?: Snippet<[ProxyItem]>;
31
+ /** Additional CSS class. */
32
+ class?: string;
33
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * ProgressBar Component Types
3
+ */
4
+ /**
5
+ * Props for the ProgressBar component.
6
+ *
7
+ * Pass `value = null` (or omit it) to render in indeterminate state.
8
+ */
9
+ export interface ProgressBarProps {
10
+ /** Current progress value. `null` (or undefined) renders indeterminate. */
11
+ value?: number | null;
12
+ /** Maximum value. Default `100`. */
13
+ max?: number;
14
+ /** Additional CSS class. */
15
+ class?: string;
16
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Range Component Types
3
+ *
4
+ * Custom slider with single or dual-handle modes,
5
+ * tick marks, drag interaction, and keyboard support.
6
+ */
7
+ /**
8
+ * Props for the Range component
9
+ */
10
+ export interface RangeProps {
11
+ /** Current value in single mode (bindable) */
12
+ value?: number;
13
+ /** Lower bound value in range mode (bindable) */
14
+ lower?: number;
15
+ /** Upper bound value in range mode (bindable) */
16
+ upper?: number;
17
+ /** Minimum value (default: 0) */
18
+ min?: number;
19
+ /** Maximum value (default: 100) */
20
+ max?: number;
21
+ /** Step increment (default: 1, 0 = continuous) */
22
+ step?: number;
23
+ /** Whether to show dual handles for range selection */
24
+ range?: boolean;
25
+ /** Number of tick divisions (default: 0 = no ticks) */
26
+ ticks?: number;
27
+ /** Show label every N ticks (default: 0 = show all) */
28
+ labelSkip?: number;
29
+ /** Disabled state */
30
+ disabled?: boolean;
31
+ /** Called when value changes */
32
+ onchange?: (value: number | [number, number]) => void;
33
+ /** Additional CSS class */
34
+ class?: string;
35
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Rating Component Types
3
+ */
4
+ /**
5
+ * Icon overrides for the Rating component.
6
+ */
7
+ export interface RatingIcons {
8
+ /** Icon class for a filled star. */
9
+ filled?: string;
10
+ /** Icon class for an empty star. */
11
+ empty?: string;
12
+ /** Icon class for a half-filled star. */
13
+ half?: string;
14
+ }
15
+ /**
16
+ * Props for the Rating component.
17
+ */
18
+ export interface RatingProps {
19
+ /** Current rating value (bindable). */
20
+ value?: number;
21
+ /** Maximum number of stars. Default `5`. */
22
+ max?: number;
23
+ /** Disabled state. */
24
+ disabled?: boolean;
25
+ /** Accessible label for the surrounding radio group. */
26
+ label?: string;
27
+ /** Custom icon overrides. */
28
+ icons?: RatingIcons;
29
+ /** Called when the value changes. */
30
+ onchange?: (value: number) => void;
31
+ /** Additional CSS class. */
32
+ class?: string;
33
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * ResponsiveGrid Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ /**
6
+ * Props for the ResponsiveGrid component.
7
+ */
8
+ export interface ResponsiveGridProps {
9
+ /** Minimum column width — CSS length value. */
10
+ minWidth?: string;
11
+ /** Gap between cells — CSS length value. */
12
+ gap?: string;
13
+ /** Maximum number of columns. */
14
+ maxCols?: number;
15
+ /** Grid children. */
16
+ children: Snippet;
17
+ /** Additional CSS class. */
18
+ class?: string;
19
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Reveal Component Types
3
+ */
4
+ import type { Snippet } from 'svelte';
5
+ /** Slide direction for the reveal animation. */
6
+ export type RevealDirection = 'up' | 'down' | 'left' | 'right' | 'none';
7
+ /**
8
+ * Props for the Reveal component.
9
+ *
10
+ * Wraps the `reveal` action so children animate in once they intersect the
11
+ * viewport.
12
+ */
13
+ export interface RevealProps {
14
+ /** Slide direction. Default `'up'`. */
15
+ direction?: RevealDirection;
16
+ /** Slide distance — CSS length value. Default `'1.5rem'`. */
17
+ distance?: string;
18
+ /** Transition duration in milliseconds. Default `600`. */
19
+ duration?: number;
20
+ /** Delay before animation starts in milliseconds. Default `0`. */
21
+ delay?: number;
22
+ /**
23
+ * Delay increment per direct child in milliseconds — used for staggered
24
+ * reveals. Default `0`.
25
+ */
26
+ stagger?: number;
27
+ /** Animate only on first intersection. Default `true`. */
28
+ once?: boolean;
29
+ /** IntersectionObserver threshold (0–1). Default `0.1`. */
30
+ threshold?: number;
31
+ /** CSS easing function. */
32
+ easing?: string;
33
+ /** Additional CSS class. */
34
+ class?: string;
35
+ /** Content to reveal. */
36
+ children?: Snippet;
37
+ }