@happyvertical/smrt-ui 0.53.1 → 0.53.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.
Files changed (205) hide show
  1. package/package.json +3 -3
  2. package/dist/actions/__tests__/ripple.test.js +0 -82
  3. package/dist/actions/__tests__/swipe-dismiss.test.js +0 -69
  4. package/dist/components/calendar/__tests__/CalendarView.test.js +0 -226
  5. package/dist/components/calendar/__tests__/calendar-model.test.js +0 -138
  6. package/dist/components/chat/__tests__/chat-primitives.test.js +0 -118
  7. package/dist/components/data/__tests__/CollectionList.test.js +0 -37
  8. package/dist/components/data/__tests__/DataTable.test.js +0 -807
  9. package/dist/components/data/__tests__/DataTableConformance.test.js +0 -212
  10. package/dist/components/data/__tests__/DataTableController.test.js +0 -371
  11. package/dist/components/data/__tests__/DataTableIdentity.test.js +0 -29
  12. package/dist/components/data/__tests__/DataTableLayout.test.js +0 -195
  13. package/dist/components/data/__tests__/DataTablePerformance.test.js +0 -21
  14. package/dist/components/data/__tests__/DataTableResponsive.test.js +0 -80
  15. package/dist/components/data/__tests__/DataTableVirtualization.test.js +0 -80
  16. package/dist/components/data/__tests__/DataTableVirtualizationComponent.test.js +0 -255
  17. package/dist/components/data/__tests__/SortableHeader.test.js +0 -101
  18. package/dist/components/data/__tests__/data-surface.test.js +0 -746
  19. package/dist/components/data/__tests__/data-table-helpers.test.js +0 -36
  20. package/dist/components/data/__tests__/data-table-surface.test.js +0 -49
  21. package/dist/components/data/__tests__/link-step-surface.test.js +0 -172
  22. package/dist/components/data/__tests__/list-sort-state.svelte.test.js +0 -71
  23. package/dist/components/data/__tests__/list-sort.test.js +0 -91
  24. package/dist/components/data/__tests__/mounted-data-surface.test.js +0 -794
  25. package/dist/components/data/__tests__/responsive-table.fixture.svelte +0 -29
  26. package/dist/components/data/__tests__/responsive-table.fixture.svelte.d.ts +0 -7
  27. package/dist/components/data/__tests__/responsive-table.fixture.svelte.d.ts.map +0 -1
  28. package/dist/components/data/__tests__/surface-navigation.test.js +0 -121
  29. package/dist/components/display/__tests__/ConfidenceBadge.test.js +0 -109
  30. package/dist/components/display/__tests__/CurrencyDisplay.test.js +0 -304
  31. package/dist/components/display/__tests__/CurrencyDisplayI18nHarness.svelte +0 -20
  32. package/dist/components/display/__tests__/CurrencyDisplayI18nHarness.svelte.d.ts +0 -19
  33. package/dist/components/display/__tests__/CurrencyDisplayI18nHarness.svelte.d.ts.map +0 -1
  34. package/dist/components/display/__tests__/CurrencyDisplaySsrHarness.svelte +0 -7
  35. package/dist/components/display/__tests__/CurrencyDisplaySsrHarness.svelte.d.ts +0 -19
  36. package/dist/components/display/__tests__/CurrencyDisplaySsrHarness.svelte.d.ts.map +0 -1
  37. package/dist/components/display/__tests__/DateDisplay.test.js +0 -195
  38. package/dist/components/display/__tests__/Icon.test.js +0 -223
  39. package/dist/components/display/__tests__/StatusBadge.test.js +0 -191
  40. package/dist/components/feedback/__tests__/ConfirmDialog.test.js +0 -181
  41. package/dist/components/feedback/__tests__/LoadingOverlay.test.js +0 -113
  42. package/dist/components/feedback/__tests__/Modal.test.js +0 -72
  43. package/dist/components/feedback/__tests__/PhoneSheet.test.js +0 -101
  44. package/dist/components/feedback/__tests__/ProgressBar.test.js +0 -89
  45. package/dist/components/feedback/__tests__/WorkingStrip.test.js +0 -172
  46. package/dist/components/feedback/__tests__/confirm-message.fixture.svelte +0 -9
  47. package/dist/components/feedback/__tests__/confirm-message.fixture.svelte.d.ts +0 -19
  48. package/dist/components/feedback/__tests__/confirm-message.fixture.svelte.d.ts.map +0 -1
  49. package/dist/components/feedback/__tests__/toast.test.js +0 -190
  50. package/dist/components/forms/__tests__/CameraCapture.test.js +0 -504
  51. package/dist/components/forms/__tests__/Combobox.test.js +0 -354
  52. package/dist/components/forms/__tests__/ControlHitArea.test.js +0 -73
  53. package/dist/components/forms/__tests__/DictationButton.test.js +0 -176
  54. package/dist/components/forms/__tests__/Fieldset.test.js +0 -37
  55. package/dist/components/forms/__tests__/Form.test.js +0 -201
  56. package/dist/components/forms/__tests__/FormActionBar.test.js +0 -22
  57. package/dist/components/forms/__tests__/FormGroup.test.js +0 -48
  58. package/dist/components/forms/__tests__/Input.test.js +0 -49
  59. package/dist/components/forms/__tests__/Listbox.test.js +0 -303
  60. package/dist/components/forms/__tests__/MultiSelect.test.js +0 -281
  61. package/dist/components/forms/__tests__/SearchInput.test.js +0 -92
  62. package/dist/components/forms/__tests__/Select.test.js +0 -37
  63. package/dist/components/forms/__tests__/SignaturePad.test.js +0 -338
  64. package/dist/components/forms/__tests__/StagedControlReview.test.js +0 -702
  65. package/dist/components/forms/__tests__/Textarea.test.js +0 -39
  66. package/dist/components/forms/__tests__/Toggle.test.js +0 -87
  67. package/dist/components/forms/__tests__/camera-capture-session.test.js +0 -207
  68. package/dist/components/forms/__tests__/capture-form-retry.test.js +0 -166
  69. package/dist/components/forms/__tests__/capture-form.fixture.svelte +0 -38
  70. package/dist/components/forms/__tests__/capture-form.fixture.svelte.d.ts +0 -10
  71. package/dist/components/forms/__tests__/capture-form.fixture.svelte.d.ts.map +0 -1
  72. package/dist/components/forms/__tests__/capture-test-env.d.ts +0 -70
  73. package/dist/components/forms/__tests__/capture-test-env.d.ts.map +0 -1
  74. package/dist/components/forms/__tests__/capture-test-env.js +0 -122
  75. package/dist/components/forms/__tests__/capture-touch.fixture.svelte +0 -15
  76. package/dist/components/forms/__tests__/capture-touch.fixture.svelte.d.ts +0 -8
  77. package/dist/components/forms/__tests__/capture-touch.fixture.svelte.d.ts.map +0 -1
  78. package/dist/components/forms/__tests__/combobox-form.fixture.svelte +0 -29
  79. package/dist/components/forms/__tests__/combobox-form.fixture.svelte.d.ts +0 -14
  80. package/dist/components/forms/__tests__/combobox-form.fixture.svelte.d.ts.map +0 -1
  81. package/dist/components/forms/__tests__/combobox-labels.fixture.svelte +0 -19
  82. package/dist/components/forms/__tests__/combobox-labels.fixture.svelte.d.ts +0 -11
  83. package/dist/components/forms/__tests__/combobox-labels.fixture.svelte.d.ts.map +0 -1
  84. package/dist/components/forms/__tests__/composite-controls.fixture.svelte +0 -47
  85. package/dist/components/forms/__tests__/composite-controls.fixture.svelte.d.ts +0 -12
  86. package/dist/components/forms/__tests__/composite-controls.fixture.svelte.d.ts.map +0 -1
  87. package/dist/components/forms/__tests__/composite-controls.test.js +0 -128
  88. package/dist/components/forms/__tests__/composite-registration.fixture.svelte +0 -29
  89. package/dist/components/forms/__tests__/composite-registration.fixture.svelte.d.ts +0 -8
  90. package/dist/components/forms/__tests__/composite-registration.fixture.svelte.d.ts.map +0 -1
  91. package/dist/components/forms/__tests__/composite-user-edit.fixture.svelte +0 -41
  92. package/dist/components/forms/__tests__/composite-user-edit.fixture.svelte.d.ts +0 -13
  93. package/dist/components/forms/__tests__/composite-user-edit.fixture.svelte.d.ts.map +0 -1
  94. package/dist/components/forms/__tests__/control-interaction.test.js +0 -3421
  95. package/dist/components/forms/__tests__/control-proposals.test.js +0 -63
  96. package/dist/components/forms/__tests__/core-controls.fixture.svelte +0 -50
  97. package/dist/components/forms/__tests__/core-controls.fixture.svelte.d.ts +0 -9
  98. package/dist/components/forms/__tests__/core-controls.fixture.svelte.d.ts.map +0 -1
  99. package/dist/components/forms/__tests__/core-controls.test.js +0 -311
  100. package/dist/components/forms/__tests__/decimal-sliders.fixture.svelte +0 -25
  101. package/dist/components/forms/__tests__/decimal-sliders.fixture.svelte.d.ts +0 -8
  102. package/dist/components/forms/__tests__/decimal-sliders.fixture.svelte.d.ts.map +0 -1
  103. package/dist/components/forms/__tests__/dictation-recording.test.js +0 -582
  104. package/dist/components/forms/__tests__/dictation.test.js +0 -486
  105. package/dist/components/forms/__tests__/form-attachment.fixture.svelte +0 -28
  106. package/dist/components/forms/__tests__/form-attachment.fixture.svelte.d.ts +0 -11
  107. package/dist/components/forms/__tests__/form-attachment.fixture.svelte.d.ts.map +0 -1
  108. package/dist/components/forms/__tests__/form-group-input.fixture.svelte +0 -16
  109. package/dist/components/forms/__tests__/form-group-input.fixture.svelte.d.ts +0 -9
  110. package/dist/components/forms/__tests__/form-group-input.fixture.svelte.d.ts.map +0 -1
  111. package/dist/components/forms/__tests__/form-retry-form.fixture.svelte +0 -31
  112. package/dist/components/forms/__tests__/form-retry-form.fixture.svelte.d.ts +0 -13
  113. package/dist/components/forms/__tests__/form-retry-form.fixture.svelte.d.ts.map +0 -1
  114. package/dist/components/forms/__tests__/form-retry-form.test.js +0 -107
  115. package/dist/components/forms/__tests__/hidden-controls-form-retry.test.js +0 -69
  116. package/dist/components/forms/__tests__/hidden-controls-form.fixture.svelte +0 -29
  117. package/dist/components/forms/__tests__/hidden-controls-form.fixture.svelte.d.ts +0 -9
  118. package/dist/components/forms/__tests__/hidden-controls-form.fixture.svelte.d.ts.map +0 -1
  119. package/dist/components/forms/__tests__/listbox-form.fixture.svelte +0 -27
  120. package/dist/components/forms/__tests__/listbox-form.fixture.svelte.d.ts +0 -13
  121. package/dist/components/forms/__tests__/listbox-form.fixture.svelte.d.ts.map +0 -1
  122. package/dist/components/forms/__tests__/long-press.test.js +0 -175
  123. package/dist/components/forms/__tests__/multiselect-form.fixture.svelte +0 -27
  124. package/dist/components/forms/__tests__/multiselect-form.fixture.svelte.d.ts +0 -13
  125. package/dist/components/forms/__tests__/multiselect-form.fixture.svelte.d.ts.map +0 -1
  126. package/dist/components/forms/__tests__/native-file-field.test.js +0 -177
  127. package/dist/components/forms/__tests__/place-picker.fixture.svelte +0 -33
  128. package/dist/components/forms/__tests__/place-picker.fixture.svelte.d.ts +0 -12
  129. package/dist/components/forms/__tests__/place-picker.fixture.svelte.d.ts.map +0 -1
  130. package/dist/components/forms/__tests__/segmented-posting.fixture.svelte +0 -28
  131. package/dist/components/forms/__tests__/segmented-posting.fixture.svelte.d.ts +0 -12
  132. package/dist/components/forms/__tests__/segmented-posting.fixture.svelte.d.ts.map +0 -1
  133. package/dist/components/forms/__tests__/segmented-posting.test.js +0 -92
  134. package/dist/components/forms/__tests__/select-interaction.fixture.svelte +0 -25
  135. package/dist/components/forms/__tests__/select-interaction.fixture.svelte.d.ts +0 -9
  136. package/dist/components/forms/__tests__/select-interaction.fixture.svelte.d.ts.map +0 -1
  137. package/dist/components/forms/__tests__/signature-pad-logic.test.js +0 -54
  138. package/dist/components/forms/__tests__/staged-review-fieldset.fixture.svelte +0 -21
  139. package/dist/components/forms/__tests__/staged-review-fieldset.fixture.svelte.d.ts +0 -8
  140. package/dist/components/forms/__tests__/staged-review-fieldset.fixture.svelte.d.ts.map +0 -1
  141. package/dist/components/forms/__tests__/staged-review-outer-fieldset.fixture.svelte +0 -23
  142. package/dist/components/forms/__tests__/staged-review-outer-fieldset.fixture.svelte.d.ts +0 -8
  143. package/dist/components/forms/__tests__/staged-review-outer-fieldset.fixture.svelte.d.ts.map +0 -1
  144. package/dist/components/forms/__tests__/staged-review.fixture.svelte +0 -56
  145. package/dist/components/forms/__tests__/staged-review.fixture.svelte.d.ts +0 -12
  146. package/dist/components/forms/__tests__/staged-review.fixture.svelte.d.ts.map +0 -1
  147. package/dist/components/forms/__tests__/touch-density.fixture.svelte +0 -34
  148. package/dist/components/forms/__tests__/touch-density.fixture.svelte.d.ts +0 -8
  149. package/dist/components/forms/__tests__/touch-density.fixture.svelte.d.ts.map +0 -1
  150. package/dist/components/forms/__tests__/touch-density.test.js +0 -66
  151. package/dist/components/forms/form-retry/__tests__/boundaries.test.js +0 -23
  152. package/dist/components/forms/form-retry/__tests__/content-digest.test.js +0 -70
  153. package/dist/components/forms/form-retry/__tests__/controller.test.js +0 -802
  154. package/dist/components/forms/form-retry/__tests__/fake-kit.d.ts +0 -82
  155. package/dist/components/forms/form-retry/__tests__/fake-kit.d.ts.map +0 -1
  156. package/dist/components/forms/form-retry/__tests__/fake-kit.js +0 -180
  157. package/dist/components/forms/form-retry/__tests__/form-draft.test.js +0 -169
  158. package/dist/components/forms/form-retry/__tests__/ssr.test.js +0 -37
  159. package/dist/components/forms/form-retry/__tests__/storage.d.ts +0 -26
  160. package/dist/components/forms/form-retry/__tests__/storage.d.ts.map +0 -1
  161. package/dist/components/forms/form-retry/__tests__/storage.js +0 -63
  162. package/dist/components/forms/form-retry/__tests__/submission-key.test.js +0 -236
  163. package/dist/components/forms/form-retry/__tests__/submitted-draft.test.js +0 -334
  164. package/dist/components/layout/__tests__/Container.test.js +0 -62
  165. package/dist/components/layout/__tests__/EmptyState.test.js +0 -83
  166. package/dist/components/layout/__tests__/Footer.test.js +0 -50
  167. package/dist/components/layout/__tests__/Grid.test.js +0 -121
  168. package/dist/components/layout/__tests__/Header.test.js +0 -48
  169. package/dist/components/layout/__tests__/Masthead.test.js +0 -93
  170. package/dist/components/layout/__tests__/PageHeader.test.js +0 -166
  171. package/dist/components/layout/__tests__/SummaryCard.test.js +0 -104
  172. package/dist/components/nav/__tests__/FilterChips.test.js +0 -94
  173. package/dist/components/nav/__tests__/LinkTabs.test.js +0 -117
  174. package/dist/components/nav/__tests__/Tabs.test.js +0 -128
  175. package/dist/components/roles/__tests__/RoleSelector.test.js +0 -134
  176. package/dist/components/ui/__tests__/Badge.test.js +0 -76
  177. package/dist/components/ui/__tests__/Button.test.js +0 -166
  178. package/dist/components/ui/__tests__/Card.test.js +0 -103
  179. package/dist/components/ui/__tests__/IconToggle.test.js +0 -59
  180. package/dist/components/ui/__tests__/IconToggleGroup.test.js +0 -30
  181. package/dist/components/ui/__tests__/Pagination.test.js +0 -113
  182. package/dist/components/ui/__tests__/Popover.test.js +0 -44
  183. package/dist/components/ui/__tests__/dropdown-popover-icon.test.js +0 -125
  184. package/dist/components/ui/__tests__/gap-primitives-interactive.test.js +0 -112
  185. package/dist/components/ui/__tests__/gap-primitives.test.js +0 -84
  186. package/dist/components/ui/__tests__/interaction-primitives.fixture.svelte +0 -13
  187. package/dist/components/ui/__tests__/interaction-primitives.fixture.svelte.d.ts +0 -19
  188. package/dist/components/ui/__tests__/interaction-primitives.fixture.svelte.d.ts.map +0 -1
  189. package/dist/components/ui/__tests__/interaction-primitives.test.js +0 -31
  190. package/dist/components/ui/__tests__/phone-touch-targets.test.js +0 -39
  191. package/dist/i18n/__tests__/i18n.test.js +0 -74
  192. package/dist/i18n/__tests__/render-parity.spec.js +0 -37
  193. package/dist/svelte/__tests__/playground.test.js +0 -20
  194. package/dist/themes/__tests__/control-boundary-contrast.test.js +0 -112
  195. package/dist/themes/__tests__/create-theme.test.js +0 -79
  196. package/dist/themes/__tests__/css-generator.test.js +0 -129
  197. package/dist/themes/__tests__/happyvertical-theme.test.js +0 -231
  198. package/dist/themes/__tests__/registry.test.js +0 -43
  199. package/dist/themes/__tests__/styles-lockstep.test.js +0 -32
  200. package/dist/themes/__tests__/theme-provider.test.js +0 -147
  201. package/dist/themes/__tests__/theme-script.test.js +0 -130
  202. package/dist/themes/__tests__/token-aliases.test.js +0 -178
  203. package/dist/utils/forms/__tests__/formatters.test.js +0 -27
  204. package/dist/utils/theme/__tests__/color.test.js +0 -89
  205. package/dist/utils/theme/__tests__/typography.test.js +0 -11
