@khsura/sui 1.19.0 → 1.21.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 (180) hide show
  1. package/@types/components/avatar/index.d.ts +2 -0
  2. package/@types/components/avatar/sAvatar.vue.d.ts +13 -0
  3. package/@types/components/avatar/sAvatarGroup.vue.d.ts +16 -0
  4. package/@types/components/cards/sCardText.vue.d.ts +2 -2
  5. package/@types/components/datePicker/sDatePickerSwitch.vue.d.ts +2 -0
  6. package/@types/components/form/index.d.ts +2 -0
  7. package/@types/components/form/radio/sRadio.vue.d.ts +3 -0
  8. package/@types/components/form/sFormRow.vue.d.ts +18 -0
  9. package/@types/components/form/sInput.vue.d.ts +1 -0
  10. package/@types/components/form/sNumberInput.vue.d.ts +29 -0
  11. package/@types/components/form/sSelect.vue.d.ts +10 -3
  12. package/@types/components/index.d.ts +5 -0
  13. package/@types/components/layout/sNavigationDrawer.vue.d.ts +6 -6
  14. package/@types/components/progress/sProgressCircular.vue.d.ts +1 -0
  15. package/@types/components/progress/sProgressLinear.vue.d.ts +1 -0
  16. package/@types/components/sAutocomplete.vue.d.ts +11 -1
  17. package/@types/components/sEmptyState.vue.d.ts +26 -0
  18. package/@types/components/sFileInput.vue.d.ts +35 -0
  19. package/@types/components/sPagination.vue.d.ts +21 -0
  20. package/@types/components/sSkeletonLoader.vue.d.ts +19 -0
  21. package/@types/components/slideGroup/sSlideGroup.vue.d.ts +4 -1
  22. package/@types/components/table/sTable.vue.d.ts +2 -0
  23. package/@types/components/tabs/sTabs.vue.d.ts +2 -2
  24. package/@types/components/toggleButtonGroup/sToggleButtonGroup.vue.d.ts +2 -0
  25. package/@types/configs/app.d.ts +4 -0
  26. package/@types/configs/fileInput.d.ts +5 -0
  27. package/@types/configs/i18n.d.ts +3 -0
  28. package/@types/configs/index.d.ts +2 -0
  29. package/@types/configs/provider.d.ts +2 -0
  30. package/@types/configs/skeletonLoader.d.ts +57 -0
  31. package/@types/constants/avatar.d.ts +3 -0
  32. package/@types/constants/color.d.ts +15 -0
  33. package/@types/constants/cssVariables.d.ts +4 -0
  34. package/@types/constants/datePicker.d.ts +7 -0
  35. package/@types/constants/fileInput.d.ts +31 -0
  36. package/@types/constants/i18n.d.ts +3 -0
  37. package/@types/constants/index.d.ts +8 -0
  38. package/@types/constants/keyboard.d.ts +12 -0
  39. package/@types/constants/layout.d.ts +2 -0
  40. package/@types/constants/listbox.d.ts +1 -0
  41. package/@types/constants/numberInput.d.ts +22 -0
  42. package/@types/constants/overlay.d.ts +5 -0
  43. package/@types/constants/pagination.d.ts +20 -0
  44. package/@types/constants/skeletonLoader.d.ts +33 -0
  45. package/@types/constants/tabs.d.ts +10 -0
  46. package/@types/definitions/props/core/propsLink.d.ts +2 -2
  47. package/@types/definitions/props/index.d.ts +7 -0
  48. package/@types/definitions/props/propsAutocomplete.d.ts +8 -0
  49. package/@types/definitions/props/propsAvatar.d.ts +13 -0
  50. package/@types/definitions/props/propsAvatarGroup.d.ts +8 -0
  51. package/@types/definitions/props/propsEmptyState.d.ts +17 -0
  52. package/@types/definitions/props/propsFileInput.d.ts +41 -0
  53. package/@types/definitions/props/propsInput.d.ts +1 -0
  54. package/@types/definitions/props/propsLink.d.ts +2 -2
  55. package/@types/definitions/props/propsNumberInput.d.ts +46 -0
  56. package/@types/definitions/props/propsPagination.d.ts +32 -0
  57. package/@types/definitions/props/propsProgressCircular.d.ts +2 -0
  58. package/@types/definitions/props/propsProgressLinear.d.ts +2 -0
  59. package/@types/definitions/props/propsRow.d.ts +1 -0
  60. package/@types/definitions/props/propsSelect.d.ts +6 -0
  61. package/@types/definitions/props/propsSkeletonLoader.d.ts +18 -0
  62. package/@types/definitions/props/propsSlideGroup.d.ts +4 -0
  63. package/@types/definitions/props/propsTable.d.ts +1 -0
  64. package/@types/definitions/props/propsTabs.d.ts +4 -0
  65. package/@types/definitions/props/propsTextarea.d.ts +3 -0
  66. package/@types/helpers/colorHelpers.d.ts +1 -1
  67. package/@types/helpers/createAppStore.d.ts +4 -0
  68. package/@types/helpers/fileInputRules.d.ts +18 -0
  69. package/@types/helpers/index.d.ts +1 -0
  70. package/@types/lib/color.d.ts +21 -2
  71. package/@types/lib/escapeHtml.d.ts +2 -0
  72. package/@types/lib/flattenVNodes.d.ts +2 -0
  73. package/@types/lib/index.d.ts +7 -0
  74. package/@types/lib/linkLocation.d.ts +9 -0
  75. package/@types/lib/numberInput.d.ts +23 -0
  76. package/@types/lib/overlayPlacement.d.ts +11 -0
  77. package/@types/lib/revealInScroller.d.ts +25 -0
  78. package/@types/lib/safeArea.d.ts +3 -0
  79. package/@types/playwright.visual.config.d.ts +3 -0
  80. package/@types/services/appBarService.d.ts +14 -0
  81. package/@types/services/backgroundScrollService.d.ts +8 -2
  82. package/@types/services/core/layoutCoreService.d.ts +4 -0
  83. package/@types/services/datePicker/datePickerItemDateService.d.ts +1 -0
  84. package/@types/services/dialogService.d.ts +4 -8
  85. package/@types/services/fieldLayoutService.d.ts +19 -0
  86. package/@types/services/formInputService.d.ts +6 -0
  87. package/@types/services/index.d.ts +9 -0
  88. package/@types/services/layoutProviderService.d.ts +6 -0
  89. package/@types/services/layoutService.d.ts +4 -0
  90. package/@types/services/linkService.d.ts +11 -1
  91. package/@types/services/listboxNavigationService.d.ts +20 -0
  92. package/@types/services/menuService.d.ts +2 -0
  93. package/@types/services/overlayFocusService.d.ts +10 -0
  94. package/@types/services/paginationService.d.ts +39 -0
  95. package/@types/services/routerLinkService.d.ts +19 -0
  96. package/@types/services/scrollableFocusService.d.ts +10 -0
  97. package/@types/services/skeletonLoaderService.d.ts +22 -0
  98. package/@types/services/surfaceTextColorService.d.ts +8 -0
  99. package/@types/services/tabsService.d.ts +14 -0
  100. package/@types/store/index.d.ts +1 -0
  101. package/@types/store/scrollLockStore.d.ts +1 -0
  102. package/@types/tests/visual/constants/a11yAudit.d.ts +4 -0
  103. package/@types/tests/visual/constants/index.d.ts +4 -0
  104. package/@types/tests/visual/constants/resizeScroll.d.ts +10 -0
  105. package/@types/tests/visual/constants/storyRender.d.ts +5 -0
  106. package/@types/tests/visual/constants/visualMatrix.d.ts +20 -0
  107. package/@types/tests/visual/schemas/index.d.ts +1 -0
  108. package/@types/tests/visual/schemas/storyIndex.d.ts +17 -0
  109. package/@types/tests/visual/types/a11yAudit.d.ts +2 -0
  110. package/@types/tests/visual/types/index.d.ts +2 -0
  111. package/@types/tests/visual/types/visualStory.d.ts +8 -0
  112. package/@types/types/app.d.ts +2 -0
  113. package/@types/types/breadcrumbs.d.ts +2 -2
  114. package/@types/types/emits.d.ts +12 -0
  115. package/@types/types/fileInput.d.ts +28 -0
  116. package/@types/types/index.d.ts +6 -0
  117. package/@types/types/link.d.ts +20 -0
  118. package/@types/types/menu.d.ts +17 -0
  119. package/@types/types/numberInput.d.ts +12 -0
  120. package/@types/types/pagination.d.ts +17 -0
  121. package/@types/types/safeArea.d.ts +1 -0
  122. package/@types/types/skeletonLoader.d.ts +16 -0
  123. package/@types/vite.config.d.ts +1 -0
  124. package/README.md +12 -0
  125. package/dist/base.css.map +1 -1
  126. package/dist/s-ui.css +1 -1
  127. package/dist/s-ui.js +4792 -3038
  128. package/dist/s-ui.umd.cjs +1 -1
  129. package/dist/styles/components/avatar/_variables.scss +17 -0
  130. package/dist/styles/components/avatar/index.scss +1 -0
  131. package/dist/styles/components/button/mixins.scss +5 -0
  132. package/dist/styles/components/form/_variables.scss +11 -0
  133. package/dist/styles/components/form/index.scss +1 -0
  134. package/dist/styles/components/index.scss +2 -0
  135. package/dist/styles/mixins/_app.scss +7 -0
  136. package/dist/styles/tools/_safeArea.scss +8 -0
  137. package/dist/styles/tools/index.scss +1 -0
  138. package/dist/sui-api.json +1295 -212
  139. package/package.json +15 -4
  140. package/sui-plugin/.claude-plugin/plugin.json +1 -1
  141. package/sui-plugin/skills/sui-component/SKILL.md +21 -6
  142. package/sui-plugin/skills/sui-component/references/autocomplete.md +54 -46
  143. package/sui-plugin/skills/sui-component/references/avatar-group.md +66 -0
  144. package/sui-plugin/skills/sui-component/references/avatar.md +76 -0
  145. package/sui-plugin/skills/sui-component/references/badge.md +4 -4
  146. package/sui-plugin/skills/sui-component/references/breadcrumbs.md +3 -2
  147. package/sui-plugin/skills/sui-component/references/button.md +13 -13
  148. package/sui-plugin/skills/sui-component/references/calendar.md +1 -1
  149. package/sui-plugin/skills/sui-component/references/cards.md +12 -12
  150. package/sui-plugin/skills/sui-component/references/carousel.md +9 -9
  151. package/sui-plugin/skills/sui-component/references/chip.md +1 -1
  152. package/sui-plugin/skills/sui-component/references/date-picker.md +14 -13
  153. package/sui-plugin/skills/sui-component/references/dialog.md +11 -10
  154. package/sui-plugin/skills/sui-component/references/droppable.md +8 -8
  155. package/sui-plugin/skills/sui-component/references/empty-state.md +104 -0
  156. package/sui-plugin/skills/sui-component/references/expansion-panels.md +1 -1
  157. package/sui-plugin/skills/sui-component/references/file-input.md +106 -0
  158. package/sui-plugin/skills/sui-component/references/form.md +155 -105
  159. package/sui-plugin/skills/sui-component/references/image.md +11 -10
  160. package/sui-plugin/skills/sui-component/references/layout.md +53 -49
  161. package/sui-plugin/skills/sui-component/references/list.md +6 -3
  162. package/sui-plugin/skills/sui-component/references/menu.md +12 -9
  163. package/sui-plugin/skills/sui-component/references/number-input.md +102 -0
  164. package/sui-plugin/skills/sui-component/references/pagination.md +83 -0
  165. package/sui-plugin/skills/sui-component/references/progress.md +20 -18
  166. package/sui-plugin/skills/sui-component/references/sheet.md +8 -8
  167. package/sui-plugin/skills/sui-component/references/skeleton-loader.md +75 -0
  168. package/sui-plugin/skills/sui-component/references/slide-group.md +14 -12
  169. package/sui-plugin/skills/sui-component/references/snackbar.md +7 -5
  170. package/sui-plugin/skills/sui-component/references/split-view.md +2 -2
  171. package/sui-plugin/skills/sui-component/references/table.md +10 -3
  172. package/sui-plugin/skills/sui-component/references/tabs.md +19 -13
  173. package/sui-plugin/skills/sui-component/references/toggle-button-group.md +5 -4
  174. package/sui-plugin/skills/sui-component/references/toolbar.md +5 -5
  175. package/sui-plugin/skills/sui-component/references/tooltip.md +10 -9
  176. package/sui-plugin/skills/sui-component/references/window.md +6 -1
  177. package/sui-plugin/skills/sui-form/SKILL.md +25 -17
  178. package/sui-plugin/skills/sui-getting-started/SKILL.md +32 -7
  179. package/sui-plugin/skills/sui-layout/SKILL.md +3 -1
  180. package/sui-plugin/skills/sui-utilities/docs/classes.md +1 -1
