rizzo-css 0.0.28 → 0.0.29

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.
Files changed (31) hide show
  1. package/README.md +3 -3
  2. package/bin/rizzo-css.js +3 -2
  3. package/package.json +1 -1
  4. package/scaffold/vanilla/README-RIZZO.md +1 -1
  5. package/scaffold/vanilla/components/accordion.html +8 -0
  6. package/scaffold/vanilla/components/alert.html +8 -0
  7. package/scaffold/vanilla/components/avatar.html +8 -0
  8. package/scaffold/vanilla/components/badge.html +8 -0
  9. package/scaffold/vanilla/components/breadcrumb.html +8 -0
  10. package/scaffold/vanilla/components/button.html +8 -0
  11. package/scaffold/vanilla/components/cards.html +8 -0
  12. package/scaffold/vanilla/components/copy-to-clipboard.html +8 -0
  13. package/scaffold/vanilla/components/divider.html +8 -0
  14. package/scaffold/vanilla/components/dropdown.html +8 -0
  15. package/scaffold/vanilla/components/forms.html +8 -0
  16. package/scaffold/vanilla/components/icons.html +8 -0
  17. package/scaffold/vanilla/components/index.html +8 -0
  18. package/scaffold/vanilla/components/modal.html +8 -0
  19. package/scaffold/vanilla/components/navbar.html +8 -0
  20. package/scaffold/vanilla/components/pagination.html +8 -0
  21. package/scaffold/vanilla/components/progress-bar.html +8 -0
  22. package/scaffold/vanilla/components/search.html +8 -0
  23. package/scaffold/vanilla/components/settings.html +8 -0
  24. package/scaffold/vanilla/components/spinner.html +8 -0
  25. package/scaffold/vanilla/components/table.html +8 -0
  26. package/scaffold/vanilla/components/tabs.html +8 -0
  27. package/scaffold/vanilla/components/theme-switcher.html +8 -0
  28. package/scaffold/vanilla/components/toast.html +8 -0
  29. package/scaffold/vanilla/components/tooltip.html +8 -0
  30. package/scaffold/vanilla/index.html +8 -0
  31. package/scaffold/vanilla/js/main.js +33 -0
package/README.md CHANGED
@@ -12,7 +12,7 @@ pnpm add rizzo-css
12
12
  yarn add rizzo-css
13
13
  ```
14
14
 
15
- **Quick start (no install):** `npx rizzo-css init` — choose **framework** (Vanilla, Astro, or Svelte), then **add to existing** or **create new**. **Existing** (or `npx rizzo-css add`) → drop in CSS + hand-pick components; you must add the `<link>` yourself (CLI prints the exact tag). **New** → choose **Full** (everything) | **Minimal** (recommended) | **Manual** (pick components; list shows which add others, e.g. Settings adds ThemeSwitcher), then package manager. Full and Minimal include all required dependencies so every component works. Run `npx rizzo-css help components` for the dependency list. Non-interactive: `npx rizzo-css init --yes --framework vanilla|astro|svelte`. Optional **rizzo-css.json** and `add --install-package`. All get the **same CSS and component styles**. To use the **official Svelte or Astro create command** plus Rizzo, create the app first, then run `npx rizzo-css add`:
15
+ **Quick start (no install):** `npx rizzo-css init` — choose **framework** (Vanilla, Astro, or Svelte), then **add to existing** or **create new**. **Existing** (or `npx rizzo-css add`) → drop in CSS + hand-pick components; you must add the `<link>` yourself (CLI prints the exact tag). **New** → choose **Full** | **Minimal** (recommended) | **Manual** (pick components; list shows which add others, e.g. Navbar adds Search and Settings, Settings adds ThemeSwitcher), then package manager. Full and Minimal include all required dependencies so every component works. Run `npx rizzo-css help components` for the dependency list. Non-interactive: `npx rizzo-css init --yes --framework vanilla|astro|svelte`. Optional **rizzo-css.json** and `add --install-package`. All get the **same CSS and component styles**. To use the **official Svelte or Astro create command** plus Rizzo, create the app first, then run `npx rizzo-css add`:
16
16
 
17
17
  ```bash
18
18
  npm create svelte@latest my-app && cd my-app && npx rizzo-css add
@@ -46,7 +46,7 @@ You install **the same package** for every framework: `npm install rizzo-css`. N
46
46
 
47
47
  With `npx rizzo-css add --path <dir>`, the CLI still suggests the correct href for your framework (e.g. Astro/Svelte get a leading `/` path).
48
48
 
49
- Scaffolds in the package: `scaffold/vanilla/` (Full or Manual), `scaffold/astro-minimal/`, `scaffold/svelte-minimal/`, plus `scaffold/astro/` and `scaffold/svelte/` (component templates for hand-pick). Use `npx rizzo-css init` and choose **Create new project** to get a **Full** or **Manual** scaffold; the stylesheet link is in the layout. **Add to existing** (or `add` command) drops in CSS + hand-pick components; **you must add the stylesheet `<link>` yourself** — the CLI prints the exact tag. Every scaffold includes LICENSE-RIZZO and README-RIZZO.md (does not overwrite your project LICENSE/README); Astro/Svelte minimal include package.json and .env.example.
49
+ Scaffolds in the package: `scaffold/vanilla/` (Full or Manual), `scaffold/astro-minimal/`, `scaffold/svelte-minimal/`, plus `scaffold/astro/` and `scaffold/svelte/` (component templates for hand-pick). Use `npx rizzo-css init` and choose **Create new project** to get a **Full** or **Manual** scaffold; the stylesheet link is in the layout. **Add to existing** (or `add` command) drops in CSS + hand-pick components; **you must add the stylesheet `<link>` yourself** — the CLI prints the exact tag. Every scaffold includes LICENSE-RIZZO, README-RIZZO.md, and .gitignore (does not overwrite your project files); Astro/Svelte minimal include package.json and .env.example.
50
50
 
