@k2b/ui 0.59.0 → 0.60.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 (325) hide show
  1. package/dist/browser/actions/CommandList.js +67 -74
  2. package/dist/browser/actions/CommandList.js.map +1 -1
  3. package/dist/browser/actions/ContextMenu.js +11 -2
  4. package/dist/browser/actions/ContextMenu.js.map +1 -1
  5. package/dist/browser/actions/Dropdown.js +187 -169
  6. package/dist/browser/actions/Dropdown.js.map +1 -1
  7. package/dist/browser/actions/GestureMenu.js +18 -7
  8. package/dist/browser/actions/GestureMenu.js.map +1 -1
  9. package/dist/browser/actions/SelectionAction.js +232 -0
  10. package/dist/browser/actions/SelectionAction.js.map +1 -0
  11. package/dist/browser/actions/command-items.js.map +1 -1
  12. package/dist/browser/actions/index.js +1 -0
  13. package/dist/browser/actions/index.js.map +1 -1
  14. package/dist/browser/actions/menu-sheet-open.js +19 -0
  15. package/dist/browser/actions/menu-sheet-open.js.map +1 -0
  16. package/dist/browser/charts/core/line-details.js +2 -2
  17. package/dist/browser/charts/core/line-details.js.map +1 -1
  18. package/dist/browser/charts/core/render.js +2 -1
  19. package/dist/browser/charts/core/render.js.map +1 -1
  20. package/dist/browser/chat/ChatActivityWords.js +142 -0
  21. package/dist/browser/chat/ChatActivityWords.js.map +1 -0
  22. package/dist/browser/chat/ChatComposer.js +540 -515
  23. package/dist/browser/chat/ChatComposer.js.map +1 -1
  24. package/dist/browser/chat/ChatComposerQuotes.js +56 -0
  25. package/dist/browser/chat/ChatComposerQuotes.js.map +1 -0
  26. package/dist/browser/chat/ChatPrimitives.js +281 -245
  27. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  28. package/dist/browser/chat/index.js +4 -1
  29. package/dist/browser/chat/index.js.map +1 -1
  30. package/dist/browser/content/ActivityList.js +789 -0
  31. package/dist/browser/content/ActivityList.js.map +1 -0
  32. package/dist/browser/content/DataTableTools.js +3 -0
  33. package/dist/browser/content/DataTableTools.js.map +1 -1
  34. package/dist/browser/content/Lightbox.js +2 -0
  35. package/dist/browser/content/Lightbox.js.map +1 -1
  36. package/dist/browser/content/MessageQuote.js +57 -0
  37. package/dist/browser/content/MessageQuote.js.map +1 -0
  38. package/dist/browser/content/MessageRow.js +413 -391
  39. package/dist/browser/content/MessageRow.js.map +1 -1
  40. package/dist/browser/content/VirtualFeed.js +29 -2
  41. package/dist/browser/content/VirtualFeed.js.map +1 -1
  42. package/dist/browser/content/activity-messages.js +47 -0
  43. package/dist/browser/content/activity-messages.js.map +1 -0
  44. package/dist/browser/content/activity-timeline.js +144 -0
  45. package/dist/browser/content/activity-timeline.js.map +1 -0
  46. package/dist/browser/content/chart-time-calendar.js +12 -18
  47. package/dist/browser/content/chart-time-calendar.js.map +1 -1
  48. package/dist/browser/content/find-text.js +47 -0
  49. package/dist/browser/content/find-text.js.map +1 -0
  50. package/dist/browser/content/index.js +1 -0
  51. package/dist/browser/content/index.js.map +1 -1
  52. package/dist/browser/content/quote-messages.js +25 -0
  53. package/dist/browser/content/quote-messages.js.map +1 -0
  54. package/dist/browser/feedback/dialog-core.js +118 -14
  55. package/dist/browser/feedback/dialog-core.js.map +1 -1
  56. package/dist/browser/feedback/dialog-frame-motion.js +274 -0
  57. package/dist/browser/feedback/dialog-frame-motion.js.map +1 -0
  58. package/dist/browser/feedback/prompt-sheet-view.js +2 -1
  59. package/dist/browser/feedback/prompt-sheet-view.js.map +1 -1
  60. package/dist/browser/feedback/prompts.js +49 -53
  61. package/dist/browser/feedback/prompts.js.map +1 -1
  62. package/dist/browser/hover-card.js +6 -0
  63. package/dist/browser/hover-card.js.map +1 -0
  64. package/dist/browser/inputs/AutocompleteEditor.js +2 -1
  65. package/dist/browser/inputs/AutocompleteEditor.js.map +1 -1
  66. package/dist/browser/inputs/AutocompleteSelect.js +3 -12
  67. package/dist/browser/inputs/AutocompleteSelect.js.map +1 -1
  68. package/dist/browser/inputs/ChoiceList.js +131 -127
  69. package/dist/browser/inputs/ChoiceList.js.map +1 -1
  70. package/dist/browser/inputs/Combobox.js +6 -15
  71. package/dist/browser/inputs/Combobox.js.map +1 -1
  72. package/dist/browser/inputs/MultiSelectInput.js +7 -16
  73. package/dist/browser/inputs/MultiSelectInput.js.map +1 -1
  74. package/dist/browser/inputs/PeriodPicker.js +475 -252
  75. package/dist/browser/inputs/PeriodPicker.js.map +1 -1
  76. package/dist/browser/inputs/RichSelect.js +431 -431
  77. package/dist/browser/inputs/RichSelect.js.map +1 -1
  78. package/dist/browser/inputs/Select.js +3 -12
  79. package/dist/browser/inputs/Select.js.map +1 -1
  80. package/dist/browser/inputs/SelectChip.js +1 -0
  81. package/dist/browser/inputs/SelectChip.js.map +1 -1
  82. package/dist/browser/inputs/TimeInput.js +181 -0
  83. package/dist/browser/inputs/TimeInput.js.map +1 -0
  84. package/dist/browser/inputs/choice.js.map +1 -1
  85. package/dist/browser/inputs/date-picker.js +2 -1
  86. package/dist/browser/inputs/date-picker.js.map +1 -1
  87. package/dist/browser/inputs/file-drop.js +2 -0
  88. package/dist/browser/inputs/file-drop.js.map +1 -1
  89. package/dist/browser/inputs/index.js +1 -0
  90. package/dist/browser/inputs/index.js.map +1 -1
  91. package/dist/browser/inputs/input-messages.js +20 -2
  92. package/dist/browser/inputs/input-messages.js.map +1 -1
  93. package/dist/browser/inputs/period-picker-messages.js +20 -2
  94. package/dist/browser/inputs/period-picker-messages.js.map +1 -1
  95. package/dist/browser/inputs/period.js +83 -0
  96. package/dist/browser/inputs/period.js.map +1 -1
  97. package/dist/browser/inputs/time-input.js +93 -0
  98. package/dist/browser/inputs/time-input.js.map +1 -0
  99. package/dist/browser/internal/exit-motion.js +23 -0
  100. package/dist/browser/internal/exit-motion.js.map +1 -0
  101. package/dist/browser/internal/option-description.js +47 -0
  102. package/dist/browser/internal/option-description.js.map +1 -0
  103. package/dist/browser/internal/scroll-places.js +15 -0
  104. package/dist/browser/internal/scroll-places.js.map +1 -0
  105. package/dist/browser/layout/AppWorkspace.js +572 -495
  106. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  107. package/dist/browser/layout/BottomSheet.js +2 -14
  108. package/dist/browser/layout/BottomSheet.js.map +1 -1
  109. package/dist/browser/layout/Navigation.js +7 -2
  110. package/dist/browser/layout/Navigation.js.map +1 -1
  111. package/dist/browser/layout/SidebarSwitcher.js +28 -37
  112. package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
  113. package/dist/browser/layout/app-workspace-controller.js +5 -1
  114. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  115. package/dist/browser/layout/bottom-sheet-load.js +17 -0
  116. package/dist/browser/layout/bottom-sheet-load.js.map +1 -0
  117. package/dist/browser/layout/bottom-sheet-options.js +27 -0
  118. package/dist/browser/layout/bottom-sheet-options.js.map +1 -0
  119. package/dist/browser/layout/index.js +2 -1
  120. package/dist/browser/layout/index.js.map +1 -1
  121. package/dist/browser/layout/sheet-motion.js +10 -11
  122. package/dist/browser/layout/sheet-motion.js.map +1 -1
  123. package/dist/browser/layout/sidebar-scroll-memory.js +30 -0
  124. package/dist/browser/layout/sidebar-scroll-memory.js.map +1 -1
  125. package/dist/browser/surfaces/AvatarStack.js +59 -43
  126. package/dist/browser/surfaces/AvatarStack.js.map +1 -1
  127. package/dist/browser/surfaces/LinkCard.js.map +1 -1
  128. package/dist/browser/surfaces/Section.js +4 -2
  129. package/dist/browser/surfaces/Section.js.map +1 -1
  130. package/dist/browser/surfaces/StatCell.js +56 -28
  131. package/dist/browser/surfaces/StatCell.js.map +1 -1
  132. package/dist/browser/surfaces/StatGrid.js +17 -8
  133. package/dist/browser/surfaces/StatGrid.js.map +1 -1
  134. package/dist/browser/surfaces/index.js.map +1 -1
  135. package/dist/ssr/actions/CommandList.js +23 -26
  136. package/dist/ssr/actions/CommandList.js.map +1 -1
  137. package/dist/ssr/actions/ContextMenu.js +8 -2
  138. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  139. package/dist/ssr/actions/Dropdown.js +79 -55
  140. package/dist/ssr/actions/Dropdown.js.map +1 -1
  141. package/dist/ssr/actions/GestureMenu.js +18 -7
  142. package/dist/ssr/actions/GestureMenu.js.map +1 -1
  143. package/dist/ssr/actions/SelectionAction.js +212 -0
  144. package/dist/ssr/actions/SelectionAction.js.map +1 -0
  145. package/dist/ssr/actions/command-items.js.map +1 -1
  146. package/dist/ssr/actions/index.js +1 -0
  147. package/dist/ssr/actions/index.js.map +1 -1
  148. package/dist/ssr/actions/menu-sheet-open.js +19 -0
  149. package/dist/ssr/actions/menu-sheet-open.js.map +1 -0
  150. package/dist/ssr/charts/core/line-details.js +2 -2
  151. package/dist/ssr/charts/core/line-details.js.map +1 -1
  152. package/dist/ssr/charts/core/render.js +2 -1
  153. package/dist/ssr/charts/core/render.js.map +1 -1
  154. package/dist/ssr/chat/ChatActivityWords.js +126 -0
  155. package/dist/ssr/chat/ChatActivityWords.js.map +1 -0
  156. package/dist/ssr/chat/ChatComposer.js +24 -3
  157. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  158. package/dist/ssr/chat/ChatComposerQuotes.js +26 -0
  159. package/dist/ssr/chat/ChatComposerQuotes.js.map +1 -0
  160. package/dist/ssr/chat/ChatPrimitives.js +53 -47
  161. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  162. package/dist/ssr/chat/index.js +4 -1
  163. package/dist/ssr/chat/index.js.map +1 -1
  164. package/dist/ssr/content/ActivityList.js +553 -0
  165. package/dist/ssr/content/ActivityList.js.map +1 -0
  166. package/dist/ssr/content/DataTableTools.js +3 -0
  167. package/dist/ssr/content/DataTableTools.js.map +1 -1
  168. package/dist/ssr/content/Lightbox.js +2 -0
  169. package/dist/ssr/content/Lightbox.js.map +1 -1
  170. package/dist/ssr/content/MessageQuote.js +36 -0
  171. package/dist/ssr/content/MessageQuote.js.map +1 -0
  172. package/dist/ssr/content/MessageRow.js +112 -95
  173. package/dist/ssr/content/MessageRow.js.map +1 -1
  174. package/dist/ssr/content/VirtualFeed.js +29 -2
  175. package/dist/ssr/content/VirtualFeed.js.map +1 -1
  176. package/dist/ssr/content/activity-messages.js +47 -0
  177. package/dist/ssr/content/activity-messages.js.map +1 -0
  178. package/dist/ssr/content/activity-timeline.js +144 -0
  179. package/dist/ssr/content/activity-timeline.js.map +1 -0
  180. package/dist/ssr/content/chart-time-calendar.js +12 -18
  181. package/dist/ssr/content/chart-time-calendar.js.map +1 -1
  182. package/dist/ssr/content/find-text.js +47 -0
  183. package/dist/ssr/content/find-text.js.map +1 -0
  184. package/dist/ssr/content/index.js +1 -0
  185. package/dist/ssr/content/index.js.map +1 -1
  186. package/dist/ssr/content/quote-messages.js +25 -0
  187. package/dist/ssr/content/quote-messages.js.map +1 -0
  188. package/dist/ssr/feedback/dialog-core.js +118 -14
  189. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  190. package/dist/ssr/feedback/dialog-frame-motion.js +274 -0
  191. package/dist/ssr/feedback/dialog-frame-motion.js.map +1 -0
  192. package/dist/ssr/feedback/prompt-sheet-view.js +2 -1
  193. package/dist/ssr/feedback/prompt-sheet-view.js.map +1 -1
  194. package/dist/ssr/feedback/prompts.js +16 -16
  195. package/dist/ssr/feedback/prompts.js.map +1 -1
  196. package/dist/ssr/hover-card.js +6 -0
  197. package/dist/ssr/hover-card.js.map +1 -0
  198. package/dist/ssr/inputs/AutocompleteEditor.js +2 -1
  199. package/dist/ssr/inputs/AutocompleteEditor.js.map +1 -1
  200. package/dist/ssr/inputs/AutocompleteSelect.js +3 -8
  201. package/dist/ssr/inputs/AutocompleteSelect.js.map +1 -1
  202. package/dist/ssr/inputs/ChoiceList.js +25 -25
  203. package/dist/ssr/inputs/ChoiceList.js.map +1 -1
  204. package/dist/ssr/inputs/Combobox.js +4 -9
  205. package/dist/ssr/inputs/Combobox.js.map +1 -1
  206. package/dist/ssr/inputs/MultiSelectInput.js +4 -9
  207. package/dist/ssr/inputs/MultiSelectInput.js.map +1 -1
  208. package/dist/ssr/inputs/PeriodPicker.js +241 -46
  209. package/dist/ssr/inputs/PeriodPicker.js.map +1 -1
  210. package/dist/ssr/inputs/RichSelect.js +135 -121
  211. package/dist/ssr/inputs/RichSelect.js.map +1 -1
  212. package/dist/ssr/inputs/Select.js +3 -8
  213. package/dist/ssr/inputs/Select.js.map +1 -1
  214. package/dist/ssr/inputs/SelectChip.js +1 -0
  215. package/dist/ssr/inputs/SelectChip.js.map +1 -1
  216. package/dist/ssr/inputs/TimeInput.js +145 -0
  217. package/dist/ssr/inputs/TimeInput.js.map +1 -0
  218. package/dist/ssr/inputs/choice.js.map +1 -1
  219. package/dist/ssr/inputs/date-picker.js +2 -1
  220. package/dist/ssr/inputs/date-picker.js.map +1 -1
  221. package/dist/ssr/inputs/file-drop.js +2 -0
  222. package/dist/ssr/inputs/file-drop.js.map +1 -1
  223. package/dist/ssr/inputs/index.js +1 -0
  224. package/dist/ssr/inputs/index.js.map +1 -1
  225. package/dist/ssr/inputs/input-messages.js +20 -2
  226. package/dist/ssr/inputs/input-messages.js.map +1 -1
  227. package/dist/ssr/inputs/period-picker-messages.js +20 -2
  228. package/dist/ssr/inputs/period-picker-messages.js.map +1 -1
  229. package/dist/ssr/inputs/period.js +83 -0
  230. package/dist/ssr/inputs/period.js.map +1 -1
  231. package/dist/ssr/inputs/time-input.js +93 -0
  232. package/dist/ssr/inputs/time-input.js.map +1 -0
  233. package/dist/ssr/internal/exit-motion.js +23 -0
  234. package/dist/ssr/internal/exit-motion.js.map +1 -0
  235. package/dist/ssr/internal/option-description.js +27 -0
  236. package/dist/ssr/internal/option-description.js.map +1 -0
  237. package/dist/ssr/internal/scroll-places.js +15 -0
  238. package/dist/ssr/internal/scroll-places.js.map +1 -0
  239. package/dist/ssr/layout/AppWorkspace.js +191 -121
  240. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  241. package/dist/ssr/layout/BottomSheet.js +2 -14
  242. package/dist/ssr/layout/BottomSheet.js.map +1 -1
  243. package/dist/ssr/layout/Navigation.js +7 -2
  244. package/dist/ssr/layout/Navigation.js.map +1 -1
  245. package/dist/ssr/layout/SidebarSwitcher.js +8 -13
  246. package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
  247. package/dist/ssr/layout/app-workspace-controller.js +5 -1
  248. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  249. package/dist/ssr/layout/bottom-sheet-load.js +17 -0
  250. package/dist/ssr/layout/bottom-sheet-load.js.map +1 -0
  251. package/dist/ssr/layout/bottom-sheet-options.js +27 -0
  252. package/dist/ssr/layout/bottom-sheet-options.js.map +1 -0
  253. package/dist/ssr/layout/index.js +2 -1
  254. package/dist/ssr/layout/index.js.map +1 -1
  255. package/dist/ssr/layout/sheet-motion.js +10 -11
  256. package/dist/ssr/layout/sheet-motion.js.map +1 -1
  257. package/dist/ssr/layout/sidebar-scroll-memory.js +30 -0
  258. package/dist/ssr/layout/sidebar-scroll-memory.js.map +1 -1
  259. package/dist/ssr/surfaces/AvatarStack.js +56 -40
  260. package/dist/ssr/surfaces/AvatarStack.js.map +1 -1
  261. package/dist/ssr/surfaces/LinkCard.js.map +1 -1
  262. package/dist/ssr/surfaces/Section.js +4 -2
  263. package/dist/ssr/surfaces/Section.js.map +1 -1
  264. package/dist/ssr/surfaces/StatCell.js +24 -12
  265. package/dist/ssr/surfaces/StatCell.js.map +1 -1
  266. package/dist/ssr/surfaces/StatGrid.js +12 -6
  267. package/dist/ssr/surfaces/StatGrid.js.map +1 -1
  268. package/dist/ssr/surfaces/index.js.map +1 -1
  269. package/dist/styles.css +1 -1
  270. package/dist/types/actions/Dropdown.d.ts +10 -0
  271. package/dist/types/actions/SelectionAction.d.ts +34 -0
  272. package/dist/types/actions/command-items.d.ts +5 -0
  273. package/dist/types/actions/index.d.ts +2 -0
  274. package/dist/types/actions/menu-sheet-open.d.ts +13 -0
  275. package/dist/types/charts/core/line-details.d.ts +1 -1
  276. package/dist/types/chat/ChatActivityWords.d.ts +31 -0
  277. package/dist/types/chat/ChatComposer.d.ts +17 -1
  278. package/dist/types/chat/ChatComposerQuotes.d.ts +10 -0
  279. package/dist/types/chat/ChatPrimitives.d.ts +17 -1
  280. package/dist/types/chat/index.d.ts +6 -2
  281. package/dist/types/content/ActivityList.d.ts +166 -0
  282. package/dist/types/content/DataTableTools.d.ts +2 -0
  283. package/dist/types/content/MessageQuote.d.ts +9 -0
  284. package/dist/types/content/MessageRow.d.ts +5 -0
  285. package/dist/types/content/VirtualFeed.d.ts +6 -0
  286. package/dist/types/content/activity-messages.d.ts +22 -0
  287. package/dist/types/content/activity-timeline.d.ts +52 -0
  288. package/dist/types/content/chart-time-calendar.d.ts +6 -0
  289. package/dist/types/content/find-text.d.ts +10 -0
  290. package/dist/types/content/index.d.ts +1 -0
  291. package/dist/types/content/quote-messages.d.ts +6 -0
  292. package/dist/types/feedback/dialog-core.d.ts +2 -0
  293. package/dist/types/feedback/dialog-frame-motion.d.ts +37 -0
  294. package/dist/types/feedback/prompts.d.ts +5 -0
  295. package/dist/types/hover-card.d.ts +5 -0
  296. package/dist/types/inputs/ChoiceList.d.ts +12 -5
  297. package/dist/types/inputs/Combobox.d.ts +5 -0
  298. package/dist/types/inputs/MultiSelectInput.d.ts +1 -0
  299. package/dist/types/inputs/PeriodPicker.d.ts +10 -0
  300. package/dist/types/inputs/RichSelect.d.ts +5 -0
  301. package/dist/types/inputs/Select.d.ts +1 -0
  302. package/dist/types/inputs/SelectChip.d.ts +5 -0
  303. package/dist/types/inputs/TimeInput.d.ts +16 -0
  304. package/dist/types/inputs/choice.d.ts +6 -1
  305. package/dist/types/inputs/index.d.ts +2 -0
  306. package/dist/types/inputs/input-messages.d.ts +9 -0
  307. package/dist/types/inputs/period-picker-messages.d.ts +9 -0
  308. package/dist/types/inputs/period.d.ts +41 -0
  309. package/dist/types/inputs/time-input.d.ts +43 -0
  310. package/dist/types/internal/exit-motion.d.ts +10 -0
  311. package/dist/types/internal/option-description.d.ts +20 -0
  312. package/dist/types/internal/scroll-places.d.ts +2 -0
  313. package/dist/types/layout/AppWorkspace.d.ts +10 -0
  314. package/dist/types/layout/BottomSheet.d.ts +1 -14
  315. package/dist/types/layout/SidebarSwitcher.d.ts +5 -0
  316. package/dist/types/layout/bottom-sheet-load.d.ts +9 -0
  317. package/dist/types/layout/bottom-sheet-options.d.ts +18 -0
  318. package/dist/types/layout/index.d.ts +3 -2
  319. package/dist/types/layout/sheet-motion.d.ts +0 -5
  320. package/dist/types/layout/sidebar-scroll-memory.d.ts +6 -0
  321. package/dist/types/surfaces/LinkCard.d.ts +2 -1
  322. package/dist/types/surfaces/StatCell.d.ts +7 -2
  323. package/dist/types/surfaces/StatGrid.d.ts +15 -3
  324. package/dist/types/surfaces/index.d.ts +1 -1
  325. package/package.json +12 -5
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["inputs/MultiSelectInput.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, onCleanup, onMount, Show } from \"solid-js\";\nimport { colorTintStyle, normalizeHexColor } from \"../internal/color\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { ChoiceGroups } from \"./ChoiceGroups\";\nimport {\n type ChoiceOption,\n createChoiceLoader,\n createChoicePopover,\n filterChoiceOptions,\n fitChoicePills,\n nextEnabledChoiceIndex,\n} from \"./choice\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { commitFieldValue, resolveMaybeAccessor } from \"./field-contract\";\nimport type { ChoiceAppearance, SelectGroup } from \"./Select\";\nimport { useSelectMessages } from \"./select-messages\";\n\nexport type MultiSelectOption =\n | string\n | { id: string; label?: string; description?: string; icon?: string; color?: string; groups?: readonly string[] }\n | ChoiceOption<string>;\ntype NormalizedOption = ChoiceOption<string>;\nexport type MultiSelectFetchDataFn = (query: string, signal: AbortSignal, group: string | null) => Promise<MultiSelectOption[]>;\n\nexport type MultiSelectInputProps = ValueFieldProps<string[]> & {\n options?: MultiSelectOption[];\n fetchData?: MultiSelectFetchDataFn;\n selectedOptions?: () => MultiSelectOption[];\n placeholder?: string;\n icon?: string;\n activeIcon?: string;\n fetchDebounceMs?: number;\n debounceMs?: number;\n loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;\n groups?: readonly SelectGroup[];\n defaultGroup?: string;\n groupsAriaLabel?: string;\n allGroupLabel?: string;\n searchable?: boolean;\n clearable?: boolean;\n name?: string;\n renderOption?: (option: ChoiceOption<string>) => JSX.Element;\n renderValue?: (option: ChoiceOption<string>) => JSX.Element;\n searchPlaceholder?: string;\n loadingLabel?: string;\n noResultsLabel?: string;\n emptyLabel?: string;\n retryLabel?: string;\n clearLabel?: string;\n /** `plain` shows the selection as wrapping pills without a box; options are removed in the list. */\n appearance?: ChoiceAppearance;\n /** Icon class shown before the placeholder while nothing is selected. */\n placeholderIcon?: string;\n};\n\n/** Cloud tints the option icon with the option color instead of adding a dot. */\nconst iconColor = (color: string | undefined): JSX.CSSProperties | undefined => {\n const normalized = normalizeHexColor(color);\n return normalized ? { color: normalized } : undefined;\n};\n\nconst normalize = (option: MultiSelectOption): NormalizedOption =>\n typeof option === \"string\"\n ? { value: option, label: option }\n : \"value\" in option\n ? option\n : { ...option, value: option.id, label: option.label || option.id };\n\nexport function MultiSelectInput(props: MultiSelectInputProps): JSX.Element {\n const messages = useUiMessages();\n const selectMessages = useSelectMessages();\n const meta = createFieldMeta(props.id);\n const listboxId = `${meta.controlId}-listbox`;\n const [query, setQuery] = createSignal(\"\");\n const [focusedIndex, setFocusedIndex] = createSignal(-1);\n const [cache, setCache] = createSignal<Record<string, NormalizedOption>>({});\n const [selectedGroup, setSelectedGroup] = createSignal<string | null>(props.defaultGroup ?? null);\n let searchRef: HTMLInputElement | undefined;\n\n const values = () => resolveMaybeAccessor(props.value) ?? [];\n const error = () => resolveMaybeAccessor(props.error);\n const activeGroup = createMemo(() => {\n const current = selectedGroup();\n return current && props.groups?.some((group) => group.value === current) ? current : null;\n });\n const groupChoices = createMemo(() => [{ value: null, label: props.allGroupLabel ?? messages().all }, ...(props.groups ?? [])]);\n const asyncOptions = createChoiceLoader(\n () =>\n props.fetchData\n ? async (query, signal) => (await props.fetchData!(query, signal, activeGroup())).map(normalize)\n : props.loadOptions\n ? (query, signal) => props.loadOptions!(query, signal, activeGroup())\n : undefined,\n () => props.fetchDebounceMs ?? props.debounceMs ?? 200,\n );\n const isAsync = () => Boolean(props.fetchData || props.loadOptions);\n const sourceOptions = createMemo(() => (isAsync() ? asyncOptions.options() : (props.options ?? []).map(normalize)));\n const groupedOptions = createMemo(() => {\n const group = activeGroup();\n return !isAsync() && group ? sourceOptions().filter((option) => option.groups?.includes(group)) : sourceOptions();\n });\n // Cloud's multi-select always renders its search field, and filters a static\n // option list client-side while a remote loader filters server-side.\n const searchable = () => isAsync() || (props.searchable ?? true);\n const visibleOptions = createMemo(() =>\n isAsync() ? groupedOptions() : filterChoiceOptions(groupedOptions(), searchable() ? query() : \"\"),\n );\n const optionByValue = createMemo(() => {\n const options = new Map<string, NormalizedOption>();\n for (const option of Object.values(cache())) options.set(option.value, option);\n for (const option of (props.selectedOptions?.() ?? []).map(normalize)) options.set(option.value, option);\n for (const option of sourceOptions()) options.set(option.value, option);\n return options;\n });\n const selected = createMemo(() => values().map((value) => optionByValue().get(value) ?? ({ value, label: value } as NormalizedOption)));\n const plain = () => props.appearance === \"plain\";\n const hasClearAction = () => Boolean(props.clearable && selected().length > 0 && !props.disabled && !plain());\n const selectedValues = createMemo(() => new Set(values()));\n const popover = createChoicePopover(() => Boolean(props.disabled));\n const focusedOption = () => visibleOptions()[focusedIndex()];\n\n // Pills that do not fit the trigger collapse into a \"+N\" summary. Until the\n // browser measures them (server HTML, hidden containers) every pill stays.\n let valuesRef: HTMLSpanElement | undefined;\n let moreRef: HTMLSpanElement | undefined;\n const [visibleCount, setVisibleCount] = createSignal(Number.POSITIVE_INFINITY);\n const hiddenOptions = createMemo(() => selected().slice(visibleCount()));\n // While every pill fits, the invisible summary carries the largest count it\n // could show, so measuring it reserves enough room for the real one.\n const moreCount = () => hiddenOptions().length || selected().length - 1;\n const fitValues = () => {\n const values = valuesRef;\n if (!values?.isConnected) return;\n // Plain pills wrap, so every one stays visible.\n if (plain()) {\n values.style.width = \"\";\n setVisibleCount(Number.POSITIVE_INFINITY);\n return;\n }\n // Measuring releases a truncated first pill to its natural width; the\n // browser paints only the final state.\n values.dataset.measuring = \"true\";\n const pills = Array.from(\n values.querySelectorAll<HTMLElement>(\":scope > .k2b-choice-pill\"),\n (pill) => pill.getBoundingClientRect().width,\n );\n const fit = fitChoicePills(\n values.getBoundingClientRect().width,\n pills,\n Number.parseFloat(getComputedStyle(values).columnGap) || 0,\n moreRef?.isConnected ? moreRef.getBoundingClientRect().width : 0,\n );\n delete values.dataset.measuring;\n // Hidden pills leave the flow. While any are hidden the strip keeps the\n // whole row as its preferred width, so a container sized by its content\n // does not shrink with the collapse and grows back once it has room. The\n // strip still flexes to the trigger's width.\n values.style.width = fit.visible < pills.length ? `${fit.rowWidth}px` : \"\";\n setVisibleCount(fit.visible);\n };\n const resizeObserver = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(() => fitValues());\n onCleanup(() => resizeObserver?.disconnect());\n createEffect(() => {\n selected();\n fitValues();\n });\n onMount(() => {\n if (\"fonts\" in document) void document.fonts.ready.then(fitValues);\n });\n\n const emit = (next: readonly string[]) => {\n const unique = [...new Set(next)];\n commitFieldValue(props, unique);\n };\n const isSelected = (value: string) => selectedValues().has(value);\n const focusFirst = () => setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), -1, 1));\n const chooseGroup = (group: string | null) => {\n if (group === activeGroup()) return;\n setSelectedGroup(group);\n focusFirst();\n if (isAsync()) asyncOptions.load(query(), true);\n };\n const open = () => {\n if (props.disabled) return;\n setQuery(\"\");\n if (isAsync()) asyncOptions.load(\"\", true);\n focusFirst();\n popover.show();\n if (searchable()) queueMicrotask(() => searchRef?.focus());\n };\n const close = (restoreFocus = false) => {\n asyncOptions.cancel();\n setQuery(\"\");\n setFocusedIndex(-1);\n popover.hide(restoreFocus);\n };\n const toggleOption = (option: NormalizedOption) => {\n if (option.disabled) return;\n setCache({ ...cache(), [option.value]: option });\n emit(isSelected(option.value) ? values().filter((value) => value !== option.value) : [...values(), option.value]);\n };\n const remove = (value: string) => emit(values().filter((item) => item !== value));\n const move = (direction: 1 | -1) => {\n setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), focusedIndex(), direction));\n };\n const handleKeyDown = (event: KeyboardEvent) => {\n const inToolbar = Boolean((event.target as HTMLElement | null)?.closest?.(\".k2b-choice-toolbar\"));\n if (inToolbar && event.key !== \"Escape\" && event.key !== \"Tab\") return;\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!popover.open()) open();\n else move(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n }\n if ((event.key === \"Enter\" || event.key === \" \") && !popover.open()) {\n event.preventDefault();\n open();\n return;\n }\n if (event.key === \"Enter\" && popover.open()) {\n const option = focusedOption();\n if (option) {\n event.preventDefault();\n toggleOption(option);\n }\n return;\n }\n if (event.key === \"Backspace\" && popover.open() && !query() && values().length > 0) {\n event.preventDefault();\n const last = values().at(-1);\n if (last) remove(last);\n return;\n }\n if (event.key === \"Escape\" && popover.open()) {\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\" && popover.open()) {\n close();\n }\n };\n\n return (\n <Field\n class={props.class}\n label={props.label}\n description={props.description}\n error={error()}\n meta={meta}\n labelFor={false}\n required={props.required}\n disabled={props.disabled}\n >\n <div class=\"k2b-choice-control\" data-appearance={props.appearance ?? \"field\"} data-invalid={error() ? \"true\" : undefined}>\n <div\n ref={(element) => {\n popover.setTrigger(element);\n resizeObserver?.observe(element);\n }}\n id={meta.controlId}\n class=\"k2b-multi-select-trigger\"\n role=\"combobox\"\n tabIndex={props.disabled ? -1 : 0}\n aria-haspopup=\"listbox\"\n aria-expanded={popover.open()}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n {...fieldControlAria(meta, props)}\n aria-disabled={props.disabled}\n data-disabled={props.disabled ? \"true\" : undefined}\n onClick={() => (popover.open() ? close() : open())}\n onKeyDown={handleKeyDown}\n >\n <Show\n when={selected().length > 0}\n fallback={\n <>\n <Show when={props.placeholderIcon}>\n {(icon) => <i class={`${icon()} k2b-choice-trigger__placeholder-icon`} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-trigger__value\" data-placeholder=\"true\">\n {props.placeholder ?? messages().select}\n </span>\n </>\n }\n >\n <span\n ref={valuesRef}\n class=\"k2b-multi-select-trigger__values\"\n data-overflowing={hiddenOptions().length > 0 ? \"true\" : undefined}\n >\n <For each={selected()}>\n {(option, index) => (\n <span\n class=\"k2b-choice-pill\"\n style={colorTintStyle(option.color)}\n title={option.label}\n data-hidden={index() >= visibleCount() ? \"true\" : undefined}\n >\n <Show\n when={props.renderValue}\n fallback={\n <>\n <Show when={option.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span>{option.label}</span>\n </>\n }\n >\n {(render) => <span class=\"k2b-choice-pill__content\">{render()(option)}</span>}\n </Show>\n <Show when={!plain()}>\n <button\n type=\"button\"\n aria-label={selectMessages().removeNamed({ name: option.label })}\n disabled={props.disabled}\n tabIndex={-1}\n onClick={(event) => {\n event.stopPropagation();\n remove(option.value);\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n </span>\n )}\n </For>\n <Show when={selected().length > 1 && !plain()}>\n <span\n ref={(element) => {\n moreRef = element;\n resizeObserver?.observe(element);\n onCleanup(() => resizeObserver?.unobserve(element));\n }}\n class=\"k2b-multi-select-trigger__more\"\n title={\n hiddenOptions()\n .map((option) => option.label)\n .join(\", \") || undefined\n }\n data-hidden={hiddenOptions().length === 0 ? \"true\" : undefined}\n >\n <span aria-hidden=\"true\">+{moreCount()}</span>\n <span class=\"k2b-sr-only\">{selectMessages().moreSelected({ count: moreCount() })}</span>\n </span>\n </Show>\n </span>\n </Show>\n <Show when={!hasClearAction()}>\n <i\n class={`${popover.open() ? (props.activeIcon ?? \"ti ti-chevron-up\") : (props.icon ?? \"ti ti-chevron-down\")} k2b-multi-select-trigger__chevron`}\n aria-hidden=\"true\"\n />\n </Show>\n </div>\n <Show when={hasClearAction()}>\n <button\n type=\"button\"\n class=\"k2b-choice-control__clear k2b-input-clear-action\"\n aria-label={props.clearLabel ?? messages().clearSelection}\n onClick={(event) => {\n event.stopPropagation();\n emit([]);\n popover.trigger()?.focus();\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n\n <div\n ref={popover.setPopover}\n popover=\"manual\"\n class=\"k2b-choice-popover\"\n role=\"group\"\n onKeyDown={handleKeyDown}\n aria-label={typeof props.label === \"string\" ? props.label : (props[\"aria-label\"] ?? messages().options)}\n >\n <Show when={searchable()}>\n <div class=\"k2b-choice-search\">\n <i class=\"ti ti-search\" aria-hidden=\"true\" />\n <input\n ref={searchRef}\n type=\"search\"\n value={query()}\n placeholder={props.searchPlaceholder ?? messages().search}\n aria-label={props.searchPlaceholder ?? selectMessages().searchOptions}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n onInput={(event) => {\n const next = event.currentTarget.value;\n setQuery(next);\n if (isAsync()) asyncOptions.load(next);\n focusFirst();\n }}\n />\n </div>\n </Show>\n <Show when={(props.groups?.length ?? 0) > 0}>\n <div class=\"k2b-choice-toolbar\">\n <ChoiceGroups\n choices={groupChoices()}\n value={activeGroup()}\n onValueChange={chooseGroup}\n ariaLabel={props.groupsAriaLabel ?? selectMessages().filterOptions}\n controls={listboxId}\n />\n </div>\n </Show>\n <div id={listboxId} class=\"k2b-choice-options\" role=\"listbox\" aria-multiselectable=\"true\">\n <Show when={asyncOptions.error()}>\n {(message) => (\n <div class=\"k2b-choice-status\" data-tone=\"danger\">\n <span>{message()}</span>\n <button type=\"button\" onClick={asyncOptions.retry}>\n {props.retryLabel ?? messages().retry}\n </button>\n </div>\n )}\n </Show>\n <Show when={asyncOptions.loading() && visibleOptions().length === 0}>\n <div class=\"k2b-choice-status\">\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span>{props.loadingLabel ?? messages().loading}</span>\n </div>\n </Show>\n <For\n each={asyncOptions.error() ? [] : visibleOptions()}\n fallback={\n <Show when={!asyncOptions.loading() && !asyncOptions.error()}>\n <div class=\"k2b-choice-status\">\n {isAsync() || query()\n ? (props.noResultsLabel ?? messages().noResults)\n : (props.emptyLabel ?? selectMessages().noOptions)}\n </div>\n </Show>\n }\n >\n {(option, index) => (\n <button\n type=\"button\"\n id={`${listboxId}-${index()}`}\n class=\"k2b-choice-option\"\n role=\"option\"\n aria-label={option.label}\n aria-selected={isSelected(option.value)}\n data-focused={index() === focusedIndex() ? \"true\" : undefined}\n disabled={option.disabled}\n onPointerMove={() => !option.disabled && setFocusedIndex(index())}\n onClick={() => toggleOption(option)}\n >\n <span class=\"k2b-choice-option__checkbox\" aria-hidden=\"true\">\n <i class=\"ti ti-check\" />\n </span>\n <Show\n when={option.icon}\n fallback={\n <Show when={normalizeHexColor(option.color)}>\n {(color) => <span class=\"k2b-choice-dot\" style={{ background: color() }} aria-hidden=\"true\" />}\n </Show>\n }\n >\n {(icon) => <i class={icon()} style={iconColor(option.color)} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-option__content\">\n <Show\n when={props.renderOption}\n fallback={\n <>\n <strong>{option.label}</strong>\n <Show when={option.description}>{(description) => <small>{description()}</small>}</Show>\n </>\n }\n >\n {(render) => render()(option)}\n </Show>\n </span>\n </button>\n )}\n </For>\n </div>\n </div>\n <Show when={props.name}>{(name) => <input type=\"hidden\" name={name()} value={values().join(\",\")} />}</Show>\n </div>\n </Field>\n );\n}\n\nexport default MultiSelectInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,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2DACT,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,iDACzB,KAAK,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,GAAG,MAAM,YAAG,SAAS,4CACnD,MAAM,CAAC,QAAQ,oCAOxB,IAAI;UAAA,IACH,IAAI;YAAA,OAAE,MAAM,CAAC,IAAI;UAAA;UAAA,IACjB,QAAQ;YAAA,yBACL,IAAI;cAAA,IAAC,IAAI;gBAAA,OAAE,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC;cAAA;cAAA,UACvC,KAAK,+DAAuD,KAAK,CAAC,CAAC;YAAyB;UAAA;UAAA,UAIhG,IAAI,qDAAe,IAAI,CAAC,CAAC,4BAAS,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;QAAuB,gCAGjF,IAAI;UAAA,IACH,IAAI;YAAA,OAAE,KAAK,CAAC,YAAY;UAAA;UAAA,IACxB,QAAQ;YAAA,iCAEK,MAAM,CAAC,KAAK,sBACpB,IAAI;cAAA,IAAC,IAAI;gBAAA,OAAE,MAAM,CAAC,WAAW;cAAA;cAAA,UAAI,WAAW,6BAAa,WAAW,CAAC,CAAC;YAAS;UAAA;UAAA,UAIlF,MAAM,IAAK,MAAM,CAAC,CAAC,CAAC,MAAM;QAAC;MAIpC,gCAIN,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,IAAI;QAAA;QAAA,UAAI,IAAI,oDAAgC,IAAI,CAAC,CAAC,mDAAS,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;MAAI;IAAA;EAAA;AAI3G;AAEA,eAAe,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["inputs/MultiSelectInput.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, onCleanup, onMount, Show } from \"solid-js\";\nimport { colorTintStyle, normalizeHexColor } from \"../internal/color\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { optionDescription } from \"../internal/option-description\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { ChoiceGroups } from \"./ChoiceGroups\";\nimport {\n type ChoiceOption,\n createChoiceLoader,\n createChoicePopover,\n filterChoiceOptions,\n fitChoicePills,\n nextEnabledChoiceIndex,\n} from \"./choice\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { commitFieldValue, resolveMaybeAccessor } from \"./field-contract\";\nimport type { ChoiceAppearance, SelectGroup } from \"./Select\";\nimport { useSelectMessages } from \"./select-messages\";\n\nexport type MultiSelectOption =\n | string\n | {\n id: string;\n label?: string;\n description?: string;\n descriptionVisual?: () => JSX.Element;\n icon?: string;\n color?: string;\n groups?: readonly string[];\n }\n | ChoiceOption<string>;\ntype NormalizedOption = ChoiceOption<string>;\nexport type MultiSelectFetchDataFn = (query: string, signal: AbortSignal, group: string | null) => Promise<MultiSelectOption[]>;\n\nexport type MultiSelectInputProps = ValueFieldProps<string[]> & {\n options?: MultiSelectOption[];\n fetchData?: MultiSelectFetchDataFn;\n selectedOptions?: () => MultiSelectOption[];\n placeholder?: string;\n icon?: string;\n activeIcon?: string;\n fetchDebounceMs?: number;\n debounceMs?: number;\n loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;\n groups?: readonly SelectGroup[];\n defaultGroup?: string;\n groupsAriaLabel?: string;\n allGroupLabel?: string;\n searchable?: boolean;\n clearable?: boolean;\n name?: string;\n renderOption?: (option: ChoiceOption<string>) => JSX.Element;\n renderValue?: (option: ChoiceOption<string>) => JSX.Element;\n searchPlaceholder?: string;\n loadingLabel?: string;\n noResultsLabel?: string;\n emptyLabel?: string;\n retryLabel?: string;\n clearLabel?: string;\n /** `plain` shows the selection as wrapping pills without a box; options are removed in the list. */\n appearance?: ChoiceAppearance;\n /** Icon class shown before the placeholder while nothing is selected. */\n placeholderIcon?: string;\n};\n\n/** Cloud tints the option icon with the option color instead of adding a dot. */\nconst iconColor = (color: string | undefined): JSX.CSSProperties | undefined => {\n const normalized = normalizeHexColor(color);\n return normalized ? { color: normalized } : undefined;\n};\n\nconst normalize = (option: MultiSelectOption): NormalizedOption =>\n typeof option === \"string\"\n ? { value: option, label: option }\n : \"value\" in option\n ? option\n : { ...option, value: option.id, label: option.label || option.id };\n\nexport function MultiSelectInput(props: MultiSelectInputProps): JSX.Element {\n const messages = useUiMessages();\n const selectMessages = useSelectMessages();\n const meta = createFieldMeta(props.id);\n const listboxId = `${meta.controlId}-listbox`;\n const [query, setQuery] = createSignal(\"\");\n const [focusedIndex, setFocusedIndex] = createSignal(-1);\n const [cache, setCache] = createSignal<Record<string, NormalizedOption>>({});\n const [selectedGroup, setSelectedGroup] = createSignal<string | null>(props.defaultGroup ?? null);\n let searchRef: HTMLInputElement | undefined;\n\n const values = () => resolveMaybeAccessor(props.value) ?? [];\n const error = () => resolveMaybeAccessor(props.error);\n const activeGroup = createMemo(() => {\n const current = selectedGroup();\n return current && props.groups?.some((group) => group.value === current) ? current : null;\n });\n const groupChoices = createMemo(() => [{ value: null, label: props.allGroupLabel ?? messages().all }, ...(props.groups ?? [])]);\n const asyncOptions = createChoiceLoader(\n () =>\n props.fetchData\n ? async (query, signal) => (await props.fetchData!(query, signal, activeGroup())).map(normalize)\n : props.loadOptions\n ? (query, signal) => props.loadOptions!(query, signal, activeGroup())\n : undefined,\n () => props.fetchDebounceMs ?? props.debounceMs ?? 200,\n );\n const isAsync = () => Boolean(props.fetchData || props.loadOptions);\n const sourceOptions = createMemo(() => (isAsync() ? asyncOptions.options() : (props.options ?? []).map(normalize)));\n const groupedOptions = createMemo(() => {\n const group = activeGroup();\n return !isAsync() && group ? sourceOptions().filter((option) => option.groups?.includes(group)) : sourceOptions();\n });\n // Cloud's multi-select always renders its search field, and filters a static\n // option list client-side while a remote loader filters server-side.\n const searchable = () => isAsync() || (props.searchable ?? true);\n const visibleOptions = createMemo(() =>\n isAsync() ? groupedOptions() : filterChoiceOptions(groupedOptions(), searchable() ? query() : \"\"),\n );\n const optionByValue = createMemo(() => {\n const options = new Map<string, NormalizedOption>();\n for (const option of Object.values(cache())) options.set(option.value, option);\n for (const option of (props.selectedOptions?.() ?? []).map(normalize)) options.set(option.value, option);\n for (const option of sourceOptions()) options.set(option.value, option);\n return options;\n });\n const selected = createMemo(() => values().map((value) => optionByValue().get(value) ?? ({ value, label: value } as NormalizedOption)));\n const plain = () => props.appearance === \"plain\";\n const hasClearAction = () => Boolean(props.clearable && selected().length > 0 && !props.disabled && !plain());\n const selectedValues = createMemo(() => new Set(values()));\n const popover = createChoicePopover(() => Boolean(props.disabled));\n const focusedOption = () => visibleOptions()[focusedIndex()];\n\n // Pills that do not fit the trigger collapse into a \"+N\" summary. Until the\n // browser measures them (server HTML, hidden containers) every pill stays.\n let valuesRef: HTMLSpanElement | undefined;\n let moreRef: HTMLSpanElement | undefined;\n const [visibleCount, setVisibleCount] = createSignal(Number.POSITIVE_INFINITY);\n const hiddenOptions = createMemo(() => selected().slice(visibleCount()));\n // While every pill fits, the invisible summary carries the largest count it\n // could show, so measuring it reserves enough room for the real one.\n const moreCount = () => hiddenOptions().length || selected().length - 1;\n const fitValues = () => {\n const values = valuesRef;\n if (!values?.isConnected) return;\n // Plain pills wrap, so every one stays visible.\n if (plain()) {\n values.style.width = \"\";\n setVisibleCount(Number.POSITIVE_INFINITY);\n return;\n }\n // Measuring releases a truncated first pill to its natural width; the\n // browser paints only the final state.\n values.dataset.measuring = \"true\";\n const pills = Array.from(\n values.querySelectorAll<HTMLElement>(\":scope > .k2b-choice-pill\"),\n (pill) => pill.getBoundingClientRect().width,\n );\n const fit = fitChoicePills(\n values.getBoundingClientRect().width,\n pills,\n Number.parseFloat(getComputedStyle(values).columnGap) || 0,\n moreRef?.isConnected ? moreRef.getBoundingClientRect().width : 0,\n );\n delete values.dataset.measuring;\n // Hidden pills leave the flow. While any are hidden the strip keeps the\n // whole row as its preferred width, so a container sized by its content\n // does not shrink with the collapse and grows back once it has room. The\n // strip still flexes to the trigger's width.\n values.style.width = fit.visible < pills.length ? `${fit.rowWidth}px` : \"\";\n setVisibleCount(fit.visible);\n };\n const resizeObserver = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(() => fitValues());\n onCleanup(() => resizeObserver?.disconnect());\n createEffect(() => {\n selected();\n fitValues();\n });\n onMount(() => {\n if (\"fonts\" in document) void document.fonts.ready.then(fitValues);\n });\n\n const emit = (next: readonly string[]) => {\n const unique = [...new Set(next)];\n commitFieldValue(props, unique);\n };\n const isSelected = (value: string) => selectedValues().has(value);\n const focusFirst = () => setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), -1, 1));\n const chooseGroup = (group: string | null) => {\n if (group === activeGroup()) return;\n setSelectedGroup(group);\n focusFirst();\n if (isAsync()) asyncOptions.load(query(), true);\n };\n const open = () => {\n if (props.disabled) return;\n setQuery(\"\");\n if (isAsync()) asyncOptions.load(\"\", true);\n focusFirst();\n popover.show();\n if (searchable()) queueMicrotask(() => searchRef?.focus());\n };\n const close = (restoreFocus = false) => {\n asyncOptions.cancel();\n setQuery(\"\");\n setFocusedIndex(-1);\n popover.hide(restoreFocus);\n };\n const toggleOption = (option: NormalizedOption) => {\n if (option.disabled) return;\n setCache({ ...cache(), [option.value]: option });\n emit(isSelected(option.value) ? values().filter((value) => value !== option.value) : [...values(), option.value]);\n };\n const remove = (value: string) => emit(values().filter((item) => item !== value));\n const move = (direction: 1 | -1) => {\n setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), focusedIndex(), direction));\n };\n const handleKeyDown = (event: KeyboardEvent) => {\n const inToolbar = Boolean((event.target as HTMLElement | null)?.closest?.(\".k2b-choice-toolbar\"));\n if (inToolbar && event.key !== \"Escape\" && event.key !== \"Tab\") return;\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!popover.open()) open();\n else move(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n }\n if ((event.key === \"Enter\" || event.key === \" \") && !popover.open()) {\n event.preventDefault();\n open();\n return;\n }\n if (event.key === \"Enter\" && popover.open()) {\n const option = focusedOption();\n if (option) {\n event.preventDefault();\n toggleOption(option);\n }\n return;\n }\n if (event.key === \"Backspace\" && popover.open() && !query() && values().length > 0) {\n event.preventDefault();\n const last = values().at(-1);\n if (last) remove(last);\n return;\n }\n if (event.key === \"Escape\" && popover.open()) {\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\" && popover.open()) {\n close();\n }\n };\n\n return (\n <Field\n class={props.class}\n label={props.label}\n description={props.description}\n error={error()}\n meta={meta}\n labelFor={false}\n required={props.required}\n disabled={props.disabled}\n >\n <div class=\"k2b-choice-control\" data-appearance={props.appearance ?? \"field\"} data-invalid={error() ? \"true\" : undefined}>\n <div\n ref={(element) => {\n popover.setTrigger(element);\n resizeObserver?.observe(element);\n }}\n id={meta.controlId}\n class=\"k2b-multi-select-trigger\"\n role=\"combobox\"\n tabIndex={props.disabled ? -1 : 0}\n aria-haspopup=\"listbox\"\n aria-expanded={popover.open()}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n {...fieldControlAria(meta, props)}\n aria-disabled={props.disabled}\n data-disabled={props.disabled ? \"true\" : undefined}\n onClick={() => (popover.open() ? close() : open())}\n onKeyDown={handleKeyDown}\n >\n <Show\n when={selected().length > 0}\n fallback={\n <>\n <Show when={props.placeholderIcon}>\n {(icon) => <i class={`${icon()} k2b-choice-trigger__placeholder-icon`} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-trigger__value\" data-placeholder=\"true\">\n {props.placeholder ?? messages().select}\n </span>\n </>\n }\n >\n <span\n ref={valuesRef}\n class=\"k2b-multi-select-trigger__values\"\n data-overflowing={hiddenOptions().length > 0 ? \"true\" : undefined}\n >\n <For each={selected()}>\n {(option, index) => (\n <span\n class=\"k2b-choice-pill\"\n style={colorTintStyle(option.color)}\n title={option.label}\n data-hidden={index() >= visibleCount() ? \"true\" : undefined}\n >\n <Show\n when={props.renderValue}\n fallback={\n <>\n <Show when={option.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span>{option.label}</span>\n </>\n }\n >\n {(render) => <span class=\"k2b-choice-pill__content\">{render()(option)}</span>}\n </Show>\n <Show when={!plain()}>\n <button\n type=\"button\"\n aria-label={selectMessages().removeNamed({ name: option.label })}\n disabled={props.disabled}\n tabIndex={-1}\n onClick={(event) => {\n event.stopPropagation();\n remove(option.value);\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n </span>\n )}\n </For>\n <Show when={selected().length > 1 && !plain()}>\n <span\n ref={(element) => {\n moreRef = element;\n resizeObserver?.observe(element);\n onCleanup(() => resizeObserver?.unobserve(element));\n }}\n class=\"k2b-multi-select-trigger__more\"\n title={\n hiddenOptions()\n .map((option) => option.label)\n .join(\", \") || undefined\n }\n data-hidden={hiddenOptions().length === 0 ? \"true\" : undefined}\n >\n <span aria-hidden=\"true\">+{moreCount()}</span>\n <span class=\"k2b-sr-only\">{selectMessages().moreSelected({ count: moreCount() })}</span>\n </span>\n </Show>\n </span>\n </Show>\n <Show when={!hasClearAction()}>\n <i\n class={`${popover.open() ? (props.activeIcon ?? \"ti ti-chevron-up\") : (props.icon ?? \"ti ti-chevron-down\")} k2b-multi-select-trigger__chevron`}\n aria-hidden=\"true\"\n />\n </Show>\n </div>\n <Show when={hasClearAction()}>\n <button\n type=\"button\"\n class=\"k2b-choice-control__clear k2b-input-clear-action\"\n aria-label={props.clearLabel ?? messages().clearSelection}\n onClick={(event) => {\n event.stopPropagation();\n emit([]);\n popover.trigger()?.focus();\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n\n <div\n ref={popover.setPopover}\n popover=\"manual\"\n class=\"k2b-choice-popover\"\n role=\"group\"\n onKeyDown={handleKeyDown}\n aria-label={typeof props.label === \"string\" ? props.label : (props[\"aria-label\"] ?? messages().options)}\n >\n <Show when={searchable()}>\n <div class=\"k2b-choice-search\">\n <i class=\"ti ti-search\" aria-hidden=\"true\" />\n <input\n ref={searchRef}\n type=\"search\"\n value={query()}\n placeholder={props.searchPlaceholder ?? messages().search}\n aria-label={props.searchPlaceholder ?? selectMessages().searchOptions}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n onInput={(event) => {\n const next = event.currentTarget.value;\n setQuery(next);\n if (isAsync()) asyncOptions.load(next);\n focusFirst();\n }}\n />\n </div>\n </Show>\n <Show when={(props.groups?.length ?? 0) > 0}>\n <div class=\"k2b-choice-toolbar\">\n <ChoiceGroups\n choices={groupChoices()}\n value={activeGroup()}\n onValueChange={chooseGroup}\n ariaLabel={props.groupsAriaLabel ?? selectMessages().filterOptions}\n controls={listboxId}\n />\n </div>\n </Show>\n <div id={listboxId} class=\"k2b-choice-options\" role=\"listbox\" aria-multiselectable=\"true\">\n <Show when={asyncOptions.error()}>\n {(message) => (\n <div class=\"k2b-choice-status\" data-tone=\"danger\">\n <span>{message()}</span>\n <button type=\"button\" onClick={asyncOptions.retry}>\n {props.retryLabel ?? messages().retry}\n </button>\n </div>\n )}\n </Show>\n <Show when={asyncOptions.loading() && visibleOptions().length === 0}>\n <div class=\"k2b-choice-status\">\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span>{props.loadingLabel ?? messages().loading}</span>\n </div>\n </Show>\n <For\n each={asyncOptions.error() ? [] : visibleOptions()}\n fallback={\n <Show when={!asyncOptions.loading() && !asyncOptions.error()}>\n <div class=\"k2b-choice-status\">\n {isAsync() || query()\n ? (props.noResultsLabel ?? messages().noResults)\n : (props.emptyLabel ?? selectMessages().noOptions)}\n </div>\n </Show>\n }\n >\n {(option, index) => (\n <button\n type=\"button\"\n id={`${listboxId}-${index()}`}\n class=\"k2b-choice-option\"\n role=\"option\"\n aria-label={option.label}\n aria-selected={isSelected(option.value)}\n data-focused={index() === focusedIndex() ? \"true\" : undefined}\n disabled={option.disabled}\n onPointerMove={() => !option.disabled && setFocusedIndex(index())}\n onClick={() => toggleOption(option)}\n >\n <span class=\"k2b-choice-option__checkbox\" aria-hidden=\"true\">\n <i class=\"ti ti-check\" />\n </span>\n <Show\n when={option.icon}\n fallback={\n <Show when={normalizeHexColor(option.color)}>\n {(color) => <span class=\"k2b-choice-dot\" style={{ background: color() }} aria-hidden=\"true\" />}\n </Show>\n }\n >\n {(icon) => <i class={icon()} style={iconColor(option.color)} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-option__content\">\n <Show\n when={props.renderOption}\n fallback={\n <>\n <strong>{option.label}</strong>\n {optionDescription(option)}\n </>\n }\n >\n {(render) => render()(option)}\n </Show>\n </span>\n </button>\n )}\n </For>\n </div>\n </div>\n <Show when={props.name}>{(name) => <input type=\"hidden\" name={name()} value={values().join(\",\")} />}</Show>\n </div>\n </Field>\n );\n}\n\nexport default MultiSelectInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC1G,SAAS,cAAc,EAAE,iBAAiB,QAAQ,mBAAmB;AACrE,SAAS,eAAe,EAAE,KAAK,EAAE,gBAAgB,QAAQ,mBAAmB;AAC5E,SAAS,iBAAiB,QAAQ,gCAAgC;AAClE,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAEE,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,QACjB,UAAU;AAEjB,SAAS,gBAAgB,EAAE,oBAAoB,QAAQ,kBAAkB;AAEzE,SAAS,iBAAiB,QAAQ,mBAAmB;AAgDrD;AACA,MAAM,SAAS,GAAI,KAAyB,IAAoC;EAC9E,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC;EAC3C,OAAO,UAAU,GAAG;IAAE,KAAK,EAAE;EAAW,CAAC,GAAG,SAAS;A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AA,iCAEK,MAAM,CAAC,KAAK,IACpB,iBAAiB,CAAC,MAAM,CAAC;UAAA;UAAA,UAI5B,MAAM,IAAK,MAAM,CAAC,CAAC,CAAC,MAAM;QAAC;MAIpC,gCAIN,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,IAAI;QAAA;QAAA,UAAI,IAAI,oDAAgC,IAAI,CAAC,CAAC,mDAAS,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;MAAI;IAAA;EAAA;AAI3G;AAEA,eAAe,gBAAgB","ignoreList":[]}
@@ -1,22 +1,26 @@
1
- import { ssr as _$ssr } from "solid-js/web";
2
- import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
3
1
  import { escape as _$escape } from "solid-js/web";
