@kenlo/kdls-design-system 2.12.1 → 2.13.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/dist/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/components/Table/Table.d.ts +4 -4
- package/dist/components/Toggle/Toggle.d.ts +6 -0
- package/dist/index.cjs +3 -3
- package/dist/index.css +1 -1
- package/dist/index.js +2221 -2208
- package/kdls-manifest.json +41 -6
- package/package.json +1 -1
|
@@ -29,6 +29,10 @@ export interface CheckboxProps {
|
|
|
29
29
|
name?: string;
|
|
30
30
|
/** Marks the field as required — asterisk on the label and aria-required on the box */
|
|
31
31
|
required?: boolean;
|
|
32
|
+
/** Accessible name when there is no visible label (e.g. a row-selection box) — replaces the label as the name screen readers announce */
|
|
33
|
+
'aria-label'?: string;
|
|
34
|
+
/** Id of the visible element that names the checkbox (e.g. the row's title) */
|
|
35
|
+
'aria-labelledby'?: string;
|
|
32
36
|
/** Additional CSS classes */
|
|
33
37
|
className?: string;
|
|
34
38
|
}
|
|
@@ -6,7 +6,7 @@ import { TableColumnPicker } from './TableColumnPicker';
|
|
|
6
6
|
export interface TableColumn<T = Record<string, unknown>> {
|
|
7
7
|
/** Unique key — matches the row object's property and identifies the column */
|
|
8
8
|
key: string;
|
|
9
|
-
/** Title shown in the header. '' or omitted shows no visible label — the column stays aligned with the grid */
|
|
9
|
+
/** Title shown in the header — also the column header a screen reader reads with each value. '' or omitted shows no visible label — the column stays aligned with the grid, and its header slot is a plain cell */
|
|
10
10
|
title?: string;
|
|
11
11
|
/** Fixed column width — number (px) or any grid-track value ('120px', '1fr'). Don't combine with minWidth/maxWidth */
|
|
12
12
|
width?: number | string;
|
|
@@ -18,7 +18,7 @@ export interface TableColumn<T = Record<string, unknown>> {
|
|
|
18
18
|
align?: 'center' | 'end';
|
|
19
19
|
/** Truncates the content to one line with ellipsis and shows the full value in a Tooltip on hover */
|
|
20
20
|
ellipsis?: boolean;
|
|
21
|
-
/** true = sortable, sorting done by the backend (the component only reports state via onSortChange, doesn't reorder `rows`) · function = sorts on the frontend using this comparator — handle dates and numbers inside it, don't let the component guess the type */
|
|
21
|
+
/** true = sortable, sorting done by the backend (the component only reports state via onSortChange, doesn't reorder `rows`) · function = sorts on the frontend using this comparator — handle dates and numbers inside it, don't let the component guess the type. The header's title becomes a button inside the column header, which carries aria-sort */
|
|
22
22
|
sortable?: boolean | ((a: T, b: T) => number);
|
|
23
23
|
/**
|
|
24
24
|
* Marks this column as a mobile-only action slot — has no effect above the mobile
|
|
@@ -75,9 +75,9 @@ export interface TableProps<T extends Record<string, unknown> = Record<string, u
|
|
|
75
75
|
defaultSort?: TableSort | null;
|
|
76
76
|
/** Fired when clicking a sortable header, with the new state (or null when returning to the neutral state) */
|
|
77
77
|
onSortChange?: (sort: TableSort | null) => void;
|
|
78
|
-
/** Makes the entire row clickable (cursor, focus, and highlight) — like Card's hoverable. No effect without onRowClick */
|
|
78
|
+
/** Makes the entire row clickable (cursor, focus, and highlight) — like Card's hoverable. The row takes Tab focus and stays a table row for screen readers, its cells still read with their column headers. No effect without onRowClick */
|
|
79
79
|
hoverable?: boolean;
|
|
80
|
-
/** Fired when clicking anywhere on the row that isn't an interactive element (button, link, checkbox) —
|
|
80
|
+
/** Fired when clicking anywhere on the row that isn't an interactive element (button, link, checkbox), and on Enter or Space while the row itself has focus — a key pressed on a control inside the row stays with that control. Use with hoverable */
|
|
81
81
|
onRowClick?: (row: T) => void;
|
|
82
82
|
/** Pagination config — passed straight through to the Pagination component, rendered below the list */
|
|
83
83
|
pagination?: Omit<PaginationProps, 'className'>;
|
|
@@ -12,6 +12,8 @@ export interface ToggleItem {
|
|
|
12
12
|
iconRight?: IconElement;
|
|
13
13
|
/** Disables only this item */
|
|
14
14
|
disabled?: boolean;
|
|
15
|
+
/** Accessible name of this item — required in practice when it shows only an icon, which otherwise has no name */
|
|
16
|
+
'aria-label'?: string;
|
|
15
17
|
}
|
|
16
18
|
export interface ToggleProps {
|
|
17
19
|
/** List of options — minimum 2 items */
|
|
@@ -26,6 +28,10 @@ export interface ToggleProps {
|
|
|
26
28
|
onChange?: (value: string) => void;
|
|
27
29
|
/** Disables all items */
|
|
28
30
|
disabled?: boolean;
|
|
31
|
+
/** Accessible name of the group — use when no visible title names the options */
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
/** Id of the visible element that names the group — prefer it over aria-label when that title is on screen */
|
|
34
|
+
'aria-labelledby'?: string;
|
|
29
35
|
/** Additional CSS classes */
|
|
30
36
|
className?: string;
|
|
31
37
|
}
|