rizzo-css 0.0.26 → 0.0.27

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 (30) hide show
  1. package/README.md +1 -1
  2. package/bin/rizzo-css.js +46 -0
  3. package/package.json +1 -1
  4. package/scaffold/vanilla/README-RIZZO.md +1 -1
  5. package/scaffold/vanilla/components/accordion.html +6 -0
  6. package/scaffold/vanilla/components/alert.html +6 -0
  7. package/scaffold/vanilla/components/avatar.html +6 -0
  8. package/scaffold/vanilla/components/badge.html +6 -0
  9. package/scaffold/vanilla/components/breadcrumb.html +6 -0
  10. package/scaffold/vanilla/components/button.html +6 -0
  11. package/scaffold/vanilla/components/cards.html +6 -0
  12. package/scaffold/vanilla/components/copy-to-clipboard.html +6 -0
  13. package/scaffold/vanilla/components/divider.html +6 -0
  14. package/scaffold/vanilla/components/dropdown.html +6 -0
  15. package/scaffold/vanilla/components/forms.html +6 -0
  16. package/scaffold/vanilla/components/icons.html +6 -0
  17. package/scaffold/vanilla/components/index.html +6 -0
  18. package/scaffold/vanilla/components/modal.html +6 -0
  19. package/scaffold/vanilla/components/navbar.html +6 -0
  20. package/scaffold/vanilla/components/pagination.html +6 -0
  21. package/scaffold/vanilla/components/progress-bar.html +6 -0
  22. package/scaffold/vanilla/components/search.html +6 -0
  23. package/scaffold/vanilla/components/settings.html +6 -0
  24. package/scaffold/vanilla/components/spinner.html +6 -0
  25. package/scaffold/vanilla/components/table.html +6 -0
  26. package/scaffold/vanilla/components/tabs.html +6 -0
  27. package/scaffold/vanilla/components/theme-switcher.html +6 -0
  28. package/scaffold/vanilla/components/toast.html +6 -0
  29. package/scaffold/vanilla/components/tooltip.html +6 -0
  30. package/scaffold/vanilla/index.html +6 -0
package/README.md CHANGED
@@ -56,7 +56,7 @@ import 'rizzo-css';
56
56
  **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:
57
57
 
