@getmicdrop/svelte-components 5.5.5 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/calendar/AboutShow/AboutShow.svelte +172 -172
  2. package/dist/calendar/Calendar/MiniMonthCalendar.svelte +782 -782
  3. package/dist/calendar/FAQs/FAQs.svelte +75 -75
  4. package/dist/calendar/MonthSwitcher/MonthSwitcher.svelte +126 -126
  5. package/dist/calendar/OrderSummary/OrderSummary.svelte +367 -367
  6. package/dist/calendar/PublicCard/PublicCard.svelte +134 -134
  7. package/dist/calendar/ShowCard/ShowCard.svelte +157 -157
  8. package/dist/calendar/ShowTimeCard/ShowTimeCard.svelte +61 -61
  9. package/dist/components/Layout/AppShell.svelte +104 -0
  10. package/dist/components/Layout/AppShell.svelte.d.ts +26 -0
  11. package/dist/components/Layout/AppShell.svelte.d.ts.map +1 -0
  12. package/dist/components/Layout/ContentSection.svelte +80 -0
  13. package/dist/components/Layout/ContentSection.svelte.d.ts +23 -0
  14. package/dist/components/Layout/ContentSection.svelte.d.ts.map +1 -0
  15. package/dist/components/Layout/Grid.svelte +4 -4
  16. package/dist/components/Layout/Heading.svelte +81 -0
  17. package/dist/components/Layout/Heading.svelte.d.ts +24 -0
  18. package/dist/components/Layout/Heading.svelte.d.ts.map +1 -0
  19. package/dist/components/Layout/PageContainer.svelte +69 -0
  20. package/dist/components/Layout/PageContainer.svelte.d.ts +23 -0
  21. package/dist/components/Layout/PageContainer.svelte.d.ts.map +1 -0
  22. package/dist/components/Layout/Responsive.svelte +75 -0
  23. package/dist/components/Layout/Responsive.svelte.d.ts +19 -0
  24. package/dist/components/Layout/Responsive.svelte.d.ts.map +1 -0
  25. package/dist/components/Layout/Section.svelte +80 -80
  26. package/dist/components/Layout/ShowOnDesktop.svelte +37 -0
  27. package/dist/components/Layout/ShowOnDesktop.svelte.d.ts +16 -0
  28. package/dist/components/Layout/ShowOnDesktop.svelte.d.ts.map +1 -0
  29. package/dist/components/Layout/ShowOnMobile.svelte +37 -0
  30. package/dist/components/Layout/ShowOnMobile.svelte.d.ts +16 -0
  31. package/dist/components/Layout/ShowOnMobile.svelte.d.ts.map +1 -0
  32. package/dist/components/Layout/Sidebar.svelte +108 -108
  33. package/dist/components/Layout/Stack.spec.js +1 -1
  34. package/dist/components/Layout/Stack.svelte +6 -6
  35. package/dist/components/Layout/Text.svelte +87 -0
  36. package/dist/components/Layout/Text.svelte.d.ts +28 -0
  37. package/dist/components/Layout/Text.svelte.d.ts.map +1 -0
  38. package/dist/components/Layout/TwoColumn.svelte +108 -0
  39. package/dist/components/Layout/TwoColumn.svelte.d.ts +28 -0
  40. package/dist/components/Layout/TwoColumn.svelte.d.ts.map +1 -0
  41. package/dist/components/Layout/__tests__/Heading.test.d.ts +2 -0
  42. package/dist/components/Layout/__tests__/Heading.test.d.ts.map +1 -0
  43. package/dist/components/Layout/__tests__/Heading.test.js +123 -0
  44. package/dist/components/Layout/__tests__/ShowOnDesktop.test.d.ts +2 -0
  45. package/dist/components/Layout/__tests__/ShowOnDesktop.test.d.ts.map +1 -0
  46. package/dist/components/Layout/__tests__/ShowOnDesktop.test.js +84 -0
  47. package/dist/components/Layout/__tests__/ShowOnMobile.test.d.ts +2 -0
  48. package/dist/components/Layout/__tests__/ShowOnMobile.test.d.ts.map +1 -0
  49. package/dist/components/Layout/__tests__/ShowOnMobile.test.js +80 -0
  50. package/dist/components/Layout/__tests__/Text.test.d.ts +2 -0
  51. package/dist/components/Layout/__tests__/Text.test.d.ts.map +1 -0
  52. package/dist/components/Layout/__tests__/Text.test.js +146 -0
  53. package/dist/components/Layout/__tests__/TwoColumn.test.d.ts +2 -0
  54. package/dist/components/Layout/__tests__/TwoColumn.test.d.ts.map +1 -0
  55. package/dist/components/Layout/__tests__/TwoColumn.test.js +129 -0
  56. package/dist/constants/validation.js +91 -91
  57. package/dist/constants/validation.spec.js +64 -64
  58. package/dist/datetime/__tests__/format.test.js +1 -1
  59. package/dist/datetime/__tests__/parse.test.js +1 -1
  60. package/dist/datetime/__tests__/timezone.test.js +1 -1
  61. package/dist/datetime/parse.js +1 -1
  62. package/dist/forms/createFormStore.svelte.js +1 -0
  63. package/dist/index.js +40 -40
  64. package/dist/patterns/data/DataGrid.svelte +45 -45
  65. package/dist/patterns/data/DataList.svelte +24 -24
  66. package/dist/patterns/data/DataTable.svelte +36 -36
  67. package/dist/patterns/forms/FormActions.spec.js +95 -95
  68. package/dist/patterns/forms/FormActions.stories.svelte +97 -97
  69. package/dist/patterns/forms/FormActions.svelte +46 -46
  70. package/dist/patterns/forms/FormGrid.svelte +33 -33
  71. package/dist/patterns/forms/FormSection.svelte +32 -32
  72. package/dist/patterns/forms/FormValidationSummary.stories.svelte +83 -83
  73. package/dist/patterns/forms/FormValidationSummary.svelte +74 -74
  74. package/dist/patterns/layout/Sidebar.svelte +39 -39
  75. package/dist/patterns/layout/index.d.ts +9 -0
  76. package/dist/patterns/layout/index.js +22 -0
  77. package/dist/patterns/navigation/BottomNav.stories.svelte +117 -117
  78. package/dist/patterns/navigation/BottomNav.svelte +64 -64
  79. package/dist/patterns/navigation/Header.stories.svelte +77 -77
  80. package/dist/patterns/navigation/Header.svelte +193 -193
  81. package/dist/patterns/page/PageHeader.svelte +18 -18
  82. package/dist/patterns/page/PageLayout.svelte +40 -40
  83. package/dist/patterns/page/PageLoader.spec.js +57 -57
  84. package/dist/patterns/page/PageLoader.stories.svelte +137 -137
  85. package/dist/patterns/page/PageLoader.svelte +24 -24
  86. package/dist/patterns/page/SectionHeader.svelte +29 -29
  87. package/dist/presets/badges.js +112 -112
  88. package/dist/presets/buttons.js +76 -76
  89. package/dist/presets/index.js +9 -9
  90. package/dist/primitives/Accordion/Accordion.stories.svelte +75 -75
  91. package/dist/primitives/Accordion/Accordion.svelte +42 -42
  92. package/dist/primitives/Accordion/AccordionItem.svelte +95 -95
  93. package/dist/primitives/Alert/Alert.spec.js +173 -173
  94. package/dist/primitives/Alert/Alert.stories.svelte +88 -88
  95. package/dist/primitives/Alert/Alert.svelte +27 -27
  96. package/dist/primitives/Avatar/Avatar.stories.svelte +94 -94
  97. package/dist/primitives/Avatar/Avatar.svelte +66 -66
  98. package/dist/primitives/Badges/Badge.spec.js +144 -144
  99. package/dist/primitives/Badges/Badge.stories.svelte +86 -86
  100. package/dist/primitives/Badges/Badge.svelte +79 -79
  101. package/dist/primitives/BottomSheet/BottomSheet.spec.js +136 -136
  102. package/dist/primitives/BottomSheet/BottomSheet.stories.svelte +83 -83
  103. package/dist/primitives/BottomSheet/BottomSheet.svelte +100 -100
  104. package/dist/primitives/Breadcrumb/Breadcrumb.spec.js +122 -122
  105. package/dist/primitives/Breadcrumb/Breadcrumb.stories.svelte +23 -23
  106. package/dist/primitives/Breadcrumb/Breadcrumb.svelte +89 -89
  107. package/dist/primitives/Button/Button.spec.js +223 -223
  108. package/dist/primitives/Button/Button.stories.svelte +76 -76
  109. package/dist/primitives/Button/Button.svelte +270 -270
  110. package/dist/primitives/Button/ButtonSaveDemo.spec.js +146 -146
  111. package/dist/primitives/Button/ButtonSaveDemo.svelte +25 -25
  112. package/dist/primitives/Button/ButtonVariantShowcase.svelte +129 -129
  113. package/dist/primitives/Card.spec.js +49 -49
  114. package/dist/primitives/Card.stories.svelte +22 -22
  115. package/dist/primitives/Card.svelte +28 -28
  116. package/dist/primitives/Checkbox/Checkbox.stories.svelte +84 -84
  117. package/dist/primitives/Checkbox/Checkbox.svelte +88 -88
  118. package/dist/primitives/DarkModeToggle.spec.js +390 -390
  119. package/dist/primitives/DarkModeToggle.stories.svelte +57 -57
  120. package/dist/primitives/DarkModeToggle.svelte +136 -136
  121. package/dist/primitives/Drawer/Drawer.stories.svelte +80 -80
  122. package/dist/primitives/Drawer/Drawer.svelte +120 -120
  123. package/dist/primitives/Dropdown/Dropdown.stories.svelte +137 -137
  124. package/dist/primitives/Dropdown/Dropdown.svelte +14 -14
  125. package/dist/primitives/Dropdown/DropdownItem.svelte +80 -80
  126. package/dist/primitives/Icons/ArrowLeft.svelte +8 -8
  127. package/dist/primitives/Icons/ArrowRight.svelte +8 -8
  128. package/dist/primitives/Icons/Availability.svelte +14 -14
  129. package/dist/primitives/Icons/Back.svelte +14 -14
  130. package/dist/primitives/Icons/CheckCircle.svelte +6 -6
  131. package/dist/primitives/Icons/CheckCircleOutline.svelte +15 -15
  132. package/dist/primitives/Icons/ChevronLeft.svelte +4 -4
  133. package/dist/primitives/Icons/ChevronRight.svelte +4 -4
  134. package/dist/primitives/Icons/Copy.svelte +15 -15
  135. package/dist/primitives/Icons/Cross.svelte +5 -5
  136. package/dist/primitives/Icons/DownArrow.svelte +8 -8
  137. package/dist/primitives/Icons/ErrorCircle.svelte +6 -6
  138. package/dist/primitives/Icons/FacebookIcon.svelte +2 -2
  139. package/dist/primitives/Icons/Home.svelte +15 -15
  140. package/dist/primitives/Icons/Icon.spec.js +169 -169
  141. package/dist/primitives/Icons/Icon.stories.svelte +100 -100
  142. package/dist/primitives/Icons/Icon.svelte +52 -52
  143. package/dist/primitives/Icons/IconGallery.stories.svelte +235 -235
  144. package/dist/primitives/Icons/Info.svelte +7 -7
  145. package/dist/primitives/Icons/InstagramIcon.svelte +4 -4
  146. package/dist/primitives/Icons/LogoInstagram.svelte +2 -2
  147. package/dist/primitives/Icons/Message.svelte +15 -15
  148. package/dist/primitives/Icons/MoonIcon.svelte +5 -5
  149. package/dist/primitives/Icons/More.svelte +21 -21
  150. package/dist/primitives/Icons/MoreHori.spec.js +61 -61
  151. package/dist/primitives/Icons/MoreHori.svelte +22 -22
  152. package/dist/primitives/Icons/Notification.svelte +14 -14
  153. package/dist/primitives/Icons/Payment.svelte +14 -14
  154. package/dist/primitives/Icons/Profile.svelte +21 -21
  155. package/dist/primitives/Icons/Reload.svelte +29 -29
  156. package/dist/primitives/Icons/Shows.svelte +21 -21
  157. package/dist/primitives/Icons/Signout.svelte +21 -21
  158. package/dist/primitives/Icons/SunIcon.svelte +8 -8
  159. package/dist/primitives/Icons/TiktokIcon.svelte +2 -2
  160. package/dist/primitives/Icons/TwitterIcon.svelte +2 -2
  161. package/dist/primitives/Icons/WarningIcon.spec.js +18 -18
  162. package/dist/primitives/Icons/WarningIcon.svelte +5 -5
  163. package/dist/primitives/Input/Input.spec.js +573 -573
  164. package/dist/primitives/Input/Input.stories.svelte +139 -139
  165. package/dist/primitives/Input/Input.svelte +417 -417
  166. package/dist/primitives/Input/Select.spec.js +212 -212
  167. package/dist/primitives/Input/Select.stories.svelte +112 -112
  168. package/dist/primitives/Input/Select.svelte +128 -128
  169. package/dist/primitives/Input/Textarea.stories.svelte +137 -137
  170. package/dist/primitives/Input/Textarea.svelte +35 -35
  171. package/dist/primitives/Label/Label.svelte +37 -37
  172. package/dist/primitives/Modal/Modal.spec.js +99 -99
  173. package/dist/primitives/Modal/Modal.stories.svelte +86 -86
  174. package/dist/primitives/Modal/Modal.svelte +158 -158
  175. package/dist/primitives/NumberInput/NumberInput.svelte +106 -106
  176. package/dist/primitives/Pagination/Pagination.stories.svelte +76 -76
  177. package/dist/primitives/Pagination/Pagination.svelte +261 -261
  178. package/dist/primitives/Radio/Radio.stories.svelte +80 -80
  179. package/dist/primitives/Radio/Radio.svelte +67 -67
  180. package/dist/primitives/Skeleton/CardPlaceholder.svelte +87 -87
  181. package/dist/primitives/Skeleton/ImagePlaceholder.svelte +59 -59
  182. package/dist/primitives/Skeleton/ListPlaceholder.svelte +76 -76
  183. package/dist/primitives/Skeleton/Skeleton.stories.svelte +151 -151
  184. package/dist/primitives/Skeleton/Skeleton.svelte +26 -26
  185. package/dist/primitives/Spinner/Spinner.spec.js +71 -71
  186. package/dist/primitives/Spinner/Spinner.stories.svelte +29 -29
  187. package/dist/primitives/Spinner/Spinner.svelte +20 -20
  188. package/dist/primitives/Tabs/TabItem.svelte +49 -49
  189. package/dist/primitives/Tabs/Tabs.stories.svelte +112 -112
  190. package/dist/primitives/Tabs/Tabs.svelte +123 -123
  191. package/dist/primitives/Toggle.spec.js +143 -143
  192. package/dist/primitives/Toggle.stories.svelte +92 -92
  193. package/dist/primitives/Toggle.svelte +71 -71
  194. package/dist/primitives/Typography/Typography.svelte +53 -53
  195. package/dist/primitives/ValidationError.spec.js +103 -103
  196. package/dist/primitives/ValidationError.stories.svelte +69 -69
  197. package/dist/primitives/ValidationError.svelte +29 -29
  198. package/dist/primitives/index.js +84 -84
  199. package/dist/recipes/CropImage/CropImage.spec.js +208 -208
  200. package/dist/recipes/CropImage/CropImage.stories.svelte +104 -104
  201. package/dist/recipes/CropImage/CropImage.svelte +238 -238
  202. package/dist/recipes/ImageUploader/ImageUploader.stories.svelte +125 -125
  203. package/dist/recipes/ImageUploader/ImageUploader.svelte +804 -804
  204. package/dist/recipes/SuperLogin/SuperLogin.spec.js +17 -17
  205. package/dist/recipes/Toaster/Toaster.stories.svelte +62 -62
  206. package/dist/recipes/feedback/EmptyState/EmptyState.svelte +1 -1
  207. package/dist/recipes/feedback/ErrorDisplay.spec.js +69 -69
  208. package/dist/recipes/feedback/ErrorDisplay.stories.svelte +101 -101
  209. package/dist/recipes/feedback/ErrorDisplay.svelte +1 -1
  210. package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +133 -133
  211. package/dist/recipes/feedback/StatusIndicator/StatusIndicator.svelte +157 -157
  212. package/dist/recipes/fields/CheckboxField.svelte +85 -85
  213. package/dist/recipes/fields/FormField.svelte +58 -58
  214. package/dist/recipes/fields/RadioGroup.svelte +95 -95
  215. package/dist/recipes/fields/SelectField.svelte +80 -80
  216. package/dist/recipes/fields/TextareaField.svelte +97 -97
  217. package/dist/recipes/fields/ToggleField.svelte +60 -60
  218. package/dist/recipes/fields/index.js +7 -7
  219. package/dist/recipes/inputs/MultiSelect.spec.js +258 -258
  220. package/dist/recipes/inputs/MultiSelect.stories.svelte +133 -133
  221. package/dist/recipes/inputs/MultiSelect.svelte +256 -256
  222. package/dist/recipes/inputs/OTPInput.spec.js +251 -251
  223. package/dist/recipes/inputs/OTPInput.stories.svelte +162 -162
  224. package/dist/recipes/inputs/OTPInput.svelte +29 -29
  225. package/dist/recipes/inputs/PasswordInput.svelte +22 -22
  226. package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.svelte +117 -117
  227. package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.stories.svelte +123 -123
  228. package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.svelte +326 -326
  229. package/dist/recipes/inputs/Search.svelte +37 -37
  230. package/dist/recipes/inputs/SelectDropdown.svelte +57 -57
  231. package/dist/recipes/modals/AlertModal.svelte +130 -130
  232. package/dist/recipes/modals/ConfirmationModal.spec.js +206 -206
  233. package/dist/recipes/modals/ConfirmationModal.stories.svelte +119 -119
  234. package/dist/recipes/modals/ConfirmationModal.svelte +152 -152
  235. package/dist/recipes/modals/InputModal.svelte +182 -182
  236. package/dist/recipes/modals/ModalStateManager.spec.js +100 -100
  237. package/dist/recipes/modals/ModalStateManager.svelte +77 -77
  238. package/dist/recipes/modals/ModalTestWrapper.svelte +65 -65
  239. package/dist/recipes/modals/StatusModal.svelte +206 -206
  240. package/dist/services/EventService.js +75 -75
  241. package/dist/services/EventService.spec.js +217 -217
  242. package/dist/services/ShowService.spec.js +345 -345
  243. package/dist/stores/auth.js +36 -36
  244. package/dist/stores/auth.spec.js +139 -139
  245. package/dist/stores/toaster.js +13 -13
  246. package/dist/stories/ButtonAuditReview.stories.svelte +14 -14
  247. package/dist/stories/ButtonAuditReview.svelte +427 -427
  248. package/dist/stories/PatternsGallery.stories.svelte +19 -19
  249. package/dist/stories/PatternsGallery.svelte +206 -206
  250. package/dist/stories/PrimitivesGallery.stories.svelte +19 -19
  251. package/dist/stories/PrimitivesGallery.svelte +725 -725
  252. package/dist/stories/RecipesGallery.stories.svelte +19 -19
  253. package/dist/stories/RecipesGallery.svelte +271 -271
  254. package/dist/stories/button-audit-manifest.json +11186 -11186
  255. package/dist/tailwind/preset.cjs +82 -82
  256. package/dist/telemetry.js +405 -405
  257. package/dist/telemetry.spec.js +1144 -1144
  258. package/dist/tokens/__tests__/typography-base.test.d.ts +2 -0
  259. package/dist/tokens/__tests__/typography-base.test.d.ts.map +1 -0
  260. package/dist/tokens/__tests__/typography-base.test.js +138 -0
  261. package/dist/tokens/tokens.css +87 -87
  262. package/dist/tokens/typography-base.css +163 -0
  263. package/dist/utils/apiConfig.spec.js +219 -219
  264. package/dist/utils/transitions.js +62 -62
  265. package/dist/utils/utils.js +354 -354
  266. package/package.json +292 -291
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=typography-base.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography-base.test.d.ts","sourceRoot":"","sources":["../../../src/lib/tokens/__tests__/typography-base.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,138 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { readFileSync } from 'fs';
3
+ import { join } from 'path';
4
+ // Read the CSS file content for testing
5
+ const cssPath = join(__dirname, '../typography-base.css');
6
+ const cssContent = readFileSync(cssPath, 'utf-8');
7
+ describe('Typography Base CSS', () => {
8
+ describe('File Structure', () => {
9
+ it('uses @layer base for element styles', () => {
10
+ expect(cssContent).toContain('@layer base');
11
+ });
12
+ it('contains documentation header', () => {
13
+ expect(cssContent).toContain('Typography Base Styles');
14
+ expect(cssContent).toContain('Usage in app.css');
15
+ });
16
+ });
17
+ describe('Heading Styles', () => {
18
+ it('defines styles for all heading levels', () => {
19
+ expect(cssContent).toMatch(/h1\s*\{/);
20
+ expect(cssContent).toMatch(/h2\s*\{/);
21
+ expect(cssContent).toMatch(/h3\s*\{/);
22
+ expect(cssContent).toMatch(/h4\s*\{/);
23
+ expect(cssContent).toMatch(/h5\s*\{/);
24
+ expect(cssContent).toMatch(/h6\s*\{/);
25
+ });
26
+ it('headings use semibold weight', () => {
27
+ // Each heading should have font-semibold
28
+ const headingMatches = cssContent.match(/h[1-6]\s*\{[^}]+\}/g) || [];
29
+ expect(headingMatches.length).toBeGreaterThanOrEqual(6);
30
+ headingMatches.forEach(match => {
31
+ expect(match).toContain('font-semibold');
32
+ });
33
+ });
34
+ it('headings have dark mode support', () => {
35
+ const headingMatches = cssContent.match(/h[1-6]\s*\{[^}]+\}/g) || [];
36
+ headingMatches.forEach(match => {
37
+ expect(match).toContain('dark:text-white');
38
+ });
39
+ });
40
+ });
41
+ describe('Body Text Styles', () => {
42
+ it('defines paragraph style', () => {
43
+ expect(cssContent).toMatch(/p\s*\{/);
44
+ });
45
+ it('paragraph uses secondary color for visual hierarchy', () => {
46
+ const pMatch = cssContent.match(/p\s*\{[^}]+\}/);
47
+ expect(pMatch).toBeTruthy();
48
+ expect(pMatch[0]).toContain('text-gray-600');
49
+ expect(pMatch[0]).toContain('dark:text-gray-300');
50
+ });
51
+ it('paragraph has relaxed line height', () => {
52
+ const pMatch = cssContent.match(/p\s*\{[^}]+\}/);
53
+ expect(pMatch[0]).toContain('leading-relaxed');
54
+ });
55
+ });
56
+ describe('Form Elements', () => {
57
+ it('defines label style', () => {
58
+ expect(cssContent).toMatch(/label\s*\{/);
59
+ });
60
+ it('label has medium weight', () => {
61
+ const labelMatch = cssContent.match(/label\s*\{[^}]+\}/);
62
+ expect(labelMatch).toBeTruthy();
63
+ expect(labelMatch[0]).toContain('font-medium');
64
+ });
65
+ });
66
+ describe('Links', () => {
67
+ it('defines anchor style', () => {
68
+ expect(cssContent).toMatch(/a\s*\{/);
69
+ });
70
+ it('links have blue color and hover underline', () => {
71
+ const aMatch = cssContent.match(/a\s*\{[^}]+\}/);
72
+ expect(aMatch).toBeTruthy();
73
+ expect(aMatch[0]).toContain('text-blue-600');
74
+ expect(aMatch[0]).toContain('hover:underline');
75
+ });
76
+ });
77
+ describe('Code Elements', () => {
78
+ it('defines code and pre styles', () => {
79
+ expect(cssContent).toMatch(/code\s*\{/);
80
+ expect(cssContent).toMatch(/pre\s*\{/);
81
+ });
82
+ it('code uses monospace font', () => {
83
+ const codeMatch = cssContent.match(/(?<!pre\s*)code\s*\{[^}]+\}/);
84
+ expect(codeMatch).toBeTruthy();
85
+ expect(codeMatch[0]).toContain('font-mono');
86
+ });
87
+ it('pre code resets background', () => {
88
+ expect(cssContent).toMatch(/pre\s+code\s*\{[^}]+bg-transparent/);
89
+ });
90
+ });
91
+ describe('Additional Elements', () => {
92
+ it('defines small text style', () => {
93
+ expect(cssContent).toMatch(/small\s*\{/);
94
+ });
95
+ it('defines list styles', () => {
96
+ expect(cssContent).toMatch(/ul,\s*ol\s*\{/);
97
+ expect(cssContent).toMatch(/li\s*\{/);
98
+ });
99
+ it('defines blockquote style', () => {
100
+ expect(cssContent).toMatch(/blockquote\s*\{/);
101
+ });
102
+ it('defines emphasis styles', () => {
103
+ expect(cssContent).toMatch(/strong,\s*b\s*\{/);
104
+ expect(cssContent).toMatch(/em,\s*i\s*\{/);
105
+ });
106
+ it('defines mark/highlight style', () => {
107
+ expect(cssContent).toMatch(/mark\s*\{/);
108
+ });
109
+ });
110
+ describe('No Conflicting Utilities', () => {
111
+ it('does NOT define .text-muted utility (app-specific)', () => {
112
+ expect(cssContent).not.toMatch(/\.text-muted\s*\{/);
113
+ });
114
+ it('does NOT define .text-primary utility (app-specific)', () => {
115
+ expect(cssContent).not.toMatch(/\.text-primary\s*\{/);
116
+ });
117
+ it('does NOT define .text-secondary utility (app-specific)', () => {
118
+ expect(cssContent).not.toMatch(/\.text-secondary\s*\{/);
119
+ });
120
+ });
121
+ });
122
+ describe('Typography Base CSS Consistency with typography.ts', () => {
123
+ // Note: typography-base.css intentionally uses different colors for <p> elements
124
+ // to create visual hierarchy. The CSS styles raw HTML elements, while typography.ts
125
+ // provides class-based tokens for explicit styling.
126
+ //
127
+ // Design decision:
128
+ // - <p> without classes: secondary color (gray-600) for body text
129
+ // - typography.body class: primary color (gray-900) for emphasized content
130
+ //
131
+ // This is intentional and not a bug.
132
+ it('documents the intentional difference between CSS <p> and typography.body', () => {
133
+ // This test exists to document the design decision
134
+ const pMatch = cssContent.match(/p\s*\{[^}]+\}/);
135
+ expect(pMatch[0]).toContain('text-gray-600'); // CSS uses secondary
136
+ // typography.body uses gray-900 (primary) - verified in typography.test.ts
137
+ });
138
+ });
@@ -1,87 +1,87 @@
1
- :root {
2
- --bg-primary: 0 0% 100%;
3
- --bg-secondary: 220 7% 97%;
4
- --bg-tertiary: 220 7% 94%;
5
- --bg-quaternary: 220 6% 91%;
6
-
7
- --text-primary: 221 50% 10%;
8
- --text-secondary: 220 20% 18%;
9
- --text-tertiary: 221 9% 44%;
10
- --text-head: 221 9% 44%;
11
-
12
- --brand-primary: 209 99% 50%;
13
-
14
- --accent-warning: 28 100% 59%;
15
- --accent-danger: 0 100% 70%;
16
- --accent-success: 131 77% 35%;
17
-
18
- --stroke-primary: 216 6% 84%;
19
- --stroke-secondary: 216 6% 84%;
20
- --border: 220 13% 91%;
21
-
22
- --card: 0 0% 100%;
23
- --card-foreground: 224 71.4% 4.1%;
24
- --popover: 0 0% 100%;
25
- --popover-foreground: 224 71.4% 4.1%;
26
- --muted: 220 14.3% 95.9%;
27
- --muted-foreground: 220 8.9% 46.1%;
28
- --hover-primary: 210 20% 96%;
29
-
30
- --sidebar-background: 0 0% 100%;
31
- --sidebar-foreground: 220 20% 18%;
32
- --sidebar-border: 220 13% 91%;
33
- --sidebar-primary: 221 65% 54%;
34
- --sidebar-primary-foreground: 221 50% 10%;
35
-
36
- --BG-Primary: var(--bg-primary);
37
- --BG-Secondary: var(--bg-secondary);
38
- --BG-Tertiary: var(--bg-tertiary);
39
- --BG-Quaternary: var(--bg-quaternary);
40
- --Text-Primary: var(--text-primary);
41
- --Text-Secondary: var(--text-secondary);
42
- --Text-Tartiary: var(--text-tertiary);
43
- --Text-Head: var(--text-head);
44
- --Brand-Primary: var(--brand-primary);
45
- --Accent-Warning: var(--accent-warning);
46
- --Accent-Danger: var(--accent-danger);
47
- --Accent-Success: var(--accent-success);
48
- --Stroke-Primary: var(--stroke-primary);
49
- --Stroke-Secondary: var(--stroke-secondary);
50
- }
51
-
52
- [data-theme="dark"],
53
- .dark {
54
- --bg-primary: 220 20% 18%;
55
- --bg-secondary: 221 50% 10%;
56
- --bg-tertiary: 221 50% 6%;
57
- --bg-quaternary: 0 0% 0%;
58
-
59
- --text-primary: 220 7% 97%;
60
- --text-secondary: 220 7% 94%;
61
- --text-tertiary: 220 6% 91%;
62
- --text-head: 220 9% 70%;
63
-
64
- --brand-primary: 220 89% 63%;
65
-
66
- --accent-warning: 30 100% 70%;
67
- --accent-danger: 0 100% 70%;
68
- --accent-success: 142 71% 45%;
69
-
70
- --stroke-primary: 220 20% 28%;
71
- --stroke-secondary: 220 20% 28%;
72
- --border: 215 27.9% 16.9%;
73
-
74
- --card: 224 20% 10%;
75
- --card-foreground: 210 20% 98%;
76
- --popover: 224 71.4% 4.1%;
77
- --popover-foreground: 210 20% 98%;
78
- --muted: 215 27.9% 16.9%;
79
- --muted-foreground: 217.9 10.6% 64.9%;
80
- --hover-primary: 222 10% 39%;
81
-
82
- --sidebar-background: 220 20% 18%;
83
- --sidebar-foreground: 220 7% 94%;
84
- --sidebar-border: 215 20% 20%;
85
- --sidebar-primary: 221 65% 54%;
86
- --sidebar-primary-foreground: 220 7% 97%;
87
- }
1
+ :root {
2
+ --bg-primary: 0 0% 100%;
3
+ --bg-secondary: 220 7% 97%;
4
+ --bg-tertiary: 220 7% 94%;
5
+ --bg-quaternary: 220 6% 91%;
6
+
7
+ --text-primary: 221 50% 10%;
8
+ --text-secondary: 220 20% 18%;
9
+ --text-tertiary: 221 9% 44%;
10
+ --text-head: 221 9% 44%;
11
+
12
+ --brand-primary: 209 99% 50%;
13
+
14
+ --accent-warning: 28 100% 59%;
15
+ --accent-danger: 0 100% 70%;
16
+ --accent-success: 131 77% 35%;
17
+
18
+ --stroke-primary: 216 6% 84%;
19
+ --stroke-secondary: 216 6% 84%;
20
+ --border: 220 13% 91%;
21
+
22
+ --card: 0 0% 100%;
23
+ --card-foreground: 224 71.4% 4.1%;
24
+ --popover: 0 0% 100%;
25
+ --popover-foreground: 224 71.4% 4.1%;
26
+ --muted: 220 14.3% 95.9%;
27
+ --muted-foreground: 220 8.9% 46.1%;
28
+ --hover-primary: 210 20% 96%;
29
+
30
+ --sidebar-background: 0 0% 100%;
31
+ --sidebar-foreground: 220 20% 18%;
32
+ --sidebar-border: 220 13% 91%;
33
+ --sidebar-primary: 221 65% 54%;
34
+ --sidebar-primary-foreground: 221 50% 10%;
35
+
36
+ --BG-Primary: var(--bg-primary);
37
+ --BG-Secondary: var(--bg-secondary);
38
+ --BG-Tertiary: var(--bg-tertiary);
39
+ --BG-Quaternary: var(--bg-quaternary);
40
+ --Text-Primary: var(--text-primary);
41
+ --Text-Secondary: var(--text-secondary);
42
+ --Text-Tartiary: var(--text-tertiary);
43
+ --Text-Head: var(--text-head);
44
+ --Brand-Primary: var(--brand-primary);
45
+ --Accent-Warning: var(--accent-warning);
46
+ --Accent-Danger: var(--accent-danger);
47
+ --Accent-Success: var(--accent-success);
48
+ --Stroke-Primary: var(--stroke-primary);
49
+ --Stroke-Secondary: var(--stroke-secondary);
50
+ }
51
+
52
+ [data-theme="dark"],
53
+ .dark {
54
+ --bg-primary: 220 20% 18%;
55
+ --bg-secondary: 221 50% 10%;
56
+ --bg-tertiary: 221 50% 6%;
57
+ --bg-quaternary: 0 0% 0%;
58
+
59
+ --text-primary: 220 7% 97%;
60
+ --text-secondary: 220 7% 94%;
61
+ --text-tertiary: 220 6% 91%;
62
+ --text-head: 220 9% 70%;
63
+
64
+ --brand-primary: 220 89% 63%;
65
+
66
+ --accent-warning: 30 100% 70%;
67
+ --accent-danger: 0 100% 70%;
68
+ --accent-success: 142 71% 45%;
69
+
70
+ --stroke-primary: 220 20% 28%;
71
+ --stroke-secondary: 220 20% 28%;
72
+ --border: 215 27.9% 16.9%;
73
+
74
+ --card: 224 20% 10%;
75
+ --card-foreground: 210 20% 98%;
76
+ --popover: 224 71.4% 4.1%;
77
+ --popover-foreground: 210 20% 98%;
78
+ --muted: 215 27.9% 16.9%;
79
+ --muted-foreground: 217.9 10.6% 64.9%;
80
+ --hover-primary: 222 10% 39%;
81
+
82
+ --sidebar-background: 220 20% 18%;
83
+ --sidebar-foreground: 220 7% 94%;
84
+ --sidebar-border: 215 20% 20%;
85
+ --sidebar-primary: 221 65% 54%;
86
+ --sidebar-primary-foreground: 220 7% 97%;
87
+ }
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Typography Base Styles
3
+ *
4
+ * These base styles apply default typography to semantic HTML elements.
5
+ * Import this file in your app's CSS to get consistent typography without
6
+ * needing to add classes to every heading and paragraph.
7
+ *
8
+ * Usage in app.css:
9
+ * @import '@getmicdrop/svelte-components/tokens/typography-base.css';
10
+ *
11
+ * After importing, these elements will have consistent styling:
12
+ * <h1>Page Title</h1> - No classes needed
13
+ * <h2>Section Title</h2> - No classes needed
14
+ * <p>Body text</p> - No classes needed
15
+ *
16
+ * Override when needed:
17
+ * <h1 class="text-3xl">Larger Title</h1>
18
+ * <p class="text-sm text-muted">Smaller muted text</p>
19
+ */
20
+
21
+ @layer base {
22
+ /* ==========================================================================
23
+ * HEADINGS
24
+ * Semantic heading hierarchy with consistent sizing, weight, and colors.
25
+ * Uses semibold weight for all headings to maintain visual hierarchy.
26
+ * ========================================================================== */
27
+
28
+ h1 {
29
+ @apply text-2xl font-semibold text-gray-900 dark:text-white leading-tight;
30
+ }
31
+
32
+ h2 {
33
+ @apply text-xl font-semibold text-gray-900 dark:text-white leading-tight;
34
+ }
35
+
36
+ h3 {
37
+ @apply text-lg font-semibold text-gray-900 dark:text-white leading-tight;
38
+ }
39
+
40
+ h4 {
41
+ @apply text-base font-semibold text-gray-900 dark:text-white leading-tight;
42
+ }
43
+
44
+ h5 {
45
+ @apply text-sm font-semibold text-gray-900 dark:text-white leading-tight;
46
+ }
47
+
48
+ h6 {
49
+ @apply text-xs font-semibold text-gray-900 dark:text-white leading-tight uppercase tracking-wide;
50
+ }
51
+
52
+ /* ==========================================================================
53
+ * BODY TEXT
54
+ * Default paragraph styling with comfortable reading line height.
55
+ * Uses secondary color (gray-600/gray-300) for body text to create
56
+ * visual hierarchy with headings.
57
+ * ========================================================================== */
58
+
59
+ p {
60
+ @apply text-base text-gray-600 dark:text-gray-300 leading-relaxed;
61
+ }
62
+
63
+ /* ==========================================================================
64
+ * FORM LABELS
65
+ * Form labels are slightly smaller than body text with medium weight
66
+ * to distinguish them from regular text.
67
+ * ========================================================================== */
68
+
69
+ label {
70
+ @apply text-sm font-medium text-gray-900 dark:text-white;
71
+ }
72
+
73
+ /* ==========================================================================
74
+ * LINKS
75
+ * Blue links with hover underline for clear affordance.
76
+ * ========================================================================== */
77
+
78
+ a {
79
+ @apply text-blue-600 dark:text-blue-400 hover:underline;
80
+ }
81
+
82
+ /* ==========================================================================
83
+ * EMPHASIS
84
+ * Strong and emphasis elements inherit color but add weight/style.
85
+ * ========================================================================== */
86
+
87
+ strong, b {
88
+ @apply font-semibold;
89
+ }
90
+
91
+ em, i {
92
+ @apply italic;
93
+ }
94
+
95
+ /* ==========================================================================
96
+ * SMALL TEXT
97
+ * For fine print, captions, and secondary information.
98
+ * ========================================================================== */
99
+
100
+ small {
101
+ @apply text-sm text-gray-500 dark:text-gray-400;
102
+ }
103
+
104
+ /* ==========================================================================
105
+ * LISTS
106
+ * Consistent list styling that matches body text.
107
+ * ========================================================================== */
108
+
109
+ ul, ol {
110
+ @apply text-base text-gray-600 dark:text-gray-300 leading-relaxed;
111
+ }
112
+
113
+ li {
114
+ @apply mb-1;
115
+ }
116
+
117
+ /* ==========================================================================
118
+ * BLOCKQUOTE
119
+ * Indented with left border for quoted content.
120
+ * ========================================================================== */
121
+
122
+ blockquote {
123
+ @apply pl-4 border-l-4 border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300 italic;
124
+ }
125
+
126
+ /* ==========================================================================
127
+ * CODE
128
+ * Monospace font with subtle background for inline code.
129
+ * ========================================================================== */
130
+
131
+ code {
132
+ @apply font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded text-gray-900 dark:text-gray-100;
133
+ }
134
+
135
+ pre {
136
+ @apply font-mono text-sm bg-gray-100 dark:bg-gray-800 p-4 rounded-lg overflow-x-auto text-gray-900 dark:text-gray-100;
137
+ }
138
+
139
+ pre code {
140
+ @apply bg-transparent p-0;
141
+ }
142
+
143
+ /* ==========================================================================
144
+ * MARK/HIGHLIGHT
145
+ * Yellow highlight for marked/highlighted text.
146
+ * ========================================================================== */
147
+
148
+ mark {
149
+ @apply bg-yellow-200 dark:bg-yellow-800 px-1 rounded;
150
+ }
151
+ }
152
+
153
+ /* ==========================================================================
154
+ * NOTE ON UTILITY CLASSES
155
+ *
156
+ * This file intentionally does NOT define utility classes like .text-muted,
157
+ * .text-primary, etc. These are defined in individual app's app.css files
158
+ * because they reference app-specific CSS custom properties (e.g., --Text-Tartiary).
159
+ *
160
+ * For typography utilities, import and use tokens from typography.ts:
161
+ * import { typography } from '@getmicdrop/svelte-components';
162
+ * <span class={typography.smMuted}>Helper text</span>
163
+ * ========================================================================== */