@dreamtree-org/twreact-ui 2.0.3 → 2.0.5
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 +17 -6
- package/ai-skills/dreamtree-ui.md +12 -5
- package/dist/ai-schema.json +150 -1
- package/dist/charts/index.d.ts +2 -1
- package/dist/charts/index.js +297 -12
- package/dist/components/charts/ChartFrame.d.ts +1 -0
- package/dist/components/charts/ChartFrame.d.ts.map +1 -1
- package/dist/components/charts/ScatterChart.d.ts +4 -0
- package/dist/components/charts/ScatterChart.d.ts.map +1 -0
- package/dist/components/charts/ScatterTooltip.d.ts +14 -0
- package/dist/components/charts/ScatterTooltip.d.ts.map +1 -0
- package/dist/components/charts/scatterData.d.ts +17 -0
- package/dist/components/charts/scatterData.d.ts.map +1 -0
- package/dist/components/core/DatePicker.d.ts.map +1 -1
- package/dist/components/core/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/components/navigation/Navbar.d.ts.map +1 -1
- package/dist/components/navigation/Sidebar.d.ts +2 -0
- package/dist/components/navigation/Sidebar.d.ts.map +1 -1
- package/dist/components/utility/Sortable.d.ts.map +1 -1
- package/dist/components/utility/SortableGroup.d.ts +15 -0
- package/dist/components/utility/SortableGroup.d.ts.map +1 -0
- package/dist/esm/charts/index.js +1 -0
- package/dist/esm/components/charts/ChartFrame.js +5 -5
- package/dist/esm/components/charts/ScatterChart.js +204 -0
- package/dist/esm/components/charts/ScatterTooltip.js +61 -0
- package/dist/esm/components/charts/scatterData.js +43 -0
- package/dist/esm/components/core/DatePicker.js +4 -1
- package/dist/esm/components/core/DateRangePicker.js +6 -2
- package/dist/esm/components/core/Select.js +6 -2
- package/dist/esm/components/navigation/Navbar.js +23 -6
- package/dist/esm/components/navigation/Sidebar.js +9 -2
- package/dist/esm/components/utility/Sortable.js +70 -48
- package/dist/esm/components/utility/SortableGroup.js +48 -0
- package/dist/esm/hooks/useFocusTrap.js +21 -9
- package/dist/esm/hooks/useSortable.js +96 -30
- package/dist/esm/hooks/useSortableGroup.js +268 -0
- package/dist/esm/index.js +1 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useSortable.d.ts +12 -3
- package/dist/hooks/useSortable.d.ts.map +1 -1
- package/dist/hooks/useSortableGroup.d.ts +43 -0
- package/dist/hooks/useSortableGroup.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +936 -498
- package/dist/index.js +936 -497
- package/dist/types/charts.d.ts +28 -0
- package/dist/types/charts.d.ts.map +1 -1
- package/dist/types/index.d.ts +40 -1
- package/dist/types/index.d.ts.map +1 -1
- package/doc/README.md +2 -0
- package/mcp/catalog.snapshot.json +252 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ nothing changes in your bundle — the root `@dreamtree-org/twreact-ui` import n
|
|
|
132
132
|
|
|
133
133
|
| Entry point | Exports | Install first |
|
|
134
134
|
|---|---|---|
|
|
135
|
-
| `@dreamtree-org/twreact-ui/charts` | `LineChart`, `BarChart`, `AreaChart`, `DonutChart`, `Sparkline` | `npm install recharts` (recharts 2.15+ or 3.x; React 18 apps also `npm install react-is@18`) |
|
|
135
|
+
| `@dreamtree-org/twreact-ui/charts` | `LineChart`, `BarChart`, `AreaChart`, `DonutChart`, `Sparkline`, `ScatterChart` | `npm install recharts` (recharts 2.15+ or 3.x; React 18 apps also `npm install react-is@18`) |
|
|
136
136
|
| `@dreamtree-org/twreact-ui/rich-text` | `RichTextEditor` | `npm install @tiptap/react @tiptap/pm @tiptap/starter-kit` (Tiptap 3) |
|
|
137
137
|
|
|
138
138
|
```jsx
|
|
@@ -285,7 +285,7 @@ Advanced select component with search, multi-select, and grouping support.
|
|
|
285
285
|
- `options`: Array<{value: any, label: string, disabled?: boolean, group?: string}> (with `grouped`: also `[{ label, options }]` groups)
|
|
286
286
|
- `value`: any | Array<any>
|
|
287
287
|
- `onChange`: (value: any) => void
|
|
288
|
-
- `placeholder`: string (default: 'Select an option...')
|
|
288
|
+
- `placeholder`: string (default: 'Select an option...') — shown muted (`text-muted`) with `data-empty` on the trigger while nothing is selected
|
|
289
289
|
- `label`: string — associated with the trigger (accessible name = label + value)
|
|
290
290
|
- `error`: string
|
|
291
291
|
- `helperText`: ReactNode — hint below the control; replaced by `error` while shown
|
|
@@ -432,7 +432,7 @@ Calendar-based date selection with keyboard navigation.
|
|
|
432
432
|
**Props:**
|
|
433
433
|
- `value`: Date | string
|
|
434
434
|
- `onChange`: (date: Date | null) => void
|
|
435
|
-
- `placeholder`: string (default: 'Select date...')
|
|
435
|
+
- `placeholder`: string (default: 'Select date...') — shown muted (`text-muted`) with `data-empty` on the trigger while empty (same for DateRangePicker)
|
|
436
436
|
- `label`: string
|
|
437
437
|
- `error`: string
|
|
438
438
|
- `helperText`: ReactNode — hint below the trigger; replaced by `error` while shown
|
|
@@ -464,6 +464,7 @@ Collapsible sidebar navigation with nested items.
|
|
|
464
464
|
**Props:**
|
|
465
465
|
- `items`: Array<SidebarItem>
|
|
466
466
|
- `collapsed`: boolean (default: false)
|
|
467
|
+
- `collapsible`: boolean (default: true) — `false` removes the md+ collapse/expand toggle; the phone drawer keeps its 44px "Close navigation" button
|
|
467
468
|
- `onToggle`: () => void
|
|
468
469
|
- `logo`: ReactNode
|
|
469
470
|
- `user`: {name: string, email: string, avatar?: string, menuItems?: Array<MenuItem>}
|
|
@@ -518,7 +519,9 @@ Top navigation bar with user menu and notifications.
|
|
|
518
519
|
- `onNotificationClick`: (notifications: Array<Notification>) => void
|
|
519
520
|
- `onUserClick`: (user: object) => void
|
|
520
521
|
- `leftIcon`: ReactNode | false
|
|
521
|
-
- `onLeftIconClick`: () => void
|
|
522
|
+
- `onLeftIconClick`: (event) => void
|
|
523
|
+
- `leftIconLabel`: string (default: "Go back") — the left button's accessible name, e.g. "Open navigation" when it opens a Sidebar drawer
|
|
524
|
+
- `leftIconProps`: ButtonHTMLAttributes — spread onto the left button (e.g. `aria-expanded`, `aria-controls`); `className` merges last
|
|
522
525
|
|
|
523
526
|
```jsx
|
|
524
527
|
<Navbar
|
|
@@ -758,6 +761,7 @@ Interaction primitives that products used to compose by hand. All are `forwardRe
|
|
|
758
761
|
| [`Textarea`](doc/Textarea.md) | Core | Multi-line input mirroring `Input`: `label`, `error`, `helperText`, `required`, `showCount`/`maxLength`, `autoResize`/`maxRows` |
|
|
759
762
|
| [`Slider`](doc/Slider.md) | Core | Single value or `[low, high]` range; `min`/`max`/`step`, arrows/PageUp/PageDown/Home/End, `role="slider"` with full `aria-value*` |
|
|
760
763
|
| [`Sortable`](doc/Sortable.md) | Utility | Drag-to-reorder list (pointer events, no extra dependency) + keyboard reordering (Space, arrows, Space/Escape) with live announcements; `items`, `onReorder`, `renderItem`, `getKey` |
|
|
764
|
+
| [`SortableGroup`](doc/SortableGroup.md) | Utility | Moves items between `Sortable` lists (each with an `id`): pointer drag or cross-axis arrow keys, `onMove({ item, from, to })`, and `canDrop(item, target, from)` which marks and announces a refused list before the drop |
|
|
761
765
|
| [`Tour`](doc/Tour.md) | Feedback | Step-based onboarding: spotlight on each `target` (selector or ref), Back/Next/Skip/Finish, `open`/`onClose`/`onFinish`, scrolls targets into view |
|
|
762
766
|
| [`ActionSheet`](doc/ActionSheet.md) | Feedback | iOS action sheet on `Sheet`: `actions=[{ key?, label, icon?, tone?: 'default' | 'destructive', disabled?, onSelect }]`, optional `title`/`message`, a separate Cancel button, `onClose(reason)` |
|
|
763
767
|
| [`SegmentedControl`](doc/SegmentedControl.md) | Core | Radiogroup view toggle (list/board, day/week): `options`, `value`/`defaultValue` + `onChange`, `size`, `fullWidth`, `name` for forms; arrow keys move the selection. Use `Tabs variant="segmented"` when the choice switches panels |
|
|
@@ -767,7 +771,7 @@ Interaction primitives that products used to compose by hand. All are `forwardRe
|
|
|
767
771
|
| [`BottomActionBar`](doc/BottomActionBar.md) | Block | Sticky bottom bar for a form's primary action: `pb-safe`, rides above the on-screen keyboard (`keyboardAware`), `stackOnMobile`; add `<BottomActionBar.Spacer />` at the end of the page |
|
|
768
772
|
|
|
769
773
|
```jsx
|
|
770
|
-
import { Drawer, Sheet, Popover, Textarea, Slider, Sortable, Tour, Button } from '@dreamtree-org/twreact-ui';
|
|
774
|
+
import { Drawer, Sheet, Popover, Textarea, Slider, Sortable, SortableGroup, Tour, Button } from '@dreamtree-org/twreact-ui';
|
|
771
775
|
|
|
772
776
|
<Drawer isOpen={open} onClose={() => setOpen(false)} title="Edit task" footer={<Button onClick={save}>Save</Button>}>
|
|
773
777
|
<Textarea label="Description" autoResize showCount maxLength={500} />
|
|
@@ -784,6 +788,11 @@ import { Drawer, Sheet, Popover, Textarea, Slider, Sortable, Tour, Button } from
|
|
|
784
788
|
|
|
785
789
|
<Sortable aria-label="Backlog" items={tasks} onReorder={setTasks} renderItem={(t) => t.title} />
|
|
786
790
|
|
|
791
|
+
<SortableGroup onMove={({ item, from, to }) => moveTask(item, from, to)} canDrop={(task, target) => canEnter(task, target.listId)}>
|
|
792
|
+
<Sortable id="backlog" aria-label="Backlog" items={backlog} onReorder={setBacklog} />
|
|
793
|
+
<Sortable id="sprint" aria-label="Sprint" items={sprint} onReorder={setSprint} />
|
|
794
|
+
</SortableGroup>
|
|
795
|
+
|
|
787
796
|
<Tour open={tourOpen} steps={[{ title: 'Welcome' }, { target: '[data-tour="new-task"]', title: 'Capture work' }]} onClose={() => setTourOpen(false)} />
|
|
788
797
|
```
|
|
789
798
|
|
|
@@ -804,12 +813,13 @@ screen readers (`accessibleTable`), shows `emptyState` for empty data, and disab
|
|
|
804
813
|
| [`AreaChart`](doc/AreaChart.md) | Volume over time, optionally `stacked` |
|
|
805
814
|
| [`DonutChart`](doc/DonutChart.md) | Part-to-whole (`variant="donut"` or `"pie"`, `centerLabel`) |
|
|
806
815
|
| [`Sparkline`](doc/Sparkline.md) | Word-sized trend for stat cards and table cells |
|
|
816
|
+
| [`ScatterChart`](doc/ScatterChart.md) | Two numeric axes, one point per entity: `x` + `y` keys, optional `index` (entity name) and `category` (series), `xAxisLabel` / `yAxisLabel`; single points sit on padded axes |
|
|
807
817
|
|
|
808
818
|
Shared props: `valueFormatter`, `height`, `showLegend`, `showTooltip`, `showXAxis`, `showYAxis`,
|
|
809
819
|
`showGrid`, `colors`, `animate`.
|
|
810
820
|
|
|
811
821
|
```jsx
|
|
812
|
-
import { LineChart, DonutChart, Sparkline } from '@dreamtree-org/twreact-ui/charts';
|
|
822
|
+
import { LineChart, DonutChart, Sparkline, ScatterChart } from '@dreamtree-org/twreact-ui/charts';
|
|
813
823
|
|
|
814
824
|
<LineChart
|
|
815
825
|
data={[{ month: 'Jan', revenue: 4200 }, { month: 'Feb', revenue: 5100 }]}
|
|
@@ -820,6 +830,7 @@ import { LineChart, DonutChart, Sparkline } from '@dreamtree-org/twreact-ui/char
|
|
|
820
830
|
/>
|
|
821
831
|
<DonutChart data={byStatus} index="status" category="tasks" centerLabel="63 tasks" title="Tasks by status" />
|
|
822
832
|
<Sparkline data={weekly} category="signups" color="success" title="Signups, last 4 weeks" />
|
|
833
|
+
<ScatterChart data={projects} x="health" y="variance" index="project" category="department" title="Health vs budget variance" />
|
|
823
834
|
```
|
|
824
835
|
|
|
825
836
|
### Rich text (optional entry point)
|
|
@@ -131,9 +131,9 @@ The library exports four kinds of things from `@dreamtree-org/twreact-ui`:
|
|
|
131
131
|
| **Core** | `Input`, `Button`, `Select`, `Table`, `Form`, `Accordion`, `Checkbox`, `ColorPicker`, `DatePicker`, `DateRangePicker`, `Loader`, `LocationPicker`, `PriceRangePicker`, `ProgressBar`, `Radio`, `Rate`, `RoundedTag`, `Skeleton`, `Switch`, `Tabs`, `ThreeDotPopover`, `Tooltip`, `SpeechToText`, `TextToSpeech`, `Textarea`, `Slider`, `Popover`, `SegmentedControl`, `SwipeableListItem` (swipe-to-reveal row actions), `SearchField` |
|
|
132
132
|
| **Navigation** | `Sidebar`, `Navbar`, `FootNav`, `Breadcrumbs` |
|
|
133
133
|
| **Feedback** | `Dialog`, `Toast` (+ `ToastProvider`, `ToastContainer`, `useToast`), `Alert`, `Drawer` (side sheet; `isOpen`/`onClose` like Dialog), `Sheet` (+ `Sheet.Header/Body/Footer`; phone sheet with snap points), `ActionSheet` (iOS action sheet: `actions` + separate Cancel), `Tour` (onboarding spotlight) |
|
|
134
|
-
| **Utility** | `Badge`, `Avatar`, `AvatarGroup` (overlapping stack + `max` "+N"), `Card`, `Pagination`, `Stepper`, `FileUpload`, `Condition`, `Carousel`, `Sortable` (drag + keyboard reorder), `PullToRefresh` (touch pull-to-refresh around a scroller) |
|
|
134
|
+
| **Utility** | `Badge`, `Avatar`, `AvatarGroup` (overlapping stack + `max` "+N"), `Card`, `Pagination`, `Stepper`, `FileUpload`, `Condition`, `Carousel`, `Sortable` (drag + keyboard reorder), `SortableGroup` (move items between `Sortable` lists, `canDrop`), `PullToRefresh` (touch pull-to-refresh around a scroller) |
|
|
135
135
|
| **Blocks** | `AppShell`, `PageHeader`, `StatCard`, `StatusPill`, `EmptyState`, `ErrorState`, `LoadingState`, `ConfirmDialog`, `BottomActionBar` (+ `BottomActionBar.Spacer`) — page-level patterns; build pages from these before composing layouts by hand |
|
|
136
|
-
| **Charts** (`@dreamtree-org/twreact-ui/charts`, peer `recharts`) | `LineChart`, `BarChart`, `AreaChart`, `DonutChart`, `Sparkline` — NOT exported from the root |
|
|
136
|
+
| **Charts** (`@dreamtree-org/twreact-ui/charts`, peer `recharts`) | `LineChart`, `BarChart`, `AreaChart`, `DonutChart`, `Sparkline`, `ScatterChart` — NOT exported from the root |
|
|
137
137
|
| **Rich text** (`@dreamtree-org/twreact-ui/rich-text`, peers `@tiptap/react @tiptap/pm @tiptap/starter-kit`) | `RichTextEditor` — NOT exported from the root |
|
|
138
138
|
|
|
139
139
|
### Hooks
|
|
@@ -204,7 +204,7 @@ When suggesting a component or new variant value, use this exact vocabulary.
|
|
|
204
204
|
**Blocks** are page-level patterns extracted from the products, so screens stop re-inventing them:
|
|
205
205
|
|
|
206
206
|
- `AppShell` — sidebar + top bar + mobile drawer (a left `Sheet`); pass `nav` items and `linkAs={Link}` in Next.js. `bottomNav={<FootNav … />}` adds a phone tab bar (below `md`, spacer included). Fills `min-h-dvh` and pads safe areas.
|
|
207
|
-
- `Sidebar` — every item renders as an `<a>`; give items an `href` (and `linkAs={Link}` in Next.js) so Ctrl/Cmd-click opens a new tab. Parents with `href` navigate + expand; the chevron toggles. Mark the current page `active: true` and its group opens on load (control groups with `expandedIds`/`defaultExpandedIds`/`onExpandedChange`). Top-level `group: 'Name'` adds section headings; `badge` (+ `badgeLabel: '3 unread'`) shows counts; `footer` pins links above the user block; `stickyOffset={64}` when a top bar sits above it. The mobile drawer (`isMobileOpen`/`setIsMobileOpen`) is inert when shut, closes on Escape, and opens/closes with an edge swipe (`swipeable`, default on). The content renders once (column on `md`+, drawer below), so don't render a second Sidebar for phones.
|
|
207
|
+
- `Sidebar` — every item renders as an `<a>`; give items an `href` (and `linkAs={Link}` in Next.js) so Ctrl/Cmd-click opens a new tab. Parents with `href` navigate + expand; the chevron toggles. Mark the current page `active: true` and its group opens on load (control groups with `expandedIds`/`defaultExpandedIds`/`onExpandedChange`). Top-level `group: 'Name'` adds section headings; `badge` (+ `badgeLabel: '3 unread'`) shows counts; `footer` pins links above the user block; `stickyOffset={64}` when a top bar sits above it. The mobile drawer (`isMobileOpen`/`setIsMobileOpen`) is inert when shut, closes on Escape, and opens/closes with an edge swipe (`swipeable`, default on). `collapsible={false}` drops the desktop collapse toggle (the drawer keeps "Close navigation"). Hide drawer items with real CSS if you must — the focus trap skips `display:none` / `visibility:hidden` elements. The content renders once (column on `md`+, drawer below), so don't render a second Sidebar for phones.
|
|
208
208
|
- `PageHeader` — the page's only `h1`, subtitle, one primary action, optional `back` link. `actionsPlacement="bottom"` pins the actions in a `BottomActionBar` on phones (inline on desktop).
|
|
209
209
|
- `BottomActionBar` — sticky bottom bar for a form's / checkout's primary action (`pb-safe`, `z-sticky`, rides above the on-screen keyboard via `visualViewport`). Children are the actions; `fullWidth` / `stackOnMobile` for phone layouts, `align`, `position="fixed" | "sticky"`. Put `<BottomActionBar.Spacer />` at the end of the page. Never hand-roll a `fixed bottom-0` action bar.
|
|
210
210
|
- `StatCard` — KPI tile (`label`, `value`, `icon`, `tone`, `change`).
|
|
@@ -232,9 +232,10 @@ When suggesting a component or new variant value, use this exact vocabulary.
|
|
|
232
232
|
- `Textarea` — same API as `Input` plus `autoResize`/`maxRows`; never a raw `<textarea>`.
|
|
233
233
|
- `Slider` — `defaultValue={40}` for one thumb, `[low, high]` for a range; `onChangeEnd` to save after a drag. A value bubble shows while dragging (`showBubble={false}` to hide).
|
|
234
234
|
- `Sortable` — `items` + `onReorder(newItems)` + `renderItem`; keyboard reordering and announcements are built in. Pass `handle` and spread `handleProps` on a grip for touch screens.
|
|
235
|
+
- `SortableGroup` — for boards / backlog → sprint: wrap the lists, give each `Sortable` an `id` (+ `aria-label`, used in announcements) and handle `onMove({ item, from: { listId, index }, to: { listId, index } })`; pass `canDrop(item, target, from)` (e.g. from a server transition list) so refused columns are marked and announced before the drop instead of reverting after it. Within-list reorders still call each list's `onReorder`. Give lists a `min-h-*` so empty ones can be dropped on.
|
|
235
236
|
- `PullToRefresh` — wrap a list: `<PullToRefresh onRefresh={() => refetch()} className="h-96">…</PullToRefresh>` (renders the scroller) or pass `scrollRef` to your own. `onRefresh` returns a promise; the spinner spins until it settles. `threshold` (64), `disabled`, `refreshingLabel`. Touch only — keep a refresh button for mouse/keyboard users.
|
|
236
237
|
- Haptics are opt-in: `haptics` on `Switch` / `Checkbox` (selection tick), `Sheet` (tick on a new snap point) and `ConfirmDialog` (warning on destructive open, success on confirm). Default `false`; never the only signal. For custom cues use `useHaptics().trigger('success')`.
|
|
237
|
-
- Charts (`/charts`) — `<LineChart data={rows} index="month" categories={['revenue', 'costs']} />`; same shape for `BarChart` (`stacked`, `horizontal`) and `AreaChart` (`stacked`); `DonutChart` takes `index` (name key) + `category` (value key) + `centerLabel`; `Sparkline` takes `category` + `color
|
|
238
|
+
- Charts (`/charts`) — `<LineChart data={rows} index="month" categories={['revenue', 'costs']} />`; same shape for `BarChart` (`stacked`, `horizontal`) and `AreaChart` (`stacked`); `DonutChart` takes `index` (name key) + `category` (value key) + `centerLabel`; `Sparkline` takes `category` + `color`; `ScatterChart` takes `x` + `y` (numeric keys) plus optional `index` (entity name) and `category` (series), e.g. `<ScatterChart data={projects} x="health" y="variance" index="project" category="department" />`. Colours are tokens (`colors={['primary', 'success-600']}`), never hex. Always pass `title` (accessible name) and, for key charts, a `description` with the takeaway. `valueFormatter` formats tooltip/axis/table values.
|
|
238
239
|
- `RichTextEditor` (`/rich-text`) — `label`/`error`/`helperText` like `Input`; `value` + `onChange(html)` (or `outputFormat="json"`); `toolbar={['bold', 'italic', 'link']}` to trim. Tell the user to **sanitize the HTML server-side**; never render it with `dangerouslySetInnerHTML` unsanitized.
|
|
239
240
|
- `Tour` — onboarding coach marks: `steps=[{ target: '[data-tour="x"]', title, content, placement }]`, `open`, `onClose(reason)`; a missing target falls back to a centred card.
|
|
240
241
|
|
|
@@ -312,7 +313,13 @@ with a `group` key (`{ value, label, group: 'Code' }`) — no need to pre-group.
|
|
|
312
313
|
`user.name` initials when `user.avatar` is missing; it fits a 390px phone.
|
|
313
314
|
`sticky` makes it a translucent sticky bar with the top safe area; `largeTitle="Inbox"`
|
|
314
315
|
adds an iOS large title that collapses on scroll. With `searchable`, phones get a
|
|
315
|
-
Search button that opens a `SearchField` sheet wired to `onSearch`.
|
|
316
|
+
Search button that opens a `SearchField` sheet wired to `onSearch`. When the left
|
|
317
|
+
button opens your Sidebar drawer (`leftIcon={<Menu />}`), name it with
|
|
318
|
+
`leftIconLabel="Open navigation"` (default "Go back") and pass
|
|
319
|
+
`leftIconProps={{ 'aria-expanded': open, 'aria-controls': 'app-sidebar' }}`.
|
|
320
|
+
|
|
321
|
+
**Select / DatePicker / DateRangePicker** show their placeholder muted (`text-muted`)
|
|
322
|
+
and set `data-empty` on the trigger while empty — don't add a muted `className` yourself.
|
|
316
323
|
|
|
317
324
|
**Tooltip** around a component (e.g. `<Button>`) in a row/grid: use
|
|
318
325
|
`customTrigger={<Button>…</Button>}` so there is one tab stop, not two. A lone
|
package/dist/ai-schema.json
CHANGED
|
@@ -1785,7 +1785,16 @@
|
|
|
1785
1785
|
"default": "false"
|
|
1786
1786
|
},
|
|
1787
1787
|
"onLeftIconClick": {
|
|
1788
|
-
"type": "() => void",
|
|
1788
|
+
"type": "(event: React.MouseEvent<HTMLButtonElement>) => void",
|
|
1789
|
+
"required": false
|
|
1790
|
+
},
|
|
1791
|
+
"leftIconLabel": {
|
|
1792
|
+
"type": "string",
|
|
1793
|
+
"required": false,
|
|
1794
|
+
"default": "\"Go back\""
|
|
1795
|
+
},
|
|
1796
|
+
"leftIconProps": {
|
|
1797
|
+
"type": "ButtonHTMLAttributes<HTMLButtonElement> & Record<`data-${string}`, string | undefined>",
|
|
1789
1798
|
"required": false
|
|
1790
1799
|
},
|
|
1791
1800
|
"onLoginClick": {
|
|
@@ -2435,6 +2444,118 @@
|
|
|
2435
2444
|
}
|
|
2436
2445
|
}
|
|
2437
2446
|
},
|
|
2447
|
+
"ScatterChart": {
|
|
2448
|
+
"group": "charts",
|
|
2449
|
+
"import": "@dreamtree-org/twreact-ui/charts",
|
|
2450
|
+
"forwardRef": true,
|
|
2451
|
+
"props": {
|
|
2452
|
+
"data": {
|
|
2453
|
+
"type": "ChartDatum[]",
|
|
2454
|
+
"required": true
|
|
2455
|
+
},
|
|
2456
|
+
"title": {
|
|
2457
|
+
"type": "string",
|
|
2458
|
+
"required": false
|
|
2459
|
+
},
|
|
2460
|
+
"description": {
|
|
2461
|
+
"type": "string",
|
|
2462
|
+
"required": false
|
|
2463
|
+
},
|
|
2464
|
+
"valueFormatter": {
|
|
2465
|
+
"type": "ChartValueFormatter",
|
|
2466
|
+
"required": false,
|
|
2467
|
+
"default": "toLocaleString"
|
|
2468
|
+
},
|
|
2469
|
+
"height": {
|
|
2470
|
+
"type": "number | string",
|
|
2471
|
+
"required": false,
|
|
2472
|
+
"default": "300"
|
|
2473
|
+
},
|
|
2474
|
+
"emptyState": {
|
|
2475
|
+
"type": "ReactNode",
|
|
2476
|
+
"required": false,
|
|
2477
|
+
"default": "\"No data to display\""
|
|
2478
|
+
},
|
|
2479
|
+
"accessibleTable": {
|
|
2480
|
+
"type": "boolean",
|
|
2481
|
+
"required": false,
|
|
2482
|
+
"default": "true"
|
|
2483
|
+
},
|
|
2484
|
+
"animate": {
|
|
2485
|
+
"type": "boolean",
|
|
2486
|
+
"required": false,
|
|
2487
|
+
"default": "true"
|
|
2488
|
+
},
|
|
2489
|
+
"showTooltip": {
|
|
2490
|
+
"type": "boolean",
|
|
2491
|
+
"required": false,
|
|
2492
|
+
"default": "true"
|
|
2493
|
+
},
|
|
2494
|
+
"x": {
|
|
2495
|
+
"type": "string",
|
|
2496
|
+
"required": true
|
|
2497
|
+
},
|
|
2498
|
+
"y": {
|
|
2499
|
+
"type": "string",
|
|
2500
|
+
"required": true
|
|
2501
|
+
},
|
|
2502
|
+
"index": {
|
|
2503
|
+
"type": "string",
|
|
2504
|
+
"required": false
|
|
2505
|
+
},
|
|
2506
|
+
"category": {
|
|
2507
|
+
"type": "string",
|
|
2508
|
+
"required": false
|
|
2509
|
+
},
|
|
2510
|
+
"colors": {
|
|
2511
|
+
"type": "ChartColor[]",
|
|
2512
|
+
"required": false,
|
|
2513
|
+
"default": "primary, success, warning, error, info, secondary, gray"
|
|
2514
|
+
},
|
|
2515
|
+
"xAxisFormatter": {
|
|
2516
|
+
"type": "(value: number) => string",
|
|
2517
|
+
"required": false,
|
|
2518
|
+
"default": "toLocaleString"
|
|
2519
|
+
},
|
|
2520
|
+
"xAxisLabel": {
|
|
2521
|
+
"type": "string",
|
|
2522
|
+
"required": false
|
|
2523
|
+
},
|
|
2524
|
+
"yAxisLabel": {
|
|
2525
|
+
"type": "string",
|
|
2526
|
+
"required": false
|
|
2527
|
+
},
|
|
2528
|
+
"showLegend": {
|
|
2529
|
+
"type": "boolean",
|
|
2530
|
+
"required": false,
|
|
2531
|
+
"default": "true"
|
|
2532
|
+
},
|
|
2533
|
+
"showXAxis": {
|
|
2534
|
+
"type": "boolean",
|
|
2535
|
+
"required": false,
|
|
2536
|
+
"default": "true"
|
|
2537
|
+
},
|
|
2538
|
+
"showYAxis": {
|
|
2539
|
+
"type": "boolean",
|
|
2540
|
+
"required": false,
|
|
2541
|
+
"default": "true"
|
|
2542
|
+
},
|
|
2543
|
+
"showGrid": {
|
|
2544
|
+
"type": "boolean",
|
|
2545
|
+
"required": false,
|
|
2546
|
+
"default": "true"
|
|
2547
|
+
},
|
|
2548
|
+
"yAxisWidth": {
|
|
2549
|
+
"type": "number",
|
|
2550
|
+
"required": false,
|
|
2551
|
+
"default": "48 (36 when the chart is narrower than 400 px)"
|
|
2552
|
+
},
|
|
2553
|
+
"aspectRatio": {
|
|
2554
|
+
"type": "number",
|
|
2555
|
+
"required": false
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
},
|
|
2438
2559
|
"SearchField": {
|
|
2439
2560
|
"group": "core",
|
|
2440
2561
|
"import": "@dreamtree-org/twreact-ui",
|
|
@@ -2811,6 +2932,11 @@
|
|
|
2811
2932
|
"required": false,
|
|
2812
2933
|
"default": "false"
|
|
2813
2934
|
},
|
|
2935
|
+
"collapsible": {
|
|
2936
|
+
"type": "boolean",
|
|
2937
|
+
"required": false,
|
|
2938
|
+
"default": "true"
|
|
2939
|
+
},
|
|
2814
2940
|
"onToggle": {
|
|
2815
2941
|
"type": "() => void",
|
|
2816
2942
|
"required": false
|
|
@@ -3089,6 +3215,29 @@
|
|
|
3089
3215
|
"messages": {
|
|
3090
3216
|
"type": "SortableMessages",
|
|
3091
3217
|
"required": false
|
|
3218
|
+
},
|
|
3219
|
+
"id": {
|
|
3220
|
+
"type": "string",
|
|
3221
|
+
"required": false
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
},
|
|
3225
|
+
"SortableGroup": {
|
|
3226
|
+
"group": "utility",
|
|
3227
|
+
"import": "@dreamtree-org/twreact-ui",
|
|
3228
|
+
"forwardRef": true,
|
|
3229
|
+
"props": {
|
|
3230
|
+
"onMove": {
|
|
3231
|
+
"type": "(move: SortableMove<T>) => void",
|
|
3232
|
+
"required": false
|
|
3233
|
+
},
|
|
3234
|
+
"canDrop": {
|
|
3235
|
+
"type": "(item: T, target: SortableLocation, from: SortableLocation) => boolean",
|
|
3236
|
+
"required": false
|
|
3237
|
+
},
|
|
3238
|
+
"children": {
|
|
3239
|
+
"type": "ReactNode",
|
|
3240
|
+
"required": false
|
|
3092
3241
|
}
|
|
3093
3242
|
}
|
|
3094
3243
|
},
|
package/dist/charts/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
import type { AreaChartProps, BarChartProps, DonutChartProps, LineChartProps, SparklineProps } from "../types/charts";
|
|
2
|
+
import type { AreaChartProps, BarChartProps, DonutChartProps, LineChartProps, ScatterChartProps, SparklineProps } from "../types/charts";
|
|
3
3
|
export declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export declare const AreaChart: React.ForwardRefExoticComponent<AreaChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export declare const DonutChart: React.ForwardRefExoticComponent<DonutChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export declare const Sparkline: React.ForwardRefExoticComponent<SparklineProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ScatterChart: React.ForwardRefExoticComponent<ScatterChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
9
|
export * from "../types/charts";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|