@bikdotai/bik-component-library 0.0.868-beta.0 → 0.0.868-beta.2

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/dist/cjs/components/datePicker/DatePickerWrapper.js +1 -1
  2. package/dist/cjs/components/datePicker/DatePickerWrapper.js.map +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/esm/components/ProgressChecklist/ProgressChecklist.style.d.ts +59 -24
  5. package/dist/esm/components/QueryBuilder/components/Connectors/Connector.styled.d.ts +4 -1
  6. package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.d.ts +4 -1
  7. package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.d.ts +10 -3
  8. package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.styled.d.ts +7 -2
  9. package/dist/esm/components/TablePagination/TablePagination.styled.d.ts +8 -3
  10. package/dist/esm/components/TablePagination/TablePaginationCard.d.ts +4 -2
  11. package/dist/esm/components/TypographyStyle.d.ts +141 -62
  12. package/dist/esm/components/WhatsAppTextEditor/AIRephrase.styled.d.ts +5 -2
  13. package/dist/esm/components/WhatsAppTextEditor/CustomEditor.styled.d.ts +20 -7
  14. package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +3 -1
  15. package/dist/esm/components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.d.ts +26 -9
  16. package/dist/esm/components/accordion/Accordion.style.d.ts +10 -4
  17. package/dist/esm/components/action-button/ActionButton.styled.d.ts +5 -2
  18. package/dist/esm/components/adbanner/Banner.styled.d.ts +88 -20
  19. package/dist/esm/components/add-variableV2/AddVariableBox.styled.d.ts +4 -1
  20. package/dist/esm/components/add-variableV2/AddVariableV2.styled.d.ts +9 -4
  21. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +328 -186
  22. package/dist/esm/components/agent-listing/AgentListing.styled.d.ts +88 -49
  23. package/dist/esm/components/alerts/Alert.styled.d.ts +11 -5
  24. package/dist/esm/components/analytics-card/AnalyticsCard.styled.d.ts +8 -4
  25. package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.d.ts +27 -18
  26. package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.d.ts +26 -11
  27. package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.d.ts +26 -11
  28. package/dist/esm/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.styles.d.ts +5 -2
  29. package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.d.ts +12 -5
  30. package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +8 -3
  31. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.d.ts +17 -6
  32. package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.styles.d.ts +5 -2
  33. package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapStyled.d.ts +28 -11
  34. package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.d.ts +3 -1
  35. package/dist/esm/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.d.ts +18 -7
  36. package/dist/esm/components/analytics-chips-and-dropdowns/chart/scoreBlock/ScoreBlock.styled.d.ts +18 -7
  37. package/dist/esm/components/avatar/Avatar.styled.d.ts +4 -2
  38. package/dist/esm/components/bik-chatbot/components/ChatWindow.d.ts +4 -2
  39. package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +49 -18
  40. package/dist/esm/components/bik-layout/CommonStyles.d.ts +88 -28
  41. package/dist/esm/components/bik-layout/SidebarStyles.d.ts +17 -7
  42. package/dist/esm/components/button/Button.styled.d.ts +4 -2
  43. package/dist/esm/components/button/themes.d.ts +16 -2
  44. package/dist/esm/components/buttonGroup/ButtonGroupStyle.d.ts +9 -4
  45. package/dist/esm/components/card-selection-modal/CardSelectionModal.styled.d.ts +7 -2
  46. package/dist/esm/components/card-selector/CardSelector.styled.d.ts +8 -3
  47. package/dist/esm/components/carousel-preview/CarouselPreview.style.d.ts +9 -4
  48. package/dist/esm/components/carousel-secondary/CarouselSecondary.style.d.ts +23 -11
  49. package/dist/esm/components/channel-playground/shell/TestingPlayground.style.d.ts +74 -18
  50. package/dist/esm/components/checkBox/CheckBox.styled.d.ts +9 -4
  51. package/dist/esm/components/checkList/CheckList.styled.d.ts +4 -1
  52. package/dist/esm/components/code-block/CodeBlock.styled.d.ts +43 -20
  53. package/dist/esm/components/colourInput/ColourInput.styled.d.ts +7 -2
  54. package/dist/esm/components/connected-app-dialog/ConnectedAppDialog.styled.d.ts +49 -16
  55. package/dist/esm/components/country-code-picker/CountryCodePicker.styled.d.ts +8 -3
  56. package/dist/esm/components/country-code-picker/CountryPicker.styled.d.ts +8 -3
  57. package/dist/esm/components/curtain/Curtain.styled.d.ts +11 -5
  58. package/dist/esm/components/custom-date-time/CustomDateTime.styled.d.ts +4 -1
  59. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.styled.d.ts +7 -2
  60. package/dist/esm/components/dashboard-review-popup/components/FiveStar.styled.d.ts +7 -2
  61. package/dist/esm/components/dashboard-review-popup/components/Form.styled.d.ts +20 -7
  62. package/dist/esm/components/data-source-panel/DataSourcePanel.style.d.ts +13 -4
  63. package/dist/esm/components/datePicker/DatePicker.styled.d.ts +22 -15
  64. package/dist/esm/components/datePicker/DatePickerWrapper.d.ts +0 -7
  65. package/dist/esm/components/datePicker/DatePickerWrapper.js +64 -66
  66. package/dist/esm/components/datePicker/DatePickerWrapper.js.map +1 -1
  67. package/dist/esm/components/datePicker/DatePickerWrapper.styled.d.ts +8 -4
  68. package/dist/esm/components/datePicker/index.d.ts +0 -1
  69. package/dist/esm/components/discount-modal/DiscountModal.styled.d.ts +17 -6
  70. package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.styled.d.ts +23 -8
  71. package/dist/esm/components/dropdown/ChipDropdown.d.ts +4 -2
  72. package/dist/esm/components/dropdown/Common.styled.d.ts +15 -6
  73. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +12 -5
  74. package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +5 -2
  75. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.d.ts +4 -1
  76. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +18 -4
  77. package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.d.ts +4 -1
  78. package/dist/esm/components/dropdown-button/DropdownButton.style.d.ts +9 -5
  79. package/dist/esm/components/dual-icon-button/DualIconButton.styled.d.ts +12 -5
  80. package/dist/esm/components/file-uploader/FileUploaderStyle.d.ts +9 -4
  81. package/dist/esm/components/floating-action-button/FloatingActionButton.styles.d.ts +24 -13
  82. package/dist/esm/components/half-doughnut-chart/HalfDoughnutChart.styled.d.ts +29 -10
  83. package/dist/esm/components/icon-button/IconButton.styled.d.ts +4 -2
  84. package/dist/esm/components/input/Input.styled.d.ts +114 -29
  85. package/dist/esm/components/keywords-input/KeywordsInput.styled.d.ts +4 -1
  86. package/dist/esm/components/list-item/ListItem.styled.d.ts +4 -2
  87. package/dist/esm/components/list-item/themes.d.ts +1 -1
  88. package/dist/esm/components/modals/modal.styled.d.ts +16 -7
  89. package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +60 -22
  90. package/dist/esm/components/navigation-hyperlink/NavigationHyperlink.d.ts +3 -1
  91. package/dist/esm/components/pagination/Pagination.styled.d.ts +4 -1
  92. package/dist/esm/components/plans/DurationSelectorStyles.d.ts +4 -1
  93. package/dist/esm/components/plans/SubscriptionPlanSelector.d.ts +6 -2
  94. package/dist/esm/components/plans/SubscriptionPlanStyled.d.ts +9 -4
  95. package/dist/esm/components/postPicker/PostPicker.styled.d.ts +43 -13
  96. package/dist/esm/components/product-picker/ProductPicker.styled.d.ts +7 -2
  97. package/dist/esm/components/product-picker-v2/style.d.ts +82 -25
  98. package/dist/esm/components/progress-bar/ProgressBarComponent.d.ts +5 -2
  99. package/dist/esm/components/radioButton/RadioButton.styled.d.ts +8 -3
  100. package/dist/esm/components/radioList/RadioList.styled.d.ts +4 -1
  101. package/dist/esm/components/shimmer/ShimmerComponent/ShimmerStyled.d.ts +9 -4
  102. package/dist/esm/components/side-modal/SideModal.style.d.ts +25 -12
  103. package/dist/esm/components/spinner/Spinner.d.ts +4 -2
  104. package/dist/esm/components/states/StateComponent.styled.d.ts +20 -9
  105. package/dist/esm/components/stepper/Stepper.styled.d.ts +10 -4
  106. package/dist/esm/components/switch/Switch.d.ts +12 -6
  107. package/dist/esm/components/tabs/Tabs.styles.d.ts +30 -9
  108. package/dist/esm/components/tag/Tag.styled.d.ts +4 -2
  109. package/dist/esm/components/template-context-mapper/Badge/index.d.ts +5 -2
  110. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.style.d.ts +14 -5
  111. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +4 -2
  112. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.d.ts +7 -2
  113. package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +24 -6
  114. package/dist/esm/components/template-context-mapper/utils/TemplateConstants.d.ts +16 -8
  115. package/dist/esm/components/template-preview/EmailTemplatePreview.styled.d.ts +23 -10
  116. package/dist/esm/components/template-preview/RCS/RCSPreview.styled.d.ts +70 -20
  117. package/dist/esm/components/template-preview/SMS/SMSBubble.d.ts +7 -2
  118. package/dist/esm/components/template-preview/SmsTemplatePreview.styled.d.ts +27 -10
  119. package/dist/esm/components/template-preview/TemplatePreview.styled.d.ts +4 -1
  120. package/dist/esm/components/template-preview/WhatsApp/ChatHeader.style.d.ts +16 -5
  121. package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +53 -11
  122. package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.d.ts +3 -1
  123. package/dist/esm/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.d.ts +9 -3
  124. package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.d.ts +4 -1
  125. package/dist/esm/components/testimonial-card/TestimonialCard.style.d.ts +30 -11
  126. package/dist/esm/components/thumbnail/Thumbnail.styled.d.ts +4 -2
  127. package/dist/esm/components/toaster/Toaster.styled.d.ts +4 -2
  128. package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.style.d.ts +4 -1
  129. package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.style.d.ts +4 -1
  130. package/dist/esm/components/variable-picker-v3/styles.d.ts +15 -6
  131. package/dist/esm/components/vertical-full-screen-modal/styles.d.ts +15 -6
  132. package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +18 -7
  133. package/dist/esm/editor/BikEditor.styles.d.ts +18 -7
  134. package/dist/esm/editor/extensions/editorDropdown.styles.d.ts +47 -12
  135. package/dist/esm/index.d.ts +0 -3
  136. package/dist/esm/index.js +675 -716
  137. package/dist/esm/index.js.map +1 -1
  138. package/package.json +3 -4
  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 -44
  210. package/dist/esm/components/schedule-builder/StartDateTimePicker.js +0 -119
  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 -17
  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":"StartDateTimePicker.js","sources":["../../../../src/components/schedule-builder/StartDateTimePicker.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { ComboBox } from '../combo-box';\nimport { DateButtonType, DatePickerWrapper } from '../datePicker';\nimport { Dropdown, DropdownOption, SingleOption } from '../dropdown';\nimport { BodySecondary } from '../TypographyStyle';\nimport {\n\tDateFieldColumn,\n\tDatePickerSlot,\n\tFieldLabel,\n\tFieldsRow,\n\tMeridiemDropdownSlot,\n\tRequiredMark,\n\tTimeDropdownSlot,\n\tTimeFieldColumn,\n\tTimeInputRow,\n} from './ScheduleBuilder.styled';\n\n/** Step between offered times, in minutes. */\nconst TIME_STEP_MINUTES = 30;\n\n/**\n * Reads a typed 12-hour time.\n *\n * Accepts \"9\", \"9:5\" and \"09:05\" so the merchant can type naturally; am/pm sits\n * on its own dropdown, so only 1-12 is valid here. Returns null while the text is\n * incomplete, which is what keeps the field editable mid-entry.\n */\nexport const parseTimeText = (\n\ttext: string,\n): { hours: string; minutes: string } | null => {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return null;\n\n\tconst match = trimmed.match(/^(\\d{1,2})(?::(\\d{1,2}))?$/);\n\tif (!match) return null;\n\n\tconst hours = Number(match[1]);\n\t// Minutes are optional: \"9\" means 9:00.\n\tconst minutes = match[2] === undefined ? 0 : Number(match[2]);\n\n\tif (hours < 1 || hours > 12) return null;\n\tif (minutes > 59) return null;\n\n\treturn { hours: String(hours), minutes: String(minutes) };\n};\n\nexport interface StartDateTimePickerProps {\n\t/** The chosen date. Time-of-day is carried separately by hours/minutes/isAm. */\n\tdate?: Date;\n\tonDateChange: (date: Date) => void;\n\t/** 12-hour clock, \"1\"–\"12\". Empty string while nothing is chosen. */\n\thours: string;\n\t/** \"0\"–\"59\". Empty string while nothing is chosen. */\n\tminutes: string;\n\tisAm: boolean;\n\t/** Fires only for a parseable time, so partial typing does not clear state. */\n\tonTimeChange: (time: { hours: string; minutes: string }) => void;\n\tonMeridiemChange: (isAm: boolean) => void;\n\t/** Called when focus leaves an unparseable time, for the caller to validate. */\n\tonTimeInvalidBlur?: () => void;\n\t/** Shown under the time field. The caller owns validation. */\n\ttimeErrorMessage?: string;\n\t/** \"Start date\" when a recurrence follows, plain \"Date\" otherwise. */\n\tdateLabel?: string;\n\tminDate?: Date;\n\t'data-test'?: string;\n}\n\n/**\n * The start date and time-of-day row.\n *\n * Date and time are separate props rather than one Date because the time is\n * edited as text and can be mid-entry (\"9:\" is not a time yet) — folding it into\n * a Date would force a guess about what an incomplete entry means.\n */\nexport const StartDateTimePicker: React.FC<StartDateTimePickerProps> = ({\n\tdate,\n\tonDateChange,\n\thours,\n\tminutes,\n\tisAm,\n\tonTimeChange,\n\tonMeridiemChange,\n\tonTimeInvalidBlur,\n\ttimeErrorMessage,\n\tdateLabel = 'Start date',\n\tminDate,\n\t'data-test': dataTest,\n}) => {\n\t/**\n\t * Times offered in the picker, at TIME_STEP_MINUTES steps. 12 leads the day in\n\t * 12-hour time, so it sorts to the front rather than after 11.\n\t */\n\tconst timeOptions = useMemo(() => {\n\t\tconst values: string[] = [];\n\t\tfor (let hour = 1; hour <= 12; hour += 1) {\n\t\t\tfor (let minute = 0; minute < 60; minute += TIME_STEP_MINUTES) {\n\t\t\t\tvalues.push(`${hour}:${String(minute).padStart(2, '0')}`);\n\t\t\t}\n\t\t}\n\t\tconst twelves = values.filter((value) => value.startsWith('12:'));\n\t\treturn [\n\t\t\t...twelves,\n\t\t\t...values.filter((value) => !twelves.includes(value)),\n\t\t].map((value) => ({ value }));\n\t}, []);\n\n\tconst selectedTimeLabel =\n\t\thours !== '' && minutes !== ''\n\t\t\t? `${hours}:${String(minutes).padStart(2, '0')}`\n\t\t\t: undefined;\n\n\tconst meridiemDropdownOptions: SingleOption[] = [\n\t\t{ label: 'AM', value: 'am', selected: isAm },\n\t\t{ label: 'PM', value: 'pm', selected: !isAm },\n\t];\n\n\treturn (\n\t\t<FieldsRow data-test={dataTest}>\n\t\t\t<DateFieldColumn>\n\t\t\t\t<FieldLabel>\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t{dateLabel}\n\t\t\t\t\t\t<RequiredMark> *</RequiredMark>\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</FieldLabel>\n\t\t\t\t<DatePickerSlot>\n\t\t\t\t\t<DatePickerWrapper\n\t\t\t\t\t\tval={date}\n\t\t\t\t\t\tonChange={(value: Date | Date[]) => {\n\t\t\t\t\t\t\tconst dateValue = Array.isArray(value) ? value[0] : value;\n\t\t\t\t\t\t\tif (dateValue) onDateChange(dateValue);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisplayFormat=\"dd MMM yyyy\"\n\t\t\t\t\t\tdateButtonType={DateButtonType.LARGE}\n\t\t\t\t\t\tcalendarProps={{ minDate }}\n\t\t\t\t\t\tpickerStyles={{ top: 8, zIndex: 4 }}\n\t\t\t\t\t/>\n\t\t\t\t</DatePickerSlot>\n\t\t\t</DateFieldColumn>\n\t\t\t<TimeFieldColumn>\n\t\t\t\t<FieldLabel>\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\tTime\n\t\t\t\t\t\t<RequiredMark> *</RequiredMark>\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</FieldLabel>\n\t\t\t\t{/*\n Top-aligned: the time field's error message sits inside its own slot,\n so centring would drop AM/PM as the message appears.\n */}\n\t\t\t\t<TimeInputRow>\n\t\t\t\t\t<TimeDropdownSlot>\n\t\t\t\t\t\t<ComboBox\n\t\t\t\t\t\t\tdata-test=\"recurrence-time\"\n\t\t\t\t\t\t\tvalue={selectedTimeLabel ?? ''}\n\t\t\t\t\t\t\toptions={timeOptions}\n\t\t\t\t\t\t\tplaceholder=\"hh:mm\"\n\t\t\t\t\t\t\terrorMessage={timeErrorMessage || undefined}\n\t\t\t\t\t\t\tvalidate={(text) => !!parseTimeText(text)}\n\t\t\t\t\t\t\tsanitize={(text) => text.replace(/[^\\d:]/g, '').slice(0, 5)}\n\t\t\t\t\t\t\tformat={(text) => {\n\t\t\t\t\t\t\t\tconst parsed = parseTimeText(text);\n\t\t\t\t\t\t\t\tif (!parsed) return text;\n\t\t\t\t\t\t\t\treturn `${parsed.hours}:${parsed.minutes.padStart(2, '0')}`;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonChange={(text) => {\n\t\t\t\t\t\t\t\tconst parsed = parseTimeText(text);\n\t\t\t\t\t\t\t\tif (!parsed) return;\n\t\t\t\t\t\t\t\tonTimeChange(parsed);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonInvalidBlur={onTimeInvalidBlur}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TimeDropdownSlot>\n\t\t\t\t\t<MeridiemDropdownSlot data-test=\"recurrence-meridiem\">\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tsize=\"default\"\n\t\t\t\t\t\t\tisSearchable={false}\n\t\t\t\t\t\t\tisMultiSelect={false}\n\t\t\t\t\t\t\toptions={meridiemDropdownOptions}\n\t\t\t\t\t\t\tvalue={isAm ? 'AM' : 'PM'}\n\t\t\t\t\t\t\tbuttonWidth=\"100%\"\n\t\t\t\t\t\t\twidth=\"84px\"\n\t\t\t\t\t\t\tplaceHolderHeight=\"48px\"\n\t\t\t\t\t\t\tplaceHolder=\"AM\"\n\t\t\t\t\t\t\tonSelect={(\n\t\t\t\t\t\t\t\tselected: DropdownOption | DropdownOption[] | null,\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tconst normalized = (\n\t\t\t\t\t\t\t\t\tArray.isArray(selected) ? selected[0] : selected\n\t\t\t\t\t\t\t\t) as SingleOption | null;\n\t\t\t\t\t\t\t\tonMeridiemChange(normalized?.value !== 'pm');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MeridiemDropdownSlot>\n\t\t\t\t</TimeInputRow>\n\t\t\t</TimeFieldColumn>\n\t\t</FieldsRow>\n\t);\n};\n"],"names":["TIME_STEP_MINUTES","parseTimeText","text","trimmed","match","hours","minutes","StartDateTimePicker","date","onDateChange","isAm","onTimeChange","onMeridiemChange","onTimeInvalidBlur","timeErrorMessage","dateLabel","minDate","dataTest","timeOptions","useMemo","values","hour","minute","twelves","value","selectedTimeLabel","meridiemDropdownOptions","jsxs","FieldsRow","DateFieldColumn","jsx","FieldLabel","BodySecondary","COLORS","RequiredMark","DatePickerSlot","DatePickerWrapper","dateValue","DateButtonType","TimeFieldColumn","TimeInputRow","TimeDropdownSlot","ComboBox","parsed","MeridiemDropdownSlot","Dropdown","selected","normalized"],"mappings":"yZAmBMA,EAAoB,GASbC,EACZC,GAC+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AS1C,EAAcC,CAAI,EACjC,OAAKyC,EACE,GAAGA,EAAO,KAAK,IAAIA,EAAO,QAAQ,SAAS,EAAG,GAAG,CAAC,GADrCzC,CAErB,EACA,SAAWA,GAAS,CACnB,MAAMyC,EAAS1C,EAAcC,CAAI,EAC5ByC,GACLhC,EAAagC,CAAM,CACpB,EACA,cAAe9B,CAAA,CAAA,EAEjB,EACAiB,EAAAA,IAACc,EAAAA,qBAAA,CAAqB,YAAU,sBAC/B,SAAAd,EAAAA,IAACe,EAAAA,SAAA,CACA,KAAK,UACL,aAAc,GACd,cAAe,GACf,QAASnB,EACT,MAAOhB,EAAO,KAAO,KACrB,YAAY,OACZ,MAAM,OACN,kBAAkB,OAClB,YAAY,KACZ,SACCoC,GACI,CACJ,MAAMC,EACL,MAAM,QAAQD,CAAQ,EAAIA,EAAS,CAAC,EAAIA,EAEzClC,EAAiBmC,GAAY,QAAU,IAAI,CAC5C,CAAA,CAAA,CACD,CACD,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,EACD,CAEF"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("date-fns"),i=require("../../constants/Theme.js"),o=require("../TypographyStyle.js"),t=require("./ScheduleBuilder.styled.js"),u=({runs:r,summary:n,dateFormat:c="EEE d MMM, yyyy","data-test":s})=>r.length?e.jsxs(t.Column,{gap:12,"data-test":s,children:[e.jsxs(t.Column,{gap:8,children:[e.jsx(o.TitleSmall,{color:i.COLORS.content.primary,children:"Upcoming runs"}),e.jsx(t.Column,{gap:16,children:r.map((l,a)=>e.jsxs(t.UpcomingRunItem,{isLast:a===r.length-1,children:[e.jsx(t.UpcomingRunDot,{}),e.jsx(o.BodyCaption,{color:i.COLORS.content.primary,children:d.format(l,c)})]},l.getTime()))})]}),!!n&&e.jsxs(o.BodyCaption,{color:i.COLORS.content.secondary,"data-test":"recurrence-summary",children:["Repeats ",e.jsx(t.SummaryHighlight,{children:n.frequencyLabel})," at ",e.jsx(t.SummaryHighlight,{children:n.timeLabel}),n.tail]})]}):null;exports.UpcomingRunsPreview=u;
2
- //# sourceMappingURL=UpcomingRunsPreview.js.map
@@ -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","ChipG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K,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":";;;;;AAOA,MAAMA,IAAgB,CACrBC,GACAC,MACsB;AACtB,QAAMC,IAAQD,EAAK,KAAA,EAAO,YAAA;AAC1B,SAAKC,IACEF,EAAQ;AAAA,IAAO,CAACG,MACtBA,EAAO,MAAM,YAAA,EAAc,WAAWD,CAAK;AAAA,EAAA,IAFzBF;AAIpB,GAaaI,IAAoC,CAAC;AAAA,EACjD,OAAAC;AAAA,EACA,SAAAL;AAAA,EACA,UAAAM;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC,IAASX;AAAA,EACT,aAAAY;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAaC;AACd,MAAM;AAGL,QAAM,CAACd,GAAMe,CAAO,IAAIC,EAASZ,CAAK,GAChC,CAACa,GAAQC,CAAS,IAAIF,EAAS,EAAK,GACpC,CAACG,GAAaC,CAAc,IAAIJ,EAAS,EAAE,GAC3CK,IAAaC,EAA8B,IAAI,GAC/CC,IAAUD,EAAgC,IAAI,GAI9CE,IAAiBF,EAAO,EAAE,GAG1BG,IAAYH,EAAO,EAAK,GAExBI,IAAkB,CAACC,MAAiB;AACzC,IAAAH,EAAe,UAAUG,GACzBP,EAAeO,CAAI;AAAA,EACpB,GAEMC,IAAc,CAACC,MAAkB;AACtC,IAAAJ,EAAU,UAAUI,GACpBX,EAAUW,CAAI;AAAA,EACf,GAEMC,IAAU,CAACC,MAChBzB,IAAWA,EAASyB,CAAS,IAAIA,EAAU,OAAO,SAAS;AAI5D,EAAAC,EAAU,MAAM;AACf,IAAAjB,EAAQ,CAACkB,M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AQX,CAAK,GACbS,IAAA;AAAA,QACD;AAAA,MAiCY;AAAA,IAAA,GAEV;AAAA,IACCI,KAAU,CAAC,CAACiB,EAAe,UAC3B,gBAAAQ,EAACQ,GAAA,EAAW,KAAK3B,GAAS,MAAK,WAC7B,UAAAW,EAAe,IAAI,CAAChC,GAAQiD,MAC5B,gBAAAT;AAAA,MAACU;AAAA,MAAA;AAAA,QAEA,MAAK;AAAA,QACL,iBAAelD,EAAO,UAAUE;AAAA,QAChC,UAAU+C,MAAUhC;AAAA,QACpB,YAAYjB,EAAO,UAAUE;AAAA,QAG7B,aAAa,CAACiC,MAAU;AACvB,UAAAA,EAAM,eAAA,GACNE,EAAarC,CAAM;AAAA,QACpB;AAAA,QAEC,UAAAA,EAAO,SAASA,EAAO;AAAA,MAAA;AAAA,MAZnBA,EAAO;AAAA,IAAA,CAcb,EAAA,CACF;AAAA,EAAA,GAEF;AAEF;"}
@@ -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';