@choco-vanille/ui 1.0.0 → 1.1.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 +37 -51
- package/package.json +17 -2
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @choco-vanille/ui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
> **⚠️ Personal project notice:** This library is primarily built for personal use. It is published publicly as a convenience, but comes with no guarantees of stability, long-term maintenance, or backward compatibility. Use it at your own risk.
|
|
4
|
+
|
|
5
|
+
A React 19 UI kit built with **Vite** (library mode), **Vanilla Extract**
|
|
6
|
+
(zero-runtime, typed CSS-in-TS) and **Base UI** primitives. Components are
|
|
5
7
|
previewed with **Storybook**.
|
|
6
8
|
|
|
7
9
|
## Features
|
|
@@ -9,40 +11,62 @@ previewed with **Storybook**.
|
|
|
9
11
|
- ⚛️ React 19 + TypeScript, ships ESM + CJS + type declarations
|
|
10
12
|
- 🎨 Vanilla Extract design system — a fully typed token theme
|
|
11
13
|
(colors, spacing, radius, font sizes/weights, shadows, z-index)
|
|
12
|
-
- 🧩
|
|
14
|
+
- 🧩 Base UI components styled with Vanilla Extract `recipe()` (the typed
|
|
13
15
|
replacement for `cva`), composed with `clsx`
|
|
14
16
|
- 📚 Storybook for interactive component docs
|
|
15
17
|
- ✅ ESLint flat config (typescript-eslint, react-hooks, jsx-a11y, storybook) + Prettier
|
|
16
18
|
|
|
17
|
-
##
|
|
19
|
+
## Installation
|
|
18
20
|
|
|
19
21
|
```bash
|
|
20
|
-
|
|
22
|
+
# npm
|
|
23
|
+
npm install @choco-vanille/ui react react-dom
|
|
24
|
+
|
|
25
|
+
# yarn
|
|
26
|
+
yarn add @choco-vanille/ui react react-dom
|
|
27
|
+
|
|
28
|
+
# pnpm
|
|
29
|
+
pnpm add @choco-vanille/ui react react-dom
|
|
21
30
|
```
|
|
22
31
|
|
|
23
32
|
Import the stylesheet once (e.g. in your root layout/entry):
|
|
24
33
|
|
|
25
34
|
```ts
|
|
26
|
-
import '@
|
|
35
|
+
import '@choco-vanille/ui/styles.css';
|
|
27
36
|
```
|
|
28
37
|
|
|
29
38
|
Then use components:
|
|
30
39
|
|
|
31
40
|
```tsx
|
|
32
|
-
import { Text } from '@
|
|
41
|
+
import { Text } from '@choco-vanille/ui';
|
|
33
42
|
|
|
34
43
|
export function Example() {
|
|
35
44
|
return (
|
|
36
45
|
<>
|
|
37
46
|
<Text variant="h1">Hello world</Text>
|
|
38
47
|
<Text variant="muted">A typographic primitive.</Text>
|
|
39
|
-
<Text variant="code">@
|
|
48
|
+
<Text variant="code">@choco-vanille/ui</Text>
|
|
40
49
|
</>
|
|
41
50
|
);
|
|
42
51
|
}
|
|
43
52
|
```
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
## Components
|
|
55
|
+
|
|
56
|
+
| Category | Components |
|
|
57
|
+
|---|---|
|
|
58
|
+
| **Foundation** | `Icon`, `Typography` |
|
|
59
|
+
| **Layout** | `Box`, `Flex`, `Grid`, `Image`, `Separator`, `Form`, `Fieldset`, `Legend` |
|
|
60
|
+
| **Actions** | `Button`, `IconButton`, `ToggleButton`, `ToggleIconButton`, `ToggleButtonGroup` |
|
|
61
|
+
| **Forms** | `Autocomplete`, `Calendar`, `Checkbox`, `DatePicker`, `RadioGroup`, `Select`, `Switch`, `TextArea`, `TextField` |
|
|
62
|
+
| **Data Display** | `Avatar`, `AvatarGroup`, `Badge`, `Table` |
|
|
63
|
+
| **Surfaces** | `Accordion`, `Card`, `Collapsible` |
|
|
64
|
+
| **Navigation** | `Tabs`, `Link` |
|
|
65
|
+
| **Overlay** | `Tooltip`, `DropdownMenu`, `Popover`, `HoverCard`, `Dialog`, `Drawer` |
|
|
66
|
+
| **Feedback** | `Skeleton`, `Callout`, `Toast`, `Progress` |
|
|
67
|
+
| **Theme** | `ThemeProvider`, `useTheme` |
|
|
68
|
+
|
|
69
|
+
## Theming
|
|
46
70
|
|
|
47
71
|
The design system is the single source of truth for tokens, organised by
|
|
48
72
|
category under `src/theme/tokens/` (`colors.ts`, `spacing.ts`, `radii.ts`,
|
|
@@ -65,7 +89,7 @@ Tokens are available two ways:
|
|
|
65
89
|
|
|
66
90
|
```ts
|
|
67
91
|
import { style } from '@vanilla-extract/css';
|
|
68
|
-
import { vars } from '@
|
|
92
|
+
import { vars } from '@choco-vanille/ui';
|
|
69
93
|
|
|
70
94
|
export const card = style({
|
|
71
95
|
backgroundColor: vars.color.card,
|
|
@@ -90,45 +114,7 @@ human-readable name derived from its path (`--color-primary`, `--space-md`,
|
|
|
90
114
|
Both stay in sync automatically — overriding a CSS variable also updates every
|
|
91
115
|
component that references it through `vars`.
|
|
92
116
|
|
|
93
|
-
##
|
|
94
|
-
|
|
95
|
-
### `Text`
|
|
96
|
-
|
|
97
|
-
Polymorphic typography primitive.
|
|
98
|
-
|
|
99
|
-
| Prop | Type | Default | Description |
|
|
100
|
-
| ---------- | --------------------------------------------------------------------------------------------- | ------- | -------------------------------------------- |
|
|
101
|
-
| `variant` | `h1 \| h2 \| h3 \| h4 \| p \| lead \| large \| small \| muted \| blockquote \| code` | `p` | Visual style + default semantic HTML element |
|
|
102
|
-
| `weight` | `normal \| medium \| semibold \| bold` | — | Font weight override |
|
|
103
|
-
| `align` | `left \| center \| right` | — | Text alignment |
|
|
104
|
-
| `truncate` | `boolean` | — | Truncate overflow with ellipsis |
|
|
105
|
-
| `as` | `React.ElementType` | — | Override the rendered element |
|
|
106
|
-
|
|
107
|
-
## Scripts
|
|
108
|
-
|
|
109
|
-
| Command | Description |
|
|
110
|
-
| ---------------------- | -------------------------------------------- |
|
|
111
|
-
| `yarn dev` | Build the library in watch mode |
|
|
112
|
-
| `yarn build` | Type-check and build (ESM, CJS, d.ts, CSS) |
|
|
113
|
-
| `yarn storybook` | Run Storybook dev server on port 6006 |
|
|
114
|
-
| `yarn build-storybook` | Build the static Storybook site |
|
|
115
|
-
| `yarn lint` | Run ESLint |
|
|
116
|
-
| `yarn typecheck` | Type-check without emitting |
|
|
117
|
-
| `yarn format` | Format with Prettier |
|
|
118
|
-
|
|
119
|
-
## Publishing
|
|
120
|
-
|
|
121
|
-
`yarn build` produces `dist/`. The `prepublishOnly` hook runs the build
|
|
122
|
-
automatically, and `files` limits the published package to `dist/`.
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
yarn publish --access public
|
|
126
|
-
```
|
|
117
|
+
## License
|
|
127
118
|
|
|
128
|
-
|
|
119
|
+
[MIT](./LICENSE)
|
|
129
120
|
|
|
130
|
-
Place new components under `src/components/<group>/<name>/` (e.g. `actions/`,
|
|
131
|
-
`foundation/`), re-export them from `src/index.ts`, and add a `*.stories.tsx`
|
|
132
|
-
file next to each component. Define styles in a colocated `*.styles.css.ts`
|
|
133
|
-
file using Vanilla Extract `recipe()` / `style()` and the design tokens
|
|
134
|
-
(`vars`), then compose class names with the `mergeClassNames()` helper.
|
package/package.json
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@choco-vanille/ui",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A React 19 UI kit built with
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A React 19 UI kit built with Vanilla Extract and Base UI primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/LilianMrzt/choco-vanille-ui.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/LilianMrzt/choco-vanille-ui#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/LilianMrzt/choco-vanille-ui/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"react",
|
|
17
|
+
"ui-kit",
|
|
18
|
+
"vanilla-extract",
|
|
19
|
+
"base-ui",
|
|
20
|
+
"storybook"
|
|
21
|
+
],
|
|
7
22
|
"sideEffects": [
|
|
8
23
|
"**/*.css"
|
|
9
24
|
],
|