@marwes-ui/vue 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 +160 -58
- package/dist/index.d.ts +93 -47
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +24 -4
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 {
|
|
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
|
-
<
|
|
94
|
-
<
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
- `
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
- `
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
- `
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- `
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
250
|
-
|
|
251
|
-
- `
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
- `
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- `
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
- `
|
|
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 {
|
|
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 =
|
|
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:
|