@synopackageland/ui 0.22.0 → 0.23.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -0
  3. package/dist/cli.js +0 -0
  4. package/dist/components/app/app-layout/AppLayout.vue.d.ts +5 -2
  5. package/dist/components/composite/about-dialog/AboutDialog.vue.d.ts +1 -1
  6. package/dist/components/composite/adaptive-panel/AdaptivePanel.vue.d.ts +1 -1
  7. package/dist/components/composite/disclosure-row/DisclosureRow.vue.d.ts +39 -0
  8. package/dist/components/composite/record-panel/RecordPanel.vue.d.ts +1 -1
  9. package/dist/components/containers/split-pane/SplitPane.vue.d.ts +1 -1
  10. package/dist/components/feedback/validation-popup/ValidationPopup.vue.d.ts +1 -1
  11. package/dist/components/primitives/button/Button.vue.d.ts +7 -1
  12. package/dist/components/primitives/checkbox/CheckboxGroup.vue.d.ts +1 -1
  13. package/dist/components/primitives/dropdown-menu/types.d.ts +6 -0
  14. package/dist/components/primitives/pagination/Pagination.vue.d.ts +1 -1
  15. package/dist/components/primitives/popover/Popover.vue.d.ts +1 -1
  16. package/dist/components/primitives/progress/Progress.vue.d.ts +1 -1
  17. package/dist/components/primitives/tooltip/tooltipStyle.d.ts +1 -1
  18. package/dist/components/rich-text-editor/RichTextEditor.vue.d.ts +1 -1
  19. package/dist/feedback/StatusSlot.vue.d.ts +1 -1
  20. package/dist/grid-core/theme.d.ts +2 -1
  21. package/dist/grid.js +253 -251
  22. package/dist/index.d.ts +3 -0
  23. package/dist/index.js +13855 -13595
  24. package/dist/json/catalog.d.ts +2 -0
  25. package/dist/json/registry.d.ts +34 -0
  26. package/dist/json-ai-prompt.md +1 -1
  27. package/dist/json-catalog.schema.json +2 -1
  28. package/dist/json-preview/preview.js +8669 -8605
  29. package/dist/json.js +23 -23
  30. package/dist/lib/adaptiveLayout.d.ts +17 -0
  31. package/dist/lib/scroll.d.ts +31 -0
  32. package/dist/lib/typeScale.d.ts +20 -0
  33. package/dist/reka-runtime.json +1 -1
  34. package/dist/theme.css +1 -1
  35. package/dist/themes/dsm7-embedded-theme.css +1 -1
  36. package/dist/themes/dsm7-embedded.css +1 -1
  37. package/dist/themes/dsm7.css +1 -1
  38. package/docs/button-policy.md +19 -2
  39. package/docs/mobile-native.md +142 -29
  40. package/package.json +67 -59
package/dist/json.js CHANGED
@@ -8,14 +8,14 @@ import { schema as G } from "@json-render/vue/schema";
8
8
  import { schema as Tt } from "@json-render/vue/schema";
9
9
  import { h as d, defineComponent as H, openBlock as X, createBlock as Y, unref as j, withCtx as Q, createVNode as Z } from "vue";
10
10
  import { LoadingArea as ee, InputGroup as te, ListItem as oe, CellStatus as ne, CellText as ie, DataTable as K, Dialog as ae, Badge as se, Progress as re, EmptyState as le, Callout as ce, Card as de, Surface as pe, SettingsRow as ue, SettingsSection as me, FormItem as he, Form as fe, RadioGroup as ge, Switch as be, Checkbox as ye, Select as we, Input as ve, Button as Se, SectionTabs as $e, AppSidebar as je, AppToolbar as xe, PageHeader as Oe, PageContent as Ae, ResponsiveView as ke, AppLayout as Pe, AppRoot as Ce, getRegisteredIcon as Ie } from "./index.js";
