@gild-ui/vue 0.0.0-stage → 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +97 -2
- package/dist/Button.cjs +238 -0
- package/dist/Button.d.cts +17 -0
- package/dist/Button.d.mts +17 -0
- package/dist/Button.mjs +237 -0
- package/dist/Button.types-BnJ28ym9.d.mts +1113 -0
- package/dist/Flex.cjs +25 -0
- package/dist/Flex.d.cts +11 -0
- package/dist/Flex.d.mts +11 -0
- package/dist/Flex.mjs +24 -0
- package/dist/Modal.cjs +369 -0
- package/dist/Modal.d.cts +23 -0
- package/dist/Modal.d.mts +23 -0
- package/dist/Modal.mjs +368 -0
- package/dist/TextInput.cjs +299 -0
- package/dist/TextInput.d.cts +37 -0
- package/dist/TextInput.d.mts +37 -0
- package/dist/TextInput.mjs +298 -0
- package/dist/ThemeProvider-CareN7BO.mjs +58 -0
- package/dist/ThemeProvider-DIeSdYou.cjs +63 -0
- package/dist/ThemeProvider.cjs +3 -0
- package/dist/ThemeProvider.d.cts +25 -0
- package/dist/ThemeProvider.d.mts +25 -0
- package/dist/ThemeProvider.mjs +1 -0
- package/dist/Typography.cjs +72 -0
- package/dist/Typography.d.cts +15 -0
- package/dist/Typography.d.mts +15 -0
- package/dist/Typography.mjs +71 -0
- package/dist/View.cjs +12 -0
- package/dist/View.d.cts +11 -0
- package/dist/View.d.mts +11 -0
- package/dist/View.mjs +11 -0
- package/dist/ViewRoot-CsaIxrtD.mjs +40 -0
- package/dist/ViewRoot-X9F9RROv.cjs +45 -0
- package/dist/bridge-D-x2kK4r.d.mts +36 -0
- package/dist/bridge-t6zHXVt-.d.cts +36 -0
- package/dist/engine.cjs +82 -0
- package/dist/engine.d.cts +46 -0
- package/dist/engine.d.mts +46 -0
- package/dist/engine.mjs +26 -0
- package/dist/index.cjs +57 -0
- package/dist/index.d.cts +37 -0
- package/dist/index.d.mts +37 -0
- package/dist/index.mjs +6 -0
- package/dist/props-BRLGZVjJ.d.mts +21 -0
- package/dist/props-Bzm7Wbdv.d.cts +21 -0
- package/dist/props-DDBSpAkG.mjs +49 -0
- package/dist/props-DxoB9cT4.cjs +72 -0
- package/dist/styled-Cmxvlft5.mjs +34 -0
- package/dist/styled-JHkZtq_1.cjs +39 -0
- package/dist/themes-BqxOUMCB.cjs +12 -0
- package/dist/themes-CgFrk0_b.d.cts +1112 -0
- package/dist/themes-rGHVhV5e.mjs +8 -0
- package/dist/useDefaultProps--fOGOSGa.mjs +18 -0
- package/dist/useDefaultProps-qCDgeYFm.cjs +23 -0
- package/dist/useTheme.cjs +8 -0
- package/dist/useTheme.d.cts +3 -0
- package/dist/useTheme.d.mts +3 -0
- package/dist/useTheme.mjs +1 -0
- package/package.json +171 -3
|
@@ -0,0 +1,1113 @@
|
|
|
1
|
+
import { SheetStyleProp } from "@umber-style/vue";
|
|
2
|
+
import { ButtonVariants, InputVariantKey, OpenScale, Register as Register$1, RegisteredTheme, Theme as Theme$1, ThemeBackground, ThemeColor, ThemeFonts, ThemeRadii, ThemeSize, ThemeSpaceKey, ThemeText, ThemeTransitionEasing, ThemeTypography, ThemeZOrder, TypographyVariant, VariantOf } from "@gild-ui/core/theme";
|
|
3
|
+
import { BorderProps, FlexboxProps, LayoutFrameProps, LayoutProps, PositionProps, SpaceProps, SpanProps, TypographyProps as TypographyProps$1 } from "@soroush.tech/styled-system";
|
|
4
|
+
import "@umber-style/cache";
|
|
5
|
+
import { CSSObject as CSSObject$1 } from "@umber-style/core";
|
|
6
|
+
import { ButtonHTMLAttributes, CSSProperties, ChangeEventHandler, ElementType, HTMLAttributes, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from "react";
|
|
7
|
+
/** What the `style` prop of a component takes: an entry of `StyleSheet.create`, or a list of them. */
|
|
8
|
+
type StyleOverride = SheetStyleProp;
|
|
9
|
+
/**
|
|
10
|
+
* What one slot of a component takes in `slotProps`: a `style` (as above), a `className`, and `data-*`
|
|
11
|
+
* and `aria-*` attributes. Nothing a component controls (its listeners, `ref`, `id`, `role`) is here.
|
|
12
|
+
*/
|
|
13
|
+
type SlotOverride = {
|
|
14
|
+
style?: StyleOverride;
|
|
15
|
+
className?: string;
|
|
16
|
+
} & { [K in `data-${string}` | `aria-${string}`]?: string | number | boolean; };
|
|
17
|
+
/** The `slotProps` of a component: one `SlotOverride` for each slot it declares for the theme (`<Name>Slot`). */
|
|
18
|
+
type SlotProps<Slot extends string> = { [S in Slot]?: SlotOverride; };
|
|
19
|
+
/** The defaults a theme may set for every `Accordion`. */
|
|
20
|
+
interface AccordionOwnerState {
|
|
21
|
+
hasGutters?: boolean;
|
|
22
|
+
borderRadius?: keyof ThemeRadii;
|
|
23
|
+
bg?: keyof ThemeBackground;
|
|
24
|
+
textColor?: keyof ThemeText;
|
|
25
|
+
}
|
|
26
|
+
/** The slots of Accordion a theme can style with `styleOverrides`. */
|
|
27
|
+
type AccordionSlot = 'root' | 'region';
|
|
28
|
+
/** What `theme.components.Accordion` takes. */
|
|
29
|
+
type AccordionThemeConfig = ComponentConfig<AccordionOwnerState, AccordionSlot>;
|
|
30
|
+
/** The resolved props AccordionActions's styled elements receive - what `ownerState` exposes. */
|
|
31
|
+
type AccordionActionsOwnerState = Record<string, unknown>;
|
|
32
|
+
/** The slots of AccordionActions a theme can style with `styleOverrides`. */
|
|
33
|
+
type AccordionActionsSlot = 'root';
|
|
34
|
+
/** What `theme.components.AccordionActions` takes. */
|
|
35
|
+
type AccordionActionsThemeConfig = ComponentConfig<AccordionActionsOwnerState, AccordionActionsSlot>;
|
|
36
|
+
/** The resolved props AccordionDetails's styled elements receive - what `ownerState` exposes. */
|
|
37
|
+
type AccordionDetailsOwnerState = Record<string, unknown>;
|
|
38
|
+
/** The slots of AccordionDetails a theme can style with `styleOverrides`. */
|
|
39
|
+
type AccordionDetailsSlot = 'root';
|
|
40
|
+
/** What `theme.components.AccordionDetails` takes. */
|
|
41
|
+
type AccordionDetailsThemeConfig = ComponentConfig<AccordionDetailsOwnerState, AccordionDetailsSlot>;
|
|
42
|
+
/** The defaults a theme may set for every `AccordionGroup`. */
|
|
43
|
+
interface AccordionGroupOwnerState {
|
|
44
|
+
isExclusive?: boolean;
|
|
45
|
+
variant?: 'separated' | 'attached';
|
|
46
|
+
}
|
|
47
|
+
/** The slots of AccordionGroup a theme can style with `styleOverrides`. */
|
|
48
|
+
type AccordionGroupSlot = 'root';
|
|
49
|
+
/** What `theme.components.AccordionGroup` takes. */
|
|
50
|
+
type AccordionGroupThemeConfig = ComponentConfig<AccordionGroupOwnerState, AccordionGroupSlot>;
|
|
51
|
+
/** The defaults a theme may set for every `AccordionSummary`. */
|
|
52
|
+
interface AccordionSummaryOwnerState {
|
|
53
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
54
|
+
}
|
|
55
|
+
/** The slots of AccordionSummary a theme can style with `styleOverrides`. */
|
|
56
|
+
type AccordionSummarySlot = 'root' | 'button' | 'content' | 'icon';
|
|
57
|
+
/** What `theme.components.AccordionSummary` takes. */
|
|
58
|
+
type AccordionSummaryThemeConfig = ComponentConfig<AccordionSummaryOwnerState, AccordionSummarySlot>;
|
|
59
|
+
/** The defaults a theme may set for every `Alert` - its `closeLabel` gives it a language. */
|
|
60
|
+
interface AlertOwnerState {
|
|
61
|
+
severity?: 'success' | 'info' | 'warning' | 'error';
|
|
62
|
+
variant?: 'standard' | 'contained' | 'outlined';
|
|
63
|
+
closeLabel?: string;
|
|
64
|
+
role?: 'alert' | 'status';
|
|
65
|
+
borderRadius?: keyof ThemeRadii;
|
|
66
|
+
}
|
|
67
|
+
/** The slots of Alert a theme can style with `styleOverrides`. */
|
|
68
|
+
type AlertSlot = 'root' | 'icon' | 'message' | 'action' | 'closeButton';
|
|
69
|
+
/** What `theme.components.Alert` takes. */
|
|
70
|
+
type AlertThemeConfig = ComponentConfig<AlertOwnerState, AlertSlot>;
|
|
71
|
+
/** The resolved props AlertTitle's styled elements receive - what `ownerState` exposes. */
|
|
72
|
+
type AlertTitleOwnerState = Record<string, unknown>;
|
|
73
|
+
/** The slots of AlertTitle a theme can style with `styleOverrides`. */
|
|
74
|
+
type AlertTitleSlot = 'root';
|
|
75
|
+
/** What `theme.components.AlertTitle` takes. */
|
|
76
|
+
type AlertTitleThemeConfig = ComponentConfig<AlertTitleOwnerState, AlertTitleSlot>;
|
|
77
|
+
/** The resolved props AppBar's styled elements receive - what `ownerState` exposes. */
|
|
78
|
+
type AppBarOwnerState = Record<string, unknown>;
|
|
79
|
+
/** The slots of AppBar a theme can style with `styleOverrides`. */
|
|
80
|
+
type AppBarSlot = 'root';
|
|
81
|
+
/** What `theme.components.AppBar` takes. */
|
|
82
|
+
type AppBarThemeConfig = ComponentConfig<AppBarOwnerState, AppBarSlot>;
|
|
83
|
+
/** The defaults a theme may set for every `Autocomplete` - its labels give it a language. */
|
|
84
|
+
interface AutocompleteOwnerState {
|
|
85
|
+
borderRadius?: keyof ThemeRadii;
|
|
86
|
+
bg?: keyof ThemeBackground;
|
|
87
|
+
textColor?: keyof ThemeText;
|
|
88
|
+
variant?: InputVariantKey;
|
|
89
|
+
size?: ThemeSize;
|
|
90
|
+
color?: ThemeColor;
|
|
91
|
+
shouldAllowFreeText?: boolean;
|
|
92
|
+
layer?: keyof ThemeZOrder;
|
|
93
|
+
clearLabel?: string;
|
|
94
|
+
openLabel?: string;
|
|
95
|
+
closeLabel?: string;
|
|
96
|
+
loadingText?: string;
|
|
97
|
+
noOptionsText?: string;
|
|
98
|
+
}
|
|
99
|
+
/** The slots of Autocomplete a theme can style with `styleOverrides`. */
|
|
100
|
+
type AutocompleteSlot = 'root' | 'tags' | 'input' | 'clearIndicator' | 'popupIndicator' | 'popup' | 'listbox' | 'group' | 'groupLabel' | 'groupItems' | 'option' | 'status';
|
|
101
|
+
/** What `theme.components.Autocomplete` takes. */
|
|
102
|
+
type AutocompleteThemeConfig = ComponentConfig<AutocompleteOwnerState, AutocompleteSlot>;
|
|
103
|
+
/** The resolved props Avatar's styled elements receive - what `ownerState` exposes. */
|
|
104
|
+
type AvatarOwnerState = Record<string, unknown>;
|
|
105
|
+
/** The slots of Avatar a theme can style with `styleOverrides`. */
|
|
106
|
+
type AvatarSlot = 'root' | 'img';
|
|
107
|
+
/** What `theme.components.Avatar` takes. */
|
|
108
|
+
type AvatarThemeConfig = ComponentConfig<AvatarOwnerState, AvatarSlot>;
|
|
109
|
+
/** The resolved props Backdrop's styled elements receive - what `ownerState` exposes. */
|
|
110
|
+
type BackdropOwnerState = Record<string, unknown>;
|
|
111
|
+
/** The slots of Backdrop a theme can style with `styleOverrides`. */
|
|
112
|
+
type BackdropSlot = 'root';
|
|
113
|
+
/** What `theme.components.Backdrop` takes. */
|
|
114
|
+
type BackdropThemeConfig = ComponentConfig<BackdropOwnerState, BackdropSlot>;
|
|
115
|
+
/** The defaults a theme may set for every `Badge`. */
|
|
116
|
+
interface BadgeOwnerState {
|
|
117
|
+
max?: number;
|
|
118
|
+
variant?: 'standard' | 'dot';
|
|
119
|
+
color?: ThemeColor;
|
|
120
|
+
anchorOrigin?: {
|
|
121
|
+
vertical: 'top' | 'bottom';
|
|
122
|
+
horizontal: 'start' | 'end';
|
|
123
|
+
};
|
|
124
|
+
overlap?: 'rectangular' | 'circular';
|
|
125
|
+
}
|
|
126
|
+
/** The slots of Badge a theme can style with `styleOverrides`. */
|
|
127
|
+
type BadgeSlot = 'root' | 'badge' | 'label';
|
|
128
|
+
/** What `theme.components.Badge` takes. */
|
|
129
|
+
type BadgeThemeConfig = ComponentConfig<BadgeOwnerState, BadgeSlot>;
|
|
130
|
+
/** The defaults a theme may set for every `Breadcrumbs` - its `expandLabel` gives a trail its language. */
|
|
131
|
+
interface BreadcrumbsOwnerState {
|
|
132
|
+
separator?: ReactNode;
|
|
133
|
+
maxItems?: number;
|
|
134
|
+
itemsBeforeCollapse?: number;
|
|
135
|
+
itemsAfterCollapse?: number;
|
|
136
|
+
expandLabel?: string;
|
|
137
|
+
color?: keyof ThemeText;
|
|
138
|
+
}
|
|
139
|
+
/** The slots of Breadcrumbs a theme can style with `styleOverrides`. */
|
|
140
|
+
type BreadcrumbsSlot = 'root' | 'list' | 'item' | 'separator' | 'collapsed' | 'collapsedIcon';
|
|
141
|
+
/** What `theme.components.Breadcrumbs` takes. */
|
|
142
|
+
type BreadcrumbsThemeConfig = ComponentConfig<BreadcrumbsOwnerState, BreadcrumbsSlot>;
|
|
143
|
+
/** The resolved props ButtonGroup's styled elements receive - what `ownerState` exposes. */
|
|
144
|
+
type ButtonGroupOwnerState = Record<string, unknown>;
|
|
145
|
+
/** The slots of ButtonGroup a theme can style with `styleOverrides`. */
|
|
146
|
+
type ButtonGroupSlot = 'root';
|
|
147
|
+
/** What `theme.components.ButtonGroup` takes. */
|
|
148
|
+
type ButtonGroupThemeConfig = ComponentConfig<ButtonGroupOwnerState, ButtonGroupSlot>;
|
|
149
|
+
/** Card's resolved props / theme-settable defaults. */
|
|
150
|
+
interface CardOwnerState {
|
|
151
|
+
variant?: 'paper' | 'bracketBox' | 'interactive';
|
|
152
|
+
/** Merged under any per-instance `titleProps` (instance wins). */
|
|
153
|
+
titleProps?: CardSlotTypographyProps;
|
|
154
|
+
/** Merged under any per-instance `captionProps` (instance wins). */
|
|
155
|
+
captionProps?: CardSlotTypographyProps;
|
|
156
|
+
/** Merged under any per-instance `iconProps` (instance wins). */
|
|
157
|
+
iconProps?: CardSlotIconProps;
|
|
158
|
+
}
|
|
159
|
+
/** Token-typed Typography props a theme may set for Card's title/caption slots. */
|
|
160
|
+
interface CardSlotTypographyProps {
|
|
161
|
+
variant?: ThemeTypography;
|
|
162
|
+
color?: keyof ThemeText;
|
|
163
|
+
fontFamily?: keyof ThemeFonts;
|
|
164
|
+
mb?: ThemeSpaceKey;
|
|
165
|
+
}
|
|
166
|
+
/** Token-typed Icon props a theme may set for Card's icon slot. */
|
|
167
|
+
interface CardSlotIconProps {
|
|
168
|
+
color?: keyof ThemeText;
|
|
169
|
+
size?: string | number;
|
|
170
|
+
}
|
|
171
|
+
/** The slots of Card a theme can style with `styleOverrides`. */
|
|
172
|
+
type CardSlot = 'root' | 'title' | 'caption' | 'icon';
|
|
173
|
+
/** What `theme.components.Card` takes. */
|
|
174
|
+
type CardThemeConfig = ComponentConfig<CardOwnerState, CardSlot>;
|
|
175
|
+
/** The resolved props Checkbox's styled elements receive - what `ownerState` exposes. */
|
|
176
|
+
type CheckboxOwnerState = Record<string, unknown>;
|
|
177
|
+
/** The slots of Checkbox a theme can style with `styleOverrides`. */
|
|
178
|
+
type CheckboxSlot = 'root' | 'input' | 'icon' | 'label';
|
|
179
|
+
/** What `theme.components.Checkbox` takes. */
|
|
180
|
+
type CheckboxThemeConfig = ComponentConfig<CheckboxOwnerState, CheckboxSlot>;
|
|
181
|
+
/** The corner shapes of a control or a surface. */
|
|
182
|
+
type ShapeKey$2 = 'square' | 'rounded' | 'pill';
|
|
183
|
+
/** The defaults a theme may set for every `Chip` - its `deleteLabel` gives it a language. */
|
|
184
|
+
interface ChipOwnerState {
|
|
185
|
+
variant?: 'contained' | 'outlined' | 'text';
|
|
186
|
+
color?: ThemeColor;
|
|
187
|
+
size?: ThemeSize;
|
|
188
|
+
shape?: ShapeKey$2;
|
|
189
|
+
borderRadius?: keyof ThemeRadii;
|
|
190
|
+
deleteLabel?: string;
|
|
191
|
+
}
|
|
192
|
+
/** The slots of Chip a theme can style with `styleOverrides`. */
|
|
193
|
+
type ChipSlot = 'root' | 'body' | 'label' | 'icon' | 'avatar' | 'deleteIcon';
|
|
194
|
+
/** What `theme.components.Chip` takes. */
|
|
195
|
+
type ChipThemeConfig = ComponentConfig<ChipOwnerState, ChipSlot>;
|
|
196
|
+
/** The resolved props CircularProgress's styled elements receive - what `ownerState` exposes. */
|
|
197
|
+
type CircularProgressOwnerState = Record<string, unknown>;
|
|
198
|
+
/** The slots of CircularProgress a theme can style with `styleOverrides`. */
|
|
199
|
+
type CircularProgressSlot = 'root' | 'track' | 'circle';
|
|
200
|
+
/** What `theme.components.CircularProgress` takes. */
|
|
201
|
+
type CircularProgressThemeConfig = ComponentConfig<CircularProgressOwnerState, CircularProgressSlot>;
|
|
202
|
+
/** The defaults a theme may set for every `Collapse`. */
|
|
203
|
+
interface CollapseOwnerState {
|
|
204
|
+
orientation?: 'vertical' | 'horizontal';
|
|
205
|
+
collapsedSize?: string | number;
|
|
206
|
+
timeout?: number | {
|
|
207
|
+
enter: number;
|
|
208
|
+
exit: number;
|
|
209
|
+
};
|
|
210
|
+
easing?: keyof ThemeTransitionEasing;
|
|
211
|
+
shouldAppear?: boolean;
|
|
212
|
+
}
|
|
213
|
+
/** The slots of Collapse a theme can style with `styleOverrides`. */
|
|
214
|
+
type CollapseSlot = 'root' | 'wrapper' | 'inner';
|
|
215
|
+
/** What `theme.components.Collapse` takes. */
|
|
216
|
+
type CollapseThemeConfig = ComponentConfig<CollapseOwnerState, CollapseSlot>;
|
|
217
|
+
/** The resolved props Paper's styled elements receive - what `ownerState` exposes. */
|
|
218
|
+
type PaperOwnerState = Record<string, unknown>;
|
|
219
|
+
/** The slots of Paper a theme can style with `styleOverrides`. */
|
|
220
|
+
type PaperSlot = 'root';
|
|
221
|
+
/** What `theme.components.Paper` takes. */
|
|
222
|
+
type PaperThemeConfig = ComponentConfig<PaperOwnerState, PaperSlot>;
|
|
223
|
+
/** Valid values for the color prop - derived from theme.text keys. */
|
|
224
|
+
type ViewColorToken = keyof Theme['text'];
|
|
225
|
+
/** Valid values for the bg prop - derived from theme.background keys. */
|
|
226
|
+
type ViewBackgroundToken = keyof Theme['background'];
|
|
227
|
+
/** Valid values for the borderColor prop - derived from theme.border keys. */
|
|
228
|
+
type ViewBorderColorToken = keyof Theme['border'];
|
|
229
|
+
/** Valid values for the borderWidth prop - derived from theme.borderWidths keys. */
|
|
230
|
+
type ViewBorderWidthToken = keyof Theme['borderWidths'];
|
|
231
|
+
/** Valid theme tokens for border-radius. Raw CSS pixel values (e.g. '6px', '9999px') are also accepted. */
|
|
232
|
+
type OrPixels<Token extends PropertyKey> = Token | `${number}px`;
|
|
233
|
+
type ViewBorderRadiusToken = OrPixels<keyof Theme['radii']>;
|
|
234
|
+
interface ViewProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'style'>, SpaceProps, LayoutProps, TypographyProps$1, Omit<BorderProps, 'borderColor' | 'borderWidth' | 'borderRadius'>, PositionProps, SpanProps, LayoutFrameProps {
|
|
235
|
+
/** Overrides the CSS of the element: an entry of `StyleSheet.create`, or a list of them. */
|
|
236
|
+
style?: StyleOverride;
|
|
237
|
+
/** Overrides for the slot a theme can style: `style`, `className`, `data-*` and `aria-*`. */
|
|
238
|
+
slotProps?: SlotProps<'root'>;
|
|
239
|
+
bg?: ViewBackgroundToken;
|
|
240
|
+
/** Resolves against theme.border - light · primary · dark */
|
|
241
|
+
borderColor?: ViewBorderColorToken;
|
|
242
|
+
/** Resolves against theme.borderWidths - none · thin · base · thick */
|
|
243
|
+
borderWidth?: ViewBorderWidthToken;
|
|
244
|
+
/** Theme tokens: sq · sm · md · lg. Also accepts raw CSS pixel values e.g. '6px', '9999px'. */
|
|
245
|
+
borderRadius?: ViewBorderRadiusToken;
|
|
246
|
+
opacity?: number;
|
|
247
|
+
cursor?: CSSProperties['cursor'];
|
|
248
|
+
/** CSS order for flex/grid item placement. Accepts responsive arrays. */
|
|
249
|
+
order?: FlexboxProps['order'];
|
|
250
|
+
}
|
|
251
|
+
/** The resolved props View's styled elements receive - what `ownerState` exposes. */
|
|
252
|
+
type ViewOwnerState = Record<string, unknown>;
|
|
253
|
+
/** The slots of View a theme can style with `styleOverrides`. */
|
|
254
|
+
type ViewSlot = 'root';
|
|
255
|
+
/** What `theme.components.View` takes. */
|
|
256
|
+
type ViewThemeConfig = ComponentConfig<ViewOwnerState, ViewSlot>;
|
|
257
|
+
/** Valid values for the gap prop - derived from theme.space keys. */
|
|
258
|
+
type GapToken$1 = keyof Theme['space'];
|
|
259
|
+
/**
|
|
260
|
+
* `layout` puts the flex container on the page frame, as on any View: the theme's margin and
|
|
261
|
+
* max width per breakpoint. The flexbox stays as set - a column by default, a row with
|
|
262
|
+
* `flexDirection="row"`. Columns are Grid's: content on the page columns uses `<Grid layout>`.
|
|
263
|
+
*/
|
|
264
|
+
interface FlexProps extends ViewProps, FlexboxProps {}
|
|
265
|
+
/** The resolved props Flex's styled elements receive - what `ownerState` exposes. */
|
|
266
|
+
type FlexOwnerState = Record<string, unknown>;
|
|
267
|
+
/** The slots of Flex a theme can style with `styleOverrides`. */
|
|
268
|
+
type FlexSlot = 'root';
|
|
269
|
+
/** What `theme.components.Flex` takes. */
|
|
270
|
+
type FlexThemeConfig = ComponentConfig<FlexOwnerState, FlexSlot>;
|
|
271
|
+
type PaperElevation = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24;
|
|
272
|
+
/** The defaults a theme may set for every `Menu`. */
|
|
273
|
+
interface MenuOwnerState {
|
|
274
|
+
align?: 'start' | 'end';
|
|
275
|
+
borderRadius?: keyof ThemeRadii;
|
|
276
|
+
marginThreshold?: ThemeSpaceKey;
|
|
277
|
+
elevation?: PaperElevation;
|
|
278
|
+
layer?: keyof ThemeZOrder;
|
|
279
|
+
color?: ThemeColor;
|
|
280
|
+
textColor?: keyof ThemeText;
|
|
281
|
+
size?: ThemeSize;
|
|
282
|
+
dense?: boolean;
|
|
283
|
+
}
|
|
284
|
+
/** The slots of Menu a theme can style with `styleOverrides`. */
|
|
285
|
+
type MenuSlot = 'root' | 'paper' | 'list';
|
|
286
|
+
/** What `theme.components.Menu` takes. */
|
|
287
|
+
type MenuThemeConfig = ComponentConfig<MenuOwnerState, MenuSlot>;
|
|
288
|
+
/** The defaults a theme may set for every `ContextMenu` - a `Menu`'s, placed at the pointer. */
|
|
289
|
+
type ContextMenuOwnerState = Omit<MenuOwnerState, 'align'>;
|
|
290
|
+
/** The slots of ContextMenu a theme can style with `styleOverrides`. */
|
|
291
|
+
type ContextMenuSlot = 'root' | 'paper' | 'list';
|
|
292
|
+
/** What `theme.components.ContextMenu` takes. */
|
|
293
|
+
type ContextMenuThemeConfig = ComponentConfig<ContextMenuOwnerState, ContextMenuSlot>;
|
|
294
|
+
/** The resolved props Drawer's styled elements receive - what `ownerState` exposes. */
|
|
295
|
+
type DrawerOwnerState = Record<string, unknown>;
|
|
296
|
+
/** The slots of Drawer a theme can style with `styleOverrides`. */
|
|
297
|
+
type DrawerSlot = 'root';
|
|
298
|
+
/** What `theme.components.Drawer` takes. */
|
|
299
|
+
type DrawerThemeConfig = ComponentConfig<DrawerOwnerState, DrawerSlot>;
|
|
300
|
+
/** The defaults a theme may set for every `Fab`. */
|
|
301
|
+
interface FabOwnerState {
|
|
302
|
+
variant?: 'circular' | 'extended';
|
|
303
|
+
color?: ThemeColor;
|
|
304
|
+
size?: ThemeSize;
|
|
305
|
+
}
|
|
306
|
+
/** The slots of Fab a theme can style with `styleOverrides`. */
|
|
307
|
+
type FabSlot = 'root' | 'label' | 'labelText';
|
|
308
|
+
/** What `theme.components.Fab` takes. */
|
|
309
|
+
type FabThemeConfig = ComponentConfig<FabOwnerState, FabSlot>;
|
|
310
|
+
/** The defaults a theme may set for every `FabMenu`. */
|
|
311
|
+
interface FabMenuOwnerState {
|
|
312
|
+
direction?: 'up' | 'down' | 'left' | 'right';
|
|
313
|
+
align?: 'start' | 'end';
|
|
314
|
+
color?: ThemeColor;
|
|
315
|
+
size?: ThemeSize;
|
|
316
|
+
}
|
|
317
|
+
/** The slots of FabMenu a theme can style with `styleOverrides`. */
|
|
318
|
+
type FabMenuSlot = 'root' | 'list';
|
|
319
|
+
/** What `theme.components.FabMenu` takes. */
|
|
320
|
+
type FabMenuThemeConfig = ComponentConfig<FabMenuOwnerState, FabMenuSlot>;
|
|
321
|
+
/** The resolved props FocusTrap's styled elements receive - what `ownerState` exposes. */
|
|
322
|
+
type FocusTrapOwnerState = Record<string, unknown>;
|
|
323
|
+
/** The slots of FocusTrap a theme can style with `styleOverrides`. */
|
|
324
|
+
type FocusTrapSlot = 'root';
|
|
325
|
+
/** What `theme.components.FocusTrap` takes. */
|
|
326
|
+
type FocusTrapThemeConfig = ComponentConfig<FocusTrapOwnerState, FocusTrapSlot>;
|
|
327
|
+
/** The resolved props Form's styled elements receive - what `ownerState` exposes. */
|
|
328
|
+
type FormOwnerState = Record<string, unknown>;
|
|
329
|
+
/** The slots of Form a theme can style with `styleOverrides`. */
|
|
330
|
+
type FormSlot = 'root';
|
|
331
|
+
/** What `theme.components.Form` takes. */
|
|
332
|
+
type FormThemeConfig = ComponentConfig<FormOwnerState, FormSlot>;
|
|
333
|
+
/** The resolved props FormControl's styled elements receive - what `ownerState` exposes. */
|
|
334
|
+
type FormControlOwnerState = Record<string, unknown>;
|
|
335
|
+
/** The slots of FormControl a theme can style with `styleOverrides`. */
|
|
336
|
+
type FormControlSlot = 'root';
|
|
337
|
+
/** What `theme.components.FormControl` takes. */
|
|
338
|
+
type FormControlThemeConfig = ComponentConfig<FormControlOwnerState, FormControlSlot>;
|
|
339
|
+
/** The resolved props FormHelperText's styled elements receive - what `ownerState` exposes. */
|
|
340
|
+
type FormHelperTextOwnerState = Record<string, unknown>;
|
|
341
|
+
/** The slots of FormHelperText a theme can style with `styleOverrides`. */
|
|
342
|
+
type FormHelperTextSlot = 'root';
|
|
343
|
+
/** What `theme.components.FormHelperText` takes. */
|
|
344
|
+
type FormHelperTextThemeConfig = ComponentConfig<FormHelperTextOwnerState, FormHelperTextSlot>;
|
|
345
|
+
/** The resolved props FormLabel's styled elements receive - what `ownerState` exposes. */
|
|
346
|
+
type FormLabelOwnerState = Record<string, unknown>;
|
|
347
|
+
/** The slots of FormLabel a theme can style with `styleOverrides`. */
|
|
348
|
+
type FormLabelSlot = 'root';
|
|
349
|
+
/** What `theme.components.FormLabel` takes. */
|
|
350
|
+
type FormLabelThemeConfig = ComponentConfig<FormLabelOwnerState, FormLabelSlot>;
|
|
351
|
+
/** The resolved props Grid's styled elements receive - what `ownerState` exposes. */
|
|
352
|
+
type GridOwnerState = Record<string, unknown>;
|
|
353
|
+
/** The slots of Grid a theme can style with `styleOverrides`. */
|
|
354
|
+
type GridSlot = 'root';
|
|
355
|
+
/** What `theme.components.Grid` takes. */
|
|
356
|
+
type GridThemeConfig = ComponentConfig<GridOwnerState, GridSlot>;
|
|
357
|
+
/** The resolved props Icon's styled elements receive - what `ownerState` exposes. */
|
|
358
|
+
type IconOwnerState = Record<string, unknown>;
|
|
359
|
+
/** The slots of Icon a theme can style with `styleOverrides`. */
|
|
360
|
+
type IconSlot = 'root';
|
|
361
|
+
/** What `theme.components.Icon` takes. */
|
|
362
|
+
type IconThemeConfig = ComponentConfig<IconOwnerState, IconSlot>;
|
|
363
|
+
/** The resolved props Image's styled elements receive - what `ownerState` exposes. */
|
|
364
|
+
type ImageOwnerState = Record<string, unknown>;
|
|
365
|
+
/** The slots of Image a theme can style with `styleOverrides`. */
|
|
366
|
+
type ImageSlot = 'root';
|
|
367
|
+
/** What `theme.components.Image` takes. */
|
|
368
|
+
type ImageThemeConfig = ComponentConfig<ImageOwnerState, ImageSlot>;
|
|
369
|
+
/** The resolved props LinearProgress's styled elements receive - what `ownerState` exposes. */
|
|
370
|
+
type LinearProgressOwnerState = Record<string, unknown>;
|
|
371
|
+
/** The slots of LinearProgress a theme can style with `styleOverrides`. */
|
|
372
|
+
type LinearProgressSlot = 'root' | 'track' | 'dash' | 'bar' | 'traveler' | 'segment' | 'secondaryBar';
|
|
373
|
+
/** What `theme.components.LinearProgress` takes. */
|
|
374
|
+
type LinearProgressThemeConfig = ComponentConfig<LinearProgressOwnerState, LinearProgressSlot>;
|
|
375
|
+
/** The resolved props Link's styled elements receive - what `ownerState` exposes. */
|
|
376
|
+
type LinkOwnerState = Record<string, unknown>;
|
|
377
|
+
/** The slots of Link a theme can style with `styleOverrides`. */
|
|
378
|
+
type LinkSlot = 'root';
|
|
379
|
+
/** What `theme.components.Link` takes. */
|
|
380
|
+
type LinkThemeConfig = ComponentConfig<LinkOwnerState, LinkSlot>;
|
|
381
|
+
/** The resolved props MenuDivider's styled elements receive - what `ownerState` exposes. */
|
|
382
|
+
type MenuDividerOwnerState = Record<string, unknown>;
|
|
383
|
+
/** The slots of MenuDivider a theme can style with `styleOverrides`. */
|
|
384
|
+
type MenuDividerSlot = 'root';
|
|
385
|
+
/** What `theme.components.MenuDivider` takes. */
|
|
386
|
+
type MenuDividerThemeConfig = ComponentConfig<MenuDividerOwnerState, MenuDividerSlot>;
|
|
387
|
+
/** The defaults a theme may set for every `MenuItem` - a list's own values win. */
|
|
388
|
+
interface MenuItemOwnerState {
|
|
389
|
+
color?: ThemeColor;
|
|
390
|
+
textColor?: keyof ThemeText;
|
|
391
|
+
size?: ThemeSize;
|
|
392
|
+
dense?: boolean;
|
|
393
|
+
}
|
|
394
|
+
/** The slots of MenuItem a theme can style with `styleOverrides`. */
|
|
395
|
+
type MenuItemSlot = 'root' | 'check' | 'startIcon' | 'label' | 'shortcut' | 'submenuIcon' | 'entry' | 'secondaryAction';
|
|
396
|
+
/** What `theme.components.MenuItem` takes. */
|
|
397
|
+
type MenuItemThemeConfig = ComponentConfig<MenuItemOwnerState, MenuItemSlot>;
|
|
398
|
+
/** The defaults a theme may set for every `MenuList` - and so for its rows. */
|
|
399
|
+
interface MenuListOwnerState {
|
|
400
|
+
color?: ThemeColor;
|
|
401
|
+
textColor?: keyof ThemeText;
|
|
402
|
+
size?: ThemeSize;
|
|
403
|
+
dense?: boolean;
|
|
404
|
+
shouldWrap?: boolean;
|
|
405
|
+
}
|
|
406
|
+
/** The slots of MenuList a theme can style with `styleOverrides`. */
|
|
407
|
+
type MenuListSlot = 'root';
|
|
408
|
+
/** What `theme.components.MenuList` takes. */
|
|
409
|
+
type MenuListThemeConfig = ComponentConfig<MenuListOwnerState, MenuListSlot>;
|
|
410
|
+
type ModalCloseReason = 'escapeKey' | 'backdropClick';
|
|
411
|
+
type ModalScroll = 'paper' | 'body';
|
|
412
|
+
interface ModalProps {
|
|
413
|
+
/** If true, the modal is shown. */
|
|
414
|
+
isOpen: boolean;
|
|
415
|
+
/** A single content element. */
|
|
416
|
+
children: ReactNode;
|
|
417
|
+
/** Fired on Escape (top modal only) or backdrop click. */
|
|
418
|
+
onClose?: (event: Event | React.SyntheticEvent, reason: ModalCloseReason) => void;
|
|
419
|
+
/** Render the dimmed backdrop. Default: true. */
|
|
420
|
+
hasBackdrop?: boolean;
|
|
421
|
+
/** Keep the children mounted while closed. Default: false. */
|
|
422
|
+
shouldKeepMounted?: boolean;
|
|
423
|
+
/** Portal the modal into `portalContainer`. Default: true. */
|
|
424
|
+
shouldUsePortal?: boolean;
|
|
425
|
+
/** Portal target, or a function returning one. Defaults to the document body. */
|
|
426
|
+
portalContainer?: HTMLElement | (() => HTMLElement | null) | null;
|
|
427
|
+
/** Lock body scroll while open. Default: true. */
|
|
428
|
+
shouldLockScroll?: boolean;
|
|
429
|
+
/** Skip `aria-hidden` on background content - for non-modal popovers whose trigger stays focused. Default: false. */
|
|
430
|
+
disableAriaHidden?: boolean;
|
|
431
|
+
/** Move focus into the modal on open. Default: true. */
|
|
432
|
+
shouldAutoFocus?: boolean;
|
|
433
|
+
/** Trap Tab focus within the modal. Default: true. */
|
|
434
|
+
shouldTrapFocus?: boolean;
|
|
435
|
+
/** Pull focus back into the modal whenever it escapes. Default: true. */
|
|
436
|
+
shouldEnforceFocus?: boolean;
|
|
437
|
+
/** Restore focus to the trigger on close. Default: true. */
|
|
438
|
+
shouldRestoreFocus?: boolean;
|
|
439
|
+
/** How long content scrolls: within the content (`'paper'`) or the whole root (`'body'`). Default: 'paper'. */
|
|
440
|
+
scroll?: ModalScroll;
|
|
441
|
+
/** Stacking layer from `theme.zOrder`. Default: 'modal'. */
|
|
442
|
+
layer?: keyof Theme['zOrder'];
|
|
443
|
+
/** Overrides the CSS of the root: an entry of `StyleSheet.create`, or a list of them. It wins over `slotProps.root.style`. */
|
|
444
|
+
style?: StyleOverride;
|
|
445
|
+
className?: string;
|
|
446
|
+
/** Overrides for the slots a theme can style: `style`, `className`, `data-*` and `aria-*`. */
|
|
447
|
+
slotProps?: SlotProps<ModalSlot>;
|
|
448
|
+
}
|
|
449
|
+
/** The resolved props Modal's styled elements receive - what `ownerState` exposes. */
|
|
450
|
+
type ModalOwnerState = Record<string, unknown>;
|
|
451
|
+
/** The slots of Modal a theme can style with `styleOverrides`. */
|
|
452
|
+
type ModalSlot = 'root';
|
|
453
|
+
/** What `theme.components.Modal` takes. */
|
|
454
|
+
type ModalThemeConfig = ComponentConfig<ModalOwnerState, ModalSlot>;
|
|
455
|
+
/** The resolved props NativeSelect's styled elements receive - what `ownerState` exposes. */
|
|
456
|
+
type NativeSelectOwnerState = Record<string, unknown>;
|
|
457
|
+
/** The slots of NativeSelect a theme can style with `styleOverrides`. */
|
|
458
|
+
type NativeSelectSlot = 'root' | 'select' | 'icon';
|
|
459
|
+
/** What `theme.components.NativeSelect` takes. */
|
|
460
|
+
type NativeSelectThemeConfig = ComponentConfig<NativeSelectOwnerState, NativeSelectSlot>;
|
|
461
|
+
/** The resolved props NavGroup's styled elements receive - what `ownerState` exposes. */
|
|
462
|
+
type NavGroupOwnerState = Record<string, unknown>;
|
|
463
|
+
/** The slots of NavGroup a theme can style with `styleOverrides`. */
|
|
464
|
+
type NavGroupSlot = 'root' | 'label' | 'list';
|
|
465
|
+
/** What `theme.components.NavGroup` takes. */
|
|
466
|
+
type NavGroupThemeConfig = ComponentConfig<NavGroupOwnerState, NavGroupSlot>;
|
|
467
|
+
/** The resolved props NavLink's styled elements receive - what `ownerState` exposes. */
|
|
468
|
+
type NavLinkOwnerState = Record<string, unknown>;
|
|
469
|
+
/** The slots of NavLink a theme can style with `styleOverrides`. */
|
|
470
|
+
type NavLinkSlot = 'root' | 'label' | 'note';
|
|
471
|
+
/** What `theme.components.NavLink` takes. */
|
|
472
|
+
type NavLinkThemeConfig = ComponentConfig<NavLinkOwnerState, NavLinkSlot>;
|
|
473
|
+
/** The resolved props NavTree's styled elements receive - what `ownerState` exposes. */
|
|
474
|
+
type NavTreeOwnerState = Record<string, unknown>;
|
|
475
|
+
/** The slots of NavTree a theme can style with `styleOverrides`. */
|
|
476
|
+
type NavTreeSlot = 'root';
|
|
477
|
+
/** What `theme.components.NavTree` takes. */
|
|
478
|
+
type NavTreeThemeConfig = ComponentConfig<NavTreeOwnerState, NavTreeSlot>;
|
|
479
|
+
/** The defaults a theme may set for every `NumberInput` - its button labels give it a language. */
|
|
480
|
+
interface NumberInputOwnerState {
|
|
481
|
+
variant?: InputVariantKey;
|
|
482
|
+
size?: ThemeSize;
|
|
483
|
+
color?: ThemeColor;
|
|
484
|
+
spinButtons?: 'stacked' | 'sides' | 'none';
|
|
485
|
+
step?: number;
|
|
486
|
+
smallStep?: number;
|
|
487
|
+
largeStep?: number;
|
|
488
|
+
shouldSnapOnStep?: boolean;
|
|
489
|
+
shouldScrubOnWheel?: boolean;
|
|
490
|
+
incrementLabel?: string;
|
|
491
|
+
decrementLabel?: string;
|
|
492
|
+
}
|
|
493
|
+
/** The slots of NumberInput a theme can style with `styleOverrides`. */
|
|
494
|
+
type NumberInputSlot = 'root' | 'input' | 'content' | 'spinButtons' | 'increment' | 'decrement';
|
|
495
|
+
/** What `theme.components.NumberInput` takes. */
|
|
496
|
+
type NumberInputThemeConfig = ComponentConfig<NumberInputOwnerState, NumberInputSlot>;
|
|
497
|
+
/** The resolved props Pagination's styled elements receive - what `ownerState` exposes. */
|
|
498
|
+
type PaginationOwnerState = Record<string, unknown>;
|
|
499
|
+
/** The slots of Pagination a theme can style with `styleOverrides`. */
|
|
500
|
+
type PaginationSlot = 'root' | 'list';
|
|
501
|
+
/** What `theme.components.Pagination` takes. */
|
|
502
|
+
type PaginationThemeConfig = ComponentConfig<PaginationOwnerState, PaginationSlot>;
|
|
503
|
+
/** The resolved props PaginationItem's styled elements receive - what `ownerState` exposes. */
|
|
504
|
+
type PaginationItemOwnerState = Record<string, unknown>;
|
|
505
|
+
/** The slots of PaginationItem a theme can style with `styleOverrides`. */
|
|
506
|
+
type PaginationItemSlot = 'root' | 'ellipsis';
|
|
507
|
+
/** What `theme.components.PaginationItem` takes. */
|
|
508
|
+
type PaginationItemThemeConfig = ComponentConfig<PaginationItemOwnerState, PaginationItemSlot>;
|
|
509
|
+
/** The resolved props Popover's styled elements receive - what `ownerState` exposes. */
|
|
510
|
+
type PopoverOwnerState = Record<string, unknown>;
|
|
511
|
+
/** The slots of Popover a theme can style with `styleOverrides`. */
|
|
512
|
+
type PopoverSlot = 'root' | 'positioner';
|
|
513
|
+
/** What `theme.components.Popover` takes. */
|
|
514
|
+
type PopoverThemeConfig = ComponentConfig<PopoverOwnerState, PopoverSlot>;
|
|
515
|
+
/**
|
|
516
|
+
* Pressable's resolved props / theme-settable defaults. Only the three keys it
|
|
517
|
+
* actually resolves through `useDefaultProps` - the disabled state reaches the
|
|
518
|
+
* styled root as `isDisabled` and is never read from here, so exposing it would
|
|
519
|
+
* promise theme authors an override that does nothing.
|
|
520
|
+
*/
|
|
521
|
+
interface PressableOwnerState {
|
|
522
|
+
feedback?: 'none' | 'opacity' | 'highlight';
|
|
523
|
+
color?: ThemeColor;
|
|
524
|
+
/** Opacity held content fades to under `feedback: 'opacity'`. */
|
|
525
|
+
activeOpacity?: number;
|
|
526
|
+
}
|
|
527
|
+
/** The slots of Pressable a theme can style with `styleOverrides`. */
|
|
528
|
+
type PressableSlot = 'root';
|
|
529
|
+
/** What `theme.components.Pressable` takes. */
|
|
530
|
+
type PressableThemeConfig = ComponentConfig<PressableOwnerState, PressableSlot>;
|
|
531
|
+
/** The resolved props Quote's styled elements receive - what `ownerState` exposes. */
|
|
532
|
+
type QuoteOwnerState = Record<string, unknown>;
|
|
533
|
+
/** The slots of Quote a theme can style with `styleOverrides`. */
|
|
534
|
+
type QuoteSlot = 'root';
|
|
535
|
+
/** What `theme.components.Quote` takes. */
|
|
536
|
+
type QuoteThemeConfig = ComponentConfig<QuoteOwnerState, QuoteSlot>;
|
|
537
|
+
/** The resolved props Radio's styled elements receive - what `ownerState` exposes. */
|
|
538
|
+
type RadioOwnerState = Record<string, unknown>;
|
|
539
|
+
/** The slots of Radio a theme can style with `styleOverrides`. */
|
|
540
|
+
type RadioSlot = 'root' | 'input' | 'icon' | 'label';
|
|
541
|
+
/** What `theme.components.Radio` takes. */
|
|
542
|
+
type RadioThemeConfig = ComponentConfig<RadioOwnerState, RadioSlot>;
|
|
543
|
+
/** The defaults a theme may set for every `RangeInput`. */
|
|
544
|
+
interface RangeInputOwnerState {
|
|
545
|
+
size?: ThemeSize;
|
|
546
|
+
color?: ThemeColor;
|
|
547
|
+
orientation?: 'horizontal' | 'vertical';
|
|
548
|
+
track?: 'normal' | false | 'inverted';
|
|
549
|
+
step?: number | null;
|
|
550
|
+
shiftStep?: number;
|
|
551
|
+
valueLabel?: 'auto' | 'on' | 'off';
|
|
552
|
+
shouldSwapThumbs?: boolean;
|
|
553
|
+
}
|
|
554
|
+
/** The slots of RangeInput a theme can style with `styleOverrides`. */
|
|
555
|
+
type RangeInputSlot = 'root' | 'rail' | 'track' | 'thumb' | 'mark' | 'markLabel' | 'valueLabel' | 'input';
|
|
556
|
+
/** What `theme.components.RangeInput` takes. */
|
|
557
|
+
type RangeInputThemeConfig = ComponentConfig<RangeInputOwnerState, RangeInputSlot>;
|
|
558
|
+
/** The defaults a theme may set for every `Rating`. */
|
|
559
|
+
interface RatingOwnerState {
|
|
560
|
+
max?: number;
|
|
561
|
+
precision?: number;
|
|
562
|
+
highlightSelectedOnly?: boolean;
|
|
563
|
+
size?: ThemeSize;
|
|
564
|
+
color?: ThemeColor;
|
|
565
|
+
}
|
|
566
|
+
/** The slots of Rating a theme can style with `styleOverrides`. */
|
|
567
|
+
type RatingSlot = 'root' | 'item' | 'icon' | 'decimal' | 'input' | 'text' | 'emptyLabel';
|
|
568
|
+
/** What `theme.components.Rating` takes. */
|
|
569
|
+
type RatingThemeConfig = ComponentConfig<RatingOwnerState, RatingSlot>;
|
|
570
|
+
/** The defaults a theme may set for every `ScrollArea`. */
|
|
571
|
+
interface ScrollAreaOwnerState {
|
|
572
|
+
axes?: 'x' | 'y' | 'both';
|
|
573
|
+
}
|
|
574
|
+
/** The slots of ScrollArea a theme can style with `styleOverrides`. */
|
|
575
|
+
type ScrollAreaSlot = 'root' | 'viewport' | 'track' | 'thumb';
|
|
576
|
+
/** What `theme.components.ScrollArea` takes. */
|
|
577
|
+
type ScrollAreaThemeConfig = ComponentConfig<ScrollAreaOwnerState, ScrollAreaSlot>;
|
|
578
|
+
/** The resolved props Select's styled elements receive - what `ownerState` exposes. */
|
|
579
|
+
type SelectOwnerState = Record<string, unknown>;
|
|
580
|
+
/** The slots of Select a theme can style with `styleOverrides`. */
|
|
581
|
+
type SelectSlot = 'root' | 'value' | 'valueArea' | 'valueGhost' | 'listbox';
|
|
582
|
+
/** What `theme.components.Select` takes. */
|
|
583
|
+
type SelectThemeConfig = ComponentConfig<SelectOwnerState, SelectSlot>;
|
|
584
|
+
/** The resolved props Sidebar's styled elements receive - what `ownerState` exposes. */
|
|
585
|
+
type SidebarOwnerState = Record<string, unknown>;
|
|
586
|
+
/** The slots of Sidebar a theme can style with `styleOverrides`. */
|
|
587
|
+
type SidebarSlot = 'root' | 'rail' | 'panel';
|
|
588
|
+
/** What `theme.components.Sidebar` takes. */
|
|
589
|
+
type SidebarThemeConfig = ComponentConfig<SidebarOwnerState, SidebarSlot>;
|
|
590
|
+
/** The resolved props SidebarItem's styled elements receive - what `ownerState` exposes. */
|
|
591
|
+
type SidebarItemOwnerState = Record<string, unknown>;
|
|
592
|
+
/** The slots of SidebarItem a theme can style with `styleOverrides`. */
|
|
593
|
+
type SidebarItemSlot = 'root' | 'pill';
|
|
594
|
+
/** What `theme.components.SidebarItem` takes. */
|
|
595
|
+
type SidebarItemThemeConfig = ComponentConfig<SidebarItemOwnerState, SidebarItemSlot>;
|
|
596
|
+
/** The resolved props Skeleton's styled elements receive - what `ownerState` exposes. */
|
|
597
|
+
type SkeletonOwnerState = Record<string, unknown>;
|
|
598
|
+
/** The slots of Skeleton a theme can style with `styleOverrides`. */
|
|
599
|
+
type SkeletonSlot = 'root' | 'content';
|
|
600
|
+
/** What `theme.components.Skeleton` takes. */
|
|
601
|
+
type SkeletonThemeConfig = ComponentConfig<SkeletonOwnerState, SkeletonSlot>;
|
|
602
|
+
/** The corner shapes of a control or a surface. */
|
|
603
|
+
type ShapeKey$1 = 'square' | 'rounded' | 'pill';
|
|
604
|
+
/** The defaults a theme may set for every `Snackbar`. */
|
|
605
|
+
interface SnackbarOwnerState {
|
|
606
|
+
anchorOrigin?: {
|
|
607
|
+
vertical: 'top' | 'bottom';
|
|
608
|
+
horizontal: 'start' | 'center' | 'end';
|
|
609
|
+
};
|
|
610
|
+
autoHideDuration?: number;
|
|
611
|
+
resumeHideDuration?: number;
|
|
612
|
+
layer?: keyof ThemeZOrder;
|
|
613
|
+
shape?: ShapeKey$1;
|
|
614
|
+
borderRadius?: keyof ThemeRadii;
|
|
615
|
+
bg?: keyof ThemeBackground;
|
|
616
|
+
textColor?: keyof ThemeText;
|
|
617
|
+
}
|
|
618
|
+
/** The slots of Snackbar a theme can style with `styleOverrides`. */
|
|
619
|
+
type SnackbarSlot = 'root' | 'content' | 'message' | 'action';
|
|
620
|
+
/** What `theme.components.Snackbar` takes. */
|
|
621
|
+
type SnackbarThemeConfig = ComponentConfig<SnackbarOwnerState, SnackbarSlot>;
|
|
622
|
+
/** The resolved props Switch's styled elements receive - what `ownerState` exposes. */
|
|
623
|
+
type SwitchOwnerState = Record<string, unknown>;
|
|
624
|
+
/** The slots of Switch a theme can style with `styleOverrides`. */
|
|
625
|
+
type SwitchSlot = 'root' | 'input' | 'track' | 'thumb' | 'label';
|
|
626
|
+
/** What `theme.components.Switch` takes. */
|
|
627
|
+
type SwitchThemeConfig = ComponentConfig<SwitchOwnerState, SwitchSlot>;
|
|
628
|
+
/** The defaults a theme may set for every `Tab`. */
|
|
629
|
+
interface TabOwnerState {
|
|
630
|
+
isWrapped?: boolean;
|
|
631
|
+
bg?: keyof ThemeBackground;
|
|
632
|
+
borderRadius?: keyof ThemeRadii;
|
|
633
|
+
color?: ThemeColor;
|
|
634
|
+
textColor?: keyof ThemeText;
|
|
635
|
+
size?: ThemeSize;
|
|
636
|
+
selectedBg?: keyof ThemeBackground;
|
|
637
|
+
}
|
|
638
|
+
/** The slots of Tab a theme can style with `styleOverrides`. */
|
|
639
|
+
type TabSlot = 'root' | 'label' | 'icon' | 'secondaryAction' | 'close';
|
|
640
|
+
/** What `theme.components.Tab` takes. */
|
|
641
|
+
type TabThemeConfig = ComponentConfig<TabOwnerState, TabSlot>;
|
|
642
|
+
/** The defaults a theme may set for every `TabPanel`. */
|
|
643
|
+
interface TabPanelOwnerState {
|
|
644
|
+
shouldKeepMounted?: boolean;
|
|
645
|
+
}
|
|
646
|
+
/** The slots of TabPanel a theme can style with `styleOverrides`. */
|
|
647
|
+
type TabPanelSlot = 'root';
|
|
648
|
+
/** What `theme.components.TabPanel` takes. */
|
|
649
|
+
type TabPanelThemeConfig = ComponentConfig<TabPanelOwnerState, TabPanelSlot>;
|
|
650
|
+
/** The defaults a theme may set for every `TabScrollButton`. */
|
|
651
|
+
interface TabScrollButtonOwnerState {
|
|
652
|
+
color?: ThemeColor;
|
|
653
|
+
textColor?: keyof ThemeText;
|
|
654
|
+
}
|
|
655
|
+
/** The slots of TabScrollButton a theme can style with `styleOverrides`. */
|
|
656
|
+
type TabScrollButtonSlot = 'root';
|
|
657
|
+
/** What `theme.components.TabScrollButton` takes. */
|
|
658
|
+
type TabScrollButtonThemeConfig = ComponentConfig<TabScrollButtonOwnerState, TabScrollButtonSlot>;
|
|
659
|
+
/** The resolved props Table's styled elements receive - what `ownerState` exposes. */
|
|
660
|
+
type TableOwnerState = Record<string, unknown>;
|
|
661
|
+
/** The slots of Table a theme can style with `styleOverrides`. */
|
|
662
|
+
type TableSlot = 'root';
|
|
663
|
+
/** What `theme.components.Table` takes. */
|
|
664
|
+
type TableThemeConfig = ComponentConfig<TableOwnerState, TableSlot>;
|
|
665
|
+
/** The resolved props TableBody's styled elements receive - what `ownerState` exposes. */
|
|
666
|
+
type TableBodyOwnerState = Record<string, unknown>;
|
|
667
|
+
/** The slots of TableBody a theme can style with `styleOverrides`. */
|
|
668
|
+
type TableBodySlot = 'root';
|
|
669
|
+
/** What `theme.components.TableBody` takes. */
|
|
670
|
+
type TableBodyThemeConfig = ComponentConfig<TableBodyOwnerState, TableBodySlot>;
|
|
671
|
+
/** The resolved props TableCell's styled elements receive - what `ownerState` exposes. */
|
|
672
|
+
type TableCellOwnerState = Record<string, unknown>;
|
|
673
|
+
/** The slots of TableCell a theme can style with `styleOverrides`. */
|
|
674
|
+
type TableCellSlot = 'root';
|
|
675
|
+
/** What `theme.components.TableCell` takes. */
|
|
676
|
+
type TableCellThemeConfig = ComponentConfig<TableCellOwnerState, TableCellSlot>;
|
|
677
|
+
/** The resolved props TableContainer's styled elements receive - what `ownerState` exposes. */
|
|
678
|
+
type TableContainerOwnerState = Record<string, unknown>;
|
|
679
|
+
/** The slots of TableContainer a theme can style with `styleOverrides`. */
|
|
680
|
+
type TableContainerSlot = 'root';
|
|
681
|
+
/** What `theme.components.TableContainer` takes. */
|
|
682
|
+
type TableContainerThemeConfig = ComponentConfig<TableContainerOwnerState, TableContainerSlot>;
|
|
683
|
+
/** The resolved props TableFooter's styled elements receive - what `ownerState` exposes. */
|
|
684
|
+
type TableFooterOwnerState = Record<string, unknown>;
|
|
685
|
+
/** The slots of TableFooter a theme can style with `styleOverrides`. */
|
|
686
|
+
type TableFooterSlot = 'root';
|
|
687
|
+
/** What `theme.components.TableFooter` takes. */
|
|
688
|
+
type TableFooterThemeConfig = ComponentConfig<TableFooterOwnerState, TableFooterSlot>;
|
|
689
|
+
/** The resolved props TableHead's styled elements receive - what `ownerState` exposes. */
|
|
690
|
+
type TableHeadOwnerState = Record<string, unknown>;
|
|
691
|
+
/** The slots of TableHead a theme can style with `styleOverrides`. */
|
|
692
|
+
type TableHeadSlot = 'root';
|
|
693
|
+
/** What `theme.components.TableHead` takes. */
|
|
694
|
+
type TableHeadThemeConfig = ComponentConfig<TableHeadOwnerState, TableHeadSlot>;
|
|
695
|
+
/** The resolved props TablePagination's styled elements receive - what `ownerState` exposes. */
|
|
696
|
+
type TablePaginationOwnerState = Record<string, unknown>;
|
|
697
|
+
/** The slots of TablePagination a theme can style with `styleOverrides`. */
|
|
698
|
+
type TablePaginationSlot = 'root';
|
|
699
|
+
/** What `theme.components.TablePagination` takes. */
|
|
700
|
+
type TablePaginationThemeConfig = ComponentConfig<TablePaginationOwnerState, TablePaginationSlot>;
|
|
701
|
+
/** The resolved props TablePaginationActions's styled elements receive - what `ownerState` exposes. */
|
|
702
|
+
type TablePaginationActionsOwnerState = Record<string, unknown>;
|
|
703
|
+
/** The slots of TablePaginationActions a theme can style with `styleOverrides`. */
|
|
704
|
+
type TablePaginationActionsSlot = 'root';
|
|
705
|
+
/** What `theme.components.TablePaginationActions` takes. */
|
|
706
|
+
type TablePaginationActionsThemeConfig = ComponentConfig<TablePaginationActionsOwnerState, TablePaginationActionsSlot>;
|
|
707
|
+
/** The resolved props TableRow's styled elements receive - what `ownerState` exposes. */
|
|
708
|
+
type TableRowOwnerState = Record<string, unknown>;
|
|
709
|
+
/** The slots of TableRow a theme can style with `styleOverrides`. */
|
|
710
|
+
type TableRowSlot = 'root';
|
|
711
|
+
/** What `theme.components.TableRow` takes. */
|
|
712
|
+
type TableRowThemeConfig = ComponentConfig<TableRowOwnerState, TableRowSlot>;
|
|
713
|
+
/** The resolved props TableSortLabel's styled elements receive - what `ownerState` exposes. */
|
|
714
|
+
type TableSortLabelOwnerState = Record<string, unknown>;
|
|
715
|
+
/** The slots of TableSortLabel a theme can style with `styleOverrides`. */
|
|
716
|
+
type TableSortLabelSlot = 'root' | 'icon';
|
|
717
|
+
/** What `theme.components.TableSortLabel` takes. */
|
|
718
|
+
type TableSortLabelThemeConfig = ComponentConfig<TableSortLabelOwnerState, TableSortLabelSlot>;
|
|
719
|
+
/** The resolved props Tabs' styled elements receive - what `ownerState` exposes. */
|
|
720
|
+
interface TabsOwnerState {
|
|
721
|
+
variant?: TabsVariant;
|
|
722
|
+
color?: ThemeColor;
|
|
723
|
+
size?: ThemeSize;
|
|
724
|
+
orientation?: 'horizontal' | 'vertical';
|
|
725
|
+
fullWidth?: boolean;
|
|
726
|
+
hasDivider?: boolean;
|
|
727
|
+
selectedBg?: keyof ThemeBackground;
|
|
728
|
+
}
|
|
729
|
+
/** Tabs' look values - augment to register new ones (then style them via `variants`). */
|
|
730
|
+
interface TabsVariants {
|
|
731
|
+
underline: true;
|
|
732
|
+
boxed: true;
|
|
733
|
+
enclosed: true;
|
|
734
|
+
tonal: true;
|
|
735
|
+
}
|
|
736
|
+
/** Tabs' looks: the built-in ones, those added through `TabsVariants`, and those a registered theme defines. */
|
|
737
|
+
type TabsVariant = keyof TabsVariants | VariantOf<'Tabs'>;
|
|
738
|
+
/** The slots of Tabs a theme can style with `styleOverrides`. */
|
|
739
|
+
type TabsSlot = 'root' | 'list' | 'indicator' | 'startContent' | 'endContent' | 'scrollButton' | 'overflowButton' | 'overflowClose';
|
|
740
|
+
/** What `theme.components.Tabs` takes. */
|
|
741
|
+
type TabsThemeConfig = ComponentConfig<TabsOwnerState, TabsSlot>;
|
|
742
|
+
type TextInputColor = keyof Theme['palette'];
|
|
743
|
+
type TextInputTextColor = keyof Theme['text'];
|
|
744
|
+
type TextInputVariant = 'default' | 'outlined' | 'text' | 'underline';
|
|
745
|
+
type TextInputSize = keyof Theme['sizes'];
|
|
746
|
+
interface TextInputClasses {
|
|
747
|
+
root?: string;
|
|
748
|
+
input?: string;
|
|
749
|
+
}
|
|
750
|
+
interface TextInputProps extends SpaceProps, Pick<LayoutProps, 'width' | 'minWidth' | 'maxWidth'> {
|
|
751
|
+
/** Corner radius - applies only to `default` and `outlined` variants. Resolves against `theme.radii`. */
|
|
752
|
+
borderRadius?: keyof Theme['radii'];
|
|
753
|
+
autoComplete?: string;
|
|
754
|
+
autoFocus?: boolean;
|
|
755
|
+
/** Class names applied to inner elements. `root` targets the wrapper; `input` targets the native element. */
|
|
756
|
+
classes?: TextInputClasses;
|
|
757
|
+
/** Override components for the Root and Input slots. */
|
|
758
|
+
components?: {
|
|
759
|
+
Input?: ElementType;
|
|
760
|
+
Root?: ElementType;
|
|
761
|
+
};
|
|
762
|
+
/** Focus/active border color - resolves to `theme.palette[color].main`. Default: 'primary', overridable via `theme.defaults.color`. */
|
|
763
|
+
color?: TextInputColor;
|
|
764
|
+
/** Text color of the typed value - resolves against `theme.text`. Default: the accent `color`'s `main`. */
|
|
765
|
+
textColor?: TextInputTextColor;
|
|
766
|
+
/** Disables the input. */
|
|
767
|
+
disabled?: boolean;
|
|
768
|
+
/** Marks the field as invalid - applies error border color. */
|
|
769
|
+
error?: boolean;
|
|
770
|
+
/** Stretches the root to fill its container. */
|
|
771
|
+
fullWidth?: boolean;
|
|
772
|
+
id?: string;
|
|
773
|
+
/** Custom component for the input element. Takes priority over `components.Input`. Default: `'input'`. */
|
|
774
|
+
inputComponent?: ElementType;
|
|
775
|
+
/** Native HTML `size` attribute - visible width in character widths. Has no effect with `multiline` or `resize`. */
|
|
776
|
+
inputSize?: number;
|
|
777
|
+
/** Extra props spread onto the native element. Explicit top-level props take priority. */
|
|
778
|
+
inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, 'style'> & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'style'>;
|
|
779
|
+
/** Maximum rows before the auto-grow textarea starts scrolling. Only applies when `resize` is set. */
|
|
780
|
+
maxRows?: number | string;
|
|
781
|
+
/** Minimum rows for the auto-grow textarea. Only applies when `resize` is set. */
|
|
782
|
+
minRows?: number | string;
|
|
783
|
+
/**
|
|
784
|
+
* Renders a `<textarea>` that grows with its content.
|
|
785
|
+
* Combine with `rows` to fix the height instead of auto-growing.
|
|
786
|
+
*/
|
|
787
|
+
multiline?: boolean;
|
|
788
|
+
name?: string;
|
|
789
|
+
onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
790
|
+
placeholder?: string;
|
|
791
|
+
readOnly?: boolean;
|
|
792
|
+
required?: boolean;
|
|
793
|
+
/** Auto-grows the textarea as content increases. Requires `multiline`. */
|
|
794
|
+
resize?: boolean;
|
|
795
|
+
/** Controls padding and font size. Default: 'md', overridable via `theme.defaults.size`. */
|
|
796
|
+
size?: TextInputSize;
|
|
797
|
+
/**
|
|
798
|
+
* Fixes the textarea height to this many rows. Also enables `multiline`
|
|
799
|
+
* when value is greater than 1. Disables resize.
|
|
800
|
+
*/
|
|
801
|
+
rows?: number | string;
|
|
802
|
+
/** HTML input type. Ignored when multiline. Default: `'text'`. */
|
|
803
|
+
type?: string;
|
|
804
|
+
/**
|
|
805
|
+
* Visual style of the input.
|
|
806
|
+
* - `outlined` / `default` - full border box (default)
|
|
807
|
+
* - `underline` - border on bottom only
|
|
808
|
+
* - `text` - no border, transparent background
|
|
809
|
+
*/
|
|
810
|
+
variant?: TextInputVariant;
|
|
811
|
+
value?: string | number | readonly string[];
|
|
812
|
+
className?: string;
|
|
813
|
+
/** Overrides the CSS of the root: an entry of `StyleSheet.create`, or a list of them. It wins over `slotProps.root.style`. */
|
|
814
|
+
style?: StyleOverride;
|
|
815
|
+
/** Overrides for the slots a theme can style: `style`, `className`, `data-*` and `aria-*`. */
|
|
816
|
+
slotProps?: SlotProps<TextInputSlot>;
|
|
817
|
+
'data-testid'?: string;
|
|
818
|
+
}
|
|
819
|
+
/** The resolved props TextInput's styled elements receive - what `ownerState` exposes. */
|
|
820
|
+
type TextInputOwnerState = Record<string, unknown>;
|
|
821
|
+
/** The slots of TextInput a theme can style with `styleOverrides`. */
|
|
822
|
+
type TextInputSlot = 'root' | 'input';
|
|
823
|
+
/** What `theme.components.TextInput` takes. */
|
|
824
|
+
type TextInputThemeConfig = ComponentConfig<TextInputOwnerState, TextInputSlot>;
|
|
825
|
+
/** The resolved props ToggleButton's styled elements receive - what `ownerState` exposes. */
|
|
826
|
+
type ToggleButtonOwnerState = Record<string, unknown>;
|
|
827
|
+
/** The slots of ToggleButton a theme can style with `styleOverrides`. */
|
|
828
|
+
type ToggleButtonSlot = 'root';
|
|
829
|
+
/** What `theme.components.ToggleButton` takes. */
|
|
830
|
+
type ToggleButtonThemeConfig = ComponentConfig<ToggleButtonOwnerState, ToggleButtonSlot>;
|
|
831
|
+
/** The resolved props ToggleButtonGroup's styled elements receive - what `ownerState` exposes. */
|
|
832
|
+
type ToggleButtonGroupOwnerState = Record<string, unknown>;
|
|
833
|
+
/** The slots of ToggleButtonGroup a theme can style with `styleOverrides`. */
|
|
834
|
+
type ToggleButtonGroupSlot = 'root';
|
|
835
|
+
/** What `theme.components.ToggleButtonGroup` takes. */
|
|
836
|
+
type ToggleButtonGroupThemeConfig = ComponentConfig<ToggleButtonGroupOwnerState, ToggleButtonGroupSlot>;
|
|
837
|
+
/** The defaults a theme may set for every `Tooltip`. */
|
|
838
|
+
interface TooltipOwnerState {
|
|
839
|
+
borderRadius?: keyof ThemeRadii;
|
|
840
|
+
bg?: keyof ThemeBackground;
|
|
841
|
+
textColor?: keyof ThemeText;
|
|
842
|
+
placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end' | 'auto' | 'auto-start' | 'auto-end';
|
|
843
|
+
hasArrow?: boolean;
|
|
844
|
+
enterDelay?: number;
|
|
845
|
+
leaveDelay?: number;
|
|
846
|
+
enterTouchDelay?: number;
|
|
847
|
+
leaveTouchDelay?: number;
|
|
848
|
+
shouldDescribeChild?: boolean;
|
|
849
|
+
isDescriptionPersistent?: boolean;
|
|
850
|
+
isInteractive?: boolean;
|
|
851
|
+
shouldWrapDisabledChild?: boolean;
|
|
852
|
+
/**
|
|
853
|
+
* Theme only. With a value above 0, every tooltip under the theme shares one delay window, as in a
|
|
854
|
+
* `TooltipGroup` of that duration: no enter delay while another is open or within this many
|
|
855
|
+
* milliseconds of the last close. A `TooltipGroup` around a tooltip wins.
|
|
856
|
+
*/
|
|
857
|
+
skipDelayDuration?: number;
|
|
858
|
+
shouldOpenOnHover?: boolean;
|
|
859
|
+
shouldOpenOnFocus?: boolean;
|
|
860
|
+
shouldOpenOnTouch?: boolean;
|
|
861
|
+
layer?: keyof ThemeZOrder;
|
|
862
|
+
}
|
|
863
|
+
/** The slots of Tooltip a theme can style with `styleOverrides`. */
|
|
864
|
+
type TooltipSlot = 'root' | 'arrow';
|
|
865
|
+
/** What `theme.components.Tooltip` takes. */
|
|
866
|
+
type TooltipThemeConfig = ComponentConfig<TooltipOwnerState, TooltipSlot>;
|
|
867
|
+
/** The defaults a theme may set for every `TransferList` - its button labels give it a language. */
|
|
868
|
+
interface TransferListOwnerState {
|
|
869
|
+
size?: ThemeSize;
|
|
870
|
+
color?: ThemeColor;
|
|
871
|
+
shouldShowMoveAll?: boolean;
|
|
872
|
+
hasSelectAll?: boolean;
|
|
873
|
+
moveAllRightLabel?: string;
|
|
874
|
+
moveRightLabel?: string;
|
|
875
|
+
moveLeftLabel?: string;
|
|
876
|
+
moveAllLeftLabel?: string;
|
|
877
|
+
}
|
|
878
|
+
/** The slots of TransferList a theme can style with `styleOverrides`. */
|
|
879
|
+
type TransferListSlot = 'root' | 'list' | 'header' | 'title' | 'count' | 'items' | 'item' | 'controls' | 'icon';
|
|
880
|
+
/** What `theme.components.TransferList` takes. */
|
|
881
|
+
type TransferListThemeConfig = ComponentConfig<TransferListOwnerState, TransferListSlot>;
|
|
882
|
+
type TypographyAlign = 'left' | 'right' | 'center' | 'justify' | 'inherit';
|
|
883
|
+
/** Valid values for the color prop - derived from theme.text keys. */
|
|
884
|
+
type TextColorToken = keyof Theme['text'];
|
|
885
|
+
/** Valid values for the bg prop - derived from theme.background keys. */
|
|
886
|
+
type BackgroundToken = keyof Theme['background'];
|
|
887
|
+
interface TypographyProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'style'>, SpaceProps, LayoutProps, TypographyProps$1, FlexboxProps, BorderProps, PositionProps {
|
|
888
|
+
/** Resolves against theme.text - inherit · initial · primary · secondary · error · success */
|
|
889
|
+
color?: TextColorToken;
|
|
890
|
+
/** Resolves against theme.background */
|
|
891
|
+
bg?: BackgroundToken;
|
|
892
|
+
/** Overrides the CSS of the element: an entry of `StyleSheet.create`, or a list of them. */
|
|
893
|
+
style?: StyleOverride;
|
|
894
|
+
/** Overrides for the slots a theme can style: `style`, `className`, `data-*` and `aria-*`. */
|
|
895
|
+
slotProps?: SlotProps<TypographySlot>;
|
|
896
|
+
opacity?: number;
|
|
897
|
+
textTransform?: CSSProperties['textTransform'];
|
|
898
|
+
variant?: TypographyVariant;
|
|
899
|
+
align?: TypographyAlign;
|
|
900
|
+
gutterBottom?: boolean;
|
|
901
|
+
noWrap?: boolean;
|
|
902
|
+
/** Machine-readable timestamp - forwarded when rendering as `<time>` (`as="time"`). */
|
|
903
|
+
dateTime?: string;
|
|
904
|
+
as?: ElementType;
|
|
905
|
+
}
|
|
906
|
+
/** The resolved props Typography's styled elements receive - what `ownerState` exposes. */
|
|
907
|
+
type TypographyOwnerState = Record<string, unknown>;
|
|
908
|
+
/** The slots of Typography a theme can style with `styleOverrides`. */
|
|
909
|
+
type TypographySlot = 'root';
|
|
910
|
+
/** What `theme.components.Typography` takes. */
|
|
911
|
+
type TypographyThemeConfig = ComponentConfig<TypographyOwnerState, TypographySlot>;
|
|
912
|
+
/**
|
|
913
|
+
* Per-component theme customization, keyed by component name: each key takes the component's
|
|
914
|
+
* `<Name>ThemeConfig` - its owner state, its slots, its default props and variants. An app checks
|
|
915
|
+
* its looks against it with `satisfies ThemeComponents`.
|
|
916
|
+
*/
|
|
917
|
+
interface ThemeComponents {
|
|
918
|
+
Accordion?: AccordionThemeConfig;
|
|
919
|
+
AccordionActions?: AccordionActionsThemeConfig;
|
|
920
|
+
AccordionDetails?: AccordionDetailsThemeConfig;
|
|
921
|
+
AccordionGroup?: AccordionGroupThemeConfig;
|
|
922
|
+
AccordionSummary?: AccordionSummaryThemeConfig;
|
|
923
|
+
Alert?: AlertThemeConfig;
|
|
924
|
+
AlertTitle?: AlertTitleThemeConfig;
|
|
925
|
+
AppBar?: AppBarThemeConfig;
|
|
926
|
+
Autocomplete?: AutocompleteThemeConfig;
|
|
927
|
+
Avatar?: AvatarThemeConfig;
|
|
928
|
+
Backdrop?: BackdropThemeConfig;
|
|
929
|
+
Badge?: BadgeThemeConfig;
|
|
930
|
+
Breadcrumbs?: BreadcrumbsThemeConfig;
|
|
931
|
+
Button?: ButtonThemeConfig;
|
|
932
|
+
ButtonGroup?: ButtonGroupThemeConfig;
|
|
933
|
+
Card?: CardThemeConfig;
|
|
934
|
+
Checkbox?: CheckboxThemeConfig;
|
|
935
|
+
Chip?: ChipThemeConfig;
|
|
936
|
+
CircularProgress?: CircularProgressThemeConfig;
|
|
937
|
+
Collapse?: CollapseThemeConfig;
|
|
938
|
+
ContextMenu?: ContextMenuThemeConfig;
|
|
939
|
+
Drawer?: DrawerThemeConfig;
|
|
940
|
+
Fab?: FabThemeConfig;
|
|
941
|
+
FabMenu?: FabMenuThemeConfig;
|
|
942
|
+
Flex?: FlexThemeConfig;
|
|
943
|
+
FocusTrap?: FocusTrapThemeConfig;
|
|
944
|
+
Form?: FormThemeConfig;
|
|
945
|
+
FormControl?: FormControlThemeConfig;
|
|
946
|
+
FormHelperText?: FormHelperTextThemeConfig;
|
|
947
|
+
FormLabel?: FormLabelThemeConfig;
|
|
948
|
+
Grid?: GridThemeConfig;
|
|
949
|
+
Icon?: IconThemeConfig;
|
|
950
|
+
Image?: ImageThemeConfig;
|
|
951
|
+
LinearProgress?: LinearProgressThemeConfig;
|
|
952
|
+
Link?: LinkThemeConfig;
|
|
953
|
+
Menu?: MenuThemeConfig;
|
|
954
|
+
MenuDivider?: MenuDividerThemeConfig;
|
|
955
|
+
MenuItem?: MenuItemThemeConfig;
|
|
956
|
+
MenuList?: MenuListThemeConfig;
|
|
957
|
+
Modal?: ModalThemeConfig;
|
|
958
|
+
NativeSelect?: NativeSelectThemeConfig;
|
|
959
|
+
NavGroup?: NavGroupThemeConfig;
|
|
960
|
+
NavLink?: NavLinkThemeConfig;
|
|
961
|
+
NavTree?: NavTreeThemeConfig;
|
|
962
|
+
NumberInput?: NumberInputThemeConfig;
|
|
963
|
+
Pagination?: PaginationThemeConfig;
|
|
964
|
+
PaginationItem?: PaginationItemThemeConfig;
|
|
965
|
+
Paper?: PaperThemeConfig;
|
|
966
|
+
Popover?: PopoverThemeConfig;
|
|
967
|
+
Pressable?: PressableThemeConfig;
|
|
968
|
+
Quote?: QuoteThemeConfig;
|
|
969
|
+
Radio?: RadioThemeConfig;
|
|
970
|
+
RangeInput?: RangeInputThemeConfig;
|
|
971
|
+
Rating?: RatingThemeConfig;
|
|
972
|
+
ScrollArea?: ScrollAreaThemeConfig;
|
|
973
|
+
Select?: SelectThemeConfig;
|
|
974
|
+
Sidebar?: SidebarThemeConfig;
|
|
975
|
+
SidebarItem?: SidebarItemThemeConfig;
|
|
976
|
+
Skeleton?: SkeletonThemeConfig;
|
|
977
|
+
Snackbar?: SnackbarThemeConfig;
|
|
978
|
+
Switch?: SwitchThemeConfig;
|
|
979
|
+
Tab?: TabThemeConfig;
|
|
980
|
+
TabPanel?: TabPanelThemeConfig;
|
|
981
|
+
TabScrollButton?: TabScrollButtonThemeConfig;
|
|
982
|
+
Table?: TableThemeConfig;
|
|
983
|
+
TableBody?: TableBodyThemeConfig;
|
|
984
|
+
TableCell?: TableCellThemeConfig;
|
|
985
|
+
TableContainer?: TableContainerThemeConfig;
|
|
986
|
+
TableFooter?: TableFooterThemeConfig;
|
|
987
|
+
TableHead?: TableHeadThemeConfig;
|
|
988
|
+
TablePagination?: TablePaginationThemeConfig;
|
|
989
|
+
TablePaginationActions?: TablePaginationActionsThemeConfig;
|
|
990
|
+
TableRow?: TableRowThemeConfig;
|
|
991
|
+
TableSortLabel?: TableSortLabelThemeConfig;
|
|
992
|
+
Tabs?: TabsThemeConfig;
|
|
993
|
+
TextInput?: TextInputThemeConfig;
|
|
994
|
+
ToggleButton?: ToggleButtonThemeConfig;
|
|
995
|
+
ToggleButtonGroup?: ToggleButtonGroupThemeConfig;
|
|
996
|
+
Tooltip?: TooltipThemeConfig;
|
|
997
|
+
TransferList?: TransferListThemeConfig;
|
|
998
|
+
Typography?: TypographyThemeConfig;
|
|
999
|
+
View?: ViewThemeConfig;
|
|
1000
|
+
}
|
|
1001
|
+
/** Design-system's own style-object shape - the engine stays an internal implementation detail. */
|
|
1002
|
+
type CSSObject = CSSObject$1;
|
|
1003
|
+
/**
|
|
1004
|
+
* A style contributed from `theme.components` - a plain CSS object, or a
|
|
1005
|
+
* callback receiving the theme and the styled root's resolved props
|
|
1006
|
+
* (`ownerState`) for conditional styling.
|
|
1007
|
+
*/
|
|
1008
|
+
type ComponentStyle<OwnerState> = CSSObject | ((args: {
|
|
1009
|
+
theme: Theme;
|
|
1010
|
+
ownerState: OwnerState;
|
|
1011
|
+
}) => CSSObject);
|
|
1012
|
+
/**
|
|
1013
|
+
* The owner-state fields whose types the registered themes widen: the colors, sizes, spacing keys
|
|
1014
|
+
* and looks they add.
|
|
1015
|
+
*/
|
|
1016
|
+
type DerivedFields = 'color' | 'size' | 'variant' | 'mb' | 'marginThreshold';
|
|
1017
|
+
type OpenValue = '' | (string & {}) | number | boolean | null | object;
|
|
1018
|
+
/**
|
|
1019
|
+
* The owner state as the theme's own `components` are checked against it. Once themes are
|
|
1020
|
+
* registered, the derived fields are left open: a type that reads the registered themes cannot be
|
|
1021
|
+
* checked while those themes are being written (it would read itself). A misspelt value is checked
|
|
1022
|
+
* where it is used (a component's props), and in development by the validator `ThemeProvider` runs.
|
|
1023
|
+
* Every other field keeps its type.
|
|
1024
|
+
*/
|
|
1025
|
+
type OwnerKeys<OwnerState> = keyof Register$1 extends never ? Partial<OwnerState> : { [K in keyof OwnerState]?: K extends DerivedFields ? OpenValue : OwnerState[K]; };
|
|
1026
|
+
/** One theme-contributed variant: applied when every key in `props` matches the render props. */
|
|
1027
|
+
interface ComponentVariant<OwnerState> {
|
|
1028
|
+
props: OwnerKeys<OwnerState>;
|
|
1029
|
+
style: ComponentStyle<OwnerState>;
|
|
1030
|
+
}
|
|
1031
|
+
/** Per-component customization: default prop values, per-slot CSS, extra variants. */
|
|
1032
|
+
interface ComponentConfig<OwnerState = Record<string, unknown>, Slot extends string = 'root'> {
|
|
1033
|
+
/** Default prop values - explicit props and group context always win. */
|
|
1034
|
+
defaultProps?: OwnerKeys<OwnerState>;
|
|
1035
|
+
/** Per-slot CSS merged after the component's own styles (theme wins). */
|
|
1036
|
+
styleOverrides?: Partial<Record<Slot, ComponentStyle<OwnerState>>>;
|
|
1037
|
+
/** Extra variants matched by props. */
|
|
1038
|
+
variants?: ReadonlyArray<ComponentVariant<OwnerState>>;
|
|
1039
|
+
/** Type only, never set: names the owner state, for `useDefaultProps` to type what it hands back. */
|
|
1040
|
+
readonly $owner?: OwnerState;
|
|
1041
|
+
}
|
|
1042
|
+
/** The core's theme, with the typing of `theme.components` that the libraries and the app add. */
|
|
1043
|
+
interface Theme extends Theme$1 {
|
|
1044
|
+
/** Optional per-component customization - see `ThemeComponents`. */
|
|
1045
|
+
components?: OpenScale<ThemeComponents>;
|
|
1046
|
+
}
|
|
1047
|
+
/** This package's `Theme` under a name no other interface of the engine's modules has: the bridge extends the engine's `Theme` from it. */
|
|
1048
|
+
type GildTheme = Theme;
|
|
1049
|
+
/** The theme the app registered (see `Register` in the core), or this package's `Theme` when it registered none. */
|
|
1050
|
+
type AppTheme = RegisteredTheme<Theme>;
|
|
1051
|
+
/** The corner shapes of a control or a surface. */
|
|
1052
|
+
type ShapeKey = 'square' | 'rounded' | 'pill';
|
|
1053
|
+
/** The resolved props Button's styled roots receive - what `ownerState` exposes. */
|
|
1054
|
+
interface ButtonOwnerState {
|
|
1055
|
+
variant?: ButtonVariant;
|
|
1056
|
+
color?: ThemeColor;
|
|
1057
|
+
size?: ThemeSize;
|
|
1058
|
+
shape?: ShapeKey;
|
|
1059
|
+
fullWidth?: boolean;
|
|
1060
|
+
disabled?: boolean;
|
|
1061
|
+
}
|
|
1062
|
+
/** Button's looks: the built-in ones, those added through `ButtonVariants`, and those a registered theme defines. */
|
|
1063
|
+
type ButtonVariant = keyof ButtonVariants | VariantOf<'Button'>;
|
|
1064
|
+
/** The slots of Button a theme can style with `styleOverrides`. */
|
|
1065
|
+
type ButtonSlot = 'root' | 'label' | 'icon' | 'loader';
|
|
1066
|
+
/** What `theme.components.Button` takes. */
|
|
1067
|
+
type ButtonThemeConfig = ComponentConfig<ButtonOwnerState, ButtonSlot>;
|
|
1068
|
+
/** Augmentable via the `ButtonVariants` interface, or defined by a registered theme - style new values through `theme.components.Button.variants`. */
|
|
1069
|
+
type ButtonColor = ThemeColor;
|
|
1070
|
+
type ButtonSize = keyof AppTheme['sizes'];
|
|
1071
|
+
type ButtonShape = 'square' | 'rounded' | 'pill';
|
|
1072
|
+
type ButtonLoadingPosition = 'start' | 'end' | 'center';
|
|
1073
|
+
/** Valid values for the gap prop - resolves against theme.space. Default: `1` (8px). */
|
|
1074
|
+
type GapToken = keyof AppTheme['space'];
|
|
1075
|
+
interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'style'>, SpaceProps, LayoutProps, BorderProps, TypographyProps$1 {
|
|
1076
|
+
/** Visual style - filled, stroked, or ghost. Default: `'contained'`, overridable via `theme.defaults.buttonVariant`. */
|
|
1077
|
+
variant?: ButtonVariant;
|
|
1078
|
+
/** Color palette - maps to `theme.palette[color]`. Default: `'primary'`, overridable via `theme.defaults.color`. */
|
|
1079
|
+
color?: ButtonColor;
|
|
1080
|
+
/** Size token - controls padding and font size. Default: `'md'`, overridable via `theme.defaults.size`. */
|
|
1081
|
+
size?: ButtonSize;
|
|
1082
|
+
/** Gap between icon and label - resolves against theme.space. Default: `1` (8px). */
|
|
1083
|
+
gap?: GapToken;
|
|
1084
|
+
/** Icon rendered before the label. */
|
|
1085
|
+
startIcon?: ReactNode;
|
|
1086
|
+
/** Icon rendered after the label. */
|
|
1087
|
+
endIcon?: ReactNode;
|
|
1088
|
+
/** Stretch button to full container width. */
|
|
1089
|
+
fullWidth?: boolean;
|
|
1090
|
+
/** Shows loading indicator and disables the button. */
|
|
1091
|
+
loading?: boolean;
|
|
1092
|
+
/** Custom loading element. Default: animated spinner. */
|
|
1093
|
+
loadingIndicator?: ReactNode;
|
|
1094
|
+
/**
|
|
1095
|
+
* Corner shape - sets the default `borderRadius`.
|
|
1096
|
+
* `"square"` → 0 · `"rounded"` → `theme.radii.md` (default) · `"pill"` → 9999px
|
|
1097
|
+
* The `borderRadius` prop always overrides this.
|
|
1098
|
+
*/
|
|
1099
|
+
shape?: ButtonShape;
|
|
1100
|
+
/** Where the loading indicator appears. Default: `"center"`. */
|
|
1101
|
+
loadingPosition?: ButtonLoadingPosition;
|
|
1102
|
+
/** The URL to link to when the button is clicked. If defined, an `a` element will be used as the root node. */
|
|
1103
|
+
href?: string;
|
|
1104
|
+
/** Anchor `target` - only meaningful when `href` is set. */
|
|
1105
|
+
target?: string;
|
|
1106
|
+
/** Anchor `rel` - only meaningful when `href` is set. */
|
|
1107
|
+
rel?: string;
|
|
1108
|
+
/** Overrides the CSS of the root: an entry of `StyleSheet.create`, or a list of them. It wins over `slotProps.root.style`. */
|
|
1109
|
+
style?: StyleOverride;
|
|
1110
|
+
/** Overrides for the slots a theme can style: `style`, `className`, `data-*` and `aria-*`. */
|
|
1111
|
+
slotProps?: SlotProps<ButtonSlot>;
|
|
1112
|
+
}
|
|
1113
|
+
export { SlotOverride as $, TextInputTextColor as A, FlexProps as B, TypographyVariant as C, TextInputProps as D, TextInputOwnerState as E, ModalProps as F, ViewBorderColorToken as G, FlexThemeConfig as H, ModalScroll as I, ViewColorToken as J, ViewBorderRadiusToken as K, ModalSlot as L, TextInputVariant as M, ModalCloseReason as N, TextInputSize as O, ModalOwnerState as P, ViewThemeConfig as Q, ModalThemeConfig as R, TypographyThemeConfig as S, TextInputColor as T, GapToken$1 as U, FlexSlot as V, ViewBackgroundToken as W, ViewProps as X, ViewOwnerState as Y, ViewSlot as Z, TextColorToken as _, ButtonShape as a, TypographyProps as b, ButtonThemeConfig as c, AppTheme as d, SlotProps as et, ComponentConfig as f, BackgroundToken as g, ThemeComponents as h, ButtonProps as i, TextInputThemeConfig as j, TextInputSlot as k, ButtonVariant as l, Theme as m, ButtonLoadingPosition as n, ButtonSize as o, GildTheme as p, ViewBorderWidthToken as q, ButtonOwnerState as r, ButtonSlot as s, ButtonColor as t, StyleOverride as tt, GapToken as u, TypographyAlign as v, TextInputClasses as w, TypographySlot as x, TypographyOwnerState as y, FlexOwnerState as z };
|