@bikdotai/bik-component-library 0.0.868-beta.9 → 0.0.868

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 (218) hide show
  1. package/README.md +0 -3
  2. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  3. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  4. package/dist/cjs/components/bik-copilot/BIKCopilot.js +2 -0
  5. package/dist/cjs/components/bik-copilot/BIKCopilot.js.map +1 -0
  6. package/dist/cjs/components/bik-copilot/ControlledCopilot.js +2 -0
  7. package/dist/cjs/components/bik-copilot/ControlledCopilot.js.map +1 -0
  8. package/dist/cjs/components/bik-copilot/ControlledCopilot.styled.js +27 -0
  9. package/dist/cjs/components/bik-copilot/ControlledCopilot.styled.js.map +1 -0
  10. package/dist/cjs/components/bik-copilot/CopilotBall.js +2 -0
  11. package/dist/cjs/components/bik-copilot/CopilotBall.js.map +1 -0
  12. package/dist/cjs/components/bik-copilot/CopilotBall.styled.js +42 -0
  13. package/dist/cjs/components/bik-copilot/CopilotBall.styled.js.map +1 -0
  14. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.js +2 -0
  15. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.js.map +1 -0
  16. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.styled.js +108 -0
  17. package/dist/cjs/components/bik-copilot/CopilotFeedbackModal.styled.js.map +1 -0
  18. package/dist/cjs/components/bik-copilot/CopilotPanel.js +2 -0
  19. package/dist/cjs/components/bik-copilot/CopilotPanel.js.map +1 -0
  20. package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js +534 -0
  21. package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js.map +1 -0
  22. package/dist/cjs/components/bik-copilot/copilotPlacement.js +2 -0
  23. package/dist/cjs/components/bik-copilot/copilotPlacement.js.map +1 -0
  24. package/dist/cjs/components/bik-copilot/copilotRegenerate.js +2 -0
  25. package/dist/cjs/components/bik-copilot/copilotRegenerate.js.map +1 -0
  26. package/dist/cjs/components/bik-copilot/services/copilotDb.js +2 -0
  27. package/dist/cjs/components/bik-copilot/services/copilotDb.js.map +1 -0
  28. package/dist/cjs/components/bik-copilot/services/copilotFeedbackClient.js +2 -0
  29. package/dist/cjs/components/bik-copilot/services/copilotFeedbackClient.js.map +1 -0
  30. package/dist/cjs/components/bik-copilot/services/copilotIcebreakersClient.js +2 -0
  31. package/dist/cjs/components/bik-copilot/services/copilotIcebreakersClient.js.map +1 -0
  32. package/dist/cjs/components/bik-copilot/services/copilotMessagesClient.js +2 -0
  33. package/dist/cjs/components/bik-copilot/services/copilotMessagesClient.js.map +1 -0
  34. package/dist/cjs/components/bik-copilot/services/copilotPageSession.js +2 -0
  35. package/dist/cjs/components/bik-copilot/services/copilotPageSession.js.map +1 -0
  36. package/dist/cjs/components/bik-copilot/services/copilotSseParser.js +7 -0
  37. package/dist/cjs/components/bik-copilot/services/copilotSseParser.js.map +1 -0
  38. package/dist/cjs/components/bik-copilot/services/copilotStreamClient.js +2 -0
  39. package/dist/cjs/components/bik-copilot/services/copilotStreamClient.js.map +1 -0
  40. package/dist/cjs/components/bik-copilot/useCopilotIcebreakers.js +2 -0
  41. package/dist/cjs/components/bik-copilot/useCopilotIcebreakers.js.map +1 -0
  42. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js +2 -0
  43. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js.map +1 -0
  44. package/dist/cjs/components/bik-copilot/useDraggableFloater.js +2 -0
  45. package/dist/cjs/components/bik-copilot/useDraggableFloater.js.map +1 -0
  46. package/dist/cjs/components/bik-copilot/utils/markdown.js +4 -0
  47. package/dist/cjs/components/bik-copilot/utils/markdown.js.map +1 -0
  48. package/dist/cjs/components/bik-copilot/utils/toolCtas.js +2 -0
  49. package/dist/cjs/components/bik-copilot/utils/toolCtas.js.map +1 -0
  50. package/dist/cjs/components/button/themes.js +2 -2
  51. package/dist/cjs/components/button/themes.js.map +1 -1
  52. package/dist/cjs/components/datePicker/DatePickerWrapper.js +1 -1
  53. package/dist/cjs/components/datePicker/DatePickerWrapper.js.map +1 -1
  54. package/dist/cjs/index.js +1 -1
  55. package/dist/esm/components/agent-builder/constants/tools.d.ts +1 -0
  56. package/dist/esm/components/agent-builder/constants/tools.js +18 -18
  57. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  58. package/dist/esm/components/bik-copilot/BIKCopilot.d.ts +31 -0
  59. package/dist/esm/components/bik-copilot/BIKCopilot.js +118 -0
  60. package/dist/esm/components/bik-copilot/BIKCopilot.js.map +1 -0
  61. package/dist/esm/components/bik-copilot/ControlledCopilot.d.ts +14 -0
  62. package/dist/esm/components/bik-copilot/ControlledCopilot.js +174 -0
  63. package/dist/esm/components/bik-copilot/ControlledCopilot.js.map +1 -0
  64. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.d.ts +7 -0
  65. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.js +31 -0
  66. package/dist/esm/components/bik-copilot/ControlledCopilot.styled.js.map +1 -0
  67. package/dist/esm/components/bik-copilot/CopilotBall.d.ts +13 -0
  68. package/dist/esm/components/bik-copilot/CopilotBall.js +50 -0
  69. package/dist/esm/components/bik-copilot/CopilotBall.js.map +1 -0
  70. package/dist/esm/components/bik-copilot/CopilotBall.styled.d.ts +9 -0
  71. package/dist/esm/components/bik-copilot/CopilotBall.styled.js +46 -0
  72. package/dist/esm/components/bik-copilot/CopilotBall.styled.js.map +1 -0
  73. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.d.ts +29 -0
  74. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.js +73 -0
  75. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.js.map +1 -0
  76. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.styled.d.ts +12 -0
  77. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.styled.js +122 -0
  78. package/dist/esm/components/bik-copilot/CopilotFeedbackModal.styled.js.map +1 -0
  79. package/dist/esm/components/bik-copilot/CopilotPanel.d.ts +9 -0
  80. package/dist/esm/components/bik-copilot/CopilotPanel.js +536 -0
  81. package/dist/esm/components/bik-copilot/CopilotPanel.js.map +1 -0
  82. package/dist/esm/components/bik-copilot/CopilotPanel.styled.d.ts +67 -0
  83. package/dist/esm/components/bik-copilot/CopilotPanel.styled.js +573 -0
  84. package/dist/esm/components/bik-copilot/CopilotPanel.styled.js.map +1 -0
  85. package/dist/esm/components/bik-copilot/copilotPlacement.d.ts +24 -0
  86. package/dist/esm/components/bik-copilot/copilotPlacement.js +38 -0
  87. package/dist/esm/components/bik-copilot/copilotPlacement.js.map +1 -0
  88. package/dist/esm/components/bik-copilot/copilotRegenerate.d.ts +22 -0
  89. package/dist/esm/components/bik-copilot/copilotRegenerate.js +6 -0
  90. package/dist/esm/components/bik-copilot/copilotRegenerate.js.map +1 -0
  91. package/dist/esm/components/bik-copilot/index.d.ts +19 -0
  92. package/dist/esm/components/bik-copilot/model.d.ts +804 -0
  93. package/dist/esm/components/bik-copilot/services/copilotDb.d.ts +90 -0
  94. package/dist/esm/components/bik-copilot/services/copilotDb.js +96 -0
  95. package/dist/esm/components/bik-copilot/services/copilotDb.js.map +1 -0
  96. package/dist/esm/components/bik-copilot/services/copilotFeedbackClient.d.ts +15 -0
  97. package/dist/esm/components/bik-copilot/services/copilotFeedbackClient.js +55 -0
  98. package/dist/esm/components/bik-copilot/services/copilotFeedbackClient.js.map +1 -0
  99. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.d.ts +11 -0
  100. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.js +54 -0
  101. package/dist/esm/components/bik-copilot/services/copilotIcebreakersClient.js.map +1 -0
  102. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.d.ts +23 -0
  103. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.js +78 -0
  104. package/dist/esm/components/bik-copilot/services/copilotMessagesClient.js.map +1 -0
  105. package/dist/esm/components/bik-copilot/services/copilotPageSession.d.ts +37 -0
  106. package/dist/esm/components/bik-copilot/services/copilotPageSession.js +35 -0
  107. package/dist/esm/components/bik-copilot/services/copilotPageSession.js.map +1 -0
  108. package/dist/esm/components/bik-copilot/services/copilotSseParser.d.ts +22 -0
  109. package/dist/esm/components/bik-copilot/services/copilotSseParser.js +52 -0
  110. package/dist/esm/components/bik-copilot/services/copilotSseParser.js.map +1 -0
  111. package/dist/esm/components/bik-copilot/services/copilotStreamClient.d.ts +35 -0
  112. package/dist/esm/components/bik-copilot/services/copilotStreamClient.js +110 -0
  113. package/dist/esm/components/bik-copilot/services/copilotStreamClient.js.map +1 -0
  114. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.d.ts +17 -0
  115. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.js +60 -0
  116. package/dist/esm/components/bik-copilot/useCopilotIcebreakers.js.map +1 -0
  117. package/dist/esm/components/bik-copilot/useCopilotStreamChat.d.ts +20 -0
  118. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js +377 -0
  119. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js.map +1 -0
  120. package/dist/esm/components/bik-copilot/useDraggableFloater.d.ts +9 -0
  121. package/dist/esm/components/bik-copilot/useDraggableFloater.js +118 -0
  122. package/dist/esm/components/bik-copilot/useDraggableFloater.js.map +1 -0
  123. package/dist/esm/components/bik-copilot/utils/markdown.d.ts +1 -0
  124. package/dist/esm/components/bik-copilot/utils/markdown.js +48 -0
  125. package/dist/esm/components/bik-copilot/utils/markdown.js.map +1 -0
  126. package/dist/esm/components/bik-copilot/utils/toolCtas.d.ts +6 -0
  127. package/dist/esm/components/bik-copilot/utils/toolCtas.js +27 -0
  128. package/dist/esm/components/bik-copilot/utils/toolCtas.js.map +1 -0
  129. package/dist/esm/components/button/themes.js +1 -2
  130. package/dist/esm/components/button/themes.js.map +1 -1
  131. package/dist/esm/components/datePicker/DatePickerWrapper.d.ts +0 -7
  132. package/dist/esm/components/datePicker/DatePickerWrapper.js +64 -66
  133. package/dist/esm/components/datePicker/DatePickerWrapper.js.map +1 -1
  134. package/dist/esm/components/datePicker/index.d.ts +0 -1
  135. package/dist/esm/index.d.ts +1 -3
  136. package/dist/esm/index.js +844 -828
  137. package/dist/esm/index.js.map +1 -1
  138. package/package.json +1 -1
  139. package/dist/cjs/components/chip-selector/ChipSelector.js +0 -2
  140. package/dist/cjs/components/chip-selector/ChipSelector.js.map +0 -1
  141. package/dist/cjs/components/chip-selector/ChipSelector.styled.js +0 -36
  142. package/dist/cjs/components/chip-selector/ChipSelector.styled.js.map +0 -1
  143. package/dist/cjs/components/chip-selector/ChipSelectorGroup.js +0 -2
  144. package/dist/cjs/components/chip-selector/ChipSelectorGroup.js.map +0 -1
  145. package/dist/cjs/components/combo-box/ComboBox.js +0 -2
  146. package/dist/cjs/components/combo-box/ComboBox.js.map +0 -1
  147. package/dist/cjs/components/combo-box/ComboBox.styled.js +0 -33
  148. package/dist/cjs/components/combo-box/ComboBox.styled.js.map +0 -1
  149. package/dist/cjs/components/schedule-builder/RefreshSegmentToggle.js +0 -2
  150. package/dist/cjs/components/schedule-builder/RefreshSegmentToggle.js.map +0 -1
  151. package/dist/cjs/components/schedule-builder/ScheduleBuilder.js +0 -2
  152. package/dist/cjs/components/schedule-builder/ScheduleBuilder.js.map +0 -1
  153. package/dist/cjs/components/schedule-builder/ScheduleBuilder.styled.js +0 -138
  154. package/dist/cjs/components/schedule-builder/ScheduleBuilder.styled.js.map +0 -1
  155. package/dist/cjs/components/schedule-builder/ScheduleEndPicker.js +0 -2
  156. package/dist/cjs/components/schedule-builder/ScheduleEndPicker.js.map +0 -1
  157. package/dist/cjs/components/schedule-builder/ScheduleFrequencyPicker.js +0 -2
  158. package/dist/cjs/components/schedule-builder/ScheduleFrequencyPicker.js.map +0 -1
  159. package/dist/cjs/components/schedule-builder/ScheduleHelper.js +0 -2
  160. package/dist/cjs/components/schedule-builder/ScheduleHelper.js.map +0 -1
  161. package/dist/cjs/components/schedule-builder/SendModeSelector.js +0 -2
  162. package/dist/cjs/components/schedule-builder/SendModeSelector.js.map +0 -1
  163. package/dist/cjs/components/schedule-builder/StartDateTimePicker.js +0 -2
  164. package/dist/cjs/components/schedule-builder/StartDateTimePicker.js.map +0 -1
  165. package/dist/cjs/components/schedule-builder/UpcomingRunsPreview.js +0 -2
  166. package/dist/cjs/components/schedule-builder/UpcomingRunsPreview.js.map +0 -1
  167. package/dist/cjs/components/schedule-builder/model.js +0 -2
  168. package/dist/cjs/components/schedule-builder/model.js.map +0 -1
  169. package/dist/esm/components/chip-selector/ChipSelector.d.ts +0 -9
  170. package/dist/esm/components/chip-selector/ChipSelector.js +0 -27
  171. package/dist/esm/components/chip-selector/ChipSelector.js.map +0 -1
  172. package/dist/esm/components/chip-selector/ChipSelector.styled.d.ts +0 -10
  173. package/dist/esm/components/chip-selector/ChipSelector.styled.js +0 -48
  174. package/dist/esm/components/chip-selector/ChipSelector.styled.js.map +0 -1
  175. package/dist/esm/components/chip-selector/ChipSelectorGroup.d.ts +0 -10
  176. package/dist/esm/components/chip-selector/ChipSelectorGroup.js +0 -48
  177. package/dist/esm/components/chip-selector/ChipSelectorGroup.js.map +0 -1
  178. package/dist/esm/components/chip-selector/index.d.ts +0 -4
  179. package/dist/esm/components/chip-selector/model.d.ts +0 -106
  180. package/dist/esm/components/combo-box/ComboBox.d.ts +0 -15
  181. package/dist/esm/components/combo-box/ComboBox.js +0 -118
  182. package/dist/esm/components/combo-box/ComboBox.js.map +0 -1
  183. package/dist/esm/components/combo-box/ComboBox.styled.d.ts +0 -12
  184. package/dist/esm/components/combo-box/ComboBox.styled.js +0 -40
  185. package/dist/esm/components/combo-box/ComboBox.styled.js.map +0 -1
  186. package/dist/esm/components/combo-box/index.d.ts +0 -3
  187. package/dist/esm/components/combo-box/model.d.ts +0 -55
  188. package/dist/esm/components/schedule-builder/RefreshSegmentToggle.d.ts +0 -22
  189. package/dist/esm/components/schedule-builder/RefreshSegmentToggle.js +0 -31
  190. package/dist/esm/components/schedule-builder/RefreshSegmentToggle.js.map +0 -1
  191. package/dist/esm/components/schedule-builder/ScheduleBuilder.d.ts +0 -88
  192. package/dist/esm/components/schedule-builder/ScheduleBuilder.js +0 -105
  193. package/dist/esm/components/schedule-builder/ScheduleBuilder.js.map +0 -1
  194. package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.d.ts +0 -81
  195. package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.js +0 -168
  196. package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.js.map +0 -1
  197. package/dist/esm/components/schedule-builder/ScheduleEndPicker.d.ts +0 -17
  198. package/dist/esm/components/schedule-builder/ScheduleEndPicker.js +0 -105
  199. package/dist/esm/components/schedule-builder/ScheduleEndPicker.js.map +0 -1
  200. package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.d.ts +0 -21
  201. package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.js +0 -136
  202. package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.js.map +0 -1
  203. package/dist/esm/components/schedule-builder/ScheduleHelper.d.ts +0 -110
  204. package/dist/esm/components/schedule-builder/ScheduleHelper.js +0 -196
  205. package/dist/esm/components/schedule-builder/ScheduleHelper.js.map +0 -1
  206. package/dist/esm/components/schedule-builder/SendModeSelector.d.ts +0 -29
  207. package/dist/esm/components/schedule-builder/SendModeSelector.js +0 -41
  208. package/dist/esm/components/schedule-builder/SendModeSelector.js.map +0 -1
  209. package/dist/esm/components/schedule-builder/StartDateTimePicker.d.ts +0 -51
  210. package/dist/esm/components/schedule-builder/StartDateTimePicker.js +0 -120
  211. package/dist/esm/components/schedule-builder/StartDateTimePicker.js.map +0 -1
  212. package/dist/esm/components/schedule-builder/UpcomingRunsPreview.d.ts +0 -19
  213. package/dist/esm/components/schedule-builder/UpcomingRunsPreview.js +0 -44
  214. package/dist/esm/components/schedule-builder/UpcomingRunsPreview.js.map +0 -1
  215. package/dist/esm/components/schedule-builder/index.d.ts +0 -18
  216. package/dist/esm/components/schedule-builder/model.d.ts +0 -69
  217. package/dist/esm/components/schedule-builder/model.js +0 -8
  218. package/dist/esm/components/schedule-builder/model.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"UpcomingRunsPreview.js","sources":["../../../../src/components/schedule-builder/UpcomingRunsPreview.tsx"],"sourcesContent":["import { format as formatDate } from 'date-fns';\nimport React from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { BodyCaption, TitleSmall } from '../TypographyStyle';\nimport { RecurrenceSummary } from './model';\nimport {\n\tColumn,\n\tSummaryHighlight,\n\tUpcomingRunDot,\n\tUpcomingRunItem,\n} from './ScheduleBuilder.styled';\n\nexport interface UpcomingRunsPreviewProps {\n\t/** Run dates to list. Renders nothing when empty. */\n\truns: Date[];\n\t/** Summary line under the list. Omit to show the list alone. */\n\tsummary?: RecurrenceSummary | null;\n\t/** date-fns pattern for each run. */\n\tdateFormat?: string;\n\t'data-test'?: string;\n}\n\n/**\n * The dated list of the next few runs, with the plain-English summary beneath.\n *\n * Read-only: it renders whatever run dates it is given rather than deriving them,\n * so a caller can preview a schedule it has not committed to. Pair it with\n * `ScheduleHelper.computeUpcomingRuns` to produce the dates.\n */\nexport const UpcomingRunsPreview: React.FC<UpcomingRunsPreviewProps> = ({\n\truns,\n\tsummary,\n\tdateFormat = 'EEE d MMM, yyyy',\n\t'data-test': dataTest,\n}) => {\n\tif (!runs.length) return null;\n\n\treturn (\n\t\t<Column gap={12} data-test={dataTest}>\n\t\t\t<Column gap={8}>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Upcoming runs</TitleSmall>\n\t\t\t\t<Column gap={16}>\n\t\t\t\t\t{runs.map((run, index) => (\n\t\t\t\t\t\t<UpcomingRunItem\n\t\t\t\t\t\t\tkey={run.getTime()}\n\t\t\t\t\t\t\tisLast={index === runs.length - 1}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<UpcomingRunDot />\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t{formatDate(run, dateFormat)}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</UpcomingRunItem>\n\t\t\t\t\t))}\n\t\t\t\t</Column>\n\t\t\t</Column>\n\t\t\t{!!summary && (\n\t\t\t\t<BodyCaption\n\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\tdata-test=\"recurrence-summary\"\n\t\t\t\t>\n\t\t\t\t\t{'Repeats '}\n\t\t\t\t\t<SummaryHighlight>{summary.frequencyLabel}</SummaryHighlight>\n\t\t\t\t\t{' at '}\n\t\t\t\t\t<SummaryHighlight>{summary.timeLabel}</SummaryHighlight>\n\t\t\t\t\t{summary.tail}\n\t\t\t\t</BodyCaption>\n\t\t\t)}\n\t\t</Column>\n\t);\n};\n"],"names":["UpcomingRunsPreview","runs","summary","dateFormat","dataTest","jsxs","Column","jsx","TitleSmall","COLORS","run","index","UpcomingRunItem","UpcomingRunDot","BodyCaption","formatDate","SummaryHighlight"],"mappings":"6PA6BaA,EAA0D,CAAC,CACvE,KAAAC,EACA,QAAAC,EACA,WAAAC,EAAa,kBACb,YAAaC,CACd,IACMH,EAAK,OAGTI,EAAAA,KAACC,EAAAA,OAAA,CAAO,IAAK,GAAI,YAAWF,EAC3B,SAAA,CAAAC,EAAAA,KAACC,EAAAA,OAAA,CAAO,IAAK,EACZ,SAAA,CAAAC,MAACC,EAAAA,WAAA,CAAW,MAAOC,EAAAA,OAAO,QAAQ,QAAS,SAAA,gBAAa,EACxDF,EAAAA,IAACD,EAAAA,QAAO,IAAK,GACX,WAAK,IAAI,CAACI,EAAKC,IACfN,EAAAA,KAACO,EAAAA,gBAAA,CAEA,OAAQD,IAAUV,EAAK,OAAS,EAEhC,SAAA,CAAAM,EAAAA,IAACM,EAAAA,eAAA,EAAe,EAChBN,EAAAA,IAACO,EAAAA,aAAY,MAAOL,SAAO,QAAQ,QACjC,SAAAM,EAAAA,OAAWL,EAAKP,CAAU,CAAA,CAC5B,CAAA,CAAA,EANKO,EAAI,QAAA,CAAQ,CAQlB,CAAA,CACF,CAAA,EACD,EACC,CAAC,CAACR,GACFG,EAAAA,KAACS,EAAAA,YAAA,CACA,MAAOL,EAAAA,OAAO,QAAQ,UACtB,YAAU,qBAET,SAAA,CAAA,WACDF,EAAAA,IAACS,EAAAA,iBAAA,CAAkB,SAAAd,EAAQ,cAAA,CAAe,EACzC,OACDK,EAAAA,IAACS,EAAAA,iBAAA,CAAkB,SAAAd,EAAQ,SAAA,CAAU,EACpCA,EAAQ,IAAA,CAAA,CAAA,CACV,EAEF,EAhCwB"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var S=(r=>(r.SEND_NOW="SEND_NOW",r.SCHEDULE="SCHEDULE",r.RECURRING="RECURRING",r))(S||{}),e=(r=>(r.DAILY="DAILY",r.WEEKLY="WEEKLY",r.MONTHLY="MONTHLY",r))(e||{}),t=(r=>(r.NEVER="NEVER",r.AFTER_RUNS="AFTER_RUNS",r.ON_DATE="ON_DATE",r))(t||{}),T=(r=>(r.FIRST="FIRST",r.LAST="LAST",r.CUSTOM="CUSTOM",r))(T||{});exports.MONTHLY_REPEAT_OPTION=T;exports.RECURRENCE_END_MODE=t;exports.RECURRENCE_FREQUENCY=e;exports.SEND_MODE=S;
