@luzmo/lucero 1.0.3-alpha.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.cjs +1 -1
- package/components/accordion/index.js +2 -2
- package/components/{accordion-DC7cjb1c.js → accordion-BDchhAjE.js} +4 -4
- package/components/accordion-DpsYMoeb.cjs +43 -0
- package/components/action-bar/index.cjs +1 -1
- package/components/action-bar/index.js +2 -2
- package/components/{action-bar-Dn4IDXEF.js → action-bar-BhYEHEfo.js} +7 -7
- package/components/action-bar-VhZT8kQM.cjs +39 -0
- package/components/action-button/action-button.d.ts +12 -1
- package/components/action-button/index.cjs +1 -1
- package/components/action-button/index.d.ts +1 -1
- package/components/action-button/index.js +2 -2
- package/components/action-button-CWAg-5tz.cjs +22 -0
- package/components/{action-button-DC-ZFZTm.js → action-button-cULkUUi6.js} +8 -6
- package/components/action-group/index.cjs +1 -1
- package/components/action-group/index.js +2 -2
- package/components/{action-group-DYKpp-mz.js → action-group-BQ-fyPYS.js} +3 -3
- package/components/action-group-D1G30Iir.cjs +20 -0
- package/components/action-menu/index.cjs +1 -1
- package/components/action-menu/index.js +2 -2
- package/components/{action-menu-BlR6cLpi.js → action-menu-CkU-u55D.js} +21 -21
- package/components/{action-menu-C1C1Gx39.cjs → action-menu-DREgNCXt.cjs} +15 -15
- package/components/avatar/avatar.d.ts +17 -1
- package/components/avatar/index.cjs +1 -1
- package/components/avatar/index.js +2 -2
- package/components/avatar-Cu9c0sCS.cjs +34 -0
- package/components/avatar-Nb0368Wi.js +98 -0
- package/components/badge/badge.d.ts +1 -1
- package/components/badge/index.cjs +1 -1
- package/components/badge/index.js +2 -2
- package/components/badge-BzQfqgq6.cjs +23 -0
- package/components/badge-Dnkh-mfN.js +94 -0
- package/components/button/button-base.d.ts +1 -0
- package/components/button/button.d.ts +0 -1
- package/components/button/index.cjs +1 -1
- package/components/button/index.js +3 -3
- package/components/button-BJ0Y6wlM.cjs +20 -0
- package/components/{button-D1a4B85S.js → button-BtWr5Lag.js} +6 -6
- package/components/{button-base-CzTYjZND.js → button-base-DsUg0bJB.js} +26 -12
- package/components/{button-base-Dj2qQqwO.cjs → button-base-aTiE83bl.cjs} +3 -3
- package/components/button-group/index.cjs +1 -1
- package/components/button-group/index.js +2 -2
- package/components/button-group-6M8M-TUI.cjs +18 -0
- package/components/{button-group-BiQxYcQ2.js → button-group-DaANSInm.js} +2 -2
- package/components/calendar/index.cjs +1 -1
- package/components/calendar/index.js +2 -2
- package/components/{calendar-BNRjXf9B.js → calendar-CXjdC7jm.js} +5 -9
- package/components/calendar-DSlKZZCR.cjs +138 -0
- package/components/chat-message/chat-message.d.ts +0 -1
- package/components/chat-message/index.cjs +1 -1
- package/components/chat-message/index.js +2 -2
- package/components/chat-message-7cx2Bpo8.cjs +148 -0
- package/components/{chat-message-DJgocVNj.js → chat-message-CJ7Xk7tz.js} +757 -545
- package/components/chat-message-group/index.cjs +1 -1
- package/components/chat-message-group/index.js +2 -2
- package/components/chat-message-group-CzCwyW7F.cjs +24 -0
- package/components/{chat-message-group-B4U2MzHx.js → chat-message-group-D7vdn2gG.js} +2 -2
- package/components/checkbox/checkbox.d.ts +7 -0
- package/components/checkbox/index.cjs +1 -1
- package/components/checkbox/index.js +2 -2
- package/components/{checkbox-CPS-tR_i.js → checkbox-6YzkdHR4.js} +9 -5
- package/components/checkbox-DdatW4xE.cjs +25 -0
- package/components/{checkbox-mixin-C5sLMo5L.js → checkbox-mixin-jqmrh48O.js} +2 -2
- package/components/{checkbox-mixin-D4HeLrMj.cjs → checkbox-mixin-rFRXqyrK.cjs} +3 -3
- package/components/{close-button-MgaJT7yO.js → close-button-WomHVbgz.js} +4 -4
- package/components/close-button-hicleVjQ.cjs +18 -0
- package/components/color-area/index.cjs +1 -1
- package/components/color-area/index.js +2 -2
- package/components/{color-area-mWOctRNt.js → color-area-BRrtUbvH.js} +6 -6
- package/components/color-area-ayGmH8dj.cjs +80 -0
- package/components/color-controller-DbyPc33Y.cjs +18 -0
- package/components/color-field/index.cjs +1 -1
- package/components/color-field/index.js +2 -2
- package/components/{color-field-D7_7z2A2.cjs → color-field-BNGnBRSO.cjs} +2 -2
- package/components/{color-field-CxdIoSq6.js → color-field-CUdHxonc.js} +3 -3
- package/components/color-handle/index.cjs +1 -1
- package/components/color-handle/index.js +2 -2
- package/components/color-handle-DIoVrLRF.cjs +24 -0
- package/components/{color-handle-BOusOFFx.js → color-handle-TKbLs1ax.js} +2 -2
- package/components/color-loupe/index.cjs +1 -1
- package/components/color-loupe/index.js +2 -2
- package/components/{color-loupe-bEzi2P0y.js → color-loupe-DAxrNPJz.js} +2 -2
- package/components/color-loupe-sY1wOisV.cjs +56 -0
- package/components/color-menu/index.cjs +1 -1
- package/components/color-menu/index.js +2 -2
- package/components/color-menu-DOq9PAWG.cjs +89 -0
- package/components/{color-menu-Cryp_5Gh.js → color-menu-iKU6Vw8a.js} +24 -24
- package/components/color-palette/index.cjs +1 -1
- package/components/color-palette/index.js +2 -2
- package/components/color-palette-CidHsmE0.cjs +18 -0
- package/components/{color-palette-BAdaNySC.js → color-palette-FQyIMSwP.js} +3 -3
- package/components/color-palette-group/index.cjs +1 -1
- package/components/color-palette-group/index.js +2 -2
- package/components/color-palette-group-B4r4tPfY.cjs +28 -0
- package/components/{color-palette-group-D8Mavsd2.js → color-palette-group-o6bnF-Ir.js} +3 -3
- package/components/color-picker/index.cjs +1 -1
- package/components/color-picker/index.js +2 -2
- package/components/{color-picker-DgjqWiVd.js → color-picker-Bw5UKyME.js} +6 -6
- package/components/{color-picker-DL7rqWnW.cjs → color-picker-D3WFls0M.cjs} +2 -2
- package/components/color-slider/index.cjs +1 -1
- package/components/color-slider/index.js +2 -2
- package/components/color-slider-BiVpn9_U.cjs +57 -0
- package/components/{color-slider-ihAIFt5p.js → color-slider-BtPNTmQu.js} +6 -5
- package/components/{condition-attribute-with-id-DauPaLSS.cjs → condition-attribute-with-id-Cw92IbcP.cjs} +1 -1
- package/components/date-range-picker/index.cjs +1 -1
- package/components/date-range-picker/index.js +2 -2
- package/components/date-range-picker-DMq8EaiB.cjs +180 -0
- package/components/{date-range-picker-CcDzRDm5.js → date-range-picker-DaHFLwQL.js} +13 -13
- package/components/date-time-picker/index.cjs +1 -1
- package/components/date-time-picker/index.js +2 -2
- package/components/date-time-picker-DdtcziBG.cjs +105 -0
- package/components/{date-time-picker-PHKHDgL9.js → date-time-picker-hjeFVUz9.js} +11 -11
- package/components/{decorate-aGxJUVxg.js → decorate-CkCg3wfh.js} +1 -1
- package/components/decorate-Dq34MBGe.cjs +18 -0
- package/components/{dependency-manger-CHy9t__e.cjs → dependency-manger-BSaHw9ju.cjs} +1 -1
- package/components/divider/index.cjs +1 -1
- package/components/divider/index.js +2 -2
- package/components/{divider-cU0lVwOp.js → divider-CGbT-CL8.js} +3 -3
- package/components/divider-wana0uPI.cjs +18 -0
- package/components/{divider.module-CL60P_z8.cjs → divider.module-BV6tmpOY.cjs} +1 -1
- package/components/{element-resolution-C0aiOB0Y.cjs → element-resolution-BjaAlqwX.cjs} +1 -1
- package/components/field-group/index.cjs +1 -1
- package/components/field-group/index.js +2 -2
- package/components/{field-group-C7ROsWq3.js → field-group-C_kRq7pJ.js} +2 -2
- package/components/{field-group-OcI5Lgu7.cjs → field-group-Dd5xYczm.cjs} +2 -2
- package/components/field-label/index.cjs +1 -1
- package/components/field-label/index.js +2 -2
- package/components/{field-label-CtGCEmdp.js → field-label-B9S41b7c.js} +5 -5
- package/components/field-label-C5vdJ1ys.cjs +25 -0
- package/components/focus-group-C8lOjbi9.cjs +18 -0
- package/components/{focus-group-BshI1RpM.js → focus-group-DVPa1zxz.js} +1 -1
- package/components/{focus-visible-CrooVCUu.js → focus-visible-Bt2uDmuM.js} +2 -2
- package/components/focus-visible-DNHNlrty.cjs +18 -0
- package/components/focusable-B6h03pAe.cjs +18 -0
- package/components/{focusable-BmS8IzhH.js → focusable-DuP0-Kuy.js} +2 -2
- package/components/{focusable-selectors-5n5liBn0.cjs → focusable-selectors-DJqGLTJo.cjs} +1 -1
- package/components/{get-label-from-slot-LO_DZP60.cjs → get-label-from-slot-TV4APBYs.cjs} +1 -1
- package/components/icon/index.cjs +1 -1
- package/components/icon/index.js +2 -2
- package/components/icon-CSqR-OOO.cjs +18 -0
- package/components/{icon-CwBAE1eU.js → icon-DB1DRieA.js} +5 -2
- package/components/index.cjs +1 -1
- package/components/index.js +71 -69
- package/components/infield-button/index.cjs +1 -1
- package/components/infield-button/index.js +2 -2
- package/components/{infield-button-BvKsbtKr.js → infield-button-BmGfFDDA.js} +3 -3
- package/components/infield-button-Cdee_UPX.cjs +22 -0
- package/components/label/index.cjs +1 -1
- package/components/label/index.js +2 -2
- package/components/{label-ClJE2esm.js → label-B1HYQ4Pp.js} +1 -1
- package/components/label-DPG13Ib0.cjs +18 -0
- package/components/{language-resolution-BYemISJC.cjs → language-resolution-BUeKpSce.cjs} +1 -1
- package/components/{like-anchor-BZJXts_H.cjs → like-anchor-BX4PSB3d.cjs} +2 -2
- package/components/{like-anchor-DeOXX-MX.js → like-anchor-DXCaEv7O.js} +1 -1
- package/components/{manage-help-text-CF0xBh0F.js → manage-help-text-ByLb0QYX.js} +13 -10
- package/components/{manage-help-text-D9VbYRf_.cjs → manage-help-text-DtFJsl0k.cjs} +3 -3
- package/components/menu/index.cjs +1 -1
- package/components/menu/index.js +2 -2
- package/components/menu/menu-item.d.ts +1 -1
- package/components/menu/menu.d.ts +12 -1
- package/components/{menu-Cdz2FEB7.js → menu-C9ogB7Bq.js} +82 -65
- package/components/menu-DXONqtwu.cjs +108 -0
- package/components/multi-language-field/index.cjs +1 -1
- package/components/multi-language-field/index.js +2 -2
- package/components/{multi-language-field-DmoMyCBH.cjs → multi-language-field-Cfy3M_ZS.cjs} +2 -2
- package/components/{multi-language-field-BzY75rOY.js → multi-language-field-DhQ98r2D.js} +4 -4
- package/components/notice/index.cjs +18 -0
- package/components/notice/index.d.ts +8 -0
- package/components/notice/index.js +25 -0
- package/components/notice/notice.d.ts +121 -0
- package/components/notice-BeL9oE94.js +218 -0
- package/components/notice-COZLmk94.cjs +60 -0
- package/components/number-field/index.cjs +1 -1
- package/components/number-field/index.js +2 -2
- package/components/number-field-D19qjVbk.cjs +57 -0
- package/components/{number-field-DrJURvoW.js → number-field-DjvWkjL8.js} +42 -42
- package/components/observe-slot-presence-CS8pMePk.cjs +18 -0
- package/components/observe-slot-text-CvL-2ey3.cjs +18 -0
- package/components/{observe-slot-text-Ddf1OC6F.js → observe-slot-text-Db8Kx3P-.js} +7 -7
- package/components/options/index.cjs +1 -1
- package/components/options/index.d.ts +5 -3
- package/components/options/index.js +2 -2
- package/components/options/option.d.ts +0 -1
- package/components/{options-BGwKMvng.js → options-C1MoEq26.js} +9 -9
- package/components/{options-CKi3VkNR.cjs → options-yWbz0D6O.cjs} +3 -3
- package/components/overlay/index.cjs +1 -1
- package/components/overlay/index.d.ts +3 -2
- package/components/overlay/index.js +4 -4
- package/components/overlay/overlay-trigger.d.ts +1 -1
- package/components/overlay-B-gaxspw.cjs +47 -0
- package/components/{overlay-BGI4wOGe.cjs → overlay-CPZvL0Ic.cjs} +2 -2
- package/components/{overlay-BbQuYBxp.js → overlay-CyBsHuOL.js} +20 -15
- package/components/{overlay-mdk7-NOt.js → overlay-DdIs4w5M.js} +3 -3
- package/components/{pending-state-DFcNf5rd.js → pending-state-BeG7qBDP.js} +1 -1
- package/components/{pending-state-DIeF18qg.cjs → pending-state-a527YMWV.cjs} +2 -2
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +2 -2
- package/components/picker/picker.d.ts +1 -0
- package/components/{picker-DOiM_cUu.js → picker-Bufw-biD.js} +64 -66
- package/components/picker-D6ZM08K8.cjs +124 -0
- package/components/picker-button/index.cjs +1 -1
- package/components/picker-button/index.js +2 -2
- package/components/{picker-button-VAxzuhhg.js → picker-button-CF6yD_1d.js} +5 -5
- package/components/picker-button-Dh2gGZ8R.cjs +37 -0
- package/components/platform-BAjeJp2W.cjs +18 -0
- package/components/{platform-D4V_cOJF.js → platform-Ce9pNsR9.js} +2 -2
- package/components/popover/index.cjs +1 -1
- package/components/popover/index.js +2 -2
- package/components/{popover-DyC9xGhX.js → popover-DTsrgH-f.js} +4 -4
- package/components/popover-DWWYpY-k.cjs +30 -0
- package/components/progress-bar/index.cjs +1 -1
- package/components/progress-bar/index.js +2 -2
- package/components/{progress-bar-DHgFRml1.js → progress-bar-BJO8j1aX.js} +9 -6
- package/components/progress-bar-C7wJ5bxS.cjs +34 -0
- package/components/progress-circle/index.cjs +1 -1
- package/components/progress-circle/index.js +2 -2
- package/components/{progress-circle-Cg_ua9Ff.js → progress-circle-BVToDWX8.js} +3 -3
- package/components/progress-circle-DyApSKdm.cjs +33 -0
- package/components/progress-steps/index.cjs +1 -1
- package/components/progress-steps/index.js +2 -2
- package/components/progress-steps-Ba4VbAKR.cjs +96 -0
- package/components/{progress-steps-Da8aZWx3.js → progress-steps-nJ8Xw-nG.js} +10 -10
- package/components/prompt-box/index.cjs +1 -1
- package/components/prompt-box/index.js +2 -2
- package/components/prompt-box/prompt-box-templates.d.ts +1 -0
- package/components/prompt-box/prompt-box.d.ts +3 -0
- package/components/prompt-box-D358CWoY.cjs +314 -0
- package/components/{prompt-box-DahvVbcc.js → prompt-box-y7qWHF3P.js} +102 -96
- package/components/question-box/index.cjs +18 -0
- package/components/question-box/index.d.ts +11 -0
- package/components/question-box/index.js +25 -0
- package/components/question-box/question-box-elicitation.d.ts +58 -0
- package/components/question-box/question-box-model.d.ts +25 -0
- package/components/question-box/question-box-templates.d.ts +65 -0
- package/components/question-box/question-box.d.ts +182 -0
- package/components/question-box/types.d.ts +124 -0
- package/components/question-box-9F6Ppakl.js +1171 -0
- package/components/question-box-DaAgC3_D.cjs +401 -0
- package/components/radio/index.cjs +1 -1
- package/components/radio/index.js +2 -2
- package/components/radio/radio-group.d.ts +5 -1
- package/components/radio/radio.d.ts +7 -1
- package/components/{radio-BzEPGUmQ.js → radio-DRI4on-W.js} +30 -26
- package/components/radio-O3a1rmCe.cjs +22 -0
- package/components/{random-id-B51lUxUB.cjs → random-id-BcUJAxUZ.cjs} +1 -1
- package/components/{random-id-Dd4boCPV.js → random-id-CiMDyX7v.js} +1 -1
- package/components/{roving-tabindex-B7x5ePUB.cjs → roving-tabindex-BoPao4td.cjs} +1 -1
- package/components/{roving-tabindex-BP6mQbXf.js → roving-tabindex-pomAn3z-.js} +1 -1
- package/components/{scaled-indicator-Bl-3A2gz.cjs → scaled-indicator-DLJIztx0.cjs} +2 -2
- package/components/search/index.cjs +1 -1
- package/components/search/index.js +2 -2
- package/components/search-B2DQb14U.js +100 -0
- package/components/search-CsNvKd8x.cjs +47 -0
- package/components/segments-factory-DtPyN5sh.cjs +18 -0
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +2 -2
- package/components/select-B_E-w1a2.cjs +158 -0
- package/components/{select-C2gh8zRr.js → select-CE6pIRX3.js} +12 -12
- package/components/{chunk-D-qHiVGv.cjs → sized-mixin-BT7cv-fT.cjs} +1 -1
- package/components/{sized-mixin-DaBoZkVS.js → sized-mixin-DzQTebN-.js} +1 -1
- package/components/skeleton-loader/index.cjs +1 -1
- package/components/skeleton-loader/index.js +2 -2
- package/components/{skeleton-loader-oJVESWls.js → skeleton-loader-C0LH3prK.js} +1 -1
- package/components/skeleton-loader-Cm50Ztzk.cjs +18 -0
- package/components/slider/controllers/slider-handle-controller.d.ts +79 -0
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.d.ts +5 -1
- package/components/slider/index.js +3 -3
- package/components/slider/slider-control-templates.d.ts +36 -0
- package/components/slider/slider-handle.d.ts +62 -0
- package/components/slider/slider-model.d.ts +16 -0
- package/components/slider/slider-templates.d.ts +6 -0
- package/components/slider/slider.d.ts +197 -19
- package/components/slider/types.d.ts +57 -0
- package/components/slider-CDrXecqO.cjs +135 -0
- package/components/slider-CfgH3NK8.js +921 -0
- package/components/{slottable-request-event-gAcEQan2.cjs → slottable-request-event-C6eb7Ch3.cjs} +1 -1
- package/components/status-light/index.cjs +1 -1
- package/components/status-light/index.js +2 -2
- package/components/{status-light-DXWPBufE.js → status-light-BlfBJpqa.js} +2 -2
- package/components/status-light-Bu0G8-lH.cjs +21 -0
- package/components/strategies-BwNbUXYS.cjs +18 -0
- package/components/{strategies-DhxJGIZT.js → strategies-Cl59wdNZ.js} +21 -19
- package/components/streaming-listener-Bfyk6Fsx.cjs +18 -0
- package/components/swatch/index.cjs +1 -1
- package/components/swatch/index.js +2 -2
- package/components/{swatch-BLuV-hlF.js → swatch-C2ty27bJ.js} +4 -4
- package/components/{swatch-G70JUe6I.cjs → swatch-DUmBmg4S.cjs} +2 -2
- package/components/switch/index.cjs +1 -1
- package/components/switch/index.js +2 -2
- package/components/switch-B-gu-War.cjs +22 -0
- package/components/{switch-CSuMgmAh.js → switch-DOuXlFwI.js} +5 -5
- package/components/tabs/index.cjs +1 -1
- package/components/tabs/index.js +2 -2
- package/components/tabs/tabs.d.ts +1 -2
- package/components/{tabs-Jo_qqM_H.cjs → tabs-CcnIX4jQ.cjs} +2 -2
- package/components/{tabs-B54ELQtU.js → tabs-D1puCPrL.js} +11 -11
- package/components/tags/index.cjs +1 -1
- package/components/tags/index.js +2 -2
- package/components/tags/tag.d.ts +4 -3
- package/components/{tags-Bpl4u-eo.js → tags-Bw-y2Wfl.js} +26 -26
- package/components/tags-Cr8ObbWn.cjs +47 -0
- package/components/text-field/help-text-manager.d.ts +3 -1
- package/components/text-field/help-text.d.ts +4 -0
- package/components/text-field/index.cjs +1 -1
- package/components/text-field/index.js +3 -3
- package/components/text-field/manage-help-text.d.ts +2 -1
- package/components/text-field/text-field.d.ts +9 -0
- package/components/{text-field-FJr8ZUhI.cjs → text-field-3fDtTQkR.cjs} +2 -2
- package/components/{text-field-BoGAvXvh.js → text-field-C2MHZbTp.js} +3 -3
- package/components/{text-field-Cs8HYRYL.js → text-field-CmSym2QK.js} +5 -5
- package/components/text-field-wJK2bzMT.cjs +21 -0
- package/components/{text-field.module-Btsve-VN.js → text-field.module-BHhBReKL.js} +1 -1
- package/components/{text-field.module-D5oDP7MB.cjs → text-field.module-l8CaTCwE.cjs} +1 -1
- package/components/toast/index.cjs +1 -1
- package/components/toast/index.js +2 -2
- package/components/toast-BPhdMJTx.cjs +51 -0
- package/components/{toast-Bd0fleYT.js → toast-D90C9Cim.js} +4 -4
- package/components/tooltip/index.cjs +1 -1
- package/components/tooltip/index.js +2 -2
- package/components/{tooltip-CVSSKlDP.js → tooltip-Byl1h4nN.js} +4 -4
- package/components/tooltip-Sm0pruxL.cjs +45 -0
- package/components/top-nav/index.cjs +1 -1
- package/components/top-nav/index.js +2 -2
- package/components/{top-nav-B3w3DZ56.js → top-nav-B9YKdtFB.js} +7 -11
- package/components/top-nav-BcZLCBP_.cjs +41 -0
- package/components/utils.cjs +1 -1
- package/components/utils.js +7 -7
- package/components/{voice-recorder-BUtmSvPO.cjs → voice-recorder-B1tBrGTV.cjs} +1 -1
- package/custom-elements.json +1 -1
- package/index.d.ts +2 -0
- package/package.json +15 -4
- package/utils/button-interaction-controllers/interaction-controller.d.ts +4 -2
- package/utils/reactive-controllers/match-media.d.ts +1 -0
- package/components/accordion-BHBIfsLU.cjs +0 -43
- package/components/action-bar-BSMX042X.cjs +0 -39
- package/components/action-button-Cr_QN4On.cjs +0 -22
- package/components/action-group-CH8FTW0i.cjs +0 -20
- package/components/avatar-CyY_ZSD0.js +0 -65
- package/components/avatar-PulwjkMI.cjs +0 -24
- package/components/badge-D1Ry32wi.cjs +0 -23
- package/components/badge-D6p2hPj8.js +0 -94
- package/components/button-C5hcfigl.cjs +0 -20
- package/components/button-group-DIz5TZvc.cjs +0 -18
- package/components/calendar-BWArK3rh.cjs +0 -142
- package/components/chat-message-CNE-mGuP.cjs +0 -149
- package/components/chat-message-group-COmhCN-R.cjs +0 -24
- package/components/checkbox-DFwDrIdY.cjs +0 -25
- package/components/close-button-_EXjp6_m.cjs +0 -18
- package/components/color-area-C3Y2d5cu.cjs +0 -80
- package/components/color-controller-DueaXfnX.cjs +0 -18
- package/components/color-handle-Cka48yPY.cjs +0 -24
- package/components/color-loupe-DMk8uWZW.cjs +0 -56
- package/components/color-menu-BAKmi_EI.cjs +0 -89
- package/components/color-palette-349EkPMg.cjs +0 -18
- package/components/color-palette-group-BvP09zmT.cjs +0 -28
- package/components/color-slider-DxjJ72ue.cjs +0 -57
- package/components/date-range-picker-A-XRRg1X.cjs +0 -180
- package/components/date-time-picker-Ca9GEA4N.cjs +0 -105
- package/components/decorate-B2wePfNm.cjs +0 -18
- package/components/divider-Dn8XqbB6.cjs +0 -18
- package/components/field-label-BCl6R1uO.cjs +0 -25
- package/components/focus-group-SF8Kj7iB.cjs +0 -18
- package/components/focus-visible-B0NNezGc.cjs +0 -18
- package/components/focusable-CupEoHmn.cjs +0 -18
- package/components/icon-B7hKwn_q.cjs +0 -18
- package/components/infield-button-D5cuBWE5.cjs +0 -22
- package/components/label-CqolZbJo.cjs +0 -18
- package/components/menu-DFKS4sRU.cjs +0 -108
- package/components/number-field-BmWODnnR.cjs +0 -57
- package/components/observe-slot-presence-Dx8hzNzK.cjs +0 -18
- package/components/observe-slot-text-BhTcGuHY.cjs +0 -18
- package/components/overlay-DU_p8MNs.cjs +0 -47
- package/components/picker-CssPvvau.cjs +0 -123
- package/components/picker-button-adl1JO5u.cjs +0 -37
- package/components/platform-B7Sk7Qon.cjs +0 -18
- package/components/popover-dgL04x6P.cjs +0 -30
- package/components/progress-bar-BR28tISC.cjs +0 -31
- package/components/progress-circle-DuzwUiGN.cjs +0 -33
- package/components/progress-steps-WriXaZpE.cjs +0 -96
- package/components/prompt-box-DfTe3nG0.cjs +0 -311
- package/components/radio-d-2GUbYE.cjs +0 -22
- package/components/search-CCvT87FX.cjs +0 -47
- package/components/search-Dtff2EzC.js +0 -100
- package/components/segments-factory-CHo9oQw7.cjs +0 -18
- package/components/select-qAKOLhmQ.cjs +0 -158
- package/components/sized-mixin-StFA4y0J.cjs +0 -18
- package/components/skeleton-loader-dNRfq6lt.cjs +0 -18
- package/components/slider-D8w2ipBg.cjs +0 -18
- package/components/slider-Fy-VeKrU.js +0 -96
- package/components/status-light-BG_kopZQ.cjs +0 -21
- package/components/strategies-kuvLVIKO.cjs +0 -18
- package/components/streaming-listener-BnDW38lt.cjs +0 -18
- package/components/switch-nuCOB2P3.cjs +0 -22
- package/components/tags-Dj7Xm3KI.cjs +0 -47
- package/components/text-field-A4Obzs4l.cjs +0 -21
- package/components/toast-NZ0Z1lz9.cjs +0 -51
- package/components/tooltip-6y-g7e9V.cjs +0 -45
- package/components/top-nav-DZO8yZs6.cjs +0 -45
- /package/components/{color-controller-G2_v2xSl.js → color-controller-Rg_Zl0sT.js} +0 -0
- /package/components/{condition-attribute-with-id-Duo51HZ7.js → condition-attribute-with-id-BdnTdWKz.js} +0 -0
- /package/components/{dependency-manger-DMrulWcJ.js → dependency-manger-wHEXoU92.js} +0 -0
- /package/components/{divider.module-C65RfSUa.js → divider.module-CPEKsaqR.js} +0 -0
- /package/components/{element-resolution-Bs1x89vU.js → element-resolution-gap51AVo.js} +0 -0
- /package/components/{focusable-selectors-Bg60_Kra.js → focusable-selectors-BWpiuXz5.js} +0 -0
- /package/components/{get-label-from-slot-5vVnfSgN.js → get-label-from-slot-Bo9mqYCZ.js} +0 -0
- /package/components/{language-resolution-BpfGTC29.js → language-resolution-DR30FsWE.js} +0 -0
- /package/components/{observe-slot-presence-BCqd3VSd.js → observe-slot-presence-BKY6n06-.js} +0 -0
- /package/components/{rolldown-runtime-CAFD8bLK.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
- /package/components/{scaled-indicator-fMYan6VK.js → scaled-indicator-C-TupV4L.js} +0 -0
- /package/components/{segments-factory-D0IveW-q.js → segments-factory-BCRi1NKb.js} +0 -0
- /package/components/{slottable-request-event-DZ2Z_BLk.js → slottable-request-event-MRSZbgTu.js} +0 -0
- /package/components/{streaming-listener-2NcP7ys7.js → streaming-listener-CtcMpYfS.js} +0 -0
- /package/components/{voice-recorder-477xPHRU.js → voice-recorder-CTg3kRxx.js} +0 -0
|
@@ -0,0 +1,1171 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import { n as e, t } from "./decorate-CkCg3wfh.js";
|
|
19
|
+
import { n } from "./sized-mixin-DzQTebN-.js";
|
|
20
|
+
import { t as r } from "./roving-tabindex-pomAn3z-.js";
|
|
21
|
+
import "./icon-DB1DRieA.js";
|
|
22
|
+
import "./action-button-cULkUUi6.js";
|
|
23
|
+
import "./badge-Dnkh-mfN.js";
|
|
24
|
+
import "./button-BtWr5Lag.js";
|
|
25
|
+
import { t as i } from "./language-resolution-DR30FsWE.js";
|
|
26
|
+
import "./checkbox-6YzkdHR4.js";
|
|
27
|
+
import "./field-group/index.js";
|
|
28
|
+
import "./text-field-C2MHZbTp.js";
|
|
29
|
+
import "./radio-DRI4on-W.js";
|
|
30
|
+
import { html as a, nothing as o, unsafeCSS as s } from "lit";
|
|
31
|
+
import { property as c, query as l, state as u } from "lit/decorators.js";
|
|
32
|
+
import { luzmoAngleLeft as d, luzmoAngleRight as f, luzmoPencil as p } from "@luzmo/icons";
|
|
33
|
+
import { ifDefined as m } from "lit/directives/if-defined.js";
|
|
34
|
+
import { repeat as h } from "lit/directives/repeat.js";
|
|
35
|
+
//#region src/components/question-box/question-box.module.scss?inline
|
|
36
|
+
var g = ":host{font-family:var(--question-box-font-family);font-size:var(--question-box-font-size);color:var(--highcontrast-question-box-color,var(--question-box-color));box-sizing:border-box;inline-size:100%;max-inline-size:var(--luzmo-question-box-max-inline-size,var(--question-box-max-inline-size));display:block}:host([disabled]){pointer-events:none}.card{gap:var(--question-box-gap);padding:var(--question-box-padding);box-sizing:border-box;border-width:var(--question-box-border-width);border-style:solid;border-color:var(--highcontrast-question-box-border-color,var(--question-box-border-color));border-radius:var(--question-box-border-radius);background-color:var(--highcontrast-question-box-background-color,var(--question-box-background-color));flex-direction:column;display:flex}.header{justify-content:space-between;align-items:flex-start;gap:var(--question-box-header-gap);display:flex}.header-actions,.step-navigation{align-items:center;display:flex}.header-actions{gap:var(--question-box-header-actions-gap);min-block-size:0;block-size:max(var(--question-box-title-font-size) * var(--question-box-title-line-height), var(--question-box-header-control-size) - 2 * (var(--question-box-padding) - var(--question-box-header-actions-inset)));flex-shrink:0;margin-inline-start:auto;overflow:visible}.step-navigation{gap:var(--question-box-copy-gap)}.heading{gap:var(--question-box-heading-copy-gap);flex-direction:column;min-inline-size:0;display:flex}.progress{font-size:var(--question-box-progress-font-size);color:var(--question-box-muted-color);margin:0}.title{font-size:var(--question-box-title-font-size);font-weight:var(--luzmo-font-weight-bold);line-height:var(--question-box-title-line-height);margin:0}.title:focus,.summary-heading:focus{outline:none}.title:focus-visible,.summary-heading:focus-visible{-webkit-text-decoration-color:var(--question-box-focus-ring-color);text-decoration-color:var(--question-box-focus-ring-color);text-decoration-line:underline;text-decoration-thickness:var(--question-box-focus-ring-width);text-underline-offset:var(--question-box-focus-ring-gap);outline:none}.description{color:var(--question-box-muted-color);font-size:inherit;margin:0;margin-block-start:var(--question-box-heading-copy-offset);line-height:1.4}.close{flex-shrink:0}.body{gap:var(--question-box-option-gap);max-block-size:var(--luzmo-question-box-body-max-block-size,var(--question-box-body-max-block-size));padding-block:var(--question-box-body-focus-inset);margin-block:calc(var(--question-box-body-focus-inset) * -1);flex-direction:column;display:flex;overflow:hidden auto}.body::-webkit-scrollbar{width:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width));height:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width))}.body::-webkit-scrollbar-track{background:var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background));border-radius:var(--luzmo-question-box-scrollbar-track-border-radius,var(--question-box-scrollbar-track-border-radius))}.body::-webkit-scrollbar-thumb{background:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background));border-radius:var(--luzmo-question-box-scrollbar-thumb-border-radius,var(--question-box-scrollbar-thumb-border-radius))}.body::-webkit-scrollbar-thumb:hover{background:var(--luzmo-question-box-scrollbar-thumb-hover-background,var(--question-box-scrollbar-thumb-hover-background))}.body{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background)) var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background))}.options{box-sizing:border-box;flex-direction:column;inline-size:100%;min-inline-size:0;display:flex}.options--descriptive luzmo-radio,.options--descriptive luzmo-checkbox,.options--descriptive .other-option-answer{padding-block:var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block))}.body:has(.options--descriptive){margin-block:calc(var(--question-box-option-padding-block) - var(--question-box-body-focus-inset) - var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block)))}luzmo-radio,luzmo-checkbox{box-sizing:border-box;inline-size:100%;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));border-radius:var(--luzmo-border-radius-s);align-items:center;display:flex}luzmo-radio:hover,luzmo-checkbox:hover{background-color:var(--question-box-option-hover-background)}.other-option-row{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));inline-size:100%;max-inline-size:100%;display:flex}.other-option-answer{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;min-inline-size:0;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-radius:var(--luzmo-border-radius-s);flex:1;display:flex}.other-option-answer:hover{background-color:var(--question-box-option-hover-background)}luzmo-radio.other-option,luzmo-checkbox.other-option{border:0;flex:none;min-block-size:auto;inline-size:auto;padding:0}luzmo-radio.other-option{--luzmo-radio-button-top-to-control:0px}luzmo-radio.numbered-option{--luzmo-radio-button-control-size:0px;--luzmo-radio-button-top-to-control:0px;--luzmo-radio-text-to-control:0px;--luzmo-radio-border-width:0px;--luzmo-radio-focus-indicator-width:0px}luzmo-checkbox.numbered-option{--luzmo-checkbox-control-size:0px;--luzmo-checkbox-text-to-control:0px;--luzmo-checkbox-top-to-text:0px;--luzmo-checkbox-border-width:0px;--luzmo-checkbox-selected-border-width:0px;--luzmo-checkbox-focus-indicator-width:0px}luzmo-radio.numbered-option::part(control),luzmo-checkbox.numbered-option::part(control){display:none}luzmo-radio.other-option:hover,luzmo-checkbox.other-option:hover{background-color:#0000}.other-field{inline-size:auto;min-inline-size:0;max-inline-size:100%;min-block-size:var(--question-box-other-field-min-block-size);font-size:var(--question-box-other-field-font-size);--luzmo-text-field-width:100%;--luzmo-text-field-height:var(--question-box-other-field-min-block-size);--luzmo-text-field-background-color:transparent;--luzmo-text-field-background-color-disabled:transparent;--luzmo-text-field-placeholder-font-size:var(--question-box-other-field-font-size);--luzmo-text-field-border-width:0px;--luzmo-text-field-spacing-inline:0px;--luzmo-text-field-spacing-block-start:0px;--luzmo-text-field-spacing-block-end:0px;flex:1;justify-content:center}.other-primary{flex:none}.other-actions{box-sizing:border-box;justify-content:flex-end;align-items:center;gap:var(--question-box-copy-gap-detailed);inline-size:100%;padding-inline:var(--question-box-option-padding-inline);margin-block-start:var(--question-box-copy-gap-detailed);display:flex}.selected-count{font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.other-actions .selected-count{min-inline-size:0;margin-inline-end:auto}.other-actions luzmo-button{flex:none}.status-error{--luzmo-helptext-font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size));--luzmo-helptext-min-height:0;--luzmo-helptext-top-to-text:0;--luzmo-helptext-bottom-to-text:0}.visually-hidden{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.option-content{align-items:flex-start;gap:var(--question-box-option-gap);inline-size:100%;display:flex}.option-number{forced-color-adjust:none;inline-size:var(--question-box-option-number-size);block-size:var(--question-box-option-number-size);box-sizing:border-box;border:var(--luzmo-border-width) solid var(--highcontrast-question-box-option-number-border-color,var(--question-box-option-number-border-color));border-radius:var(--luzmo-border-radius);color:var(--highcontrast-question-box-option-number-color,var(--question-box-option-number-color));background-color:var(--highcontrast-question-box-option-number-background,var(--question-box-option-number-background));transition:color var(--luzmo-animation-duration) ease-in-out, border-color var(--luzmo-animation-duration) ease-in-out, background-color var(--luzmo-animation-duration) ease-in-out;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}luzmo-radio[checked] .option-number,luzmo-checkbox[checked] .option-number{color:var(--highcontrast-question-box-option-number-selected-color,var(--question-box-option-number-selected-color));border-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background));background-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background))}luzmo-radio[data-focus-visible] .option-number,luzmo-checkbox[data-focus-visible] .option-number,.option-number--focused{outline:var(--luzmo-question-box-focus-ring-width,var(--question-box-focus-ring-width)) solid var(--highcontrast-question-box-focus-ring-color,var(--luzmo-question-box-focus-ring-color,var(--question-box-focus-ring-color)));outline-offset:var(--luzmo-question-box-focus-ring-gap,var(--question-box-focus-ring-gap))}luzmo-radio[disabled] .option-number,luzmo-checkbox[disabled] .option-number{opacity:.5}.option-copy{gap:var(--question-box-copy-gap);flex-direction:column;flex:1;min-inline-size:0;display:flex}.option-edit luzmo-icon{color:inherit}.option-heading{align-items:center;gap:var(--question-box-recommended-gap);min-block-size:var(--question-box-option-number-size);flex-wrap:wrap;display:flex}.option-text{align-items:baseline;gap:var(--question-box-recommended-gap);flex-wrap:wrap;min-inline-size:0;display:flex}.option-description{color:var(--question-box-muted-color);line-height:1.4}.option-hint{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.footer{justify-content:space-between;align-items:center;gap:var(--question-box-option-gap);flex-wrap:wrap;display:flex}.status{color:var(--question-box-muted-color);font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;margin-inline-start:auto;display:flex}:host([dir=rtl]) .step-navigation luzmo-icon{transform:scaleX(-1)}.resolved{gap:var(--question-box-summary-gap)}.summary-actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;display:flex}.summary{gap:var(--question-box-option-gap);flex-direction:column;display:flex}.summary-heading{font-size:var(--question-box-title-font-size);line-height:var(--question-box-title-line-height);margin:0}.summary-row{gap:var(--question-box-copy-gap);flex-direction:column;display:flex}.summary-title{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.summary-answer{font-weight:var(--luzmo-font-weight-bold)}@media (prefers-reduced-motion:reduce){.option-number{transition-duration:0s}}@media (forced-colors:active){:host{--highcontrast-question-box-border-color:CanvasText;--highcontrast-question-box-background-color:Canvas;--highcontrast-question-box-color:CanvasText;--highcontrast-question-box-focus-ring-color:Highlight;--highcontrast-question-box-option-number-border-color:ButtonText;--highcontrast-question-box-option-number-color:ButtonText;--highcontrast-question-box-option-number-background:Canvas;--highcontrast-question-box-option-number-selected-background:Highlight;--highcontrast-question-box-option-number-selected-color:HighlightText}}:host{--question-box-font-family:var(--luzmo-font-family);--question-box-font-size:var(--luzmo-font-size-m);--question-box-color:var(--luzmo-font-color);--question-box-muted-color:color-mix(in srgb, var(--luzmo-font-color) 80%, var(--luzmo-background-color));--question-box-background-color:var(--luzmo-background-color);--question-box-border-color:var(--luzmo-border-color);--question-box-border-width:var(--luzmo-border-width);--question-box-border-radius:var(--luzmo-border-radius-l);--question-box-padding:var(--luzmo-spacing-5);--question-box-gap:var(--luzmo-spacing-4);--question-box-header-gap:var(--luzmo-spacing-3);--question-box-header-actions-gap:var(--luzmo-spacing-2);--question-box-header-actions-inset:var(--luzmo-spacing-2);--question-box-header-control-size:var(--luzmo-component-height);--question-box-max-inline-size:40rem;--question-box-body-max-block-size:24rem;--question-box-title-font-size:var(--question-box-font-size);--question-box-title-line-height:1.3;--question-box-progress-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-s);--question-box-option-min-block-size:var(--luzmo-component-height);--question-box-option-hover-background:var(--luzmo-background-color-hover);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-descriptive-option-padding-block:var(--question-box-option-padding-block);--question-box-option-padding-block:var(--luzmo-spacing-1);--question-box-option-padding-inline:var(--luzmo-spacing-3);--question-box-option-gap:var(--luzmo-spacing-3);--question-box-heading-copy-gap:0px;--question-box-heading-copy-offset:calc(var(--question-box-font-size) * -.25);--question-box-copy-gap:var(--luzmo-spacing-1);--question-box-copy-gap-detailed:var(--luzmo-spacing-2);--question-box-recommended-gap:var(--luzmo-spacing-2);--question-box-summary-gap:var(--luzmo-spacing-4);--question-box-body-focus-inset:calc(var(--luzmo-indicator-gap) + var(--luzmo-indicator-width));--question-box-focus-ring-width:var(--luzmo-indicator-width);--question-box-focus-ring-gap:var(--luzmo-indicator-gap);--question-box-focus-ring-color:var(--luzmo-indicator-color);--question-box-divider-width:0px;--question-box-option-number-background:var(--luzmo-background-color);--question-box-option-number-border-color:var(--luzmo-border-color);--question-box-option-number-color:var(--luzmo-font-color);--question-box-option-number-selected-background:var(--luzmo-primary);--question-box-option-number-selected-color:var(--luzmo-primary-inverse-color);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size);--question-box-divider-color:var(--luzmo-border-color);--question-box-scrollbar-width:var(--luzmo-scrollbar-size);--question-box-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--question-box-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--question-box-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--question-box-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--question-box-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background)}:host([size=s]){--question-box-padding:var(--luzmo-spacing-4);--question-box-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-xs);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-s);--question-box-option-min-block-size:var(--luzmo-component-height-s);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=l]){--question-box-font-size:var(--luzmo-font-size-l);--question-box-selected-count-font-size:var(--luzmo-font-size-m);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-l);--question-box-option-min-block-size:var(--luzmo-component-height-l);--question-box-option-number-size:var(--luzmo-component-height-s);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=xl]){--question-box-font-size:var(--luzmo-font-size-xl);--question-box-selected-count-font-size:var(--luzmo-font-size-l);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-xl);--question-box-option-min-block-size:var(--luzmo-component-height-xl);--question-box-option-number-size:var(--luzmo-component-height);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}", _ = "__other__", v = {
|
|
37
|
+
continue: "Next",
|
|
38
|
+
back: "Back",
|
|
39
|
+
submit: "Submit",
|
|
40
|
+
skip: "Skip",
|
|
41
|
+
change: "Change",
|
|
42
|
+
close: "Close",
|
|
43
|
+
other: "Something else",
|
|
44
|
+
otherPlaceholder: "Something else",
|
|
45
|
+
recommended: "Recommended",
|
|
46
|
+
answerTitle: "Answer",
|
|
47
|
+
answersTitle: "Answers",
|
|
48
|
+
progress: "{current} of {total}",
|
|
49
|
+
selectedCount: "{count} selected",
|
|
50
|
+
selectedCountOne: "{count} selected",
|
|
51
|
+
recommendedSuffix: "{label} ({recommended})",
|
|
52
|
+
answer: "{answer}",
|
|
53
|
+
requiredSelectionDescription: "Choose one or more options.",
|
|
54
|
+
selectionRangeDescription: "Choose between {min} and {max} options.",
|
|
55
|
+
minSelectedError: "Choose at least {min} options.",
|
|
56
|
+
maxSelectedError: "Choose at most {max} options.",
|
|
57
|
+
otherRequiredError: "Enter a value for this option."
|
|
58
|
+
}, y = (e) => `${e}Other`, b = (e) => !!e.other || e.options.length === 0, x = (e) => typeof e.other == "object" && e.other ? e.other : {}, S = (e) => Object.fromEntries(Object.entries(e)), C = (e, t, n) => {
|
|
59
|
+
Object.defineProperty(e, t, {
|
|
60
|
+
configurable: !0,
|
|
61
|
+
enumerable: !0,
|
|
62
|
+
value: n,
|
|
63
|
+
writable: !0
|
|
64
|
+
});
|
|
65
|
+
}, w = (e, t) => {
|
|
66
|
+
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
67
|
+
for (let r of n) {
|
|
68
|
+
let n = e[r], i = t[r];
|
|
69
|
+
if (Array.isArray(n) || Array.isArray(i)) {
|
|
70
|
+
if (!Array.isArray(n) || !Array.isArray(i) || n.length !== i.length || n.some((e, t) => e !== i[t])) return !1;
|
|
71
|
+
} else if (n !== i) return !1;
|
|
72
|
+
}
|
|
73
|
+
return !0;
|
|
74
|
+
}, T = (e) => {
|
|
75
|
+
let t = /* @__PURE__ */ new Set(), n = [];
|
|
76
|
+
for (let r of e) t.has(r) || (t.add(r), n.push(r));
|
|
77
|
+
return n;
|
|
78
|
+
}, E = (e) => {
|
|
79
|
+
let t = new Set(e.options.map((e) => e.value));
|
|
80
|
+
return b(e) && t.add(_), t;
|
|
81
|
+
}, D = (e, t) => {
|
|
82
|
+
let n = t[e.id];
|
|
83
|
+
return e.type === "single" ? typeof n == "string" && n ? [n] : [] : Array.isArray(n) ? T(n) : [];
|
|
84
|
+
}, O = (e, t) => D(e, t).includes(_), ee = (e) => {
|
|
85
|
+
let t = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
86
|
+
return {
|
|
87
|
+
...v,
|
|
88
|
+
...t
|
|
89
|
+
};
|
|
90
|
+
}, k = (e, t) => {
|
|
91
|
+
let n = e;
|
|
92
|
+
for (let [e, r] of Object.entries(t)) n = n.replaceAll(`{${e}}`, r);
|
|
93
|
+
return n;
|
|
94
|
+
}, A = (e) => {
|
|
95
|
+
let t = /* @__PURE__ */ new Set();
|
|
96
|
+
for (let n of e) {
|
|
97
|
+
if (!n.id) throw TypeError("luzmo-question-box: every question needs an id.");
|
|
98
|
+
if (t.has(n.id)) throw TypeError(`luzmo-question-box: duplicate question id "${n.id}".`);
|
|
99
|
+
t.add(n.id);
|
|
100
|
+
let r = y(n.id);
|
|
101
|
+
if (e.some((e) => e.id === r)) throw TypeError(`luzmo-question-box: question id "${r}" collides with Other text for "${n.id}".`);
|
|
102
|
+
if (n.type !== "multiple" && (n.minSelected !== void 0 || n.maxSelected !== void 0)) throw TypeError(`luzmo-question-box: minSelected and maxSelected only apply to multiple-choice question "${n.id}".`);
|
|
103
|
+
for (let [e, t] of [["minSelected", n.minSelected], ["maxSelected", n.maxSelected]]) if (t !== void 0 && (!Number.isInteger(t) || t < 0)) throw TypeError(`luzmo-question-box: ${e} must be a non-negative integer on "${n.id}".`);
|
|
104
|
+
let i = n.minSelected ?? +!!n.required;
|
|
105
|
+
if (n.maxSelected !== void 0 && i > n.maxSelected) throw TypeError(`luzmo-question-box: minSelected cannot exceed maxSelected on "${n.id}".`);
|
|
106
|
+
let a = n.options.filter((e) => !e.disabled).length + +!!b(n);
|
|
107
|
+
if (n.type === "multiple" && i > a) throw TypeError(`luzmo-question-box: minSelected exceeds the available options on "${n.id}".`);
|
|
108
|
+
let o = /* @__PURE__ */ new Set();
|
|
109
|
+
for (let e of n.options) {
|
|
110
|
+
if (!e.value) throw TypeError(`luzmo-question-box: option values cannot be empty on "${n.id}".`);
|
|
111
|
+
if (e.value === "__other__") throw TypeError(`luzmo-question-box: "${_}" is reserved on "${n.id}".`);
|
|
112
|
+
if (o.has(e.value)) throw TypeError(`luzmo-question-box: duplicate option value "${e.value}" on "${n.id}".`);
|
|
113
|
+
o.add(e.value);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, j = (e, t) => {
|
|
117
|
+
let n = Object.fromEntries([]);
|
|
118
|
+
for (let r of e) {
|
|
119
|
+
let e = E(r), i = t[r.id], a = Object.hasOwn(t, r.id);
|
|
120
|
+
if (r.type === "single") typeof i == "string" && e.has(i) ? C(n, r.id, i) : !a && typeof r.default == "string" && (e.has(r.default) || r.options.length === 0) && C(n, r.id, r.options.length === 0 ? _ : r.default);
|
|
121
|
+
else {
|
|
122
|
+
let t = [...r.options.map((e) => e.value), ...b(r) ? [_] : []], o = T(Array.isArray(i) ? i.filter((t) => e.has(t)) : []);
|
|
123
|
+
if (o.length > 0) C(n, r.id, t.filter((e) => o.includes(e)));
|
|
124
|
+
else if (!a && Array.isArray(r.default)) {
|
|
125
|
+
let i = T(r.default.filter((t) => e.has(t)));
|
|
126
|
+
i.length > 0 && C(n, r.id, t.filter((e) => i.includes(e)));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
let o = y(r.id), s = t[o];
|
|
130
|
+
typeof s == "string" ? C(n, o, s) : !a && r.options.length === 0 && typeof r.default == "string" && C(n, o, r.default);
|
|
131
|
+
}
|
|
132
|
+
return n;
|
|
133
|
+
}, M = (e) => e.minSelected ?? +!!e.required, N = (e, t) => {
|
|
134
|
+
let n = M(e), r = e.maxSelected;
|
|
135
|
+
return n > 0 && r !== void 0 ? k(t.selectionRangeDescription, {
|
|
136
|
+
min: String(n),
|
|
137
|
+
max: String(r)
|
|
138
|
+
}) : n === 1 ? t.requiredSelectionDescription : n > 1 ? k(t.minSelectedError, { min: String(n) }) : r === void 0 ? void 0 : k(t.maxSelectedError, { max: String(r) });
|
|
139
|
+
}, P = (e, t) => {
|
|
140
|
+
let n = D(e, t), r = M(e), i = e.maxSelected;
|
|
141
|
+
if (n.length < r) return r <= 1 ? "missing" : "minimum";
|
|
142
|
+
if (i !== void 0 && n.length > i) return "maximum";
|
|
143
|
+
if (O(e, t) && !String(t[y(e.id)] ?? "").trim()) return "otherText";
|
|
144
|
+
}, te = (e, t) => P(e, t) !== void 0, ne = (e, t, n) => {
|
|
145
|
+
switch (P(e, t)) {
|
|
146
|
+
case "minimum": return k(n.minSelectedError, { min: String(M(e)) });
|
|
147
|
+
case "maximum": return k(n.maxSelectedError, { max: String(e.maxSelected) });
|
|
148
|
+
case "otherText": return n.otherRequiredError;
|
|
149
|
+
default: return;
|
|
150
|
+
}
|
|
151
|
+
}, re = (e, t, n, r, i) => {
|
|
152
|
+
if (i || t.disabled) return !0;
|
|
153
|
+
if (e.type !== "multiple" || n) return !1;
|
|
154
|
+
let a = e.maxSelected;
|
|
155
|
+
return a !== void 0 && D(e, r).length >= a;
|
|
156
|
+
}, ie = (e, t) => k(e === 1 ? t.selectedCountOne : t.selectedCount, { count: String(e) }), F, ae = (e, t) => {
|
|
157
|
+
try {
|
|
158
|
+
return F?.language !== t && (F = {
|
|
159
|
+
language: t,
|
|
160
|
+
formatter: new Intl.ListFormat(t, {
|
|
161
|
+
style: "narrow",
|
|
162
|
+
type: "conjunction"
|
|
163
|
+
})
|
|
164
|
+
}), F.formatter.format(e);
|
|
165
|
+
} catch {
|
|
166
|
+
return e.join(", ");
|
|
167
|
+
}
|
|
168
|
+
}, oe = (e, t) => e.recommended ? k(t.recommendedSuffix, {
|
|
169
|
+
label: e.label,
|
|
170
|
+
recommended: t.recommended
|
|
171
|
+
}) : e.label, se = (e) => {
|
|
172
|
+
let t = e.options.map((e) => ({
|
|
173
|
+
const: e.value,
|
|
174
|
+
title: e.label
|
|
175
|
+
}));
|
|
176
|
+
return b(e) && e.options.length > 0 && t.push({
|
|
177
|
+
const: _,
|
|
178
|
+
title: typeof e.other == "object" && e.other.label || v.other
|
|
179
|
+
}), t;
|
|
180
|
+
}, ce = (e) => {
|
|
181
|
+
let t = { type: "string" };
|
|
182
|
+
return typeof e.other == "object" && e.other.label && (t.title = e.other.label), t;
|
|
183
|
+
}, I = (e) => {
|
|
184
|
+
let t = [], n = [];
|
|
185
|
+
for (let r of e) {
|
|
186
|
+
if (r.options.length === 0) {
|
|
187
|
+
let e = { type: "string" };
|
|
188
|
+
r.title && (e.title = r.title), r.description && (e.description = r.description), typeof r.default == "string" && (e.default = r.default), t.push([r.id, e]), r.required && n.push(r.id);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
let e = se(r);
|
|
192
|
+
if (r.type === "single") {
|
|
193
|
+
let n = {
|
|
194
|
+
type: "string",
|
|
195
|
+
oneOf: e
|
|
196
|
+
};
|
|
197
|
+
r.title && (n.title = r.title), r.description && (n.description = r.description), typeof r.default == "string" && r.options.some((e) => e.value === r.default) && (n.default = r.default), t.push([r.id, n]);
|
|
198
|
+
} else {
|
|
199
|
+
let n = {
|
|
200
|
+
type: "array",
|
|
201
|
+
items: { anyOf: e }
|
|
202
|
+
};
|
|
203
|
+
r.title && (n.title = r.title), r.description && (n.description = r.description);
|
|
204
|
+
let i = r.minSelected ?? (r.required ? 1 : void 0);
|
|
205
|
+
if (i !== void 0 && (n.minItems = i), r.maxSelected !== void 0 && (n.maxItems = r.maxSelected), Array.isArray(r.default)) {
|
|
206
|
+
let t = new Set(e.map((e) => e.const)), i = r.default.filter((e) => t.has(e));
|
|
207
|
+
i.length > 0 && (n.default = i);
|
|
208
|
+
}
|
|
209
|
+
t.push([r.id, n]);
|
|
210
|
+
}
|
|
211
|
+
r.required && n.push(r.id), b(r) && t.push([y(r.id), ce(r)]);
|
|
212
|
+
}
|
|
213
|
+
let r = Object.fromEntries(t);
|
|
214
|
+
return n.length > 0 ? {
|
|
215
|
+
type: "object",
|
|
216
|
+
properties: r,
|
|
217
|
+
required: n
|
|
218
|
+
} : {
|
|
219
|
+
type: "object",
|
|
220
|
+
properties: r
|
|
221
|
+
};
|
|
222
|
+
}, L = (e, t) => String(t[y(e.id)] ?? "").trim(), R = (e, t) => {
|
|
223
|
+
let n = [];
|
|
224
|
+
for (let r of e) {
|
|
225
|
+
let e = L(r, t);
|
|
226
|
+
if (r.options.length === 0) {
|
|
227
|
+
e && n.push([r.id, e]);
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
let i = D(r, t);
|
|
231
|
+
r.type === "single" ? i[0] && n.push([r.id, i[0]]) : i.length > 0 && n.push([r.id, [...i]]), b(r) && O(r, t) && e && n.push([y(r.id), e]);
|
|
232
|
+
}
|
|
233
|
+
return Object.fromEntries(n);
|
|
234
|
+
}, z = (e) => !!e && typeof e == "object" && !Array.isArray(e), B = (e) => z(e) ? e : {}, V = (e) => {
|
|
235
|
+
let t = e.oneOf ?? e.items?.anyOf;
|
|
236
|
+
if (Array.isArray(t)) {
|
|
237
|
+
let e = [], n = /* @__PURE__ */ new Set();
|
|
238
|
+
for (let r of t) !z(r) || typeof r.const != "string" || !r.const || n.has(r.const) || (n.add(r.const), e.push({
|
|
239
|
+
value: r.const,
|
|
240
|
+
label: typeof r.title == "string" && r.title ? r.title : r.const
|
|
241
|
+
}));
|
|
242
|
+
return {
|
|
243
|
+
declared: !0,
|
|
244
|
+
options: e
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
let n = e.enum ?? e.items?.enum;
|
|
248
|
+
if (Array.isArray(n)) {
|
|
249
|
+
let t = e.enumNames ?? e.items?.enumNames, r = /* @__PURE__ */ new Set(), i = [];
|
|
250
|
+
for (let [e, a] of n.entries()) {
|
|
251
|
+
if (typeof a != "string" || !a || r.has(a)) continue;
|
|
252
|
+
r.add(a);
|
|
253
|
+
let n = t?.[e];
|
|
254
|
+
i.push({
|
|
255
|
+
value: a,
|
|
256
|
+
label: typeof n == "string" && n ? n : a
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
declared: !0,
|
|
261
|
+
options: i
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
declared: !1,
|
|
266
|
+
options: []
|
|
267
|
+
};
|
|
268
|
+
}, H = (e) => y(e), U = (e) => e.format !== void 0 || e.minLength !== void 0 || e.maxLength !== void 0 || e.pattern !== void 0, W = (e) => e.type === "string" && !V(e).declared && !U(e), le = (e) => {
|
|
269
|
+
if (e.type !== "object" || !e.properties) return [];
|
|
270
|
+
let t = e.properties, n = new Set(e.required ?? []), r = /* @__PURE__ */ new Set();
|
|
271
|
+
for (let e of Object.keys(t)) {
|
|
272
|
+
let n = H(e), i = V(B(t[e])), a = B(t[n]);
|
|
273
|
+
n in t && W(a) && i.options.some((e) => e.value === "__other__") && r.add(n);
|
|
274
|
+
}
|
|
275
|
+
let i = [];
|
|
276
|
+
for (let [e, a] of Object.entries(t)) {
|
|
277
|
+
if (r.has(e)) continue;
|
|
278
|
+
let o = B(a), s = V(o), c = s.options.some((e) => e.value === _), l = H(e);
|
|
279
|
+
if (c && !r.has(l)) continue;
|
|
280
|
+
let u = s.options.filter((e) => e.value !== _);
|
|
281
|
+
if (o.type === "number" || o.type === "integer" || o.type === "boolean" || o.type !== "string" && o.type !== "array" || s.declared && s.options.length === 0 || o.type === "array" && !s.declared || o.type === "string" && !s.declared && U(o)) continue;
|
|
282
|
+
let d = {
|
|
283
|
+
id: e,
|
|
284
|
+
type: o.type === "array" ? "multiple" : "single",
|
|
285
|
+
title: o.title || e,
|
|
286
|
+
options: u
|
|
287
|
+
};
|
|
288
|
+
if (o.description && (d.description = o.description), n.has(e) && (d.required = !0), o.type === "array" ? (o.minItems !== void 0 && (d.minSelected = o.minItems), o.maxItems !== void 0 && (d.maxSelected = o.maxItems), Array.isArray(o.default) && o.default.length > 0 && (d.default = o.default)) : typeof o.default == "string" && (d.default = o.default), c && l in t) {
|
|
289
|
+
let e = B(t[l]);
|
|
290
|
+
d.other = !e.title || { label: e.title };
|
|
291
|
+
}
|
|
292
|
+
i.push(d);
|
|
293
|
+
}
|
|
294
|
+
return i;
|
|
295
|
+
};
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/components/question-box/question-box-templates.ts
|
|
298
|
+
function G(e) {
|
|
299
|
+
switch (e) {
|
|
300
|
+
case "s": return "xs";
|
|
301
|
+
case "m": return "s";
|
|
302
|
+
case "l": return "m";
|
|
303
|
+
default: return "l";
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function K(e) {
|
|
307
|
+
switch (e) {
|
|
308
|
+
case "m": return "xs";
|
|
309
|
+
case "l": return "s";
|
|
310
|
+
case "xl":
|
|
311
|
+
case "xxl": return "m";
|
|
312
|
+
default: return "xxs";
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function q(e) {
|
|
316
|
+
return e.step >= e.questions.length - 1;
|
|
317
|
+
}
|
|
318
|
+
function ue(e, t) {
|
|
319
|
+
let n = e.selectedValues(t);
|
|
320
|
+
return n.length === 0 ? "" : ae(n.map((n) => {
|
|
321
|
+
if (n === "__other__") return String(e.value[y(t.id)] ?? e.copy.other);
|
|
322
|
+
let r = t.options.find((e) => e.value === n);
|
|
323
|
+
return r ? oe(r, e.copy) : n;
|
|
324
|
+
}), e.language);
|
|
325
|
+
}
|
|
326
|
+
function de(e, t) {
|
|
327
|
+
let n = ue(e, t);
|
|
328
|
+
return a`<span class="summary-value">${e.copy.answer.split("{answer}").map((e, t) => a`${t > 0 ? a`<span class="summary-answer">${n}</span>` : o}${e}`)}</span>`;
|
|
329
|
+
}
|
|
330
|
+
function fe(e) {
|
|
331
|
+
let t = e.copy;
|
|
332
|
+
return a`
|
|
333
|
+
<div class="card resolved">
|
|
334
|
+
<div class="summary">
|
|
335
|
+
<h2 class="summary-heading" id="resolved-title" tabindex="-1">
|
|
336
|
+
${e.questions.reduce((t, n) => t + e.selectedValues(n).length, 0) === 1 ? t.answerTitle : t.answersTitle}
|
|
337
|
+
</h2>
|
|
338
|
+
${h(e.questions, (e) => e.id, (t) => a`
|
|
339
|
+
<div class="summary-row">
|
|
340
|
+
<span class="summary-title">${t.title}</span>
|
|
341
|
+
${de(e, t)}
|
|
342
|
+
</div>
|
|
343
|
+
`)}
|
|
344
|
+
</div>
|
|
345
|
+
<div class="summary-actions">
|
|
346
|
+
${!e.submitted || e.showChange ? a`
|
|
347
|
+
<luzmo-button
|
|
348
|
+
id="change-button"
|
|
349
|
+
dir=${e.dir}
|
|
350
|
+
variant="primary"
|
|
351
|
+
treatment=${e.submitted ? "fill" : "outline"}
|
|
352
|
+
size=${e.size}
|
|
353
|
+
?disabled=${e.disabled}
|
|
354
|
+
@click=${e.handlers.change}
|
|
355
|
+
>${t.change}</luzmo-button
|
|
356
|
+
>
|
|
357
|
+
` : o}
|
|
358
|
+
${e.submitted ? o : a`
|
|
359
|
+
<luzmo-button
|
|
360
|
+
id="review-submit-button"
|
|
361
|
+
dir=${e.dir}
|
|
362
|
+
variant="primary"
|
|
363
|
+
size=${e.size}
|
|
364
|
+
?disabled=${e.disabled || e.readonly}
|
|
365
|
+
@click=${e.handlers.primary}
|
|
366
|
+
>${t.submit}</luzmo-button
|
|
367
|
+
>
|
|
368
|
+
`}
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
`;
|
|
372
|
+
}
|
|
373
|
+
function J(e, t, n) {
|
|
374
|
+
let r = e.optionIndicator === "letters" && n < 26 ? String.fromCharCode(65 + n) : String(n + 1);
|
|
375
|
+
return a`
|
|
376
|
+
<span
|
|
377
|
+
class=${t.description ? "option-content option-content--detailed" : "option-content"}
|
|
378
|
+
>
|
|
379
|
+
<span class="option-number" aria-hidden="true">${r}</span>
|
|
380
|
+
<span class="option-copy">
|
|
381
|
+
<span class="option-heading">
|
|
382
|
+
<span class="option-text">
|
|
383
|
+
<span class="option-label">${t.label}</span>
|
|
384
|
+
${t.hint ? a`<span class="option-hint">${t.hint}</span>` : o}
|
|
385
|
+
</span>
|
|
386
|
+
${t.recommended ? a`<luzmo-badge
|
|
387
|
+
class="recommended-label"
|
|
388
|
+
dir=${e.dir}
|
|
389
|
+
variant="neutral"
|
|
390
|
+
treatment="subtle"
|
|
391
|
+
size=${G(e.size)}
|
|
392
|
+
>${e.copy.recommended}</luzmo-badge
|
|
393
|
+
>` : o}
|
|
394
|
+
</span>
|
|
395
|
+
${t.description ? a`<span class="option-description"
|
|
396
|
+
>${t.description}</span
|
|
397
|
+
>` : o}
|
|
398
|
+
</span>
|
|
399
|
+
</span>
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
function Y(e, t) {
|
|
403
|
+
return e.disabledReason ? a`<span class="visually-hidden" id="option-reason-${t}"
|
|
404
|
+
>${e.disabledReason}</span
|
|
405
|
+
>` : o;
|
|
406
|
+
}
|
|
407
|
+
function pe(e, t) {
|
|
408
|
+
return t ? a`
|
|
409
|
+
<luzmo-help-text
|
|
410
|
+
id="question-error"
|
|
411
|
+
dir=${e.dir}
|
|
412
|
+
slot="negative-help-text"
|
|
413
|
+
>${t}</luzmo-help-text
|
|
414
|
+
>
|
|
415
|
+
` : o;
|
|
416
|
+
}
|
|
417
|
+
function X(e, t) {
|
|
418
|
+
if (t.type !== "multiple") return o;
|
|
419
|
+
let n = e.showError ? e.questionError(t) : void 0;
|
|
420
|
+
return a`
|
|
421
|
+
<span class="selected-count" aria-live="polite"
|
|
422
|
+
>${n ? a`<luzmo-help-text
|
|
423
|
+
id="question-error"
|
|
424
|
+
class="status-error"
|
|
425
|
+
dir=${e.dir}
|
|
426
|
+
variant="negative"
|
|
427
|
+
>${n}</luzmo-help-text
|
|
428
|
+
>` : ie(e.selectedValues(t).length, e.copy)}</span
|
|
429
|
+
>
|
|
430
|
+
`;
|
|
431
|
+
}
|
|
432
|
+
function me(e, t) {
|
|
433
|
+
return a`
|
|
434
|
+
<div class="other-actions">
|
|
435
|
+
${X(e, t)}
|
|
436
|
+
${e.hideSkip ? o : a`
|
|
437
|
+
<luzmo-button
|
|
438
|
+
id="other-skip-button"
|
|
439
|
+
dir=${e.dir}
|
|
440
|
+
variant="primary"
|
|
441
|
+
size=${G(e.size)}
|
|
442
|
+
quiet
|
|
443
|
+
?disabled=${e.disabled}
|
|
444
|
+
@click=${e.handlers.skip}
|
|
445
|
+
>${e.copy.skip}</luzmo-button
|
|
446
|
+
>
|
|
447
|
+
`}
|
|
448
|
+
<luzmo-button
|
|
449
|
+
id="other-primary-button"
|
|
450
|
+
dir=${e.dir}
|
|
451
|
+
class="other-primary"
|
|
452
|
+
variant="primary"
|
|
453
|
+
treatment="outline"
|
|
454
|
+
size=${G(e.size)}
|
|
455
|
+
?disabled=${e.disabled || e.readonly || e.questionInvalid(t)}
|
|
456
|
+
@click=${e.handlers.primary}
|
|
457
|
+
>${q(e) ? e.copy.submit : e.copy.continue}</luzmo-button
|
|
458
|
+
>
|
|
459
|
+
</div>
|
|
460
|
+
`;
|
|
461
|
+
}
|
|
462
|
+
function he(e, t) {
|
|
463
|
+
return e.isOtherSelected(t) && String(e.value[y(t.id)] ?? "").trim().length > 0;
|
|
464
|
+
}
|
|
465
|
+
function Z(e, t) {
|
|
466
|
+
let n = x(t), r = y(t.id), i = e.isOtherSelected(t), o = e.optionDisabled(t, {
|
|
467
|
+
value: _,
|
|
468
|
+
label: n.label || e.copy.other
|
|
469
|
+
}, i), s = e.showError && i && !!e.questionError(t);
|
|
470
|
+
return a`
|
|
471
|
+
<luzmo-text-field
|
|
472
|
+
id="other-field"
|
|
473
|
+
dir=${e.dir}
|
|
474
|
+
class="other-field"
|
|
475
|
+
size=${e.size}
|
|
476
|
+
label=${n.label || e.copy.other}
|
|
477
|
+
placeholder=${n.placeholder || e.copy.otherPlaceholder}
|
|
478
|
+
border="none"
|
|
479
|
+
multiline
|
|
480
|
+
grows
|
|
481
|
+
rows="1"
|
|
482
|
+
.value=${String(e.value[r] ?? "")}
|
|
483
|
+
?disabled=${o}
|
|
484
|
+
?readonly=${e.readonly}
|
|
485
|
+
?invalid=${s}
|
|
486
|
+
@keydown=${e.handlers.otherKeydown}
|
|
487
|
+
@input=${e.handlers.otherInput}
|
|
488
|
+
@change=${e.handlers.otherChange}
|
|
489
|
+
></luzmo-text-field>
|
|
490
|
+
`;
|
|
491
|
+
}
|
|
492
|
+
function ge(e, t) {
|
|
493
|
+
let n = he(e, t);
|
|
494
|
+
return t.type === "multiple" || e.hideSkip && !n ? o : a`
|
|
495
|
+
<luzmo-button
|
|
496
|
+
id="other-row-action"
|
|
497
|
+
dir=${e.dir}
|
|
498
|
+
class="other-primary"
|
|
499
|
+
variant="primary"
|
|
500
|
+
treatment="outline"
|
|
501
|
+
size=${G(e.size)}
|
|
502
|
+
?disabled=${n ? e.disabled || e.readonly || e.questionInvalid(t) : e.disabled}
|
|
503
|
+
@click=${n ? e.handlers.primary : e.handlers.skip}
|
|
504
|
+
>${n ? q(e) ? e.copy.submit : e.copy.continue : e.copy.skip}</luzmo-button
|
|
505
|
+
>
|
|
506
|
+
`;
|
|
507
|
+
}
|
|
508
|
+
function _e(e, t, n) {
|
|
509
|
+
let r = e.selectedValues(t)[0] ?? "", i = t.options.some((e) => e.description) ? "options options--descriptive" : "options";
|
|
510
|
+
return a`
|
|
511
|
+
<luzmo-radio-group
|
|
512
|
+
id="options"
|
|
513
|
+
dir=${e.dir}
|
|
514
|
+
class=${i}
|
|
515
|
+
vertical
|
|
516
|
+
label=${t.title}
|
|
517
|
+
manual-selection
|
|
518
|
+
aria-readonly=${m(e.readonly ? "true" : void 0)}
|
|
519
|
+
aria-required=${m(t.required ? "true" : void 0)}
|
|
520
|
+
.selected=${r}
|
|
521
|
+
?invalid=${!!n}
|
|
522
|
+
@change=${e.handlers.radioChange}
|
|
523
|
+
@focusin=${e.handlers.focusIn}
|
|
524
|
+
@focusout=${e.handlers.focusOut}
|
|
525
|
+
>
|
|
526
|
+
${h(t.options, (e) => e.value, (n, i) => a`
|
|
527
|
+
<luzmo-radio
|
|
528
|
+
class="numbered-option"
|
|
529
|
+
dir=${e.dir}
|
|
530
|
+
value=${n.value}
|
|
531
|
+
data-option-index=${i}
|
|
532
|
+
size=${e.size}
|
|
533
|
+
emphasized
|
|
534
|
+
?disabled=${e.optionDisabled(t, n, n.value === r)}
|
|
535
|
+
?readonly=${e.readonly}
|
|
536
|
+
aria-describedby=${m(n.disabledReason ? `option-reason-${i}` : void 0)}
|
|
537
|
+
@click=${e.handlers.radioClick}
|
|
538
|
+
@change=${e.handlers.radioChange}
|
|
539
|
+
>
|
|
540
|
+
${J(e, n, i)}
|
|
541
|
+
${Y(n, i)}
|
|
542
|
+
</luzmo-radio>
|
|
543
|
+
`)}
|
|
544
|
+
${b(t) ? a`
|
|
545
|
+
<div class="other-option-row">
|
|
546
|
+
<div class="other-option-answer">
|
|
547
|
+
<luzmo-radio
|
|
548
|
+
class="numbered-option other-option"
|
|
549
|
+
dir=${e.dir}
|
|
550
|
+
value=${_}
|
|
551
|
+
data-option-index=${t.options.length}
|
|
552
|
+
size=${e.size}
|
|
553
|
+
emphasized
|
|
554
|
+
aria-label=${x(t).label || e.copy.other}
|
|
555
|
+
?disabled=${e.disabled}
|
|
556
|
+
?readonly=${e.readonly}
|
|
557
|
+
@change=${e.handlers.radioChange}
|
|
558
|
+
>
|
|
559
|
+
<span class="option-number option-edit" aria-hidden="true">
|
|
560
|
+
<luzmo-icon
|
|
561
|
+
block
|
|
562
|
+
dir=${e.dir}
|
|
563
|
+
.size=${K(e.size)}
|
|
564
|
+
.icon=${p}
|
|
565
|
+
></luzmo-icon>
|
|
566
|
+
</span>
|
|
567
|
+
</luzmo-radio>
|
|
568
|
+
${Z(e, t)}
|
|
569
|
+
</div>
|
|
570
|
+
${ge(e, t)}
|
|
571
|
+
</div>
|
|
572
|
+
` : o}
|
|
573
|
+
${pe(e, n)}
|
|
574
|
+
</luzmo-radio-group>
|
|
575
|
+
`;
|
|
576
|
+
}
|
|
577
|
+
function Q(e, t, n) {
|
|
578
|
+
let r = new Set(e.selectedValues(t)), i = e.isOtherSelected(t), s = t.options.some((e) => e.description) ? "options options--descriptive" : "options", c = N(t, e.copy);
|
|
579
|
+
return a`
|
|
580
|
+
${c ? a`<span class="visually-hidden" id="selection-requirement"
|
|
581
|
+
>${c}</span
|
|
582
|
+
>` : o}
|
|
583
|
+
<luzmo-field-group
|
|
584
|
+
id="options"
|
|
585
|
+
dir=${e.dir}
|
|
586
|
+
class=${s}
|
|
587
|
+
vertical
|
|
588
|
+
label=${t.title}
|
|
589
|
+
aria-describedby=${m(c ? "selection-requirement" : void 0)}
|
|
590
|
+
?invalid=${!!n}
|
|
591
|
+
@focusin=${e.handlers.focusIn}
|
|
592
|
+
@focusout=${e.handlers.focusOut}
|
|
593
|
+
>
|
|
594
|
+
${h(t.options, (e) => e.value, (n, i) => a`
|
|
595
|
+
<luzmo-checkbox
|
|
596
|
+
class="numbered-option"
|
|
597
|
+
dir=${e.dir}
|
|
598
|
+
data-value=${n.value}
|
|
599
|
+
data-option-index=${i}
|
|
600
|
+
size=${e.size}
|
|
601
|
+
emphasized
|
|
602
|
+
?checked=${r.has(n.value)}
|
|
603
|
+
?disabled=${e.optionDisabled(t, n, r.has(n.value))}
|
|
604
|
+
?readonly=${e.readonly}
|
|
605
|
+
aria-describedby=${m(n.disabledReason ? `option-reason-${i}` : void 0)}
|
|
606
|
+
@change=${e.handlers.checkboxChange}
|
|
607
|
+
>
|
|
608
|
+
${J(e, n, i)}
|
|
609
|
+
${Y(n, i)}
|
|
610
|
+
</luzmo-checkbox>
|
|
611
|
+
`)}
|
|
612
|
+
${b(t) ? a`
|
|
613
|
+
<div class="other-option-row other-option-row--multiple">
|
|
614
|
+
<div class="other-option-answer">
|
|
615
|
+
<luzmo-checkbox
|
|
616
|
+
class="numbered-option other-option"
|
|
617
|
+
dir=${e.dir}
|
|
618
|
+
data-value=${_}
|
|
619
|
+
data-option-index=${t.options.length}
|
|
620
|
+
size=${e.size}
|
|
621
|
+
emphasized
|
|
622
|
+
?checked=${i}
|
|
623
|
+
?disabled=${e.optionDisabled(t, {
|
|
624
|
+
value: _,
|
|
625
|
+
label: e.copy.other
|
|
626
|
+
}, i)}
|
|
627
|
+
?readonly=${e.readonly}
|
|
628
|
+
@change=${e.handlers.checkboxChange}
|
|
629
|
+
>
|
|
630
|
+
<span class="option-number option-edit" aria-hidden="true">
|
|
631
|
+
<luzmo-icon
|
|
632
|
+
block
|
|
633
|
+
dir=${e.dir}
|
|
634
|
+
.size=${K(e.size)}
|
|
635
|
+
.icon=${p}
|
|
636
|
+
></luzmo-icon>
|
|
637
|
+
</span>
|
|
638
|
+
<span class="visually-hidden"
|
|
639
|
+
>${x(t).label || e.copy.other}</span
|
|
640
|
+
>
|
|
641
|
+
</luzmo-checkbox>
|
|
642
|
+
${Z(e, t)}
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
645
|
+
${me(e, t)}
|
|
646
|
+
` : o}
|
|
647
|
+
</luzmo-field-group>
|
|
648
|
+
`;
|
|
649
|
+
}
|
|
650
|
+
function ve(e, t) {
|
|
651
|
+
let n = e.copy, r = k(n.progress, {
|
|
652
|
+
current: String(e.step + 1),
|
|
653
|
+
total: String(e.questions.length)
|
|
654
|
+
}), i = !e.questionInvalid(t);
|
|
655
|
+
return a`
|
|
656
|
+
<header class="header">
|
|
657
|
+
<div class="heading">
|
|
658
|
+
<h2 class="title" id="question-title" tabindex="-1">
|
|
659
|
+
${t.title}
|
|
660
|
+
</h2>
|
|
661
|
+
${t.description ? a`<p class="description" id="question-description">
|
|
662
|
+
${t.description}
|
|
663
|
+
</p>` : o}
|
|
664
|
+
</div>
|
|
665
|
+
<div class="header-actions">
|
|
666
|
+
${e.questions.length > 1 ? a`
|
|
667
|
+
<nav class="step-navigation" aria-label=${r}>
|
|
668
|
+
<luzmo-action-button
|
|
669
|
+
id="back-button"
|
|
670
|
+
dir=${e.dir}
|
|
671
|
+
quiet
|
|
672
|
+
size=${G(e.size)}
|
|
673
|
+
label=${n.back}
|
|
674
|
+
?disabled=${e.disabled || e.step === 0}
|
|
675
|
+
@click=${e.handlers.back}
|
|
676
|
+
>
|
|
677
|
+
<div slot="icon">
|
|
678
|
+
<luzmo-icon
|
|
679
|
+
block
|
|
680
|
+
dir=${e.dir}
|
|
681
|
+
.size=${G(e.size)}
|
|
682
|
+
.icon=${d}
|
|
683
|
+
></luzmo-icon>
|
|
684
|
+
</div>
|
|
685
|
+
</luzmo-action-button>
|
|
686
|
+
<p class="progress" id="progress" aria-live="polite">
|
|
687
|
+
${r}
|
|
688
|
+
</p>
|
|
689
|
+
<luzmo-action-button
|
|
690
|
+
id="continue-button"
|
|
691
|
+
dir=${e.dir}
|
|
692
|
+
quiet
|
|
693
|
+
size=${G(e.size)}
|
|
694
|
+
label=${n.continue}
|
|
695
|
+
?disabled=${e.disabled || e.readonly || q(e) || !i}
|
|
696
|
+
@click=${e.handlers.primary}
|
|
697
|
+
>
|
|
698
|
+
<div slot="icon">
|
|
699
|
+
<luzmo-icon
|
|
700
|
+
block
|
|
701
|
+
dir=${e.dir}
|
|
702
|
+
.size=${G(e.size)}
|
|
703
|
+
.icon=${f}
|
|
704
|
+
></luzmo-icon>
|
|
705
|
+
</div>
|
|
706
|
+
</luzmo-action-button>
|
|
707
|
+
</nav>
|
|
708
|
+
` : o}
|
|
709
|
+
${e.hideClose ? o : a`
|
|
710
|
+
<luzmo-close-button
|
|
711
|
+
id="close-button"
|
|
712
|
+
dir=${e.dir}
|
|
713
|
+
class="close"
|
|
714
|
+
label=${n.close}
|
|
715
|
+
size=${e.size}
|
|
716
|
+
?disabled=${e.disabled}
|
|
717
|
+
@click=${e.handlers.cancel}
|
|
718
|
+
></luzmo-close-button>
|
|
719
|
+
`}
|
|
720
|
+
</div>
|
|
721
|
+
</header>
|
|
722
|
+
`;
|
|
723
|
+
}
|
|
724
|
+
function ye(e, t) {
|
|
725
|
+
let n = e.copy, r = !e.questionInvalid(t);
|
|
726
|
+
return a`
|
|
727
|
+
<footer class="footer">
|
|
728
|
+
<div class="status">${X(e, t)}</div>
|
|
729
|
+
<div class="actions">
|
|
730
|
+
${e.hideSkip ? o : a`
|
|
731
|
+
<luzmo-button
|
|
732
|
+
id="skip-button"
|
|
733
|
+
dir=${e.dir}
|
|
734
|
+
variant="primary"
|
|
735
|
+
treatment="outline"
|
|
736
|
+
size=${G(e.size)}
|
|
737
|
+
?disabled=${e.disabled}
|
|
738
|
+
@click=${e.handlers.skip}
|
|
739
|
+
>${n.skip}</luzmo-button
|
|
740
|
+
>
|
|
741
|
+
`}
|
|
742
|
+
${q(e) && t.type === "multiple" ? a`
|
|
743
|
+
<luzmo-button
|
|
744
|
+
id="submit-button"
|
|
745
|
+
dir=${e.dir}
|
|
746
|
+
variant="primary"
|
|
747
|
+
treatment="outline"
|
|
748
|
+
size=${G(e.size)}
|
|
749
|
+
?disabled=${e.disabled || e.readonly || !r}
|
|
750
|
+
@click=${e.handlers.primary}
|
|
751
|
+
>${n.submit}</luzmo-button
|
|
752
|
+
>
|
|
753
|
+
` : o}
|
|
754
|
+
</div>
|
|
755
|
+
</footer>
|
|
756
|
+
`;
|
|
757
|
+
}
|
|
758
|
+
function be(e) {
|
|
759
|
+
if (e.questions.length === 0) return o;
|
|
760
|
+
if (e.resolved) return fe(e);
|
|
761
|
+
let t = e.questions[e.step];
|
|
762
|
+
if (!t) return o;
|
|
763
|
+
let n = e.showError ? e.questionError(t) : void 0, r = !b(t) && (t.type === "multiple" || !e.hideSkip), i = [
|
|
764
|
+
e.questions.length > 1 ? "progress" : "",
|
|
765
|
+
t.description ? "question-description" : "",
|
|
766
|
+
n ? "question-error" : ""
|
|
767
|
+
].filter(Boolean).join(" ") || void 0;
|
|
768
|
+
return a`
|
|
769
|
+
<div class="card" @click=${e.handlers.contentClick}>
|
|
770
|
+
${ve(e, t)}
|
|
771
|
+
<div
|
|
772
|
+
class="body"
|
|
773
|
+
role="group"
|
|
774
|
+
aria-labelledby="question-title"
|
|
775
|
+
aria-describedby=${m(i)}
|
|
776
|
+
>
|
|
777
|
+
${t.type === "single" ? _e(e, t, n) : Q(e, t, n)}
|
|
778
|
+
</div>
|
|
779
|
+
${r ? ye(e, t) : o}
|
|
780
|
+
</div>
|
|
781
|
+
`;
|
|
782
|
+
}
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/components/question-box/question-box.ts
|
|
785
|
+
var $ = class extends n(e, { validSizes: [
|
|
786
|
+
"s",
|
|
787
|
+
"m",
|
|
788
|
+
"l",
|
|
789
|
+
"xl"
|
|
790
|
+
] }) {
|
|
791
|
+
constructor(...e) {
|
|
792
|
+
super(...e), this.questions = [], this.value = {}, this.labels = {}, this.dir = "ltr", this.disabled = !1, this.readonly = !1, this.hideClose = !1, this.hideSkip = !1, this.showChange = !1, this._optionIndicator = "numbers", this._step = 0, this._resolved = !1, this._submitted = !1, this._showError = !1, this.languageResolver = new i(this), this._radioChangeAdvanced = !1, this.multipleChoiceRoving = new r(this, {
|
|
793
|
+
direction: "vertical",
|
|
794
|
+
elements: () => [...this.shadowRoot?.querySelectorAll("luzmo-field-group#options luzmo-checkbox[data-option-index]") ?? []],
|
|
795
|
+
focusInIndex: (e) => {
|
|
796
|
+
let t = e.findIndex((e) => e.checked && !e.disabled);
|
|
797
|
+
return t === -1 ? e.findIndex((e) => !e.disabled) : t;
|
|
798
|
+
},
|
|
799
|
+
isFocusableElement: (e) => !e.disabled,
|
|
800
|
+
listenerScope: () => this.shadowRoot?.querySelector("luzmo-field-group#options")
|
|
801
|
+
}), this.handleKeydown = (e) => {
|
|
802
|
+
if (this.disabled) return;
|
|
803
|
+
let t = e.composedPath(), n = this.shadowRoot?.activeElement;
|
|
804
|
+
if (e.key !== "Escape" && this.otherField && (t.includes(this.otherField) || n === this.otherField)) return;
|
|
805
|
+
let r = this.focusedOptionForEvent(e), i = this.currentQuestion;
|
|
806
|
+
if (i?.type === "multiple" && r && this.multipleChoiceRoving.acceptsEventCode(e.code) && !e.defaultPrevented) {
|
|
807
|
+
let t = this.multipleChoiceRoving.elements.indexOf(r);
|
|
808
|
+
t !== -1 && (this.multipleChoiceRoving.currentIndex = t), this.multipleChoiceRoving.hostContainsFocus(), this.multipleChoiceRoving.handleKeydown(e);
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
if (!this.readonly && e.code === "Space" && r && !r.hasAttribute("disabled")) {
|
|
812
|
+
e.preventDefault();
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
let a = this.optionIndicator === "letters" && /^[a-z]$/i.test(e.key) ? e.key.toUpperCase().charCodeAt(0) - 65 : this.optionIndicator === "numbers" && /^[1-9]$/.test(e.key) ? Number(e.key) - 1 : -1, o = !this.readonly && r && !e.altKey && !e.ctrlKey && !e.metaKey && a >= 0 ? this.shadowRoot?.querySelector(`[data-option-index="${a}"]:not([disabled])`) : void 0;
|
|
816
|
+
if (o) {
|
|
817
|
+
e.preventDefault();
|
|
818
|
+
let t = o.getAttribute("value") ?? o.dataset.value;
|
|
819
|
+
if (i?.type === "single" && t !== "__other__" && this.selectedValues(i)[0] === t) {
|
|
820
|
+
this.advanceAfterSingleSelection();
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
o.click();
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
e.key === "Escape" && (e.preventDefault(), !this.disabled && this.cancel());
|
|
827
|
+
}, this.handleKeyup = (e) => {
|
|
828
|
+
if (this.disabled || this.readonly || e.code !== "Space") return;
|
|
829
|
+
let t = this.focusedOptionForEvent(e);
|
|
830
|
+
!t || t.hasAttribute("disabled") || (e.preventDefault(), t.click());
|
|
831
|
+
}, this.handleFocusIn = (e) => {
|
|
832
|
+
let t = this.focusedOptionForEvent(e);
|
|
833
|
+
this.markKeyboardFocus(t && this.optionShowsKeyboardFocus(t) ? t : void 0);
|
|
834
|
+
}, this.handleContentClick = (e) => {
|
|
835
|
+
this.disabled || e.composedPath().some((e) => e instanceof Element && e.matches("a[href], button, input, select, textarea, [contenteditable=\"true\"], [data-option-index], #other-field, luzmo-action-button, luzmo-button, luzmo-close-button")) || this.focusOptions();
|
|
836
|
+
}, this.handleFocusOut = () => {
|
|
837
|
+
requestAnimationFrame(() => {
|
|
838
|
+
let e = this.shadowRoot?.activeElement;
|
|
839
|
+
(!(e instanceof HTMLElement) || e.dataset.optionIndex === void 0) && this.markKeyboardFocus();
|
|
840
|
+
});
|
|
841
|
+
}, this.handleCancelClick = (e) => {
|
|
842
|
+
e.preventDefault(), this.cancel();
|
|
843
|
+
}, this.handleSkip = (e) => {
|
|
844
|
+
e.preventDefault(), !this.disabled && this.emitResult("decline");
|
|
845
|
+
}, this.handleBack = (e) => {
|
|
846
|
+
e.preventDefault(), !(this.disabled || this._step === 0) && (this._showError = !1, --this._step, this.updateComplete.then(() => this.moveFocus(this.questionTitle)));
|
|
847
|
+
}, this.handlePrimary = () => {
|
|
848
|
+
let e = this.currentQuestion;
|
|
849
|
+
if (!(!e || this.disabled || this.readonly)) {
|
|
850
|
+
if (this.questionInvalid(e)) {
|
|
851
|
+
this._showError = !0, this.focusOptions();
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
if (this._showError = !1, this._step < this.questions.length - 1) {
|
|
855
|
+
this._step += 1, this.updateComplete.then(() => this.moveFocus(this.questionTitle));
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
this.acceptFlow();
|
|
859
|
+
}
|
|
860
|
+
}, this.handleChange = () => {
|
|
861
|
+
this._resolved = !1, this._submitted = !1, this._showError = !1, this.updateComplete.then(() => this.focusOptions());
|
|
862
|
+
}, this.handleRadioChange = (e) => {
|
|
863
|
+
if (e.stopPropagation(), this.disabled || this.readonly) return;
|
|
864
|
+
let t = this.currentQuestion;
|
|
865
|
+
if (!t) return;
|
|
866
|
+
let n = e.target.value || e.currentTarget.selected;
|
|
867
|
+
if (n) {
|
|
868
|
+
if (n === "__other__" && !String(this.value[y(t.id)] ?? "").trim()) {
|
|
869
|
+
this.requestUpdate(), this.updateComplete.then(() => this.moveFocus(this.otherField));
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
this.commitAnswer(t.id, n, !0), n !== "__other__" && (this._radioChangeAdvanced = !0, this.advanceAfterSingleSelection(), queueMicrotask(() => {
|
|
873
|
+
this._radioChangeAdvanced = !1;
|
|
874
|
+
}));
|
|
875
|
+
}
|
|
876
|
+
}, this.handleRadioClick = (e) => {
|
|
877
|
+
if (this._radioChangeAdvanced || this.disabled || this.readonly) return;
|
|
878
|
+
let t = this.currentQuestion, n = e.currentTarget;
|
|
879
|
+
t?.type === "single" && n.value !== "__other__" && this.selectedValues(t)[0] === n.value && this.advanceAfterSingleSelection();
|
|
880
|
+
}, this.handleCheckboxChange = (e) => {
|
|
881
|
+
if (e.stopPropagation(), this.disabled || this.readonly) return;
|
|
882
|
+
let t = this.currentQuestion;
|
|
883
|
+
if (!t) return;
|
|
884
|
+
let n = e.currentTarget, r = n.dataset.value;
|
|
885
|
+
if (!r) return;
|
|
886
|
+
let i = new Set(this.selectedValues(t));
|
|
887
|
+
if (r === "__other__" && n.checked && !String(this.value[y(t.id)] ?? "").trim()) {
|
|
888
|
+
n.checked = !1, this.moveFocus(this.otherField);
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
n.checked ? i.add(r) : i.delete(r);
|
|
892
|
+
let a = [...t.options.map((e) => e.value), ...b(t) ? [_] : []].filter((e) => i.has(e));
|
|
893
|
+
this.commitAnswer(t.id, T(a), !0), r === "__other__" && n.checked && this.updateComplete.then(() => this.moveFocus(this.otherField));
|
|
894
|
+
}, this.handleOtherInput = (e) => {
|
|
895
|
+
if (e.stopPropagation(), this.disabled || this.readonly) return;
|
|
896
|
+
let t = this.currentQuestion;
|
|
897
|
+
if (!t) return;
|
|
898
|
+
let n = e.currentTarget;
|
|
899
|
+
this.commitOther(t, n.value, !1);
|
|
900
|
+
}, this.handleOtherChange = (e) => {
|
|
901
|
+
if (e.stopPropagation(), this.disabled || this.readonly) return;
|
|
902
|
+
let t = this.currentQuestion;
|
|
903
|
+
if (!t) return;
|
|
904
|
+
let n = e.currentTarget;
|
|
905
|
+
this.commitOther(t, n.value, !0);
|
|
906
|
+
}, this.handleOtherKeydown = (e) => {
|
|
907
|
+
if (e.key !== "Enter" || e.shiftKey || e.isComposing || this.disabled || this.readonly) return;
|
|
908
|
+
e.preventDefault();
|
|
909
|
+
let t = this.currentQuestion;
|
|
910
|
+
t && String(this.value[y(t.id)] ?? "").trim() && this.handlePrimary();
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
static get styles() {
|
|
914
|
+
let e = super.styles;
|
|
915
|
+
return [...Array.isArray(e) ? e : e ? [e] : [], s(g)];
|
|
916
|
+
}
|
|
917
|
+
get optionIndicator() {
|
|
918
|
+
return this._optionIndicator;
|
|
919
|
+
}
|
|
920
|
+
set optionIndicator(e) {
|
|
921
|
+
let t = this._optionIndicator;
|
|
922
|
+
this._optionIndicator = e === "letters" ? "letters" : "numbers", this.requestUpdate("optionIndicator", t);
|
|
923
|
+
}
|
|
924
|
+
connectedCallback() {
|
|
925
|
+
super.connectedCallback(), this.addEventListener("keydown", this.handleKeydown), this.addEventListener("keyup", this.handleKeyup), this.addEventListener("focusin", this.handleFocusIn);
|
|
926
|
+
}
|
|
927
|
+
attributeChangedCallback(e, t, n) {
|
|
928
|
+
if (e === "option-indicator" && n !== null && n !== "numbers" && n !== "letters") {
|
|
929
|
+
this.setAttribute("option-indicator", "numbers");
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
super.attributeChangedCallback(e, t, n);
|
|
933
|
+
}
|
|
934
|
+
disconnectedCallback() {
|
|
935
|
+
this.removeEventListener("keydown", this.handleKeydown), this.removeEventListener("keyup", this.handleKeyup), this.removeEventListener("focusin", this.handleFocusIn), super.disconnectedCallback();
|
|
936
|
+
}
|
|
937
|
+
focus() {
|
|
938
|
+
if (this._resolved) {
|
|
939
|
+
this.moveFocus(this.resolvedTitle);
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
this.focusOptions();
|
|
943
|
+
}
|
|
944
|
+
checkValidity() {
|
|
945
|
+
return this.questions.every((e) => !this.questionInvalid(e));
|
|
946
|
+
}
|
|
947
|
+
submit() {
|
|
948
|
+
this.disabled || this.readonly || this._submitted || this.acceptFlow();
|
|
949
|
+
}
|
|
950
|
+
reset() {
|
|
951
|
+
this._resolved = !1, this._submitted = !1, this._showError = !1, this._step = 0, this.value = {};
|
|
952
|
+
}
|
|
953
|
+
cancel() {
|
|
954
|
+
this.emitResult("cancel");
|
|
955
|
+
}
|
|
956
|
+
willUpdate(e) {
|
|
957
|
+
if (super.willUpdate(e), e.has("questions") || e.has("value")) {
|
|
958
|
+
if (e.has("questions")) {
|
|
959
|
+
A(this.questions);
|
|
960
|
+
let t = (e.get("questions") ?? []).map((e) => e.id), n = this.questions.map((e) => e.id);
|
|
961
|
+
t.join("\0") !== n.join("\0") && (this._step = 0, this._resolved = !1, this._submitted = !1, this._showError = !1);
|
|
962
|
+
}
|
|
963
|
+
let t = j(this.questions, this.value);
|
|
964
|
+
w(t, this.value) || (this.value = t);
|
|
965
|
+
}
|
|
966
|
+
e.has("questions") && (this._step = Math.min(this._step, Math.max(0, this.questions.length - 1)));
|
|
967
|
+
}
|
|
968
|
+
updated(e) {
|
|
969
|
+
super.updated(e), (e.has("questions") || e.has("size") || e.has("disabled") || e.has("readonly") || e.has("_step") || e.has("_resolved")) && this.multipleChoiceRoving.clearElementCache();
|
|
970
|
+
}
|
|
971
|
+
render() {
|
|
972
|
+
return be(this.renderContext);
|
|
973
|
+
}
|
|
974
|
+
get renderContext() {
|
|
975
|
+
return {
|
|
976
|
+
questions: this.questions,
|
|
977
|
+
value: this.value,
|
|
978
|
+
copy: this.copy,
|
|
979
|
+
step: this._step,
|
|
980
|
+
resolved: this._resolved,
|
|
981
|
+
submitted: this._submitted,
|
|
982
|
+
showError: this._showError,
|
|
983
|
+
disabled: this.disabled,
|
|
984
|
+
readonly: this.readonly,
|
|
985
|
+
hideClose: this.hideClose,
|
|
986
|
+
hideSkip: this.hideSkip,
|
|
987
|
+
showChange: this.showChange,
|
|
988
|
+
optionIndicator: this.optionIndicator,
|
|
989
|
+
size: this.size,
|
|
990
|
+
dir: this.dir,
|
|
991
|
+
language: this.languageResolver.language,
|
|
992
|
+
selectedValues: (e) => this.selectedValues(e),
|
|
993
|
+
isOtherSelected: (e) => this.isOtherSelected(e),
|
|
994
|
+
questionError: (e) => this.questionError(e),
|
|
995
|
+
questionInvalid: (e) => this.questionInvalid(e),
|
|
996
|
+
optionDisabled: (e, t, n) => this.optionDisabled(e, t, n),
|
|
997
|
+
handlers: this.renderHandlers
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
get renderHandlers() {
|
|
1001
|
+
return {
|
|
1002
|
+
contentClick: this.handleContentClick,
|
|
1003
|
+
back: this.handleBack,
|
|
1004
|
+
primary: this.handlePrimary,
|
|
1005
|
+
skip: this.handleSkip,
|
|
1006
|
+
cancel: this.handleCancelClick,
|
|
1007
|
+
change: this.handleChange,
|
|
1008
|
+
radioChange: this.handleRadioChange,
|
|
1009
|
+
radioClick: this.handleRadioClick,
|
|
1010
|
+
checkboxChange: this.handleCheckboxChange,
|
|
1011
|
+
otherInput: this.handleOtherInput,
|
|
1012
|
+
otherChange: this.handleOtherChange,
|
|
1013
|
+
otherKeydown: this.handleOtherKeydown,
|
|
1014
|
+
focusIn: this.handleFocusIn,
|
|
1015
|
+
focusOut: this.handleFocusOut
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
get copy() {
|
|
1019
|
+
return ee(this.labels);
|
|
1020
|
+
}
|
|
1021
|
+
get currentQuestion() {
|
|
1022
|
+
return this.questions[this._step];
|
|
1023
|
+
}
|
|
1024
|
+
optionShowsKeyboardFocus(e) {
|
|
1025
|
+
let t = (e) => {
|
|
1026
|
+
if (!e) return !1;
|
|
1027
|
+
try {
|
|
1028
|
+
return e.matches(":focus-visible") || e.matches(".focus-visible");
|
|
1029
|
+
} catch {
|
|
1030
|
+
return e.matches(".focus-visible");
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
return t(e) || t(e.shadowRoot?.activeElement) || this.hasVisibleFocusInTree();
|
|
1034
|
+
}
|
|
1035
|
+
markKeyboardFocus(e) {
|
|
1036
|
+
this.shadowRoot?.querySelectorAll("[data-focus-visible]").forEach((e) => delete e.dataset.focusVisible), this.shadowRoot?.querySelectorAll(".option-number--focused").forEach((e) => e.classList.remove("option-number--focused")), e && (e.dataset.focusVisible = "", e.querySelector(".option-number")?.classList.add("option-number--focused"));
|
|
1037
|
+
}
|
|
1038
|
+
focusedOptionForEvent(e) {
|
|
1039
|
+
let t = e.composedPath().find((e) => e instanceof HTMLElement && e.dataset.optionIndex !== void 0);
|
|
1040
|
+
if (t) return t;
|
|
1041
|
+
let n = this.shadowRoot?.activeElement;
|
|
1042
|
+
return n instanceof HTMLElement && n.dataset.optionIndex !== void 0 ? n : void 0;
|
|
1043
|
+
}
|
|
1044
|
+
moveFocus(e) {
|
|
1045
|
+
if (e) try {
|
|
1046
|
+
e.focus();
|
|
1047
|
+
} catch {
|
|
1048
|
+
try {
|
|
1049
|
+
HTMLElement.prototype.focus.call(e);
|
|
1050
|
+
} catch {
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
focusOptions() {
|
|
1056
|
+
let e = this.optionsGroup;
|
|
1057
|
+
if (!e) {
|
|
1058
|
+
this.moveFocus(this.questionTitle);
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
let t = this.currentQuestion, n = t?.type === "single" ? this.selectedValues(t)[0] : void 0, r = n ? e.querySelector(`luzmo-radio[value="${CSS.escape(n)}"]:not([disabled])`) : void 0, i = e.querySelector("[data-option-index]:not([disabled])");
|
|
1062
|
+
this.moveFocus(r ?? i ?? e);
|
|
1063
|
+
}
|
|
1064
|
+
advanceAfterSingleSelection() {
|
|
1065
|
+
if (this._step < this.questions.length - 1) {
|
|
1066
|
+
this._step += 1, this.updateComplete.then(() => this.moveFocus(this.questionTitle));
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
this._resolved = !0, this._submitted = !1, this.updateComplete.then(() => this.focus());
|
|
1070
|
+
}
|
|
1071
|
+
acceptFlow() {
|
|
1072
|
+
let e = this.questions.findIndex((e) => this.questionInvalid(e));
|
|
1073
|
+
if (e !== -1) {
|
|
1074
|
+
this._step = e, this._showError = !0, this.updateComplete.then(() => this.focusOptions());
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
this._showError = !1, this._resolved = !0, this._submitted = !0, this.emitResult("accept", R(this.questions, this.value)), this.updateComplete.then(() => this.focus());
|
|
1078
|
+
}
|
|
1079
|
+
commitAnswer(e, t, n) {
|
|
1080
|
+
let r = S(this.value);
|
|
1081
|
+
C(r, e, t), this.assignValue(r, n);
|
|
1082
|
+
}
|
|
1083
|
+
commitOther(e, t, n) {
|
|
1084
|
+
let r = S(this.value);
|
|
1085
|
+
C(r, y(e.id), t);
|
|
1086
|
+
let i = t.trim().length > 0;
|
|
1087
|
+
if (e.type === "single") i ? C(r, e.id, _) : r[e.id] === "__other__" && C(r, e.id, "");
|
|
1088
|
+
else {
|
|
1089
|
+
let t = new Set(this.selectedValues(e));
|
|
1090
|
+
i ? t.add(_) : t.delete(_), C(r, e.id, [...e.options.map((e) => e.value), _].filter((e) => t.has(e)));
|
|
1091
|
+
}
|
|
1092
|
+
this.assignValue(r, n);
|
|
1093
|
+
}
|
|
1094
|
+
assignValue(e, t) {
|
|
1095
|
+
w(e, this.value) || (this.value = e, this.dispatchEvent(new Event("input", {
|
|
1096
|
+
bubbles: !0,
|
|
1097
|
+
composed: !0
|
|
1098
|
+
}))), t && this.dispatchEvent(new Event("change", {
|
|
1099
|
+
bubbles: !0,
|
|
1100
|
+
composed: !0
|
|
1101
|
+
}));
|
|
1102
|
+
}
|
|
1103
|
+
emitResult(e, t) {
|
|
1104
|
+
let n = e === "accept" ? {
|
|
1105
|
+
action: e,
|
|
1106
|
+
content: t
|
|
1107
|
+
} : { action: e };
|
|
1108
|
+
if (e === "accept") {
|
|
1109
|
+
this.dispatchEvent(new CustomEvent("luzmo-submit", {
|
|
1110
|
+
detail: n,
|
|
1111
|
+
bubbles: !0,
|
|
1112
|
+
composed: !0
|
|
1113
|
+
}));
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
if (e === "decline") {
|
|
1117
|
+
this.dispatchEvent(new CustomEvent("luzmo-decline", {
|
|
1118
|
+
detail: n,
|
|
1119
|
+
bubbles: !0,
|
|
1120
|
+
composed: !0
|
|
1121
|
+
}));
|
|
1122
|
+
return;
|
|
1123
|
+
}
|
|
1124
|
+
this.dispatchEvent(new CustomEvent("luzmo-cancel", {
|
|
1125
|
+
detail: n,
|
|
1126
|
+
bubbles: !0,
|
|
1127
|
+
composed: !0
|
|
1128
|
+
}));
|
|
1129
|
+
}
|
|
1130
|
+
selectedValues(e) {
|
|
1131
|
+
return D(e, this.value);
|
|
1132
|
+
}
|
|
1133
|
+
isOtherSelected(e) {
|
|
1134
|
+
return O(e, this.value);
|
|
1135
|
+
}
|
|
1136
|
+
questionError(e) {
|
|
1137
|
+
return ne(e, this.value, this.copy);
|
|
1138
|
+
}
|
|
1139
|
+
questionInvalid(e) {
|
|
1140
|
+
return te(e, this.value);
|
|
1141
|
+
}
|
|
1142
|
+
optionDisabled(e, t, n) {
|
|
1143
|
+
return re(e, t, n, this.value, this.disabled);
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
//#endregion
|
|
1147
|
+
//#region src/components/question-box/index.ts
|
|
1148
|
+
t([c({ attribute: !1 })], $.prototype, "questions", void 0), t([c({ attribute: !1 })], $.prototype, "value", void 0), t([c({ attribute: !1 })], $.prototype, "labels", void 0), t([c({ reflect: !0 })], $.prototype, "dir", void 0), t([c({
|
|
1149
|
+
type: Boolean,
|
|
1150
|
+
reflect: !0
|
|
1151
|
+
})], $.prototype, "disabled", void 0), t([c({
|
|
1152
|
+
type: Boolean,
|
|
1153
|
+
reflect: !0
|
|
1154
|
+
})], $.prototype, "readonly", void 0), t([c({
|
|
1155
|
+
type: Boolean,
|
|
1156
|
+
reflect: !0,
|
|
1157
|
+
attribute: "hide-close"
|
|
1158
|
+
})], $.prototype, "hideClose", void 0), t([c({
|
|
1159
|
+
type: Boolean,
|
|
1160
|
+
reflect: !0,
|
|
1161
|
+
attribute: "hide-skip"
|
|
1162
|
+
})], $.prototype, "hideSkip", void 0), t([c({
|
|
1163
|
+
type: Boolean,
|
|
1164
|
+
reflect: !0,
|
|
1165
|
+
attribute: "show-change"
|
|
1166
|
+
})], $.prototype, "showChange", void 0), t([c({
|
|
1167
|
+
reflect: !0,
|
|
1168
|
+
attribute: "option-indicator"
|
|
1169
|
+
})], $.prototype, "optionIndicator", null), t([u()], $.prototype, "_step", void 0), t([u()], $.prototype, "_resolved", void 0), t([u()], $.prototype, "_submitted", void 0), t([u()], $.prototype, "_showError", void 0), t([l("#question-title")], $.prototype, "questionTitle", void 0), t([l("#other-field")], $.prototype, "otherField", void 0), t([l("#options")], $.prototype, "optionsGroup", void 0), t([l("#resolved-title")], $.prototype, "resolvedTitle", void 0), typeof customElements < "u" && !customElements.get("luzmo-question-box") && customElements.define("luzmo-question-box", $);
|
|
1170
|
+
//#endregion
|
|
1171
|
+
export { v as a, R as i, I as n, _ as o, le as r, y as s, $ as t };
|