@lifesg/react-design-system 4.0.0-alpha.3 → 4.0.0-alpha.4
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.
- package/accordion/accordion-item.styles.js +1 -1
- package/accordion/accordion-item.styles.js.map +1 -1
- package/accordion/{accordion-item.styles_kchcad.css → accordion-item.styles_1j4eb32.css} +2 -2
- package/accordion/accordion.styles.js +1 -1
- package/{cjs/accordion/accordion.styles_ijglff.css → accordion/accordion.styles_bzrfrs.css} +1 -1
- package/alert/alert.styles.js +1 -1
- package/alert/alert.styles.js.map +1 -1
- package/{cjs/alert/alert.styles_1ygel36.css → alert/alert.styles_patwo2.css} +4 -4
- package/badge/badge.js +1 -1
- package/badge/badge.js.map +1 -1
- package/badge/badge.styles.js +1 -1
- package/badge/badge.styles_1c3c6wj.css +16 -0
- package/badge/types.d.ts +1 -1
- package/box-container/box-container.styles.js +1 -1
- package/box-container/box-container.styles.js.map +1 -1
- package/box-container/{box-container.styles_5y84d5.css → box-container.styles_5t2j9k.css} +2 -2
- package/breadcrumb/breadcrumb.js +1 -1
- package/breadcrumb/breadcrumb.js.map +1 -1
- package/button/button.styles.js +1 -1
- package/button/button.styles.js.map +1 -1
- package/button/{button.styles_bcpkzm.css → button.styles_1pxy0co.css} +3 -3
- package/calendar/calendar.js +1 -1
- package/calendar/calendar.js.map +1 -1
- package/cjs/accordion/accordion-item.styles.js +1 -1
- package/cjs/accordion/accordion-item.styles.js.map +1 -1
- package/cjs/accordion/{accordion-item.styles_kchcad.css → accordion-item.styles_1j4eb32.css} +2 -2
- package/cjs/accordion/accordion.styles.js +1 -1
- package/{accordion/accordion.styles_ijglff.css → cjs/accordion/accordion.styles_bzrfrs.css} +1 -1
- package/cjs/alert/alert.styles.js +1 -1
- package/cjs/alert/alert.styles.js.map +1 -1
- package/{alert/alert.styles_1ygel36.css → cjs/alert/alert.styles_patwo2.css} +4 -4
- package/cjs/badge/badge.js +1 -1
- package/cjs/badge/badge.js.map +1 -1
- package/cjs/badge/badge.styles.js +1 -1
- package/cjs/badge/badge.styles_1c3c6wj.css +16 -0
- package/cjs/box-container/box-container.styles.js +1 -1
- package/cjs/box-container/box-container.styles.js.map +1 -1
- package/cjs/box-container/{box-container.styles_5y84d5.css → box-container.styles_5t2j9k.css} +2 -2
- package/cjs/breadcrumb/breadcrumb.js +1 -1
- package/cjs/breadcrumb/breadcrumb.js.map +1 -1
- package/cjs/button/button.styles.js +1 -1
- package/cjs/button/button.styles.js.map +1 -1
- package/cjs/button/{button.styles_bcpkzm.css → button.styles_1pxy0co.css} +3 -3
- package/cjs/calendar/calendar.js +1 -1
- package/cjs/calendar/calendar.js.map +1 -1
- package/cjs/countdown-timer/countdown-timer.styles.js +1 -1
- package/cjs/countdown-timer/{countdown-timer.styles_k50tkw.css → countdown-timer.styles_ipn1b0.css} +1 -1
- package/cjs/dashed-border/dashed-border.js +1 -1
- package/cjs/dashed-border/dashed-border.js.map +1 -1
- package/cjs/data-table/data-table.js +1 -1
- package/cjs/data-table/data-table.js.map +1 -1
- package/cjs/data-table/data-table.styles.js +1 -1
- package/cjs/data-table/{data-table.styles_1nj2uzq.css → data-table.styles_1iqq1g7.css} +1 -1
- package/cjs/date-input/date-input.js +1 -1
- package/cjs/date-input/date-input.js.map +1 -1
- package/cjs/date-navigator/date-navigator.styles.js +1 -1
- package/cjs/date-navigator/date-navigator.styles.js.map +1 -1
- package/cjs/date-navigator/date-navigator.styles_wokh56.css +4 -0
- package/cjs/divider/divider.js.map +1 -1
- package/cjs/e-signature/e-signature-canvas.js +1 -1
- package/cjs/e-signature/e-signature-canvas.js.map +1 -1
- package/cjs/e-signature/e-signature.js +1 -1
- package/cjs/e-signature/e-signature.js.map +1 -1
- package/cjs/e-signature/e-signature.styles.js +1 -168
- package/cjs/e-signature/e-signature.styles.js.map +1 -1
- package/cjs/e-signature/e-signature.styles_lukd9f.css +17 -0
- package/cjs/error-display/error-display-data.js +1 -1
- package/cjs/error-display/error-display-data.js.map +1 -1
- package/cjs/external/lodash/get.js +1 -1
- package/cjs/external/lodash/get.js.map +1 -1
- package/cjs/file-download/file-download.js +1 -1
- package/cjs/file-download/file-download.js.map +1 -1
- package/cjs/file-download/file-download.styles.js +1 -32
- package/cjs/file-download/file-download.styles.js.map +1 -1
- package/cjs/file-download/file-download.styles_iggk8q.css +8 -0
- package/cjs/file-download/file-list-card/file-list-card.js +1 -1
- package/cjs/file-download/file-list-card/file-list-card.js.map +1 -1
- package/cjs/file-download/file-list-card/file-list-card.styles.js +1 -177
- package/cjs/file-download/file-list-card/file-list-card.styles.js.map +1 -1
- package/cjs/file-download/file-list-card/file-list-card.styles_oom8ii.css +16 -0
- package/cjs/file-upload/file-list/file-list.js +2 -0
- package/cjs/file-upload/file-list/file-list.js.map +1 -0
- package/cjs/file-upload/file-list/file-list.styles.js +2 -0
- package/cjs/file-upload/file-list/file-list.styles.js.map +1 -0
- package/cjs/file-upload/file-list/file-list.styles_1ea12kj.css +3 -0
- package/cjs/file-upload/file-list-item/file-list-item-thumbnail.styles.js +1 -1
- package/cjs/file-upload/file-list-item/{file-list-item-thumbnail.styles_1vrh1ve.css → file-list-item-thumbnail.styles_1y4si19.css} +1 -1
- package/cjs/file-upload/file-upload.js +1 -1
- package/cjs/file-upload/file-upload.js.map +1 -1
- package/cjs/filter/addons/filter-item-checkbox.styles.js +1 -1
- package/cjs/filter/addons/filter-item-checkbox.styles.js.map +1 -1
- package/cjs/filter/addons/{filter-item-checkbox.styles_18l87i2.css → filter-item-checkbox.styles_7degw7.css} +1 -1
- package/cjs/filter/filter-badge.js +2 -0
- package/cjs/filter/filter-badge.js.map +1 -0
- package/cjs/filter/filter-item-page.js +1 -1
- package/cjs/filter/filter-item-page.js.map +1 -1
- package/cjs/filter/filter-item.styles.js +1 -1
- package/cjs/filter/filter-item.styles.js.map +1 -1
- package/{filter/filter-item.styles_1e3v6qq.css → cjs/filter/filter-item.styles_cphjnj.css} +2 -2
- package/cjs/filter/filter-modal.js +1 -1
- package/cjs/filter/filter-modal.js.map +1 -1
- package/cjs/filter/filter-modal.styles.js +1 -1
- package/cjs/filter/filter-modal.styles.js.map +1 -1
- package/cjs/filter/filter-modal.styles_qw3xlg.css +10 -0
- package/cjs/filter/filter-sidebar.js +1 -1
- package/cjs/filter/filter-sidebar.js.map +1 -1
- package/cjs/filter/filter-sidebar.styles.js +1 -1
- package/cjs/filter/filter-sidebar.styles.js.map +1 -1
- package/cjs/filter/filter-sidebar.styles_1otwpjl.css +5 -0
- package/cjs/filter/filter.styles.js +1 -1
- package/cjs/filter/filter.styles.js.map +1 -1
- package/cjs/filter/{filter.styles_2fmaok.css → filter.styles_1ykijwm.css} +1 -1
- package/cjs/form/form-label.styles.js +1 -1
- package/cjs/form/form-label.styles.js.map +1 -1
- package/cjs/form/form-label.styles_11r0652.css +6 -0
- package/cjs/form/form-wrapper.js +1 -1
- package/cjs/form/form-wrapper.js.map +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
- package/cjs/image-button/image-button.styles.js +1 -1
- package/cjs/image-button/{image-button.styles_qtt605.css → image-button.styles_6n1qsr.css} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/input-group/input-group-list-addon.js +1 -1
- package/cjs/input-group/input-group-list-addon.js.map +1 -1
- package/cjs/input-group/input-group.styles.js +1 -1
- package/{input-group/input-group.styles_fpy81r.css → cjs/input-group/input-group.styles_bqye6f.css} +1 -1
- package/cjs/input-multi-select/input-multi-select.js +1 -1
- package/cjs/input-multi-select/input-multi-select.js.map +1 -1
- package/cjs/input-nested-multi-select/input-nested-multi-select.js +1 -1
- package/cjs/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
- package/cjs/input-nested-select/input-nested-select.js +1 -1
- package/cjs/input-nested-select/input-nested-select.js.map +1 -1
- package/cjs/input-range-select/input-range-select.js +1 -1
- package/cjs/input-range-select/input-range-select.js.map +1 -1
- package/cjs/input-select/input-select.js +1 -1
- package/cjs/input-select/input-select.js.map +1 -1
- package/cjs/input-textarea/textarea-counter.styles.js +1 -1
- package/cjs/input-textarea/textarea-counter.styles.js.map +1 -1
- package/cjs/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -0
- package/cjs/input-textarea/textarea.styles.js +1 -1
- package/cjs/input-textarea/textarea.styles_22z4n3.css +5 -0
- package/cjs/language-switcher/dropdown-panel.styles.js +1 -1
- package/cjs/language-switcher/dropdown-panel.styles.js.map +1 -1
- package/cjs/language-switcher/{dropdown-panel.styles_1z0n7qq.css → dropdown-panel.styles_1qsjf8d.css} +1 -1
- package/cjs/language-switcher/dropdown-variant.js +1 -1
- package/cjs/language-switcher/dropdown-variant.js.map +1 -1
- package/cjs/language-switcher/dropdown-variant.styles.js +1 -1
- package/cjs/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -0
- package/cjs/language-switcher/link-container-variant.styles.js +1 -1
- package/cjs/language-switcher/{link-container-variant.styles_1blx9qm.css → link-container-variant.styles_1iw6zux.css} +1 -1
- package/cjs/layout/col-div.js +1 -1
- package/cjs/layout/col-div.js.map +1 -1
- package/cjs/link-list/link-list.styles.js +1 -1
- package/cjs/link-list/link-list.styles.js.map +1 -1
- package/{link-list/link-list.styles_1g33nb4.css → cjs/link-list/link-list.styles_m57vks.css} +2 -2
- package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js +1 -1
- package/{local-nav/local-nav-dropdown/local-nav-dropdown.styles_ftv36t.css → cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css} +1 -1
- package/cjs/markup/markup.js +1 -1
- package/cjs/markup/markup.js.map +1 -1
- package/cjs/markup/markup.style.js +1 -1
- package/cjs/markup/markup.style.js.map +1 -1
- package/cjs/masked-input/masked-input.styles.js +1 -1
- package/cjs/masked-input/masked-input.styles.js.map +1 -1
- package/{masked-input/masked-input.styles_4i1qsy.css → cjs/masked-input/masked-input.styles_1cm388a.css} +2 -2
- package/cjs/masthead/masthead.js +1 -1
- package/cjs/masthead/masthead.js.map +1 -1
- package/cjs/modal/modal-box.styles.js +1 -1
- package/cjs/modal/modal-box.styles.js.map +1 -1
- package/cjs/modal/modal-box.styles_y52cts.css +11 -0
- package/cjs/modal/modal.js +1 -1
- package/cjs/modal/modal.js.map +1 -1
- package/cjs/modal/modal.styles.js +1 -1
- package/cjs/modal/modal.styles.js.map +1 -1
- package/cjs/modal/{modal.styles_1sav73f.css → modal.styles_1lbblx6.css} +1 -1
- package/cjs/modal-v2/modal-v2.js +1 -1
- package/cjs/modal-v2/modal-v2.js.map +1 -1
- package/cjs/modal-v2/modal-v2.styles.js +1 -1
- package/cjs/modal-v2/modal-v2.styles.js.map +1 -1
- package/cjs/modal-v2/modal-v2.styles_a8gv5i.css +3 -0
- package/cjs/modal-v2/slots/card.js +1 -1
- package/cjs/modal-v2/slots/card.js.map +1 -1
- package/cjs/navbar/navbar-items.styles.js +1 -1
- package/cjs/navbar/navbar-items.styles.js.map +1 -1
- package/cjs/navbar/{navbar-items.styles_i9cunu.css → navbar-items.styles_1i3ltot.css} +7 -7
- package/cjs/navbar/navbar.js +1 -1
- package/cjs/navbar/navbar.js.map +1 -1
- package/cjs/notification-banner/notification-banner.styles.js +1 -1
- package/cjs/notification-banner/notification-banner.styles.js.map +1 -1
- package/{notification-banner/notification-banner.styles_130loac.css → cjs/notification-banner/notification-banner.styles_uxlysy.css} +2 -2
- package/cjs/otp-verification/contact-input-section.js +1 -1
- package/cjs/otp-verification/contact-input-section.js.map +1 -1
- package/cjs/otp-verification/contact-input-section.styles.js +2 -0
- package/cjs/otp-verification/contact-input-section.styles.js.map +1 -0
- package/cjs/otp-verification/contact-input-section.styles_odrjvt.css +14 -0
- package/cjs/otp-verification/otp-verification.js +1 -1
- package/cjs/otp-verification/otp-verification.js.map +1 -1
- package/cjs/otp-verification/otp-verification.styles.js +2 -0
- package/cjs/otp-verification/otp-verification.styles.js.map +1 -0
- package/cjs/otp-verification/otp-verification.styles_dg9bm8.css +1 -0
- package/cjs/otp-verification/thumbnail/email-thumbnail.js +1 -21
- package/cjs/otp-verification/thumbnail/email-thumbnail.js.map +1 -1
- package/cjs/otp-verification/thumbnail/phone-thumbnail.js +1 -17
- package/cjs/otp-verification/thumbnail/phone-thumbnail.js.map +1 -1
- package/cjs/otp-verification/thumbnail/thumbnail.styles.js +2 -0
- package/cjs/otp-verification/thumbnail/thumbnail.styles.js.map +1 -0
- package/cjs/otp-verification/thumbnail/thumbnail.styles_shqylh.css +3 -0
- package/cjs/otp-verification/verification-section.js +1 -1
- package/cjs/otp-verification/verification-section.js.map +1 -1
- package/cjs/otp-verification/verification-section.styles.js +2 -0
- package/cjs/otp-verification/verification-section.styles.js.map +1 -0
- package/cjs/otp-verification/verification-section.styles_x8jj.css +5 -0
- package/cjs/pagination/pagination.styles.js +1 -1
- package/cjs/pagination/pagination.styles.js.map +1 -1
- package/{pagination/pagination.styles_1u898rb.css → cjs/pagination/pagination.styles_6bcgva.css} +3 -3
- package/cjs/pill/pill.styles.js +1 -1
- package/{pill/pill.styles_1wiyl8.css → cjs/pill/pill.styles_xwrniu.css} +1 -1
- package/cjs/predictive-text-input/predictive-text-input.js +1 -1
- package/cjs/predictive-text-input/predictive-text-input.js.map +1 -1
- package/cjs/schedule/const.js +1 -1
- package/cjs/schedule/const.js.map +1 -1
- package/cjs/schedule/schedule-day-view/schedule-day-view.js +1 -1
- package/cjs/schedule/schedule-day-view/schedule-day-view.js.map +1 -1
- package/cjs/schedule/schedule-day-view/schedule-day-view.styles.js +1 -152
- package/cjs/schedule/schedule-day-view/schedule-day-view.styles.js.map +1 -1
- package/cjs/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +30 -0
- package/cjs/schedule/schedule-header/schedule-header.js +1 -1
- package/cjs/schedule/schedule-header/schedule-header.js.map +1 -1
- package/cjs/schedule/schedule-header/schedule-header.styles.js +2 -0
- package/cjs/schedule/schedule-header/schedule-header.styles.js.map +1 -0
- package/cjs/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +6 -0
- package/cjs/schedule/schedule-slot-content/schedule-slot-content.js +2 -0
- package/cjs/schedule/schedule-slot-content/schedule-slot-content.js.map +1 -0
- package/cjs/schedule/schedule-slot-content/style-helper.js +2 -0
- package/cjs/schedule/schedule-slot-content/style-helper.js.map +1 -0
- package/cjs/schedule/schedule-week-view/schedule-week-view.js +1 -1
- package/cjs/schedule/schedule-week-view/schedule-week-view.js.map +1 -1
- package/cjs/schedule/schedule-week-view/schedule-week-view.styles.js +1 -74
- package/cjs/schedule/schedule-week-view/schedule-week-view.styles.js.map +1 -1
- package/cjs/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +10 -0
- package/cjs/schedule/schedule-week-view/time-cell.js +1 -1
- package/cjs/schedule/schedule-week-view/time-cell.js.map +1 -1
- package/cjs/schedule/schedule-week-view/time-cell.styles.js +1 -34
- package/cjs/schedule/schedule-week-view/time-cell.styles.js.map +1 -1
- package/cjs/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +14 -0
- package/cjs/schedule/schedule-week-view/week-view-utils.js +1 -1
- package/cjs/schedule/schedule-week-view/week-view-utils.js.map +1 -1
- package/cjs/schedule/schedule.js +1 -1
- package/cjs/schedule/schedule.js.map +1 -1
- package/cjs/schedule/schedule.styles.js +1 -26
- package/cjs/schedule/schedule.styles.js.map +1 -1
- package/cjs/schedule/schedule.styles_fdy5a1.css +5 -0
- package/cjs/schedule/shared/with-optional-popover.js +1 -5
- package/cjs/schedule/shared/with-optional-popover.js.map +1 -1
- package/cjs/schedule/shared/with-optional-popover.styles.js +2 -0
- package/cjs/schedule/shared/with-optional-popover.styles.js.map +1 -0
- package/cjs/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -0
- package/cjs/schedule/time-indicator/time-indicator.js +1 -1
- package/cjs/schedule/time-indicator/time-indicator.js.map +1 -1
- package/cjs/schedule/time-indicator/time-indicator.styles.js +1 -33
- package/cjs/schedule/time-indicator/time-indicator.styles.js.map +1 -1
- package/cjs/schedule/time-indicator/time-indicator.styles_1eaxyes.css +6 -0
- package/cjs/select-histogram/select-histogram.js +1 -1
- package/cjs/select-histogram/select-histogram.js.map +1 -1
- package/cjs/select-histogram/select-histogram.styles.js +1 -1
- package/cjs/select-histogram/select-histogram.styles.js.map +1 -1
- package/cjs/select-histogram/{select-histogram.styles_11916eo.css → select-histogram.styles_n260dy.css} +1 -1
- package/cjs/shared/dropdown-list/dropdown-label.js +1 -1
- package/cjs/shared/dropdown-list/dropdown-label.js.map +1 -1
- package/cjs/shared/dropdown-list/dropdown-label.styles.js +1 -1
- package/cjs/shared/dropdown-list/dropdown-label.styles.js.map +1 -1
- package/{shared/dropdown-list/dropdown-label.styles_1dwmd8f.css → cjs/shared/dropdown-list/dropdown-label.styles_mloii0.css} +4 -4
- package/cjs/shared/dropdown-list/dropdown-list.styles.js +1 -1
- package/cjs/shared/dropdown-list/dropdown-list.styles.js.map +1 -1
- package/{shared/dropdown-list/dropdown-list.styles_1kt4zhf.css → cjs/shared/dropdown-list/dropdown-list.styles_konwm.css} +4 -4
- package/cjs/shared/dropdown-list/dropdown-search.styles.js +1 -1
- package/cjs/shared/dropdown-list/dropdown-search.styles.js.map +1 -1
- package/{shared/dropdown-list/dropdown-search.styles_4r9oma.css → cjs/shared/dropdown-list/dropdown-search.styles_1hc1gkh.css} +2 -2
- package/cjs/shared/dropdown-list/expandable-element.js +1 -1
- package/cjs/shared/dropdown-list/expandable-element.js.map +1 -1
- package/cjs/shared/dropdown-list/expandable-element.styles.js +1 -1
- package/cjs/shared/dropdown-list/expandable-element.styles.js.map +1 -1
- package/cjs/shared/dropdown-list/expandable-element.styles_rkkvqr.css +5 -0
- package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles.js +1 -1
- package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles.js.map +1 -1
- package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +3 -0
- package/cjs/shared/hooks/useViewport.js +1 -1
- package/cjs/shared/hooks/useViewport.js.map +1 -1
- package/cjs/shared/input-wrapper/input-wrapper.styles.js +1 -1
- package/cjs/shared/input-wrapper/{input-wrapper.styles_19fpzb.css → input-wrapper.styles_je6maw.css} +2 -2
- package/cjs/shared/internal-calendar/calendar-manager.styles.js +1 -1
- package/cjs/shared/internal-calendar/{calendar-manager.styles_1q13ylk.css → calendar-manager.styles_1iuq5zw.css} +1 -1
- package/cjs/shared/internal-calendar/day-cell/day-cell.styles.js +1 -1
- package/cjs/shared/internal-calendar/day-cell/day-cell.styles.js.map +1 -1
- package/{shared/internal-calendar/day-cell/day-cell.styles_vazxvn.css → cjs/shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css} +1 -1
- package/cjs/shared/internal-calendar/internal-calendar-month.styles.js +1 -1
- package/{shared/internal-calendar/internal-calendar-month.styles_1pk3ynj.css → cjs/shared/internal-calendar/internal-calendar-month.styles_14oh57f.css} +1 -1
- package/cjs/shared/internal-calendar/internal-calendar-year.styles.js +1 -1
- package/cjs/shared/internal-calendar/internal-calendar-year.styles.js.map +1 -1
- package/cjs/shared/internal-calendar/{internal-calendar-year.styles_1azy42u.css → internal-calendar-year.styles_therlc.css} +1 -1
- package/cjs/shared/internal-calendar/single/single-cell.js +1 -1
- package/cjs/shared/internal-calendar/single/single-cell.js.map +1 -1
- package/cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles.js +1 -1
- package/{shared/internal-calendar/standard/standard-calendar-day-view.styles_1dbvup3.css → cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css} +1 -1
- package/cjs/shared/standalone-date-input/standalone-date-input.js +1 -1
- package/cjs/shared/standalone-date-input/standalone-date-input.js.map +1 -1
- package/cjs/shared/standalone-date-input/standalone-date-input.styles.js +1 -1
- package/cjs/shared/standalone-date-input/standalone-date-input.styles.js.map +1 -1
- package/cjs/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +15 -0
- package/cjs/shared/time-slot/time-slot.js +1 -1
- package/cjs/shared/time-slot/time-slot.js.map +1 -1
- package/cjs/shared/time-slot/time-slot.styles.js +1 -1
- package/cjs/shared/time-slot/time-slot.styles.js.map +1 -1
- package/cjs/shared/time-slot/time-slot.styles_18s0to7.css +29 -0
- package/cjs/sidenav/sidenav-drawer-item.styles.js +1 -1
- package/cjs/sidenav/sidenav-drawer-item.styles.js.map +1 -1
- package/cjs/sidenav/{sidenav-drawer-item.styles_yp8cga.css → sidenav-drawer-item.styles_1ljnyx2.css} +1 -1
- package/cjs/sidenav/sidenav-drawer-subitem.styles.js +1 -1
- package/cjs/sidenav/sidenav-drawer-subitem.styles.js.map +1 -1
- package/cjs/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -0
- package/cjs/sidenav/sidenav-item.styles.js +1 -1
- package/cjs/sidenav/sidenav-item.styles.js.map +1 -1
- package/cjs/sidenav/{sidenav-item.styles_1eew8px.css → sidenav-item.styles_lqw3kh.css} +2 -2
- package/cjs/smart-app-banner/smart-app-banner.styles.js +1 -1
- package/cjs/smart-app-banner/smart-app-banner.styles.js.map +1 -1
- package/cjs/smart-app-banner/{smart-app-banner.styles_m5dtgh.css → smart-app-banner.styles_15u6yv4.css} +2 -2
- package/cjs/tab/tab-link-chain.styles.js +1 -1
- package/cjs/tab/tab-link-chain.styles.js.map +1 -1
- package/cjs/tab/{tab-link-chain.styles_1nreqrp.css → tab-link-chain.styles_49got4.css} +2 -2
- package/cjs/tag/tag.style.js +1 -1
- package/cjs/tag/{tag.style_10tn8i.css → tag.style_d98c53.css} +2 -2
- package/cjs/text-list/text-list.styles.js +1 -1
- package/cjs/text-list/text-list.styles.js.map +1 -1
- package/cjs/text-list/text-list.styles_w3fvyt.css +16 -0
- package/cjs/theme/index.js +1 -1
- package/cjs/theme/theme-provider/hooks.js +1 -1
- package/cjs/theme/theme-provider/hooks.js.map +1 -1
- package/cjs/theme/tokens/colour.js +1 -1
- package/cjs/theme/tokens/colour.js.map +1 -1
- package/cjs/theme/tokens/font.js +1 -1
- package/cjs/theme/tokens/font.js.map +1 -1
- package/cjs/theme/types.js +1 -1
- package/cjs/theme/types.js.map +1 -1
- package/cjs/theme/utils/css-variable.js +1 -1
- package/cjs/theme/utils/css-variable.js.map +1 -1
- package/cjs/theme/utils/font.js +1 -1
- package/cjs/theme/utils/font.js.map +1 -1
- package/cjs/theme/utils/token-resolver.js +1 -1
- package/cjs/theme/utils/token-resolver.js.map +1 -1
- package/cjs/theme/utils/use-design-token.js +1 -1
- package/cjs/theme/utils/use-design-token.js.map +1 -1
- package/cjs/theme/utils/use-media-query.js +1 -1
- package/cjs/theme/utils/use-media-query.js.map +1 -1
- package/cjs/time-range-picker/combobox-picker/combobox-picker.js +1 -1
- package/cjs/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
- package/cjs/time-slot-bar-week/consts.js +2 -0
- package/cjs/time-slot-bar-week/consts.js.map +1 -0
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.js +1 -1
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.js.map +1 -1
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles.js +2 -0
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles.js.map +1 -0
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +17 -0
- package/cjs/time-slot-bar-week/time-slot-bar-week.js +1 -1
- package/cjs/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
- package/cjs/time-slot-bar-week/time-slot-bar-week.styles.js +2 -0
- package/cjs/time-slot-bar-week/time-slot-bar-week.styles.js.map +1 -0
- package/cjs/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -0
- package/cjs/time-slot-bar-week/time-slot-cell.js +2 -0
- package/cjs/time-slot-bar-week/time-slot-cell.js.map +1 -0
- package/cjs/time-slot-week-view/time-slot-week-days.js +1 -1
- package/cjs/time-slot-week-view/time-slot-week-days.js.map +1 -1
- package/cjs/time-slot-week-view/time-slot-week-days.styles.js +2 -0
- package/cjs/time-slot-week-view/time-slot-week-days.styles.js.map +1 -0
- package/cjs/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +9 -0
- package/cjs/time-slot-week-view/time-slot-week-view.js +1 -1
- package/cjs/time-slot-week-view/time-slot-week-view.js.map +1 -1
- package/cjs/time-slot-week-view/time-slot-week-view.styles.js +1 -9
- package/cjs/time-slot-week-view/time-slot-week-view.styles.js.map +1 -1
- package/cjs/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -0
- package/cjs/timeline/timeline.styles.js +1 -1
- package/{timeline/timeline.styles_1wcnzot.css → cjs/timeline/timeline.styles_1jxzik4.css} +1 -1
- package/cjs/timepicker/timepicker.js +1 -1
- package/cjs/timepicker/timepicker.js.map +1 -1
- package/cjs/timepicker/timepicker.styles.js +1 -1
- package/cjs/timepicker/timepicker.styles.js.map +1 -1
- package/cjs/timepicker/timepicker.styles_1jm33yw.css +1 -0
- package/cjs/toast/toast.styles.js +1 -1
- package/cjs/toast/toast.styles.js.map +1 -1
- package/cjs/toast/{toast.styles_ngrlup.css → toast.styles_1e0l60w.css} +1 -1
- package/cjs/toggle/toggle.styles.js +1 -1
- package/cjs/toggle/toggle.styles.js.map +1 -1
- package/{toggle/toggle.styles_1yzqsu.css → cjs/toggle/toggle.styles_1t5qrye.css} +5 -5
- package/cjs/typography/typography.js +1 -1
- package/cjs/typography/typography.js.map +1 -1
- package/cjs/typography/typography.styles.js +1 -1
- package/cjs/typography/typography.styles.js.map +1 -1
- package/cjs/typography/typography.styles_1155j4c.css +11 -0
- package/cjs/uneditable-section/section-item.styles.js +1 -1
- package/cjs/uneditable-section/section-item.styles.js.map +1 -1
- package/cjs/uneditable-section/{section-item.styles_1dfjzc4.css → section-item.styles_mwx8ht.css} +2 -2
- package/cjs/util/is-styled-components.js +2 -0
- package/cjs/util/is-styled-components.js.map +1 -0
- package/cjs/util/styling-helper.js +1 -1
- package/cjs/util/styling-helper.js.map +1 -1
- package/codemod-utils.d.ts +1 -0
- package/codemods/codemod-utils.ts +17 -0
- package/codemods/index.ts +231 -75
- package/codemods/migrate-popover/index.ts +267 -0
- package/codemods/run-codemod.js +6 -53
- package/codemods/run-codemod.js.map +1 -1
- package/codemods/run-codemod.ts +7 -54
- package/countdown-timer/countdown-timer.styles.js +1 -1
- package/countdown-timer/{countdown-timer.styles_k50tkw.css → countdown-timer.styles_ipn1b0.css} +1 -1
- package/dashed-border/dashed-border.js +1 -1
- package/dashed-border/dashed-border.js.map +1 -1
- package/data-table/data-table.js +1 -1
- package/data-table/data-table.js.map +1 -1
- package/data-table/data-table.styles.js +1 -1
- package/data-table/{data-table.styles_1nj2uzq.css → data-table.styles_1iqq1g7.css} +1 -1
- package/date-input/date-input.js +1 -1
- package/date-input/date-input.js.map +1 -1
- package/date-navigator/date-navigator.styles.js +1 -1
- package/date-navigator/date-navigator.styles.js.map +1 -1
- package/date-navigator/date-navigator.styles_wokh56.css +4 -0
- package/divider/divider.js.map +1 -1
- package/e-signature/e-signature-canvas.js +1 -1
- package/e-signature/e-signature-canvas.js.map +1 -1
- package/e-signature/e-signature.js +1 -1
- package/e-signature/e-signature.js.map +1 -1
- package/e-signature/e-signature.styles.d.ts +17 -45
- package/e-signature/e-signature.styles.js +1 -168
- package/e-signature/e-signature.styles.js.map +1 -1
- package/e-signature/e-signature.styles_lukd9f.css +17 -0
- package/error-display/error-display-data.js +1 -1
- package/error-display/error-display-data.js.map +1 -1
- package/external/lodash/get.js +1 -1
- package/external/lodash/get.js.map +1 -1
- package/file-download/file-download.js +1 -1
- package/file-download/file-download.js.map +1 -1
- package/file-download/file-download.styles.d.ts +8 -11
- package/file-download/file-download.styles.js +1 -32
- package/file-download/file-download.styles.js.map +1 -1
- package/file-download/file-download.styles_iggk8q.css +8 -0
- package/file-download/file-list-card/file-list-card.js +1 -1
- package/file-download/file-list-card/file-list-card.js.map +1 -1
- package/file-download/file-list-card/file-list-card.styles.d.ts +16 -64
- package/file-download/file-list-card/file-list-card.styles.js +1 -177
- package/file-download/file-list-card/file-list-card.styles.js.map +1 -1
- package/file-download/file-list-card/file-list-card.styles_oom8ii.css +16 -0
- package/file-upload/{file-list.d.ts → file-list/file-list.d.ts} +1 -1
- package/file-upload/file-list/file-list.js +2 -0
- package/file-upload/file-list/file-list.js.map +1 -0
- package/file-upload/file-list/file-list.styles.js +2 -0
- package/file-upload/file-list/file-list.styles.js.map +1 -0
- package/file-upload/file-list/file-list.styles_1ea12kj.css +3 -0
- package/file-upload/file-list/index.d.ts +1 -0
- package/file-upload/file-list-item/file-list-item-thumbnail.styles.js +1 -1
- package/file-upload/file-list-item/{file-list-item-thumbnail.styles_1vrh1ve.css → file-list-item-thumbnail.styles_1y4si19.css} +1 -1
- package/file-upload/file-upload.js +1 -1
- package/file-upload/file-upload.js.map +1 -1
- package/filter/addons/filter-item-checkbox.styles.js +1 -1
- package/filter/addons/filter-item-checkbox.styles.js.map +1 -1
- package/filter/addons/{filter-item-checkbox.styles_18l87i2.css → filter-item-checkbox.styles_7degw7.css} +1 -1
- package/filter/filter-badge.d.ts +5 -0
- package/filter/filter-badge.js +2 -0
- package/filter/filter-badge.js.map +1 -0
- package/filter/filter-item-page.d.ts +1 -1
- package/filter/filter-item-page.js +1 -1
- package/filter/filter-item-page.js.map +1 -1
- package/filter/filter-item.styles.js +1 -1
- package/filter/filter-item.styles.js.map +1 -1
- package/{cjs/filter/filter-item.styles_1e3v6qq.css → filter/filter-item.styles_cphjnj.css} +2 -2
- package/filter/filter-modal.d.ts +1 -1
- package/filter/filter-modal.js +1 -1
- package/filter/filter-modal.js.map +1 -1
- package/filter/filter-modal.styles.d.ts +2 -0
- package/filter/filter-modal.styles.js +1 -1
- package/filter/filter-modal.styles.js.map +1 -1
- package/filter/filter-modal.styles_qw3xlg.css +10 -0
- package/filter/filter-sidebar.d.ts +1 -1
- package/filter/filter-sidebar.js +1 -1
- package/filter/filter-sidebar.js.map +1 -1
- package/filter/filter-sidebar.styles.d.ts +1 -0
- package/filter/filter-sidebar.styles.js +1 -1
- package/filter/filter-sidebar.styles.js.map +1 -1
- package/filter/filter-sidebar.styles_1otwpjl.css +5 -0
- package/filter/filter.d.ts +3 -3
- package/filter/filter.styles.js +1 -1
- package/filter/filter.styles.js.map +1 -1
- package/filter/{filter.styles_2fmaok.css → filter.styles_1ykijwm.css} +1 -1
- package/filter/types.d.ts +2 -0
- package/form/form-label.styles.js +1 -1
- package/form/form-label.styles.js.map +1 -1
- package/form/form-label.styles_11r0652.css +6 -0
- package/form/form-wrapper.js +1 -1
- package/form/form-wrapper.js.map +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
- package/image-button/image-button.styles.js +1 -1
- package/image-button/{image-button.styles_qtt605.css → image-button.styles_6n1qsr.css} +1 -1
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/input-group/input-group-list-addon.js +1 -1
- package/input-group/input-group-list-addon.js.map +1 -1
- package/input-group/input-group.styles.js +1 -1
- package/{cjs/input-group/input-group.styles_fpy81r.css → input-group/input-group.styles_bqye6f.css} +1 -1
- package/input-multi-select/input-multi-select.js +1 -1
- package/input-multi-select/input-multi-select.js.map +1 -1
- package/input-nested-multi-select/input-nested-multi-select.js +1 -1
- package/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
- package/input-nested-select/input-nested-select.js +1 -1
- package/input-nested-select/input-nested-select.js.map +1 -1
- package/input-range-select/input-range-select.js +1 -1
- package/input-range-select/input-range-select.js.map +1 -1
- package/input-select/input-select.js +1 -1
- package/input-select/input-select.js.map +1 -1
- package/input-textarea/textarea-counter.styles.js +1 -1
- package/input-textarea/textarea-counter.styles.js.map +1 -1
- package/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -0
- package/input-textarea/textarea.styles.js +1 -1
- package/input-textarea/textarea.styles_22z4n3.css +5 -0
- package/language-switcher/dropdown-panel.styles.js +1 -1
- package/language-switcher/dropdown-panel.styles.js.map +1 -1
- package/language-switcher/{dropdown-panel.styles_1z0n7qq.css → dropdown-panel.styles_1qsjf8d.css} +1 -1
- package/language-switcher/dropdown-variant.js +1 -1
- package/language-switcher/dropdown-variant.js.map +1 -1
- package/language-switcher/dropdown-variant.styles.js +1 -1
- package/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -0
- package/language-switcher/link-container-variant.styles.js +1 -1
- package/language-switcher/{link-container-variant.styles_1blx9qm.css → link-container-variant.styles_1iw6zux.css} +1 -1
- package/layout/col-div.js +1 -1
- package/layout/col-div.js.map +1 -1
- package/layout/types.d.ts +8 -11
- package/link-list/link-list.styles.js +1 -1
- package/link-list/link-list.styles.js.map +1 -1
- package/{cjs/link-list/link-list.styles_1g33nb4.css → link-list/link-list.styles_m57vks.css} +2 -2
- package/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js +1 -1
- package/{cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles_ftv36t.css → local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css} +1 -1
- package/markup/markup.js +1 -1
- package/markup/markup.js.map +1 -1
- package/markup/markup.style.js +1 -1
- package/markup/markup.style.js.map +1 -1
- package/markup/types.d.ts +2 -1
- package/masked-input/masked-input.styles.js +1 -1
- package/masked-input/masked-input.styles.js.map +1 -1
- package/{cjs/masked-input/masked-input.styles_4i1qsy.css → masked-input/masked-input.styles_1cm388a.css} +2 -2
- package/masthead/masthead.js +1 -1
- package/masthead/masthead.js.map +1 -1
- package/modal/modal-box.styles.js +1 -1
- package/modal/modal-box.styles.js.map +1 -1
- package/modal/modal-box.styles_y52cts.css +11 -0
- package/modal/modal.js +1 -1
- package/modal/modal.js.map +1 -1
- package/modal/modal.styles.d.ts +4 -1
- package/modal/modal.styles.js +1 -1
- package/modal/modal.styles.js.map +1 -1
- package/modal/{modal.styles_1sav73f.css → modal.styles_1lbblx6.css} +1 -1
- package/modal-v2/modal-v2.js +1 -1
- package/modal-v2/modal-v2.js.map +1 -1
- package/modal-v2/modal-v2.styles.d.ts +0 -1
- package/modal-v2/modal-v2.styles.js +1 -1
- package/modal-v2/modal-v2.styles.js.map +1 -1
- package/modal-v2/modal-v2.styles_a8gv5i.css +3 -0
- package/modal-v2/slots/card.js +1 -1
- package/modal-v2/slots/card.js.map +1 -1
- package/navbar/navbar-items.styles.js +1 -1
- package/navbar/navbar-items.styles.js.map +1 -1
- package/navbar/{navbar-items.styles_i9cunu.css → navbar-items.styles_1i3ltot.css} +7 -7
- package/navbar/navbar.js +1 -1
- package/navbar/navbar.js.map +1 -1
- package/notification-banner/notification-banner.styles.js +1 -1
- package/notification-banner/notification-banner.styles.js.map +1 -1
- package/{cjs/notification-banner/notification-banner.styles_130loac.css → notification-banner/notification-banner.styles_uxlysy.css} +2 -2
- package/otp-verification/contact-input-section.js +1 -1
- package/otp-verification/contact-input-section.js.map +1 -1
- package/otp-verification/contact-input-section.styles.d.ts +14 -0
- package/otp-verification/contact-input-section.styles.js +2 -0
- package/otp-verification/contact-input-section.styles.js.map +1 -0
- package/otp-verification/contact-input-section.styles_odrjvt.css +14 -0
- package/otp-verification/otp-verification.js +1 -1
- package/otp-verification/otp-verification.js.map +1 -1
- package/otp-verification/otp-verification.styles.d.ts +1 -0
- package/otp-verification/otp-verification.styles.js +2 -0
- package/otp-verification/otp-verification.styles.js.map +1 -0
- package/otp-verification/otp-verification.styles_dg9bm8.css +1 -0
- package/otp-verification/thumbnail/email-thumbnail.d.ts +1 -3
- package/otp-verification/thumbnail/email-thumbnail.js +1 -21
- package/otp-verification/thumbnail/email-thumbnail.js.map +1 -1
- package/otp-verification/thumbnail/phone-thumbnail.d.ts +1 -3
- package/otp-verification/thumbnail/phone-thumbnail.js +1 -17
- package/otp-verification/thumbnail/phone-thumbnail.js.map +1 -1
- package/otp-verification/thumbnail/thumbnail.styles.d.ts +3 -0
- package/otp-verification/thumbnail/thumbnail.styles.js +2 -0
- package/otp-verification/thumbnail/thumbnail.styles.js.map +1 -0
- package/otp-verification/thumbnail/thumbnail.styles_shqylh.css +3 -0
- package/otp-verification/verification-section.js +1 -1
- package/otp-verification/verification-section.js.map +1 -1
- package/otp-verification/verification-section.styles.d.ts +5 -0
- package/otp-verification/verification-section.styles.js +2 -0
- package/otp-verification/verification-section.styles.js.map +1 -0
- package/otp-verification/verification-section.styles_x8jj.css +5 -0
- package/package.json +14 -9
- package/pagination/pagination.styles.js +1 -1
- package/pagination/pagination.styles.js.map +1 -1
- package/{cjs/pagination/pagination.styles_1u898rb.css → pagination/pagination.styles_6bcgva.css} +3 -3
- package/pill/pill.styles.js +1 -1
- package/{cjs/pill/pill.styles_1wiyl8.css → pill/pill.styles_xwrniu.css} +1 -1
- package/predictive-text-input/predictive-text-input.js +1 -1
- package/predictive-text-input/predictive-text-input.js.map +1 -1
- package/schedule/const.js +1 -1
- package/schedule/const.js.map +1 -1
- package/schedule/schedule-day-view/schedule-day-view.js +1 -1
- package/schedule/schedule-day-view/schedule-day-view.js.map +1 -1
- package/schedule/schedule-day-view/schedule-day-view.styles.d.ts +39 -99
- package/schedule/schedule-day-view/schedule-day-view.styles.js +1 -152
- package/schedule/schedule-day-view/schedule-day-view.styles.js.map +1 -1
- package/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +30 -0
- package/schedule/schedule-day-view/types.d.ts +2 -10
- package/schedule/schedule-header/schedule-header.js +1 -1
- package/schedule/schedule-header/schedule-header.js.map +1 -1
- package/schedule/schedule-header/schedule-header.styles.d.ts +7 -0
- package/schedule/schedule-header/schedule-header.styles.js +2 -0
- package/schedule/schedule-header/schedule-header.styles.js.map +1 -0
- package/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +6 -0
- package/schedule/schedule-slot-content/index.d.ts +4 -0
- package/schedule/schedule-slot-content/schedule-slot-content.d.ts +21 -0
- package/schedule/schedule-slot-content/schedule-slot-content.js +2 -0
- package/schedule/schedule-slot-content/schedule-slot-content.js.map +1 -0
- package/schedule/schedule-slot-content/style-helper.d.ts +8 -0
- package/schedule/schedule-slot-content/style-helper.js +2 -0
- package/schedule/schedule-slot-content/style-helper.js.map +1 -0
- package/schedule/schedule-week-view/schedule-week-view.js +1 -1
- package/schedule/schedule-week-view/schedule-week-view.js.map +1 -1
- package/schedule/schedule-week-view/schedule-week-view.styles.d.ts +15 -32
- package/schedule/schedule-week-view/schedule-week-view.styles.js +1 -74
- package/schedule/schedule-week-view/schedule-week-view.styles.js.map +1 -1
- package/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +10 -0
- package/schedule/schedule-week-view/time-cell.js +1 -1
- package/schedule/schedule-week-view/time-cell.js.map +1 -1
- package/schedule/schedule-week-view/time-cell.styles.d.ts +23 -14
- package/schedule/schedule-week-view/time-cell.styles.js +1 -34
- package/schedule/schedule-week-view/time-cell.styles.js.map +1 -1
- package/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +14 -0
- package/schedule/schedule-week-view/types.d.ts +2 -15
- package/schedule/schedule-week-view/week-view-utils.js +1 -1
- package/schedule/schedule-week-view/week-view-utils.js.map +1 -1
- package/schedule/schedule.js +1 -1
- package/schedule/schedule.js.map +1 -1
- package/schedule/schedule.styles.d.ts +5 -8
- package/schedule/schedule.styles.js +1 -26
- package/schedule/schedule.styles.js.map +1 -1
- package/schedule/schedule.styles_fdy5a1.css +5 -0
- package/schedule/shared/with-optional-popover.d.ts +1 -1
- package/schedule/shared/with-optional-popover.js +1 -5
- package/schedule/shared/with-optional-popover.js.map +1 -1
- package/schedule/shared/with-optional-popover.styles.d.ts +1 -0
- package/schedule/shared/with-optional-popover.styles.js +2 -0
- package/schedule/shared/with-optional-popover.styles.js.map +1 -0
- package/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -0
- package/schedule/time-indicator/time-indicator.js +1 -1
- package/schedule/time-indicator/time-indicator.js.map +1 -1
- package/schedule/time-indicator/time-indicator.styles.d.ts +11 -28
- package/schedule/time-indicator/time-indicator.styles.js +1 -33
- package/schedule/time-indicator/time-indicator.styles.js.map +1 -1
- package/schedule/time-indicator/time-indicator.styles_1eaxyes.css +6 -0
- package/schedule/types.d.ts +10 -0
- package/select-histogram/select-histogram.js +1 -1
- package/select-histogram/select-histogram.js.map +1 -1
- package/select-histogram/select-histogram.styles.js +1 -1
- package/select-histogram/select-histogram.styles.js.map +1 -1
- package/select-histogram/{select-histogram.styles_11916eo.css → select-histogram.styles_n260dy.css} +1 -1
- package/shared/dropdown-list/dropdown-label.js +1 -1
- package/shared/dropdown-list/dropdown-label.js.map +1 -1
- package/shared/dropdown-list/dropdown-label.styles.js +1 -1
- package/shared/dropdown-list/dropdown-label.styles.js.map +1 -1
- package/{cjs/shared/dropdown-list/dropdown-label.styles_1dwmd8f.css → shared/dropdown-list/dropdown-label.styles_mloii0.css} +4 -4
- package/shared/dropdown-list/dropdown-list.styles.js +1 -1
- package/shared/dropdown-list/dropdown-list.styles.js.map +1 -1
- package/{cjs/shared/dropdown-list/dropdown-list.styles_1kt4zhf.css → shared/dropdown-list/dropdown-list.styles_konwm.css} +4 -4
- package/shared/dropdown-list/dropdown-search.styles.js +1 -1
- package/shared/dropdown-list/dropdown-search.styles.js.map +1 -1
- package/{cjs/shared/dropdown-list/dropdown-search.styles_4r9oma.css → shared/dropdown-list/dropdown-search.styles_1hc1gkh.css} +2 -2
- package/shared/dropdown-list/expandable-element.js +1 -1
- package/shared/dropdown-list/expandable-element.js.map +1 -1
- package/shared/dropdown-list/expandable-element.styles.d.ts +0 -1
- package/shared/dropdown-list/expandable-element.styles.js +1 -1
- package/shared/dropdown-list/expandable-element.styles.js.map +1 -1
- package/shared/dropdown-list/expandable-element.styles_rkkvqr.css +5 -0
- package/shared/dropdown-wrapper/dropdown-wrapper.styles.js +1 -1
- package/shared/dropdown-wrapper/dropdown-wrapper.styles.js.map +1 -1
- package/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +3 -0
- package/shared/hooks/useViewport.d.ts +7 -2
- package/shared/hooks/useViewport.js +1 -1
- package/shared/hooks/useViewport.js.map +1 -1
- package/shared/input-wrapper/input-wrapper.styles.js +1 -1
- package/shared/input-wrapper/{input-wrapper.styles_19fpzb.css → input-wrapper.styles_je6maw.css} +2 -2
- package/shared/internal-calendar/calendar-manager.styles.js +1 -1
- package/shared/internal-calendar/{calendar-manager.styles_1q13ylk.css → calendar-manager.styles_1iuq5zw.css} +1 -1
- package/shared/internal-calendar/day-cell/day-cell.styles.js +1 -1
- package/shared/internal-calendar/day-cell/day-cell.styles.js.map +1 -1
- package/{cjs/shared/internal-calendar/day-cell/day-cell.styles_vazxvn.css → shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css} +1 -1
- package/shared/internal-calendar/internal-calendar-month.styles.js +1 -1
- package/{cjs/shared/internal-calendar/internal-calendar-month.styles_1pk3ynj.css → shared/internal-calendar/internal-calendar-month.styles_14oh57f.css} +1 -1
- package/shared/internal-calendar/internal-calendar-year.styles.js +1 -1
- package/shared/internal-calendar/internal-calendar-year.styles.js.map +1 -1
- package/shared/internal-calendar/{internal-calendar-year.styles_1azy42u.css → internal-calendar-year.styles_therlc.css} +1 -1
- package/shared/internal-calendar/single/single-cell.js +1 -1
- package/shared/internal-calendar/single/single-cell.js.map +1 -1
- package/shared/internal-calendar/standard/standard-calendar-day-view.styles.js +1 -1
- package/{cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles_1dbvup3.css → shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css} +1 -1
- package/shared/standalone-date-input/standalone-date-input.js +1 -1
- package/shared/standalone-date-input/standalone-date-input.js.map +1 -1
- package/shared/standalone-date-input/standalone-date-input.styles.d.ts +2 -0
- package/shared/standalone-date-input/standalone-date-input.styles.js +1 -1
- package/shared/standalone-date-input/standalone-date-input.styles.js.map +1 -1
- package/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +15 -0
- package/shared/time-slot/time-slot.d.ts +1 -0
- package/shared/time-slot/time-slot.js +1 -1
- package/shared/time-slot/time-slot.js.map +1 -1
- package/shared/time-slot/time-slot.styles.d.ts +2 -0
- package/shared/time-slot/time-slot.styles.js +1 -1
- package/shared/time-slot/time-slot.styles.js.map +1 -1
- package/shared/time-slot/time-slot.styles_18s0to7.css +29 -0
- package/sidenav/sidenav-drawer-item.styles.js +1 -1
- package/sidenav/sidenav-drawer-item.styles.js.map +1 -1
- package/sidenav/{sidenav-drawer-item.styles_yp8cga.css → sidenav-drawer-item.styles_1ljnyx2.css} +1 -1
- package/sidenav/sidenav-drawer-subitem.styles.js +1 -1
- package/sidenav/sidenav-drawer-subitem.styles.js.map +1 -1
- package/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -0
- package/sidenav/sidenav-item.styles.js +1 -1
- package/sidenav/sidenav-item.styles.js.map +1 -1
- package/sidenav/{sidenav-item.styles_1eew8px.css → sidenav-item.styles_lqw3kh.css} +2 -2
- package/smart-app-banner/smart-app-banner.styles.js +1 -1
- package/smart-app-banner/smart-app-banner.styles.js.map +1 -1
- package/smart-app-banner/{smart-app-banner.styles_m5dtgh.css → smart-app-banner.styles_15u6yv4.css} +2 -2
- package/tab/tab-link-chain.styles.js +1 -1
- package/tab/tab-link-chain.styles.js.map +1 -1
- package/tab/{tab-link-chain.styles_1nreqrp.css → tab-link-chain.styles_49got4.css} +2 -2
- package/tag/tag.style.js +1 -1
- package/tag/{tag.style_10tn8i.css → tag.style_d98c53.css} +2 -2
- package/text-list/text-list.styles.js +1 -1
- package/text-list/text-list.styles.js.map +1 -1
- package/text-list/text-list.styles_w3fvyt.css +16 -0
- package/theme/index.d.ts +4 -1
- package/theme/index.js +1 -1
- package/theme/styles/a11y-playground.css +30 -1
- package/theme/styles/bookingsg.css +30 -1
- package/theme/styles/careercompass.css +516 -0
- package/theme/styles/ccube.css +28 -0
- package/theme/styles/default.css +2 -1
- package/theme/styles/imda.css +30 -1
- package/theme/styles/lifesg.css +28 -0
- package/theme/styles/mylegacy.css +30 -1
- package/theme/styles/oneservice.css +28 -0
- package/theme/styles/pa.css +30 -1
- package/theme/styles/rbs.css +28 -0
- package/theme/styles/sgw-digital-lobby.css +32 -3
- package/theme/styles/smgs.css +516 -0
- package/theme/styles/spf.css +143 -114
- package/theme/styles/supportgowhere.css +30 -1
- package/theme/theme-provider/hooks.d.ts +2 -1
- package/theme/theme-provider/hooks.js +1 -1
- package/theme/theme-provider/hooks.js.map +1 -1
- package/theme/tokens/colour.d.ts +28 -0
- package/theme/tokens/colour.js +1 -1
- package/theme/tokens/colour.js.map +1 -1
- package/theme/tokens/font.d.ts +4 -2
- package/theme/tokens/font.js +1 -1
- package/theme/tokens/font.js.map +1 -1
- package/theme/types.d.ts +1 -1
- package/theme/types.js +1 -1
- package/theme/types.js.map +1 -1
- package/theme/utils/css-variable.d.ts +0 -5
- package/theme/utils/css-variable.js +1 -1
- package/theme/utils/css-variable.js.map +1 -1
- package/theme/utils/font.d.ts +2 -2
- package/theme/utils/font.js +1 -1
- package/theme/utils/font.js.map +1 -1
- package/theme/utils/token-resolver.js +1 -1
- package/theme/utils/token-resolver.js.map +1 -1
- package/theme/utils/use-design-token.js +1 -1
- package/theme/utils/use-design-token.js.map +1 -1
- package/theme/utils/use-media-query.d.ts +1 -2
- package/theme/utils/use-media-query.js +1 -1
- package/theme/utils/use-media-query.js.map +1 -1
- package/time-range-picker/combobox-picker/combobox-picker.js +1 -1
- package/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
- package/time-slot-bar-week/consts.d.ts +3 -0
- package/time-slot-bar-week/consts.js +2 -0
- package/time-slot-bar-week/consts.js.map +1 -0
- package/time-slot-bar-week/time-slot-bar-week-days.js +1 -1
- package/time-slot-bar-week/time-slot-bar-week-days.js.map +1 -1
- package/time-slot-bar-week/time-slot-bar-week-days.styles.d.ts +25 -0
- package/time-slot-bar-week/time-slot-bar-week-days.styles.js +2 -0
- package/time-slot-bar-week/time-slot-bar-week-days.styles.js.map +1 -0
- package/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +17 -0
- package/time-slot-bar-week/time-slot-bar-week.js +1 -1
- package/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
- package/time-slot-bar-week/time-slot-bar-week.styles.d.ts +1 -0
- package/time-slot-bar-week/time-slot-bar-week.styles.js +2 -0
- package/time-slot-bar-week/time-slot-bar-week.styles.js.map +1 -0
- package/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -0
- package/time-slot-bar-week/time-slot-cell.d.ts +28 -0
- package/time-slot-bar-week/time-slot-cell.js +2 -0
- package/time-slot-bar-week/time-slot-cell.js.map +1 -0
- package/time-slot-week-view/time-slot-week-days.js +1 -1
- package/time-slot-week-view/time-slot-week-days.js.map +1 -1
- package/time-slot-week-view/time-slot-week-days.styles.d.ts +14 -0
- package/time-slot-week-view/time-slot-week-days.styles.js +2 -0
- package/time-slot-week-view/time-slot-week-days.styles.js.map +1 -0
- package/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +9 -0
- package/time-slot-week-view/time-slot-week-view.js +1 -1
- package/time-slot-week-view/time-slot-week-view.js.map +1 -1
- package/time-slot-week-view/time-slot-week-view.styles.d.ts +1 -1
- package/time-slot-week-view/time-slot-week-view.styles.js +1 -9
- package/time-slot-week-view/time-slot-week-view.styles.js.map +1 -1
- package/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -0
- package/timeline/timeline.styles.js +1 -1
- package/{cjs/timeline/timeline.styles_1wcnzot.css → timeline/timeline.styles_1jxzik4.css} +1 -1
- package/timepicker/timepicker.js +1 -1
- package/timepicker/timepicker.js.map +1 -1
- package/timepicker/timepicker.styles.js +1 -1
- package/timepicker/timepicker.styles.js.map +1 -1
- package/timepicker/timepicker.styles_1jm33yw.css +1 -0
- package/toast/toast.styles.js +1 -1
- package/toast/toast.styles.js.map +1 -1
- package/toast/{toast.styles_ngrlup.css → toast.styles_1e0l60w.css} +1 -1
- package/toggle/toggle.styles.js +1 -1
- package/toggle/toggle.styles.js.map +1 -1
- package/{cjs/toggle/toggle.styles_1yzqsu.css → toggle/toggle.styles_1t5qrye.css} +5 -5
- package/typography/index.js +1 -1
- package/typography/typography.js +1 -1
- package/typography/typography.js.map +1 -1
- package/typography/typography.styles.d.ts +2 -0
- package/typography/typography.styles.js +1 -1
- package/typography/typography.styles.js.map +1 -1
- package/typography/typography.styles_1155j4c.css +11 -0
- package/uneditable-section/section-item.styles.js +1 -1
- package/uneditable-section/section-item.styles.js.map +1 -1
- package/uneditable-section/{section-item.styles_1dfjzc4.css → section-item.styles_mwx8ht.css} +2 -2
- package/util/is-styled-components.d.ts +5 -0
- package/util/is-styled-components.js +2 -0
- package/util/is-styled-components.js.map +1 -0
- package/util/styling-helper.js +1 -1
- package/util/styling-helper.js.map +1 -1
- package/badge/badge.styles_1yrxocm.css +0 -16
- package/cjs/badge/badge.styles_1yrxocm.css +0 -16
- package/cjs/date-navigator/date-navigator.styles_1cotsgz.css +0 -4
- package/cjs/file-upload/file-list.js +0 -2
- package/cjs/file-upload/file-list.js.map +0 -1
- package/cjs/file-upload/file-list.styles.js +0 -2
- package/cjs/file-upload/file-list.styles.js.map +0 -1
- package/cjs/file-upload/file-list.styles_16vplxk.css +0 -3
- package/cjs/filter/filter-modal.styles_e0ev97.css +0 -8
- package/cjs/filter/filter-sidebar.styles_cwvqql.css +0 -4
- package/cjs/form/form-label.styles_rk98yd.css +0 -6
- package/cjs/input-textarea/textarea-counter.styles_adg5h1.css +0 -1
- package/cjs/input-textarea/textarea.styles_g0zgyq.css +0 -5
- package/cjs/language-switcher/dropdown-variant.styles_16c4wc1.css +0 -2
- package/cjs/markup/markup.utils.js +0 -2
- package/cjs/markup/markup.utils.js.map +0 -1
- package/cjs/modal/modal-box.styles_1xrlxhd.css +0 -2
- package/cjs/modal-v2/modal-v2.styles_1irpyi6.css +0 -3
- package/cjs/otp-verification/contact-input-section-styles.js +0 -115
- package/cjs/otp-verification/contact-input-section-styles.js.map +0 -1
- package/cjs/otp-verification/otp-verification-styles.js +0 -6
- package/cjs/otp-verification/otp-verification-styles.js.map +0 -1
- package/cjs/otp-verification/verification-section-styles.js +0 -27
- package/cjs/otp-verification/verification-section-styles.js.map +0 -1
- package/cjs/schedule/schedule-header/schedule-header.style.js +0 -38
- package/cjs/schedule/schedule-header/schedule-header.style.js.map +0 -1
- package/cjs/schedule/schedule-week-view/slot-content.js +0 -2
- package/cjs/schedule/schedule-week-view/slot-content.js.map +0 -1
- package/cjs/schedule/schedule-week-view/slot-content.styles.js +0 -40
- package/cjs/schedule/schedule-week-view/slot-content.styles.js.map +0 -1
- package/cjs/shared/dropdown-list/expandable-element.styles_5o9f9w.css +0 -6
- package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles_v10jbi.css +0 -3
- package/cjs/shared/standalone-date-input/standalone-date-input.styles_1m0da43.css +0 -13
- package/cjs/shared/styles/index.js +0 -2
- package/cjs/shared/styles/index.js.map +0 -1
- package/cjs/shared/time-slot/time-slot.styles_1r9na3f.css +0 -17
- package/cjs/sidenav/sidenav-drawer-subitem.styles_1ylzfn5.css +0 -1
- package/cjs/text-list/text-list.styles_1gohl3f.css +0 -16
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.style.js +0 -104
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.style.js.map +0 -1
- package/cjs/time-slot-bar-week/time-slot-bar-week.style.js +0 -10
- package/cjs/time-slot-bar-week/time-slot-bar-week.style.js.map +0 -1
- package/cjs/time-slot-week-view/time-slot-week-days.style.js +0 -59
- package/cjs/time-slot-week-view/time-slot-week-days.style.js.map +0 -1
- package/cjs/timepicker/timepicker.styles_zmkhl8.css +0 -1
- package/cjs/typography/typography.styles_1jqils.css +0 -9
- package/cjs/v3_theme/border/specs/default-border-set.js +0 -2
- package/cjs/v3_theme/border/specs/default-border-set.js.map +0 -1
- package/cjs/v3_theme/border/theme-helper.js +0 -2
- package/cjs/v3_theme/border/theme-helper.js.map +0 -1
- package/cjs/v3_theme/border-util/specs/default-border-util-set.js +0 -2
- package/cjs/v3_theme/border-util/specs/default-border-util-set.js.map +0 -1
- package/cjs/v3_theme/border-util/theme-helper.js +0 -2
- package/cjs/v3_theme/border-util/theme-helper.js.map +0 -1
- package/cjs/v3_theme/border-util/utils.js +0 -8
- package/cjs/v3_theme/border-util/utils.js.map +0 -1
- package/cjs/v3_theme/breakpoint/media-query-helper.js +0 -2
- package/cjs/v3_theme/breakpoint/media-query-helper.js.map +0 -1
- package/cjs/v3_theme/breakpoint/specs/default-breakpoint-set.js +0 -2
- package/cjs/v3_theme/breakpoint/specs/default-breakpoint-set.js.map +0 -1
- package/cjs/v3_theme/breakpoint/theme-helper.js +0 -2
- package/cjs/v3_theme/breakpoint/theme-helper.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/bookingsg-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/bookingsg-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/ccube-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/ccube-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/imda-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/imda-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/lifesg-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/lifesg-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/mylegacy-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/mylegacy-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/oneservice-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/oneservice-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/pa-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/pa-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/rbs-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/rbs-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/smgs-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/smgs-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/spf-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/spf-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js +0 -2
- package/cjs/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js.map +0 -1
- package/cjs/v3_theme/colour-primitive/theme-helper.js +0 -2
- package/cjs/v3_theme/colour-primitive/theme-helper.js.map +0 -1
- package/cjs/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js +0 -2
- package/cjs/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js.map +0 -1
- package/cjs/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js +0 -2
- package/cjs/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js.map +0 -1
- package/cjs/v3_theme/colour-semantic/specs/pa-semantic-tokens.js +0 -2
- package/cjs/v3_theme/colour-semantic/specs/pa-semantic-tokens.js.map +0 -1
- package/cjs/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js +0 -2
- package/cjs/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js.map +0 -1
- package/cjs/v3_theme/colour-semantic/theme-helper.js +0 -2
- package/cjs/v3_theme/colour-semantic/theme-helper.js.map +0 -1
- package/cjs/v3_theme/ds-theme-provider.js +0 -2
- package/cjs/v3_theme/ds-theme-provider.js.map +0 -1
- package/cjs/v3_theme/font/specs/a11yplayground-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/a11yplayground-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/bookingsg-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/bookingsg-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/default-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/default-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/imda-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/imda-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/oneservice-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/oneservice-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/pa-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/pa-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/smgs-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/smgs-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/spf-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/spf-font-set.js.map +0 -1
- package/cjs/v3_theme/font/specs/supportgowhere-font-set.js +0 -2
- package/cjs/v3_theme/font/specs/supportgowhere-font-set.js.map +0 -1
- package/cjs/v3_theme/font/theme-helper.js +0 -2
- package/cjs/v3_theme/font/theme-helper.js.map +0 -1
- package/cjs/v3_theme/font/utils.js +0 -10
- package/cjs/v3_theme/font/utils.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/bookingsg-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/bookingsg-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/default-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/default-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/imda-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/imda-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/mylegacy-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/mylegacy-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/oneservice-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/oneservice-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/pa-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/pa-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/smgs-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/smgs-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/spf-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/spf-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js +0 -2
- package/cjs/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js.map +0 -1
- package/cjs/v3_theme/font-spec/theme-helper.js +0 -2
- package/cjs/v3_theme/font-spec/theme-helper.js.map +0 -1
- package/cjs/v3_theme/helpers.js +0 -2
- package/cjs/v3_theme/helpers.js.map +0 -1
- package/cjs/v3_theme/index.js +0 -2
- package/cjs/v3_theme/index.js.map +0 -1
- package/cjs/v3_theme/motion/specs/default-motion-set.js +0 -2
- package/cjs/v3_theme/motion/specs/default-motion-set.js.map +0 -1
- package/cjs/v3_theme/motion/theme-helper.js +0 -2
- package/cjs/v3_theme/motion/theme-helper.js.map +0 -1
- package/cjs/v3_theme/radius/specs/default-radius-set.js +0 -2
- package/cjs/v3_theme/radius/specs/default-radius-set.js.map +0 -1
- package/cjs/v3_theme/radius/specs/spf-radius-set.js +0 -2
- package/cjs/v3_theme/radius/specs/spf-radius-set.js.map +0 -1
- package/cjs/v3_theme/radius/theme-helper.js +0 -2
- package/cjs/v3_theme/radius/theme-helper.js.map +0 -1
- package/cjs/v3_theme/shadow/specs/default-shadow-set.js +0 -2
- package/cjs/v3_theme/shadow/specs/default-shadow-set.js.map +0 -1
- package/cjs/v3_theme/shadow/theme-helper.js +0 -2
- package/cjs/v3_theme/shadow/theme-helper.js.map +0 -1
- package/cjs/v3_theme/spacing/specs/default-spacing-set.js +0 -2
- package/cjs/v3_theme/spacing/specs/default-spacing-set.js.map +0 -1
- package/cjs/v3_theme/spacing/theme-helper.js +0 -2
- package/cjs/v3_theme/spacing/theme-helper.js.map +0 -1
- package/cjs/v3_theme/use-theme-mode.js +0 -2
- package/cjs/v3_theme/use-theme-mode.js.map +0 -1
- package/codemods/common.ts +0 -8
- package/codemods/data.ts +0 -16
- package/codemods/deprecate-v2-tokens/data.ts +0 -283
- package/codemods/deprecate-v2-tokens/index.ts +0 -89
- package/codemods/migrate-colour/data.ts +0 -95
- package/codemods/migrate-colour/index.ts +0 -104
- package/codemods/migrate-layout/data.ts +0 -5
- package/codemods/migrate-layout/index.ts +0 -108
- package/codemods/migrate-media-query/data.ts +0 -20
- package/codemods/migrate-media-query/index.ts +0 -113
- package/codemods/migrate-text/data.ts +0 -48
- package/codemods/migrate-text/index.ts +0 -196
- package/codemods/migrate-text-list/data.ts +0 -16
- package/codemods/migrate-text-list/index.ts +0 -111
- package/common.d.ts +0 -8
- package/date-navigator/date-navigator.styles_1cotsgz.css +0 -4
- package/deprecate-v2-tokens/data.d.ts +0 -8
- package/file-upload/file-list.js +0 -2
- package/file-upload/file-list.js.map +0 -1
- package/file-upload/file-list.styles.js +0 -2
- package/file-upload/file-list.styles.js.map +0 -1
- package/file-upload/file-list.styles_16vplxk.css +0 -3
- package/filter/filter-modal.styles_e0ev97.css +0 -8
- package/filter/filter-sidebar.styles_cwvqql.css +0 -4
- package/form/form-label.styles_rk98yd.css +0 -6
- package/input-textarea/textarea-counter.styles_adg5h1.css +0 -1
- package/input-textarea/textarea.styles_g0zgyq.css +0 -5
- package/language-switcher/dropdown-variant.styles_16c4wc1.css +0 -2
- package/markup/markup.utils.d.ts +0 -2
- package/markup/markup.utils.js +0 -2
- package/markup/markup.utils.js.map +0 -1
- package/migrate-colour/data.d.ts +0 -270
- package/migrate-colour/index.d.ts +0 -7
- package/migrate-layout/data.d.ts +0 -5
- package/migrate-layout/index.d.ts +0 -2
- package/migrate-media-query/data.d.ts +0 -20
- package/migrate-media-query/index.d.ts +0 -2
- package/migrate-text/data.d.ts +0 -46
- package/migrate-text/index.d.ts +0 -2
- package/migrate-text-list/data.d.ts +0 -16
- package/migrate-text-list/index.d.ts +0 -2
- package/modal/modal-box.styles_1xrlxhd.css +0 -2
- package/modal-v2/modal-v2.styles_1irpyi6.css +0 -3
- package/otp-verification/contact-input-section-styles.d.ts +0 -14
- package/otp-verification/contact-input-section-styles.js +0 -115
- package/otp-verification/contact-input-section-styles.js.map +0 -1
- package/otp-verification/otp-verification-styles.d.ts +0 -1
- package/otp-verification/otp-verification-styles.js +0 -6
- package/otp-verification/otp-verification-styles.js.map +0 -1
- package/otp-verification/verification-section-styles.d.ts +0 -23
- package/otp-verification/verification-section-styles.js +0 -27
- package/otp-verification/verification-section-styles.js.map +0 -1
- package/schedule/schedule-header/schedule-header.style.d.ts +0 -25
- package/schedule/schedule-header/schedule-header.style.js +0 -38
- package/schedule/schedule-header/schedule-header.style.js.map +0 -1
- package/schedule/schedule-week-view/slot-content.d.ts +0 -8
- package/schedule/schedule-week-view/slot-content.js +0 -2
- package/schedule/schedule-week-view/slot-content.js.map +0 -1
- package/schedule/schedule-week-view/slot-content.styles.d.ts +0 -27
- package/schedule/schedule-week-view/slot-content.styles.js +0 -40
- package/schedule/schedule-week-view/slot-content.styles.js.map +0 -1
- package/schedule/shared/index.d.ts +0 -2
- package/shared/dropdown-list/expandable-element.styles_5o9f9w.css +0 -6
- package/shared/dropdown-wrapper/dropdown-wrapper.styles_v10jbi.css +0 -3
- package/shared/standalone-date-input/standalone-date-input.styles_1m0da43.css +0 -13
- package/shared/styles/index.js +0 -2
- package/shared/styles/index.js.map +0 -1
- package/shared/time-slot/time-slot.styles_1r9na3f.css +0 -17
- package/sidenav/sidenav-drawer-subitem.styles_1ylzfn5.css +0 -1
- package/text-list/text-list.styles_1gohl3f.css +0 -16
- package/time-slot-bar-week/time-slot-bar-week-days.style.d.ts +0 -54
- package/time-slot-bar-week/time-slot-bar-week-days.style.js +0 -104
- package/time-slot-bar-week/time-slot-bar-week-days.style.js.map +0 -1
- package/time-slot-bar-week/time-slot-bar-week.style.d.ts +0 -1
- package/time-slot-bar-week/time-slot-bar-week.style.js +0 -10
- package/time-slot-bar-week/time-slot-bar-week.style.js.map +0 -1
- package/time-slot-week-view/time-slot-week-days.style.d.ts +0 -12
- package/time-slot-week-view/time-slot-week-days.style.js +0 -59
- package/time-slot-week-view/time-slot-week-days.style.js.map +0 -1
- package/timepicker/timepicker.styles_zmkhl8.css +0 -1
- package/typography/typography.styles_1jqils.css +0 -9
- package/v3_theme/border/specs/default-border-set.d.ts +0 -2
- package/v3_theme/border/specs/default-border-set.js +0 -2
- package/v3_theme/border/specs/default-border-set.js.map +0 -1
- package/v3_theme/border/theme-helper.d.ts +0 -10
- package/v3_theme/border/theme-helper.js +0 -2
- package/v3_theme/border/theme-helper.js.map +0 -1
- package/v3_theme/border/types.d.ts +0 -12
- package/v3_theme/border-util/specs/default-border-util-set.d.ts +0 -2
- package/v3_theme/border-util/specs/default-border-util-set.js +0 -2
- package/v3_theme/border-util/specs/default-border-util-set.js.map +0 -1
- package/v3_theme/border-util/theme-helper.d.ts +0 -8
- package/v3_theme/border-util/theme-helper.js +0 -2
- package/v3_theme/border-util/theme-helper.js.map +0 -1
- package/v3_theme/border-util/types.d.ts +0 -19
- package/v3_theme/border-util/utils.d.ts +0 -11
- package/v3_theme/border-util/utils.js +0 -8
- package/v3_theme/border-util/utils.js.map +0 -1
- package/v3_theme/breakpoint/media-query-helper.d.ts +0 -9
- package/v3_theme/breakpoint/media-query-helper.js +0 -2
- package/v3_theme/breakpoint/media-query-helper.js.map +0 -1
- package/v3_theme/breakpoint/specs/default-breakpoint-set.d.ts +0 -2
- package/v3_theme/breakpoint/specs/default-breakpoint-set.js +0 -2
- package/v3_theme/breakpoint/specs/default-breakpoint-set.js.map +0 -1
- package/v3_theme/breakpoint/theme-helper.d.ts +0 -39
- package/v3_theme/breakpoint/theme-helper.js +0 -2
- package/v3_theme/breakpoint/theme-helper.js.map +0 -1
- package/v3_theme/breakpoint/types.d.ts +0 -41
- package/v3_theme/colour-primitive/specs/a11yplayground-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/bookingsg-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/bookingsg-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/bookingsg-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/ccube-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/ccube-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/ccube-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/imda-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/imda-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/imda-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/lifesg-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/lifesg-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/lifesg-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/mylegacy-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/mylegacy-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/mylegacy-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/oneservice-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/oneservice-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/oneservice-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/pa-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/pa-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/pa-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/rbs-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/rbs-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/rbs-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/smgs-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/smgs-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/smgs-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/spf-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/spf-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/spf-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/specs/supportgowhere-colour-set.d.ts +0 -2
- package/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js +0 -2
- package/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js.map +0 -1
- package/v3_theme/colour-primitive/theme-helper.d.ts +0 -10
- package/v3_theme/colour-primitive/theme-helper.js +0 -2
- package/v3_theme/colour-primitive/theme-helper.js.map +0 -1
- package/v3_theme/colour-primitive/types.d.ts +0 -98
- package/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.d.ts +0 -3
- package/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js +0 -2
- package/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js.map +0 -1
- package/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.d.ts +0 -3
- package/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js +0 -2
- package/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js.map +0 -1
- package/v3_theme/colour-semantic/specs/pa-semantic-tokens.d.ts +0 -2
- package/v3_theme/colour-semantic/specs/pa-semantic-tokens.js +0 -2
- package/v3_theme/colour-semantic/specs/pa-semantic-tokens.js.map +0 -1
- package/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.d.ts +0 -3
- package/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js +0 -2
- package/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js.map +0 -1
- package/v3_theme/colour-semantic/theme-helper.d.ts +0 -10
- package/v3_theme/colour-semantic/theme-helper.js +0 -2
- package/v3_theme/colour-semantic/theme-helper.js.map +0 -1
- package/v3_theme/colour-semantic/types.d.ts +0 -123
- package/v3_theme/components/specs/a11yplayground-component-token-set.d.ts +0 -2
- package/v3_theme/components/specs/default-component-token-set.d.ts +0 -2
- package/v3_theme/components/specs/lifesg-component-token-set.d.ts +0 -2
- package/v3_theme/components/specs/pa-component-token-set.d.ts +0 -2
- package/v3_theme/components/specs/smgs-component-token-set.d.ts +0 -2
- package/v3_theme/components/specs/spf-component-token-set.d.ts +0 -2
- package/v3_theme/components/theme-helper.d.ts +0 -17
- package/v3_theme/components/types.d.ts +0 -44
- package/v3_theme/ds-theme-provider.d.ts +0 -2
- package/v3_theme/ds-theme-provider.js +0 -2
- package/v3_theme/ds-theme-provider.js.map +0 -1
- package/v3_theme/font/specs/a11yplayground-font-set.d.ts +0 -2
- package/v3_theme/font/specs/a11yplayground-font-set.js +0 -2
- package/v3_theme/font/specs/a11yplayground-font-set.js.map +0 -1
- package/v3_theme/font/specs/bookingsg-font-set.d.ts +0 -2
- package/v3_theme/font/specs/bookingsg-font-set.js +0 -2
- package/v3_theme/font/specs/bookingsg-font-set.js.map +0 -1
- package/v3_theme/font/specs/default-font-set.d.ts +0 -2
- package/v3_theme/font/specs/default-font-set.js +0 -2
- package/v3_theme/font/specs/default-font-set.js.map +0 -1
- package/v3_theme/font/specs/imda-font-set.d.ts +0 -2
- package/v3_theme/font/specs/imda-font-set.js +0 -2
- package/v3_theme/font/specs/imda-font-set.js.map +0 -1
- package/v3_theme/font/specs/oneservice-font-set.d.ts +0 -2
- package/v3_theme/font/specs/oneservice-font-set.js +0 -2
- package/v3_theme/font/specs/oneservice-font-set.js.map +0 -1
- package/v3_theme/font/specs/pa-font-set.d.ts +0 -2
- package/v3_theme/font/specs/pa-font-set.js +0 -2
- package/v3_theme/font/specs/pa-font-set.js.map +0 -1
- package/v3_theme/font/specs/smgs-font-set.d.ts +0 -2
- package/v3_theme/font/specs/smgs-font-set.js +0 -2
- package/v3_theme/font/specs/smgs-font-set.js.map +0 -1
- package/v3_theme/font/specs/spf-font-set.d.ts +0 -2
- package/v3_theme/font/specs/spf-font-set.js +0 -2
- package/v3_theme/font/specs/spf-font-set.js.map +0 -1
- package/v3_theme/font/specs/supportgowhere-font-set.d.ts +0 -2
- package/v3_theme/font/specs/supportgowhere-font-set.js +0 -2
- package/v3_theme/font/specs/supportgowhere-font-set.js.map +0 -1
- package/v3_theme/font/theme-helper.d.ts +0 -7
- package/v3_theme/font/theme-helper.js +0 -2
- package/v3_theme/font/theme-helper.js.map +0 -1
- package/v3_theme/font/types.d.ts +0 -54
- package/v3_theme/font/utils.d.ts +0 -4
- package/v3_theme/font/utils.js +0 -10
- package/v3_theme/font/utils.js.map +0 -1
- package/v3_theme/font-spec/specs/a11yplayground-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/bookingsg-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/bookingsg-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/bookingsg-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/default-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/default-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/default-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/imda-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/imda-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/imda-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/mylegacy-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/mylegacy-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/mylegacy-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/oneservice-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/oneservice-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/oneservice-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/pa-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/pa-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/pa-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/smgs-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/smgs-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/smgs-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/spf-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/spf-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/spf-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/specs/supportgowhere-font-spec-set.d.ts +0 -2
- package/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js +0 -2
- package/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js.map +0 -1
- package/v3_theme/font-spec/theme-helper.d.ts +0 -6
- package/v3_theme/font-spec/theme-helper.js +0 -2
- package/v3_theme/font-spec/theme-helper.js.map +0 -1
- package/v3_theme/font-spec/types.d.ts +0 -53
- package/v3_theme/helpers.d.ts +0 -7
- package/v3_theme/helpers.js +0 -2
- package/v3_theme/helpers.js.map +0 -1
- package/v3_theme/index.d.ts +0 -696
- package/v3_theme/index.js +0 -2
- package/v3_theme/index.js.map +0 -1
- package/v3_theme/internal-types.d.ts +0 -4
- package/v3_theme/motion/specs/default-motion-set.d.ts +0 -2
- package/v3_theme/motion/specs/default-motion-set.js +0 -2
- package/v3_theme/motion/specs/default-motion-set.js.map +0 -1
- package/v3_theme/motion/theme-helper.d.ts +0 -6
- package/v3_theme/motion/theme-helper.js +0 -2
- package/v3_theme/motion/theme-helper.js.map +0 -1
- package/v3_theme/motion/types.d.ts +0 -17
- package/v3_theme/radius/specs/default-radius-set.d.ts +0 -2
- package/v3_theme/radius/specs/default-radius-set.js +0 -2
- package/v3_theme/radius/specs/default-radius-set.js.map +0 -1
- package/v3_theme/radius/specs/spf-radius-set.d.ts +0 -2
- package/v3_theme/radius/specs/spf-radius-set.js +0 -2
- package/v3_theme/radius/specs/spf-radius-set.js.map +0 -1
- package/v3_theme/radius/theme-helper.d.ts +0 -6
- package/v3_theme/radius/theme-helper.js +0 -2
- package/v3_theme/radius/theme-helper.js.map +0 -1
- package/v3_theme/radius/types.d.ts +0 -13
- package/v3_theme/shadow/specs/default-shadow-set.d.ts +0 -2
- package/v3_theme/shadow/specs/default-shadow-set.js +0 -2
- package/v3_theme/shadow/specs/default-shadow-set.js.map +0 -1
- package/v3_theme/shadow/theme-helper.d.ts +0 -7
- package/v3_theme/shadow/theme-helper.js +0 -2
- package/v3_theme/shadow/theme-helper.js.map +0 -1
- package/v3_theme/shadow/types.d.ts +0 -21
- package/v3_theme/spacing/specs/default-spacing-set.d.ts +0 -2
- package/v3_theme/spacing/specs/default-spacing-set.js +0 -2
- package/v3_theme/spacing/specs/default-spacing-set.js.map +0 -1
- package/v3_theme/spacing/theme-helper.d.ts +0 -6
- package/v3_theme/spacing/theme-helper.js +0 -2
- package/v3_theme/spacing/theme-helper.js.map +0 -1
- package/v3_theme/spacing/types.d.ts +0 -26
- package/v3_theme/types.d.ts +0 -78
- package/v3_theme/use-theme-mode.d.ts +0 -4
- package/v3_theme/use-theme-mode.js +0 -2
- package/v3_theme/use-theme-mode.js.map +0 -1
- /package/file-upload/{file-list.styles.d.ts → file-list/file-list.styles.d.ts} +0 -0
- /package/{deprecate-v2-tokens → migrate-popover}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-nested-multi-select.js","sources":["../../../src/input-nested-multi-select/input-nested-multi-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isEqual from \"lodash/isEqual\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type { SelectedItem } from \"./helpers\";\nimport { getSelectedItems, getSelectedSubItems } from \"./helpers\";\nimport type { InputNestedMultiSelectProps } from \"./types\";\n\nexport const InputNestedMultiSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPaths: _selectedKeyPaths,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onSearch,\n onSelectOptions,\n onShowOptions,\n onHideOptions,\n onRetry,\n onBlur,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedMultiSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const { multiSelectedLabel } = customLabels || {};\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPaths\n ? buildKeyPathToSet(_selectedKeyPaths)\n : new Set<string>()\n );\n const [selectedItems, setSelectedItems] = useState<\n SelectedItem<V1 | V2 | V3>[]\n >([]);\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n const newKeyPath = _selectedKeyPaths || [];\n const selectedItems = getSelectedItems(options, newKeyPath);\n\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPath));\n setSelectedItems(selectedItems);\n }, [_selectedKeyPaths, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleSelectAll = (\n keyPaths: string[][],\n items: NestedDropdownListLocalItem<V1 | V2 | V3>[]\n ) => {\n const selectedItems = items.map((item) => ({\n keyPath: item.keyPath,\n label: item.item.label,\n value: item.item.value,\n }));\n setSelectedKeyPaths(buildKeyPathToSet(keyPaths));\n setSelectedItems(selectedItems);\n performOnSelectOptions(keyPaths, selectedItems);\n };\n\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const newSelectedItems: SelectedItem<V1 | V2 | V3>[] =\n getNewSelection(listItem);\n const newKeyPaths = newSelectedItems.map((item) => item.keyPath);\n setSelectedItems(newSelectedItems);\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPaths));\n performOnSelectOptions(newKeyPaths, newSelectedItems);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (selectedItems.length > 1) {\n return multiSelectedLabel || `${selectedItems.length} selected`;\n }\n\n const { label, value } = selectedItems[0];\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n const performOnSelectOptions = (\n keyPaths: string[][],\n items: SelectedItem<V1 | V2 | V3>[]\n ) => {\n if (onSelectOptions) {\n const returnValue = items.map((item) => item.value);\n onSelectOptions(keyPaths, returnValue);\n }\n };\n\n const getNewSelection = (\n item: NestedDropdownListLocalItem<V1 | V2 | V3>\n ): SelectedItem<V1 | V2 | V3>[] => {\n if (item.checked === true) {\n // remove item or subitems\n return selectedItems.filter((selectedItem) => {\n const ancestorKeyPath = selectedItem.keyPath.slice(\n 0,\n item.keyPath.length\n );\n return !isEqual(item.keyPath, ancestorKeyPath);\n });\n } else {\n // select item or all subitems\n const nextSelection = [...selectedItems];\n const newItemsToAdd = item.hasSubItems\n ? getSelectedSubItems(options, item.keyPath)\n : [\n {\n value: item.item.value,\n label: item.item.label,\n keyPath: item.keyPath,\n },\n ];\n newItemsToAdd.forEach((addedItem) => {\n if (\n !selectedItems.find((selectedItem) =>\n isEqual(selectedItem.keyPath, addedItem.keyPath)\n )\n ) {\n nextSelection.push(addedItem);\n }\n });\n return nextSelection;\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItems)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n multiSelect\n selectedKeyPaths={selectedKeyPaths}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onSelectAll={handleSelectAll}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPaths","_selectedKeyPaths","mode","valueToStringFunction","enableSearch","searchPlaceholder","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onSearch","onSelectOptions","onShowOptions","onHideOptions","onRetry","onBlur","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","multiSelectedLabel","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItems","setSelectedItems","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","newKeyPath","getSelectedItems","handleSelectAll","keyPaths","items","map","item","keyPath","label","value","performOnSelectOptions","handleListItemClick","listItem","newSelectedItems","getNewSelection","newKeyPaths","handleNodeFocus","handleNodeBlur","e","current","contains","relatedTarget","getDisplayValue","length","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","triggerOptionDisplayCallback","show","returnValue","checked","filter","selectedItem","ancestorKeyPath","slice","isEqual","nextSelection","hasSubItems","getSelectedSubItems","forEach","addedItem","find","push","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","multiSelect","itemsLoadState","itemTruncationType","onSelectItem","onSelectAll","matchElementWidth","onOpen","onClose","reason","onDismiss","_a","focus","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"iwCA2BsC,EAClCA,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,iBAA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AAQ,EACRvG,UAAWA,EACXwG,oBAAkB,EAClBC,aAAcxG,EACdyG,SAAUvG,GACZ"}
|
|
1
|
+
{"version":3,"file":"input-nested-multi-select.js","sources":["../../../src/input-nested-multi-select/input-nested-multi-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isEqual from \"lodash/isEqual\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type { SelectedItem } from \"./helpers\";\nimport { getSelectedItems, getSelectedSubItems } from \"./helpers\";\nimport type { InputNestedMultiSelectProps } from \"./types\";\n\nexport const InputNestedMultiSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPaths: _selectedKeyPaths,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onSearch,\n onSelectOptions,\n onShowOptions,\n onHideOptions,\n onRetry,\n onBlur,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedMultiSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const { multiSelectedLabel } = customLabels || {};\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPaths\n ? buildKeyPathToSet(_selectedKeyPaths)\n : new Set<string>()\n );\n const [selectedItems, setSelectedItems] = useState<\n SelectedItem<V1 | V2 | V3>[]\n >([]);\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n const newKeyPath = _selectedKeyPaths || [];\n const selectedItems = getSelectedItems(options, newKeyPath);\n\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPath));\n setSelectedItems(selectedItems);\n }, [_selectedKeyPaths, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleSelectAll = (\n keyPaths: string[][],\n items: NestedDropdownListLocalItem<V1 | V2 | V3>[]\n ) => {\n const selectedItems = items.map((item) => ({\n keyPath: item.keyPath,\n label: item.item.label,\n value: item.item.value,\n }));\n setSelectedKeyPaths(buildKeyPathToSet(keyPaths));\n setSelectedItems(selectedItems);\n performOnSelectOptions(keyPaths, selectedItems);\n };\n\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const newSelectedItems: SelectedItem<V1 | V2 | V3>[] =\n getNewSelection(listItem);\n const newKeyPaths = newSelectedItems.map((item) => item.keyPath);\n setSelectedItems(newSelectedItems);\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPaths));\n performOnSelectOptions(newKeyPaths, newSelectedItems);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (selectedItems.length > 1) {\n return multiSelectedLabel || `${selectedItems.length} selected`;\n }\n\n const { label, value } = selectedItems[0];\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n const performOnSelectOptions = (\n keyPaths: string[][],\n items: SelectedItem<V1 | V2 | V3>[]\n ) => {\n if (onSelectOptions) {\n const returnValue = items.map((item) => item.value);\n onSelectOptions(keyPaths, returnValue);\n }\n };\n\n const getNewSelection = (\n item: NestedDropdownListLocalItem<V1 | V2 | V3>\n ): SelectedItem<V1 | V2 | V3>[] => {\n if (item.checked === true) {\n // remove item or subitems\n return selectedItems.filter((selectedItem) => {\n const ancestorKeyPath = selectedItem.keyPath.slice(\n 0,\n item.keyPath.length\n );\n return !isEqual(item.keyPath, ancestorKeyPath);\n });\n } else {\n // select item or all subitems\n const nextSelection = [...selectedItems];\n const newItemsToAdd = item.hasSubItems\n ? getSelectedSubItems(options, item.keyPath)\n : [\n {\n value: item.item.value,\n label: item.item.label,\n keyPath: item.keyPath,\n },\n ];\n newItemsToAdd.forEach((addedItem) => {\n if (\n !selectedItems.find((selectedItem) =>\n isEqual(selectedItem.keyPath, addedItem.keyPath)\n )\n ) {\n nextSelection.push(addedItem);\n }\n });\n return nextSelection;\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItems)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n multiSelect\n selectedKeyPaths={selectedKeyPaths}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onSelectAll={handleSelectAll}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPaths","_selectedKeyPaths","mode","valueToStringFunction","enableSearch","searchPlaceholder","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onSearch","onSelectOptions","onShowOptions","onHideOptions","onRetry","onBlur","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","multiSelectedLabel","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItems","setSelectedItems","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","newKeyPath","getSelectedItems","handleSelectAll","keyPaths","items","map","item","keyPath","label","value","performOnSelectOptions","handleListItemClick","listItem","newSelectedItems","getNewSelection","newKeyPaths","handleNodeFocus","handleNodeBlur","e","current","contains","relatedTarget","getDisplayValue","length","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","triggerOptionDisplayCallback","show","returnValue","checked","filter","selectedItem","ancestorKeyPath","slice","isEqual","nextSelection","hasSubItems","getSelectedSubItems","forEach","addedItem","find","push","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","multiSelect","itemsLoadState","itemTruncationType","onSelectItem","onSelectAll","matchElementWidth","onOpen","onClose","reason","onDismiss","_a","focus","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"gwCA2BsC,EAClCA,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,iBAAkBC,EAClBC,OACAC,wBACAC,eACAC,oBACAC,uBACAC,uBACAC,eACAC,WACAC,WACAC,kBACAC,gBACAC,gBACAC,UACAC,SACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,UAAU,UACVC,YACAC,iBACAC,gBACAC,uBAKA,MAAMC,mBAAEA,GAAuBf,GAAgB,CAAA,EACzClB,EAAUC,GACTS,EAAkBwB,GAAuBC,WAC5CxB,EACMyB,EAAAA,kBAAkBzB,GAClB,IAAI0B,MAEPC,EAAeC,GAAoBJ,EAAAA,SAExC,KAEKK,EAAaC,GAAkBN,EAAAA,UAAkB,IACjDO,EAASC,IAAcR,EAAAA,UAAkB,GAC1CS,GAAaC,EAAAA,QAEbC,GAAUC,EAAAA,OAAuB,MACjCC,GAAcD,EAAAA,OAA0B,MACxCE,GAAoBF,EAAAA,OAAuB,MAKjDG,EAAAA,WAAU,KACN,MAAMC,EAAaxC,GAAqB,GAClC2B,EAAgBc,EAAAA,iBAAiBpD,EAASmD,GAEhDjB,EAAoBE,EAAAA,kBAAkBe,IACtCZ,EAAiBD,EAAc,GAChC,CAAC3B,EAAmBX,IAKvB,MAAMqD,GAAkB,CACpBC,EACAC,KAEA,MAAMjB,EAAgBiB,EAAMC,KAAKC,IAAI,CACjCC,QAASD,EAAKC,QACdC,MAAOF,EAAKA,KAAKE,MACjBC,MAAOH,EAAKA,KAAKG,UAErB1B,EAAoBE,EAAAA,kBAAkBkB,IACtCf,EAAiBD,GACjBuB,GAAuBP,EAAUhB,EAAc,EAG7CwB,GACFC,IAEA,MAAMC,EACFC,GAAgBF,GACdG,EAAcF,EAAiBR,KAAKC,GAASA,EAAKC,UACxDnB,EAAiByB,GACj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fwC,IAA6B,GAGd,UAAX8C,IACApF,IAAW,GACXlB,SAAAA,IACJ,EA2LIuG,UAxLc,WACC,QAAnBC,EAAAjF,GAAYsB,eAAO,IAAA2D,GAAAA,EAAEC,QACrBzF,GAAe,GACfwC,IAA6B,EAAM,EAsL/BkD,eAAa,EACbC,OAAQ,EACRvG,UAAWA,EACXwG,oBAAkB,EAClBC,aAAcxG,EACdyG,SAAUvG,GACZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("../external/lodash/isEmpty.js"),t=require("react");require("clsx"),require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var n=require("../util/simple-id-generator.js"),s=require("../util/string-helper.js");require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("../external/lodash/isEmpty.js"),t=require("react");require("clsx"),require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var n=require("../util/simple-id-generator.js"),s=require("../util/string-helper.js");require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.styles_mloii0.css"),require("../shared/dropdown-list/dropdown-list.js"),require("../shared/dropdown-list/dropdown-list-state.js");var l=require("../shared/dropdown-list/expandable-element.js"),a=require("../shared/dropdown-list/nested-dropdown-list.js"),i=require("../shared/dropdown-list/nested-dropdown-list-helpers.js"),d=require("../shared/dropdown-wrapper/element-with-dropdown.js"),o=require("../shared/dropdown-wrapper/dropdown-wrapper.js"),u=require("../shared/input-wrapper/input-wrapper.js");exports.InputNestedSelect=({placeholder:c="Select",options:p,disabled:h,error:m,className:b,"data-testid":w,id:y,"aria-labelledby":j,"aria-describedby":q,"aria-invalid":x,selectedKeyPath:S,mode:v,valueToStringFunction:f,enableSearch:g,searchPlaceholder:T,selectableCategory:I,hideNoResultsDisplay:R,noResultsDescription:P,customLabels:L,readOnly:O,onBlur:D,onSearch:N,onSelectOption:k,onShowOptions:E,onHideOptions:C,onRetry:K,optionsLoadState:B="success",optionTruncationType:H="end",variant:_="default",alignment:A,dropdownZIndex:W,dropdownWidth:F,dropdownRootNode:Z})=>{const G=p,[M,V]=t.useState(S?i.buildKeyPathToSet([S]):new Set),[z,J]=t.useState(),[Q,U]=t.useState(!1),[X,Y]=t.useState(!1),$=n.useId(),ee=t.useRef(null),re=t.useRef(null),te=t.useRef(null);t.useEffect((()=>{V(S?i.buildKeyPathToSet([S]):new Set);const e=i.findItemByKeyPath(G,S||[]);J(null!=e?e:void 0)}),[S,G]);const ne=e=>{var r;const{keyPath:t,item:{label:n,value:s}}=e;V(i.buildKeyPathToSet([t])),J({label:n,value:s}),U(!1),de(!1),null===(r=re.current)||void 0===r||r.focus(),null==k||k(t,s)},se=()=>{X||Q||Y(!0)},le=e=>{X&&!Q&&ee.current&&!ee.current.contains(e.relatedTarget)&&(Y(!1),null==D||D())},ae=()=>{if(!z)return"";const{label:e,value:r}=z;return f?f(r):e},ie=e=>{if("middle"===H){let r=0;return te&&te.current&&(r=te.current.getBoundingClientRect().width),s.StringHelper.truncateOneLine(e,r,120,6)}return e},de=e=>{!e&&C&&C(),e&&E&&E()};return e.jsx(d.ElementWithDropdown,{enabled:!O&&!h,isOpen:Q,renderElement:()=>e.jsx(u.InputBox,{className:b,"data-testid":w,id:y,ref:ee,tabIndex:-1,onFocus:se,onBlur:le,focused:X,disabled:h,readOnly:O,error:m,children:e.jsx(l.ExpandableElement,{ref:re,disabled:h,expanded:Q,listboxId:$,popupRole:"tree",readOnly:O,variant:_,"aria-labelledby":j,"aria-describedby":q,"aria-invalid":x,children:e.jsx(o.LabelContainer,{ref:te,disabled:h,children:r.default(z)?e.jsx(o.PlaceholderLabel,{truncateType:H,children:c}):e.jsx(o.ValueLabel,{truncateType:H,children:ie(ae())})})})}),renderDropdown:()=>e.jsx(a.NestedDropdownList,{listboxId:$,listItems:G,selectedKeyPaths:M,selectableCategory:I,itemsLoadState:B,itemTruncationType:H,enableSearch:g,searchPlaceholder:T,hideNoResultsDisplay:R,noResultsDescription:P,customLabels:L,onSelectItem:ne,onRetry:K,onSearch:N,variant:_,mode:v,width:F,matchElementWidth:!0}),onOpen:()=>{U(!0),de(!0),Y(!0)},onClose:e=>{U(!1),de(!1),"click"!==e&&(Y(!1),null==D||D())},onDismiss:()=>{var e;null===(e=re.current)||void 0===e||e.focus(),U(!1),de(!1)},clickToToggle:!0,offset:8,alignment:A,fitAvailableHeight:!0,customZIndex:W,rootNode:Z})};
|
|
2
2
|
//# sourceMappingURL=input-nested-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-nested-select.js","sources":["../../../src/input-nested-select/input-nested-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n findItemByKeyPath,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type {\n InputNestedSelectProps,\n L1OptionProps,\n L2OptionProps,\n L3OptionProps,\n} from \"./types\";\n\nexport type CombinedOptionProps<V1, V2, V3> =\n | L1OptionProps<V1, V2, V3>\n | L2OptionProps<V2, V3>\n | L3OptionProps<V3>;\n\ninterface SelectedItemType<V1, V2, V3> {\n label: string;\n value: V1 | V2 | V3;\n}\n\nexport const InputNestedSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPath: _selectedKeyPath,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n selectableCategory,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onBlur,\n onSearch,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const [selectedItem, setSelectedItem] =\n useState<SelectedItemType<V1, V2, V3>>();\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n setSelectedKeyPaths(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const selectedItem = findItemByKeyPath(options, _selectedKeyPath || []);\n setSelectedItem(selectedItem ?? undefined);\n }, [_selectedKeyPath, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const {\n keyPath,\n item: { label, value },\n } = listItem;\n setSelectedKeyPaths(buildKeyPathToSet([keyPath]));\n setSelectedItem({ label, value });\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n selectorRef.current?.focus();\n onSelectOption?.(keyPath, value);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (!selectedItem) return \"\";\n const { label, value } = selectedItem;\n\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItem)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n selectedKeyPaths={selectedKeyPaths}\n selectableCategory={selectableCategory}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPath","_selectedKeyPath","mode","valueToStringFunction","enableSearch","searchPlaceholder","selectableCategory","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onBlur","onSearch","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","selectedKeyPaths","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItem","setSelectedItem","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","findItemByKeyPath","undefined","handleListItemClick","listItem","keyPath","item","label","value","triggerOptionDisplayCallback","_a","current","focus","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","itemsLoadState","itemTruncationType","onSelectItem","matchElementWidth","onOpen","onClose","reason","onDismiss","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"urCAwCiC,EAC7BA,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAiBC,EACjBC,OACAC,wBACAC,eACAC,oBACAC,qBACAC,uBACAC,uBACAC,eACAC,WACAC,SACAC,WACAC,iBACAC,gBACAC,gBACAC,UACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,UAAU,UACVC,YACAC,iBACAC,gBACAC,uBAKA,MAAMjC,EAAUC,GACTiC,EAAkBC,GAAuBC,WAC5CzB,EACM0B,EAAAA,kBAAkB,CAAC1B,IACnB,IAA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EAAAZ,GAAYa,eAAO,IAAAD,GAAAA,EAAEE,QACrBrB,GAAe,GACfkB,IAA6B,EAAM,EAoI/B+C,eAAa,EACbC,OAAQ,EACR9E,UAAWA,EACX+E,oBAAkB,EAClBC,aAAc/E,EACdgF,SAAU9E,GACZ"}
|
|
1
|
+
{"version":3,"file":"input-nested-select.js","sources":["../../../src/input-nested-select/input-nested-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n findItemByKeyPath,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type {\n InputNestedSelectProps,\n L1OptionProps,\n L2OptionProps,\n L3OptionProps,\n} from \"./types\";\n\nexport type CombinedOptionProps<V1, V2, V3> =\n | L1OptionProps<V1, V2, V3>\n | L2OptionProps<V2, V3>\n | L3OptionProps<V3>;\n\ninterface SelectedItemType<V1, V2, V3> {\n label: string;\n value: V1 | V2 | V3;\n}\n\nexport const InputNestedSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPath: _selectedKeyPath,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n selectableCategory,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onBlur,\n onSearch,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const [selectedItem, setSelectedItem] =\n useState<SelectedItemType<V1, V2, V3>>();\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n setSelectedKeyPaths(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const selectedItem = findItemByKeyPath(options, _selectedKeyPath || []);\n setSelectedItem(selectedItem ?? undefined);\n }, [_selectedKeyPath, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const {\n keyPath,\n item: { label, value },\n } = listItem;\n setSelectedKeyPaths(buildKeyPathToSet([keyPath]));\n setSelectedItem({ label, value });\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n selectorRef.current?.focus();\n onSelectOption?.(keyPath, value);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (!selectedItem) return \"\";\n const { label, value } = selectedItem;\n\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItem)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n selectedKeyPaths={selectedKeyPaths}\n selectableCategory={selectableCategory}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPath","_selectedKeyPath","mode","valueToStringFunction","enableSearch","searchPlaceholder","selectableCategory","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onBlur","onSearch","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","selectedKeyPaths","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItem","setSelectedItem","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","findItemByKeyPath","undefined","handleListItemClick","listItem","keyPath","item","label","value","triggerOptionDisplayCallback","_a","current","focus","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","itemsLoadState","itemTruncationType","onSelectItem","matchElementWidth","onOpen","onClose","reason","onDismiss","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"srCAwCiC,EAC7BA,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAiBC,EACjBC,OACAC,wBACAC,eACAC,oBACAC,qBACAC,uBACAC,uBACAC,eACAC,WACAC,SACAC,WACAC,iBACAC,gBACAC,gBACAC,UACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,UAAU,UACVC,YACAC,iBACAC,gBACAC,uBAKA,MAAMjC,EAAUC,GACTiC,EAAkBC,GAAuBC,WAC5CzB,EACM0B,EAAAA,kBAAkB,CAAC1B,IACnB,IAAI2B,MAEPC,EAAcC,GACjBJ,cAEGK,EAAaC,GAAkBN,EAAAA,UAAkB,IACjDO,EAASC,GAAcR,EAAAA,UAAkB,GAC1CS,EAAaC,EAAAA,QAEbC,GAAUC,EAAAA,OAAuB,MACjCC,GAAcD,EAAAA,OAA0B,MACxCE,GAAoBF,EAAAA,OAAuB,MAKjDG,EAAAA,WAAU,KACNhB,EACIxB,EACM0B,EAAAA,kBAAkB,CAAC1B,IACnB,IAAI2B,KAEd,MAAMC,EAAea,EAAAA,kBAAkBpD,EAASW,GAAoB,IACpE6B,EAAgBD,QAAAA,OAAgBc,EAAU,GAC3C,CAAC1C,EAAkBX,IAKtB,MAAMsD,GACFC,UAEA,MAAMC,QACFA,EACAC,MA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C,EAAe,eACnBC,EAAWiF,SA9BrCb,MAACc,EAAAA,eAAc,CAACR,IAAKjC,GAAmBhD,SAAUA,WAhB9C0F,EAAAA,QAAQrD,GAEJsC,EAAAA,IAACgB,EAAAA,iBAAgB,CAACC,aAAclE,EAAoB8D,SAC/C3F,IAKL8E,EAAAA,IAACkB,aAAU,CAACD,aAAclE,EAAoB8D,SACzCpB,GAAcD,cA2EvB2B,eA9Be,IAEfnB,EAAAA,IAACoB,EAAAA,mBAAkB,CACfT,UAAW3C,EACXqD,UAAWlG,EACXkC,iBAAkBA,EAClBlB,mBAAoBA,EACpBmF,eAAgBxE,EAChByE,mBAAoBxE,EACpBd,aAAcA,EACdC,kBAAmBA,EACnBE,qBAAsBA,EACtBC,qBAAsBA,EACtBC,aAAcA,EACdkF,aAAc/C,GACd5B,QAASA,EACTJ,SAAUA,EACVO,QAASA,EACTjB,KAAMA,EACN6D,MAAOzC,EACPsE,mBAAiB,IAWrBC,OArJW,KACf7D,GAAe,GACfkB,IAA6B,GAC7BhB,GAAW,EAAK,EAmJZ4D,QAhJaC,IACjB/D,GAAe,GACfkB,IAA6B,GAGd,UAAX6C,IACA7D,GAAW,GACXvB,SAAAA,IACJ,EAyIIqF,UAtIc,WACC,QAAnB7C,EAAAZ,GAAYa,eAAO,IAAAD,GAAAA,EAAEE,QACrBrB,GAAe,GACfkB,IAA6B,EAAM,EAoI/B+C,eAAa,EACbC,OAAQ,EACR9E,UAAWA,EACX+E,oBAAkB,EAClBC,aAAc/E,EACdgF,SAAU9E,GACZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),t=require("clsx"),o=require("react"),n=require("../shared/accessibility/index.js");require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var i=require("../util/simple-id-generator.js"),s=require("../util/string-helper.js");require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.
|
|
1
|
+
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),t=require("clsx"),o=require("react"),n=require("../shared/accessibility/index.js");require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var i=require("../util/simple-id-generator.js"),s=require("../util/string-helper.js");require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.styles_mloii0.css");var a=require("../shared/dropdown-list/dropdown-list.js"),l=require("../shared/dropdown-list/dropdown-list-state.js");require("../shared/dropdown-list/expandable-element.js"),require("@lifesg/react-icons/caret-right"),require("@lifesg/react-icons/exclamation-circle-fill"),require("@lifesg/react-icons/minus-square-fill"),require("@lifesg/react-icons/square"),require("@lifesg/react-icons/square-tick-fill"),require("@lifesg/react-icons/tick"),require("react-virtuoso"),require("../markup/markup.js"),require("../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css");var d=require("../shared/dropdown-wrapper/element-with-dropdown.js"),u=require("../shared/input-wrapper/input-wrapper.js");require("../shared/dropdown-list/dropdown-list.styles_konwm.css"),require("../shared/dropdown-list/dropdown-search.js"),require("../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css"),require("immer"),require("../external/lodash/_getTag.js"),require("../external/lodash/isArguments.js"),require("../external/lodash/_baseGetTag.js"),require("../external/lodash/isBuffer.js"),require("../external/lodash/isTypedArray.js"),require("../external/lodash/_Stack.js"),require("../external/lodash/_SetCache.js"),require("../external/lodash/_equalByTag.js"),require("../shared/dropdown-list/virtuoso-components.js");var c=require("../shared/dropdown-wrapper/dropdown-wrapper.js"),p=require("../shared/input-wrapper/input-wrapper.styles.js"),m=require("../shared/range-input-inner-container/range-input-inner-container.js"),h=require("./input-range-select.styles.js");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=f(t);exports.InputRangeSelect=t=>{var{selectedOptions:f,placeholders:q={from:"Select",to:"Select"},options:j,disabled:w,className:x,readOnly:b,error:y,"data-testid":g,id:S,enableSearch:_=!1,searchFunction:T,searchPlaceholder:I,valueExtractor:C,valueToStringFunction:O,listExtractor:A,displayValueExtractor:k,onSelectOption:E,onShowOptions:L,onHideOptions:D,onRetry:R,optionsLoadState:H={from:"success",to:"success"},optionTruncationType:P="middle",renderCustomSelectedOption:N,renderListItem:B,renderCustomCallToAction:F,alignment:M,dropdownZIndex:W,dropdownRootNode:$,dropdownWidth:G,"aria-labelledby":V,"aria-describedby":Z}=t,K=e.__rest(t,["selectedOptions","placeholders","options","disabled","className","readOnly","error","data-testid","id","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","renderCustomCallToAction","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","aria-labelledby","aria-describedby"]);const[z,J]=o.useState(),[Q,U]=o.useState(),[X,Y]=o.useState("none"),ee="none"!==X,re={from:o.useRef(null),to:o.useRef(null)},te=o.useRef(null),oe=i.useId(),ne=`${oe}-range-listbox`,ie=`${oe}-from-label`,se=`${oe}-to-label`;o.useEffect((()=>{J(null==f?void 0:f.from),U(null==f?void 0:f.to)}),[f]),o.useEffect((()=>{var e;ee&&"to"===X&&(null===(e=te.current)||void 0===e||e.refocus({index:0}))}),[ee,X]);const ae=e=>{e||null==D||D(),e&&(null==L||L())},le=e=>{var r,t;const o="from"===e?z:Q;if(!o)return"";if(k)return k(o);if(C){const e=C(o);return O?O(e):null!==(t=null===(r=null==e?void 0:e.toString)||void 0===r?void 0:r.call(e))&&void 0!==t?t:""}return o.toString()},de=(e,r)=>{var t;if("middle"===P){let o=0;return(null===(t=re[e])||void 0===t?void 0:t.current)&&(o=re[e].current.getBoundingClientRect().width),s.StringHelper.truncateOneLine(r,o,120,8)}return r},ue=()=>{switch(X){case"from":return"start";case"to":return"end";case"none":return X}},ce=o.useMemo((()=>{var e;return"none"===X?[]:null!==(e=null==j?void 0:j[X])&&void 0!==e?e:[]}),[X,j]),pe=o.useMemo((()=>{if("none"===X)return[];const e="from"===X?z:Q;return e?[e]:[]}),[X,z,Q]),me=e=>{if(w||b)return;Y("to"!==e||z?e:"from"),ae(!0)},he=e=>{var r;null===(r=re[e].current)||void 0===r||r.focus()},fe=e=>{const r="from"===e?ie:se;return n.concatIds(r,V)},ve=e=>r=>{r.stopPropagation(),r.preventDefault(),me(e)},qe=e=>r=>{if(!w&&!b)switch(r.key){case"Enter":case" ":case"ArrowDown":r.preventDefault(),me(e)}},je=(e,r)=>{if("none"!==X){if("from"===X)return J(e),null==E||E({from:e},r),U(void 0),Y("to"),ae(!0),void he("to");U(e),null==E||E({to:e},r),Y("none"),ae(!1),he("to")}},we=()=>{const e=X;Y("none"),ae(!1),he("to"===e?"to":"from"),z&&Q||(J(void 0),U(void 0))},xe=e=>{e.stopPropagation(),e.preventDefault(),J(void 0),U(void 0),null==E||E({from:void 0,to:void 0},void 0),he("from")},be=e=>{const t="from"===e?z:Q;return t?N?N(t):r.jsx(c.ValueLabel,{truncateType:P,children:de(e,le(e))}):r.jsx(c.PlaceholderLabel,{truncateType:P,children:de(e,(null==q?void 0:q[e])||"")})},ye=e=>r.jsx("button",{type:"button",role:"combobox","aria-labelledby":fe(e),"aria-describedby":Z,"aria-expanded":ee&&X===e,"aria-controls":ne,"aria-disabled":w,"aria-readonly":b,onClick:ve(e),onKeyDown:qe(e),ref:re[e],tabIndex:0,className:h.rangeSelectorButton,children:be(e)});return r.jsx("div",Object.assign({id:S},K,{children:r.jsx(l.DropdownListState,{children:r.jsx(d.ElementWithDropdown,{enabled:!b&&!w,isOpen:ee,renderElement:()=>r.jsxs(u.InputWrapper,{className:v.default(h.styledInputWrapper,x),"data-testid":g,disabled:w,readOnly:b,error:y,focused:ee,children:[r.jsx(n.VisuallyHidden,{id:ie,children:(null==q?void 0:q.from)||"Select From"}),r.jsx(n.VisuallyHidden,{id:se,children:(null==q?void 0:q.to)||"Select To"}),r.jsxs(m.RangeInputInnerContainer,{currentActive:ue(),error:y,children:[ye("from"),ye("to")]}),!ee&&z&&Q&&!b&&!w&&r.jsx("div",{className:p.clearButtonContainer,children:r.jsx(u.ClearButton,{onClick:xe,type:"button","aria-label":"Clear"})})]}),renderDropdown:()=>r.jsx(a.DropdownList,{ref:te,"data-testid":`${g}-dropdown`,listboxId:ne,ariaLabel:"from"===X?`Selecting for: ${null==q?void 0:q.from}`:"to"===X?`Selecting for: ${null==q?void 0:q.to}`:void 0,listItems:ce,onSelectItem:je,onDismiss:we,valueExtractor:C,listExtractor:A,selectedItems:pe,itemsLoadState:H[X],itemTruncationType:P,onRetry:R,width:G,matchElementWidth:!G,enableSearch:_,searchFunction:T,searchPlaceholder:I,renderListItem:B,renderCustomCallToAction:F}),onOpen:()=>{w||b||"none"===X&&(Y("from"),ae(!0))},onClose:()=>{Y("none"),ae(!1),z&&Q||(J(void 0),U(void 0))},onDismiss:we,clickToToggle:!1,offset:8,alignment:M,fitAvailableHeight:!0,customZIndex:W,rootNode:$})})}))};
|
|
2
2
|
//# sourceMappingURL=input-range-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-range-select.js","sources":["../../../src/input-range-select/input-range-select.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type React from \"react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { concatIds, VisuallyHidden } from \"../shared/accessibility\";\nimport type { DropdownListApi } from \"../shared/dropdown-list\";\nimport { DropdownList, DropdownListState } from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { ClearButton, InputWrapper } from \"../shared/input-wrapper\";\nimport * as inputWrapperStyles from \"../shared/input-wrapper/input-wrapper.styles\";\nimport { RangeInputInnerContainer } from \"../shared/range-input-inner-container\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport * as styles from \"./input-range-select.styles\";\nimport type { InputRangeSelectProps } from \"./types\";\n\ntype RangeType = \"from\" | \"to\";\n\nexport const InputRangeSelect = <T, V>({\n selectedOptions,\n placeholders = { from: \"Select\", to: \"Select\" },\n options,\n disabled,\n className,\n readOnly,\n error,\n \"data-testid\": testId,\n id,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = { from: \"success\", to: \"success\" },\n optionTruncationType = \"middle\",\n renderCustomSelectedOption,\n renderListItem,\n renderCustomCallToAction,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n}: InputRangeSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [selectedFromValue, setSelectedFromValue] = useState<T | undefined>();\n const [selectedToValue, setSelectedToValue] = useState<T | undefined>();\n const [focusedInput, setFocusedInput] = useState<RangeType | \"none\">(\n \"none\"\n );\n const isOpen = focusedInput !== \"none\";\n\n const labelButtonRef = {\n from: useRef<HTMLButtonElement>(null),\n to: useRef<HTMLButtonElement>(null),\n };\n const dropdownRef = useRef<DropdownListApi>(null);\n\n const internalId = useId();\n const listboxId = `${internalId}-range-listbox`;\n const fromLabelId = `${internalId}-from-label`;\n const toLabelId = `${internalId}-to-label`;\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelectedFromValue(selectedOptions?.from);\n setSelectedToValue(selectedOptions?.to);\n }, [selectedOptions]);\n\n useEffect(() => {\n if (!isOpen) return;\n\n if (focusedInput === \"to\") {\n dropdownRef.current?.refocus({ index: 0 });\n }\n }, [isOpen, focusedInput]);\n\n // =============================================================================\n // HELPERS\n // =============================================================================\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show) onHideOptions?.();\n if (show) onShowOptions?.();\n };\n\n const getDisplayValue = (rangeType: RangeType): string => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n if (!selected) return \"\";\n\n if (displayValueExtractor) return displayValueExtractor(selected);\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString?.() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (type: RangeType, value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelButtonRef[type]?.current) {\n widthOfElement =\n labelButtonRef[type].current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const getCurrentFocused = (): \"none\" | \"start\" | \"end\" => {\n switch (focusedInput) {\n case \"from\":\n return \"start\";\n case \"to\":\n return \"end\";\n case \"none\":\n return focusedInput;\n }\n };\n\n const currentOptions = useMemo(() => {\n if (focusedInput === \"none\") return [];\n return options?.[focusedInput] ?? [];\n }, [focusedInput, options]);\n\n const currentSelectedItems = useMemo(() => {\n if (focusedInput === \"none\") return [];\n const selected =\n focusedInput === \"from\" ? selectedFromValue : selectedToValue;\n return selected ? [selected] : [];\n }, [focusedInput, selectedFromValue, selectedToValue]);\n\n const openDropdownFor = (rangeType: RangeType) => {\n if (disabled || readOnly) return;\n\n const nextFocusedInput =\n rangeType === \"to\" && !selectedFromValue ? \"from\" : rangeType;\n\n setFocusedInput(nextFocusedInput);\n triggerOptionDisplayCallback(true);\n };\n\n const focusButton = (type: RangeType) => {\n labelButtonRef[type].current?.focus();\n };\n\n const getButtonLabelledBy = (rangeType: RangeType) => {\n const rangeLabelId = rangeType === \"from\" ? fromLabelId : toLabelId;\n return concatIds(rangeLabelId, ariaLabelledBy);\n };\n\n const getDropdownAriaLabel = () => {\n if (focusedInput === \"from\") {\n return `Selecting for: ${placeholders?.from}`;\n }\n\n if (focusedInput === \"to\") {\n return `Selecting for: ${placeholders?.to}`;\n }\n\n return undefined;\n };\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleSelectorClick =\n (rangeType: RangeType) => (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n openDropdownFor(rangeType);\n };\n\n const handleSelectorKeyDown =\n (rangeType: RangeType) =>\n (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) return;\n\n switch (event.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\":\n event.preventDefault();\n openDropdownFor(rangeType);\n break;\n default:\n break;\n }\n };\n\n const handleListItemClick = (item: T, extractedValue: V) => {\n if (focusedInput === \"none\") return;\n\n if (focusedInput === \"from\") {\n setSelectedFromValue(item);\n onSelectOption?.({ from: item }, extractedValue);\n\n setSelectedToValue(undefined);\n setFocusedInput(\"to\");\n triggerOptionDisplayCallback(true);\n focusButton(\"to\");\n return;\n }\n\n setSelectedToValue(item);\n onSelectOption?.({ to: item }, extractedValue);\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n focusButton(\"to\");\n };\n\n const handleDismiss = () => {\n const last = focusedInput;\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (last === \"to\") focusButton(\"to\");\n else focusButton(\"from\");\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleClose = () => {\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleOpen = () => {\n if (disabled || readOnly) return;\n\n if (focusedInput === \"none\") {\n setFocusedInput(\"from\");\n triggerOptionDisplayCallback(true);\n }\n };\n\n const handleClear = (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n onSelectOption?.({ from: undefined, to: undefined }, undefined);\n\n focusButton(\"from\");\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n const renderLabel = (rangeType: RangeType) => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n\n if (!selected) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, placeholders?.[rangeType] || \"\")}\n </PlaceholderLabel>\n );\n }\n\n if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n }\n\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, getDisplayValue(rangeType))}\n </ValueLabel>\n );\n };\n\n const renderSelectorContent = (rangeType: RangeType) => (\n <button\n type=\"button\"\n role=\"combobox\"\n aria-labelledby={getButtonLabelledBy(rangeType)}\n aria-describedby={ariaDescribedBy}\n aria-expanded={isOpen && focusedInput === rangeType}\n aria-controls={listboxId}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n onClick={handleSelectorClick(rangeType)}\n onKeyDown={handleSelectorKeyDown(rangeType)}\n ref={labelButtonRef[rangeType]}\n tabIndex={0}\n className={styles.rangeSelectorButton}\n >\n {renderLabel(rangeType)}\n </button>\n );\n\n const renderElement = () => {\n return (\n <InputWrapper\n className={clsx(styles.styledInputWrapper, className)}\n data-testid={testId}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n focused={isOpen}\n >\n <VisuallyHidden id={fromLabelId}>\n {placeholders?.from || \"Select From\"}\n </VisuallyHidden>\n <VisuallyHidden id={toLabelId}>\n {placeholders?.to || \"Select To\"}\n </VisuallyHidden>\n\n <RangeInputInnerContainer\n currentActive={getCurrentFocused()}\n error={error}\n >\n {renderSelectorContent(\"from\")}\n {renderSelectorContent(\"to\")}\n </RangeInputInnerContainer>\n\n {!isOpen &&\n selectedFromValue &&\n selectedToValue &&\n !readOnly &&\n !disabled && (\n <div\n className={inputWrapperStyles.clearButtonContainer}\n >\n <ClearButton\n onClick={handleClear}\n type=\"button\"\n aria-label=\"Clear\"\n />\n </div>\n )}\n </InputWrapper>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n ref={dropdownRef}\n data-testid={`${testId}-dropdown`}\n listboxId={listboxId}\n ariaLabel={getDropdownAriaLabel()}\n listItems={currentOptions}\n onSelectItem={handleListItemClick}\n onDismiss={handleDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n selectedItems={currentSelectedItems}\n itemsLoadState={optionsLoadState[focusedInput as RangeType]}\n itemTruncationType={optionTruncationType}\n onRetry={onRetry}\n width={dropdownWidth}\n matchElementWidth={!dropdownWidth}\n enableSearch={enableSearch}\n searchFunction={searchFunction}\n searchPlaceholder={searchPlaceholder}\n renderListItem={renderListItem}\n renderCustomCallToAction={renderCustomCallToAction}\n />\n );\n };\n\n return (\n <div id={id} {...otherProps}>\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={isOpen}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle={false}\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n </div>\n );\n};\n"],"names":["_a","selectedOptions","placeholders","from","to","options","disabled","className","readOnly","error","testId","id","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","renderCustomCallToAction","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","ariaLabelledBy","ariaDescribedBy","otherProps","__rest","selectedFromValue","setSelectedFromValue","useState","selectedToValue","setSelectedToValue","focusedInput","setFocusedInput","isOpen","labelButtonRef","useRef","dropdownRef","internalId","useId","listboxId","fromLabelId","toLabelId","useEffect","current","refocus","index","triggerOptionDisplayCallback","show","getDisplayValue","rangeType","selected","value","_b","toString","call","truncateValue","type","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","getCurrentFocused","currentOptions","useMemo","currentSelectedItems","openDropdownFor","focusButton","focus","getButtonLabelledBy","rangeLabelId","concatIds","handleSelectorClick","event","stopPropagation","preventDefault","handleSelectorKeyDown","key","handleListItemClick","item","extractedValue","undefined","handleDismiss","last","handleClear","renderLabel","_jsx","ValueLabel","truncateType","children","PlaceholderLabel","renderSelectorContent","role","onClick","onKeyDown","ref","tabIndex","styles.rangeSelectorButton","Object","assign","DropdownListState","ElementWithDropdown","enabled","renderElement","_jsxs","InputWrapper","clsx","styles.styledInputWrapper","focused","VisuallyHidden","RangeInputInnerContainer","currentActive","inputWrapperStyles.clearButtonContainer","ClearButton","renderDropdown","DropdownList","ariaLabel","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"06EAsBuCA,QAAAC,gBACnCA,EAAeC,aACfA,EAAe,CAAEC,KAAM,SAAUC,GAAI,UAAUC,QAC/CA,EAAOC,SACPA,EAAQC,UACRA,EAASC,SACTA,EAAQC,MACRA,EACA,cAAeC,EAAMC,GACrBA,EAAEC,aACFA,GAAe,EAAKC,eACpBA,EAAcC,kBACdA,EAAiBC,eACjBA,EAAcC,sBACdA,EAAqBC,cACrBA,EAAaC,sBACbA,EAAqBC,eACrBA,EAAcC,cACdA,EAAaC,cACbA,EAAaC,QACbA,EAAOC,iBACPA,EAAmB,CAAEpB,KAAM,UAAWC,GAAI,WAAWoB,qBACrDA,EAAuB,SAAQC,2BAC/BA,EAA0BC,eAC1BA,EAAcC,yBACdA,EAAwBC,UACxBA,EAASC,eACT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EAChBE,cAAeA,EACfiH,cAAevD,GACfwD,eAAgB5G,EAAiBkB,GACjC2F,mBAAoB5G,EACpBF,QAASA,EACT+C,MAAOtC,EACPsG,mBAAoBtG,EACpBnB,aAAcA,EACdC,eAAgBA,EAChBC,kBAAmBA,EACnBY,eAAgBA,EAChBC,yBAA0BA,IAatB2G,OAhJG,KACXhI,GAAYE,GAEK,SAAjBiC,IACAC,EAAgB,QAChBc,IAA6B,GACjC,EA2IY+E,QA3JI,KAChB7F,EAAgB,QAChBc,IAA6B,GAExBpB,GAAsBG,IACvBF,OAAqBsD,GACrBnD,OAAmBmD,GACvB,EAqJYsC,UAAWrC,GACX4C,eAAe,EACfC,OAAQ,EACR7G,UAAWA,EACX8G,oBAAkB,EAClBC,aAAc9G,EACd+G,SAAU9G,QAGhB"}
|
|
1
|
+
{"version":3,"file":"input-range-select.js","sources":["../../../src/input-range-select/input-range-select.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type React from \"react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { concatIds, VisuallyHidden } from \"../shared/accessibility\";\nimport type { DropdownListApi } from \"../shared/dropdown-list\";\nimport { DropdownList, DropdownListState } from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { ClearButton, InputWrapper } from \"../shared/input-wrapper\";\nimport * as inputWrapperStyles from \"../shared/input-wrapper/input-wrapper.styles\";\nimport { RangeInputInnerContainer } from \"../shared/range-input-inner-container\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport * as styles from \"./input-range-select.styles\";\nimport type { InputRangeSelectProps } from \"./types\";\n\ntype RangeType = \"from\" | \"to\";\n\nexport const InputRangeSelect = <T, V>({\n selectedOptions,\n placeholders = { from: \"Select\", to: \"Select\" },\n options,\n disabled,\n className,\n readOnly,\n error,\n \"data-testid\": testId,\n id,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = { from: \"success\", to: \"success\" },\n optionTruncationType = \"middle\",\n renderCustomSelectedOption,\n renderListItem,\n renderCustomCallToAction,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n}: InputRangeSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [selectedFromValue, setSelectedFromValue] = useState<T | undefined>();\n const [selectedToValue, setSelectedToValue] = useState<T | undefined>();\n const [focusedInput, setFocusedInput] = useState<RangeType | \"none\">(\n \"none\"\n );\n const isOpen = focusedInput !== \"none\";\n\n const labelButtonRef = {\n from: useRef<HTMLButtonElement>(null),\n to: useRef<HTMLButtonElement>(null),\n };\n const dropdownRef = useRef<DropdownListApi>(null);\n\n const internalId = useId();\n const listboxId = `${internalId}-range-listbox`;\n const fromLabelId = `${internalId}-from-label`;\n const toLabelId = `${internalId}-to-label`;\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelectedFromValue(selectedOptions?.from);\n setSelectedToValue(selectedOptions?.to);\n }, [selectedOptions]);\n\n useEffect(() => {\n if (!isOpen) return;\n\n if (focusedInput === \"to\") {\n dropdownRef.current?.refocus({ index: 0 });\n }\n }, [isOpen, focusedInput]);\n\n // =============================================================================\n // HELPERS\n // =============================================================================\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show) onHideOptions?.();\n if (show) onShowOptions?.();\n };\n\n const getDisplayValue = (rangeType: RangeType): string => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n if (!selected) return \"\";\n\n if (displayValueExtractor) return displayValueExtractor(selected);\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString?.() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (type: RangeType, value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelButtonRef[type]?.current) {\n widthOfElement =\n labelButtonRef[type].current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const getCurrentFocused = (): \"none\" | \"start\" | \"end\" => {\n switch (focusedInput) {\n case \"from\":\n return \"start\";\n case \"to\":\n return \"end\";\n case \"none\":\n return focusedInput;\n }\n };\n\n const currentOptions = useMemo(() => {\n if (focusedInput === \"none\") return [];\n return options?.[focusedInput] ?? [];\n }, [focusedInput, options]);\n\n const currentSelectedItems = useMemo(() => {\n if (focusedInput === \"none\") return [];\n const selected =\n focusedInput === \"from\" ? selectedFromValue : selectedToValue;\n return selected ? [selected] : [];\n }, [focusedInput, selectedFromValue, selectedToValue]);\n\n const openDropdownFor = (rangeType: RangeType) => {\n if (disabled || readOnly) return;\n\n const nextFocusedInput =\n rangeType === \"to\" && !selectedFromValue ? \"from\" : rangeType;\n\n setFocusedInput(nextFocusedInput);\n triggerOptionDisplayCallback(true);\n };\n\n const focusButton = (type: RangeType) => {\n labelButtonRef[type].current?.focus();\n };\n\n const getButtonLabelledBy = (rangeType: RangeType) => {\n const rangeLabelId = rangeType === \"from\" ? fromLabelId : toLabelId;\n return concatIds(rangeLabelId, ariaLabelledBy);\n };\n\n const getDropdownAriaLabel = () => {\n if (focusedInput === \"from\") {\n return `Selecting for: ${placeholders?.from}`;\n }\n\n if (focusedInput === \"to\") {\n return `Selecting for: ${placeholders?.to}`;\n }\n\n return undefined;\n };\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleSelectorClick =\n (rangeType: RangeType) => (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n openDropdownFor(rangeType);\n };\n\n const handleSelectorKeyDown =\n (rangeType: RangeType) =>\n (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) return;\n\n switch (event.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\":\n event.preventDefault();\n openDropdownFor(rangeType);\n break;\n default:\n break;\n }\n };\n\n const handleListItemClick = (item: T, extractedValue: V) => {\n if (focusedInput === \"none\") return;\n\n if (focusedInput === \"from\") {\n setSelectedFromValue(item);\n onSelectOption?.({ from: item }, extractedValue);\n\n setSelectedToValue(undefined);\n setFocusedInput(\"to\");\n triggerOptionDisplayCallback(true);\n focusButton(\"to\");\n return;\n }\n\n setSelectedToValue(item);\n onSelectOption?.({ to: item }, extractedValue);\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n focusButton(\"to\");\n };\n\n const handleDismiss = () => {\n const last = focusedInput;\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (last === \"to\") focusButton(\"to\");\n else focusButton(\"from\");\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleClose = () => {\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleOpen = () => {\n if (disabled || readOnly) return;\n\n if (focusedInput === \"none\") {\n setFocusedInput(\"from\");\n triggerOptionDisplayCallback(true);\n }\n };\n\n const handleClear = (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n onSelectOption?.({ from: undefined, to: undefined }, undefined);\n\n focusButton(\"from\");\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n const renderLabel = (rangeType: RangeType) => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n\n if (!selected) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, placeholders?.[rangeType] || \"\")}\n </PlaceholderLabel>\n );\n }\n\n if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n }\n\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, getDisplayValue(rangeType))}\n </ValueLabel>\n );\n };\n\n const renderSelectorContent = (rangeType: RangeType) => (\n <button\n type=\"button\"\n role=\"combobox\"\n aria-labelledby={getButtonLabelledBy(rangeType)}\n aria-describedby={ariaDescribedBy}\n aria-expanded={isOpen && focusedInput === rangeType}\n aria-controls={listboxId}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n onClick={handleSelectorClick(rangeType)}\n onKeyDown={handleSelectorKeyDown(rangeType)}\n ref={labelButtonRef[rangeType]}\n tabIndex={0}\n className={styles.rangeSelectorButton}\n >\n {renderLabel(rangeType)}\n </button>\n );\n\n const renderElement = () => {\n return (\n <InputWrapper\n className={clsx(styles.styledInputWrapper, className)}\n data-testid={testId}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n focused={isOpen}\n >\n <VisuallyHidden id={fromLabelId}>\n {placeholders?.from || \"Select From\"}\n </VisuallyHidden>\n <VisuallyHidden id={toLabelId}>\n {placeholders?.to || \"Select To\"}\n </VisuallyHidden>\n\n <RangeInputInnerContainer\n currentActive={getCurrentFocused()}\n error={error}\n >\n {renderSelectorContent(\"from\")}\n {renderSelectorContent(\"to\")}\n </RangeInputInnerContainer>\n\n {!isOpen &&\n selectedFromValue &&\n selectedToValue &&\n !readOnly &&\n !disabled && (\n <div\n className={inputWrapperStyles.clearButtonContainer}\n >\n <ClearButton\n onClick={handleClear}\n type=\"button\"\n aria-label=\"Clear\"\n />\n </div>\n )}\n </InputWrapper>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n ref={dropdownRef}\n data-testid={`${testId}-dropdown`}\n listboxId={listboxId}\n ariaLabel={getDropdownAriaLabel()}\n listItems={currentOptions}\n onSelectItem={handleListItemClick}\n onDismiss={handleDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n selectedItems={currentSelectedItems}\n itemsLoadState={optionsLoadState[focusedInput as RangeType]}\n itemTruncationType={optionTruncationType}\n onRetry={onRetry}\n width={dropdownWidth}\n matchElementWidth={!dropdownWidth}\n enableSearch={enableSearch}\n searchFunction={searchFunction}\n searchPlaceholder={searchPlaceholder}\n renderListItem={renderListItem}\n renderCustomCallToAction={renderCustomCallToAction}\n />\n );\n };\n\n return (\n <div id={id} {...otherProps}>\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={isOpen}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle={false}\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n </div>\n );\n};\n"],"names":["_a","selectedOptions","placeholders","from","to","options","disabled","className","readOnly","error","testId","id","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","renderCustomCallToAction","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","ariaLabelledBy","ariaDescribedBy","otherProps","__rest","selectedFromValue","setSelectedFromValue","useState","selectedToValue","setSelectedToValue","focusedInput","setFocusedInput","isOpen","labelButtonRef","useRef","dropdownRef","internalId","useId","listboxId","fromLabelId","toLabelId","useEffect","current","refocus","index","triggerOptionDisplayCallback","show","getDisplayValue","rangeType","selected","value","_b","toString","call","truncateValue","type","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","getCurrentFocused","currentOptions","useMemo","currentSelectedItems","openDropdownFor","focusButton","focus","getButtonLabelledBy","rangeLabelId","concatIds","handleSelectorClick","event","stopPropagation","preventDefault","handleSelectorKeyDown","key","handleListItemClick","item","extractedValue","undefined","handleDismiss","last","handleClear","renderLabel","_jsx","ValueLabel","truncateType","children","PlaceholderLabel","renderSelectorContent","role","onClick","onKeyDown","ref","tabIndex","styles.rangeSelectorButton","Object","assign","DropdownListState","ElementWithDropdown","enabled","renderElement","_jsxs","InputWrapper","clsx","styles.styledInputWrapper","focused","VisuallyHidden","RangeInputInnerContainer","currentActive","inputWrapperStyles.clearButtonContainer","ClearButton","renderDropdown","DropdownList","ariaLabel","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"u6EAsBuCA,QAAAC,gBACnCA,EAAeC,aACfA,EAAe,CAAEC,KAAM,SAAUC,GAAI,UAAUC,QAC/CA,EAAOC,SACPA,EAAQC,UACRA,EAASC,SACTA,EAAQC,MACRA,EACA,cAAeC,EAAMC,GACrBA,EAAEC,aACFA,GAAe,EAAKC,eACpBA,EAAcC,kBACdA,EAAiBC,eACjBA,EAAcC,sBACdA,EAAqBC,cACrBA,EAAaC,sBACbA,EAAqBC,eACrBA,EAAcC,cACdA,EAAaC,cACbA,EAAaC,QACbA,EAAOC,iBACPA,EAAmB,CAAEpB,KAAM,UAAWC,GAAI,WAAWoB,qBACrDA,EAAuB,SAAQC,2BAC/BA,EAA0BC,eAC1BA,EAAcC,yBACdA,EAAwBC,UACxBA,EAASC,eACTA,EAAcC,iBACdA,EAAgBC,cAChBA,EACA,kBAAmBC,EACnB,mBAAoBC,KACjBC,EAAUC,EAAAA,OAAAnC,EAhCsB,CAAA,kBAAA,eAAA,UAAA,WAAA,YAAA,WAAA,QAAA,cAAA,KAAA,eAAA,iBAAA,oBAAA,iBAAA,wBAAA,gBAAA,wBAAA,iBAAA,gBAAA,gBAAA,UAAA,mBAAA,uBAAA,6BAAA,iBAAA,2BAAA,YAAA,iBAAA,mBAAA,gBAAA,kBAAA,qBAqCnC,MAAOoC,EAAmBC,GAAwBC,cAC3CC,EAAiBC,GAAsBF,cACvCG,EAAcC,GAAmBJ,EAAAA,SACpC,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C,eAAe,EACfC,OAAQ,EACR7G,UAAWA,EACX8G,oBAAkB,EAClBC,aAAc9G,EACd+G,SAAU9G,QAGhB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react");require("clsx"),require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var t=require("../util/simple-id-generator.js"),i=require("../util/string-helper.js");require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react");require("clsx"),require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var t=require("../util/simple-id-generator.js"),i=require("../util/string-helper.js");require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.styles_mloii0.css");var s=require("../shared/dropdown-list/dropdown-list.js"),n=require("../shared/dropdown-list/dropdown-list-state.js"),a=require("../shared/dropdown-list/expandable-element.js");require("@lifesg/react-icons/caret-right"),require("@lifesg/react-icons/exclamation-circle-fill"),require("@lifesg/react-icons/minus-square-fill"),require("@lifesg/react-icons/square"),require("@lifesg/react-icons/square-tick-fill"),require("@lifesg/react-icons/tick"),require("react-virtuoso"),require("../markup/markup.js"),require("../_virtual/_tslib.js"),require("../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css");var o=require("../shared/dropdown-wrapper/element-with-dropdown.js"),l=require("../shared/input-wrapper/input-wrapper.js");require("../shared/dropdown-list/dropdown-list.styles_konwm.css"),require("../shared/dropdown-list/dropdown-search.js"),require("../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css"),require("immer"),require("../external/lodash/_getTag.js"),require("../external/lodash/isArguments.js"),require("../external/lodash/_baseGetTag.js"),require("../external/lodash/isBuffer.js"),require("../external/lodash/isTypedArray.js"),require("../external/lodash/_Stack.js"),require("../external/lodash/_SetCache.js"),require("../external/lodash/_equalByTag.js"),require("../shared/dropdown-list/virtuoso-components.js");var d=require("../shared/dropdown-wrapper/dropdown-wrapper.js");exports.InputSelect=({selectedOption:u,placeholder:c="Select",options:p,disabled:h,error:m,className:q,"data-testid":j,id:x,"aria-labelledby":w,"aria-describedby":b,"aria-invalid":f,enableSearch:v=!1,searchFunction:g,searchPlaceholder:y,valueExtractor:_,valueToStringFunction:S,listExtractor:T,displayValueExtractor:I,onSelectOption:A,onShowOptions:C,onHideOptions:k,onRetry:L,optionsLoadState:R="success",optionTruncationType:E="end",renderCustomSelectedOption:O,renderListItem:D,hideNoResultsDisplay:H,noResultsDescription:P,customLabels:B,renderCustomCallToAction:N,onBlur:G,variant:F="default",readOnly:M,alignment:W,dropdownZIndex:V,dropdownRootNode:Z,dropdownWidth:z})=>{const[J,K]=r.useState(u),[Q,U]=r.useState(!1),[X,Y]=r.useState(!1),$=t.useId(),ee=r.useRef(null),re=r.useRef(null),te=r.useRef(null);r.useEffect((()=>{K(u)}),[u]);const ie=(e,r)=>{var t;null===(t=re.current)||void 0===t||t.focus(),K(e),U(!1),de(!1),null==A||A(e,r)},se=()=>{Q&&(U(!1),de(!1))},ne=()=>{X||Q||Y(!0)},ae=e=>{X&&!Q&&ee.current&&!ee.current.contains(e.relatedTarget)&&(Y(!1),null==G||G())},oe=()=>{var e;if(!J)return"";if(I)return I(J);if(_){const r=_(J);return S?S(r):null!==(e=null==r?void 0:r.toString())&&void 0!==e?e:""}return J.toString()},le=e=>{if("middle"===E){let r=0;return te&&te.current&&(r=te.current.getBoundingClientRect().width),i.StringHelper.truncateOneLine(e,r,120,8)}return e},de=e=>{e?null==C||C():null==k||k()};return e.jsx(n.DropdownListState,{children:e.jsx(o.ElementWithDropdown,{enabled:!M&&!h,isOpen:Q,renderElement:()=>e.jsx(l.InputBox,{className:q,"data-testid":j,id:x,ref:ee,tabIndex:-1,onFocus:ne,onBlur:ae,focused:X,disabled:h,readOnly:M,error:m,children:e.jsx(a.ExpandableElement,{ref:re,disabled:h,expanded:Q,listboxId:$,popupRole:"listbox",readOnly:M,variant:F,"aria-labelledby":w,"aria-describedby":b,"aria-invalid":f,children:e.jsx(d.LabelContainer,{ref:te,disabled:h,children:J?O?O(J):e.jsx(d.ValueLabel,{variant:F,truncateType:E,children:le(oe())}):e.jsx(d.PlaceholderLabel,{variant:F,truncateType:E,children:c})})})}),renderDropdown:()=>e.jsx(s.DropdownList,{listboxId:$,listItems:p,onSelectItem:ie,onDismiss:se,valueExtractor:_,listExtractor:T,enableSearch:v,searchPlaceholder:y,searchFunction:g,selectedItems:J?[J]:[],onRetry:L,itemsLoadState:R,itemTruncationType:E,renderListItem:D,hideNoResultsDisplay:H,noResultsDescription:P,customLabels:B,renderCustomCallToAction:N,variant:F,width:z,matchElementWidth:!0}),onOpen:()=>{U(!0),de(!0),Y(!0)},onClose:e=>{U(!1),de(!1),"click"!==e&&(Y(!1),null==G||G())},onDismiss:()=>{var e;null===(e=re.current)||void 0===e||e.focus(),U(!1),de(!1)},clickToToggle:!0,offset:8,alignment:W,fitAvailableHeight:!0,customZIndex:V,rootNode:Z})})};
|
|
2
2
|
//# sourceMappingURL=input-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-select.js","sources":["../../../src/input-select/input-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n DropdownList,\n DropdownListState,\n ExpandableElement,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport type { InputSelectProps } from \"./types\";\n\nexport const InputSelect = <T, V>({\n selectedOption,\n placeholder = \"Select\",\n options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n renderCustomSelectedOption,\n renderListItem,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n renderCustomCallToAction,\n onBlur,\n variant = \"default\",\n readOnly,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n}: InputSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE\n // =============================================================================\n const [selected, setSelected] = useState<T | undefined>(selectedOption);\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelected(selectedOption);\n }, [selectedOption]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleListItemClick = (item: T, extractedValue: V) => {\n selectorRef.current?.focus();\n setSelected(item);\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n onSelectOption?.(item, extractedValue);\n };\n\n const handleListDismiss = () => {\n if (showOptions) {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n }\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =============================================================================\n // HELPER FUNCTION\n // =============================================================================\n const getDisplayValue = (): string => {\n if (!selected) return \"\";\n\n if (displayValueExtractor) {\n return displayValueExtractor(selected);\n }\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (show) {\n onShowOptions?.();\n } else {\n onHideOptions?.();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderLabel = () => {\n if (!selected) {\n return (\n <PlaceholderLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {placeholder}\n </PlaceholderLabel>\n );\n } else if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n } else {\n return (\n <ValueLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"listbox\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n listboxId={internalId}\n listItems={options}\n onSelectItem={handleListItemClick}\n onDismiss={handleListDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n searchFunction={searchFunction}\n selectedItems={selected ? [selected] : []}\n onRetry={onRetry}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n renderListItem={renderListItem}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n renderCustomCallToAction={renderCustomCallToAction}\n variant={variant}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n );\n};\n"],"names":["selectedOption","placeholder","options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","hideNoResultsDisplay","noResultsDescription","customLabels","renderCustomCallToAction","onBlur","variant","readOnly","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","selected","setSelected","useState","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","handleListItemClick","item","extractedValue","_a","current","focus","triggerOptionDisplayCallback","handleListDismiss","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","value","toString","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","DropdownListState","children","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","LabelContainer","ValueLabel","truncateType","PlaceholderLabel","renderDropdown","DropdownList","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","reason","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"umEAoB2B,EACvBA,iBACAC,cAAc,SACdC,UACAC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAe,EACfC,iBACAC,oBACAC,iBACAC,wBACAC,gBACAC,wBACAC,iBACAC,gBACAC,gBACAC,UACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,6BACAC,iBACAC,uBACAC,uBACAC,eACAC,2BACAC,SACAC,UAAU,UACVC,WACAC,YACAC,iBACAC,mBACAC,oBAKA,MAAOC,EAAUC,GAAeC,EAAAA,SAAwBvC,IACjDwC,EAAaC,GAAkBF,EAAAA,UAAkB,IACjDG,EAASC,GAAcJ,EAAAA,UAAkB,GAC1CK,EAAaC,EAAAA,QAEbC,GAAUC,EAAAA,OAAuB,MACjCC,GAAcD,EAAAA,OAA0B,MAC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BAAkB,EAClBC,aAAc1E,EACd2E,SAAU1E,KAEE"}
|
|
1
|
+
{"version":3,"file":"input-select.js","sources":["../../../src/input-select/input-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n DropdownList,\n DropdownListState,\n ExpandableElement,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport type { InputSelectProps } from \"./types\";\n\nexport const InputSelect = <T, V>({\n selectedOption,\n placeholder = \"Select\",\n options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n renderCustomSelectedOption,\n renderListItem,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n renderCustomCallToAction,\n onBlur,\n variant = \"default\",\n readOnly,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n}: InputSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE\n // =============================================================================\n const [selected, setSelected] = useState<T | undefined>(selectedOption);\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelected(selectedOption);\n }, [selectedOption]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleListItemClick = (item: T, extractedValue: V) => {\n selectorRef.current?.focus();\n setSelected(item);\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n onSelectOption?.(item, extractedValue);\n };\n\n const handleListDismiss = () => {\n if (showOptions) {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n }\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =============================================================================\n // HELPER FUNCTION\n // =============================================================================\n const getDisplayValue = (): string => {\n if (!selected) return \"\";\n\n if (displayValueExtractor) {\n return displayValueExtractor(selected);\n }\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (show) {\n onShowOptions?.();\n } else {\n onHideOptions?.();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderLabel = () => {\n if (!selected) {\n return (\n <PlaceholderLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {placeholder}\n </PlaceholderLabel>\n );\n } else if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n } else {\n return (\n <ValueLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"listbox\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n listboxId={internalId}\n listItems={options}\n onSelectItem={handleListItemClick}\n onDismiss={handleListDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n searchFunction={searchFunction}\n selectedItems={selected ? [selected] : []}\n onRetry={onRetry}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n renderListItem={renderListItem}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n renderCustomCallToAction={renderCustomCallToAction}\n variant={variant}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n );\n};\n"],"names":["selectedOption","placeholder","options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","hideNoResultsDisplay","noResultsDescription","customLabels","renderCustomCallToAction","onBlur","variant","readOnly","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","selected","setSelected","useState","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","handleListItemClick","item","extractedValue","_a","current","focus","triggerOptionDisplayCallback","handleListDismiss","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","value","toString","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","DropdownListState","children","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","LabelContainer","ValueLabel","truncateType","PlaceholderLabel","renderDropdown","DropdownList","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","reason","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"omEAoB2B,EACvBA,iBACAC,cAAc,SACdC,UACAC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAe,EACfC,iBACAC,oBACAC,iBACAC,wBACAC,gBACAC,wBACAC,iBACA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,MAAOlC,EACPiE,mBAAiB,IAYjBC,OArKO,KACf7D,GAAe,GACfgB,IAA6B,GAC7Bd,GAAW,EAAK,EAmKR4D,QAhKSC,IACjB/D,GAAe,GACfgB,IAA6B,GAGd,UAAX+C,IACA7D,GAAW,GACXb,SAAAA,IACJ,EAyJQmE,UAtJU,WACC,QAAnB3C,EAAAN,GAAYO,eAAO,IAAAD,GAAAA,EAAEE,QACrBf,GAAe,GACfgB,IAA6B,EAAM,EAoJ3BgD,eAAa,EACbC,OAAQ,EACRzE,UAAWA,EACX0E,oBAAkB,EAClBC,aAAc1E,EACd2E,SAAU1E,KAEE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./textarea-counter.
|
|
1
|
+
"use strict";require("./textarea-counter.styles_1n3wsnv.css");exports.counterLabel="c1d4l1yp";
|
|
2
2
|
//# sourceMappingURL=textarea-counter.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea-counter.styles.js","sources":["../../../src/input-textarea/textarea-counter.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Colour, Font } from \"../theme\";\n\nexport const counterLabel = css`\n text-align: right;\n ${Font[\"body-sm-semibold\"]}\n color: ${Colour[\"text-subtler\"]};\n`;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textarea-counter.styles.js","sources":["../../../src/input-textarea/textarea-counter.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Colour, Font } from \"../theme\";\n\nexport const counterLabel = css`\n text-align: right;\n ${Font[\"body-sm-semibold\"]}\n color: ${Colour[\"text-subtler\"]};\n`;\n"],"names":[],"mappings":"iHAIyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c1d4l1yp{text-align:right;font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-sm);font-weight:var(--fds-font-weight-semibold);line-height:var(--fds-font-body-lh-sm);letter-spacing:var(--fds-font-body-ls-sm);color:var(--fds-colour-text-subtler);}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("./textarea.
|
|
1
|
+
"use strict";require("./textarea.styles_22z4n3.css");exports.element="e10c6rk9",exports.elementDisabled="e9uwuyt",exports.elementError="etmlvbn",exports.elementReadOnly="e1kovz0t",exports.wrapper="w1xqauhq";
|
|
2
2
|
//# sourceMappingURL=textarea.styles.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
.w1xqauhq{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
2
|
+
.e10c6rk9{border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);border-radius:var(--fds-radius-sm);background:var(--fds-colour-bg);outline:none;overflow:auto;display:block;padding:var(--fds-spacing-12) var(--fds-spacing-16);width:100%;font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-baseline);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-baseline);letter-spacing:var(--fds-font-body-ls-baseline);color:var(--fds-colour-text);}.e10c6rk9:focus,.e10c6rk9:active{outline-offset:-1px;outline:var(--fds-border-width-020) var(--fds-border-style-solid) var(--fds-colour-border-focus);}.e10c6rk9::-webkit-input-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9::-webkit-scrollbar{width:14px;}.e10c6rk9::-webkit-scrollbar-track{background:transparent;}.e10c6rk9::-webkit-scrollbar-thumb{background:var(--fds-colour-bg-inverse-subtlest);border:5px solid transparent;border-radius:var(--fds-radius-full);-webkit-background-clip:padding-box;background-clip:padding-box;}.e10c6rk9::-webkit-input-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9::-moz-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9:-ms-input-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9::placeholder{color:var(--fds-colour-text-subtler);}
|
|
3
|
+
.e1kovz0t{border-color:transparent;background:transparent!important;padding:var(--fds-spacing-12) 0;}.e1kovz0t:focus,.e1kovz0t:active{outline-color:var(--fds-colour-border-focus);}
|
|
4
|
+
.e9uwuyt{background:var(--fds-colour-bg-disabled);cursor:not-allowed;}.e9uwuyt:focus,.e9uwuyt:active{outline-color:var(--fds-colour-border-disabled);}
|
|
5
|
+
.etmlvbn{border-color:var(--fds-colour-border-error);}.etmlvbn:focus,.etmlvbn:active{outline-color:var(--fds-colour-border-error-focus);}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("../shared/dropdown-list/dropdown-list.
|
|
1
|
+
"use strict";require("../shared/dropdown-list/dropdown-list.styles_konwm.css"),require("./dropdown-panel.styles_1qsjf8d.css");exports.dropdownItem="d4xkcjy",exports.dropdownItemSelected="ddiq5up",exports.dropdownList="dogrnw8",exports.dropdownPanel="dbl9jc4",exports.tokens={width:"--fds-internal-languageSwitcher-dropdown-width"};
|
|
2
2
|
//# sourceMappingURL=dropdown-panel.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-panel.styles.js","sources":["../../../src/language-switcher/dropdown-panel.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Border, Colour, Font, Radius, Spacing } from \"../theme\";\n\nexport const tokens = {\n width: \"--fds-internal-languageSwitcher-dropdown-width\",\n} as const;\n\nexport const dropdownPanel = css`\n ${tokens.width}: initial;\n\n width: var(${tokens.width});\n border-radius: ${Radius[\"sm\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n background: ${Colour[\"bg\"]};\n overflow: hidden;\n`;\n\nexport const dropdownList = css`\n list-style: none;\n margin: 0;\n padding: ${Spacing[\"spacing-8\"]};\n`;\n\nexport {\n baseIndicatorStyle,\n selectedIndicator,\n} from \"../shared/dropdown-list/dropdown-list.styles\";\n\nexport const dropdownItem = css`\n align-items: center;\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover-subtle\"]};\n }\n`;\n\nexport const dropdownItemSelected = css`\n background: transparent;\n color: ${Colour[\"text-selected\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover\"]};\n }\n`;\n"],"names":["width"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown-panel.styles.js","sources":["../../../src/language-switcher/dropdown-panel.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Border, Colour, Font, Radius, Spacing } from \"../theme\";\n\nexport const tokens = {\n width: \"--fds-internal-languageSwitcher-dropdown-width\",\n} as const;\n\nexport const dropdownPanel = css`\n ${tokens.width}: initial;\n\n width: var(${tokens.width});\n border-radius: ${Radius[\"sm\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n background: ${Colour[\"bg\"]};\n overflow: hidden;\n`;\n\nexport const dropdownList = css`\n list-style: none;\n margin: 0;\n padding: ${Spacing[\"spacing-8\"]};\n`;\n\nexport {\n baseIndicatorStyle,\n selectedIndicator,\n} from \"../shared/dropdown-list/dropdown-list.styles\";\n\nexport const dropdownItem = css`\n align-items: center;\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover-subtle\"]};\n }\n`;\n\nexport const dropdownItemSelected = css`\n background: transparent;\n color: ${Colour[\"text-selected\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover\"]};\n }\n`;\n"],"names":["width"],"mappings":"kMA6ByB,uCAUQ,+BArBR,gCAVC,yBAJJ,CAClBA,MAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
.dbl9jc4{--fds-internal-languageSwitcher-dropdown-width:initial;width:var(--fds-internal-languageSwitcher-dropdown-width);border-radius:var(--fds-radius-sm);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);background:var(--fds-colour-bg);overflow:hidden;}
|
|
2
2
|
.dogrnw8{list-style:none;margin:0;padding:var(--fds-spacing-8);}
|
|
3
|
-
.d4xkcjy{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-family:var(--fds-font-family);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-md);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-md);letter-spacing:var(--fds-font-body-ls-md);color:var(--fds-colour-text);}.d4xkcjy:hover{background:var(--fds-colour-bg-hover-subtle);}
|
|
3
|
+
.d4xkcjy{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-md);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-md);letter-spacing:var(--fds-font-body-ls-md);color:var(--fds-colour-text);}.d4xkcjy:hover{background:var(--fds-colour-bg-hover-subtle);}
|
|
4
4
|
.ddiq5up{background:transparent;color:var(--fds-colour-text-selected);}.ddiq5up:hover{background:var(--fds-colour-bg-hover);}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),s=require("@lifesg/react-icons/language"),t=require("react");require("clsx"),require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var a=require("../util/simple-id-generator.js");require("../util/string-helper.js"),require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.
|
|
1
|
+
"use strict";var e=require("../_virtual/_tslib.js"),r=require("react/jsx-runtime"),s=require("@lifesg/react-icons/language"),t=require("react");require("clsx"),require("../theme/theme-provider/index.js"),require("../theme/theme-provider/context.js"),require("../theme/tokens/border.js"),require("../theme/tokens/colour.js"),require("../theme/tokens/font.js"),require("../theme/tokens/media-query.js"),require("../util/calendar-helper.js"),require("../external/dayjs/dayjs.min.js");var a=require("../util/simple-id-generator.js");require("../util/string-helper.js"),require("@react-aria/live-announcer"),require("../theme/utils/use-media-query.js"),require("../shared/dropdown-list/dropdown-label.styles_mloii0.css"),require("../shared/dropdown-list/dropdown-list.js"),require("../shared/dropdown-list/dropdown-list-state.js");var i=require("../shared/dropdown-list/expandable-element.js");require("@lifesg/react-icons/caret-right"),require("@lifesg/react-icons/exclamation-circle-fill"),require("@lifesg/react-icons/minus-square-fill"),require("@lifesg/react-icons/square"),require("@lifesg/react-icons/square-tick-fill"),require("@lifesg/react-icons/tick"),require("react-virtuoso"),require("../markup/markup.js"),require("../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css");var n=require("../shared/dropdown-wrapper/element-with-dropdown.js");require("../shared/input-wrapper/input-wrapper.js"),require("../shared/dropdown-list/dropdown-list.styles_konwm.css"),require("../shared/dropdown-list/dropdown-search.js"),require("../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css"),require("immer"),require("../external/lodash/_getTag.js"),require("../external/lodash/isArguments.js"),require("../external/lodash/_baseGetTag.js"),require("../external/lodash/isBuffer.js"),require("../external/lodash/isTypedArray.js"),require("../external/lodash/_Stack.js"),require("../external/lodash/_SetCache.js"),require("../external/lodash/_equalByTag.js"),require("../shared/dropdown-list/virtuoso-components.js");var o=require("./data.js"),l=require("./dropdown-panel.js"),d=require("./dropdown-variant.styles.js");exports.DropdownVariant=u=>{var{selectedLanguage:c,onSelectLanguage:p,testId:q}=u,h=e.__rest(u,["selectedLanguage","onSelectLanguage","testId"]);const[j,m]=t.useState(!1),[g,f]=t.useState(-1),_=t.useRef(null),w=t.useRef([]),x=`listbox-${a.useId()}`;t.useEffect((()=>{if(j){const e=o.LANGUAGE_CODES.indexOf(c),r=e>=0?e:0;f(r),setTimeout((()=>{var e;null===(e=w.current[r])||void 0===e||e.focus()}),0)}else f(-1)}),[j,c]);const A=e=>{var r;p(e),m(!1),null===(r=_.current)||void 0===r||r.focus()},v=e=>{var r,s,t,a;switch(e.key){case"ArrowDown":{e.preventDefault();const s=Math.min(g+1,o.LANGUAGE_CODES.length-1);f(s),null===(r=w.current[s])||void 0===r||r.focus();break}case"ArrowUp":{e.preventDefault();const r=Math.max(g-1,0);f(r),null===(s=w.current[r])||void 0===s||s.focus();break}case"Home":e.preventDefault(),f(0),null===(t=w.current[0])||void 0===t||t.focus();break;case"End":{e.preventDefault();const r=o.LANGUAGE_CODES.length-1;f(r),null===(a=w.current[r])||void 0===a||a.focus();break}case"Enter":case" ":e.preventDefault(),g>=0&&A(o.LANGUAGE_CODES[g])}};return r.jsx("div",Object.assign({"data-testid":q},h,{children:r.jsx(n.ElementWithDropdown,{enabled:!0,isOpen:j,renderElement:()=>r.jsxs(i.ExpandableElement,{ref:_,className:d.expandableElement,disabled:!1,expanded:j,listboxId:x,popupRole:"listbox",readOnly:!1,"aria-label":`${o.ARIA_LABEL}, ${o.LANGUAGE_DISPLAY_MAP[c]}`,"data-testid":`${q}--trigger`,children:[r.jsx("span",{className:d.languageIconWrapper,"aria-hidden":!0,children:r.jsx(s.LanguageIcon,{})}),o.LANGUAGE_DISPLAY_MAP[c]]}),renderDropdown:()=>r.jsx(l.DropdownPanel,{focusedIndex:g,handleItemSelect:A,handleListKeyDown:v,itemRefs:w,listboxId:x,selectedLanguage:c,testId:q}),onOpen:()=>{m(!0)},onClose:()=>{m(!1)},onDismiss:()=>{var e;m(!1),null===(e=_.current)||void 0===e||e.focus()},clickToToggle:!0,offset:8})}))};
|
|
2
2
|
//# sourceMappingURL=dropdown-variant.js.map
|