@marwes-ui/svelte 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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @marwes-ui/svelte
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#44](https://github.com/niklas-westman/marwes/pull/44) [`6dbb453`](https://github.com/niklas-westman/marwes/commit/6dbb45356374cc50cb40204fd1dac5effc243b53) Thanks [@niklas-westman](https://github.com/niklas-westman)! - Improve `IconButton` accessible-name support through `label`, `ariaLabel`, or `ariaLabelledBy`, align external-label behavior across adapters, and document the boundary between CSS-variable theme helpers and resolved `useTheme()` values. Preserve optional naming props for backward compatibility, keep the runtime warning for unnamed icon-only buttons, and export an opt-in `AccessibleButtonName` helper for consumers that want a stricter naming contract.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#44](https://github.com/niklas-westman/marwes/pull/44) [`6dbb453`](https://github.com/niklas-westman/marwes/commit/6dbb45356374cc50cb40204fd1dac5effc243b53) Thanks [@niklas-westman](https://github.com/niklas-westman)! - Publish generated public component inventories, Field- and Purpose-first setup guidance, consistent package metadata, and framework-specific links to the canonical Marwes consumer documentation.
12
+
13
+ - [#44](https://github.com/niklas-westman/marwes/pull/44) [`6dbb453`](https://github.com/niklas-westman/marwes/commit/6dbb45356374cc50cb40204fd1dac5effc243b53) Thanks [@niklas-westman](https://github.com/niklas-westman)! - Restore density-aware spacing between AccordionField group labels and accordion items in React and Vue. Native fieldset legends do not receive the fieldset's grid gap; the shared preset now applies that spacing explicitly while preserving Svelte's existing grid-based label spacing.
14
+
15
+ - Updated dependencies [[`6dbb453`](https://github.com/niklas-westman/marwes/commit/6dbb45356374cc50cb40204fd1dac5effc243b53), [`6dbb453`](https://github.com/niklas-westman/marwes/commit/6dbb45356374cc50cb40204fd1dac5effc243b53), [`6dbb453`](https://github.com/niklas-westman/marwes/commit/6dbb45356374cc50cb40204fd1dac5effc243b53)]:
16
+ - @marwes-ui/core@1.5.0
17
+ - @marwes-ui/presets@1.5.0
18
+
3
19
  ## 1.4.1
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -45,6 +45,13 @@ For a Svelte app, install this package first. It includes the Svelte adapter, lo
45
45
 
46
46
  This split keeps installation simple for app teams while giving humans and AI agents clear package boundaries: adapters render, core defines contracts, presets style.
47
47
 
48
+ ## Requirements
49
+
50
+ - Svelte 5.20 or newer
51
+ - Node.js 20 or newer for package installation, application builds, and the CLI
52
+ - A modern browser with CSS custom-property support
53
+ - A Vite starter layout for automatic provider patching; custom layouts use the printed manual setup
54
+
48
55
  ## Install
49
56
 
50
57
  The Marwes CLI is the official installation path. It installs `@marwes-ui/svelte` (with `svelte` as a peer), wraps your app root with `MarwesProvider`, and leaves you ready to render components with default Marwes styling — no separate CSS setup.
@@ -61,6 +68,14 @@ pnpm dlx @marwes-ui/cli init --adapter svelte
61
68
 
62
69
  Also works with `npx @marwes-ui/cli`, `yarn dlx @marwes-ui/cli`, and `bunx @marwes-ui/cli`.
63
70
 
71
+ Verify the patched app and its production build:
72
+
73
+ ```bash
74
+ pnpm dlx @marwes-ui/cli doctor --run-build
75
+ ```
76
+
77
+ 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.
78
+
64
79
  ### New Vite app
65
80
 
66
81
  Scaffold a fresh Vite starter with Marwes preinstalled:
@@ -86,19 +101,16 @@ After install, jump to the [Quick Start](#quick-start) below.
86
101
  import {
87
102
  Button,
88
103
  ButtonVariant,
89
- Checkbox,
90
- Input,
104
+ CheckboxField,
105
+ EmailField,
91
106
  MarwesProvider,
92
107
  SubmitButton,
93
108
  } from "@marwes-ui/svelte"
94
-
95
- let email = $state("")
96
- let subscribed = $state(false)
97
109
  </script>
98
110
 
99
111
  <MarwesProvider>
100
- <Input bind:value={email} placeholder="Email" label="Email" />
101
- <Checkbox bind:checked={subscribed} label="Subscribe" />
112
+ <EmailField label="Email" input={{ placeholder: "you@example.com" }} />
113
+ <CheckboxField label="Subscribe" />
102
114
  <Button variant={ButtonVariant.secondary}>Preview</Button>
103
115
  <SubmitButton>Save</SubmitButton>
104
116
  </MarwesProvider>
@@ -189,60 +201,148 @@ Import components, enums, and prop types from the same package. The values line
189
201
  </Card>
190
202
  ```
191
203
 
204
+ 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.
205
+
206
+ <!-- BEGIN GENERATED PUBLIC COMPONENTS -->
192
207
  ## Available Components
193
208
 
194
- Provider and hooks:
195
- - `MarwesProvider`
196
- - `useTheme`
197
- - `useToast`
198
-
199
- Actions and buttons:
200
- - `Button`, `IconButton`
201
- - `PrimaryButton`, `SecondaryButton`, `TextButton`, `SuccessButton`
202
- - `SubmitButton`, `CancelButton`, `CreateButton`, `DestructiveButton`
203
- - `LinkButton`, `SaveButton`, `ConfirmButton`, `VerifyButton`
204
- - `EditButton`, `CloseButton`, `RefreshButton`
205
- - `UploadButton`, `DownloadButton`, `CopyButton`
206
- - `SearchButton`, `FilterButton`, `SortButton`, `DropdownButton`
207
-
208
- Forms and inputs:
209
- - `Input`, `Textarea`, `Select`, `RichText`, `InputOtp`
210
- - `InputField`, `TextareaField`, `SelectField`, `RichTextField`
211
- - `DropdownField`, `SearchField`, `PasswordField`, `EmailField`
212
- - `DateOfBirthField`, `ZipCodeField`, `PhoneField`, `URLField`, `CurrencyField`
213
- - `Checkbox`, `CheckboxField`, `CheckboxGroupField`
214
- - `Radio`, `RadioGroupField`, `YesNoRadioGroup`, `RatingRadioGroup`, `OptionRadioGroup`
215
- - `Switch`, `SwitchField`, `FeatureToggle`, `PreferenceSwitch`, `PermissionSwitch`
216
- - `Slider`, `SliderField`, `VolumeSlider`, `BrightnessSlider`, `RadiusSlider`
217
- - `SegmentedControlField`, `PaginationField`
218
-
219
- Content and layout:
220
- - `Card`, `ProductCard`, `ProfileCard`, `StatCard`
221
- - `H1`, `H2`, `H3`, `Paragraph`, `Text`, `TypographyText`
222
- - `Spacer`, `Spacing`, `Divider`
209
+ Generated from the public root export of `@marwes-ui/svelte`. Do not edit this inventory by hand.
210
+
211
+ ### Framework
212
+
213
+ - `MarwesProvider`, `SkipLink`
214
+
215
+ ### Accordion
216
+
217
+ - `AccordionField`, `FAQAccordion`, `SectionsAccordion`, `SettingsAccordion`
218
+
219
+ ### Avatar
220
+
221
+ - `Avatar`, `AvatarBadge`, `AvatarGroup`, `PresenceAvatar`, `ProfileAvatar`, `TeamAvatarGroup`
222
+
223
+ ### Badge
224
+
225
+ - `Badge`, `BadgeGroup`, `NotificationBadge`, `PriorityBadge`, `StatusBadge`
226
+
227
+ ### Banner
228
+
229
+ - `Banner`, `ErrorBanner`, `InfoBanner`, `SuccessBanner`, `WarningBanner`
230
+
231
+ ### Breadcrumb
232
+
223
233
  - `Breadcrumb`
234
+
235
+ ### Button
236
+
237
+ - `Button`, `CancelButton`, `CloseButton`, `ConfirmButton`, `CopyButton`, `CreateButton`
238
+ - `DestructiveButton`, `DownloadButton`, `DropdownButton`, `EditButton`, `FilterButton`, `IconButton`
239
+ - `LinkButton`, `PrimaryButton`, `RefreshButton`, `SaveButton`, `SearchButton`, `SecondaryButton`
240
+ - `SortButton`, `SubmitButton`, `SuccessButton`, `TextButton`, `UploadButton`, `VerifyButton`
241
+
242
+ ### Card
243
+
244
+ - `Card`, `ProductCard`, `ProfileCard`, `StatCard`
245
+
246
+ ### Checkbox
247
+
248
+ - `CheckboxField`, `CheckboxGroupField`
249
+
250
+ ### Context Menu
251
+
252
+ - `ContextMenu`
253
+
254
+ ### Date Picker
255
+
256
+ - `DatePickerField`
257
+
258
+ ### Dialog
259
+
260
+ - `ConfirmDialog`, `DestructiveDialog`, `Dialog`, `DialogModal`, `InfoDialog`
261
+
262
+ ### Divider
263
+
264
+ - `Divider`
265
+
266
+ ### Drawer
267
+
268
+ - `Drawer`
269
+
270
+ ### Heading
271
+
272
+ - `H1`, `H2`, `H3`
273
+
274
+ ### Icon
275
+
224
276
  - `Icon`
225
- - `Avatar`, `AvatarBadge`, `AvatarGroup`, `ProfileAvatar`, `PresenceAvatar`, `TeamAvatarGroup`
226
- - `StatTile`, `Skeleton`
227
277
 
228
- Feedback and overlays:
229
- - `Badge`, `BadgeGroup`, `StatusBadge`, `PriorityBadge`, `NotificationBadge`
230
- - `Banner`, `InfoBanner`, `SuccessBanner`, `WarningBanner`, `ErrorBanner`
278
+ ### Input
279
+
280
+ - `CurrencyField`, `DateOfBirthField`, `DropdownField`, `EmailField`, `InputField`, `InputOtpField`
281
+ - `PasswordField`, `PhoneField`, `RichTextField`, `SearchField`, `SelectField`, `TextareaField`
282
+ - `URLField`, `ZipCodeField`
283
+
284
+ ### Pagination
285
+
286
+ - `PaginationField`
287
+
288
+ ### Paragraph
289
+
290
+ - `Paragraph`
291
+
292
+ ### Progress Bar
293
+
231
294
  - `ProgressBar`
232
- - `Spinner`, `ButtonSpinner`, `EmptyStateSpinner`
233
- - `Toast`, `ToastContainer`, `ToastProvider`
234
- - `SuccessToast`, `ErrorToast`, `WarningToast`, `InfoToast`
235
- - `Tooltip`, `TooltipGroup`, `ContextMenu`
236
- - `Dialog`, `DialogModal`, `Drawer`, `ConfirmDialog`, `DestructiveDialog`, `InfoDialog`
237
- - `Accordion`, `AccordionField`, `FAQAccordion`, `SettingsAccordion`, `SectionsAccordion`
238
- - `Tab`, `TabGroup`, `TabPanel`, `NavigationTabs`, `ContentTabs`, `SettingsTabs`
239
-
240
- Typed tokens and helpers:
241
- - `ThemeInput`, `ThemeMode`, `Density`, `ToneName`
242
- - `mwAvailableFonts`, `mwGoogleFontFamilies`, `mwFontFallbacks`, `createFontStack`
243
- - `mwThemeVars`, `mwThemeVarNames`, `mwStyledTheme`, `mwVar`
244
- - `ButtonVariant`, `ButtonSize`, `ButtonAction`
245
- - `BadgeVariant`, `AvatarSize`, `AvatarType`, `SwitchSize`, `IconName`, `Spacings`
295
+
296
+ ### Radio
297
+
298
+ - `OptionRadioGroup`, `RadioGroupField`, `RatingRadioGroup`, `YesNoRadioGroup`
299
+
300
+ ### Segmented Control
301
+
302
+ - `SegmentedControlField`
303
+
304
+ ### Skeleton
305
+
306
+ - `Skeleton`
307
+
308
+ ### Slider
309
+
310
+ - `BrightnessSlider`, `RadiusSlider`, `SliderField`, `VolumeSlider`
311
+
312
+ ### Spacing
313
+
314
+ - `Spacer`, `Spacing`
315
+
316
+ ### Spinner
317
+
318
+ - `ButtonSpinner`, `EmptyStateSpinner`, `Spinner`
319
+
320
+ ### Stat Tile
321
+
322
+ - `StatTile`
323
+
324
+ ### Switch
325
+
326
+ - `FeatureToggle`, `PermissionSwitch`, `PreferenceSwitch`, `SwitchField`
327
+
328
+ ### Tab
329
+
330
+ - `ContentTabs`, `NavigationTabs`, `SettingsTabs`, `Tab`, `TabGroup`, `TabPanel`
331
+
332
+ ### Text
333
+
334
+ - `Text`, `TypographyText`
335
+
336
+ ### Toast
337
+
338
+ - `ErrorToast`, `InfoToast`, `SuccessToast`, `Toast`, `ToastContainer`, `ToastProvider`
339
+ - `WarningToast`
340
+
341
+ ### Tooltip
342
+
343
+ - `Tooltip`, `TooltipGroup`
344
+
345
+ <!-- END GENERATED PUBLIC COMPONENTS -->
246
346
 
247
347
  ## Theme In Seconds
248
348
 
@@ -371,10 +471,10 @@ By default Marwes keeps theme state scoped to the provider element. If your app
371
471
 
372
472
  ### SvelteKit SSR
373
473
 
374
- Use `createMarwesThemeStyle()` and `createMarwesThemeScript()` when a server-rendered app needs the correct light or dark variables before hydration. Import from the `/ssr` subpath:
474
+ Use `createMarwesThemeStyle()` and `createMarwesThemeScript()` when a server-rendered app needs the correct light or dark variables before hydration. Both helpers are available from the adapter root:
375
475
 
376
476
  ```ts
377
- import { createMarwesThemeScript, createMarwesThemeStyle } from "@marwes-ui/svelte/ssr"
477
+ import { createMarwesThemeScript, createMarwesThemeStyle } from "@marwes-ui/svelte"
378
478
  ```
379
479
 
380
480
  Read the [theme SSR no-flash guide](https://github.com/niklas-westman/marwes/blob/main/docs/guides/theme-ssr-no-flash.md) for SvelteKit setup, CSP nonces, custom light/dark themes, and stored/system preference behavior.
@@ -412,6 +512,8 @@ const panelStyle = `
412
512
  `
413
513
  ```
414
514
 
515
+ `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.
516
+
415
517
  Keep the APIs separate:
416
518
  - Use `Spacings.sp24` for Marwes spacing props such as `<Spacer spacing={Spacings.sp24} />`.
417
519
  - Use `mwThemeVars.spacing.sp24` for custom CSS values.
@@ -61,6 +61,7 @@
61
61
  type={kit.a11y.type}
62
62
  disabled={kit.a11y.disabled}
63
63
  aria-label={kit.a11y.ariaLabel}
64
+ aria-labelledby={kit.a11y.ariaLabelledBy}
64
65
  aria-busy={kit.a11y.ariaBusy}
65
66
  aria-disabled={kit.a11y.ariaDisabled}
66
67
  aria-pressed={kit.a11y.ariaPressed}
@@ -80,6 +81,7 @@
80
81
  role={kit.a11y.role}
81
82
  tabindex={kit.a11y.tabIndex}
82
83
  aria-label={kit.a11y.ariaLabel}
84
+ aria-labelledby={kit.a11y.ariaLabelledBy}
83
85
  aria-busy={kit.a11y.ariaBusy}
84
86
  aria-disabled={kit.a11y.ariaDisabled}
85
87
  aria-pressed={kit.a11y.ariaPressed}
@@ -6,13 +6,10 @@ export interface ButtonProps extends ButtonOptions {
6
6
  class?: string;
7
7
  style?: string;
8
8
  }
9
- export interface IconButtonProps extends Omit<ButtonProps, "children" | "hasVisibleText" | "iconLeft" | "iconOnly" | "iconRight"> {
9
+ export type IconButtonProps = Omit<ButtonProps, "children" | "hasVisibleText" | "iconLeft" | "iconOnly" | "iconRight"> & {
10
10
  icon: IconName;
11
- /** Accessible name — required for icon-only buttons. Prefer `label`; `ariaLabel` also accepted. */
12
- label?: string;
13
- ariaLabel?: string;
14
11
  variant?: ButtonVariant;
15
- }
12
+ };
16
13
  export type PrimaryButtonProps = Omit<ButtonProps, "variant" | "as">;
17
14
  export type SecondaryButtonProps = Omit<ButtonProps, "variant" | "as">;
18
15
  export type TextButtonProps = Omit<ButtonProps, "variant" | "as">;
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@marwes-ui/svelte",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
+ "description": "Accessible, themeable Marwes components for Svelte with static preset CSS and purpose-first APIs.",
5
+ "homepage": "https://marwes.io/docs/get-started/svelte/",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/niklas-westman/marwes.git",
9
+ "directory": "packages/svelte"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/niklas-westman/marwes/issues"
13
+ },
14
+ "keywords": [
15
+ "marwes",
16
+ "svelte",
17
+ "components",
18
+ "design-system",
19
+ "accessibility"
20
+ ],
21
+ "engines": {
22
+ "node": ">=20"
23
+ },
4
24
  "publishConfig": {
5
25
  "access": "public"
6
26
  },
@@ -29,8 +49,8 @@
29
49
  }
30
50
  },
31
51
  "dependencies": {
32
- "@marwes-ui/core": "1.4.1",
33
- "@marwes-ui/presets": "1.4.1"
52
+ "@marwes-ui/core": "1.5.0",
53
+ "@marwes-ui/presets": "1.5.0"
34
54
  },
35
55
  "peerDependencies": {
36
56
  "svelte": "^5.20.0"
@@ -45,7 +65,7 @@
45
65
  "svelte-check": "^4.0.0",
46
66
  "typescript": "5.9.3",
47
67
  "vite": "^6.0.0",
48
- "vitest": "4.1.8"
68
+ "vitest": "4.1.11"
49
69
  },
50
70
  "scripts": {
51
71
  "dev": "svelte-package --watch",