svelte-fluentui 1.3.0 → 1.3.2
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 +12 -17
- package/dist/components/Badge.svelte +5 -1
- package/dist/components/Badge.svelte.d.ts +1 -0
- package/dist/components/QuickGrid.svelte.d.ts +2 -2
- package/dist/components/layout/Panel.svelte +311 -266
- package/dist/components/layout/Panel.svelte.d.ts +1 -0
- package/dist/components/layout/TopNav.svelte +412 -369
- package/dist/components/layout/TopNav.svelte.d.ts +4 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,23 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
A comprehensive Svelte wrapper library for Microsoft FluentUI web components (v2.6.x), providing a seamless way to use FluentUI components in Svelte applications.
|
|
4
4
|
|
|
5
|
-
## What's New in v1.3.
|
|
6
|
-
|
|
7
|
-
- **`
|
|
8
|
-
- **`TopNav`
|
|
9
|
-
- **`
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **`
|
|
17
|
-
- **`Select` rewritten as a custom component** — the wrapped `<fluent-select>` rendered its dropdown listbox inside its own shadow DOM with a static `--max-height`, so inside Dialogs and other overflow-hidden ancestors the option list extended past the viewport with no scroll cutoff. New custom Select portals the listbox to `document.body` via `PositioningRegion` (Floating-UI), so it escapes any clipping ancestor and stays inside the viewport regardless of where the trigger sits. Full keyboard wiring (Arrow/Home/End/Enter/Space/Escape/Tab, single-char type-ahead with cycle-through-matches), multi-mode renders an always-expanded inline listbox matching FluentUI Blazor, and a hidden `<input>` keeps native form submission working. Public API mostly preserved; `value` widened to `string | string[]` for multi mode, `open` is now bindable, and `position` means "force placement" rather than the old static attribute.
|
|
18
|
-
- **`PositioningRegion` — new `availableHeight` prop** — writes the computed remaining viewport height into the `--available-height` CSS custom property on the floating element on every reposition, so dropdowns can cap their max-height with `max-height: var(--available-height, <fallback>)` instead of hard-coding a value that overflows on small screens or near viewport edges. Works alongside `matchWidth` in a single `size()` middleware pass.
|
|
19
|
-
- **`.fluent-value-label` — new canonical class for inline value labels next to a control** — separates field labels (the bold, stacked-above text that names a form field) from value labels (the inline text next to a single control that describes the value, e.g. "Remember me" next to a checkbox). Value labels are normal weight with a pointer cursor, matching FluentUI Blazor's pickers and `<fluent-radio>`'s slotted label. `data-disabled` / `data-readonly` on the wrapper drive a `not-allowed` cursor when the host is inactive.
|
|
20
|
-
- **`Checkbox` & `Switch` — inline label fixes** — labels were rendering bold with a text cursor (using the field-label class) and clicks on the label didn't reliably toggle the control when no `id` was passed. Switched to the new `.fluent-value-label` class, and a stable per-instance `fallbackId` is now used as `<label for>` / element `id` when the caller didn't supply one, so label-click-to-toggle works regardless of whether an `id` was passed in. Applies across all three `labelPosition` values (`top` / `start` / `end`).
|
|
21
|
-
- **`Select` & `Combobox` — field-label class consolidated to shared `.fluent-label`** — both components had component-scoped `.select-label` / `.combobox-label` rules that duplicated the canonical `.fluent-label` declarations from `assets/styles/components.scss`. A single library-wide tweak to label styling now lives in one place. After this change, every component that renders a stacked field label uses `.fluent-label`, Field uses its BEM-namespaced `fluent-field__label`, and Checkbox/Switch use `.fluent-value-label` — three classes total, each with a clear semantic role.
|
|
5
|
+
## What's New in v1.3.2
|
|
6
|
+
|
|
7
|
+
- **`TopNav` — hamburger flexibility via `menuToggleSize` + `menuToggleTemplate`** — `menuToggleSize` (default `42`) flows through a `--topnav-toggle-size` CSS variable so the glyph and close-icon scale proportionally with the box. `menuToggleTemplate: Snippet<[{open, toggle}]>` lets consumers render any button shape — text + chevron, brand-styled accent button, custom SVG — and still wire up state correctly. Both paths render inside a wrapper that owns the visibility/order/collapse rules, so custom templates automatically inherit hide-when-wide / show-when-narrow / stay-visible-when-pinned behavior.
|
|
8
|
+
- **`TopNav` — default hamburger is now a plain `<button>` instead of a fluent-button** — the previous default rendered `<Button appearance="stealth">` which still carried button chrome (hover background fill, boxed visual weight). Replaced with a vanilla `<button>` styled `background: transparent; border: none; padding: 0`, with `opacity: 0.7` on hover and a `:focus-visible` accent outline for keyboard nav. Reads as just the icon, not a button containing an icon. Click target still fills the full `menuToggleSize` box for touch reachability.
|
|
9
|
+
- **`Badge` — new `radius` prop overrides the binary rounded-rect / pill shape with an arbitrary border-radius** — Badge had exactly two shape modes (default 4px corner / `circular={true}` pill) mirroring Microsoft's FluentUI Badge `shape` prop. The new `radius?: string` accepts any CSS length (`8px`, `0.5rem`, `var(--my-radius)`) and emits inline `border-radius`, winning over both class rules via CSS specificity. Plays nicely with `circular={true}` — the circular sizing wins, the radius wins, so you get pill-sized badges with non-pill corners if you want.
|
|
10
|
+
|
|
11
|
+
## What's New in v1.3.1
|
|
12
|
+
|
|
13
|
+
- **`Panel` — new `pinned` prop renders the panel as an inline `<aside>` instead of a portal'd overlay** — flips the rendering entirely: no portal, no backdrop, no transforms, no escape/outside-click handlers, `position: relative` so it participates in the parent's flex/grid layout, `align-self: stretch` so it fills its grid cell vertically. `open` is still respected so the panel can hide and let its grid cell collapse. Explicit z-index forms its own stacking context so overlay Panels opened on top still layer above as expected.
|
|
14
|
+
- **`TopNav` — new `drawerPinned` + `drawerWidth` props turn the drawer into a permanent left rail with an always-visible hamburger toggle** — composes Panel's `pinned` so the same `drawerContent` snippet that renders the mobile overlay drawer also renders the desktop rail. `drawerWidth` (default `"280px"`) propagates to both modes. The hamburger stays visible when pinned so the user can collapse the rail back away, and an effect re-syncs the drawer's `open` state to `drawerPinned` on viewport flips (narrow→wide auto-opens, wide→narrow auto-closes).
|
|
15
|
+
- **Docs layout switched to a single nav surface at every width via `drawerPinned`** — the duplicate desktop sidebar `GridItem` is gone; TopNav's drawer now renders as a pinned `<aside>` at ≥1024px and collapses to the hamburger overlay below. The layout uses CSS Grid with `grid-template-areas` and a `matchMedia` listener to drive `drawerPinned`. The pinned rail is `position: sticky` below the topnav and the scrollbar sits flush with the rail's inside edge.
|
|
16
|
+
- **`TopNav` — tightened horizontal padding from `1.5rem` to `0.5rem`** — the bar's inside edges felt cramped relative to the rest of the content. Brand + hamburger now sit closer to the inline-start edge and the action slot sits closer to the inline-end edge.
|
|
22
17
|
|
|
23
18
|
## Features
|
|
24
19
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
fill?: string
|
|
19
19
|
appearance?: BadgeAppearance
|
|
20
20
|
circular?: boolean
|
|
21
|
+
radius?: string
|
|
21
22
|
children?: SlotType
|
|
22
23
|
onclick?: (ev: MouseEvent) => void
|
|
23
24
|
class?: string
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
fill = undefined,
|
|
30
31
|
appearance = "lightweight",
|
|
31
32
|
circular = false,
|
|
33
|
+
radius = undefined,
|
|
32
34
|
children = undefined,
|
|
33
35
|
onclick = undefined,
|
|
34
36
|
class: className = "",
|
|
@@ -51,7 +53,9 @@
|
|
|
51
53
|
return styles
|
|
52
54
|
})
|
|
53
55
|
|
|
54
|
-
let
|
|
56
|
+
let radiusStyle = $derived(radius ? `border-radius: ${radius};` : "")
|
|
57
|
+
|
|
58
|
+
let computedStyle = $derived([colorStyles, radiusStyle, style].filter(Boolean).join(" "))
|
|
55
59
|
|
|
56
60
|
let classes = $derived.by(() => {
|
|
57
61
|
let cls = ["badge"]
|
|
@@ -764,7 +764,7 @@ declare function $$render<T>(): {
|
|
|
764
764
|
row: T;
|
|
765
765
|
rowIndex: number;
|
|
766
766
|
}) => void | Promise<void>) | undefined;
|
|
767
|
-
}, "
|
|
767
|
+
}, "group" | "title" | "icon" | "id" | "row">> & Omit<{
|
|
768
768
|
id: string;
|
|
769
769
|
icon: string;
|
|
770
770
|
title: string;
|
|
@@ -778,7 +778,7 @@ declare function $$render<T>(): {
|
|
|
778
778
|
row: T;
|
|
779
779
|
rowIndex: number;
|
|
780
780
|
}) => void | Promise<void>) | undefined;
|
|
781
|
-
}, "
|
|
781
|
+
}, "group" | "title" | "icon" | "id" | "row">;
|
|
782
782
|
rowIndex: number;
|
|
783
783
|
row: T;
|
|
784
784
|
}) => void) | undefined;
|