@marwes-ui/react 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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
- Checkbox,
87
- Input,
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
- <Input placeholder="Email" label="Email" />
96
- <Checkbox label="Subscribe" />
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
- Provider and hooks:
224
- - `MarwesProvider`
225
- - `useTheme`
226
- - `useToast`
227
-
228
- Actions and buttons:
229
- - `Button`, `IconButton`
230
- - `PrimaryButton`, `SecondaryButton`, `TextButton`, `SuccessButton`
231
- - `SubmitButton`, `CancelButton`, `CreateButton`, `DestructiveButton`
232
- - `LinkButton`, `SaveButton`, `ConfirmButton`, `VerifyButton`
233
- - `EditButton`, `CloseButton`, `RefreshButton`
234
- - `UploadButton`, `DownloadButton`, `CopyButton`
235
- - `SearchButton`, `FilterButton`, `SortButton`, `DropdownButton`
236
-
237
- Forms and inputs:
238
- - `Input`, `Textarea`, `Select`, `RichText`, `InputOtp`
239
- - `InputField`, `TextareaField`, `SelectField`, `RichTextField`
240
- - `DropdownField`, `SearchField`, `PasswordField`, `EmailField`
241
- - `DateOfBirthField`, `ZipCodeField`, `PhoneField`, `URLField`, `CurrencyField`
242
- - `Checkbox`, `CheckboxField`, `CheckboxGroupField`
243
- - `Radio`, `RadioGroupField`, `YesNoRadioGroup`, `RatingRadioGroup`, `OptionRadioGroup`
244
- - `Switch`, `SwitchField`, `FeatureToggle`, `PreferenceSwitch`, `PermissionSwitch`
245
- - `Slider`, `SliderField`, `VolumeSlider`, `BrightnessSlider`, `RadiusSlider`
246
- - `SegmentedControlField`, `PaginationField`
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
- Feedback and overlays:
258
- - `Badge`, `BadgeGroup`, `StatusBadge`, `PriorityBadge`, `NotificationBadge`
259
- - `Banner`, `InfoBanner`, `SuccessBanner`, `WarningBanner`, `ErrorBanner`
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
- - `Spinner`, `ButtonSpinner`, `EmptyStateSpinner`
262
- - `Toast`, `ToastContainer`, `ToastProvider`
263
- - `SuccessToast`, `ErrorToast`, `WarningToast`, `InfoToast`
264
- - `Tooltip`, `TooltipGroup`, `ContextMenu`
265
- - `Dialog`, `DialogModal`, `Drawer`, `ConfirmDialog`, `DestructiveDialog`, `InfoDialog`
266
- - `Accordion`, `AccordionField`, `FAQAccordion`, `SettingsAccordion`, `SectionsAccordion`
267
- - `Tab`, `TabGroup`, `TabPanel`, `NavigationTabs`, `ContentTabs`, `SettingsTabs`
268
-
269
- Typed tokens and helpers:
270
- - `ThemeInput`, `ThemeMode`, `Density`, `ToneName`
271
- - `mwAvailableFonts`, `mwGoogleFontFamilies`, `mwFontFallbacks`, `createFontStack`
272
- - `mwThemeVars`, `mwThemeVarNames`, `mwStyledTheme`, `mwVar`
273
- - `ButtonVariant`, `ButtonSize`, `ButtonAction`
274
- - `BadgeVariant`, `AvatarSize`, `AvatarType`, `SwitchSize`, `IconName`, `Spacings`
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
- - `mwStyledTheme` is a plain object that mirrors `mwThemeVars` for styled-components or Emotion `ThemeProvider` usage.
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 { mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar } from "@marwes-ui/react"
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={mwStyledTheme}>{children}</ThemeProvider>
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