@happyvertical/smrt-ui 0.52.0 → 0.53.1

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 (208) hide show
  1. package/AGENTS.md +11 -1
  2. package/README.md +300 -2
  3. package/dist/components/data/DataTable.svelte +60 -15
  4. package/dist/components/data/DataTable.svelte.d.ts.map +1 -1
  5. package/dist/components/data/DataTableResponsive.d.ts +4 -0
  6. package/dist/components/data/DataTableResponsive.d.ts.map +1 -0
  7. package/dist/components/data/DataTableResponsive.js +22 -0
  8. package/dist/components/data/__tests__/DataTableResponsive.test.js +80 -0
  9. package/dist/components/data/__tests__/responsive-table.fixture.svelte +29 -0
  10. package/dist/components/data/__tests__/responsive-table.fixture.svelte.d.ts +7 -0
  11. package/dist/components/data/__tests__/responsive-table.fixture.svelte.d.ts.map +1 -0
  12. package/dist/components/data/types.d.ts +8 -0
  13. package/dist/components/data/types.d.ts.map +1 -1
  14. package/dist/components/display/DateDisplay.svelte +76 -14
  15. package/dist/components/display/DateDisplay.svelte.d.ts +2 -0
  16. package/dist/components/display/DateDisplay.svelte.d.ts.map +1 -1
  17. package/dist/components/display/Icon.svelte +3 -16
  18. package/dist/components/display/Icon.svelte.d.ts +0 -9
  19. package/dist/components/display/Icon.svelte.d.ts.map +1 -1
  20. package/dist/components/display/StatusBadge.svelte +29 -2
  21. package/dist/components/display/StatusBadge.svelte.d.ts +4 -2
  22. package/dist/components/display/StatusBadge.svelte.d.ts.map +1 -1
  23. package/dist/components/display/__tests__/DateDisplay.test.js +82 -1
  24. package/dist/components/display/__tests__/Icon.test.js +132 -2
  25. package/dist/components/display/__tests__/StatusBadge.test.js +78 -0
  26. package/dist/components/display/icons.svelte.d.ts +11 -0
  27. package/dist/components/display/icons.svelte.d.ts.map +1 -0
  28. package/dist/components/display/icons.svelte.js +60 -0
  29. package/dist/components/display/index.d.ts +3 -1
  30. package/dist/components/display/index.d.ts.map +1 -1
  31. package/dist/components/display/index.js +1 -0
  32. package/dist/components/display/types.d.ts +2 -0
  33. package/dist/components/display/types.d.ts.map +1 -1
  34. package/dist/components/feedback/ConfirmDialog.svelte +59 -48
  35. package/dist/components/feedback/ConfirmDialog.svelte.d.ts +14 -2
  36. package/dist/components/feedback/ConfirmDialog.svelte.d.ts.map +1 -1
  37. package/dist/components/feedback/ToastViewport.svelte +156 -8
  38. package/dist/components/feedback/ToastViewport.svelte.d.ts +5 -1
  39. package/dist/components/feedback/ToastViewport.svelte.d.ts.map +1 -1
  40. package/dist/components/feedback/__tests__/ConfirmDialog.test.js +38 -20
  41. package/dist/components/feedback/__tests__/confirm-message.fixture.svelte +9 -0
  42. package/dist/components/feedback/__tests__/confirm-message.fixture.svelte.d.ts +19 -0
  43. package/dist/components/feedback/__tests__/confirm-message.fixture.svelte.d.ts.map +1 -0
  44. package/dist/components/feedback/__tests__/toast.test.js +142 -1
  45. package/dist/components/feedback/index.d.ts +1 -1
  46. package/dist/components/feedback/index.d.ts.map +1 -1
  47. package/dist/components/feedback/toast.d.ts +13 -1
  48. package/dist/components/feedback/toast.d.ts.map +1 -1
  49. package/dist/components/feedback/toast.js +51 -10
  50. package/dist/components/forms/CameraCapture.svelte +619 -0
  51. package/dist/components/forms/CameraCapture.svelte.d.ts +42 -0
  52. package/dist/components/forms/CameraCapture.svelte.d.ts.map +1 -0
  53. package/dist/components/forms/Checkbox.svelte +8 -1
  54. package/dist/components/forms/Checkbox.svelte.d.ts +2 -0
  55. package/dist/components/forms/Checkbox.svelte.d.ts.map +1 -1
  56. package/dist/components/forms/Combobox.svelte +40 -0
  57. package/dist/components/forms/Combobox.svelte.d.ts.map +1 -1
  58. package/dist/components/forms/Form.svelte +5 -0
  59. package/dist/components/forms/Form.svelte.d.ts +1 -0
  60. package/dist/components/forms/Form.svelte.d.ts.map +1 -1
  61. package/dist/components/forms/Input.svelte +8 -1
  62. package/dist/components/forms/Input.svelte.d.ts +2 -0
  63. package/dist/components/forms/Input.svelte.d.ts.map +1 -1
  64. package/dist/components/forms/Listbox.svelte +39 -1
  65. package/dist/components/forms/Listbox.svelte.d.ts.map +1 -1
  66. package/dist/components/forms/MultiSelect.svelte +41 -1
  67. package/dist/components/forms/MultiSelect.svelte.d.ts.map +1 -1
  68. package/dist/components/forms/Radio.svelte +1 -0
  69. package/dist/components/forms/RadioGroup.svelte +7 -1
  70. package/dist/components/forms/RadioGroup.svelte.d.ts +2 -0
  71. package/dist/components/forms/RadioGroup.svelte.d.ts.map +1 -1
  72. package/dist/components/forms/SegmentedControl.svelte +152 -11
  73. package/dist/components/forms/SegmentedControl.svelte.d.ts +4 -0
  74. package/dist/components/forms/SegmentedControl.svelte.d.ts.map +1 -1
  75. package/dist/components/forms/Select.svelte +8 -1
  76. package/dist/components/forms/Select.svelte.d.ts +2 -0
  77. package/dist/components/forms/Select.svelte.d.ts.map +1 -1
  78. package/dist/components/forms/SignaturePad.svelte +436 -0
  79. package/dist/components/forms/SignaturePad.svelte.d.ts +32 -0
  80. package/dist/components/forms/SignaturePad.svelte.d.ts.map +1 -0
  81. package/dist/components/forms/Switch.svelte +8 -1
  82. package/dist/components/forms/Switch.svelte.d.ts +2 -0
  83. package/dist/components/forms/Switch.svelte.d.ts.map +1 -1
  84. package/dist/components/forms/Textarea.svelte +8 -1
  85. package/dist/components/forms/Textarea.svelte.d.ts +2 -0
  86. package/dist/components/forms/Textarea.svelte.d.ts.map +1 -1
  87. package/dist/components/forms/__tests__/CameraCapture.test.js +504 -0
  88. package/dist/components/forms/__tests__/Combobox.test.js +279 -12
  89. package/dist/components/forms/__tests__/Form.test.js +46 -0
  90. package/dist/components/forms/__tests__/Listbox.test.js +303 -0
  91. package/dist/components/forms/__tests__/MultiSelect.test.js +281 -0
  92. package/dist/components/forms/__tests__/SignaturePad.test.js +338 -0
  93. package/dist/components/forms/__tests__/camera-capture-session.test.js +207 -0
  94. package/dist/components/forms/__tests__/capture-form-retry.test.js +166 -0
  95. package/dist/components/forms/__tests__/capture-form.fixture.svelte +38 -0
  96. package/dist/components/forms/__tests__/capture-form.fixture.svelte.d.ts +10 -0
  97. package/dist/components/forms/__tests__/capture-form.fixture.svelte.d.ts.map +1 -0
  98. package/dist/components/forms/__tests__/capture-test-env.d.ts +70 -0
  99. package/dist/components/forms/__tests__/capture-test-env.d.ts.map +1 -0
  100. package/dist/components/forms/__tests__/capture-test-env.js +122 -0
  101. package/dist/components/forms/__tests__/capture-touch.fixture.svelte +15 -0
  102. package/dist/components/forms/__tests__/capture-touch.fixture.svelte.d.ts +8 -0
  103. package/dist/components/forms/__tests__/capture-touch.fixture.svelte.d.ts.map +1 -0
  104. package/dist/components/forms/__tests__/combobox-form.fixture.svelte +29 -0
  105. package/dist/components/forms/__tests__/combobox-form.fixture.svelte.d.ts +14 -0
  106. package/dist/components/forms/__tests__/combobox-form.fixture.svelte.d.ts.map +1 -0
  107. package/dist/components/forms/__tests__/form-attachment.fixture.svelte +28 -0
  108. package/dist/components/forms/__tests__/form-attachment.fixture.svelte.d.ts +11 -0
  109. package/dist/components/forms/__tests__/form-attachment.fixture.svelte.d.ts.map +1 -0
  110. package/dist/components/forms/__tests__/form-retry-form.fixture.svelte +31 -0
  111. package/dist/components/forms/__tests__/form-retry-form.fixture.svelte.d.ts +13 -0
  112. package/dist/components/forms/__tests__/form-retry-form.fixture.svelte.d.ts.map +1 -0
  113. package/dist/components/forms/__tests__/form-retry-form.test.js +107 -0
  114. package/dist/components/forms/__tests__/hidden-controls-form-retry.test.js +69 -0
  115. package/dist/components/forms/__tests__/hidden-controls-form.fixture.svelte +29 -0
  116. package/dist/components/forms/__tests__/hidden-controls-form.fixture.svelte.d.ts +9 -0
  117. package/dist/components/forms/__tests__/hidden-controls-form.fixture.svelte.d.ts.map +1 -0
  118. package/dist/components/forms/__tests__/listbox-form.fixture.svelte +27 -0
  119. package/dist/components/forms/__tests__/listbox-form.fixture.svelte.d.ts +13 -0
  120. package/dist/components/forms/__tests__/listbox-form.fixture.svelte.d.ts.map +1 -0
  121. package/dist/components/forms/__tests__/multiselect-form.fixture.svelte +27 -0
  122. package/dist/components/forms/__tests__/multiselect-form.fixture.svelte.d.ts +13 -0
  123. package/dist/components/forms/__tests__/multiselect-form.fixture.svelte.d.ts.map +1 -0
  124. package/dist/components/forms/__tests__/native-file-field.test.js +177 -0
  125. package/dist/components/forms/__tests__/segmented-posting.fixture.svelte +28 -0
  126. package/dist/components/forms/__tests__/segmented-posting.fixture.svelte.d.ts +12 -0
  127. package/dist/components/forms/__tests__/segmented-posting.fixture.svelte.d.ts.map +1 -0
  128. package/dist/components/forms/__tests__/segmented-posting.test.js +92 -0
  129. package/dist/components/forms/__tests__/signature-pad-logic.test.js +54 -0
  130. package/dist/components/forms/__tests__/touch-density.fixture.svelte +34 -0
  131. package/dist/components/forms/__tests__/touch-density.fixture.svelte.d.ts +8 -0
  132. package/dist/components/forms/__tests__/touch-density.fixture.svelte.d.ts.map +1 -0
  133. package/dist/components/forms/__tests__/touch-density.test.js +66 -0
  134. package/dist/components/forms/camera-capture-session.d.ts +81 -0
  135. package/dist/components/forms/camera-capture-session.d.ts.map +1 -0
  136. package/dist/components/forms/camera-capture-session.js +130 -0
  137. package/dist/components/forms/form-retry/__tests__/boundaries.test.js +23 -0
  138. package/dist/components/forms/form-retry/__tests__/content-digest.test.js +70 -0
  139. package/dist/components/forms/form-retry/__tests__/controller.test.js +802 -0
  140. package/dist/components/forms/form-retry/__tests__/fake-kit.d.ts +82 -0
  141. package/dist/components/forms/form-retry/__tests__/fake-kit.d.ts.map +1 -0
  142. package/dist/components/forms/form-retry/__tests__/fake-kit.js +180 -0
  143. package/dist/components/forms/form-retry/__tests__/form-draft.test.js +169 -0
  144. package/dist/components/forms/form-retry/__tests__/ssr.test.js +37 -0
  145. package/dist/components/forms/form-retry/__tests__/storage.d.ts +26 -0
  146. package/dist/components/forms/form-retry/__tests__/storage.d.ts.map +1 -0
  147. package/dist/components/forms/form-retry/__tests__/storage.js +63 -0
  148. package/dist/components/forms/form-retry/__tests__/submission-key.test.js +236 -0
  149. package/dist/components/forms/form-retry/__tests__/submitted-draft.test.js +334 -0
  150. package/dist/components/forms/form-retry/content-digest.d.ts +54 -0
  151. package/dist/components/forms/form-retry/content-digest.d.ts.map +1 -0
  152. package/dist/components/forms/form-retry/content-digest.js +169 -0
  153. package/dist/components/forms/form-retry/controller.d.ts +214 -0
  154. package/dist/components/forms/form-retry/controller.d.ts.map +1 -0
  155. package/dist/components/forms/form-retry/controller.js +404 -0
  156. package/dist/components/forms/form-retry/form-draft.d.ts +68 -0
  157. package/dist/components/forms/form-retry/form-draft.d.ts.map +1 -0
  158. package/dist/components/forms/form-retry/form-draft.js +161 -0
  159. package/dist/components/forms/form-retry/index.d.ts +19 -0
  160. package/dist/components/forms/form-retry/index.d.ts.map +1 -0
  161. package/dist/components/forms/form-retry/index.js +16 -0
  162. package/dist/components/forms/form-retry/submission-key.d.ts +244 -0
  163. package/dist/components/forms/form-retry/submission-key.d.ts.map +1 -0
  164. package/dist/components/forms/form-retry/submission-key.js +342 -0
  165. package/dist/components/forms/form-retry/submitted-draft.d.ts +112 -0
  166. package/dist/components/forms/form-retry/submitted-draft.d.ts.map +1 -0
  167. package/dist/components/forms/form-retry/submitted-draft.js +270 -0
  168. package/dist/components/forms/form-retry/types.d.ts +84 -0
  169. package/dist/components/forms/form-retry/types.d.ts.map +1 -0
  170. package/dist/components/forms/form-retry/types.js +13 -0
  171. package/dist/components/forms/index.d.ts +7 -1
  172. package/dist/components/forms/index.d.ts.map +1 -1
  173. package/dist/components/forms/index.js +8 -0
  174. package/dist/components/forms/native-file-field.d.ts +94 -0
  175. package/dist/components/forms/native-file-field.d.ts.map +1 -0
  176. package/dist/components/forms/native-file-field.js +147 -0
  177. package/dist/components/forms/signature-pad-logic.d.ts +50 -0
  178. package/dist/components/forms/signature-pad-logic.d.ts.map +1 -0
  179. package/dist/components/forms/signature-pad-logic.js +48 -0
  180. package/dist/components/forms/types.d.ts +41 -0
  181. package/dist/components/forms/types.d.ts.map +1 -1
  182. package/dist/components/nav/FilterChips.svelte +8 -1
  183. package/dist/components/nav/FilterChips.svelte.d.ts +2 -0
  184. package/dist/components/nav/FilterChips.svelte.d.ts.map +1 -1
  185. package/dist/components/ui/Button.svelte +9 -2
  186. package/dist/components/ui/Button.svelte.d.ts +2 -0
  187. package/dist/components/ui/Button.svelte.d.ts.map +1 -1
  188. package/dist/i18n/strings.ui.d.ts +24 -0
  189. package/dist/i18n/strings.ui.d.ts.map +1 -1
  190. package/dist/i18n/strings.ui.js +26 -0
  191. package/dist/styles/tokens.css +2 -0
  192. package/dist/svelte/__tests__/playground.test.js +2 -1
  193. package/dist/svelte/playground/CapturePreview.svelte +56 -0
  194. package/dist/svelte/playground/CapturePreview.svelte.d.ts +4 -0
  195. package/dist/svelte/playground/CapturePreview.svelte.d.ts.map +1 -0
  196. package/dist/svelte/playground.d.ts.map +1 -1
  197. package/dist/svelte/playground.js +10 -0
  198. package/dist/themes/ThemeProvider.svelte +9 -0
  199. package/dist/themes/ThemeProvider.svelte.d.ts +2 -0
  200. package/dist/themes/ThemeProvider.svelte.d.ts.map +1 -1
  201. package/dist/themes/css-generator.d.ts.map +1 -1
  202. package/dist/themes/css-generator.js +3 -0
  203. package/dist/themes/styles/glass.css +4 -0
  204. package/dist/themes/styles/happyvertical.css +4 -0
  205. package/dist/themes/styles/material.css +4 -0
  206. package/dist/themes/styles/smrt.css +4 -0
  207. package/dist/themes/styles/studio.css +4 -0
  208. package/package.json +8 -2