4
2
  import { createComponent as _$createComponent } from "solid-js/web";
3
+ import { ssr as _$ssr } from "solid-js/web";
4
+ import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
5
5
  import { memo as _$memo } from "solid-js/web";
6
- var _tmpl$ = ["<button", " type=\"button\" class=\"k2b-period-picker__trigger\" aria-haspopup=\"dialog\"", "", "><i class=\"ti ti-calendar\" aria-hidden=\"true\"></i><span class=\"k2b-period-picker__value\"", "><span", ">", "</span>", "</span><i", " aria-hidden=\"true\"></i></button>"],
7
- _tmpl$2 = ["<div", " class=\"k2b-period-picker__popover\" popover=\"auto\" role=\"dialog\"", ">", "</div>"],
8
- _tmpl$3 = ["<span class=\"k2b-period-picker__detail\"> · ", "</span>"],
9
- _tmpl$4 = ["<span aria-hidden=\"true\">", "</span>"],
10
- _tmpl$5 = ["<button type=\"button\" role=\"option\" class=\"k2b-dropdown__item k2b-period-picker__option k2b-period-picker__custom\"", "><span class=\"k2b-dropdown__copy\"><span>", "</span></span><span class=\"k2b-period-picker__hint\">", "</span><i class=\"ti ti-chevron-right k2b-dropdown__check\" aria-hidden=\"true\"></i></button>"],
11
- _tmpl$6 = ["<div class=\"k2b-period-picker__list\" role=\"listbox\"", ">", "", "</div>"],
12
- _tmpl$7 = ["<div class=\"k2b-period-picker__panel\"", ">", "", "</div>"],
13
- _tmpl$8 = ["<button type=\"button\" role=\"option\" class=\"k2b-dropdown__item k2b-period-picker__option\"", "><span class=\"k2b-dropdown__copy\"><span>", "</span></span><span class=\"k2b-period-picker__hint\">", "</span><i class=\"ti ti-check k2b-dropdown__check\" aria-hidden=\"true\"", "></i></button>"],
14
- _tmpl$9 = ["<div class=\"k2b-field k2b-period-picker__field\"", "><label class=\"k2b-field__label\"", ">", "</label><div class=\"k2b-input-shell\"><input", " class=\"k2b-input\" type=\"text\" inputmode=\"numeric\" autocomplete=\"off\" spellcheck=\"false\"", "></div><p class=\"k2b-period-picker__error\" id=\"", "\">", "</p></div>"],
15
- _tmpl$0 = ["<button type=\"button\" class=\"k2b-period-picker__back\"><i class=\"ti ti-chevron-left\" aria-hidden=\"true\"></i>", "</button>"],
16
- _tmpl$1 = "<i class=\"ti ti-hourglass-low\" aria-hidden=\"true\"></i>",
17
- _tmpl$10 = ["<div class=\"k2b-period-picker__editor\" role=\"group\"", ">", "<div class=\"k2b-period-picker__fields\">", "", "</div><div class=\"k2b-period-picker__months\">", "", "</div><div class=\"k2b-period-picker__actions\"><span class=\"k2b-date-duration\" aria-live=\"polite\">", "", "</span><button type=\"button\" class=\"k2b-date-apply\"", ">", "</button></div></div>"];
6
+ var _tmpl$ = ["<i", " aria-hidden=\"true\"></i>"],
7
+ _tmpl$2 = "<i class=\"ti ti-calendar\" aria-hidden=\"true\"></i>",
8
+ _tmpl$3 = ["<button", " type=\"button\" class=\"k2b-period-picker__trigger\" aria-haspopup=\"dialog\"", "", ">", "<span class=\"k2b-period-picker__value\"", "><span", ">", "</span>", "</span><i", " aria-hidden=\"true\"></i></button>"],
9
+ _tmpl$4 = ["<span class=\"k2b-period-picker__detail\"> · ", "</span>"],
10
+ _tmpl$5 = ["<span aria-hidden=\"true\">", "</span>"],
11
+ _tmpl$6 = ["<div class=\"k2b-period-picker__steps\">", "", "", "<button type=\"button\" class=\"k2b-period-picker__home\"", "", ">", "</button></div>"],
12
+ _tmpl$7 = ["<div", " class=\"k2b-period-picker__popover\" popover=\"auto\" role=\"dialog\"", ">", "</div>"],
13
+ _tmpl$8 = ["<button type=\"button\" role=\"option\" class=\"k2b-dropdown__item k2b-period-picker__option k2b-period-picker__custom\"", "><span class=\"k2b-dropdown__copy\"><span>", "</span></span><span class=\"k2b-period-picker__hint\">", "</span><i class=\"ti ti-chevron-right k2b-dropdown__check\" aria-hidden=\"true\"></i></button>"],
14
+ _tmpl$9 = ["<div class=\"k2b-period-picker__list\" role=\"listbox\"", ">", "", "</div>"],
15
+ _tmpl$0 = ["<div class=\"k2b-period-picker__panel\"", ">", "", "</div>"],
16
+ _tmpl$1 = ["<button type=\"button\" role=\"option\" class=\"k2b-dropdown__item k2b-period-picker__option\"", "><span class=\"k2b-dropdown__copy\"><span>", "</span></span><span class=\"k2b-period-picker__hint\">", "</span><i class=\"ti ti-check k2b-dropdown__check\" aria-hidden=\"true\"", "></i></button>"],
17
+ _tmpl$10 = ["<div class=\"k2b-field k2b-period-picker__field\"", "><label class=\"k2b-field__label\"", ">", "</label><div class=\"k2b-input-shell\"><input", " class=\"k2b-input\" type=\"text\" inputmode=\"numeric\" autocomplete=\"off\" spellcheck=\"false\"", "></div><p class=\"k2b-period-picker__error\" id=\"", "\">", "</p></div>"],
18
+ _tmpl$11 = ["<button type=\"button\" class=\"k2b-period-picker__back\"><i class=\"ti ti-chevron-left\" aria-hidden=\"true\"></i>", "</button>"],
19
+ _tmpl$12 = "<i class=\"ti ti-hourglass-low\" aria-hidden=\"true\"></i>",
20
+ _tmpl$13 = ["<div class=\"k2b-period-picker__editor\" role=\"group\"", ">", "<div class=\"k2b-period-picker__fields\">", "", "</div><div class=\"k2b-period-picker__months\">", "", "</div><div class=\"k2b-period-picker__actions\"><span class=\"k2b-date-duration\" aria-live=\"polite\">", "", "</span><button type=\"button\" class=\"k2b-date-apply\"", ">", "</button></div></div>"];
18
21
  import { dates } from "@k2b/stdlib";
