@marwes-ui/react 0.0.4 → 1.0.1
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 +1 -1
- package/README.md +510 -86
- package/dist/index.d.ts +1550 -441
- package/dist/index.js +3978 -246
- package/dist/index.js.map +1 -1
- package/package.json +16 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,42 +1,28 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export { ButtonAction, ButtonSize, ButtonVariant, IconName,
|
|
2
|
+
import { ThemeInput, ThemeMode, FontLoadingConfig, ResolvedTheme, ButtonOptions, InputOptions, SelectOptions, SelectAppearance as SelectAppearance$1, SelectOption as SelectOption$1, TextareaOptions, RichTextOptions, InputOtpOptions, CurrencyCode, iconRegistry, IconSize, IconStrokeWidth, AvatarOptions, CheckboxProps as CheckboxProps$1, DividerOptions, DividerSize, DividerOrientation, SpinnerOptions, SpacingOptions, SpacingSize, HeadingOptions, HeadingSize, ParagraphOptions, ParagraphSize, ToastOptions, ToastVariant, ToastIntent, ToastPlacement, TooltipOptions, IconNameType, RadioOptions, BadgeOptions, SwitchOptions, SliderOptions, TabOptions, DialogOptions } from '@marwes-ui/core';
|
|
3
|
+
export { AvatarSize, AvatarType, BadgeVariant, ButtonAction, ButtonSize, ButtonVariant, Density, FontLoadingConfig, FontLoadingMode, FontLoadingOptions, IconName, MwAvailableFont, MwFontFallback, MwGoogleFontFamily, MwStyledTheme, MwThemeVarName, MwThemeVarNames, MwThemeVarReference, MwThemeVars, ResolvedTheme, SpacingSize, Spacings, SwitchSize, Theme, ThemeInput, ThemeMode, ToneName, createFontStack, mwAvailableFonts, mwFontFallbacks, mwGoogleFontFamilies, mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar } from '@marwes-ui/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
type MarwesProviderProps = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Current theme mode. Determines light or dark color palette.
|
|
11
|
-
* When changed, efficiently switches theme colors without recreating the entire system.
|
|
12
|
-
*/
|
|
7
|
+
theme?: ThemeInput;
|
|
8
|
+
defaultMode?: ThemeMode;
|
|
13
9
|
mode?: ThemeMode;
|
|
14
|
-
|
|
15
|
-
* Callback fired when mode should change.
|
|
16
|
-
* Users are responsible for managing mode state and persistence (e.g., localStorage).
|
|
17
|
-
*
|
|
18
|
-
* Example with persistence:
|
|
19
|
-
* ```tsx
|
|
20
|
-
* const [mode, setMode] = useState<ThemeMode>(
|
|
21
|
-
* () => (localStorage.getItem('theme-mode') as ThemeMode) ?? 'light'
|
|
22
|
-
* );
|
|
23
|
-
*
|
|
24
|
-
* const handleModeChange = (newMode: ThemeMode) => {
|
|
25
|
-
* setMode(newMode);
|
|
26
|
-
* localStorage.setItem('theme-mode', newMode);
|
|
27
|
-
* };
|
|
28
|
-
*
|
|
29
|
-
* <MarwesProvider mode={mode} onModeChange={handleModeChange}>
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
10
|
+
fontLoading?: FontLoadingConfig;
|
|
32
11
|
onModeChange?: (mode: ThemeMode) => void;
|
|
33
12
|
children: React.ReactNode;
|
|
34
13
|
};
|
|
35
|
-
declare function MarwesProvider({
|
|
14
|
+
declare function MarwesProvider({ theme, defaultMode, mode: controlledMode, fontLoading, onModeChange, children, }: MarwesProviderProps): react_jsx_runtime.JSX.Element;
|
|
36
15
|
|
|
37
|
-
declare function
|
|
16
|
+
declare function useTheme(): ResolvedTheme;
|
|
38
17
|
|
|
39
|
-
|
|
18
|
+
type ThemeModeContextValue = {
|
|
19
|
+
mode: ThemeMode;
|
|
20
|
+
setMode: (mode: ThemeMode) => void;
|
|
21
|
+
toggleMode: () => void;
|
|
22
|
+
isDark: boolean;
|
|
23
|
+
isLight: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare function useThemeMode(): ThemeModeContextValue;
|
|
40
26
|
|
|
41
27
|
type ButtonProps = ButtonOptions & {
|
|
42
28
|
children?: React.ReactNode;
|
|
@@ -46,162 +32,568 @@ type ButtonProps = ButtonOptions & {
|
|
|
46
32
|
declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
47
33
|
|
|
48
34
|
/**
|
|
49
|
-
*
|
|
35
|
+
* Purpose Components — Button
|
|
50
36
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* the purpose and behavior of each button.
|
|
37
|
+
* Pre-configured button compositions that encode a specific semantic purpose.
|
|
38
|
+
* Purpose buttons lock semantic intent and canonical visual treatment.
|
|
54
39
|
*/
|
|
55
|
-
type
|
|
40
|
+
type DestructiveButtonProps = Omit<ButtonProps, "variant" | "action" | "as" | "href"> & {
|
|
56
41
|
/**
|
|
57
42
|
* Override automatic confirmation requirement.
|
|
58
43
|
* Defaults to `true` for destructive actions.
|
|
59
44
|
*/
|
|
60
45
|
confirmation?: boolean;
|
|
61
46
|
};
|
|
47
|
+
declare function DestructiveButton(props: DestructiveButtonProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
type CreateButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
49
|
+
declare function CreateButton(props: CreateButtonProps): react_jsx_runtime.JSX.Element;
|
|
50
|
+
type SubmitButtonProps = Omit<ButtonProps, "variant" | "action" | "as" | "href">;
|
|
51
|
+
declare function SubmitButton(props: SubmitButtonProps): react_jsx_runtime.JSX.Element;
|
|
52
|
+
type CancelButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
53
|
+
declare function CancelButton(props: CancelButtonProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
type LinkButtonProps = Omit<ButtonProps, "variant" | "action" | "as"> & {
|
|
55
|
+
href: string;
|
|
56
|
+
};
|
|
57
|
+
declare function LinkButton(props: LinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
type SaveButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
59
|
+
declare function SaveButton(props: SaveButtonProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
type ConfirmButtonProps = Omit<ButtonProps, "variant" | "action" | "as" | "href">;
|
|
61
|
+
declare function ConfirmButton(props: ConfirmButtonProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
type VerifyButtonProps = Omit<ButtonProps, "variant" | "action" | "as" | "href">;
|
|
63
|
+
declare function VerifyButton(props: VerifyButtonProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
type EditButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
65
|
+
declare function EditButton(props: EditButtonProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
type CloseButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
67
|
+
declare function CloseButton(props: CloseButtonProps): react_jsx_runtime.JSX.Element;
|
|
68
|
+
type RefreshButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
69
|
+
declare function RefreshButton(props: RefreshButtonProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
type UploadButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
71
|
+
declare function UploadButton(props: UploadButtonProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
type DownloadButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
73
|
+
declare function DownloadButton(props: DownloadButtonProps): react_jsx_runtime.JSX.Element;
|
|
74
|
+
type CopyButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
75
|
+
declare function CopyButton(props: CopyButtonProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
type SearchButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
77
|
+
declare function SearchButton(props: SearchButtonProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
type FilterButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
79
|
+
declare function FilterButton(props: FilterButtonProps): react_jsx_runtime.JSX.Element;
|
|
80
|
+
type SortButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
81
|
+
declare function SortButton(props: SortButtonProps): react_jsx_runtime.JSX.Element;
|
|
82
|
+
type DropdownButtonProps = Omit<ButtonProps, "variant" | "action">;
|
|
83
|
+
declare function DropdownButton(props: DropdownButtonProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
type PrimaryButtonProps = Omit<ButtonProps, "variant" | "as"> & {};
|
|
85
|
+
declare function PrimaryButton(props: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
type SecondaryButtonProps = Omit<ButtonProps, "variant" | "as"> & {};
|
|
87
|
+
declare function SecondaryButton(props: SecondaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
88
|
+
type TextButtonProps = Omit<ButtonProps, "variant" | "as"> & {};
|
|
89
|
+
declare function TextButton(props: TextButtonProps): react_jsx_runtime.JSX.Element;
|
|
90
|
+
type SuccessButtonProps = Omit<ButtonProps, "variant" | "as"> & {};
|
|
91
|
+
declare function SuccessButton(props: SuccessButtonProps): react_jsx_runtime.JSX.Element;
|
|
92
|
+
|
|
93
|
+
type InputProps = InputOptions & {
|
|
94
|
+
onValueChange?: (value: string) => void;
|
|
95
|
+
className?: string;
|
|
96
|
+
};
|
|
97
|
+
declare function Input(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
98
|
+
|
|
99
|
+
type SelectAppearance = SelectAppearance$1;
|
|
100
|
+
type SelectOption = SelectOption$1;
|
|
101
|
+
type SelectProps = SelectOptions & {
|
|
102
|
+
onValueChange?: (value: string) => void;
|
|
103
|
+
className?: string;
|
|
104
|
+
};
|
|
105
|
+
declare function Select(props: SelectProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
|
|
107
|
+
type TextareaProps = TextareaOptions & {
|
|
108
|
+
onValueChange?: (value: string) => void;
|
|
109
|
+
className?: string;
|
|
110
|
+
};
|
|
111
|
+
declare function Textarea(props: TextareaProps): react_jsx_runtime.JSX.Element;
|
|
112
|
+
|
|
113
|
+
type RichTextProps = RichTextOptions & {
|
|
114
|
+
onValueChange?: (value: string) => void;
|
|
115
|
+
className?: string;
|
|
116
|
+
};
|
|
117
|
+
declare const RichText: React.ForwardRefExoticComponent<RichTextOptions & {
|
|
118
|
+
onValueChange?: (value: string) => void;
|
|
119
|
+
className?: string;
|
|
120
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
121
|
+
|
|
122
|
+
type InputFieldProps = {
|
|
123
|
+
/** Optional: if omitted, we generate one via useId(). */
|
|
124
|
+
id?: string;
|
|
125
|
+
/** Field label (required for accessibility). */
|
|
126
|
+
label: string;
|
|
127
|
+
/** Optional helper text shown below the input. */
|
|
128
|
+
helperText?: string;
|
|
129
|
+
/** Optional error message. When present, input is marked invalid. */
|
|
130
|
+
error?: string;
|
|
131
|
+
/** Props forwarded to the Input atom. */
|
|
132
|
+
input: InputProps;
|
|
133
|
+
/** Additional aria-describedby IDs to merge with internal helper/error IDs. */
|
|
134
|
+
ariaDescribedBy?: string;
|
|
135
|
+
/** Optional leading text symbol displayed inside the input on the left (e.g. "$", "€", "kr"). */
|
|
136
|
+
leadingSymbol?: string;
|
|
137
|
+
};
|
|
62
138
|
/**
|
|
63
|
-
*
|
|
139
|
+
* InputField (Molecule) — Recommended
|
|
140
|
+
*
|
|
141
|
+
* A convenient, accessible wrapper around `Input` that provides:
|
|
142
|
+
* - a visible `<label>` wired via `htmlFor`/`id`
|
|
143
|
+
* - optional `helperText` and `error` regions
|
|
144
|
+
* - automatic `aria-describedby` wiring (helperText + error + any external ids)
|
|
145
|
+
* - automatic invalid state when `error` is present
|
|
146
|
+
*
|
|
147
|
+
* Use `InputField` for most forms. Use `Input` directly only when you need
|
|
148
|
+
* a highly custom layout or composite inputs.
|
|
149
|
+
*
|
|
150
|
+
* Accessibility
|
|
151
|
+
* - Generates a stable `id` via `useId()` when `id` is not provided.
|
|
152
|
+
* - Always renders a visible `<label>` element connected to the input control.
|
|
153
|
+
* - When `helperText` and/or `error` are present, it sets `aria-describedby`
|
|
154
|
+
* on the input to reference their ids.
|
|
155
|
+
* - When `error` is present, the input is marked invalid (aria-invalid).
|
|
156
|
+
* - Error region has `aria-live="polite"` for screen reader announcements.
|
|
157
|
+
*
|
|
158
|
+
* @example Minimal (recommended)
|
|
159
|
+
* ```tsx
|
|
160
|
+
* <InputField
|
|
161
|
+
* label="Email address"
|
|
162
|
+
* input={{ type: "email", placeholder: "you@example.com" }}
|
|
163
|
+
* />
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @example With helper text
|
|
167
|
+
* ```tsx
|
|
168
|
+
* <InputField
|
|
169
|
+
* label="Username"
|
|
170
|
+
* helperText="Choose a unique username between 3-20 characters."
|
|
171
|
+
* input={{ type: "text", placeholder: "johnsmith" }}
|
|
172
|
+
* />
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* @example With error (invalid state)
|
|
176
|
+
* ```tsx
|
|
177
|
+
* <InputField
|
|
178
|
+
* label="Password"
|
|
179
|
+
* error="Password must be at least 8 characters."
|
|
180
|
+
* input={{ type: "password", required: true }}
|
|
181
|
+
* />
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @example Controlled
|
|
185
|
+
* ```tsx
|
|
186
|
+
* const [email, setEmail] = React.useState("");
|
|
187
|
+
*
|
|
188
|
+
* <InputField
|
|
189
|
+
* label="Email"
|
|
190
|
+
* input={{
|
|
191
|
+
* type: "email",
|
|
192
|
+
* value: email,
|
|
193
|
+
* onValueChange: setEmail,
|
|
194
|
+
* }}
|
|
195
|
+
* />
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @example Disabled
|
|
199
|
+
* ```tsx
|
|
200
|
+
* <InputField
|
|
201
|
+
* label="Account ID"
|
|
202
|
+
* helperText="This value cannot be changed."
|
|
203
|
+
* input={{ value: "ACC-12345", disabled: true }}
|
|
204
|
+
* />
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* @example Read-only
|
|
208
|
+
* ```tsx
|
|
209
|
+
* <InputField
|
|
210
|
+
* label="Account created"
|
|
211
|
+
* input={{ value: "January 15, 2026", readOnly: true }}
|
|
212
|
+
* />
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @example Custom describedBy (merge with internal helper/error)
|
|
216
|
+
* ```tsx
|
|
217
|
+
* <InputField
|
|
218
|
+
* ariaDescribedBy="my-extra-help"
|
|
219
|
+
* label="API Key"
|
|
220
|
+
* helperText="Your key is stored securely."
|
|
221
|
+
* input={{ type: "password" }}
|
|
222
|
+
* />
|
|
223
|
+
*
|
|
224
|
+
* <div id="my-extra-help">This can be regenerated from your settings.</div>
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
declare function InputField(props: InputFieldProps): React.ReactElement;
|
|
228
|
+
|
|
229
|
+
type InputOtpProps = Omit<InputOtpOptions, "describedBy"> & {
|
|
230
|
+
label: string;
|
|
231
|
+
helperText?: string;
|
|
232
|
+
error?: string;
|
|
233
|
+
ariaDescribedBy?: string;
|
|
234
|
+
onValueChange?: (value: string) => void;
|
|
235
|
+
className?: string;
|
|
236
|
+
};
|
|
237
|
+
declare function InputOtp(props: InputOtpProps): React.ReactElement;
|
|
238
|
+
|
|
239
|
+
type SelectFieldProps = {
|
|
240
|
+
id?: string;
|
|
241
|
+
label: string;
|
|
242
|
+
helperText?: string;
|
|
243
|
+
error?: string;
|
|
244
|
+
select: SelectProps;
|
|
245
|
+
ariaDescribedBy?: string;
|
|
246
|
+
};
|
|
247
|
+
declare function SelectField(props: SelectFieldProps): React.ReactElement;
|
|
248
|
+
|
|
249
|
+
type TextareaFieldProps = {
|
|
250
|
+
id?: string;
|
|
251
|
+
label: string;
|
|
252
|
+
helperText?: string;
|
|
253
|
+
error?: string;
|
|
254
|
+
textarea: TextareaProps;
|
|
255
|
+
ariaDescribedBy?: string;
|
|
256
|
+
};
|
|
257
|
+
declare function TextareaField(props: TextareaFieldProps): React.ReactElement;
|
|
258
|
+
|
|
259
|
+
type RichTextFieldProps = {
|
|
260
|
+
id?: string;
|
|
261
|
+
label: string;
|
|
262
|
+
helperText?: string;
|
|
263
|
+
error?: string;
|
|
264
|
+
editor: RichTextProps;
|
|
265
|
+
ariaDescribedBy?: string;
|
|
266
|
+
};
|
|
267
|
+
declare function RichTextField(props: RichTextFieldProps): React.ReactElement;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Field Variants - AI-Friendly Components
|
|
271
|
+
*
|
|
272
|
+
* These variants encode best practices and automatically set AI-friendly
|
|
273
|
+
* metadata, making it easier for both developers and AI tools to understand
|
|
274
|
+
* the purpose and behavior of each field.
|
|
275
|
+
*
|
|
276
|
+
* Each variant manages its own purpose-specific logic (password toggle,
|
|
277
|
+
* search clear, etc.) and sets appropriate semantic attributes.
|
|
278
|
+
*/
|
|
279
|
+
type DropdownFieldProps = Omit<SelectFieldProps, "select"> & {
|
|
280
|
+
/**
|
|
281
|
+
* Select-specific props. Use `native` to opt back into the browser dropdown.
|
|
282
|
+
*/
|
|
283
|
+
select: Omit<SelectProps, "appearance"> & {
|
|
284
|
+
native?: boolean;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* DropdownField - For the Figma-aligned dropdown presentation.
|
|
64
289
|
*
|
|
65
290
|
* **AI Context:**
|
|
66
|
-
* -
|
|
67
|
-
* -
|
|
68
|
-
* -
|
|
69
|
-
* - Adds `data-
|
|
291
|
+
* - Reuses `SelectField` accessibility and state wiring
|
|
292
|
+
* - Defaults to the Marwes dropdown presentation
|
|
293
|
+
* - Allows `native={true}` to fall back to the browser dropdown
|
|
294
|
+
* - Adds `data-purpose="dropdown"` for semantic parsing
|
|
295
|
+
*
|
|
296
|
+
* **Features:**
|
|
297
|
+
* - Same label/helper/error contract as `SelectField`
|
|
298
|
+
* - Controlled and uncontrolled modes supported
|
|
299
|
+
* - Prevents API drift between generic select and dropdown styling
|
|
70
300
|
*
|
|
71
301
|
* @example
|
|
72
302
|
* ```tsx
|
|
73
|
-
*
|
|
303
|
+
* <DropdownField
|
|
304
|
+
* label="Country"
|
|
305
|
+
* select={{
|
|
306
|
+
* placeholder: "Choose a country",
|
|
307
|
+
* options: [
|
|
308
|
+
* { value: "se", label: "Sweden" },
|
|
309
|
+
* { value: "us", label: "United States" },
|
|
310
|
+
* ],
|
|
311
|
+
* }}
|
|
312
|
+
* />
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
declare function DropdownField(props: DropdownFieldProps): React.ReactElement;
|
|
316
|
+
type SearchFieldProps = Omit<InputFieldProps, "input"> & {
|
|
317
|
+
/**
|
|
318
|
+
* Input-specific props (type is auto-set to "search")
|
|
319
|
+
*/
|
|
320
|
+
input?: Omit<InputProps, "type">;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* SearchField - For search inputs with an automatic search affordance and clear button.
|
|
324
|
+
*
|
|
325
|
+
* **AI Context:**
|
|
326
|
+
* - Sets `type="search"` automatically
|
|
327
|
+
* - Sets `inputMode="search"` for mobile keyboards
|
|
328
|
+
* - Shows a search icon by default and a clear button (X icon) when field has content
|
|
329
|
+
* - Adds `data-purpose="search"` for AI parsing
|
|
330
|
+
*
|
|
331
|
+
* **Features:**
|
|
332
|
+
* - Automatic clear button that appears when typing
|
|
333
|
+
* - Native search input behavior
|
|
334
|
+
* - Optimized mobile keyboard
|
|
335
|
+
* - Controlled and uncontrolled modes supported
|
|
336
|
+
*
|
|
337
|
+
* @example Basic usage
|
|
338
|
+
* ```tsx
|
|
339
|
+
* import { SearchField } from "@marwes-ui/react";
|
|
74
340
|
*
|
|
75
341
|
* export function Example() {
|
|
76
|
-
*
|
|
342
|
+
* const [query, setQuery] = React.useState("");
|
|
343
|
+
* return (
|
|
344
|
+
* <SearchField
|
|
345
|
+
* label="Search products"
|
|
346
|
+
* input={{ value: query, onValueChange: setQuery }}
|
|
347
|
+
* />
|
|
348
|
+
* );
|
|
349
|
+
* }
|
|
350
|
+
* ```
|
|
351
|
+
*/
|
|
352
|
+
declare function SearchField(props: SearchFieldProps): React.ReactElement;
|
|
353
|
+
type PasswordFieldProps = Omit<InputFieldProps, "input"> & {
|
|
354
|
+
/**
|
|
355
|
+
* Input-specific props (type is auto-set to "password")
|
|
356
|
+
*/
|
|
357
|
+
input?: Omit<InputProps, "type">;
|
|
358
|
+
/**
|
|
359
|
+
* Autocomplete hint: "current-password" or "new-password"
|
|
360
|
+
* Defaults to "current-password"
|
|
361
|
+
*/
|
|
362
|
+
autoComplete?: "current-password" | "new-password";
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* PasswordField - For password inputs with automatic show/hide toggle.
|
|
366
|
+
*
|
|
367
|
+
* **AI Context:**
|
|
368
|
+
* - Sets `type="password"` automatically (toggles to "text" when shown)
|
|
369
|
+
* - Shows eye/eyeOff icon toggle button
|
|
370
|
+
* - Sets appropriate `autoComplete` attribute
|
|
371
|
+
* - Adds `data-purpose="password"` for AI parsing
|
|
372
|
+
*
|
|
373
|
+
* **Features:**
|
|
374
|
+
* - Automatic show/hide toggle with eye icon
|
|
375
|
+
* - Proper autocomplete for password managers
|
|
376
|
+
* - Accessible toggle button with clear labels
|
|
377
|
+
* - Controlled and uncontrolled modes supported
|
|
378
|
+
*
|
|
379
|
+
* @example Basic usage
|
|
380
|
+
* ```tsx
|
|
381
|
+
* import { PasswordField } from "@marwes-ui/react";
|
|
382
|
+
*
|
|
383
|
+
* export function Example() {
|
|
384
|
+
* const [password, setPassword] = React.useState("");
|
|
385
|
+
* return (
|
|
386
|
+
* <PasswordField
|
|
387
|
+
* label="Password"
|
|
388
|
+
* input={{ value: password, onValueChange: setPassword }}
|
|
389
|
+
* />
|
|
390
|
+
* );
|
|
77
391
|
* }
|
|
78
392
|
* ```
|
|
393
|
+
*
|
|
394
|
+
* @example New password (signup/reset)
|
|
395
|
+
* ```tsx
|
|
396
|
+
* <PasswordField
|
|
397
|
+
* label="New Password"
|
|
398
|
+
* autoComplete="new-password"
|
|
399
|
+
* helperText="Must be at least 8 characters"
|
|
400
|
+
* />
|
|
401
|
+
* ```
|
|
79
402
|
*/
|
|
80
|
-
declare function
|
|
81
|
-
type
|
|
403
|
+
declare function PasswordField(props: PasswordFieldProps): React.ReactElement;
|
|
404
|
+
type EmailFieldProps = Omit<InputFieldProps, "input"> & {
|
|
405
|
+
/**
|
|
406
|
+
* Input-specific props (type, inputMode, autoComplete auto-set)
|
|
407
|
+
*/
|
|
408
|
+
input?: Omit<InputProps, "type" | "inputMode" | "autoComplete">;
|
|
409
|
+
};
|
|
82
410
|
/**
|
|
83
|
-
*
|
|
411
|
+
* EmailField - For email address inputs with proper semantic attributes.
|
|
84
412
|
*
|
|
85
413
|
* **AI Context:**
|
|
86
|
-
* - Sets `
|
|
87
|
-
* -
|
|
88
|
-
* -
|
|
414
|
+
* - Sets `type="email"` for validation
|
|
415
|
+
* - Sets `inputMode="email"` for optimized mobile keyboard
|
|
416
|
+
* - Sets `autoComplete="email"` for autofill
|
|
417
|
+
* - Adds `data-purpose="email"` for AI parsing
|
|
418
|
+
*
|
|
419
|
+
* **Features:**
|
|
420
|
+
* - Browser email validation
|
|
421
|
+
* - Email-optimized mobile keyboard
|
|
422
|
+
* - Autofill support for email addresses
|
|
89
423
|
*
|
|
90
424
|
* @example
|
|
91
425
|
* ```tsx
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
426
|
+
* import { EmailField } from "@marwes-ui/react";
|
|
427
|
+
*
|
|
428
|
+
* <EmailField
|
|
429
|
+
* label="Email address"
|
|
430
|
+
* input={{ placeholder: "you@example.com" }}
|
|
431
|
+
* />
|
|
95
432
|
* ```
|
|
96
433
|
*/
|
|
97
|
-
declare function
|
|
98
|
-
type
|
|
434
|
+
declare function EmailField(props: EmailFieldProps): React.ReactElement;
|
|
435
|
+
type DateOfBirthFieldProps = Omit<InputFieldProps, "input"> & {
|
|
436
|
+
/**
|
|
437
|
+
* Input-specific props (type, inputMode, autoComplete auto-set)
|
|
438
|
+
*/
|
|
439
|
+
input?: Omit<InputProps, "type" | "inputMode" | "autoComplete">;
|
|
440
|
+
};
|
|
99
441
|
/**
|
|
100
|
-
*
|
|
442
|
+
* DateOfBirthField - For birthday inputs with native date semantics.
|
|
101
443
|
*
|
|
102
444
|
* **AI Context:**
|
|
103
|
-
* - Sets `
|
|
104
|
-
* -
|
|
105
|
-
* -
|
|
445
|
+
* - Sets `type="date"` for native browser date controls
|
|
446
|
+
* - Sets `autoComplete="bday"` for profile/password-manager autofill
|
|
447
|
+
* - Adds `data-purpose="date-of-birth"` for AI parsing
|
|
448
|
+
*
|
|
449
|
+
* **Features:**
|
|
450
|
+
* - Native date picker where the platform supports it
|
|
451
|
+
* - ISO value handling (`YYYY-MM-DD`) for predictable form state
|
|
452
|
+
* - Keeps the same label/helper/error contract as `InputField`
|
|
453
|
+
*/
|
|
454
|
+
declare function DateOfBirthField(props: DateOfBirthFieldProps): React.ReactElement;
|
|
455
|
+
type ZipCodeFieldProps = Omit<InputFieldProps, "input"> & {
|
|
456
|
+
/**
|
|
457
|
+
* Input-specific props (type, inputMode, autoComplete auto-set)
|
|
458
|
+
*/
|
|
459
|
+
input?: Omit<InputProps, "type" | "inputMode" | "autoComplete">;
|
|
460
|
+
};
|
|
461
|
+
/**
|
|
462
|
+
* ZipCodeField - For postal/ZIP code inputs that should keep text semantics.
|
|
463
|
+
*
|
|
464
|
+
* **AI Context:**
|
|
465
|
+
* - Sets `type="text"` to preserve leading zeros
|
|
466
|
+
* - Sets `inputMode="numeric"` for the mobile number keypad
|
|
467
|
+
* - Sets `autoComplete="postal-code"` for address autofill
|
|
468
|
+
* - Adds `data-purpose="zip-code"` for AI parsing
|
|
469
|
+
*
|
|
470
|
+
* **Features:**
|
|
471
|
+
* - Low-regret default for US ZIP and broader postal-code entry
|
|
472
|
+
* - Avoids number-input quirks like spinner UI and lost leading zeroes
|
|
473
|
+
* - Keeps the same label/helper/error contract as `InputField`
|
|
474
|
+
*/
|
|
475
|
+
declare function ZipCodeField(props: ZipCodeFieldProps): React.ReactElement;
|
|
476
|
+
type PhoneFieldProps = Omit<InputFieldProps, "input"> & {
|
|
477
|
+
/**
|
|
478
|
+
* Input-specific props (type, inputMode, autoComplete auto-set)
|
|
479
|
+
*/
|
|
480
|
+
input?: Omit<InputProps, "type" | "inputMode" | "autoComplete">;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* PhoneField - For phone number inputs with proper semantic attributes.
|
|
484
|
+
*
|
|
485
|
+
* **AI Context:**
|
|
486
|
+
* - Sets `type="tel"` for telephone input
|
|
487
|
+
* - Sets `inputMode="tel"` for phone keyboard
|
|
488
|
+
* - Sets `autoComplete="tel"` for autofill
|
|
489
|
+
* - Adds `data-purpose="phone"` for AI parsing
|
|
490
|
+
*
|
|
491
|
+
* **Features:**
|
|
492
|
+
* - Phone-optimized mobile keyboard
|
|
493
|
+
* - Autofill support for phone numbers
|
|
494
|
+
* - Accepts any phone format (formatting should be done externally)
|
|
106
495
|
*
|
|
107
496
|
* @example
|
|
108
497
|
* ```tsx
|
|
109
|
-
*
|
|
498
|
+
* import { PhoneField } from "@marwes-ui/react";
|
|
499
|
+
*
|
|
500
|
+
* <PhoneField
|
|
501
|
+
* label="Phone number"
|
|
502
|
+
* input={{ placeholder: "+1 (555) 000-0000" }}
|
|
503
|
+
* />
|
|
110
504
|
* ```
|
|
111
505
|
*/
|
|
112
|
-
declare function
|
|
113
|
-
type
|
|
506
|
+
declare function PhoneField(props: PhoneFieldProps): React.ReactElement;
|
|
507
|
+
type URLFieldProps = Omit<InputFieldProps, "input"> & {
|
|
508
|
+
/**
|
|
509
|
+
* Input-specific props (type, inputMode, autoComplete auto-set)
|
|
510
|
+
*/
|
|
511
|
+
input?: Omit<InputProps, "type" | "inputMode" | "autoComplete">;
|
|
512
|
+
};
|
|
114
513
|
/**
|
|
115
|
-
*
|
|
514
|
+
* URLField - For URL inputs with proper semantic attributes.
|
|
116
515
|
*
|
|
117
516
|
* **AI Context:**
|
|
118
|
-
* - Sets `
|
|
119
|
-
* -
|
|
120
|
-
* -
|
|
517
|
+
* - Sets `type="url"` for URL validation
|
|
518
|
+
* - Sets `inputMode="url"` for URL keyboard
|
|
519
|
+
* - Sets `autoComplete="url"` for autofill
|
|
520
|
+
* - Adds `data-purpose="url"` for AI parsing
|
|
521
|
+
*
|
|
522
|
+
* **Features:**
|
|
523
|
+
* - Browser URL validation
|
|
524
|
+
* - URL-optimized mobile keyboard
|
|
525
|
+
* - Autofill support for URLs
|
|
121
526
|
*
|
|
122
527
|
* @example
|
|
123
528
|
* ```tsx
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
529
|
+
* import { URLField } from "@marwes-ui/react";
|
|
530
|
+
*
|
|
531
|
+
* <URLField
|
|
532
|
+
* label="Website"
|
|
533
|
+
* input={{ placeholder: "https://example.com" }}
|
|
534
|
+
* />
|
|
127
535
|
* ```
|
|
128
536
|
*/
|
|
129
|
-
declare function
|
|
130
|
-
type
|
|
537
|
+
declare function URLField(props: URLFieldProps): React.ReactElement;
|
|
538
|
+
type CurrencyFieldProps = Omit<InputFieldProps, "input"> & {
|
|
131
539
|
/**
|
|
132
|
-
*
|
|
540
|
+
* Input-specific props (type, inputMode auto-set)
|
|
133
541
|
*/
|
|
134
|
-
|
|
542
|
+
input?: Omit<InputProps, "type" | "inputMode">;
|
|
543
|
+
/**
|
|
544
|
+
* Currency code (e.g., "USD", "EUR", "GBP").
|
|
545
|
+
* Prefer `CurrencyCode` for autocomplete and Storybook controls.
|
|
546
|
+
* Unknown strings are tolerated and simply render without a leading symbol.
|
|
547
|
+
*/
|
|
548
|
+
currency?: CurrencyCode | string;
|
|
135
549
|
};
|
|
136
550
|
/**
|
|
137
|
-
*
|
|
551
|
+
* CurrencyField - For monetary amount inputs with currency context.
|
|
138
552
|
*
|
|
139
553
|
* **AI Context:**
|
|
140
|
-
* - Sets `
|
|
141
|
-
* -
|
|
142
|
-
* - Adds
|
|
554
|
+
* - Sets `type="text"` (better browser support than "number")
|
|
555
|
+
* - Sets `inputMode="decimal"` for numeric keyboard with decimal
|
|
556
|
+
* - Adds currency code to helper text if provided
|
|
557
|
+
* - Adds `data-purpose="currency"` and `data-currency` for AI parsing
|
|
143
558
|
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*/
|
|
151
|
-
declare function LinkButton(props: LinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
152
|
-
type PrimaryButtonProps = Omit<ButtonProps, "variant" | "as"> & {};
|
|
153
|
-
/**
|
|
154
|
-
* PrimaryButton - For general use when no specific semantic variant fits.
|
|
559
|
+
* **Features:**
|
|
560
|
+
* - Decimal keyboard on mobile
|
|
561
|
+
* - Currency code display in helper text
|
|
562
|
+
* - Better input control than type="number"
|
|
563
|
+
* - Sanitizes values passed through `input.onValueChange`
|
|
564
|
+
* - Note: Formatting should be handled by parent component
|
|
155
565
|
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* Do something important
|
|
160
|
-
* </PrimaryButton>
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
declare function PrimaryButton(props: PrimaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
164
|
-
type SecondaryButtonProps = Omit<ButtonProps, "variant" | "as"> & {};
|
|
165
|
-
/**
|
|
166
|
-
* SecondaryButton - For general use when no specific semantic variant fits.
|
|
566
|
+
* **Controlled usage recommended:**
|
|
567
|
+
* - Use `input.value` + `input.onValueChange` when you need guaranteed sanitized state
|
|
568
|
+
* - In uncontrolled usage, the callback still receives sanitized values, but the DOM input may temporarily display unsanitized text
|
|
167
569
|
*
|
|
168
570
|
* @example
|
|
169
571
|
* ```tsx
|
|
170
|
-
*
|
|
171
|
-
* Do something important
|
|
172
|
-
* </SecondaryButton>
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
declare function SecondaryButton(props: SecondaryButtonProps): react_jsx_runtime.JSX.Element;
|
|
176
|
-
type TextButtonProps = Omit<ButtonProps, "variant" | "as"> & {};
|
|
177
|
-
/**
|
|
178
|
-
* TextButton - For general use when no specific semantic variant fits.
|
|
572
|
+
* import { CurrencyField } from "@marwes-ui/react";
|
|
179
573
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
574
|
+
* <CurrencyField
|
|
575
|
+
* label="Amount"
|
|
576
|
+
* currency="USD"
|
|
577
|
+
* input={{
|
|
578
|
+
* value: amount,
|
|
579
|
+
* onValueChange: setAmount,
|
|
580
|
+
* placeholder: "0.00",
|
|
581
|
+
* }}
|
|
582
|
+
* />
|
|
185
583
|
* ```
|
|
186
584
|
*/
|
|
187
|
-
declare function
|
|
188
|
-
|
|
189
|
-
type InputProps = InputOptions & {
|
|
190
|
-
onValueChange?: (value: string) => void;
|
|
191
|
-
className?: string;
|
|
192
|
-
};
|
|
193
|
-
declare function Input(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
585
|
+
declare function CurrencyField(props: CurrencyFieldProps): React.ReactElement;
|
|
194
586
|
|
|
195
587
|
type IconName = keyof typeof iconRegistry;
|
|
196
588
|
type IconProps = {
|
|
197
589
|
name: IconName;
|
|
198
590
|
/**
|
|
199
|
-
*
|
|
591
|
+
* Icon scale token ("xs"|"sm"|"md"|"lg") or an explicit pixel size.
|
|
200
592
|
* Defaults to system.theme.icon.size
|
|
201
593
|
*/
|
|
202
594
|
size?: IconSize | number;
|
|
203
595
|
/**
|
|
204
|
-
*
|
|
596
|
+
* Stroke-width token ("xs"|"sm"|"md"|"lg") or an explicit numeric stroke width.
|
|
205
597
|
* Defaults to system.theme.icon.strokeWidth
|
|
206
598
|
*/
|
|
207
599
|
strokeWidth?: IconStrokeWidth | number;
|
|
@@ -214,7 +606,34 @@ type IconProps = {
|
|
|
214
606
|
};
|
|
215
607
|
declare function Icon({ name, size, strokeWidth, className, "aria-label": ariaLabel, decorative, }: IconProps): react_jsx_runtime.JSX.Element;
|
|
216
608
|
|
|
217
|
-
|
|
609
|
+
interface AvatarProps extends AvatarOptions, Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
610
|
+
dataAttributes?: Record<string, string>;
|
|
611
|
+
}
|
|
612
|
+
declare function Avatar(props: AvatarProps): React.ReactElement;
|
|
613
|
+
|
|
614
|
+
interface AvatarBadgeProps extends AvatarProps {
|
|
615
|
+
statusLabel?: string;
|
|
616
|
+
}
|
|
617
|
+
declare function AvatarBadge(props: AvatarBadgeProps): React.ReactElement;
|
|
618
|
+
|
|
619
|
+
interface AvatarGroupItem extends Omit<AvatarProps, "size" | "className" | "style"> {
|
|
620
|
+
id?: string;
|
|
621
|
+
}
|
|
622
|
+
interface AvatarGroupProps extends Omit<React.HTMLAttributes<HTMLFieldSetElement>, "children"> {
|
|
623
|
+
items: AvatarGroupItem[];
|
|
624
|
+
overflowCount?: number;
|
|
625
|
+
overflowLabel?: string;
|
|
626
|
+
ariaLabel?: string;
|
|
627
|
+
dataAttributes?: Record<string, string>;
|
|
628
|
+
}
|
|
629
|
+
declare function AvatarGroup(props: AvatarGroupProps): React.ReactElement;
|
|
630
|
+
|
|
631
|
+
type ProfileAvatarProps = AvatarProps;
|
|
632
|
+
declare function ProfileAvatar(props: ProfileAvatarProps): React.ReactElement;
|
|
633
|
+
type PresenceAvatarProps = AvatarBadgeProps;
|
|
634
|
+
declare function PresenceAvatar(props: PresenceAvatarProps): React.ReactElement;
|
|
635
|
+
type TeamAvatarGroupProps = AvatarGroupProps;
|
|
636
|
+
declare function TeamAvatarGroup(props: TeamAvatarGroupProps): React.ReactElement;
|
|
218
637
|
|
|
219
638
|
/**
|
|
220
639
|
* React adapter for Marwes Checkbox.
|
|
@@ -299,12 +718,140 @@ type CheckboxProps = CheckboxProps$1 & {
|
|
|
299
718
|
*/
|
|
300
719
|
declare function Checkbox(props: CheckboxProps): React.ReactElement;
|
|
301
720
|
|
|
721
|
+
type CheckboxFieldProps = {
|
|
722
|
+
/** Optional: if omitted, we generate one via useId(). */
|
|
723
|
+
id?: string;
|
|
724
|
+
/** Field content (rendered by adapter). */
|
|
725
|
+
label: React.ReactNode;
|
|
726
|
+
description?: React.ReactNode;
|
|
727
|
+
error?: React.ReactNode;
|
|
728
|
+
/** Props forwarded to the Checkbox atom. */
|
|
729
|
+
checkbox: CheckboxProps;
|
|
730
|
+
/** Additional aria-describedby IDs to merge with internal description/error IDs. */
|
|
731
|
+
ariaDescribedBy?: string;
|
|
732
|
+
};
|
|
733
|
+
/**
|
|
734
|
+
* CheckboxField (Molecule) — Recommended
|
|
735
|
+
*
|
|
736
|
+
* A convenient, accessible wrapper around `Checkbox` that provides:
|
|
737
|
+
* - a clickable `<label>` wired via `htmlFor`/`id`
|
|
738
|
+
* - optional `description` and `error` regions
|
|
739
|
+
* - automatic `aria-describedby` wiring (description + error + any external ids)
|
|
740
|
+
* - automatic invalid state when `error` is present
|
|
741
|
+
*
|
|
742
|
+
* Use `CheckboxField` for most forms. Use `Checkbox` directly only when you need
|
|
743
|
+
* a highly custom layout (tables, list rows, compound list items, etc.).
|
|
744
|
+
*
|
|
745
|
+
* Accessibility
|
|
746
|
+
* - Generates a stable `id` via `useId()` when `id` is not provided.
|
|
747
|
+
* - Always renders a real `<label>` element connected to the checkbox control.
|
|
748
|
+
* - When `description` and/or `error` are present, it sets `aria-describedby`
|
|
749
|
+
* on the checkbox to reference their ids.
|
|
750
|
+
* - When `error` is present, the checkbox is marked invalid (aria-invalid via core).
|
|
751
|
+
*
|
|
752
|
+
* @example Minimal (recommended)
|
|
753
|
+
* ```tsx
|
|
754
|
+
* <CheckboxField
|
|
755
|
+
* label="Subscribe to updates"
|
|
756
|
+
* checkbox={{ defaultChecked: true }}
|
|
757
|
+
* />
|
|
758
|
+
* ```
|
|
759
|
+
*
|
|
760
|
+
* @example With description
|
|
761
|
+
* ```tsx
|
|
762
|
+
* <CheckboxField
|
|
763
|
+
* label="Subscribe to updates"
|
|
764
|
+
* description="We'll only email you about important product changes."
|
|
765
|
+
* checkbox={{}}
|
|
766
|
+
* />
|
|
767
|
+
* ```
|
|
768
|
+
*
|
|
769
|
+
* @example With error (invalid state)
|
|
770
|
+
* ```tsx
|
|
771
|
+
* <CheckboxField
|
|
772
|
+
* label="Accept terms"
|
|
773
|
+
* error="You must accept the terms to continue."
|
|
774
|
+
* checkbox={{ required: true }}
|
|
775
|
+
* />
|
|
776
|
+
* ```
|
|
777
|
+
*
|
|
778
|
+
* @example Controlled
|
|
779
|
+
* ```tsx
|
|
780
|
+
* const [checked, setChecked] = React.useState(false);
|
|
781
|
+
*
|
|
782
|
+
* <CheckboxField
|
|
783
|
+
* label="Accept terms"
|
|
784
|
+
* checkbox={{
|
|
785
|
+
* checked,
|
|
786
|
+
* onCheckedChange: setChecked,
|
|
787
|
+
* }}
|
|
788
|
+
* />
|
|
789
|
+
* ```
|
|
790
|
+
*
|
|
791
|
+
* @example Indeterminate (mixed)
|
|
792
|
+
* ```tsx
|
|
793
|
+
* const [checked, setChecked] = React.useState(false);
|
|
794
|
+
* const [mixed, setMixed] = React.useState(true);
|
|
795
|
+
*
|
|
796
|
+
* <CheckboxField
|
|
797
|
+
* label="Select all"
|
|
798
|
+
* description="Applies to all items in the current view."
|
|
799
|
+
* checkbox={{
|
|
800
|
+
* checked,
|
|
801
|
+
* indeterminate: mixed,
|
|
802
|
+
* onCheckedChange: (next) => {
|
|
803
|
+
* setMixed(false);
|
|
804
|
+
* setChecked(next);
|
|
805
|
+
* },
|
|
806
|
+
* }}
|
|
807
|
+
* />
|
|
808
|
+
* ```
|
|
809
|
+
*
|
|
810
|
+
* @example Custom describedBy (merge with internal description/error)
|
|
811
|
+
* ```tsx
|
|
812
|
+
* <CheckboxField
|
|
813
|
+
* ariaDescribedBy="my-extra-help"
|
|
814
|
+
* label="Enable telemetry"
|
|
815
|
+
* description="Helps us improve the product."
|
|
816
|
+
* checkbox={{}}
|
|
817
|
+
* />
|
|
818
|
+
*
|
|
819
|
+
* <div id="my-extra-help">This setting can be changed later.</div>
|
|
820
|
+
* ```
|
|
821
|
+
*/
|
|
822
|
+
declare function CheckboxField(props: CheckboxFieldProps): React.ReactElement;
|
|
823
|
+
|
|
824
|
+
interface CheckboxGroupFieldOption {
|
|
825
|
+
value: string;
|
|
826
|
+
label: React.ReactNode;
|
|
827
|
+
disabled?: boolean;
|
|
828
|
+
indeterminate?: boolean;
|
|
829
|
+
}
|
|
830
|
+
type CheckboxGroupFieldCheckboxProps = Omit<CheckboxProps, "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "checked" | "defaultChecked" | "disabled" | "id" | "indeterminate" | "invalid" | "name" | "onChange" | "onCheckedChange" | "required" | "value">;
|
|
831
|
+
interface CheckboxGroupFieldProps {
|
|
832
|
+
label: React.ReactNode;
|
|
833
|
+
options: CheckboxGroupFieldOption[];
|
|
834
|
+
description?: React.ReactNode;
|
|
835
|
+
error?: React.ReactNode;
|
|
836
|
+
value?: string[];
|
|
837
|
+
onChange?: (value: string[]) => void;
|
|
838
|
+
defaultValue?: string[];
|
|
839
|
+
checkbox?: CheckboxGroupFieldCheckboxProps;
|
|
840
|
+
disabled?: boolean;
|
|
841
|
+
required?: boolean;
|
|
842
|
+
name?: string;
|
|
843
|
+
id?: string;
|
|
844
|
+
ariaDescribedBy?: string;
|
|
845
|
+
dataAttributes?: Record<string, string>;
|
|
846
|
+
}
|
|
847
|
+
declare function CheckboxGroupField(props: CheckboxGroupFieldProps): React.ReactElement;
|
|
848
|
+
|
|
302
849
|
/**
|
|
303
850
|
* React adapter for Marwes Divider component.
|
|
304
851
|
* - Renders semantic <hr> using the core divider recipe.
|
|
305
852
|
* - Supports 7 size variants: xxs/xs/sm/md/lg/xl/xxl.
|
|
306
853
|
* - Supports horizontal and vertical orientation.
|
|
307
|
-
* - Figma reference:
|
|
854
|
+
* - Figma reference: component 1574:21053
|
|
308
855
|
*/
|
|
309
856
|
|
|
310
857
|
type DividerProps = DividerOptions & Omit<React.HTMLAttributes<HTMLHRElement>, "children"> & {
|
|
@@ -355,23 +902,144 @@ type DividerProps = DividerOptions & Omit<React.HTMLAttributes<HTMLHRElement>, "
|
|
|
355
902
|
* </div>
|
|
356
903
|
* ```
|
|
357
904
|
*
|
|
358
|
-
* @example With custom ID
|
|
905
|
+
* @example With custom ID
|
|
906
|
+
* ```tsx
|
|
907
|
+
* <Divider id="section-break" />
|
|
908
|
+
* ```
|
|
909
|
+
*/
|
|
910
|
+
declare const Divider: React.ForwardRefExoticComponent<DividerOptions & Omit<React.HTMLAttributes<HTMLHRElement>, "children"> & {
|
|
911
|
+
/**
|
|
912
|
+
* Size variant for the divider.
|
|
913
|
+
* Maps to pixel values: xxs=1px, xs=8px, sm=16px, md=32px, lg=48px, xl=64px, xxl=80px
|
|
914
|
+
* @default "md"
|
|
915
|
+
*/
|
|
916
|
+
size?: DividerSize;
|
|
917
|
+
/**
|
|
918
|
+
* Orientation of the divider.
|
|
919
|
+
* @default "horizontal"
|
|
920
|
+
*/
|
|
921
|
+
orientation?: DividerOrientation;
|
|
922
|
+
/**
|
|
923
|
+
* Additional CSS class names.
|
|
924
|
+
*/
|
|
925
|
+
className?: string;
|
|
926
|
+
/**
|
|
927
|
+
* Inline styles.
|
|
928
|
+
*/
|
|
929
|
+
style?: React.CSSProperties;
|
|
930
|
+
} & React.RefAttributes<HTMLHRElement>>;
|
|
931
|
+
|
|
932
|
+
interface SpinnerProps extends SpinnerOptions, Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
933
|
+
dataAttributes?: Record<string, string>;
|
|
934
|
+
}
|
|
935
|
+
declare function Spinner(props: SpinnerProps): React.ReactElement;
|
|
936
|
+
|
|
937
|
+
type ButtonSpinnerProps = SpinnerProps & {
|
|
938
|
+
inverted?: boolean;
|
|
939
|
+
};
|
|
940
|
+
declare function ButtonSpinner(props: ButtonSpinnerProps): React.ReactElement;
|
|
941
|
+
type EmptyStateSpinnerProps = SpinnerProps;
|
|
942
|
+
declare function EmptyStateSpinner(props: EmptyStateSpinnerProps): React.ReactElement;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* React adapter for Marwes Spacing component.
|
|
946
|
+
* - Renders a decorative, aria-hidden div using the core spacing recipe.
|
|
947
|
+
* - Inserts a fixed vertical gap driven by the --mw-spacing-* token scale.
|
|
948
|
+
*/
|
|
949
|
+
|
|
950
|
+
type SpacingProps = SpacingOptions & Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
951
|
+
/**
|
|
952
|
+
* Size variant for the spacing.
|
|
953
|
+
* Maps to token values: sp-0=0px, sp-2=2px, sp-4=4px, sp-8=8px,
|
|
954
|
+
* sp-16=16px, sp-24=24px, sp-32=32px, up to sp-120=120px.
|
|
955
|
+
* @default "sp-24"
|
|
956
|
+
*/
|
|
957
|
+
size?: SpacingSize;
|
|
958
|
+
/**
|
|
959
|
+
* Ergonomic alias for `size`.
|
|
960
|
+
* Prefer this on `Spacer` for readable layout code.
|
|
961
|
+
*/
|
|
962
|
+
spacing?: SpacingSize;
|
|
963
|
+
/**
|
|
964
|
+
* Additional CSS class names.
|
|
965
|
+
*/
|
|
966
|
+
className?: string;
|
|
967
|
+
/**
|
|
968
|
+
* Inline styles.
|
|
969
|
+
*/
|
|
970
|
+
style?: React.CSSProperties;
|
|
971
|
+
};
|
|
972
|
+
type SpacerProps = SpacingProps;
|
|
973
|
+
/**
|
|
974
|
+
* Spacing
|
|
975
|
+
*
|
|
976
|
+
* Pure layout primitive that inserts a fixed vertical gap between elements.
|
|
977
|
+
* Driven by the design token scale — no magic numbers required.
|
|
978
|
+
*
|
|
979
|
+
* @example Basic usage (24px gap)
|
|
980
|
+
* ```tsx
|
|
981
|
+
* <Spacing />
|
|
982
|
+
* ```
|
|
983
|
+
*
|
|
984
|
+
* @example Semantic size
|
|
985
|
+
* ```tsx
|
|
986
|
+
* <H1>Hello</H1>
|
|
987
|
+
* <Spacing size={Spacings.sp24} />
|
|
988
|
+
* <Paragraph>World</Paragraph>
|
|
989
|
+
* ```
|
|
990
|
+
*
|
|
991
|
+
* @example All sizes
|
|
992
|
+
* ```tsx
|
|
993
|
+
* <Spacing size="sp-2" /> // 2px
|
|
994
|
+
* <Spacing size="sp-8" /> // 8px
|
|
995
|
+
* <Spacing size="sp-32" /> // 32px
|
|
996
|
+
* ```
|
|
997
|
+
*/
|
|
998
|
+
declare const Spacing: React.ForwardRefExoticComponent<SpacingOptions & Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
999
|
+
/**
|
|
1000
|
+
* Size variant for the spacing.
|
|
1001
|
+
* Maps to token values: sp-0=0px, sp-2=2px, sp-4=4px, sp-8=8px,
|
|
1002
|
+
* sp-16=16px, sp-24=24px, sp-32=32px, up to sp-120=120px.
|
|
1003
|
+
* @default "sp-24"
|
|
1004
|
+
*/
|
|
1005
|
+
size?: SpacingSize;
|
|
1006
|
+
/**
|
|
1007
|
+
* Ergonomic alias for `size`.
|
|
1008
|
+
* Prefer this on `Spacer` for readable layout code.
|
|
1009
|
+
*/
|
|
1010
|
+
spacing?: SpacingSize;
|
|
1011
|
+
/**
|
|
1012
|
+
* Additional CSS class names.
|
|
1013
|
+
*/
|
|
1014
|
+
className?: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* Inline styles.
|
|
1017
|
+
*/
|
|
1018
|
+
style?: React.CSSProperties;
|
|
1019
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Spacer
|
|
1022
|
+
*
|
|
1023
|
+
* Alias for `Spacing` with a layout-oriented prop name.
|
|
1024
|
+
*
|
|
1025
|
+
* @example
|
|
359
1026
|
* ```tsx
|
|
360
|
-
* <
|
|
1027
|
+
* <Spacer spacing={Spacings.sp24} />
|
|
361
1028
|
* ```
|
|
362
1029
|
*/
|
|
363
|
-
declare const
|
|
1030
|
+
declare const Spacer: React.ForwardRefExoticComponent<SpacingOptions & Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
364
1031
|
/**
|
|
365
|
-
* Size variant for the
|
|
366
|
-
* Maps to
|
|
367
|
-
*
|
|
1032
|
+
* Size variant for the spacing.
|
|
1033
|
+
* Maps to token values: sp-0=0px, sp-2=2px, sp-4=4px, sp-8=8px,
|
|
1034
|
+
* sp-16=16px, sp-24=24px, sp-32=32px, up to sp-120=120px.
|
|
1035
|
+
* @default "sp-24"
|
|
368
1036
|
*/
|
|
369
|
-
size?:
|
|
1037
|
+
size?: SpacingSize;
|
|
370
1038
|
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
1039
|
+
* Ergonomic alias for `size`.
|
|
1040
|
+
* Prefer this on `Spacer` for readable layout code.
|
|
373
1041
|
*/
|
|
374
|
-
|
|
1042
|
+
spacing?: SpacingSize;
|
|
375
1043
|
/**
|
|
376
1044
|
* Additional CSS class names.
|
|
377
1045
|
*/
|
|
@@ -380,7 +1048,7 @@ declare const Divider: React.ForwardRefExoticComponent<DividerOptions & Omit<Rea
|
|
|
380
1048
|
* Inline styles.
|
|
381
1049
|
*/
|
|
382
1050
|
style?: React.CSSProperties;
|
|
383
|
-
} & React.RefAttributes<
|
|
1051
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
384
1052
|
|
|
385
1053
|
/**
|
|
386
1054
|
* React adapter for Marwes H1 component.
|
|
@@ -568,442 +1236,883 @@ type ParagraphProps = ParagraphOptions & {
|
|
|
568
1236
|
*/
|
|
569
1237
|
declare function Paragraph(props: ParagraphProps): React.ReactElement;
|
|
570
1238
|
|
|
571
|
-
|
|
572
|
-
/** Optional
|
|
1239
|
+
interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1240
|
+
/** Optional title rendered above the body content */
|
|
1241
|
+
title?: React.ReactNode;
|
|
1242
|
+
/** Card body content */
|
|
1243
|
+
children?: React.ReactNode;
|
|
1244
|
+
/** Data attributes for AI-friendly metadata (used by purpose variants). */
|
|
1245
|
+
dataAttributes?: Record<string, string>;
|
|
1246
|
+
}
|
|
1247
|
+
declare function Card(props: CardProps): React.ReactElement;
|
|
1248
|
+
|
|
1249
|
+
type ProductCardProps = CardProps;
|
|
1250
|
+
declare function ProductCard(props: ProductCardProps): React.ReactElement;
|
|
1251
|
+
type ProfileCardProps = CardProps;
|
|
1252
|
+
declare function ProfileCard(props: ProfileCardProps): React.ReactElement;
|
|
1253
|
+
type StatCardProps = CardProps;
|
|
1254
|
+
declare function StatCard(props: StatCardProps): React.ReactElement;
|
|
1255
|
+
|
|
1256
|
+
interface ToastProps extends ToastOptions {
|
|
1257
|
+
/** Main notification message */
|
|
1258
|
+
children: React.ReactNode;
|
|
1259
|
+
/** Icon element shown on the left (e.g. an <Icon> component) */
|
|
1260
|
+
icon?: React.ReactNode;
|
|
1261
|
+
/** Action element shown inline after the message (e.g. a text action or <a>) */
|
|
1262
|
+
action?: React.ReactNode;
|
|
1263
|
+
/** When provided, renders a dismiss (×) button and calls this on click */
|
|
1264
|
+
onDismiss?: () => void;
|
|
1265
|
+
className?: string;
|
|
573
1266
|
id?: string;
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
1267
|
+
dataAttributes?: Record<string, string>;
|
|
1268
|
+
}
|
|
1269
|
+
declare function Toast(props: ToastProps): React.ReactElement;
|
|
1270
|
+
|
|
1271
|
+
interface ManagedToast {
|
|
1272
|
+
id: string;
|
|
1273
|
+
children: React.ReactNode;
|
|
1274
|
+
icon?: React.ReactNode;
|
|
1275
|
+
action?: React.ReactNode;
|
|
1276
|
+
onDismiss?: () => void;
|
|
1277
|
+
className?: string;
|
|
1278
|
+
variant?: ToastVariant;
|
|
1279
|
+
ariaLive?: "polite" | "assertive";
|
|
1280
|
+
intent?: ToastIntent;
|
|
1281
|
+
duration?: number | null;
|
|
1282
|
+
dataAttributes?: Record<string, string>;
|
|
1283
|
+
}
|
|
1284
|
+
type ShowToastOptions = Omit<ManagedToast, "id">;
|
|
1285
|
+
interface ToastContainerProps {
|
|
1286
|
+
toasts: ManagedToast[];
|
|
1287
|
+
placement?: ToastPlacement;
|
|
1288
|
+
maxVisible?: number;
|
|
1289
|
+
className?: string;
|
|
1290
|
+
onDismiss?: (id: string) => void;
|
|
1291
|
+
}
|
|
1292
|
+
interface ToastProviderProps {
|
|
1293
|
+
children: React.ReactNode;
|
|
1294
|
+
placement?: ToastPlacement;
|
|
1295
|
+
maxVisible?: number;
|
|
1296
|
+
defaultDuration?: number | null;
|
|
1297
|
+
className?: string;
|
|
1298
|
+
}
|
|
1299
|
+
interface ToastController {
|
|
1300
|
+
show: (toast: ShowToastOptions) => string;
|
|
1301
|
+
dismiss: (id: string) => void;
|
|
1302
|
+
clear: () => void;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
declare function ToastContainer(props: ToastContainerProps): React.ReactElement;
|
|
1306
|
+
|
|
1307
|
+
declare function ToastProvider(props: ToastProviderProps): React.ReactElement;
|
|
1308
|
+
declare function useToast(): ToastController;
|
|
1309
|
+
|
|
1310
|
+
type SuccessToastProps = ToastProps;
|
|
1311
|
+
declare function SuccessToast(props: SuccessToastProps): React.ReactElement;
|
|
1312
|
+
type ErrorToastProps = ToastProps;
|
|
1313
|
+
declare function ErrorToast(props: ErrorToastProps): React.ReactElement;
|
|
1314
|
+
type WarningToastProps = ToastProps;
|
|
1315
|
+
declare function WarningToast(props: WarningToastProps): React.ReactElement;
|
|
1316
|
+
type InfoToastProps = ToastProps;
|
|
1317
|
+
declare function InfoToast(props: InfoToastProps): React.ReactElement;
|
|
1318
|
+
|
|
1319
|
+
interface TooltipProps extends TooltipOptions, Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
1320
|
+
children: React.ReactNode;
|
|
1321
|
+
dataAttributes?: Record<string, string>;
|
|
1322
|
+
}
|
|
1323
|
+
declare function Tooltip(props: TooltipProps): React.ReactElement;
|
|
1324
|
+
|
|
1325
|
+
interface TooltipGroupProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "content"> {
|
|
1326
|
+
content: React.ReactNode;
|
|
1327
|
+
icon?: IconNameType;
|
|
1328
|
+
triggerLabel?: string;
|
|
1329
|
+
open?: boolean;
|
|
1330
|
+
defaultOpen?: boolean;
|
|
1331
|
+
onOpenChange?: (open: boolean) => void;
|
|
1332
|
+
tooltipId?: string;
|
|
1333
|
+
tooltipClassName?: string;
|
|
1334
|
+
triggerClassName?: string;
|
|
1335
|
+
dataAttributes?: Record<string, string>;
|
|
1336
|
+
}
|
|
1337
|
+
declare function TooltipGroup(props: TooltipGroupProps): React.ReactElement;
|
|
1338
|
+
|
|
583
1339
|
/**
|
|
584
|
-
*
|
|
1340
|
+
* React adapter for Marwes Accordion.
|
|
1341
|
+
* - Renders a compound structure: wrapper div > trigger button + panel div.
|
|
1342
|
+
* - id is optional; falls back to React.useId() for aria wiring.
|
|
1343
|
+
*/
|
|
1344
|
+
|
|
1345
|
+
interface AccordionProps {
|
|
1346
|
+
/** Unique id for aria wiring. Defaults to React.useId() when omitted. */
|
|
1347
|
+
id?: string;
|
|
1348
|
+
open?: boolean;
|
|
1349
|
+
disabled?: boolean;
|
|
1350
|
+
/** Content of the trigger button header */
|
|
1351
|
+
title: React.ReactNode;
|
|
1352
|
+
/** Content shown in the collapsible panel */
|
|
1353
|
+
children: React.ReactNode;
|
|
1354
|
+
className?: string;
|
|
1355
|
+
/** Called when the trigger is clicked */
|
|
1356
|
+
onToggle?: () => void;
|
|
1357
|
+
}
|
|
1358
|
+
declare function Accordion(props: AccordionProps): React.ReactElement;
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* AccordionField (Molecule) — Recommended
|
|
585
1362
|
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
* - optional `description` and `error` regions
|
|
589
|
-
* - automatic `aria-describedby` wiring (description + error + any external ids)
|
|
590
|
-
* - automatic invalid state when `error` is present
|
|
1363
|
+
* An accessible accordion group with field semantics: group label, optional
|
|
1364
|
+
* description, optional error, and coordinated open-state management.
|
|
591
1365
|
*
|
|
592
|
-
*
|
|
593
|
-
* a
|
|
1366
|
+
* Composes `Accordion` atoms into a `role="group"` container with:
|
|
1367
|
+
* - a visible label wired via `aria-labelledby`
|
|
1368
|
+
* - optional `description` and `error` regions
|
|
1369
|
+
* - automatic `aria-describedby` wiring (description + error + external IDs)
|
|
1370
|
+
* - automatic `aria-invalid` when `error` is present
|
|
1371
|
+
* - controlled (`openItems` + `onOpenItemsChange`) or uncontrolled (`defaultOpenItems`) state
|
|
1372
|
+
* - single-open (`multiple=false`, default) or multi-open (`multiple=true`) behaviour
|
|
594
1373
|
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* - Always renders a real `<label>` element connected to the checkbox control.
|
|
598
|
-
* - When `description` and/or `error` are present, it sets `aria-describedby`
|
|
599
|
-
* on the checkbox to reference their ids.
|
|
600
|
-
* - When `error` is present, the checkbox is marked invalid (aria-invalid via core).
|
|
1374
|
+
* Use `AccordionField` for most accordion groups. Use `Accordion` directly only
|
|
1375
|
+
* when you need a standalone collapsible panel outside of group semantics.
|
|
601
1376
|
*
|
|
602
|
-
* @example
|
|
1377
|
+
* @example Basic (uncontrolled, single-open)
|
|
603
1378
|
* ```tsx
|
|
604
|
-
* <
|
|
605
|
-
* label="
|
|
606
|
-
*
|
|
1379
|
+
* <AccordionField
|
|
1380
|
+
* label="FAQ"
|
|
1381
|
+
* items={[
|
|
1382
|
+
* { value: "q1", title: "What is Marwes?", content: <p>A design system.</p> },
|
|
1383
|
+
* { value: "q2", title: "Is it free?", content: <p>Yes.</p> },
|
|
1384
|
+
* ]}
|
|
1385
|
+
* defaultOpenItems={["q1"]}
|
|
607
1386
|
* />
|
|
608
1387
|
* ```
|
|
609
1388
|
*
|
|
610
|
-
* @example
|
|
1389
|
+
* @example Multi-open, controlled
|
|
611
1390
|
* ```tsx
|
|
612
|
-
* <
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
1391
|
+
* const [open, setOpen] = React.useState<string[]>([]);
|
|
1392
|
+
*
|
|
1393
|
+
* <AccordionField
|
|
1394
|
+
* label="Settings"
|
|
1395
|
+
* items={settingsItems}
|
|
1396
|
+
* openItems={open}
|
|
1397
|
+
* onOpenItemsChange={setOpen}
|
|
1398
|
+
* multiple
|
|
616
1399
|
* />
|
|
617
1400
|
* ```
|
|
1401
|
+
*/
|
|
1402
|
+
|
|
1403
|
+
interface AccordionFieldItem {
|
|
1404
|
+
value: string;
|
|
1405
|
+
title: React.ReactNode;
|
|
1406
|
+
content?: React.ReactNode;
|
|
1407
|
+
/** @deprecated Use `content` instead for cross-framework parity. */
|
|
1408
|
+
children?: React.ReactNode;
|
|
1409
|
+
disabled?: boolean;
|
|
1410
|
+
}
|
|
1411
|
+
interface AccordionFieldProps {
|
|
1412
|
+
/** Visible label for the accordion group. */
|
|
1413
|
+
label: React.ReactNode;
|
|
1414
|
+
/** Optional description text below the label. */
|
|
1415
|
+
description?: React.ReactNode;
|
|
1416
|
+
/** Error message. When present, sets aria-invalid on the group. */
|
|
1417
|
+
error?: React.ReactNode;
|
|
1418
|
+
/** Accordion items to render. */
|
|
1419
|
+
items: AccordionFieldItem[];
|
|
1420
|
+
/** Allow multiple items open simultaneously. Defaults to `true`. */
|
|
1421
|
+
multiple?: boolean;
|
|
1422
|
+
/** Controlled: currently open item values. */
|
|
1423
|
+
openItems?: string[];
|
|
1424
|
+
/** Controlled: called with the new open-items array when state changes. */
|
|
1425
|
+
onOpenItemsChange?: (openItems: string[]) => void;
|
|
1426
|
+
/** Uncontrolled: initially open item values. */
|
|
1427
|
+
defaultOpenItems?: string[];
|
|
1428
|
+
/** Disables all accordion items. */
|
|
1429
|
+
disabled?: boolean;
|
|
1430
|
+
/** Explicit ID. If omitted, generated via useId(). */
|
|
1431
|
+
id?: string;
|
|
1432
|
+
/** Additional aria-describedby IDs to merge with internal description/error IDs. */
|
|
1433
|
+
ariaDescribedBy?: string;
|
|
1434
|
+
/** Data attributes for AI-friendly metadata (used by context variants). */
|
|
1435
|
+
dataAttributes?: Record<string, string>;
|
|
1436
|
+
}
|
|
1437
|
+
declare function AccordionField(props: AccordionFieldProps): React.ReactElement;
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* Purpose Components — Accordion
|
|
618
1441
|
*
|
|
619
|
-
*
|
|
620
|
-
*
|
|
621
|
-
*
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
*
|
|
626
|
-
* ```
|
|
1442
|
+
* Pre-configured accordion compositions that encode a specific semantic purpose.
|
|
1443
|
+
* Each sets `data-purpose` for machine-readable intent while keeping the
|
|
1444
|
+
* visual `variant` prop for presentation only.
|
|
1445
|
+
*/
|
|
1446
|
+
type FAQAccordionProps = Omit<AccordionFieldProps, "multiple">;
|
|
1447
|
+
/**
|
|
1448
|
+
* FAQAccordion - For question-and-answer sections.
|
|
627
1449
|
*
|
|
628
|
-
*
|
|
1450
|
+
* **AI Context:**
|
|
1451
|
+
* - Enforces single-open behaviour (opening one closes others)
|
|
1452
|
+
* - Adds `data-purpose="faq"` for AI parsing
|
|
1453
|
+
* - Ideal for FAQ pages, help sections, knowledge bases
|
|
1454
|
+
*
|
|
1455
|
+
* @example
|
|
629
1456
|
* ```tsx
|
|
630
|
-
*
|
|
1457
|
+
* import { FAQAccordion } from "@marwes-ui/react";
|
|
631
1458
|
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
1459
|
+
* export function Example() {
|
|
1460
|
+
* return (
|
|
1461
|
+
* <FAQAccordion
|
|
1462
|
+
* label="Frequently Asked Questions"
|
|
1463
|
+
* items={[
|
|
1464
|
+
* { value: "q1", title: "What is Marwes?", content: <p>A design system.</p> },
|
|
1465
|
+
* { value: "q2", title: "Is it free?", content: <p>Yes.</p> },
|
|
1466
|
+
* ]}
|
|
1467
|
+
* defaultOpenItems={["q1"]}
|
|
1468
|
+
* />
|
|
1469
|
+
* );
|
|
1470
|
+
* }
|
|
639
1471
|
* ```
|
|
1472
|
+
*/
|
|
1473
|
+
declare function FAQAccordion(props: FAQAccordionProps): React.ReactElement;
|
|
1474
|
+
type SettingsAccordionProps = Omit<AccordionFieldProps, "multiple">;
|
|
1475
|
+
/**
|
|
1476
|
+
* SettingsAccordion - For configuration and settings panels.
|
|
640
1477
|
*
|
|
641
|
-
*
|
|
1478
|
+
* **AI Context:**
|
|
1479
|
+
* - Enforces multi-open behaviour (multiple sections open simultaneously)
|
|
1480
|
+
* - Adds `data-purpose="settings"` for AI parsing
|
|
1481
|
+
* - Ideal for preferences, admin panels, configuration forms
|
|
1482
|
+
*
|
|
1483
|
+
* @example
|
|
642
1484
|
* ```tsx
|
|
643
|
-
*
|
|
644
|
-
* const [mixed, setMixed] = React.useState(true);
|
|
1485
|
+
* import { SettingsAccordion } from "@marwes-ui/react";
|
|
645
1486
|
*
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
*
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
1487
|
+
* export function Example() {
|
|
1488
|
+
* return (
|
|
1489
|
+
* <SettingsAccordion
|
|
1490
|
+
* label="Account Settings"
|
|
1491
|
+
* items={[
|
|
1492
|
+
* { value: "profile", title: "Profile", content: <ProfileForm /> },
|
|
1493
|
+
* { value: "notifications", title: "Notifications", content: <NotificationsForm /> },
|
|
1494
|
+
* { value: "privacy", title: "Privacy", content: <PrivacyForm /> },
|
|
1495
|
+
* ]}
|
|
1496
|
+
* />
|
|
1497
|
+
* );
|
|
1498
|
+
* }
|
|
658
1499
|
* ```
|
|
1500
|
+
*/
|
|
1501
|
+
declare function SettingsAccordion(props: SettingsAccordionProps): React.ReactElement;
|
|
1502
|
+
type SectionsAccordionProps = AccordionFieldProps;
|
|
1503
|
+
/**
|
|
1504
|
+
* SectionsAccordion - For generic collapsible content sections.
|
|
659
1505
|
*
|
|
660
|
-
*
|
|
1506
|
+
* **AI Context:**
|
|
1507
|
+
* - Same API as `AccordionField` with `data-purpose="sections"` for AI parsing
|
|
1508
|
+
* - Defaults to multi-open but can be overridden with `multiple={false}`
|
|
1509
|
+
* - Use when no more specific purpose component fits
|
|
1510
|
+
* - Documentation, product details, order breakdowns
|
|
1511
|
+
*
|
|
1512
|
+
* @example
|
|
661
1513
|
* ```tsx
|
|
662
|
-
*
|
|
663
|
-
* ariaDescribedBy="my-extra-help"
|
|
664
|
-
* label="Enable telemetry"
|
|
665
|
-
* description="Helps us improve the product."
|
|
666
|
-
* checkbox={{}}
|
|
667
|
-
* />
|
|
1514
|
+
* import { SectionsAccordion } from "@marwes-ui/react";
|
|
668
1515
|
*
|
|
669
|
-
*
|
|
1516
|
+
* export function Example() {
|
|
1517
|
+
* return (
|
|
1518
|
+
* <SectionsAccordion
|
|
1519
|
+
* label="Product Details"
|
|
1520
|
+
* items={[
|
|
1521
|
+
* { value: "desc", title: "Description", content: <p>Full description.</p> },
|
|
1522
|
+
* { value: "specs", title: "Specifications", content: <SpecsTable /> },
|
|
1523
|
+
* { value: "reviews", title: "Reviews", content: <ReviewsList /> },
|
|
1524
|
+
* ]}
|
|
1525
|
+
* />
|
|
1526
|
+
* );
|
|
1527
|
+
* }
|
|
670
1528
|
* ```
|
|
671
1529
|
*/
|
|
672
|
-
declare function
|
|
1530
|
+
declare function SectionsAccordion(props: SectionsAccordionProps): React.ReactElement;
|
|
673
1531
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
1532
|
+
/**
|
|
1533
|
+
* React adapter for Marwes Radio.
|
|
1534
|
+
* - Renders a native <input type="radio"> using the core render kit.
|
|
1535
|
+
* - Applies strict a11y fields and modifier classes.
|
|
1536
|
+
*/
|
|
1537
|
+
|
|
1538
|
+
type RadioProps = RadioOptions & {
|
|
1539
|
+
/**
|
|
1540
|
+
* Called with the next checked value when the user selects this radio.
|
|
1541
|
+
* In a group, only the newly selected radio fires `true`.
|
|
1542
|
+
*/
|
|
1543
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1544
|
+
/** Raw event access escape hatch. */
|
|
1545
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
687
1546
|
};
|
|
688
1547
|
/**
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
* A convenient, accessible wrapper around `Input` that provides:
|
|
692
|
-
* - a visible `<label>` wired via `htmlFor`/`id`
|
|
693
|
-
* - optional `helperText` and `error` regions
|
|
694
|
-
* - automatic `aria-describedby` wiring (helperText + error + any external ids)
|
|
695
|
-
* - automatic invalid state when `error` is present
|
|
1548
|
+
* Radio (Atom)
|
|
696
1549
|
*
|
|
697
|
-
*
|
|
698
|
-
*
|
|
1550
|
+
* Low-level radio control built on a native `<input type="radio">`.
|
|
1551
|
+
* Use this when you need custom layout or when the label/grouping is handled
|
|
1552
|
+
* elsewhere (e.g. inside a list item, table row, or custom field wrapper).
|
|
699
1553
|
*
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
* - Always renders a visible `<label>` element connected to the input control.
|
|
703
|
-
* - When `helperText` and/or `error` are present, it sets `aria-describedby`
|
|
704
|
-
* on the input to reference their ids.
|
|
705
|
-
* - When `error` is present, the input is marked invalid (aria-invalid).
|
|
706
|
-
* - Error region has `aria-live="polite"` for screen reader announcements.
|
|
1554
|
+
* For most forms, prefer `RadioGroupField`, which composes `Radio` with
|
|
1555
|
+
* group label/description/error wiring, selection state, and consistent spacing.
|
|
707
1556
|
*
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
*
|
|
1557
|
+
* **AI Context:**
|
|
1558
|
+
* - Renders a native `<input type="radio">` using the core `radioRecipe`
|
|
1559
|
+
* - Applies strict a11y attributes: `aria-label`, `aria-labelledby`, `aria-describedby`, `aria-invalid`
|
|
1560
|
+
* - Supports controlled (`checked` + `onCheckedChange`) and uncontrolled (`defaultChecked`) modes
|
|
1561
|
+
* - Modifier classes: `mw-radio`, `mw-radio--disabled`, `mw-radio--invalid`
|
|
1562
|
+
*
|
|
1563
|
+
* Accessibility:
|
|
1564
|
+
* - Provide **either** `ariaLabel` **or** `ariaLabelledBy` (or wrap with a `<label htmlFor>`).
|
|
1565
|
+
* - Use the same `name` attribute on all radios in a group for native keyboard navigation.
|
|
1566
|
+
* - Use `ariaDescribedBy` to connect supporting text (help/error).
|
|
715
1567
|
*
|
|
716
|
-
* @example
|
|
1568
|
+
* @example Basic (uncontrolled)
|
|
717
1569
|
* ```tsx
|
|
718
|
-
* <
|
|
719
|
-
* label="Username"
|
|
720
|
-
* helperText="Choose a unique username between 3-20 characters."
|
|
721
|
-
* input={{ type: "text", placeholder: "johnsmith" }}
|
|
722
|
-
* />
|
|
1570
|
+
* <Radio ariaLabel="Option A" name="preference" defaultChecked />
|
|
723
1571
|
* ```
|
|
724
1572
|
*
|
|
725
|
-
* @example
|
|
1573
|
+
* @example Controlled
|
|
726
1574
|
* ```tsx
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
1575
|
+
* const [selected, setSelected] = React.useState("a");
|
|
1576
|
+
*
|
|
1577
|
+
* <Radio
|
|
1578
|
+
* name="color"
|
|
1579
|
+
* value="a"
|
|
1580
|
+
* checked={selected === "a"}
|
|
1581
|
+
* onCheckedChange={(checked) => { if (checked) setSelected("a"); }}
|
|
1582
|
+
* ariaLabel="Red"
|
|
731
1583
|
* />
|
|
732
1584
|
* ```
|
|
733
1585
|
*
|
|
734
|
-
* @example
|
|
1586
|
+
* @example With external label
|
|
735
1587
|
* ```tsx
|
|
736
|
-
* const
|
|
1588
|
+
* const id = "opt-1";
|
|
737
1589
|
*
|
|
738
|
-
* <
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
*
|
|
742
|
-
* value: email,
|
|
743
|
-
* onValueChange: setEmail,
|
|
744
|
-
* }}
|
|
745
|
-
* />
|
|
1590
|
+
* <div style={{ display: "flex", alignItems: "center", gap: 8 }}>
|
|
1591
|
+
* <Radio id={id} name="group" value="a" />
|
|
1592
|
+
* <label htmlFor={id}>Option A</label>
|
|
1593
|
+
* </div>
|
|
746
1594
|
* ```
|
|
747
1595
|
*
|
|
748
|
-
* @example
|
|
1596
|
+
* @example In a group (manual)
|
|
749
1597
|
* ```tsx
|
|
750
|
-
*
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
*
|
|
1598
|
+
* const [selected, setSelected] = React.useState("a");
|
|
1599
|
+
* const options = [
|
|
1600
|
+
* { value: "a", label: "Option A" },
|
|
1601
|
+
* { value: "b", label: "Option B" },
|
|
1602
|
+
* ];
|
|
1603
|
+
*
|
|
1604
|
+
* <div role="radiogroup" aria-label="Preference">
|
|
1605
|
+
* {options.map(({ value, label }) => (
|
|
1606
|
+
* <label key={value}>
|
|
1607
|
+
* <Radio
|
|
1608
|
+
* name="preference"
|
|
1609
|
+
* value={value}
|
|
1610
|
+
* checked={selected === value}
|
|
1611
|
+
* onCheckedChange={(checked) => { if (checked) setSelected(value); }}
|
|
1612
|
+
* />
|
|
1613
|
+
* {label}
|
|
1614
|
+
* </label>
|
|
1615
|
+
* ))}
|
|
1616
|
+
* </div>
|
|
755
1617
|
* ```
|
|
1618
|
+
*/
|
|
1619
|
+
declare function Radio(props: RadioProps): React.ReactElement;
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* RadioGroupField (Molecule) — Recommended
|
|
756
1623
|
*
|
|
757
|
-
*
|
|
1624
|
+
* An accessible radio group with field semantics: group label, optional
|
|
1625
|
+
* description, optional error, and selection state management.
|
|
1626
|
+
*
|
|
1627
|
+
* Composes `Radio` atoms into a `role="radiogroup"` container with:
|
|
1628
|
+
* - a visible label wired via `aria-labelledby`
|
|
1629
|
+
* - optional `description` and `error` regions
|
|
1630
|
+
* - automatic `aria-describedby` wiring (description + error + external IDs)
|
|
1631
|
+
* - automatic `aria-invalid` when `error` is present
|
|
1632
|
+
* - controlled (`value` + `onChange`) or uncontrolled (`defaultValue`) state
|
|
1633
|
+
*
|
|
1634
|
+
* Use `RadioGroupField` for most forms. Use `Radio` directly only when you
|
|
1635
|
+
* need a highly custom layout (tables, list rows, compound list items, etc.).
|
|
1636
|
+
*
|
|
1637
|
+
* **AI Context:**
|
|
1638
|
+
* - Renders `role="radiogroup"` with proper ARIA wiring
|
|
1639
|
+
* - Manages selection state for child Radio atoms
|
|
1640
|
+
* - All child radios share the same `name` for native keyboard navigation
|
|
1641
|
+
* - Supports both controlled and uncontrolled patterns
|
|
1642
|
+
*
|
|
1643
|
+
* @example Basic (uncontrolled)
|
|
758
1644
|
* ```tsx
|
|
759
|
-
* <
|
|
760
|
-
*
|
|
761
|
-
*
|
|
1645
|
+
* <RadioGroupField
|
|
1646
|
+
* name="color"
|
|
1647
|
+
* label="Favorite color"
|
|
1648
|
+
* options={[
|
|
1649
|
+
* { value: "red", label: "Red" },
|
|
1650
|
+
* { value: "blue", label: "Blue" },
|
|
1651
|
+
* { value: "green", label: "Green" },
|
|
1652
|
+
* ]}
|
|
1653
|
+
* defaultValue="red"
|
|
762
1654
|
* />
|
|
763
1655
|
* ```
|
|
764
|
-
*
|
|
765
|
-
* @example
|
|
766
|
-
* ```tsx
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
*
|
|
1656
|
+
*
|
|
1657
|
+
* @example Controlled
|
|
1658
|
+
* ```tsx
|
|
1659
|
+
* const [color, setColor] = React.useState("red");
|
|
1660
|
+
*
|
|
1661
|
+
* <RadioGroupField
|
|
1662
|
+
* name="color"
|
|
1663
|
+
* label="Favorite color"
|
|
1664
|
+
* options={[
|
|
1665
|
+
* { value: "red", label: "Red" },
|
|
1666
|
+
* { value: "blue", label: "Blue" },
|
|
1667
|
+
* ]}
|
|
1668
|
+
* value={color}
|
|
1669
|
+
* onChange={setColor}
|
|
772
1670
|
* />
|
|
1671
|
+
* ```
|
|
773
1672
|
*
|
|
774
|
-
*
|
|
1673
|
+
* @example With description and error
|
|
1674
|
+
* ```tsx
|
|
1675
|
+
* <RadioGroupField
|
|
1676
|
+
* name="plan"
|
|
1677
|
+
* label="Select a plan"
|
|
1678
|
+
* description="Choose the plan that best fits your needs."
|
|
1679
|
+
* error="Please select a plan to continue."
|
|
1680
|
+
* options={[
|
|
1681
|
+
* { value: "free", label: "Free" },
|
|
1682
|
+
* { value: "pro", label: "Pro" },
|
|
1683
|
+
* ]}
|
|
1684
|
+
* />
|
|
775
1685
|
* ```
|
|
776
1686
|
*/
|
|
777
|
-
|
|
1687
|
+
|
|
1688
|
+
interface RadioGroupFieldOption {
|
|
1689
|
+
value: string;
|
|
1690
|
+
label: React.ReactNode;
|
|
1691
|
+
disabled?: boolean;
|
|
1692
|
+
}
|
|
1693
|
+
interface RadioGroupFieldProps {
|
|
1694
|
+
/** Shared name for all radio inputs in the group. */
|
|
1695
|
+
name: string;
|
|
1696
|
+
/** Visible label for the radio group. */
|
|
1697
|
+
label: React.ReactNode;
|
|
1698
|
+
/** Optional description text below the label. */
|
|
1699
|
+
description?: React.ReactNode;
|
|
1700
|
+
/** Error message. When present, sets aria-invalid on the group. */
|
|
1701
|
+
error?: React.ReactNode;
|
|
1702
|
+
/** Controlled: current selected value. */
|
|
1703
|
+
value?: string;
|
|
1704
|
+
/** Controlled: called with the new value when selection changes. */
|
|
1705
|
+
onChange?: (value: string) => void;
|
|
1706
|
+
/** Uncontrolled: initial selected value. */
|
|
1707
|
+
defaultValue?: string;
|
|
1708
|
+
/** Radio options to render. */
|
|
1709
|
+
options: RadioGroupFieldOption[];
|
|
1710
|
+
/** Disables all radio inputs in the group. */
|
|
1711
|
+
disabled?: boolean;
|
|
1712
|
+
/** Marks the group as required. */
|
|
1713
|
+
required?: boolean;
|
|
1714
|
+
/** Explicit ID. If omitted, generated via useId(). */
|
|
1715
|
+
id?: string;
|
|
1716
|
+
/** Additional aria-describedby IDs to merge with internal description/error IDs. */
|
|
1717
|
+
ariaDescribedBy?: string;
|
|
1718
|
+
/** Data attributes for AI-friendly metadata (used by context variants). */
|
|
1719
|
+
dataAttributes?: Record<string, string>;
|
|
1720
|
+
}
|
|
1721
|
+
declare function RadioGroupField(props: RadioGroupFieldProps): React.ReactElement;
|
|
778
1722
|
|
|
779
1723
|
/**
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
* These variants encode best practices and automatically set AI-friendly
|
|
783
|
-
* metadata, making it easier for both developers and AI tools to understand
|
|
784
|
-
* the purpose and behavior of each field.
|
|
1724
|
+
* Purpose Components — Radio Group
|
|
785
1725
|
*
|
|
786
|
-
*
|
|
787
|
-
*
|
|
1726
|
+
* Pre-configured radio group compositions that encode a specific semantic purpose.
|
|
1727
|
+
* Each sets `data-purpose` for machine-readable intent while keeping the
|
|
1728
|
+
* visual `variant` prop for presentation only.
|
|
788
1729
|
*/
|
|
789
|
-
type
|
|
790
|
-
/**
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
1730
|
+
type YesNoRadioGroupProps = Omit<RadioGroupFieldProps, "options"> & {
|
|
1731
|
+
/** Label for the "Yes" option. Defaults to "Yes". */
|
|
1732
|
+
yesLabel?: React.ReactNode;
|
|
1733
|
+
/** Label for the "No" option. Defaults to "No". */
|
|
1734
|
+
noLabel?: React.ReactNode;
|
|
794
1735
|
};
|
|
795
1736
|
/**
|
|
796
|
-
*
|
|
1737
|
+
* YesNoRadioGroup - For binary yes/no choices.
|
|
797
1738
|
*
|
|
798
1739
|
* **AI Context:**
|
|
799
|
-
* -
|
|
800
|
-
* -
|
|
801
|
-
* -
|
|
802
|
-
* - Adds `data-purpose="search"` for AI parsing
|
|
803
|
-
*
|
|
804
|
-
* **Features:**
|
|
805
|
-
* - Automatic clear button that appears when typing
|
|
806
|
-
* - Native search input behavior
|
|
807
|
-
* - Optimized mobile keyboard
|
|
808
|
-
* - Controlled and uncontrolled modes supported
|
|
1740
|
+
* - Pre-built options with values `"yes"` and `"no"`
|
|
1741
|
+
* - Adds `data-purpose="binary-choice"` for AI parsing
|
|
1742
|
+
* - Labels customizable via `yesLabel` / `noLabel`
|
|
809
1743
|
*
|
|
810
|
-
* @example
|
|
1744
|
+
* @example
|
|
811
1745
|
* ```tsx
|
|
812
|
-
* import {
|
|
1746
|
+
* import { YesNoRadioGroup } from "@marwes-ui/react";
|
|
813
1747
|
*
|
|
814
1748
|
* export function Example() {
|
|
815
|
-
* const [query, setQuery] = React.useState("");
|
|
816
1749
|
* return (
|
|
817
|
-
* <
|
|
818
|
-
*
|
|
819
|
-
*
|
|
1750
|
+
* <YesNoRadioGroup
|
|
1751
|
+
* name="accept-terms"
|
|
1752
|
+
* label="Do you accept the terms?"
|
|
1753
|
+
* defaultValue="no"
|
|
820
1754
|
* />
|
|
821
1755
|
* );
|
|
822
1756
|
* }
|
|
823
1757
|
* ```
|
|
1758
|
+
*
|
|
1759
|
+
* @example Custom labels
|
|
1760
|
+
* ```tsx
|
|
1761
|
+
* <YesNoRadioGroup
|
|
1762
|
+
* name="newsletter"
|
|
1763
|
+
* label="Subscribe to newsletter?"
|
|
1764
|
+
* yesLabel="Subscribe"
|
|
1765
|
+
* noLabel="No thanks"
|
|
1766
|
+
* />
|
|
1767
|
+
* ```
|
|
824
1768
|
*/
|
|
825
|
-
declare function
|
|
826
|
-
type
|
|
827
|
-
/**
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
/**
|
|
832
|
-
|
|
833
|
-
* Defaults to "current-password"
|
|
834
|
-
*/
|
|
835
|
-
autoComplete?: "current-password" | "new-password";
|
|
1769
|
+
declare function YesNoRadioGroup(props: YesNoRadioGroupProps): React.ReactElement;
|
|
1770
|
+
type RatingRadioGroupProps = Omit<RadioGroupFieldProps, "options"> & {
|
|
1771
|
+
/** Minimum value (inclusive). Defaults to 1. */
|
|
1772
|
+
min?: number;
|
|
1773
|
+
/** Maximum value (inclusive). Defaults to 5. */
|
|
1774
|
+
max?: number;
|
|
1775
|
+
/** Custom label function. Receives the numeric value, returns a label. Defaults to `String(value)`. */
|
|
1776
|
+
labelFn?: (value: number) => React.ReactNode;
|
|
836
1777
|
};
|
|
837
1778
|
/**
|
|
838
|
-
*
|
|
1779
|
+
* RatingRadioGroup - For numeric scale selections.
|
|
839
1780
|
*
|
|
840
1781
|
* **AI Context:**
|
|
841
|
-
* -
|
|
842
|
-
* -
|
|
843
|
-
* -
|
|
844
|
-
* -
|
|
1782
|
+
* - Generates options from `min` to `max` (default 1–5)
|
|
1783
|
+
* - Values are string representations of numbers ("1", "2", etc.)
|
|
1784
|
+
* - Adds `data-purpose="rating"` for AI parsing
|
|
1785
|
+
* - Custom labels via `labelFn`
|
|
845
1786
|
*
|
|
846
|
-
*
|
|
847
|
-
* - Automatic show/hide toggle with eye icon
|
|
848
|
-
* - Proper autocomplete for password managers
|
|
849
|
-
* - Accessible toggle button with clear labels
|
|
850
|
-
* - Controlled and uncontrolled modes supported
|
|
851
|
-
*
|
|
852
|
-
* @example Basic usage
|
|
1787
|
+
* @example
|
|
853
1788
|
* ```tsx
|
|
854
|
-
* import {
|
|
1789
|
+
* import { RatingRadioGroup } from "@marwes-ui/react";
|
|
855
1790
|
*
|
|
856
1791
|
* export function Example() {
|
|
857
|
-
* const [password, setPassword] = React.useState("");
|
|
858
1792
|
* return (
|
|
859
|
-
* <
|
|
860
|
-
*
|
|
861
|
-
*
|
|
1793
|
+
* <RatingRadioGroup
|
|
1794
|
+
* name="satisfaction"
|
|
1795
|
+
* label="How satisfied are you?"
|
|
1796
|
+
* defaultValue="3"
|
|
862
1797
|
* />
|
|
863
1798
|
* );
|
|
864
1799
|
* }
|
|
865
1800
|
* ```
|
|
866
1801
|
*
|
|
867
|
-
* @example
|
|
1802
|
+
* @example Custom range and labels
|
|
868
1803
|
* ```tsx
|
|
869
|
-
* <
|
|
870
|
-
*
|
|
871
|
-
*
|
|
872
|
-
*
|
|
1804
|
+
* <RatingRadioGroup
|
|
1805
|
+
* name="priority"
|
|
1806
|
+
* label="Priority level"
|
|
1807
|
+
* min={1}
|
|
1808
|
+
* max={3}
|
|
1809
|
+
* labelFn={(v) => ["Low", "Medium", "High"][v - 1]}
|
|
873
1810
|
* />
|
|
874
1811
|
* ```
|
|
875
1812
|
*/
|
|
876
|
-
declare function
|
|
877
|
-
type
|
|
878
|
-
/**
|
|
879
|
-
* Input-specific props (type, inputMode, autoComplete auto-set)
|
|
880
|
-
*/
|
|
881
|
-
input?: Omit<InputProps, "type" | "inputMode" | "autoComplete">;
|
|
882
|
-
};
|
|
1813
|
+
declare function RatingRadioGroup(props: RatingRadioGroupProps): React.ReactElement;
|
|
1814
|
+
type OptionRadioGroupProps = RadioGroupFieldProps;
|
|
883
1815
|
/**
|
|
884
|
-
*
|
|
1816
|
+
* OptionRadioGroup - For general labeled option selection.
|
|
885
1817
|
*
|
|
886
1818
|
* **AI Context:**
|
|
887
|
-
* -
|
|
888
|
-
* -
|
|
889
|
-
* -
|
|
890
|
-
* - Adds `data-purpose="email"` for AI parsing
|
|
891
|
-
*
|
|
892
|
-
* **Features:**
|
|
893
|
-
* - Browser email validation
|
|
894
|
-
* - Email-optimized mobile keyboard
|
|
895
|
-
* - Autofill support for email addresses
|
|
1819
|
+
* - Same API as `RadioGroupField` with `data-purpose="selection"` for AI parsing
|
|
1820
|
+
* - Use when no more specific purpose component fits
|
|
1821
|
+
* - Preferences, categories, modes, or any custom option list
|
|
896
1822
|
*
|
|
897
1823
|
* @example
|
|
898
1824
|
* ```tsx
|
|
899
|
-
* import {
|
|
1825
|
+
* import { OptionRadioGroup } from "@marwes-ui/react";
|
|
900
1826
|
*
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
*
|
|
1827
|
+
* export function Example() {
|
|
1828
|
+
* return (
|
|
1829
|
+
* <OptionRadioGroup
|
|
1830
|
+
* name="theme"
|
|
1831
|
+
* label="Select theme"
|
|
1832
|
+
* options={[
|
|
1833
|
+
* { value: "light", label: "Light" },
|
|
1834
|
+
* { value: "dark", label: "Dark" },
|
|
1835
|
+
* { value: "system", label: "System" },
|
|
1836
|
+
* ]}
|
|
1837
|
+
* defaultValue="system"
|
|
1838
|
+
* />
|
|
1839
|
+
* );
|
|
1840
|
+
* }
|
|
905
1841
|
* ```
|
|
906
1842
|
*/
|
|
907
|
-
declare function
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1843
|
+
declare function OptionRadioGroup(props: OptionRadioGroupProps): React.ReactElement;
|
|
1844
|
+
|
|
1845
|
+
type BadgeProps = BadgeOptions & {
|
|
1846
|
+
children?: React.ReactNode;
|
|
1847
|
+
className?: string;
|
|
1848
|
+
id?: string;
|
|
1849
|
+
/** Data attributes for AI-friendly metadata (used by context variants). */
|
|
1850
|
+
dataAttributes?: Record<string, string>;
|
|
913
1851
|
};
|
|
1852
|
+
declare function Badge(props: BadgeProps): React.ReactElement;
|
|
1853
|
+
|
|
914
1854
|
/**
|
|
915
|
-
*
|
|
1855
|
+
* BadgeGroup (Molecule) — Recommended
|
|
916
1856
|
*
|
|
917
|
-
*
|
|
918
|
-
*
|
|
919
|
-
* - Sets `inputMode="tel"` for phone keyboard
|
|
920
|
-
* - Sets `autoComplete="tel"` for autofill
|
|
921
|
-
* - Adds `data-purpose="phone"` for AI parsing
|
|
1857
|
+
* An accessible badge group with a visible label. Groups related badges
|
|
1858
|
+
* into a `role="group"` container with `aria-labelledby` wiring.
|
|
922
1859
|
*
|
|
923
|
-
*
|
|
924
|
-
*
|
|
925
|
-
*
|
|
926
|
-
* - Accepts any phone format (formatting should be done externally)
|
|
1860
|
+
* Use `BadgeGroup` when displaying multiple related badges together
|
|
1861
|
+
* (e.g. a list of tags, status indicators, or categories).
|
|
1862
|
+
* Use `Badge` directly only when a single standalone badge is needed.
|
|
927
1863
|
*
|
|
928
1864
|
* @example
|
|
929
1865
|
* ```tsx
|
|
930
|
-
* import {
|
|
1866
|
+
* import { BadgeVariant } from "@marwes-ui/core";
|
|
931
1867
|
*
|
|
932
|
-
* <
|
|
933
|
-
*
|
|
934
|
-
*
|
|
935
|
-
*
|
|
1868
|
+
* <BadgeGroup label="Status">
|
|
1869
|
+
* <Badge variant={BadgeVariant.success}>Active</Badge>
|
|
1870
|
+
* <Badge variant={BadgeVariant.warning}>Pending review</Badge>
|
|
1871
|
+
* </BadgeGroup>
|
|
936
1872
|
* ```
|
|
937
1873
|
*/
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
/**
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1874
|
+
|
|
1875
|
+
interface BadgeGroupProps {
|
|
1876
|
+
/** Visible label for the badge group. */
|
|
1877
|
+
label: React.ReactNode;
|
|
1878
|
+
/** Badge children to render inside the group. */
|
|
1879
|
+
children: React.ReactNode;
|
|
1880
|
+
/** Additional CSS class names. */
|
|
1881
|
+
className?: string;
|
|
1882
|
+
/** Explicit ID. If omitted, generated via useId(). */
|
|
1883
|
+
id?: string;
|
|
1884
|
+
/** Data attributes for AI-friendly metadata (used by context variants). */
|
|
1885
|
+
dataAttributes?: Record<string, string>;
|
|
1886
|
+
}
|
|
1887
|
+
declare function BadgeGroup(props: BadgeGroupProps): React.ReactElement;
|
|
1888
|
+
|
|
945
1889
|
/**
|
|
946
|
-
*
|
|
1890
|
+
* Purpose Components — Badge
|
|
947
1891
|
*
|
|
948
|
-
*
|
|
949
|
-
*
|
|
950
|
-
*
|
|
951
|
-
|
|
952
|
-
|
|
1892
|
+
* Pre-configured badge compositions that encode a specific semantic purpose.
|
|
1893
|
+
* Each sets `data-purpose` for machine-readable intent while keeping the
|
|
1894
|
+
* visual `variant` prop for presentation only.
|
|
1895
|
+
*/
|
|
1896
|
+
|
|
1897
|
+
type StatusBadgeProps = BadgeProps;
|
|
1898
|
+
/**
|
|
1899
|
+
* StatusBadge - For operational or lifecycle status indicators.
|
|
953
1900
|
*
|
|
954
|
-
* **
|
|
955
|
-
* -
|
|
956
|
-
* -
|
|
957
|
-
* - Autofill support for URLs
|
|
1901
|
+
* **AI Context:**
|
|
1902
|
+
* - Adds `data-purpose="status"` for AI parsing
|
|
1903
|
+
* - Ideal for active/inactive, online/offline, enabled/disabled states
|
|
958
1904
|
*
|
|
959
1905
|
* @example
|
|
960
1906
|
* ```tsx
|
|
961
|
-
* import {
|
|
1907
|
+
* import { BadgeVariant } from "@marwes-ui/core";
|
|
962
1908
|
*
|
|
963
|
-
* <
|
|
964
|
-
*
|
|
965
|
-
* input={{ placeholder: "https://example.com" }}
|
|
966
|
-
* />
|
|
1909
|
+
* <StatusBadge variant={BadgeVariant.success}>Active</StatusBadge>
|
|
1910
|
+
* <StatusBadge variant={BadgeVariant.error}>Offline</StatusBadge>
|
|
967
1911
|
* ```
|
|
968
1912
|
*/
|
|
969
|
-
declare function
|
|
970
|
-
type
|
|
971
|
-
/**
|
|
972
|
-
* Input-specific props (type, inputMode auto-set)
|
|
973
|
-
*/
|
|
974
|
-
input?: Omit<InputProps, "type" | "inputMode">;
|
|
975
|
-
/**
|
|
976
|
-
* Currency code (e.g., "USD", "EUR", "GBP")
|
|
977
|
-
* Used for helper text and context
|
|
978
|
-
*/
|
|
979
|
-
currency?: string;
|
|
980
|
-
};
|
|
1913
|
+
declare function StatusBadge(props: StatusBadgeProps): React.ReactElement;
|
|
1914
|
+
type PriorityBadgeProps = BadgeProps;
|
|
981
1915
|
/**
|
|
982
|
-
*
|
|
1916
|
+
* PriorityBadge - For urgency or importance indicators.
|
|
983
1917
|
*
|
|
984
1918
|
* **AI Context:**
|
|
985
|
-
* -
|
|
986
|
-
* -
|
|
987
|
-
* - Adds currency code to helper text if provided
|
|
988
|
-
* - Adds `data-purpose="currency"` and `data-currency` for AI parsing
|
|
1919
|
+
* - Adds `data-purpose="priority"` for AI parsing
|
|
1920
|
+
* - Ideal for critical/high/medium/low priority labels
|
|
989
1921
|
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
*
|
|
994
|
-
*
|
|
1922
|
+
* @example
|
|
1923
|
+
* ```tsx
|
|
1924
|
+
* import { BadgeVariant } from "@marwes-ui/core";
|
|
1925
|
+
*
|
|
1926
|
+
* <PriorityBadge variant={BadgeVariant.error}>Critical</PriorityBadge>
|
|
1927
|
+
* <PriorityBadge variant={BadgeVariant.warning}>High</PriorityBadge>
|
|
1928
|
+
* ```
|
|
1929
|
+
*/
|
|
1930
|
+
declare function PriorityBadge(props: PriorityBadgeProps): React.ReactElement;
|
|
1931
|
+
type NotificationBadgeProps = BadgeProps;
|
|
1932
|
+
/**
|
|
1933
|
+
* NotificationBadge - For notification counts and alert indicators.
|
|
1934
|
+
*
|
|
1935
|
+
* **AI Context:**
|
|
1936
|
+
* - Adds `data-purpose="notification"` for AI parsing
|
|
1937
|
+
* - Ideal for unread counts, new items, alert badges
|
|
1938
|
+
* - Always provide `ariaLabel` for numeric-only content
|
|
995
1939
|
*
|
|
996
1940
|
* @example
|
|
997
1941
|
* ```tsx
|
|
998
|
-
* import {
|
|
1942
|
+
* import { BadgeVariant } from "@marwes-ui/core";
|
|
999
1943
|
*
|
|
1000
|
-
* <
|
|
1001
|
-
* label="Amount"
|
|
1002
|
-
* currency="USD"
|
|
1003
|
-
* input={{ placeholder: "0.00" }}
|
|
1004
|
-
* />
|
|
1944
|
+
* <NotificationBadge variant={BadgeVariant.info} ariaLabel="5 unread messages">5</NotificationBadge>
|
|
1005
1945
|
* ```
|
|
1006
1946
|
*/
|
|
1007
|
-
declare function
|
|
1947
|
+
declare function NotificationBadge(props: NotificationBadgeProps): React.ReactElement;
|
|
1948
|
+
|
|
1949
|
+
type SwitchProps = SwitchOptions & {
|
|
1950
|
+
/** Label text rendered next to the toggle */
|
|
1951
|
+
children?: React.ReactNode;
|
|
1952
|
+
className?: string;
|
|
1953
|
+
id?: string;
|
|
1954
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1955
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
1956
|
+
};
|
|
1957
|
+
declare function Switch(props: SwitchProps): React.ReactElement;
|
|
1958
|
+
|
|
1959
|
+
type SwitchFieldProps = {
|
|
1960
|
+
id?: string;
|
|
1961
|
+
label: React.ReactNode;
|
|
1962
|
+
description?: React.ReactNode;
|
|
1963
|
+
error?: React.ReactNode;
|
|
1964
|
+
switch: SwitchProps;
|
|
1965
|
+
ariaDescribedBy?: string;
|
|
1966
|
+
dataAttributes?: Record<string, string>;
|
|
1967
|
+
};
|
|
1968
|
+
declare function SwitchField(props: SwitchFieldProps): React.ReactElement;
|
|
1969
|
+
|
|
1970
|
+
type FeatureToggleProps = SwitchFieldProps;
|
|
1971
|
+
declare function FeatureToggle(props: FeatureToggleProps): React.ReactElement;
|
|
1972
|
+
type PreferenceSwitchProps = SwitchFieldProps;
|
|
1973
|
+
declare function PreferenceSwitch(props: PreferenceSwitchProps): React.ReactElement;
|
|
1974
|
+
type PermissionSwitchProps = SwitchFieldProps;
|
|
1975
|
+
declare function PermissionSwitch(props: PermissionSwitchProps): React.ReactElement;
|
|
1976
|
+
|
|
1977
|
+
type NativeSliderProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "className" | "defaultValue" | "max" | "min" | "onChange" | "step" | "style" | "type" | "value">;
|
|
1978
|
+
type SliderProps = SliderOptions & NativeSliderProps & {
|
|
1979
|
+
className?: string;
|
|
1980
|
+
style?: React.CSSProperties;
|
|
1981
|
+
onValueChange?: (value: number) => void;
|
|
1982
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
1983
|
+
};
|
|
1984
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderOptions & NativeSliderProps & {
|
|
1985
|
+
className?: string;
|
|
1986
|
+
style?: React.CSSProperties;
|
|
1987
|
+
onValueChange?: (value: number) => void;
|
|
1988
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
1989
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
1990
|
+
|
|
1991
|
+
type SliderFieldLabelPosition = "top" | "inline";
|
|
1992
|
+
type SliderFieldProps = {
|
|
1993
|
+
id?: string;
|
|
1994
|
+
label: React.ReactNode;
|
|
1995
|
+
description?: React.ReactNode;
|
|
1996
|
+
error?: React.ReactNode;
|
|
1997
|
+
slider: SliderProps;
|
|
1998
|
+
ariaDescribedBy?: string;
|
|
1999
|
+
minValueLabel?: React.ReactNode;
|
|
2000
|
+
maxValueLabel?: React.ReactNode;
|
|
2001
|
+
labelPosition?: SliderFieldLabelPosition;
|
|
2002
|
+
showEdgeValues?: boolean;
|
|
2003
|
+
dataAttributes?: Record<string, string>;
|
|
2004
|
+
};
|
|
2005
|
+
declare function SliderField(props: SliderFieldProps): React.ReactElement;
|
|
2006
|
+
|
|
2007
|
+
type SliderFieldPurposeProps = Omit<SliderFieldProps, "label" | "slider" | "minValueLabel" | "maxValueLabel"> & {
|
|
2008
|
+
label?: React.ReactNode;
|
|
2009
|
+
slider?: SliderProps;
|
|
2010
|
+
orientation?: SliderProps["orientation"];
|
|
2011
|
+
minValueLabel?: React.ReactNode;
|
|
2012
|
+
maxValueLabel?: React.ReactNode;
|
|
2013
|
+
};
|
|
2014
|
+
type VolumeSliderProps = SliderFieldPurposeProps;
|
|
2015
|
+
declare function VolumeSlider(props: VolumeSliderProps): React.ReactElement;
|
|
2016
|
+
type BrightnessSliderProps = SliderFieldPurposeProps;
|
|
2017
|
+
declare function BrightnessSlider(props: BrightnessSliderProps): React.ReactElement;
|
|
2018
|
+
type RadiusSliderProps = SliderFieldPurposeProps;
|
|
2019
|
+
declare function RadiusSlider(props: RadiusSliderProps): React.ReactElement;
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* React adapter for Marwes Tab.
|
|
2023
|
+
* - Renders a native <button> using the core render kit.
|
|
2024
|
+
* - Applies strict a11y fields and modifier classes.
|
|
2025
|
+
*/
|
|
2026
|
+
|
|
2027
|
+
type TabProps = TabOptions & {
|
|
2028
|
+
children?: React.ReactNode;
|
|
2029
|
+
className?: string;
|
|
2030
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
2031
|
+
id?: string;
|
|
2032
|
+
};
|
|
2033
|
+
declare function Tab(props: TabProps): React.ReactElement;
|
|
2034
|
+
|
|
2035
|
+
interface TabGroupItem {
|
|
2036
|
+
value: string;
|
|
2037
|
+
label: React.ReactNode;
|
|
2038
|
+
panel: React.ReactNode;
|
|
2039
|
+
disabled?: boolean;
|
|
2040
|
+
ariaLabel?: string;
|
|
2041
|
+
}
|
|
2042
|
+
interface TabGroupProps {
|
|
2043
|
+
id?: string;
|
|
2044
|
+
label?: React.ReactNode;
|
|
2045
|
+
ariaLabel?: string;
|
|
2046
|
+
tabs: TabGroupItem[];
|
|
2047
|
+
activeTab?: string;
|
|
2048
|
+
defaultActiveTab?: string;
|
|
2049
|
+
onActiveTabChange?: (value: string) => void;
|
|
2050
|
+
className?: string;
|
|
2051
|
+
dataAttributes?: Record<string, string>;
|
|
2052
|
+
}
|
|
2053
|
+
interface TabPanelProps {
|
|
2054
|
+
id: string;
|
|
2055
|
+
tabId: string;
|
|
2056
|
+
hidden?: boolean;
|
|
2057
|
+
className?: string;
|
|
2058
|
+
children?: React.ReactNode;
|
|
2059
|
+
}
|
|
2060
|
+
declare function TabPanel(props: TabPanelProps): React.ReactElement;
|
|
2061
|
+
declare function TabGroup(props: TabGroupProps): React.ReactElement;
|
|
2062
|
+
|
|
2063
|
+
type NavigationTabsProps = TabGroupProps;
|
|
2064
|
+
declare function NavigationTabs(props: NavigationTabsProps): React.ReactElement;
|
|
2065
|
+
type ContentTabsProps = TabGroupProps;
|
|
2066
|
+
declare function ContentTabs(props: ContentTabsProps): React.ReactElement;
|
|
2067
|
+
type SettingsTabsProps = TabGroupProps;
|
|
2068
|
+
declare function SettingsTabs(props: SettingsTabsProps): React.ReactElement;
|
|
2069
|
+
|
|
2070
|
+
interface DialogProps extends DialogOptions {
|
|
2071
|
+
id?: string;
|
|
2072
|
+
title?: React.ReactNode;
|
|
2073
|
+
description?: React.ReactNode;
|
|
2074
|
+
footer?: React.ReactNode;
|
|
2075
|
+
children?: React.ReactNode;
|
|
2076
|
+
onClose?: () => void;
|
|
2077
|
+
className?: string;
|
|
2078
|
+
dataAttributes?: Record<string, string>;
|
|
2079
|
+
}
|
|
2080
|
+
declare function Dialog(props: DialogProps): React.ReactElement;
|
|
2081
|
+
|
|
2082
|
+
interface DialogFooterControls {
|
|
2083
|
+
close: () => void;
|
|
2084
|
+
}
|
|
2085
|
+
interface DialogModalProps extends Omit<DialogProps, "footer" | "onClose"> {
|
|
2086
|
+
open?: boolean;
|
|
2087
|
+
defaultOpen?: boolean;
|
|
2088
|
+
onOpenChange?: (open: boolean) => void;
|
|
2089
|
+
closeOnEscape?: boolean;
|
|
2090
|
+
closeOnScrimClick?: boolean;
|
|
2091
|
+
restoreFocus?: boolean;
|
|
2092
|
+
portalTarget?: HTMLElement | null;
|
|
2093
|
+
overlayClassName?: string;
|
|
2094
|
+
footer?: React.ReactNode | ((controls: DialogFooterControls) => React.ReactNode);
|
|
2095
|
+
}
|
|
2096
|
+
declare function DialogModal(props: DialogModalProps): React.ReactElement | null;
|
|
2097
|
+
|
|
2098
|
+
type ConfirmDialogProps = Omit<DialogModalProps, "footer"> & {
|
|
2099
|
+
confirmLabel?: React.ReactNode;
|
|
2100
|
+
cancelLabel?: React.ReactNode;
|
|
2101
|
+
onConfirm?: () => void;
|
|
2102
|
+
onCancel?: () => void;
|
|
2103
|
+
};
|
|
2104
|
+
declare function ConfirmDialog(props: ConfirmDialogProps): React.ReactElement;
|
|
2105
|
+
type DestructiveDialogProps = Omit<DialogModalProps, "footer"> & {
|
|
2106
|
+
confirmLabel?: React.ReactNode;
|
|
2107
|
+
cancelLabel?: React.ReactNode;
|
|
2108
|
+
onConfirm?: () => void;
|
|
2109
|
+
onCancel?: () => void;
|
|
2110
|
+
};
|
|
2111
|
+
declare function DestructiveDialog(props: DestructiveDialogProps): React.ReactElement;
|
|
2112
|
+
type InfoDialogProps = Omit<DialogModalProps, "footer"> & {
|
|
2113
|
+
acknowledgeLabel?: React.ReactNode;
|
|
2114
|
+
onAcknowledge?: () => void;
|
|
2115
|
+
};
|
|
2116
|
+
declare function InfoDialog(props: InfoDialogProps): React.ReactElement;
|
|
1008
2117
|
|
|
1009
|
-
export { Button, type ButtonProps, CancelButton, type CancelButtonProps, Checkbox, CheckboxField, type CheckboxFieldProps, type CheckboxProps, CreateButton, type CreateButtonProps, CurrencyField, type CurrencyFieldProps,
|
|
2118
|
+
export { Accordion, AccordionField, type AccordionFieldItem, type AccordionFieldProps, type AccordionProps, Avatar, AvatarBadge, type AvatarBadgeProps, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, Badge, BadgeGroup, type BadgeGroupProps, type BadgeProps, BrightnessSlider, type BrightnessSliderProps, Button, type ButtonProps, ButtonSpinner, type ButtonSpinnerProps, CancelButton, type CancelButtonProps, Card, type CardProps, Checkbox, CheckboxField, type CheckboxFieldProps, CheckboxGroupField, type CheckboxGroupFieldOption, type CheckboxGroupFieldProps, type CheckboxProps, CloseButton, type CloseButtonProps, ConfirmButton, type ConfirmButtonProps, ConfirmDialog, type ConfirmDialogProps, ContentTabs, type ContentTabsProps, CopyButton, type CopyButtonProps, CreateButton, type CreateButtonProps, CurrencyField, type CurrencyFieldProps, DateOfBirthField, type DateOfBirthFieldProps, DestructiveButton, type DestructiveButtonProps, DestructiveDialog, type DestructiveDialogProps, Dialog, type DialogFooterControls, DialogModal, type DialogModalProps, type DialogProps, Divider, type DividerProps, DownloadButton, type DownloadButtonProps, DropdownButton, type DropdownButtonProps, DropdownField, type DropdownFieldProps, EditButton, type EditButtonProps, EmailField, type EmailFieldProps, EmptyStateSpinner, type EmptyStateSpinnerProps, ErrorToast, type ErrorToastProps, FAQAccordion, type FAQAccordionProps, FeatureToggle, type FeatureToggleProps, FilterButton, type FilterButtonProps, H1, type H1Props, H2, type H2Props, H3, type H3Props, Icon, type IconProps, InfoDialog, type InfoDialogProps, InfoToast, type InfoToastProps, Input, InputField, type InputFieldProps, InputOtp, type InputOtpProps, type InputProps, LinkButton, type LinkButtonProps, type ManagedToast, MarwesProvider, type MarwesProviderProps, NavigationTabs, type NavigationTabsProps, NotificationBadge, type NotificationBadgeProps, OptionRadioGroup, type OptionRadioGroupProps, Paragraph, type ParagraphProps, PasswordField, type PasswordFieldProps, PermissionSwitch, type PermissionSwitchProps, PhoneField, type PhoneFieldProps, PreferenceSwitch, type PreferenceSwitchProps, PresenceAvatar, type PresenceAvatarProps, PrimaryButton, type PrimaryButtonProps, PriorityBadge, type PriorityBadgeProps, ProductCard, type ProductCardProps, ProfileAvatar, type ProfileAvatarProps, ProfileCard, type ProfileCardProps, Radio, RadioGroupField, type RadioGroupFieldOption, type RadioGroupFieldProps, type RadioProps, RadiusSlider, type RadiusSliderProps, RatingRadioGroup, type RatingRadioGroupProps, RefreshButton, type RefreshButtonProps, RichText, RichTextField, type RichTextFieldProps, type RichTextProps, SaveButton, type SaveButtonProps, SearchButton, type SearchButtonProps, SearchField, type SearchFieldProps, SecondaryButton, type SecondaryButtonProps, SectionsAccordion, type SectionsAccordionProps, Select, type SelectAppearance, SelectField, type SelectFieldProps, type SelectOption, type SelectProps, SettingsAccordion, type SettingsAccordionProps, SettingsTabs, type SettingsTabsProps, type ShowToastOptions, Slider, SliderField, type SliderFieldProps, type SliderProps, SortButton, type SortButtonProps, Spacer, type SpacerProps, Spacing, type SpacingProps, Spinner, type SpinnerProps, StatCard, type StatCardProps, StatusBadge, type StatusBadgeProps, SubmitButton, type SubmitButtonProps, SuccessButton, type SuccessButtonProps, SuccessToast, type SuccessToastProps, Switch, SwitchField, type SwitchFieldProps, type SwitchProps, Tab, TabGroup, type TabGroupItem, type TabGroupProps, TabPanel, type TabPanelProps, type TabProps, TeamAvatarGroup, type TeamAvatarGroupProps, TextButton, type TextButtonProps, Textarea, TextareaField, type TextareaFieldProps, type TextareaProps, type ThemeModeContextValue, Toast, ToastContainer, type ToastContainerProps, type ToastController, type ToastProps, ToastProvider, type ToastProviderProps, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipProps, URLField, type URLFieldProps, UploadButton, type UploadButtonProps, VerifyButton, type VerifyButtonProps, VolumeSlider, type VolumeSliderProps, WarningToast, type WarningToastProps, YesNoRadioGroup, type YesNoRadioGroupProps, ZipCodeField, type ZipCodeFieldProps, useTheme, useThemeMode, useToast };
|