twico-ui 1.47.0 → 1.49.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/CHANGELOG.md +19 -0
- package/dist/icons.d.cts +2 -1
- package/dist/icons.d.ts +2 -1
- package/dist/index.cjs +57 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -12
- package/dist/index.d.ts +77 -12
- package/dist/index.mjs +57 -1
- package/dist/index.mjs.map +1 -1
- package/llms.txt +5 -2
- package/package.json +2 -2
- package/styles/twico-ui.css +28 -10
package/dist/index.d.cts
CHANGED
|
@@ -258,7 +258,11 @@ declare function Accordion(props: AccordionProps): React.JSX.Element;
|
|
|
258
258
|
/** The canonical six-value color/intent scale used by status & control components. */
|
|
259
259
|
type Tone = "primary" | "success" | "warning" | "danger" | "info" | "neutral";
|
|
260
260
|
|
|
261
|
-
/**
|
|
261
|
+
/**
|
|
262
|
+
* The two intents most actions want. Button and IconButton accepted ONLY these until #504; they now
|
|
263
|
+
* take the full {@link Tone} scale, so this is a convenience alias for the common pair rather than a
|
|
264
|
+
* ceiling. Still exported, still accurate for anything that genuinely is brand-or-destructive.
|
|
265
|
+
*/
|
|
262
266
|
type ActionTone = "primary" | "danger";
|
|
263
267
|
|
|
264
268
|
/** Text roles, the full color scale, and `"inherit"` (adopt the parent color) — Text. */
|
|
@@ -557,8 +561,20 @@ declare function Breadcrumb(props: BreadcrumbProps): React.JSX.Element;
|
|
|
557
561
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
558
562
|
/** Fill style. @default "solid" */
|
|
559
563
|
variant?: "solid" | "soft" | "outline" | "ghost";
|
|
560
|
-
/**
|
|
561
|
-
|
|
564
|
+
/**
|
|
565
|
+
* Color/intent, orthogonal to `variant`. @default "primary"
|
|
566
|
+
*
|
|
567
|
+
* #504: the full {@link Tone} scale, widened from `ActionTone` (`primary | danger`). A standalone
|
|
568
|
+
* affirmative action — a row-level confirm sitting beside a `danger` sibling, reading as
|
|
569
|
+
* "yes / no" — could not be green, so the colour carrying that distinction came out the same blue
|
|
570
|
+
* as every neutral action on the page. `ActionTone` is still exported and still describes the two
|
|
571
|
+
* intents most actions want; it is no longer the ceiling.
|
|
572
|
+
*
|
|
573
|
+
* `neutral` follows Badge's mapping rather than an accent ramp of its own: `--color-text` on
|
|
574
|
+
* `--color-surface` for `solid`, `--color-surface-sunken` for `soft`. Note `variant="ghost"` and
|
|
575
|
+
* `variant="outline"` already express a quiet action, so reach for those first.
|
|
576
|
+
*/
|
|
577
|
+
tone?: Tone;
|
|
562
578
|
/** Control size; "xs" (~26px) is smaller than "sm". @default "md" */
|
|
563
579
|
size?: "xs" | "sm" | "md" | "lg";
|
|
564
580
|
/** Icon node rendered before the label. */
|
|
@@ -576,9 +592,10 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
576
592
|
/** #405: toggle "on" state — sets `aria-pressed` and shows a soft fill + border in the current `tone`
|
|
577
593
|
* (works with any `variant`). Omit for a plain (non-toggle) button. @default undefined */
|
|
578
594
|
pressed?: boolean;
|
|
579
|
-
/** #411: tone of the pressed ("on") fill
|
|
580
|
-
*
|
|
581
|
-
*
|
|
595
|
+
/** #411: tone of the pressed ("on") fill, so a toggle can carry a different selected-state meaning
|
|
596
|
+
* from its unpressed look. Both are the full `Tone` scale since #504 — before that `tone` was
|
|
597
|
+
* `ActionTone` and this was the only way to reach the other four. Defaults to `tone`.
|
|
598
|
+
* @default undefined */
|
|
582
599
|
pressedTone?: Tone;
|
|
583
600
|
/** Render as a different element (e.g. "a"). @default "button" */
|
|
584
601
|
as?: "button" | "a";
|
|
@@ -2150,6 +2167,31 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
2150
2167
|
* `tr.twc-dt__row.my-row .twc-dt__td`. You are then choosing to cover the hover cue on those rows.
|
|
2151
2168
|
*/
|
|
2152
2169
|
getRowClassName?: (row: T, index: number) => string | undefined;
|
|
2170
|
+
/**
|
|
2171
|
+
* Default vertical alignment for every body cell, as `data-valign`. Only visible once rows vary
|
|
2172
|
+
* in height - a `wrapText` column, a multi-line `renderCell`, or a drag-resized row; with
|
|
2173
|
+
* single-line rows every value looks the same.
|
|
2174
|
+
*
|
|
2175
|
+
* **Precedence, lowest first: this → {@link getRowVerticalAlign} → the column's
|
|
2176
|
+
* `verticalAlign`.** It is resolved in one place and emitted as a single `data-valign` on the
|
|
2177
|
+
* cell, rather than as three competing CSS rules, so the order is readable in the code and an
|
|
2178
|
+
* unrelated stylesheet edit cannot reorder it.
|
|
2179
|
+
*
|
|
2180
|
+
* @default unset — cells keep the browser's `middle`, except `wrapText` cells, which sit `top`
|
|
2181
|
+
*/
|
|
2182
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
2183
|
+
/**
|
|
2184
|
+
* Vertical alignment for one row's cells, called `(row, index)` like {@link getRowStyle}. Return
|
|
2185
|
+
* `undefined` to leave a row on the table default.
|
|
2186
|
+
*
|
|
2187
|
+
* Overrides {@link verticalAlign} but **not** a column's own `verticalAlign`: an explicit column
|
|
2188
|
+
* value is a property of that column's content type and is almost always a deliberate exemption
|
|
2189
|
+
* (the actions column stays centred while the rest of the row moves). If you need a row to move
|
|
2190
|
+
* every cell, leave the columns' values unset.
|
|
2191
|
+
*
|
|
2192
|
+
* `index` is page-relative, the same as {@link getRowStyle}.
|
|
2193
|
+
*/
|
|
2194
|
+
getRowVerticalAlign?: (row: T, index: number) => "top" | "middle" | "bottom" | undefined;
|
|
2153
2195
|
/** Restrict the toolbar quick-search to these column `field`s (client mode); defaults to every
|
|
2154
2196
|
* visible column. Mirrors `runDatatableQuery`'s `options.searchFields`. */
|
|
2155
2197
|
searchFields?: string[];
|
|
@@ -2669,6 +2711,20 @@ interface DatatableColumn<T = any> {
|
|
|
2669
2711
|
align?: "left" | "center" | "right";
|
|
2670
2712
|
/** Header-cell alignment, when it should differ from the body `align`. @default the column's `align` */
|
|
2671
2713
|
headerAlign?: "left" | "center" | "right";
|
|
2714
|
+
/**
|
|
2715
|
+
* Vertical alignment of this column's body cells, as `data-valign`. The transpose of `align`:
|
|
2716
|
+
* `align` decides where content sits across the column's width, this decides where it sits down
|
|
2717
|
+
* the row's height. Only visible once rows vary in height - a `wrapText` column, a multi-line
|
|
2718
|
+
* `renderCell`, or a drag-resized row.
|
|
2719
|
+
*
|
|
2720
|
+
* **Wins over the row and table values.** A per-column setting is a statement about this column's
|
|
2721
|
+
* content type - an actions column or a status badge that should stay centred however tall the
|
|
2722
|
+
* row gets - so it survives a row-level or table-wide sweep. To move a whole row including this
|
|
2723
|
+
* column, leave the column's value unset.
|
|
2724
|
+
*
|
|
2725
|
+
* @default `"top"` for `wrapText` columns, otherwise the table's `verticalAlign`
|
|
2726
|
+
*/
|
|
2727
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
2672
2728
|
/** Allow sorting this column. @default true */
|
|
2673
2729
|
sortable?: boolean;
|
|
2674
2730
|
/** Allow filtering this column. @default true */
|
|
@@ -3900,9 +3956,16 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
3900
3956
|
icon?: React.ReactNode;
|
|
3901
3957
|
/** Fill style (same axes as Button). @default "ghost" */
|
|
3902
3958
|
variant?: "solid" | "soft" | "outline" | "ghost";
|
|
3903
|
-
/**
|
|
3904
|
-
*
|
|
3905
|
-
|
|
3959
|
+
/**
|
|
3960
|
+
* Color/intent, orthogonal to `variant` (mirrors Button). A destructive icon button is
|
|
3961
|
+
* `tone="danger"` with any variant. @default "primary"
|
|
3962
|
+
*
|
|
3963
|
+
* #504: the full {@link Tone} scale, widened from `ActionTone` (`primary | danger`), so an
|
|
3964
|
+
* affirmative icon action can be green beside a destructive one. `ActionTone` is still exported
|
|
3965
|
+
* and still names the two intents most actions want; it is no longer the ceiling. `neutral`
|
|
3966
|
+
* follows Badge's mapping rather than an accent ramp of its own.
|
|
3967
|
+
*/
|
|
3968
|
+
tone?: Tone;
|
|
3906
3969
|
/** Control size; "xs" (~26px) is smaller than "sm". @default "md" */
|
|
3907
3970
|
size?: "xs" | "sm" | "md" | "lg";
|
|
3908
3971
|
/** Fully rounded (circular). @default false */
|
|
@@ -3914,8 +3977,9 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
3914
3977
|
/** #405: toggle "on" state — sets `aria-pressed` and shows a soft fill + border in the current `tone`
|
|
3915
3978
|
* (works with any `variant`), e.g. a pin/unpin or bold/italic icon toggle. @default undefined */
|
|
3916
3979
|
pressed?: boolean;
|
|
3917
|
-
/** #411: tone of the pressed ("on") fill
|
|
3918
|
-
*
|
|
3980
|
+
/** #411: tone of the pressed ("on") fill, so a toggle can carry a different selected-state meaning
|
|
3981
|
+
* from its unpressed look. Both are the full `Tone` scale since #504. Defaults to `tone`.
|
|
3982
|
+
* @default undefined */
|
|
3919
3983
|
pressedTone?: Tone;
|
|
3920
3984
|
/** #342: render as a different element — use `"a"` for an icon **link** (GitHub icon, external nav, …) so
|
|
3921
3985
|
* navigation is a real link, not a button. @default "button" */
|
|
@@ -5643,4 +5707,5 @@ declare function useFilePicker(options?: UseFilePickerOptions): {
|
|
|
5643
5707
|
getInputProps: () => React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement | null> };
|
|
5644
5708
|
};
|
|
5645
5709
|
|
|
5646
|
-
export { Accordion,
|
|
5710
|
+
export { Accordion, Alert, Anchor, AppShell, Avatar, AvatarMenu, Badge, Box, Boxplot, Breadcrumb, BubbleChart, Button, Candlestick, Card, CardGrid, Carousel, Chart, Checkbox, Code, ColorPicker, ColorSchemeScript, Combobox, CommandPalette, Container, Currency, CurrencyField, Datatable, DatePicker, DateRangePicker, DateTimePicker, Dialog, DiffTable, Divider, DonutChart, Drawer, EmptyState, Field, FileUpload, FilterBar, Form, FunnelChart, Gauge, Grid, Heading, Heatmap, IconButton, Image, ImageViewer, Input, Kanban, Kbd, Label, List, Menu, MultiSelect, Navbar, Pagination, PieChart, PolarAreaChart, Popover, Portal, Pre, Progress, RadarChart, Radio, RadioGroup, RangeChart, Rating, ScatterChart, Select, Sidebar, Skeleton, Slider, Sparkline, Spinner, Stack, Stat, Stepper, Switch, Table, Tabs, Tag, Text, Textarea, ThemeProvider, TimePicker, Timeline, Toast, ToastProvider, ToastViewport, ToggleGroup, Tooltip, TreeView, Treemap, TwicoProvider, VisuallyHidden, createTheme, getColorSchemeScript, runDatatableQuery, useClickOutside, useColorScheme, useControllableState, useCopyToClipboard, useDebouncedCallback, useDebouncedValue, useDisclosure, useEventListener, useFilePicker, useFocusTrap, useHover, useId, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyPress, useLocalStorage, useMediaQuery, useMounted, usePortal, usePrefersReducedMotion, usePrevious, useScrollLock, useTimeout, useToast, useToggle, useWindowSize };
|
|
5711
|
+
export type { AccordionItem, AccordionProps, ActionTone, AlertProps, AnchorProps, AppShellProps, AvatarMenuProps, AvatarProps, BadgeProps, BarTone, BoxOwnProps, BoxProps, BoxplotDatum, BoxplotProps, BreadcrumbItem, BreadcrumbProps, BubbleChartProps, ButtonProps, CandlestickDatum, CandlestickProps, CardGridBatchAction, CardGridBatchActionContext, CardGridFilter, CardGridProps, CardGridQuery, CardGridSort, CardGridSortOption, CardProps, CarouselProps, ChartDatum, ChartProps, CheckboxProps, CodeProps, ColorPickerProps, ColorSchemeScriptOptions, ColorSchemeScriptProps, ComboboxGroup, ComboboxOption, ComboboxProps, Command, CommandPaletteProps, ContainerOwnProps, ContainerProps, CurrencyFieldProps, CurrencyOption, CurrencyProps, DatatableBatchAction, DatatableBatchActionContext, DatatableBatchUpdateDetail, DatatableColumn, DatatableFilter, DatatableFilterOp, DatatableNumberOp, DatatableProps, DatatableQuery, DatatableRowAction, DatatableState, DatatableStringOp, DatePickerProps, DateRange, DateRangePickerProps, DateTimePickerProps, DialogProps, DiffOp, DiffTableColumn, DiffTableProps, DividerProps, DonutChartDatum, DonutChartProps, DrawerProps, EmptyStateProps, FieldProps, FileUploadProps, FilterBarProps, FilterClause, FilterField, FilterFieldType, FilterValues, FormProps, FunnelChartProps, FunnelDatum, GaugeProps, GaugeSeries, GridOwnProps, GridProps, HeadingOwnProps, HeadingProps, HeadingSize, HeatmapDatum, HeatmapProps, IconButtonProps, ImageProps, ImageViewerControlsApi, ImageViewerProps, ImageViewerState, InputProps, KanbanCard, KanbanColumn, KanbanProps, KbdProps, LabelProps, ListItemData, ListProps, MenuItemDef, MenuProps, MultiSelectGroup, MultiSelectOption, MultiSelectProps, NavbarLink, NavbarProps, Option, OptionGroup, PaginationProps, PieChartDatum, PieChartProps, PolarAreaChartProps, PolarAreaDatum, PolymorphicAs, PolymorphicComponent, PolymorphicProps, PolymorphicPropsWithRef, PolymorphicRef, PopoverProps, PortalProps, PreProps, ProgressProps, RadarChartProps, RadarDatum, RadioGroupOption, RadioGroupProps, RadioProps, RangeChartProps, RangeDatum, RatingProps, ResponsiveColumns, ScatterChartProps, ScatterPoint, ScatterSeries, SelectGroup, SelectOption, SelectProps, SidebarItem, SidebarProps, SkeletonProps, SliderProps, SparklineDatum, SparklineProps, SpinnerProps, StackOwnProps, StackProps, StatProps, Step, StepperProps, SwitchProps, Sx, TabItem, TableColumn, TableProps, TabsProps, TagProps, TextOwnProps, TextProps, TextTone, TextareaProps, Theme, ThemeProviderProps, ThemeTokens, TimePickerProps, TimelineItem, TimelineProps, ToastApi, ToastOptions, ToastProps, ToastProviderProps, ToastTone, ToastViewportProps, ToggleGroupItem, ToggleGroupProps, Tone, TooltipProps, TreeNode, TreeViewProps, TreemapDatum, TreemapProps, TwicoProviderProps, UseColorSchemeOptions, UseFilePickerOptions, UseFocusTrapOptions, UseKeyPressOptions, UseLocalStorageOptions, UseMediaQueryOptions, UseWindowSizeOptions, VisuallyHiddenProps, WithSx };
|
package/dist/index.d.ts
CHANGED
|
@@ -258,7 +258,11 @@ declare function Accordion(props: AccordionProps): React.JSX.Element;
|
|
|
258
258
|
/** The canonical six-value color/intent scale used by status & control components. */
|
|
259
259
|
type Tone = "primary" | "success" | "warning" | "danger" | "info" | "neutral";
|
|
260
260
|
|
|
261
|
-
/**
|
|
261
|
+
/**
|
|
262
|
+
* The two intents most actions want. Button and IconButton accepted ONLY these until #504; they now
|
|
263
|
+
* take the full {@link Tone} scale, so this is a convenience alias for the common pair rather than a
|
|
264
|
+
* ceiling. Still exported, still accurate for anything that genuinely is brand-or-destructive.
|
|
265
|
+
*/
|
|
262
266
|
type ActionTone = "primary" | "danger";
|
|
263
267
|
|
|
264
268
|
/** Text roles, the full color scale, and `"inherit"` (adopt the parent color) — Text. */
|
|
@@ -557,8 +561,20 @@ declare function Breadcrumb(props: BreadcrumbProps): React.JSX.Element;
|
|
|
557
561
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
558
562
|
/** Fill style. @default "solid" */
|
|
559
563
|
variant?: "solid" | "soft" | "outline" | "ghost";
|
|
560
|
-
/**
|
|
561
|
-
|
|
564
|
+
/**
|
|
565
|
+
* Color/intent, orthogonal to `variant`. @default "primary"
|
|
566
|
+
*
|
|
567
|
+
* #504: the full {@link Tone} scale, widened from `ActionTone` (`primary | danger`). A standalone
|
|
568
|
+
* affirmative action — a row-level confirm sitting beside a `danger` sibling, reading as
|
|
569
|
+
* "yes / no" — could not be green, so the colour carrying that distinction came out the same blue
|
|
570
|
+
* as every neutral action on the page. `ActionTone` is still exported and still describes the two
|
|
571
|
+
* intents most actions want; it is no longer the ceiling.
|
|
572
|
+
*
|
|
573
|
+
* `neutral` follows Badge's mapping rather than an accent ramp of its own: `--color-text` on
|
|
574
|
+
* `--color-surface` for `solid`, `--color-surface-sunken` for `soft`. Note `variant="ghost"` and
|
|
575
|
+
* `variant="outline"` already express a quiet action, so reach for those first.
|
|
576
|
+
*/
|
|
577
|
+
tone?: Tone;
|
|
562
578
|
/** Control size; "xs" (~26px) is smaller than "sm". @default "md" */
|
|
563
579
|
size?: "xs" | "sm" | "md" | "lg";
|
|
564
580
|
/** Icon node rendered before the label. */
|
|
@@ -576,9 +592,10 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
576
592
|
/** #405: toggle "on" state — sets `aria-pressed` and shows a soft fill + border in the current `tone`
|
|
577
593
|
* (works with any `variant`). Omit for a plain (non-toggle) button. @default undefined */
|
|
578
594
|
pressed?: boolean;
|
|
579
|
-
/** #411: tone of the pressed ("on") fill
|
|
580
|
-
*
|
|
581
|
-
*
|
|
595
|
+
/** #411: tone of the pressed ("on") fill, so a toggle can carry a different selected-state meaning
|
|
596
|
+
* from its unpressed look. Both are the full `Tone` scale since #504 — before that `tone` was
|
|
597
|
+
* `ActionTone` and this was the only way to reach the other four. Defaults to `tone`.
|
|
598
|
+
* @default undefined */
|
|
582
599
|
pressedTone?: Tone;
|
|
583
600
|
/** Render as a different element (e.g. "a"). @default "button" */
|
|
584
601
|
as?: "button" | "a";
|
|
@@ -2150,6 +2167,31 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
2150
2167
|
* `tr.twc-dt__row.my-row .twc-dt__td`. You are then choosing to cover the hover cue on those rows.
|
|
2151
2168
|
*/
|
|
2152
2169
|
getRowClassName?: (row: T, index: number) => string | undefined;
|
|
2170
|
+
/**
|
|
2171
|
+
* Default vertical alignment for every body cell, as `data-valign`. Only visible once rows vary
|
|
2172
|
+
* in height - a `wrapText` column, a multi-line `renderCell`, or a drag-resized row; with
|
|
2173
|
+
* single-line rows every value looks the same.
|
|
2174
|
+
*
|
|
2175
|
+
* **Precedence, lowest first: this → {@link getRowVerticalAlign} → the column's
|
|
2176
|
+
* `verticalAlign`.** It is resolved in one place and emitted as a single `data-valign` on the
|
|
2177
|
+
* cell, rather than as three competing CSS rules, so the order is readable in the code and an
|
|
2178
|
+
* unrelated stylesheet edit cannot reorder it.
|
|
2179
|
+
*
|
|
2180
|
+
* @default unset — cells keep the browser's `middle`, except `wrapText` cells, which sit `top`
|
|
2181
|
+
*/
|
|
2182
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
2183
|
+
/**
|
|
2184
|
+
* Vertical alignment for one row's cells, called `(row, index)` like {@link getRowStyle}. Return
|
|
2185
|
+
* `undefined` to leave a row on the table default.
|
|
2186
|
+
*
|
|
2187
|
+
* Overrides {@link verticalAlign} but **not** a column's own `verticalAlign`: an explicit column
|
|
2188
|
+
* value is a property of that column's content type and is almost always a deliberate exemption
|
|
2189
|
+
* (the actions column stays centred while the rest of the row moves). If you need a row to move
|
|
2190
|
+
* every cell, leave the columns' values unset.
|
|
2191
|
+
*
|
|
2192
|
+
* `index` is page-relative, the same as {@link getRowStyle}.
|
|
2193
|
+
*/
|
|
2194
|
+
getRowVerticalAlign?: (row: T, index: number) => "top" | "middle" | "bottom" | undefined;
|
|
2153
2195
|
/** Restrict the toolbar quick-search to these column `field`s (client mode); defaults to every
|
|
2154
2196
|
* visible column. Mirrors `runDatatableQuery`'s `options.searchFields`. */
|
|
2155
2197
|
searchFields?: string[];
|
|
@@ -2669,6 +2711,20 @@ interface DatatableColumn<T = any> {
|
|
|
2669
2711
|
align?: "left" | "center" | "right";
|
|
2670
2712
|
/** Header-cell alignment, when it should differ from the body `align`. @default the column's `align` */
|
|
2671
2713
|
headerAlign?: "left" | "center" | "right";
|
|
2714
|
+
/**
|
|
2715
|
+
* Vertical alignment of this column's body cells, as `data-valign`. The transpose of `align`:
|
|
2716
|
+
* `align` decides where content sits across the column's width, this decides where it sits down
|
|
2717
|
+
* the row's height. Only visible once rows vary in height - a `wrapText` column, a multi-line
|
|
2718
|
+
* `renderCell`, or a drag-resized row.
|
|
2719
|
+
*
|
|
2720
|
+
* **Wins over the row and table values.** A per-column setting is a statement about this column's
|
|
2721
|
+
* content type - an actions column or a status badge that should stay centred however tall the
|
|
2722
|
+
* row gets - so it survives a row-level or table-wide sweep. To move a whole row including this
|
|
2723
|
+
* column, leave the column's value unset.
|
|
2724
|
+
*
|
|
2725
|
+
* @default `"top"` for `wrapText` columns, otherwise the table's `verticalAlign`
|
|
2726
|
+
*/
|
|
2727
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
2672
2728
|
/** Allow sorting this column. @default true */
|
|
2673
2729
|
sortable?: boolean;
|
|
2674
2730
|
/** Allow filtering this column. @default true */
|
|
@@ -3900,9 +3956,16 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
3900
3956
|
icon?: React.ReactNode;
|
|
3901
3957
|
/** Fill style (same axes as Button). @default "ghost" */
|
|
3902
3958
|
variant?: "solid" | "soft" | "outline" | "ghost";
|
|
3903
|
-
/**
|
|
3904
|
-
*
|
|
3905
|
-
|
|
3959
|
+
/**
|
|
3960
|
+
* Color/intent, orthogonal to `variant` (mirrors Button). A destructive icon button is
|
|
3961
|
+
* `tone="danger"` with any variant. @default "primary"
|
|
3962
|
+
*
|
|
3963
|
+
* #504: the full {@link Tone} scale, widened from `ActionTone` (`primary | danger`), so an
|
|
3964
|
+
* affirmative icon action can be green beside a destructive one. `ActionTone` is still exported
|
|
3965
|
+
* and still names the two intents most actions want; it is no longer the ceiling. `neutral`
|
|
3966
|
+
* follows Badge's mapping rather than an accent ramp of its own.
|
|
3967
|
+
*/
|
|
3968
|
+
tone?: Tone;
|
|
3906
3969
|
/** Control size; "xs" (~26px) is smaller than "sm". @default "md" */
|
|
3907
3970
|
size?: "xs" | "sm" | "md" | "lg";
|
|
3908
3971
|
/** Fully rounded (circular). @default false */
|
|
@@ -3914,8 +3977,9 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
3914
3977
|
/** #405: toggle "on" state — sets `aria-pressed` and shows a soft fill + border in the current `tone`
|
|
3915
3978
|
* (works with any `variant`), e.g. a pin/unpin or bold/italic icon toggle. @default undefined */
|
|
3916
3979
|
pressed?: boolean;
|
|
3917
|
-
/** #411: tone of the pressed ("on") fill
|
|
3918
|
-
*
|
|
3980
|
+
/** #411: tone of the pressed ("on") fill, so a toggle can carry a different selected-state meaning
|
|
3981
|
+
* from its unpressed look. Both are the full `Tone` scale since #504. Defaults to `tone`.
|
|
3982
|
+
* @default undefined */
|
|
3919
3983
|
pressedTone?: Tone;
|
|
3920
3984
|
/** #342: render as a different element — use `"a"` for an icon **link** (GitHub icon, external nav, …) so
|
|
3921
3985
|
* navigation is a real link, not a button. @default "button" */
|
|
@@ -5643,4 +5707,5 @@ declare function useFilePicker(options?: UseFilePickerOptions): {
|
|
|
5643
5707
|
getInputProps: () => React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement | null> };
|
|
5644
5708
|
};
|
|
5645
5709
|
|
|
5646
|
-
export { Accordion,
|
|
5710
|
+
export { Accordion, Alert, Anchor, AppShell, Avatar, AvatarMenu, Badge, Box, Boxplot, Breadcrumb, BubbleChart, Button, Candlestick, Card, CardGrid, Carousel, Chart, Checkbox, Code, ColorPicker, ColorSchemeScript, Combobox, CommandPalette, Container, Currency, CurrencyField, Datatable, DatePicker, DateRangePicker, DateTimePicker, Dialog, DiffTable, Divider, DonutChart, Drawer, EmptyState, Field, FileUpload, FilterBar, Form, FunnelChart, Gauge, Grid, Heading, Heatmap, IconButton, Image, ImageViewer, Input, Kanban, Kbd, Label, List, Menu, MultiSelect, Navbar, Pagination, PieChart, PolarAreaChart, Popover, Portal, Pre, Progress, RadarChart, Radio, RadioGroup, RangeChart, Rating, ScatterChart, Select, Sidebar, Skeleton, Slider, Sparkline, Spinner, Stack, Stat, Stepper, Switch, Table, Tabs, Tag, Text, Textarea, ThemeProvider, TimePicker, Timeline, Toast, ToastProvider, ToastViewport, ToggleGroup, Tooltip, TreeView, Treemap, TwicoProvider, VisuallyHidden, createTheme, getColorSchemeScript, runDatatableQuery, useClickOutside, useColorScheme, useControllableState, useCopyToClipboard, useDebouncedCallback, useDebouncedValue, useDisclosure, useEventListener, useFilePicker, useFocusTrap, useHover, useId, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyPress, useLocalStorage, useMediaQuery, useMounted, usePortal, usePrefersReducedMotion, usePrevious, useScrollLock, useTimeout, useToast, useToggle, useWindowSize };
|
|
5711
|
+
export type { AccordionItem, AccordionProps, ActionTone, AlertProps, AnchorProps, AppShellProps, AvatarMenuProps, AvatarProps, BadgeProps, BarTone, BoxOwnProps, BoxProps, BoxplotDatum, BoxplotProps, BreadcrumbItem, BreadcrumbProps, BubbleChartProps, ButtonProps, CandlestickDatum, CandlestickProps, CardGridBatchAction, CardGridBatchActionContext, CardGridFilter, CardGridProps, CardGridQuery, CardGridSort, CardGridSortOption, CardProps, CarouselProps, ChartDatum, ChartProps, CheckboxProps, CodeProps, ColorPickerProps, ColorSchemeScriptOptions, ColorSchemeScriptProps, ComboboxGroup, ComboboxOption, ComboboxProps, Command, CommandPaletteProps, ContainerOwnProps, ContainerProps, CurrencyFieldProps, CurrencyOption, CurrencyProps, DatatableBatchAction, DatatableBatchActionContext, DatatableBatchUpdateDetail, DatatableColumn, DatatableFilter, DatatableFilterOp, DatatableNumberOp, DatatableProps, DatatableQuery, DatatableRowAction, DatatableState, DatatableStringOp, DatePickerProps, DateRange, DateRangePickerProps, DateTimePickerProps, DialogProps, DiffOp, DiffTableColumn, DiffTableProps, DividerProps, DonutChartDatum, DonutChartProps, DrawerProps, EmptyStateProps, FieldProps, FileUploadProps, FilterBarProps, FilterClause, FilterField, FilterFieldType, FilterValues, FormProps, FunnelChartProps, FunnelDatum, GaugeProps, GaugeSeries, GridOwnProps, GridProps, HeadingOwnProps, HeadingProps, HeadingSize, HeatmapDatum, HeatmapProps, IconButtonProps, ImageProps, ImageViewerControlsApi, ImageViewerProps, ImageViewerState, InputProps, KanbanCard, KanbanColumn, KanbanProps, KbdProps, LabelProps, ListItemData, ListProps, MenuItemDef, MenuProps, MultiSelectGroup, MultiSelectOption, MultiSelectProps, NavbarLink, NavbarProps, Option, OptionGroup, PaginationProps, PieChartDatum, PieChartProps, PolarAreaChartProps, PolarAreaDatum, PolymorphicAs, PolymorphicComponent, PolymorphicProps, PolymorphicPropsWithRef, PolymorphicRef, PopoverProps, PortalProps, PreProps, ProgressProps, RadarChartProps, RadarDatum, RadioGroupOption, RadioGroupProps, RadioProps, RangeChartProps, RangeDatum, RatingProps, ResponsiveColumns, ScatterChartProps, ScatterPoint, ScatterSeries, SelectGroup, SelectOption, SelectProps, SidebarItem, SidebarProps, SkeletonProps, SliderProps, SparklineDatum, SparklineProps, SpinnerProps, StackOwnProps, StackProps, StatProps, Step, StepperProps, SwitchProps, Sx, TabItem, TableColumn, TableProps, TabsProps, TagProps, TextOwnProps, TextProps, TextTone, TextareaProps, Theme, ThemeProviderProps, ThemeTokens, TimePickerProps, TimelineItem, TimelineProps, ToastApi, ToastOptions, ToastProps, ToastProviderProps, ToastTone, ToastViewportProps, ToggleGroupItem, ToggleGroupProps, Tone, TooltipProps, TreeNode, TreeViewProps, TreemapDatum, TreemapProps, TwicoProviderProps, UseColorSchemeOptions, UseFilePickerOptions, UseFocusTrapOptions, UseKeyPressOptions, UseLocalStorageOptions, UseMediaQueryOptions, UseWindowSizeOptions, VisuallyHiddenProps, WithSx };
|
package/dist/index.mjs
CHANGED
|
@@ -434,6 +434,22 @@ var ICONBTN_CSS = `
|
|
|
434
434
|
--_accent-fg: var(--color-primary-fg); --_accent-subtle: var(--color-primary-subtle); --_accent-subtle-fg: var(--color-primary-subtle-fg); }
|
|
435
435
|
.twc-iconbtn[data-tone="danger"] { --_accent: var(--color-danger); --_accent-hover: var(--color-danger-hover);
|
|
436
436
|
--_accent-fg: var(--color-danger-fg); --_accent-subtle: var(--color-danger-subtle); --_accent-subtle-fg: var(--color-danger-subtle-fg); }
|
|
437
|
+
/* #504: the full Tone scale, not just primary|danger. A standalone affirmative action - a row-level
|
|
438
|
+
confirm sitting next to a danger sibling, reading as "yes / no" - could not be green, so the colour
|
|
439
|
+
that carried the distinction came out the same blue as every neutral action on the page.
|
|
440
|
+
success/warning/info now have real -hover/-active tokens (added in tokens/colors.css on the same
|
|
441
|
+
step rule as primary and danger: light goes darker, dark goes lighter), so hover always moves AWAY
|
|
442
|
+
from the ink and contrast only improves. neutral has no accent tokens anywhere and is mapped the way
|
|
443
|
+
Badge already maps it - --color-text on --color-surface solid, --color-surface-sunken soft - with its
|
|
444
|
+
hover mixed from currentColor, since there is no --color-text-hover to point at. */
|
|
445
|
+
.twc-iconbtn[data-tone="success"] { --_accent: var(--color-success); --_accent-hover: var(--color-success-hover);
|
|
446
|
+
--_accent-fg: var(--color-success-fg); --_accent-subtle: var(--color-success-subtle); --_accent-subtle-fg: var(--color-success-subtle-fg); }
|
|
447
|
+
.twc-iconbtn[data-tone="warning"] { --_accent: var(--color-warning); --_accent-hover: var(--color-warning-hover);
|
|
448
|
+
--_accent-fg: var(--color-warning-fg); --_accent-subtle: var(--color-warning-subtle); --_accent-subtle-fg: var(--color-warning-subtle-fg); }
|
|
449
|
+
.twc-iconbtn[data-tone="info"] { --_accent: var(--color-info); --_accent-hover: var(--color-info-hover);
|
|
450
|
+
--_accent-fg: var(--color-info-fg); --_accent-subtle: var(--color-info-subtle); --_accent-subtle-fg: var(--color-info-subtle-fg); }
|
|
451
|
+
.twc-iconbtn[data-tone="neutral"] { --_accent: var(--color-text); --_accent-hover: color-mix(in srgb, var(--color-text) 88%, var(--color-surface));
|
|
452
|
+
--_accent-fg: var(--color-surface); --_accent-subtle: var(--color-surface-sunken); --_accent-subtle-fg: var(--color-text-muted); }
|
|
437
453
|
.twc-iconbtn[data-variant="solid"] { background: var(--_accent); color: var(--_accent-fg); }
|
|
438
454
|
.twc-iconbtn[data-variant="solid"]:hover:not(:disabled) { background: var(--_accent-hover); box-shadow: var(--shadow-brand); }
|
|
439
455
|
.twc-iconbtn[data-variant="solid"]:active:not(:disabled) { filter: brightness(0.92); }
|
|
@@ -1811,6 +1827,31 @@ var CSS2 = `
|
|
|
1811
1827
|
--_accent: var(--color-danger); --_accent-hover: var(--color-danger-hover); --_accent-active: var(--color-danger-hover);
|
|
1812
1828
|
--_accent-fg: var(--color-danger-fg); --_accent-subtle: var(--color-danger-subtle); --_accent-subtle-fg: var(--color-danger-subtle-fg);
|
|
1813
1829
|
}
|
|
1830
|
+
/* #504: the full Tone scale, not just primary|danger. A standalone affirmative action - a row-level
|
|
1831
|
+
confirm sitting next to a danger sibling, reading as "yes / no" - could not be green, so the colour
|
|
1832
|
+
that carried the distinction came out the same blue as every neutral action on the page.
|
|
1833
|
+
success/warning/info now have real -hover/-active tokens (added in tokens/colors.css on the same
|
|
1834
|
+
step rule as primary and danger: light goes darker, dark goes lighter), so hover always moves AWAY
|
|
1835
|
+
from the ink and contrast only improves. neutral has no accent tokens anywhere and is mapped the way
|
|
1836
|
+
Badge already maps it - --color-text on --color-surface solid, --color-surface-sunken soft - with its
|
|
1837
|
+
hover mixed from currentColor, since there is no --color-text-hover to point at. */
|
|
1838
|
+
.twc-btn[data-tone="success"] {
|
|
1839
|
+
--_accent: var(--color-success); --_accent-hover: var(--color-success-hover); --_accent-active: var(--color-success-active);
|
|
1840
|
+
--_accent-fg: var(--color-success-fg); --_accent-subtle: var(--color-success-subtle); --_accent-subtle-fg: var(--color-success-subtle-fg);
|
|
1841
|
+
}
|
|
1842
|
+
.twc-btn[data-tone="warning"] {
|
|
1843
|
+
--_accent: var(--color-warning); --_accent-hover: var(--color-warning-hover); --_accent-active: var(--color-warning-active);
|
|
1844
|
+
--_accent-fg: var(--color-warning-fg); --_accent-subtle: var(--color-warning-subtle); --_accent-subtle-fg: var(--color-warning-subtle-fg);
|
|
1845
|
+
}
|
|
1846
|
+
.twc-btn[data-tone="info"] {
|
|
1847
|
+
--_accent: var(--color-info); --_accent-hover: var(--color-info-hover); --_accent-active: var(--color-info-active);
|
|
1848
|
+
--_accent-fg: var(--color-info-fg); --_accent-subtle: var(--color-info-subtle); --_accent-subtle-fg: var(--color-info-subtle-fg);
|
|
1849
|
+
}
|
|
1850
|
+
.twc-btn[data-tone="neutral"] {
|
|
1851
|
+
--_accent: var(--color-text); --_accent-hover: color-mix(in srgb, var(--color-text) 88%, var(--color-surface));
|
|
1852
|
+
--_accent-active: color-mix(in srgb, var(--color-text) 78%, var(--color-surface));
|
|
1853
|
+
--_accent-fg: var(--color-surface); --_accent-subtle: var(--color-surface-sunken); --_accent-subtle-fg: var(--color-text-muted);
|
|
1854
|
+
}
|
|
1814
1855
|
/* solid */
|
|
1815
1856
|
.twc-btn[data-variant="solid"] { background: var(--_accent); color: var(--_accent-fg); }
|
|
1816
1857
|
.twc-btn[data-variant="solid"]:hover:not(:disabled) { background: var(--_accent-hover); box-shadow: var(--shadow-brand); }
|
|
@@ -9357,9 +9398,20 @@ var DT_CSS = `
|
|
|
9357
9398
|
font-size: var(--text-sm); color: var(--color-text); background: var(--twc-dt-row-bg, var(--color-surface));
|
|
9358
9399
|
white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
|
|
9359
9400
|
/* Wrap-text columns: content flows onto multiple lines (the row grows down) instead of
|
|
9360
|
-
clipping to one line. height stays a per-row minimum, so single-line cells are unchanged.
|
|
9401
|
+
clipping to one line. height stays a per-row minimum, so single-line cells are unchanged.
|
|
9402
|
+
The top alignment here is only a DEFAULT for wrapped cells - an explicit verticalAlign at any
|
|
9403
|
+
level resolves to data-valign below, which is more specific and wins. Before that existed, a row
|
|
9404
|
+
mixing a wrapped column with normal ones was silently inconsistent: the wrapped cell sat top and
|
|
9405
|
+
its neighbours sat middle, with no way to say otherwise. */
|
|
9361
9406
|
.twc-dt__td[data-wrap="true"] { white-space: normal; overflow: hidden; text-overflow: clip;
|
|
9362
9407
|
word-break: break-word; overflow-wrap: anywhere; vertical-align: top; padding-block: 10px; line-height: 1.45; }
|
|
9408
|
+
/* Vertical alignment. One attribute, already resolved: column > row > table default, computed in
|
|
9409
|
+
renderLeaf rather than left to three competing selectors, so the precedence is readable in the
|
|
9410
|
+
code and cannot be reordered by an unrelated CSS edit. Matters whenever rows vary in height -
|
|
9411
|
+
wrapText, a multi-line renderCell, or a drag-resized row. */
|
|
9412
|
+
.twc-dt__td[data-valign="top"] { vertical-align: top; }
|
|
9413
|
+
.twc-dt__td[data-valign="middle"] { vertical-align: middle; }
|
|
9414
|
+
.twc-dt__td[data-valign="bottom"] { vertical-align: bottom; }
|
|
9363
9415
|
/* #338: "combined" column cell \u2014 one column showing several source columns' values. */
|
|
9364
9416
|
.twc-dt__combine--stack { display: flex; flex-direction: column; gap: 1px; }
|
|
9365
9417
|
.twc-dt__combine-sep { color: var(--color-text-subtle); padding-inline: 3px; }
|
|
@@ -10128,6 +10180,8 @@ function Datatable({
|
|
|
10128
10180
|
batchActions = [],
|
|
10129
10181
|
onRowSelectionChange,
|
|
10130
10182
|
selectionSummary,
|
|
10183
|
+
verticalAlign,
|
|
10184
|
+
getRowVerticalAlign,
|
|
10131
10185
|
getRowStyle,
|
|
10132
10186
|
getRowClassName,
|
|
10133
10187
|
showExport = false,
|
|
@@ -12707,6 +12761,7 @@ function Datatable({
|
|
|
12707
12761
|
const h = rowHeights[k];
|
|
12708
12762
|
const userRowStyle = getRowStyle ? getRowStyle(row, ri) : void 0;
|
|
12709
12763
|
const userRowClass = getRowClassName ? getRowClassName(row, ri) : void 0;
|
|
12764
|
+
const rowValign = getRowVerticalAlign ? getRowVerticalAlign(row, ri) : void 0;
|
|
12710
12765
|
const { background: _rowBgShorthand, backgroundColor: _rowBgColor, ...restRowStyle } = userRowStyle || {};
|
|
12711
12766
|
const usable = (v) => typeof v === "string" && v.trim() !== "" ? v : void 0;
|
|
12712
12767
|
const rowBg = usable(_rowBgShorthand) ?? usable(_rowBgColor);
|
|
@@ -12817,6 +12872,7 @@ function Datatable({
|
|
|
12817
12872
|
"data-num": c.type === "number" || void 0,
|
|
12818
12873
|
"data-actions": isActions || void 0,
|
|
12819
12874
|
"data-align": c.align !== dtNaturalAlign(c) ? c.align : void 0,
|
|
12875
|
+
"data-valign": c.verticalAlign ?? rowValign ?? verticalAlign,
|
|
12820
12876
|
"data-editable": editable && !isEditing || void 0,
|
|
12821
12877
|
"data-editing": isEditing || void 0,
|
|
12822
12878
|
"data-cell-active": cellActive || void 0,
|