19
22
  import { batch, createComputed, createEffect, createMemo, createSignal, For, on, onCleanup, Show } from "solid-js";
23
+ import { IconButton } from "../actions/Button";
20
24
  import { prefersMenuSheet } from "../actions/phone-sheet";
21
25
  import { createFieldMeta, Field, fieldDescribedBy } from "../internal/field";
22
26
  import { returnFocus, ringOnReturn } from "../internal/focus-return";
@@ -25,15 +29,43 @@ import { useUiMessages } from "../intl/messages";
25
29
  import { DatePickerPanel } from "./DatePicker";
26
30
  import { dateInputPattern, formatDateInput, parseDateInput } from "./date-input";
27
31
  import { resolveDateInputMessages } from "./date-input-messages";
28
- import { errorText } from "./date-input-status";
32
+ import { errorText, limitErrorText } from "./date-input-status";
29
33
  import { parseDateValue, pickRangeDay, previewRange, rangeAnchor } from "./date-picker";
30
34
  import { commitFieldValue, resolveMaybeAccessor } from "./field-contract";
31
- import { formatPeriodDays, formatPeriodRange, periodContext, periodDayCount, widePeriodRangeSample } from "./period";
35
+ import { addPeriodDays, currentPeriodOf, formatPeriodDays, formatPeriodRange, formatPeriodUnit, periodContext, periodDayCount, periodKind, periodStep, stepPeriod, widePeriodRangeSample } from "./period";
32
36
  import { builtInPresetLabel, usePeriodPickerMessages } from "./period-picker-messages";
