svelte-fluentui 1.3.3 → 1.4.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 +6 -6
- package/dist/components/Select.svelte +13 -0
- package/dist/components/layout/MultiSplitter.svelte +1152 -157
- package/dist/components/layout/MultiSplitter.svelte.d.ts +19 -9
- package/dist/components/layout/MultiSplitterPane.svelte +78 -99
- package/dist/components/layout/MultiSplitterPane.svelte.d.ts +7 -4
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/types/multi-splitter.d.ts +35 -0
- package/dist/types/multi-splitter.js +9 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,18 +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.4.0
|
|
6
|
+
|
|
7
|
+
- **`MultiSplitter` — full rewrite as a Svelte 5 port of pureadmin.io's `pa-splitter`** — The old wrapper was a near-empty shell; the new component (`src/lib/components/layout/MultiSplitter.svelte` + `MultiSplitterPane.svelte`) is a real N-pane resizable container with drag-to-resize using a REBALANCE model (CLASSIC + TUNNEL absorbers so slack can punch through a rail wall), minimize-to-rail via the `minimize` prop with a configurable snap threshold, full keyboard nav + ARIA on the gutter, `localStorage` persistence via the `id` prop, and auto-accordion mode when the container can't fit all panes' mins. Drag math is rAF-throttled with a 2px jitter floor; pane Cards auto-adapt to railed state with the first child becoming a rotated rail title in horizontal orientation. Three callbacks (`onresize`, `oncollapse`, `onexpand`) and full type exports (`MultiSplitterResizeDetail`, `MultiSplitterToggleDetail`).
|
|
8
|
+
- **`MultiSplitter` — gutter drag against a railed pane is a one-way valve: inward inert, outward expands** — Earlier iterations either flipped the rail open instantly on `pointerdown` (the user saw the card "expand" just from pressing the gutter) or refused to expand from any drag at all. Final behaviour: inward drag (toward the rail) bails before reaching the drag math so the gutter doesn't move; outward drag past 2px releases the rail, fires `onexpand`, and grows the pane following the cursor with the rail floor clamping until `primary.min` is reached. Dblclick and rail-body click stay as alternative expand gestures. The result matches what users actually expect from a collapsed pane — you can pull it open but you can't accidentally crush it further.
|
|
9
|
+
- **`Select` — encapsulated in a single render root via `display: contents`** — The component renders 2-4 sibling elements at root depending on mode (label + hidden source mirror + trigger + optional hidden form input in single mode; label + inline listbox in multi mode). That meant a consumer dropping `<Select>` into a flex or grid had to reason about the internal sibling structure to align it. Wrapped everything in `<div class="select-root">` with `display: contents` so the wrapper is invisible to flex/grid layout (children still participate as direct items of the consumer's container), but the component now reads as a single logical root from the outside. Zero behaviour change for existing layout code.
|
|
10
|
+
|
|
5
11
|
## What's New in v1.3.3
|
|
6
12
|
|
|
7
13
|
- **Custom-element attribute bindings stop stringifying `undefined` / `null` / `false`** — Recurring regression (last fixed ~5 months ago, reintroduced during the structural rework) that affected 22 wrappers including `TextField`, `Textarea`, `Switch`, `Slider`, `Checkbox`, `Button`, `Anchor`, `Accordion(Item)`, `BreadcrumbItem`, `DataGrid(Row/Cell)`, `Dialog`, `Listbox`, `MenuButton`, `Option`, `TabPanel`, `Toolbar`, `NumberField`, `Combobox`, plus `Paginator` and `QuickGrid` sub-buttons. Svelte 5 sets properties on custom elements rather than attributes, and FAST's `@attr` decorators stringify whatever they receive — so unset props were rendering as `title="undefined"`, `readonly="false"`, `disabled="false"`, etc. The `readonly`/`disabled` cases were the worst symptom because `[readonly]` and `[disabled]` CSS attribute-presence selectors match regardless of value, leaving an enabled field with a not-allowed cursor. All affected wrappers converted to the conditional-spread pattern (`{...(title ? { title } : {})}`) which physically omits the attribute from the template when unset. Variants `{...(value != null ? { value } : {})}` for inputs (so `value=""` still renders) and `{...(attr !== undefined ? { attr } : {})}` for numeric props (so `0` survives) are used where falsy values are meaningful.
|
|
8
14
|
|
|
9
15
|
- **`TextField` demo page — new Readonly and Disabled example sections** — The `/components/forms/text-field` showcase previously demonstrated only the basic input and `autocomplete` variants; the readonly and disabled states (the surface that exposed the bug above) had no live example. Added Readonly with outline + filled variants and Disabled with three variants (outline + placeholder, outline + value, filled + value).
|
|
10
16
|
|
|
11
|
-
## What's New in v1.3.2
|
|
12
|
-
|
|
13
|
-
- **`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.
|
|
14
|
-
- **`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.
|
|
15
|
-
- **`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.
|
|
16
|
-
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
19
|
- 🎨 **Complete FluentUI Component Set** - Wraps all major FluentUI web components
|
|
@@ -468,6 +468,10 @@
|
|
|
468
468
|
const listboxId = $derived(id ? `${id}-listbox` : undefined)
|
|
469
469
|
</script>
|
|
470
470
|
|
|
471
|
+
<!-- Single DOM root so consumers see one element, not 2–4 siblings. Uses
|
|
472
|
+
display:contents so it's transparent to flex/grid layout in the parent. -->
|
|
473
|
+
<div class="select-root">
|
|
474
|
+
|
|
471
475
|
<!-- svelte-ignore a11y_label_has_associated_control -->
|
|
472
476
|
{#if hasLabel}
|
|
473
477
|
<label class="fluent-label" for={id}>
|
|
@@ -568,7 +572,16 @@
|
|
|
568
572
|
{/if}
|
|
569
573
|
{/if}
|
|
570
574
|
|
|
575
|
+
</div>
|
|
576
|
+
|
|
571
577
|
<style>
|
|
578
|
+
/* Transparent to layout — wraps label + trigger + mirror + portal anchor
|
|
579
|
+
* so consumers only see one root, but parent flex/grid still lays out the
|
|
580
|
+
* inner elements directly. */
|
|
581
|
+
.select-root {
|
|
582
|
+
display: contents;
|
|
583
|
+
}
|
|
584
|
+
|
|
572
585
|
.required-indicator {
|
|
573
586
|
color: var(--error-foreground-rest, #d13438);
|
|
574
587
|
margin-left: 0.25rem;
|