@smart-coder-labs/apple-design-system 1.3.0 → 1.3.2
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 +216 -319
- package/dist/cli/commands/rollback.d.ts +2 -0
- package/dist/cli/commands/rollback.d.ts.map +1 -0
- package/dist/cli/commands/rollback.js +32 -0
- package/dist/cli/commands/rollback.js.map +1 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +105 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/index.js +13 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/utils/config.d.ts +7 -1
- package/dist/cli/utils/config.d.ts.map +1 -1
- package/dist/cli/utils/config.js +12 -2
- package/dist/cli/utils/config.js.map +1 -1
- package/dist/cli/utils/registry.d.ts +17 -0
- package/dist/cli/utils/registry.d.ts.map +1 -1
- package/dist/cli/utils/registry.js +59 -0
- package/dist/cli/utils/registry.js.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Apple Creative Design System
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**A comprehensive design system inspired by macOS, iOS, and VisionOS**
|
|
6
6
|
|
|
7
|
-
*
|
|
8
|
-
<br>
|
|
9
|
-
*✨ Creado con Inteligencia Artificial ✨*
|
|
7
|
+
*Built with Framer Motion + Radix UI + Tailwind CSS*
|
|
10
8
|
|
|
11
9
|
[](https://www.typescriptlang.org/)
|
|
12
|
-
[](https://reactjs.org/)
|
|
13
11
|
[](https://www.framer.com/motion/)
|
|
14
|
-
[](https://tailwindcss.com/)
|
|
15
13
|
[](https://www.npmjs.com/package/@smart-coder-labs/apple-design-system)
|
|
16
14
|
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
15
|
+
[Installation](#installation) •
|
|
16
|
+
[CLI](#cli) •
|
|
17
|
+
[Components](#components) •
|
|
18
|
+
[Versioning](#component-versioning) •
|
|
19
|
+
[Storybook](https://smart-coder-labs.github.io/design-system/)
|
|
22
20
|
|
|
23
21
|
</div>
|
|
24
22
|
|
|
25
23
|
---
|
|
26
24
|
|
|
27
|
-
##
|
|
25
|
+
## Installation
|
|
28
26
|
|
|
29
27
|
```bash
|
|
30
28
|
npm install -D @smart-coder-labs/apple-design-system
|
|
@@ -32,421 +30,320 @@ npm install -D @smart-coder-labs/apple-design-system
|
|
|
32
30
|
|
|
33
31
|
---
|
|
34
32
|
|
|
35
|
-
##
|
|
33
|
+
## CLI
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
The design system ships with a CLI inspired by shadcn/ui — it copies component source code directly into your project instead of importing a black-box package. You own the code.
|
|
38
36
|
|
|
39
37
|
### `init`
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
Detects your framework automatically and sets up `design-system.json`.
|
|
42
40
|
|
|
43
41
|
```bash
|
|
44
42
|
npx @smart-coder-labs/apple-design-system init
|
|
45
43
|
```
|
|
46
44
|
|
|
47
|
-
### `add`
|
|
48
|
-
|
|
49
|
-
Añade componentes individuales a tu proyecto. La CLI descargará el código fuente más reciente directamente desde el repositorio.
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npx @smart-coder-labs/apple-design-system add Button Card
|
|
53
45
|
```
|
|
46
|
+
Apple Design System — Initialization
|
|
54
47
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
2. Instala automáticamente las dependencias necesarias (`framer-motion`, `radix-ui`, etc.) solo para ese componente.
|
|
48
|
+
Detected framework: Next.js (App Router — RSC enabled)
|
|
49
|
+
Is this correct? › Yes
|
|
58
50
|
|
|
59
|
-
|
|
51
|
+
Where to install components? › ./src/components/ui
|
|
52
|
+
Global CSS file path? › ./src/index.css
|
|
53
|
+
Install required dependencies now? › Yes
|
|
54
|
+
```
|
|
60
55
|
|
|
61
|
-
|
|
56
|
+
**Supported frameworks:** Next.js (App Router and Pages Router), Vite, Astro, Remix / React Router.
|
|
62
57
|
|
|
63
|
-
|
|
58
|
+
Configuration is saved to `design-system.json`:
|
|
64
59
|
|
|
65
|
-
```
|
|
66
|
-
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"framework": "next",
|
|
63
|
+
"rsc": true,
|
|
64
|
+
"componentsDir": "./src/components/ui",
|
|
65
|
+
"globalCss": "./src/index.css",
|
|
66
|
+
"components": {}
|
|
67
|
+
}
|
|
67
68
|
```
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
2. Te pregunta antes de sobrescribir cualquier archivo.
|
|
70
|
+
> **`rsc: true`** — Next.js App Router. Components keep `'use client'`.
|
|
71
|
+
> **`rsc: false`** — Vite, Astro, Remix, Pages Router. `'use client'` is stripped automatically.
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
### `add`
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
- 🌓 **Dark Mode Completo** - Soporte automático para modo oscuro
|
|
79
|
-
- ⚡ **Animaciones Fluidas** - Springs suaves y transiciones elegantes con Framer Motion
|
|
80
|
-
- ♿ **Accesibilidad** - Componentes accesibles y semánticos
|
|
81
|
-
- 🎯 **TypeScript** - Completamente tipado
|
|
82
|
-
- 📱 **Responsive** - Diseñado para todos los dispositivos
|
|
83
|
-
- 🎭 **Personalizable** - Tokens configurables fácilmente
|
|
77
|
+
Adds one or more components. Resolves inter-component dependencies automatically.
|
|
84
78
|
|
|
85
|
-
|
|
79
|
+
```bash
|
|
80
|
+
npx @smart-coder-labs/apple-design-system add Button Card
|
|
81
|
+
```
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
| **Calendar** | Calendario completo | React Day Picker |
|
|
109
|
-
| **DataGrid** | Tabla avanzada con filtros | TanStack Table |
|
|
110
|
-
| **Kanban** | Tablero Trello-like | Dnd Kit |
|
|
111
|
-
| **Sheet** | Panel lateral deslizante | Framer Motion |
|
|
112
|
-
| **Command** | Menú de comandos (CMD+K) | CMDK |
|
|
113
|
-
| **Popover** | Contenido flotante | Framer Motion |
|
|
114
|
-
| **Toast** | Notificaciones tostada | Sonner |
|
|
115
|
-
|
|
116
|
-
### 🎨 Tokens Completos
|
|
117
|
-
|
|
118
|
-
- ✅ Colores (light/dark)
|
|
119
|
-
- ✅ Tipografía
|
|
120
|
-
- ✅ Espaciado
|
|
121
|
-
- ✅ Border Radius
|
|
122
|
-
- ✅ Sombras
|
|
123
|
-
- ✅ Blur
|
|
124
|
-
- ✅ Animaciones
|
|
125
|
-
- ✅ Breakpoints
|
|
126
|
-
|
|
127
|
-
### 📚 Documentación Extensa
|
|
128
|
-
|
|
129
|
-
- ✅ README completo
|
|
130
|
-
- ✅ Guía de inicio rápido
|
|
131
|
-
- ✅ Decisiones de diseño explicadas
|
|
132
|
-
- ✅ 50+ ejemplos de código
|
|
133
|
-
- ✅ Estructura del proyecto
|
|
134
|
-
- ✅ Índice general
|
|
83
|
+
Running without arguments opens an interactive selector (install all or pick specific ones).
|
|
84
|
+
|
|
85
|
+
After install, `design-system.json` tracks each component with its version and full history:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"components": {
|
|
90
|
+
"Button": {
|
|
91
|
+
"version": "1.1.0",
|
|
92
|
+
"status": "stable",
|
|
93
|
+
"type": "folder",
|
|
94
|
+
"installedAt": "2025-05-10T12:00:00.000Z",
|
|
95
|
+
"updatedAt": "2025-05-17T09:30:00.000Z",
|
|
96
|
+
"history": [
|
|
97
|
+
{ "version": "1.0.0", "action": "install", "date": "2025-05-10T12:00:00.000Z" },
|
|
98
|
+
{ "version": "1.1.0", "action": "update", "date": "2025-05-17T09:30:00.000Z" }
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
135
104
|
|
|
136
105
|
---
|
|
137
106
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
### 1. Inicializar el proyecto
|
|
107
|
+
### `update`
|
|
141
108
|
|
|
142
|
-
|
|
109
|
+
Updates installed components to the latest version from the registry.
|
|
143
110
|
|
|
144
111
|
```bash
|
|
145
|
-
npx @smart-coder-labs/apple-design-system
|
|
112
|
+
npx @smart-coder-labs/apple-design-system update
|
|
113
|
+
npx @smart-coder-labs/apple-design-system update Button Card
|
|
146
114
|
```
|
|
147
115
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
### 2. Usar en tu proyecto
|
|
116
|
+
---
|
|
151
117
|
|
|
152
|
-
|
|
153
|
-
npx @smart-coder-labs/apple-design-system add Button
|
|
154
|
-
```
|
|
118
|
+
### `rollback`
|
|
155
119
|
|
|
156
|
-
|
|
157
|
-
import { Button } from "@/components/ui/Button";
|
|
120
|
+
Rolls back a component to any previously published version. Uses the exact git SHA recorded in the registry — no manual tagging required.
|
|
158
121
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<Button variant="primary">Submit</Button>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
122
|
+
```bash
|
|
123
|
+
npx @smart-coder-labs/apple-design-system rollback Button 1.0.0
|
|
164
124
|
```
|
|
165
125
|
|
|
166
|
-
|
|
126
|
+
The CLI reads the version history from the registry, finds the git SHA for that version, and fetches the component files from that specific commit.
|
|
167
127
|
|
|
168
128
|
---
|
|
169
129
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
### Button
|
|
173
|
-
|
|
174
|
-
```tsx
|
|
175
|
-
<Button variant="primary" size="md">
|
|
176
|
-
Click me
|
|
177
|
-
</Button>
|
|
178
|
-
```
|
|
130
|
+
### `status`
|
|
179
131
|
|
|
180
|
-
|
|
181
|
-
**Tamaños:** `sm` | `md` | `lg`
|
|
182
|
-
**Estados:** `loading` | `disabled`
|
|
132
|
+
Shows installed components, their versions, and whether they are outdated.
|
|
183
133
|
|
|
184
|
-
|
|
134
|
+
```bash
|
|
135
|
+
# Overview table for all tracked components
|
|
136
|
+
npx @smart-coder-labs/apple-design-system status
|
|
185
137
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<CardHeader>
|
|
189
|
-
<CardTitle>Title</CardTitle>
|
|
190
|
-
</CardHeader>
|
|
191
|
-
<CardContent>Content</CardContent>
|
|
192
|
-
</Card>
|
|
138
|
+
# Full detail for one component
|
|
139
|
+
npx @smart-coder-labs/apple-design-system status Button
|
|
193
140
|
```
|
|
194
141
|
|
|
195
|
-
**
|
|
196
|
-
|
|
197
|
-
### Modal
|
|
198
|
-
|
|
199
|
-
```tsx
|
|
200
|
-
<Modal open={open} onOpenChange={setOpen}>
|
|
201
|
-
<ModalHeader>
|
|
202
|
-
<ModalTitle>Title</ModalTitle>
|
|
203
|
-
</ModalHeader>
|
|
204
|
-
<ModalContent>Content</ModalContent>
|
|
205
|
-
</Modal>
|
|
142
|
+
**Table output:**
|
|
206
143
|
```
|
|
144
|
+
Registry version: 1.3.1
|
|
207
145
|
|
|
208
|
-
|
|
146
|
+
Component Installed Latest Status Outdated
|
|
147
|
+
────────────────────────────────────────────────────────────────────────────────────
|
|
148
|
+
Button 1.0.0 1.1.0 stable yes
|
|
149
|
+
Card 1.1.0 1.1.0 stable no
|
|
150
|
+
AnimatedCounter 1.0.0 1.0.0 beta no
|
|
151
|
+
```
|
|
209
152
|
|
|
210
|
-
**
|
|
153
|
+
**Detail output:**
|
|
154
|
+
```
|
|
155
|
+
Button
|
|
156
|
+
Installed version : 1.0.0
|
|
157
|
+
Registry version : 1.1.0
|
|
158
|
+
Status : stable
|
|
159
|
+
Installed at : 2025-05-10T12:00:00.000Z
|
|
160
|
+
Last updated : 2025-05-10T12:00:00.000Z
|
|
161
|
+
History:
|
|
162
|
+
install v1.0.0 2025-05-10T12:00:00.000Z
|
|
163
|
+
```
|
|
211
164
|
|
|
212
165
|
---
|
|
213
166
|
|
|
214
|
-
##
|
|
215
|
-
|
|
216
|
-
Explora nuestra demostración interactiva de Storybook con una Landing Page completa construida con nuestro Sistema de Diseño. Experimenta el cambio de modo oscuro, diseño responsivo y varios componentes de UI en acción.
|
|
167
|
+
## Component Architecture
|
|
217
168
|
|
|
218
|
-
|
|
169
|
+
Each component lives in its own folder under `components/ui/`:
|
|
219
170
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
171
|
+
```
|
|
172
|
+
components/ui/
|
|
173
|
+
└── Button/
|
|
174
|
+
├── Button.tsx # Component implementation
|
|
175
|
+
├── Button.types.ts # TypeScript interfaces and types
|
|
176
|
+
├── Button.styles.ts # Tailwind variant definitions
|
|
177
|
+
├── index.ts # Barrel export
|
|
178
|
+
└── CHANGELOG.md # Per-component changelog
|
|
179
|
+
```
|
|
225
180
|
|
|
226
|
-
|
|
181
|
+
This structure means:
|
|
182
|
+
- You import from `@/components/ui/Button` — clean, no deep paths
|
|
183
|
+
- Each file has a single responsibility
|
|
184
|
+
- Types are co-located and always up to date
|
|
185
|
+
- You can edit any piece without touching the others
|
|
227
186
|
|
|
228
187
|
---
|
|
229
188
|
|
|
230
|
-
##
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
189
|
+
## Component Versioning
|
|
190
|
+
|
|
191
|
+
Each component in the registry is versioned independently from the CLI package. A change to `Button` only bumps `Button`'s version — untouched components stay at their current version.
|
|
192
|
+
|
|
193
|
+
### Registry schema
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"Button": {
|
|
198
|
+
"version": "1.1.0",
|
|
199
|
+
"status": "stable",
|
|
200
|
+
"added": "1.0.0",
|
|
201
|
+
"breakingChanges": [],
|
|
202
|
+
"history": [
|
|
203
|
+
{ "version": "1.0.0", "sha": "abc123f", "files": ["Button.tsx", "Button.types.ts", "Button.styles.ts", "index.ts"] },
|
|
204
|
+
{ "version": "1.1.0", "sha": "d9f3a12", "files": ["Button.tsx", "Button.types.ts", "Button.styles.ts", "index.ts"] }
|
|
205
|
+
],
|
|
206
|
+
"dependencies": ["framer-motion"],
|
|
207
|
+
"files": [...]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
241
211
|
|
|
242
|
-
|
|
212
|
+
### Stability tags
|
|
243
213
|
|
|
244
|
-
|
|
214
|
+
| Status | Meaning |
|
|
215
|
+
|--------|---------|
|
|
216
|
+
| `stable` | Production-ready. Breaking changes are documented. |
|
|
217
|
+
| `beta` | Functional but API may have minor changes. |
|
|
218
|
+
| `experimental` | New feature under active development. |
|
|
245
219
|
|
|
246
|
-
###
|
|
247
|
-
- Espacio negativo amplio
|
|
248
|
-
- Elementos esenciales solamente
|
|
249
|
-
- Sin decoraciones innecesarias
|
|
220
|
+
### Automatic version bumps
|
|
250
221
|
|
|
251
|
-
|
|
252
|
-
- Bordes suaves (12-20px)
|
|
253
|
-
- Sombras sutiles
|
|
254
|
-
- Transiciones fluidas (160-260ms)
|
|
222
|
+
The registry is updated automatically on every push to `main` via GitHub Actions. The bump type is derived from the commit message using [Conventional Commits](https://www.conventionalcommits.org/):
|
|
255
223
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
224
|
+
| Commit type | Bump |
|
|
225
|
+
|-------------|------|
|
|
226
|
+
| `fix:`, `chore:`, `refactor:` | patch — `1.0.0 → 1.0.1` |
|
|
227
|
+
| `feat:` | minor — `1.0.0 → 1.1.0` |
|
|
228
|
+
| `feat!:` or `BREAKING CHANGE` in body | major — `1.0.0 → 2.0.0` |
|
|
260
229
|
|
|
261
|
-
|
|
230
|
+
Only components whose files changed in that commit are bumped.
|
|
262
231
|
|
|
263
232
|
---
|
|
264
233
|
|
|
265
|
-
##
|
|
234
|
+
## Quick Start
|
|
266
235
|
|
|
267
|
-
```
|
|
268
|
-
|
|
236
|
+
```bash
|
|
237
|
+
# 1. Initialize your project
|
|
238
|
+
npx @smart-coder-labs/apple-design-system init
|
|
269
239
|
|
|
270
|
-
|
|
240
|
+
# 2. Add components
|
|
241
|
+
npx @smart-coder-labs/apple-design-system add Button Card Modal
|
|
271
242
|
|
|
272
|
-
|
|
273
|
-
document.documentElement.classList.toggle('dark', darkMode);
|
|
274
|
-
}, [darkMode]);
|
|
275
|
-
|
|
276
|
-
<Switch
|
|
277
|
-
checked={darkMode}
|
|
278
|
-
onCheckedChange={setDarkMode}
|
|
279
|
-
label="Dark Mode"
|
|
280
|
-
/>
|
|
243
|
+
# 3. Use them
|
|
281
244
|
```
|
|
282
245
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
### Modificar colores
|
|
288
|
-
|
|
289
|
-
```typescript
|
|
290
|
-
import { tokens } from '@smart-coder-labs/apple-design-system';
|
|
246
|
+
```tsx
|
|
247
|
+
import { Button } from "@/components/ui/Button";
|
|
248
|
+
import { Card, CardHeader, CardContent } from "@/components/ui/Card";
|
|
291
249
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
},
|
|
303
|
-
};
|
|
250
|
+
function App() {
|
|
251
|
+
return (
|
|
252
|
+
<Card variant="glass" hoverable>
|
|
253
|
+
<CardHeader>Getting started</CardHeader>
|
|
254
|
+
<CardContent>
|
|
255
|
+
<Button variant="primary">Click me</Button>
|
|
256
|
+
</CardContent>
|
|
257
|
+
</Card>
|
|
258
|
+
);
|
|
259
|
+
}
|
|
304
260
|
```
|
|
305
261
|
|
|
306
|
-
**[🔧 Ver guía completa →](./README.md#personalización)**
|
|
307
|
-
|
|
308
262
|
---
|
|
309
263
|
|
|
310
|
-
##
|
|
264
|
+
## Components
|
|
311
265
|
|
|
312
|
-
|
|
313
|
-
📁 Archivos: 150+
|
|
314
|
-
📝 Líneas de código: 10,000+
|
|
315
|
-
🧩 Componentes: 50+
|
|
316
|
-
🎨 Tokens: 100+
|
|
317
|
-
📖 Documentación: 7 archivos
|
|
318
|
-
```
|
|
266
|
+
214 components across all UI categories. A few highlights:
|
|
319
267
|
|
|
320
|
-
|
|
268
|
+
| Component | Description | Notes |
|
|
269
|
+
|-----------|-------------|-------|
|
|
270
|
+
| **Button** | Animated buttons | 4 variants, loading state |
|
|
271
|
+
| **Card** | Glass and elevated cards | Compound component |
|
|
272
|
+
| **Modal** | VisionOS-style dialogs | Backdrop blur, spring animation |
|
|
273
|
+
| **DataGrid** | Advanced table with filters | TanStack Table |
|
|
274
|
+
| **Command** | CMD+K command palette | CMDK |
|
|
275
|
+
| **Kanban** | Drag-and-drop board | Dnd Kit |
|
|
276
|
+
| **Calendar** | Full calendar | React Day Picker |
|
|
277
|
+
| **SearchInput** | Search with dropdown | Compound component |
|
|
278
|
+
| **Tabs** | iOS segmented control | Framer Motion |
|
|
279
|
+
| **Switch** | iOS toggle with spring | Framer Motion |
|
|
321
280
|
|
|
322
|
-
|
|
281
|
+
All 214 components are documented in Storybook with interactive examples.
|
|
323
282
|
|
|
324
|
-
|
|
325
|
-
- **TypeScript** 5+ - Type Safety
|
|
326
|
-
- **Framer Motion** 12+ - Animaciones
|
|
327
|
-
- **Tailwind CSS** 4+ - Estilos
|
|
328
|
-
- **PostCSS** - Procesamiento CSS
|
|
283
|
+
**[View all components in Storybook →](https://smart-coder-labs.github.io/design-system/)**
|
|
329
284
|
|
|
330
285
|
---
|
|
331
286
|
|
|
332
|
-
##
|
|
287
|
+
## Tailwind Setup
|
|
333
288
|
|
|
334
|
-
|
|
335
|
-
✅ Navegación por teclado
|
|
336
|
-
✅ Focus visible
|
|
337
|
-
✅ ARIA labels
|
|
338
|
-
✅ Touch targets 40x40px
|
|
339
|
-
✅ Screen reader friendly
|
|
289
|
+
The package exports a Tailwind preset that must be included in consuming projects:
|
|
340
290
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
Todos los componentes son responsive por defecto.
|
|
291
|
+
```js
|
|
292
|
+
// tailwind.config.js
|
|
293
|
+
import preset from '@smart-coder-labs/apple-design-system/tailwind.preset';
|
|
346
294
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
-
|
|
352
|
-
|
|
295
|
+
export default {
|
|
296
|
+
presets: [preset],
|
|
297
|
+
content: [
|
|
298
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
299
|
+
'./node_modules/@smart-coder-labs/apple-design-system/dist/**/*.js',
|
|
300
|
+
],
|
|
301
|
+
};
|
|
302
|
+
```
|
|
353
303
|
|
|
354
304
|
---
|
|
355
305
|
|
|
356
|
-
##
|
|
357
|
-
|
|
358
|
-
- ✅ Aplicaciones web premium
|
|
359
|
-
- ✅ Dashboards administrativos
|
|
360
|
-
- ✅ Landing pages elegantes
|
|
361
|
-
- ✅ Aplicaciones SaaS
|
|
362
|
-
- ✅ Portfolios profesionales
|
|
363
|
-
- ✅ E-commerce moderno
|
|
306
|
+
## Dark Mode
|
|
364
307
|
|
|
365
|
-
|
|
308
|
+
```tsx
|
|
309
|
+
const [dark, setDark] = useState(false);
|
|
366
310
|
|
|
367
|
-
|
|
311
|
+
useEffect(() => {
|
|
312
|
+
document.documentElement.classList.toggle('dark', dark);
|
|
313
|
+
}, [dark]);
|
|
368
314
|
|
|
315
|
+
<Switch checked={dark} onCheckedChange={setDark} label="Dark Mode" />
|
|
369
316
|
```
|
|
370
|
-
apple-design-system/
|
|
371
|
-
├── 📄 Documentación (7 archivos)
|
|
372
|
-
├── 🎨 Configuración (tokens, tailwind, globals)
|
|
373
|
-
├── 🧩 Componentes (10 componentes)
|
|
374
|
-
├── 📦 Package.json
|
|
375
|
-
└── 🎬 DemoPage.tsx
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
**[📂 Ver estructura completa →](./PROJECT_STRUCTURE.md)**
|
|
379
|
-
|
|
380
|
-
---
|
|
381
317
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
1. **[📖 Lee el índice](./INDEX.md)** - Vista general
|
|
385
|
-
2. **[🚀 Instalación rápida](./QUICKSTART.md)** - 5 minutos
|
|
386
|
-
3. **[📖 Copia ejemplos](./EXAMPLES.md)** - Código listo
|
|
387
|
-
4. **[🎨 Personaliza](./README.md)** - Hazlo tuyo
|
|
388
|
-
5. **[🎬 Ve la demo](./DemoPage.tsx)** - Inspiración
|
|
318
|
+
All components adapt automatically via Tailwind's `dark:` classes and design tokens.
|
|
389
319
|
|
|
390
320
|
---
|
|
391
321
|
|
|
392
|
-
##
|
|
393
|
-
|
|
394
|
-
Este design system está inspirado en:
|
|
322
|
+
## Accessibility
|
|
395
323
|
|
|
396
|
-
-
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
-
|
|
324
|
+
- WCAG 2.1 AA
|
|
325
|
+
- Full keyboard navigation
|
|
326
|
+
- Visible focus indicators
|
|
327
|
+
- ARIA labels throughout
|
|
328
|
+
- Touch targets 40×40px minimum
|
|
329
|
+
- Built on Radix UI primitives
|
|
400
330
|
|
|
401
331
|
---
|
|
402
332
|
|
|
403
|
-
##
|
|
333
|
+
## Migration
|
|
404
334
|
|
|
405
|
-
###
|
|
335
|
+
### From v1.0.2 or earlier
|
|
406
336
|
|
|
407
|
-
|
|
337
|
+
From **v1.0.3**, the Tailwind preset is required. Update your config as shown in [Tailwind Setup](#tailwind-setup) and reinstall:
|
|
408
338
|
|
|
409
339
|
```bash
|
|
410
340
|
npm install -D @smart-coder-labs/apple-design-system@latest
|
|
411
341
|
```
|
|
412
342
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
```javascript
|
|
416
|
-
import preset from '@smart-coder-labs/apple-design-system/tailwind.preset';
|
|
417
|
-
|
|
418
|
-
export default {
|
|
419
|
-
presets: [preset],
|
|
420
|
-
content: [
|
|
421
|
-
'./src/**/*.{js,ts,jsx,tsx}',
|
|
422
|
-
'./node_modules/@smart-coder-labs/apple-design-system/**/*.{js,ts,jsx,tsx}',
|
|
423
|
-
],
|
|
424
|
-
};
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
**[📖 Ver guía completa de migración →](./MIGRATION.md)**
|
|
343
|
+
**[Full migration guide →](./MIGRATION.md)**
|
|
428
344
|
|
|
429
345
|
---
|
|
430
346
|
|
|
431
|
-
##
|
|
347
|
+
## License
|
|
432
348
|
|
|
433
349
|
MIT © 2025
|
|
434
|
-
|
|
435
|
-
---
|
|
436
|
-
|
|
437
|
-
## 🙏 Agradecimientos
|
|
438
|
-
|
|
439
|
-
Construido con:
|
|
440
|
-
- [Framer Motion](https://www.framer.com/motion/)
|
|
441
|
-
- [Tailwind CSS](https://tailwindcss.com/)
|
|
442
|
-
- [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/)
|
|
443
|
-
|
|
444
|
-
---
|
|
445
|
-
|
|
446
|
-
<div align="center">
|
|
447
|
-
|
|
448
|
-
**Hecho con ❤️ e IA inspirado en Apple**
|
|
449
|
-
|
|
450
|
-
[⬆ Volver arriba](#-apple-creative-design-system)
|
|
451
|
-
|
|
452
|
-
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollback.d.ts","sourceRoot":"","sources":["../../../cli/commands/rollback.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,GAAU,WAAW,MAAM,EAAE,SAAS,MAAM,kBA2BhE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.rollback = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const ora_1 = __importDefault(require("ora"));
|
|
11
|
+
const registry_1 = require("../utils/registry");
|
|
12
|
+
const config_1 = require("../utils/config");
|
|
13
|
+
const rollback = async (component, version) => {
|
|
14
|
+
const config = await (0, config_1.loadConfig)();
|
|
15
|
+
const spinner = (0, ora_1.default)(`Fetching component ${component}@${version}...`).start();
|
|
16
|
+
const files = await (0, registry_1.getComponentFilesAtVersion)(component, version);
|
|
17
|
+
if (!files) {
|
|
18
|
+
spinner.fail(`Version ${version} of ${component} not found. Make sure that version exists as a git tag (v${version}).`);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const componentDir = path_1.default.resolve(process.cwd(), config.componentsDir, component);
|
|
22
|
+
await fs_extra_1.default.ensureDir(componentDir);
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
const content = config.rsc ? file.content : (0, config_1.stripUseClient)(file.content);
|
|
25
|
+
await fs_extra_1.default.writeFile(path_1.default.join(componentDir, file.name), content);
|
|
26
|
+
}
|
|
27
|
+
await (0, config_1.recordInstall)(config, component, version, "folder", "rollback");
|
|
28
|
+
await (0, config_1.saveConfig)(config);
|
|
29
|
+
spinner.succeed(chalk_1.default.green(`Rolled back ${component} to v${version}`));
|
|
30
|
+
};
|
|
31
|
+
exports.rollback = rollback;
|
|
32
|
+
//# sourceMappingURL=rollback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollback.js","sourceRoot":"","sources":["../../../cli/commands/rollback.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,wDAA0B;AAC1B,kDAA0B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EAAE,CAAC,CACvD,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,QAAQ,YA2BnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../cli/commands/status.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,GAAU,YAAY,MAAM,kBAqG9C,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.status = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const config_1 = require("../utils/config");
|
|
9
|
+
const registry_1 = require("../utils/registry");
|
|
10
|
+
const status = async (component) => {
|
|
11
|
+
const config = await (0, config_1.loadConfig)();
|
|
12
|
+
const tracked = config.components;
|
|
13
|
+
if (Object.keys(tracked).length === 0) {
|
|
14
|
+
console.log(chalk_1.default.yellow("No components tracked in design-system.json."));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (component) {
|
|
18
|
+
// Single component detail view
|
|
19
|
+
const record = tracked[component];
|
|
20
|
+
if (!record) {
|
|
21
|
+
console.log(chalk_1.default.red(`Component '${component}' is not tracked in design-system.json.`));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const meta = await (0, registry_1.getComponentMeta)(component);
|
|
25
|
+
console.log();
|
|
26
|
+
console.log(chalk_1.default.bold(`${component}`));
|
|
27
|
+
console.log(` Installed version : ${chalk_1.default.cyan(record.version)}`);
|
|
28
|
+
console.log(` Registry version : ${meta ? chalk_1.default.cyan(meta.version) : chalk_1.default.gray("unknown")}`);
|
|
29
|
+
console.log(` Status : ${formatStatus(record.status)}`);
|
|
30
|
+
console.log(` Type : ${record.type}`);
|
|
31
|
+
console.log(` Installed at : ${record.installedAt}`);
|
|
32
|
+
console.log(` Last updated : ${record.updatedAt}`);
|
|
33
|
+
if (meta?.breakingChanges && meta.breakingChanges.length > 0) {
|
|
34
|
+
console.log(` Breaking changes :`);
|
|
35
|
+
for (const bc of meta.breakingChanges) {
|
|
36
|
+
console.log(` - ${chalk_1.default.yellow(bc)}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (record.history && record.history.length > 0) {
|
|
40
|
+
console.log(` History:`);
|
|
41
|
+
for (const entry of record.history) {
|
|
42
|
+
const actionColor = entry.action === "rollback"
|
|
43
|
+
? chalk_1.default.yellow
|
|
44
|
+
: entry.action === "install"
|
|
45
|
+
? chalk_1.default.green
|
|
46
|
+
: chalk_1.default.blue;
|
|
47
|
+
console.log(` ${actionColor(entry.action.padEnd(8))} v${entry.version} ${chalk_1.default.gray(entry.date)}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
console.log();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// Table view for all tracked components
|
|
54
|
+
const registryVersion = await (0, registry_1.getRegistryVersion)();
|
|
55
|
+
// Fetch registry meta for all components at once
|
|
56
|
+
const metaMap = new Map();
|
|
57
|
+
await Promise.all(Object.keys(tracked).map(async (name) => {
|
|
58
|
+
const meta = await (0, registry_1.getComponentMeta)(name);
|
|
59
|
+
metaMap.set(name, meta);
|
|
60
|
+
}));
|
|
61
|
+
console.log();
|
|
62
|
+
console.log(chalk_1.default.bold(`Registry version: ${chalk_1.default.cyan(registryVersion)}`));
|
|
63
|
+
console.log();
|
|
64
|
+
// Header
|
|
65
|
+
const nameW = 36;
|
|
66
|
+
const verW = 12;
|
|
67
|
+
const latestW = 12;
|
|
68
|
+
const statusW = 14;
|
|
69
|
+
const header = chalk_1.default.bold("Component".padEnd(nameW)) +
|
|
70
|
+
chalk_1.default.bold("Installed".padEnd(verW)) +
|
|
71
|
+
chalk_1.default.bold("Latest".padEnd(latestW)) +
|
|
72
|
+
chalk_1.default.bold("Status".padEnd(statusW)) +
|
|
73
|
+
chalk_1.default.bold("Outdated");
|
|
74
|
+
console.log(header);
|
|
75
|
+
console.log("─".repeat(nameW + verW + latestW + statusW + 8));
|
|
76
|
+
for (const [name, record] of Object.entries(tracked)) {
|
|
77
|
+
const meta = metaMap.get(name);
|
|
78
|
+
const registryVer = meta?.version ?? "unknown";
|
|
79
|
+
const isOutdated = registryVer !== "unknown" && record.version !== registryVer;
|
|
80
|
+
const outdatedLabel = isOutdated ? chalk_1.default.yellow("yes") : chalk_1.default.green("no");
|
|
81
|
+
const nameLabel = isOutdated ? chalk_1.default.yellow(name.padEnd(nameW)) : name.padEnd(nameW);
|
|
82
|
+
const row = nameLabel +
|
|
83
|
+
chalk_1.default.cyan(record.version.padEnd(verW)) +
|
|
84
|
+
chalk_1.default.cyan(registryVer.padEnd(latestW)) +
|
|
85
|
+
formatStatus(record.status).padEnd(statusW + 10) + // +10 for chalk escape codes
|
|
86
|
+
outdatedLabel;
|
|
87
|
+
console.log(row);
|
|
88
|
+
}
|
|
89
|
+
console.log();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.status = status;
|
|
93
|
+
function formatStatus(status) {
|
|
94
|
+
switch (status) {
|
|
95
|
+
case "stable":
|
|
96
|
+
return chalk_1.default.green(status);
|
|
97
|
+
case "beta":
|
|
98
|
+
return chalk_1.default.yellow(status);
|
|
99
|
+
case "experimental":
|
|
100
|
+
return chalk_1.default.red(status);
|
|
101
|
+
default:
|
|
102
|
+
return chalk_1.default.gray(status ?? "unknown");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../cli/commands/status.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAA6C;AAC7C,gDAAyE;AAElE,MAAM,MAAM,GAAG,KAAK,EAAE,SAAkB,EAAE,EA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C,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,KAAK,cAAc;YACjB,OAAO,eAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3B;YACE,OAAO,eAAK,CAAC,IAAI,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -6,6 +6,8 @@ const init_1 = require("./commands/init");
|
|
|
6
6
|
const add_1 = require("./commands/add");
|
|
7
7
|
const update_1 = require("./commands/update");
|
|
8
8
|
const update_components_1 = require("./commands/update-components");
|
|
9
|
+
const rollback_1 = require("./commands/rollback");
|
|
10
|
+
const status_1 = require("./commands/status");
|
|
9
11
|
const program = new commander_1.Command();
|
|
10
12
|
program
|
|
11
13
|
.name("apple-design-system")
|
|
@@ -29,5 +31,16 @@ program
|
|
|
29
31
|
.command("update-components")
|
|
30
32
|
.description("Interactively update components from the design system (with UI selection)")
|
|
31
33
|
.action(() => (0, update_components_1.updateComponents)());
|
|
34
|
+
program
|
|
35
|
+
.command("rollback")
|
|
36
|
+
.description("Roll back a component to a previous version")
|
|
37
|
+
.argument("<component>", "Component name")
|
|
38
|
+
.argument("<version>", "Target version (must exist as git tag v{version})")
|
|
39
|
+
.action((component, version) => (0, rollback_1.rollback)(component, version));
|
|
40
|
+
program
|
|
41
|
+
.command("status")
|
|
42
|
+
.description("Show installed component versions and their status")
|
|
43
|
+
.argument("[component]", "Component name (optional)")
|
|
44
|
+
.action((component) => (0, status_1.status)(component));
|
|
32
45
|
program.parse();
|
|
33
46
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../cli/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,0CAAuC;AACvC,wCAAqC;AACrC,8CAA2C;AAC3C,oEAAgE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../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AC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhE,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,oDAAoD,CAAC;KACjE,QAAQ,CAAC,aAAa,EAAE,2BAA2B,CAAC;KACpD,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAA,eAAM,EAAC,SAAS,CAAC,CAAC,CAAC;AAE5C,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export interface ComponentRecord {
|
|
2
2
|
version: string;
|
|
3
|
+
status: "stable" | "beta" | "experimental";
|
|
3
4
|
type: "folder" | "flat";
|
|
4
5
|
installedAt: string;
|
|
5
6
|
updatedAt: string;
|
|
7
|
+
history: Array<{
|
|
8
|
+
version: string;
|
|
9
|
+
action: "install" | "update" | "rollback";
|
|
10
|
+
date: string;
|
|
11
|
+
}>;
|
|
6
12
|
}
|
|
7
13
|
import type { Framework } from "./framework";
|
|
8
14
|
export interface DesignSystemConfig {
|
|
@@ -20,7 +26,7 @@ export declare function saveConfig(config: DesignSystemConfig): Promise<void>;
|
|
|
20
26
|
* Used for non-RSC projects (Vite, Astro, Remix, Next.js Pages Router).
|
|
21
27
|
*/
|
|
22
28
|
export declare function stripUseClient(content: string): string;
|
|
23
|
-
export declare function recordInstall(config: DesignSystemConfig, componentName: string, version: string, type: "folder" | "flat"): Promise<DesignSystemConfig>;
|
|
29
|
+
export declare function recordInstall(config: DesignSystemConfig, componentName: string, version: string, type: "folder" | "flat", action?: "install" | "update" | "rollback", status?: "stable" | "beta" | "experimental"): Promise<DesignSystemConfig>;
|
|
24
30
|
/**
|
|
25
31
|
* Detect installed components from disk.
|
|
26
32
|
* Supports both folder structure (ComponentName/) and flat files (ComponentName.tsx).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../cli/utils/config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW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AAG,MAAM,EACvB,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,EAC1C,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,GAC1C,OAAO,CAAC,kBAAkB,CAAC,CAwB7B;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,qBAAqB,EAAE,MAAM,EAC7B,mBAAmB,EAAE,MAAM,EAAE,EAC7B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CA8BnB"}
|
package/dist/cli/utils/config.js
CHANGED
|
@@ -40,17 +40,27 @@ async function saveConfig(config) {
|
|
|
40
40
|
*/
|
|
41
41
|
function stripUseClient(content) {
|
|
42
42
|
return content
|
|
43
|
-
.replace(/^['"]use client['"]
|
|
43
|
+
.replace(/^['"]use client['"];?\s*\n?/m, "")
|
|
44
44
|
.trimStart();
|
|
45
45
|
}
|
|
46
|
-
async function recordInstall(config, componentName, version, type) {
|
|
46
|
+
async function recordInstall(config, componentName, version, type, action, status) {
|
|
47
47
|
const now = new Date().toISOString();
|
|
48
48
|
const existing = config.components[componentName];
|
|
49
|
+
// Auto-detect action if not provided
|
|
50
|
+
const resolvedAction = action ?? (existing ? "update" : "install");
|
|
51
|
+
const resolvedStatus = status ?? existing?.status ?? "stable";
|
|
52
|
+
// Preserve existing history array or initialize it
|
|
53
|
+
const existingHistory = existing?.history ?? [];
|
|
49
54
|
config.components[componentName] = {
|
|
50
55
|
version,
|
|
56
|
+
status: resolvedStatus,
|
|
51
57
|
type,
|
|
52
58
|
installedAt: existing?.installedAt ?? now,
|
|
53
59
|
updatedAt: now,
|
|
60
|
+
history: [
|
|
61
|
+
...existingHistory,
|
|
62
|
+
{ version, action: resolvedAction, date: now },
|
|
63
|
+
],
|
|
54
64
|
};
|
|
55
65
|
return config;
|
|
56
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../cli/utils/config.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EAAE,IAAI,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC1B,MAAM,IAAI,GAAG,cAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,cAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;gBACjE,IACE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;oBAC3D,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAClC,CAAC;oBACD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QAClD,IAAI,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -4,6 +4,23 @@ export declare function getComponentFiles(componentName: string): Promise<Array<
|
|
|
4
4
|
name: string;
|
|
5
5
|
content: string;
|
|
6
6
|
}> | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Fetches a component's files at a specific historical version using the SHA
|
|
9
|
+
* stored in the component's registry history.
|
|
10
|
+
*
|
|
11
|
+
* Falls back to candidate file names if the history entry has no `files` list
|
|
12
|
+
* (for entries created before the files field was added to history).
|
|
13
|
+
*/
|
|
14
|
+
export declare function getComponentFilesAtVersion(componentName: string, version: string): Promise<Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
content: string;
|
|
17
|
+
}> | null>;
|
|
18
|
+
export declare function getComponentMeta(componentName: string): Promise<{
|
|
19
|
+
version: string;
|
|
20
|
+
status: string;
|
|
21
|
+
added: string;
|
|
22
|
+
breakingChanges: string[];
|
|
23
|
+
} | null>;
|
|
7
24
|
export declare function getComponentDependencies(componentName: string): Promise<string[]>;
|
|
8
25
|
export declare function getGlobalCss(): Promise<string | null>;
|
|
9
26
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../cli/utils/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../cli/utils/registry.ts"],"names":[],"mappings":"AA+DA,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CAG1D;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAGhE;AAED,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC,CAuB1D;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC,CAmC1D;AAED,wBAAsB,gBAAgB,CACpC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAAC,CAY/F;AAED,wBAAsB,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIvF;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAW3D"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getRegistryVersion = getRegistryVersion;
|
|
4
4
|
exports.getAvailableComponents = getAvailableComponents;
|
|
5
5
|
exports.getComponentFiles = getComponentFiles;
|
|
6
|
+
exports.getComponentFilesAtVersion = getComponentFilesAtVersion;
|
|
7
|
+
exports.getComponentMeta = getComponentMeta;
|
|
6
8
|
exports.getComponentDependencies = getComponentDependencies;
|
|
7
9
|
exports.getGlobalCss = getGlobalCss;
|
|
8
10
|
// Fetches from a remote JSON registry on GitHub Raw.
|
|
@@ -25,6 +27,19 @@ async function fetchRegistry() {
|
|
|
25
27
|
return {};
|
|
26
28
|
}
|
|
27
29
|
}
|
|
30
|
+
const GITHUB_RAW_BASE = "https://raw.githubusercontent.com/smart-coder-labs/design-system";
|
|
31
|
+
async function fetchFileAtSha(sha, filePath) {
|
|
32
|
+
const url = `${GITHUB_RAW_BASE}/${sha}/${filePath}`;
|
|
33
|
+
try {
|
|
34
|
+
const res = await fetch(url);
|
|
35
|
+
if (!res.ok)
|
|
36
|
+
return null;
|
|
37
|
+
return await res.text();
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
28
43
|
async function getRegistryVersion() {
|
|
29
44
|
const registry = await fetchRegistry();
|
|
30
45
|
return registry._version ?? "unknown";
|
|
@@ -54,6 +69,50 @@ async function getComponentFiles(componentName) {
|
|
|
54
69
|
return null;
|
|
55
70
|
}
|
|
56
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Fetches a component's files at a specific historical version using the SHA
|
|
74
|
+
* stored in the component's registry history.
|
|
75
|
+
*
|
|
76
|
+
* Falls back to candidate file names if the history entry has no `files` list
|
|
77
|
+
* (for entries created before the files field was added to history).
|
|
78
|
+
*/
|
|
79
|
+
async function getComponentFilesAtVersion(componentName, version) {
|
|
80
|
+
const registry = await fetchRegistry();
|
|
81
|
+
const component = registry[componentName];
|
|
82
|
+
if (!component)
|
|
83
|
+
return null;
|
|
84
|
+
const historyEntry = (component.history ?? []).find((h) => h.version === version);
|
|
85
|
+
if (!historyEntry?.sha) {
|
|
86
|
+
console.error(`No SHA found for ${componentName}@${version}. ` +
|
|
87
|
+
`Available versions: ${(component.history ?? []).map((h) => h.version).join(", ") || "none"}`);
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const { sha } = historyEntry;
|
|
91
|
+
// Use stored file names if available, otherwise fall back to known candidates
|
|
92
|
+
const fileNames = historyEntry.files && historyEntry.files.length > 0
|
|
93
|
+
? historyEntry.files
|
|
94
|
+
: [`${componentName}.tsx`, `${componentName}.types.ts`, `${componentName}.styles.ts`, "index.ts"];
|
|
95
|
+
const results = [];
|
|
96
|
+
await Promise.all(fileNames.map(async (fileName) => {
|
|
97
|
+
const content = await fetchFileAtSha(sha, `components/ui/${componentName}/${fileName}`);
|
|
98
|
+
if (content !== null) {
|
|
99
|
+
results.push({ name: fileName, content });
|
|
100
|
+
}
|
|
101
|
+
}));
|
|
102
|
+
return results.length > 0 ? results : null;
|
|
103
|
+
}
|
|
104
|
+
async function getComponentMeta(componentName) {
|
|
105
|
+
const registry = await fetchRegistry();
|
|
106
|
+
const component = registry[componentName];
|
|
107
|
+
if (!component)
|
|
108
|
+
return null;
|
|
109
|
+
return {
|
|
110
|
+
version: component.version ?? "unknown",
|
|
111
|
+
status: component.status ?? "stable",
|
|
112
|
+
added: component.added ?? "unknown",
|
|
113
|
+
breakingChanges: component.breakingChanges ?? [],
|
|
114
|
+
};
|
|
115
|
+
}
|
|
57
116
|
async function getComponentDependencies(componentName) {
|
|
58
117
|
const registry = await fetchRegistry();
|
|
59
118
|
const component = registry[componentName];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../cli/utils/registry.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../cli/utils/registry.ts"],"names":[],"mappings":";;AA+DA,gDAGC;AAED,wDAGC;AAED,8CAyBC;AASD,gEAsCC;AAED,4CAcC;AAED,4DAIC;AAED,oCAWC;AApLD,qDAAqD;AACrD,MAAM,YAAY,GAAG,gGAAgG,CAAC;AACtH,MAAM,OAAO,GAAG,8FAA8F,CAAC;AA8B/G,IAAI,cAAc,GAAoB,IAAI,CAAC;AAE3C,KAAK,UAAU,aAAa;IAC1B,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC;IAE1C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,cAAc,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAa,CAAC;QAChD,OAAO,cAAc,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACjD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,eAAe,GAAG,kEAAkE,CAAC;AAE3F,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,QAAgB;IACzD,MAAM,GAAG,GAAG,GAAG,eAAe,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;IACpD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,C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KAAK,UAAU,YAAY;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-coder-labs/apple-design-system",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Design system completo estilo Apple (macOS/iOS/VisionOS) con Framer Motion",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apple-design-system",
|
|
@@ -53,7 +53,10 @@
|
|
|
53
53
|
"test:ui": "vitest --ui",
|
|
54
54
|
"build": "npm run clean && tsc -p tsconfig.build.json",
|
|
55
55
|
"cli": "npm run build && node dist/cli/index.js",
|
|
56
|
-
"build:registry": "
|
|
56
|
+
"build:registry": "tsx scripts/build-registry.ts",
|
|
57
|
+
"bump-versions": "tsx scripts/bump-component-versions.ts",
|
|
58
|
+
"add-versions-to-readmes": "tsx scripts/add-version-to-readmes.ts",
|
|
59
|
+
"generate-changelogs": "tsx scripts/generate-changelogs.ts",
|
|
57
60
|
"prepublishOnly": "npm run build",
|
|
58
61
|
"storybook": "storybook dev -p 6006",
|
|
59
62
|
"build-storybook": "storybook build"
|
|
@@ -104,6 +107,7 @@
|
|
|
104
107
|
"tailwind-merge": "^3.4.0",
|
|
105
108
|
"tailwindcss": "^4.1.18",
|
|
106
109
|
"ts-node": "^10.9.2",
|
|
110
|
+
"tsx": "^4.22.1",
|
|
107
111
|
"typescript": "^5.3.3",
|
|
108
112
|
"vitest": "^4.1.5",
|
|
109
113
|
"vitest-axe": "^0.1.0",
|