33
37
  /** Two months side by side need room for the list and both calendars. */
34
38
  const TWO_MONTHS_QUERY = "(min-width: 56rem)";
35
39
  const presetLabel = (preset, t) => preset.label ?? builtInPresetLabel(t, preset.key) ?? preset.key;
36
40
 
41
+ /** The link back to the current period names it by kind: "This week", "This month", or "Current period". */
42
+ const homeLabels = t => ({
43
+ day: t.today,
44
+ week: t["this-week"],
45
+ month: t["this-month"],
46
+ quarter: t["this-quarter"],
47
+ year: t["this-year"],
48
+ range: t.currentPeriod
49
+ });
50
+
51
+ /** Every month of today's year and the week that crosses into the next year: the widest texts a step can show. */
52
+ const unitSamples = (today, weekStartsOn) => {
53
+ const year = Number(today.slice(0, 4));
54
+ const months = Array.from({
55
+ length: 12
56
+ }, (_, month) => ({
57
+ start: `${year}-${String(month + 1).padStart(2, "0")}-01`,
58
+ end: new Date(Date.UTC(year, month + 1, 0)).toISOString().slice(0, 10)
59
+ }));
60
+ const lastDay = `${year}-12-31`;
61
+ const weekday = new Date(`${lastDay}T00:00:00Z`).getUTCDay();
62
+ const weekStart = addPeriodDays(lastDay, -((weekday - weekStartsOn + 7) % 7));
63
+ return [...months, {
64
+ start: weekStart,
65
+ end: addPeriodDays(weekStart, 6)
66
+ }];
67
+ };
68
+
37
69
  /** Places the popover under (or over) the trigger; it grows toward the side with room, right-aligned near the right edge. */
