rizzo-css 0.0.79 → 0.0.81
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/README.md +1 -1
- package/bin/rizzo-css.js +3 -3
- package/package.json +1 -1
- package/scaffold/react/base/package.json +1 -1
- package/scaffold/svelte/Settings.svelte +11 -48
- package/scaffold/svelte/variants/full/.svelte-kit/tsconfig.json +11 -0
- package/scaffold/svelte/variants/full/README-RIZZO.md +2 -0
- package/scaffold/svelte/variants/full/gitignore +2 -1
- package/scaffold/svelte/variants/full/src/config/componentCategories.ts +43 -0
- package/scaffold/svelte/variants/full/src/config/docsNav.ts +50 -0
- package/scaffold/svelte/variants/full/src/routes/+page.svelte +16 -22
- package/scaffold/svelte/variants/full/src/routes/blocks/+layout.svelte +119 -0
- package/scaffold/svelte/variants/full/src/routes/blocks/+page.svelte +107 -0
- package/scaffold/svelte/variants/full/src/routes/docs/+layout.svelte +135 -0
- package/scaffold/svelte/variants/full/src/routes/docs/+page.svelte +68 -0
- package/scaffold/svelte/variants/full/src/routes/docs/components/+page.svelte +116 -0
- package/scaffold/svelte/variants/full/src/routes/docs/getting-started/+page.svelte +48 -0
- package/scaffold/svelte/variants/full/src/routes/docs/overview/+page.svelte +5 -0
- package/scaffold/svelte/variants/full/src/routes/themes/+page.svelte +202 -0
- package/scaffold/svelte/variants/full/tsconfig.json +1 -0
- package/scaffold/vanilla/README-RIZZO.md +1 -1
- package/scaffold/vanilla/components/accordion.html +4 -0
- package/scaffold/vanilla/components/alert-dialog.html +4 -0
- package/scaffold/vanilla/components/alert.html +4 -0
- package/scaffold/vanilla/components/aspect-ratio.html +4 -0
- package/scaffold/vanilla/components/avatar.html +4 -0
- package/scaffold/vanilla/components/back-to-top.html +4 -0
- package/scaffold/vanilla/components/badge.html +4 -0
- package/scaffold/vanilla/components/breadcrumb.html +4 -0
- package/scaffold/vanilla/components/button-group.html +4 -0
- package/scaffold/vanilla/components/button.html +4 -0
- package/scaffold/vanilla/components/calendar.html +4 -0
- package/scaffold/vanilla/components/cards.html +4 -0
- package/scaffold/vanilla/components/carousel.html +4 -0
- package/scaffold/vanilla/components/chart.html +4 -0
- package/scaffold/vanilla/components/collapsible.html +4 -0
- package/scaffold/vanilla/components/command.html +4 -0
- package/scaffold/vanilla/components/context-menu.html +4 -0
- package/scaffold/vanilla/components/copy-to-clipboard.html +4 -0
- package/scaffold/vanilla/components/dashboard.html +4 -0
- package/scaffold/vanilla/components/direction.html +4 -0
- package/scaffold/vanilla/components/divider.html +4 -0
- package/scaffold/vanilla/components/docs-sidebar.html +4 -0
- package/scaffold/vanilla/components/dropdown.html +4 -0
- package/scaffold/vanilla/components/empty.html +4 -0
- package/scaffold/vanilla/components/font-switcher.html +4 -0
- package/scaffold/vanilla/components/footer.html +4 -0
- package/scaffold/vanilla/components/forms.html +4 -0
- package/scaffold/vanilla/components/hover-card.html +4 -0
- package/scaffold/vanilla/components/icons.html +4 -0
- package/scaffold/vanilla/components/index.html +4 -0
- package/scaffold/vanilla/components/input-group.html +4 -0
- package/scaffold/vanilla/components/input-otp.html +4 -0
- package/scaffold/vanilla/components/kbd.html +4 -0
- package/scaffold/vanilla/components/label.html +4 -0
- package/scaffold/vanilla/components/menubar.html +4 -0
- package/scaffold/vanilla/components/modal.html +4 -0
- package/scaffold/vanilla/components/navbar.html +4 -0
- package/scaffold/vanilla/components/pagination.html +4 -0
- package/scaffold/vanilla/components/popover.html +4 -0
- package/scaffold/vanilla/components/progress-bar.html +4 -0
- package/scaffold/vanilla/components/range-calendar.html +4 -0
- package/scaffold/vanilla/components/resizable.html +4 -0
- package/scaffold/vanilla/components/scroll-area.html +4 -0
- package/scaffold/vanilla/components/search.html +4 -0
- package/scaffold/vanilla/components/separator.html +4 -0
- package/scaffold/vanilla/components/settings.html +4 -0
- package/scaffold/vanilla/components/sheet.html +4 -0
- package/scaffold/vanilla/components/skeleton.html +4 -0
- package/scaffold/vanilla/components/slider.html +4 -0
- package/scaffold/vanilla/components/sound-effects.html +4 -0
- package/scaffold/vanilla/components/spinner.html +4 -0
- package/scaffold/vanilla/components/switch.html +4 -0
- package/scaffold/vanilla/components/table.html +4 -0
- package/scaffold/vanilla/components/tabs.html +4 -0
- package/scaffold/vanilla/components/theme-switcher.html +4 -0
- package/scaffold/vanilla/components/toast.html +4 -0
- package/scaffold/vanilla/components/toggle-group.html +4 -0
- package/scaffold/vanilla/components/toggle.html +4 -0
- package/scaffold/vanilla/components/tooltip.html +4 -0
- package/scaffold/vanilla/index.html +4 -0
- package/scaffold/vue/base/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ import 'rizzo-css';
|
|
|
72
72
|
**Without a bundler (plain HTML):** Use a CDN. Both unpkg and jsDelivr resolve the package root to the built CSS (via the `unpkg` / `jsdelivr` fields in this package). For reliability or to pin a version, use the explicit path:
|
|
73
73
|
|
|
74
74
|
```html
|
|
75
|
-
<!-- unpkg (pin version: replace @latest with @0.0.
|
|
75
|
+
<!-- unpkg (pin version: replace @latest with @0.0.81 or any version) -->
|
|
76
76
|
<link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />
|
|
77
77
|
|
|
78
78
|
<!-- or jsDelivr -->
|
package/bin/rizzo-css.js
CHANGED
|
@@ -199,7 +199,7 @@ const SVELTE_COMPONENTS = [
|
|
|
199
199
|
'Button', 'Badge', 'Card', 'Calendar', 'RangeCalendar', 'Carousel', 'Chart', 'Dashboard', 'Divider', 'DocsSidebar', 'Footer', 'Spinner', 'ProgressBar', 'Avatar', 'Alert',
|
|
200
200
|
'BackToTop', 'Breadcrumb', 'Command', 'FormGroup', 'Input', 'InputGroup', 'InputOtp', 'Checkbox', 'Textarea', 'Select', 'Radio',
|
|
201
201
|
'CopyToClipboard', 'Tooltip', 'Pagination', 'Tabs', 'Accordion', 'Dropdown', 'Direction', 'Menubar',
|
|
202
|
-
'Modal', 'Toast', 'Table', 'ThemeSwitcher', 'FontSwitcher', 'SoundEffects',
|
|
202
|
+
'Modal', 'Toast', 'Table', 'ThemeIcon', 'ThemeSwitcher', 'FontSwitcher', 'SoundEffects',
|
|
203
203
|
'Navbar', 'Settings', 'Search', 'Icons', 'Skeleton', 'Switch',
|
|
204
204
|
'Label', 'Kbd', 'Collapsible', 'AlertDialog', 'AspectRatio', 'ButtonGroup', 'Empty', 'Separator',
|
|
205
205
|
'Slider', 'Sheet', 'Popover', 'Toggle', 'ToggleGroup', 'ScrollArea', 'HoverCard', 'ContextMenu', 'ResizablePaneGroup', 'ResizablePane', 'ResizableHandle',
|
|
@@ -208,7 +208,7 @@ const ASTRO_COMPONENTS = [
|
|
|
208
208
|
'Button', 'Badge', 'Card', 'Calendar', 'RangeCalendar', 'Carousel', 'Chart', 'Dashboard', 'Divider', 'DocsSidebar', 'Footer', 'Spinner', 'ProgressBar', 'Avatar', 'Alert',
|
|
209
209
|
'BackToTop', 'Breadcrumb', 'Command', 'FormGroup', 'Input', 'InputGroup', 'InputOtp', 'Checkbox', 'Textarea', 'Select', 'Radio',
|
|
210
210
|
'CopyToClipboard', 'Tooltip', 'Pagination', 'Tabs', 'Accordion', 'Dropdown', 'Direction', 'Menubar',
|
|
211
|
-
'Modal', 'Toast', 'Table', 'ThemeSwitcher', 'FontSwitcher', 'SoundEffects',
|
|
211
|
+
'Modal', 'Toast', 'Table', 'ThemeIcon', 'ThemeSwitcher', 'FontSwitcher', 'SoundEffects',
|
|
212
212
|
'Navbar', 'Settings', 'Search', 'Icons', 'Skeleton', 'Switch',
|
|
213
213
|
'Label', 'Kbd', 'Collapsible', 'AlertDialog', 'AspectRatio', 'ButtonGroup', 'Empty', 'Separator',
|
|
214
214
|
'Slider', 'Sheet', 'Popover', 'Toggle', 'ToggleGroup', 'ScrollArea', 'HoverCard', 'ContextMenu', 'ResizablePaneGroup', 'ResizablePane', 'ResizableHandle',
|
|
@@ -221,7 +221,7 @@ const RECOMMENDED_COMPONENTS = [
|
|
|
221
221
|
'Button', 'Badge', 'Card', 'Calendar', 'RangeCalendar', 'Carousel', 'Dashboard', 'Divider', 'DocsSidebar', 'Footer', 'Spinner', 'ProgressBar', 'Avatar', 'Alert',
|
|
222
222
|
'BackToTop', 'Breadcrumb', 'FormGroup', 'Input', 'Checkbox', 'Textarea', 'Select', 'Radio',
|
|
223
223
|
'CopyToClipboard', 'Tooltip', 'Pagination', 'Tabs', 'Accordion', 'Dropdown',
|
|
224
|
-
'Modal', 'Toast', 'Table', 'ThemeSwitcher', 'FontSwitcher', 'SoundEffects',
|
|
224
|
+
'Modal', 'Toast', 'Table', 'ThemeIcon', 'ThemeSwitcher', 'FontSwitcher', 'SoundEffects',
|
|
225
225
|
'Navbar', 'Search', 'Settings', 'Icons', 'Skeleton', 'Switch',
|
|
226
226
|
'Label', 'Kbd', 'Collapsible', 'AlertDialog', 'AspectRatio', 'ButtonGroup', 'Empty', 'Separator',
|
|
227
227
|
'Slider', 'Sheet', 'Popover', 'Toggle', 'ToggleGroup', 'ScrollArea', 'HoverCard', 'ContextMenu', 'ResizablePaneGroup', 'ResizablePane', 'ResizableHandle',
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import ThemeSwitcher from './ThemeSwitcher.svelte';
|
|
3
|
+
import FontSwitcher from './FontSwitcher.svelte';
|
|
4
|
+
import SoundEffects from './SoundEffects.svelte';
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
5
7
|
open?: boolean;
|
|
@@ -11,8 +13,6 @@
|
|
|
11
13
|
const isBrowser = typeof window !== 'undefined' && typeof localStorage?.getItem === 'function';
|
|
12
14
|
let fontSizeLabel = $state('100%');
|
|
13
15
|
let fontSizeSlider = $state(1);
|
|
14
|
-
let fontPairValue = $state(isBrowser ? localStorage.getItem('fontPair') || FONT_PAIR_DEFAULT : FONT_PAIR_DEFAULT);
|
|
15
|
-
let soundEffects = $state(isBrowser && localStorage.getItem('soundEffects') === 'true');
|
|
16
16
|
let reducedMotion = $state(isBrowser && localStorage.getItem('reducedMotion') === 'true');
|
|
17
17
|
let highContrast = $state(isBrowser && localStorage.getItem('highContrast') === 'true');
|
|
18
18
|
let scrollbarStyle = $state((isBrowser ? localStorage.getItem('scrollbarStyle') || 'thin' : 'thin') as 'thin' | 'thick' | 'hidden');
|
|
@@ -24,16 +24,6 @@
|
|
|
24
24
|
fontSizeLabel = `${Math.round(scale * 100)}%`;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function applyFontPair(value: string) {
|
|
28
|
-
if (typeof document === 'undefined') return;
|
|
29
|
-
const pair = FONT_PAIRS.find((p) => p.value === value);
|
|
30
|
-
if (pair) {
|
|
31
|
-
document.documentElement.style.setProperty('--font-family', pair.sans);
|
|
32
|
-
document.documentElement.style.setProperty('--font-family-mono', pair.mono);
|
|
33
|
-
localStorage?.setItem('fontPair', value);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
27
|
$effect(() => {
|
|
38
28
|
if (typeof window === 'undefined') return;
|
|
39
29
|
(window as unknown as { openSettings?: () => void }).openSettings = () => {
|
|
@@ -61,21 +51,12 @@
|
|
|
61
51
|
const scale = saved ? parseFloat(saved) : 1;
|
|
62
52
|
fontSizeSlider = scale;
|
|
63
53
|
fontSizeLabel = `${Math.round(scale * 100)}%`;
|
|
64
|
-
const savedPair = localStorage?.getItem('fontPair') || FONT_PAIR_DEFAULT;
|
|
65
|
-
fontPairValue = savedPair;
|
|
66
|
-
soundEffects = localStorage?.getItem('soundEffects') === 'true';
|
|
67
54
|
reducedMotion = localStorage?.getItem('reducedMotion') === 'true';
|
|
68
55
|
highContrast = localStorage?.getItem('highContrast') === 'true';
|
|
69
56
|
scrollbarStyle = (localStorage?.getItem('scrollbarStyle') || 'thin') as 'thin' | 'thick' | 'hidden';
|
|
70
57
|
}
|
|
71
58
|
});
|
|
72
59
|
|
|
73
|
-
function onSoundEffectsChange(e: Event) {
|
|
74
|
-
const checked = (e.target as HTMLInputElement).checked;
|
|
75
|
-
soundEffects = checked;
|
|
76
|
-
localStorage?.setItem('soundEffects', checked ? 'true' : 'false');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
60
|
function close() {
|
|
80
61
|
openInternal = false;
|
|
81
62
|
}
|
|
@@ -87,13 +68,6 @@
|
|
|
87
68
|
applyFontSize(scale);
|
|
88
69
|
}
|
|
89
70
|
|
|
90
|
-
function onFontPairChange(e: Event) {
|
|
91
|
-
const target = e.target as HTMLSelectElement;
|
|
92
|
-
const value = target.value;
|
|
93
|
-
fontPairValue = value;
|
|
94
|
-
applyFontPair(value);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
71
|
function onReducedMotionChange(e: Event) {
|
|
98
72
|
const checked = (e.target as HTMLInputElement).checked;
|
|
99
73
|
reducedMotion = checked;
|
|
@@ -133,6 +107,12 @@
|
|
|
133
107
|
<button type="button" class="settings__close" data-settings-close aria-label="Close settings" onclick={close}>×</button>
|
|
134
108
|
</div>
|
|
135
109
|
<div class="settings__content" tabindex="-1" aria-label="Settings options">
|
|
110
|
+
<section class="settings__section">
|
|
111
|
+
<h3 class="settings__section-title">Theme</h3>
|
|
112
|
+
<div class="settings__control">
|
|
113
|
+
<ThemeSwitcher idPrefix="settings" />
|
|
114
|
+
</div>
|
|
115
|
+
</section>
|
|
136
116
|
<section class="settings__section">
|
|
137
117
|
<h3 class="settings__section-title">Font Size</h3>
|
|
138
118
|
<div class="settings__control">
|
|
@@ -159,31 +139,14 @@
|
|
|
159
139
|
<section class="settings__section">
|
|
160
140
|
<h3 class="settings__section-title">Font</h3>
|
|
161
141
|
<div class="settings__control">
|
|
162
|
-
<
|
|
163
|
-
<select
|
|
164
|
-
id="font-pair-select"
|
|
165
|
-
class="form-control"
|
|
166
|
-
aria-label="Font pair"
|
|
167
|
-
data-font-pair
|
|
168
|
-
style="width: 100%;"
|
|
169
|
-
value={fontPairValue}
|
|
170
|
-
onchange={onFontPairChange}
|
|
171
|
-
>
|
|
172
|
-
{#each FONT_PAIRS as pair}
|
|
173
|
-
<option value={pair.value} data-sans={pair.sans} data-mono={pair.mono}>{pair.label}</option>
|
|
174
|
-
{/each}
|
|
175
|
-
</select>
|
|
142
|
+
<FontSwitcher idPrefix="settings" />
|
|
176
143
|
<p class="settings__help-text">Body text and code blocks use the selected pair.</p>
|
|
177
144
|
</div>
|
|
178
145
|
</section>
|
|
179
146
|
<section class="settings__section">
|
|
180
147
|
<h3 class="settings__section-title">Sound</h3>
|
|
181
148
|
<div class="settings__control">
|
|
182
|
-
<
|
|
183
|
-
<input type="checkbox" class="settings__checkbox" aria-label="Play sound on click" checked={soundEffects} onchange={onSoundEffectsChange} />
|
|
184
|
-
<span>Play sound on click</span>
|
|
185
|
-
</label>
|
|
186
|
-
<p class="settings__help-text">Short click sound when you interact with buttons and links. Off by default.</p>
|
|
149
|
+
<SoundEffects showHelp={true} />
|
|
187
150
|
</div>
|
|
188
151
|
</section>
|
|
189
152
|
<section class="settings__section">
|
|
@@ -39,10 +39,12 @@ SvelteKit project with Rizzo CSS. Scaffolded with `npx rizzo-css init` when you
|
|
|
39
39
|
|
|
40
40
|
- `svelte.config.js` — SvelteKit configuration
|
|
41
41
|
- `vite.config.js` — Vite config with SvelteKit plugin (required for `pnpm dev`)
|
|
42
|
+
- `tsconfig.json` — Extends `.svelte-kit/tsconfig.json`; a minimal fallback is committed so TypeScript and the IDE work before the first `pnpm dev`. Running `pnpm dev` or `svelte-kit sync` regenerates the full config.
|
|
42
43
|
- `src/app.html` — HTML shell with Rizzo CSS and theme (edit `data-theme` for default)
|
|
43
44
|
- `src/routes/+layout.svelte` — Root layout
|
|
44
45
|
- `src/routes/+page.svelte` — Home page
|
|
45
46
|
- **Navbar** — Flat links (Docs, Components, Blocks, Themes, Colors); Search and Settings in the scaffold
|
|
47
|
+
- **Settings** — Slide-in panel (gear icon): Theme (ThemeSwitcher), Font Size, Font (FontSwitcher), Sound (SoundEffects), Accessibility (reduce motion, high contrast, scrollbar style). Same contents as the docs site.
|
|
46
48
|
- `static/css/rizzo.min.css` — Rizzo CSS bundle (added by CLI; font URLs point to `/assets/fonts/`)
|
|
47
49
|
- `static/assets/fonts/` — Rizzo font files (added by CLI)
|
|
48
50
|
- `README-RIZZO.md` — This file (scaffold docs; does not replace your project README)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal component categories for the full template components page.
|
|
3
|
+
* Same structure as main site for consistent layout.
|
|
4
|
+
*/
|
|
5
|
+
export interface CategoryItem {
|
|
6
|
+
href: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface CategoryWithItems {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
items: CategoryItem[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function slugToTitle(slug: string): string {
|
|
18
|
+
return slug
|
|
19
|
+
.split('-')
|
|
20
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
21
|
+
.join(' ');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const CATEGORIES: { id: string; label: string; slugs: string[] }[] = [
|
|
25
|
+
{ id: 'layout', label: 'Layout', slugs: ['navbar', 'docs-sidebar', 'dashboard', 'resizable', 'footer'] },
|
|
26
|
+
{ id: 'forms', label: 'Forms & inputs', slugs: ['button', 'button-group', 'forms', 'switch', 'slider', 'toggle', 'toggle-group', 'divider', 'separator', 'label', 'kbd'] },
|
|
27
|
+
{ id: 'data', label: 'Data display', slugs: ['cards', 'table', 'badge', 'pagination', 'aspect-ratio', 'empty', 'scroll-area', 'alert', 'skeleton', 'spinner', 'progress-bar', 'toast'] },
|
|
28
|
+
{ id: 'overlay', label: 'Overlay', slugs: ['modal', 'sheet', 'popover', 'dropdown', 'tooltip', 'accordion', 'collapsible', 'tabs'] },
|
|
29
|
+
{ id: 'other', label: 'Other', slugs: ['avatar', 'copy-to-clipboard', 'theme-switcher', 'font-switcher', 'settings', 'search', 'breadcrumb', 'back-to-top'] },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
export function getComponentsByCategory(): CategoryWithItems[] {
|
|
33
|
+
const pathPrefix = '/docs/components';
|
|
34
|
+
return CATEGORIES.map((cat) => ({
|
|
35
|
+
id: cat.id,
|
|
36
|
+
label: cat.label,
|
|
37
|
+
items: cat.slugs.map((slug) => ({
|
|
38
|
+
href: `${pathPrefix}/${slug}`,
|
|
39
|
+
title: slugToTitle(slug),
|
|
40
|
+
description: `Accessible, themeable ${slugToTitle(slug).toLowerCase()} component.`,
|
|
41
|
+
})),
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal docs nav for the full template. Matches DOCS_NAV structure so DocsSidebar works.
|
|
3
|
+
*/
|
|
4
|
+
export interface DocsNavSection {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface DocsNavLink {
|
|
10
|
+
href: string;
|
|
11
|
+
label: string;
|
|
12
|
+
frameworkOnly?: boolean;
|
|
13
|
+
absolute?: boolean;
|
|
14
|
+
sections?: DocsNavSection[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface DocsNavGroup {
|
|
18
|
+
label: string;
|
|
19
|
+
links: DocsNavLink[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const DOCS_NAV: DocsNavGroup[] = [
|
|
23
|
+
{
|
|
24
|
+
label: 'Introduction',
|
|
25
|
+
links: [
|
|
26
|
+
{ href: 'overview', label: 'Overview', frameworkOnly: true },
|
|
27
|
+
{ href: 'getting-started', label: 'Getting Started' },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Components',
|
|
32
|
+
links: [{ href: 'components', label: 'Overview', frameworkOnly: true }],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Blocks',
|
|
36
|
+
links: [
|
|
37
|
+
{ href: '/blocks', label: 'Blocks overview', absolute: true },
|
|
38
|
+
{ href: '/blocks/landing-hero', label: 'Landing hero', absolute: true },
|
|
39
|
+
{ href: '/blocks/pricing', label: 'Pricing cards', absolute: true },
|
|
40
|
+
{ href: '/blocks/dashboard-01', label: 'Dashboard', absolute: true },
|
|
41
|
+
{ href: '/blocks/docs-layout', label: 'Docs layout', absolute: true },
|
|
42
|
+
{ href: '/blocks/login', label: 'Login', absolute: true },
|
|
43
|
+
{ href: '/blocks/signup', label: 'Sign up', absolute: true },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Themes',
|
|
48
|
+
links: [{ href: '/themes', label: 'Themes', absolute: true }],
|
|
49
|
+
},
|
|
50
|
+
];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import CopyToClipboard from '$lib/rizzo/CopyToClipboard.svelte';
|
|
3
|
-
const DOCS_BASE = 'https://rizzo-css.vercel.app';
|
|
4
3
|
const ADD_COMMAND = 'npx rizzo-css add <ComponentName>';
|
|
5
4
|
</script>
|
|
6
5
|
|
|
@@ -11,8 +10,8 @@
|
|
|
11
10
|
<h1 class="home__title">Rizzo CSS</h1>
|
|
12
11
|
<p class="home__subtitle">A modern CSS design system with semantic theming, accessibility-first components, and one CLI for Vanilla, Astro, and Svelte. Start here then make it your own.</p>
|
|
13
12
|
<div class="home__hero-ctas">
|
|
14
|
-
<a href=
|
|
15
|
-
<a href=
|
|
13
|
+
<a href="/docs/getting-started" class="btn btn-primary home__hero-cta">Get Started</a>
|
|
14
|
+
<a href="/docs/components" class="btn btn-outline home__hero-cta">View Components</a>
|
|
16
15
|
</div>
|
|
17
16
|
</header>
|
|
18
17
|
|
|
@@ -69,34 +68,29 @@
|
|
|
69
68
|
<section class="home__docs">
|
|
70
69
|
<h2 class="home__section-title">Documentation</h2>
|
|
71
70
|
<div class="home__docs-grid">
|
|
72
|
-
<a href=
|
|
71
|
+
<a href="/docs/getting-started" class="home__doc-card">
|
|
73
72
|
<h3>Getting Started</h3>
|
|
74
73
|
<p>Installation, project structure, and quick start guide</p>
|
|
75
|
-
<span class="sr-only"> (opens in new tab)</span>
|
|
76
74
|
</a>
|
|
77
|
-
<a href=
|
|
75
|
+
<a href="/docs/components" class="home__doc-card">
|
|
78
76
|
<h3>Components</h3>
|
|
79
77
|
<p>Component library with usage examples and live demos</p>
|
|
80
|
-
<span class="sr-only"> (opens in new tab)</span>
|
|
81
78
|
</a>
|
|
82
|
-
<a href=
|
|
83
|
-
<h3>
|
|
84
|
-
<p>Theme system,
|
|
85
|
-
<span class="sr-only"> (opens in new tab)</span>
|
|
79
|
+
<a href="/themes" class="home__doc-card">
|
|
80
|
+
<h3>Themes</h3>
|
|
81
|
+
<p>Theme system, 14 themes, and live preview</p>
|
|
86
82
|
</a>
|
|
87
|
-
<a href=
|
|
88
|
-
<h3>
|
|
89
|
-
<p>
|
|
90
|
-
<span class="sr-only"> (opens in new tab)</span>
|
|
83
|
+
<a href="/blocks" class="home__doc-card">
|
|
84
|
+
<h3>Blocks</h3>
|
|
85
|
+
<p>Pre-built layouts: landing, pricing, dashboard, docs, login, signup</p>
|
|
91
86
|
</a>
|
|
92
|
-
<a href=
|
|
93
|
-
<h3>
|
|
94
|
-
<p>
|
|
95
|
-
<span class="sr-only"> (opens in new tab)</span>
|
|
87
|
+
<a href="/docs" class="home__doc-card">
|
|
88
|
+
<h3>Docs Overview</h3>
|
|
89
|
+
<p>Condensed index of documentation and links</p>
|
|
96
90
|
</a>
|
|
97
|
-
<a href=
|
|
98
|
-
<h3>
|
|
99
|
-
<p>
|
|
91
|
+
<a href="https://rizzo-css.vercel.app/docs/theming" class="home__doc-card" target="_blank" rel="noopener noreferrer">
|
|
92
|
+
<h3>Theming (full docs)</h3>
|
|
93
|
+
<p>Custom themes, persistence, color format — on main site</p>
|
|
100
94
|
<span class="sr-only"> (opens in new tab)</span>
|
|
101
95
|
</a>
|
|
102
96
|
</div>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import { page } from '$app/stores';
|
|
4
|
+
import BackToTop from '$lib/rizzo/BackToTop.svelte';
|
|
5
|
+
|
|
6
|
+
const currentPath = $derived($page.url.pathname);
|
|
7
|
+
const BLOCKS_NAV = [
|
|
8
|
+
{ href: '/blocks', label: 'Overview' },
|
|
9
|
+
{ href: '/blocks/landing-hero', label: 'Landing hero' },
|
|
10
|
+
{ href: '/blocks/pricing', label: 'Pricing cards' },
|
|
11
|
+
{ href: '/blocks/dashboard-01', label: 'Dashboard with sidebar' },
|
|
12
|
+
{ href: '/blocks/docs-layout', label: 'Docs layout with sidebar' },
|
|
13
|
+
{ href: '/blocks/login', label: 'Login' },
|
|
14
|
+
{ href: '/blocks/signup', label: 'Sign up' },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
onMount(() => {
|
|
18
|
+
const w = typeof window !== 'undefined' ? window.innerWidth : 1025;
|
|
19
|
+
document.documentElement.classList.add(w <= 1024 ? 'docs-sidebar-mobile' : 'docs-sidebar-desktop');
|
|
20
|
+
|
|
21
|
+
const container = document.getElementById('docs-sidebar-container');
|
|
22
|
+
if (!container) return;
|
|
23
|
+
const toggle = container.querySelector('[data-docs-sidebar-toggle]');
|
|
24
|
+
const overlay = container.querySelector('[data-docs-sidebar-overlay]');
|
|
25
|
+
const docs = document.querySelector('[data-docs]');
|
|
26
|
+
if (!toggle || !overlay || !docs) return;
|
|
27
|
+
|
|
28
|
+
function open() {
|
|
29
|
+
docs.classList.add('docs--sidebar-open');
|
|
30
|
+
toggle.setAttribute('aria-expanded', 'true');
|
|
31
|
+
overlay.setAttribute('aria-hidden', 'false');
|
|
32
|
+
}
|
|
33
|
+
function close() {
|
|
34
|
+
docs.classList.remove('docs--sidebar-open');
|
|
35
|
+
toggle.setAttribute('aria-expanded', 'false');
|
|
36
|
+
overlay.setAttribute('aria-hidden', 'true');
|
|
37
|
+
}
|
|
38
|
+
toggle.addEventListener('click', () => (docs.classList.contains('docs--sidebar-open') ? close() : open()));
|
|
39
|
+
overlay.addEventListener('click', close);
|
|
40
|
+
|
|
41
|
+
if (document.documentElement.classList.contains('docs-sidebar-mobile')) {
|
|
42
|
+
if (document.readyState === 'loading') {
|
|
43
|
+
document.addEventListener('DOMContentLoaded', () => container.remove());
|
|
44
|
+
} else {
|
|
45
|
+
container.remove();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<div class="docs" data-docs>
|
|
52
|
+
<div id="docs-sidebar-container">
|
|
53
|
+
<button
|
|
54
|
+
type="button"
|
|
55
|
+
class="docs__sidebar-toggle"
|
|
56
|
+
aria-label="Open blocks menu"
|
|
57
|
+
aria-expanded="false"
|
|
58
|
+
aria-controls="docs-sidebar"
|
|
59
|
+
data-docs-sidebar-toggle
|
|
60
|
+
>
|
|
61
|
+
<span class="docs__sidebar-toggle-icon" aria-hidden="true">
|
|
62
|
+
<span></span><span></span><span></span>
|
|
63
|
+
</span>
|
|
64
|
+
<span class="docs__sidebar-toggle-text">Blocks</span>
|
|
65
|
+
</button>
|
|
66
|
+
<div class="docs__sidebar-overlay" data-docs-sidebar-overlay aria-hidden="true"></div>
|
|
67
|
+
<aside id="docs-sidebar" class="docs-sidebar" aria-label="Blocks navigation" tabindex="0">
|
|
68
|
+
<nav class="docs-sidebar__nav">
|
|
69
|
+
<div class="docs-sidebar__group">
|
|
70
|
+
<h2 class="docs-sidebar__group-label">Blocks</h2>
|
|
71
|
+
<ul class="docs-sidebar__list">
|
|
72
|
+
{#each BLOCKS_NAV as item}
|
|
73
|
+
{@const isActive = currentPath === item.href || (item.href !== '/blocks' && currentPath.startsWith(item.href))}
|
|
74
|
+
<li class="docs-sidebar__item">
|
|
75
|
+
<a
|
|
76
|
+
href={item.href}
|
|
77
|
+
class="docs-sidebar__link"
|
|
78
|
+
class:docs-sidebar__link--active={isActive}
|
|
79
|
+
aria-current={isActive ? 'page' : undefined}
|
|
80
|
+
>
|
|
81
|
+
{item.label}
|
|
82
|
+
</a>
|
|
83
|
+
</li>
|
|
84
|
+
{/each}
|
|
85
|
+
</ul>
|
|
86
|
+
</div>
|
|
87
|
+
</nav>
|
|
88
|
+
</aside>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="docs__main">
|
|
91
|
+
<div class="docs__container">
|
|
92
|
+
<div class="docs__content">
|
|
93
|
+
<slot />
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<BackToTop threshold={300} />
|
|
99
|
+
|
|
100
|
+
<svelte:head>
|
|
101
|
+
<title>Blocks — Rizzo CSS</title>
|
|
102
|
+
</svelte:head>
|
|
103
|
+
|
|
104
|
+
<style>
|
|
105
|
+
:global(.docs__container) {
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
width: 100%;
|
|
108
|
+
min-width: 0;
|
|
109
|
+
max-width: var(--container-default);
|
|
110
|
+
margin: 0 auto;
|
|
111
|
+
padding: 0 var(--content-padding-x);
|
|
112
|
+
}
|
|
113
|
+
:global(.docs__content) {
|
|
114
|
+
width: 100%;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
color: var(--text);
|
|
117
|
+
line-height: var(--line-height-relaxed);
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Card from '$lib/rizzo/Card.svelte';
|
|
3
|
+
|
|
4
|
+
const blocks = [
|
|
5
|
+
{ href: '/blocks/landing-hero', title: 'Landing hero', desc: 'Marketing hero with headline, subtitle, and primary CTAs. Typography and button tokens.', meta: 'Hero · Buttons · Typography' },
|
|
6
|
+
{ href: '/blocks/pricing', title: 'Pricing cards', desc: 'Three-tier pricing section using Card, Badge, and buttons. Theme-aware.', meta: 'Card · Badge · Buttons' },
|
|
7
|
+
{ href: '/blocks/dashboard-01', title: 'Dashboard', desc: 'App dashboard with sidebar, stat cards, and data table. Uses Dashboard, Card, and Table components.', meta: 'Dashboard · Sidebar · Cards · Table' },
|
|
8
|
+
{ href: '/blocks/docs-layout', title: 'Docs layout', desc: 'Documentation layout with a sidebar nav and main content area. Same pattern as this docs site.', meta: 'Docs Sidebar · Layout' },
|
|
9
|
+
{ href: '/blocks/login', title: 'Login', desc: 'Centered login form on a muted background. Brand link, email/password fields, and footer links.', meta: 'Form · Button · Tokens' },
|
|
10
|
+
{ href: '/blocks/signup', title: 'Sign up', desc: 'Centered sign-up form with name, email, password, and link to sign in. Same tokens as Login.', meta: 'Form · Button · Tokens' },
|
|
11
|
+
];
|
|
12
|
+
const DOCS_BASE = 'https://rizzo-css.vercel.app';
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<svelte:head>
|
|
16
|
+
<title>Blocks — Rizzo CSS</title>
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="blocks-index__browse">
|
|
20
|
+
<h1 class="docs__title">Blocks</h1>
|
|
21
|
+
<p class="blocks-index__browse-desc">
|
|
22
|
+
Pre-built layouts and patterns using Rizzo components and design tokens. Use them as starting points for dashboards, docs sites, auth screens, and app shells.
|
|
23
|
+
</p>
|
|
24
|
+
</section>
|
|
25
|
+
|
|
26
|
+
<section>
|
|
27
|
+
<h2 class="blocks-index__section-label">Featured</h2>
|
|
28
|
+
<div class="blocks-index__grid">
|
|
29
|
+
{#each blocks as block}
|
|
30
|
+
<a href="{DOCS_BASE}{block.href}" class="block-card-link" target="_blank" rel="noopener noreferrer">
|
|
31
|
+
<Card variant="elevated">
|
|
32
|
+
<div class="card__body">
|
|
33
|
+
<h3 style="margin: 0 0 var(--spacing-2) 0;">{block.title}</h3>
|
|
34
|
+
<p style="margin: 0; color: var(--text-dim); font-size: var(--font-size-sm);">{block.desc}</p>
|
|
35
|
+
<span class="block-card-meta" style="margin-top: var(--spacing-2); font-size: var(--font-size-xs); color: var(--text-dim);">{block.meta}</span>
|
|
36
|
+
</div>
|
|
37
|
+
</Card>
|
|
38
|
+
</a>
|
|
39
|
+
{/each}
|
|
40
|
+
</div>
|
|
41
|
+
</section>
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<h2>Scaffold from CLI</h2>
|
|
45
|
+
<p>When you create a new project or add to existing, choose a <strong>template</strong>: <strong>CSS only</strong>, <strong>Landing</strong>, <strong>Docs</strong>, <strong>Dashboard</strong>, or <strong>Full</strong>. Full clones the entire docs site with home, docs, components, blocks, and themes.</p>
|
|
46
|
+
<pre><code>npx rizzo-css init
|
|
47
|
+
# → Choose framework (Vanilla, Astro, Svelte, React, Vue)
|
|
48
|
+
# → Choose template: CSS only | Landing | Docs | Dashboard | Full</code></pre>
|
|
49
|
+
</section>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
.blocks-index__browse {
|
|
53
|
+
margin-bottom: var(--section-spacing);
|
|
54
|
+
}
|
|
55
|
+
.blocks-index__browse-desc {
|
|
56
|
+
margin: 0;
|
|
57
|
+
color: var(--text-dim);
|
|
58
|
+
font-size: var(--font-size-sm);
|
|
59
|
+
}
|
|
60
|
+
.blocks-index__section-label {
|
|
61
|
+
font-size: var(--text-lg);
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
margin: 0 0 var(--page-header-margin-bottom);
|
|
64
|
+
color: var(--text);
|
|
65
|
+
}
|
|
66
|
+
.blocks-index__grid {
|
|
67
|
+
display: grid;
|
|
68
|
+
grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
|
|
69
|
+
gap: var(--spacing-6);
|
|
70
|
+
margin: var(--page-header-margin-bottom) 0;
|
|
71
|
+
}
|
|
72
|
+
.block-card-link {
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
color: inherit;
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
height: 100%;
|
|
78
|
+
transition: transform var(--transition-base);
|
|
79
|
+
}
|
|
80
|
+
.block-card-link :global(.card) {
|
|
81
|
+
flex: 1;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
min-height: 0;
|
|
85
|
+
}
|
|
86
|
+
.block-card-link :global(.card .card__body) {
|
|
87
|
+
flex: 1;
|
|
88
|
+
}
|
|
89
|
+
.block-card-link:hover {
|
|
90
|
+
transform: translateY(calc(-1 * var(--spacing-0-125)));
|
|
91
|
+
}
|
|
92
|
+
.block-card-link:hover :global(.card__body h3) {
|
|
93
|
+
color: var(--accent-fg);
|
|
94
|
+
}
|
|
95
|
+
pre {
|
|
96
|
+
background: var(--background-alt);
|
|
97
|
+
border: 1px solid var(--border);
|
|
98
|
+
border-radius: var(--radius-lg);
|
|
99
|
+
padding: var(--spacing-4);
|
|
100
|
+
overflow-x: auto;
|
|
101
|
+
font-size: var(--font-size-sm);
|
|
102
|
+
}
|
|
103
|
+
pre code {
|
|
104
|
+
background: none;
|
|
105
|
+
padding: 0;
|
|
106
|
+
}
|
|
107
|
+
</style>
|