@getmicdrop/svelte-components 5.17.1 → 5.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/dist/calendar/Calendar/MiniMonthCalendar.svelte +5 -7
  2. package/dist/calendar/Calendar/MiniMonthCalendar.svelte.d.ts.map +1 -1
  3. package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte +2 -3
  4. package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte.d.ts.map +1 -1
  5. package/dist/calendar/PublicCard/PublicCard.svelte +23 -14
  6. package/dist/calendar/PublicCard/PublicCard.svelte.d.ts.map +1 -1
  7. package/dist/calendar/ShowCard/ShowCard.spec.js +1 -7
  8. package/dist/calendar/ShowCard/ShowCard.svelte +10 -1
  9. package/dist/calendar/ShowCard/ShowCard.svelte.d.ts.map +1 -1
  10. package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte +11 -0
  11. package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte.d.ts +2 -0
  12. package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte.d.ts.map +1 -1
  13. package/dist/components/Heading.spec.d.ts +2 -0
  14. package/dist/components/Heading.spec.d.ts.map +1 -0
  15. package/dist/components/Heading.spec.js +89 -0
  16. package/dist/components/Layout/__tests__/AppShell.test.js +140 -0
  17. package/dist/components/Text.spec.d.ts +2 -0
  18. package/dist/components/Text.spec.d.ts.map +1 -0
  19. package/dist/components/Text.spec.js +89 -0
  20. package/dist/config.d.ts +102 -0
  21. package/dist/config.js +147 -1
  22. package/dist/datetime/README.md +323 -0
  23. package/dist/forms/createFormStore.svelte.spec.d.ts +2 -0
  24. package/dist/forms/createFormStore.svelte.spec.d.ts.map +1 -0
  25. package/dist/forms/createFormStore.svelte.spec.js +387 -0
  26. package/dist/messages.d.ts +43 -0
  27. package/dist/messages.d.ts.map +1 -0
  28. package/dist/messages.js +57 -0
  29. package/dist/patterns/chat/ChatActivityNotice.spec.d.ts +2 -0
  30. package/dist/patterns/chat/ChatActivityNotice.spec.d.ts.map +1 -0
  31. package/dist/patterns/chat/ChatActivityNotice.spec.js +59 -0
  32. package/dist/patterns/chat/ChatBubble.spec.d.ts +2 -0
  33. package/dist/patterns/chat/ChatBubble.spec.d.ts.map +1 -0
  34. package/dist/patterns/chat/ChatBubble.spec.js +91 -0
  35. package/dist/patterns/chat/ChatContainer.spec.d.ts +2 -0
  36. package/dist/patterns/chat/ChatContainer.spec.d.ts.map +1 -0
  37. package/dist/patterns/chat/ChatContainer.spec.js +30 -0
  38. package/dist/patterns/chat/ChatDateDivider.spec.d.ts +2 -0
  39. package/dist/patterns/chat/ChatDateDivider.spec.d.ts.map +1 -0
  40. package/dist/patterns/chat/ChatDateDivider.spec.js +30 -0
  41. package/dist/patterns/chat/ChatInvitationBubble.spec.d.ts +2 -0
  42. package/dist/patterns/chat/ChatInvitationBubble.spec.d.ts.map +1 -0
  43. package/dist/patterns/chat/ChatInvitationBubble.spec.js +46 -0
  44. package/dist/patterns/chat/ChatInvitationNotice.spec.d.ts +2 -0
  45. package/dist/patterns/chat/ChatInvitationNotice.spec.d.ts.map +1 -0
  46. package/dist/patterns/chat/ChatInvitationNotice.spec.js +32 -0
  47. package/dist/patterns/chat/ChatMessageGroup.spec.d.ts +2 -0
  48. package/dist/patterns/chat/ChatMessageGroup.spec.d.ts.map +1 -0
  49. package/dist/patterns/chat/ChatMessageGroup.spec.js +58 -0
  50. package/dist/patterns/chat/ChatSlotUpdate.spec.d.ts +2 -0
  51. package/dist/patterns/chat/ChatSlotUpdate.spec.d.ts.map +1 -0
  52. package/dist/patterns/chat/ChatSlotUpdate.spec.js +65 -0
  53. package/dist/patterns/chat/ChatStatusBadge.spec.d.ts +2 -0
  54. package/dist/patterns/chat/ChatStatusBadge.spec.d.ts.map +1 -0
  55. package/dist/patterns/chat/ChatStatusBadge.spec.js +79 -0
  56. package/dist/patterns/chat/ChatStatusTransition.spec.d.ts +2 -0
  57. package/dist/patterns/chat/ChatStatusTransition.spec.d.ts.map +1 -0
  58. package/dist/patterns/chat/ChatStatusTransition.spec.js +81 -0
  59. package/dist/patterns/chat/ChatTextBubble.spec.d.ts +2 -0
  60. package/dist/patterns/chat/ChatTextBubble.spec.d.ts.map +1 -0
  61. package/dist/patterns/chat/ChatTextBubble.spec.js +35 -0
  62. package/dist/patterns/data/DataTable.spec.js +61 -0
  63. package/dist/patterns/forms/FormGrid.spec.js +34 -0
  64. package/dist/patterns/layout/Sidebar.spec.js +240 -1
  65. package/dist/patterns/layout/SidebarTestWrapper.svelte +34 -0
  66. package/dist/patterns/layout/SidebarTestWrapper.svelte.d.ts +23 -0
  67. package/dist/patterns/layout/SidebarTestWrapper.svelte.d.ts.map +1 -0
  68. package/dist/patterns/navigation/Header.spec.js +123 -0
  69. package/dist/primitives/Accordion/Accordion.spec.js +112 -2
  70. package/dist/primitives/Accordion/AccordionToggleWrapper.test.svelte +28 -0
  71. package/dist/primitives/Accordion/AccordionToggleWrapper.test.svelte.d.ts +7 -0
  72. package/dist/primitives/Accordion/AccordionToggleWrapper.test.svelte.d.ts.map +1 -0
  73. package/dist/primitives/Avatar/Avatar.spec.js +23 -0
  74. package/dist/primitives/BottomSheet/BottomSheet.spec.js +102 -0
  75. package/dist/primitives/BottomSheet/BottomSheetWithActions.test.svelte +20 -0
  76. package/dist/primitives/BottomSheet/BottomSheetWithActions.test.svelte.d.ts +10 -0
  77. package/dist/primitives/BottomSheet/BottomSheetWithActions.test.svelte.d.ts.map +1 -0
  78. package/dist/primitives/Button/ButtonGroup.spec.d.ts +2 -0
  79. package/dist/primitives/Button/ButtonGroup.spec.d.ts.map +1 -0
  80. package/dist/primitives/Button/ButtonGroup.spec.js +44 -0
  81. package/dist/primitives/Checkbox/Checkbox.spec.js +32 -0
  82. package/dist/primitives/Drawer/Drawer.spec.js +437 -0
  83. package/dist/primitives/Drawer/DrawerTestWrapper.svelte +86 -0
  84. package/dist/primitives/Drawer/DrawerTestWrapper.svelte.d.ts +26 -0
  85. package/dist/primitives/Drawer/DrawerTestWrapper.svelte.d.ts.map +1 -0
  86. package/dist/primitives/Dropdown/Dropdown.spec.js +116 -0
  87. package/dist/primitives/Dropdown/DropdownDivider.spec.d.ts +2 -0
  88. package/dist/primitives/Dropdown/DropdownDivider.spec.d.ts.map +1 -0
  89. package/dist/primitives/Dropdown/DropdownDivider.spec.js +30 -0
  90. package/dist/primitives/Dropdown/DropdownItem.spec.js +155 -1
  91. package/dist/primitives/Dropdown/DropdownItemTestWrapper.svelte +43 -0
  92. package/dist/primitives/Dropdown/DropdownItemTestWrapper.svelte.d.ts +17 -0
  93. package/dist/primitives/Dropdown/DropdownItemTestWrapper.svelte.d.ts.map +1 -0
  94. package/dist/primitives/Helper/Helper.spec.d.ts +2 -0
  95. package/dist/primitives/Helper/Helper.spec.d.ts.map +1 -0
  96. package/dist/primitives/Helper/Helper.spec.js +57 -0
  97. package/dist/primitives/Input/Input.spec.js +664 -0
  98. package/dist/primitives/Input/Input.svelte +18 -10
  99. package/dist/primitives/Input/Input.svelte.d.ts.map +1 -1
  100. package/dist/primitives/Input/Select.spec.js +414 -0
  101. package/dist/primitives/Label/Label.spec.js +9 -0
  102. package/dist/primitives/LandingButton/LandingButton.spec.d.ts +2 -0
  103. package/dist/primitives/LandingButton/LandingButton.spec.d.ts.map +1 -0
  104. package/dist/primitives/LandingButton/LandingButton.spec.js +61 -0
  105. package/dist/primitives/MenuItem/MenuItem.spec.d.ts +2 -0
  106. package/dist/primitives/MenuItem/MenuItem.spec.d.ts.map +1 -0
  107. package/dist/primitives/MenuItem/MenuItem.spec.js +130 -0
  108. package/dist/primitives/Modal/Modal.spec.js +215 -0
  109. package/dist/primitives/NavItem/NavItem.spec.d.ts +2 -0
  110. package/dist/primitives/NavItem/NavItem.spec.d.ts.map +1 -0
  111. package/dist/primitives/NavItem/NavItem.spec.js +97 -0
  112. package/dist/primitives/SearchResultItem/SearchResultItem.spec.d.ts +2 -0
  113. package/dist/primitives/SearchResultItem/SearchResultItem.spec.d.ts.map +1 -0
  114. package/dist/primitives/SearchResultItem/SearchResultItem.spec.js +78 -0
  115. package/dist/primitives/SidebarToggle/SidebarToggle.spec.d.ts +2 -0
  116. package/dist/primitives/SidebarToggle/SidebarToggle.spec.d.ts.map +1 -0
  117. package/dist/primitives/SidebarToggle/SidebarToggle.spec.js +61 -0
  118. package/dist/primitives/Spinner/Spinner.spec.js +13 -0
  119. package/dist/primitives/Toggle.spec.js +75 -0
  120. package/dist/primitives/ToggleTestWrapper.svelte +30 -0
  121. package/dist/primitives/ToggleTestWrapper.svelte.d.ts +29 -0
  122. package/dist/primitives/ToggleTestWrapper.svelte.d.ts.map +1 -0
  123. package/dist/primitives/Tooltip/Tooltip.spec.d.ts +2 -0
  124. package/dist/primitives/Tooltip/Tooltip.spec.d.ts.map +1 -0
  125. package/dist/primitives/Tooltip/Tooltip.spec.js +126 -0
  126. package/dist/recipes/inputs/Search.spec.js +66 -2
  127. package/dist/recipes/modals/ConfirmationModal.spec.js +190 -0
  128. package/dist/schemas/__tests__/auth.test.d.ts +2 -0
  129. package/dist/schemas/__tests__/auth.test.d.ts.map +1 -0
  130. package/dist/schemas/__tests__/auth.test.js +210 -0
  131. package/dist/schemas/__tests__/common.test.d.ts +2 -0
  132. package/dist/schemas/__tests__/common.test.d.ts.map +1 -0
  133. package/dist/schemas/__tests__/common.test.js +340 -0
  134. package/dist/schemas/__tests__/domain.test.d.ts +2 -0
  135. package/dist/schemas/__tests__/domain.test.d.ts.map +1 -0
  136. package/dist/schemas/__tests__/domain.test.js +293 -0
  137. package/dist/schemas/__tests__/order.test.d.ts +2 -0
  138. package/dist/schemas/__tests__/order.test.d.ts.map +1 -0
  139. package/dist/schemas/__tests__/order.test.js +349 -0
  140. package/dist/schemas/__tests__/user.test.d.ts +2 -0
  141. package/dist/schemas/__tests__/user.test.d.ts.map +1 -0
  142. package/dist/schemas/__tests__/user.test.js +325 -0
  143. package/dist/schemas/auth.d.ts +41 -0
  144. package/dist/schemas/auth.d.ts.map +1 -0
  145. package/dist/schemas/auth.js +69 -0
  146. package/dist/schemas/common.d.ts +43 -0
  147. package/dist/schemas/common.d.ts.map +1 -0
  148. package/dist/schemas/common.js +157 -0
  149. package/dist/schemas/event.d.ts +82 -0
  150. package/dist/schemas/event.d.ts.map +1 -0
  151. package/dist/schemas/event.js +58 -0
  152. package/dist/schemas/index.d.ts +10 -0
  153. package/dist/schemas/index.d.ts.map +1 -0
  154. package/dist/schemas/index.js +9 -0
  155. package/dist/schemas/order.d.ts +111 -0
  156. package/dist/schemas/order.d.ts.map +1 -0
  157. package/dist/schemas/order.js +73 -0
  158. package/dist/schemas/performer.d.ts +133 -0
  159. package/dist/schemas/performer.d.ts.map +1 -0
  160. package/dist/schemas/performer.js +73 -0
  161. package/dist/schemas/promo.d.ts +87 -0
  162. package/dist/schemas/promo.d.ts.map +1 -0
  163. package/dist/schemas/promo.js +98 -0
  164. package/dist/schemas/ticket.d.ts +104 -0
  165. package/dist/schemas/ticket.d.ts.map +1 -0
  166. package/dist/schemas/ticket.js +82 -0
  167. package/dist/schemas/user.d.ts +92 -0
  168. package/dist/schemas/user.d.ts.map +1 -0
  169. package/dist/schemas/user.js +53 -0
  170. package/dist/schemas/venue.d.ts +95 -0
  171. package/dist/schemas/venue.d.ts.map +1 -0
  172. package/dist/schemas/venue.js +52 -0
  173. package/dist/stores/auth.svelte.spec.d.ts +2 -0
  174. package/dist/stores/auth.svelte.spec.d.ts.map +1 -0
  175. package/dist/stores/auth.svelte.spec.js +112 -0
  176. package/dist/stores/formDataStore.svelte.spec.d.ts +2 -0
  177. package/dist/stores/formDataStore.svelte.spec.d.ts.map +1 -0
  178. package/dist/stores/formDataStore.svelte.spec.js +150 -0
  179. package/dist/stores/formSave.svelte.spec.d.ts +2 -0
  180. package/dist/stores/formSave.svelte.spec.d.ts.map +1 -0
  181. package/dist/stores/formSave.svelte.spec.js +196 -0
  182. package/dist/stores/navigation.spec.d.ts +2 -0
  183. package/dist/stores/navigation.spec.d.ts.map +1 -0
  184. package/dist/stores/navigation.spec.js +53 -0
  185. package/dist/telemetry.spec.js +5 -0
  186. package/dist/tokens/__tests__/sizing.test.js +2 -2
  187. package/dist/tokens/sizing.d.ts +5 -0
  188. package/dist/tokens/sizing.d.ts.map +1 -1
  189. package/dist/tokens/sizing.js +6 -0
  190. package/dist/utils/haptic.spec.d.ts +2 -0
  191. package/dist/utils/haptic.spec.d.ts.map +1 -0
  192. package/dist/utils/haptic.spec.js +153 -0
  193. package/dist/utils/imageOptimizer.spec.d.ts +2 -0
  194. package/dist/utils/imageOptimizer.spec.d.ts.map +1 -0
  195. package/dist/utils/imageOptimizer.spec.js +201 -0
  196. package/dist/utils/logger.spec.d.ts +2 -0
  197. package/dist/utils/logger.spec.d.ts.map +1 -0
  198. package/dist/utils/logger.spec.js +95 -0
  199. package/package.json +1 -2
