twico-ui 1.38.0 → 1.40.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
@@ -207,7 +207,7 @@ in the examples.
207
207
 
208
208
  ---
209
209
 
210
- ## Component reference (81 components)
210
+ ## Component reference (83 components)
211
211
 
212
212
  ### Buttons & actions
213
213
 
@@ -281,6 +281,42 @@ const TrashIcon = () => (<svg width="18" height="18" viewBox="0 0 24 24" fill="n
281
281
  <IconButton aria-label="Delete" variant="outline" icon={<TrashIcon />} />
282
282
  ```
283
283
 
284
+ #### ToggleGroup
285
+
286
+ A set of toggle buttons (aria-pressed) for a tool/mode switch, formatting bar, or segmented control. It composes Button (reusing its variant/tone styles) and is a group of toggle buttons, not a radiogroup: with roving, arrows move focus and Space/Enter/click toggle. For a single pressed button, use Button/IconButton with the `pressed` prop.
287
+
288
+ `import { ToggleGroup } from "twico-ui"`
289
+
290
+ Props:
291
+ - `items` — `ToggleGroupItem[]` · **required** — The toggles to render — each { value, label?, icon?, disabled?, "aria-label"? }. Use aria-label for an icon-only toggle.
292
+ - `type` — `"single" | "multiple"` · default `"single"` — single holds one value (string | null; clicking the active one deselects); multiple holds a string[].
293
+ - `value` — `string | string[] | null` — Controlled value — a string | null for single, a string[] for multiple. Pair with onValueChange.
294
+ - `defaultValue` — `string | string[] | null` — Initial value for the uncontrolled case.
295
+ - `onValueChange` — `(value: string | string[] | null) => void` — Fired with the next value (a string | null, or a fresh string[]) when a toggle changes.
296
+ - `tone` — `"primary" | "danger"` · default `"primary"` — Tone applied to the pressed ("on") fill of each toggle.
297
+ - `variant` — `"solid" | "soft" | "outline" | "ghost"` · default `"outline"` — The Button variant used for the OFF (unpressed) look, giving a segmented feel by default.
298
+ - `size` — `"xs" | "sm" | "md" | "lg"` · default `"md"` — Button size for every toggle.
299
+ - `roving` — `boolean` · default `false` — Opt into WAI-ARIA roving arrow-key focus — the group becomes one Tab stop and arrows move focus (Space/Enter/click still toggle).
300
+ - `orientation` — `"horizontal" | "vertical"` · default `"horizontal"` — Layout direction and the roving arrow-key axis.
301
+ - `disabled` — `boolean` · default `false` — Disable the whole group (individual items can also set disabled).
302
+ - `aria-label` — `string` — Accessible label for the role="group" container.
303
+
304
+ ```jsx
305
+ import { ToggleGroup } from "twico-ui";
306
+
307
+ const [align, setAlign] = React.useState("left");
308
+ <ToggleGroup
309
+ aria-label="Text alignment"
310
+ value={align}
311
+ onValueChange={setAlign}
312
+ items={[
313
+ { value: "left", label: "Left" },
314
+ { value: "center", label: "Center" },
315
+ { value: "right", label: "Right" },
316
+ ]}
317
+ />
318
+ ```
319
+
284
320
  ### Layout
285
321
 
286
322
  #### AppShell
@@ -1794,6 +1830,31 @@ const after = [
1794
1830
  />
1795
1831
  ```
1796
1832
 
1833
+ #### ImageViewer
1834
+
1835
+ A zoomable, pannable image on a fixed stage — for inspecting a product photo, a scanned document, or a technical drawing. Pointer-anchored wheel + pinch zoom (via a non-passive listener so the page behind never scrolls), drag-to-pan when zoomed, +/-/0 keys, and double-click to toggle. For a plain, non-interactive image use Image.
1836
+
1837
+ `import { ImageViewer } from "twico-ui"`
1838
+
1839
+ Props:
1840
+ - `src` — `string` — Image source URL.
1841
+ - `alt` — `string` · **required** — Accessible description of the image (required).
1842
+ - `minZoom` — `number` · default `1` — Minimum zoom level, also the reset level.
1843
+ - `maxZoom` — `number` · default `8` — Maximum zoom level.
1844
+ - `step` — `number` · default `0.25` — Zoom increment applied by the wheel, the +/- keys, and the buttons.
1845
+ - `zoom` — `number` — Controlled zoom level; pair with onZoomChange.
1846
+ - `defaultZoom` — `number` · default `1` — Initial zoom for the uncontrolled case.
1847
+ - `onZoomChange` — `(zoom: number) => void` — Fired with the new zoom level whenever it changes.
1848
+ - `doubleClickZoom` — `number` · default `2` — Zoom level a double-click toggles to from minZoom.
1849
+ - `controls` — `React.ReactNode | ((api) => React.ReactNode) | false` · default `built-in controls` — The built-in zoom in/out/reset controls, your own node, a render function receiving the zoom API, or false to hide them.
1850
+ - `fit` — `"contain" | "cover"` · default `"contain"` — How the image fills the stage at 1x.
1851
+
1852
+ ```jsx
1853
+ import { ImageViewer } from "twico-ui";
1854
+
1855
+ <ImageViewer src="/plans/drawing.png" alt="Assembly drawing" style={{ height: 420 }} />
1856
+ ```
1857
+
1797
1858
  #### Kanban
1798
1859
 
1799
1860
  Kanban is a drag-and-drop board that arranges cards into columns you can drag between. Use it for visualizing and reorganizing work items (tasks, tickets, stages) by status, either controlled via cards + onCardMove or uncontrolled.
@@ -3221,7 +3282,7 @@ function Page() {
3221
3282
  }
3222
3283
  ```
3223
3284
 
3224
- ## Hooks (25)
3285
+ ## Hooks (26)
3225
3286
 
3226
3287
  ### useIsomorphicLayoutEffect
3227
3288
 
@@ -3423,6 +3484,14 @@ Returns a stable `render(node)` that portals `node` to `document.body`, or `null
3423
3484
  export function usePortal(): (node: React.ReactNode) => React.ReactPortal | React.ReactNode | null;
3424
3485
  ```
3425
3486
 
3487
+ ### useFilePicker
3488
+
3489
+ #406: open a native file picker from your own trigger while reusing FileUpload's validation. Render `<input {...getInputProps()} />` (hidden) once, then call `open()` from any control.
3490
+
3491
+ ```ts
3492
+ export function useFilePicker(options?: UseFilePickerOptions): { open: () => void; getInputProps: () => React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement | null> }; };
3493
+ ```
3494
+
3426
3495
  ---
3427
3496
 
3428
3497
  _Generated by `scripts/gen-llms.mjs`. Do not edit by hand — run `npm run gen:llms`. Source of truth: the component `.d.ts` files and `hooks/index.d.ts`._
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twico-ui",
3
- "version": "1.38.0",
3
+ "version": "1.40.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",
@@ -126,7 +126,7 @@
126
126
  {
127
127
  "name": "ESM (full barrel)",
128
128
  "path": "dist/index.mjs",
129
- "limit": "125 kB"
129
+ "limit": "132 kB"
130
130
  },
131
131
  {
132
132
  "name": "Button only (tree-shaken)",