@synopackageland/ui 0.19.2 → 0.19.4

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
  # Changelog
2
2
 
3
+ ## 0.19.4 (2026-11-02)
4
+
5
+ - `SegmentControl`'s selected fill slides from the old item to the new one in 120ms, like the tab notch; a `variant="sheet"` tab's accent line slides the same way. Only transform and width move, through a `.ui-segment-thumb` shown while it slides (`data-ui-segment-moving`). The first render, a resize and a relabel do not move it, and reduced motion or `data-ui-motion="off"` switches at once.
6
+ - New `MotionSwap` for content switched by a control or a route: `<MotionSwap :value="view">` rises what it holds 4px and fades it in over 180ms each time `value` changes, like a switched tab panel. Not on first render, the old content goes at once, the slot is not remounted, and reduced motion turns it off. Pair it with `SegmentControl`, or wrap an App shell's router view ([README](README.md#segmentcontrol-and-the-views-it-switches)).
7
+ - `AppLayout`'s page content rises in the same way after navigating with its `AppSidebar` (side or top) or `AppTabBar`; the first load does not. Only opacity and a translate move, so the page height and scroll stay put.
8
+ - Fix a `DatePicker` field being about 8px taller than a text input beside it: its inline root sat on the text baseline and left a descender gap below, so in a row of fields its label and box sat higher than its neighbours'. The root now aligns to the top of its line.
9
+ - New `AvatarStack`: people as overlapping round avatars (a board card's assignees) with each name in a tooltip, the group named for screen readers, and a "+n" circle past `max` (default 3). The comment avatar is exported as `Avatar`, and both take `initials` (one or two letters) instead of the name's first character.
10
+ - `Dialog` takes a `header` slot: what it holds (a breadcrumb, a menu) fills the header strip beside the close button, and the `title` stays as the dialog's accessible name only. New `maxHeight` caps the panel (default 85vh), and `fullscreen` fills the viewport: `true` always, `'mobile'` at 640px and narrower, with `data-ui-dialog-fullscreen` set.
11
+ - `ImageLightbox` has a Rotate button on pictures: each press turns the picture a quarter turn clockwise for viewing, such as a receipt photographed sideways. The file is unchanged and the next file opens upright; `data-ui-lightbox-rotate` carries `data-turns` while turned.
12
+
13
+ ## 0.19.3 (2026-11-02)
14
+
15
+ - Fix the library's own text (a `SettingsPage` footer's Reset and Apply, Close, pagination, validation) showing English in an App that names its language only on `AppRoot`'s `lang` or not at all. `AppRoot` takes a `locale` prop and otherwise reads its `lang` attribute; with neither, and no `ConfigProvider locale` above, the text follows DSM's language in a DSM window, then the browser's, then English. `toUiLocale()` and `detectUiLocale()` map DSM codes (`cht`, `jpn`, …) and BCP-47 tags.
16
+ - Fix a `SettingsPage` footer in a page with gutters (`PageContent`, an App shell) drawn as a box inset by the gutter: it now reaches both edges of the content area as DSM's footer does, its buttons on the content's right edge. `PageContent` sets `--ui-page-gutter-x` for this.
17
+ - Library text in every language ends without a closing period (Version 2.0.0 is available, Could not check for updates, FilePicker's rejections); periods between sentences stay.
18
+
3
19
  ## 0.19.2 (2026-11-01)
4
20
 
5
21
  - Fix `FacetPanel` values showing no box until picked: a filter list read as blank space beside its labels. Every value now shows the Checkbox's box, empty until picked and ticked once picked, in the panel and in the phone sheet.
package/README.md CHANGED
@@ -188,6 +188,11 @@ Inside `AppRoot`, a nested `ConfigProvider` (for `dir` or `locale`) must pass
188
188
  the same `teleport-to`, and your own `<Teleport>`s must target an element inside
189
189
  the root.
190
190
 
191
+ The library's own text (Reset, Apply, Close, …) follows `AppRoot`'s `locale`
192
+ prop, else its `lang` attribute (`<AppRoot :lang="locale">`), else a
193
+ `ConfigProvider locale` above it, else DSM's language in a DSM window, then the
194
+ browser's. Pass the language your App shows so both read alike.
195
+
191
196
  Theme overrides go on your own app root, after the library stylesheet. Use a
192
197
  package-specific selector, so an override does not also match other apps:
193
198
 
@@ -516,7 +521,7 @@ Primitives:
516
521
  - Sheet / Drawer — `:modal="false"` overlays the page without blocking it
517
522
  - DatePicker
518
523
  - ToastProvider + `useToast()`
519
- - Tabs / Accordion
524
+ - Tabs / Accordion / MotionSwap (content switched by a control or a route rises in, as a switched tab panel does)
520
525
 
521
526
  DSM-style application building blocks:
522
527
 
@@ -578,9 +583,48 @@ on the strip (`nav`).
578
583
  ```
579
584
 
580
585
  Navigation-only `SectionTabs` usage still works. For content managed separately
581
- by the caller, add `class="ui-tab-panel"` to a panel keyed by the selected value
582
- to use the same short fade. These effects and the loading ring respect the
583
- system's reduced-motion preference.
586
+ by the caller, wrap it in `MotionSwap` (below) for the same short rise. These
587
+ effects and the loading ring respect the system's reduced-motion preference.
588
+
589
+ ### SegmentControl and the views it switches
590
+
591
+ When the selection changes, `SegmentControl`'s selected fill (the accent line
592
+ of a `variant="sheet"` tab) slides from the old item to the new one in 120ms,
593
+ like the tab notch. The first render, a resize and a relabel do not move it;
594
+ under reduced motion or `data-ui-motion="off"` it switches at once.
595
+
596
+ Pair the control with its views through `MotionSwap`, keyed by the same value.
597
+ A view switched to rises 4px and fades in over 180ms, like a switched tab
598
+ panel; the view shown first does not animate, the old view goes at once, and
599
+ the slot is not remounted by `MotionSwap` itself:
600
+
601
+ ```vue
602
+ <SegmentControl v-model="view" aria-label="Health views">
603
+ <SegmentItem value="security">Security</SegmentItem>
604
+ <SegmentItem value="storage">Storage</SegmentItem>
605
+ </SegmentControl>
606
+ <MotionSwap :value="view">
607
+ <SecurityView v-if="view === 'security'" />
608
+ <StorageView v-else />
609
+ </MotionSwap>
610
+ ```
611
+
612
+ `AppLayout` does the same for its page: navigating with its `AppSidebar` (side
613
+ or top) or `AppTabBar` rises the page content in; the first load does not. An
614
+ App with its own shell wraps its router view instead (mount the App after
615
+ `router.isReady()`, so the first route is not a change):
616
+
617
+ ```vue
618
+ <RouterView v-slot="{ Component, route }">
619
+ <MotionSwap :value="route.path" class="min-h-0 flex-1">
620
+ <component :is="Component" />
621
+ </MotionSwap>
622
+ </RouterView>
623
+ ```
624
+
625
+ Only opacity and a translate move, so the page height and scroll position stay
626
+ put. While it rises (180ms) the content is a containing block for
627
+ `position: fixed` descendants.
584
628
 
585
629
  ### StatTile: counts that filter
586
630
 
@@ -679,7 +723,7 @@ already matched them. With `maxlength` the box counts characters near and over
679
723
  the limit and never cuts text.
680
724
 
681
725
  `FileThumbs` shows a few thumbnails and "+N", `ImageLightbox` shows files full
682
- size (arrow keys and swipes), and `UploadQueue` lists uploads with progress,
726
+ size (arrow keys and swipes; Rotate turns a picture for viewing), and `UploadQueue` lists uploads with progress,
683
727
  retry and cancel. `useUploadQueue(upload, { concurrency, retries })` runs the
684
728
  uploads it shows. `FilePicker` takes pasted files with `paste`.
685
729
 
@@ -1,3 +1,4 @@
1
+ import { UiLocale } from '../../../i18n/locale';
1
2
  type __VLS_Props = {
2
3
  modalScope?: 'document' | 'app';
3
4
  /**
@@ -18,6 +19,12 @@ type __VLS_Props = {
18
19
  * `<html>` instead, but then passes `dark` here too when it sets an accent.
19
20
  */
20
21
  colorScheme?: 'light' | 'dark';
22
+ /**
23
+ * The language of the library's own text (Reset, Apply, Close, ...). Without
24
+ * it the root's `lang` attribute names it, then an enclosing ConfigProvider,
25
+ * then DSM's language in a DSM window, then the browser's.
26
+ */
27
+ locale?: UiLocale;
21
28
  };
22
29
  declare var __VLS_7: {}, __VLS_9: {};
23
30
  type __VLS_Slots = {} & {
@@ -2,12 +2,14 @@ type __VLS_Props = {
2
2
  name: string;
3
3
  id?: string;
4
4
  src?: string;
5
+ initials?: string;
5
6
  size?: 'sm' | 'md';
6
7
  };
7
8
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
9
  size: "sm" | "md";
9
10
  id: string;
10
11
  src: string;
12
+ initials: string;
11
13
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
14
  declare const _default: typeof __VLS_export;
13
15
  export default _default;
@@ -297,10 +297,10 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
297
297
  }) => any) | undefined;
298
298
  onCellUpdate?: ((value: DataGridCellUpdate) => any) | undefined;
299
299
  }>, {
300
- footer: boolean;
301
- filter: string;
302
300
  sort: DataGridSort | null;
301
+ filter: string;
303
302
  fill: boolean;
303
+ footer: boolean;
304
304
  loading: boolean;
305
305
  group: DataGridGroup | null;
306
306
  loadingText: string;
@@ -0,0 +1,14 @@
1
+ import { AvatarPerson } from './types';
2
+ type __VLS_Props = {
3
+ people: AvatarPerson[];
4
+ max?: number;
5
+ label?: string;
6
+ size?: 'sm' | 'md';
7
+ };
8
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ label: string;
10
+ size: "sm" | "md";
11
+ max: number;
12
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,7 @@
1
+ /** One person in an AvatarStack: the name shows in the tooltip; `id` keeps the colour, `src` is a picture. */
2
+ export type AvatarPerson = {
3
+ name: string;
4
+ id?: string;
5
+ src?: string;
6
+ initials?: string;
7
+ };
@@ -14,6 +14,10 @@ type __VLS_Props = {
14
14
  height?: string;
15
15
  /** Keeps the panel from shrinking with short content, capped to the available height. */
16
16
  minHeight?: string;
17
+ /** The tallest the panel grows before its body scrolls (default 85vh), capped to the available height. */
18
+ maxHeight?: string;
19
+ /** Fills the viewport: `true` always, `'mobile'` only on a phone-width screen (640px and narrower), for a dialog that is a page there. */
20
+ fullscreen?: boolean | 'mobile';
17
21
  closeLabel?: string;
18
22
  /** Hides the header close affordance for fixed-flow dialogs that own their dismiss path. */
19
23
  showClose?: boolean;
@@ -26,13 +30,15 @@ type __VLS_Props = {
26
30
  /** The mask over the app behind: `dim` (default), `light` (a faint tint, as DSM leaves the window behind a wizard) or `none`. It blocks presses in each case. */
27
31
  scrim?: 'dim' | 'light' | 'none';
28
32
  };
29
- declare var __VLS_14: {}, __VLS_73: {}, __VLS_81: {};
33
+ declare var __VLS_14: {}, __VLS_62: {}, __VLS_75: {}, __VLS_83: {};
30
34
  type __VLS_Slots = {} & {
31
35
  trigger?: (props: typeof __VLS_14) => any;
32
36
  } & {
33
- default?: (props: typeof __VLS_73) => any;
37
+ header?: (props: typeof __VLS_62) => any;
34
38
  } & {
35
- footer?: (props: typeof __VLS_81) => any;
39
+ default?: (props: typeof __VLS_75) => any;
40
+ } & {
41
+ footer?: (props: typeof __VLS_83) => any;
36
42
  };
37
43
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
38
44
  escapeKeyDown: (event: KeyboardEvent) => any;
@@ -0,0 +1,21 @@
1
+ type __VLS_Props = {
2
+ /** What is shown; each change plays the rise-in. Usually the control's `v-model` or the route path. */
3
+ value: unknown;
4
+ /** Wrapper element. */
5
+ as?: string;
6
+ };
7
+ declare var __VLS_9: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_9) => any;
10
+ };
11
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
12
+ as: string;
13
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -1,6 +1,15 @@
1
1
  import { ComputedRef, InjectionKey } from 'vue';
2
2
  export type UiLocale = 'en' | 'zh-TW' | 'zh-CN' | 'ja' | 'ko' | 'de' | 'fr' | 'es' | 'it';
3
+ export declare const UI_LOCALES: readonly UiLocale[];
3
4
  export declare const UI_LOCALE_KEY: InjectionKey<ComputedRef<UiLocale>>;
5
+ /** The built-in locale for a DSM language code or a BCP-47 tag, or undefined
6
+ * when the library has no text for it. Chinese without a region reads as
7
+ * Traditional only for Taiwan, Hong Kong and Macau scripts and regions. */
8
+ export declare function toUiLocale(tag: string | null | undefined): UiLocale | undefined;
9
+ /** The language the page runs in when no AppRoot or ConfigProvider names one:
10
+ * DSM's language in a DSM window (DSM reloads the window when it changes),
11
+ * else the browser's, else English. */
12
+ export declare function detectUiLocale(): UiLocale;
4
13
  export declare function useUiLocale(own: () => UiLocale | undefined): ComputedRef<UiLocale>;
5
14
  /** Named placeholders let applications translate messages without concatenating English. */
6
15
  export declare function formatUiText(template: string, values: Record<string, string | number>): string;
@@ -25,6 +25,7 @@ export declare const englishUiText: {
25
25
  readonly "Links start with http://, https:// or mailto:": "Links start with http://, https:// or mailto:";
26
26
  readonly "Mention someone": "Mention someone";
27
27
  readonly "Next file": "Next file";
28
+ readonly Rotate: "Rotate";
28
29
  readonly "Numbered list": "Numbered list";
29
30
  readonly "Open {name}": "Open {name}";
30
31
  readonly "Previous file": "Previous file";
@@ -156,15 +157,15 @@ export declare const englishUiText: {
156
157
  readonly "Enter password": "Enter password";
157
158
  readonly "Unsaved changes": "Unsaved changes";
158
159
  readonly "Save your changes before closing?": "Save your changes before closing?";
159
- readonly "The value is not valid.": "The value is not valid.";
160
+ readonly "The value is not valid.": "The value is not valid";
160
161
  readonly "About this application": "About this application";
161
162
  readonly BETA: "BETA";
162
163
  readonly "Version {version}": "Version {version}";
163
164
  readonly "Checking for updates\u2026": "Checking for updates…";
164
- readonly "Version {version} is available.": "Version {version} is available.";
165
- readonly "Beta version {version} is available.": "Beta version {version} is available.";
166
- readonly "Could not check for updates.": "Could not check for updates.";
167
- readonly "You have the latest version.": "You have the latest version.";
165
+ readonly "Version {version} is available.": "Version {version} is available";
166
+ readonly "Beta version {version} is available.": "Beta version {version} is available";
167
+ readonly "Could not check for updates.": "Could not check for updates";
168
+ readonly "You have the latest version.": "You have the latest version";
168
169
  readonly "Could not refresh. Showing previous data": "Could not refresh. Showing previous data";
169
170
  readonly Retry: "Retry";
170
171
  readonly "Release notes": "Release notes";
@@ -225,7 +226,7 @@ export declare const englishUiText: {
225
226
  readonly "Copy path": "Copy path";
226
227
  readonly "Path: {path}": "Path: {path}";
227
228
  readonly Copied: "Copied";
228
- readonly "Couldn't copy. Select the text and copy it manually.": "Couldn't copy. Select the text and copy it manually.";
229
+ readonly "Couldn't copy. Select the text and copy it manually.": "Couldn't copy. Select the text and copy it manually";
229
230
  readonly "Couldn't copy": "Couldn't copy";
230
231
  readonly "Clear filters": "Clear filters";
231
232
  readonly Filters: "Filters";
package/dist/index.d.ts CHANGED
@@ -100,6 +100,7 @@ export { default as Pagination } from './components/primitives/pagination/Pagina
100
100
  export type { PaginationBeforeSwitchPage, PaginationLabels, PaginationPageSizeOption, PaginationSwitch, PaginationTotalTextMode, } from './components/primitives/pagination/Pagination.vue';
101
101
  export { default as SegmentControl } from './components/primitives/segment-control/SegmentControl.vue';
102
102
  export { default as SegmentItem } from './components/primitives/segment-control/SegmentItem.vue';
103
+ export { default as MotionSwap } from './components/primitives/motion/MotionSwap.vue';
103
104
  export { default as SearchField } from './components/composite/search-field/SearchField.vue';
104
105
  export { default as SettingsRow } from './components/composite/settings-row/SettingsRow.vue';
105
106
  export { default as FormActions } from './components/composite/form-actions/FormActions.vue';
@@ -140,6 +141,9 @@ export type { FacetGroup, FacetSelection, FacetValue } from './components/compos
140
141
  export { default as TagEditor } from './components/composite/tag-editor/TagEditor.vue';
141
142
  export { default as CompletionToggle } from './components/composite/completion-toggle/CompletionToggle.vue';
142
143
  export { default as CommentItem } from './components/composite/comment-item/CommentItem.vue';
144
+ export { default as Avatar } from './components/composite/comment-item/PersonInitials.vue';
145
+ export { default as AvatarStack } from './components/primitives/avatar/AvatarStack.vue';
146
+ export type { AvatarPerson } from './components/primitives/avatar/types';
143
147
  export { mentionParts } from './lib/mentions';
144
148
  export { default as MentionList } from './components/composite/mention-list/MentionList.vue';
145
149
  export type { MentionCandidate, MentionPart } from './lib/mentions';
@@ -265,6 +269,7 @@ export { default as OverflowToolbar } from './components/composite/overflow-tool
265
269
  export { computeOverflowFit, ITEM_GAP } from './components/composite/overflow-toolbar/overflow';
266
270
  export type { OverflowToolbarItem, OverflowToolbarMenuEntry, OverflowToolbarMoreMenu, OverflowToolbarMoreState, OverflowToolbarMoreText, } from './components/composite/overflow-toolbar/types';
267
271
  export type { UiLocale } from './i18n/locale';
272
+ export { detectUiLocale, toUiLocale, UI_LOCALES } from './i18n/locale';
268
273
  export { useUiText } from './i18n/text';
269
274
  export type { UiTextKey } from './i18n/text';
270
275
  export { filePickerText } from './i18n/filePicker';