@restio/ui 0.2.1-20260901160735 → 0.2.1-20261007123729
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 +9 -35
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +245 -87
- package/dist/core.js +32 -27
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +186 -145
- package/dist/data.js +19 -19
- package/dist/experimental.cjs +2 -1
- package/dist/experimental.d.ts +206 -33
- package/dist/experimental.js +899 -566
- package/dist/framework.cjs +1 -1
- package/dist/framework.d.ts +73 -101
- package/dist/framework.js +29 -26
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +431 -304
- package/dist/index.js +96 -88
- package/dist/{src-DaTjVaGd.js → src-Bzrq1hWW.js} +12070 -11460
- package/dist/src-kY7g6XFo.cjs +158 -0
- package/dist/ui.css +1 -1
- package/package.json +6 -5
- package/dist/src-gB-fpYMb.cjs +0 -156
package/README.md
CHANGED
|
@@ -61,16 +61,13 @@ Complex/high-risk flows currently covered by automated tests include:
|
|
|
61
61
|
- Menu and Select: keyboard navigation and controlled/uncontrolled behavior
|
|
62
62
|
- Focus management: focus trap tab loop and focus restoration
|
|
63
63
|
|
|
64
|
-
## Documentation
|
|
64
|
+
## Documentation
|
|
65
65
|
|
|
66
|
-
Component documentation
|
|
66
|
+
Component documentation lives in Storybook (`npm run dev`).
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- https://restio.leonardosignorelli.com/operations-control-room.html
|
|
72
|
-
- https://restio.leonardosignorelli.com/operations-portfolio-pulse.html
|
|
73
|
-
- https://restio.leonardosignorelli.com/operations-commitment-register.html
|
|
68
|
+
The standalone showcase that used to live in this repository has moved to the
|
|
69
|
+
[`restio-showcase`](https://github.com/Leonardo-Signorelli/restio-showcase) Next.js app, which consumes
|
|
70
|
+
this package the way a customer does.
|
|
74
71
|
|
|
75
72
|
## Development
|
|
76
73
|
|
|
@@ -81,15 +78,9 @@ npm install
|
|
|
81
78
|
# Start Storybook
|
|
82
79
|
npm run dev
|
|
83
80
|
|
|
84
|
-
# Start standalone showcase pages
|
|
85
|
-
npm run dev:showcase
|
|
86
|
-
|
|
87
81
|
# Build library
|
|
88
82
|
npm run build
|
|
89
83
|
|
|
90
|
-
# Build standalone showcase pages
|
|
91
|
-
npm run build:showcase
|
|
92
|
-
|
|
93
84
|
# Run tests
|
|
94
85
|
npm run test:components
|
|
95
86
|
|
|
@@ -97,28 +88,11 @@ npm run test:components
|
|
|
97
88
|
npm run visual-test
|
|
98
89
|
```
|
|
99
90
|
|
|
100
|
-
##
|
|
101
|
-
|
|
102
|
-
The standalone showcase is deployed to Vercel at `restio.leonardosignorelli.com`. Vercel builds with `npm run build:showcase` and serves the `showcase-static` output directory (see `vercel.json`). Each push and pull request gets an automatic deployment with a preview URL.
|
|
103
|
-
|
|
104
|
-
The base path defaults to `/` (root) for Vercel. It can be overridden via the `SHOWCASE_BASE` environment variable for GitHub Pages preview deploys:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Vercel (default, root)
|
|
108
|
-
npm run build:showcase
|
|
109
|
-
|
|
110
|
-
# GitHub Pages root deploy
|
|
111
|
-
SHOWCASE_BASE=/restio-ui/ npm run build:showcase
|
|
112
|
-
|
|
113
|
-
# GitHub Pages /test preview deploy
|
|
114
|
-
SHOWCASE_BASE=/restio-ui/test/ npm run build:showcase
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Workflows:
|
|
91
|
+
## Workflows
|
|
118
92
|
|
|
119
|
-
- `.github/workflows/
|
|
120
|
-
- `.github/workflows/
|
|
121
|
-
- `.github/workflows/develop-release.yaml` — push to `develop
|
|
93
|
+
- `.github/workflows/test.yaml` — PRs to `develop`, runs lint, build and unit tests
|
|
94
|
+
- `.github/workflows/visual-regression.yml` — PRs to `develop`, runs the visual tests
|
|
95
|
+
- `.github/workflows/develop-release.yaml` — push to `develop` or a tag, builds the library and publishes it to npm
|
|
122
96
|
|
|
123
97
|
## License
|
|
124
98
|
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-kY7g6XFo.cjs");exports.AnchoredOverlay=e.AnchoredOverlay;exports.Banner=e.Banner;exports.Button=e.Button;exports.ButtonDropdown=e.ButtonDropdown;exports.ButtonGroup=e.ButtonGroup;exports.CellType=e.CellType;exports.Checkbox=e.Checkbox;exports.CheckboxGroup=e.CheckboxGroup;exports.DatePicker=e.DatePicker;exports.DateRangePicker=e.DateRangePicker;exports.FileUpload=e.FileUpload;exports.Icon=e.Icon;exports.Input=e.Input;exports.Kbd=e.Kbd;exports.Label=e.Label;exports.Menu=e.Menu;exports.NumberInput=e.NumberInput;exports.OTP=e.OTPComponent;exports.OverlayPanel=e.OverlayPanel;exports.ProgressBar=e.ProgressBar;exports.Radio=e.Radio;exports.RadioGroup=e.RadioGroup;exports.Select=e.Select;exports.SelectionGrid=e.SelectionGrid;exports.ShortcutProvider=e.ShortcutProvider;exports.Stack=e.Stack;exports.Tag=e.Tag;exports.TextInput=e.TextInput;exports.Textarea=e.Textarea;exports.Typography=e.Typography;exports.useDynamicVirtualList=e.useDynamicVirtualList;exports.useShortcut=e.useShortcut;
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React$1 from 'react';
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { RefObject } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* OTP Component Props
|
|
@@ -30,7 +31,7 @@ interface OTPProps {
|
|
|
30
31
|
className?: string;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
declare const OTPComponent:
|
|
34
|
+
declare const OTPComponent: React__default.FC<OTPProps>;
|
|
34
35
|
|
|
35
36
|
/** Interface for an option in a component */
|
|
36
37
|
interface Option {
|
|
@@ -95,7 +96,7 @@ interface BannerProps {
|
|
|
95
96
|
linkLabel?: string;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
declare const Banner:
|
|
99
|
+
declare const Banner: React__default.FC<BannerProps>;
|
|
99
100
|
|
|
100
101
|
type ButtonVariant = "base" | "primary" | "danger" | "invisible" | "link";
|
|
101
102
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -111,7 +112,7 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
111
112
|
count?: number;
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
declare const Button:
|
|
115
|
+
declare const Button: React__default.FC<ButtonProps>;
|
|
115
116
|
|
|
116
117
|
interface ButtonGroupProps {
|
|
117
118
|
options: Option[];
|
|
@@ -128,7 +129,7 @@ interface ButtonGroupProps {
|
|
|
128
129
|
readonly iconOnly?: boolean;
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
declare const ButtonGroup:
|
|
132
|
+
declare const ButtonGroup: React__default.FC<ButtonGroupProps>;
|
|
132
133
|
|
|
133
134
|
interface ButtonDropdownProps {
|
|
134
135
|
/** Currently selected value */
|
|
@@ -153,7 +154,7 @@ interface ButtonDropdownProps {
|
|
|
153
154
|
* A button that opens a dropdown menu to select a single value.
|
|
154
155
|
* Flat component — not a form field. Use Select for form contexts.
|
|
155
156
|
*/
|
|
156
|
-
declare const ButtonDropdown:
|
|
157
|
+
declare const ButtonDropdown: React__default.FC<ButtonDropdownProps>;
|
|
157
158
|
|
|
158
159
|
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> {
|
|
159
160
|
/** Whether the checkbox is checked */
|
|
@@ -170,7 +171,7 @@ interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
170
171
|
onChange?: (checked: boolean) => void;
|
|
171
172
|
}
|
|
172
173
|
|
|
173
|
-
declare const Checkbox:
|
|
174
|
+
declare const Checkbox: React__default.FC<CheckboxProps>;
|
|
174
175
|
|
|
175
176
|
interface CheckboxOption {
|
|
176
177
|
/** Value of the checkbox option */
|
|
@@ -203,7 +204,7 @@ interface CheckboxGroupProps {
|
|
|
203
204
|
* A group of checkboxes that allows multiple selection.
|
|
204
205
|
* Manages the selection state and renders a list of Checkbox components.
|
|
205
206
|
*/
|
|
206
|
-
declare const CheckboxGroup:
|
|
207
|
+
declare const CheckboxGroup: React__default.FC<CheckboxGroupProps>;
|
|
207
208
|
|
|
208
209
|
interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "type"> {
|
|
209
210
|
/** Whether the radio is checked */
|
|
@@ -222,7 +223,7 @@ interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
|
222
223
|
* A styled radio input component.
|
|
223
224
|
* Supports size variants, disabled, and error states.
|
|
224
225
|
*/
|
|
225
|
-
declare const Radio:
|
|
226
|
+
declare const Radio: React__default.FC<RadioProps>;
|
|
226
227
|
|
|
227
228
|
interface RadioOption {
|
|
228
229
|
/** Value of the radio option */
|
|
@@ -257,13 +258,13 @@ interface RadioGroupProps {
|
|
|
257
258
|
* A group of radios that allows single selection.
|
|
258
259
|
* Manages the selection state and renders a list of Radio components.
|
|
259
260
|
*/
|
|
260
|
-
declare const RadioGroup:
|
|
261
|
+
declare const RadioGroup: React__default.FC<RadioGroupProps>;
|
|
261
262
|
|
|
262
263
|
interface AnchoredOverlayProps {
|
|
263
264
|
/** The anchor element that triggers the overlay */
|
|
264
|
-
anchor:
|
|
265
|
+
anchor: React__default.ReactNode;
|
|
265
266
|
/** The target element to display as the overlay */
|
|
266
|
-
target:
|
|
267
|
+
target: React__default.ReactNode;
|
|
267
268
|
/** Whether the overlay is open/visible */
|
|
268
269
|
isOpen?: boolean;
|
|
269
270
|
/** Callback when the overlay should be closed */
|
|
@@ -280,41 +281,37 @@ interface AnchoredOverlayProps {
|
|
|
280
281
|
animationDuration?: number;
|
|
281
282
|
}
|
|
282
283
|
|
|
283
|
-
declare const AnchoredOverlay:
|
|
284
|
+
declare const AnchoredOverlay: React__default.FC<AnchoredOverlayProps>;
|
|
284
285
|
|
|
285
286
|
/** Props for the OverlayPanel.Footer sub-component. */
|
|
286
287
|
interface OverlayPanelFooterProps {
|
|
287
288
|
/** Footer content — typically action buttons (primary, secondary, etc.). */
|
|
288
|
-
children:
|
|
289
|
+
children: React__default.ReactNode;
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
/** Standard footer for OverlayPanel. Compose as a child of OverlayPanel */
|
|
292
|
-
declare const OverlayPanelFooter:
|
|
293
|
+
declare const OverlayPanelFooter: React__default.FC<OverlayPanelFooterProps>;
|
|
293
294
|
|
|
294
295
|
/** Props for the OverlayPanel.Header sub-component.*/
|
|
295
296
|
interface OverlayPanelHeaderProps {
|
|
296
297
|
/** Panel title shown on the left. Accepts string or custom node. */
|
|
297
|
-
title:
|
|
298
|
+
title: React__default.ReactNode;
|
|
298
299
|
/** Called when the close button is clicked. If omitted, no close button is rendered. */
|
|
299
300
|
onClose?: () => void;
|
|
300
301
|
/** Optional actions (buttons, etc.) rendered before the close button. */
|
|
301
|
-
actions?:
|
|
302
|
+
actions?: React__default.ReactNode;
|
|
302
303
|
/** Whether to show the close button. Defaults to true when onClose is provided. */
|
|
303
304
|
showClose?: boolean;
|
|
304
305
|
}
|
|
305
306
|
|
|
306
307
|
/** Standard header for OverlayPanel. Compose as a child of OverlayPanel */
|
|
307
|
-
declare const OverlayPanelHeader:
|
|
308
|
+
declare const OverlayPanelHeader: React__default.FC<OverlayPanelHeaderProps>;
|
|
308
309
|
|
|
309
310
|
/** OverlayPanelPosition defines the possible positions for the OverlayPanel. */
|
|
310
311
|
type OverlayPanelPosition = "center" | "left" | "right" | "top" | "bottom";
|
|
311
312
|
/**
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
* - "dialog": Center dialog, lighter backdrop, may allow outside click to close.
|
|
315
|
-
* - "sidepanel": Left/right slide-in panel, typically with backdrop.
|
|
316
|
-
* - "drawer": Mobile-friendly drawer, usually slides from bottom or side.
|
|
317
|
-
* - "popover": Light overlay, anchored to element, minimal/no backdrop.
|
|
313
|
+
* Visual and behavioral variant: "modal", "dialog", "sidepanel", "drawer", or
|
|
314
|
+
* "popover" (light, anchored, minimal backdrop).
|
|
318
315
|
*/
|
|
319
316
|
type OverlayPanelVariant = "modal" | "dialog" | "sidepanel" | "drawer" | "popover";
|
|
320
317
|
/** Props for the OverlayPanel component.*/
|
|
@@ -379,7 +376,7 @@ interface KbdProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
379
376
|
children: string;
|
|
380
377
|
}
|
|
381
378
|
|
|
382
|
-
declare const Kbd:
|
|
379
|
+
declare const Kbd: React__default.FC<KbdProps>;
|
|
383
380
|
|
|
384
381
|
interface IconProps {
|
|
385
382
|
/**
|
|
@@ -404,8 +401,22 @@ interface IconProps {
|
|
|
404
401
|
height?: string;
|
|
405
402
|
}
|
|
406
403
|
|
|
407
|
-
declare const Icon:
|
|
404
|
+
declare const Icon: React__default.FC<IconProps>;
|
|
408
405
|
|
|
406
|
+
interface InputProps {
|
|
407
|
+
error?: string;
|
|
408
|
+
disabled?: boolean;
|
|
409
|
+
size?: Size;
|
|
410
|
+
leadingIcon?: string;
|
|
411
|
+
trailingIcon?: string;
|
|
412
|
+
autoFocus?: boolean;
|
|
413
|
+
className?: string;
|
|
414
|
+
children: (props: InputChildProps) => React.ReactNode;
|
|
415
|
+
}
|
|
416
|
+
interface InputChildProps {
|
|
417
|
+
id: string;
|
|
418
|
+
disabled?: boolean;
|
|
419
|
+
}
|
|
409
420
|
interface sharedInputProps {
|
|
410
421
|
autoFocus?: boolean;
|
|
411
422
|
placeholder?: string;
|
|
@@ -428,7 +439,186 @@ interface NumberInputProps extends sharedInputProps {
|
|
|
428
439
|
max?: number;
|
|
429
440
|
}
|
|
430
441
|
|
|
431
|
-
declare const NumberInput:
|
|
442
|
+
declare const NumberInput: React__default.FC<NumberInputProps>;
|
|
443
|
+
|
|
444
|
+
declare const Input: React__default.FC<InputProps>;
|
|
445
|
+
|
|
446
|
+
interface TextInputProps extends sharedInputProps {
|
|
447
|
+
value: string | undefined;
|
|
448
|
+
onChange: (value: string | undefined) => void;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
declare const TextInput: React__default.FC<TextInputProps>;
|
|
452
|
+
|
|
453
|
+
interface SelectTemplateProps {
|
|
454
|
+
options: Option[];
|
|
455
|
+
value: string | string[];
|
|
456
|
+
multiple: boolean;
|
|
457
|
+
onChange: (value: string | string[]) => void;
|
|
458
|
+
onClose: () => void;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/** Select template types supported out of the box. */
|
|
462
|
+
type SelectType = "list" | "grid" | "preview-dialog";
|
|
463
|
+
interface SelectBaseProps {
|
|
464
|
+
/** Active value of the select: `string` for single, `string[]` for multiple. */
|
|
465
|
+
value: string | string[];
|
|
466
|
+
/** List of possible options. */
|
|
467
|
+
options: Option[];
|
|
468
|
+
/** Label shown above the field. */
|
|
469
|
+
label?: string;
|
|
470
|
+
/** Helper text shown below the field. */
|
|
471
|
+
helperText?: string;
|
|
472
|
+
/** Disables the select trigger. */
|
|
473
|
+
disabled?: boolean;
|
|
474
|
+
/** Whether the select is read-only. */
|
|
475
|
+
readOnly?: boolean;
|
|
476
|
+
/** Size of the select trigger button. */
|
|
477
|
+
size?: Size;
|
|
478
|
+
/** Enables multiselection. */
|
|
479
|
+
multiple?: boolean;
|
|
480
|
+
/** Called when the selection changes. Receives `string` (single) or `string[]` (multiple). */
|
|
481
|
+
onChange?: (value: string | string[]) => void;
|
|
482
|
+
/** Controlled open state. When provided, the dropdown is controlled externally. */
|
|
483
|
+
open?: boolean;
|
|
484
|
+
/** Notifies open/close changes. Only meaningful when `open` is provided. */
|
|
485
|
+
onOpenChange?: (open: boolean) => void;
|
|
486
|
+
}
|
|
487
|
+
interface SelectProps extends SelectBaseProps {
|
|
488
|
+
/** Built-in template kind. Defaults to `"list"` when omitted. */
|
|
489
|
+
type?: SelectType;
|
|
490
|
+
/** Dialog title (`type="preview-dialog"`). */
|
|
491
|
+
title?: string;
|
|
492
|
+
/** Renders the live preview of drafted selections (`type="preview-dialog"`). */
|
|
493
|
+
renderPreview?: (selected: Option[]) => React.ReactNode;
|
|
494
|
+
/** Custom inline dropdown content (replaces built-in templates). */
|
|
495
|
+
renderList?: (props: SelectTemplateProps) => React.ReactNode;
|
|
496
|
+
/** Custom dialog content (opens an OverlayPanel instead of a dropdown). */
|
|
497
|
+
renderDialog?: (props: SelectTemplateProps) => React.ReactNode;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
declare const Select: React__default.FC<SelectProps>;
|
|
501
|
+
|
|
502
|
+
interface TextareaProps {
|
|
503
|
+
/**
|
|
504
|
+
* Value of the textarea field
|
|
505
|
+
*/
|
|
506
|
+
value: string;
|
|
507
|
+
/**
|
|
508
|
+
* Leading icon to display before the textarea
|
|
509
|
+
*/
|
|
510
|
+
leadingIcon?: string;
|
|
511
|
+
/**
|
|
512
|
+
* Trailing icon to display after the textarea
|
|
513
|
+
*/
|
|
514
|
+
trailingIcon?: string;
|
|
515
|
+
/**
|
|
516
|
+
* Placeholder text for the textarea
|
|
517
|
+
*/
|
|
518
|
+
placeholder?: string;
|
|
519
|
+
/**
|
|
520
|
+
* ARIA label for the textarea
|
|
521
|
+
*/
|
|
522
|
+
ariaLabel?: string;
|
|
523
|
+
/**
|
|
524
|
+
* Callback triggered when the textarea value changes
|
|
525
|
+
* @param value - The current value of the textarea
|
|
526
|
+
*/
|
|
527
|
+
onChange?: (value: string) => void;
|
|
528
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
529
|
+
onBlur?: () => void;
|
|
530
|
+
/**
|
|
531
|
+
* Label for the field
|
|
532
|
+
*/
|
|
533
|
+
label?: string;
|
|
534
|
+
/**
|
|
535
|
+
* Helper text displayed below the field
|
|
536
|
+
*/
|
|
537
|
+
helperText?: string;
|
|
538
|
+
/**
|
|
539
|
+
* Ref for the textarea element
|
|
540
|
+
*/
|
|
541
|
+
ref?: RefObject<HTMLTextAreaElement | null>;
|
|
542
|
+
/**
|
|
543
|
+
* Disabled state
|
|
544
|
+
*/
|
|
545
|
+
disabled?: boolean;
|
|
546
|
+
/**
|
|
547
|
+
* Autofocus the textarea on mount
|
|
548
|
+
*/
|
|
549
|
+
autoFocus?: boolean;
|
|
550
|
+
/**
|
|
551
|
+
* Error message shown below the field (danger state)
|
|
552
|
+
*/
|
|
553
|
+
error?: string;
|
|
554
|
+
/** Size of the textarea */
|
|
555
|
+
size?: Size;
|
|
556
|
+
/** Number of rows (default 3) */
|
|
557
|
+
rows?: number;
|
|
558
|
+
/** Number of cols ( default 1 ) */
|
|
559
|
+
cols?: number;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare const Textarea: React__default.FC<TextareaProps>;
|
|
563
|
+
|
|
564
|
+
interface BaseTypographyProps {
|
|
565
|
+
/**
|
|
566
|
+
* Prefer children when rendering rich/nested content
|
|
567
|
+
*/
|
|
568
|
+
children?: React__default.ReactNode;
|
|
569
|
+
variant: TypographyVariant;
|
|
570
|
+
/**
|
|
571
|
+
* Flag to indicate if the component is disabled.
|
|
572
|
+
* @optional
|
|
573
|
+
*/
|
|
574
|
+
disabled?: boolean;
|
|
575
|
+
/**
|
|
576
|
+
* Optional color string i can pass to the text
|
|
577
|
+
* @optional
|
|
578
|
+
*/
|
|
579
|
+
color?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Font weight applied to the text.
|
|
582
|
+
* @optional
|
|
583
|
+
*/
|
|
584
|
+
fontWeight?: string | number;
|
|
585
|
+
/**
|
|
586
|
+
* Font style applied to the text.
|
|
587
|
+
* @optional
|
|
588
|
+
*/
|
|
589
|
+
fontStyle?: string;
|
|
590
|
+
/**
|
|
591
|
+
* Text decoration applied to the text.
|
|
592
|
+
* @optional
|
|
593
|
+
*/
|
|
594
|
+
textDecoration?: string;
|
|
595
|
+
}
|
|
596
|
+
type TypographyProps<T extends TypographyVariant> = BaseTypographyProps & {
|
|
597
|
+
variant: T;
|
|
598
|
+
} & React__default.ComponentPropsWithoutRef<VariantToElement<T>>;
|
|
599
|
+
type TypographyVariant = "display" | "heading" | "body" | "label" | "code" | "subtitle" | "title" | "caption" | "article-h1" | "article-h2" | "article-h3" | "article-h4" | "article-body" | "article-code" | "article-quote" | "article-caption" | "article-list";
|
|
600
|
+
declare const variantToComponent: {
|
|
601
|
+
readonly display: "h1";
|
|
602
|
+
readonly heading: "h2";
|
|
603
|
+
readonly title: "h3";
|
|
604
|
+
readonly subtitle: "h4";
|
|
605
|
+
readonly body: "p";
|
|
606
|
+
readonly label: "label";
|
|
607
|
+
readonly code: "code";
|
|
608
|
+
readonly caption: "span";
|
|
609
|
+
readonly "article-h1": "h1";
|
|
610
|
+
readonly "article-h2": "h2";
|
|
611
|
+
readonly "article-h3": "h3";
|
|
612
|
+
readonly "article-h4": "h4";
|
|
613
|
+
readonly "article-body": "p";
|
|
614
|
+
readonly "article-code": "code";
|
|
615
|
+
readonly "article-quote": "blockquote";
|
|
616
|
+
readonly "article-caption": "figcaption";
|
|
617
|
+
readonly "article-list": "li";
|
|
618
|
+
};
|
|
619
|
+
type VariantToElement<T extends TypographyVariant> = (typeof variantToComponent)[T];
|
|
620
|
+
|
|
621
|
+
declare const Typography: <T extends TypographyVariant>({ variant, children, color, disabled, className, fontWeight, fontStyle, textDecoration, ...htmlProps }: TypographyProps<T>) => React$1.JSX.Element;
|
|
432
622
|
|
|
433
623
|
type DatePickerMode = "day" | "month" | "quarter" | "year";
|
|
434
624
|
interface DateRange {
|
|
@@ -466,14 +656,13 @@ interface DateRangePickerProps extends Omit<sharedInputProps, "onKeyDown"> {
|
|
|
466
656
|
* Single-date picker supporting day, month, quarter, and year modes.
|
|
467
657
|
* Renders a styled text input and opens a calendar overlay on focus/click.
|
|
468
658
|
*/
|
|
469
|
-
declare const DatePicker:
|
|
659
|
+
declare const DatePicker: React__default.FC<DatePickerProps>;
|
|
470
660
|
|
|
471
661
|
/**
|
|
472
662
|
* Date range picker supporting day, month, quarter, and year modes.
|
|
473
|
-
*
|
|
474
|
-
* Clicking once sets the start date; clicking again sets the end date.
|
|
663
|
+
* Two calendars select the range: the first click sets the start, the second the end.
|
|
475
664
|
*/
|
|
476
|
-
declare const DateRangePicker:
|
|
665
|
+
declare const DateRangePicker: React__default.FC<DateRangePickerProps>;
|
|
477
666
|
|
|
478
667
|
interface LabelProps {
|
|
479
668
|
/**
|
|
@@ -510,7 +699,7 @@ interface StackProps {
|
|
|
510
699
|
* Arranges children in a flex row or column with consistent spacing.
|
|
511
700
|
* Uses design-system gap tokens (`--rst-space-*`) instead of inline rem values.
|
|
512
701
|
*/
|
|
513
|
-
declare const Stack:
|
|
702
|
+
declare const Stack: React__default.FC<StackProps>;
|
|
514
703
|
|
|
515
704
|
interface MenuItem {
|
|
516
705
|
id?: string;
|
|
@@ -521,21 +710,21 @@ interface MenuItem {
|
|
|
521
710
|
onClick?: (item: MenuItem) => void;
|
|
522
711
|
type?: "item" | "separator";
|
|
523
712
|
shortcut?: string[];
|
|
524
|
-
content?:
|
|
713
|
+
content?: React__default.ReactNode;
|
|
525
714
|
}
|
|
526
|
-
interface MenuProps extends
|
|
715
|
+
interface MenuProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
527
716
|
onItemClick?: (item: MenuItem) => void;
|
|
528
717
|
}
|
|
529
|
-
interface MenuSubmenuProps extends
|
|
530
|
-
trigger:
|
|
718
|
+
interface MenuSubmenuProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
719
|
+
trigger: React__default.ReactNode;
|
|
531
720
|
position?: AnchorPosition;
|
|
532
721
|
align?: anchorAlign;
|
|
533
722
|
}
|
|
534
723
|
|
|
535
|
-
declare const Menu:
|
|
536
|
-
Item:
|
|
537
|
-
Separator:
|
|
538
|
-
Submenu:
|
|
724
|
+
declare const Menu: React__default.FC<MenuProps> & {
|
|
725
|
+
Item: React__default.FC<MenuItem>;
|
|
726
|
+
Separator: React__default.FC<React__default.HTMLAttributes<HTMLHRElement>>;
|
|
727
|
+
Submenu: React__default.FC<MenuSubmenuProps>;
|
|
539
728
|
};
|
|
540
729
|
|
|
541
730
|
interface SelectionGridProps {
|
|
@@ -561,7 +750,7 @@ interface SelectionGridProps {
|
|
|
561
750
|
* A grid of selectable items supporting single and multiple selection.
|
|
562
751
|
* Behaves like a selection list but laid out in a grid.
|
|
563
752
|
*/
|
|
564
|
-
declare const SelectionGrid:
|
|
753
|
+
declare const SelectionGrid: React__default.FC<SelectionGridProps>;
|
|
565
754
|
|
|
566
755
|
interface FileUploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
567
756
|
/**
|
|
@@ -599,7 +788,7 @@ interface FileUploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
|
|
|
599
788
|
icon?: string;
|
|
600
789
|
}
|
|
601
790
|
|
|
602
|
-
declare const FileUpload:
|
|
791
|
+
declare const FileUpload: React__default.FC<FileUploadProps>;
|
|
603
792
|
|
|
604
793
|
interface ProgressBarProps {
|
|
605
794
|
/** Current progress value */
|
|
@@ -629,7 +818,7 @@ interface ProgressBarProps {
|
|
|
629
818
|
/**
|
|
630
819
|
* ProgressBar component for displaying progress visually.
|
|
631
820
|
*/
|
|
632
|
-
declare const ProgressBar:
|
|
821
|
+
declare const ProgressBar: React__default.FC<ProgressBarProps>;
|
|
633
822
|
|
|
634
823
|
interface TagProps {
|
|
635
824
|
value: string | number;
|
|
@@ -640,40 +829,19 @@ interface TagProps {
|
|
|
640
829
|
onClear?: () => void;
|
|
641
830
|
}
|
|
642
831
|
|
|
643
|
-
declare const Tag:
|
|
832
|
+
declare const Tag: React__default.FC<TagProps>;
|
|
644
833
|
|
|
645
834
|
/**
|
|
646
835
|
* Props for the ShortcutProvider component
|
|
647
836
|
*/
|
|
648
837
|
interface ShortcutProviderProps {
|
|
649
|
-
readonly children:
|
|
838
|
+
readonly children: React__default.ReactNode;
|
|
650
839
|
}
|
|
651
840
|
/**
|
|
652
|
-
*
|
|
653
|
-
*
|
|
654
|
-
* Features:
|
|
655
|
-
* - Global and component-scoped shortcuts
|
|
656
|
-
* - Visual feedback with tooltips appearing near cursor
|
|
657
|
-
* - Hold-to-execute shortcuts with progress indicators (3s default)
|
|
658
|
-
* - Automatic cleanup of component-scoped shortcuts
|
|
659
|
-
* - Key release detection for cancelling hold shortcuts
|
|
660
|
-
*
|
|
661
|
-
* How it works:
|
|
662
|
-
* 1. Maintains a map of registered shortcuts with their configurations
|
|
663
|
-
* 2. Tracks active components for scoping validation
|
|
664
|
-
* 3. Listens for keyboard events and matches against registered shortcuts
|
|
665
|
-
* 4. Shows tooltip with shortcut keys and function name near cursor
|
|
666
|
-
* 5. Executes actions only after full hold duration (for hold shortcuts)
|
|
667
|
-
* 6. Cancels hold shortcuts when any key is released
|
|
668
|
-
*
|
|
669
|
-
* Component Scoping:
|
|
670
|
-
* - Global shortcuts (no componentId) always available
|
|
671
|
-
* - Component shortcuts only trigger when their component is registered as active
|
|
672
|
-
* - Components auto-register/unregister through useShortcut hook focus/hover handlers
|
|
673
|
-
*
|
|
674
|
-
* @param children - Child components that will have access to shortcut context
|
|
841
|
+
* Manages global and per-component keyboard shortcuts and shows the cursor-anchored
|
|
842
|
+
* feedback tooltip, including progress for hold-to-execute shortcuts (3s default).
|
|
675
843
|
*/
|
|
676
|
-
declare const ShortcutProvider:
|
|
844
|
+
declare const ShortcutProvider: React__default.FC<ShortcutProviderProps>;
|
|
677
845
|
|
|
678
846
|
/**
|
|
679
847
|
* Configuration for a keyboard shortcut
|
|
@@ -691,9 +859,7 @@ interface ShortcutConfig {
|
|
|
691
859
|
*/
|
|
692
860
|
interface UseShortcutOptions {
|
|
693
861
|
/**
|
|
694
|
-
* Scope of the shortcuts:
|
|
695
|
-
* - 'component': Shortcuts only work when this component is focused or hovered
|
|
696
|
-
* - 'global': Shortcuts work globally across the application
|
|
862
|
+
* Scope of the shortcuts: 'global' works app-wide, 'component' only when focused or hovered.
|
|
697
863
|
*/
|
|
698
864
|
scope?: 'global' | 'component';
|
|
699
865
|
/** Whether shortcuts are enabled */
|
|
@@ -733,9 +899,8 @@ interface UseDynamicVirtualListOptions {
|
|
|
733
899
|
/** Fallback height used for items that have not been measured yet */
|
|
734
900
|
estimatedItemHeight?: number;
|
|
735
901
|
/**
|
|
736
|
-
* Extra items rendered above and below the
|
|
737
|
-
*
|
|
738
|
-
* Defaults to 10.
|
|
902
|
+
* Extra items rendered above and below the viewport. Higher values scroll more
|
|
903
|
+
* smoothly at the cost of more DOM nodes. Defaults to 10.
|
|
739
904
|
*/
|
|
740
905
|
overscan?: number;
|
|
741
906
|
}
|
|
@@ -765,14 +930,10 @@ interface UseDynamicVirtualListResult {
|
|
|
765
930
|
scrollTop: number;
|
|
766
931
|
}
|
|
767
932
|
/**
|
|
768
|
-
*
|
|
933
|
+
* Dynamic-height virtual list hook: measures every rendered item with a ResizeObserver
|
|
934
|
+
* and falls back to `estimatedItemHeight`, so variable-height rows scroll correctly.
|
|
769
935
|
*
|
|
770
|
-
*
|
|
771
|
-
* each rendered item's actual height and falls back to `estimatedItemHeight` for
|
|
772
|
-
* items that have not yet been rendered. This allows rows with variable content
|
|
773
|
-
* (wrapped text, expandable cells, group headers) to scroll correctly.
|
|
774
|
-
*
|
|
775
|
-
* Usage:
|
|
936
|
+
* @example
|
|
776
937
|
* ```tsx
|
|
777
938
|
* const { virtualItems, totalSize, containerRef, onScroll, measureElement } =
|
|
778
939
|
* useDynamicVirtualList({ count: rows.length, estimatedItemHeight: 40, overscan: 10 });
|
|
@@ -793,11 +954,8 @@ interface UseDynamicVirtualListResult {
|
|
|
793
954
|
* </div>
|
|
794
955
|
* );
|
|
795
956
|
* ```
|
|
796
|
-
*
|
|
797
|
-
* For table usage, pair with padding `<tr>` spacers at the top and bottom of
|
|
798
|
-
* `<tbody>` and attach `measureElement` to each `<tr>` via a ref callback.
|
|
799
957
|
*/
|
|
800
958
|
declare function useDynamicVirtualList({ count, estimatedItemHeight, overscan, }: UseDynamicVirtualListOptions): UseDynamicVirtualListResult;
|
|
801
959
|
|
|
802
|
-
export { AnchoredOverlay, Banner, Button, ButtonDropdown, ButtonGroup, CellType, Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileUpload, Icon, Kbd, Label, Menu, NumberInput, OTPComponent as OTP, OverlayPanel, ProgressBar, Radio, RadioGroup, SelectionGrid, ShortcutProvider, Stack, Tag, useDynamicVirtualList, useShortcut };
|
|
803
|
-
export type { AnchoredOverlayProps, BannerProps, Breakpoint, ButtonDropdownProps, ButtonGroupProps, ButtonProps, CheckboxGroupProps, CheckboxOption, CheckboxProps, DatePickerMode, DatePickerProps, DateRange, DateRangePickerProps, DynamicVirtualItem, IconProps, KbdProps, LabelProps, ListItemVariant, MenuItem, MenuProps, MenuSubmenuProps, NumberInputProps, OTPProps, Option, OverlayPanelFooterProps, OverlayPanelHeaderProps, OverlayPanelPosition, OverlayPanelProps, OverlayPanelVariant, ProgressBarProps, RadioGroupProps, RadioOption, RadioProps, SelectionGridProps, ShortcutConfig, Size, StackProps, State, TagProps, UseDynamicVirtualListOptions, UseDynamicVirtualListResult, UseShortcutOptions };
|
|
960
|
+
export { AnchoredOverlay, Banner, Button, ButtonDropdown, ButtonGroup, CellType, Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileUpload, Icon, Input, Kbd, Label, Menu, NumberInput, OTPComponent as OTP, OverlayPanel, ProgressBar, Radio, RadioGroup, Select, SelectionGrid, ShortcutProvider, Stack, Tag, TextInput, Textarea, Typography, useDynamicVirtualList, useShortcut };
|
|
961
|
+
export type { AnchoredOverlayProps, BannerProps, Breakpoint, ButtonDropdownProps, ButtonGroupProps, ButtonProps, CheckboxGroupProps, CheckboxOption, CheckboxProps, DatePickerMode, DatePickerProps, DateRange, DateRangePickerProps, DynamicVirtualItem, IconProps, InputProps, KbdProps, LabelProps, ListItemVariant, MenuItem, MenuProps, MenuSubmenuProps, NumberInputProps, OTPProps, Option, OverlayPanelFooterProps, OverlayPanelHeaderProps, OverlayPanelPosition, OverlayPanelProps, OverlayPanelVariant, ProgressBarProps, RadioGroupProps, RadioOption, RadioProps, SelectProps, SelectionGridProps, ShortcutConfig, Size, StackProps, State, TagProps, TextInputProps, TextareaProps, TypographyProps, TypographyVariant, UseDynamicVirtualListOptions, UseDynamicVirtualListResult, UseShortcutOptions };
|