@@ -0,0 +1,30 @@
1
+ import { render } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatContainer from './ChatContainer.svelte';
4
+
5
+ describe('ChatContainer', () => {
6
+ test('renders without crashing', () => {
7
+ const { container } = render(ChatContainer);
8
+ expect(container.firstElementChild).toBeInTheDocument();
9
+ });
10
+
11
+ test('has flex column layout', () => {
12
+ const { container } = render(ChatContainer);
13
+ expect(container.querySelector('.flex-col, .flex')).toBeInTheDocument();
14
+ });
15
+
16
+ test('has scrollable content area', () => {
17
+ const { container } = render(ChatContainer);
18
+ expect(container.querySelector('.overflow-y-auto, [class*="overflow"]')).toBeInTheDocument();
19
+ });
20
+
21
+ test('applies custom className', () => {
22
+ const { container } = render(ChatContainer, { props: { className: 'my-container' } });
23
+ expect(container.querySelector('.my-container')).toBeInTheDocument();
24
+ });
25
+
26
+ test('has white background', () => {
27
+ const { container } = render(ChatContainer);
28
+ expect(container.querySelector('[class*="bg-white"]')).toBeInTheDocument();
29
+ });
30
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatDateDivider.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatDateDivider.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatDateDivider.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import { render, screen } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatDateDivider from './ChatDateDivider.svelte';
4
+
5
+ describe('ChatDateDivider', () => {
6
+ test('renders the label', () => {
7
+ render(ChatDateDivider, { props: { label: 'Today' } });
8
+ expect(screen.getByText('Today')).toBeInTheDocument();
9
+ });
10
+
11
+ test('renders long date label', () => {
12
+ render(ChatDateDivider, { props: { label: 'Monday, Jan 15, 2024' } });
13
+ expect(screen.getByText('Monday, Jan 15, 2024')).toBeInTheDocument();
14
+ });
15
+
16
+ test('has centered text', () => {
17
+ const { container } = render(ChatDateDivider, { props: { label: 'Today' } });
18
+ expect(container.querySelector('.text-center')).toBeInTheDocument();
19
+ });
20
+
21
+ test('has pill styling on label', () => {
22
+ const { container } = render(ChatDateDivider, { props: { label: 'Today' } });
23
+ expect(container.querySelector('.rounded-full, [class*="rounded"]')).toBeInTheDocument();
24
+ });
25
+
26
+ test('applies custom className', () => {
27
+ const { container } = render(ChatDateDivider, { props: { label: 'Today', className: 'my-divider' } });
28
+ expect(container.querySelector('.my-divider')).toBeInTheDocument();
29
+ });
30
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatInvitationBubble.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInvitationBubble.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatInvitationBubble.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,46 @@
1
+ import { render, screen } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatInvitationBubble from './ChatInvitationBubble.svelte';
4
+
5
+ describe('ChatInvitationBubble', () => {
6
+ test('renders performer name', () => {
7
+ render(ChatInvitationBubble, { props: { performerName: 'Alice' } });
8
+ expect(screen.getByText(/Invited Alice/i)).toBeInTheDocument();
9
+ });
10
+
11
+ test('has blue background', () => {
12
+ const { container } = render(ChatInvitationBubble, { props: { performerName: 'Bob' } });
13
+ expect(container.querySelector('[class*="blue"]')).toBeInTheDocument();
14
+ });
15
+
16
+ test('renders invitation icon', () => {
17
+ const { container } = render(ChatInvitationBubble, { props: { performerName: 'Test' } });
18
+ expect(container.querySelector('svg')).toBeInTheDocument();
19
+ });
20
+
21
+ test('outbound true applies rounded-br-sm', () => {
22
+ const { container } = render(ChatInvitationBubble, {
23
+ props: { performerName: 'Test', outbound: true }
24
+ });
25
+ expect(container.querySelector('.rounded-br-sm')).toBeInTheDocument();
26
+ });
27
+
28
+ test('outbound false applies rounded-bl-sm', () => {
29
+ const { container } = render(ChatInvitationBubble, {
30
+ props: { performerName: 'Test', outbound: false }
31
+ });
32
+ expect(container.querySelector('.rounded-bl-sm')).toBeInTheDocument();
33
+ });
34
+
35
+ test('default outbound is true', () => {
36
+ const { container } = render(ChatInvitationBubble, { props: { performerName: 'Test' } });
37
+ expect(container.querySelector('.rounded-br-sm')).toBeInTheDocument();
38
+ });
39
+
40
+ test('applies custom className', () => {
41
+ const { container } = render(ChatInvitationBubble, {
42
+ props: { performerName: 'Test', className: 'my-invite' }
43
+ });
44
+ expect(container.querySelector('.my-invite')).toBeInTheDocument();
45
+ });
46
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatInvitationNotice.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInvitationNotice.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatInvitationNotice.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ import { render, screen } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatInvitationNotice from './ChatInvitationNotice.svelte';
4
+
5
+ describe('ChatInvitationNotice', () => {
6
+ test('renders performer name', () => {
7
+ render(ChatInvitationNotice, { props: { performerName: 'Alice' } });
8
+ expect(screen.getByText(/Invited Alice/i)).toBeInTheDocument();
9
+ });
10
+
11
+ test('has blue text color', () => {
12
+ const { container } = render(ChatInvitationNotice, { props: { performerName: 'Bob' } });
13
+ expect(container.querySelector('[class*="blue"]')).toBeInTheDocument();
14
+ });
15
+
16
+ test('renders icon', () => {
17
+ const { container } = render(ChatInvitationNotice, { props: { performerName: 'Test' } });
18
+ expect(container.querySelector('svg')).toBeInTheDocument();
19
+ });
20
+
21
+ test('has inline flex layout', () => {
22
+ const { container } = render(ChatInvitationNotice, { props: { performerName: 'Test' } });
23
+ expect(container.querySelector('.inline-flex, .flex')).toBeInTheDocument();
24
+ });
25
+
26
+ test('applies custom className', () => {
27
+ const { container } = render(ChatInvitationNotice, {
28
+ props: { performerName: 'Test', className: 'my-notice' }
29
+ });
30
+ expect(container.querySelector('.my-notice')).toBeInTheDocument();
31
+ });
32
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatMessageGroup.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessageGroup.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatMessageGroup.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ import { render, screen } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatMessageGroup from './ChatMessageGroup.svelte';
4
+
5
+ describe('ChatMessageGroup', () => {
6
+ test('renders with default inbound direction', () => {
7
+ const { container } = render(ChatMessageGroup);
8
+ const el = container.querySelector('.items-start');
9
+ expect(el).toBeInTheDocument();
10
+ });
11
+
12
+ test('outbound uses flex-row-reverse', () => {
13
+ const { container } = render(ChatMessageGroup, { props: { direction: 'outbound' } });
14
+ expect(container.querySelector('.flex-row-reverse')).toBeInTheDocument();
15
+ });
16
+
17
+ test('outbound uses items-end', () => {
18
+ const { container } = render(ChatMessageGroup, { props: { direction: 'outbound' } });
19
+ expect(container.querySelector('.items-end')).toBeInTheDocument();
20
+ });
21
+
22
+ test('shows sender name for inbound', () => {
23
+ render(ChatMessageGroup, { props: { direction: 'inbound', senderName: 'Bob' } });
24
+ expect(screen.getByText('Bob')).toBeInTheDocument();
25
+ });
26
+
27
+ test('hides sender name for outbound even when provided', () => {
28
+ const { container } = render(ChatMessageGroup, {
29
+ props: { direction: 'outbound', senderName: 'Bob' }
30
+ });
31
+ // senderName should not appear as standalone element for outbound
32
+ // but may appear in timestamp area
33
+ expect(container.firstElementChild).toBeInTheDocument();
34
+ });
35
+
36
+ test('shows timestamp', () => {
37
+ render(ChatMessageGroup, { props: { timestamp: '3:45 PM' } });
38
+ expect(screen.getByText(/3:45 PM/)).toBeInTheDocument();
39
+ });
40
+
41
+ test('outbound timestamp includes sender name', () => {
42
+ const { container } = render(ChatMessageGroup, {
43
+ props: { direction: 'outbound', senderName: 'Alice', timestamp: '3:45 PM' }
44
+ });
45
+ expect(container.textContent).toContain('Alice');
46
+ expect(container.textContent).toContain('3:45 PM');
47
+ });
48
+
49
+ test('hides timestamp when not provided', () => {
50
+ const { container } = render(ChatMessageGroup, { props: { direction: 'inbound' } });
51
+ expect(container.textContent.trim()).toBe('');
52
+ });
53
+
54
+ test('applies custom className', () => {
55
+ const { container } = render(ChatMessageGroup, { props: { className: 'my-group' } });
56
+ expect(container.querySelector('.my-group')).toBeInTheDocument();
57
+ });
58
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatSlotUpdate.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatSlotUpdate.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatSlotUpdate.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ import { render } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatSlotUpdate from './ChatSlotUpdate.svelte';
4
+
5
+ describe('ChatSlotUpdate', () => {
6
+ test('renders fromValue and toValue', () => {
7
+ const { container } = render(ChatSlotUpdate, {
8
+ props: { fromValue: '8:00 PM', toValue: '9:00 PM' }
9
+ });
10
+ expect(container.textContent).toContain('8:00 PM');
11
+ expect(container.textContent).toContain('9:00 PM');
12
+ });
13
+
14
+ test('renders arrow between values', () => {
15
+ const { container } = render(ChatSlotUpdate, {
16
+ props: { fromValue: 'Slot A', toValue: 'Slot B' }
17
+ });
18
+ expect(container.textContent).toContain('→');
19
+ });
20
+
21
+ test('bubble variant has rounded styling', () => {
22
+ const { container } = render(ChatSlotUpdate, {
23
+ props: { fromValue: 'A', toValue: 'B', variant: 'bubble' }
24
+ });
25
+ const el = container.querySelector('[class*="rounded"]');
26
+ expect(el).toBeInTheDocument();
27
+ });
28
+
29
+ test('bubble variant inbound has rounded-bl-sm', () => {
30
+ const { container } = render(ChatSlotUpdate, {
31
+ props: { fromValue: 'A', toValue: 'B', variant: 'bubble', outbound: false }
32
+ });
33
+ expect(container.querySelector('.rounded-bl-sm')).toBeInTheDocument();
34
+ });
35
+
36
+ test('bubble variant outbound has rounded-br-sm', () => {
37
+ const { container } = render(ChatSlotUpdate, {
38
+ props: { fromValue: 'A', toValue: 'B', variant: 'bubble', outbound: true }
39
+ });
40
+ expect(container.querySelector('.rounded-br-sm')).toBeInTheDocument();
41
+ });
42
+
43
+ test('inline variant has smaller styling', () => {
44
+ const { container } = render(ChatSlotUpdate, {
45
+ props: { fromValue: 'A', toValue: 'B', variant: 'inline' }
46
+ });
47
+ const el = container.querySelector('.text-xs');
48
+ expect(el).toBeInTheDocument();
49
+ });
50
+
51
+ test('default variant is bubble', () => {
52
+ const { container } = render(ChatSlotUpdate, {
53
+ props: { fromValue: 'A', toValue: 'B' }
54
+ });
55
+ const el = container.querySelector('[class*="rounded"]');
56
+ expect(el).toBeInTheDocument();
57
+ });
58
+
59
+ test('applies custom className', () => {
60
+ const { container } = render(ChatSlotUpdate, {
61
+ props: { fromValue: 'A', toValue: 'B', className: 'custom-slot' }
62
+ });
63
+ expect(container.querySelector('.custom-slot')).toBeInTheDocument();
64
+ });
65
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatStatusBadge.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatStatusBadge.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatStatusBadge.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ import { render, screen } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatStatusBadge from './ChatStatusBadge.svelte';
4
+
5
+ describe('ChatStatusBadge', () => {
6
+ test('renders confirmed status with green styling', () => {
7
+ const { container } = render(ChatStatusBadge, { props: { status: 'confirmed' } });
8
+ expect(screen.getByText(/confirmed/i)).toBeInTheDocument();
9
+ const badge = container.querySelector('[class*="green"]');
10
+ expect(badge).toBeInTheDocument();
11
+ });
12
+
13
+ test('renders declined status with red styling', () => {
14
+ const { container } = render(ChatStatusBadge, { props: { status: 'declined' } });
15
+ expect(screen.getByText(/declined/i)).toBeInTheDocument();
16
+ const badge = container.querySelector('[class*="red"]');
17
+ expect(badge).toBeInTheDocument();
18
+ });
19
+
20
+ test('renders canceled status with red styling', () => {
21
+ const { container } = render(ChatStatusBadge, { props: { status: 'canceled' } });
22
+ expect(screen.getByText(/canceled/i)).toBeInTheDocument();
23
+ const badge = container.querySelector('[class*="red"]');
24
+ expect(badge).toBeInTheDocument();
25
+ });
26
+
27
+ test('renders invited status with blue styling', () => {
28
+ const { container } = render(ChatStatusBadge, { props: { status: 'invited' } });
29
+ expect(screen.getByText(/invited/i)).toBeInTheDocument();
30
+ const badge = container.querySelector('[class*="blue"]');
31
+ expect(badge).toBeInTheDocument();
32
+ });
33
+
34
+ test('renders unknown status with gray styling', () => {
35
+ const { container } = render(ChatStatusBadge, { props: { status: 'pending' } });
36
+ expect(screen.getByText(/pending/i)).toBeInTheDocument();
37
+ const badge = container.querySelector('[class*="gray"]');
38
+ expect(badge).toBeInTheDocument();
39
+ });
40
+
41
+ test('outbound applies rounded-br-sm', () => {
42
+ const { container } = render(ChatStatusBadge, { props: { status: 'confirmed', outbound: true } });
43
+ expect(container.querySelector('.rounded-br-sm')).toBeInTheDocument();
44
+ });
45
+
46
+ test('inbound applies rounded-bl-sm', () => {
47
+ const { container } = render(ChatStatusBadge, { props: { status: 'confirmed', outbound: false } });
48
+ expect(container.querySelector('.rounded-bl-sm')).toBeInTheDocument();
49
+ });
50
+
51
+ test('applies custom className', () => {
52
+ const { container } = render(ChatStatusBadge, { props: { status: 'confirmed', className: 'my-badge' } });
53
+ expect(container.querySelector('.my-badge')).toBeInTheDocument();
54
+ });
55
+
56
+ test('renders icon for confirmed status', () => {
57
+ const { container } = render(ChatStatusBadge, { props: { status: 'confirmed' } });
58
+ const svg = container.querySelector('svg');
59
+ expect(svg).toBeInTheDocument();
60
+ });
61
+
62
+ test('renders icon for declined status', () => {
63
+ const { container } = render(ChatStatusBadge, { props: { status: 'declined' } });
64
+ const svg = container.querySelector('svg');
65
+ expect(svg).toBeInTheDocument();
66
+ });
67
+
68
+ test('renders icon for invited status', () => {
69
+ const { container } = render(ChatStatusBadge, { props: { status: 'invited' } });
70
+ const svg = container.querySelector('svg');
71
+ expect(svg).toBeInTheDocument();
72
+ });
73
+
74
+ test('no icon for unknown status', () => {
75
+ const { container } = render(ChatStatusBadge, { props: { status: 'something-else' } });
76
+ const svg = container.querySelector('svg');
77
+ expect(svg).toBeNull();
78
+ });
79
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatStatusTransition.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatStatusTransition.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatStatusTransition.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,81 @@
1
+ import { render, screen } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatStatusTransition from './ChatStatusTransition.svelte';
4
+
5
+ describe('ChatStatusTransition', () => {
6
+ test('renders from and to status text', () => {
7
+ render(ChatStatusTransition, { props: { fromStatus: 'invited', toStatus: 'confirmed' } });
8
+ expect(screen.getByText(/invited/i)).toBeInTheDocument();
9
+ expect(screen.getByText(/confirmed/i)).toBeInTheDocument();
10
+ });
11
+
12
+ test('renders arrow separator', () => {
13
+ const { container } = render(ChatStatusTransition, {
14
+ props: { fromStatus: 'invited', toStatus: 'confirmed' }
15
+ });
16
+ expect(container.textContent).toContain('→');
17
+ });
18
+
19
+ test('confirmed status shows icon', () => {
20
+ const { container } = render(ChatStatusTransition, {
21
+ props: { fromStatus: 'invited', toStatus: 'confirmed' }
22
+ });
23
+ const svgs = container.querySelectorAll('svg');
24
+ expect(svgs.length).toBeGreaterThanOrEqual(1);
25
+ });
26
+
27
+ test('declined status shows icon', () => {
28
+ const { container } = render(ChatStatusTransition, {
29
+ props: { fromStatus: 'confirmed', toStatus: 'declined' }
30
+ });
31
+ const svgs = container.querySelectorAll('svg');
32
+ expect(svgs.length).toBeGreaterThanOrEqual(1);
33
+ });
34
+
35
+ test('canceled status shows icon', () => {
36
+ const { container } = render(ChatStatusTransition, {
37
+ props: { fromStatus: 'confirmed', toStatus: 'canceled' }
38
+ });
39
+ const svgs = container.querySelectorAll('svg');
40
+ expect(svgs.length).toBeGreaterThanOrEqual(1);
41
+ });
42
+
43
+ test('unknown status does not show icon', () => {
44
+ const { container } = render(ChatStatusTransition, {
45
+ props: { fromStatus: 'unknown', toStatus: 'unknown' }
46
+ });
47
+ const svgs = container.querySelectorAll('svg');
48
+ expect(svgs.length).toBe(0);
49
+ });
50
+
51
+ test('confirmed from shows green color', () => {
52
+ const { container } = render(ChatStatusTransition, {
53
+ props: { fromStatus: 'confirmed', toStatus: 'declined' }
54
+ });
55
+ const green = container.querySelector('[class*="green"]');
56
+ expect(green).toBeInTheDocument();
57
+ });
58
+
59
+ test('declined to shows red color', () => {
60
+ const { container } = render(ChatStatusTransition, {
61
+ props: { fromStatus: 'confirmed', toStatus: 'declined' }
62
+ });
63
+ const red = container.querySelector('[class*="red"]');
64
+ expect(red).toBeInTheDocument();
65
+ });
66
+
67
+ test('invited status shows blue color', () => {
68
+ const { container } = render(ChatStatusTransition, {
69
+ props: { fromStatus: 'invited', toStatus: 'confirmed' }
70
+ });
71
+ const blue = container.querySelector('[class*="blue"]');
72
+ expect(blue).toBeInTheDocument();
73
+ });
74
+
75
+ test('applies custom className', () => {
76
+ const { container } = render(ChatStatusTransition, {
77
+ props: { fromStatus: 'invited', toStatus: 'confirmed', className: 'my-transition' }
78
+ });
79
+ expect(container.querySelector('.my-transition')).toBeInTheDocument();
80
+ });
81
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatTextBubble.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatTextBubble.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/patterns/chat/ChatTextBubble.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import { render } from '@testing-library/svelte';
2
+ import { expect, describe, test } from 'vitest';
3
+ import ChatTextBubble from './ChatTextBubble.svelte';
4
+
5
+ describe('ChatTextBubble', () => {
6
+ test('renders with default inbound styling', () => {
7
+ const { container } = render(ChatTextBubble);
8
+ expect(container.querySelector('.rounded-bl-sm')).toBeInTheDocument();
9
+ });
10
+
11
+ test('inbound has gray background', () => {
12
+ const { container } = render(ChatTextBubble, { props: { direction: 'inbound' } });
13
+ expect(container.querySelector('[class*="gray"]')).toBeInTheDocument();
14
+ });
15
+
16
+ test('outbound has blue background', () => {
17
+ const { container } = render(ChatTextBubble, { props: { direction: 'outbound' } });
18
+ expect(container.querySelector('[class*="blue"]')).toBeInTheDocument();
19
+ });
20
+
21
+ test('outbound has rounded-br-sm', () => {
22
+ const { container } = render(ChatTextBubble, { props: { direction: 'outbound' } });
23
+ expect(container.querySelector('.rounded-br-sm')).toBeInTheDocument();
24
+ });
25
+
26
+ test('outbound has white text', () => {
27
+ const { container } = render(ChatTextBubble, { props: { direction: 'outbound' } });
28
+ expect(container.querySelector('.text-white')).toBeInTheDocument();
29
+ });
30
+
31
+ test('applies custom className', () => {
32
+ const { container } = render(ChatTextBubble, { props: { className: 'my-text' } });
33
+ expect(container.querySelector('.my-text')).toBeInTheDocument();
34
+ });
35
+ });
@@ -1,5 +1,6 @@
1
1
  import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
2
  import { render, screen, cleanup } from '@testing-library/svelte';
3
+ import { createRawSnippet } from 'svelte';
3
4
  import DataTable from './DataTable.svelte';
4
5
 
5
6
  describe('DataTable Component', () => {
@@ -193,4 +194,64 @@ describe('DataTable Component', () => {
193
194
  expect(tbody.className).not.toContain('[&>tr]:hover');
194
195
  });
195
196
  });
197
+
198
+ describe('header snippet', () => {
199
+ it('does not render thead when header is not provided', () => {
200
+ const { container } = render(DataTable);
201
+ const thead = container.querySelector('thead');
202
+ expect(thead).not.toBeInTheDocument();
203
+ });
204
+
205
+ it('renders thead when header snippet is provided', () => {
206
+ const header = createRawSnippet(() => ({
207
+ render: () => `<tr><th>Column</th></tr>`
208
+ }));
209
+ const { container } = render(DataTable, { props: { header } });
210
+ const thead = container.querySelector('thead');
211
+ expect(thead).toBeInTheDocument();
212
+ expect(thead).toHaveClass('text-xs', 'uppercase', 'bg-gray-50');
213
+ });
214
+
215
+ it('header receives cellSize as argument', () => {
216
+ const header = createRawSnippet(() => ({
217
+ render: () => `<tr><th>Name</th></tr>`
218
+ }));
219
+ const { container } = render(DataTable, { props: { header, size: 'lg' } });
220
+ const thead = container.querySelector('thead');
221
+ expect(thead).toBeInTheDocument();
222
+ expect(thead.textContent).toContain('Name');
223
+ });
224
+
225
+ it('thead has dark mode classes', () => {
226
+ const header = createRawSnippet(() => ({
227
+ render: () => `<tr><th>Col</th></tr>`
228
+ }));
229
+ const { container } = render(DataTable, { props: { header } });
230
+ const thead = container.querySelector('thead');
231
+ expect(thead.className).toContain('dark:bg-gray-700');
232
+ });
233
+ });
234
+
235
+ describe('children snippet', () => {
236
+ it('renders children content inside tbody', () => {
237
+ const children = createRawSnippet(() => ({
238
+ render: () => `<tr><td>Row data</td></tr>`
239
+ }));
240
+ const { container } = render(DataTable, { props: { children } });
241
+ const tbody = container.querySelector('tbody');
242
+ expect(tbody.textContent).toContain('Row data');
243
+ });
244
+
245
+ it('renders both header and children together', () => {
246
+ const header = createRawSnippet(() => ({
247
+ render: () => `<tr><th>Header</th></tr>`
248
+ }));
249
+ const children = createRawSnippet(() => ({
250
+ render: () => `<tr><td>Body</td></tr>`
251
+ }));
252
+ const { container } = render(DataTable, { props: { header, children } });
253
+ expect(container.querySelector('thead')).toBeInTheDocument();
254
+ expect(container.querySelector('tbody').textContent).toContain('Body');
255
+ });
256
+ });
196
257
  });
@@ -1,4 +1,5 @@
1
1
  import { render, screen } from '@testing-library/svelte';
2
+ import { createRawSnippet } from 'svelte';
2
3
  import { expect, describe, test } from 'vitest';
3
4
  import FormGrid from './FormGrid.svelte';
4
5
 
@@ -123,3 +124,36 @@ describe('FormGrid Combinations', () => {
123
124
  expect(grid).toHaveClass('extra');
124
125
  });
125
126
  });
127
+
128
+ describe('FormGrid children snippet', () => {
129
+ test('renders children content inside grid', () => {
130
+ const children = createRawSnippet(() => ({
131
+ render: () => `<div class="field">Field 1</div>`
132
+ }));
133
+ const { container } = render(FormGrid, { props: { children } });
134
+ const grid = container.querySelector('.grid');
135
+ expect(grid.textContent).toContain('Field 1');
136
+ expect(grid.querySelector('.field')).toBeInTheDocument();
137
+ });
138
+
139
+ test('renders without children (optional chaining)', () => {
140
+ const { container } = render(FormGrid);
141
+ const grid = container.querySelector('.grid');
142
+ expect(grid).toBeInTheDocument();
143
+ expect(grid.children.length).toBe(0);
144
+ });
145
+ });
146
+
147
+ describe('FormGrid fallback values', () => {
148
+ test('invalid cols falls back to md:grid-cols-2', () => {
149
+ const { container } = render(FormGrid, { props: { cols: 99 } });
150
+ const grid = container.querySelector('div');
151
+ expect(grid).toHaveClass('md:grid-cols-2');
152
+ });
153
+
154
+ test('invalid gap falls back to gap-4', () => {
155
+ const { container } = render(FormGrid, { props: { gap: 99 } });
156
+ const grid = container.querySelector('div');
157
+ expect(grid).toHaveClass('gap-4');
158
+ });
159
+ });