@octavius2929-personal/design-system 0.1.0 → 0.4.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 +64 -0
- package/dist/dm-serif-display-latin-ext-italic-400-QUYR73UK.woff2 +0 -0
- package/dist/dm-serif-display-latin-ext-normal-400-GP44XTZK.woff2 +0 -0
- package/dist/dm-serif-display-latin-italic-400-NM54ELTO.woff2 +0 -0
- package/dist/dm-serif-display-latin-normal-400-DCCDLJOI.woff2 +0 -0
- package/dist/ibm-plex-mono-latin-ext-normal-400-T6XOR2FX.woff2 +0 -0
- package/dist/ibm-plex-mono-latin-ext-normal-500-LJE4XY22.woff2 +0 -0
- package/dist/ibm-plex-mono-latin-ext-normal-600-IEJYURAG.woff2 +0 -0
- package/dist/ibm-plex-mono-latin-normal-400-A2WATXFY.woff2 +0 -0
- package/dist/ibm-plex-mono-latin-normal-500-33HAQIPI.woff2 +0 -0
- package/dist/ibm-plex-mono-latin-normal-600-IIV3OB4N.woff2 +0 -0
- package/dist/index.cjs +189 -115
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +888 -746
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +647 -6
- package/dist/index.d.ts +647 -6
- package/dist/index.js +107 -35
- package/dist/index.js.map +1 -0
- package/dist/newsreader-latin-ext-italic-400-500-6IPSRR6F.woff2 +0 -0
- package/dist/newsreader-latin-ext-normal-300-600-HJH6YDA4.woff2 +0 -0
- package/dist/newsreader-latin-italic-400-500-ZC4QAWU3.woff2 +0 -0
- package/dist/newsreader-latin-normal-300-600-J4KAOEDO.woff2 +0 -0
- package/dist/unifraktur-maguntia-latin-normal-400-TOQBJZN4.woff2 +0 -0
- package/package.json +19 -13
package/README.md
CHANGED
|
@@ -2,6 +2,66 @@
|
|
|
2
2
|
|
|
3
3
|
Librería de componentes **React** con estilos en TypeScript (vanilla-extract). Generada con `@octavius2929-personal/scaffold-generator`.
|
|
4
4
|
|
|
5
|
+
## Instalación
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @octavius2929-personal/design-system
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react` y `react-dom` son **peer dependencies** (`>=18`): asegurate de tenerlos instalados en tu app.
|
|
12
|
+
|
|
13
|
+
## Uso
|
|
14
|
+
|
|
15
|
+
1. Importá el CSS **una sola vez** (en el entrypoint de tu app, p. ej. `main.tsx`):
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import "@octavius2929-personal/design-system/styles.css";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. Envolvé tu app con `ThemeProvider` y usá los componentes:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { ThemeProvider, Button } from "@octavius2929-personal/design-system";
|
|
25
|
+
|
|
26
|
+
export function App() {
|
|
27
|
+
return (
|
|
28
|
+
<ThemeProvider defaultSchema="tinta" defaultMode="light">
|
|
29
|
+
<Button variant="filled" tone="accent" size="md" onClick={() => alert("¡Hola!")}>
|
|
30
|
+
Continuar
|
|
31
|
+
</Button>
|
|
32
|
+
</ThemeProvider>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`ThemeProvider` es **opcional**: sin él los componentes usan el schema `tinta` en modo `light` (las vars de `:root`).
|
|
38
|
+
|
|
39
|
+
3. Para cambiar el schema (paleta) o el modo en runtime, usá `useTheme()` desde un componente dentro del provider:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { useTheme, schemaNames } from "@octavius2929-personal/design-system";
|
|
43
|
+
|
|
44
|
+
function ThemeSwitch() {
|
|
45
|
+
const { schema, mode, setSchema, toggleMode } = useTheme();
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<select value={schema} onChange={(e) => setSchema(e.target.value as typeof schema)}>
|
|
49
|
+
{schemaNames.map((name) => (
|
|
50
|
+
<option key={name} value={name}>
|
|
51
|
+
{name}
|
|
52
|
+
</option>
|
|
53
|
+
))}
|
|
54
|
+
</select>
|
|
55
|
+
<button type="button" onClick={toggleMode}>
|
|
56
|
+
Modo: {mode}
|
|
57
|
+
</button>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Los componentes toman el tema activo solos (no hace falta un wrapper con clase). La lista de paletas disponibles está en el export `schemaNames`.
|
|
64
|
+
|
|
5
65
|
## Comandos
|
|
6
66
|
|
|
7
67
|
| Comando | Qué hace |
|
|
@@ -51,3 +111,7 @@ El ejemplo (`Button` + `useToggle`) es demostrativo — reemplazalo por tus comp
|
|
|
51
111
|
1. Ajustá `name`, `version` y `description` en `package.json`.
|
|
52
112
|
2. `npm run build` genera `dist/` (incluye `index.css`).
|
|
53
113
|
3. `npm publish` (el campo `files` ya limita el tarball a `dist/`). Recordales a los consumidores importar `<pkg>/styles.css`.
|
|
114
|
+
|
|
115
|
+
## Versionado
|
|
116
|
+
|
|
117
|
+
El versionado es **semántico** (SemVer) y se deriva automáticamente de los [conventional commits](https://www.conventionalcommits.org/). Las versiones y el changelog de cada release viven en los **[GitHub Releases](https://github.com/proyectos-octavio/design-system/releases)** del repositorio — no hay `CHANGELOG.md` en el árbol del proyecto porque el proceso de release no commitea de vuelta.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|