@marwes-ui/vue 1.4.1 → 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 Vue app, install this package first. It includes the Vue adapter, loads th
38
38
  | --- | --- |
39
39
  | `@marwes-ui/vue` | You are building a Vue app. |
40
40
  | `@marwes-ui/react` | You are building a React 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
+ - Vue 3.4 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/vue` (with `vue` as a peer), 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 vue
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:
@@ -81,17 +97,13 @@ After install, jump to the [Quick Start](#quick-start) below.
81
97
 
82
98
  ```vue
83
99
  <script setup lang="ts">
84
- import { ref } from "vue"
85
- import { Button, ButtonVariant, Checkbox, Input, MarwesProvider, SubmitButton } from "@marwes-ui/vue"
86
-
87
- const email = ref("")
88
- const subscribed = ref(false)
100
+ import { Button, ButtonVariant, CheckboxField, EmailField, MarwesProvider, SubmitButton } from "@marwes-ui/vue"
89
101
  </script>
90
102
 
91
103
  <template>
92
104
  <MarwesProvider>
93
- <Input v-model="email" placeholder="Email" label="Email" />
94
- <Checkbox v-model="subscribed" label="Subscribe" />
105
+ <EmailField label="Email" :input="{ placeholder: 'you@example.com' }" />
106
+ <CheckboxField label="Subscribe" />
95
107
  <Button :variant="ButtonVariant.secondary">Preview</Button>
96
108
  <SubmitButton>Save</SubmitButton>
97
109
  </MarwesProvider>