2
- //# sourceMappingURL=model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.js","sources":["../../../../src/components/schedule-builder/model.ts"],"sourcesContent":["/**\n * Types for the recurrence pickers.\n *\n * These enums are duplicated from the consuming app's campaign types on purpose:\n * a library component cannot import from an app, and the string values are what\n * both ends already send over the wire, so the two stay compatible without a\n * shared package. Cast at the boundary if your app has its own copy.\n */\n\n/**\n * When something sends. SEND_NOW hides the date and time; SCHEDULE shows them;\n * RECURRING adds the frequency, end rule and run preview beneath.\n */\nexport enum SEND_MODE {\n\tSEND_NOW = 'SEND_NOW',\n\tSCHEDULE = 'SCHEDULE',\n\tRECURRING = 'RECURRING',\n}\n\n/** How often the series repeats. */\nexport enum RECURRENCE_FREQUENCY {\n\tDAILY = 'DAILY',\n\tWEEKLY = 'WEEKLY',\n\tMONTHLY = 'MONTHLY',\n}\n\n/** What stops a series from running forever. */\nexport enum RECURRENCE_END_MODE {\n\tNEVER = 'NEVER',\n\tAFTER_RUNS = 'AFTER_RUNS',\n\tON_DATE = 'ON_DATE',\n}\n\n/**\n * The \"Repeat every\" choice shown for a monthly recurrence. FIRST and LAST are\n * presets over the same dates the CUSTOM grid picks, so all three resolve to one\n * set of dates plus a last-day flag rather than three separate code paths.\n */\nexport enum MONTHLY_REPEAT_OPTION {\n\tFIRST = 'FIRST',\n\tLAST = 'LAST',\n\tCUSTOM = 'CUSTOM',\n}\n\n/**\n * Everything the pickers below the start date own.\n *\n * The start date and time are deliberately not here — they belong to the\n * schedule the recurrence repeats from, which every send mode shares.\n * `ScheduleBuilder` holds those as its own `date`/`hours`/`minutes` props so\n * switching mode does not have to move them between two shapes.\n */\nexport interface RecurrenceValue {\n\tfrequency?: RECURRENCE_FREQUENCY;\n\tendMode?: RECURRENCE_END_MODE;\n\t/** Weekly only. JS day indices — 0 = Sunday, matching `Date.getDay()`. */\n\tdaysOfWeek?: number[];\n\t/** Monthly only. Calendar dates, 1–31. */\n\tdatesOfMonth?: number[];\n\t/** Monthly only. Runs on the last day of every month, whatever date that is. */\n\tlastDaySelected?: boolean;\n\tmonthlyRepeatOption?: MONTHLY_REPEAT_OPTION;\n\t/** AFTER_RUNS only. Counts the first run, so 1 means \"just the start date\". */\n\tendAfterRuns?: number;\n\t/** ON_DATE only. Epoch seconds at the end of the chosen day. */\n\tendOnDate?: number;\n\trefreshSegmentBeforeEachRun?: boolean;\n}\n\n/** Summary line split into its semibold parts and the plain text between them. */\nexport interface RecurrenceSummary {\n\tfrequencyLabel: string;\n\ttimeLabel: string;\n\ttail: string;\n}\n"],"names":["SEND_MODE","RECURRENCE_FREQUENCY","RECURRENCE_END_MODE","MONTHLY_REPEAT_OPTION"],"mappings":"gFAaO,IAAKA,GAAAA,IACXA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,UAAY,YAHDA,IAAAA,GAAA,CAAA,CAAA,EAOAC,GAAAA,IACXA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,QAAU,UAHCA,IAAAA,GAAA,CAAA,CAAA,EAOAC,GAAAA,IACXA,EAAA,MAAQ,QACRA,EAAA,WAAa,aACbA,EAAA,QAAU,UAHCA,IAAAA,GAAA,CAAA,CAAA,EAWAC,GAAAA,IACXA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,OAAS,SAHEA,IAAAA,GAAA,CAAA,CAAA"}
@@ -1,9 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChipSelectorProps } from './model';
3
- /**
4
- * A single compact, selectable chip.
5
- *
6
- * Most callers want ChipSelectorGroup, which manages the selection for them.
7
- * Use this directly only when the surrounding layout is bespoke.
8
- */
9
- export declare const ChipSelector: React.FC<ChipSelectorProps>;
@@ -1,27 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { Chip as l } from "./ChipSelector.styled.js";
3
- const s = (e) => {
4
- const a = e.size ?? "medium", t = e.disabled ?? !1;
5
- return /* @__PURE__ */ i(
6
- l,
7
- {
8
- type: "button",
9
- selected: e.selected,
10
- size: a,
11
- width: e.width,
12
- disabled: t,
13
- "aria-pressed": e.selected,
14
- "aria-label": e.ariaLabel ?? e.label,
15
- "data-test": e.dataTestId,
16
- "data-testid": "chip-selector",
17
- onClick: () => {
18
- t || e.onSelect(e.value);
19
- },
20
- children: e.label
21
- }
22
- );
23
- };
24
- export {
25
- s as ChipSelector
26
- };
27
- //# sourceMappingURL=ChipSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChipSelector.js","sources":["../../../../src/components/chip-selector/ChipSelector.tsx"],"sourcesContent":["import React from 'react';\nimport { Chip } from './ChipSelector.styled';\nimport { ChipSelectorProps } from './model';\n\n/**\n * A single compact, selectable chip.\n *\n * Most callers want ChipSelectorGroup, which manages the selection for them.\n * Use this directly only when the surrounding layout is bespoke.\n */\nexport const ChipSelector: React.FC<ChipSelectorProps> = (props) => {\n\tconst size = props.size ?? 'medium';\n\tconst isDisabled = props.disabled ?? false;\n\n\treturn (\n\t\t<Chip\n\t\t\ttype=\"button\"\n\t\t\tselected={props.selected}\n\t\t\tsize={size}\n\t\t\twidth={props.width}\n\t\t\tdisabled={isDisabled}\n\t\t\taria-pressed={props.selected}\n\t\t\taria-label={props.ariaLabel ?? props.label}\n\t\t\tdata-test={props.dataTestId}\n\t\t\tdata-testid=\"chip-selector\"\n\t\t\tonClick={() => {\n\t\t\t\tif (!isDisabled) {\n\t\t\t\t\tprops.onSelect(props.value);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{props.label}\n\t\t</Chip>\n\t);\n};\n"],"names":["ChipSelector","props","size","isDisabled","jsx","Chip"],"mappings":";;AAUO,MAAMA,IAA4C,CAACC,MAAU;AACnE,QAAMC,IAAOD,EAAM,QAAQ,UACrBE,IAAaF,EAAM,YAAY;AAErC,SACC,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,MAAK;AAAA,MACL,UAAUJ,EAAM;AAAA,MAChB,MAAAC;AAAA,MACA,OAAOD,EAAM;AAAA,MACb,UAAUE;AAAA,MACV,gBAAcF,EAAM;AAAA,MACpB,cAAYA,EAAM,aAAaA,EAAM;AAAA,MACrC,aAAWA,EAAM;AAAA,MACjB,eAAY;AAAA,MACZ,SAAS,MAAM;AACd,QAAKE,KACJF,EAAM,SAASA,EAAM,KAAK;AAAA,MAE5B;AAAA,MAEC,UAAAA,EAAM;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1,10 +0,0 @@
1
- import { ChipSize } from './model';
2
- export declare const Chip: import('styled-components').StyledComponent<"button", any, {
3
- selected: boolean;
4
- size: ChipSize;
5
- width?: number | undefined;
6
- }, never>;
7
- export declare const ChipGroup: import('styled-components').StyledComponent<"div", any, {
8
- gap: number;
9
- wrap: boolean;
10
- }, never>;
@@ -1,48 +0,0 @@
1
- import i from "styled-components";
2
- import { COLORS as r } from "../../constants/Theme.js";
3
- const o = {
4
- small: "32px",
5
- medium: "48px"
6
- }, t = {
7
- small: "0px 8px",
8
- medium: "0px 12px"
9
- }, a = i.button`
10
- box-sizing: border-box;
11
- height: ${(e) => o[e.size]};
12
- ${(e) => e.width ? `width: ${e.width}px;` : ""}
13
- padding: ${(e) => t[e.size]};
14
- display: flex;
15
- align-items: center;
16
- justify-content: center;
17
- border-radius: 4px;
18
- border: 1px solid
19
- ${(e) => e.selected ? r.background.inverseLight : r.stroke.primary};
20
- background: ${(e) => e.selected ? r.background.brandLight : r.surface.standard};
21
- color: ${(e) => e.selected ? r.content.primary : r.content.secondary};
22
- font-family: inherit;
23
- font-weight: ${(e) => e.selected ? 600 : 400};
24
- font-size: 14px;
25
- line-height: 20px;
26
- cursor: pointer;
27
-
28
- :disabled {
29
- cursor: not-allowed;
30
- color: ${r.content.inactive};
31
- border-color: ${r.stroke.primary};
32
- background: ${r.surface.subdued};
33
- }
34
-
35
- :hover:not(:disabled) {
36
- background: ${(e) => e.selected ? r.background.brandLight : r.surface.hovered};
37
- }
38
- `, p = i.div`
39
- display: flex;
40
- flex-direction: row;
41
- gap: ${(e) => e.gap}px;
42
- flex-wrap: ${(e) => e.wrap ? "wrap" : "nowrap"};
43
- `;
44
- export {
45
- a as Chip,
46
- p as ChipGroup
47
- };
48
- //# sourceMappingURL=ChipSelector.styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChipSelector.styled.js","sources":["../../../../src/components/chip-selector/ChipSelector.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { ChipSize } from './model';\n\n/** Medium matches the 48px input height so chips align with inputs beside them. */\nconst ChipHeightMapping: Record<ChipSize, string> = {\n\tsmall: '32px',\n\tmedium: '48px',\n};\n\nconst ChipPaddingMapping: Record<ChipSize, string> = {\n\tsmall: '0px 8px',\n\tmedium: '0px 12px',\n};\n\nexport const Chip = styled.button<{\n\tselected: boolean;\n\tsize: ChipSize;\n\twidth?: number;\n}>`\n\tbox-sizing: border-box;\n\theight: ${(props) => ChipHeightMapping[props.size]};\n\t${(props) => (props.width ? `width: ${props.width}px;` : '')}\n\tpadding: ${(props) => ChipPaddingMapping[props.size]};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder-radius: 4px;\n\tborder: 1px solid\n\t\t${(props) =>\n\t\t\tprops.selected ? COLORS.background.inverseLight : COLORS.stroke.primary};\n\tbackground: ${(props) =>\n\t\tprops.selected ? COLORS.background.brandLight : COLORS.surface.standard};\n\tcolor: ${(props) =>\n\t\tprops.selected ? COLORS.content.primary : COLORS.content.secondary};\n\tfont-family: inherit;\n\tfont-weight: ${(props) => (props.selected ? 600 : 400)};\n\tfont-size: 14px;\n\tline-height: 20px;\n\tcursor: pointer;\n\n\t:disabled {\n\t\tcursor: not-allowed;\n\t\tcolor: ${COLORS.content.inactive};\n\t\tborder-color: ${COLORS.stroke.primary};\n\t\tbackground: ${COLORS.surface.subdued};\n\t}\n\n\t:hover:not(:disabled) {\n\t\tbackground: ${(props) =>\n\t\t\tprops.selected ? COLORS.background.brandLight : COLORS.surface.hovered};\n\t}\n`;\n\nexport const ChipGroup = styled.div<{ gap: number; wrap: boolean }>`\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: ${(props) => props.gap}px;\n\tflex-wrap: ${(props) => (props.wrap ? 'wrap' : 'nowrap')};\n`;\n"],"names":["ChipHeightMapping","ChipPaddingMapping","Chip","styled","props","COLORS","ChipGroup"],"mappings":";;AAKA,MAAMA,IAA8C;AAAA,EACnD,OAAO;AAAA,EACP,QAAQ;AACT,GAEMC,IAA+C;AAAA,EACpD,OAAO;AAAA,EACP,QAAQ;AACT,GAEaC,IAAOC,EAAO;AAAA;AAAA,WAMhB,CAACC,MAAUJ,EAAkBI,EAAM,IAAI,CAAC;AAAA,GAChD,CAACA,MAAWA,EAAM,QAAQ,UAAUA,EAAM,KAAK,QAAQ,EAAG;AAAA,YACjD,CAACA,MAAUH,EAAmBG,EAAM,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMjD,CAACA,MACFA,EAAM,WAAWC,EAAO,WAAW,eAAeA,EAAO,OAAO,OAAO;AAAA,eAC3D,CAACD,MACdA,EAAM,WAAWC,EAAO,WAAW,aAAaA,EAAO,QAAQ,QAAQ;AAAA,UAC/D,CAACD,MACTA,EAAM,WAAWC,EAAO,QAAQ,UAAUA,EAAO,QAAQ,SAAS;AAAA;AAAA,gBAEpD,CAACD,MAAWA,EAAM,WAAW,MAAM,GAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAO5CC,EAAO,QAAQ,QAAQ;AAAA,kBAChBA,EAAO,OAAO,OAAO;AAAA,gBACvBA,EAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA,gBAItB,CAACD,MACdA,EAAM,WAAWC,EAAO,WAAW,aAAaA,EAAO,QAAQ,OAAO;AAAA;AAAA,GAI5DC,IAAYH,EAAO;AAAA;AAAA;AAAA,QAGxB,CAACC,MAAUA,EAAM,GAAG;AAAA,cACd,CAACA,MAAWA,EAAM,OAAO,SAAS,QAAS;AAAA;"}
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ChipSelectorGroupProps } from './model';
3
- /**
4
- * A row or grid of compact selectable chips — weekday pickers, month-date
5
- * pickers, and similar cases where options are short and shown all at once.
6
- *
7
- * The group owns the add/remove logic and reports the whole next selection, so
8
- * callers store what they are given instead of repeating toggle code.
9
- */
10
- export declare const ChipSelectorGroup: React.FC<ChipSelectorGroupProps>;
@@ -1,48 +0,0 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { ChipSelector as m } from "./ChipSelector.js";
3
- import { ChipGroup as v } from "./ChipSelector.styled.js";
4
- const s = (e) => {
5
- const n = e.multiSelect ?? !0, i = e.allowEmpty ?? !0, d = (t) => {
6
- const l = e.value.includes(t);
7
- if (!n)
8
- return l ? i ? [] : e.value : [t];
9
- if (l) {
10
- const a = e.value.filter((c) => c !== t);
11
- return !a.length && !i ? e.value : a;
12
- }
13
- return e.options.map((a) => a.value).filter((a) => a === t || e.value.includes(a));
14
- }, r = (t) => {
15
- const l = d(t);
16
- l !== e.value && e.onChange(l);
17
- };
18
- return /* @__PURE__ */ u(
19
- v,
20
- {
21
- role: "group",
22
- "aria-label": e.ariaLabel,
23
- gap: e.gap ?? 8,
24
- wrap: e.wrap ?? !1,
25
- "data-test": e["data-test"],
26
- "data-testid": "chip-selector-group",
27
- children: e.options.map((t) => /* @__PURE__ */ u(
28
- m,
29
- {
30
- value: t.value,
31
- label: t.label,
32
- ariaLabel: t.ariaLabel,
33
- disabled: t.disabled,
34
- selected: e.value.includes(t.value),
35
- size: e.size,
36
- width: t.fitContent ? void 0 : e.chipWidth,
37
- dataTestId: `${e["data-test"] ?? "chip"}-${t.value}`,
38
- onSelect: r
39
- },
40
- t.value
41
- ))
42
- }
43
- );
44
- };
45
- export {
46
- s as ChipSelectorGroup
47
- };
48
- //# sourceMappingURL=ChipSelectorGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChipSelectorGroup.js","sources":["../../../../src/components/chip-selector/ChipSelectorGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { ChipSelector } from './ChipSelector';\nimport { ChipGroup } from './ChipSelector.styled';\nimport { ChipSelectorGroupProps, ChipValue } from './model';\n\n/**\n * A row or grid of compact selectable chips — weekday pickers, month-date\n * pickers, and similar cases where options are short and shown all at once.\n *\n * The group owns the add/remove logic and reports the whole next selection, so\n * callers store what they are given instead of repeating toggle code.\n */\nexport const ChipSelectorGroup: React.FC<ChipSelectorGroupProps> = (props) => {\n\tconst multiSelect = props.multiSelect ?? true;\n\tconst allowEmpty = props.allowEmpty ?? true;\n\n\tconst buildNextValue = (clicked: ChipValue): ChipValue[] => {\n\t\tconst isSelected = props.value.includes(clicked);\n\n\t\tif (!multiSelect) {\n\t\t\t// Re-picking the only selection clears it, unless a value is required.\n\t\t\tif (isSelected) {\n\t\t\t\treturn allowEmpty ? [] : props.value;\n\t\t\t}\n\t\t\treturn [clicked];\n\t\t}\n\n\t\tif (isSelected) {\n\t\t\tconst remaining = props.value.filter((value) => value !== clicked);\n\t\t\treturn !remaining.length && !allowEmpty ? props.value : remaining;\n\t\t}\n\n\t\t// Order by the options given, so the selection reads the way it is shown\n\t\t// rather than in the order the user happened to click.\n\t\treturn props.options\n\t\t\t.map((option) => option.value)\n\t\t\t.filter((value) => value === clicked || props.value.includes(value));\n\t};\n\n\tconst onChipSelected = (clicked: ChipValue) => {\n\t\tconst next = buildNextValue(clicked);\n\t\tif (next !== props.value) {\n\t\t\tprops.onChange(next);\n\t\t}\n\t};\n\n\treturn (\n\t\t<ChipGroup\n\t\t\trole=\"group\"\n\t\t\taria-label={props.ariaLabel}\n\t\t\tgap={props.gap ?? 8}\n\t\t\twrap={props.wrap ?? false}\n\t\t\tdata-test={props['data-test']}\n\t\t\tdata-testid=\"chip-selector-group\"\n\t\t>\n\t\t\t{props.options.map((option) => (\n\t\t\t\t<ChipSelector\n\t\t\t\t\tkey={option.value}\n\t\t\t\t\tvalue={option.value}\n\t\t\t\t\tlabel={option.label}\n\t\t\t\t\tariaLabel={option.ariaLabel}\n\t\t\t\t\tdisabled={option.disabled}\n\t\t\t\t\tselected={props.value.includes(option.value)}\n\t\t\t\t\tsize={props.size}\n\t\t\t\t\twidth={option.fitContent ? undefined : props.chipWidth}\n\t\t\t\t\tdataTestId={`${props['data-test'] ?? 'chip'}-${option.value}`}\n\t\t\t\t\tonSelect={onChipSelected}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</ChipGroup>\n\t);\n};\n"],"names":["ChipSelectorGroup","props","multiSelect","allowEmpty","buildNextValue","clicked","isSelected","remaining","value","option","onChipSelected","next","jsx","ChipGroup","ChipSelector"],"mappings":";;;AAYO,MAAMA,IAAsD,CAACC,MAAU;AAC7E,QAAMC,IAAcD,EAAM,eAAe,IACnCE,IAAaF,EAAM,cAAc,IAEjCG,IAAiB,CAACC,MAAoC;AAC3D,UAAMC,IAAaL,EAAM,MAAM,SAASI,CAAO;AAE/C,QAAI,CAACH;AAEJ,aAAII,IACIH,IAAa,KAAKF,EAAM,QAEzB,CAACI,CAAO;AAGhB,QAAIC,GAAY;AACf,YAAMC,IAAYN,EAAM,MAAM,OAAO,CAACO,MAAUA,MAAUH,CAAO;AACjE,aAAO,CAACE,EAAU,UAAU,CAACJ,IAAaF,EAAM,QAAQM;AAAA,IACzD;AAIA,WAAON,EAAM,QACX,IAAI,CAACQ,MAAWA,EAAO,KAAK,EAC5B,OAAO,CAACD,MAAUA,MAAUH,KAAWJ,EAAM,MAAM,SAASO,CAAK,CAAC;AAAA,EACrE,GAEME,IAAiB,CAACL,MAAuB;AAC9C,UAAMM,IAAOP,EAAeC,CAAO;AACnC,IAAIM,MAASV,EAAM,SAClBA,EAAM,SAASU,CAAI;AAAA,EAErB;AAEA,SACC,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,MAAK;AAAA,MACL,cAAYZ,EAAM;AAAA,MAClB,KAAKA,EAAM,OAAO;AAAA,MAClB,MAAMA,EAAM,QAAQ;AAAA,MACpB,aAAWA,EAAM,WAAW;AAAA,MAC5B,eAAY;AAAA,MAEX,UAAAA,EAAM,QAAQ,IAAI,CAACQ,MACnB,gBAAAG;AAAA,QAACE;AAAA,QAAA;AAAA,UAEA,OAAOL,EAAO;AAAA,UACd,OAAOA,EAAO;AAAA,UACd,WAAWA,EAAO;AAAA,UAClB,UAAUA,EAAO;AAAA,UACjB,UAAUR,EAAM,MAAM,SAASQ,EAAO,KAAK;AAAA,UAC3C,MAAMR,EAAM;AAAA,UACZ,OAAOQ,EAAO,aAAa,SAAYR,EAAM;AAAA,UAC7C,YAAY,GAAGA,EAAM,WAAW,KAAK,MAAM,IAAIQ,EAAO,KAAK;AAAA,UAC3D,UAAUC;AAAA,QAAA;AAAA,QATLD,EAAO;AAAA,MAAA,CAWb;AAAA,IAAA;AAAA,EAAA;AAGJ;"}
@@ -1,4 +0,0 @@
1
- import { ChipSelector } from './ChipSelector';
2
- import { ChipSelectorGroup } from './ChipSelectorGroup';
3
- export { ChipSelector, ChipSelectorGroup };
4
- export * from './model';
@@ -1,106 +0,0 @@
1
- import { default as React } from 'react';
2
- /** Identifier for a chip. Numbers suit day/date indices, strings suit slugs. */
3
- export type ChipValue = string | number;
4
- export type ChipSize = 'small' | 'medium';
5
- export interface ChipOption {
6
- /**
7
- * Unique value for this chip, reported back through the group's `onChange`.
8
- */
9
- value: ChipValue;
10
- /**
11
- * Text rendered inside the chip. Keep it short — chips are compact by design.
12
- */
13
- label: string;
14
- /**
15
- * Accessible name, used when `label` is abbreviated and would not read well
16
- * on its own — e.g. "M" for Monday, where several days share a letter.
17
- * @default the `label`
18
- */
19
- ariaLabel?: string;
20
- /**
21
- * Blocks selection and dims the chip.
22
- * @default false
23
- */
24
- disabled?: boolean;
25
- /**
26
- * Sizes this chip to its label, ignoring the group's `chipWidth`. For the odd
27
- * long option in an otherwise uniform grid — "Last day of the month" beside
28
- * dates 1–31, which would overflow a fixed date-sized chip.
29
- * @default false
30
- */
31
- fitContent?: boolean;
32
- }
33
- export interface ChipSelectorProps extends ChipOption {
34
- /**
35
- * Whether the chip is currently selected.
36
- */
37
- selected: boolean;
38
- /**
39
- * Size of the chip. `medium` matches the 48px input height so chips can sit
40
- * in a row beside inputs and dropdowns.
41
- * @default 'medium'
42
- */
43
- size?: ChipSize;
44
- /**
45
- * Fixed width in px. Omit to let the chip size to its content, which is what
46
- * variable-length labels need.
47
- * @default undefined
48
- */
49
- width?: number;
50
- onSelect: (value: ChipValue) => void;
51
- dataTestId?: string;
52
- }
53
- export interface ChipSelectorGroupProps {
54
- /**
55
- * Chips to render, in display order.
56
- */
57
- options: ChipOption[];
58
- /**
59
- * Currently selected values. Pass a single-element array for single-select.
60
- */
61
- value: ChipValue[];
62
- /**
63
- * Fired with the full next selection, so the caller stores the result
64
- * directly rather than reimplementing add/remove on every screen.
65
- */
66
- onChange: (value: ChipValue[]) => void;
67
- /**
68
- * Allows more than one chip to be selected at a time. When false, picking a
69
- * chip replaces the selection.
70
- * @default true
71
- */
72
- multiSelect?: boolean;
73
- /**
74
- * Permits clearing the last selected chip. Set false when the caller always
75
- * needs at least one value.
76
- * @default true
77
- */
78
- allowEmpty?: boolean;
79
- /**
80
- * Size applied to every chip in the group.
81
- * @default 'medium'
82
- */
83
- size?: ChipSize;
84
- /**
85
- * Fixed width in px applied to every chip, for grids that must align — a
86
- * day picker looks uneven if "S" and "W" size to their own content.
87
- * @default undefined
88
- */
89
- chipWidth?: number;
90
- /**
91
- * Gap between chips in px.
92
- * @default 8
93
- */
94
- gap?: number;
95
- /**
96
- * Wraps chips onto multiple lines. Needed for the 31-chip month grid.
97
- * @default false
98
- */
99
- wrap?: boolean;
100
- /**
101
- * Accessible name for the group as a whole, e.g. "Repeat on".
102
- */
103
- ariaLabel?: string;
104
- 'data-test'?: string;
105
- }
106
- export type ChipIconProps = React.SVGAttributes<SVGElement>;
@@ -1,15 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ComboBoxProps } from './model';
3
- /**
4
- * A text field that can be typed into or picked from a list.
5
- *
6
- * Sits between Dropdown, whose box is not editable, and Input, which offers no
7
- * options. Reach for it when a field has common values worth listing but must
8
- * still accept anything valid the user types — a time, a duration, a currency.
9
- *
10
- * Typing is validated rather than constrained, so a half-finished entry stays in
11
- * the box instead of being rewritten on every keystroke; `validate` decides what
12
- * is worth committing and `format` tidies the text once the field is left.
13
- */
14
- export declare const ComboBox: React.FC<ComboBoxProps>;
15
- export default ComboBox;
@@ -1,118 +0,0 @@
1
- import { jsxs as V, jsx as h } from "react/jsx-runtime";
2
- import { useState as b, useRef as v, useEffect as I, useMemo as j } from "react";
3
- import q from "../../assets/icons/chevronDown.svg.js";
4
- import { ComboBoxWrapper as F, OptionList as M, OptionItem as W } from "./ComboBox.styled.js";
5
- import { Input as H } from "../input/Input.js";
6
- const N = (n, s) => {
7
- const c = s.trim().toLowerCase();
8
- return c ? n.filter(
9
- (a) => a.value.toLowerCase().startsWith(c)
10
- ) : n;
11
- }, Z = ({
12
- value: n,
13
- options: s,
14
- onChange: c,
15
- validate: a,
16
- format: f,
17
- sanitize: g,
18
- filter: O = N,
19
- placeholder: B,
20
- errorMessage: k,
21
- disabled: C,
22
- onInvalidBlur: R,
23
- "data-test": K
24
- }) => {
25
- const [r, i] = b(n), [x, S] = b(!1), [d, T] = b(-1), E = v(null), L = v(null), m = v(-1), w = v(!1), l = (e) => {
26
- m.current = e, T(e);
27
- }, o = (e) => {
28
- w.current = e, S(e);
29
- }, D = (e) => a ? a(e) : e.trim().length > 0;
30
- I(() => {
31
- i((e) => D(e) && (f ? f(e) : e) === n ? e : n);
32
- }, [n]);
33
- const u = j(() => {
34
- const e = r.trim();
35
- return s.some((t) => t.value === e) ? s : O(s, r);
36
- }, [O, s, r]);
37
- I(() => {
38
- if (!x) return;
39
- const e = (t) => {
40
- E.current?.contains(t.target) || o(!1);
41
- };
42
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
43
- }, [x]), I(() => {
44
- if (d < 0) return;
45
- const e = L.current?.children[d];
46
- e instanceof HTMLElement && e.scrollIntoView && e.scrollIntoView({ block: "nearest" });
47
- }, [d]);
48
- const A = (e) => {
49
- i(e.value), c(e.value), o(!1), l(-1);
50
- };
51
- return /* @__PURE__ */ V(F, { ref: E, "data-test": K, children: [
52
- /* @__PURE__ */ h("div", { children: /* @__PURE__ */ h(
53
- H,
54
- {
55
- width: "100%",
56
- placeholder: B,
57
- value: r,
58
- isDisabled: C,
59
- errorMessage: k,
60
- state: k ? "invalid" : C ? "disabled" : "active",
61
- rightIcon: {
62
- icon: q,
63
- callback: () => o(!w.current),
64
- "data-test": "combo-box-toggle"
65
- },
66
- onKeyDownEvent: (e) => {
67
- const t = e;
68
- if (t.key === "ArrowDown" || t.key === "ArrowUp") {
69
- if (t.preventDefault(), !w.current) {
70
- o(!0);
71
- return;
72
- }
73
- const p = t.key === "ArrowDown" ? 1 : -1, y = m.current + p;
74
- y < 0 ? l(u.length - 1) : y >= u.length ? l(0) : l(y);
75
- return;
76
- }
77
- if (t.key === "Enter" && w.current && m.current >= 0) {
78
- t.preventDefault(), A(u[m.current]);
79
- return;
80
- }
81
- t.key === "Escape" && o(!1);
82
- },
83
- noKeyDownChange: !0,
84
- onFocus: () => o(!0),
85
- onChangeText: (e) => {
86
- const t = g ? g(e) : e;
87
- i(t), o(!0), l(-1), D(t) && c(t);
88
- },
89
- onBlur: () => {
90
- if (D(r)) {
91
- const e = f ? f(r) : r;
92
- i(e), e !== n && c(e);
93
- return;
94
- }
95
- i(n), R?.();
96
- }
97
- }
98
- ) }),
99
- x && !!u.length && /* @__PURE__ */ h(M, { ref: L, role: "listbox", children: u.map((e, t) => /* @__PURE__ */ h(
100
- W,
101
- {
102
- role: "option",
103
- "aria-selected": e.value === n,
104
- isActive: t === d,
105
- isSelected: e.value === n,
106
- onMouseDown: (p) => {
107
- p.preventDefault(), A(e);
108
- },
109
- children: e.label ?? e.value
110
- },
111
- e.value
112
- )) })
113
- ] });
114
- };
115
- export {
116
- Z as ComboBox
117
- };
118
- //# sourceMappingURL=ComboBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComboBox.js","sources":["../../../../src/components/combo-box/ComboBox.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport DownIcon from '../../assets/icons/chevronDown.svg';\nimport { Input } from '../input';\nimport { ComboBoxWrapper, OptionItem, OptionList } from './ComboBox.styled';\nimport { ComboBoxOption, ComboBoxProps } from './model';\n\n/** Options whose value starts with what has been typed. */\nconst defaultFilter = (\n\toptions: ComboBoxOption[],\n\ttext: string,\n): ComboBoxOption[] => {\n\tconst query = text.trim().toLowerCase();\n\tif (!query) return options;\n\treturn options.filter((option) =>\n\t\toption.value.toLowerCase().startsWith(query),\n\t);\n};\n\n/**\n * A text field that can be typed into or picked from a list.\n *\n * Sits between Dropdown, whose box is not editable, and Input, which offers no\n * options. Reach for it when a field has common values worth listing but must\n * still accept anything valid the user types — a time, a duration, a currency.\n *\n * Typing is validated rather than constrained, so a half-finished entry stays in\n * the box instead of being rewritten on every keystroke; `validate` decides what\n * is worth committing and `format` tidies the text once the field is left.\n */\nexport const ComboBox: React.FC<ComboBoxProps> = ({\n\tvalue,\n\toptions,\n\tonChange,\n\tvalidate,\n\tformat,\n\tsanitize,\n\tfilter = defaultFilter,\n\tplaceholder,\n\terrorMessage,\n\tdisabled,\n\tonInvalidBlur,\n\t'data-test': dataTest,\n}) => {\n\t// What the box shows while typing. Separate from `value` so a partial entry\n\t// survives a keystroke rather than being parsed away.\n\tconst [text, setText] = useState(value);\n\tconst [isOpen, setIsOpen] = useState(false);\n\tconst [activeIndex, setActiveIndex] = useState(-1);\n\tconst wrapperRef = useRef<HTMLDivElement | null>(null);\n\tconst listRef = useRef<HTMLUListElement | null>(null);\n\t// Mirrors activeIndex for the key handler, which closes over the value from\n\t// its own render — two arrow presses in one frame would otherwise both read\n\t// the same starting index.\n\tconst activeIndexRef = useRef(-1);\n\t// Same reason as activeIndexRef: the handler must see the list state left by\n\t// the keypress before it, not the one from its own render.\n\tconst isOpenRef = useRef(false);\n\n\tconst moveActiveIndex = (next: number) => {\n\t\tactiveIndexRef.current = next;\n\t\tsetActiveIndex(next);\n\t};\n\n\tconst setListOpen = (open: boolean) => {\n\t\tisOpenRef.current = open;\n\t\tsetIsOpen(open);\n\t};\n\n\tconst isValid = (candidate: string) =>\n\t\tvalidate ? validate(candidate) : candidate.trim().length > 0;\n\n\t// Mirror committed changes from outside — a loaded value, a reset, a\n\t// recommendation — without disturbing text being typed right now.\n\tuseEffect(() => {\n\t\tsetText((prev) => {\n\t\t\tif (!isValid(prev)) return value;\n\t\t\t// Compare through `format` so text that already means the committed\n\t\t\t// value is left as typed. Without this, typing \"11:4\" is rewritten to\n\t\t\t// the formatted \"11:04\" and the next keystroke lands as \"11:045\".\n\t\t\tconst asCommitted = format ? format(prev) : prev;\n\t\t\treturn asCommitted === value ? prev : value;\n\t\t});\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [value]);\n\n\t// An exact match still shows every option, so neighbouring values stay\n\t// reachable after picking one.\n\tconst visibleOptions = useMemo(() => {\n\t\tconst query = text.trim();\n\t\tif (options.some((option) => option.value === query)) return options;\n\t\treturn filter(options, text);\n\t}, [filter, options, text]);\n\n\tuseEffect(() => {\n\t\tif (!isOpen) return;\n\n\t\tconst handlePointerDown = (event: MouseEvent) => {\n\t\t\tif (!wrapperRef.current?.contains(event.target as Node)) {\n\t\t\t\tsetListOpen(false);\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener('mousedown', handlePointerDown);\n\t\treturn () => document.removeEventListener('mousedown', handlePointerDown);\n\t}, [isOpen]);\n\n\t// Keep the keyboard cursor in view when it moves past the visible rows.\n\tuseEffect(() => {\n\t\tif (activeIndex < 0) return;\n\t\tconst activeNode = listRef.current?.children[activeIndex];\n\t\t// Guarded because scrollIntoView is not implemented everywhere the library\n\t\t// renders — jsdom being the common case.\n\t\tif (activeNode instanceof HTMLElement && activeNode.scrollIntoView) {\n\t\t\tactiveNode.scrollIntoView({ block: 'nearest' });\n\t\t}\n\t}, [activeIndex]);\n\n\tconst selectOption = (option: ComboBoxOption) => {\n\t\tsetText(option.value);\n\t\tonChange(option.value);\n\t\tsetListOpen(false);\n\t\tmoveActiveIndex(-1);\n\t};\n\n\t// Typed as the DOM Event the Input hook passes; the fields read below are\n\t// KeyboardEvent's, so it is narrowed on entry.\n\tconst handleKeyDown = (nativeEvent: Event) => {\n\t\tconst event = nativeEvent as unknown as KeyboardEvent;\n\t\tif (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n\t\t\tevent.preventDefault();\n\t\t\tif (!isOpenRef.current) {\n\t\t\t\tsetListOpen(true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst step = event.key === 'ArrowDown' ? 1 : -1;\n\t\t\tconst next = activeIndexRef.current + step;\n\t\t\tif (next < 0) moveActiveIndex(visibleOptions.length - 1);\n\t\t\telse if (next >= visibleOptions.length) moveActiveIndex(0);\n\t\t\telse moveActiveIndex(next);\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tevent.key === 'Enter' &&\n\t\t\tisOpenRef.current &&\n\t\t\tactiveIndexRef.current >= 0\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\tselectOption(visibleOptions[activeIndexRef.current]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.key === 'Escape') setListOpen(false);\n\t};\n\n\tconst handleBlur = () => {\n\t\tif (isValid(text)) {\n\t\t\tconst formatted = format ? format(text) : text;\n\t\t\tsetText(formatted);\n\t\t\tif (formatted !== value) onChange(formatted);\n\t\t\treturn;\n\t\t}\n\t\t// Unusable text falls back to the last committed value.\n\t\tsetText(value);\n\t\tonInvalidBlur?.();\n\t};\n\n\treturn (\n\t\t<ComboBoxWrapper ref={wrapperRef} data-test={dataTest}>\n\t\t\t<div>\n\t\t\t\t<Input\n\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tvalue={text}\n\t\t\t\t\tisDisabled={disabled}\n\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\tstate={errorMessage ? 'invalid' : disabled ? 'disabled' : 'active'}\n\t\t\t\t\t// Input handles its own keydown, so the arrow/Enter handling goes\n\t\t\t\t\t// through its hook rather than a wrapper that never sees the event.\n\t\t\t\t\t// Same chevron Dropdown uses, so the field reads as one rather than\n\t\t\t\t\t// looking like a plain text box that happens to suggest values.\n\t\t\t\t\trightIcon={{\n\t\t\t\t\t\ticon: DownIcon,\n\t\t\t\t\t\tcallback: () => setListOpen(!isOpenRef.current),\n\t\t\t\t\t\t'data-test': 'combo-box-toggle',\n\t\t\t\t\t}}\n\t\t\t\t\tonKeyDownEvent={handleKeyDown}\n\t\t\t\t\t// Without this Input re-fires onChangeText on every keypress, which\n\t\t\t\t\t// would re-open the list on Escape and fight the arrow keys.\n\t\t\t\t\tnoKeyDownChange\n\t\t\t\t\tonFocus={() => setListOpen(true)}\n\t\t\t\t\tonChangeText={(input: string) => {\n\t\t\t\t\t\tconst cleaned = sanitize ? sanitize(input) : input;\n\t\t\t\t\t\tsetText(cleaned);\n\t\t\t\t\t\tsetListOpen(true);\n\t\t\t\t\t\tmoveActiveIndex(-1);\n\t\t\t\t\t\tif (isValid(cleaned)) onChange(cleaned);\n\t\t\t\t\t}}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{isOpen && !!visibleOptions.length && (\n\t\t\t\t<OptionList ref={listRef} role=\"listbox\">\n\t\t\t\t\t{visibleOptions.map((option, index) => (\n\t\t\t\t\t\t<OptionItem\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\taria-selected={option.value === value}\n\t\t\t\t\t\t\tisActive={index === activeIndex}\n\t\t\t\t\t\t\tisSelected={option.value === value}\n\t\t\t\t\t\t\t// mousedown fires before the input's blur, so the click is not\n\t\t\t\t\t\t\t// lost to the field closing first.\n\t\t\t\t\t\t\tonMouseDown={(event) => {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tselectOption(option);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option.label ?? option.value}\n\t\t\t\t\t\t</OptionItem>\n\t\t\t\t\t))}\n\t\t\t\t</OptionList>\n\t\t\t)}\n\t\t</ComboBoxWrapper>\n\t);\n};\n\nexport default ComboBox;\n"],"names":["defaultFilter","options","text","query","option","ComboBox","value","onChange","validate","format","sanitize","filter","placeholder","errorMessage","disabled","onInvalidBlur","dataTest","setText","useState","isOpen","setIsOpen","activeIndex","setActiveIndex","wrapperRef","useRef","listRef","activeIndexRef","isOpenRef","moveActiveIndex","next","setListOpen","open","isValid","candidate","useEffect","prev","visibleOptions","useMemo","handlePointerDown","event","activeNode","selectOption","jsxs","ComboBoxWrapper","jsx","Input","DownIcon","nativeEvent","step","input","cleaned","formatted","OptionList","index","OptionItem"],"mappings":"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"}
@@ -1,12 +0,0 @@
1
- /** Anchors the option list to the input below it. */
2
- export declare const ComboBoxWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
3
- /**
4
- * The option list. Sits above neighbouring fields — date pickers in the same
5
- * form commonly overlay at z-index 4, so this clears them.
6
- */
7
- export declare const OptionList: import('styled-components').StyledComponent<"ul", any, {}, never>;
8
- /** `isActive` tracks the keyboard cursor, which is separate from selection. */
9
- export declare const OptionItem: import('styled-components').StyledComponent<"li", any, {
10
- isActive: boolean;
11
- isSelected: boolean;
12
- }, never>;
@@ -1,40 +0,0 @@
1
- import r from "styled-components";
2
- import { COLORS as o } from "../../constants/Theme.js";
3
- const n = r.div`
4
- position: relative;
5
- width: 100%;
6
- `, p = r.ul`
7
- position: absolute;
8
- top: calc(100% + 4px);
9
- left: 0;
10
- right: 0;
11
- z-index: 5;
12
- margin: 0;
13
- padding: 4px 0;
14
- list-style: none;
15
- max-height: 240px;
16
- overflow-y: auto;
17
- background: ${o.surface.standard};
18
- border: 1px solid ${o.stroke.primary};
19
- border-radius: 4px;
20
- box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
21
- `, a = r.li`
22
- padding: 10px 12px;
23
- cursor: pointer;
24
- font-family: 'Inter', sans-serif;
25
- font-size: 14px;
26
- line-height: 20px;
27
- color: ${(e) => e.isSelected ? o.content.brand : o.content.primary};
28
- font-weight: ${(e) => e.isSelected ? 600 : 400};
29
- background: ${(e) => e.isActive ? o.surface.hovered : "transparent"};
30
-
31
- :hover {
32
- background: ${o.surface.hovered};
33
- }
34
- `;
35
- export {
36
- n as ComboBoxWrapper,
37
- a as OptionItem,
38
- p as OptionList
39
- };
40
- //# sourceMappingURL=ComboBox.styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComboBox.styled.js","sources":["../../../../src/components/combo-box/ComboBox.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\n/** Anchors the option list to the input below it. */\nexport const ComboBoxWrapper = styled.div`\n\tposition: relative;\n\twidth: 100%;\n`;\n\n/**\n * The option list. Sits above neighbouring fields — date pickers in the same\n * form commonly overlay at z-index 4, so this clears them.\n */\nexport const OptionList = styled.ul`\n\tposition: absolute;\n\ttop: calc(100% + 4px);\n\tleft: 0;\n\tright: 0;\n\tz-index: 5;\n\tmargin: 0;\n\tpadding: 4px 0;\n\tlist-style: none;\n\tmax-height: 240px;\n\toverflow-y: auto;\n\tbackground: ${COLORS.surface.standard};\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbox-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);\n`;\n\n/** `isActive` tracks the keyboard cursor, which is separate from selection. */\nexport const OptionItem = styled.li<{ isActive: boolean; isSelected: boolean }>`\n\tpadding: 10px 12px;\n\tcursor: pointer;\n\tfont-family: 'Inter', sans-serif;\n\tfont-size: 14px;\n\tline-height: 20px;\n\tcolor: ${(props) =>\n\t\tprops.isSelected ? COLORS.content.brand : COLORS.content.primary};\n\tfont-weight: ${(props) => (props.isSelected ? 600 : 400)};\n\tbackground: ${(props) =>\n\t\tprops.isActive ? COLORS.surface.hovered : 'transparent'};\n\n\t:hover {\n\t\tbackground: ${COLORS.surface.hovered};\n\t}\n`;\n"],"names":["ComboBoxWrapper","styled","OptionList","COLORS","OptionItem","props"],"mappings":";;AAIO,MAAMA,IAAkBC,EAAO;AAAA;AAAA;AAAA,GASzBC,IAAaD,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAWlBE,EAAO,QAAQ,QAAQ;AAAA,qBACjBA,EAAO,OAAO,OAAO;AAAA;AAAA;AAAA,GAM7BC,IAAaH,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMvB,CAACI,MACTA,EAAM,aAAaF,EAAO,QAAQ,QAAQA,EAAO,QAAQ,OAAO;AAAA,gBAClD,CAACE,MAAWA,EAAM,aAAa,MAAM,GAAI;AAAA,eAC1C,CAACA,MACdA,EAAM,WAAWF,EAAO,QAAQ,UAAU,aAAa;AAAA;AAAA;AAAA,gBAGzCA,EAAO,QAAQ,OAAO;AAAA;AAAA;"}
@@ -1,3 +0,0 @@
1
- import { ComboBox } from './ComboBox';
2
- export { ComboBox };
3
- export * from './model';
@@ -1,55 +0,0 @@
1
- /** A value the combo box can offer. */
2
- export interface ComboBoxOption {
3
- /**
4
- * Committed through `onChange` when this option is picked, and compared
5
- * against the typed text to decide what the list shows.
6
- */
7
- value: string;
8
- /**
9
- * Text rendered in the list. Defaults to `value`, which suits lists where the
10
- * two are the same — times, codes, plain identifiers.
11
- */
12
- label?: string;
13
- }
14
- export interface ComboBoxProps {
15
- /** Current committed value. Empty string when nothing is chosen yet. */
16
- value: string;
17
- options: ComboBoxOption[];
18
- /**
19
- * Fires whenever the typed text is accepted by `validate`, and whenever an
20
- * option is picked from the list.
21
- */
22
- onChange: (value: string) => void;
23
- /**
24
- * Rejects text that should not be committed — a half-typed entry, or one
25
- * outside the allowed range. Return false and the text stays in the box
26
- * without being committed, which is what keeps the field editable mid-entry.
27
- * @default accepts any non-empty text
28
- */
29
- validate?: (text: string) => boolean;
30
- /**
31
- * Rewrites the text when the field is left, e.g. padding "9:5" to "9:05".
32
- * Only called for text that passes `validate`.
33
- *
34
- * Also used to tell whether typed text already means the committed value:
35
- * "9:5" and "9:05" format alike, so the box is left alone rather than being
36
- * rewritten mid-entry.
37
- */
38
- format?: (text: string) => string;
39
- /**
40
- * Strips characters as they are typed, so unusable input never reaches the
41
- * box. Applied before `validate`.
42
- */
43
- sanitize?: (text: string) => string;
44
- /**
45
- * Narrows the list against the typed text. The default keeps options whose
46
- * value starts with what has been typed.
47
- */
48
- filter?: (options: ComboBoxOption[], text: string) => ComboBoxOption[];
49
- placeholder?: string;
50
- errorMessage?: string;
51
- disabled?: boolean;
52
- /** Called on blur when the text is not valid, for the caller's own checks. */
53
- onInvalidBlur?: () => void;
54
- 'data-test'?: string;
55
- }
@@ -1,22 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface RefreshSegmentToggleProps {
3
- value: boolean;
4
- onChange: (value: boolean) => void;
5
- /**
6
- * False when the audience cannot be recomputed — a static uploaded list, for
7
- * instance. The switch reads off and goes inert rather than disappearing, so
8
- * the merchant can see the option exists and is unavailable.
9
- */
10
- canRefresh?: boolean;
11
- title?: string;
12
- caption?: string;
13
- 'data-test'?: string;
14
- }
15
- /**
16
- * "Refresh segment before each run".
17
- *
18
- * Kept separate from the pickers because it is not part of the schedule — it
19
- * decides how the audience is resolved at send time, and a screen may want the
20
- * schedule without offering this at all.
21
- */
22
- export declare const RefreshSegmentToggle: React.FC<RefreshSegmentToggleProps>;