@dryui/theme-wizard 1.0.0
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/actions.d.ts +4 -0
- package/dist/actions.js +9 -0
- package/dist/components/AlphaSlider.svelte +13 -0
- package/dist/components/AlphaSlider.svelte.d.ts +9 -0
- package/dist/components/ContrastBadge.svelte +22 -0
- package/dist/components/ContrastBadge.svelte.d.ts +8 -0
- package/dist/components/HsbPicker.svelte +304 -0
- package/dist/components/HsbPicker.svelte.d.ts +9 -0
- package/dist/components/StepIndicator.svelte +87 -0
- package/dist/components/StepIndicator.svelte.d.ts +7 -0
- package/dist/components/TokenPreview.svelte +55 -0
- package/dist/components/TokenPreview.svelte.d.ts +8 -0
- package/dist/components/WizardShell.svelte +140 -0
- package/dist/components/WizardShell.svelte.d.ts +15 -0
- package/dist/engine/derivation.d.ts +282 -0
- package/dist/engine/derivation.js +1445 -0
- package/dist/engine/derivation.test.d.ts +1 -0
- package/dist/engine/derivation.test.js +956 -0
- package/dist/engine/export-css.d.ts +32 -0
- package/dist/engine/export-css.js +90 -0
- package/dist/engine/export-css.test.d.ts +1 -0
- package/dist/engine/export-css.test.js +78 -0
- package/dist/engine/index.d.ts +10 -0
- package/dist/engine/index.js +6 -0
- package/dist/engine/palette.d.ts +16 -0
- package/dist/engine/palette.js +44 -0
- package/dist/engine/presets.d.ts +6 -0
- package/dist/engine/presets.js +34 -0
- package/dist/engine/url-codec.d.ts +53 -0
- package/dist/engine/url-codec.js +243 -0
- package/dist/engine/url-codec.test.d.ts +1 -0
- package/dist/engine/url-codec.test.js +137 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +17 -0
- package/dist/state.svelte.d.ts +104 -0
- package/dist/state.svelte.js +555 -0
- package/dist/steps/BrandColor.svelte +218 -0
- package/dist/steps/BrandColor.svelte.d.ts +6 -0
- package/dist/steps/Personality.svelte +319 -0
- package/dist/steps/Personality.svelte.d.ts +3 -0
- package/dist/steps/PreviewExport.svelte +113 -0
- package/dist/steps/PreviewExport.svelte.d.ts +9 -0
- package/dist/steps/Shape.svelte +121 -0
- package/dist/steps/Shape.svelte.d.ts +18 -0
- package/dist/steps/Typography.svelte +115 -0
- package/dist/steps/Typography.svelte.d.ts +18 -0
- package/package.json +56 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Card } from '@dryui/ui/card';
|
|
3
|
+
import { SegmentedControl } from '@dryui/ui/segmented-control';
|
|
4
|
+
import { Text } from '@dryui/ui/text';
|
|
5
|
+
import { wizardState, setRadiusPreset, setDensity } from '../state.svelte.js';
|
|
6
|
+
import type { RadiusPreset } from '../state.svelte.js';
|
|
7
|
+
|
|
8
|
+
const PRESETS: { value: RadiusPreset; label: string; description: string }[] = [
|
|
9
|
+
{ value: 'sharp', label: 'Sharp', description: 'Tight corners' },
|
|
10
|
+
{ value: 'soft', label: 'Soft', description: 'Gentle corners' },
|
|
11
|
+
{ value: 'rounded', label: 'Rounded', description: 'Friendly surfaces' },
|
|
12
|
+
{ value: 'pill', label: 'Pill', description: 'Capsule shapes' }
|
|
13
|
+
];
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<section class="shape-section">
|
|
17
|
+
<div class="corner-grid">
|
|
18
|
+
{#each PRESETS as preset (preset.value)}
|
|
19
|
+
<Card.Root
|
|
20
|
+
as="button"
|
|
21
|
+
variant="interactive"
|
|
22
|
+
size="sm"
|
|
23
|
+
selected={wizardState.shape.radiusPreset === preset.value}
|
|
24
|
+
onclick={() => setRadiusPreset(preset.value)}
|
|
25
|
+
>
|
|
26
|
+
<Card.Content>
|
|
27
|
+
<div class="corner-option">
|
|
28
|
+
<div class="shape-hint" data-shape={preset.value}></div>
|
|
29
|
+
<div class="corner-meta">
|
|
30
|
+
<Text as="span" size="sm" weight="semibold">{preset.label}</Text>
|
|
31
|
+
<Text as="span" size="xs" color="muted">{preset.description}</Text>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</Card.Content>
|
|
35
|
+
</Card.Root>
|
|
36
|
+
{/each}
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="density-control">
|
|
40
|
+
<Text as="span" size="sm" weight="semibold">Spacing density</Text>
|
|
41
|
+
<SegmentedControl.Root value={wizardState.shape.density}>
|
|
42
|
+
<SegmentedControl.Item value="compact" onclick={() => setDensity('compact')}>
|
|
43
|
+
Compact
|
|
44
|
+
</SegmentedControl.Item>
|
|
45
|
+
<SegmentedControl.Item value="default" onclick={() => setDensity('default')}>
|
|
46
|
+
Default
|
|
47
|
+
</SegmentedControl.Item>
|
|
48
|
+
<SegmentedControl.Item value="spacious" onclick={() => setDensity('spacious')}>
|
|
49
|
+
Spacious
|
|
50
|
+
</SegmentedControl.Item>
|
|
51
|
+
</SegmentedControl.Root>
|
|
52
|
+
</div>
|
|
53
|
+
</section>
|
|
54
|
+
|
|
55
|
+
<style>
|
|
56
|
+
.shape-section {
|
|
57
|
+
display: grid;
|
|
58
|
+
gap: var(--dry-space-5);
|
|
59
|
+
container-type: inline-size;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.corner-grid {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
65
|
+
gap: var(--dry-space-4);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.corner-option {
|
|
69
|
+
display: grid;
|
|
70
|
+
gap: var(--dry-space-3);
|
|
71
|
+
justify-items: start;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.corner-meta {
|
|
75
|
+
display: grid;
|
|
76
|
+
gap: var(--dry-space-1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.shape-hint {
|
|
80
|
+
aspect-ratio: 1;
|
|
81
|
+
height: 2.5rem;
|
|
82
|
+
border: 2px solid var(--dry-color-stroke-strong);
|
|
83
|
+
background: var(--dry-color-bg-base);
|
|
84
|
+
transition: border-radius 0.2s ease;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.shape-hint[data-shape='sharp'] {
|
|
88
|
+
border-radius: 2px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.shape-hint[data-shape='soft'] {
|
|
92
|
+
border-radius: 8px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.shape-hint[data-shape='rounded'] {
|
|
96
|
+
border-radius: 16px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.shape-hint[data-shape='pill'] {
|
|
100
|
+
border-radius: 9999px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.density-control {
|
|
104
|
+
display: grid;
|
|
105
|
+
grid-template-columns: auto minmax(0, 20rem);
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: var(--dry-space-4);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@container (max-width: 40rem) {
|
|
111
|
+
.corner-grid {
|
|
112
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@container (max-width: 30rem) {
|
|
117
|
+
.density-control {
|
|
118
|
+
grid-template-columns: 1fr;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
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> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Shape: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Shape = InstanceType<typeof Shape>;
|
|
18
|
+
export default Shape;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Card } from '@dryui/ui/card';
|
|
3
|
+
import { SegmentedControl } from '@dryui/ui/segmented-control';
|
|
4
|
+
import { Text } from '@dryui/ui/text';
|
|
5
|
+
import {
|
|
6
|
+
FONT_STACKS,
|
|
7
|
+
setFontPreset,
|
|
8
|
+
setTypeScale,
|
|
9
|
+
wizardState,
|
|
10
|
+
type FontPreset
|
|
11
|
+
} from '../state.svelte.js';
|
|
12
|
+
|
|
13
|
+
const FONT_SAMPLES: Record<FontPreset, string> = {
|
|
14
|
+
System: 'Fast, neutral, and familiar',
|
|
15
|
+
Humanist: 'Warm curves for readable product copy',
|
|
16
|
+
Geometric: 'Sharper rhythm with a modern edge',
|
|
17
|
+
Classical: 'Refined without turning formal',
|
|
18
|
+
Serif: 'Editorial and literary by default',
|
|
19
|
+
Mono: 'Technical, precise, and utilitarian'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const FONT_PRESETS = (Object.keys(FONT_STACKS) as FontPreset[]).map((name) => ({
|
|
23
|
+
name,
|
|
24
|
+
stack: FONT_STACKS[name],
|
|
25
|
+
sample: FONT_SAMPLES[name]
|
|
26
|
+
}));
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<section class="typography-section">
|
|
30
|
+
<div class="font-grid">
|
|
31
|
+
{#each FONT_PRESETS as preset (preset.name)}
|
|
32
|
+
<Card.Root
|
|
33
|
+
as="button"
|
|
34
|
+
variant="interactive"
|
|
35
|
+
size="sm"
|
|
36
|
+
selected={wizardState.typography.fontPreset === preset.name}
|
|
37
|
+
onclick={() => setFontPreset(preset.name)}
|
|
38
|
+
>
|
|
39
|
+
<Card.Content>
|
|
40
|
+
<div class="font-option" style:--_stack={preset.stack}>
|
|
41
|
+
<span class="font-display">Ag</span>
|
|
42
|
+
<div class="font-meta">
|
|
43
|
+
<Text as="span" size="sm" weight="semibold">{preset.name}</Text>
|
|
44
|
+
<Text as="span" size="xs" color="muted">{preset.sample}</Text>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</Card.Content>
|
|
48
|
+
</Card.Root>
|
|
49
|
+
{/each}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="scale-control">
|
|
53
|
+
<Text as="span" size="sm" weight="semibold">Type scale</Text>
|
|
54
|
+
<SegmentedControl.Root value={wizardState.typography.scale}>
|
|
55
|
+
<SegmentedControl.Item value="compact" onclick={() => setTypeScale('compact')}>
|
|
56
|
+
Compact
|
|
57
|
+
</SegmentedControl.Item>
|
|
58
|
+
<SegmentedControl.Item value="default" onclick={() => setTypeScale('default')}>
|
|
59
|
+
Default
|
|
60
|
+
</SegmentedControl.Item>
|
|
61
|
+
<SegmentedControl.Item value="spacious" onclick={() => setTypeScale('spacious')}>
|
|
62
|
+
Spacious
|
|
63
|
+
</SegmentedControl.Item>
|
|
64
|
+
</SegmentedControl.Root>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
<style>
|
|
69
|
+
.typography-section {
|
|
70
|
+
display: grid;
|
|
71
|
+
gap: var(--dry-space-5);
|
|
72
|
+
container-type: inline-size;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.font-grid {
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
78
|
+
gap: var(--dry-space-4);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.font-option {
|
|
82
|
+
display: grid;
|
|
83
|
+
gap: var(--dry-space-2);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.font-display {
|
|
87
|
+
font-family: var(--_stack, inherit);
|
|
88
|
+
font-size: 2rem;
|
|
89
|
+
line-height: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.font-meta {
|
|
93
|
+
display: grid;
|
|
94
|
+
gap: var(--dry-space-1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.scale-control {
|
|
98
|
+
display: grid;
|
|
99
|
+
grid-template-columns: auto minmax(0, 20rem);
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: var(--dry-space-4);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@container (max-width: 40rem) {
|
|
105
|
+
.font-grid {
|
|
106
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@container (max-width: 30rem) {
|
|
111
|
+
.scale-control {
|
|
112
|
+
grid-template-columns: 1fr;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
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> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Typography: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Typography = InstanceType<typeof Typography>;
|
|
18
|
+
export default Typography;
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dryui/theme-wizard",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"author": "Rob Balfre",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/rob-balfre/dryui.git",
|
|
9
|
+
"directory": "packages/theme-wizard"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/rob-balfre/dryui#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/rob-balfre/dryui/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"svelte": "./src/index.ts",
|
|
17
|
+
"types": "./src/index.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./src/index.ts",
|
|
21
|
+
"svelte": "./src/index.ts",
|
|
22
|
+
"default": "./src/index.ts"
|
|
23
|
+
},
|
|
24
|
+
"./engine": {
|
|
25
|
+
"types": "./src/engine/index.ts",
|
|
26
|
+
"default": "./src/engine/index.ts"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "svelte-package -i src",
|
|
37
|
+
"check": "svelte-check --tsconfig ./tsconfig.json"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@dryui/primitives": "workspace:*",
|
|
41
|
+
"@dryui/ui": "workspace:*",
|
|
42
|
+
"lucide-svelte": ">=1.0.1",
|
|
43
|
+
"svelte": "^5.55.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@dryui/lint": "workspace:*",
|
|
47
|
+
"@dryui/primitives": "workspace:*",
|
|
48
|
+
"@dryui/ui": "workspace:*",
|
|
49
|
+
"lucide-svelte": "^1.0.1",
|
|
50
|
+
"svelte": "^5.55.1",
|
|
51
|
+
"@sveltejs/package": "^2.5.7",
|
|
52
|
+
"svelte-check": "^4.4.5",
|
|
53
|
+
"bun-types": "^1.3.11",
|
|
54
|
+
"typescript": "^6.0.2"
|
|
55
|
+
}
|
|
56
|
+
}
|