@rokkit/ui 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +63 -0
- package/dist/index.js +8 -0
- package/dist/markdown-plugin.js +1 -0
- package/dist/types/alert-list.js +7 -0
- package/dist/types/avatar.js +4 -0
- package/dist/types/badge.js +4 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +7 -0
- package/dist/types/card.js +4 -0
- package/dist/types/carousel.js +4 -0
- package/dist/types/chat.js +1 -0
- package/dist/types/code.js +12 -0
- package/dist/types/connector.js +8 -0
- package/dist/types/divider.js +4 -0
- package/dist/types/floating-action.js +12 -0
- package/dist/types/floating-navigation.js +1 -0
- package/dist/types/frame.js +8 -0
- package/dist/types/index.js +93 -0
- package/dist/types/item-content.js +8 -0
- package/dist/types/item-switch.js +10 -0
- package/dist/types/item-toggle.js +12 -0
- package/dist/types/list.js +36 -0
- package/dist/types/lock-mode.js +1 -0
- package/dist/types/menu.js +25 -0
- package/dist/types/message.js +4 -0
- package/dist/types/nav-content.js +4 -0
- package/dist/types/palette.js +54 -0
- package/dist/types/pill.js +4 -0
- package/dist/types/progress-bar.js +4 -0
- package/dist/types/range.js +7 -0
- package/dist/types/rating.js +4 -0
- package/dist/types/responsive-grid.js +4 -0
- package/dist/types/reveal.js +4 -0
- package/dist/types/search-filter.js +7 -0
- package/dist/types/select.js +21 -0
- package/dist/types/shine.js +7 -0
- package/dist/types/stack.js +4 -0
- package/dist/types/status-list.js +7 -0
- package/dist/types/stepper.js +4 -0
- package/dist/types/switch.js +7 -0
- package/dist/types/table.js +23 -0
- package/dist/types/tabs.js +7 -0
- package/dist/types/tilt.js +4 -0
- package/dist/types/timeline.js +14 -0
- package/dist/types/toggle.js +7 -0
- package/dist/types/toolbar.js +20 -0
- package/dist/types/tooltip.js +1 -0
- package/dist/types/tree-table.js +10 -0
- package/dist/types/tree.js +94 -0
- package/dist/types/upload-file-status.js +8 -0
- package/dist/types/upload-progress.js +8 -0
- package/dist/types/upload-target.js +7 -0
- package/dist/utils/palette.js +641 -0
- package/dist/utils/relative-time.js +17 -0
- package/dist/utils/shiki.js +118 -0
- package/package.json +13 -14
- package/src/components/index.ts +0 -63
- package/src/index.ts +0 -75
- package/src/markdown-plugin.ts +0 -12
- package/src/types/alert-list.ts +0 -28
- package/src/types/avatar.ts +0 -41
- package/src/types/badge.ts +0 -37
- package/src/types/breadcrumbs.ts +0 -43
- package/src/types/button.ts +0 -92
- package/src/types/card.ts +0 -38
- package/src/types/carousel.ts +0 -49
- package/src/types/chat.ts +0 -81
- package/src/types/code.ts +0 -147
- package/src/types/connector.ts +0 -22
- package/src/types/divider.ts +0 -20
- package/src/types/floating-action.ts +0 -123
- package/src/types/floating-navigation.ts +0 -80
- package/src/types/frame.ts +0 -29
- package/src/types/index.ts +0 -137
- package/src/types/item-content.ts +0 -26
- package/src/types/item-switch.ts +0 -34
- package/src/types/item-toggle.ts +0 -52
- package/src/types/list.ts +0 -200
- package/src/types/lock-mode.ts +0 -16
- package/src/types/menu.ts +0 -95
- package/src/types/message.ts +0 -54
- package/src/types/nav-content.ts +0 -31
- package/src/types/palette.ts +0 -160
- package/src/types/pill.ts +0 -43
- package/src/types/progress-bar.ts +0 -19
- package/src/types/range.ts +0 -51
- package/src/types/rating.ts +0 -43
- package/src/types/responsive-grid.ts +0 -25
- package/src/types/reveal.ts +0 -49
- package/src/types/search-filter.ts +0 -67
- package/src/types/select.ts +0 -176
- package/src/types/shine.ts +0 -37
- package/src/types/stack.ts +0 -40
- package/src/types/status-list.ts +0 -42
- package/src/types/stepper.ts +0 -74
- package/src/types/switch.ts +0 -68
- package/src/types/table.ts +0 -219
- package/src/types/tabs.ts +0 -103
- package/src/types/tilt.ts +0 -28
- package/src/types/timeline.ts +0 -53
- package/src/types/toggle.ts +0 -81
- package/src/types/toolbar.ts +0 -167
- package/src/types/tooltip.ts +0 -21
- package/src/types/tree-table.ts +0 -103
- package/src/types/tree.ts +0 -302
- package/src/types/upload-file-status.ts +0 -45
- package/src/types/upload-progress.ts +0 -111
- package/src/types/upload-target.ts +0 -71
- package/src/utils/palette.ts +0 -750
- package/src/utils/relative-time.ts +0 -12
- package/src/utils/shiki.ts +0 -137
- /package/{src → dist}/MarkdownRenderer.svelte +0 -0
- /package/{src → dist}/components/AlertList.svelte +0 -0
- /package/{src → dist}/components/Avatar.svelte +0 -0
- /package/{src → dist}/components/Badge.svelte +0 -0
- /package/{src → dist}/components/BreadCrumbs.svelte +0 -0
- /package/{src → dist}/components/Button.svelte +0 -0
- /package/{src → dist}/components/ButtonGroup.svelte +0 -0
- /package/{src → dist}/components/Card.svelte +0 -0
- /package/{src → dist}/components/Carousel.svelte +0 -0
- /package/{src → dist}/components/ChatComposer.svelte +0 -0
- /package/{src → dist}/components/ChatHistory.svelte +0 -0
- /package/{src → dist}/components/ChatMessage.svelte +0 -0
- /package/{src → dist}/components/ChatShell.svelte +0 -0
- /package/{src → dist}/components/ChatTimeline.svelte +0 -0
- /package/{src → dist}/components/Code.svelte +0 -0
- /package/{src → dist}/components/CodeBlock.svelte +0 -0
- /package/{src → dist}/components/CodeGroup.svelte +0 -0
- /package/{src → dist}/components/CommandPalette.svelte +0 -0
- /package/{src → dist}/components/Connector.svelte +0 -0
- /package/{src → dist}/components/Divider.svelte +0 -0
- /package/{src → dist}/components/Dropdown.svelte +0 -0
- /package/{src → dist}/components/FloatingAction.svelte +0 -0
- /package/{src → dist}/components/FloatingNavigation.svelte +0 -0
- /package/{src → dist}/components/Frame.svelte +0 -0
- /package/{src → dist}/components/Grid.svelte +0 -0
- /package/{src → dist}/components/ItemContent.svelte +0 -0
- /package/{src → dist}/components/ItemSwitch.svelte +0 -0
- /package/{src → dist}/components/ItemToggle.svelte +0 -0
- /package/{src → dist}/components/LazyTree.svelte +0 -0
- /package/{src → dist}/components/List.svelte +0 -0
- /package/{src → dist}/components/LockMode.svelte +0 -0
- /package/{src → dist}/components/Menu.svelte +0 -0
- /package/{src → dist}/components/Message.svelte +0 -0
- /package/{src → dist}/components/MultiSelect.svelte +0 -0
- /package/{src → dist}/components/NavContent.svelte +0 -0
- /package/{src → dist}/components/PaletteManager.svelte +0 -0
- /package/{src → dist}/components/Pill.svelte +0 -0
- /package/{src → dist}/components/ProgressBar.svelte +0 -0
- /package/{src → dist}/components/Range.svelte +0 -0
- /package/{src → dist}/components/Rating.svelte +0 -0
- /package/{src → dist}/components/ResponsiveGrid.svelte +0 -0
- /package/{src → dist}/components/Reveal.svelte +0 -0
- /package/{src → dist}/components/SearchFilter.svelte +0 -0
- /package/{src → dist}/components/Select.svelte +0 -0
- /package/{src → dist}/components/Shine.svelte +0 -0
- /package/{src → dist}/components/Stack.svelte +0 -0
- /package/{src → dist}/components/StatusList.svelte +0 -0
- /package/{src → dist}/components/Stepper.svelte +0 -0
- /package/{src → dist}/components/Swatch.svelte +0 -0
- /package/{src → dist}/components/Switch.svelte +0 -0
- /package/{src → dist}/components/Table.svelte +0 -0
- /package/{src → dist}/components/Tabs.svelte +0 -0
- /package/{src → dist}/components/Tilt.svelte +0 -0
- /package/{src → dist}/components/Timeline.svelte +0 -0
- /package/{src → dist}/components/Toggle.svelte +0 -0
- /package/{src → dist}/components/Toolbar.svelte +0 -0
- /package/{src → dist}/components/ToolbarGroup.svelte +0 -0
- /package/{src → dist}/components/Tooltip.svelte +0 -0
- /package/{src → dist}/components/Tree.svelte +0 -0
- /package/{src → dist}/components/TreeTable.svelte +0 -0
- /package/{src → dist}/components/UploadFileStatus.svelte +0 -0
- /package/{src → dist}/components/UploadProgress.svelte +0 -0
- /package/{src → dist}/components/UploadTarget.svelte +0 -0
- /package/{src → dist}/utils/upload.js +0 -0
package/src/types/range.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
// =============================================================================
|
|
9
|
-
// Component Props Types
|
|
10
|
-
// =============================================================================
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Props for the Range component
|
|
14
|
-
*/
|
|
15
|
-
export interface RangeProps {
|
|
16
|
-
/** Current value in single mode (bindable) */
|
|
17
|
-
value?: number
|
|
18
|
-
|
|
19
|
-
/** Lower bound value in range mode (bindable) */
|
|
20
|
-
lower?: number
|
|
21
|
-
|
|
22
|
-
/** Upper bound value in range mode (bindable) */
|
|
23
|
-
upper?: number
|
|
24
|
-
|
|
25
|
-
/** Minimum value (default: 0) */
|
|
26
|
-
min?: number
|
|
27
|
-
|
|
28
|
-
/** Maximum value (default: 100) */
|
|
29
|
-
max?: number
|
|
30
|
-
|
|
31
|
-
/** Step increment (default: 1, 0 = continuous) */
|
|
32
|
-
step?: number
|
|
33
|
-
|
|
34
|
-
/** Whether to show dual handles for range selection */
|
|
35
|
-
range?: boolean
|
|
36
|
-
|
|
37
|
-
/** Number of tick divisions (default: 0 = no ticks) */
|
|
38
|
-
ticks?: number
|
|
39
|
-
|
|
40
|
-
/** Show label every N ticks (default: 0 = show all) */
|
|
41
|
-
labelSkip?: number
|
|
42
|
-
|
|
43
|
-
/** Disabled state */
|
|
44
|
-
disabled?: boolean
|
|
45
|
-
|
|
46
|
-
/** Called when value changes */
|
|
47
|
-
onchange?: (value: number | [number, number]) => void
|
|
48
|
-
|
|
49
|
-
/** Additional CSS class */
|
|
50
|
-
class?: string
|
|
51
|
-
}
|
package/src/types/rating.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rating Component Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Icon overrides for the Rating component.
|
|
7
|
-
*/
|
|
8
|
-
export interface RatingIcons {
|
|
9
|
-
/** Icon class for a filled star. */
|
|
10
|
-
filled?: string
|
|
11
|
-
|
|
12
|
-
/** Icon class for an empty star. */
|
|
13
|
-
empty?: string
|
|
14
|
-
|
|
15
|
-
/** Icon class for a half-filled star. */
|
|
16
|
-
half?: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Props for the Rating component.
|
|
21
|
-
*/
|
|
22
|
-
export interface RatingProps {
|
|
23
|
-
/** Current rating value (bindable). */
|
|
24
|
-
value?: number
|
|
25
|
-
|
|
26
|
-
/** Maximum number of stars. Default `5`. */
|
|
27
|
-
max?: number
|
|
28
|
-
|
|
29
|
-
/** Disabled state. */
|
|
30
|
-
disabled?: boolean
|
|
31
|
-
|
|
32
|
-
/** Accessible label for the surrounding radio group. */
|
|
33
|
-
label?: string
|
|
34
|
-
|
|
35
|
-
/** Custom icon overrides. */
|
|
36
|
-
icons?: RatingIcons
|
|
37
|
-
|
|
38
|
-
/** Called when the value changes. */
|
|
39
|
-
onchange?: (value: number) => void
|
|
40
|
-
|
|
41
|
-
/** Additional CSS class. */
|
|
42
|
-
class?: string
|
|
43
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ResponsiveGrid Component Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Snippet } from 'svelte'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Props for the ResponsiveGrid component.
|
|
9
|
-
*/
|
|
10
|
-
export interface ResponsiveGridProps {
|
|
11
|
-
/** Minimum column width — CSS length value. */
|
|
12
|
-
minWidth?: string
|
|
13
|
-
|
|
14
|
-
/** Gap between cells — CSS length value. */
|
|
15
|
-
gap?: string
|
|
16
|
-
|
|
17
|
-
/** Maximum number of columns. */
|
|
18
|
-
maxCols?: number
|
|
19
|
-
|
|
20
|
-
/** Grid children. */
|
|
21
|
-
children: Snippet
|
|
22
|
-
|
|
23
|
-
/** Additional CSS class. */
|
|
24
|
-
class?: string
|
|
25
|
-
}
|
package/src/types/reveal.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reveal Component Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Snippet } from 'svelte'
|
|
6
|
-
|
|
7
|
-
/** Slide direction for the reveal animation. */
|
|
8
|
-
export type RevealDirection = 'up' | 'down' | 'left' | 'right' | 'none'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Props for the Reveal component.
|
|
12
|
-
*
|
|
13
|
-
* Wraps the `reveal` action so children animate in once they intersect the
|
|
14
|
-
* viewport.
|
|
15
|
-
*/
|
|
16
|
-
export interface RevealProps {
|
|
17
|
-
/** Slide direction. Default `'up'`. */
|
|
18
|
-
direction?: RevealDirection
|
|
19
|
-
|
|
20
|
-
/** Slide distance — CSS length value. Default `'1.5rem'`. */
|
|
21
|
-
distance?: string
|
|
22
|
-
|
|
23
|
-
/** Transition duration in milliseconds. Default `600`. */
|
|
24
|
-
duration?: number
|
|
25
|
-
|
|
26
|
-
/** Delay before animation starts in milliseconds. Default `0`. */
|
|
27
|
-
delay?: number
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Delay increment per direct child in milliseconds — used for staggered
|
|
31
|
-
* reveals. Default `0`.
|
|
32
|
-
*/
|
|
33
|
-
stagger?: number
|
|
34
|
-
|
|
35
|
-
/** Animate only on first intersection. Default `true`. */
|
|
36
|
-
once?: boolean
|
|
37
|
-
|
|
38
|
-
/** IntersectionObserver threshold (0–1). Default `0.1`. */
|
|
39
|
-
threshold?: number
|
|
40
|
-
|
|
41
|
-
/** CSS easing function. */
|
|
42
|
-
easing?: string
|
|
43
|
-
|
|
44
|
-
/** Additional CSS class. */
|
|
45
|
-
class?: string
|
|
46
|
-
|
|
47
|
-
/** Content to reveal. */
|
|
48
|
-
children?: Snippet
|
|
49
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SearchFilter Component Types
|
|
3
|
-
*
|
|
4
|
-
* Provides types for the standalone SearchFilter component.
|
|
5
|
-
* Parses user input into structured filter objects using parseFilters() from @rokkit/data.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// =============================================================================
|
|
9
|
-
// Filter Types
|
|
10
|
-
// =============================================================================
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A parsed filter condition.
|
|
14
|
-
*/
|
|
15
|
-
export interface FilterObject {
|
|
16
|
-
/** Column to filter (undefined = search all columns) */
|
|
17
|
-
column?: string
|
|
18
|
-
|
|
19
|
-
/** Comparison operator */
|
|
20
|
-
operator: string
|
|
21
|
-
|
|
22
|
-
/** Filter value */
|
|
23
|
-
value: string | number | RegExp
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// =============================================================================
|
|
27
|
-
// Snippet Types
|
|
28
|
-
// =============================================================================
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Snippet for custom filter tag rendering.
|
|
32
|
-
* Parameters: filter, remove callback
|
|
33
|
-
*/
|
|
34
|
-
export type SearchFilterTagSnippet = import('svelte').Snippet<[FilterObject, () => void]>
|
|
35
|
-
|
|
36
|
-
// =============================================================================
|
|
37
|
-
// Component Props
|
|
38
|
-
// =============================================================================
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Props for the SearchFilter component.
|
|
42
|
-
*/
|
|
43
|
-
export interface SearchFilterProps {
|
|
44
|
-
/** Parsed filter array (bindable) */
|
|
45
|
-
filters?: FilterObject[]
|
|
46
|
-
|
|
47
|
-
/** Debounce delay in ms — default: 300 */
|
|
48
|
-
debounce?: number
|
|
49
|
-
|
|
50
|
-
/** Input placeholder text */
|
|
51
|
-
placeholder?: string
|
|
52
|
-
|
|
53
|
-
/** Column name hints for autocomplete (future use) */
|
|
54
|
-
columns?: string[]
|
|
55
|
-
|
|
56
|
-
/** Called when filters change */
|
|
57
|
-
onfilter?: (filters: FilterObject[]) => void
|
|
58
|
-
|
|
59
|
-
/** Additional CSS classes */
|
|
60
|
-
class?: string
|
|
61
|
-
|
|
62
|
-
/** Size variant */
|
|
63
|
-
size?: 'sm' | 'md' | 'lg'
|
|
64
|
-
|
|
65
|
-
/** Custom filter tag snippet */
|
|
66
|
-
tag?: SearchFilterTagSnippet
|
|
67
|
-
}
|
package/src/types/select.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Select Component Types
|
|
3
|
-
*
|
|
4
|
-
* Provides types for the data-driven Select and MultiSelect components.
|
|
5
|
-
* Field mapping and data access is handled by ProxyItem from @rokkit/states.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { Snippet } from 'svelte'
|
|
9
|
-
import type { ProxyItem } from '@rokkit/states'
|
|
10
|
-
import { DEFAULT_STATE_ICONS } from '@rokkit/core'
|
|
11
|
-
|
|
12
|
-
// =============================================================================
|
|
13
|
-
// Select Item Types
|
|
14
|
-
// =============================================================================
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Generic select item - can be any object with mapped fields
|
|
18
|
-
*/
|
|
19
|
-
export type SelectItem = Record<string, unknown>
|
|
20
|
-
|
|
21
|
-
// =============================================================================
|
|
22
|
-
// Legacy types — retained while PaletteManager still uses old snippet API
|
|
23
|
-
// =============================================================================
|
|
24
|
-
|
|
25
|
-
/** @deprecated Legacy handlers — will be removed when PaletteManager migrates to Navigator stack */
|
|
26
|
-
export interface SelectItemHandlers {
|
|
27
|
-
onclick: () => void
|
|
28
|
-
onkeydown: (event: KeyboardEvent) => void
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// =============================================================================
|
|
32
|
-
// Snippet Types — ProxyItem-based API
|
|
33
|
-
// =============================================================================
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Snippet type for rendering a single option in the dropdown.
|
|
37
|
-
* The component renders the focusable wrapper; the snippet renders the inner content.
|
|
38
|
-
* Navigator handles click selection via data-path — no handlers needed in snippet.
|
|
39
|
-
*/
|
|
40
|
-
export type SelectOptionSnippet = Snippet<[ProxyItem]>
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Snippet type for rendering a group header label.
|
|
44
|
-
*/
|
|
45
|
-
export type SelectGroupLabelSnippet = Snippet<[ProxyItem]>
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Snippet type for rendering the selected value display in the trigger button.
|
|
49
|
-
*/
|
|
50
|
-
export type SelectValueSnippet = Snippet<[ProxyItem]>
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Snippet type for rendering selected values in MultiSelect trigger.
|
|
54
|
-
* Receives the array of selected ProxyItems.
|
|
55
|
-
*/
|
|
56
|
-
export type MultiSelectValueSnippet = Snippet<[ProxyItem[]]>
|
|
57
|
-
|
|
58
|
-
// =============================================================================
|
|
59
|
-
// Component Props Types
|
|
60
|
-
// =============================================================================
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Common props shared between Select and MultiSelect
|
|
64
|
-
*/
|
|
65
|
-
export interface SelectBaseProps {
|
|
66
|
-
/** Array of select options or groups */
|
|
67
|
-
options?: SelectItem[]
|
|
68
|
-
|
|
69
|
-
/** Field mapping — overrides BASE_FIELDS defaults (text → 'label', value → 'value', …) */
|
|
70
|
-
fields?: Record<string, string>
|
|
71
|
-
|
|
72
|
-
/** Placeholder text when no selection */
|
|
73
|
-
placeholder?: string
|
|
74
|
-
|
|
75
|
-
/** Size variant */
|
|
76
|
-
size?: 'sm' | 'md' | 'lg'
|
|
77
|
-
|
|
78
|
-
/** Dropdown alignment relative to trigger */
|
|
79
|
-
align?: 'left' | 'right' | 'start' | 'end'
|
|
80
|
-
|
|
81
|
-
/** Dropdown slide direction */
|
|
82
|
-
direction?: 'up' | 'down'
|
|
83
|
-
|
|
84
|
-
/** Maximum visible rows in dropdown (default: 5) */
|
|
85
|
-
maxRows?: number
|
|
86
|
-
|
|
87
|
-
/** Whether the select is disabled */
|
|
88
|
-
disabled?: boolean
|
|
89
|
-
|
|
90
|
-
/** Additional CSS classes on root element */
|
|
91
|
-
class?: string
|
|
92
|
-
|
|
93
|
-
/** Icons for select states (dropdown arrow, check, remove) */
|
|
94
|
-
icons?: SelectStateIcons
|
|
95
|
-
|
|
96
|
-
/** Custom snippet for rendering options in dropdown */
|
|
97
|
-
option?: SelectOptionSnippet
|
|
98
|
-
|
|
99
|
-
/** Custom snippet for rendering group labels */
|
|
100
|
-
groupLabel?: SelectGroupLabelSnippet
|
|
101
|
-
|
|
102
|
-
/** Enable typeahead filter input in dropdown header */
|
|
103
|
-
filterable?: boolean
|
|
104
|
-
|
|
105
|
-
/** Placeholder text for the filter input */
|
|
106
|
-
filterPlaceholder?: string
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Props for the Select component (single selection)
|
|
111
|
-
*/
|
|
112
|
-
export interface SelectProps extends SelectBaseProps {
|
|
113
|
-
/** Currently selected value (bindable) — extracted via item[fields.value] */
|
|
114
|
-
value?: unknown
|
|
115
|
-
|
|
116
|
-
/** Currently selected raw item (bindable) — full object from options array */
|
|
117
|
-
selected?: SelectItem | null
|
|
118
|
-
|
|
119
|
-
/** Called when selection changes */
|
|
120
|
-
onchange?: (value: unknown, item: SelectItem) => void
|
|
121
|
-
|
|
122
|
-
/** Custom snippet for rendering the selected value in the trigger */
|
|
123
|
-
selectedValue?: SelectValueSnippet
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Props for the MultiSelect component (multiple selection)
|
|
128
|
-
*/
|
|
129
|
-
export interface MultiSelectProps extends SelectBaseProps {
|
|
130
|
-
/** Currently selected values (bindable) - extracted primitives */
|
|
131
|
-
value?: unknown[]
|
|
132
|
-
|
|
133
|
-
/** Currently selected items (bindable) - full item objects for convenience */
|
|
134
|
-
selected?: SelectItem[]
|
|
135
|
-
|
|
136
|
-
/** Called when selection changes */
|
|
137
|
-
onchange?: (values: unknown[], items: SelectItem[]) => void
|
|
138
|
-
|
|
139
|
-
/** Maximum number of tags to show before collapsing to count */
|
|
140
|
-
maxDisplay?: number
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// =============================================================================
|
|
144
|
-
// State Icons
|
|
145
|
-
// =============================================================================
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Icons configuration for select expand/collapse and selection states.
|
|
149
|
-
*/
|
|
150
|
-
export interface SelectStateIcons {
|
|
151
|
-
/** Icon class for dropdown arrow (open state) */
|
|
152
|
-
opened?: string
|
|
153
|
-
/** Icon class for dropdown arrow (closed state) */
|
|
154
|
-
closed?: string
|
|
155
|
-
/** Icon class for selected item indicator */
|
|
156
|
-
checked?: string
|
|
157
|
-
/** Icon class for tag remove button (MultiSelect) */
|
|
158
|
-
remove?: string
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Default state icons — uses semantic names from @rokkit/core
|
|
163
|
-
* that get resolved to actual icon classes via UnoCSS shortcuts.
|
|
164
|
-
*/
|
|
165
|
-
export const defaultSelectStateIcons: SelectStateIcons = {
|
|
166
|
-
opened: DEFAULT_STATE_ICONS.selector.opened,
|
|
167
|
-
closed: DEFAULT_STATE_ICONS.selector.closed,
|
|
168
|
-
checked: DEFAULT_STATE_ICONS.checkbox.checked,
|
|
169
|
-
remove: DEFAULT_STATE_ICONS.action.remove
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// =============================================================================
|
|
173
|
-
// Helper Functions
|
|
174
|
-
// =============================================================================
|
|
175
|
-
|
|
176
|
-
export { getSnippet } from './menu.js'
|
package/src/types/shine.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shine Component Types
|
|
3
|
-
*
|
|
4
|
-
* Renders an SVG specular-lighting filter that tracks pointer position to
|
|
5
|
-
* give wrapped content a moving highlight.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { Snippet } from 'svelte'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Props for the Shine component.
|
|
12
|
-
*/
|
|
13
|
-
export interface ShineProps {
|
|
14
|
-
/** Light color. Default `'rgb(var(--primary-500))'`. */
|
|
15
|
-
color?: string
|
|
16
|
-
|
|
17
|
-
/** Light source distance / height — controls highlight spread. Default `300`. */
|
|
18
|
-
radius?: number
|
|
19
|
-
|
|
20
|
-
/** Gaussian blur depth applied to the highlight. Default `1`. */
|
|
21
|
-
depth?: number
|
|
22
|
-
|
|
23
|
-
/** Surface height for the light filter. Default `2`. */
|
|
24
|
-
surfaceScale?: number
|
|
25
|
-
|
|
26
|
-
/** Reflection size — bigger = bigger reflection. Default `0.75`. */
|
|
27
|
-
specularConstant?: number
|
|
28
|
-
|
|
29
|
-
/** Light source focus — bigger = brighter. Default `120`. */
|
|
30
|
-
specularExponent?: number
|
|
31
|
-
|
|
32
|
-
/** Additional CSS class. */
|
|
33
|
-
class?: string
|
|
34
|
-
|
|
35
|
-
/** Content the highlight wraps. */
|
|
36
|
-
children?: Snippet
|
|
37
|
-
}
|
package/src/types/stack.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stack Component Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Snippet } from 'svelte'
|
|
6
|
-
|
|
7
|
-
/** Layout direction. */
|
|
8
|
-
export type StackDirection = 'vertical' | 'horizontal'
|
|
9
|
-
|
|
10
|
-
/** Gap size between children — maps to the theme's spacing scale. */
|
|
11
|
-
export type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
12
|
-
|
|
13
|
-
/** Cross-axis alignment. */
|
|
14
|
-
export type StackAlign = 'start' | 'center' | 'end' | 'stretch'
|
|
15
|
-
|
|
16
|
-
/** Main-axis justification. */
|
|
17
|
-
export type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around'
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Props for the Stack component.
|
|
21
|
-
*/
|
|
22
|
-
export interface StackProps {
|
|
23
|
-
/** Layout direction. */
|
|
24
|
-
direction?: StackDirection
|
|
25
|
-
|
|
26
|
-
/** Gap size between children. */
|
|
27
|
-
gap?: StackGap
|
|
28
|
-
|
|
29
|
-
/** Cross-axis alignment. */
|
|
30
|
-
align?: StackAlign
|
|
31
|
-
|
|
32
|
-
/** Main-axis justification. */
|
|
33
|
-
justify?: StackJustify
|
|
34
|
-
|
|
35
|
-
/** Stack children. */
|
|
36
|
-
children: Snippet
|
|
37
|
-
|
|
38
|
-
/** Additional CSS class. */
|
|
39
|
-
class?: string
|
|
40
|
-
}
|
package/src/types/status-list.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* StatusList Component Types
|
|
3
|
-
*
|
|
4
|
-
* Renders a vertical list of status rows — each with a label and a status
|
|
5
|
-
* keyword that maps to a badge icon (e.g. `pass`, `fail`, `warn`).
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { DEFAULT_STATE_ICONS } from '@rokkit/core'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Built-in badge status keys provided by `@rokkit/core`. Consumers may also
|
|
12
|
-
* pass any other string and supply a matching entry via the `icons` prop.
|
|
13
|
-
*/
|
|
14
|
-
export type StatusListStatus = keyof typeof DEFAULT_STATE_ICONS.badge | (string & {})
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* One row in a StatusList — a label paired with a status keyword.
|
|
18
|
-
*/
|
|
19
|
-
export interface StatusListItem {
|
|
20
|
-
/** Text rendered for this row. */
|
|
21
|
-
text: string
|
|
22
|
-
|
|
23
|
-
/** Status keyword used to look up the badge icon. */
|
|
24
|
-
status: StatusListStatus
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Props for the StatusList component.
|
|
29
|
-
*/
|
|
30
|
-
export interface StatusListProps {
|
|
31
|
-
/** Additional CSS class applied to the root element. */
|
|
32
|
-
class?: string
|
|
33
|
-
|
|
34
|
-
/** Rows to render. */
|
|
35
|
-
items: StatusListItem[]
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Override the default badge icon map (`pass` / `fail` / `warn` / `unknown`).
|
|
39
|
-
* Merged on top of `DEFAULT_STATE_ICONS.badge` from `@rokkit/core`.
|
|
40
|
-
*/
|
|
41
|
-
icons?: Partial<Record<string, string>>
|
|
42
|
-
}
|
package/src/types/stepper.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stepper Component Types
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Snippet } from 'svelte'
|
|
6
|
-
|
|
7
|
-
/** Layout orientation for the stepper. */
|
|
8
|
-
export type StepperOrientation = 'horizontal' | 'vertical'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Definition for a single step in the stepper.
|
|
12
|
-
*/
|
|
13
|
-
export interface StepperStep {
|
|
14
|
-
/** Step label (shown below the circle). */
|
|
15
|
-
text: string
|
|
16
|
-
|
|
17
|
-
/** Short text shown inside the circle. Default: step number. */
|
|
18
|
-
label?: string
|
|
19
|
-
|
|
20
|
-
/** Step is finished — shows the check icon. */
|
|
21
|
-
completed?: boolean
|
|
22
|
-
|
|
23
|
-
/** Step cannot be navigated to. */
|
|
24
|
-
disabled?: boolean
|
|
25
|
-
|
|
26
|
-
/** Number of sub-stages within this step. Default `1`. */
|
|
27
|
-
stages?: number
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Icon overrides for the Stepper component.
|
|
32
|
-
*/
|
|
33
|
-
export interface StepperIcons {
|
|
34
|
-
/** Icon class for the check / completed state. */
|
|
35
|
-
check?: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Props for the Stepper component.
|
|
40
|
-
*/
|
|
41
|
-
export interface StepperProps {
|
|
42
|
-
/** Array of step definitions. */
|
|
43
|
-
steps?: StepperStep[]
|
|
44
|
-
|
|
45
|
-
/** Current step index (bindable). */
|
|
46
|
-
current?: number
|
|
47
|
-
|
|
48
|
-
/** Current sub-stage within the step (bindable, 0-based). */
|
|
49
|
-
currentStage?: number
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* In linear mode only completed steps + the first incomplete step
|
|
53
|
-
* are clickable.
|
|
54
|
-
*/
|
|
55
|
-
linear?: boolean
|
|
56
|
-
|
|
57
|
-
/** Layout orientation. */
|
|
58
|
-
orientation?: StepperOrientation
|
|
59
|
-
|
|
60
|
-
/** Accessible label for the surrounding group. */
|
|
61
|
-
label?: string
|
|
62
|
-
|
|
63
|
-
/** Custom icon overrides. */
|
|
64
|
-
icons?: StepperIcons
|
|
65
|
-
|
|
66
|
-
/** Called when a step (or sub-stage dot) is clicked. */
|
|
67
|
-
onclick?: (step: number, stage?: number) => void
|
|
68
|
-
|
|
69
|
-
/** Content snippet rendered below the stepper. */
|
|
70
|
-
content?: Snippet<[StepperStep, number]>
|
|
71
|
-
|
|
72
|
-
/** Additional CSS class. */
|
|
73
|
-
class?: string
|
|
74
|
-
}
|
package/src/types/switch.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Switch Component Types
|
|
3
|
-
*
|
|
4
|
-
* Provides types for the iOS-style Switch component.
|
|
5
|
-
* Field mapping and data access is handled by ProxyItem from @rokkit/states.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// =============================================================================
|
|
9
|
-
// Field Mapping Types
|
|
10
|
-
// =============================================================================
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Field mapping configuration for switch option data.
|
|
14
|
-
* Maps custom data field names to the component's expected properties.
|
|
15
|
-
*/
|
|
16
|
-
export interface SwitchFields {
|
|
17
|
-
text?: string
|
|
18
|
-
value?: string
|
|
19
|
-
icon?: string
|
|
20
|
-
disabled?: string
|
|
21
|
-
description?: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// =============================================================================
|
|
25
|
-
// Switch Item Types
|
|
26
|
-
// =============================================================================
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* A switch option — can be any object, primitive, or boolean.
|
|
30
|
-
* Processed through ProxyItem for field resolution.
|
|
31
|
-
*/
|
|
32
|
-
export type SwitchItem = Record<string, unknown> | string | number | boolean
|
|
33
|
-
|
|
34
|
-
// =============================================================================
|
|
35
|
-
// Component Props Types
|
|
36
|
-
// =============================================================================
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Props for the Switch component
|
|
40
|
-
*/
|
|
41
|
-
export interface SwitchProps {
|
|
42
|
-
/**
|
|
43
|
-
* Exactly two options. First = off/unchecked. Second = on/checked.
|
|
44
|
-
* @default [false, true]
|
|
45
|
-
*/
|
|
46
|
-
options?: [SwitchItem, SwitchItem]
|
|
47
|
-
|
|
48
|
-
/** Field mapping configuration */
|
|
49
|
-
fields?: SwitchFields
|
|
50
|
-
|
|
51
|
-
/** Currently selected value */
|
|
52
|
-
value?: unknown
|
|
53
|
-
|
|
54
|
-
/** Called when the switch changes */
|
|
55
|
-
onchange?: (value: unknown, item: SwitchItem) => void
|
|
56
|
-
|
|
57
|
-
/** Whether to show text labels beside the track */
|
|
58
|
-
showLabels?: boolean
|
|
59
|
-
|
|
60
|
-
/** Size variant */
|
|
61
|
-
size?: 'sm' | 'md' | 'lg'
|
|
62
|
-
|
|
63
|
-
/** Whether the switch is disabled */
|
|
64
|
-
disabled?: boolean
|
|
65
|
-
|
|
66
|
-
/** Additional CSS classes */
|
|
67
|
-
class?: string
|
|
68
|
-
}
|