@marwes-ui/react 1.4.1 → 1.5.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/README.md +161 -55
- package/dist/index.d.ts +0 -3
- package/dist/index.js.map +1 -1
- package/package.json +24 -4
package/README.md
CHANGED
|
@@ -38,11 +38,19 @@ For a React app, install this package first. It includes the React adapter, load
|
|
|
38
38
|
| --- | --- |
|
|
39
39
|
| `@marwes-ui/react` | You are building a React app. |
|
|
40
40
|
| `@marwes-ui/vue` | You are building a Vue app instead. |
|
|
41
|
+
| `@marwes-ui/svelte` | You are building a Svelte app instead. |
|
|
41
42
|
| `@marwes-ui/core` | You are building adapters, tests, tooling, or framework-agnostic integrations. |
|
|
42
43
|
| `@marwes-ui/presets` | You need standalone preset CSS or preset theme exports. |
|
|
43
44
|
|
|
44
45
|
This split keeps installation simple for app teams while giving humans and AI agents clear package boundaries: adapters render, core defines contracts, presets style.
|
|
45
46
|
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
- React and React DOM 18 or newer
|
|
50
|
+
- Node.js 20 or newer for package installation, application builds, and the CLI
|
|
51
|
+
- A modern browser with CSS custom-property support
|
|
52
|
+
- A Vite starter layout for automatic provider patching; custom layouts use the printed manual setup
|
|
53
|
+
|
|
46
54
|
## Install
|
|
47
55
|
|
|
48
56
|
The Marwes CLI is the official installation path. It installs `@marwes-ui/react` (with `react` and `react-dom` as peers), wraps your app root with `MarwesProvider`, and leaves you ready to render components with default Marwes styling — no separate CSS setup.
|
|
@@ -59,6 +67,14 @@ pnpm dlx @marwes-ui/cli init --adapter react
|
|
|
59
67
|
|
|
60
68
|
Also works with `npx @marwes-ui/cli`, `yarn dlx @marwes-ui/cli`, and `bunx @marwes-ui/cli`.
|
|
61
69
|
|
|
70
|
+
Verify the patched app and its production build:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pnpm dlx @marwes-ui/cli doctor --run-build
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Automatic provider patching supports known Vite starter layouts. A `manual-action-required` result means the package was installed but the CLI could not safely identify the app root; apply the complete provider example printed by the CLI and rerun the doctor command.
|
|
77
|
+
|
|
62
78
|
### New Vite app
|
|
63
79
|
|
|
64
80
|
Scaffold a fresh Vite starter with Marwes preinstalled:
|
|
@@ -83,8 +99,8 @@ After install, jump to the [Quick Start](#quick-start) below.
|
|
|
83
99
|
import {
|
|
84
100
|
Button,
|
|
85
101
|
ButtonVariant,
|
|
86
|
-
|
|
87
|
-
|
|
102
|
+
CheckboxField,
|
|
103
|
+
EmailField,
|
|
88
104
|
MarwesProvider,
|
|
89
105
|
SubmitButton,
|
|
90
106
|
} from "@marwes-ui/react"
|
|
@@ -92,8 +108,8 @@ import {
|
|
|
92
108
|
export function App() {
|
|
93
109
|
return (
|
|
94
110
|
<MarwesProvider>
|
|
95
|
-
<
|
|
96
|
-
<
|
|
111
|
+
<EmailField label="Email" input={{ placeholder: "you@example.com" }} />
|
|
112
|
+
<CheckboxField label="Subscribe" />
|
|
97
113
|
<Button variant={ButtonVariant.secondary}>Preview</Button>
|
|
98
114
|
<SubmitButton>Save</SubmitButton>
|
|
99
115
|
</MarwesProvider>
|
|
@@ -218,60 +234,148 @@ export function ProjectPanel() {
|
|
|
218
234
|
}
|
|
219
235
|
```
|
|
220
236
|
|
|
237
|
+
For icon-only actions, use `IconButton` and name the button with `label`, `ariaLabel`, or `ariaLabelledBy`. An `ariaLabel` on a nested `Icon` names the image, not the interactive button.
|
|
238
|
+
|
|
239
|
+
<!-- BEGIN GENERATED PUBLIC COMPONENTS -->
|
|
221
240
|
## Available Components
|
|
222
241
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
- `
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- `
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
- `
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
- `
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
Content and layout:
|
|
249
|
-
- `Card`, `ProductCard`, `ProfileCard`, `StatCard`
|
|
250
|
-
- `H1`, `H2`, `H3`, `Paragraph`, `Text`, `TypographyText`
|
|
251
|
-
- `Spacer`, `Spacing`, `Divider`
|
|
242
|
+
Generated from the public root export of `@marwes-ui/react`. Do not edit this inventory by hand.
|
|
243
|
+
|
|
244
|
+
### Framework
|
|
245
|
+
|
|
246
|
+
- `MarwesProvider`, `MarwesThemeScript`, `MarwesThemeStyle`, `SkipLink`
|
|
247
|
+
|
|
248
|
+
### Accordion
|
|
249
|
+
|
|
250
|
+
- `AccordionField`, `FAQAccordion`, `SectionsAccordion`, `SettingsAccordion`
|
|
251
|
+
|
|
252
|
+
### Avatar
|
|
253
|
+
|
|
254
|
+
- `Avatar`, `AvatarBadge`, `AvatarGroup`, `PresenceAvatar`, `ProfileAvatar`, `TeamAvatarGroup`
|
|
255
|
+
|
|
256
|
+
### Badge
|
|
257
|
+
|
|
258
|
+
- `Badge`, `BadgeGroup`, `NotificationBadge`, `PriorityBadge`, `StatusBadge`
|
|
259
|
+
|
|
260
|
+
### Banner
|
|
261
|
+
|
|
262
|
+
- `Banner`, `ErrorBanner`, `InfoBanner`, `SuccessBanner`, `WarningBanner`
|
|
263
|
+
|
|
264
|
+
### Breadcrumb
|
|
265
|
+
|
|
252
266
|
- `Breadcrumb`
|
|
267
|
+
|
|
268
|
+
### Button
|
|
269
|
+
|
|
270
|
+
- `Button`, `CancelButton`, `CloseButton`, `ConfirmButton`, `CopyButton`, `CreateButton`
|
|
271
|
+
- `DestructiveButton`, `DownloadButton`, `DropdownButton`, `EditButton`, `FilterButton`, `IconButton`
|
|
272
|
+
- `LinkButton`, `PrimaryButton`, `RefreshButton`, `SaveButton`, `SearchButton`, `SecondaryButton`
|
|
273
|
+
- `SortButton`, `SubmitButton`, `SuccessButton`, `TextButton`, `UploadButton`, `VerifyButton`
|
|
274
|
+
|
|
275
|
+
### Card
|
|
276
|
+
|
|
277
|
+
- `Card`, `ProductCard`, `ProfileCard`, `StatCard`
|
|
278
|
+
|
|
279
|
+
### Checkbox
|
|
280
|
+
|
|
281
|
+
- `CheckboxField`, `CheckboxGroupField`
|
|
282
|
+
|
|
283
|
+
### Context Menu
|
|
284
|
+
|
|
285
|
+
- `ContextMenu`
|
|
286
|
+
|
|
287
|
+
### Date Picker
|
|
288
|
+
|
|
289
|
+
- `DatePickerField`
|
|
290
|
+
|
|
291
|
+
### Dialog
|
|
292
|
+
|
|
293
|
+
- `ConfirmDialog`, `DestructiveDialog`, `Dialog`, `DialogModal`, `InfoDialog`
|
|
294
|
+
|
|
295
|
+
### Divider
|
|
296
|
+
|
|
297
|
+
- `Divider`
|
|
298
|
+
|
|
299
|
+
### Drawer
|
|
300
|
+
|
|
301
|
+
- `Drawer`
|
|
302
|
+
|
|
303
|
+
### Heading
|
|
304
|
+
|
|
305
|
+
- `H1`, `H2`, `H3`
|
|
306
|
+
|
|
307
|
+
### Icon
|
|
308
|
+
|
|
253
309
|
- `Icon`
|
|
254
|
-
- `Avatar`, `AvatarBadge`, `AvatarGroup`, `ProfileAvatar`, `PresenceAvatar`, `TeamAvatarGroup`
|
|
255
|
-
- `StatTile`, `Skeleton`
|
|
256
310
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
- `
|
|
311
|
+
### Input
|
|
312
|
+
|
|
313
|
+
- `CurrencyField`, `DateOfBirthField`, `DropdownField`, `EmailField`, `InputField`, `InputOtpField`
|
|
314
|
+
- `PasswordField`, `PhoneField`, `RichTextField`, `SearchField`, `SelectField`, `TextareaField`
|
|
315
|
+
- `URLField`, `ZipCodeField`
|
|
316
|
+
|
|
317
|
+
### Pagination
|
|
318
|
+
|
|
319
|
+
- `PaginationField`
|
|
320
|
+
|
|
321
|
+
### Paragraph
|
|
322
|
+
|
|
323
|
+
- `Paragraph`
|
|
324
|
+
|
|
325
|
+
### Progress Bar
|
|
326
|
+
|
|
260
327
|
- `ProgressBar`
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- `
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
- `
|
|
273
|
-
|
|
274
|
-
|
|
328
|
+
|
|
329
|
+
### Radio
|
|
330
|
+
|
|
331
|
+
- `OptionRadioGroup`, `RadioGroupField`, `RatingRadioGroup`, `YesNoRadioGroup`
|
|
332
|
+
|
|
333
|
+
### Segmented Control
|
|
334
|
+
|
|
335
|
+
- `SegmentedControlField`
|
|
336
|
+
|
|
337
|
+
### Skeleton
|
|
338
|
+
|
|
339
|
+
- `Skeleton`
|
|
340
|
+
|
|
341
|
+
### Slider
|
|
342
|
+
|
|
343
|
+
- `BrightnessSlider`, `RadiusSlider`, `SliderField`, `VolumeSlider`
|
|
344
|
+
|
|
345
|
+
### Spacing
|
|
346
|
+
|
|
347
|
+
- `Spacer`, `Spacing`
|
|
348
|
+
|
|
349
|
+
### Spinner
|
|
350
|
+
|
|
351
|
+
- `ButtonSpinner`, `EmptyStateSpinner`, `Spinner`
|
|
352
|
+
|
|
353
|
+
### Stat Tile
|
|
354
|
+
|
|
355
|
+
- `StatTile`
|
|
356
|
+
|
|
357
|
+
### Switch
|
|
358
|
+
|
|
359
|
+
- `FeatureToggle`, `PermissionSwitch`, `PreferenceSwitch`, `SwitchField`
|
|
360
|
+
|
|
361
|
+
### Tab
|
|
362
|
+
|
|
363
|
+
- `ContentTabs`, `NavigationTabs`, `SettingsTabs`, `Tab`, `TabGroup`, `TabPanel`
|
|
364
|
+
|
|
365
|
+
### Text
|
|
366
|
+
|
|
367
|
+
- `Text`, `TypographyText`
|
|
368
|
+
|
|
369
|
+
### Toast
|
|
370
|
+
|
|
371
|
+
- `ErrorToast`, `InfoToast`, `SuccessToast`, `Toast`, `ToastContainer`, `ToastProvider`
|
|
372
|
+
- `WarningToast`
|
|
373
|
+
|
|
374
|
+
### Tooltip
|
|
375
|
+
|
|
376
|
+
- `Tooltip`, `TooltipGroup`
|
|
377
|
+
|
|
378
|
+
<!-- END GENERATED PUBLIC COMPONENTS -->
|
|
275
379
|
|
|
276
380
|
## Theme In Seconds
|
|
277
381
|
|
|
@@ -504,11 +608,11 @@ Use the helpers by purpose:
|
|
|
504
608
|
- `mwThemeVars` is the default styling helper. It returns CSS `var(...)` references for styled-components, Emotion, vanilla-extract, inline style values, and config files.
|
|
505
609
|
- `mwThemeVarNames` returns raw custom property names for assigning provider-scoped overrides in style objects or tooling.
|
|
506
610
|
- `mwVar()` wraps custom or advanced `--mw-*` names when the named token object does not cover a specialized case.
|
|
507
|
-
- `
|
|
611
|
+
- `mwTheme` is a plain object that mirrors `mwThemeVars` for styled-components or Emotion `ThemeProvider` usage. `mwStyledTheme` remains as a deprecated compatibility alias.
|
|
508
612
|
|
|
509
613
|
```tsx
|
|
510
614
|
import type { ReactNode } from "react"
|
|
511
|
-
import {
|
|
615
|
+
import { mwTheme, mwThemeVarNames, mwThemeVars, mwVar } from "@marwes-ui/react"
|
|
512
616
|
import styled, { ThemeProvider } from "styled-components"
|
|
513
617
|
|
|
514
618
|
const Panel = styled.section`
|
|
@@ -529,10 +633,12 @@ const InlinePanel = () => (
|
|
|
529
633
|
)
|
|
530
634
|
|
|
531
635
|
const AppTheme = ({ children }: { children: ReactNode }) => (
|
|
532
|
-
<ThemeProvider theme={
|
|
636
|
+
<ThemeProvider theme={mwTheme}>{children}</ThemeProvider>
|
|
533
637
|
)
|
|
534
638
|
```
|
|
535
639
|
|
|
640
|
+
`mwTheme`, `mwStyledTheme`, and `mwThemeVars` contain CSS `var(--mw-*)` references, not resolved color or spacing values. They are correct inside styled CSS evaluated below `MarwesProvider`, but JavaScript reads or aliases taken from `props.theme` can resolve against the wrong element and return an empty value. Use `useTheme()` for JavaScript logic, charts, runtime aliases, or bridges that need concrete values.
|
|
641
|
+
|
|
536
642
|
Plain CSS and CSS Modules do not need a JavaScript bridge:
|
|
537
643
|
|
|
538
644
|
```css
|
package/dist/index.d.ts
CHANGED
|
@@ -51,9 +51,6 @@ declare function Button(props: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
|
51
51
|
|
|
52
52
|
type IconButtonProps = Omit<ButtonProps, "children" | "hasVisibleText" | "iconLeft" | "iconOnly" | "iconRight"> & {
|
|
53
53
|
icon: IconName$1;
|
|
54
|
-
/** Accessible name — required for icon-only buttons. Prefer `label`; `ariaLabel` also accepted. */
|
|
55
|
-
label?: string;
|
|
56
|
-
ariaLabel?: string;
|
|
57
54
|
};
|
|
58
55
|
declare function IconButton(props: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
59
56
|
|