uifolio 0.5.5 → 0.7.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/README.md CHANGED
@@ -14,6 +14,7 @@ and the alias is rewritten automatically.
14
14
  # from any project, through the npm package
15
15
  npx uifolio@latest add calendar --color "#10B981" --radius 6
16
16
  pnpm dlx uifolio@latest add video-player otp
17
+ pnpm dlx uifolio@latest add horizontal-accordion storytelling
17
18
 
18
19
  # from the root of the project that contains UIfolio
19
20
  npm run uifolio -- list
@@ -31,11 +32,12 @@ node cli/uifolio.mjs add file-upload --alias "#lib" --dry-run # simulate
31
32
  | `uifolio init` | writes `uifolio.json` (dir, lib, alias) in the target project |
32
33
  | `uifolio add <names...>` | copies the component **+ transitive dependencies** (helpers `@/lib/*`) |
33
34
 
34
- Options: `--cwd <dir>`, `--dir <path>` (default `src/components/ui`), `--lib <path>` (default `src/lib`), `--alias <alias>` (default `@`), `--page <path>` (created if missing), `--interactive` (force the questions), `--force` (overwrite), `--dry-run` (simulate), `--color <hex>` and `--radius <px>`.
35
+ Options: `--cwd <dir>`, `--dir <path>` (default `src/components/ui`), `--animations <path>` (default `src/components/animations`), `--lib <path>` (default `src/lib`), `--alias <alias>` (default `@`), `--page <path>` (created if missing), `--interactive` (force the questions), `--force` (overwrite), `--dry-run` (simulate), `--color <hex>` and `--radius <px>`.
35
36
 
36
- `add` does not stop at the copy. The components always land in
37
- `src/components/ui` (override with `--dir`) and the page imports them through
38
- the `@/` alias. Without `--page`, the CLI asks where to use them:
37
+ `add` does not stop at the copy. The components land in
38
+ `src/components/ui` (override with `--dir`), the animations in
39
+ `src/components/animations` (override with `--animations`), and the page imports
40
+ them through the `@/` alias. Without `--page`, the CLI asks where to use them:
39
41
 
40
42
  1. *Do you already have a file ready to receive the component (…component…) (y/N) ?* `yes` → *In which file should the component (…component…) be copied (e.g. src/pages/calendar.tsx) ?*: the import and a ready-to-render example are added without duplication, and the file is created when missing;
41
43
  2. `no` → *Would you like to create a new folder and an import file (Y/n) ?* `yes` → *Please specify the new path (e.g. src/pages/calendar.tsx) ?*: the folder and the file are created; `no` → install only, no file is touched.
@@ -54,15 +56,38 @@ Colors go through **Tailwind CSS 4 tokens**: the CLI writes
54
56
  into the project's global CSS (the one with `@import 'tailwindcss'`). The
55
57
  components therefore keep `bg-primary`, `border-primary/50`, `ring-primary/40`:
56
58
  no hard-coded colors. `--color` changes `--primary` in the theme and `--radius`
57
- adds `--radius` to it. When no global Tailwind CSS is found, the file is written
58
- at the root and the import to add is printed.
59
-
60
- At the end, the CLI prints the detected npm dependencies, for example:
59
+ adds `--radius` to it. The CSS that imports Tailwind is detected wherever it
60
+ lives (`src/index.css`, `src/styles/globals.css`, `app/globals.css`…).
61
+
62
+ Tailwind CSS 4 is required: without it, no utility class exists and the
63
+ components render unstyled. When the target project does not have it (or no CSS
64
+ imports it yet), `add` sets it up before wiring the theme:
65
+
66
+ 1. installs `tailwindcss` (+ `@tailwindcss/vite`) with the package manager of the
67
+ project's lockfile (`npm`, `pnpm`, `yarn` or `bun`);
68
+ 2. creates the CSS entry (`src/index.css`, or `app/globals.css`) with
69
+ `@import 'tailwindcss';`, or prepends the import to the existing one;
70
+ 3. imports that CSS in the app entry (`src/main.tsx`, `app/layout.tsx`…);
71
+ 4. adds the `tailwindcss()` plugin to `vite.config.*`.
72
+
73
+ The installation is skipped by `--dry-run` (the steps are printed instead).
74
+ If the install fails (offline, read-only…), the theme is still written and the
75
+ exact steps to run manually are printed.
76
+
77
+ `add` also installs the npm packages the copied files import (`clsx`,
78
+ `tailwind-merge`, `lucide-react`, `hls.js`…), with the same package manager and
79
+ as runtime dependencies (`dependencies`, not `devDependencies`). Only the ones
80
+ missing from the manifest are installed, `--dry-run` prints the command without
81
+ running it, and a project without `package.json` simply gets the command to run
82
+ itself:
61
83
 
62
84
  ```bash
63
85
  npm install clsx tailwind-merge lucide-react hls.js
64
86
  ```
65
87
 
88
+ Tailwind is handled the same way, as a dev dependency (see above), so it is not
89
+ part of that list.
90
+
66
91
  ### Preview parity
67
92
 
68
93
  The docs preview and the installed component render identically because the page
@@ -91,6 +116,14 @@ only marks the installation as complete when that is relevant.
91
116
  | OtpInput | `src/components/ui/otp-input.tsx` | 4 fields, paste, rotate + success check |
92
117
  | ColorPicker | `src/components/ui/color-picker.tsx` | advanced panel, saturation/lightness, hue, alpha, eyedropper, RGB channels, presets, HEX/RGB/HSL/RGBA |
93
118
  | Table | `src/components/ui/table.tsx` | shadcn-style typed table, uniform `px-4` cells and a wider gap before Actions, select-all checkbox, row actions |
119
+ | HorizontalAccordion | `src/components/animations/horizontal-accordion.tsx` | theme-colored panels, hover, click, arrow/Home/End keyboard |
120
+ | Storytelling | `src/components/animations/horizontal-story.tsx` | vertical scroll driven horizontal story, palettes, mobile touch fallback |
121
+ | StackingCards | `src/components/animations/stacking-cards.tsx` | cards settle on scroll, customizable gradients or solid color |
122
+ | ScrollText | `src/components/animations/scroll-text.tsx` | letters light up with their viewport position, reversible |
123
+ | ImageCrossfade | `src/components/animations/image-crossfade.tsx` | pinned crossfading images, captions, dots and customizable overlay |
124
+
125
+ The animation helpers (`data.ts`, `palette.ts`, `animation-settings-*`, `palette-*`)
126
+ are copied automatically when the installed animation needs them.
94
127
 
95
128
  Copyable helpers (the CLI follows them automatically): `src/lib/utils.ts`,
96
129
  `src/lib/video.ts`, `src/lib/vtt.ts`, `src/lib/date.ts`, `src/lib/uploader.ts`, `src/lib/color.ts`,