51
51
  ## Use
52
52
 
@@ -61,7 +61,7 @@ import 'rizzo-css';
61
61
  **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:
62
62
 
63
63
  ```html
64
- <!-- unpkg (pin version: replace @latest with @0.0.28 or any version) -->
64
+ <!-- unpkg (pin version: replace @latest with @0.0.29 or any version) -->
65
65
  <link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />
66
66
 
67
67
  <!-- or jsDelivr -->
package/bin/rizzo-css.js CHANGED
@@ -120,8 +120,8 @@ const VANILLA_JS_COMPONENTS = ['Modal', 'Dropdown', 'Tabs', 'Toast', 'ThemeSwitc
120
120
  // Component dependencies per framework: when user selects a component, these are copied automatically so it works.
121
121
  // Manual users can run: npx rizzo-css help components
122
122
  const COMPONENT_DEPS = {
123
- astro: { Settings: ['ThemeSwitcher'], Toast: ['Alert'] },
124
- svelte: { Settings: ['ThemeSwitcher'], Toast: ['Alert'] },
123
+ astro: { Settings: ['ThemeSwitcher'], Toast: ['Alert'], Navbar: ['Search', 'Settings'] },
124
+ svelte: { Settings: ['ThemeSwitcher'], Toast: ['Alert'], Navbar: ['Search', 'Settings'] },
125
125
  };
126
126
 
127
127
  function getComponentDeps(framework, componentName) {
@@ -872,6 +872,7 @@ Available to pick (Astro & Svelte; same list):
872
872
  ` + line1 + (line2 ? ',\n ' + line2 : '') + (line3 ? ',\n ' + line3 : '') + `
873
873
 
874
874
  Dependencies (when you pick the component on the left, the right is added automatically):
875
+ Navbar → Search, Settings (navbar includes search bar; Settings so gear button works)
875
876
  Settings → ThemeSwitcher (and themes.ts)
876
877
  Toast → Alert
877
878
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rizzo-css",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "scripts": {
5
5
  "prepublishOnly": "cd ../.. && pnpm run lint:css:fix && pnpm run build:css && node scripts/copy-scaffold.js && node scripts/prepare-vanilla-scaffold.js"
6
6
  },
@@ -13,7 +13,7 @@ If you prefer to load CSS from a CDN instead of the local file, replace the `<li
13
13
  - `<link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />`
14
14
  - Or jsDelivr: `https://cdn.jsdelivr.net/npm/rizzo-css@latest/dist/rizzo.min.css`
15
15
 
16
- (Replace `@latest` with a specific version, e.g. `@0.0.28`, in production.)
16
+ (Replace `@latest` with a specific version, e.g. `@0.0.29`, in production.)
17
17
 
18
18
  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.
19
19
 
@@ -731,6 +731,38 @@
731
731
  document.querySelectorAll('[data-accordion]').forEach(initOne);
732
732
  }
733
733
 
734
+ function initNavbarMobile() {
735
+ document.querySelectorAll('.navbar').forEach(function (navbar) {
736
+ var toggle = navbar.querySelector('.navbar__toggle');
737
+ var menu = navbar.querySelector('.navbar__menu');
738
+ if (!toggle || !menu) return;
739
+ function setMenuOpen(open) {
740
+ menu.classList.toggle('navbar__menu--open', open);
741
+ navbar.classList.toggle('navbar--menu-open', open);
742
+ toggle.setAttribute('aria-expanded', open ? 'true' : 'false');
743
+ menu.setAttribute('aria-hidden', open ? 'false' : 'true');
744
+ }
745
+ toggle.addEventListener('click', function () {
746
+ setMenuOpen(!menu.classList.contains('navbar__menu--open'));
747
+ });
748
+ menu.querySelectorAll('.navbar__link').forEach(function (link) {
749
+ link.addEventListener('click', function () { setMenuOpen(false); });
750
+ });
751
+ });
752
+ document.addEventListener('keydown', function (e) {
753
+ if (e.key === 'Escape') {
754
+ document.querySelectorAll('.navbar__menu.navbar__menu--open').forEach(function (menu) {
755
+ var navbar = menu.closest('.navbar');
756
+ var toggle = navbar && navbar.querySelector('.navbar__toggle');
757
+ menu.classList.remove('navbar__menu--open');
758
+ navbar.classList.remove('navbar--menu-open');
759
+ if (toggle) toggle.setAttribute('aria-expanded', 'false');
760
+ menu.setAttribute('aria-hidden', 'true');
761
+ });
762
+ }
763
+ });
764
+ }
765
+
734
766
  function run() {
735
767
  initTheme();
736
768
  initSettings();
@@ -738,6 +770,7 @@
738
770
  initModals();
739
771
  initDropdowns();
740
772
  initAccordions();
773
+ initNavbarMobile();
741
774
  }
742
775
 
743
776
  if (document.readyState === 'loading') {