rizzo-css 0.0.77 → 0.0.79
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 +13 -9
- package/package.json +1 -1
- package/scaffold/react/base/package.json +1 -1
- package/scaffold/svelte/FontSwitcher.svelte +1 -1
- package/scaffold/svelte/Navbar.svelte +1 -1
- package/scaffold/svelte/Search.svelte +3 -3
- package/scaffold/svelte/Settings.svelte +9 -7
- package/scaffold/svelte/config/fonts.ts +59 -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.79 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
|
@@ -1855,8 +1855,8 @@ function copySvelteComponents(projectDir, selectedNames, opts) {
|
|
|
1855
1855
|
if (existsSync(join(scaffoldDir, 'themes.ts'))) plan.wouldWrite.push(pathRelative(projectDir, join(targetDir, 'themes.ts')));
|
|
1856
1856
|
if (existsSync(join(scaffoldDir, 'theme.ts'))) plan.wouldWrite.push(pathRelative(projectDir, join(targetDir, 'theme.ts')));
|
|
1857
1857
|
}
|
|
1858
|
-
if (toCopy.includes('Settings') && existsSync(join(
|
|
1859
|
-
plan.wouldWrite.push(pathRelative(projectDir, join(
|
|
1858
|
+
if ((toCopy.includes('Settings') || toCopy.includes('FontSwitcher')) && existsSync(join(scaffoldDir, 'config', 'fonts.ts')))
|
|
1859
|
+
plan.wouldWrite.push(pathRelative(projectDir, join(targetDir, 'config', 'fonts.ts')));
|
|
1860
1860
|
if (toCopy.length > 0) plan.wouldWrite.push(pathRelative(projectDir, join(targetDir, 'index.ts')));
|
|
1861
1861
|
return;
|
|
1862
1862
|
}
|
|
@@ -1879,13 +1879,17 @@ function copySvelteComponents(projectDir, selectedNames, opts) {
|
|
|
1879
1879
|
if (existsSync(themesSrc)) copyFileSync(themesSrc, join(targetDir, 'themes.ts'));
|
|
1880
1880
|
if (existsSync(themeSrc)) copyFileSync(themeSrc, join(targetDir, 'theme.ts'));
|
|
1881
1881
|
}
|
|
1882
|
-
if (toCopy.includes('Settings')) {
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1882
|
+
if (toCopy.includes('Settings') || toCopy.includes('FontSwitcher')) {
|
|
1883
|
+
const svelteConfigSrc = join(scaffoldDir, 'config');
|
|
1884
|
+
if (existsSync(svelteConfigSrc)) {
|
|
1885
|
+
const projectRizzoConfigDir = join(targetDir, 'config');
|
|
1886
|
+
mkdirSync(projectRizzoConfigDir, { recursive: true });
|
|
1887
|
+
const configEntries = readdirSync(svelteConfigSrc, { withFileTypes: true });
|
|
1888
|
+
for (const entry of configEntries) {
|
|
1889
|
+
if (entry.isFile()) {
|
|
1890
|
+
copyFileSync(join(svelteConfigSrc, entry.name), join(projectRizzoConfigDir, entry.name));
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1889
1893
|
}
|
|
1890
1894
|
}
|
|
1891
1895
|
if (exports.length > 0 || copyIconsOnly) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
import ChevronDown from './icons/ChevronDown.svelte';
|
|
4
|
-
import { FONT_PAIRS, FONT_PAIR_DEFAULT } from '
|
|
4
|
+
import { FONT_PAIRS, FONT_PAIR_DEFAULT } from './config/fonts';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
/** Optional prefix for trigger/menu IDs when multiple FontSwitchers exist. */
|
|
@@ -143,9 +143,9 @@
|
|
|
143
143
|
<p class="search__empty-text">Start typing to search…</p>
|
|
144
144
|
</div>
|
|
145
145
|
<div class="search__results-list" role="group" aria-label="Sample results">
|
|
146
|
-
<a href="
|
|
147
|
-
<a href="
|
|
148
|
-
<a href="
|
|
146
|
+
<a href="/docs/getting-started" class="search__result-item" tabindex={open ? 0 : -1}><div class="search__result-category">Docs</div><div class="search__result-title">Getting started</div></a>
|
|
147
|
+
<a href="/docs/components" class="search__result-item" tabindex={open ? 0 : -1}><div class="search__result-category">Docs</div><div class="search__result-title">Components</div></a>
|
|
148
|
+
<a href="/docs/theming" class="search__result-item" tabindex={open ? 0 : -1}><div class="search__result-category">Docs</div><div class="search__result-title">Theming</div></a>
|
|
149
149
|
</div>
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { FONT_PAIRS, FONT_PAIR_DEFAULT } from '
|
|
2
|
+
import { FONT_PAIRS, FONT_PAIR_DEFAULT } from './config/fonts';
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
open?: boolean;
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
let openInternal = $state(false);
|
|
9
9
|
const open = $derived(openProp !== undefined ? openProp : openInternal);
|
|
10
10
|
|
|
11
|
+
const isBrowser = typeof window !== 'undefined' && typeof localStorage?.getItem === 'function';
|
|
11
12
|
let fontSizeLabel = $state('100%');
|
|
12
13
|
let fontSizeSlider = $state(1);
|
|
13
|
-
let fontPairValue = $state(
|
|
14
|
-
let soundEffects = $state(
|
|
15
|
-
let reducedMotion = $state(
|
|
16
|
-
let highContrast = $state(
|
|
17
|
-
let scrollbarStyle = $state((
|
|
14
|
+
let fontPairValue = $state(isBrowser ? localStorage.getItem('fontPair') || FONT_PAIR_DEFAULT : FONT_PAIR_DEFAULT);
|
|
15
|
+
let soundEffects = $state(isBrowser && localStorage.getItem('soundEffects') === 'true');
|
|
16
|
+
let reducedMotion = $state(isBrowser && localStorage.getItem('reducedMotion') === 'true');
|
|
17
|
+
let highContrast = $state(isBrowser && localStorage.getItem('highContrast') === 'true');
|
|
18
|
+
let scrollbarStyle = $state((isBrowser ? localStorage.getItem('scrollbarStyle') || 'thin' : 'thin') as 'thin' | 'thick' | 'hidden');
|
|
18
19
|
|
|
19
20
|
function applyFontSize(scale: number) {
|
|
20
21
|
if (typeof document === 'undefined') return;
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
$effect(() => {
|
|
38
|
+
if (typeof window === 'undefined') return;
|
|
37
39
|
(window as unknown as { openSettings?: () => void }).openSettings = () => {
|
|
38
40
|
openInternal = true;
|
|
39
41
|
};
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
$effect(() => {
|
|
48
|
-
if (!open) return;
|
|
50
|
+
if (typeof document === 'undefined' || !open) return;
|
|
49
51
|
const onEscape = (e: KeyboardEvent) => {
|
|
50
52
|
if (e.key === 'Escape') openInternal = false;
|
|
51
53
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Font pairs (sans + mono) for the Settings font changer.
|
|
3
|
+
* Each option sets both --font-family (body/UI) and --font-family-mono (code blocks, pre, kbd).
|
|
4
|
+
* Used by Settings components and layout flash scripts to apply and persist the chosen pair.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface FontPairEntry {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** CSS value for --font-family (sans stack) */
|
|
11
|
+
sans: string;
|
|
12
|
+
/** CSS value for --font-family-mono */
|
|
13
|
+
mono: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const FONT_PAIR_DEFAULT = 'geist' as const;
|
|
17
|
+
|
|
18
|
+
export const FONT_PAIRS: FontPairEntry[] = [
|
|
19
|
+
{
|
|
20
|
+
value: 'geist',
|
|
21
|
+
label: 'Geist (Sans + Mono)',
|
|
22
|
+
sans: 'var(--font-family-geist-sans)',
|
|
23
|
+
mono: 'var(--font-family-geist-mono)',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: 'inter-jetbrains',
|
|
27
|
+
label: 'Inter + JetBrains Mono',
|
|
28
|
+
sans: 'var(--font-family-inter)',
|
|
29
|
+
mono: 'var(--font-family-jetbrains-mono)',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: 'ibm-plex',
|
|
33
|
+
label: 'IBM Plex Sans + Mono',
|
|
34
|
+
sans: 'var(--font-family-ibm-plex-sans)',
|
|
35
|
+
mono: 'var(--font-family-ibm-plex-mono)',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 'source',
|
|
39
|
+
label: 'Source Sans 3 + Source Code Pro',
|
|
40
|
+
sans: 'var(--font-family-source-sans-3)',
|
|
41
|
+
mono: 'var(--font-family-source-code-pro)',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: 'dm',
|
|
45
|
+
label: 'DM Sans + DM Mono',
|
|
46
|
+
sans: 'var(--font-family-dm-sans)',
|
|
47
|
+
mono: 'var(--font-family-dm-mono)',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 'outfit-jetbrains',
|
|
51
|
+
label: 'Outfit + JetBrains Mono',
|
|
52
|
+
sans: 'var(--font-family-outfit)',
|
|
53
|
+
mono: 'var(--font-family-jetbrains-mono)',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export function getFontPairById(id: string): FontPairEntry | undefined {
|
|
58
|
+
return FONT_PAIRS.find((p) => p.value === id);
|
|
59
|
+
}
|
|
@@ -28,7 +28,7 @@ If you prefer to load CSS from a CDN instead of the local file, replace the `<li
|
|
|
28
28
|
- `<link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />`
|
|
29
29
|
- Or jsDelivr: `https://cdn.jsdelivr.net/npm/rizzo-css@latest/dist/rizzo.min.css`
|
|
30
30
|
|
|
31
|
-
(Replace `@latest` with a specific version, e.g. `@0.0.
|
|
31
|
+
(Replace `@latest` with a specific version, e.g. `@0.0.79`, in production.)
|
|
32
32
|
|
|
33
33
|
The CLI replaces placeholders in `index.html` (e.g. `{{DATA_THEME}}`, `{{TITLE}}`) when you run `rizzo-css init`. The theme selected during init is used on first load when you have no saved preference in the browser.
|
|
34
34
|
|