@nqmcreative/ui 0.1.0 → 0.2.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 (308) hide show
  1. package/README.md +151 -439
  2. package/cli/index.mjs +67 -30
  3. package/dist/core/calendar.d.ts +3 -0
  4. package/dist/core/calendar.js +36 -0
  5. package/dist/core/dialog.svelte.d.ts +14 -0
  6. package/dist/core/dialog.svelte.js +23 -0
  7. package/dist/core/files.d.ts +35 -0
  8. package/dist/core/files.js +62 -0
  9. package/dist/core/index.d.ts +37 -0
  10. package/dist/core/index.js +35 -0
  11. package/dist/core/list.svelte.d.ts +41 -0
  12. package/dist/core/list.svelte.js +77 -0
  13. package/dist/core/number.d.ts +7 -0
  14. package/dist/core/number.js +17 -0
  15. package/dist/core/pagination.d.ts +6 -0
  16. package/dist/core/pagination.js +21 -0
  17. package/dist/core/password.d.ts +8 -0
  18. package/dist/core/password.js +23 -0
  19. package/dist/core/table.d.ts +22 -0
  20. package/dist/core/table.js +41 -0
  21. package/dist/core/theme.svelte.d.ts +16 -0
  22. package/dist/core/theme.svelte.js +34 -0
  23. package/dist/core/trigger.d.ts +35 -0
  24. package/dist/core/trigger.js +77 -0
  25. package/dist/index.d.ts +11 -103
  26. package/dist/index.js +11 -75
  27. package/dist/{components → styles/matte}/AccordionItem.svelte +1 -1
  28. package/dist/{components → styles/matte}/AccordionItem.svelte.d.ts +1 -1
  29. package/dist/{components → styles/matte}/Alert.svelte +8 -2
  30. package/dist/{components → styles/matte}/Alert.svelte.d.ts +1 -1
  31. package/dist/{components → styles/matte}/Avatar.svelte +1 -1
  32. package/dist/{components → styles/matte}/Avatar.svelte.d.ts +1 -1
  33. package/dist/{components → styles/matte}/Badge.svelte +8 -3
  34. package/dist/{components → styles/matte}/Badge.svelte.d.ts +1 -3
  35. package/dist/{components → styles/matte}/Breadcrumb.svelte +2 -2
  36. package/dist/{components → styles/matte}/Breadcrumb.svelte.d.ts +1 -1
  37. package/dist/{components → styles/matte}/Button.svelte +1 -1
  38. package/dist/{components → styles/matte}/Button.svelte.d.ts +1 -1
  39. package/dist/styles/matte/CTASection.svelte +76 -0
  40. package/dist/styles/matte/CTASection.svelte.d.ts +18 -0
  41. package/dist/{components → styles/matte}/Calendar.svelte +7 -17
  42. package/dist/{components → styles/matte}/Calendar.svelte.d.ts +1 -1
  43. package/dist/{components → styles/matte}/Card.svelte +1 -1
  44. package/dist/{components → styles/matte}/Card.svelte.d.ts +1 -1
  45. package/dist/{components → styles/matte}/Checkbox.svelte +1 -1
  46. package/dist/{components → styles/matte}/Checkbox.svelte.d.ts +1 -1
  47. package/dist/{components → styles/matte}/CheckboxGroup.svelte +1 -1
  48. package/dist/{components → styles/matte}/CheckboxGroup.svelte.d.ts +1 -1
  49. package/dist/{components → styles/matte}/Combobox.svelte +31 -42
  50. package/dist/{components → styles/matte}/Combobox.svelte.d.ts +1 -1
  51. package/dist/{components → styles/matte}/CommandPalette.svelte +26 -41
  52. package/dist/{components → styles/matte}/CommandPalette.svelte.d.ts +1 -1
  53. package/dist/{components → styles/matte}/ConfirmDialog.svelte +2 -2
  54. package/dist/{components → styles/matte}/ConfirmDialog.svelte.d.ts +2 -2
  55. package/dist/{components → styles/matte}/ContextMenu.svelte +5 -7
  56. package/dist/{components → styles/matte}/DatePicker.svelte +7 -11
  57. package/dist/{components → styles/matte}/DatePicker.svelte.d.ts +1 -1
  58. package/dist/{components → styles/matte}/Drawer.svelte +4 -7
  59. package/dist/{components → styles/matte}/Dropdown.svelte +18 -36
  60. package/dist/{components → styles/matte}/Dropdown.svelte.d.ts +1 -1
  61. package/dist/{components → styles/matte}/Dropzone.svelte +11 -43
  62. package/dist/{components → styles/matte}/Dropzone.svelte.d.ts +2 -5
  63. package/dist/{components → styles/matte}/EmptyState.svelte +1 -1
  64. package/dist/{components → styles/matte}/EmptyState.svelte.d.ts +1 -1
  65. package/dist/styles/matte/FeatureCard.svelte +58 -0
  66. package/dist/styles/matte/FeatureCard.svelte.d.ts +16 -0
  67. package/dist/styles/matte/FeatureGrid.svelte +62 -0
  68. package/dist/styles/matte/FeatureGrid.svelte.d.ts +16 -0
  69. package/dist/{components → styles/matte}/Footer.svelte +1 -1
  70. package/dist/{components → styles/matte}/Footer.svelte.d.ts +1 -1
  71. package/dist/styles/matte/HeroSection.svelte +80 -0
  72. package/dist/styles/matte/HeroSection.svelte.d.ts +21 -0
  73. package/dist/{components → styles/matte}/Input.svelte +1 -1
  74. package/dist/{components → styles/matte}/Input.svelte.d.ts +1 -1
  75. package/dist/{components → styles/matte}/Link.svelte +1 -1
  76. package/dist/{components → styles/matte}/Link.svelte.d.ts +1 -1
  77. package/dist/{components → styles/matte}/LocaleProvider.svelte +1 -1
  78. package/dist/{components → styles/matte}/LocaleProvider.svelte.d.ts +1 -1
  79. package/dist/styles/matte/LogoCloud.svelte +61 -0
  80. package/dist/styles/matte/LogoCloud.svelte.d.ts +19 -0
  81. package/dist/{components → styles/matte}/MenuItem.svelte +1 -1
  82. package/dist/{components → styles/matte}/MenuItem.svelte.d.ts +1 -1
  83. package/dist/{components → styles/matte}/Modal.svelte +4 -7
  84. package/dist/{components → styles/matte}/MultiSelect.svelte +18 -37
  85. package/dist/{components → styles/matte}/MultiSelect.svelte.d.ts +1 -1
  86. package/dist/{components → styles/matte}/Navbar.svelte +2 -2
  87. package/dist/{components → styles/matte}/Navbar.svelte.d.ts +1 -1
  88. package/dist/{components → styles/matte}/NumberInput.svelte +4 -8
  89. package/dist/{components → styles/matte}/NumberInput.svelte.d.ts +1 -1
  90. package/dist/{components → styles/matte}/Pagination.svelte +4 -15
  91. package/dist/{components → styles/matte}/Pagination.svelte.d.ts +1 -1
  92. package/dist/{components → styles/matte}/PasswordInput.svelte +4 -13
  93. package/dist/{components → styles/matte}/PasswordInput.svelte.d.ts +1 -1
  94. package/dist/{components → styles/matte}/Popover.svelte +16 -41
  95. package/dist/{components → styles/matte}/Popover.svelte.d.ts +1 -1
  96. package/dist/styles/matte/PricingCard.svelte +107 -0
  97. package/dist/styles/matte/PricingCard.svelte.d.ts +25 -0
  98. package/dist/{components → styles/matte}/Progress.svelte +3 -2
  99. package/dist/{components → styles/matte}/Progress.svelte.d.ts +1 -1
  100. package/dist/{components → styles/matte}/Radio.svelte +1 -1
  101. package/dist/{components → styles/matte}/Radio.svelte.d.ts +1 -1
  102. package/dist/{components → styles/matte}/RadioGroup.svelte +1 -1
  103. package/dist/{components → styles/matte}/RadioGroup.svelte.d.ts +1 -1
  104. package/dist/{components → styles/matte}/SegmentedControl.svelte +1 -1
  105. package/dist/{components → styles/matte}/SegmentedControl.svelte.d.ts +1 -1
  106. package/dist/{components → styles/matte}/Select.svelte +1 -1
  107. package/dist/{components → styles/matte}/Select.svelte.d.ts +1 -1
  108. package/dist/{components → styles/matte}/Sidebar.svelte +2 -2
  109. package/dist/{components → styles/matte}/Sidebar.svelte.d.ts +1 -1
  110. package/dist/{components → styles/matte}/Slider.svelte +3 -2
  111. package/dist/{components → styles/matte}/Slider.svelte.d.ts +1 -1
  112. package/dist/{components → styles/matte}/Spinner.svelte +2 -2
  113. package/dist/{components → styles/matte}/Spinner.svelte.d.ts +1 -1
  114. package/dist/{components → styles/matte}/Stat.svelte +1 -1
  115. package/dist/{components → styles/matte}/Stat.svelte.d.ts +1 -1
  116. package/dist/styles/matte/StatsBand.svelte +57 -0
  117. package/dist/styles/matte/StatsBand.svelte.d.ts +20 -0
  118. package/dist/{components → styles/matte}/Steps.svelte +1 -1
  119. package/dist/{components → styles/matte}/Steps.svelte.d.ts +1 -1
  120. package/dist/{components → styles/matte}/Switch.svelte +1 -1
  121. package/dist/{components → styles/matte}/Switch.svelte.d.ts +1 -1
  122. package/dist/{components → styles/matte}/Table.svelte +6 -28
  123. package/dist/{components → styles/matte}/Table.svelte.d.ts +2 -6
  124. package/dist/{components → styles/matte}/Tabs.svelte +8 -1
  125. package/dist/{components → styles/matte}/Tabs.svelte.d.ts +1 -1
  126. package/dist/styles/matte/Testimonial.svelte +67 -0
  127. package/dist/styles/matte/Testimonial.svelte.d.ts +19 -0
  128. package/dist/{components → styles/matte}/Textarea.svelte +1 -1
  129. package/dist/{components → styles/matte}/Textarea.svelte.d.ts +1 -1
  130. package/dist/{components → styles/matte}/ThemeToggle.svelte +14 -27
  131. package/dist/{components → styles/matte}/ThemeToggle.svelte.d.ts +2 -6
  132. package/dist/{components → styles/matte}/Toaster.svelte +4 -4
  133. package/dist/{fonts.css → styles/matte/fonts.css} +4 -3
  134. package/dist/styles/matte/index.d.ts +109 -0
  135. package/dist/styles/matte/index.js +83 -0
  136. package/dist/{theme.css → styles/matte/theme.css} +0 -1
  137. package/dist/styles/paper/Accordion.svelte +17 -0
  138. package/dist/styles/paper/Accordion.svelte.d.ts +8 -0
  139. package/dist/styles/paper/AccordionItem.svelte +46 -0
  140. package/dist/styles/paper/AccordionItem.svelte.d.ts +14 -0
  141. package/dist/styles/paper/Alert.svelte +99 -0
  142. package/dist/styles/paper/Alert.svelte.d.ts +18 -0
  143. package/dist/styles/paper/Avatar.svelte +60 -0
  144. package/dist/styles/paper/Avatar.svelte.d.ts +16 -0
  145. package/dist/styles/paper/AvatarGroup.svelte +17 -0
  146. package/dist/styles/paper/AvatarGroup.svelte.d.ts +8 -0
  147. package/dist/styles/paper/Badge.svelte +58 -0
  148. package/dist/styles/paper/Badge.svelte.d.ts +16 -0
  149. package/dist/styles/paper/Breadcrumb.svelte +49 -0
  150. package/dist/styles/paper/Breadcrumb.svelte.d.ts +14 -0
  151. package/dist/styles/paper/Button.svelte +96 -0
  152. package/dist/styles/paper/Button.svelte.d.ts +21 -0
  153. package/dist/styles/paper/CTASection.svelte +76 -0
  154. package/dist/styles/paper/CTASection.svelte.d.ts +18 -0
  155. package/dist/styles/paper/Calendar.svelte +202 -0
  156. package/dist/styles/paper/Calendar.svelte.d.ts +22 -0
  157. package/dist/styles/paper/Card.svelte +78 -0
  158. package/dist/styles/paper/Card.svelte.d.ts +21 -0
  159. package/dist/styles/paper/Checkbox.svelte +75 -0
  160. package/dist/styles/paper/Checkbox.svelte.d.ts +15 -0
  161. package/dist/styles/paper/CheckboxGroup.svelte +111 -0
  162. package/dist/styles/paper/CheckboxGroup.svelte.d.ts +30 -0
  163. package/dist/styles/paper/Combobox.svelte +266 -0
  164. package/dist/styles/paper/Combobox.svelte.d.ts +29 -0
  165. package/dist/styles/paper/CommandPalette.svelte +209 -0
  166. package/dist/styles/paper/CommandPalette.svelte.d.ts +32 -0
  167. package/dist/styles/paper/ConfirmDialog.svelte +97 -0
  168. package/dist/styles/paper/ConfirmDialog.svelte.d.ts +22 -0
  169. package/dist/styles/paper/ContextMenu.svelte +88 -0
  170. package/dist/styles/paper/ContextMenu.svelte.d.ts +15 -0
  171. package/dist/styles/paper/DatePicker.svelte +192 -0
  172. package/dist/styles/paper/DatePicker.svelte.d.ts +23 -0
  173. package/dist/styles/paper/Divider.svelte +30 -0
  174. package/dist/styles/paper/Divider.svelte.d.ts +10 -0
  175. package/dist/styles/paper/Drawer.svelte +165 -0
  176. package/dist/styles/paper/Drawer.svelte.d.ts +20 -0
  177. package/dist/styles/paper/Dropdown.svelte +94 -0
  178. package/dist/styles/paper/Dropdown.svelte.d.ts +23 -0
  179. package/dist/styles/paper/Dropzone.svelte +210 -0
  180. package/dist/styles/paper/Dropzone.svelte.d.ts +29 -0
  181. package/dist/styles/paper/EmptyState.svelte +71 -0
  182. package/dist/styles/paper/EmptyState.svelte.d.ts +18 -0
  183. package/dist/styles/paper/FeatureCard.svelte +58 -0
  184. package/dist/styles/paper/FeatureCard.svelte.d.ts +16 -0
  185. package/dist/styles/paper/FeatureGrid.svelte +62 -0
  186. package/dist/styles/paper/FeatureGrid.svelte.d.ts +16 -0
  187. package/dist/styles/paper/Field.svelte +42 -0
  188. package/dist/styles/paper/Field.svelte.d.ts +16 -0
  189. package/dist/styles/paper/Footer.svelte +91 -0
  190. package/dist/styles/paper/Footer.svelte.d.ts +25 -0
  191. package/dist/styles/paper/HeroSection.svelte +86 -0
  192. package/dist/styles/paper/HeroSection.svelte.d.ts +21 -0
  193. package/dist/styles/paper/Input.svelte +60 -0
  194. package/dist/styles/paper/Input.svelte.d.ts +18 -0
  195. package/dist/styles/paper/InputGroup.svelte +20 -0
  196. package/dist/styles/paper/InputGroup.svelte.d.ts +11 -0
  197. package/dist/styles/paper/Kbd.svelte +17 -0
  198. package/dist/styles/paper/Kbd.svelte.d.ts +8 -0
  199. package/dist/styles/paper/Label.svelte +16 -0
  200. package/dist/styles/paper/Label.svelte.d.ts +9 -0
  201. package/dist/styles/paper/Link.svelte +44 -0
  202. package/dist/styles/paper/Link.svelte.d.ts +16 -0
  203. package/dist/styles/paper/LocaleProvider.svelte +24 -0
  204. package/dist/styles/paper/LocaleProvider.svelte.d.ts +10 -0
  205. package/dist/styles/paper/LogoCloud.svelte +61 -0
  206. package/dist/styles/paper/LogoCloud.svelte.d.ts +19 -0
  207. package/dist/styles/paper/MenuItem.svelte +64 -0
  208. package/dist/styles/paper/MenuItem.svelte.d.ts +18 -0
  209. package/dist/styles/paper/MenuSeparator.svelte +22 -0
  210. package/dist/styles/paper/MenuSeparator.svelte.d.ts +8 -0
  211. package/dist/styles/paper/Modal.svelte +118 -0
  212. package/dist/styles/paper/Modal.svelte.d.ts +21 -0
  213. package/dist/styles/paper/MultiSelect.svelte +287 -0
  214. package/dist/styles/paper/MultiSelect.svelte.d.ts +31 -0
  215. package/dist/styles/paper/Navbar.svelte +201 -0
  216. package/dist/styles/paper/Navbar.svelte.d.ts +33 -0
  217. package/dist/styles/paper/NumberInput.svelte +96 -0
  218. package/dist/styles/paper/NumberInput.svelte.d.ts +15 -0
  219. package/dist/styles/paper/Pagination.svelte +83 -0
  220. package/dist/styles/paper/Pagination.svelte.d.ts +15 -0
  221. package/dist/styles/paper/PasswordInput.svelte +100 -0
  222. package/dist/styles/paper/PasswordInput.svelte.d.ts +12 -0
  223. package/dist/styles/paper/Popover.svelte +89 -0
  224. package/dist/styles/paper/Popover.svelte.d.ts +19 -0
  225. package/dist/styles/paper/PricingCard.svelte +108 -0
  226. package/dist/styles/paper/PricingCard.svelte.d.ts +25 -0
  227. package/dist/styles/paper/Progress.svelte +59 -0
  228. package/dist/styles/paper/Progress.svelte.d.ts +17 -0
  229. package/dist/styles/paper/Radio.svelte +55 -0
  230. package/dist/styles/paper/Radio.svelte.d.ts +15 -0
  231. package/dist/styles/paper/RadioGroup.svelte +95 -0
  232. package/dist/styles/paper/RadioGroup.svelte.d.ts +27 -0
  233. package/dist/styles/paper/SegmentedControl.svelte +88 -0
  234. package/dist/styles/paper/SegmentedControl.svelte.d.ts +25 -0
  235. package/dist/styles/paper/Select.svelte +61 -0
  236. package/dist/styles/paper/Select.svelte.d.ts +20 -0
  237. package/dist/styles/paper/Sidebar.svelte +206 -0
  238. package/dist/styles/paper/Sidebar.svelte.d.ts +36 -0
  239. package/dist/styles/paper/Skeleton.svelte +46 -0
  240. package/dist/styles/paper/Skeleton.svelte.d.ts +13 -0
  241. package/dist/styles/paper/Slider.svelte +80 -0
  242. package/dist/styles/paper/Slider.svelte.d.ts +19 -0
  243. package/dist/styles/paper/Spinner.svelte +34 -0
  244. package/dist/styles/paper/Spinner.svelte.d.ts +13 -0
  245. package/dist/styles/paper/Stat.svelte +51 -0
  246. package/dist/styles/paper/Stat.svelte.d.ts +16 -0
  247. package/dist/styles/paper/StatsBand.svelte +63 -0
  248. package/dist/styles/paper/StatsBand.svelte.d.ts +20 -0
  249. package/dist/styles/paper/Steps.svelte +141 -0
  250. package/dist/styles/paper/Steps.svelte.d.ts +24 -0
  251. package/dist/styles/paper/Switch.svelte +64 -0
  252. package/dist/styles/paper/Switch.svelte.d.ts +14 -0
  253. package/dist/styles/paper/Table.svelte +217 -0
  254. package/dist/styles/paper/Table.svelte.d.ts +66 -0
  255. package/dist/styles/paper/Tabs.svelte +102 -0
  256. package/dist/styles/paper/Tabs.svelte.d.ts +23 -0
  257. package/dist/styles/paper/Testimonial.svelte +64 -0
  258. package/dist/styles/paper/Testimonial.svelte.d.ts +19 -0
  259. package/dist/styles/paper/Textarea.svelte +54 -0
  260. package/dist/styles/paper/Textarea.svelte.d.ts +12 -0
  261. package/dist/styles/paper/ThemeToggle.svelte +130 -0
  262. package/dist/styles/paper/ThemeToggle.svelte.d.ts +16 -0
  263. package/dist/styles/paper/Toaster.svelte +132 -0
  264. package/dist/styles/paper/Toaster.svelte.d.ts +8 -0
  265. package/dist/styles/paper/Tooltip.svelte +33 -0
  266. package/dist/styles/paper/Tooltip.svelte.d.ts +12 -0
  267. package/dist/styles/paper/fonts.css +46 -0
  268. package/dist/styles/paper/index.d.ts +109 -0
  269. package/dist/styles/paper/index.js +83 -0
  270. package/dist/styles/paper/theme.css +222 -0
  271. package/package.json +531 -201
  272. package/registry.json +658 -339
  273. /package/dist/{actions → core/actions}/anchor.d.ts +0 -0
  274. /package/dist/{actions → core/actions}/anchor.js +0 -0
  275. /package/dist/{actions → core/actions}/dismissable.d.ts +0 -0
  276. /package/dist/{actions → core/actions}/dismissable.js +0 -0
  277. /package/dist/{date.d.ts → core/date.d.ts} +0 -0
  278. /package/dist/{date.js → core/date.js} +0 -0
  279. /package/dist/{locale.svelte.d.ts → core/locale.svelte.d.ts} +0 -0
  280. /package/dist/{locale.svelte.js → core/locale.svelte.js} +0 -0
  281. /package/dist/{toast.svelte.d.ts → core/toast.svelte.d.ts} +0 -0
  282. /package/dist/{toast.svelte.js → core/toast.svelte.js} +0 -0
  283. /package/dist/{tones.d.ts → core/tones.d.ts} +0 -0
  284. /package/dist/{tones.js → core/tones.js} +0 -0
  285. /package/dist/{components → styles/matte}/Accordion.svelte +0 -0
  286. /package/dist/{components → styles/matte}/Accordion.svelte.d.ts +0 -0
  287. /package/dist/{components → styles/matte}/AvatarGroup.svelte +0 -0
  288. /package/dist/{components → styles/matte}/AvatarGroup.svelte.d.ts +0 -0
  289. /package/dist/{components → styles/matte}/ContextMenu.svelte.d.ts +0 -0
  290. /package/dist/{components → styles/matte}/Divider.svelte +0 -0
  291. /package/dist/{components → styles/matte}/Divider.svelte.d.ts +0 -0
  292. /package/dist/{components → styles/matte}/Drawer.svelte.d.ts +0 -0
  293. /package/dist/{components → styles/matte}/Field.svelte +0 -0
  294. /package/dist/{components → styles/matte}/Field.svelte.d.ts +0 -0
  295. /package/dist/{components → styles/matte}/InputGroup.svelte +0 -0
  296. /package/dist/{components → styles/matte}/InputGroup.svelte.d.ts +0 -0
  297. /package/dist/{components → styles/matte}/Kbd.svelte +0 -0
  298. /package/dist/{components → styles/matte}/Kbd.svelte.d.ts +0 -0
  299. /package/dist/{components → styles/matte}/Label.svelte +0 -0
  300. /package/dist/{components → styles/matte}/Label.svelte.d.ts +0 -0
  301. /package/dist/{components → styles/matte}/MenuSeparator.svelte +0 -0
  302. /package/dist/{components → styles/matte}/MenuSeparator.svelte.d.ts +0 -0
  303. /package/dist/{components → styles/matte}/Modal.svelte.d.ts +0 -0
  304. /package/dist/{components → styles/matte}/Skeleton.svelte +0 -0
  305. /package/dist/{components → styles/matte}/Skeleton.svelte.d.ts +0 -0
  306. /package/dist/{components → styles/matte}/Toaster.svelte.d.ts +0 -0
  307. /package/dist/{components → styles/matte}/Tooltip.svelte +0 -0
  308. /package/dist/{components → styles/matte}/Tooltip.svelte.d.ts +0 -0