@@ -12,8 +12,27 @@ export declare const convertToRgb: (rgb: string | [number, number, number] | {
12
12
  g: number;
13
13
  b: number;
14
14
  } | null;
15
- export declare const isDarkColor: (rgb: string | [number, number, number] | {
15
+ type RgbInput = string | [number, number, number] | {
16
16
  r: number;
17
17
  g: number;
18
18
  b: number;
19
- } | null | undefined, threshold?: number) => boolean | null;
19
+ };
20
+ export declare const getRelativeLuminance: (rgb: RgbInput) => number | null;
21
+ export declare const getContrastRatio: (first: RgbInput, second: RgbInput) => number | null;
22
+ export declare const getReadableTextColor: <T extends string>(background: RgbInput, lightText: T, darkText: T) => T;
23
+ export declare const mixColors: (color: RgbInput, target: RgbInput, amount: number) => string | null;
24
+ /**
25
+ * `color` used as text: kept as is when it already reaches `minimumContrast` on every surface, otherwise mixed
26
+ * toward `towards` (the theme text colour) in `step` increments until it does. Returns `color` when it cannot parse.
27
+ */
28
+ export declare const getReadableTextVariant: (color: string, surfaces: string[], towards: string, options: {
29
+ minimumContrast: number;
30
+ step: number;
31
+ }) => string;
32
+ /**
33
+ * Whether `rgb` is dark enough to need light text.
34
+ * Without `threshold` it compares WCAG contrast: light text is chosen when it contrasts more than dark text.
35
+ * With an explicit `threshold` (0-100) it keeps the legacy YIQ brightness rule, so existing overrides behave the same.
36
+ */
37
+ export declare const isDarkColor: (rgb: RgbInput | null | undefined, threshold?: number) => boolean | null;
38
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Text made safe for `v-html`: the characters HTML treats as markup become entities. */
2
+ export declare const escapeHtml: (text: string) => string;
@@ -0,0 +1,2 @@
1
+ import { type VNode } from 'vue';
2
+ export declare const flattenVNodes: (nodes: VNode[] | undefined) => VNode[];
@@ -10,3 +10,10 @@ export * from './scroll';
10
10
  export * from './wait';
11
11
  export * from './htmlClass';
12
12
  export * from './retry';
13
+ export * from './overlayPlacement';
14
+ export * from './revealInScroller';
15
+ export * from './linkLocation';
16
+ export * from './safeArea';
17
+ export * from './flattenVNodes';
18
+ export * from './numberInput';
19
+ export * from './escapeHtml';
@@ -0,0 +1,9 @@
1
+ import type { LinkLocation } from '../types';
2
+ /**
3
+ * The plain URL a `to` location points at, for apps without vue-router.
4
+ *
5
+ * A path string is already a URL. A location object resolves only when it
6
+ * names a `path`; a route addressed by `name` needs the router's route table,
7
+ * so it has no URL here and the result is `undefined`.
8
+ */
9
+ export declare const getLinkLocationHref: (location: LinkLocation) => string | undefined;
@@ -0,0 +1,23 @@
1
+ import { type NumberInputBounds } from '../types';
2
+ /** Decimal places a number is written with: `0.25` → 2, `3` → 0, `1e-7` → 7. */
3
+ export declare const getDecimalCount: (value: number) => number;
4
+ /** Rounds to `precision` decimal places, dropping binary noise such as `0.1 + 0.2`; `null` keeps the value. */
5
+ export declare const getRoundedNumber: (value: number, precision: number | null) => number;
6
+ /** Keeps a value inside `min` and `max` (either may be `null` for no bound). */
7
+ export declare const getClampedNumber: (value: number, { min, max }: Pick<NumberInputBounds, "min" | "max">) => number;
8
+ /** Rounds a value to the bounds' precision, then clamps it into their range. */
9
+ export declare const getNormalizedNumber: (value: number, bounds: NumberInputBounds) => number;
10
+ /** Reads the number typed into a field; empty or unfinished text (`-`, `.`) and anything else is `null`. */
11
+ export declare const getParsedNumberText: (text: string) => number | null;
12
+ /**
13
+ * Whether text may stay in the field while the user types: digits, one leading `-` when negatives are allowed,
14
+ * and a `.` followed by at most `precision` digits (none when `precision` is 0, any when it is `null`).
15
+ */
16
+ export declare const getIsNumberTextAllowed: (text: string, { allowNegative, precision }: {
17
+ allowNegative: boolean;
18
+ precision: number | null;
19
+ }) => boolean;
20
+ /** The text a field shows for a value: `precision` fixed decimals, or the plain number when it is `null`. */
21
+ export declare const getNumberText: (value: number | null | undefined, precision: number | null) => string;
22
+ /** A numeric prop given as a number or a string (`min="0"`); `null` when it is missing or not a finite number. */
23
+ export declare const getOptionalNumber: (value: number | string | null | undefined) => number | null;
@@ -0,0 +1,11 @@
1
+ import type { OverlayPlacementInput } from '../types';
2
+ /**
3
+ * Keeps an overlay inside the viewport, `gutter` pixels from every edge.
4
+ *
5
+ * Vertically it first flips to the other side of the activator (keeping the same gap) when that side has room,
6
+ * otherwise it shifts the overlay until it fits. Horizontally it shifts. All values are viewport coordinates.
7
+ */
8
+ export declare const getOverlayPlacement: ({ content, activator, viewportWidth, viewportHeight, gutter, }: OverlayPlacementInput) => {
9
+ top: number;
10
+ left: number;
11
+ };
@@ -0,0 +1,25 @@
1
+ /** Horizontal edges of a box, in viewport pixels (a subset of DOMRect). */
2
+ export interface HorizontalEdges {
3
+ left: number;
4
+ right: number;
5
+ }
6
+ /**
7
+ * The scrollLeft that brings `item` fully into view inside a horizontal scroller, moving as little as
8
+ * possible. Returns the current scrollLeft when the item is already visible. An item wider than the
9
+ * scroller is aligned to its start.
10
+ */
11
+ export declare const getScrollLeftToReveal: (scroller: HorizontalEdges, item: HorizontalEdges, scrollLeft: number) => number;
12
+ /** The scroll metrics of a horizontal scroller (a subset of HTMLElement). */
13
+ export interface HorizontalScrollMetrics {
14
+ scrollLeft: number;
15
+ scrollWidth: number;
16
+ clientWidth: number;
17
+ }
18
+ /**
19
+ * Which ends of a horizontal scroller hide content: `start` when it is scrolled away from the left edge,
20
+ * `end` when more content lies past the right edge. `tolerance` absorbs sub-pixel rounding.
21
+ */
22
+ export declare const getHiddenScrollEdges: (metrics: HorizontalScrollMetrics, tolerance: number) => {
23
+ start: boolean;
24
+ end: boolean;
25
+ };
@@ -0,0 +1,3 @@
1
+ import type { SafeAreaSide } from '../types';
2
+ export declare const getSafeAreaInset: (side: SafeAreaSide) => string;
3
+ export declare const getLengthWithSafeArea: (length: string | undefined, side: SafeAreaSide) => string;
@@ -0,0 +1,3 @@
1
+ import type { VisualOptions } from './tests/visual/types';
2
+ declare const _default: import("playwright/test").PlaywrightTestConfig<VisualOptions, {}>;
3
+ export default _default;
@@ -12,6 +12,8 @@ export declare const useAppBarService: (props: PropsAppBar) => {
12
12
  appBarPosition: import("..").Position;
13
13
  appBarHeight: number;
14
14
  footerHeight: number;
15
+ hasLeftSafeArea: boolean;
16
+ hasRightSafeArea: boolean;
15
17
  }, {
16
18
  left: number;
17
19
  right: number;
@@ -20,6 +22,8 @@ export declare const useAppBarService: (props: PropsAppBar) => {
20
22
  appBarPosition: import("..").Position;
21
23
  appBarHeight: number;
22
24
  footerHeight: number;
25
+ hasLeftSafeArea: boolean;
26
+ hasRightSafeArea: boolean;
23
27
  }>;
24
28
  classes: import("vue").ComputedRef<{
25
29
  s_appBar: boolean;
@@ -35,6 +39,16 @@ export declare const useAppBarService: (props: PropsAppBar) => {
35
39
  width: string;
36
40
  top: string;
37
41
  transform: string;
42
+ paddingLeft?: undefined;
43
+ paddingRight?: undefined;
44
+ } | {
45
+ marginLeft: string;
46
+ marginRight: string;
47
+ width: string;
48
+ top: string;
49
+ transform: string;
50
+ paddingLeft: string;
51
+ paddingRight: string;
38
52
  }>>;
39
53
  isActive: import("vue").Ref<boolean, boolean>;
40
54
  updateIsAppBarDisplayStatus: () => void;
@@ -1,4 +1,10 @@
1
+ /**
2
+ * Blocks the page scroll behind a modal overlay. Each caller is one lock owner; the page stays pinned while any
3
+ * owner holds a lock and is released when the last one lets go. Both calls are idempotent and apply at once, so
4
+ * a drawer that turns mobile and closes in the same tick (a window resize across the md breakpoint) ends unlocked
5
+ * whatever order its watchers ran in. An owner created inside a component lets go when the component unmounts.
6
+ */
1
7
  export declare const useBackgroundScrollService: () => {
2
- enableBackgroundScroll: () => Promise<void>;
3
- disableBackgroundScroll: () => Promise<void>;
8
+ enableBackgroundScroll: () => void;
9
+ disableBackgroundScroll: () => void;
4
10
  };
@@ -8,6 +8,8 @@ export declare const useLayoutCoreService: (props: PropsLayout | PropsLayoutProv
8
8
  appBarPosition: import("../..").Position;
9
9
  appBarHeight: number;
10
10
  footerHeight: number;
11
+ hasLeftSafeArea: boolean;
12
+ hasRightSafeArea: boolean;
11
13
  }, {
12
14
  left: number;
13
15
  right: number;
@@ -16,6 +18,8 @@ export declare const useLayoutCoreService: (props: PropsLayout | PropsLayoutProv
16
18
  appBarPosition: import("../..").Position;
17
19
  appBarHeight: number;
18
20
  footerHeight: number;
21
+ hasLeftSafeArea: boolean;
22
+ hasRightSafeArea: boolean;
19
23
  }>>>;
20
24
  isApp: import("vue").ComputedRef<boolean>;
21
25
  };
@@ -7,6 +7,7 @@ export declare const useDatePickerItemDateService: (props: PropsDatePickerItem,
7
7
  isSelected: boolean;
8
8
  isCurrentMonth: boolean;
9
9
  title: string;
10
+ label: string;
10
11
  isDisabled: boolean;
11
12
  select: () => void;
12
13
  }[]>;
@@ -19,14 +19,10 @@ export declare const useDialogService: (props: PropsDialog, isDialogOpen: ModelR
19
19
  's_dialog__content--bottom': boolean;
20
20
  's_dialog__content--borderless': boolean | undefined;
21
21
  }>;
22
- contentStyles: import("vue").ComputedRef<{
23
- height?: string;
24
- width?: string;
25
- maxHeight?: string;
26
- maxWidth?: string;
27
- minHeight?: string;
28
- minWidth?: string;
29
- }>;
22
+ contentStyles: import("vue").ComputedRef<Partial<{
23
+ minHeight?: string | undefined;
24
+ minWidth?: string | undefined;
25
+ }>>;
30
26
  transitionName: import("vue").ComputedRef<STransition.appear | "s_transition__dialog--bottom">;
31
27
  onClickOutside: () => void;
32
28
  };
@@ -0,0 +1,19 @@
1
+ import { type ComputedRef } from 'vue';
2
+ export interface FieldLayoutState {
3
+ /** A label is rendered above the field box (a label is set and `hideDetails` is off). */
4
+ hasLabel: boolean;
5
+ /** The details line (error / counter) is reserved below the field box. */
6
+ hasDetails: boolean;
7
+ }
8
+ /**
9
+ * Marker classes on a text field's root, so `SFormRow` can line its buttons up with the field box:
10
+ * it offsets the other children by the label height when a field in the row shows a label.
11
+ * The classes carry no styles of their own, so a field outside `SFormRow` renders unchanged.
12
+ */
13
+ export declare const useFieldLayoutService: (state: ComputedRef<FieldLayoutState>) => {
14
+ classListField: ComputedRef<{
15
+ s_field: boolean;
16
+ 's_field--labelled': boolean;
17
+ 's_field--details': boolean;
18
+ }>;
19
+ };
@@ -5,4 +5,10 @@ export declare const useFormInputService: <T extends FormInputModelValue = FormI
5
5
  updateFormInput: (value?: T) => Promise<boolean>;
6
6
  errors: import("vue").ComputedRef<string[]>;
7
7
  hasError: import("vue").ComputedRef<boolean>;
8
+ inputId: import("vue").ComputedRef<string>;
9
+ errorId: import("vue").ComputedRef<string>;
10
+ ariaAttributesFormInput: import("vue").ComputedRef<{
11
+ 'aria-invalid': true | undefined;
12
+ 'aria-describedby': string | undefined;
13
+ }>;
8
14
  };
@@ -16,28 +16,37 @@ export * from './displayService';
16
16
  export * from './elevationService';
17
17
  export * from './expandableItemService';
18
18
  export * from './expandableService';
19
+ export * from './fieldLayoutService';
19
20
  export * from './formInputService';
20
21
  export * from './groupItemService';
21
22
  export * from './groupService';
22
23
  export * from './layoutProviderService';
23
24
  export * from './layoutService';
24
25
  export * from './linkService';
26
+ export * from './routerLinkService';
25
27
  export * from './listMediaItemService';
26
28
  export * from './measurableStylesService';
29
+ export * from './listboxNavigationService';
27
30
  export * from './menuService';
28
31
  export * from './navigationDrawerService';
29
32
  export * from './navigationDrawerResizeService';
30
33
  export * from './positionService';
31
34
  export * from './resizeService';
35
+ export * from './scrollableFocusService';
32
36
  export * from './scrollService';
33
37
  export * from './scrollableService';
34
38
  export * from './singleGroupItemService';
35
39
  export * from './singleGroupService';
36
40
  export * from './sizeService';
37
41
  export * from './slideGroupService';
42
+ export * from './tabsService';
38
43
  export * from './table';
39
44
  export * from './tagService';
45
+ export * from './surfaceTextColorService';
40
46
  export * from './textColorService';
41
47
  export * from './themeService';
42
48
  export * from './toolbarService';
43
49
  export * from './touchService';
50
+ export * from './overlayFocusService';
51
+ export * from './paginationService';
52
+ export * from './skeletonLoaderService';
@@ -8,6 +8,8 @@ export declare const useLayoutProviderService: (props: PropsLayoutProvider, appS
8
8
  appBarPosition: import("..").Position;
9
9
  appBarHeight: number;
10
10
  footerHeight: number;
11
+ hasLeftSafeArea: boolean;
12
+ hasRightSafeArea: boolean;
11
13
  }, {
12
14
  left: number;
13
15
  right: number;
@@ -16,6 +18,8 @@ export declare const useLayoutProviderService: (props: PropsLayoutProvider, appS
16
18
  appBarPosition: import("..").Position;
17
19
  appBarHeight: number;
18
20
  footerHeight: number;
21
+ hasLeftSafeArea: boolean;
22
+ hasRightSafeArea: boolean;
19
23
  } | {
20
24
  left: number;
21
25
  right: number;
@@ -24,5 +28,7 @@ export declare const useLayoutProviderService: (props: PropsLayoutProvider, appS
24
28
  appBarPosition: import("..").Position;
25
29
  appBarHeight: number;
26
30
  footerHeight: number;
31
+ hasLeftSafeArea: boolean;
32
+ hasRightSafeArea: boolean;
27
33
  }>;
28
34
  };
@@ -8,6 +8,8 @@ export declare const useLayoutService: (props: PropsLayout) => {
8
8
  appBarPosition: import("..").Position;
9
9
  appBarHeight: number;
10
10
  footerHeight: number;
11
+ hasLeftSafeArea: boolean;
12
+ hasRightSafeArea: boolean;
11
13
  }, {
12
14
  left: number;
13
15
  right: number;
@@ -16,6 +18,8 @@ export declare const useLayoutService: (props: PropsLayout) => {
16
18
  appBarPosition: import("..").Position;
17
19
  appBarHeight: number;
18
20
  footerHeight: number;
21
+ hasLeftSafeArea: boolean;
22
+ hasRightSafeArea: boolean;
19
23
  }>;
20
24
  isApp: import("vue").ComputedRef<boolean>;
21
25
  left: import("vue").ComputedRef<string | undefined>;
@@ -1,12 +1,22 @@
1
1
  import { type PropsLink, type PropsTag } from '../definitions';
2
+ /**
3
+ * `to` renders a `router-link` when the app has vue-router, and degrades to a
4
+ * plain `<a href>` when it does not, so `@khsura/sui` never needs vue-router
5
+ * installed. See `useRouterLinkService`.
6
+ */
2
7
  export declare const useLinkService: (props: PropsLink & PropsTag) => {
3
8
  tag: import("vue").ComputedRef<import("..").HtmlTagName | "router-link">;
4
9
  isLink: import("vue").ComputedRef<boolean>;
5
10
  linkAttrs: import("vue").ComputedRef<{
6
- to: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric | null | undefined;
11
+ to: import("..").LinkLocation | null | undefined;
7
12
  href?: undefined;
8
13
  target?: undefined;
9
14
  rel?: undefined;
15
+ } | {
16
+ href: string | undefined;
17
+ to?: undefined;
18
+ target?: undefined;
19
+ rel?: undefined;
10
20
  } | {
11
21
  href: string | null | undefined;
12
22
  target: "_blank" | "_self" | "_parent" | "_top" | undefined;
@@ -0,0 +1,20 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * Keyboard highlight for a popup listbox driven from a focused combobox (the `aria-activedescendant` pattern):
4
+ * focus stays on the field while the arrow keys move a highlighted option. Disabled options are skipped.
5
+ */
6
+ export declare const useListboxNavigationService: (options: {
7
+ idPrefix: MaybeRefOrGetter<string>;
8
+ getOptionCount: () => number;
9
+ getIsOptionDisabled: (index: number) => boolean;
10
+ }) => {
11
+ activeIndex: import("vue").Ref<number, number>;
12
+ activeOptionId: import("vue").ComputedRef<string | undefined>;
13
+ listboxId: import("vue").ComputedRef<string>;
14
+ getOptionId: (index: number) => string;
15
+ setActiveIndex: (index: number) => void;
16
+ resetActiveIndex: () => void;
17
+ moveActive: (step: 1 | -1) => void;
18
+ moveToFirst: () => void;
19
+ moveToLast: () => void;
20
+ };
@@ -10,6 +10,8 @@ export declare const useMenuService: (props: PropsMenu, model: Ref<boolean | und
10
10
  alignMiddle?: boolean;
11
11
  preventOverlap?: boolean;
12
12
  autoFlip?: boolean;
13
+ /** Flip or shift the content so it stays inside the viewport (gutter: `screenPadding` or the default). */
14
+ keepInViewport?: boolean;
13
15
  onChange?: (v: boolean | undefined | null) => void;
14
16
  }) => {
15
17
  contentClasses: import("vue").ComputedRef<Record<string, boolean>>;
@@ -0,0 +1,10 @@
1
+ import { type Ref } from 'vue';
2
+ export declare const useOverlayFocusService: (model: Ref<boolean | null | undefined>, elements: {
3
+ activator: Readonly<Ref<HTMLElement | null>>;
4
+ content: Readonly<Ref<HTMLElement | null>>;
5
+ }, options: {
6
+ /** Esc closes the overlay unless this returns false (a persistent dialog). */
7
+ canCloseOnEscape: () => boolean;
8
+ /** Move focus into the content on open and keep Tab inside it (modal dialogs). */
9
+ trapFocus: boolean;
10
+ }) => void;
@@ -0,0 +1,39 @@
1
+ import { type MaybeRefOrGetter, type Ref } from 'vue';
2
+ import type { PaginationItem, PaginationItemRange, PaginationRangeOptions } from '../types';
3
+ /** Number of pages needed for `itemsCount` rows at `itemsPerPage` rows a page. */
4
+ export declare const getPageCount: (itemsCount: number, itemsPerPage: number) => number;
5
+ /** Keeps `page` (starting at 1) between the first and the last page. With no pages it returns the first page. */
6
+ export declare const clampPage: (page: number, pageCount: number) => number;
7
+ /** The rows that `page` (starting at 1) shows, such as `{ first: 11, last: 20 }`. */
8
+ export declare const getPageItemRange: (page: number, itemsPerPage: number, itemsCount: number) => PaginationItemRange;
9
+ /**
10
+ * The page list SPagination draws: exactly `totalVisible` slots (or every page, when they all fit), with the
11
+ * first and last page kept and the gaps drawn as an ellipsis. An ellipsis always hides two pages or more.
12
+ *
13
+ * `{ page: 10, length: 20, totalVisible: 7 }` gives `[1, '…', 9, 10, 11, '…', 20]`.
14
+ */
15
+ export declare const getPaginationItems: ({ page, length, totalVisible }: PaginationRangeOptions) => PaginationItem[];
16
+ type PaginationServiceOptions = {
17
+ page: MaybeRefOrGetter<number>;
18
+ length: MaybeRefOrGetter<number>;
19
+ totalVisible: MaybeRefOrGetter<number>;
20
+ /** `true` or `false` forces the mode; `undefined` turns compact mode on when the full list does not fit. */
21
+ compact: MaybeRefOrGetter<boolean | null | undefined>;
22
+ showFirstLastPage: MaybeRefOrGetter<boolean | null | undefined>;
23
+ /** Changes that resize the page buttons, such as the `size` prop. They reset the measured width. */
24
+ layoutKey: MaybeRefOrGetter<unknown>;
25
+ };
26
+ /**
27
+ * SPagination's state. It measures how many page slots fit in `element` and switches to compact mode (no
28
+ * first/last buttons, at most five page slots) when the full list would overflow, so it never scrolls the page.
29
+ */
30
+ export declare const usePaginationService: (options: PaginationServiceOptions, element: Readonly<Ref<HTMLElement | null>>) => {
31
+ page: import("vue").ComputedRef<number>;
32
+ pageCount: import("vue").ComputedRef<number>;
33
+ items: import("vue").ComputedRef<PaginationItem[]>;
34
+ isCompact: import("vue").ComputedRef<boolean>;
35
+ showFirstLast: import("vue").ComputedRef<boolean>;
36
+ canGoBack: import("vue").ComputedRef<boolean>;
37
+ canGoForward: import("vue").ComputedRef<boolean>;
38
+ };
39
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { LinkLocation } from '../types';
2
+ /**
3
+ * Whether the host app can render `RouterLink`, found without importing
4
+ * vue-router.
5
+ *
6
+ * `@khsura/sui` does not depend on vue-router. A static import of it — even
7
+ * a type import written as `import { type X } from 'vue-router'`, which
8
+ * `verbatimModuleSyntax` keeps as a bare `import 'vue-router'` — puts the
9
+ * package into `dist/s-ui.js`, and an app without it then fails to build
10
+ * with "Failed to resolve import 'vue-router'".
11
+ *
12
+ * `app.use(router)` registers `RouterLink` as a global component, so the
13
+ * app's component registry answers the question. Call this from `setup`:
14
+ * outside a component there is no app, and so no router.
15
+ */
16
+ export declare const useRouterLinkService: () => {
17
+ hasRouterLink: boolean;
18
+ warnIfNoRouter: (to: LinkLocation | null | undefined) => void;
19
+ };
@@ -0,0 +1,10 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * A region that scrolls must be reachable from the keyboard (WCAG 2.1.1), or its overflow cannot be read
4
+ * without a mouse. Returns a `tabindex` that makes the element a Tab stop only while its content overflows.
5
+ * The element and its direct children are observed, so content that grows inside a fixed-size box counts too.
6
+ */
7
+ export declare const useScrollableFocusService: (element: MaybeRefOrGetter<HTMLElement | null | undefined>) => {
8
+ isScrollable: import("vue").Ref<boolean, boolean>;
9
+ scrollableTabindex: import("vue").ComputedRef<0 | undefined>;
10
+ };
@@ -0,0 +1,22 @@
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ import type { SkeletonLoaderNode, SkeletonLoaderPresetType, SkeletonLoaderTypeEntry } from '../types';
3
+ /** Whether `name` is one of SSkeletonLoader's presets. */
4
+ export declare const isSkeletonLoaderPreset: (name: string) => name is SkeletonLoaderPresetType;
5
+ /**
6
+ * Splits a `type` string such as `'avatar, text@3'` into its presets and repeat counts. Spaces and empty parts are
7
+ * ignored, an unknown preset is dropped, and a missing or invalid `@N` counts as 1 (at most 50).
8
+ */
9
+ export declare const parseSkeletonLoaderType: (type: string) => SkeletonLoaderTypeEntry[];
10
+ /** The bones a `type` string draws, with every repeat and every group (`card`, `table`, …) expanded. */
11
+ export declare const getSkeletonLoaderNodes: (type: string) => SkeletonLoaderNode[];
12
+ /** The classes of one drawn node: `s_skeletonLoader__bone` for a bone, and the preset's own element class. */
13
+ export declare const getSkeletonLoaderNodeClass: (node: SkeletonLoaderNode) => {
14
+ [x: string]: boolean;
15
+ s_skeletonLoader__bone: boolean;
16
+ };
17
+ /** How many levels deep a node tree goes: 1 for bones only, 3 for a `table` (table → row → cell). */
18
+ export declare const getSkeletonLoaderDepth: (nodes: SkeletonLoaderNode[]) => number;
19
+ /** SSkeletonLoader's bone tree for a reactive `type` string. */
20
+ export declare const useSkeletonLoaderService: (type: MaybeRefOrGetter<string>) => {
21
+ nodes: import("vue").ComputedRef<SkeletonLoaderNode[]>;
22
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `s_textColor__<name>` reads `--s-color-<name>--readable`, which SApp tunes for the app background and cards.
3
+ * A surface with a fixed colour of its own (the always-dark snackbar) redefines those variables for its subtree,
4
+ * so a preset colour as text (`color="warning"` on a text button) reaches 4.5:1 on that surface instead.
5
+ */
6
+ export declare const useSurfaceTextColorService: (surfaceColorName: string, appName?: string | symbol) => {
7
+ styleListSurfaceTextColor: import("vue").ComputedRef<Record<string, string>>;
8
+ };
@@ -0,0 +1,14 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * STabs keeps its tabs on one row that scrolls sideways when they do not fit. This keeps the selected tab
4
+ * scrolled into view, without scrolling the page: on mount, once the web fonts have loaded, and whenever the
5
+ * selection changes. It also reports which ends of the row hide tabs, so STabs can fade the row out there
6
+ * (and, with `showArrows`, show a scroll arrow), and scrolls the row by most of its width when an arrow is clicked.
7
+ */
8
+ export declare const useTabsService: (selected: Ref<number | string>, element: Ref<HTMLElement | null | undefined>) => {
9
+ isStartHidden: Ref<boolean, boolean>;
10
+ isEndHidden: Ref<boolean, boolean>;
11
+ revealSelectedTab: () => void;
12
+ scrollBackward: () => void;
13
+ scrollForward: () => void;
14
+ };
@@ -3,3 +3,4 @@ export declare const store: {
3
3
  width: number;
4
4
  height: number;
5
5
  };
6
+ export * from './scrollLockStore';
@@ -0,0 +1 @@
1
+ export declare const scrollLockOwners: Set<symbol>;
@@ -0,0 +1,4 @@
1
+ export declare const a11yTag = "a11y";
2
+ export declare const a11yBlockingImpacts: string[];
3
+ export declare const a11yAxeTags: string[];
4
+ export declare const a11yAuditBrowser = "chromium";
@@ -0,0 +1,4 @@
1
+ export * from './a11yAudit';
2
+ export * from './storyRender';
3
+ export * from './visualMatrix';
4
+ export * from './resizeScroll';
@@ -0,0 +1,10 @@
1
+ export declare const resizeScrollShellStoryId = "recipes--app-shell";
2
+ export declare const resizeScrollPageStoryId = "recipes--responsive-grid";
3
+ export declare const resizeScrollBrowser = "chromium";
4
+ export declare const resizeScrollSteps = 10;
5
+ export declare const resizeScrollStepDelayMs = 16;
6
+ export declare const resizeScrollSettleMs = 400;
7
+ export declare const resizeScrollDistance = 200;
8
+ export declare const resizeScrollPageHeight = 500;
9
+ export declare const resizeScrollBlockedClassName = "s_overlay__scrollBlocked";
10
+ export declare const resizeObserverLoopMessage = "ResizeObserver loop";
@@ -0,0 +1,5 @@
1
+ export declare const storyFailureEvents: string[];
2
+ export declare const storybookChannelGlobal = "__STORYBOOK_ADDONS_CHANNEL__";
3
+ export declare const storyFailuresGlobal = "__suiVisualStoryFailures";
4
+ export declare const storyFailureMaxLength = 500;
5
+ export declare const storybookA11yManualGlobal = "a11y.manual:!true";
@@ -0,0 +1,20 @@
1
+ export declare const visualTag = "visual";
2
+ export declare const visualViewportWidths: readonly [375, 768, 1280];
3
+ export declare const visualViewportHeight = 800;
4
+ export declare const visualThemes: readonly ["light", "dark"];
5
+ export declare const visualBrowsers: readonly ["chromium", "webkit"];
6
+ export declare const visualStorybookDir = "storybook-static";
7
+ export declare const visualServerPort = 6007;
8
+ export declare const visualServerUrl = "http://127.0.0.1:6007";
9
+ export declare const visualServerTimeoutMs = 60000;
10
+ export declare const mdiFontPackage = "@mdi/font";
11
+ export declare const mdiFontCdnPathPattern: RegExp;
12
+ export declare const visualFixedTime = "2026-01-01T09:00:00.000Z";
13
+ export declare const visualStoryRenderTimeoutMs = 15000;
14
+ export declare const visualStoryRenderPollingMs = 100;
15
+ export declare const storyRenderFinishedPhase = "finished";
16
+ export declare const storyRenderTerminalPhases: string[];
17
+ export declare const visualTestTimeoutMs = 60000;
18
+ export declare const visualScreenshotTimeoutMs = 15000;
19
+ export declare const visualPixelThreshold = 0.2;
20
+ export declare const visualMaxDiffPixelRatio = 0.002;
@@ -0,0 +1 @@
1
+ export * from './storyIndex';
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const storyIndexEntrySchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ title: z.ZodString;
5
+ name: z.ZodString;
6
+ type: z.ZodString;
7
+ tags: z.ZodArray<z.ZodString>;
8
+ }, z.core.$strip>;
9
+ export declare const storyIndexSchema: z.ZodObject<{
10
+ entries: z.ZodRecord<z.ZodString, z.ZodObject<{
11
+ id: z.ZodString;
12
+ title: z.ZodString;
13
+ name: z.ZodString;
14
+ type: z.ZodString;
15
+ tags: z.ZodArray<z.ZodString>;
16
+ }, z.core.$strip>>;
17
+ }, z.core.$strip>;
@@ -0,0 +1,2 @@
1
+ import type { AxeBuilder } from '@axe-core/playwright';
2
+ export type A11yViolation = Awaited<ReturnType<AxeBuilder['analyze']>>['violations'][number];
@@ -0,0 +1,2 @@
1
+ export * from './a11yAudit';
2
+ export * from './visualStory';