twico-ui 1.0.2 → 1.2.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/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Twico UI — LLM usage guide (llms.txt)
2
2
 
3
- Twico UI is a free, MIT-licensed **React component library**: 61 components and 23 standalone
3
+ Twico UI is a free, MIT-licensed **React component library**: 62 components and 23 standalone
4
4
  hooks (plus the `useToast` hook), with dark mode, motion, accessibility, RTL, a density scale, and
5
5
  design tokens. **Zero runtime dependencies** (peer: `react`/`react-dom` >= 18).
6
6
 
@@ -161,11 +161,19 @@ function Page() {
161
161
 
162
162
  ## Icons
163
163
 
164
- The library **ships no icon set** — pass your own icons as React nodes (inline SVG recommended) to
165
- props such as `leftIcon`, `rightIcon`, `icon`, `header`. Icons inherit `currentColor` and the
166
- control's size:
164
+ Components take icons as **React nodes** via props like `leftIcon`, `rightIcon`, `icon`, `header` —
165
+ bring any icon (inline SVG, or any icon library). Icons inherit `currentColor` and the control's size.
166
+
167
+ For convenience, **`twico-ui/icons` re-exports the full [Lucide](https://lucide.dev) icon set** (the
168
+ visual language Twico UI is built on). It needs the **optional peer** `lucide-react`
169
+ (`npm install lucide-react`) and is tree-shakeable — the core `twico-ui` package itself stays
170
+ zero-dependency. The icons are plain SVG components (no hooks), so they work in Server Components too.
167
171
 
168
172
  ```jsx
173
+ import { Home, Search } from "twico-ui/icons"; // needs the optional `lucide-react` peer
174
+ <Button leftIcon={<Home size={16} />}>Home</Button>
175
+
176
+ // …or pass your own inline SVG (no peer needed):
169
177
  <Button leftIcon={<svg width="16" height="16" viewBox="0 0 24 24" /* … */ />}>Add item</Button>
170
178
  ```
171
179
 
@@ -194,7 +202,7 @@ in the examples.
194
202
 
195
203
  ---
196
204
 
197
- ## Component reference (61 components)
205
+ ## Component reference (62 components)
198
206
 
199
207
  ### Buttons & actions
200
208
 
@@ -266,6 +274,40 @@ const TrashIcon = () => (<svg width="18" height="18" viewBox="0 0 24 24" fill="n
266
274
 
267
275
  ### Layout
268
276
 
277
+ #### AppShell
278
+
279
+ Full-height application shell: a fixed sidebar beside a scrollable content area with an optional fixed topbar. The content fills the remaining width and scrolls independently, so the sidebar and header stay put.
280
+
281
+ `import { AppShell } from "twico-ui"`
282
+
283
+ Props:
284
+ - `sidebar` — `React.ReactNode` — The sidebar element (e.g. a Sidebar), rendered full-height on the inline-start side of the shell.
285
+ - `header` — `React.ReactNode` — Topbar content in a fixed header above the content; a flex row with space-between, so pass a left and a right group.
286
+ - `children` — `React.ReactNode` — Main content; fills the remaining space and scrolls independently of the fixed sidebar and header.
287
+ - `height` — `string | number` · default `"100dvh"` — Overall shell height; pass a fixed value to embed the shell inside a smaller region (e.g. a demo).
288
+ - `padded` — `boolean` · default `true` — Pads the scrollable content region with the standard page padding; set false for edge-to-edge content.
289
+
290
+ ```jsx
291
+ import { AppShell, Sidebar, Button } from "twico-ui";
292
+
293
+ <AppShell
294
+ sidebar={
295
+ <Sidebar
296
+ brand={<b>Acme</b>}
297
+ items={[{ label: "Home", active: true }, { label: "Settings" }]}
298
+ />
299
+ }
300
+ header={
301
+ <>
302
+ <b>Dashboard</b>
303
+ <Button size="sm">New</Button>
304
+ </>
305
+ }
306
+ >
307
+ <h1>Welcome back</h1>
308
+ </AppShell>
309
+ ```
310
+
269
311
  #### Box
270
312
 
271
313
  Generic, token-styled box — the building block for non-flex layout (padding, margin, background, border, radius, shadow) without writing CSS.
@@ -2416,5 +2458,5 @@ export function useId(prefix?: string): string;
2416
2458
 
2417
2459
  ---
2418
2460
 
2419
- _Generated by `scripts/gen-llms.mjs` from twico-ui v1.0.2. Do not edit by hand — run `npm run gen:llms`. Source of truth: the component `.d.ts` files and `hooks/index.d.ts`._
2461
+ _Generated by `scripts/gen-llms.mjs` from twico-ui v1.2.0. Do not edit by hand — run `npm run gen:llms`. Source of truth: the component `.d.ts` files and `hooks/index.d.ts`._
2420
2462
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twico-ui",
3
- "version": "1.0.2",
3
+ "version": "1.2.0",
4
4
  "description": "Twico UI — a free, modern, themeable React + Tailwind-friendly component library. 61 components with dark mode, motion, and accessibility built in.",
5
5
  "license": "MIT",
6
6
  "author": "Twico UI",
@@ -53,6 +53,16 @@
53
53
  "default": "./dist/colors.cjs"
54
54
  }
55
55
  },
56
+ "./icons": {
57
+ "import": {
58
+ "types": "./dist/icons.d.ts",
59
+ "default": "./dist/icons.mjs"
60
+ },
61
+ "require": {
62
+ "types": "./dist/icons.d.cts",
63
+ "default": "./dist/icons.cjs"
64
+ }
65
+ },
56
66
  "./styles.css": "./styles/twico-ui.css",
57
67
  "./package.json": "./package.json"
58
68
  },
@@ -80,7 +90,13 @@
80
90
  },
81
91
  "peerDependencies": {
82
92
  "react": ">=18",
83
- "react-dom": ">=18"
93
+ "react-dom": ">=18",
94
+ "lucide-react": ">=0.300.0"
95
+ },
96
+ "peerDependenciesMeta": {
97
+ "lucide-react": {
98
+ "optional": true
99
+ }
84
100
  },
85
101
  "overrides": {
86
102
  "esbuild": "^0.28.1"
@@ -96,6 +112,7 @@
96
112
  "@types/react": "^19.2.17",
97
113
  "@types/react-dom": "^19.2.3",
98
114
  "jsdom": "^29.1.1",
115
+ "lucide-react": "^1.21.0",
99
116
  "semantic-release": "^25.0.5",
100
117
  "size-limit": "^12.1.0",
101
118
  "tsup": "^8.3.5",