react-os-shell 4.21.1 → 4.41.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/{Browser-2GQLOOS7.js → Browser-TKBH4DZ3.js} +6 -6
- package/dist/{Browser-2GQLOOS7.js.map → Browser-TKBH4DZ3.js.map} +1 -1
- package/dist/{Calculator-QCAJ6ITI.js → Calculator-XERXEV35.js} +5 -5
- package/dist/{Calculator-QCAJ6ITI.js.map → Calculator-XERXEV35.js.map} +1 -1
- package/dist/ConfirmDialog-EEH4CWSW.js +3 -0
- package/dist/{ConfirmDialog-WAM5OKAV.js.map → ConfirmDialog-EEH4CWSW.js.map} +1 -1
- package/dist/{CurrencyConverter-PCYC6RL5.js → CurrencyConverter-OSZISLHT.js} +5 -5
- package/dist/{CurrencyConverter-PCYC6RL5.js.map → CurrencyConverter-OSZISLHT.js.map} +1 -1
- package/dist/{Documents-MOQNF6HE.js → Documents-YRTLDTLX.js} +6 -6
- package/dist/{Documents-MOQNF6HE.js.map → Documents-YRTLDTLX.js.map} +1 -1
- package/dist/{Files-YBH6XKXE.js → Files-WHYCDRYU.js} +7 -7
- package/dist/{Files-YBH6XKXE.js.map → Files-WHYCDRYU.js.map} +1 -1
- package/dist/{Notepad-E3L6AOGU.js → Notepad-6UAWRNZH.js} +6 -6
- package/dist/{Notepad-E3L6AOGU.js.map → Notepad-6UAWRNZH.js.map} +1 -1
- package/dist/{PomodoroTimer-YABFEPEV.js → PomodoroTimer-5ZSIG7SQ.js} +5 -5
- package/dist/{PomodoroTimer-YABFEPEV.js.map → PomodoroTimer-5ZSIG7SQ.js.map} +1 -1
- package/dist/{Preview-SNPHS4PS.js → Preview-VBIWWJLK.js} +6 -6
- package/dist/{Preview-SNPHS4PS.js.map → Preview-VBIWWJLK.js.map} +1 -1
- package/dist/{Spreadsheet-JXQCWZES.js → Spreadsheet-GRD4P3OI.js} +6 -6
- package/dist/{Spreadsheet-JXQCWZES.js.map → Spreadsheet-GRD4P3OI.js.map} +1 -1
- package/dist/{Stock-IPLLRUOC.js → Stock-4BORXILI.js} +5 -5
- package/dist/{Stock-IPLLRUOC.js.map → Stock-4BORXILI.js.map} +1 -1
- package/dist/{Weather-SI5QN7X2.js → Weather-ZPPSEUIY.js} +5 -5
- package/dist/{Weather-SI5QN7X2.js.map → Weather-ZPPSEUIY.js.map} +1 -1
- package/dist/{WorldClock-WYDSMUWX.js → WorldClock-LBKYWDWE.js} +5 -5
- package/dist/{WorldClock-WYDSMUWX.js.map → WorldClock-LBKYWDWE.js.map} +1 -1
- package/dist/apps/index.js +16 -16
- package/dist/{chunk-XRBJARD7.js → chunk-COTCIYLS.js} +4 -4
- package/dist/{chunk-XRBJARD7.js.map → chunk-COTCIYLS.js.map} +1 -1
- package/dist/{chunk-XBV7NUZK.js → chunk-D4WFGAUW.js} +556 -131
- package/dist/chunk-D4WFGAUW.js.map +1 -0
- package/dist/{chunk-IGPSRRL7.js → chunk-GUWAKATU.js} +10 -7
- package/dist/chunk-GUWAKATU.js.map +1 -0
- package/dist/{chunk-HYAW6KIL.js → chunk-HNH7FOYB.js} +16 -4
- package/dist/chunk-HNH7FOYB.js.map +1 -0
- package/dist/{chunk-L2O6B5KT.js → chunk-OXLLRKBC.js} +24 -4
- package/dist/chunk-OXLLRKBC.js.map +1 -0
- package/dist/chunk-TQFUNASX.js +7 -0
- package/dist/{chunk-CM2NWGYZ.js.map → chunk-TQFUNASX.js.map} +1 -1
- package/dist/{chunk-Q3AOIJ7B.js → chunk-X6DOWIY2.js} +3 -3
- package/dist/{chunk-Q3AOIJ7B.js.map → chunk-X6DOWIY2.js.map} +1 -1
- package/dist/{index-Czn1re5M.d.ts → index-B4RRJ5bp.d.ts} +300 -64
- package/dist/index.d.ts +53 -29
- package/dist/index.js +54 -146
- package/dist/index.js.map +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +4 -4
- package/package.json +1 -1
- package/dist/ConfirmDialog-WAM5OKAV.js +0 -3
- package/dist/chunk-CM2NWGYZ.js +0 -7
- package/dist/chunk-HYAW6KIL.js.map +0 -1
- package/dist/chunk-IGPSRRL7.js.map +0 -1
- package/dist/chunk-L2O6B5KT.js.map +0 -1
- package/dist/chunk-XBV7NUZK.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, LabelHTMLAttributes, ElementType, CSSProperties, RefObject } from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, LabelHTMLAttributes, ElementType, MouseEvent, CSSProperties, RefObject } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -10,9 +10,9 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
10
10
|
* it lets someone tell what the button costs WITHOUT reading it, which under
|
|
11
11
|
* time pressure is what actually happens.
|
|
12
12
|
*/
|
|
13
|
-
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'ghost-danger' | 'danger';
|
|
13
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'ghost-danger' | 'danger' | 'link';
|
|
14
14
|
/**
|
|
15
|
-
* `sm`/`md` are the desktop scale. The `touch-*` rungs are for a finger on
|
|
15
|
+
* `sm`/`md`/`lg` are the desktop scale. The `touch-*` rungs are for a finger on
|
|
16
16
|
* glass — a till, a warehouse tablet — and are a SEPARATE ladder on purpose:
|
|
17
17
|
* a till's idea of "medium" is 56px, and naming it `md` would have made the
|
|
18
18
|
* same word mean two sizes depending on which app you were reading.
|
|
@@ -20,7 +20,7 @@ type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'ghost-danger' | 'dange
|
|
|
20
20
|
* Nothing picks a touch size automatically. An app that wants them asks for
|
|
21
21
|
* them, so a desktop portal cannot grow finger-sized buttons by accident.
|
|
22
22
|
*/
|
|
23
|
-
type ButtonSize = 'sm' | 'md' | 'touch-sm' | 'touch' | 'touch-lg' | 'touch-xl';
|
|
23
|
+
type ButtonSize = 'sm' | 'md' | 'lg' | 'touch-sm' | 'touch' | 'touch-lg' | 'touch-xl';
|
|
24
24
|
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className'> {
|
|
25
25
|
variant?: ButtonVariant;
|
|
26
26
|
size?: ButtonSize;
|
|
@@ -45,6 +45,31 @@ interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'cla
|
|
|
45
45
|
}
|
|
46
46
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
47
47
|
|
|
48
|
+
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'children'> {
|
|
49
|
+
/** The icon. Sized by the caller — the kit does not resize what it is given. */
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* What the button does, in words. Required: there is no text to read, so
|
|
53
|
+
* without this the control is unusable to anyone not looking at it.
|
|
54
|
+
*/
|
|
55
|
+
'aria-label': string;
|
|
56
|
+
/**
|
|
57
|
+
* Defaults to `ghost`, where `Button` defaults to `primary`. An icon with no
|
|
58
|
+
* label is almost always a secondary action — a row's overflow menu, a copy
|
|
59
|
+
* affordance, a close — and a grid of solid blue squares is not what any of
|
|
60
|
+
* those want. Ask for `primary` on the rare icon-only main action.
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* `link` is excluded: it exists to shed the box, and a square icon button is
|
|
64
|
+
* nothing but the box. Asking for it would produce a bare coloured glyph
|
|
65
|
+
* with a 40px hit area it no longer draws.
|
|
66
|
+
*/
|
|
67
|
+
variant?: Exclude<ButtonVariant, 'link'>;
|
|
68
|
+
size?: ButtonSize;
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
71
|
+
declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
72
|
+
|
|
48
73
|
/**
|
|
49
74
|
* Shared form-control styling — the single source of truth for the kit's
|
|
50
75
|
* text-input look. Promoted out of SearchableSelect so every form control
|
|
@@ -55,15 +80,17 @@ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAtt
|
|
|
55
80
|
* so the classes survive both the dark-mode allow-list and the design-sync
|
|
56
81
|
* compiled stylesheet.
|
|
57
82
|
*/
|
|
58
|
-
/** `md`
|
|
59
|
-
* for why
|
|
60
|
-
|
|
83
|
+
/** `sm`/`md`/`lg` are the desktop ladder; `touch` is a finger on glass. See
|
|
84
|
+
* ButtonSize for why touch is a separate rung rather than the top of this
|
|
85
|
+
* ladder — a till's idea of "large" is 56px, and one word cannot mean both. */
|
|
86
|
+
type InputSize = 'sm' | 'md' | 'lg' | 'touch';
|
|
61
87
|
declare const INPUT_SIZES: Record<InputSize, string>;
|
|
62
88
|
/** Base look for a text-bearing form control. Native <input>/<select>/<textarea>
|
|
63
89
|
* also receive dark styling for free via the global rule in styles.css. */
|
|
64
90
|
declare const INPUT_BASE: string;
|
|
65
|
-
/** Compose the input classes for a control. Omitting `size`
|
|
66
|
-
* `INPUT_BASE`, so every existing caller is
|
|
91
|
+
/** Compose the input classes for a control. Omitting `size` — or passing the
|
|
92
|
+
* default `md` — yields exactly `INPUT_BASE`, so every existing caller is
|
|
93
|
+
* unaffected. */
|
|
67
94
|
declare function inputClasses(opts?: {
|
|
68
95
|
invalid?: boolean;
|
|
69
96
|
size?: InputSize;
|
|
@@ -95,6 +122,8 @@ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
95
122
|
invalid?: boolean;
|
|
96
123
|
/** Grow the field to fit its content instead of scrolling. */
|
|
97
124
|
autoGrow?: boolean;
|
|
125
|
+
/** Desktop rung, or `touch`. Defaults to `md`. */
|
|
126
|
+
size?: InputSize;
|
|
98
127
|
className?: string;
|
|
99
128
|
}
|
|
100
129
|
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -104,9 +133,18 @@ interface SelectOption {
|
|
|
104
133
|
label: string;
|
|
105
134
|
disabled?: boolean;
|
|
106
135
|
}
|
|
107
|
-
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'onChange' | 'value' | 'className'> {
|
|
136
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'onChange' | 'value' | 'className' | 'size'> {
|
|
108
137
|
value: string;
|
|
109
138
|
onChange: (value: string) => void;
|
|
139
|
+
/**
|
|
140
|
+
* Desktop rung, or `touch`. Defaults to `md`.
|
|
141
|
+
*
|
|
142
|
+
* This shadows the native `size` attribute (the number of rows a select
|
|
143
|
+
* shows when it is rendered as a list box), which is omitted above rather
|
|
144
|
+
* than left to collide. Nothing here has ever rendered as a list box — the
|
|
145
|
+
* kit's Select is a dropdown — so no capability is lost.
|
|
146
|
+
*/
|
|
147
|
+
size?: InputSize;
|
|
110
148
|
options: SelectOption[];
|
|
111
149
|
/** Shown as a disabled first option when no value is selected. */
|
|
112
150
|
placeholder?: string;
|
|
@@ -125,6 +163,20 @@ declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAtt
|
|
|
125
163
|
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange' | 'checked' | 'className'> {
|
|
126
164
|
checked: boolean;
|
|
127
165
|
onChange: (checked: boolean) => void;
|
|
166
|
+
/**
|
|
167
|
+
* Neither checked nor unchecked — the "some of the rows below are selected"
|
|
168
|
+
* state on a select-all box.
|
|
169
|
+
*
|
|
170
|
+
* It has to be a prop because it cannot be an attribute: `indeterminate`
|
|
171
|
+
* exists only as a DOM property, so passing it through JSX sets a bogus
|
|
172
|
+
* attribute, logs "Received `true` for a non-boolean attribute", and leaves
|
|
173
|
+
* the box looking unchecked. Set here through a ref instead.
|
|
174
|
+
*
|
|
175
|
+
* A native checkbox in this state reports itself as `mixed` to assistive
|
|
176
|
+
* technology on its own, so no `aria-checked` is added — writing one would
|
|
177
|
+
* risk contradicting the element.
|
|
178
|
+
*/
|
|
179
|
+
indeterminate?: boolean;
|
|
128
180
|
label?: ReactNode;
|
|
129
181
|
description?: ReactNode;
|
|
130
182
|
className?: string;
|
|
@@ -333,6 +385,29 @@ interface DateRangePickerProps {
|
|
|
333
385
|
declare function toISODate(d: Date): string;
|
|
334
386
|
declare function DateRangePicker({ from, to, onChange, formatDisplay, clearable, placeholder, }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
|
|
335
387
|
|
|
388
|
+
interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'size' | 'type' | 'value' | 'onChange' | 'min' | 'max'> {
|
|
389
|
+
/** A Date, a `YYYY-MM-DD` string, or nothing. */
|
|
390
|
+
value?: Date | string | null;
|
|
391
|
+
/**
|
|
392
|
+
* The chosen date at local midnight, or `null` when the field is empty.
|
|
393
|
+
*
|
|
394
|
+
* A native date input also reports `''` mid-entry, while a partly typed date
|
|
395
|
+
* is not yet a date. Both arrive here as `null`: "no date yet" and "cleared"
|
|
396
|
+
* are the same thing to a caller storing a value.
|
|
397
|
+
*/
|
|
398
|
+
onChange?: (value: Date | null) => void;
|
|
399
|
+
/** Earliest selectable date. */
|
|
400
|
+
min?: Date | string | null;
|
|
401
|
+
/** Latest selectable date. */
|
|
402
|
+
max?: Date | string | null;
|
|
403
|
+
/** Error state — red border + ring, matching Input. */
|
|
404
|
+
invalid?: boolean;
|
|
405
|
+
/** `touch` gives a 56px field for a finger. Defaults to the desktop size. */
|
|
406
|
+
size?: InputSize;
|
|
407
|
+
className?: string;
|
|
408
|
+
}
|
|
409
|
+
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLInputElement>>;
|
|
410
|
+
|
|
336
411
|
interface NumericKeypadProps {
|
|
337
412
|
value: string;
|
|
338
413
|
onChange: (next: string) => void;
|
|
@@ -405,7 +480,7 @@ interface SegmentedProps<T extends string = string> {
|
|
|
405
480
|
declare function Segmented<T extends string = string>({ value, onChange, options, name, size, block, label, className, }: SegmentedProps<T>): react_jsx_runtime.JSX.Element;
|
|
406
481
|
|
|
407
482
|
type SwitchSize = 'sm' | 'md' | 'touch';
|
|
408
|
-
interface SwitchProps {
|
|
483
|
+
interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'type' | 'className'> {
|
|
409
484
|
checked: boolean;
|
|
410
485
|
onChange: (checked: boolean) => void;
|
|
411
486
|
disabled?: boolean;
|
|
@@ -417,7 +492,16 @@ interface SwitchProps {
|
|
|
417
492
|
id?: string;
|
|
418
493
|
className?: string;
|
|
419
494
|
}
|
|
420
|
-
|
|
495
|
+
/**
|
|
496
|
+
* Forwards its ref, and spreads the rest onto the button.
|
|
497
|
+
*
|
|
498
|
+
* A form library hands a field three things: a change handler, a name, and a
|
|
499
|
+
* ref it uses to move focus to the field when validation fails. The first was
|
|
500
|
+
* here; the other two had nowhere to go, so this control could not be a form
|
|
501
|
+
* field at all — which contradicts the kit's own guidance that its controls
|
|
502
|
+
* drop into react-hook-form.
|
|
503
|
+
*/
|
|
504
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
|
|
421
505
|
|
|
422
506
|
interface InputNumberProps {
|
|
423
507
|
value: number | null;
|
|
@@ -644,10 +728,19 @@ interface DescriptionListProps {
|
|
|
644
728
|
/** Hairline-separated rows in a bordered panel. */
|
|
645
729
|
bordered?: boolean;
|
|
646
730
|
size?: 'sm' | 'md';
|
|
731
|
+
/**
|
|
732
|
+
* Shown in place of a value that is `null`, `undefined` or `''`. Defaults to
|
|
733
|
+
* an em dash.
|
|
734
|
+
*
|
|
735
|
+
* A blank cell answers nothing — and inside `bordered`, where the cell has
|
|
736
|
+
* an outline of its own, it reads as a rendering fault rather than as "there
|
|
737
|
+
* is no tracking number". Pass `emptyText={null}` for the old behaviour.
|
|
738
|
+
*/
|
|
739
|
+
emptyText?: ReactNode;
|
|
647
740
|
title?: ReactNode;
|
|
648
741
|
className?: string;
|
|
649
742
|
}
|
|
650
|
-
declare function DescriptionList({ items, columns, bordered, size, title, className, }: DescriptionListProps): react_jsx_runtime.JSX.Element;
|
|
743
|
+
declare function DescriptionList({ items, columns, bordered, size, title, className, emptyText: empty, }: DescriptionListProps): react_jsx_runtime.JSX.Element;
|
|
651
744
|
|
|
652
745
|
type ResultStatus = 'success' | 'error' | 'warning' | 'info' | '404' | '403' | '500';
|
|
653
746
|
interface ResultProps {
|
|
@@ -699,7 +792,14 @@ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
|
699
792
|
type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
|
|
700
793
|
interface AvatarProps {
|
|
701
794
|
src?: string;
|
|
702
|
-
/**
|
|
795
|
+
/**
|
|
796
|
+
* Who this is. It names the avatar to assistive technology and supplies the
|
|
797
|
+
* initials when there is no usable image.
|
|
798
|
+
*
|
|
799
|
+
* Without it the avatar is hidden from assistive technology rather than
|
|
800
|
+
* announced as "question mark" — an avatar nobody can name carries nothing
|
|
801
|
+
* a screen-reader user needs.
|
|
802
|
+
*/
|
|
703
803
|
name?: string;
|
|
704
804
|
size?: AvatarSize;
|
|
705
805
|
status?: AvatarStatus;
|
|
@@ -750,6 +850,16 @@ interface BannerProps {
|
|
|
750
850
|
}
|
|
751
851
|
declare function Banner({ tone, emphasis, title, children, icon, onDismiss, sticky, className, }: BannerProps): react_jsx_runtime.JSX.Element;
|
|
752
852
|
|
|
853
|
+
/**
|
|
854
|
+
* The DOM id of a tab and of the panel it controls, derived from the same
|
|
855
|
+
* prefix so a consumer rendering the panel cannot mismatch them.
|
|
856
|
+
*
|
|
857
|
+
* Exported rather than inlined: the panel is rendered by the CONSUMER, so both
|
|
858
|
+
* sides have to agree on the string, and agreeing by convention in a comment
|
|
859
|
+
* is how these drift.
|
|
860
|
+
*/
|
|
861
|
+
declare const tabButtonId: (prefix: string, id: string) => string;
|
|
862
|
+
declare const tabPanelId: (prefix: string, id: string) => string;
|
|
753
863
|
interface TabItem {
|
|
754
864
|
id: string;
|
|
755
865
|
label: ReactNode;
|
|
@@ -761,9 +871,27 @@ interface TabsProps {
|
|
|
761
871
|
value: string;
|
|
762
872
|
onChange: (id: string) => void;
|
|
763
873
|
variant?: 'underline' | 'pill';
|
|
874
|
+
/**
|
|
875
|
+
* Enables the tab/panel association. With it each tab gains a stable id and
|
|
876
|
+
* an `aria-controls` pointing at `tabPanelId(idPrefix, item.id)`; the
|
|
877
|
+
* consumer gives its panel that id and names it with
|
|
878
|
+
* `aria-labelledby={tabButtonId(idPrefix, item.id)}`.
|
|
879
|
+
*
|
|
880
|
+
* Omitted, nothing is emitted. A tab strip used purely as a filter — no
|
|
881
|
+
* panel to point at — should not claim to control an element that does not
|
|
882
|
+
* exist, which is a dangling reference rather than a helpful one.
|
|
883
|
+
*/
|
|
884
|
+
idPrefix?: string;
|
|
885
|
+
/**
|
|
886
|
+
* Names the strip. A page with more than one — order sections above, media
|
|
887
|
+
* types below — gives a screen-reader user two "tab list"s with nothing to
|
|
888
|
+
* tell them apart, and there was no way to pass a name at all.
|
|
889
|
+
*/
|
|
890
|
+
'aria-label'?: string;
|
|
891
|
+
'aria-labelledby'?: string;
|
|
764
892
|
className?: string;
|
|
765
893
|
}
|
|
766
|
-
declare function Tabs({ items, value, onChange, variant, className }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
894
|
+
declare function Tabs({ items, value, onChange, variant, idPrefix, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
767
895
|
|
|
768
896
|
interface AccordionItem {
|
|
769
897
|
id: string;
|
|
@@ -791,10 +919,37 @@ interface TooltipProps {
|
|
|
791
919
|
}
|
|
792
920
|
declare function Tooltip({ content, side, delay, children }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
793
921
|
|
|
922
|
+
type SemanticGroup = 'success' | 'active' | 'queued' | 'info' | 'pending' | 'warning' | 'danger' | 'draft' | 'neutral';
|
|
923
|
+
/**
|
|
924
|
+
* The one table. `ColoredBadge` reads it too, through its `tone` prop, so a
|
|
925
|
+
* badge given a tone directly and a badge given a status string that maps to
|
|
926
|
+
* that tone are the same colour — which is the promise this component's
|
|
927
|
+
* docblock makes and could not keep for anything that was not a status.
|
|
928
|
+
*/
|
|
929
|
+
declare const GROUP_COLORS: Record<SemanticGroup, string>;
|
|
930
|
+
declare function StatusBadgeProvider({ groups, children, }: {
|
|
931
|
+
groups: Record<string, SemanticGroup>;
|
|
932
|
+
children: ReactNode;
|
|
933
|
+
}): react_jsx_runtime.JSX.Element;
|
|
934
|
+
interface StatusBadgeProps {
|
|
935
|
+
status: string;
|
|
936
|
+
}
|
|
937
|
+
declare function StatusBadge({ status }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
|
|
938
|
+
|
|
794
939
|
interface ColoredBadgeProps {
|
|
940
|
+
/**
|
|
941
|
+
* A semantic tone, resolved through the same table `StatusBadge` uses — so a
|
|
942
|
+
* badge given `tone="success"` and one given a status string that maps to
|
|
943
|
+
* success are the same green.
|
|
944
|
+
*
|
|
945
|
+
* Prefer this to `colorClass`. Raw classes are the escape hatch for a colour
|
|
946
|
+
* the system has no name for, and every consumer reaching for them is a
|
|
947
|
+
* place the theme system cannot follow.
|
|
948
|
+
*/
|
|
949
|
+
tone?: SemanticGroup;
|
|
795
950
|
/** Tailwind classes for the badge color, e.g. `bg-green-100 text-green-800`.
|
|
796
|
-
*
|
|
797
|
-
colorClass
|
|
951
|
+
* Wins over `tone` when both are given. */
|
|
952
|
+
colorClass?: string;
|
|
798
953
|
children: ReactNode;
|
|
799
954
|
/** `xs` = 10px (dense list cells), `sm` = 12px / px-2 (default), `md` =
|
|
800
955
|
* 12px / px-2.5 (matches StatusBadge). */
|
|
@@ -802,23 +957,29 @@ interface ColoredBadgeProps {
|
|
|
802
957
|
/** Capitalize each word — useful for raw status strings like `in_progress`
|
|
803
958
|
* (rendered as `In Progress`). Default false. */
|
|
804
959
|
capitalize?: boolean;
|
|
960
|
+
/**
|
|
961
|
+
* Render a close control — a filter chip the user can drop.
|
|
962
|
+
*
|
|
963
|
+
* Its accessible name is derived from the badge's own text: "Remove Winter
|
|
964
|
+
* tyres", not "Remove". A row of filter chips otherwise gives a screen-reader
|
|
965
|
+
* user five identical buttons and no way to tell which one drops which
|
|
966
|
+
* filter. `closeLabel` overrides it, and is required in practice whenever
|
|
967
|
+
* the children are not plain text — there is nothing to derive from.
|
|
968
|
+
*/
|
|
969
|
+
closable?: boolean;
|
|
970
|
+
onClose?: () => void;
|
|
971
|
+
closeLabel?: string;
|
|
972
|
+
className?: string;
|
|
805
973
|
}
|
|
806
974
|
/**
|
|
807
|
-
* ColoredBadge — a small rounded-full pill
|
|
808
|
-
*
|
|
809
|
-
*
|
|
975
|
+
* ColoredBadge — a small rounded-full pill. Give it a `tone` from the shell's
|
|
976
|
+
* semantic vocabulary, or raw Tailwind classes when the colour has no name.
|
|
977
|
+
*
|
|
978
|
+
* Counterpart to StatusBadge, which takes a domain status STRING and maps it
|
|
979
|
+
* through a provider. Both read the same colour table, so the two never
|
|
980
|
+
* disagree about what success looks like.
|
|
810
981
|
*/
|
|
811
|
-
declare function ColoredBadge({ colorClass, children, size, capitalize }: ColoredBadgeProps): react_jsx_runtime.JSX.Element;
|
|
812
|
-
|
|
813
|
-
type SemanticGroup = 'success' | 'active' | 'queued' | 'info' | 'pending' | 'warning' | 'danger' | 'draft' | 'neutral';
|
|
814
|
-
declare function StatusBadgeProvider({ groups, children, }: {
|
|
815
|
-
groups: Record<string, SemanticGroup>;
|
|
816
|
-
children: ReactNode;
|
|
817
|
-
}): react_jsx_runtime.JSX.Element;
|
|
818
|
-
interface StatusBadgeProps {
|
|
819
|
-
status: string;
|
|
820
|
-
}
|
|
821
|
-
declare function StatusBadge({ status }: StatusBadgeProps): react_jsx_runtime.JSX.Element;
|
|
982
|
+
declare function ColoredBadge({ colorClass, tone, children, size, capitalize, closable, onClose, closeLabel, className, }: ColoredBadgeProps): react_jsx_runtime.JSX.Element;
|
|
822
983
|
|
|
823
984
|
interface EmptyStateProps {
|
|
824
985
|
/** Bold heading, e.g. "No invoices yet". */
|
|
@@ -835,8 +996,16 @@ interface EmptyStateProps {
|
|
|
835
996
|
variant?: 'dashed' | 'card' | 'none';
|
|
836
997
|
/** @deprecated set `variant="none"` instead. */
|
|
837
998
|
frameless?: boolean;
|
|
838
|
-
/**
|
|
839
|
-
|
|
999
|
+
/**
|
|
1000
|
+
* `true`/omitted shows the placeholder inbox, `false` shows nothing, and an
|
|
1001
|
+
* element shows that instead.
|
|
1002
|
+
*
|
|
1003
|
+
* The boolean alone meant every empty state in every app was an inbox — an
|
|
1004
|
+
* empty catalogue, an empty invoice list and an empty inbox drawn
|
|
1005
|
+
* identically, when the icon is the fastest thing on the screen to read.
|
|
1006
|
+
* Defaults to the placeholder (to nothing for `variant="card"`).
|
|
1007
|
+
*/
|
|
1008
|
+
icon?: boolean | ReactNode;
|
|
840
1009
|
/** Action(s) rendered under the text. */
|
|
841
1010
|
children?: ReactNode;
|
|
842
1011
|
}
|
|
@@ -847,6 +1016,53 @@ interface EmptyStateProps {
|
|
|
847
1016
|
*/
|
|
848
1017
|
declare function EmptyState({ title, message, description, hint, variant, frameless, icon, children, }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
849
1018
|
|
|
1019
|
+
/**
|
|
1020
|
+
* Generic breadcrumb trail. Self-contained and styled with the same Tailwind
|
|
1021
|
+
* utilities the shell already ships, so consumers get it for free.
|
|
1022
|
+
*
|
|
1023
|
+
* Pass an ordered list of `items` from root → current. Every crumb except the
|
|
1024
|
+
* last renders as a button when it has an `onClick`; the last crumb is treated
|
|
1025
|
+
* as the current location — rendered inert with `aria-current="page"`. When the
|
|
1026
|
+
* trail is long, set `maxItems` to collapse the middle into an ellipsis
|
|
1027
|
+
* (`first … last-n` ), keeping the first and the tail visible.
|
|
1028
|
+
*/
|
|
1029
|
+
interface BreadcrumbItem {
|
|
1030
|
+
/** Visible label. */
|
|
1031
|
+
label: ReactNode;
|
|
1032
|
+
/** Optional leading icon (typically a 3.5×3.5 svg). */
|
|
1033
|
+
icon?: ReactNode;
|
|
1034
|
+
/**
|
|
1035
|
+
* Navigate to this crumb. Omitted on the current (last) crumb.
|
|
1036
|
+
*
|
|
1037
|
+
* Receives the event, which is what makes `href` usable from a routed app:
|
|
1038
|
+
* the handler calls `preventDefault()` on a plain click and hands the
|
|
1039
|
+
* navigation to its router, while ctrl/middle/right clicks fall through to
|
|
1040
|
+
* the browser untouched. Without the argument an anchor could only ever do a
|
|
1041
|
+
* full page load, which is the thing a single-page app is avoiding.
|
|
1042
|
+
*/
|
|
1043
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
1044
|
+
/**
|
|
1045
|
+
* Where this crumb goes, when it is a real destination.
|
|
1046
|
+
*
|
|
1047
|
+
* A routed app needs this rather than `onClick` alone: an `<a href>` can be
|
|
1048
|
+
* middle-clicked into a new tab, copied, and read off the status bar before
|
|
1049
|
+
* committing to it — none of which a button offers, however well it behaves
|
|
1050
|
+
* once pressed. Given both, the anchor still calls `onClick`, so a client-side
|
|
1051
|
+
* router can intercept the plain-click case and leave the rest to the browser.
|
|
1052
|
+
*/
|
|
1053
|
+
href?: string;
|
|
1054
|
+
}
|
|
1055
|
+
interface BreadcrumbsProps {
|
|
1056
|
+
items: BreadcrumbItem[];
|
|
1057
|
+
/** Node rendered between crumbs. Defaults to a chevron. */
|
|
1058
|
+
separator?: ReactNode;
|
|
1059
|
+
/** Collapse the middle to an ellipsis when there are more than this many
|
|
1060
|
+
* crumbs. `0` (default) never collapses. */
|
|
1061
|
+
maxItems?: number;
|
|
1062
|
+
className?: string;
|
|
1063
|
+
}
|
|
1064
|
+
declare function Breadcrumbs({ items, separator, maxItems, className }: BreadcrumbsProps): react_jsx_runtime.JSX.Element | null;
|
|
1065
|
+
|
|
850
1066
|
interface PageHeaderProps {
|
|
851
1067
|
title: string;
|
|
852
1068
|
/** Muted line under the title. (`subtitle` is an accepted alias.) */
|
|
@@ -856,13 +1072,27 @@ interface PageHeaderProps {
|
|
|
856
1072
|
/** Right-aligned actions. (`children` is also accepted.) */
|
|
857
1073
|
actions?: ReactNode;
|
|
858
1074
|
children?: ReactNode;
|
|
1075
|
+
/**
|
|
1076
|
+
* Icon beside the title — a marker for the page, not a second headline.
|
|
1077
|
+
* Rendered muted and at the title's own size, so it labels the words rather
|
|
1078
|
+
* than competing with them.
|
|
1079
|
+
*/
|
|
1080
|
+
icon?: ReactNode;
|
|
1081
|
+
/**
|
|
1082
|
+
* Trail above the title, root → current, rendered with the kit's own
|
|
1083
|
+
* `Breadcrumbs`. Not a second implementation: the collapsing behaviour, the
|
|
1084
|
+
* `aria-current="page"` on the last crumb and the separator all come from
|
|
1085
|
+
* that component, so a trail in a header and a trail anywhere else stay the
|
|
1086
|
+
* same thing.
|
|
1087
|
+
*/
|
|
1088
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
859
1089
|
}
|
|
860
1090
|
/**
|
|
861
1091
|
* PageHeader — a page/section title with an optional muted description and a
|
|
862
1092
|
* right-aligned actions slot. Accepts both the `description`/`actions` and the
|
|
863
1093
|
* `subtitle`/`children` prop shapes the portals previously used locally.
|
|
864
1094
|
*/
|
|
865
|
-
declare function PageHeader({ title, description, subtitle, actions, children }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1095
|
+
declare function PageHeader({ title, description, subtitle, actions, children, icon, breadcrumbs, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
866
1096
|
|
|
867
1097
|
interface LoadingSpinnerProps {
|
|
868
1098
|
/** Ring diameter: `sm` = 20px, `md` = 32px (default), `lg` = 48px. */
|
|
@@ -1276,35 +1506,6 @@ interface TopNavProps {
|
|
|
1276
1506
|
}
|
|
1277
1507
|
declare function TopNav({ items, activeKey, onSelect, brand, actions, className }: TopNavProps): react_jsx_runtime.JSX.Element;
|
|
1278
1508
|
|
|
1279
|
-
/**
|
|
1280
|
-
* Generic breadcrumb trail. Self-contained and styled with the same Tailwind
|
|
1281
|
-
* utilities the shell already ships, so consumers get it for free.
|
|
1282
|
-
*
|
|
1283
|
-
* Pass an ordered list of `items` from root → current. Every crumb except the
|
|
1284
|
-
* last renders as a button when it has an `onClick`; the last crumb is treated
|
|
1285
|
-
* as the current location — rendered inert with `aria-current="page"`. When the
|
|
1286
|
-
* trail is long, set `maxItems` to collapse the middle into an ellipsis
|
|
1287
|
-
* (`first … last-n` ), keeping the first and the tail visible.
|
|
1288
|
-
*/
|
|
1289
|
-
interface BreadcrumbItem {
|
|
1290
|
-
/** Visible label. */
|
|
1291
|
-
label: ReactNode;
|
|
1292
|
-
/** Optional leading icon (typically a 3.5×3.5 svg). */
|
|
1293
|
-
icon?: ReactNode;
|
|
1294
|
-
/** Navigate to this crumb. Omitted on the current (last) crumb. */
|
|
1295
|
-
onClick?: () => void;
|
|
1296
|
-
}
|
|
1297
|
-
interface BreadcrumbsProps {
|
|
1298
|
-
items: BreadcrumbItem[];
|
|
1299
|
-
/** Node rendered between crumbs. Defaults to a chevron. */
|
|
1300
|
-
separator?: ReactNode;
|
|
1301
|
-
/** Collapse the middle to an ellipsis when there are more than this many
|
|
1302
|
-
* crumbs. `0` (default) never collapses. */
|
|
1303
|
-
maxItems?: number;
|
|
1304
|
-
className?: string;
|
|
1305
|
-
}
|
|
1306
|
-
declare function Breadcrumbs({ items, separator, maxItems, className }: BreadcrumbsProps): react_jsx_runtime.JSX.Element | null;
|
|
1307
|
-
|
|
1308
1509
|
/**
|
|
1309
1510
|
* Unified popup menu component — used for all context menus, dropdowns, and flyouts.
|
|
1310
1511
|
* Reads --menu-density CSS variable: 'tight', 'normal' (default), or 'large'.
|
|
@@ -1501,6 +1702,41 @@ declare function ConfirmProvider({ children }: {
|
|
|
1501
1702
|
children: React.ReactNode;
|
|
1502
1703
|
}): react_jsx_runtime.JSX.Element;
|
|
1503
1704
|
|
|
1705
|
+
interface SearchResult {
|
|
1706
|
+
/** Category label, e.g. "Sales Order". */
|
|
1707
|
+
type: string;
|
|
1708
|
+
/** Primary text shown in the result row. */
|
|
1709
|
+
label: string;
|
|
1710
|
+
/** Optional secondary line. */
|
|
1711
|
+
sub?: string;
|
|
1712
|
+
/** Window-registry key passed to openEntity. */
|
|
1713
|
+
entity_type: string;
|
|
1714
|
+
entity_id: string;
|
|
1715
|
+
}
|
|
1716
|
+
/** A search provider — given a query, returns matching results. The shell
|
|
1717
|
+
* calls every provider in parallel and concatenates the responses. */
|
|
1718
|
+
type SearchProvider = (query: string) => Promise<SearchResult[]>;
|
|
1719
|
+
/** Bundle of search-related consumer config. */
|
|
1720
|
+
interface SearchConfig {
|
|
1721
|
+
providers: SearchProvider[];
|
|
1722
|
+
/** Per-result-type icon (SVG path `d` attribute). Unmatched types fall
|
|
1723
|
+
* back to a generic magnifier glyph. */
|
|
1724
|
+
typeIcons?: Record<string, string>;
|
|
1725
|
+
placeholder?: string;
|
|
1726
|
+
}
|
|
1727
|
+
interface GlobalSearchProps extends Partial<SearchConfig> {
|
|
1728
|
+
/**
|
|
1729
|
+
* What to do with the chosen result. Called after the overlay closes.
|
|
1730
|
+
*
|
|
1731
|
+
* Supplied by whoever renders the overlay, not by the consumer's
|
|
1732
|
+
* `SearchConfig`: inside the desktop shell `Layout` passes `openEntity`, and
|
|
1733
|
+
* a routed app passes its own navigation. Omitted, selecting a result just
|
|
1734
|
+
* closes the overlay — which is what a search with nowhere to go should do.
|
|
1735
|
+
*/
|
|
1736
|
+
onSelect?: (result: SearchResult) => void;
|
|
1737
|
+
}
|
|
1738
|
+
declare function GlobalSearch({ providers, typeIcons, placeholder, onSelect }?: GlobalSearchProps): react_jsx_runtime.JSX.Element | null;
|
|
1739
|
+
|
|
1504
1740
|
interface GridColumn {
|
|
1505
1741
|
key: string;
|
|
1506
1742
|
title: string;
|
|
@@ -1936,4 +2172,4 @@ declare const ALT_SHIFT_N: string;
|
|
|
1936
2172
|
* string when the source is consumed without a build (e.g. tests). */
|
|
1937
2173
|
declare const VERSION: string;
|
|
1938
2174
|
|
|
1939
|
-
export { type
|
|
2175
|
+
export { type CountBadgeProps as $, ALT as A, Banner as B, type ColumnDef as C, type ButtonSize as D, type ButtonVariant as E, CMD_A as F, CMD_DOT as G, CMD_ENTER as H, CMD_K as I, CMD_S as J, Card as K, type CardPadding as L, type CardProps as M, type CellStyle as N, ChatTemplate as O, type PaginatedResponse as P, Checkbox as Q, type CheckboxProps as R, type SearchConfig as S, CheckoutTemplate as T, ColoredBadge as U, type ColoredBadgeProps as V, ConfirmProvider as W, ContainerFillChart as X, type ContainerFillChartProps as Y, type ContainerFillItem as Z, CountBadge as _, type SortState as a, type InputProps as a$, type CountBadgeTone as a0, DashboardTemplate as a1, DataTable as a2, type DataTableColumn as a3, DataTablePage as a4, type DataTableProps as a5, DatePicker as a6, type DatePickerProps as a7, DateRangePicker as a8, type DateRangePickerProps as a9, type FilePickerProps as aA, FormField as aB, type FormFieldProps as aC, FormLayoutPage as aD, GLASS_DIVIDER as aE, GLASS_INPUT_BG as aF, GROUP_COLORS as aG, GalleryTemplate as aH, type Gap as aI, GlobalSearch as aJ, type GlobalSearchProps as aK, Grid as aL, type GridCols as aM, type GridColumn as aN, type GridProps as aO, HelpCenter as aP, type HelpCenterDoc as aQ, type HelpCenterProps as aR, INPUT_BASE as aS, INPUT_SIZES as aT, IconButton as aU, type IconButtonProps as aV, Inline as aW, type InlineProps as aX, Input as aY, InputNumber as aZ, type InputNumberProps as a_, type DescriptionColumns as aa, type DescriptionItem as ab, DescriptionList as ac, type DescriptionListProps as ad, Dialog as ae, type DialogProps as af, type DialogSize as ag, Divider as ah, type DividerProps as ai, type DividerSpacing as aj, DonutChart as ak, type DonutChartProps as al, type DonutSegment as am, Drawer as an, type DrawerProps as ao, type DrawerSide as ap, type DrawerSize as aq, ENTER as ar, EditableGrid as as, type EditableGridProps as at, EmailTemplate as au, EmptyState as av, type EmptyStateProps as aw, ErrorPage as ax, type ErrorPageProps as ay, FilePicker as az, ALT_SHIFT_D as b, type SidebarActionButtonProps as b$, type InputSize as b0, type Justify as b1, Kanban as b2, type KanbanColumn as b3, type KanbanProps as b4, Label as b5, type LabelProps as b6, ListFooter as b7, ListLoadError as b8, type ListLoadErrorProps as b9, PopupMenu as bA, PopupMenuDivider as bB, PopupMenuItem as bC, PopupMenuLabel as bD, Radio as bE, type RadioProps as bF, Result as bG, type ResultProps as bH, type ResultStatus as bI, SHIFT as bJ, type SearchProvider as bK, type SearchResult as bL, type SearchableOption as bM, SearchableSelect as bN, type SearchableSelectProps as bO, Segmented as bP, type SegmentedOption as bQ, type SegmentedProps as bR, type SegmentedSize as bS, Select as bT, type SelectOption as bU, type SelectProps as bV, type SemanticGroup as bW, type SeverityTone as bX, type ShellPrefsAdapter as bY, ShellPrefsProvider as bZ, SidebarActionButton as b_, LoadingSpinner as ba, type LoadingSpinnerProps as bb, MAX_FRACTION_DIGITS as bc, MOD as bd, Markdown as be, type MarkdownProps as bf, MediaUploadField as bg, type MediaUploadFieldProps as bh, MediaUploadGrid as bi, type MediaUploadGridItem as bj, type MediaUploadGridProps as bk, MetricBar as bl, type MetricBarProps as bm, type Milestone as bn, type MilestoneKind as bo, MilestoneTimeline as bp, type MilestoneTimelineProps as bq, NativeSelect as br, NumericKeypad as bs, type NumericKeypadProps as bt, PageHeader as bu, type PageHeaderProps as bv, Pagination as bw, type PaginationProps as bx, Paragraph as by, type ParagraphProps as bz, ALT_SHIFT_E as c, toISODate as c$, SidebarGroupLabel as c0, SidebarLayout as c1, type SidebarLayoutProps as c2, SidebarNavItem as c3, Skeleton as c4, type SkeletonProps as c5, type SkeletonVariant as c6, Sparkline as c7, type SparklineProps as c8, Stack as c9, Title as cA, type TitleLevel as cB, type TitleProps as cC, type ToastOptions as cD, type ToastPlacement as cE, Tooltip as cF, type TooltipProps as cG, TopNav as cH, type TopNavItem as cI, type TopNavProps as cJ, VERSION as cK, appendKey as cL, applyThemePrefs as cM, backspace as cN, confirm as cO, confirmDestructive as cP, formatDate as cQ, glassStyle as cR, inputClasses as cS, isMac as cT, isSeverityTone as cU, mediaFileName as cV, prompt as cW, resolveTheme as cX, severityOf as cY, tabButtonId as cZ, tabPanelId as c_, type StackProps as ca, StatCard as cb, type StatCardProps as cc, Statistic as cd, type StatisticProps as ce, type StatisticSize as cf, type StatisticTone as cg, StatusBadge as ch, StatusBadgeProvider as ci, Switch as cj, type SwitchProps as ck, type SwitchSize as cl, type TabItem as cm, Tabs as cn, type TabsProps as co, Text as cp, type TextProps as cq, type TextSize as cr, type TextTone as cs, type TextWeight as ct, Textarea as cu, type TextareaProps as cv, type Theme as cw, TileButton as cx, type TileButtonProps as cy, type TileSize as cz, ALT_SHIFT_N as d, toast as d0, useClickOutside as d1, useConfirm as d2, useFocusTrap as d3, useIsMobile as d4, useLocalStoragePrefs as d5, useScrollLock as d6, useShellPrefs as d7, useTheme as d8, Accordion as e, type AccordionItem as f, type AccordionProps as g, type Align as h, AuthScreen as i, type AuthScreenProps as j, Avatar as k, AvatarGroup as l, type AvatarGroupProps as m, type AvatarProps as n, type AvatarSize as o, type AvatarStatus as p, type BannerEmphasis as q, type BannerProps as r, type BannerTone as s, BarChart as t, type BarChartProps as u, type BreadcrumbItem as v, Breadcrumbs as w, type BreadcrumbsProps as x, Button as y, type ButtonProps as z };
|