@@ -0,0 +1,166 @@
1
+ /**
2
+ * `createFormRetry()` around a form holding a named `CameraCapture` or
3
+ * `SignaturePad` (#3290, #3291), through the structural fake of SvelteKit's
4
+ * `use:enhance` from the form-retry tests.
5
+ *
6
+ * A successful submit of an unchanged form calls `update({ reset: true })`,
7
+ * which resets the form and so empties every native file input. The capture
8
+ * component must empty with it: otherwise it keeps showing the attachment
9
+ * while the next submit posts an empty file entry, and the person believes a
10
+ * photo or signature went with a record that has none.
11
+ *
12
+ * The reverse matters as much: a capture taken or replaced while the submit is
13
+ * in flight is an edit the server has never seen, so the success must NOT
14
+ * reset it. Under the `formdata`-event strategy the file lives in no element,
15
+ * only in the entry list, so `useBrowserFormData()` makes `new FormData(form)`
16
+ * fire `formdata` as browsers do.
17
+ */
18
+ import { fireEvent, render, screen, waitFor } from '@testing-library/svelte';
19
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
20
+ import { fakeEnhance, fakeRunOnceServer, } from '../form-retry/__tests__/fake-kit.js';
21
+ import { createFormRetry } from '../form-retry/controller.js';
22
+ import { resetFormRetryMemory } from '../form-retry/submission-key.js';
23
+ import CaptureFormFixture from './capture-form.fixture.svelte';
24
+ import { fakeStream, installMediaDevices, removeMediaDevices, stubCanvas, stubMediaPlayback, useBrowserFormData, useFileFieldStrategy, } from './capture-test-env.js';
25
+ const FIELD = { camera: 'photo', signature: 'signature' };
26
+ const FILE = {
27
+ camera: 'file:photo.jpg',
28
+ signature: 'file:signature.png',
29
+ };
30
+ beforeEach(() => {
31
+ resetFormRetryMemory();
32
+ sessionStorage.clear();
33
+ stubCanvas();
34
+ stubMediaPlayback();
35
+ useBrowserFormData();
36
+ installMediaDevices({
37
+ getUserMedia: vi.fn().mockResolvedValue(fakeStream()),
38
+ });
39
+ });
40
+ afterEach(() => {
41
+ removeMediaDevices();
42
+ vi.restoreAllMocks();
43
+ vi.unstubAllGlobals();
44
+ });
45
+ function root(container) {
46
+ return container.querySelector('[data-state]');
47
+ }
48
+ async function expectState(container, state) {
49
+ await waitFor(() => expect(root(container)).toHaveAttribute('data-state', state));
50
+ }
51
+ async function commit(container, kind) {
52
+ if (kind === 'camera') {
53
+ await expectState(container, 'streaming');
54
+ await fireEvent.click(screen.getByRole('button', { name: 'Take photo' }));
55
+ await expectState(container, 'reviewing');
56
+ await fireEvent.click(screen.getByRole('button', { name: 'Use photo' }));
57
+ }
58
+ else {
59
+ const canvas = container.querySelector('canvas');
60
+ await fireEvent.pointerDown(canvas, { pointerType: 'mouse', pointerId: 1 });
61
+ await fireEvent.pointerMove(canvas, {
62
+ pointerType: 'mouse',
63
+ pointerId: 1,
64
+ clientX: 40,
65
+ clientY: 20,
66
+ });
67
+ await fireEvent.pointerUp(canvas, { pointerType: 'mouse', pointerId: 1 });
68
+ await fireEvent.click(screen.getByRole('button', { name: 'Use signature' }));
69
+ }
70
+ await expectState(container, 'committed');
71
+ }
72
+ /** Discard the committed capture as the person would, then commit another. */
73
+ async function replace(container, kind) {
74
+ // A different photo or signature: different bytes, so a different file.
75
+ vi.mocked(HTMLCanvasElement.prototype.toBlob).mockImplementation((callback, type) => callback(new Blob(['other pixels'], { type })));
76
+ await fireEvent.click(screen.getByRole('button', {
77
+ name: kind === 'camera' ? 'Retake' : 'Clear',
78
+ }));
79
+ await commit(container, kind);
80
+ }
81
+ function setup(kind, strategy) {
82
+ useFileFieldStrategy(strategy);
83
+ const onClear = vi.fn();
84
+ const view = render(CaptureFormFixture, {
85
+ props: { kind, name: FIELD[kind], onClear },
86
+ });
87
+ const form = view.container.querySelector('form');
88
+ const server = fakeRunOnceServer();
89
+ const retry = createFormRetry({ form: `capture-${kind}`, storage: null });
90
+ retry.attach(form);
91
+ const kit = fakeEnhance(form, retry.enhance(), server);
92
+ return { ...view, form, server, retry, kit, onClear };
93
+ }
94
+ const CASES = [
95
+ ['camera', 'data-transfer'],
96
+ ['camera', 'formdata-event'],
97
+ ['signature', 'data-transfer'],
98
+ ['signature', 'formdata-event'],
99
+ ];
100
+ describe('createFormRetry with a capture field', () => {
101
+ it.each(CASES)('a successful submit clears the %s (%s), so the next submit cannot post a shown-but-empty attachment', async (kind, strategy) => {
102
+ const name = FIELD[kind];
103
+ const { container, server, retry, kit, onClear } = setup(kind, strategy);
104
+ await waitFor(() => expect(root(container)).toHaveAttribute('data-smrt-file-field', strategy));
105
+ await commit(container, kind);
106
+ await kit.submit();
107
+ expect(retry.state.status).toBe('success');
108
+ expect(kit.updates).toEqual([{ reset: true }]);
109
+ expect(server.rows).toHaveLength(1);
110
+ expect(server.rows[0].fields[name]).toEqual([FILE[kind]]);
111
+ // The reset reached the component: nothing is shown, onClear fired.
112
+ await expectState(container, kind === 'camera' ? 'streaming' : 'empty');
113
+ expect(onClear).toHaveBeenCalledTimes(1);
114
+ expect(screen.queryByRole('img')).not.toBeInTheDocument();
115
+ // The next submit posts what is shown: no file, and not the old one.
116
+ await kit.submit();
117
+ expect(server.rows).toHaveLength(2);
118
+ expect(server.rows[1].fields[name]).toEqual(['file:']);
119
+ // A new capture posts as its own record.
120
+ await commit(container, kind);
121
+ await kit.submit();
122
+ expect(server.rows).toHaveLength(3);
123
+ expect(server.rows[2].fields[name]).toEqual([FILE[kind]]);
124
+ });
125
+ it.each(CASES)('keeps a %s (%s) captured while the submit was in flight', async (kind, strategy) => {
126
+ const name = FIELD[kind];
127
+ const { container, server, retry, kit, onClear } = setup(kind, strategy);
128
+ await waitFor(() => expect(root(container)).toHaveAttribute('data-smrt-file-field', strategy));
129
+ const held = server.hold();
130
+ const first = kit.submit();
131
+ await vi.waitFor(() => expect(retry.state.status).toBe('submitting'));
132
+ // The next entry's capture is taken while the first is unresolved.
133
+ await commit(container, kind);
134
+ held.release();
135
+ await first;
136
+ expect(kit.updates).toEqual([{ reset: false }]);
137
+ expect(root(container)).toHaveAttribute('data-state', 'committed');
138
+ expect(onClear).not.toHaveBeenCalled();
139
+ await kit.submit();
140
+ expect(server.rows.at(-1)?.fields[name]).toEqual([FILE[kind]]);
141
+ });
142
+ it.each(CASES)('keeps a %s (%s) replaced while the submit was in flight', async (kind, strategy) => {
143
+ const name = FIELD[kind];
144
+ const { container, server, retry, kit, onClear } = setup(kind, strategy);
145
+ await waitFor(() => expect(root(container)).toHaveAttribute('data-smrt-file-field', strategy));
146
+ await commit(container, kind);
147
+ const held = server.hold();
148
+ const first = kit.submit();
149
+ await vi.waitFor(() => expect(retry.state.status).toBe('submitting'));
150
+ await replace(container, kind);
151
+ expect(onClear).toHaveBeenCalledTimes(1);
152
+ held.release();
153
+ await first;
154
+ // The first capture was recorded; the newer one is an unsent edit, so the
155
+ // success must leave it on screen and in the field.
156
+ expect(server.rows[0].fields[name]).toEqual([FILE[kind]]);
157
+ expect(kit.updates).toEqual([{ reset: false }]);
158
+ expect(root(container)).toHaveAttribute('data-state', 'committed');
159
+ expect(onClear).toHaveBeenCalledTimes(1);
160
+ await kit.submit();
161
+ const sent = server.requests.at(-1)?.get(name);
162
+ expect(sent.name).toBe(FILE[kind].slice('file:'.length));
163
+ expect(sent.size).toBe('other pixels'.length);
164
+ expect(server.rows).toHaveLength(2);
165
+ });
166
+ });
@@ -0,0 +1,38 @@
1
+ <script lang="ts">
2
+ import CameraCapture from '../CameraCapture.svelte';
3
+ import SignaturePad from '../SignaturePad.svelte';
4
+
5
+ let {
6
+ kind,
7
+ inFieldset = false,
8
+ ...props
9
+ }: {
10
+ kind: 'camera' | 'signature';
11
+ /** Wrap the component in a `<fieldset>` the test can disable. */
12
+ inFieldset?: boolean;
13
+ [key: string]: unknown;
14
+ } = $props();
15
+ </script>
16
+
17
+ {#snippet capture()}
18
+ {#if kind === 'camera'}
19
+ <CameraCapture {...props} />
20
+ {:else}
21
+ <SignaturePad {...props} />
22
+ {/if}
23
+ {/snippet}
24
+
25
+ <!-- A plain native form: no submit handler, no hidden inputs wired by the caller. -->
26
+ <form method="POST" enctype="multipart/form-data" action="/submit">
27
+ <input type="hidden" name="note" value="hazard" />
28
+ {#if inFieldset}
29
+ <fieldset>
30
+ <legend>Capture</legend>
31
+ {@render capture()}
32
+ </fieldset>
33
+ {:else}
34
+ {@render capture()}
35
+ {/if}
36
+ <button type="submit">Submit</button>
37
+ <button type="reset">Reset form</button>
38
+ </form>
@@ -0,0 +1,10 @@
1
+ type $$ComponentProps = {
2
+ kind: 'camera' | 'signature';
3
+ /** Wrap the component in a `<fieldset>` the test can disable. */
4
+ inFieldset?: boolean;
5
+ [key: string]: unknown;
6
+ };
7
+ declare const CaptureForm: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type CaptureForm = ReturnType<typeof CaptureForm>;
9
+ export default CaptureForm;
10
+ //# sourceMappingURL=capture-form.fixture.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-form.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/capture-form.fixture.svelte.ts"],"names":[],"mappings":"AAMC,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC7B,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAqCF,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -0,0 +1,70 @@
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 { type Mock } from 'vitest';
8
+ /**
9
+ * A real jsdom `FileList` holding `files`. jsdom's `input.files` setter only
10
+ * accepts genuine `FileList` instances and exposes no constructor, so the list
11
+ * is taken from a detached file input and filled through its implementation
12
+ * object. This keeps `new FormData(form)` reading the files exactly as a
13
+ * browser would after `input.files = dataTransfer.files`.
14
+ */
15
+ export declare function createFileList(files: File[]): FileList;
16
+ /** Browser-shaped `DataTransfer` for jsdom: `items.add()` plus a real `files`. */
17
+ export declare class TestDataTransfer {
18
+ #private;
19
+ readonly items: {
20
+ add: (file: File) => null;
21
+ };
22
+ get files(): FileList;
23
+ }
24
+ /** Marker constructor: its presence is what feature detection reads. */
25
+ export declare class TestFormDataEvent {
26
+ }
27
+ /** Select the posting strategy the component will detect on mount. */
28
+ export declare function useFileFieldStrategy(strategy: 'data-transfer' | 'formdata-event' | 'none'): void;
29
+ /**
30
+ * The entry list a native submit of `form` would send: what `new FormData`
31
+ * builds, plus the browser's `formdata` event (which jsdom never fires) so the
32
+ * fallback strategy's listener can contribute.
33
+ */
34
+ export declare function submittedEntries(form: HTMLFormElement): FormData;
35
+ /**
36
+ * Make `new FormData(form)` fire `formdata` on the form, as browsers do while
37
+ * constructing the entry list (jsdom does not), so code that snapshots a form
38
+ * — SvelteKit's `enhance`, form-retry's draft comparison — sees files the
39
+ * `formdata`-event strategy appends. Do not combine with
40
+ * {@link submittedEntries}, which dispatches the event itself.
41
+ */
42
+ export declare function useBrowserFormData(): void;
43
+ /** Canvas 2D, `toBlob` and `toDataURL` stubs. Returns the fake context. */
44
+ /** The canvas 2D surface the capture components touch. */
45
+ export interface FakeCanvasContext {
46
+ drawImage: Mock;
47
+ fillRect: Mock;
48
+ beginPath: Mock;
49
+ moveTo: Mock;
50
+ lineTo: Mock;
51
+ stroke: Mock;
52
+ fillStyle: string;
53
+ strokeStyle: string;
54
+ lineWidth: number;
55
+ lineCap: string;
56
+ lineJoin: string;
57
+ }
58
+ export declare function stubCanvas(): FakeCanvasContext;
59
+ /** `play()` is unimplemented in jsdom; resolve it like an allowed autoplay. */
60
+ export declare function stubMediaPlayback(): void;
61
+ export interface FakeTrack {
62
+ stop: Mock;
63
+ }
64
+ export declare function fakeStream(tracks?: FakeTrack[]): MediaStream;
65
+ /** Install `navigator.mediaDevices` (or remove it with `undefined`). */
66
+ export declare function installMediaDevices(mediaDevices: {
67
+ getUserMedia: (...args: unknown[]) => unknown;
68
+ } | undefined): void;
69
+ export declare function removeMediaDevices(): void;
70
+ //# sourceMappingURL=capture-test-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-test-env.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/capture-test-env.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,IAAI,EAAM,MAAM,QAAQ,CAAC;AAYvC;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,QAAQ,CAWtD;AAED,kFAAkF;AAClF,qBAAa,gBAAgB;;IAE3B,QAAQ,CAAC,KAAK;oBACA,IAAI;MAIhB;IACF,IAAI,KAAK,IAAI,QAAQ,CAEpB;CACF;AAED,wEAAwE;AACxE,qBAAa,iBAAiB;CAAG;AAEjC,sEAAsE;AACtE,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,GAAG,gBAAgB,GAAG,MAAM,GACpD,IAAI,CASN;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,QAAQ,CAMhE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAYzC;AAED,2EAA2E;AAC3E,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,UAAU,IAAI,iBAAiB,CA0B9C;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,UAAU,CAAC,MAAM,GAAE,SAAS,EAAwB,GACjB,WAAW,CAC7D;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,YAAY,EAAE;IAAE,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAA;CAAE,GAAG,SAAS,GAC1E,IAAI,CAKN;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
@@ -0,0 +1,122 @@
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
+ }
@@ -0,0 +1,15 @@
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>
@@ -0,0 +1,8 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,29 @@
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>
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,28 @@
1
+ <script lang="ts">
2
+ import type { Action } from 'svelte/action';
3
+ import { fromAction } from 'svelte/attachments';
4
+ import type { ControlInteractionRegistry } from '../control-interaction.js';
5
+ import Form from '../Form.svelte';
6
+ import Input from '../Input.svelte';
7
+
8
+ interface Props {
9
+ enhance: Action<HTMLFormElement, void>;
10
+ registry: ControlInteractionRegistry;
11
+ onsubmit?: (event: SubmitEvent) => void;
12
+ }
13
+
14
+ let { enhance, registry, onsubmit }: Props = $props();
15
+ </script>
16
+
17
+ <Form
18
+ method="POST"
19
+ action="/profile"
20
+ preventDefault={false}
21
+ formId="profile"
22
+ interactionRegistry={registry}
23
+ {onsubmit}
24
+ {@attach fromAction(enhance)}
25
+ >
26
+ <Input name="displayName" value="Dana" />
27
+ <button type="submit">Save</button>
28
+ </Form>
@@ -0,0 +1,11 @@
1
+ import type { Action } from 'svelte/action';
2
+ import type { ControlInteractionRegistry } from '../control-interaction.js';
3
+ interface Props {
4
+ enhance: Action<HTMLFormElement, void>;
5
+ registry: ControlInteractionRegistry;
6
+ onsubmit?: (event: SubmitEvent) => void;
7
+ }
8
+ declare const FormAttachment: import("svelte").Component<Props, {}, "">;
9
+ type FormAttachment = ReturnType<typeof FormAttachment>;
10
+ export default FormAttachment;
11
+ //# sourceMappingURL=form-attachment.fixture.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-attachment.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/form-attachment.fixture.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAK5E,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACvC,QAAQ,EAAE,0BAA0B,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACzC;AAmBD,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import { fromAction } from 'svelte/attachments';
3
+ import Form from '../Form.svelte';
4
+ import type { FormRetry } from '../form-retry/controller.js';
5
+ import type { FormRetrySubmitFunction } from '../form-retry/types.js';
6
+ import Input from '../Input.svelte';
7
+
8
+ interface Props {
9
+ /** SvelteKit's `enhance` action (here: the structural fake). */
10
+ enhance: (
11
+ form: HTMLFormElement,
12
+ submit?: FormRetrySubmitFunction,
13
+ ) => { destroy(): void };
14
+ retry: FormRetry;
15
+ }
16
+
17
+ let { enhance, retry }: Props = $props();
18
+ </script>
19
+
20
+ <!-- The pairing the guide documents: kit's enhance with the retry submit
21
+ function, plus the retry attachment for the hidden key field. -->
22
+ <Form
23
+ method="POST"
24
+ action="?/create"
25
+ preventDefault={false}
26
+ {@attach fromAction(enhance, () => retry.enhance())}
27
+ {@attach retry.attach}
28
+ >
29
+ <Input name="title" aria-label="Title" />
30
+ <button type="submit">Send</button>
31
+ </Form>
@@ -0,0 +1,13 @@
1
+ import type { FormRetry } from '../form-retry/controller.js';
2
+ import type { FormRetrySubmitFunction } from '../form-retry/types.js';
3
+ interface Props {
4
+ /** SvelteKit's `enhance` action (here: the structural fake). */
5
+ enhance: (form: HTMLFormElement, submit?: FormRetrySubmitFunction) => {
6
+ destroy(): void;
7
+ };
8
+ retry: FormRetry;
9
+ }
10
+ declare const FormRetryForm: import("svelte").Component<Props, {}, "">;
11
+ type FormRetryForm = ReturnType<typeof FormRetryForm>;
12
+ export default FormRetryForm;
13
+ //# sourceMappingURL=form-retry-form.fixture.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-retry-form.fixture.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/__tests__/form-retry-form.fixture.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,UAAU,KAAK;IACb,gEAAgE;IAChE,OAAO,EAAE,CACP,IAAI,EAAE,eAAe,EACrB,MAAM,CAAC,EAAE,uBAAuB,KAC7B;QAAE,OAAO,IAAI,IAAI,CAAA;KAAE,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC;CAClB;AAoBD,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}