@platned/ui 0.10.4 → 1.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 +42 -98
- package/dist/blocks-charts.cjs +459 -0
- package/dist/blocks-charts.cjs.map +1 -0
- package/dist/blocks-charts.d.cts +64 -0
- package/dist/blocks-charts.d.ts +64 -0
- package/dist/blocks-charts.js +440 -0
- package/dist/blocks-charts.js.map +1 -0
- package/dist/blocks.cjs +8007 -0
- package/dist/blocks.cjs.map +1 -0
- package/dist/blocks.d.cts +3082 -0
- package/dist/blocks.d.ts +3082 -0
- package/dist/blocks.js +8223 -0
- package/dist/blocks.js.map +1 -0
- package/dist/chart.cjs +226 -0
- package/dist/chart.cjs.map +1 -0
- package/dist/chart.d.ts +66 -0
- package/dist/chart.js +183 -0
- package/dist/chart.js.map +1 -0
- package/dist/chunk-2L5XAYNK.js +11 -0
- package/dist/chunk-2L5XAYNK.js.map +1 -0
- package/dist/chunk-327NSKZW.js +3176 -0
- package/dist/chunk-327NSKZW.js.map +1 -0
- package/dist/chunk-GJJWRZ4B.js +200 -0
- package/dist/chunk-GJJWRZ4B.js.map +1 -0
- package/dist/chunk-WGCAQEZ4.js +178 -0
- package/dist/chunk-WGCAQEZ4.js.map +1 -0
- package/dist/code-block-BgEiLXpO.d.ts +111 -0
- package/dist/code-block-highlight.cjs +489 -0
- package/dist/code-block-highlight.cjs.map +1 -0
- package/dist/code-block-highlight.d.ts +28 -0
- package/dist/code-block-highlight.js +120 -0
- package/dist/code-block-highlight.js.map +1 -0
- package/dist/data-table-Dec6t8NO.d.ts +729 -0
- package/dist/data-table.cjs +3506 -2219
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +2 -1
- package/dist/data-table.js +1396 -246
- package/dist/data-table.js.map +1 -1
- package/dist/index.cjs +8934 -11994
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2524 -5312
- package/dist/index.js +4678 -9574
- package/dist/index.js.map +1 -1
- package/dist/map.cjs +432 -0
- package/dist/map.cjs.map +1 -0
- package/dist/map.d.cts +294 -0
- package/dist/map.d.ts +294 -0
- package/dist/map.js +422 -0
- package/dist/map.js.map +1 -0
- package/dist/theme.css +1897 -0
- package/package.json +65 -24
- package/dist/chunk-OVIRTNT4.js +0 -2787
- package/dist/chunk-OVIRTNT4.js.map +0 -1
- package/dist/data-table-JX-vnL0F.d.ts +0 -464
- package/dist/sidebar.cjs +0 -108
- package/dist/sidebar.cjs.map +0 -1
- package/dist/sidebar.d.cts +0 -257
- package/dist/sidebar.d.ts +0 -257
- package/dist/sidebar.js +0 -70
- package/dist/sidebar.js.map +0 -1
- package/dist/styles.css +0 -1
- package/dist/tokens.css +0 -1
- package/tailwind-preset.cjs +0 -446
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, ReactNode, ReactElement } from 'react';
|
|
3
|
-
import { Column, Table as Table$1, ColumnDef, RowData, SortingState, ColumnFiltersState, PaginationState, VisibilityState, RowSelectionState, TableOptions } from '@tanstack/react-table';
|
|
4
|
-
|
|
5
|
-
/** How a column appears in card mode. */
|
|
6
|
-
type ColumnMobileRole = 'title' | 'status' | 'actions' | 'field' | 'hidden';
|
|
7
|
-
|
|
8
|
-
type TableDensity = 'default' | 'compact';
|
|
9
|
-
type TableSortDirection = 'ascending' | 'descending';
|
|
10
|
-
/**
|
|
11
|
-
* The composable table primitive, matching Figma's `Table` and `Table cell`.
|
|
12
|
-
*
|
|
13
|
-
* `DataTable` is the config-driven form — you give it `columns` and `rows` and it renders
|
|
14
|
-
* everything. It is the right tool most of the time, and it is not going away. But it
|
|
15
|
-
* cannot express a grouped header, a footer row, a colspan, or a cell layout outside its
|
|
16
|
-
* `render` signature, so anything unusual meant abandoning it for a hand-rolled `<table>`
|
|
17
|
-
* with none of the semantics. These parts are that escape hatch with the semantics kept.
|
|
18
|
-
*
|
|
19
|
-
* Figma's `Table cell` has a 32-value `Style` axis (lead checkbox, lead avatar, badges
|
|
20
|
-
* multiple, trend positive/negative, action icons, star ratings, payment method…). Those
|
|
21
|
-
* are *compositions*, not variants of one component — each is an existing library
|
|
22
|
-
* component dropped into a cell — so they are expressed here as `TableCell` plus whatever
|
|
23
|
-
* goes inside it, rather than 32 props.
|
|
24
|
-
*/
|
|
25
|
-
interface TableProps extends HTMLAttributes<HTMLTableElement> {
|
|
26
|
-
/** Names the table. Required unless you render a `TableCaption`. */
|
|
27
|
-
label?: string;
|
|
28
|
-
density?: TableDensity;
|
|
29
|
-
/** Equal-width columns driven by `<colgroup>`, matching `DataTable`. Default `false`. */
|
|
30
|
-
fixed?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Cap the height (px number or CSS length) and scroll the body inside it. Pair with
|
|
33
|
-
* `<TableHead sticky>` to keep the header row in view. The wrapper becomes a focusable region
|
|
34
|
-
* named by `label`, so the keyboard can scroll it. New in 0.7.1.
|
|
35
|
-
*/
|
|
36
|
-
maxHeight?: number | string;
|
|
37
|
-
}
|
|
38
|
-
declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttributes<HTMLTableElement>>;
|
|
39
|
-
interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* A visible table title that also names the table. Prefer this over `label` when the
|
|
43
|
-
* heading is on screen anyway — `DataTable` could not be named at all before 0.4.0.
|
|
44
|
-
*/
|
|
45
|
-
declare const TableCaption: react.ForwardRefExoticComponent<TableCaptionProps & react.RefAttributes<HTMLTableCaptionElement>>;
|
|
46
|
-
declare const TableHeader: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
47
|
-
declare const TableBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
48
|
-
declare const TableFooter: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
49
|
-
/**
|
|
50
|
-
* A row's state tint. Each is a meaning, not a colour: `muted` for an inactive or ended
|
|
51
|
-
* record, `danger` for a denied or failed one, and so on. New in 0.7.0, to replace the
|
|
52
|
-
* `className={active ? '' : 'bg-default-secondary'}` consumers were writing on every row.
|
|
53
|
-
*/
|
|
54
|
-
type TableRowTone = 'default' | 'muted' | 'brand' | 'positive' | 'warning' | 'danger';
|
|
55
|
-
interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
56
|
-
selected?: boolean;
|
|
57
|
-
/** State tint; see `TableRowTone`. Selection wins over tone. */
|
|
58
|
-
tone?: TableRowTone;
|
|
59
|
-
/** De-emphasises the row (an expired or archived record) without hiding it. */
|
|
60
|
-
dimmed?: boolean;
|
|
61
|
-
}
|
|
62
|
-
declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
|
|
63
|
-
interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
64
|
-
/**
|
|
65
|
-
* Makes the header a sort control. `false` means sortable but not currently sorted.
|
|
66
|
-
*
|
|
67
|
-
* `aria-sort` goes on the `<th>` and must be present on exactly one column at a time —
|
|
68
|
-
* it is the only non-visual signal of sort state, and `DataTable` had none.
|
|
69
|
-
*/
|
|
70
|
-
sort?: TableSortDirection | false;
|
|
71
|
-
onSort?: () => void;
|
|
72
|
-
align?: 'left' | 'center' | 'right';
|
|
73
|
-
/** Keeps the header visible while the body scrolls. */
|
|
74
|
-
sticky?: boolean;
|
|
75
|
-
}
|
|
76
|
-
declare const TableHead: react.ForwardRefExoticComponent<TableHeadProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
77
|
-
interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
|
|
78
|
-
align?: 'left' | 'center' | 'right';
|
|
79
|
-
/** Vertical rhythm. Matches `DataTable`'s `density`. */
|
|
80
|
-
density?: TableDensity;
|
|
81
|
-
/** Makes this the row's header cell — `scope="row"`, for a table with row headers. */
|
|
82
|
-
header?: boolean;
|
|
83
|
-
}
|
|
84
|
-
declare const TableCell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* The composable parts of `DataTable`. `DataTable` renders all of them for you; they are
|
|
88
|
-
* exported for a table that needs its own layout around them (a toolbar elsewhere on the
|
|
89
|
-
* page, a pager in a sticky footer) or a custom header renderer.
|
|
90
|
-
*/
|
|
91
|
-
/** The id `createSelectColumn` gives its column, so `DataTable` can find and place it. */
|
|
92
|
-
declare const SELECT_COLUMN_ID = "select";
|
|
93
|
-
interface DataTableColumnHeaderProps<TData, TValue> {
|
|
94
|
-
column: Column<TData, TValue>;
|
|
95
|
-
/** Header text. Defaults to the column's label. */
|
|
96
|
-
title?: string;
|
|
97
|
-
className?: string;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* A header that sorts its column when the column can sort, and plain text when it cannot.
|
|
101
|
-
* `DataTable` uses it for every string `header`. Use it yourself inside a `header` render
|
|
102
|
-
* function to keep the sort control while adding something next to it.
|
|
103
|
-
*
|
|
104
|
-
* A click toggles the sort between its two directions; the first click uses the column's
|
|
105
|
-
* `sortDescFirst` (descending first for numbers, by TanStack's default). From 0.9.4 a click no
|
|
106
|
-
* longer turns the sort off. Shift-click adds the column to a multi-column sort. The direction is announced through `aria-sort` on the `<th>`, which
|
|
107
|
-
* `DataTable` sets, so this button carries only the visible chevron.
|
|
108
|
-
*/
|
|
109
|
-
declare function DataTableColumnHeader<TData, TValue>({ column, title, className, }: DataTableColumnHeaderProps<TData, TValue>): react.JSX.Element;
|
|
110
|
-
interface CreateSelectColumnOptions<TData> {
|
|
111
|
-
/** Names each row's checkbox, e.g. `(row) => \`Select ${row.name}\``. Default "Select row". */
|
|
112
|
-
getRowLabel?: (row: TData) => string;
|
|
113
|
-
/** Names the header checkbox. Default "Select all rows on this page". */
|
|
114
|
-
selectAllLabel?: string;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* A leading checkbox column. `DataTable` adds one automatically when `enableRowSelection` is
|
|
118
|
-
* set and the columns have none, so call this only to place it yourself or to name the rows.
|
|
119
|
-
*
|
|
120
|
-
* The header checkbox selects the current *page*, which is what a user can see, and shows
|
|
121
|
-
* indeterminate while some of the page is selected.
|
|
122
|
-
*/
|
|
123
|
-
declare function createSelectColumn<TData>(options?: CreateSelectColumnOptions<TData>): ColumnDef<TData, unknown>;
|
|
124
|
-
interface DataTableViewOptionsProps<TData> {
|
|
125
|
-
table: Table$1<TData>;
|
|
126
|
-
/** Trigger text. Default "Columns". */
|
|
127
|
-
label?: string;
|
|
128
|
-
}
|
|
129
|
-
/** A "Columns" menu that shows and hides every column whose `enableHiding` is not false. */
|
|
130
|
-
declare function DataTableViewOptions<TData>({ table, label }: DataTableViewOptionsProps<TData>): react.JSX.Element | null;
|
|
131
|
-
interface DataTablePaginationProps<TData> {
|
|
132
|
-
table: Table$1<TData>;
|
|
133
|
-
/** Page sizes on offer. An empty array hides the selector. Default `[10, 20, 50]`. */
|
|
134
|
-
pageSizeOptions?: number[];
|
|
135
|
-
/** Replaces the "Showing 1–10 of 57" summary. */
|
|
136
|
-
summary?: ReactNode;
|
|
137
|
-
}
|
|
138
|
-
/** The pager row: a range summary, a page-size selector, and page buttons. */
|
|
139
|
-
declare function DataTablePagination<TData>({ table, pageSizeOptions, summary, }: DataTablePaginationProps<TData>): react.JSX.Element;
|
|
140
|
-
|
|
141
|
-
type ProgressBarTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral';
|
|
142
|
-
type ProgressBarSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
143
|
-
interface ProgressBarProps {
|
|
144
|
-
/** 0–100. Values outside the range are clamped. */
|
|
145
|
-
value: number;
|
|
146
|
-
tone?: ProgressBarTone;
|
|
147
|
-
size?: ProgressBarSize;
|
|
148
|
-
/** Caption above the bar. Also becomes the accessible name. */
|
|
149
|
-
label?: string;
|
|
150
|
-
/** Show the percentage at the right of the label row. */
|
|
151
|
-
showValue?: boolean;
|
|
152
|
-
/** CSS radius override, e.g. `'1px'` for a square-ended bar. Defaults to fully round. */
|
|
153
|
-
radius?: string;
|
|
154
|
-
/** Accessible name when there is no visible `label`. */
|
|
155
|
-
'aria-label'?: string;
|
|
156
|
-
/**
|
|
157
|
-
* Draw the bar as this many equal steps, filled in whole steps, e.g. a password-strength
|
|
158
|
-
* meter. New in 0.7.0; replaces hand-built rows of tinted bars.
|
|
159
|
-
*/
|
|
160
|
-
segments?: number;
|
|
161
|
-
/**
|
|
162
|
-
* What the value means, announced instead of the number (`aria-valuetext`), e.g. "Strong".
|
|
163
|
-
* A strength meter at 75 means nothing as "75 percent".
|
|
164
|
-
*/
|
|
165
|
-
valueText?: string;
|
|
166
|
-
/**
|
|
167
|
-
* Applied to the track. This is how you set a fixed width — `className="w-16"`.
|
|
168
|
-
* It genuinely overrides the base `w-full` because this file uses `cn`.
|
|
169
|
-
*/
|
|
170
|
-
className?: string;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* A horizontal progress / proportion bar.
|
|
174
|
-
*
|
|
175
|
-
* Was `WidgetProgressBar` in 0.2.0, which fixed the height at 6px and lived under
|
|
176
|
-
* `widgets/` despite being a general-purpose primitive — so `TableCellProgress`
|
|
177
|
-
* hand-rolled a second copy rather than reuse it. It also had no ARIA at all.
|
|
178
|
-
*/
|
|
179
|
-
declare function ProgressBar({ value, tone, size, label, showValue, radius, 'aria-label': ariaLabel, segments, valueText, className, }: ProgressBarProps): react.JSX.Element;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Cell renderers for `DataTable` (and the `Table` parts). Unchanged in 0.7.0; moved out of
|
|
183
|
-
* `data-table.tsx` when the table itself was rebuilt on TanStack Table.
|
|
184
|
-
*/
|
|
185
|
-
/**
|
|
186
|
-
* Cell type scale.
|
|
187
|
-
*
|
|
188
|
-
* Named `size`, not `density`, and deliberately *not* inherited from the table: the two
|
|
189
|
-
* real compact tables disagree about the mapping — the audit table wants default
|
|
190
|
-
* padding with small cell text — so inheritance could not express it anyway, and it
|
|
191
|
-
* would make these render one size inside a table and another outside one.
|
|
192
|
-
*/
|
|
193
|
-
type TableCellSize = 'sm' | 'md';
|
|
194
|
-
interface TableCellLeadTextProps {
|
|
195
|
-
primary: string;
|
|
196
|
-
/**
|
|
197
|
-
* The muted second line. A string ellipsises with a `title`. From 0.9.1 it can also be an
|
|
198
|
-
* element, such as `<EmailText email={…} />`, which manages its own overflow: an email
|
|
199
|
-
* should truncate before the `@`, never wrap mid-word.
|
|
200
|
-
*/
|
|
201
|
-
secondary?: ReactNode;
|
|
202
|
-
size?: TableCellSize;
|
|
203
|
-
className?: string;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Primary text plus an optional muted subtitle — for lead entity/name cells.
|
|
207
|
-
*
|
|
208
|
-
* Both lines ellipsise, with the full text as a `title`, so a long name can't stretch the row.
|
|
209
|
-
* `min-w-0` on the root is load-bearing: callers put this next to an Avatar in a flex row, and a
|
|
210
|
-
* flex item doesn't shrink below its content width without it, so `truncate` would never fire.
|
|
211
|
-
*/
|
|
212
|
-
declare function TableCellLeadText({ primary, secondary, size, className }: TableCellLeadTextProps): react.JSX.Element;
|
|
213
|
-
interface TableCellTextProps {
|
|
214
|
-
children: ReactNode;
|
|
215
|
-
/** Muted (secondary) by default; pass false for the primary colour. */
|
|
216
|
-
muted?: boolean;
|
|
217
|
-
size?: TableCellSize;
|
|
218
|
-
/**
|
|
219
|
-
* Ellipsise with the full text as a `title` (default). `false` keeps the text on one line at
|
|
220
|
-
* its full width instead, for a column that is sized to fit its content.
|
|
221
|
-
*
|
|
222
|
-
* Defaulted on in 0.8.3. Until then the default was a bare `whitespace-nowrap`, which in a
|
|
223
|
-
* column narrower than the text clipped it mid-glyph with no ellipsis and no way to read the
|
|
224
|
-
* rest.
|
|
225
|
-
*/
|
|
226
|
-
truncate?: boolean;
|
|
227
|
-
className?: string;
|
|
228
|
-
}
|
|
229
|
-
/** Plain one-line text cell. */
|
|
230
|
-
declare function TableCellText({ children, muted, size, truncate, className, }: TableCellTextProps): react.JSX.Element;
|
|
231
|
-
interface TableCellBadgeProps {
|
|
232
|
-
label: string;
|
|
233
|
-
className?: string;
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Small outlined chip — entity type labels, categories. A label longer than the column
|
|
237
|
-
* ellipsises inside the chip, with the full text as a `title`, rather than overflowing it.
|
|
238
|
-
*/
|
|
239
|
-
declare function TableCellBadge({ label, className }: TableCellBadgeProps): react.JSX.Element;
|
|
240
|
-
interface TableCellProgressProps {
|
|
241
|
-
percent: number;
|
|
242
|
-
/**
|
|
243
|
-
* Bar colour. `brand` is 0.2.0's default and byte-identical to it — `bg-brand`
|
|
244
|
-
* resolves to the same `--prim-brand-900` the old raw-hex default hardcoded.
|
|
245
|
-
*/
|
|
246
|
-
tone?: ProgressBarTone;
|
|
247
|
-
size?: TableCellSize;
|
|
248
|
-
/**
|
|
249
|
-
* What the bar measures, e.g. "Risk score" — the bar's accessible name, with the value
|
|
250
|
-
* announced by the progressbar role. Without it the bar is named by its percentage alone.
|
|
251
|
-
*/
|
|
252
|
-
label?: string;
|
|
253
|
-
className?: string;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Mini progress bar with its percentage at the end. The bar fills whatever width the cell gives
|
|
257
|
-
* it, as shadcn's Progress (`w-full`), Ant Design's line Progress and MUI's LinearProgress do:
|
|
258
|
-
* through 0.7.0 it was a fixed 48 / 64px, which left most of a wide column, or of a card field in
|
|
259
|
-
* the responsive layout, empty. `size` now sets the bar's thickness (4 / 6px).
|
|
260
|
-
*/
|
|
261
|
-
declare function TableCellProgress({ percent, tone, size, label, className, }: TableCellProgressProps): react.JSX.Element;
|
|
262
|
-
|
|
263
|
-
type DataTableColumnAlign = 'start' | 'center' | 'end';
|
|
264
|
-
/**
|
|
265
|
-
* Per-column layout options, carried on TanStack's `meta`. Declared by augmenting TanStack's
|
|
266
|
-
* own `ColumnMeta`, so `meta` on your `ColumnDef` is typed with no extra import:
|
|
267
|
-
*
|
|
268
|
-
* const columns: ColumnDef<Supplier>[] = [
|
|
269
|
-
* { accessorKey: 'name', header: 'Supplier', meta: { width: '280px', grow: true, mobile: 'title' } },
|
|
270
|
-
* ];
|
|
271
|
-
*/
|
|
272
|
-
declare module '@tanstack/react-table' {
|
|
273
|
-
interface ColumnMeta<TData extends RowData, TValue> {
|
|
274
|
-
/**
|
|
275
|
-
* CSS width for the column's `<col>`, e.g. `"320px"` or `"10rem"`. A column is never
|
|
276
|
-
* narrower than its header text. With `grow`, this is the floor instead.
|
|
277
|
-
*/
|
|
278
|
-
width?: string;
|
|
279
|
-
/** Absorbs the table's remaining width, with `width` as its floor. Usually one column. */
|
|
280
|
-
grow?: boolean;
|
|
281
|
-
/** Horizontal alignment of the header and cells. Default `start`. */
|
|
282
|
-
align?: DataTableColumnAlign;
|
|
283
|
-
/**
|
|
284
|
-
* The cell renders its own controls (a button, a toggle, a menu). Presses inside it stop
|
|
285
|
-
* before reaching the row's `onRowClick`, and the cell stops clipping its overflow, so
|
|
286
|
-
* focus rings are not cut off.
|
|
287
|
-
*/
|
|
288
|
-
interactive?: boolean;
|
|
289
|
-
/** Keep the header for screen readers but hide it visually, e.g. an actions column. */
|
|
290
|
-
hideHeader?: boolean;
|
|
291
|
-
/** The column's part in card mode. See `ColumnMobileRole`. Default `field`. */
|
|
292
|
-
mobile?: ColumnMobileRole;
|
|
293
|
-
/** Pin the first (`start`) or last (`end`) visible column while the table scrolls sideways. */
|
|
294
|
-
sticky?: 'start' | 'end';
|
|
295
|
-
/** The column's name where its header cannot be shown as text: menus, card labels. */
|
|
296
|
-
label?: string;
|
|
297
|
-
/** Extra classes on the header cell. An escape hatch; prefer `align`. */
|
|
298
|
-
headerClassName?: string;
|
|
299
|
-
/** Extra classes on each body cell. An escape hatch; prefer `align`. */
|
|
300
|
-
cellClassName?: string;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
type DataTableDensity = 'default' | 'compact';
|
|
304
|
-
type DataTableAlign = 'center' | 'top';
|
|
305
|
-
/** The table state you can control. Every key is optional and independently controlled. */
|
|
306
|
-
interface DataTableState {
|
|
307
|
-
sorting: SortingState;
|
|
308
|
-
globalFilter: string;
|
|
309
|
-
columnFilters: ColumnFiltersState;
|
|
310
|
-
pagination: PaginationState;
|
|
311
|
-
columnVisibility: VisibilityState;
|
|
312
|
-
rowSelection: RowSelectionState;
|
|
313
|
-
}
|
|
314
|
-
/** Hand an operation to the server. The table then shows `data` as given for that operation. */
|
|
315
|
-
interface DataTableManual {
|
|
316
|
-
sorting?: boolean;
|
|
317
|
-
filtering?: boolean;
|
|
318
|
-
pagination?: boolean;
|
|
319
|
-
/** Total rows on the server. Needed with `pagination`, so the pager knows the page count. */
|
|
320
|
-
rowCount?: number;
|
|
321
|
-
}
|
|
322
|
-
interface DataTableSearchOptions {
|
|
323
|
-
/** Filter one column instead of every column. */
|
|
324
|
-
columnId?: string;
|
|
325
|
-
placeholder?: string;
|
|
326
|
-
/** Accessible name. Default "Search". */
|
|
327
|
-
label?: string;
|
|
328
|
-
}
|
|
329
|
-
interface DataTableRowLinkProps {
|
|
330
|
-
href: string;
|
|
331
|
-
className: string;
|
|
332
|
-
children: ReactNode;
|
|
333
|
-
'data-row-link': '';
|
|
334
|
-
}
|
|
335
|
-
interface DataTableProps<TData, TValue = unknown> {
|
|
336
|
-
/** TanStack column definitions. Layout options go in each column's `meta`. */
|
|
337
|
-
columns: ColumnDef<TData, TValue>[];
|
|
338
|
-
data: TData[];
|
|
339
|
-
/** A stable id per row. Defaults to the row index, which breaks selection across re-sorts. */
|
|
340
|
-
getRowId?: (row: TData, index: number) => string;
|
|
341
|
-
/**
|
|
342
|
-
* Accessible name, rendered as a visually hidden `<caption>`. Give the table either this or
|
|
343
|
-
* `caption`: an unnamed table is announced as just "table".
|
|
344
|
-
*/
|
|
345
|
-
label?: string;
|
|
346
|
-
/** A visible caption above the table, which also names it. */
|
|
347
|
-
caption?: ReactNode;
|
|
348
|
-
/** A search box. `true` filters across every column; pass options to filter one column. */
|
|
349
|
-
searchable?: boolean | DataTableSearchOptions;
|
|
350
|
-
/** A "Columns" menu to show and hide columns. */
|
|
351
|
-
columnVisibility?: boolean;
|
|
352
|
-
/** Page the rows. Default `true`. */
|
|
353
|
-
pagination?: boolean;
|
|
354
|
-
/** Rows per page to start with. Default `10`. */
|
|
355
|
-
pageSize?: number;
|
|
356
|
-
/** Page sizes to offer. Default `[10, 20, 50]`; `[]` hides the selector. */
|
|
357
|
-
pageSizeOptions?: number[];
|
|
358
|
-
/**
|
|
359
|
-
* Adds a leading checkbox column (unless the columns already include `createSelectColumn()`).
|
|
360
|
-
* Pass a function to make only some rows selectable.
|
|
361
|
-
*/
|
|
362
|
-
enableRowSelection?: boolean | ((row: TData) => boolean);
|
|
363
|
-
/** The selected rows, every time the selection changes. */
|
|
364
|
-
onSelectionChange?: (rows: TData[]) => void;
|
|
365
|
-
/** Names a row for its selection checkbox and its card, e.g. `(s) => s.name`. */
|
|
366
|
-
getRowLabel?: (row: TData) => string;
|
|
367
|
-
/**
|
|
368
|
-
* Whole-row activation for rows that open something in place (a drawer, a modal). Keyboard
|
|
369
|
-
* users focus the row and press Enter or Space. Rows that navigate should use `getRowHref`.
|
|
370
|
-
*/
|
|
371
|
-
onRowClick?: (row: TData) => void;
|
|
372
|
-
/**
|
|
373
|
-
* The row's destination. The title cell renders as a real link (so middle-click, open in a
|
|
374
|
-
* new tab and screen-reader link lists all work) and a click anywhere else on the row follows
|
|
375
|
-
* it. Takes precedence over `onRowClick`.
|
|
376
|
-
*/
|
|
377
|
-
getRowHref?: (row: TData) => string;
|
|
378
|
-
/**
|
|
379
|
-
* Renders the row link, e.g. through your router's `Link`. Default: a plain `<a>`.
|
|
380
|
-
*
|
|
381
|
-
* The row comes as a second argument rather than inside `props`, so spreading `props` onto a
|
|
382
|
-
* link never puts the row object on a DOM element. Use it for anything the link needs per row,
|
|
383
|
-
* e.g. router state: `({ href, ...props }, row) => <Link to={href} state={{ from: row.id }} {...props} />`.
|
|
384
|
-
*/
|
|
385
|
-
renderRowLink?: (props: DataTableRowLinkProps, row: TData) => ReactElement;
|
|
386
|
-
/** A state tint per row, e.g. `(u) => (u.active ? undefined : 'muted')`. */
|
|
387
|
-
getRowTone?: (row: TData) => TableRowTone | undefined;
|
|
388
|
-
/** De-emphasise some rows, e.g. expired ones. */
|
|
389
|
-
getRowDimmed?: (row: TData) => boolean;
|
|
390
|
-
/** Shows skeleton rows in place of `data`. */
|
|
391
|
-
loading?: boolean;
|
|
392
|
-
/** How many skeleton rows. Default `5`. */
|
|
393
|
-
loadingRows?: number;
|
|
394
|
-
/** A load failure, shown in place of the rows. Takes precedence over loading and empty. */
|
|
395
|
-
error?: ReactNode;
|
|
396
|
-
/** Adds a Retry button to the error state. */
|
|
397
|
-
onRetry?: () => void;
|
|
398
|
-
/** Shown when there are no rows. A string, or your own node. Default "No results found." */
|
|
399
|
-
empty?: ReactNode;
|
|
400
|
-
/** Extra toolbar content beside the search box: filters, a primary action. */
|
|
401
|
-
toolbar?: ReactNode;
|
|
402
|
-
/** Extra content below the pager, e.g. a "refreshed 2 min ago" note. */
|
|
403
|
-
footer?: ReactNode;
|
|
404
|
-
density?: DataTableDensity;
|
|
405
|
-
/** Vertical alignment of body cells. Use `top` for multi-line or ragged cells. */
|
|
406
|
-
align?: DataTableAlign;
|
|
407
|
-
/**
|
|
408
|
-
* Render rows as cards when the table's own width is below the breakpoint. Default `true`
|
|
409
|
-
* at 560px. `false` always renders a table.
|
|
410
|
-
*/
|
|
411
|
-
responsive?: boolean | {
|
|
412
|
-
breakpoint?: number;
|
|
413
|
-
};
|
|
414
|
-
/**
|
|
415
|
-
* Cap the table's height (px number or any CSS length) and scroll the body inside it, with the
|
|
416
|
-
* header row pinned. Works with horizontal scrolling and sticky columns, and caps the card list
|
|
417
|
-
* in the responsive layout. The pattern of MUI's `TableContainer` + `stickyHeader` and Ant
|
|
418
|
-
* Design's `scroll.y`. New in 0.7.1.
|
|
419
|
-
*/
|
|
420
|
-
maxHeight?: number | string;
|
|
421
|
-
manual?: DataTableManual;
|
|
422
|
-
/** Controlled state. Any key you pass is controlled; the rest stay internal. */
|
|
423
|
-
state?: Partial<DataTableState>;
|
|
424
|
-
onSortingChange?: (sorting: SortingState) => void;
|
|
425
|
-
onGlobalFilterChange?: (value: string) => void;
|
|
426
|
-
onColumnFiltersChange?: (filters: ColumnFiltersState) => void;
|
|
427
|
-
onPaginationChange?: (pagination: PaginationState) => void;
|
|
428
|
-
onColumnVisibilityChange?: (visibility: VisibilityState) => void;
|
|
429
|
-
onRowSelectionChange?: (selection: RowSelectionState) => void;
|
|
430
|
-
/** Passed to `useReactTable` last, for anything this API does not cover. */
|
|
431
|
-
tableOptions?: Partial<TableOptions<TData>>;
|
|
432
|
-
/**
|
|
433
|
-
* Draw the table's own border and radius. Default `true`. Pass `false` to sit it flush inside
|
|
434
|
-
* a `Card`, under a `CardHeader` that carries the title, description and actions: the Card
|
|
435
|
-
* supplies the border, and the toolbar gains the Card's side padding. New in 0.9.5.
|
|
436
|
-
*/
|
|
437
|
-
bordered?: boolean;
|
|
438
|
-
/** Classes on the bordered wrapper. Layout only, e.g. margins. */
|
|
439
|
-
className?: string;
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* A data table on TanStack Table: sorting, search, pagination, column visibility and row
|
|
443
|
-
* selection built in, client-side by default and server-driven through `manual`.
|
|
444
|
-
*
|
|
445
|
-
* <DataTable label="Suppliers" columns={columns} data={suppliers} searchable columnVisibility />
|
|
446
|
-
*
|
|
447
|
-
* `TData` and `TValue` are inferred from `columns`, so `cell: ({ row }) => row.original.name`
|
|
448
|
-
* is typed. Layout options (width, alignment, card-mode role, sticky) go in each column's `meta`.
|
|
449
|
-
*
|
|
450
|
-
* Layout, from SCIC's table:
|
|
451
|
-
* - `table-fixed` plus one `<colgroup>`, so one set of widths governs every row and cells can
|
|
452
|
-
* ellipsise. A column is never narrower than its header.
|
|
453
|
-
* - Whatever does not fit scrolls inside a focusable, named region with edge shadows and
|
|
454
|
-
* optional sticky first or last columns.
|
|
455
|
-
* - Below 560px of its own width (not the viewport's) each row becomes a card: the title column
|
|
456
|
-
* leads, `status` and `actions` sit at the top, the rest become labelled values.
|
|
457
|
-
*
|
|
458
|
-
* Accessibility: a real `<table>` with a caption, `aria-sort` on sortable headers, `aria-busy`
|
|
459
|
-
* while loading, a polite announcement of the result count after a search, keyboard row
|
|
460
|
-
* activation, and named selection checkboxes.
|
|
461
|
-
*/
|
|
462
|
-
declare function DataTable<TData, TValue = unknown>({ columns, data, getRowId, label, caption, searchable, columnVisibility: showColumnMenu, pagination: paginated, pageSize, pageSizeOptions, enableRowSelection, onSelectionChange, getRowLabel, onRowClick, getRowHref, renderRowLink, getRowTone, getRowDimmed, loading, loadingRows, error, onRetry, empty, toolbar, footer, density, align, responsive, maxHeight, manual, state, onSortingChange, onGlobalFilterChange, onColumnFiltersChange, onPaginationChange, onColumnVisibilityChange, onRowSelectionChange, tableOptions, bordered, className, }: DataTableProps<TData, TValue>): react.JSX.Element;
|
|
463
|
-
|
|
464
|
-
export { TableCellProgress as A, type TableCellProgressProps as B, type ColumnMobileRole as C, DataTable as D, type TableCellProps as E, type TableCellSize as F, TableCellText as G, type TableCellTextProps as H, type TableDensity as I, TableFooter as J, TableHead as K, type TableHeadProps as L, TableHeader as M, type TableProps as N, TableRow as O, type ProgressBarTone as P, type TableRowProps as Q, type TableRowTone as R, SELECT_COLUMN_ID as S, Table as T, type TableSortDirection as U, createSelectColumn as V, type CreateSelectColumnOptions as a, type DataTableAlign as b, type DataTableColumnAlign as c, DataTableColumnHeader as d, type DataTableColumnHeaderProps as e, type DataTableDensity as f, type DataTableManual as g, DataTablePagination as h, type DataTablePaginationProps as i, type DataTableProps as j, type DataTableRowLinkProps as k, type DataTableSearchOptions as l, type DataTableState as m, DataTableViewOptions as n, type DataTableViewOptionsProps as o, ProgressBar as p, type ProgressBarProps as q, type ProgressBarSize as r, TableBody as s, TableCaption as t, type TableCaptionProps as u, TableCell as v, TableCellBadge as w, type TableCellBadgeProps as x, TableCellLeadText as y, type TableCellLeadTextProps as z };
|
package/dist/sidebar.cjs
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/sidebar/index.tsx
|
|
31
|
-
var sidebar_exports = {};
|
|
32
|
-
__export(sidebar_exports, {
|
|
33
|
-
AppSidebar: () => AppSidebar,
|
|
34
|
-
NavTabs: () => NavTabs,
|
|
35
|
-
SidebarSeparator: () => import__2.SidebarSeparator,
|
|
36
|
-
SidebarUserCard: () => import__2.SidebarUserCard
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(sidebar_exports);
|
|
39
|
-
var import_react = require("react");
|
|
40
|
-
var import_react_router_dom2 = require("react-router-dom");
|
|
41
|
-
var import__ = require("./index.cjs");
|
|
42
|
-
var import__2 = require("./index.cjs");
|
|
43
|
-
|
|
44
|
-
// src/sidebar/nav-tabs.tsx
|
|
45
|
-
var import_react_router_dom = require("react-router-dom");
|
|
46
|
-
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
47
|
-
|
|
48
|
-
// src/lib/scrollbar.ts
|
|
49
|
-
var import_clsx = __toESM(require("clsx"), 1);
|
|
50
|
-
var SCROLLBAR_CLASSES = (0, import_clsx.default)(
|
|
51
|
-
// Firefox and the standard property.
|
|
52
|
-
"[scrollbar-color:var(--color-background-default-tertiary)_transparent] [scrollbar-width:thin]",
|
|
53
|
-
// WebKit/Blink.
|
|
54
|
-
"[&::-webkit-scrollbar]:size-2",
|
|
55
|
-
"[&::-webkit-scrollbar-track]:bg-transparent",
|
|
56
|
-
"[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-default-tertiary",
|
|
57
|
-
"[&::-webkit-scrollbar-thumb:hover]:bg-neutral-secondary",
|
|
58
|
-
"[&::-webkit-scrollbar-corner]:bg-transparent"
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
// src/sidebar/nav-tabs.tsx
|
|
62
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
63
|
-
function NavTabs({ items, className }) {
|
|
64
|
-
return (
|
|
65
|
-
// The links inside are the tab stops.
|
|
66
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
-
"div",
|
|
68
|
-
{
|
|
69
|
-
className: (0, import_clsx2.default)(
|
|
70
|
-
"flex gap-6 overflow-x-auto border-b border-default",
|
|
71
|
-
SCROLLBAR_CLASSES,
|
|
72
|
-
className
|
|
73
|
-
),
|
|
74
|
-
children: items.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
-
import_react_router_dom.NavLink,
|
|
76
|
-
{
|
|
77
|
-
to: tab.to,
|
|
78
|
-
end: tab.end,
|
|
79
|
-
className: ({ isActive }) => (0, import_clsx2.default)(
|
|
80
|
-
"shrink-0 whitespace-nowrap border-b-2 pb-3 text-body-sm transition-colors",
|
|
81
|
-
isActive ? "border-brand-emphasis font-semibold text-brand-emphasis" : "border-transparent font-medium text-default-secondary hover:text-default"
|
|
82
|
-
),
|
|
83
|
-
children: tab.label
|
|
84
|
-
},
|
|
85
|
-
tab.to
|
|
86
|
-
))
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// src/sidebar/index.tsx
|
|
93
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
94
|
-
var RouterLink = (0, import_react.forwardRef)(function RouterLink2({ href, ...rest }, ref) {
|
|
95
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_router_dom2.Link, { ref, to: href, ...rest });
|
|
96
|
-
});
|
|
97
|
-
function AppSidebar(props) {
|
|
98
|
-
const location = (0, import_react_router_dom2.useLocation)();
|
|
99
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import__.Sidebar, { ...props, currentPath: location.pathname, currentHash: location.hash, linkComponent: RouterLink });
|
|
100
|
-
}
|
|
101
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
-
0 && (module.exports = {
|
|
103
|
-
AppSidebar,
|
|
104
|
-
NavTabs,
|
|
105
|
-
SidebarSeparator,
|
|
106
|
-
SidebarUserCard
|
|
107
|
-
});
|
|
108
|
-
//# sourceMappingURL=sidebar.cjs.map
|
package/dist/sidebar.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sidebar/index.tsx","../src/sidebar/nav-tabs.tsx","../src/lib/scrollbar.ts"],"sourcesContent":["import { forwardRef } from 'react';\nimport { Link, useLocation } from 'react-router-dom';\n\nimport { Sidebar } from '../index';\nimport type { SidebarLinkProps, SidebarProps } from '../index';\n\nexport type AppSidebarProps = Omit<SidebarProps, 'currentPath' | 'currentHash' | 'linkComponent'>;\n\n/** `Sidebar`'s link slot, filled with react-router's `Link`. */\nconst RouterLink = forwardRef<HTMLAnchorElement, SidebarLinkProps>(function RouterLink({ href, ...rest }, ref) {\n return <Link ref={ref} to={href} {...rest} />;\n});\n\n/**\n * The application nav rail, wired to react-router: the current row comes from `useLocation`\n * and rows link with `Link`.\n *\n * Lives on its own entry point (`@platned/ui/sidebar`) because `react-router-dom` is an\n * optional peer dependency. From 0.9.6 it is a thin wrapper over `Sidebar` on the main entry,\n * which takes the location and the link component as props — use that directly in an app on\n * another router (Next.js).\n *\n * Through 0.4.0 this was not a library component at all. It hardcoded ten product routes,\n * their labels and their icons, an `SCIC` wordmark, and an `isAdmin` flag gating two of the\n * rows — so the only app it could render was the one it was extracted from. Everything\n * app-specific is now a prop or a slot.\n *\n * Width is an explicit prop rather than something `className` overrides: the width is\n * conditional on `collapsed`, so a `className=\"w-64\"` would tailwind-merge away the\n * collapsed width too and break the collapse. Everything else about the shell is fair game\n * for `className` — `rounded-none` to flatten it for a full-bleed layout, for instance.\n */\nexport function AppSidebar(props: AppSidebarProps) {\n const location = useLocation();\n return (\n <Sidebar {...props} currentPath={location.pathname} currentHash={location.hash} linkComponent={RouterLink} />\n );\n}\n\n// Kept on this entry so imports from before 0.9.6 keep working; they live on the main one now.\nexport { SidebarSeparator, SidebarUserCard } from '../index';\nexport type {\n SidebarNavItem,\n SidebarNavGroup,\n SidebarSeparatorProps,\n SidebarUserCardProps,\n} from '../index';\n\n// ── Route-driven navigation ────────────────────────────────────────────────────\n// Lives on this entry point (not the main one) because it needs react-router-dom.\n\nexport { NavTabs } from './nav-tabs';\nexport type { NavTabsProps, NavTabItem } from './nav-tabs';\n","import { NavLink } from 'react-router-dom';\nimport clsx from 'clsx';\n\nimport { SCROLLBAR_CLASSES } from '../lib/scrollbar';\n\nexport interface NavTabItem {\n to: string;\n label: string;\n /** Match this route exactly — needed for an index route like `/account`. */\n end?: boolean;\n}\n\nexport interface NavTabsProps {\n items: NavTabItem[];\n className?: string;\n}\n\n/** Route-driven tab strip, backed by react-router's `NavLink`.\n *\n * Use this when each tab is its own route. For state-driven tabs that do not change\n * the URL, use `Tabs` from the main entry point instead — it has no router dependency.\n *\n * The active underline and label use `brand-emphasis` (#0C2D58), the brand fill colour\n * Figma specifies for a tab rule, rather than the lighter `brand` border token. */\nexport function NavTabs({ items, className }: NavTabsProps) {\n return (\n // The links inside are the tab stops.\n <div\n className={clsx(\n 'flex gap-6 overflow-x-auto border-b border-default',\n SCROLLBAR_CLASSES,\n className,\n )}\n >\n {items.map((tab) => (\n <NavLink\n key={tab.to}\n to={tab.to}\n end={tab.end}\n className={({ isActive }) =>\n clsx(\n 'shrink-0 whitespace-nowrap border-b-2 pb-3 text-body-sm transition-colors',\n isActive\n ? 'border-brand-emphasis font-semibold text-brand-emphasis'\n : 'border-transparent font-medium text-default-secondary hover:text-default',\n )\n }\n >\n {tab.label}\n </NavLink>\n ))}\n </div>\n );\n}\n","import clsx from 'clsx';\n\n/**\n * Styled native scrollbars, for the components that must own their own overflow and so\n * cannot delegate to `ScrollArea`.\n *\n * Two kinds qualify. A table wrapper, a tab strip or a stepper, where inserting another\n * element would break the layout or the `<table>` element relationship; and a floating panel\n * that is already its own scroll container. Both hold focusable children, so a keyboard user\n * can already reach and scroll them — which is the one thing `ScrollArea` adds beyond these\n * classes, and the one thing they do not need.\n *\n * Prefer `ScrollArea` for a scrolling *region* of content. Reach for this only when a wrapper\n * element is not an option, and say why at the call site.\n *\n * A plain string module rather than an export from `scroll-area.tsx`: `menu-styles.ts` needs\n * it, and importing a component module from a style module would pull the component into the\n * bundle graph for the sake of a class list.\n */\nexport const SCROLLBAR_CLASSES = clsx(\n // Firefox and the standard property.\n '[scrollbar-color:var(--color-background-default-tertiary)_transparent] [scrollbar-width:thin]',\n // WebKit/Blink.\n '[&::-webkit-scrollbar]:size-2',\n '[&::-webkit-scrollbar-track]:bg-transparent',\n '[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-default-tertiary',\n '[&::-webkit-scrollbar-thumb:hover]:bg-neutral-secondary',\n '[&::-webkit-scrollbar-corner]:bg-transparent',\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAC3B,IAAAA,2BAAkC;AAElC,eAAwB;AAqCxB,IAAAC,YAAkD;;;ACxClD,8BAAwB;AACxB,IAAAC,eAAiB;;;ACDjB,kBAAiB;AAmBV,IAAM,wBAAoB,YAAAC;AAAA;AAAA,EAE/B;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ADOQ;AAXD,SAAS,QAAQ,EAAE,OAAO,UAAU,GAAiB;AAC1D;AAAA;AAAA,IAEE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,aAAAC;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QAEC,gBAAM,IAAI,CAAC,QACV;AAAA,UAAC;AAAA;AAAA,YAEC,IAAI,IAAI;AAAA,YACR,KAAK,IAAI;AAAA,YACT,WAAW,CAAC,EAAE,SAAS,UACrB,aAAAA;AAAA,cACE;AAAA,cACA,WACI,4DACA;AAAA,YACN;AAAA,YAGD,cAAI;AAAA;AAAA,UAZA,IAAI;AAAA,QAaX,CACD;AAAA;AAAA,IACH;AAAA;AAEJ;;;AD3CS,IAAAC,sBAAA;AADT,IAAM,iBAAa,yBAAgD,SAASC,YAAW,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK;AAC7G,SAAO,6CAAC,iCAAK,KAAU,IAAI,MAAO,GAAG,MAAM;AAC7C,CAAC;AAqBM,SAAS,WAAW,OAAwB;AACjD,QAAM,eAAW,sCAAY;AAC7B,SACE,6CAAC,oBAAS,GAAG,OAAO,aAAa,SAAS,UAAU,aAAa,SAAS,MAAM,eAAe,YAAY;AAE/G;","names":["import_react_router_dom","import__","import_clsx","clsx","clsx","import_jsx_runtime","RouterLink"]}
|