@@ -1,122 +0,0 @@
1
- /**
2
- * jsdom stand-ins for the browser APIs `CameraCapture` and `SignaturePad` use
3
- * (smrt#3290). jsdom has no `DataTransfer`, no canvas, no media playback and
4
- * never fires the `formdata` event, so each is supplied here, as close to the
5
- * browser contract as the tests need.
6
- */
7
- import { vi } from 'vitest';
8
- function implOf(wrapper, guard) {
9
- const key = Object.getOwnPropertySymbols(wrapper).find((symbol) => guard(wrapper[symbol]));
10
- if (!key)
11
- throw new Error('jsdom wrapper has no implementation symbol');
12
- return wrapper[key];
13
- }
14
- /**
15
- * A real jsdom `FileList` holding `files`. jsdom's `input.files` setter only
16
- * accepts genuine `FileList` instances and exposes no constructor, so the list
17
- * is taken from a detached file input and filled through its implementation
18
- * object. This keeps `new FormData(form)` reading the files exactly as a
19
- * browser would after `input.files = dataTransfer.files`.
20
- */
21
- export function createFileList(files) {
22
- const input = document.createElement('input');
23
- input.type = 'file';
24
- const list = input.files;
25
- const impl = implOf(list, Array.isArray);
26
- for (const file of files) {
27
- impl.push(implOf(file, (value) => typeof value === 'object' && value !== null));
28
- }
29
- return list;
30
- }
31
- /** Browser-shaped `DataTransfer` for jsdom: `items.add()` plus a real `files`. */
32
- export class TestDataTransfer {
33
- #files = [];
34
- items = {
35
- add: (file) => {
36
- this.#files.push(file);
37
- return null;
38
- },
39
- };
40
- get files() {
41
- return createFileList(this.#files);
42
- }
43
- }
44
- /** Marker constructor: its presence is what feature detection reads. */
45
- export class TestFormDataEvent {
46
- }
47
- /** Select the posting strategy the component will detect on mount. */
48
- export function useFileFieldStrategy(strategy) {
49
- vi.stubGlobal('DataTransfer', strategy === 'data-transfer' ? TestDataTransfer : undefined);
50
- vi.stubGlobal('FormDataEvent', strategy === 'formdata-event' ? TestFormDataEvent : undefined);
51
- }
52
- /**
53
- * The entry list a native submit of `form` would send: what `new FormData`
54
- * builds, plus the browser's `formdata` event (which jsdom never fires) so the
55
- * fallback strategy's listener can contribute.
56
- */
57
- export function submittedEntries(form) {
58
- const formData = new FormData(form);
59
- const event = new Event('formdata');
60
- Object.defineProperty(event, 'formData', { value: formData });
61
- form.dispatchEvent(event);
62
- return formData;
63
- }
64
- /**
65
- * Make `new FormData(form)` fire `formdata` on the form, as browsers do while
66
- * constructing the entry list (jsdom does not), so code that snapshots a form
67
- * — SvelteKit's `enhance`, form-retry's draft comparison — sees files the
68
- * `formdata`-event strategy appends. Do not combine with
69
- * {@link submittedEntries}, which dispatches the event itself.
70
- */
71
- export function useBrowserFormData() {
72
- const NativeFormData = FormData;
73
- class BrowserFormData extends NativeFormData {
74
- constructor(form, submitter) {
75
- super(form, submitter);
76
- if (!form)
77
- return;
78
- const event = new Event('formdata');
79
- Object.defineProperty(event, 'formData', { value: this });
80
- form.dispatchEvent(event);
81
- }
82
- }
83
- vi.stubGlobal('FormData', BrowserFormData);
84
- }
85
- export function stubCanvas() {
86
- const context = {
87
- drawImage: vi.fn(),
88
- fillRect: vi.fn(),
89
- beginPath: vi.fn(),
90
- moveTo: vi.fn(),
91
- lineTo: vi.fn(),
92
- stroke: vi.fn(),
93
- fillStyle: '',
94
- strokeStyle: '',
95
- lineWidth: 1,
96
- lineCap: 'butt',
97
- lineJoin: 'miter',
98
- };
99
- vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockImplementation(() => context);
100
- vi.spyOn(HTMLCanvasElement.prototype, 'toDataURL').mockImplementation((type = 'image/png') => `data:${type};base64,AAAA`);
101
- vi.spyOn(HTMLCanvasElement.prototype, 'toBlob').mockImplementation((callback, type = 'image/png') => {
102
- callback(new Blob(['pixels'], { type }));
103
- });
104
- return context;
105
- }
106
- /** `play()` is unimplemented in jsdom; resolve it like an allowed autoplay. */
107
- export function stubMediaPlayback() {
108
- vi.spyOn(HTMLMediaElement.prototype, 'play').mockResolvedValue(undefined);
109
- }
110
- export function fakeStream(tracks = [{ stop: vi.fn() }]) {
111
- return { getTracks: () => tracks };
112
- }
113
- /** Install `navigator.mediaDevices` (or remove it with `undefined`). */
114
- export function installMediaDevices(mediaDevices) {
115
- Object.defineProperty(window.navigator, 'mediaDevices', {
116
- configurable: true,
117
- value: mediaDevices,
118
- });
119
- }
120
- export function removeMediaDevices() {
121
- delete window.navigator.mediaDevices;
122
- }
@@ -1,15 +0,0 @@
1
- <script lang="ts">
2
- import ThemeProvider from '../../../themes/ThemeProvider.svelte';
3
- import CameraCapture from '../CameraCapture.svelte';
4
- import SignaturePad from '../SignaturePad.svelte';
5
-
6
- let {
7
- density = 'comfortable',
8
- target = '48px',
9
- }: { density?: 'comfortable' | 'touch'; target?: string } = $props();
10
- </script>
11
- <!-- Capture actions are touch targets at every density: comfortable is the default here on purpose. -->
12
- <ThemeProvider {density} overrides={{ '--smrt-touch-target-min': target }} persist={false} inlineVariables>
13
- <CameraCapture name="photo" fileInputFallback interaction={false} />
14
- <SignaturePad name="signature" interaction={false} />
15
- </ThemeProvider>
@@ -1,8 +0,0 @@
1
- type $$ComponentProps = {
2
- density?: 'comfortable' | 'touch';
3
- target?: string;
4
- };
5
- declare const CaptureTouch: import("svelte").Component<$$ComponentProps, {}, "">;
6
- type CaptureTouch = ReturnType<typeof CaptureTouch>;
7
- export default CaptureTouch;
8
- //# sourceMappingURL=capture-touch.fixture.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capture-touch.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/capture-touch.fixture.svelte.ts"],"names":[],"mappings":"AAOC,KAAK,gBAAgB,GAAI;IAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAmBjF,QAAA,MAAM,YAAY,sDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -1,29 +0,0 @@
1
- <script lang="ts">
2
- import Combobox from '../Combobox.svelte';
3
- import type { ControlInteractionRegistry } from '../control-interaction.js';
4
- import Form from '../Form.svelte';
5
-
6
- interface Props {
7
- name?: string;
8
- unnamed?: boolean;
9
- value?: string;
10
- disabled?: boolean;
11
- fieldsetDisabled?: boolean;
12
- allowCustom?: boolean;
13
- registry?: ControlInteractionRegistry;
14
- }
15
- let {
16
- name = 'sku',
17
- unnamed = false,
18
- value = $bindable(''),
19
- disabled = false,
20
- fieldsetDisabled = false,
21
- allowCustom = false,
22
- registry,
23
- }: Props = $props();
24
- </script>
25
- <Form formId="order" interactionRegistry={registry} aria-label="Order">
26
- <fieldset disabled={fieldsetDisabled}>
27
- <Combobox name={unnamed ? undefined : name} label="SKU" options={[{value: '42', label: 'Plate 1/4 A36'}, {value: '43', label: 'Disabled plate', disabled: true}]} bind:value {disabled} {allowCustom} interaction={{id: 'sku'}} />
28
- </fieldset>
29
- </Form>
@@ -1,14 +0,0 @@
1
- import type { ControlInteractionRegistry } from '../control-interaction.js';
2
- interface Props {
3
- name?: string;
4
- unnamed?: boolean;
5
- value?: string;
6
- disabled?: boolean;
7
- fieldsetDisabled?: boolean;
8
- allowCustom?: boolean;
9
- registry?: ControlInteractionRegistry;
10
- }
11
- declare const ComboboxForm: import("svelte").Component<Props, {}, "value">;
12
- type ComboboxForm = ReturnType<typeof ComboboxForm>;
13
- export default ComboboxForm;
14
- //# sourceMappingURL=combobox-form.fixture.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"combobox-form.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/combobox-form.fixture.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAI5E,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,0BAA0B,CAAC;CACvC;AAwBD,QAAA,MAAM,YAAY,gDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -1,19 +0,0 @@
1
- <script lang="ts">
2
- import Combobox from '../Combobox.svelte';
3
- import type { ControlOption } from '../control-interaction.js';
4
-
5
- let {
6
- options = [],
7
- value = $bindable(''),
8
- valueLabel = undefined,
9
- required = false,
10
- }: {
11
- options?: ControlOption[];
12
- value?: string;
13
- valueLabel?: string;
14
- required?: boolean;
15
- } = $props();
16
- </script>
17
-
18
- <Combobox label="Town" name="town" {options} {valueLabel} {required} bind:value />
19
- <p data-testid="value">{value}</p>
@@ -1,11 +0,0 @@
1
- import type { ControlOption } from '../control-interaction.js';
2
- type $$ComponentProps = {
3
- options?: ControlOption[];
4
- value?: string;
5
- valueLabel?: string;
6
- required?: boolean;
7
- };
8
- declare const ComboboxLabels: import("svelte").Component<$$ComponentProps, {}, "value">;
9
- type ComboboxLabels = ReturnType<typeof ComboboxLabels>;
10
- export default ComboboxLabels;
11
- //# sourceMappingURL=combobox-labels.fixture.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"combobox-labels.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/combobox-labels.fixture.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE9D,KAAK,gBAAgB,GAAI;IACxB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAkBF,QAAA,MAAM,cAAc,2DAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -1,47 +0,0 @@
1
- <script lang="ts">
2
- import Combobox from '../Combobox.svelte';
3
- import type {
4
- ControlInteractionRegistry,
5
- ControlOption,
6
- } from '../control-interaction.js';
7
- import Form from '../Form.svelte';
8
- import Listbox from '../Listbox.svelte';
9
- import MultiSelect from '../MultiSelect.svelte';
10
- import TagsInput from '../TagsInput.svelte';
11
-
12
- interface Props {
13
- registry: ControlInteractionRegistry;
14
- fieldsetDisabled?: boolean;
15
- collisionOptions?: ControlOption[];
16
- collisionValues?: Array<string | number>;
17
- onCollisionValuesChange?: (values: Array<string | number>) => void;
18
- }
19
- let {
20
- registry,
21
- fieldsetDisabled = false,
22
- collisionOptions,
23
- collisionValues = $bindable([]),
24
- onCollisionValuesChange,
25
- }: Props = $props();
26
- const countries = [
27
- { value: 'ca', label: 'Canada' },
28
- { value: 'us', label: 'United States' },
29
- { value: 'mx', label: 'Mexico' },
30
- ];
31
- let country = $state('');
32
- let channels = $state<Array<string | number>>([]);
33
- let tags = $state<string[]>([]);
34
- let region = $state<string | number>('west');
35
- </script>
36
-
37
- <Form formId="profile" interactionRegistry={registry} aria-label="Profile">
38
- <fieldset disabled={fieldsetDisabled}>
39
- <Combobox name="country" label="Country" options={countries} required bind:value={country} />
40
- <MultiSelect name="channels" label="Channels" options={[{ value: 'email', label: 'Email' }, { value: 'sms', label: 'SMS' }]} bind:values={channels} />
41
- <TagsInput name="topics" label="Topics" maxTags={2} bind:values={tags} />
42
- <Listbox name="region" label="Region" options={[{ value: 'west', label: 'West' }, { value: 'east', label: 'East' }]} bind:value={region} />
43
- {#if collisionOptions}
44
- <MultiSelect name="collision" label="Collision" options={collisionOptions} bind:values={collisionValues} onvalueschange={onCollisionValuesChange} />
45
- {/if}
46
- </fieldset>
47
- </Form>
@@ -1,12 +0,0 @@
1
- import type { ControlInteractionRegistry, ControlOption } from '../control-interaction.js';
2
- interface Props {
3
- registry: ControlInteractionRegistry;
4
- fieldsetDisabled?: boolean;
5
- collisionOptions?: ControlOption[];
6
- collisionValues?: Array<string | number>;
7
- onCollisionValuesChange?: (values: Array<string | number>) => void;
8
- }
9
- declare const CompositeControls: import("svelte").Component<Props, {}, "collisionValues">;
10
- type CompositeControls = ReturnType<typeof CompositeControls>;
11
- export default CompositeControls;
12
- //# sourceMappingURL=composite-controls.fixture.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composite-controls.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/composite-controls.fixture.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,0BAA0B,EAC1B,aAAa,EACd,MAAM,2BAA2B,CAAC;AAOnC,UAAU,KAAK;IACb,QAAQ,EAAE,0BAA0B,CAAC;IACrC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,aAAa,EAAE,CAAC;IACnC,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACzC,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;CACpE;AAyCD,QAAA,MAAM,iBAAiB,0DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
@@ -1,128 +0,0 @@
1
- import { render, screen } from '@testing-library/svelte';
2
- import userEvent from '@testing-library/user-event';
3
- import { describe, expect, it, vi } from 'vitest';
4
- import { expectNoA11yViolations } from '../../../test-support/a11y';
5
- import { createControlInteractionRegistry } from '../control-interaction.js';
6
- import Fixture from './composite-controls.fixture.svelte';
7
- describe('composite controls', () => {
8
- it('supports searchable, multiple, tag, and listbox selection', async () => {
9
- const registry = createControlInteractionRegistry();
10
- render(Fixture, { props: { registry } });
11
- const country = screen.getByRole('combobox', { name: 'Country' });
12
- await userEvent.type(country, 'Can');
13
- await userEvent.click(screen.getByRole('option', { name: 'Canada' }));
14
- expect(country).toHaveValue('Canada');
15
- await userEvent.click(screen.getByRole('button', { name: /Channels.*Select options/ }));
16
- await userEvent.click(screen.getByRole('option', { name: 'Email' }));
17
- expect(screen.getByRole('option', { name: 'Email' })).toHaveAttribute('aria-selected', 'true');
18
- await userEvent.type(screen.getByRole('textbox', { name: 'Topics' }), 'svelte{Enter}');
19
- expect(screen.getByText('svelte')).toBeInTheDocument();
20
- await userEvent.click(screen.getByRole('option', { name: 'East' }));
21
- expect(screen.getByRole('option', { name: 'East' })).toHaveAttribute('aria-selected', 'true');
22
- });
23
- it('registers stable controls for agent adapters', () => {
24
- const registry = createControlInteractionRegistry();
25
- render(Fixture, { props: { registry } });
26
- expect(registry.list('profile').map((item) => item.identity.controlId)).toEqual(['country', 'channels', 'topics', 'region']);
27
- });
28
- it('rejects invalid choice and normalized-shape proposals at staging time', async () => {
29
- const registry = createControlInteractionRegistry();
30
- render(Fixture, { props: { registry } });
31
- const invalid = new Map([
32
- ['country', 'unknown'],
33
- ['channels', ['fax']],
34
- ['topics', ['duplicate', 'duplicate']],
35
- ['region', 'north'],
36
- ]);
37
- for (const [controlId, value] of invalid) {
38
- await registry.execute({
39
- action: 'stage',
40
- identity: { formId: 'profile', controlId },
41
- value,
42
- }, { source: 'agent' });
43
- expect(registry.get({ formId: 'profile', controlId })?.state.staged?.valid).toBe(false);
44
- }
45
- expect(await screen.findAllByRole('alert')).toHaveLength(invalid.size);
46
- });
47
- it('applies only the deterministic MultiSelect match for colliding values', async () => {
48
- const registry = createControlInteractionRegistry({
49
- isLocalGesture: () => true,
50
- });
51
- const onValuesChange = vi.fn();
52
- render(Fixture, {
53
- props: {
54
- registry,
55
- collisionOptions: [
56
- { value: 1, label: 'Number one' },
57
- { value: '1', label: 'String one' },
58
- { value: 2, label: 'Disabled two', disabled: true },
59
- ],
60
- onCollisionValuesChange: onValuesChange,
61
- },
62
- });
63
- await registry.execute({
64
- action: 'stage',
65
- identity: { formId: 'profile', controlId: 'collision' },
66
- value: [1],
67
- }, { source: 'agent' });
68
- expect(registry.get({ formId: 'profile', controlId: 'collision' })?.state.staged
69
- ?.valid).toBe(true);
70
- await userEvent.click(screen.getByRole('button', { name: 'Apply valid changes' }));
71
- expect(onValuesChange).toHaveBeenLastCalledWith([1]);
72
- await userEvent.click(screen.getByRole('button', { name: /Collision.*Number one/ }));
73
- expect(screen.getByRole('option', { name: 'Number one' })).toHaveAttribute('aria-selected', 'true');
74
- expect(screen.getByRole('option', { name: 'String one' })).toHaveAttribute('aria-selected', 'false');
75
- for (const value of [[1, 1], [2], ['unknown']]) {
76
- await registry.execute({
77
- action: 'stage',
78
- identity: { formId: 'profile', controlId: 'collision' },
79
- value,
80
- }, { source: 'agent' });
81
- expect(registry.get({ formId: 'profile', controlId: 'collision' })?.state
82
- .staged?.valid).toBe(false);
83
- }
84
- });
85
- it('stages the typed option value selected by a transport string', async () => {
86
- const registry = createControlInteractionRegistry();
87
- render(Fixture, {
88
- props: {
89
- registry,
90
- collisionOptions: [{ value: 1, label: 'Number one' }],
91
- },
92
- });
93
- await registry.execute({
94
- action: 'stage',
95
- identity: { formId: 'profile', controlId: 'collision' },
96
- value: ['1'],
97
- }, { source: 'agent' });
98
- expect(registry.get({ formId: 'profile', controlId: 'collision' })?.state.staged
99
- ?.value).toEqual([1]);
100
- });
101
- it('normalizes legacy string-bound selections for numeric options', async () => {
102
- const registry = createControlInteractionRegistry();
103
- const onValuesChange = vi.fn();
104
- render(Fixture, {
105
- props: {
106
- registry,
107
- collisionOptions: [{ value: 1, label: 'Number one' }],
108
- collisionValues: ['1'],
109
- onCollisionValuesChange: onValuesChange,
110
- },
111
- });
112
- await userEvent.click(screen.getByRole('button', { name: /Collision.*Number one/ }));
113
- const option = screen.getByRole('option', { name: 'Number one' });
114
- expect(option).toHaveAttribute('aria-selected', 'true');
115
- await userEvent.click(option);
116
- expect(onValuesChange).toHaveBeenLastCalledWith([]);
117
- });
118
- it('reports effective disabled state from an ancestor fieldset', () => {
119
- const registry = createControlInteractionRegistry();
120
- render(Fixture, { props: { registry, fieldsetDisabled: true } });
121
- expect(registry.list('profile').map((item) => item.state.disabled)).toEqual([true, true, true, true]);
122
- });
123
- it('is axe-clean', async () => {
124
- const registry = createControlInteractionRegistry();
125
- const { container } = render(Fixture, { props: { registry } });
126
- await expectNoA11yViolations(container);
127
- });
128
- });
@@ -1,29 +0,0 @@
1
- <script lang="ts">
2
- import type { ControlInteractionRegistry } from '../control-interaction.js';
3
- import Form from '../Form.svelte';
4
- import FormGroup from '../FormGroup.svelte';
5
- import Input from '../Input.svelte';
6
- import PlacePicker from './place-picker.fixture.svelte';
7
-
8
- interface Props {
9
- registry: ControlInteractionRegistry;
10
- }
11
- let { registry }: Props = $props();
12
- let name = $state('');
13
- let place = $state<{
14
- name: string;
15
- latitude: number;
16
- longitude: number;
17
- } | null>(null);
18
- </script>
19
-
20
- <Form formId="new-site" interactionRegistry={registry} aria-label="New site">
21
- <FormGroup label="Site name" id="site-name">
22
- <Input name="name" bind:value={name} />
23
- </FormGroup>
24
- <PlacePicker bind:value={place} />
25
- <FormGroup label="Password" id="site-password">
26
- <Input name="password" type="password" value="" />
27
- </FormGroup>
28
- </Form>
29
- <p data-testid="place">{place ? place.name : 'none'}</p>
@@ -1,8 +0,0 @@
1
- import type { ControlInteractionRegistry } from '../control-interaction.js';
2
- interface Props {
3
- registry: ControlInteractionRegistry;
4
- }
5
- declare const CompositeRegistration: import("svelte").Component<Props, {}, "">;
6
- type CompositeRegistration = ReturnType<typeof CompositeRegistration>;
7
- export default CompositeRegistration;
8
- //# sourceMappingURL=composite-registration.fixture.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composite-registration.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/composite-registration.fixture.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAO5E,UAAU,KAAK;IACb,QAAQ,EAAE,0BAA0B,CAAC;CACtC;AA8BD,QAAA,MAAM,qBAAqB,2CAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
@@ -1,41 +0,0 @@
1
- <script lang="ts">
2
- import type { ControlInteractionRegistry } from '../control-interaction.js';
3
- import Form from '../Form.svelte';
4
- import SegmentedControl from '../SegmentedControl.svelte';
5
-
6
- let {
7
- registry,
8
- onchange,
9
- modeState,
10
- }: {
11
- registry: ControlInteractionRegistry;
12
- onchange?: (event: Event) => void;
13
- modeState?: {
14
- get?: () => string;
15
- set?: (next: string) => void;
16
- };
17
- } = $props();
18
-
19
- let mode = $state<'draft' | 'review' | 'published'>('draft');
20
-
21
- $effect(() => {
22
- if (!modeState) return;
23
- modeState.get = () => mode;
24
- modeState.set = (next) => {
25
- mode = next as typeof mode;
26
- };
27
- });
28
- </script>
29
-
30
- <Form formId="profile" interactionRegistry={registry} {onchange}>
31
- <SegmentedControl
32
- name="mode"
33
- label="Mode"
34
- bind:value={mode}
35
- options={[
36
- { value: 'draft', label: 'Draft' },
37
- { value: 'review', label: 'Review' },
38
- { value: 'published', label: 'Published' },
39
- ]}
40
- />
41
- </Form>
@@ -1,13 +0,0 @@
1
- import type { ControlInteractionRegistry } from '../control-interaction.js';
2
- type $$ComponentProps = {
3
- registry: ControlInteractionRegistry;
4
- onchange?: (event: Event) => void;
5
- modeState?: {
6
- get?: () => string;
7
- set?: (next: string) => void;
8
- };
9
- };
10
- declare const CompositeUserEdit: import("svelte").Component<$$ComponentProps, {}, "">;
11
- type CompositeUserEdit = ReturnType<typeof CompositeUserEdit>;
12
- export default CompositeUserEdit;
13
- //# sourceMappingURL=composite-user-edit.fixture.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composite-user-edit.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/composite-user-edit.fixture.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAI3E,KAAK,gBAAgB,GAAI;IACxB,QAAQ,EAAE,0BAA0B,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;KAC9B,CAAC;CACH,CAAC;AAiCF,QAAA,MAAM,iBAAiB,sDAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}