38
70
  const placePeriodPopover = (trigger, popover) => {
39
71
  const margin = 8;
@@ -89,12 +121,31 @@ export function PeriodPicker(props) {
89
121
  label: presetLabel(preset, t()),
90
122
  detail: formatPeriodDays(preset.resolve(context()), context().today, locale(), since)
91
123
  });
92
- const rangeText = range => ({
124
+ const numericRangeText = range => ({
93
125
  label: formatPeriodRange(range, locale()),
94
126
  detail: t().days({
95
127
  count: periodDayCount(range)
96
128
  })
97
129
  });
130
+ // A picker that steps names a calendar week, month or year as such: "9.–15. Nov. 2026", "Oktober 2026".
131
+ const rangeText = range => {
132
+ const unit = props.steps ? formatPeriodUnit(range, context().weekStartsOn, locale()) : undefined;
133
+ return unit ? {
134
+ label: unit,
135
+ detail: ""
136
+ } : numericRangeText(range);
137
+ };
138
+ const triggerPresetText = preset => {
139
+ const days = preset.resolve(context());
140
+ const unit = props.steps && preset.key !== "all" && days.start && days.end ? formatPeriodUnit({
141
+ start: days.start,
142
+ end: days.end
143
+ }, context().weekStartsOn, locale()) : undefined;
144
+ return unit ? {
145
+ label: unit,
146
+ detail: ""
147
+ } : presetText(preset);
148
+ };
98
149
  const selectedPreset = () => {
99
150
  const current = value();
100
151
  return current && "preset" in current ? props.presets.find(preset => preset.key === current.preset) : undefined;
@@ -104,13 +155,103 @@ export function PeriodPicker(props) {
104
155
  if (!selected) return undefined;
105
156
  if ("preset" in selected) {
106
157
  const preset = selectedPreset();
107
- return preset ? presetText(preset) : undefined;
158
+ return preset ? triggerPresetText(preset) : undefined;
108
159
  }
109
160
  return rangeText(selected);
110
161
  });
111
162
  const joined = text => text.detail ? `${text.label} · ${text.detail}` : text.label;
112
163
  // Every text the trigger can show shares one grid cell, so it keeps the widest one's width.
113
- const widths = createMemo(() => [...props.presets.map(preset => joined(presetText(preset))), ...(custom() ? [joined(rangeText(widePeriodRangeSample(context().today)))] : []), t().choosePeriod]);
164
+ const widths = createMemo(() => [...props.presets.map(preset => joined(triggerPresetText(preset))), ...(custom() || props.steps ? [joined(numericRangeText(widePeriodRangeSample(context().today)))] : []), ...(props.steps ? unitSamples(context().today, context().weekStartsOn).map(range => joined(rangeText(range))) : []), t().choosePeriod]);
165
+
166
+ // Stepping: the resolved days of the value, its neighbours, and the current period of the same kind.
167
+ const range = createMemo(() => {
168
+ const selected = value();
169
+ if (!selected) return undefined;
170
+ if (!("preset" in selected)) return selected;
171
+ if (selected.preset === "all") return undefined;
172
+ const resolved = selectedPreset()?.resolve(context());
173
+ return resolved?.start && resolved.end ? {
174
+ start: resolved.start,
175
+ end: resolved.end
176
+ } : undefined;
177
+ });
178
+ const step = createMemo(() => {
179
+ const days = range();
180
+ return days ? periodStep(days) : undefined;
181
+ });
182
+ const neighbour = count => {
183
+ const days = range();
184
+ const by = step();
185
+ return days && by ? stepPeriod(days, by, count) : undefined;
186
+ };
187
+ /** Why an arrow cannot step: the neighbour lies wholly before `min` or after `max`. */
188
+ const boundReason = count => {
189
+ const next = neighbour(count);
190
+ if (!next) return undefined;
191
+ if (count < 0 && props.min && next.end < props.min) return t().nothingBefore({
192
+ date: formatDateInput(props.min, locale())
193
+ });
194
+ if (count > 0 && props.max && next.start > props.max) return t().nothingAfter({
195
+ date: formatDateInput(props.max, locale())
196
+ });
197
+ return undefined;
198
+ };
199
+ const home = createMemo(() => {
200
+ const days = range();
201
+ const by = step();
202
+ return days && by ? currentPeriodOf(days, by, context().today) : undefined;
203
+ });
204
+ const atHome = () => {
205
+ const days = range();
206
+ const current = home();
207
+ return !days || !current || days.start === current.start && days.end === current.end;
208
+ };
209
+ const kind = () => {
210
+ const days = range();
211
+ return days ? periodKind(days, context().weekStartsOn) : "range";
212
+ };
213
+ const homeLabel = of => homeLabels(t())[of];
214
+ /** A step that lands on a preset's days stores the preset, so "This week" stays relative. */
215
+ const valueFor = days => {
216
+ const preset = props.presets.find(candidate => {
217
+ if (candidate.key === "all") return false;
218
+ const resolved = candidate.resolve(context());
219
+ return resolved.start === days.start && resolved.end === days.end;
220
+ });
221
+ return preset ? {
222
+ preset: preset.key
223
+ } : days;
224
+ };
225
+ const stepBy = count => {
226
+ const next = neighbour(count);
227
+ if (!next || disabled() || boundReason(count)) return;
228
+ commitFieldValue(props, valueFor(next));
229
+ };
230
+ const goHome = () => {
231
+ const current = home();
232
+ if (current && !disabled()) commitFieldValue(props, valueFor(current));
233
+ };
234
+ const stepButton = count => {
235
+ const reason = () => boundReason(count);
236
+ const name = () => count < 0 ? t().previousPeriod : t().nextPeriod;
237
+ return _$createComponent(IconButton, {
238
+ variant: "ghost",
239
+ size: "xs",
240
+ get label() {
241
+ return _$memo(() => !!reason())() ? `${name()}: ${reason()}` : name();
242
+ },
243
+ get ["aria-disabled"]() {
244
+ return reason() ? "true" : undefined;
245
+ },
246
+ get disabled() {
247
+ return disabled() || !step();
248
+ },
249
+ onClick: () => stepBy(count),
250
+ get children() {
251
+ return _$ssr(_tmpl$, _$ssrAttribute("class", count < 0 ? "ti ti-chevron-left" : "ti ti-chevron-right", false));
252
+ }
253
+ });
254
+ };
114
255
  const [open, setOpen] = createSignal(false);
115
256
  const [view, setView] = createSignal("list");
116
257
  const [sheetOpen, setSheetOpen] = createSignal(false);
@@ -198,6 +339,12 @@ export function PeriodPicker(props) {
198
339
  get label() {
199
340
  return props["aria-label"] ?? t().period;
200
341
  },
342
+ get min() {
343
+ return props.min;
344
+ },
345
+ get max() {
346
+ return props.max;
347
+ },
201
348
  onPick: closeSheet
202
349
  })
203
350
  });