11
- const J = t.lazy(() => t.object({
11
+ const z = t.lazy(() => t.object({
12
12
  key: t.string(),
13
13
  label: t.string(),
14
14
  icon: t.string().optional(),
15
15
  badge: t.union([t.string(), t.number()]).optional(),
16
16
  disabled: t.boolean().optional(),
17
17
  selectable: t.boolean().optional(),
18
- children: t.array(J).optional()
18
+ children: t.array(z).optional()
19
19
  })), P = t.object({
20
20
  label: t.string(),
21
21
  value: t.string(),
@@ -29,7 +29,7 @@ const J = t.lazy(() => t.object({
29
29
  /** Sets the alignment: DSM keeps every column left; number and date digits get one width. */
30
30
  type: t.enum(["text", "number", "date", "actions"]).optional(),
31
31
  align: t.enum(["left", "center", "right"]).optional()
32
- }), V = {
32
+ }), J = {
33
33
  AppRoot: {
34
34
  props: t.object({
35
35
  modalScope: t.enum(["document", "app"]).optional()
@@ -79,7 +79,7 @@ const J = t.lazy(() => t.object({
79
79
  value: t.string().optional(),
80
80
  groups: t.array(t.object({
81
81
  label: t.string().optional(),
82
- items: t.array(J)
82
+ items: t.array(z)
83
83
  })),
84
84
  searchable: t.boolean().optional(),
85
85
  collapsible: t.boolean().optional(),
@@ -118,7 +118,7 @@ const J = t.lazy(() => t.object({
118
118
  Button: {
119
119
  props: t.object({
120
120
  label: t.string(),
121
- variant: t.enum(["primary", "secondary", "ghost", "danger", "danger-outline"]).optional(),
121
+ variant: t.enum(["primary", "secondary", "ghost", "danger", "danger-outline", "text"]).optional(),
122
122
  size: t.enum(["sm", "md", "lg"]).optional(),
123
123
  disabled: t.boolean().optional(),
124
124
  loading: t.boolean().optional(),
@@ -361,7 +361,7 @@ const J = t.lazy(() => t.object({
361
361
  description: "Centered loading state for a page or bounded region."
362
362
  }
363
363
  }, A = F(G, {
364
- components: V,
364
+ components: J,
365
365
  actions: {}
366
366
  }), Ke = [
367
367
  "Prefer AppRoot > AppShell > Page as the normal DSM application hierarchy.",
@@ -392,17 +392,17 @@ function Ne(e) {
392
392
  function C(e) {
393
393
  return e ? Ie(e) : void 0;
394
394
  }
395
- function _(e) {
395
+ function V(e) {
396
396
  return {
397
397
  ...e,
398
398
  icon: C(e.icon),
399
- children: e.children?.map(_)
399
+ children: e.children?.map(V)
400
400
  };
401
401
  }
402
402
  function Ee(e) {
403
- return e.map((o) => ({ ...o, items: o.items.map(_) }));
403
+ return e.map((o) => ({ ...o, items: o.items.map(V) }));
404
404
  }
405
- const Je = {
405
+ const ze = {
406
406
  AppRoot: ({ props: e, slots: o }) => d(Ce, { modalScope: e.modalScope }, o),
407
407
  AppShell: ({ props: e, slots: o }) => d(Pe, {
408
408
  sidebarWidth: e.sidebarWidth,
@@ -452,7 +452,7 @@ const Je = {
452
452
  }, o),
453
453
  Text: ({ props: e }) => {
454
454
  const o = e.variant ?? "body";
455
- return d(o === "heading" ? "h2" : o === "mono" ? "code" : "span", { class: o === "muted" ? "text-[length:var(--ui-font-size-control)] text-[var(--ui-text-muted)]" : o === "caption" ? "text-[12px] text-[var(--ui-text-muted)]" : o === "heading" ? "text-[16px] font-semibold text-[var(--ui-text)]" : o === "mono" ? "font-mono text-[12px] text-[var(--ui-text)]" : "text-[length:var(--ui-font-size-control)] text-[var(--ui-text)]", "data-syno-pkg-land-ui": "" }, e.text);
455
+ return d(o === "heading" ? "h2" : o === "mono" ? "code" : "span", { class: o === "muted" ? "text-[length:var(--ui-font-size-control)] text-[var(--ui-text-muted)]" : o === "caption" ? "text-[length:var(--ui-font-size-sm)] text-[var(--ui-text-muted)]" : o === "heading" ? "text-[length:var(--ui-font-size-title)] font-semibold text-[var(--ui-text)]" : o === "mono" ? "font-mono text-[length:var(--ui-font-size-sm)] text-[var(--ui-text)]" : "text-[length:var(--ui-font-size-control)] text-[var(--ui-text)]", "data-syno-pkg-land-ui": "" }, e.text);
456
456
  },
457
457
  Button: ({ props: e, emit: o }) => {
458
458
  const n = C(e.icon);
@@ -617,7 +617,7 @@ const Je = {
617
617
  InputGroup: ({ slots: e }) => d(te, null, e),
618
618
  Loading: ({ props: e }) => d(ee, { text: e.text })
619
619
  }, { registry: D } = W(A, {
620
- components: Je
620
+ components: ze
621
621
  }), ut = /* @__PURE__ */ H({
622
622
  __name: "SynoJsonRenderer",
623
623
  props: {
@@ -656,12 +656,12 @@ const Je = {
656
656
  _: 1
657
657
  }, 8, ["registry", "store", "initial-state", "handlers", "navigate", "functions", "directives", "validation-functions", "on-state-change"]));
658
658
  }
659
- }), Ve = ["label", "title", "description", "text", "placeholder", "emptyText", "help", "ariaLabel", "valueLabel", "searchPlaceholder"];
660
- function z(e, o = "") {
661
- return Array.isArray(e) ? e : Object.entries(e).flatMap(([n, a]) => m(a) ? z(a, `${o}${n}.`) : [`${o}${n}`]);
659
+ }), Je = ["label", "title", "description", "text", "placeholder", "emptyText", "help", "ariaLabel", "valueLabel", "searchPlaceholder"];
660
+ function _(e, o = "") {
661
+ return Array.isArray(e) ? e : Object.entries(e).flatMap(([n, a]) => m(a) ? _(a, `${o}${n}.`) : [`${o}${n}`]);
662
662
  }
663
663
  const m = (e) => typeof e == "object" && e !== null && !Array.isArray(e), u = (...e) => e.map((o) => "/" + String(o).replaceAll("~", "~0").replaceAll("/", "~1")).join("");
664
- function _e(e, o) {
664
+ function Ve(e, o) {
665
665
  const n = Array.from({ length: o.length + 1 }, (a, i) => i);
666
666
  for (let a = 1; a <= e.length; a++) {
667
667
  let i = n[0];
@@ -676,12 +676,12 @@ function _e(e, o) {
676
676
  function y(e, o) {
677
677
  let n, a = 1 / 0;
678
678
  for (const i of o) {
679
- const s = _e(e, i);
679
+ const s = Ve(e, i);
680
680
  s < a && ([n, a] = [i, s]);
681
681
  }
682
682
  return n !== void 0 && a <= Math.max(2, Math.floor(e.length / 3)) ? n : void 0;
683
683
  }
684
- const ze = ["$state", "$item", "$index", "$bindState", "$bindItem", "$cond", "$computed", "$template"], qe = (e) => m(e) && ze.some((o) => Object.hasOwn(e, o)), I = (e) => qe(e) || (Array.isArray(e) ? e.some(I) : m(e) && Object.values(e).some(I));
684
+ const _e = ["$state", "$item", "$index", "$bindState", "$bindItem", "$cond", "$computed", "$template"], qe = (e) => m(e) && _e.some((o) => Object.hasOwn(e, o)), I = (e) => qe(e) || (Array.isArray(e) ? e.some(I) : m(e) && Object.values(e).some(I));
685
685
  function k(e) {
686
686
  const o = e.props?.shape;
687
687
  return m(o) ? o : void 0;
@@ -730,7 +730,7 @@ function mt(e, o = {}) {
730
730
  }
731
731
  Be(i, p, h, a[h], f.props), Me(i, p, h, a[h], f, s);
732
732
  }
733
- const c = o.messages && z(o.messages), l = {
733
+ const c = o.messages && _(o.messages), l = {
734
734
  issues: i,
735
735
  components: a,
736
736
  actions: [
@@ -942,7 +942,7 @@ const Ye = ["statePath", "clearStatePath"];
942
942
  function Qe(e, o, n, a) {
943
943
  const i = (...c) => u("elements", o, ...c);
944
944
  if ($(e, o, n.props, i("props"), a), e.messageKeys && m(n.props))
945
- for (const c of Ve) {
945
+ for (const c of Je) {
946
946
  const l = n.props[c];
947
947
  typeof l == "string" && l.trim() && e.issues.warn({
948
948
  code: "literal_text",
@@ -999,7 +999,7 @@ function U(e, o, n, a, i) {
999
999
  function T(e) {
1000
1000
  return { valid: e.errors.length === 0, errors: e.errors, warnings: e.warnings };
1001
1001
  }
1002
- const x = V;
1002
+ const x = J;
1003
1003
  function Ze(e) {
1004
1004
  const o = t.toJSONSchema(e);
1005
1005
  return delete o.$schema, o;
@@ -1160,9 +1160,9 @@ export {
1160
1160
  pt as synoJsonAiPrompt,
1161
1161
  Ke as synoJsonAiRules,
1162
1162
  A as synoJsonCatalog,
1163
- V as synoJsonComponentDefinitions,
1163
+ J as synoJsonComponentDefinitions,
1164
1164
  D as synoJsonRegistry,
1165
- Je as synoJsonRenderers,
1165
+ ze as synoJsonRenderers,
1166
1166
  bt as synoJsonSchema,
1167
1167
  Kt as useActions,
1168
1168
  Lt as useBoundProp,
@@ -1,4 +1,5 @@
1
1
  import { ComputedRef, InjectionKey, Ref } from 'vue';
2
+ import { DropdownMenuEntry } from '../components/primitives/dropdown-menu/types';
2
3
  export type AppPresentation = 'mobile' | 'window' | 'web';
3
4
  /** Container widths, never global viewport breakpoints: DSM windows share a wide host viewport. */
4
5
  export declare const MOBILE_LAYOUT_MAX = 640;
@@ -72,6 +73,22 @@ export type AppNavigationDrawer = {
72
73
  claim: () => () => void;
73
74
  };
74
75
  export declare const APP_NAVIGATION_DRAWER_KEY: InjectionKey<AppNavigationDrawer>;
76
+ /**
77
+ * The phone bar's one overflow menu. A DropdownMenu registers here; while the
78
+ * last registered menu whose trigger is in the bar's page actions is the
79
+ * page's "…", the layout's `headerActions` (an App shell's account entry too)
80
+ * join it after a separator instead of a second "…" of the layout's own.
81
+ */
82
+ export type AppBarMenu = {
83
+ /** The menu that takes the layout's entries, or null when the layout keeps its own "…". */
84
+ owner: Readonly<Ref<symbol | null>>;
85
+ /** The layout's entries for the owner to append, without the leading separator. */
86
+ entries: ComputedRef<DropdownMenuEntry[]>;
87
+ /** A pick of one of those entries (AppLayout emits `headerAction`). */
88
+ select: (key: string) => void;
89
+ register: (id: symbol, trigger: () => HTMLElement | null | undefined) => () => void;
90
+ };
91
+ export declare const APP_BAR_MENU_KEY: InjectionKey<AppBarMenu>;
75
92
  /** AppSidebar and AppTabBar report a change of the selected page, so AppLayout's content rises in. */
76
93
  export declare const APP_PAGE_CHANGE_KEY: InjectionKey<() => void>;
77
94
  /**
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Scrolling an element into view inside the one scroller that holds it. On a
3
+ * phone the page scrolls in the layout's main area or in a PageContent; on a
4
+ * desktop often in a pane or the document. `Element.scrollIntoView` moves
5
+ * every scrollable ancestor (and can shift a whole App inside DSM), so these
6
+ * move only the nearest one, and stop the target below what sticks at the top
7
+ * of the page (`--ui-sticky-top-offset`, set by PageContent, read through the
8
+ * target's `scroll-margin-top`).
9
+ */
10
+ export type ScrollAlign = 'start' | 'nearest';
11
+ export type ScrollWithinOptions = {
12
+ /** `start` puts the target at the top; `nearest` (default) moves only as far as needed. */
13
+ block?: ScrollAlign;
14
+ /** Defaults to `smooth`, and `auto` under reduced motion. */
15
+ behavior?: ScrollBehavior;
16
+ /** Extra room above the target, in px, on top of its scroll margin. */
17
+ offset?: number;
18
+ };
19
+ /**
20
+ * The nearest ancestor of `element` that scrolls vertically (its overflow
21
+ * lets it scroll and its content is taller than it), else the document's
22
+ * scrolling element.
23
+ */
24
+ export declare function nearestScroller(element: Element | null | undefined): HTMLElement;
25
+ /**
26
+ * Scrolls the nearest scroller of `element` (only that one) so the element
27
+ * shows below what sticks at the top of the page. Returns the scroller.
28
+ */
29
+ export declare function scrollIntoViewWithinScroller(element: Element | null | undefined, options?: ScrollWithinOptions): HTMLElement | null;
30
+ /** Scrolls the nearest scroller of `element` so the element starts at its top, below what sticks there. */
31
+ export declare function scrollToStart(element: Element | null | undefined, options?: Omit<ScrollWithinOptions, 'block'>): HTMLElement | null;
@@ -0,0 +1,20 @@
1
+ export type TypeScale = {
2
+ /** Body text: list and record titles, values, menu items (`--ui-font-size`). */
3
+ body: number;
4
+ /** Secondary text: labels, captions, axis labels, legends (`--ui-font-size-sm`). */
5
+ small: number;
6
+ /** The smallest text anywhere (`--ui-font-size-xs`). */
7
+ tiny: number;
8
+ /** Card and section titles (`--ui-font-size-lg`). */
9
+ large: number;
10
+ /** Header and dialog titles (`--ui-font-size-title`). */
11
+ title: number;
12
+ /** Body line height (`--ui-line-height`). */
13
+ lineHeight: number;
14
+ /** The font stack (`--ui-font-sans`). */
15
+ family: string;
16
+ };
17
+ /** The type tokens in effect on `el`, in CSS pixels; a missing token keeps the desktop value. */
18
+ export declare function readTypeScale(el: Element): TypeScale;
19
+ /** A canvas `font` string for one step of the scale: `canvasFont(scale, 'small', 600)`. */
20
+ export declare function canvasFont(scale: TypeScale, step: Exclude<keyof TypeScale, 'lineHeight' | 'family'>, weight?: number | string): string;
@@ -3,7 +3,7 @@
3
3
  "version": "2.11.0",
4
4
  "delivery": "bundled-patched-esm",
5
5
  "patchManifestSha256": "9c5b9c9a162fa584b4695a683368a4484b3ac6e70177fd063b77aa618c051627",
6
- "bundleSha256": "456f1e93092c2704e275d53a03614a7760ef0ab738e8531a1499bd0ca07e090d",
6
+ "bundleSha256": "ca127c182520c64a4c770b2c9e3d034c7f1c232430211e18a3079590339d0db1",
7
7
  "sourceHashes": {
8
8
  "shared/useBodyScrollLock.js": "287bfb604318c4202769e4b5191896eaf0e52a952e1de898967cbe09467fcfda",
9
9
  "DismissableLayer/DismissableLayer.js": "3c8d248f0a32e01f89ca1f6202b1bb691bf5d0e4012a92535e161c35e69cdc32",