@@ -210,60 +222,148 @@ const descriptionProps: ParagraphProps = {
210
222
  </template>
211
223
  ```
212
224
 
225
+ 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.
226
+
227
+ <!-- BEGIN GENERATED PUBLIC COMPONENTS -->
213
228
  ## Available Components
214
229
 
215
- Provider and hooks:
216
- - `MarwesProvider`
217
- - `useTheme`
218
- - `useToast`
219
-
220
- Actions and buttons:
221
- - `Button`, `IconButton`
222
- - `PrimaryButton`, `SecondaryButton`, `TextButton`, `SuccessButton`
223
- - `SubmitButton`, `CancelButton`, `CreateButton`, `DestructiveButton`
224
- - `LinkButton`, `SaveButton`, `ConfirmButton`, `VerifyButton`
225
- - `EditButton`, `CloseButton`, `RefreshButton`
226
- - `UploadButton`, `DownloadButton`, `CopyButton`
227
- - `SearchButton`, `FilterButton`, `SortButton`, `DropdownButton`
228
-
229
- Forms and inputs:
230
- - `Input`, `Textarea`, `Select`, `RichText`, `InputOtp`
231
- - `InputField`, `TextareaField`, `SelectField`, `RichTextField`
232
- - `DropdownField`, `SearchField`, `PasswordField`, `EmailField`
233
- - `DateOfBirthField`, `ZipCodeField`, `PhoneField`, `URLField`, `CurrencyField`
234
- - `Checkbox`, `CheckboxField`, `CheckboxGroupField`
235
- - `Radio`, `RadioGroupField`, `YesNoRadioGroup`, `RatingRadioGroup`, `OptionRadioGroup`
236
- - `Switch`, `SwitchField`, `FeatureToggle`, `PreferenceSwitch`, `PermissionSwitch`
237
- - `Slider`, `SliderField`, `VolumeSlider`, `BrightnessSlider`, `RadiusSlider`
238
- - `SegmentedControlField`, `PaginationField`
239
-
240
- Content and layout:
241
- - `Card`, `ProductCard`, `ProfileCard`, `StatCard`
242
- - `H1`, `H2`, `H3`, `Paragraph`, `Text`, `TypographyText`
243
- - `Spacer`, `Spacing`, `Divider`
230
+ Generated from the public root export of `@marwes-ui/vue`. Do not edit this inventory by hand.
231
+
232
+ ### Framework
233
+
234
+ - `MarwesProvider`, `SkipLink`
235
+
236
+ ### Accordion
237
+
238
+ - `AccordionField`, `FAQAccordion`, `SectionsAccordion`, `SettingsAccordion`
239
+
240
+ ### Avatar
241
+
242
+ - `Avatar`, `AvatarBadge`, `AvatarGroup`, `PresenceAvatar`, `ProfileAvatar`, `TeamAvatarGroup`
243
+
244
+ ### Badge
245
+
246
+ - `Badge`, `BadgeGroup`, `NotificationBadge`, `PriorityBadge`, `StatusBadge`
247
+
248
+ ### Banner
249
+
250
+ - `Banner`, `ErrorBanner`, `InfoBanner`, `SuccessBanner`, `WarningBanner`
251
+
252
+ ### Breadcrumb
253
+
244
254
  - `Breadcrumb`
255
+
256
+ ### Button
257
+
258
+ - `Button`, `CancelButton`, `CloseButton`, `ConfirmButton`, `CopyButton`, `CreateButton`
259
+ - `DestructiveButton`, `DownloadButton`, `DropdownButton`, `EditButton`, `FilterButton`, `IconButton`
260
+ - `LinkButton`, `PrimaryButton`, `RefreshButton`, `SaveButton`, `SearchButton`, `SecondaryButton`
261
+ - `SortButton`, `SubmitButton`, `SuccessButton`, `TextButton`, `UploadButton`, `VerifyButton`
262
+
263
+ ### Card
264
+
265
+ - `Card`, `ProductCard`, `ProfileCard`, `StatCard`
266
+
267
+ ### Checkbox
268
+
269
+ - `CheckboxField`, `CheckboxGroupField`
270
+
271
+ ### Context Menu
272
+
273
+ - `ContextMenu`
274
+
275
+ ### Date Picker
276
+
277
+ - `DatePickerField`
278
+
279
+ ### Dialog
280
+
281
+ - `ConfirmDialog`, `DestructiveDialog`, `Dialog`, `DialogModal`, `InfoDialog`
282
+
283
+ ### Divider
284
+
285
+ - `Divider`
286
+
287
+ ### Drawer
288
+
289
+ - `Drawer`
290
+
291
+ ### Heading
292
+
293
+ - `H1`, `H2`, `H3`
294
+
295
+ ### Icon
296
+
245
297
  - `Icon`
246
- - `Avatar`, `AvatarBadge`, `AvatarGroup`, `ProfileAvatar`, `PresenceAvatar`, `TeamAvatarGroup`
247
- - `StatTile`, `Skeleton`
248
298
 
249
- Feedback and overlays:
250
- - `Badge`, `BadgeGroup`, `StatusBadge`, `PriorityBadge`, `NotificationBadge`
251
- - `Banner`, `InfoBanner`, `SuccessBanner`, `WarningBanner`, `ErrorBanner`
299
+ ### Input
300
+
301
+ - `CurrencyField`, `DateOfBirthField`, `DropdownField`, `EmailField`, `InputField`, `InputOtpField`
302
+ - `PasswordField`, `PhoneField`, `RichTextField`, `SearchField`, `SelectField`, `TextareaField`
303
+ - `URLField`, `ZipCodeField`
304
+
305
+ ### Pagination
306
+
307
+ - `PaginationField`
308
+
309
+ ### Paragraph
310
+
311
+ - `Paragraph`
312
+
313
+ ### Progress Bar
314
+
252
315
  - `ProgressBar`
253
- - `Spinner`, `ButtonSpinner`, `EmptyStateSpinner`
254
- - `Toast`, `ToastContainer`, `ToastProvider`
255
- - `SuccessToast`, `ErrorToast`, `WarningToast`, `InfoToast`
256
- - `Tooltip`, `TooltipGroup`, `ContextMenu`
257
- - `Dialog`, `DialogModal`, `Drawer`, `ConfirmDialog`, `DestructiveDialog`, `InfoDialog`
258
- - `Accordion`, `AccordionField`, `FAQAccordion`, `SettingsAccordion`, `SectionsAccordion`
259
- - `Tab`, `TabGroup`, `TabPanel`, `NavigationTabs`, `ContentTabs`, `SettingsTabs`
260
-
261
- Typed tokens and helpers:
262
- - `ThemeInput`, `ThemeMode`, `Density`, `ToneName`
263
- - `mwAvailableFonts`, `mwGoogleFontFamilies`, `mwFontFallbacks`, `createFontStack`
264
- - `mwThemeVars`, `mwThemeVarNames`, `mwStyledTheme`, `mwVar`
265
- - `ButtonVariant`, `ButtonSize`, `ButtonAction`
266
- - `BadgeVariant`, `AvatarSize`, `AvatarType`, `SwitchSize`, `IconName`, `Spacings`
316
+
317
+ ### Radio
318
+
319
+ - `OptionRadioGroup`, `RadioGroupField`, `RatingRadioGroup`, `YesNoRadioGroup`
320
+
321
+ ### Segmented Control
322
+
323
+ - `SegmentedControlField`
324
+
325
+ ### Skeleton
326
+
327
+ - `Skeleton`
328
+
329
+ ### Slider
330
+
331
+ - `BrightnessSlider`, `RadiusSlider`, `SliderField`, `VolumeSlider`
332
+
333
+ ### Spacing
334
+
335
+ - `Spacer`, `Spacing`
336
+
337
+ ### Spinner
338
+
339
+ - `ButtonSpinner`, `EmptyStateSpinner`, `Spinner`
340
+
341
+ ### Stat Tile
342
+
343
+ - `StatTile`
344
+
345
+ ### Switch
346
+
347
+ - `FeatureToggle`, `PermissionSwitch`, `PreferenceSwitch`, `SwitchField`
348
+
349
+ ### Tab
350
+
351
+ - `ContentTabs`, `NavigationTabs`, `SettingsTabs`, `Tab`, `TabGroup`, `TabPanel`
352
+
353
+ ### Text
354
+
355
+ - `Text`, `TypographyText`
356
+
357
+ ### Toast
358
+
359
+ - `ErrorToast`, `InfoToast`, `SuccessToast`, `Toast`, `ToastContainer`, `ToastProvider`
360
+ - `WarningToast`
361
+
362
+ ### Tooltip
363
+
364
+ - `Tooltip`, `TooltipGroup`
365
+
366
+ <!-- END GENERATED PUBLIC COMPONENTS -->
267
367
 
268
368
  ## Theme In Seconds
269
369
 
@@ -509,10 +609,10 @@ For script-driven style objects, composables, renderer bridges, or config files,
509
609
  - `mwThemeVars` is the default styling helper. It returns CSS `var(...)` references for style objects, CSS-in-JS integrations, vanilla-extract, and config files.
510
610
  - `mwThemeVarNames` returns raw custom property names for assigning provider-scoped overrides in style objects or tooling.
511
611
  - `mwVar()` wraps custom or advanced `--mw-*` names when the named token object does not cover a specialized case.
512
- - `mwStyledTheme` mirrors `mwThemeVars` as a plain object for shared CSS-in-JS integrations that expect a theme object.
612
+ - `mwTheme` mirrors `mwThemeVars` as a plain object for shared CSS-in-JS integrations that expect a theme object. `mwStyledTheme` remains as a deprecated compatibility alias.
513
613
 
514
614
  ```ts
515
- import { mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar } from "@marwes-ui/vue"
615
+ import { mwTheme, mwThemeVarNames, mwThemeVars, mwVar } from "@marwes-ui/vue"
516
616
 
517
617
  const panelStyle = {
518
618
  padding: mwThemeVars.spacing.sp24,
@@ -524,9 +624,11 @@ const focusOverride = {
524
624
  [mwThemeVarNames.color.focus]: "#FF00AA",
525
625
  }
526
626
 
527
- const cssInJsTheme = mwStyledTheme
627
+ const cssInJsTheme = mwTheme
528
628
  ```
529
629
 
630
+ `mwTheme`, `mwStyledTheme`, and `mwThemeVars` contain CSS `var(--mw-*)` references, not resolved color or spacing values. They are correct inside CSS evaluated below `MarwesProvider`, but JavaScript reads or aliases 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.
631
+
530
632
  This enables Vue apps to keep scoped CSS, dynamic `:style` bindings, custom layout wrappers, and design-tool integrations visually tied to the same active theme as Marwes components. Changing `MarwesProvider :theme="..."` updates both preset components and app-owned styles.
531
633
 
532
634
  Keep the APIs separate:
package/dist/index.d.ts CHANGED
@@ -86,55 +86,13 @@ declare const Button: vue.DefineSetupFnComponent<ButtonProps, "click"[], {}, But
86
86
  onClick?: (...args: any[]) => any;
87
87
  }, vue.PublicProps>;
88
88
 
89
- type IconButtonProps = Omit<ButtonProps, "iconLeft" | "iconRight" | "iconOnly" | "hasVisibleText"> & {
89
+ type IconButtonProps = Omit<ButtonProps, "hasVisibleText" | "iconLeft" | "iconOnly" | "iconRight"> & {
90
90
  icon: IconName$1;
91
- /** Accessible name — required for icon-only buttons. Prefer `label`; `ariaLabel` also accepted. */
92
- label?: string;
93
- ariaLabel?: string;
94
91
  };
95
- declare const IconButton: vue.DefineSetupFnComponent<{
96
- label: any;
97
- pressed: any;
98
- disabled: any;
99
- error: any;
100
- icon: any;
101
- ariaLabel: any;
102
- href: any;
103
- tooltip: any;
104
- size: any;
105
- dataAttributes: any;
106
- toggle: any;
107
- onClick: any;
108
- className: any;
109
- variant: any;
110
- as: any;
111
- loading: any;
112
- ariaExpanded: any;
113
- ariaControls: any;
114
- action: any;
115
- confirmation: any;
116
- }, {}, {}, {
117
- label: any;
118
- pressed: any;
119
- disabled: any;
120
- error: any;
121
- icon: any;
122
- ariaLabel: any;
123
- href: any;
124
- tooltip: any;
125
- size: any;
126
- dataAttributes: any;
127
- toggle: any;
128
- onClick: any;
129
- className: any;
130
- variant: any;
131
- as: any;
132
- loading: any;
133
- ariaExpanded: any;
134
- ariaControls: any;
135
- action: any;
136
- confirmation: any;
137
- } & {}, vue.PublicProps>;
92
+ /** Vue component type that preserves IconButton's public props at call sites. */
93
+ declare const IconButton: new () => {
94
+ $props: IconButtonProps;
95
+ };
138
96
 
139
97
  type DestructiveButtonProps = Omit<ButtonProps, "variant" | "action" | "as" | "href"> & {
140
98
  confirmation?: boolean;
package/dist/index.js CHANGED
@@ -527,6 +527,7 @@ var buttonPropKeys = [
527
527
  "toggle",
528
528
  "pressed",
529
529
  "ariaLabel",
530
+ "ariaLabelledBy",
530
531
  "label",
531
532
  "hasVisibleText",
532
533
  "ariaExpanded",
@@ -585,6 +586,7 @@ var Button = defineComponent(
585
586
  type: renderKit.a11y.type,
586
587
  disabled: renderKit.a11y.disabled,
587
588
  "aria-label": renderKit.a11y.ariaLabel,
589
+ "aria-labelledby": renderKit.a11y.ariaLabelledBy,
588
590
  "aria-busy": renderKit.a11y.ariaBusy,
589
591
  "aria-disabled": renderKit.a11y.ariaDisabled,
590
592
  "aria-pressed": renderKit.a11y.ariaPressed,
@@ -609,6 +611,7 @@ var Button = defineComponent(
609
611
  role: renderKit.a11y.role,
610
612
  tabindex: renderKit.a11y.tabIndex,
611
613
  "aria-label": renderKit.a11y.ariaLabel,
614
+ "aria-labelledby": renderKit.a11y.ariaLabelledBy,
612
615
  "aria-busy": renderKit.a11y.ariaBusy,
613
616
  "aria-disabled": renderKit.a11y.ariaDisabled,
614
617
  "aria-pressed": renderKit.a11y.ariaPressed,
@@ -647,6 +650,7 @@ var iconButtonPropKeys = [
647
650
  "toggle",
648
651
  "pressed",
649
652
  "ariaLabel",
653
+ "ariaLabelledBy",
650
654
  "label",
651
655
  "ariaExpanded",
652
656
  "ariaControls",
@@ -658,7 +662,7 @@ var iconButtonPropKeys = [
658
662
  "className",
659
663
  "icon"
660
664
  ];
661
- var IconButton = defineComponent(
665
+ var IconButtonImplementation = defineComponent(
662
666
  (rawProps) => {
663
667
  const attrs = useAttrs();
664
668
  return () => {
@@ -688,6 +692,7 @@ var IconButton = defineComponent(
688
692
  props: [...iconButtonPropKeys]
689
693
  }
690
694
  );
695
+ var IconButton = IconButtonImplementation;
691
696
  var buttonPropKeys2 = [
692
697
  "as",
693
698
  "href",