@@ -221,6 +368,34 @@ export function PeriodPicker(props) {
221
368
  });
222
369
  };
223
370
  const name = () => props.label ? undefined : `${props["aria-label"] ?? t().period}: ${current() ? joined(current()) : t().choosePeriod}`;
371
+ const triggerButton = _$ssr(_tmpl$3, _$ssrAttribute("id", _$escape(meta.controlId, true), false), _$ssrAttribute("aria-expanded", _$escape(open() || sheetOpen(), true), false) + _$ssrAttribute("aria-controls", sheetOpen() ? _$escape(sheetId, true) : _$escape(popoverId, true), false) + _$ssrAttribute("aria-label", _$escape(name(), true), false) + _$ssrAttribute("aria-labelledby", props.label ? `${_$escape(meta.labelId, true)} ${_$escape(valueId, true)}` : _$escape(undefined, true), false) + _$ssrAttribute("aria-describedby", _$escape(fieldDescribedBy(meta, props), true), false) + _$ssrAttribute("aria-invalid", resolveMaybeAccessor(props.error) ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-busy", props.loading ? "true" : _$escape(undefined, true), false), _$ssrAttribute("disabled", disabled(), true), _$escape(_$createComponent(Show, {
372
+ get when() {
373
+ return !props.steps;
374
+ },
375
+ get children() {
376
+ return _$ssr(_tmpl$2);
377
+ }
378
+ })), _$ssrAttribute("data-placeholder", current() ? _$escape(undefined, true) : "true", false), _$ssrAttribute("id", _$escape(valueId, true), false), _$escape(_$createComponent(Show, {
379
+ get when() {
380
+ return current();
381
+ },
382
+ get fallback() {
383
+ return t().choosePeriod;
384
+ },
385
+ children: text => [text().label, _$createComponent(Show, {
386
+ get when() {
387
+ return text().detail;
388
+ },
389
+ get children() {
390
+ return _$ssr(_tmpl$4, _$escape(text().detail));
391
+ }
392
+ })]
393
+ })), _$escape(_$createComponent(For, {
394
+ get each() {
395
+ return widths();
396
+ },
397
+ children: text => _$ssr(_tmpl$5, _$escape(text))
398
+ })), _$ssrAttribute("class", props.loading ? "ti ti-loader-2 k2b-spin" : "ti ti-chevron-down", false));
224
399
  return _$createComponent(Field, {
225
400
  get ["class"]() {
226
401
  return `k2b-period-picker ${props.class ?? ""}`;
@@ -242,27 +417,15 @@ export function PeriodPicker(props) {
242
417
  return disabled();
243
418
  },
244
419
  get children() {
245
- return [_$ssr(_tmpl$, _$ssrAttribute("id", _$escape(meta.controlId, true), false), _$ssrAttribute("aria-expanded", _$escape(open() || sheetOpen(), true), false) + _$ssrAttribute("aria-controls", sheetOpen() ? _$escape(sheetId, true) : _$escape(popoverId, true), false) + _$ssrAttribute("aria-label", _$escape(name(), true), false) + _$ssrAttribute("aria-labelledby", props.label ? `${_$escape(meta.labelId, true)} ${_$escape(valueId, true)}` : _$escape(undefined, true), false) + _$ssrAttribute("aria-describedby", _$escape(fieldDescribedBy(meta, props), true), false) + _$ssrAttribute("aria-invalid", resolveMaybeAccessor(props.error) ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-busy", props.loading ? "true" : _$escape(undefined, true), false), _$ssrAttribute("disabled", disabled(), true), _$ssrAttribute("data-placeholder", current() ? _$escape(undefined, true) : "true", false), _$ssrAttribute("id", _$escape(valueId, true), false), _$escape(_$createComponent(Show, {
420
+ return [_$createComponent(Show, {
246
421
  get when() {
247
- return current();
248
- },
249
- get fallback() {
250
- return t().choosePeriod;
422
+ return props.steps;
251
423
  },
252
- children: text => [text().label, _$createComponent(Show, {
253
- get when() {
254
- return text().detail;
255
- },
256
- get children() {
257
- return _$ssr(_tmpl$3, _$escape(text().detail));
258
- }
259
- })]
260
- })), _$escape(_$createComponent(For, {
261
- get each() {
262
- return widths();
263
- },
264
- children: text => _$ssr(_tmpl$4, _$escape(text))
265
- })), _$ssrAttribute("class", props.loading ? "ti ti-loader-2 k2b-spin" : "ti ti-chevron-down", false)), _$ssr(_tmpl$2, _$ssrAttribute("id", _$escape(popoverId, true), false), _$ssrAttribute("aria-label", _$escape(props["aria-label"] ?? (typeof props.label === "string" ? props.label : t().period), true), false), _$escape(_$createComponent(Show, {
424
+ fallback: triggerButton,
425
+ get children() {
426
+ return _$ssr(_tmpl$6, _$escape(stepButton(-1)), _$escape(stepButton(1)), _$escape(triggerButton), _$ssrAttribute("hidden", atHome(), true), _$ssrAttribute("disabled", disabled(), true), _$escape(homeLabel(kind())));
427
+ }
428
+ }), _$ssr(_tmpl$7, _$ssrAttribute("id", _$escape(popoverId, true), false), _$ssrAttribute("aria-label", _$escape(props["aria-label"] ?? (typeof props.label === "string" ? props.label : t().period), true), false), _$escape(_$createComponent(Show, {
266
429
  get when() {
267
430
  return open();
268
431
  },
@@ -286,6 +449,12 @@ export function PeriodPicker(props) {
286
449
  get label() {
287
450
  return props["aria-label"] ?? t().period;
288
451
  },
452
+ get min() {
453
+ return props.min;
454
+ },
455
+ get max() {
456
+ return props.max;
457
+ },
289
458
  onPick: pick
290
459
  });
291
460
  }
@@ -341,25 +510,25 @@ function PeriodPanel(props) {
341
510
  // In the sheet the list goes away with the focused option; focus continues on the calendar's day.
342
511
  if (props.sheet) queueMicrotask(() => panel?.querySelector('[data-date-focus="true"]')?.focus());
343
512
  };
344
- return _$ssr(_tmpl$7, _$ssrAttribute("data-view", _$escape(view(), true), false) + _$ssrAttribute("data-sheet", props.sheet ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
513
+ return _$ssr(_tmpl$0, _$ssrAttribute("data-view", _$escape(view(), true), false) + _$ssrAttribute("data-sheet", props.sheet ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
345
514
  get when() {
346
515
  return !props.sheet || view() === "list";
347
516
  },
348
517
  get children() {
349
- return _$ssr(_tmpl$6, _$ssrAttribute("aria-label", _$escape(props.label, true), false), _$escape(_$createComponent(For, {
518
+ return _$ssr(_tmpl$9, _$ssrAttribute("aria-label", _$escape(props.label, true), false), _$escape(_$createComponent(For, {
350
519
  get each() {
351
520
  return props.presets;
352
521
  },
353
522
  children: (preset, index) => {
354
523
  const text = () => props.presetText(preset);
355
- return _$ssr(_tmpl$8, _$ssrAttribute("data-option-index", _$escape(index(), true), false) + _$ssrAttribute("aria-selected", isSelected(preset) && _$escape(view(), true) === "list", false) + _$ssrAttribute("tabindex", active() === index() ? 0 : -1, false), _$escape(text().label), _$escape(text().detail), _$ssrAttribute("data-hidden", isSelected(preset) && view() === "list" ? _$escape(undefined, true) : "true", false));
524
+ return _$ssr(_tmpl$1, _$ssrAttribute("data-option-index", _$escape(index(), true), false) + _$ssrAttribute("aria-selected", isSelected(preset) && _$escape(view(), true) === "list", false) + _$ssrAttribute("tabindex", active() === index() ? 0 : -1, false), _$escape(text().label), _$escape(text().detail), _$ssrAttribute("data-hidden", isSelected(preset) && view() === "list" ? _$escape(undefined, true) : "true", false));
356
525
  }
357
526
  })), _$escape(_$createComponent(Show, {
358
527
  get when() {
359
528
  return props.custom;
360
529
  },
361
530
  get children() {
362
- return _$ssr(_tmpl$5, _$ssrAttribute("data-option-index", _$escape(props.presets.length, true), false) + _$ssrAttribute("aria-selected", _$escape(view() === "custom" || Boolean(explicit()), true), false) + _$ssrAttribute("tabindex", active() === props.presets.length ? 0 : -1, false), _$escape(t().custom), explicit() ? _$escape(props.rangeText(explicit()).label) : "");
531
+ return _$ssr(_tmpl$8, _$ssrAttribute("data-option-index", _$escape(props.presets.length, true), false) + _$ssrAttribute("aria-selected", _$escape(view() === "custom" || Boolean(explicit()), true), false) + _$ssrAttribute("tabindex", active() === props.presets.length ? 0 : -1, false), _$escape(t().custom), explicit() ? _$escape(props.rangeText(explicit()).label) : "");
363
532
  }
364
533
  })));
365
534
  }
@@ -391,6 +560,12 @@ function PeriodPanel(props) {
391
560
  get sheet() {
392
561
  return props.sheet;
393
562
  },
563
+ get min() {
564
+ return props.min;
565
+ },
566
+ get max() {
567
+ return props.max;
568
+ },
394
569
  onBack: () => {
395
570
  setView("list");
396
571
  focusOption(props.presets.length);
@@ -470,6 +645,14 @@ function RangeEditor(props) {
470
645
  setError(errorText(result.error, locale(), inputT(), props.today));
471
646
  return undefined;
472
647
  }
648
+ const limit = limitErrorText(result.date, {
649
+ min: props.min,
650
+ max: props.max
651
+ }, locale(), inputT());
652
+ if (limit) {
653
+ setError(limit);
654
+ return undefined;
655
+ }
473
656
  setError("");
474
657
  return result.date;
475
658
  };
@@ -526,13 +709,13 @@ function RangeEditor(props) {
526
709
  end: range.end
527
710
  }).detail : "";
528
711
  };
529
- const field = fieldProps => _$ssr(_tmpl$9, _$ssrAttribute("data-invalid", fieldProps.error() ? "true" : _$escape(undefined, true), false), _$ssrAttribute("for", _$escape(fieldProps.id, true), false), _$escape(fieldProps.label), _$ssrAttribute("id", _$escape(fieldProps.id, true), false), _$ssrAttribute("placeholder", _$escape(placeholder(), true), false) + _$ssrAttribute("value", _$escape(fieldProps.text(), true), false) + _$ssrAttribute("aria-invalid", fieldProps.error() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-describedby", fieldProps.error() ? `${_$escape(fieldProps.id, true)}-error` : _$escape(undefined, true), false), `${_$escape(fieldProps.id, true)}-error`, _$escape(fieldProps.error()));
530
- return _$ssr(_tmpl$10, _$ssrAttribute("aria-label", _$escape(t().custom, true), false), _$escape(_$createComponent(Show, {
712
+ const field = fieldProps => _$ssr(_tmpl$10, _$ssrAttribute("data-invalid", fieldProps.error() ? "true" : _$escape(undefined, true), false), _$ssrAttribute("for", _$escape(fieldProps.id, true), false), _$escape(fieldProps.label), _$ssrAttribute("id", _$escape(fieldProps.id, true), false), _$ssrAttribute("placeholder", _$escape(placeholder(), true), false) + _$ssrAttribute("value", _$escape(fieldProps.text(), true), false) + _$ssrAttribute("aria-invalid", fieldProps.error() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-describedby", fieldProps.error() ? `${_$escape(fieldProps.id, true)}-error` : _$escape(undefined, true), false), `${_$escape(fieldProps.id, true)}-error`, _$escape(fieldProps.error()));
713
+ return _$ssr(_tmpl$13, _$ssrAttribute("aria-label", _$escape(t().custom, true), false), _$escape(_$createComponent(Show, {
531
714
  get when() {
532
715
  return props.sheet;
533
716
  },
534
717
  get children() {
535
- return _$ssr(_tmpl$0, _$escape(t().backToPresets));
718
+ return _$ssr(_tmpl$11, _$escape(t().backToPresets));
536
719
  }
537
720
  })), _$escape(field({
538
721
  id: startId,
@@ -556,6 +739,12 @@ function RangeEditor(props) {
556
739
  get dateConfig() {
557
740
  return config();
558
741
  },
742
+ get min() {
743
+ return props.min;
744
+ },
745
+ get max() {
746
+ return props.max;
747
+ },
559
748
  get nav() {
560
749
  return twoMonths() ? "previous" : "both";
561
750
  },
@@ -579,6 +768,12 @@ function RangeEditor(props) {
579
768
  get dateConfig() {
580
769
  return config();
581
770
  },
771
+ get min() {
772
+ return props.min;
773
+ },
774
+ get max() {
775
+ return props.max;
776
+ },
582
777
  nav: "next",
583
778
  hideOutside: true,
584
779
  isShown: isShown,
@@ -590,7 +785,7 @@ function RangeEditor(props) {
590
785
  return _$memo(() => !!shown().start)() && shown().end;
591
786
  },
592
787
  get children() {
593
- return _$ssr(_tmpl$1);
788
+ return _$ssr(_tmpl$12);
594
789
  }
595
790
  })), _$escape(status()), _$ssrAttribute("disabled", !complete(), true), _$escape(ui().apply));
596
791
  }