@uselets/ui 1.20.4 → 2.0.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 +309 -426
- package/dist/as-child-Dxg3Xo1G.d.ts +41 -0
- package/dist/cli/uselets.mjs +5 -4
- package/dist/cli/uselets.mjs.map +1 -1
- package/dist/components/accordion.d.ts +12 -8
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +20 -15
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/anchor.d.ts +3 -5
- package/dist/components/anchor.js +1 -1
- package/dist/components/anchor.js.map +1 -1
- package/dist/components/area-chart.d.ts +54 -0
- package/dist/components/area-chart.js +1 -1
- package/dist/components/area-chart.js.map +1 -1
- package/dist/components/avatar.d.ts +12 -7
- package/dist/components/avatar.js +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.d.ts +3 -5
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/bar-chart.d.ts +48 -0
- package/dist/components/bar-chart.js +1 -1
- package/dist/components/bar-chart.js.map +1 -1
- package/dist/components/bottom-nav.d.ts +7 -3
- package/dist/components/bottom-nav.js +1 -1
- package/dist/components/bottom-nav.js.map +1 -1
- package/dist/components/breadcrumb.d.ts +3 -4
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.d.ts +3 -4
- package/dist/components/button-group.js +1 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.d.ts +8 -4
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.d.ts +4 -0
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.d.ts +4 -0
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.d.ts +11 -3
- package/dist/components/carousel.js +1 -1
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/center.d.ts +1 -1
- package/dist/components/chart.js +4 -4
- package/dist/components/checkbox.d.ts +14 -4
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.d.ts +8 -7
- package/dist/components/collapsible.js +1 -1
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.d.ts +48 -26
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +16 -2
- package/dist/components/command.js +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/container.d.ts +1 -1
- package/dist/components/data-table.d.ts +39 -0
- package/dist/components/data-table.js +1 -1
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-range-picker.d.ts +24 -2
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog.d.ts +33 -15
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/direction.d.ts +7 -0
- package/dist/components/direction.js +1 -0
- package/dist/components/donut-chart.d.ts +12 -0
- package/dist/components/donut-chart.js +1 -1
- package/dist/components/donut-chart.js.map +1 -1
- package/dist/components/drawer.d.ts +33 -15
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +36 -26
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/dropzone.d.ts +19 -0
- package/dist/components/dropzone.js +1 -1
- package/dist/components/dropzone.js.map +1 -1
- package/dist/components/field.d.ts +16 -4
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/flex.d.ts +1 -1
- package/dist/components/grid.d.ts +13 -0
- package/dist/components/grid.js.map +1 -1
- package/dist/components/group.d.ts +1 -1
- package/dist/components/heading.d.ts +3 -5
- package/dist/components/heading.js +1 -1
- package/dist/components/heading.js.map +1 -1
- package/dist/components/hover-card.d.ts +7 -6
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.d.ts +2 -2
- package/dist/components/input-group.js +1 -1
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.d.ts +4 -2
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/label.d.ts +3 -4
- package/dist/components/label.js +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/list.d.ts +8 -5
- package/dist/components/list.js +1 -1
- package/dist/components/list.js.map +1 -1
- package/dist/components/logo.d.ts +113 -0
- package/dist/components/marker.d.ts +4 -5
- package/dist/components/marker.js +1 -1
- package/dist/components/marker.js.map +1 -1
- package/dist/components/mask-input.d.ts +6 -0
- package/dist/components/mask-input.js.map +1 -1
- package/dist/components/native-select.d.ts +5 -1
- package/dist/components/native-select.js +1 -1
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +19 -20
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/number-field.d.ts +18 -13
- package/dist/components/number-field.js +1 -1
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/pagination.d.ts +9 -0
- package/dist/components/pagination.js +1 -1
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/phone-input.d.ts +3 -0
- package/dist/components/phone-input.js +1 -1
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/pie-chart.d.ts +53 -0
- package/dist/components/pie-chart.js +1 -1
- package/dist/components/pie-chart.js.map +1 -1
- package/dist/components/popover.d.ts +13 -12
- package/dist/components/popover.js +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.d.ts +9 -3
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.d.ts +20 -6
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/resizable.d.ts +1 -0
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/ring-progress.d.ts +9 -1
- package/dist/components/ring-progress.js.map +1 -1
- package/dist/components/scroll-area.d.ts +3 -3
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.d.ts +25 -20
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.d.ts +9 -4
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sidebar.d.ts +63 -18
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/simple-grid.d.ts +7 -0
- package/dist/components/simple-grid.js +1 -1
- package/dist/components/simple-grid.js.map +1 -1
- package/dist/components/skeleton.d.ts +4 -0
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/stack.d.ts +1 -1
- package/dist/components/stepper.d.ts +46 -25
- package/dist/components/stepper.js +1 -1
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.d.ts +17 -3
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts +10 -1
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +14 -10
- package/dist/components/tabs.js +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.d.ts +3 -5
- package/dist/components/text.js +1 -1
- package/dist/components/text.js.map +1 -1
- package/dist/components/textarea.d.ts +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/theme.d.ts +12 -0
- package/dist/components/theme.js +1 -1
- package/dist/components/theme.js.map +1 -1
- package/dist/components/timeline.d.ts +25 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/toggle-group.d.ts +16 -6
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.d.ts +4 -4
- package/dist/components/toggle.js +1 -1
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tooltip.d.ts +15 -8
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unstyled-button.d.ts +3 -5
- package/dist/components/unstyled-button.js +1 -1
- package/dist/components/unstyled-button.js.map +1 -1
- package/dist/components/visibility.d.ts +2 -0
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.js.map +1 -1
- package/dist/hooks/use-breakpoint-value.d.ts +1 -0
- package/dist/hooks/use-breakpoint-value.js.map +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -0
- package/dist/hooks/use-breakpoint.js.map +1 -1
- package/dist/hooks/use-disclosure.d.ts +3 -0
- package/dist/hooks/use-disclosure.js +1 -1
- package/dist/hooks/use-disclosure.js.map +1 -1
- package/dist/hooks/use-document-visibility.d.ts +1 -0
- package/dist/hooks/use-document-visibility.js.map +1 -1
- package/dist/hooks/use-hotkeys.d.ts +1 -1
- package/dist/hooks/use-idle.d.ts +9 -0
- package/dist/hooks/use-idle.js.map +1 -1
- package/dist/hooks/use-interval.d.ts +1 -0
- package/dist/hooks/use-interval.js.map +1 -1
- package/dist/hooks/use-local-storage.d.ts +6 -0
- package/dist/hooks/use-local-storage.js +1 -1
- package/dist/hooks/use-local-storage.js.map +1 -1
- package/dist/hooks/use-mask.d.ts +1 -0
- package/dist/hooks/use-mask.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -1
- package/dist/lib/as-child.d.ts +2 -0
- package/dist/lib/as-child.js +2 -0
- package/dist/lib/as-child.js.map +1 -0
- package/dist/lib/utils.d.ts +1 -1
- package/dist/logo--R3_XDgA.js.map +1 -1
- package/dist/resolve-class-name-BurP8ngI.js +2 -0
- package/dist/resolve-class-name-BurP8ngI.js.map +1 -0
- package/dist/skills/uselets-ui/SKILL.md +8 -3
- package/dist/skills/uselets-ui/references/component-catalog.md +31 -16
- package/dist/skills/uselets-ui/references/migration-v1-to-v2.md +599 -0
- package/dist/skills/uselets-ui/references/package-guide.md +7 -7
- package/dist/styles/base.css +21 -0
- package/dist/{use-hotkeys-DOjcX9Tt.d.ts → use-hotkeys-D1_TEIwN.d.ts} +2 -1
- package/dist/use-hotkeys-YDJmGWX6.js.map +1 -1
- package/package.json +16 -17
- package/skills/uselets-ui/SKILL.md +8 -3
- package/skills/uselets-ui/references/component-catalog.md +31 -16
- package/skills/uselets-ui/references/migration-v1-to-v2.md +599 -0
- package/skills/uselets-ui/references/package-guide.md +7 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-class-name-BurP8ngI.js","names":["className","state"],"sources":["../src/utils/resolve-class-name.ts"],"sourcesContent":["/** Resolves a Base UI `className`, which can also be a function of the component state, for that state. */\nexport function resolveClassName<State>(\n className: string | ((state: State) => string | undefined) | undefined,\n state: State\n) {\n return typeof className === 'function' ? className(state) : className\n}\n"],"mappings":"uCACA,SAAgB,iBACd,EACA,EACA,CACA,OAAO,OAAOA,GAAc,WAAaA,EAAUC,CAAK,EAAID,CAC9D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: uselets-ui
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Use @uselets/ui in apps: install it, configure themes, choose public imports/components, inspect the installed package API, and migrate from v1 to v2 (Radix → Base UI). Use whenever code imports from @uselets/ui, including upgrades or v1-only APIs such as Accordion `type="single"`, `delayDuration`, `PopoverAnchor`, `NavigationMenuViewport`, `checked="indeterminate"`, or `onSelect` on menu items.
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# @uselets/ui
|
|
@@ -53,12 +54,14 @@ To set up a consumer project after installing `@uselets/ui`, run `bun uselets in
|
|
|
53
54
|
app's entry file (`import '@fontsource-variable/inter'` in `app/layout.tsx`, `pages/_app.tsx`, or `src/main.tsx`),
|
|
54
55
|
not via `@import` in CSS — some bundlers, including Next.js, don't resolve third-party CSS `@import`s reliably.
|
|
55
56
|
- Recommend `@uselets/ui/postcss.config` when the app needs the package PostCSS preset for Tailwind v4.
|
|
57
|
+
- Interactive components are built on Base UI (`@base-ui/react`). Use `asChild` (Radix-style, single child element) for polymorphism; the child replaces the part's content. Not supported on `ScrollArea`, `ScrollBar`, `SelectContent`, `SelectItem`, `AccordionContent`, `Checkbox`, `Switch`, `RadioGroupItem`, `Progress`, `Slider`, `NavigationMenu`, `NumberFieldScrubArea`, `ComboboxInput`, `ComboboxClear`, `ComboboxChipsInput`, `NumberField`, `NumberFieldInput` (their internal structure is required). Do not pass Base UI's `render` prop — it is not part of the public API. When `asChild` wraps a button-like part (triggers, closes, `TabsTrigger`, `AccordionTrigger`, `Toggle`, `SelectTrigger`, `AlertDialogAction`/`Cancel`) with a non-`<button>` child, also pass `nativeButton={false}` (not needed for `TooltipTrigger`/`HoverCardTrigger`). Change callbacks of Base UI-backed components (`onOpenChange`, `onValueChange`, `onCheckedChange`, …) receive `(value, eventDetails)`; `DateRangePicker`, `SidebarProvider` and `Stepper` callbacks don't.
|
|
58
|
+
- Popups unmount when closed. `keepMounted?: boolean` (default `false`) keeps them mounted while hidden on `DialogContent`, `AlertDialogContent`, `DrawerContent`, `PopoverContent`, `DropdownMenuContent`, `DropdownMenuSubContent`, `TooltipContent`/`Tooltip`, `HoverCardContent`, `ComboboxContent` and `NavigationMenuPositioner`; `SelectContent` does not accept it. `sticky?: boolean` (default `false`) keeps `PopoverContent`, `SelectContent`, `DropdownMenuContent`, `DropdownMenuSubContent`, `TooltipContent`/`Tooltip`, `HoverCardContent` and `ComboboxContent` in the viewport after the anchor scrolls out of view. Other positioner props (`collisionPadding`, `collisionBoundary`, `arrowPadding`, `collisionAvoidance`) are only exposed on `ComboboxContent`.
|
|
56
59
|
- For Vite apps, `@tailwindcss/vite` (registered in `vite.config.ts`, no `postcss.config.mjs`) is a valid alternative to PostCSS; prefer it when the project uses isolated installs (pnpm, Bun workspaces). See `references/package-guide.md`.
|
|
57
|
-
- For tooltip-heavy apps, wrap the app with `TooltipProvider
|
|
60
|
+
- For tooltip-heavy apps, wrap the app with `TooltipProvider` (`delay`, not `delayDuration`); use `Tooltip label={...}` for common trigger/content usage (it accepts `delay`/`closeDelay`) and `TooltipRoot` only when manual composition is needed.
|
|
58
61
|
- Use `UnstyledButton` when button semantics are needed without `Button` variants; it provides reset styles, pointer cursor, focus ring, default `type="button"`, and `asChild`.
|
|
59
62
|
- For toast usage, mount `Toaster` near the app root before calling `toast(...)`.
|
|
60
63
|
- For package theme helpers, use `ThemeProvider`, `useTheme`, and `ModeToggle` from `@uselets/ui/theme` or the root barrel.
|
|
61
|
-
- For form fields, `Field` automatically shares a generated control id with `FieldLabel` and labelable controls when explicit ids are omitted; pass explicit matching `htmlFor` and `id` only when a stable custom id is required.
|
|
64
|
+
- For form fields, `Field` automatically shares a generated control id with `FieldLabel` and labelable controls when explicit ids are omitted; pass explicit matching `htmlFor` and `id` only when a stable custom id is required. Use one control per `Field` (a `RadioGroup` counts as one control); for several checkboxes/switches use `FieldSet` + `FieldLegend` with one `Field` each. Mark errors with `<Field invalid>` (not `aria-invalid` on each control): it colors the label and propagates `aria-invalid` to the control; `Checkbox`/`Switch`/`RadioGroup` get the attribute but no red style.
|
|
62
65
|
- For client-side tabular data, use `DataTable` from `@uselets/ui/data-table`. Defaults are bare: `enableRowSelection`, `enableSorting`, and `showPagination` are all `false`. Set `enableRowSelection` to auto-prepend the selection checkbox column (no need to add `createDataTableSelectColumn` manually); set `enableSorting` to make `DataTableColumnHeader` clickable for sort. `filterColumns` accepts a single id or an array; with 2+ ids the toolbar renders an `InputGroup` with a column selector on the left. `toolbarActions` always sits at the right of the toolbar. All labels default to pt-BR; override any subset through `labels` (`Partial<DataTableLabels>`), with full defaults exposed as `defaultDataTableLabels`. Use `variant` on `DataTable` (or directly on the base `Table`) to switch chrome: `"line"` (default) renders only horizontal separators between rows; `"outline"` adds a rounded outer border around the table. The base `Table` from `@uselets/ui/table` renders only the `<table>` element and is striped by default (pass `striped={false}` to disable). Wrap it in `TableContainer` to control scroll; `minWidth` lives on `TableContainer`. Combine `stickyHeader` on `Table` with `max-h` + `overflow-y-auto` on the `TableContainer` to keep the `<thead>` visible during vertical scroll. `DataTable` wraps its `Table` in `TableContainer` automatically.
|
|
63
66
|
|
|
64
67
|
## Quick Routing
|
|
@@ -66,6 +69,7 @@ To set up a consumer project after installing `@uselets/ui`, run `bun uselets in
|
|
|
66
69
|
- Need installation or global setup: run `bun uselets init` or read `references/package-guide.md`.
|
|
67
70
|
- Need to install or update this skill locally: run `bun uselets skill`.
|
|
68
71
|
- Need to choose a component: read `references/component-catalog.md`.
|
|
72
|
+
- Upgrading from v1, or the code uses v1-only APIs (Radix-era props like `type="single"`, `delayDuration`, `PopoverAnchor`, `data-[state=...]` selectors): read `references/migration-v1-to-v2.md` and follow it step by step.
|
|
69
73
|
- Need the exact local API: run `scripts/print-public-api.mjs`.
|
|
70
74
|
- Need exact props for one module: open the matching `.d.ts` file in `node_modules/@uselets/ui/dist`.
|
|
71
75
|
|
|
@@ -76,3 +80,4 @@ To set up a consumer project after installing `@uselets/ui`, run `bun uselets in
|
|
|
76
80
|
- "Show me the correct import for `TooltipProvider`, `Tooltip`, `UnstyledButton`, or `Sidebar`."
|
|
77
81
|
- "Inspect the installed version of `@uselets/ui` and tell me what `button` exports."
|
|
78
82
|
- "Build this screen only with `@uselets/ui` components."
|
|
83
|
+
- "Upgrade this app from `@uselets/ui` v1 to v2."
|
|
@@ -5,7 +5,7 @@ This file is a portable snapshot of the public package API for `@uselets/ui`.
|
|
|
5
5
|
Snapshot basis:
|
|
6
6
|
|
|
7
7
|
- package name: `@uselets/ui`
|
|
8
|
-
- snapshot version: `
|
|
8
|
+
- snapshot version: `2.x` (Base UI-based major; see `migration-v1-to-v2.md` for v1 differences)
|
|
9
9
|
|
|
10
10
|
Use this snapshot to choose modules and imports when the package is not yet installed.
|
|
11
11
|
When `@uselets/ui` is installed locally, confirm exact exports with:
|
|
@@ -57,14 +57,14 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
57
57
|
- `use-mask`
|
|
58
58
|
- Import path: `@uselets/ui/hooks/use-mask`
|
|
59
59
|
- Exports: `useMask`, `UseMaskOptions`, `MaskOptions`, `Replacement`, `Track`, `TrackingData`, `Modify`, `ModifiedData`
|
|
60
|
-
- Notes: thin wrapper over `@react-input/mask`'s `useMask` that defaults `replacement` to `{
|
|
60
|
+
- Notes: thin wrapper over `@react-input/mask`'s `useMask` that defaults `replacement` to `{ _: /\d/, '#': /[A-Za-z]/, '*': /./ }`; returns a `MutableRefObject<HTMLInputElement>` to attach to any input. Consumers may override `replacement`.
|
|
61
61
|
- `utils`
|
|
62
62
|
- Import path: `@uselets/ui/utils`
|
|
63
63
|
- Exports: `cn`, `randomId`
|
|
64
64
|
- `color`
|
|
65
65
|
- Import path: `@uselets/ui/lib/color`
|
|
66
66
|
- Exports: `uiColors`, `UIColor`, `selectionControlColorVariants`
|
|
67
|
-
- Notes: canonical public color list used by `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch`; `ButtonColor` is a compatibility alias for `UIColor`; `selectionControlColorVariants` is an internal styling map for checked selection controls
|
|
67
|
+
- Notes: canonical public color list used by `Button`, `Toggle`, `Checkbox`, `RadioGroupItem`, and `Switch`; `ButtonColor` (exported from `@uselets/ui/lib/button`, not this module) is a compatibility alias for `UIColor`; `selectionControlColorVariants` is an internal styling map for checked selection controls
|
|
68
68
|
- `compose-refs`
|
|
69
69
|
- Import path: `@uselets/ui/lib/compose-refs`
|
|
70
70
|
- Exports: `composeRefs`, `setRef`
|
|
@@ -119,7 +119,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
119
119
|
- Exports: `Empty`, `EmptyContent`, `EmptyDescription`, `EmptyHeader`, `EmptyMedia`, `EmptyTitle`
|
|
120
120
|
- `progress`
|
|
121
121
|
- Exports: `Progress`, `progressVariants`
|
|
122
|
-
- Notes: linear progress bar driven by a single `value` (0–100); `size: 'sm' | 'md' | 'lg'` (default: `md`) controls bar height and `color: UIColor` (default: `primary`) controls the indicator
|
|
122
|
+
- Notes: linear progress bar driven by a single `value` (0–100); `size: 'sm' | 'md' | 'lg'` (default: `md`) controls bar height and `color: UIColor` (default: `primary`) controls the indicator; omitting `value` (or passing `null`) renders the indeterminate state
|
|
123
123
|
- `ring-progress`
|
|
124
124
|
- Exports: `RingProgress`, `ringProgressVariants`
|
|
125
125
|
- Notes: circular progress indicator driven by a single `value` (0–100); `size: 'sm' | 'md' | 'lg'` (default: `md`, `32/40/48px`), `thickness: 'thin' | 'md' | 'thick'` (default: `md`), and `color: UIColor` (default: `primary`); normalized `viewBox` means the size can also be set via `className` (e.g. `size-5`); rounded line caps
|
|
@@ -132,8 +132,9 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
132
132
|
## Forms and input composition
|
|
133
133
|
|
|
134
134
|
- `field`
|
|
135
|
-
- Exports: `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`, `useFieldControlId`
|
|
136
|
-
- Notes: form layout and validation helpers; `Field` automatically provides a generated control id to `FieldLabel` and labelable descendants when explicit ids are omitted
|
|
135
|
+
- Exports: `Field`, `FieldContent`, `FieldDescription`, `FieldError`, `FieldGroup`, `FieldLabel`, `FieldLegend`, `FieldSeparator`, `FieldSet`, `FieldTitle`, `useFieldControlId`, `useFieldInvalid`, `useFieldLabelId`
|
|
136
|
+
- Notes: form layout and validation helpers; `Field` automatically provides a generated control id to `FieldLabel` and labelable descendants when explicit ids are omitted. One control per `Field`: a `RadioGroup` placed directly in a `Field` takes the `FieldLabel` as its group label (`aria-labelledby`) and its items keep their own ids; never put several `Checkbox`/`Switch` controls in one `Field` (they would share the control id) — use `FieldSet` + `FieldLegend` with one `Field` per control. `useFieldLabelId()` returns the current `FieldLabel` id (or `undefined` outside a `Field`) for custom group controls
|
|
137
|
+
- Invalid state: `Field.invalid?: boolean` (or legacy `data-invalid="true"`; `invalid` wins when both are set) renders `data-invalid="true"` (label/description turn destructive) and sets `aria-invalid` on the control inside. Styled red: `Input` (incl. `InputGroupInput`, `PhoneInput`), `Textarea`, `NativeSelect`, `SelectTrigger`, `ComboboxInput`, `ComboboxChipsInput`, `InputOTP` (+ slots), `NumberField`. `aria-invalid` only, no red style: `Checkbox`, `Switch`, `RadioGroup` (on the group). Not propagated: `Slider`, `DatePicker`/`DateRangePicker` triggers. A control's own `aria-invalid` (including `false`) overrides the `Field`. Do: `<Field invalid><FieldLabel/><Input/><FieldError/></Field>`. Don't: repeat `aria-invalid` on every control inside an invalid `Field`. Custom controls: `const invalid = useFieldInvalid(props['aria-invalid'])` → `aria-invalid={invalid}` (returns `undefined` outside a `Field`)
|
|
137
138
|
- `grid`
|
|
138
139
|
- Exports: `Grid`, `GridItem`
|
|
139
140
|
- Notes: 12-column CSS grid by default. `Grid` supports spacing props plus direct `templateRows` and `templateColumns`; spacing values `xs` to `xl` map to `4/8/16/24/32px`; `GridItem` defaults to `colSpan={12}` and supports numeric `colSpan` and `rowSpan`. Use `useBreakpointValue` when these values need to change by breakpoint.
|
|
@@ -163,15 +164,16 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
163
164
|
- Notes: international phone input built on `react-phone-number-input`, composed from the existing `Input` and `Combobox` (country select, with flags); matches `Input`'s styling and single size (no `variant`/size prop). `value` / `onChange` use the E.164 `Value` string from `react-phone-number-input`; `defaultCountry` defaults to `BR`.
|
|
164
165
|
- `checkbox`
|
|
165
166
|
- Exports: `Checkbox`
|
|
166
|
-
- Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `primary`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows checkbox size (`sm` 12px, `md` 14px, `lg`
|
|
167
|
+
- Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `primary`), `indeterminate?: boolean` for the mixed state (use it alongside a boolean `checked`; `checked="indeterminate"` is not supported), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows checkbox size (`sm` 12px, `md` 14px, `lg` 18px); `description?: React.ReactNode` + `descriptionProps` render muted helper text (a `<p>`) below the label, linked via `aria-describedby`; description text is `sm` 12px, `md` 12px, `lg` 14px
|
|
167
168
|
- `switch`
|
|
168
169
|
- Exports: `Switch`
|
|
169
|
-
- Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `green`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; `color` controls the checked track and indicator color only; track size is `sm`
|
|
170
|
+
- Notes: supports `size: 'sm' | 'md' | 'lg'`, `color: UIColor` (default `green`), `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; `color` controls the checked track and indicator color only; track size is `sm` 30x14px, `md` 34x16px, and `lg` 42x20px (control heights match `Checkbox`); the thumb and internal indicator scale with the switch; composed label text follows switch size (`sm` 12px, `md` 14px, `lg` 18px (same as `Checkbox` and `RadioGroupItem`)); `description?: React.ReactNode` + `descriptionProps` render muted helper text (a `<p>`) below the label, linked via `aria-describedby`; description text is `sm` 12px, `md` 12px, `lg` 14px
|
|
170
171
|
- `radio-group`
|
|
171
172
|
- Exports: `RadioGroup`, `RadioGroupItem`
|
|
172
|
-
- Notes: `RadioGroup` supports `color: UIColor` (default `primary`) for the group; `RadioGroupItem` supports `size: 'sm' | 'md' | 'lg'`, optional `color: UIColor` item overrides, `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows item size (`sm` 12px, `md` 14px, `lg`
|
|
173
|
+
- Notes: `RadioGroup` supports `color: UIColor` (default `primary`) for the group; `RadioGroupItem` supports `size: 'sm' | 'md' | 'lg'`, optional `color: UIColor` item overrides, `label?: React.ReactNode`, `labelProps`, and automatic `id`/`htmlFor` wiring when a label is provided without an explicit `id`; composed label text follows item size (`sm` 12px, `md` 14px, `lg` 18px); `description?: React.ReactNode` + `descriptionProps` render muted helper text (a `<p>`) below the label, linked via `aria-describedby`; description text is `sm` 12px, `md` 12px, `lg` 14px
|
|
173
174
|
- `select`
|
|
174
175
|
- Exports: `Select`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectScrollDownButton`, `SelectScrollUpButton`, `SelectSeparator`, `SelectTrigger`, `SelectValue`
|
|
176
|
+
- Notes: pass `items` to `Select` (array of `{ value, label }` or a `value → label` record) whenever item labels differ from their values — otherwise `SelectValue` shows the raw value. `SelectTrigger.size: 'sm' | 'md'`; `SelectContent` accepts `side`, `sideOffset`, `align`, `alignOffset`, and `alignItemWithTrigger` (default `true`). `onValueChange` may receive `null`.
|
|
175
177
|
- `native-select`
|
|
176
178
|
- Exports: `NativeSelect`, `NativeSelectOptGroup`, `NativeSelectOption`
|
|
177
179
|
- `combobox`
|
|
@@ -188,6 +190,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
188
190
|
- Notes: compound popover picker using `Calendar` range mode with two months; draft changes from fixed presets, relative-day inputs, date inputs, and calendar stay synchronized until apply; reset and applied clear emit `null` through `onValueChange`; preset buttons show selected state when the draft range matches by calendar day
|
|
189
191
|
- `slider`
|
|
190
192
|
- Exports: `Slider`
|
|
193
|
+
- Notes: `onValueChange` receives `number | readonly number[]` (an array when `value`/`defaultValue` is an array)
|
|
191
194
|
- `label`
|
|
192
195
|
- Exports: `Label`
|
|
193
196
|
- `toggle`
|
|
@@ -195,22 +198,28 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
195
198
|
- Notes: `secondary`, `outline`, and `ghost` variants; supports `color: UIColor` using the same color variants as `Button`
|
|
196
199
|
- `toggle-group`
|
|
197
200
|
- Exports: `ToggleGroup`, `ToggleGroupItem`
|
|
198
|
-
- Notes: shares `toggleVariants` with `Toggle` (`secondary`, `outline`, `ghost`)
|
|
201
|
+
- Notes: shares `toggleVariants` with `Toggle` (`secondary`, `outline`, `ghost`); single-selection by default, set `multiple` for multi-selection. `value`/`defaultValue`/`onValueChange` always use string arrays (no `type="single" | "multiple"`)
|
|
199
202
|
|
|
200
203
|
## Overlays and floating UI
|
|
201
204
|
|
|
202
205
|
- `dialog`
|
|
203
206
|
- Exports: `Dialog`, `DialogBody`, `DialogClose`, `DialogContent`, `DialogDescription`, `DialogFooter`, `DialogHeader`, `DialogOverlay`, `DialogPortal`, `DialogTitle`, `DialogTrigger`
|
|
204
|
-
- Notes: `Dialog` supports `size: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'` with default `md`; `full` occupies the entire viewport. `DialogContent` caps its height at `calc(100dvh - 2rem)` and lays out children as a flex column. For long content, wrap the middle in `DialogBody` (`flex-1 overflow-y-auto`) so the body scrolls while `DialogHeader` and `DialogFooter` remain pinned; for short content, omit `DialogBody`. `DialogContent.showCloseButton` defaults to `true`; `DialogFooter.showCloseButton` defaults to `false`. `Dialog.dismissible` defaults to `true`; set it to `false` to prevent closing via outside click and Esc (the close button and `DialogClose` still work). `DialogOverlay` and `DialogContent` stop `click`/`submit` propagation to ancestor elements by default, since
|
|
207
|
+
- Notes: `Dialog` supports `size: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'` with default `md`; `full` occupies the entire viewport. `DialogContent` caps its height at `calc(100dvh - 2rem)` and lays out children as a flex column. For long content, wrap the middle in `DialogBody` (`flex-1 overflow-y-auto`) so the body scrolls while `DialogHeader` and `DialogFooter` remain pinned; for short content, omit `DialogBody`. `DialogContent.showCloseButton` defaults to `true`; `DialogFooter.showCloseButton` defaults to `false`. `Dialog.dismissible` defaults to `true`; set it to `false` to prevent closing via outside click and Esc (the close button and `DialogClose` still work). `DialogOverlay` and `DialogContent` stop `click`/`submit` propagation to ancestor elements by default, since portals move them elsewhere in the DOM but React still propagates their synthetic events through the component tree
|
|
208
|
+
- `direction`
|
|
209
|
+
- Exports: `DirectionProvider`, `useDirection`, types `DirectionProviderProps`, `TextDirection`
|
|
210
|
+
- Notes: `DirectionProvider.direction: 'ltr' | 'rtl'` (default `'ltr'`) sets the text direction for keyboard navigation (`Tabs`, `ToggleGroup`, `RadioGroup`, `DropdownMenu`), `Slider`, `ScrollArea`, `Select`, `NavigationMenu`, `Combobox` and popup positioning. A `dir` prop/attribute on those components does not change their behavior; wrap the RTL subtree (or the app) in `DirectionProvider` and also set `dir` on the HTML for text layout. `useDirection()` reads the current direction
|
|
205
211
|
- `drawer`
|
|
206
212
|
- Exports: `Drawer`, `DrawerBody`, `DrawerClose`, `DrawerContent`, `DrawerDescription`, `DrawerFooter`, `DrawerHeader`, `DrawerOverlay`, `DrawerPortal`, `DrawerTitle`, `DrawerTrigger`
|
|
207
|
-
- Notes: `Drawer` supports `size: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'` with default `md`; `DrawerBody` provides padded auto-scroll content; `DrawerFooter` stacks actions on mobile and aligns them to the end on larger breakpoints; `DrawerContent.showCloseButton` controls the automatic close button and defaults to `true`. `Drawer.dismissible` defaults to `true`; set it to `false` to prevent closing via outside click and Esc (the close button and `DrawerClose` still work). `Drawer.direction: 'top' | 'right' | 'bottom' | 'left'` (default: `right`) controls which edge the drawer slides in from. `DrawerOverlay` and `DrawerContent` stop `click`/`submit` propagation to ancestor elements by default, since
|
|
213
|
+
- Notes: `Drawer` supports `size: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full'` with default `md`; `DrawerBody` provides padded auto-scroll content; `DrawerFooter` stacks actions on mobile and aligns them to the end on larger breakpoints; `DrawerContent.showCloseButton` controls the automatic close button and defaults to `true`. `Drawer.dismissible` defaults to `true`; set it to `false` to prevent closing via outside click and Esc (the close button and `DrawerClose` still work). `Drawer.direction: 'top' | 'right' | 'bottom' | 'left'` (default: `right`) controls which edge the drawer slides in from. `DrawerOverlay` and `DrawerContent` stop `click`/`submit` propagation to ancestor elements by default, since portals move them elsewhere in the DOM but React still propagates their synthetic events through the component tree
|
|
208
214
|
- `popover`
|
|
209
|
-
- Exports: `Popover`, `
|
|
215
|
+
- Exports: `Popover`, `PopoverClose`, `PopoverContent`, `PopoverDescription`, `PopoverHeader`, `PopoverTitle`, `PopoverTrigger`
|
|
216
|
+
- Notes: `PopoverContent` accepts `side`, `sideOffset`, `align`, `alignOffset`, and `anchor` (element, ref, or virtual element) to position against something other than the trigger; there is no `PopoverAnchor` component. `Popover.modal: boolean | 'trap-focus'` (default `false`) traps focus only when a `PopoverClose` (supports `asChild`) is rendered inside `PopoverContent`; without it, `modal` still blocks outside clicks and page scroll but `Tab` leaves the popup. Hide the close with `className="sr-only"` when there is no visible close button
|
|
210
217
|
- `hover-card`
|
|
211
218
|
- Exports: `HoverCard`, `HoverCardTrigger`, `HoverCardContent`
|
|
219
|
+
- Notes: open/close timing lives on `HoverCardTrigger` (`delay` default `700`, `closeDelay` default `300`)
|
|
212
220
|
- `dropdown-menu`
|
|
213
221
|
- Exports: `DropdownMenu`, `DropdownMenuCheckboxItem`, `DropdownMenuContent`, `DropdownMenuGroup`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuPortal`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSeparator`, `DropdownMenuShortcut`, `DropdownMenuSub`, `DropdownMenuSubContent`, `DropdownMenuSubTrigger`, `DropdownMenuTrigger`
|
|
222
|
+
- Notes: use `onClick` on `DropdownMenuItem` to react to selection (there is no `onSelect`); every part (trigger, content, items, label, sub trigger…) accepts `asChild`; `DropdownMenuCheckboxItem`/`DropdownMenuRadioItem` keep the menu open on toggle by default; pass `closeOnClick` to close it
|
|
214
223
|
|
|
215
224
|
## Navigation
|
|
216
225
|
|
|
@@ -221,8 +230,10 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
221
230
|
- Exports: `Breadcrumb`, `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis`
|
|
222
231
|
- `command`
|
|
223
232
|
- Exports: `Command`, `CommandDialog`, `CommandInput`, `CommandList`, `CommandEmpty`, `CommandGroup`, `CommandItem`, `CommandShortcut`, `CommandSeparator`
|
|
233
|
+
- Notes: `CommandDialog` accepts the `Dialog` props and defaults to `size="sm"` (plain `Dialog` defaults to `md`)
|
|
224
234
|
- `navigation-menu`
|
|
225
|
-
- Exports: `NavigationMenu`, `NavigationMenuList`, `NavigationMenuItem`, `NavigationMenuContent`, `NavigationMenuTrigger`, `NavigationMenuLink`, `NavigationMenuIndicator`, `
|
|
235
|
+
- Exports: `NavigationMenu`, `NavigationMenuList`, `NavigationMenuItem`, `NavigationMenuContent`, `NavigationMenuTrigger`, `NavigationMenuLink`, `NavigationMenuIndicator`, `NavigationMenuPositioner`, `navigationMenuTriggerStyle`
|
|
236
|
+
- Notes: `NavigationMenu` renders `NavigationMenuPositioner` automatically (forwarding `align`); there is no `viewport` prop. Place `NavigationMenuIndicator` inside a `NavigationMenuItem`. `NavigationMenuLink` supports `active`, `asChild` and `closeOnClick` (default `false`: the menu stays open after a click; pass it for client-side routing). It has no `onSelect`; use `onClick`
|
|
226
237
|
- `pagination`
|
|
227
238
|
- Exports: `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`
|
|
228
239
|
- Notes: `Pagination` highlights the current page and keeps other links neutral. `Pagination.color` (a `UIColor`, default `primary`) controls only the current page's color. Each `PaginationLink`/`PaginationPrevious`/`PaginationNext` can still pass its own `color`, but `Pagination`'s wins when set.
|
|
@@ -240,6 +251,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
240
251
|
|
|
241
252
|
- `accordion`
|
|
242
253
|
- Exports: `Accordion`, `AccordionItem`, `AccordionTrigger`, `AccordionContent`
|
|
254
|
+
- Notes: single-item expansion by default; set `multiple` to allow several open items. `value`/`defaultValue` are string arrays (no `type`/`collapsible` props — items can always be collapsed)
|
|
243
255
|
- `avatar`
|
|
244
256
|
- Exports: `Avatar`, `AvatarBadge`, `AvatarFallback`, `AvatarGroup`, `AvatarGroupCount`, `AvatarImage`
|
|
245
257
|
- `card`
|
|
@@ -247,11 +259,14 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
247
259
|
- Notes: supports `size: 'sm' | 'md' | 'lg'` with default `md`
|
|
248
260
|
- `carousel`
|
|
249
261
|
- Exports: `Carousel`, `CarouselContent`, `CarouselItem`, `CarouselPrevious`, `CarouselNext`, `CarouselIndicators`, `useCarousel`
|
|
262
|
+
- `Carousel` renders `role="region"` with `aria-roledescription="carousel"`; give it an accessible name with `aria-label`.
|
|
263
|
+
- Keyboard: arrows navigate along the orientation (`ArrowLeft`/`ArrowRight` horizontal, swapped when `opts.direction === 'rtl'`; `ArrowUp`/`ArrowDown` vertical). Arrows are left alone inside text fields and when a control in the slide already called `preventDefault`.
|
|
264
|
+
- `CarouselPrevious`/`CarouselNext`: a consumer `onClick` runs before scrolling; call `event.preventDefault()` to skip the scroll. Default accessible names are English ("Previous slide"/"Next slide") — translate with `aria-label`. Indicators default to "Go to slide N" — translate with `getIndicatorProps={(index) => ({ 'aria-label': ... })}`.
|
|
250
265
|
- `center`
|
|
251
266
|
- Exports: `Center`, `centerVariants`
|
|
252
267
|
- `chart`
|
|
253
268
|
- Exports: `ChartContainer`, `ChartLegend`, `ChartLegendContent`, `ChartStyle`, `ChartTooltip`, `ChartTooltipContent`, `ChartConfig`, `ChartColorKey`, `CHART_COLOR_KEYS`, `DEFAULT_CHART_PALETTE`, `resolveChartColor`
|
|
254
|
-
- Notes: low-level chart primitives. For app usage prefer the high-level `area-chart`, `bar-chart`, `pie-chart`, `donut-chart` modules. Import raw recharts primitives (`Bar`, `XAxis`, etc.) directly from `recharts` when composing with `ChartContainer`. `ChartColorKey` is the union of theme color tokens accepted by every high-level chart (`primary | brand | gray | zinc | red | yellow | green | blue | indigo | pink`) and resolves to `var(--{key}
|
|
269
|
+
- Notes: low-level chart primitives. For app usage prefer the high-level `area-chart`, `bar-chart`, `pie-chart`, `donut-chart` modules. Import raw recharts primitives (`Bar`, `XAxis`, etc.) directly from `recharts` when composing with `ChartContainer`. `ChartColorKey` is the union of theme color tokens accepted by every high-level chart (`primary | brand | gray | zinc | red | yellow | green | blue | indigo | pink`) and resolves to the semantic token `var(--{key})` (step 500 in light mode, 400 in dark) via `resolveChartColor`; any other string passes through unchanged.
|
|
255
270
|
- `area-chart`
|
|
256
271
|
- Exports: `AreaChart`, `AreaChartSeries`, `AreaChartType`, `AreaChartCurveType`, `AreaChartGridAxis`
|
|
257
272
|
- Notes: high-level area chart. Pass `data`, `series` (array of `{ name, label?, color?, colorKey? }`), and `dataKey` (X axis field). Supports `type` (default/stacked/percent/split), `curveType`, `withXAxis`, `withYAxis`, `gridAxis`, `withDots`, `withTooltip`, `withLegend`. Use `colorKey: ChartColorKey` for theme colors (`'blue'`, `'primary'`, etc.) or `color` for raw CSS values; explicit `color` wins. Defaults to chart colors `--chart-1..5`. Pass `areaProps` to spread props (e.g. `onClick`) onto each underlying recharts `<Area>`. Pass `areaChartProps` to spread props (e.g. `margin`) onto the wrapping recharts `<AreaChart>`.
|
|
@@ -298,7 +313,7 @@ Unless noted otherwise, each module also exports its public `*Props` types from
|
|
|
298
313
|
- Exports: `DataTable`, `DataTableRoot`, `DataTableToolbar`, `DataTableHeader`, `DataTableBody`, `DataTablePagination`, `DataTableColumnHeader`, `createDataTableSelectColumn`, `useDataTable`, `useDataTableContext`, `defaultDataTableLabels`, `DataTableLabels`, `UseDataTableOptions`, `DataTableRootProps`, `DataTableToolbarProps`
|
|
299
314
|
- Notes: dual API — high-level `DataTable` (monolithic, simple cases) and compound (`DataTableRoot` + sub-parts, power cases including virtualization). Both share the same underlying logic via `useDataTable`.
|
|
300
315
|
- **High-level `DataTable`:** client-side TanStack Table composition. Defaults are bare — `enableRowSelection`, `enableSorting`, `showPagination` all default to `false` and must be explicitly enabled. Setting `enableRowSelection` auto-prepends the selection column; setting `enableSorting` activates sort buttons in `DataTableColumnHeader`. `filterColumns` accepts `string | string[]`; with 2+ ids the toolbar renders an `InputGroup` with a column selector at the left. `toolbarActions` always renders at the right of the toolbar. `variant` (`"line"` default | `"outline"`) is forwarded to the internal `Table` — pass `"outline"` to wrap the table in a rounded border. All user-facing labels default to pt-BR and are overridable through the `labels` prop (`Partial<DataTableLabels>`)
|
|
301
|
-
- **Compound API:** `DataTableRoot` accepts either `{ columns, data, ...options }` (uncontrolled — creates the `table` instance internally) or `{ table }` (controlled — table instance comes from `useDataTable` called by the consumer). `DataTableToolbar`, `DataTableHeader`, `DataTableBody`, and `DataTablePagination` read the `table` instance from context. `DataTableHeader` renders a full `<thead>`; `DataTableBody` renders a full `<tbody>` — to virtualize, omit `<DataTableBody />` and render your own `<tbody>` instead. `useDataTable(options)` is a thin wrapper around `useReactTable` that bakes in the same defaults `DataTable` uses (row models, selection auto-injection); pass `enablePagination: false` when virtualizing so `table.getRowModel()` returns all rows. `useDataTableContext<TData>()` retrieves the current `table` and merged `labels` inside a custom compound child
|
|
316
|
+
- **Compound API:** `DataTableRoot` accepts either `{ columns, data, ...options }` (uncontrolled — creates the `table` instance internally) or `{ table }` (controlled — table instance comes from `useDataTable` called by the consumer). `DataTableToolbar`, `DataTableHeader`, `DataTableBody`, and `DataTablePagination` read the `table` instance from context. Uncontrolled `DataTableRoot` paginates automatically while a `DataTablePagination` is mounted inside it (explicit `enablePagination` wins); `useDataTable` defaults to `enablePagination: false`. Changing `pageSize` applies the new size and returns to the first page. Removing a column from `filterColumns` clears its filter. `DataTableHeader` renders a full `<thead>`; `DataTableBody` renders a full `<tbody>` — to virtualize, omit `<DataTableBody />` and render your own `<tbody>` instead. `useDataTable(options)` is a thin wrapper around `useReactTable` that bakes in the same defaults `DataTable` uses (row models, selection auto-injection); pass `enablePagination: false` when virtualizing so `table.getRowModel()` returns all rows. `useDataTableContext<TData>()` retrieves the current `table` and merged `labels` inside a custom compound child
|
|
302
317
|
- **Virtualization:** the package is virtualizer-agnostic — it has zero runtime dependency on `@tanstack/react-virtual`. Bring your own virtualizer (TanStack Virtual, `react-window`, `virtua`, or manual). See the *Virtualized lists* section in `references/package-guide.md` for the canonical TanStack Virtual recipe
|
|
303
318
|
- `timeline`
|
|
304
319
|
- Exports: `Timeline`, `TimelineConnector`, `TimelineContent`, `TimelineDescription`, `TimelineEmpty`, `TimelineHeader`, `TimelineIcon`, `TimelineItem`, `TimelineTime`, `TimelineTitle`, `timelineVariants`
|