@rovula/ui 0.1.28 → 0.1.29
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/cjs/bundle.css +501 -67
- package/dist/cjs/bundle.js +589 -589
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/DataTable/DataTable.d.ts +195 -4
- package/dist/cjs/types/components/DataTable/DataTable.editing.d.ts +20 -0
- package/dist/cjs/types/components/DataTable/DataTable.editing.types.d.ts +145 -0
- package/dist/cjs/types/components/DataTable/DataTable.stories.d.ts +268 -6
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +22 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +4 -0
- package/dist/cjs/types/components/ScrollArea/ScrollArea.d.ts +3 -3
- package/dist/cjs/types/components/ScrollArea/ScrollArea.stories.d.ts +4 -0
- package/dist/cjs/types/components/Table/Table.d.ts +33 -3
- package/dist/cjs/types/components/Table/Table.stories.d.ts +86 -4
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +8 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +1 -0
- package/dist/components/DataTable/DataTable.editing.js +385 -0
- package/dist/components/DataTable/DataTable.editing.types.js +1 -0
- package/dist/components/DataTable/DataTable.js +983 -50
- package/dist/components/DataTable/DataTable.stories.js +1077 -25
- package/dist/components/Dropdown/Dropdown.js +8 -6
- package/dist/components/ScrollArea/ScrollArea.js +2 -2
- package/dist/components/ScrollArea/ScrollArea.stories.js +68 -2
- package/dist/components/Table/Table.js +103 -13
- package/dist/components/Table/Table.stories.js +226 -9
- package/dist/components/TextInput/TextInput.js +6 -4
- package/dist/components/TextInput/TextInput.stories.js +8 -0
- package/dist/components/TextInput/TextInput.styles.js +7 -1
- package/dist/esm/bundle.css +501 -67
- package/dist/esm/bundle.js +1545 -1545
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/DataTable/DataTable.d.ts +195 -4
- package/dist/esm/types/components/DataTable/DataTable.editing.d.ts +20 -0
- package/dist/esm/types/components/DataTable/DataTable.editing.types.d.ts +145 -0
- package/dist/esm/types/components/DataTable/DataTable.stories.d.ts +268 -6
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +22 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +4 -0
- package/dist/esm/types/components/ScrollArea/ScrollArea.d.ts +3 -3
- package/dist/esm/types/components/ScrollArea/ScrollArea.stories.d.ts +4 -0
- package/dist/esm/types/components/Table/Table.d.ts +33 -3
- package/dist/esm/types/components/Table/Table.stories.d.ts +86 -4
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +8 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +1 -0
- package/dist/index.d.ts +493 -122
- package/dist/src/theme/global.css +747 -96
- package/package.json +14 -2
- package/src/components/DataTable/DataTable.editing.tsx +861 -0
- package/src/components/DataTable/DataTable.editing.types.ts +192 -0
- package/src/components/DataTable/DataTable.stories.tsx +2169 -31
- package/src/components/DataTable/DataTable.test.tsx +696 -0
- package/src/components/DataTable/DataTable.tsx +2260 -94
- package/src/components/Dropdown/Dropdown.tsx +22 -6
- package/src/components/ScrollArea/ScrollArea.stories.tsx +146 -3
- package/src/components/ScrollArea/ScrollArea.tsx +6 -6
- package/src/components/Table/Table.stories.tsx +789 -44
- package/src/components/Table/Table.tsx +294 -28
- package/src/components/TextInput/TextInput.stories.tsx +80 -0
- package/src/components/TextInput/TextInput.styles.ts +7 -1
- package/src/components/TextInput/TextInput.tsx +21 -14
- package/src/test/setup.ts +50 -0
- package/src/theme/global.css +81 -42
- package/src/theme/presets/colors.js +12 -0
- package/src/theme/themes/variable.css +27 -28
- package/src/theme/tokens/baseline.css +2 -1
- package/src/theme/tokens/components/scrollbar.css +9 -4
- package/src/theme/tokens/components/table.css +63 -0
|
@@ -41,6 +41,17 @@ export type DropdownProps = {
|
|
|
41
41
|
selectedOption: Options | null | undefined;
|
|
42
42
|
onClick: (option: Options) => void;
|
|
43
43
|
}) => ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* When `true`, keep focus on the input after selecting an option so the
|
|
46
|
+
* menu stays open (useful for inline row-editing where the user may Tab
|
|
47
|
+
* to the next field instead of closing the dropdown).
|
|
48
|
+
*/
|
|
49
|
+
keepOpenAfterSelect?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Render the options list via a React portal so it escapes containers
|
|
52
|
+
* with `overflow: hidden/auto` (e.g. DataTable scroll wrappers).
|
|
53
|
+
*/
|
|
54
|
+
portal?: boolean;
|
|
44
55
|
} & Omit<InputProps, "value" | "onSelect">;
|
|
45
56
|
declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
46
57
|
id?: string;
|
|
@@ -71,5 +82,16 @@ declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
|
71
82
|
selectedOption: Options | null | undefined;
|
|
72
83
|
onClick: (option: Options) => void;
|
|
73
84
|
}) => ReactNode;
|
|
85
|
+
/**
|
|
86
|
+
* When `true`, keep focus on the input after selecting an option so the
|
|
87
|
+
* menu stays open (useful for inline row-editing where the user may Tab
|
|
88
|
+
* to the next field instead of closing the dropdown).
|
|
89
|
+
*/
|
|
90
|
+
keepOpenAfterSelect?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Render the options list via a React portal so it escapes containers
|
|
93
|
+
* with `overflow: hidden/auto` (e.g. DataTable scroll wrappers).
|
|
94
|
+
*/
|
|
95
|
+
portal?: boolean;
|
|
74
96
|
} & Omit<InputProps, "onSelect" | "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
75
97
|
export default Dropdown;
|
|
@@ -31,6 +31,8 @@ declare const meta: {
|
|
|
31
31
|
selectedOption: Options | null | undefined;
|
|
32
32
|
onClick: (option: Options) => void;
|
|
33
33
|
}) => React.ReactNode;
|
|
34
|
+
keepOpenAfterSelect?: boolean;
|
|
35
|
+
portal?: boolean;
|
|
34
36
|
} & Omit<import("../..").InputProps, "onSelect" | "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
35
37
|
tags: string[];
|
|
36
38
|
parameters: {
|
|
@@ -64,6 +66,8 @@ declare const meta: {
|
|
|
64
66
|
selectedOption: Options | null | undefined;
|
|
65
67
|
onClick: (option: Options) => void;
|
|
66
68
|
}) => React.ReactNode) | undefined;
|
|
69
|
+
keepOpenAfterSelect?: boolean | undefined;
|
|
70
|
+
portal?: boolean | undefined;
|
|
67
71
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
68
72
|
color?: string | undefined | undefined;
|
|
69
73
|
height?: number | string | undefined | undefined;
|
|
@@ -3,9 +3,9 @@ export type ScrollbarSize = "m" | "s" | "xs";
|
|
|
3
3
|
export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Scrollbar thickness.
|
|
6
|
-
* - `m` — 12 px (shows track border)
|
|
7
|
-
* - `s` — 6 px (
|
|
8
|
-
* - `xs` — 2 px (
|
|
6
|
+
* - `m` — 12 px (default, shows track border + 2px thumb inset)
|
|
7
|
+
* - `s` — 6 px (shows track border + 2px thumb inset)
|
|
8
|
+
* - `xs` — 2 px (no track border, no thumb inset)
|
|
9
9
|
*/
|
|
10
10
|
scrollbarSize?: ScrollbarSize;
|
|
11
11
|
/**
|
|
@@ -2,12 +2,42 @@ import * as React from "react";
|
|
|
2
2
|
declare const Table: React.ForwardRefExoticComponent<{
|
|
3
3
|
rootClassName?: string;
|
|
4
4
|
rootRef?: React.LegacyRef<HTMLDivElement>;
|
|
5
|
+
/**
|
|
6
|
+
* Wraps the table in a rounded frame (`rounded-md` + `border-table-c-border`).
|
|
7
|
+
* Uses an outer `overflow-hidden` shell and an inner scroll area so corners clip
|
|
8
|
+
* cleanly (same pattern as scrollable bordered tables elsewhere in the system).
|
|
9
|
+
* For pagination in the same frame, wrap `Table` + `TablePagination` in your own
|
|
10
|
+
* bordered div instead of relying on this prop alone.
|
|
11
|
+
*/
|
|
12
|
+
bordered?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* When false, render only `<table>` (no inner `overflow-auto` wrapper).
|
|
15
|
+
* Use when a parent already provides the scrollport — e.g. `DataTable` — so
|
|
16
|
+
* `sticky` header rows stick to the correct ancestor.
|
|
17
|
+
* Ignored when `bordered` is true (bordered tables always use the inner scroll shell).
|
|
18
|
+
*/
|
|
19
|
+
scrollableWrapper?: boolean;
|
|
5
20
|
} & React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
6
21
|
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
7
|
-
declare const TableBody: React.ForwardRefExoticComponent<
|
|
22
|
+
declare const TableBody: React.ForwardRefExoticComponent<{
|
|
23
|
+
striped?: boolean;
|
|
24
|
+
} & React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
8
25
|
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
9
|
-
declare const TableRow: React.ForwardRefExoticComponent<
|
|
26
|
+
declare const TableRow: React.ForwardRefExoticComponent<{
|
|
27
|
+
divided?: boolean;
|
|
28
|
+
colDivided?: boolean;
|
|
29
|
+
} & React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
10
30
|
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
11
31
|
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
12
32
|
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
13
|
-
export
|
|
33
|
+
export interface TablePaginationProps {
|
|
34
|
+
pageIndex: number;
|
|
35
|
+
pageSize: number;
|
|
36
|
+
totalCount: number;
|
|
37
|
+
pageSizeOptions?: number[];
|
|
38
|
+
onPageChange: (pageIndex: number) => void;
|
|
39
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
declare const TablePagination: React.ForwardRefExoticComponent<TablePaginationProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, TablePagination, };
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
3
|
declare const meta: {
|
|
3
4
|
title: string;
|
|
4
5
|
component: React.ForwardRefExoticComponent<{
|
|
5
6
|
rootClassName?: string;
|
|
6
7
|
rootRef?: React.LegacyRef<HTMLDivElement>;
|
|
8
|
+
bordered?: boolean;
|
|
9
|
+
scrollableWrapper?: boolean;
|
|
7
10
|
} & React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
8
11
|
tags: string[];
|
|
9
12
|
parameters: {
|
|
10
13
|
layout: string;
|
|
11
14
|
};
|
|
15
|
+
argTypes: {
|
|
16
|
+
bordered: {
|
|
17
|
+
control: "boolean";
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
12
21
|
decorators: ((Story: import("@storybook/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
13
22
|
rootClassName?: string | undefined;
|
|
14
23
|
rootRef?: React.LegacyRef<HTMLDivElement> | undefined;
|
|
24
|
+
bordered?: boolean | undefined;
|
|
25
|
+
scrollableWrapper?: boolean | undefined;
|
|
15
26
|
defaultChecked?: boolean | undefined | undefined;
|
|
16
27
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
17
28
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
@@ -283,7 +294,78 @@ declare const meta: {
|
|
|
283
294
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
284
295
|
};
|
|
285
296
|
export default meta;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
297
|
+
/** NON-STRIPED — horizontal row strokes, no column dividers */
|
|
298
|
+
export declare const Default: StoryObj;
|
|
299
|
+
/** NON-STRIPED + COL DIVIDED — horizontal row strokes + vertical column dividers */
|
|
300
|
+
export declare const NonStripedDivided: StoryObj;
|
|
301
|
+
/** STRIPED — alternating bg-a / bg-b, NO row strokes, NO column dividers */
|
|
302
|
+
export declare const Striped: StoryObj;
|
|
303
|
+
/**
|
|
304
|
+
* STRIPED + COL DIVIDED — alternating bg, NO row strokes, WITH column dividers.
|
|
305
|
+
* Primary Xspector table style.
|
|
306
|
+
*/
|
|
307
|
+
export declare const StripedAndDivided: StoryObj;
|
|
308
|
+
/** SELECTED ROW — data-[state=selected] applies transparent-primary-12. Row 1 pre-selected. */
|
|
309
|
+
export declare const WithSelectedRow: StoryObj;
|
|
310
|
+
/**
|
|
311
|
+
* WITH FOOTER — tfoot summary row with bg-table-bg-main + top border.
|
|
312
|
+
* TableFooter is inside Table so bordered works naturally.
|
|
313
|
+
*/
|
|
314
|
+
export declare const WithFooter: StoryObj;
|
|
315
|
+
/**
|
|
316
|
+
* WITH PAGINATION — TablePagination is a sibling of Table so needs an explicit
|
|
317
|
+
* outer wrapper (not covered by Table's bordered prop).
|
|
318
|
+
*/
|
|
319
|
+
export declare const WithPagination: StoryObj;
|
|
320
|
+
/** EMPTY STATE — single full-width row with centered message */
|
|
321
|
+
export declare const Empty: StoryObj;
|
|
322
|
+
/** ALL STATES SIDE-BY-SIDE — reference sheet for design review */
|
|
323
|
+
export declare const AllStates: StoryObj;
|
|
324
|
+
/**
|
|
325
|
+
* WITH SCROLL (Figma 9637-10817)
|
|
326
|
+
*
|
|
327
|
+
* Demonstrates both axes of overflow:
|
|
328
|
+
* - Vertical: fixed-height container → body rows overflow and scroll vertically
|
|
329
|
+
* - Horizontal: 10 columns wider than the viewport → native h-scroll bar appears
|
|
330
|
+
*
|
|
331
|
+
* Implementation notes:
|
|
332
|
+
* - Outer div sets the fixed height and owns the rounded border
|
|
333
|
+
* (TablePagination must sit outside the scrollable Table)
|
|
334
|
+
* - Table gets rootClassName="flex-1 min-h-0" so it grows to fill flex space
|
|
335
|
+
* and allows overflow-auto to kick in
|
|
336
|
+
* - TableHeader gets className="sticky top-0 z-10" for a frozen header row
|
|
337
|
+
*/
|
|
338
|
+
export declare const WithScroll: StoryObj;
|
|
339
|
+
/**
|
|
340
|
+
* SCROLLBAR SIZES — per-axis demo
|
|
341
|
+
*
|
|
342
|
+
* Combine ui-scrollbar-x-{size} + ui-scrollbar-y-{size} independently.
|
|
343
|
+
* CSS: height → horizontal bar thickness | width → vertical bar thickness
|
|
344
|
+
*/
|
|
345
|
+
export declare const ScrollbarSizes: StoryObj;
|
|
346
|
+
/** PANEL DEFAULT — transparent rows + panel-sub-line row dividers */
|
|
347
|
+
export declare const PanelDefault: StoryObj;
|
|
348
|
+
/** PANEL NON-STRIPED DIVIDED — row dividers + vertical column dividers */
|
|
349
|
+
export declare const PanelNonStripedDivided: StoryObj;
|
|
350
|
+
/** PANEL STRIPED — alternating rows (both transparent in panel mode), no row strokes */
|
|
351
|
+
export declare const PanelStriped: StoryObj;
|
|
352
|
+
/** PANEL STRIPED + COL DIVIDED */
|
|
353
|
+
export declare const PanelStripedAndDivided: StoryObj;
|
|
354
|
+
/** PANEL SELECTED ROW — table-panel-selected (yellow/olive) */
|
|
355
|
+
export declare const PanelWithSelectedRow: StoryObj;
|
|
356
|
+
/** PANEL WITH FOOTER */
|
|
357
|
+
export declare const PanelWithFooter: StoryObj;
|
|
358
|
+
/**
|
|
359
|
+
* PANEL WITH PAGINATION
|
|
360
|
+
* TablePagination sits inside the same data-surface="panel" scope so it
|
|
361
|
+
* automatically picks up the panel tokens — no variant prop needed.
|
|
362
|
+
*/
|
|
363
|
+
export declare const PanelWithPagination: StoryObj;
|
|
364
|
+
/** PANEL EMPTY STATE */
|
|
365
|
+
export declare const PanelEmpty: StoryObj;
|
|
366
|
+
/**
|
|
367
|
+
* PANEL WITH SCROLL — sticky header + both scroll axes inside a fixed-height panel.
|
|
368
|
+
*/
|
|
369
|
+
export declare const PanelWithScroll: StoryObj;
|
|
370
|
+
/** PANEL ALL STATES — all variants side-by-side for design review */
|
|
371
|
+
export declare const PanelAllStates: StoryObj;
|
|
@@ -390,6 +390,14 @@ export declare const Default: {
|
|
|
390
390
|
};
|
|
391
391
|
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
392
392
|
};
|
|
393
|
+
/**
|
|
394
|
+
* `isFloatingLabel={false}` — visible **`placeholder`**, no floating animation,
|
|
395
|
+
* and no inner `<label>` when `label` is empty (e.g. table cells, compact filters).
|
|
396
|
+
* Pair with `required={false}` + `hasClearIcon={false}` when mimicking inline fields.
|
|
397
|
+
*/
|
|
398
|
+
export declare const NonFloatingLabel: {
|
|
399
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
400
|
+
};
|
|
393
401
|
export declare const CustomLabel: {
|
|
394
402
|
args: {
|
|
395
403
|
label: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const inputVariant: (props?: ({
|
|
2
|
+
floatingLabelPlaceholder?: boolean | null | undefined;
|
|
2
3
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
3
4
|
rounded?: "none" | "normal" | "full" | null | undefined;
|
|
4
5
|
variant?: "outline" | "flat" | "underline" | null | undefined;
|