58
58
  ```html
59
- <!-- unpkg (pin version: replace @latest with @0.0.26 or any version) -->
59
+ <!-- unpkg (pin version: replace @latest with @0.0.27 or any version) -->
60
60
  <link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />
61
61
 
62
62
  <!-- or jsDelivr -->
package/bin/rizzo-css.js CHANGED
@@ -271,6 +271,30 @@ function copyPackageLicense(projectDir) {
271
271
  }
272
272
  }
273
273
 
274
+ /** Copy scaffold vanilla .gitignore into project so new vanilla projects have sensible defaults. */
275
+ function copyVanillaGitignore(projectDir) {
276
+ const gitignorePath = join(getPackageRoot(), 'scaffold', 'vanilla', '.gitignore');
277
+ if (existsSync(gitignorePath)) {
278
+ copyFileSync(gitignorePath, join(projectDir, '.gitignore'));
279
+ }
280
+ }
281
+
282
+ /** Copy Astro minimal scaffold .gitignore into project (full and minimal templates). */
283
+ function copyAstroGitignore(projectDir) {
284
+ const gitignorePath = join(getScaffoldAstroMinimalDir(), '.gitignore');
285
+ if (existsSync(gitignorePath)) {
286
+ copyFileSync(gitignorePath, join(projectDir, '.gitignore'));
287
+ }
288
+ }
289
+
290
+ /** Copy Svelte minimal scaffold .gitignore into project (full and minimal templates). */
291
+ function copySvelteGitignore(projectDir) {
292
+ const gitignorePath = join(getScaffoldSvelteMinimalDir(), '.gitignore');
293
+ if (existsSync(gitignorePath)) {
294
+ copyFileSync(gitignorePath, join(projectDir, '.gitignore'));
295
+ }
296
+ }
297
+
274
298
  /** Read rizzo-css.json from cwd. Returns { targetDir?, framework?, packageManager? } or null. */
275
299
  function readRizzoConfig(cwd) {
276
300
  if (!cwd || !existsSync(cwd)) return null;
@@ -985,6 +1009,10 @@ function getScaffoldAstroDir() {
985
1009
  return join(getPackageRoot(), 'scaffold', 'astro');
986
1010
  }
987
1011
 
1012
+ function getScaffoldUtilsDir() {
1013
+ return join(getPackageRoot(), 'scaffold', 'utils');
1014
+ }
1015
+
988
1016
  function getScaffoldVanillaIndex() {
989
1017
  return join(getPackageRoot(), 'scaffold', 'vanilla', 'index.html');
990
1018
  }
@@ -1196,6 +1224,17 @@ function copyAstroComponents(projectDir, selectedNames) {
1196
1224
  if (existsSync(themesSrc)) {
1197
1225
  copyFileSync(themesSrc, join(targetDir, 'themes.ts'));
1198
1226
  }
1227
+ // ThemeSwitcher.astro imports '../utils/theme' -> need src/components/utils/theme.ts in project
1228
+ const utilsDir = getScaffoldUtilsDir();
1229
+ const themeSrc = join(utilsDir, 'theme.ts');
1230
+ if (existsSync(themeSrc)) {
1231
+ const componentsDir = join(projectDir, 'src', 'components');
1232
+ const projectUtilsDir = join(componentsDir, 'utils');
1233
+ mkdirSync(projectUtilsDir, { recursive: true });
1234
+ let themeContent = readFileSync(themeSrc, 'utf8');
1235
+ themeContent = themeContent.replace(/from ['"]\.\.\/astro\/themes['"]/g, "from '../rizzo/themes'");
1236
+ writeFileSync(join(projectUtilsDir, 'theme.ts'), themeContent);
1237
+ }
1199
1238
  }
1200
1239
  if (count > 0 || copyIconsOnly) {
1201
1240
  const msg = copyIconsOnly ? 'Icons' : count + ' Astro components + icons';
@@ -1530,6 +1569,7 @@ async function cmdInit(argv) {
1530
1569
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1531
1570
  }
1532
1571
  copyPackageLicense(projectDir);
1572
+ copyAstroGitignore(projectDir);
1533
1573
  if (componentsToCopy.length > 0) {
1534
1574
  copyRizzoIcons(projectDir, 'astro');
1535
1575
  copyAstroComponents(projectDir, componentsToCopy);
@@ -1543,6 +1583,7 @@ async function cmdInit(argv) {
1543
1583
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1544
1584
  }
1545
1585
  copyPackageLicense(projectDir);
1586
+ copyAstroGitignore(projectDir);
1546
1587
  if (componentsToCopy.length > 0) {
1547
1588
  copyRizzoIcons(projectDir, 'astro');
1548
1589
  copyAstroComponents(projectDir, componentsToCopy);
@@ -1556,6 +1597,7 @@ async function cmdInit(argv) {
1556
1597
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1557
1598
  }
1558
1599
  copyPackageLicense(projectDir);
1600
+ copySvelteGitignore(projectDir);
1559
1601
  if (componentsToCopy.length > 0) {
1560
1602
  copyRizzoIcons(projectDir, 'svelte');
1561
1603
  copySvelteComponents(projectDir, componentsToCopy);
@@ -1569,6 +1611,7 @@ async function cmdInit(argv) {
1569
1611
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1570
1612
  }
1571
1613
  copyPackageLicense(projectDir);
1614
+ copySvelteGitignore(projectDir);
1572
1615
  if (componentsToCopy.length > 0) {
1573
1616
  copyRizzoIcons(projectDir, 'svelte');
1574
1617
  copySvelteComponents(projectDir, componentsToCopy);
@@ -1607,6 +1650,7 @@ async function cmdInit(argv) {
1607
1650
  writeFileSync(join(projectDir, 'js', 'main.js'), mainJs, 'utf8');
1608
1651
  }
1609
1652
  copyPackageLicense(projectDir);
1653
+ copyVanillaGitignore(projectDir);
1610
1654
  } else if (useVanillaMinimal) {
1611
1655
  const cssDir = join(projectDir, pathsForScaffold.targetDir);
1612
1656
  cssTarget = join(cssDir, 'rizzo.min.css');
@@ -1631,6 +1675,7 @@ async function cmdInit(argv) {
1631
1675
  writeFileSync(indexPath, minimalIndexWithScript, 'utf8');
1632
1676
  writeFileSync(join(projectDir, SCAFFOLD_README_FILENAME), VANILLA_MINIMAL_README, 'utf8');
1633
1677
  copyPackageLicense(projectDir);
1678
+ copyVanillaGitignore(projectDir);
1634
1679
  } else {
1635
1680
  if (framework === 'svelte') {
1636
1681
  copyRizzoCssAndFontsForSvelte(projectDir, cssSource);
@@ -1663,6 +1708,7 @@ async function cmdInit(argv) {
1663
1708
  }
1664
1709
  writeFileSync(indexPath, indexContent, 'utf8');
1665
1710
  writeFileSync(join(projectDir, SCAFFOLD_README_FILENAME), VANILLA_MANUAL_README, 'utf8');
1711
+ copyVanillaGitignore(projectDir);
1666
1712
  } else if (framework === 'astro') {
1667
1713
  indexPath = join(projectDir, 'public', 'index.html');
1668
1714
  mkdirSync(join(projectDir, 'public'), { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rizzo-css",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
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.26`, in production.)
16
+ (Replace `@latest` with a specific version, e.g. `@0.0.27`, 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