@@ -0,0 +1,202 @@
1
+ <script lang="ts">
2
+ import {
3
+ addMonths,
4
+ fromISO,
5
+ isOutOfRange,
6
+ isSameDay,
7
+ monthGrid,
8
+ monthLabel,
9
+ toISO,
10
+ today,
11
+ weekdayNames
12
+ } from '../../core/date.js';
13
+ import { calendarKeyMove } from '../../core/calendar.js';
14
+ import { useLocale } from '../../core/locale.svelte.js';
15
+ import {
16
+ focusRing,
17
+ toneFill,
18
+ toneRing,
19
+ toneSoft,
20
+ toneText,
21
+ type Tone
22
+ } from '../../core/tones.js';
23
+
24
+ interface Props {
25
+ /** Bindable `YYYY-MM-DD`, or `''` for nothing selected. */
26
+ value?: string;
27
+ /** Bindable `YYYY-MM-DD` inside the month on show. */
28
+ month?: string;
29
+ /** Inclusive bounds, `YYYY-MM-DD`. */
30
+ min?: string;
31
+ max?: string;
32
+ /** Return true to grey out a specific day — weekends, holidays. */
33
+ isDisabled?: (date: Date) => boolean;
34
+ /** 1 = Monday (default), 0 = Sunday. */
35
+ weekStart?: 0 | 1;
36
+ tone?: Tone;
37
+ /** Show the "Today" shortcut under the grid. */
38
+ showToday?: boolean;
39
+ onselect?: (value: string) => void;
40
+ class?: string;
41
+ }
42
+
43
+ let {
44
+ value = $bindable(''),
45
+ month = $bindable(''),
46
+ min,
47
+ max,
48
+ isDisabled,
49
+ weekStart = 1,
50
+ tone = 'brand',
51
+ showToday = true,
52
+ onselect,
53
+ class: className = ''
54
+ }: Props = $props();
55
+
56
+ const t = useLocale();
57
+
58
+ const selected = $derived(fromISO(value));
59
+ const now = today();
60
+
61
+ let view = $state(fromISO(month) ?? fromISO(value) ?? today());
62
+ /** The day the arrow keys are on — not necessarily the selected one. */
63
+ let focused = $state(fromISO(value) ?? today());
64
+ let grid: HTMLElement | null = $state(null);
65
+
66
+ // Follow the bound `month`/`value` when the parent changes them.
67
+ $effect(() => {
68
+ const next = fromISO(month) ?? fromISO(value);
69
+ if (next && (next.getMonth() !== view.getMonth() || next.getFullYear() !== view.getFullYear()))
70
+ view = next;
71
+ });
72
+
73
+ const days = $derived(monthGrid(view, weekStart));
74
+ const weekdays = $derived(weekdayNames(t.current.dateLocale, weekStart));
75
+
76
+ function blocked(date: Date) {
77
+ return isOutOfRange(date, min, max) || (isDisabled?.(date) ?? false);
78
+ }
79
+
80
+ function show(next: Date) {
81
+ view = next;
82
+ month = toISO(new Date(next.getFullYear(), next.getMonth(), 1));
83
+ }
84
+
85
+ function pick(date: Date) {
86
+ if (blocked(date)) return;
87
+ value = toISO(date);
88
+ focused = date;
89
+ if (date.getMonth() !== view.getMonth()) show(date);
90
+ onselect?.(value);
91
+ }
92
+
93
+ function moveFocus(next: Date) {
94
+ focused = next;
95
+ if (next.getMonth() !== view.getMonth() || next.getFullYear() !== view.getFullYear())
96
+ show(next);
97
+ queueMicrotask(() => grid?.querySelector<HTMLElement>('[data-focused="true"]')?.focus());
98
+ }
99
+
100
+ function onKeydown(event: KeyboardEvent) {
101
+ const next = calendarKeyMove(event.key, focused, weekStart, event.shiftKey);
102
+ if (next) {
103
+ event.preventDefault();
104
+ moveFocus(next);
105
+ return;
106
+ }
107
+ if (event.key === 'Enter' || event.key === ' ') {
108
+ event.preventDefault();
109
+ pick(focused);
110
+ }
111
+ }
112
+
113
+ const arrow =
114
+ 'inline-flex size-8 items-center justify-center rounded-md text-text-secondary transition-colors duration-150 hover:bg-bg-inset hover:text-text';
115
+ </script>
116
+
117
+ <div class="flex w-[18rem] flex-col gap-3 p-3 font-sans {className}">
118
+ <div class="flex items-center justify-between gap-2">
119
+ <button
120
+ type="button"
121
+ onclick={() => show(addMonths(view, -1))}
122
+ aria-label={t.current.previousMonth}
123
+ class="{arrow} {focusRing} {toneRing[tone]}"
124
+ >
125
+ <svg class="size-4" viewBox="0 0 16 16" fill="none" aria-hidden="true">
126
+ <path d="m10 4-4 4 4 4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
127
+ </svg>
128
+ </button>
129
+
130
+ <span aria-live="polite" class="text-sm font-semibold text-text">
131
+ {monthLabel(view, t.current.dateLocale)}
132
+ </span>
133
+
134
+ <button
135
+ type="button"
136
+ onclick={() => show(addMonths(view, 1))}
137
+ aria-label={t.current.nextMonth}
138
+ class="{arrow} {focusRing} {toneRing[tone]}"
139
+ >
140
+ <svg class="size-4" viewBox="0 0 16 16" fill="none" aria-hidden="true">
141
+ <path d="m6 4 4 4-4 4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" />
142
+ </svg>
143
+ </button>
144
+ </div>
145
+
146
+ <div class="grid grid-cols-7 gap-0.5">
147
+ {#each weekdays as name, i (i)}
148
+ <span class="pb-1 text-center text-[11px] font-medium text-text-muted">{name}</span>
149
+ {/each}
150
+ </div>
151
+
152
+ <!-- Roving tabindex: the grid itself is never a tab stop, the focused day is. -->
153
+ <div
154
+ bind:this={grid}
155
+ role="grid"
156
+ tabindex="-1"
157
+ aria-label={t.current.selectDate}
158
+ onkeydown={onKeydown}
159
+ class="grid grid-cols-7 gap-0.5 focus:outline-none"
160
+ >
161
+ {#each days as day (toISO(day))}
162
+ {@const outside = day.getMonth() !== view.getMonth()}
163
+ {@const off = blocked(day)}
164
+ {@const isSelected = isSameDay(day, selected)}
165
+ {@const isFocused = isSameDay(day, focused)}
166
+ <button
167
+ type="button"
168
+ role="gridcell"
169
+ data-focused={isFocused}
170
+ tabindex={isFocused ? 0 : -1}
171
+ disabled={off}
172
+ aria-selected={isSelected}
173
+ aria-current={isSameDay(day, now) ? 'date' : undefined}
174
+ onclick={() => pick(day)}
175
+ class="flex h-9 items-center justify-center rounded-md text-[13px] tabular-nums transition-colors duration-100 disabled:pointer-events-none disabled:opacity-30 {focusRing} {toneRing[
176
+ tone
177
+ ]}
178
+ {isSelected
179
+ ? `${toneFill[tone]} font-semibold text-text-inverse`
180
+ : outside
181
+ ? 'text-text-muted/60 hover:bg-bg-inset'
182
+ : 'text-text-secondary hover:bg-bg-inset hover:text-text'}
183
+ {!isSelected && isSameDay(day, now) ? `${toneSoft[tone]} font-semibold` : ''}"
184
+ >
185
+ {day.getDate()}
186
+ </button>
187
+ {/each}
188
+ </div>
189
+
190
+ {#if showToday}
191
+ <button
192
+ type="button"
193
+ onclick={() => pick(now)}
194
+ disabled={blocked(now)}
195
+ class="self-start rounded px-1 text-[13px] font-medium transition-colors duration-150 disabled:pointer-events-none disabled:opacity-40 {toneText[
196
+ tone
197
+ ]} hover:underline hover:underline-offset-2 {focusRing} {toneRing[tone]}"
198
+ >
199
+ {t.current.today}
200
+ </button>
201
+ {/if}
202
+ </div>
@@ -0,0 +1,22 @@
1
+ import { type Tone } from '../../core/tones.js';
2
+ interface Props {
3
+ /** Bindable `YYYY-MM-DD`, or `''` for nothing selected. */
4
+ value?: string;
5
+ /** Bindable `YYYY-MM-DD` inside the month on show. */
6
+ month?: string;
7
+ /** Inclusive bounds, `YYYY-MM-DD`. */
8
+ min?: string;
9
+ max?: string;
10
+ /** Return true to grey out a specific day — weekends, holidays. */
11
+ isDisabled?: (date: Date) => boolean;
12
+ /** 1 = Monday (default), 0 = Sunday. */
13
+ weekStart?: 0 | 1;
14
+ tone?: Tone;
15
+ /** Show the "Today" shortcut under the grid. */
16
+ showToday?: boolean;
17
+ onselect?: (value: string) => void;
18
+ class?: string;
19
+ }
20
+ declare const Calendar: import("svelte").Component<Props, {}, "month" | "value">;
21
+ type Calendar = ReturnType<typeof Calendar>;
22
+ export default Calendar;
@@ -0,0 +1,78 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import { toneBorderLeft, toneHoverBorder, toneSurface, type Tone } from '../../core/tones.js';
5
+
6
+ export type CardVariant = 'outline' | 'filled' | 'tinted';
7
+
8
+ interface Props extends HTMLAttributes<HTMLDivElement> {
9
+ variant?: CardVariant;
10
+ tone?: Tone;
11
+ /** Draws a tone-coloured rule down the left edge. */
12
+ accent?: boolean;
13
+ /** Lifts the card on hover — use for clickable cards. */
14
+ interactive?: boolean;
15
+ padded?: boolean;
16
+ title?: string;
17
+ eyebrow?: string;
18
+ header?: Snippet;
19
+ footer?: Snippet;
20
+ children: Snippet;
21
+ }
22
+
23
+ let {
24
+ variant = 'outline',
25
+ tone = 'brand',
26
+ accent = false,
27
+ interactive = false,
28
+ padded = true,
29
+ title,
30
+ eyebrow,
31
+ header,
32
+ footer,
33
+ class: className = '',
34
+ children,
35
+ ...rest
36
+ }: Props = $props();
37
+
38
+ const variants = $derived({
39
+ outline: 'border border-hairline bg-bg shadow-xs',
40
+ filled: 'border border-hairline bg-bg-alt',
41
+ tinted: `border border-transparent ${toneSurface[tone]}`
42
+ });
43
+ </script>
44
+
45
+ <div
46
+ class="flex flex-col rounded-lg {variants[variant]}
47
+ {accent ? `border-l-4 ${toneBorderLeft[tone]}` : ''}
48
+ {interactive
49
+ ? `transition-shadow duration-150 ease-brand-out hover:shadow-md ${toneHoverBorder[tone]}`
50
+ : ''}
51
+ {className}"
52
+ {...rest}
53
+ >
54
+ {#if header || title || eyebrow}
55
+ <div class="flex flex-col gap-1 {padded ? 'px-5 pt-5' : ''}">
56
+ {#if header}
57
+ {@render header()}
58
+ {:else}
59
+ {#if eyebrow}
60
+ <span class="font-sans text-xs font-semibold text-text-muted">{eyebrow}</span>
61
+ {/if}
62
+ {#if title}
63
+ <h3 class="font-heading text-base font-semibold text-text">{title}</h3>
64
+ {/if}
65
+ {/if}
66
+ </div>
67
+ {/if}
68
+
69
+ <div class="flex-1 {padded ? (header || title || eyebrow ? 'px-5 pt-3 pb-5' : 'p-5') : ''}">
70
+ {@render children()}
71
+ </div>
72
+
73
+ {#if footer}
74
+ <div class="rounded-b-lg border-t border-hairline bg-bg-alt {padded ? 'px-5 py-3.5' : ''}">
75
+ {@render footer()}
76
+ </div>
77
+ {/if}
78
+ </div>
@@ -0,0 +1,21 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { type Tone } from '../../core/tones.js';
4
+ export type CardVariant = 'outline' | 'filled' | 'tinted';
5
+ interface Props extends HTMLAttributes<HTMLDivElement> {
6
+ variant?: CardVariant;
7
+ tone?: Tone;
8
+ /** Draws a tone-coloured rule down the left edge. */
9
+ accent?: boolean;
10
+ /** Lifts the card on hover — use for clickable cards. */
11
+ interactive?: boolean;
12
+ padded?: boolean;
13
+ title?: string;
14
+ eyebrow?: string;
15
+ header?: Snippet;
16
+ footer?: Snippet;
17
+ children: Snippet;
18
+ }
19
+ declare const Card: import("svelte").Component<Props, {}, "">;
20
+ type Card = ReturnType<typeof Card>;
21
+ export default Card;
@@ -0,0 +1,75 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLInputAttributes } from 'svelte/elements';
4
+ import { peerFocusRing, tonePeerChecked, tonePeerFocus, type Tone } from '../../core/tones.js';
5
+
6
+ interface Props extends Omit<HTMLInputAttributes, 'type' | 'size'> {
7
+ checked?: boolean;
8
+ /** Renders the dash state — visual only, `checked` stays false. */
9
+ indeterminate?: boolean;
10
+ label?: string;
11
+ description?: string;
12
+ tone?: Tone;
13
+ children?: Snippet;
14
+ }
15
+
16
+ let {
17
+ checked = $bindable(false),
18
+ indeterminate = false,
19
+ label,
20
+ description,
21
+ tone = 'brand',
22
+ disabled = false,
23
+ class: className = '',
24
+ children,
25
+ ...rest
26
+ }: Props = $props();
27
+
28
+ let el: HTMLInputElement | null = $state(null);
29
+
30
+ $effect(() => {
31
+ if (el) el.indeterminate = indeterminate;
32
+ });
33
+ </script>
34
+
35
+ <label
36
+ class="group inline-flex items-start gap-2.5 font-sans text-sm
37
+ {disabled ? 'pointer-events-none opacity-50' : 'cursor-pointer'} {className}"
38
+ >
39
+ <input bind:this={el} type="checkbox" bind:checked {disabled} class="peer sr-only" {...rest} />
40
+ <span
41
+ class="mt-0.5 flex size-[18px] shrink-0 items-center justify-center rounded border border-hairline-strong bg-bg shadow-xs transition-colors duration-150 ease-brand-out
42
+ {tonePeerChecked[tone]} {peerFocusRing} {tonePeerFocus[tone]}"
43
+ aria-hidden="true"
44
+ >
45
+ {#if indeterminate}
46
+ <span class="h-0.5 w-2.5 rounded-full bg-text-muted"></span>
47
+ {:else}
48
+ <svg
49
+ class="size-3 text-text-inverse opacity-0 transition-opacity duration-150 group-has-[:checked]:opacity-100"
50
+ viewBox="0 0 12 12"
51
+ fill="none"
52
+ >
53
+ <path
54
+ d="m2 6 2.6 2.6L10 3.2"
55
+ stroke="currentColor"
56
+ stroke-width="2"
57
+ stroke-linecap="round"
58
+ stroke-linejoin="round"
59
+ />
60
+ </svg>
61
+ {/if}
62
+ </span>
63
+ {#if label || description || children}
64
+ <span class="flex flex-col gap-0.5">
65
+ {#if children}
66
+ {@render children()}
67
+ {:else if label}
68
+ <span class="leading-snug text-text">{label}</span>
69
+ {/if}
70
+ {#if description}
71
+ <span class="text-[13px] leading-snug text-text-muted">{description}</span>
72
+ {/if}
73
+ </span>
74
+ {/if}
75
+ </label>
@@ -0,0 +1,15 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLInputAttributes } from 'svelte/elements';
3
+ import { type Tone } from '../../core/tones.js';
4
+ interface Props extends Omit<HTMLInputAttributes, 'type' | 'size'> {
5
+ checked?: boolean;
6
+ /** Renders the dash state — visual only, `checked` stays false. */
7
+ indeterminate?: boolean;
8
+ label?: string;
9
+ description?: string;
10
+ tone?: Tone;
11
+ children?: Snippet;
12
+ }
13
+ declare const Checkbox: import("svelte").Component<Props, {}, "checked">;
14
+ type Checkbox = ReturnType<typeof Checkbox>;
15
+ export default Checkbox;
@@ -0,0 +1,111 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLFieldsetAttributes } from 'svelte/elements';
4
+ import Checkbox from './Checkbox.svelte';
5
+ import { toneBorder, toneSurface, type Tone } from '../../core/tones.js';
6
+
7
+ export interface CheckboxOption {
8
+ value: string;
9
+ label: string;
10
+ description?: string;
11
+ disabled?: boolean;
12
+ }
13
+
14
+ interface Props extends Omit<HTMLFieldsetAttributes, 'onchange'> {
15
+ /** Bindable — the `value` of every checked option. */
16
+ value?: string[];
17
+ options?: CheckboxOption[];
18
+ legend?: string;
19
+ hint?: string;
20
+ error?: string;
21
+ required?: boolean;
22
+ tone?: Tone;
23
+ orientation?: 'vertical' | 'horizontal';
24
+ /** Wraps each option in a bordered, clickable card. */
25
+ boxed?: boolean;
26
+ /** Cap on how many may be checked at once. `0` means no limit. */
27
+ max?: number;
28
+ onchange?: (value: string[]) => void;
29
+ /** Pass your own `Checkbox`es instead of `options`. */
30
+ children?: Snippet;
31
+ }
32
+
33
+ let {
34
+ value = $bindable([]),
35
+ options,
36
+ legend,
37
+ hint,
38
+ error,
39
+ required = false,
40
+ tone = 'brand',
41
+ orientation = 'vertical',
42
+ boxed = false,
43
+ max = 0,
44
+ onchange,
45
+ class: className = '',
46
+ children,
47
+ ...rest
48
+ }: Props = $props();
49
+
50
+ const full = $derived(max > 0 && value.length >= max);
51
+
52
+ function toggle(option: CheckboxOption) {
53
+ value = value.includes(option.value)
54
+ ? value.filter((v) => v !== option.value)
55
+ : [...value, option.value];
56
+ onchange?.(value);
57
+ }
58
+ </script>
59
+
60
+ <fieldset class="flex flex-col gap-3 border-0 p-0 {className}" {...rest}>
61
+ {#if legend}
62
+ <legend class="mb-1 font-sans text-sm font-medium text-text">
63
+ {legend}
64
+ {#if required}<span class="ml-0.5 text-danger" aria-hidden="true">*</span>{/if}
65
+ </legend>
66
+ {/if}
67
+
68
+ <div class="flex gap-2.5 {orientation === 'horizontal' ? 'flex-row flex-wrap' : 'flex-col'}">
69
+ {#if options}
70
+ {#each options as option (option.value)}
71
+ {@const checked = value.includes(option.value)}
72
+ {@const disabled = option.disabled || (full && !checked)}
73
+ {#if boxed}
74
+ <label
75
+ class="flex flex-1 cursor-pointer items-start gap-3 rounded-lg border p-4 shadow-xs transition-colors duration-150 ease-brand-out
76
+ {checked
77
+ ? `${toneBorder[tone]} ${toneSurface[tone]}`
78
+ : 'border-hairline bg-bg hover:border-hairline-strong'}
79
+ {disabled ? 'pointer-events-none opacity-50' : ''}"
80
+ >
81
+ <Checkbox
82
+ {checked}
83
+ {disabled}
84
+ {tone}
85
+ label={option.label}
86
+ description={option.description}
87
+ onchange={() => toggle(option)}
88
+ />
89
+ </label>
90
+ {:else}
91
+ <Checkbox
92
+ {checked}
93
+ {disabled}
94
+ {tone}
95
+ label={option.label}
96
+ description={option.description}
97
+ onchange={() => toggle(option)}
98
+ />
99
+ {/if}
100
+ {/each}
101
+ {:else if children}
102
+ {@render children()}
103
+ {/if}
104
+ </div>
105
+
106
+ {#if error}
107
+ <p class="font-sans text-[13px] text-danger">{error}</p>
108
+ {:else if hint}
109
+ <p class="font-sans text-[13px] text-text-muted">{hint}</p>
110
+ {/if}
111
+ </fieldset>
@@ -0,0 +1,30 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLFieldsetAttributes } from 'svelte/elements';
3
+ import { type Tone } from '../../core/tones.js';
4
+ export interface CheckboxOption {
5
+ value: string;
6
+ label: string;
7
+ description?: string;
8
+ disabled?: boolean;
9
+ }
10
+ interface Props extends Omit<HTMLFieldsetAttributes, 'onchange'> {
11
+ /** Bindable — the `value` of every checked option. */
12
+ value?: string[];
13
+ options?: CheckboxOption[];
14
+ legend?: string;
15
+ hint?: string;
16
+ error?: string;
17
+ required?: boolean;
18
+ tone?: Tone;
19
+ orientation?: 'vertical' | 'horizontal';
20
+ /** Wraps each option in a bordered, clickable card. */
21
+ boxed?: boolean;
22
+ /** Cap on how many may be checked at once. `0` means no limit. */
23
+ max?: number;
24
+ onchange?: (value: string[]) => void;
25
+ /** Pass your own `Checkbox`es instead of `options`. */
26
+ children?: Snippet;
27
+ }
28
+ declare const CheckboxGroup: import("svelte").Component<Props, {}, "value">;
29
+ type CheckboxGroup = ReturnType<typeof CheckboxGroup>;
30
+ export default CheckboxGroup;