sdocs 0.0.3 → 0.0.4
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/bin/sdocs.js +1 -1
- package/dist/app-gen.d.ts +10 -0
- package/dist/app-gen.js +147 -0
- package/dist/cli.js +71 -0
- package/dist/client/App.svelte +151 -0
- package/dist/client/App.svelte.d.ts +14 -0
- package/dist/client/CollapsiblePanel.svelte +63 -0
- package/dist/client/CollapsiblePanel.svelte.d.ts +9 -0
- package/dist/client/ComponentView.svelte +321 -0
- package/dist/client/ComponentView.svelte.d.ts +10 -0
- package/dist/client/ControlsPanel.svelte +191 -0
- package/dist/client/ControlsPanel.svelte.d.ts +13 -0
- package/dist/client/DataTable.svelte +78 -0
- package/dist/client/DataTable.svelte.d.ts +11 -0
- package/dist/client/HomePage.svelte +92 -0
- package/dist/client/HomePage.svelte.d.ts +8 -0
- package/dist/client/LayoutView.svelte +27 -0
- package/dist/client/LayoutView.svelte.d.ts +8 -0
- package/dist/client/PageView.svelte +130 -0
- package/dist/client/PageView.svelte.d.ts +8 -0
- package/dist/client/PreviewFrame.svelte +100 -0
- package/dist/client/PreviewFrame.svelte.d.ts +10 -0
- package/dist/client/Sidebar.svelte +329 -0
- package/dist/client/Sidebar.svelte.d.ts +16 -0
- package/dist/client/controls/CheckboxControl.svelte +37 -0
- package/dist/client/controls/CheckboxControl.svelte.d.ts +8 -0
- package/dist/client/controls/ColorControl.svelte +47 -0
- package/dist/client/controls/ColorControl.svelte.d.ts +8 -0
- package/dist/client/controls/DimensionControl.svelte +56 -0
- package/dist/client/controls/DimensionControl.svelte.d.ts +8 -0
- package/dist/client/controls/NumberControl.svelte +44 -0
- package/dist/client/controls/NumberControl.svelte.d.ts +8 -0
- package/dist/client/controls/SelectControl.svelte +48 -0
- package/dist/client/controls/SelectControl.svelte.d.ts +9 -0
- package/dist/client/controls/TextControl.svelte +43 -0
- package/dist/client/controls/TextControl.svelte.d.ts +8 -0
- package/dist/client/router.svelte.d.ts +11 -0
- package/dist/client/router.svelte.js +45 -0
- package/dist/client/theme.css +34 -0
- package/dist/client/tree-builder.d.ts +30 -0
- package/dist/client/tree-builder.js +162 -0
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.js +38 -0
- package/dist/commands/dev.d.ts +1 -0
- package/dist/commands/dev.js +40 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +41 -0
- package/dist/commands/preview.d.ts +1 -0
- package/dist/commands/preview.js +25 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.js +57 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -4
- package/dist/server/discovery.d.ts +6 -0
- package/dist/server/discovery.js +24 -0
- package/dist/server/highlighter.d.ts +4 -0
- package/dist/server/highlighter.js +31 -0
- package/dist/server/meta-parser.d.ts +11 -0
- package/dist/server/meta-parser.js +107 -0
- package/dist/server/prop-parser.d.ts +5 -0
- package/dist/server/prop-parser.js +275 -0
- package/dist/server/sdocx-parser.d.ts +11 -0
- package/dist/server/sdocx-parser.js +197 -0
- package/dist/server/snippet-compiler.d.ts +27 -0
- package/dist/server/snippet-compiler.js +145 -0
- package/dist/server/snippet-extractor.d.ts +11 -0
- package/dist/server/snippet-extractor.js +37 -0
- package/dist/server/toc-extractor.d.ts +5 -0
- package/dist/server/toc-extractor.js +37 -0
- package/dist/types.d.ts +100 -148
- package/dist/vite.d.ts +5 -2
- package/dist/vite.js +266 -2
- package/package.json +50 -74
- package/README.md +0 -43
- package/dist/Sdocs.svelte +0 -1210
- package/dist/Sdocs.svelte.d.ts +0 -5
- package/dist/cli/app-plugin.d.ts +0 -7
- package/dist/cli/app-plugin.js +0 -69
- package/dist/cli/config.d.ts +0 -12
- package/dist/cli/config.js +0 -34
- package/dist/cli/index.js +0 -72
- package/dist/cli/server.d.ts +0 -2
- package/dist/cli/server.js +0 -64
- package/dist/docgen.d.ts +0 -47
- package/dist/docgen.js +0 -463
- package/dist/internal/ComponentPreview.svelte +0 -58
- package/dist/internal/ComponentPreview.svelte.d.ts +0 -17
- package/dist/internal/CssPropsTable.svelte +0 -239
- package/dist/internal/CssPropsTable.svelte.d.ts +0 -11
- package/dist/internal/Home.svelte +0 -92
- package/dist/internal/Home.svelte.d.ts +0 -9
- package/dist/internal/MethodsTable.svelte +0 -72
- package/dist/internal/MethodsTable.svelte.d.ts +0 -7
- package/dist/internal/PropsTable.svelte +0 -342
- package/dist/internal/PropsTable.svelte.d.ts +0 -12
- package/dist/internal/Showcase.svelte +0 -130
- package/dist/internal/Showcase.svelte.d.ts +0 -21
- package/dist/ui/Badge/Badge.docs.svelte +0 -46
- package/dist/ui/Badge/Badge.docs.svelte.d.ts +0 -26
- package/dist/ui/Badge/Badge.svelte +0 -59
- package/dist/ui/Badge/Badge.svelte.d.ts +0 -17
- package/dist/ui/Badge/index.d.ts +0 -1
- package/dist/ui/Badge/index.js +0 -1
- package/dist/ui/Checkbox/Checkbox.docs.svelte +0 -51
- package/dist/ui/Checkbox/Checkbox.docs.svelte.d.ts +0 -27
- package/dist/ui/Checkbox/Checkbox.svelte +0 -169
- package/dist/ui/Checkbox/Checkbox.svelte.d.ts +0 -18
- package/dist/ui/Checkbox/index.d.ts +0 -1
- package/dist/ui/Checkbox/index.js +0 -1
- package/dist/ui/CodeBlock/CodeBlock.docs.svelte +0 -28
- package/dist/ui/CodeBlock/CodeBlock.docs.svelte.d.ts +0 -24
- package/dist/ui/CodeBlock/CodeBlock.svelte +0 -101
- package/dist/ui/CodeBlock/CodeBlock.svelte.d.ts +0 -7
- package/dist/ui/CodeBlock/index.d.ts +0 -1
- package/dist/ui/CodeBlock/index.js +0 -1
- package/dist/ui/Frame/Frame.docs.svelte +0 -140
- package/dist/ui/Frame/Frame.docs.svelte.d.ts +0 -26
- package/dist/ui/Frame/Frame.svelte +0 -88
- package/dist/ui/Frame/Frame.svelte.d.ts +0 -15
- package/dist/ui/Frame/index.d.ts +0 -1
- package/dist/ui/Frame/index.js +0 -1
- package/dist/ui/InputNumber/InputNumber.docs.svelte +0 -50
- package/dist/ui/InputNumber/InputNumber.docs.svelte.d.ts +0 -26
- package/dist/ui/InputNumber/InputNumber.svelte +0 -275
- package/dist/ui/InputNumber/InputNumber.svelte.d.ts +0 -26
- package/dist/ui/InputNumber/index.d.ts +0 -1
- package/dist/ui/InputNumber/index.js +0 -1
- package/dist/ui/InputText/InputText.docs.svelte +0 -43
- package/dist/ui/InputText/InputText.docs.svelte.d.ts +0 -26
- package/dist/ui/InputText/InputText.svelte +0 -116
- package/dist/ui/InputText/InputText.svelte.d.ts +0 -22
- package/dist/ui/InputText/index.d.ts +0 -1
- package/dist/ui/InputText/index.js +0 -1
- package/dist/ui/Panel/CollapsiblePanel.docs.svelte +0 -45
- package/dist/ui/Panel/CollapsiblePanel.docs.svelte.d.ts +0 -25
- package/dist/ui/Panel/CollapsiblePanel.svelte +0 -93
- package/dist/ui/Panel/CollapsiblePanel.svelte.d.ts +0 -14
- package/dist/ui/Panel/index.d.ts +0 -1
- package/dist/ui/Panel/index.js +0 -1
- package/dist/ui/Placeholder/Placeholder.docs.svelte +0 -49
- package/dist/ui/Placeholder/Placeholder.docs.svelte.d.ts +0 -26
- package/dist/ui/Placeholder/Placeholder.svelte +0 -99
- package/dist/ui/Placeholder/Placeholder.svelte.d.ts +0 -21
- package/dist/ui/Placeholder/index.d.ts +0 -1
- package/dist/ui/Placeholder/index.js +0 -1
- package/dist/ui/Radio/Radio.docs.svelte +0 -67
- package/dist/ui/Radio/Radio.docs.svelte.d.ts +0 -27
- package/dist/ui/Radio/Radio.svelte +0 -165
- package/dist/ui/Radio/Radio.svelte.d.ts +0 -22
- package/dist/ui/Radio/RadioGroup.docs.svelte +0 -70
- package/dist/ui/Radio/RadioGroup.docs.svelte.d.ts +0 -27
- package/dist/ui/Radio/RadioGroup.svelte +0 -98
- package/dist/ui/Radio/RadioGroup.svelte.d.ts +0 -27
- package/dist/ui/Radio/index.d.ts +0 -2
- package/dist/ui/Radio/index.js +0 -2
- package/dist/ui/SegmentControl/SegmentControl.docs.svelte +0 -54
- package/dist/ui/SegmentControl/SegmentControl.docs.svelte.d.ts +0 -25
- package/dist/ui/SegmentControl/SegmentControl.svelte +0 -120
- package/dist/ui/SegmentControl/SegmentControl.svelte.d.ts +0 -18
- package/dist/ui/SegmentControl/index.d.ts +0 -1
- package/dist/ui/SegmentControl/index.js +0 -1
- package/dist/ui/Stack/Stack.docs.svelte +0 -63
- package/dist/ui/Stack/Stack.docs.svelte.d.ts +0 -26
- package/dist/ui/Stack/Stack.svelte +0 -45
- package/dist/ui/Stack/Stack.svelte.d.ts +0 -19
- package/dist/ui/Stack/index.d.ts +0 -1
- package/dist/ui/Stack/index.js +0 -1
- package/dist/ui/Table/Body.svelte +0 -17
- package/dist/ui/Table/Body.svelte.d.ts +0 -11
- package/dist/ui/Table/Caption.svelte +0 -17
- package/dist/ui/Table/Caption.svelte.d.ts +0 -11
- package/dist/ui/Table/Cell.svelte +0 -24
- package/dist/ui/Table/Cell.svelte.d.ts +0 -15
- package/dist/ui/Table/Foot.svelte +0 -17
- package/dist/ui/Table/Foot.svelte.d.ts +0 -11
- package/dist/ui/Table/Head.svelte +0 -17
- package/dist/ui/Table/Head.svelte.d.ts +0 -11
- package/dist/ui/Table/Header.svelte +0 -27
- package/dist/ui/Table/Header.svelte.d.ts +0 -17
- package/dist/ui/Table/Row.svelte +0 -19
- package/dist/ui/Table/Row.svelte.d.ts +0 -13
- package/dist/ui/Table/Table.docs.svelte +0 -197
- package/dist/ui/Table/Table.docs.svelte.d.ts +0 -28
- package/dist/ui/Table/Table.svelte +0 -140
- package/dist/ui/Table/Table.svelte.d.ts +0 -27
- package/dist/ui/Table/index.js +0 -10
- package/dist/ui/css/colors.css +0 -377
- package/dist/ui/css/global.css +0 -10
- package/dist/ui/index.d.ts +0 -12
- package/dist/ui/index.js +0 -12
- package/dist/virtual-sdocs.d.ts +0 -20
- package/dist/vite-plugin.d.ts +0 -18
- package/dist/vite-plugin.js +0 -206
- /package/dist/{cli/index.d.ts → cli.d.ts} +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import RadioGroup from './RadioGroup.svelte';
|
|
3
|
-
import type { DocMeta } from '../../types.js';
|
|
4
|
-
|
|
5
|
-
export const meta: DocMeta = {
|
|
6
|
-
title: 'RadioGroup',
|
|
7
|
-
component: RadioGroup,
|
|
8
|
-
args: {
|
|
9
|
-
options: ['Option A', 'Option B', 'Option C'],
|
|
10
|
-
value: 'Option A',
|
|
11
|
-
size: 'm',
|
|
12
|
-
direction: 'vertical',
|
|
13
|
-
disabled: false
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { Default, Sizes, Horizontal, Disabled, WithDisabledOption };
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
{#snippet Default(args: any)}
|
|
21
|
-
<RadioGroup {...args} />
|
|
22
|
-
{/snippet}
|
|
23
|
-
|
|
24
|
-
{#snippet Sizes()}
|
|
25
|
-
<div style="display: flex; gap: 48px;">
|
|
26
|
-
<div>
|
|
27
|
-
<p style="margin: 0 0 8px; font-size: 12px; color: var(--base-500);">Extra small</p>
|
|
28
|
-
<RadioGroup options={['Yes', 'No', 'Maybe']} value="Yes" size="xs" />
|
|
29
|
-
</div>
|
|
30
|
-
<div>
|
|
31
|
-
<p style="margin: 0 0 8px; font-size: 12px; color: var(--base-500);">Small</p>
|
|
32
|
-
<RadioGroup options={['Yes', 'No', 'Maybe']} value="Yes" size="s" />
|
|
33
|
-
</div>
|
|
34
|
-
<div>
|
|
35
|
-
<p style="margin: 0 0 8px; font-size: 12px; color: var(--base-500);">Medium</p>
|
|
36
|
-
<RadioGroup options={['Yes', 'No', 'Maybe']} value="Yes" size="m" />
|
|
37
|
-
</div>
|
|
38
|
-
<div>
|
|
39
|
-
<p style="margin: 0 0 8px; font-size: 12px; color: var(--base-500);">Large</p>
|
|
40
|
-
<RadioGroup options={['Yes', 'No', 'Maybe']} value="Yes" size="l" />
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
{/snippet}
|
|
44
|
-
|
|
45
|
-
{#snippet Horizontal()}
|
|
46
|
-
<RadioGroup
|
|
47
|
-
options={['Daily', 'Weekly', 'Monthly', 'Yearly']}
|
|
48
|
-
value="Weekly"
|
|
49
|
-
direction="horizontal"
|
|
50
|
-
/>
|
|
51
|
-
{/snippet}
|
|
52
|
-
|
|
53
|
-
{#snippet Disabled()}
|
|
54
|
-
<RadioGroup
|
|
55
|
-
options={['Option 1', 'Option 2', 'Option 3']}
|
|
56
|
-
value="Option 1"
|
|
57
|
-
disabled
|
|
58
|
-
/>
|
|
59
|
-
{/snippet}
|
|
60
|
-
|
|
61
|
-
{#snippet WithDisabledOption()}
|
|
62
|
-
<RadioGroup
|
|
63
|
-
options={[
|
|
64
|
-
{ value: 'free', label: 'Free Plan' },
|
|
65
|
-
{ value: 'pro', label: 'Pro Plan' },
|
|
66
|
-
{ value: 'enterprise', label: 'Enterprise (Coming Soon)', disabled: true }
|
|
67
|
-
]}
|
|
68
|
-
value="pro"
|
|
69
|
-
/>
|
|
70
|
-
{/snippet}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import RadioGroup from './RadioGroup.svelte';
|
|
2
|
-
import type { DocMeta } from '../../types.js';
|
|
3
|
-
declare const Default: (args: any) => ReturnType<import("svelte").Snippet>;
|
|
4
|
-
declare const Sizes: () => ReturnType<import("svelte").Snippet>;
|
|
5
|
-
declare const Horizontal: () => ReturnType<import("svelte").Snippet>;
|
|
6
|
-
declare const Disabled: () => ReturnType<import("svelte").Snippet>;
|
|
7
|
-
declare const WithDisabledOption: () => ReturnType<import("svelte").Snippet>;
|
|
8
|
-
export declare const meta: DocMeta;
|
|
9
|
-
export { Default, Sizes, Horizontal, Disabled, WithDisabledOption };
|
|
10
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
11
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
12
|
-
$$bindings?: Bindings;
|
|
13
|
-
} & Exports;
|
|
14
|
-
(internal: unknown, props: {
|
|
15
|
-
$$events?: Events;
|
|
16
|
-
$$slots?: Slots;
|
|
17
|
-
}): Exports & {
|
|
18
|
-
$set?: any;
|
|
19
|
-
$on?: any;
|
|
20
|
-
};
|
|
21
|
-
z_$$bindings?: Bindings;
|
|
22
|
-
}
|
|
23
|
-
declare const RadioGroup: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
24
|
-
[evt: string]: CustomEvent<any>;
|
|
25
|
-
}, {}, {}, string>;
|
|
26
|
-
type RadioGroup = InstanceType<typeof RadioGroup>;
|
|
27
|
-
export default RadioGroup;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Radio from './Radio.svelte';
|
|
3
|
-
|
|
4
|
-
interface RadioOption {
|
|
5
|
-
value: string;
|
|
6
|
-
label: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A managed group of radio buttons with built-in state handling and layout options.
|
|
12
|
-
*/
|
|
13
|
-
interface Props {
|
|
14
|
-
/** Array of options to display */
|
|
15
|
-
options: RadioOption[] | string[];
|
|
16
|
-
/** Currently selected value */
|
|
17
|
-
value?: string;
|
|
18
|
-
/** Group name */
|
|
19
|
-
name?: string;
|
|
20
|
-
/** Size variant */
|
|
21
|
-
size?: 'xs' | 's' | 'm' | 'l';
|
|
22
|
-
/** Disable all radios */
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
/** Layout direction */
|
|
25
|
-
direction?: 'horizontal' | 'vertical';
|
|
26
|
-
/** Callback when selection changes */
|
|
27
|
-
onchange?: (value: string) => void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
let {
|
|
31
|
-
options,
|
|
32
|
-
value = '',
|
|
33
|
-
name,
|
|
34
|
-
size = 'm',
|
|
35
|
-
disabled = false,
|
|
36
|
-
direction = 'vertical',
|
|
37
|
-
onchange
|
|
38
|
-
}: Props = $props();
|
|
39
|
-
|
|
40
|
-
let selectedValue = $state(value);
|
|
41
|
-
|
|
42
|
-
// Sync with external changes
|
|
43
|
-
$effect(() => {
|
|
44
|
-
selectedValue = value;
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// Normalize options to RadioOption format
|
|
48
|
-
let normalizedOptions = $derived(
|
|
49
|
-
options.map((opt) =>
|
|
50
|
-
typeof opt === 'string' ? { value: opt, label: opt } : opt
|
|
51
|
-
)
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
function handleChange(newValue: string) {
|
|
55
|
-
selectedValue = newValue;
|
|
56
|
-
onchange?.(newValue);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Gap based on size
|
|
60
|
-
const gaps = {
|
|
61
|
-
xs: '8px',
|
|
62
|
-
s: '10px',
|
|
63
|
-
m: '12px',
|
|
64
|
-
l: '14px'
|
|
65
|
-
};
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<div
|
|
69
|
-
class="RadioGroup"
|
|
70
|
-
class:horizontal={direction === 'horizontal'}
|
|
71
|
-
role="radiogroup"
|
|
72
|
-
style="--gap: {gaps[size]};"
|
|
73
|
-
>
|
|
74
|
-
{#each normalizedOptions as option (option.value)}
|
|
75
|
-
<Radio
|
|
76
|
-
value={option.value}
|
|
77
|
-
label={option.label}
|
|
78
|
-
{name}
|
|
79
|
-
{size}
|
|
80
|
-
checked={selectedValue === option.value}
|
|
81
|
-
disabled={disabled || option.disabled}
|
|
82
|
-
onchange={handleChange}
|
|
83
|
-
/>
|
|
84
|
-
{/each}
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<style>
|
|
88
|
-
.RadioGroup {
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: var(--gap);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.RadioGroup.horizontal {
|
|
95
|
-
flex-direction: row;
|
|
96
|
-
flex-wrap: wrap;
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
interface RadioOption {
|
|
2
|
-
value: string;
|
|
3
|
-
label: string;
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* A managed group of radio buttons with built-in state handling and layout options.
|
|
8
|
-
*/
|
|
9
|
-
interface Props {
|
|
10
|
-
/** Array of options to display */
|
|
11
|
-
options: RadioOption[] | string[];
|
|
12
|
-
/** Currently selected value */
|
|
13
|
-
value?: string;
|
|
14
|
-
/** Group name */
|
|
15
|
-
name?: string;
|
|
16
|
-
/** Size variant */
|
|
17
|
-
size?: 'xs' | 's' | 'm' | 'l';
|
|
18
|
-
/** Disable all radios */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/** Layout direction */
|
|
21
|
-
direction?: 'horizontal' | 'vertical';
|
|
22
|
-
/** Callback when selection changes */
|
|
23
|
-
onchange?: (value: string) => void;
|
|
24
|
-
}
|
|
25
|
-
declare const RadioGroup: import("svelte").Component<Props, {}, "">;
|
|
26
|
-
type RadioGroup = ReturnType<typeof RadioGroup>;
|
|
27
|
-
export default RadioGroup;
|
package/dist/ui/Radio/index.d.ts
DELETED
package/dist/ui/Radio/index.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import SegmentControl from './SegmentControl.svelte';
|
|
3
|
-
import type { DocMeta } from '../../types.js';
|
|
4
|
-
|
|
5
|
-
export const meta: DocMeta = {
|
|
6
|
-
title: 'SegmentControl',
|
|
7
|
-
component: SegmentControl,
|
|
8
|
-
args: {
|
|
9
|
-
options: ['Option 1', 'Option 2', 'Option 3'],
|
|
10
|
-
value: 'Option 1',
|
|
11
|
-
size: 'm',
|
|
12
|
-
disabled: false
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { Default, Sizes, Disabled };
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
{#snippet Default(args: any)}
|
|
20
|
-
<SegmentControl {...args} />
|
|
21
|
-
{/snippet}
|
|
22
|
-
|
|
23
|
-
{#snippet Sizes()}
|
|
24
|
-
<div style="display: flex; flex-direction: column; gap: 16px;">
|
|
25
|
-
<SegmentControl
|
|
26
|
-
options={['XS', 'S', 'M', 'L']}
|
|
27
|
-
value="XS"
|
|
28
|
-
size="xs"
|
|
29
|
-
/>
|
|
30
|
-
<SegmentControl
|
|
31
|
-
options={['XS', 'S', 'M', 'L']}
|
|
32
|
-
value="S"
|
|
33
|
-
size="s"
|
|
34
|
-
/>
|
|
35
|
-
<SegmentControl
|
|
36
|
-
options={['XS', 'S', 'M', 'L']}
|
|
37
|
-
value="M"
|
|
38
|
-
size="m"
|
|
39
|
-
/>
|
|
40
|
-
<SegmentControl
|
|
41
|
-
options={['XS', 'S', 'M', 'L']}
|
|
42
|
-
value="L"
|
|
43
|
-
size="l"
|
|
44
|
-
/>
|
|
45
|
-
</div>
|
|
46
|
-
{/snippet}
|
|
47
|
-
|
|
48
|
-
{#snippet Disabled()}
|
|
49
|
-
<SegmentControl
|
|
50
|
-
options={['One', 'Two', 'Three']}
|
|
51
|
-
value="Two"
|
|
52
|
-
disabled
|
|
53
|
-
/>
|
|
54
|
-
{/snippet}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import SegmentControl from './SegmentControl.svelte';
|
|
2
|
-
import type { DocMeta } from '../../types.js';
|
|
3
|
-
declare const Default: (args: any) => ReturnType<import("svelte").Snippet>;
|
|
4
|
-
declare const Sizes: () => ReturnType<import("svelte").Snippet>;
|
|
5
|
-
declare const Disabled: () => ReturnType<import("svelte").Snippet>;
|
|
6
|
-
export declare const meta: DocMeta;
|
|
7
|
-
export { Default, Sizes, Disabled };
|
|
8
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
9
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
10
|
-
$$bindings?: Bindings;
|
|
11
|
-
} & Exports;
|
|
12
|
-
(internal: unknown, props: {
|
|
13
|
-
$$events?: Events;
|
|
14
|
-
$$slots?: Slots;
|
|
15
|
-
}): Exports & {
|
|
16
|
-
$set?: any;
|
|
17
|
-
$on?: any;
|
|
18
|
-
};
|
|
19
|
-
z_$$bindings?: Bindings;
|
|
20
|
-
}
|
|
21
|
-
declare const SegmentControl: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
}, {}, {}, string>;
|
|
24
|
-
type SegmentControl = InstanceType<typeof SegmentControl>;
|
|
25
|
-
export default SegmentControl;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* A segmented toggle control for selecting one option from a set of choices.
|
|
4
|
-
*/
|
|
5
|
-
interface Props {
|
|
6
|
-
/** Available options */
|
|
7
|
-
options: string[];
|
|
8
|
-
/** Initially selected value */
|
|
9
|
-
value?: string;
|
|
10
|
-
/** Callback when selection changes */
|
|
11
|
-
onchange?: (value: string) => void;
|
|
12
|
-
/** Size variant */
|
|
13
|
-
size?: 'xs' | 's' | 'm' | 'l';
|
|
14
|
-
/** Disable the control */
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
let { options, value, onchange, size = 'm', disabled = false }: Props = $props();
|
|
19
|
-
|
|
20
|
-
// Internal state, initialized from prop
|
|
21
|
-
let selected = $state(value ?? options[0]);
|
|
22
|
-
|
|
23
|
-
function select(option: string) {
|
|
24
|
-
if (disabled || option === selected) return;
|
|
25
|
-
selected = option;
|
|
26
|
-
onchange?.(option);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function handleKeydown(event: KeyboardEvent, option: string) {
|
|
30
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
select(option);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<div class="SegmentControl {size}" class:disabled role="radiogroup">
|
|
38
|
-
{#each options as option (option)}
|
|
39
|
-
<button
|
|
40
|
-
type="button"
|
|
41
|
-
class="SegmentControl-option"
|
|
42
|
-
class:selected={selected === option}
|
|
43
|
-
role="radio"
|
|
44
|
-
aria-checked={selected === option}
|
|
45
|
-
{disabled}
|
|
46
|
-
onclick={() => select(option)}
|
|
47
|
-
onkeydown={(e) => handleKeydown(e, option)}
|
|
48
|
-
>
|
|
49
|
-
{option}
|
|
50
|
-
</button>
|
|
51
|
-
{/each}
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<style>
|
|
55
|
-
.SegmentControl {
|
|
56
|
-
display: inline-flex;
|
|
57
|
-
background: var(--base-100);
|
|
58
|
-
border-radius: 8px;
|
|
59
|
-
padding: 3px;
|
|
60
|
-
gap: 2px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.SegmentControl.disabled {
|
|
64
|
-
opacity: 0.5;
|
|
65
|
-
pointer-events: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.SegmentControl-option {
|
|
69
|
-
font-family: var(--font-sans);
|
|
70
|
-
font-weight: 500;
|
|
71
|
-
border: none;
|
|
72
|
-
background: transparent;
|
|
73
|
-
color: var(--color-text-secondary);
|
|
74
|
-
cursor: pointer;
|
|
75
|
-
border-radius: 6px;
|
|
76
|
-
transition: all 0.15s ease;
|
|
77
|
-
white-space: nowrap;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.SegmentControl-option:hover:not(.selected):not(:disabled) {
|
|
81
|
-
color: var(--color-text);
|
|
82
|
-
background: var(--base-50);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.SegmentControl-option.selected {
|
|
86
|
-
background: white;
|
|
87
|
-
color: var(--color-text);
|
|
88
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.SegmentControl-option:focus-visible {
|
|
92
|
-
outline: 2px solid var(--action-500);
|
|
93
|
-
outline-offset: 1px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/* Size variants - heights: xs=24px, s=28px, m=32px, l=40px (minus 6px container padding) */
|
|
97
|
-
.xs .SegmentControl-option {
|
|
98
|
-
height: 18px;
|
|
99
|
-
padding: 0 8px;
|
|
100
|
-
font-size: 11px;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.s .SegmentControl-option {
|
|
104
|
-
height: 22px;
|
|
105
|
-
padding: 0 10px;
|
|
106
|
-
font-size: 12px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.m .SegmentControl-option {
|
|
110
|
-
height: 26px;
|
|
111
|
-
padding: 0 12px;
|
|
112
|
-
font-size: 13px;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.l .SegmentControl-option {
|
|
116
|
-
height: 34px;
|
|
117
|
-
padding: 0 16px;
|
|
118
|
-
font-size: 14px;
|
|
119
|
-
}
|
|
120
|
-
</style>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A segmented toggle control for selecting one option from a set of choices.
|
|
3
|
-
*/
|
|
4
|
-
interface Props {
|
|
5
|
-
/** Available options */
|
|
6
|
-
options: string[];
|
|
7
|
-
/** Initially selected value */
|
|
8
|
-
value?: string;
|
|
9
|
-
/** Callback when selection changes */
|
|
10
|
-
onchange?: (value: string) => void;
|
|
11
|
-
/** Size variant */
|
|
12
|
-
size?: 'xs' | 's' | 'm' | 'l';
|
|
13
|
-
/** Disable the control */
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const SegmentControl: import("svelte").Component<Props, {}, "">;
|
|
17
|
-
type SegmentControl = ReturnType<typeof SegmentControl>;
|
|
18
|
-
export default SegmentControl;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SegmentControl } from './SegmentControl.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SegmentControl } from './SegmentControl.svelte';
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import Stack from './Stack.svelte';
|
|
3
|
-
import { Placeholder } from '../Placeholder/index.js';
|
|
4
|
-
import type { DocMeta } from '../../types.js';
|
|
5
|
-
|
|
6
|
-
export const meta: DocMeta = {
|
|
7
|
-
title: 'Layout/Stack',
|
|
8
|
-
component: Stack,
|
|
9
|
-
args: {
|
|
10
|
-
direction: 'column',
|
|
11
|
-
gap: '8px',
|
|
12
|
-
padding: '0',
|
|
13
|
-
bg: ''
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { Default, Row, Reversed, WithBackground };
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
{#snippet Default(args: any)}
|
|
21
|
-
<Stack {...args}>
|
|
22
|
-
<Placeholder text="1" width="80px" height="40px" />
|
|
23
|
-
<Placeholder text="2" width="80px" height="40px" />
|
|
24
|
-
<Placeholder text="3" width="80px" height="40px" />
|
|
25
|
-
</Stack>
|
|
26
|
-
{/snippet}
|
|
27
|
-
|
|
28
|
-
{#snippet Row()}
|
|
29
|
-
<Stack direction="row" gap="12px">
|
|
30
|
-
<Placeholder text="Left" width="100px" height="60px" color="blue" />
|
|
31
|
-
<Placeholder text="Center" width="100px" height="60px" color="green" />
|
|
32
|
-
<Placeholder text="Right" width="100px" height="60px" color="pink" />
|
|
33
|
-
</Stack>
|
|
34
|
-
{/snippet}
|
|
35
|
-
|
|
36
|
-
{#snippet Reversed()}
|
|
37
|
-
<div style="display: flex; gap: 32px;">
|
|
38
|
-
<div>
|
|
39
|
-
<p style="margin: 0 0 8px; font-size: 12px; color: var(--base-500);">Column reversed</p>
|
|
40
|
-
<Stack direction="column-reverse" gap="8px">
|
|
41
|
-
<Placeholder text="1" width="80px" height="40px" />
|
|
42
|
-
<Placeholder text="2" width="80px" height="40px" />
|
|
43
|
-
<Placeholder text="3" width="80px" height="40px" />
|
|
44
|
-
</Stack>
|
|
45
|
-
</div>
|
|
46
|
-
<div>
|
|
47
|
-
<p style="margin: 0 0 8px; font-size: 12px; color: var(--base-500);">Row reversed</p>
|
|
48
|
-
<Stack direction="row-reverse" gap="8px">
|
|
49
|
-
<Placeholder text="1" width="80px" height="40px" />
|
|
50
|
-
<Placeholder text="2" width="80px" height="40px" />
|
|
51
|
-
<Placeholder text="3" width="80px" height="40px" />
|
|
52
|
-
</Stack>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
{/snippet}
|
|
56
|
-
|
|
57
|
-
{#snippet WithBackground()}
|
|
58
|
-
<Stack direction="column" gap="12px" padding="16px" bg="var(--base-100)">
|
|
59
|
-
<Placeholder text="Item 1" height="50px" color="blue" />
|
|
60
|
-
<Placeholder text="Item 2" height="50px" color="green" />
|
|
61
|
-
<Placeholder text="Item 3" height="50px" color="pink" />
|
|
62
|
-
</Stack>
|
|
63
|
-
{/snippet}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import Stack from './Stack.svelte';
|
|
2
|
-
import type { DocMeta } from '../../types.js';
|
|
3
|
-
declare const Default: (args: any) => ReturnType<import("svelte").Snippet>;
|
|
4
|
-
declare const Row: () => ReturnType<import("svelte").Snippet>;
|
|
5
|
-
declare const Reversed: () => ReturnType<import("svelte").Snippet>;
|
|
6
|
-
declare const WithBackground: () => ReturnType<import("svelte").Snippet>;
|
|
7
|
-
export declare const meta: DocMeta;
|
|
8
|
-
export { Default, Row, Reversed, WithBackground };
|
|
9
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
10
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
11
|
-
$$bindings?: Bindings;
|
|
12
|
-
} & Exports;
|
|
13
|
-
(internal: unknown, props: {
|
|
14
|
-
$$events?: Events;
|
|
15
|
-
$$slots?: Slots;
|
|
16
|
-
}): Exports & {
|
|
17
|
-
$set?: any;
|
|
18
|
-
$on?: any;
|
|
19
|
-
};
|
|
20
|
-
z_$$bindings?: Bindings;
|
|
21
|
-
}
|
|
22
|
-
declare const Stack: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
}, {}, {}, string>;
|
|
25
|
-
type Stack = InstanceType<typeof Stack>;
|
|
26
|
-
export default Stack;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A flexible Stack layout component for arranging elements vertically or horizontally.
|
|
6
|
-
*/
|
|
7
|
-
interface Props {
|
|
8
|
-
/** Stack direction (CSS flex-direction) */
|
|
9
|
-
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
10
|
-
/** Gap between items (any CSS dimension) */
|
|
11
|
-
gap?: string;
|
|
12
|
-
/** Padding (any CSS dimension) */
|
|
13
|
-
padding?: string;
|
|
14
|
-
/** Background color (any CSS color) */
|
|
15
|
-
bg?: string;
|
|
16
|
-
/** Children content */
|
|
17
|
-
children?: Snippet;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let {
|
|
21
|
-
direction = 'column',
|
|
22
|
-
gap = '0',
|
|
23
|
-
padding = '0',
|
|
24
|
-
bg,
|
|
25
|
-
children
|
|
26
|
-
}: Props = $props();
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<div
|
|
30
|
-
class="Stack"
|
|
31
|
-
style:flex-direction={direction}
|
|
32
|
-
style:gap
|
|
33
|
-
style:padding
|
|
34
|
-
style:background={bg}
|
|
35
|
-
>
|
|
36
|
-
{#if children}
|
|
37
|
-
{@render children()}
|
|
38
|
-
{/if}
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
<style>
|
|
42
|
-
.Stack {
|
|
43
|
-
display: flex;
|
|
44
|
-
}
|
|
45
|
-
</style>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
/**
|
|
3
|
-
* A flexible Stack layout component for arranging elements vertically or horizontally.
|
|
4
|
-
*/
|
|
5
|
-
interface Props {
|
|
6
|
-
/** Stack direction (CSS flex-direction) */
|
|
7
|
-
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
8
|
-
/** Gap between items (any CSS dimension) */
|
|
9
|
-
gap?: string;
|
|
10
|
-
/** Padding (any CSS dimension) */
|
|
11
|
-
padding?: string;
|
|
12
|
-
/** Background color (any CSS color) */
|
|
13
|
-
bg?: string;
|
|
14
|
-
/** Children content */
|
|
15
|
-
children?: Snippet;
|
|
16
|
-
}
|
|
17
|
-
declare const Stack: import("svelte").Component<Props, {}, "">;
|
|
18
|
-
type Stack = ReturnType<typeof Stack>;
|
|
19
|
-
export default Stack;
|
package/dist/ui/Stack/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Stack } from './Stack.svelte';
|
package/dist/ui/Stack/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Stack } from './Stack.svelte';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Table body section. Contains data rows.
|
|
6
|
-
*/
|
|
7
|
-
interface Props {
|
|
8
|
-
/** Data rows */
|
|
9
|
-
children: Snippet;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let { children }: Props = $props();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<tbody>
|
|
16
|
-
{@render children()}
|
|
17
|
-
</tbody>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
/**
|
|
3
|
-
* Table body section. Contains data rows.
|
|
4
|
-
*/
|
|
5
|
-
interface Props {
|
|
6
|
-
/** Data rows */
|
|
7
|
-
children: Snippet;
|
|
8
|
-
}
|
|
9
|
-
declare const Body: import("svelte").Component<Props, {}, "">;
|
|
10
|
-
type Body = ReturnType<typeof Body>;
|
|
11
|
-
export default Body;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* An accessible table caption. Announced by screen readers when navigating to the table.
|
|
6
|
-
*/
|
|
7
|
-
interface Props {
|
|
8
|
-
/** Caption content */
|
|
9
|
-
children: Snippet;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let { children }: Props = $props();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<caption>
|
|
16
|
-
{@render children()}
|
|
17
|
-
</caption>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
/**
|
|
3
|
-
* An accessible table caption. Announced by screen readers when navigating to the table.
|
|
4
|
-
*/
|
|
5
|
-
interface Props {
|
|
6
|
-
/** Caption content */
|
|
7
|
-
children: Snippet;
|
|
8
|
-
}
|
|
9
|
-
declare const Caption: import("svelte").Component<Props, {}, "">;
|
|
10
|
-
type Caption = ReturnType<typeof Caption>;
|
|
11
|
-
export default Caption;
|