@televet/kibble-ui 4.0.1 → 5.0.0-beta.hotfix.1
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/dist/chunks/alert.types-BKSqs9qY.js +2 -0
- package/dist/chunks/alert.types-BKSqs9qY.js.map +1 -0
- package/dist/chunks/alert.types-C_ygg7fh.js +141 -0
- package/dist/chunks/alert.types-C_ygg7fh.js.map +1 -0
- package/dist/chunks/anatomy-BkGk10kB.js +2 -0
- package/dist/chunks/anatomy-BkGk10kB.js.map +1 -0
- package/dist/chunks/anatomy-zd4ecEFD.js +280 -0
- package/dist/chunks/anatomy-zd4ecEFD.js.map +1 -0
- package/dist/chunks/avatar.component-B1HGlwVW.js +2 -0
- package/dist/chunks/avatar.component-B1HGlwVW.js.map +1 -0
- package/dist/chunks/avatar.component-C-365mx3.js +404 -0
- package/dist/chunks/avatar.component-C-365mx3.js.map +1 -0
- package/dist/chunks/avatar.records-CxLCvZfG.js +2 -0
- package/dist/chunks/avatar.records-CxLCvZfG.js.map +1 -0
- package/dist/chunks/{index-Cv06PsSJ.js → avatar.records-EoZmO3VR.js} +21 -13
- package/dist/chunks/avatar.records-EoZmO3VR.js.map +1 -0
- package/dist/chunks/avatarGroup.component-B-ZOhj7i.js +75 -0
- package/dist/chunks/avatarGroup.component-B-ZOhj7i.js.map +1 -0
- package/dist/chunks/avatarGroup.component-CTBfGiSm.js +2 -0
- package/dist/chunks/avatarGroup.component-CTBfGiSm.js.map +1 -0
- package/dist/chunks/button.component-BO6oee_V.js +69 -0
- package/dist/chunks/button.component-BO6oee_V.js.map +1 -0
- package/dist/chunks/button.component-DjdgBXDC.js +2 -0
- package/dist/chunks/button.component-DjdgBXDC.js.map +1 -0
- package/dist/chunks/button.recipe-Bb0lptGi.js +613 -0
- package/dist/chunks/button.recipe-Bb0lptGi.js.map +1 -0
- package/dist/chunks/button.recipe-flk0XJTS.js +2 -0
- package/dist/chunks/button.recipe-flk0XJTS.js.map +1 -0
- package/dist/chunks/button.types-3lHElsln.js +2 -0
- package/dist/chunks/button.types-3lHElsln.js.map +1 -0
- package/dist/chunks/{button.types-BKXZNvN1.js → button.types-C9PpvmYR.js} +14 -9
- package/dist/chunks/button.types-C9PpvmYR.js.map +1 -0
- package/dist/chunks/buttonGroup.component-CowJsbr7.js +2 -0
- package/dist/chunks/buttonGroup.component-CowJsbr7.js.map +1 -0
- package/dist/chunks/buttonGroup.component-DUK2FgFn.js +70 -0
- package/dist/chunks/buttonGroup.component-DUK2FgFn.js.map +1 -0
- package/dist/chunks/calendar.component-CHIhplfO.js +18 -0
- package/dist/chunks/calendar.component-CHIhplfO.js.map +1 -0
- package/dist/chunks/calendar.component-tOoK1NrU.js +2 -0
- package/dist/chunks/calendar.component-tOoK1NrU.js.map +1 -0
- package/dist/chunks/card.component-B1AznjWF.js +55 -0
- package/dist/chunks/card.component-B1AznjWF.js.map +1 -0
- package/dist/chunks/card.component-BmBiYbMV.js +2 -0
- package/dist/chunks/card.component-BmBiYbMV.js.map +1 -0
- package/dist/chunks/center-Dmlzv1BW.js +20 -0
- package/dist/chunks/center-Dmlzv1BW.js.map +1 -0
- package/dist/chunks/center-kk61ArhQ.js +2 -0
- package/dist/chunks/center-kk61ArhQ.js.map +1 -0
- package/dist/chunks/characterCounter.component-CKDigkoD.js +2 -0
- package/dist/chunks/characterCounter.component-CKDigkoD.js.map +1 -0
- package/dist/chunks/characterCounter.component-Ch3P3GqC.js +82 -0
- package/dist/chunks/characterCounter.component-Ch3P3GqC.js.map +1 -0
- package/dist/chunks/{checkbox.anatomy-DC8fJdkY.js → checkbox.anatomy-BzZ0IkUF.js} +22 -22
- package/dist/chunks/{checkbox.anatomy-DC8fJdkY.js.map → checkbox.anatomy-BzZ0IkUF.js.map} +1 -1
- package/dist/chunks/{checkbox.anatomy-BNdLT4Qf.js → checkbox.anatomy-DM39E2Q9.js} +2 -2
- package/dist/chunks/{checkbox.anatomy-BNdLT4Qf.js.map → checkbox.anatomy-DM39E2Q9.js.map} +1 -1
- package/dist/chunks/checkbox.component-CiA3Z1zR.js +2 -0
- package/dist/chunks/{checkbox.component-DNOkXggb.js.map → checkbox.component-CiA3Z1zR.js.map} +1 -1
- package/dist/chunks/checkbox.component-DE35wBj-.js +269 -0
- package/dist/chunks/{checkbox.component-Dhjcu89D.js.map → checkbox.component-DE35wBj-.js.map} +1 -1
- package/dist/chunks/checkboxGroup.component-BGBd-roJ.js +2 -0
- package/dist/chunks/checkboxGroup.component-BGBd-roJ.js.map +1 -0
- package/dist/chunks/checkboxGroup.component-CYwGlktu.js +53 -0
- package/dist/chunks/checkboxGroup.component-CYwGlktu.js.map +1 -0
- package/dist/chunks/{config-B3QABP1-.js → config-Djkl1N81.js} +4 -4
- package/dist/chunks/{config-B3QABP1-.js.map → config-Djkl1N81.js.map} +1 -1
- package/dist/chunks/conversationCard.component-BrDGshOG.js +2 -0
- package/dist/chunks/conversationCard.component-BrDGshOG.js.map +1 -0
- package/dist/chunks/conversationCard.component-CMdqD3yN.js +331 -0
- package/dist/chunks/conversationCard.component-CMdqD3yN.js.map +1 -0
- package/dist/chunks/{create-recipe-context-CrEKmpj8.js → create-recipe-context-DfQ-MTih.js} +9 -9
- package/dist/chunks/{create-recipe-context-CrEKmpj8.js.map → create-recipe-context-DfQ-MTih.js.map} +1 -1
- package/dist/chunks/create-slot-recipe-context-D_FXDJGp.js +104 -0
- package/dist/chunks/create-slot-recipe-context-D_FXDJGp.js.map +1 -0
- package/dist/chunks/create-slot-recipe-context-HXE1VazG.js +2 -0
- package/dist/chunks/create-slot-recipe-context-HXE1VazG.js.map +1 -0
- package/dist/chunks/datePicker.component-C6cD1_HR.js +2 -0
- package/dist/chunks/datePicker.component-C6cD1_HR.js.map +1 -0
- package/dist/chunks/datePicker.component-eHU7IZgC.js +166 -0
- package/dist/chunks/datePicker.component-eHU7IZgC.js.map +1 -0
- package/dist/chunks/datePicker.provider-BWHE-9FA.js +3009 -0
- package/dist/chunks/datePicker.provider-BWHE-9FA.js.map +1 -0
- package/dist/chunks/datePicker.provider-DgarjPPd.js +15 -0
- package/dist/chunks/datePicker.provider-DgarjPPd.js.map +1 -0
- package/dist/chunks/dateTimePicker.component-Byjxg2lJ.js +317 -0
- package/dist/chunks/dateTimePicker.component-Byjxg2lJ.js.map +1 -0
- package/dist/chunks/dateTimePicker.component-REz9iX4S.js +2 -0
- package/dist/chunks/dateTimePicker.component-REz9iX4S.js.map +1 -0
- package/dist/chunks/{dialog-C51vaoYf.js → dialog-B9jifvV4.js} +37 -36
- package/dist/chunks/{dialog-C51vaoYf.js.map → dialog-B9jifvV4.js.map} +1 -1
- package/dist/chunks/dialog-CZFwddWp.js +2 -0
- package/dist/chunks/{dialog-BPhjKQkb.js.map → dialog-CZFwddWp.js.map} +1 -1
- package/dist/chunks/divider.component-BX3zyB7O.js +2 -0
- package/dist/chunks/divider.component-BX3zyB7O.js.map +1 -0
- package/dist/chunks/divider.component-CFOh4Nw3.js +45 -0
- package/dist/chunks/divider.component-CFOh4Nw3.js.map +1 -0
- package/dist/chunks/divider.types-6MEkMNbx.js +7 -0
- package/dist/chunks/divider.types-6MEkMNbx.js.map +1 -0
- package/dist/chunks/divider.types-DBNcs0IR.js +2 -0
- package/dist/chunks/divider.types-DBNcs0IR.js.map +1 -0
- package/dist/chunks/{empty-BU2EAux9.js → empty-DNH84khx.js} +3 -3
- package/dist/chunks/{empty-BU2EAux9.js.map → empty-DNH84khx.js.map} +1 -1
- package/dist/chunks/field.anatomy-Bhj7Mlr7.js +2 -0
- package/dist/chunks/field.anatomy-Bhj7Mlr7.js.map +1 -0
- package/dist/chunks/field.anatomy-C37GEr2p.js +16 -0
- package/dist/chunks/field.anatomy-C37GEr2p.js.map +1 -0
- package/dist/chunks/{format-BRt-TIiQ.js → format-CK7Imh-5.js} +2 -2
- package/dist/chunks/{format-BRt-TIiQ.js.map → format-CK7Imh-5.js.map} +1 -1
- package/dist/chunks/{format-DgHM6wFr.js → format-CqTHHSak.js} +3 -1
- package/dist/chunks/{format-DgHM6wFr.js.map → format-CqTHHSak.js.map} +1 -1
- package/dist/chunks/grid-item-BmCSQ38y.js +78 -0
- package/dist/chunks/grid-item-BmCSQ38y.js.map +1 -0
- package/dist/chunks/grid-item-CH3dbZHL.js +2 -0
- package/dist/chunks/grid-item-CH3dbZHL.js.map +1 -0
- package/dist/chunks/heading.component-7ikcgDco.js +18 -0
- package/dist/chunks/heading.component-7ikcgDco.js.map +1 -0
- package/dist/chunks/heading.component-DMAQO_-m.js +2 -0
- package/dist/chunks/heading.component-DMAQO_-m.js.map +1 -0
- package/dist/chunks/{icon-button-5UcFiA_W.js → icon-button-CcZMCNUJ.js} +3 -3
- package/dist/chunks/{icon-button-5UcFiA_W.js.map → icon-button-CcZMCNUJ.js.map} +1 -1
- package/dist/chunks/icon.component-B1hr5lLa.js +2 -0
- package/dist/chunks/icon.component-B1hr5lLa.js.map +1 -0
- package/dist/chunks/icon.component-PV_nHBId.js +32 -0
- package/dist/chunks/icon.component-PV_nHBId.js.map +1 -0
- package/dist/chunks/{icons-DQ5FafZQ.js → icons-CoSqruIn.js} +5 -5
- package/dist/chunks/{icons-DQ5FafZQ.js.map → icons-CoSqruIn.js.map} +1 -1
- package/dist/chunks/index-B-OGBT0w.js +2 -0
- package/dist/chunks/{index-BEfEzWJx.js.map → index-B-OGBT0w.js.map} +1 -1
- package/dist/chunks/index-B3xJnxjd.js +371 -0
- package/dist/chunks/index-B3xJnxjd.js.map +1 -0
- package/dist/chunks/index-BFUdiDZp.js +2 -0
- package/dist/chunks/{index-2glJ2faJ.js.map → index-BFUdiDZp.js.map} +1 -1
- package/dist/chunks/{index-CVJXrcei.js → index-BGd_2-DY.js} +29 -27
- package/dist/chunks/{index-CVJXrcei.js.map → index-BGd_2-DY.js.map} +1 -1
- package/dist/chunks/index-BXv9lkZC.js +4 -0
- package/dist/chunks/index-BXv9lkZC.js.map +1 -0
- package/dist/chunks/index-BbZjRFzg.js +265 -0
- package/dist/chunks/index-BbZjRFzg.js.map +1 -0
- package/dist/chunks/{index-CYXurbh4.js → index-BgFImxxe.js} +27 -25
- package/dist/chunks/{index-CYXurbh4.js.map → index-BgFImxxe.js.map} +1 -1
- package/dist/chunks/index-BoulS5Zg.js +2 -0
- package/dist/chunks/index-BoulS5Zg.js.map +1 -0
- package/dist/chunks/index-BrJtqTzN.js +4115 -0
- package/dist/chunks/index-BrJtqTzN.js.map +1 -0
- package/dist/chunks/index-C9UYIjEB.js +1584 -0
- package/dist/chunks/index-C9UYIjEB.js.map +1 -0
- package/dist/chunks/index-CQURjLlA.js +3 -0
- package/dist/chunks/index-CQURjLlA.js.map +1 -0
- package/dist/chunks/{index-BXJJKHzT.js → index-CbVKVxMW.js} +54 -52
- package/dist/chunks/{index-BXJJKHzT.js.map → index-CbVKVxMW.js.map} +1 -1
- package/dist/chunks/{index-CWhDtS-n.js → index-Cxrrsmf-.js} +17 -16
- package/dist/chunks/{index-CWhDtS-n.js.map → index-Cxrrsmf-.js.map} +1 -1
- package/dist/chunks/{index-BZBgTxer.js → index-D0DKQnEK.js} +11 -11
- package/dist/chunks/{index-BZBgTxer.js.map → index-D0DKQnEK.js.map} +1 -1
- package/dist/chunks/index-D1RhzPVz.js +984 -0
- package/dist/chunks/index-D1RhzPVz.js.map +1 -0
- package/dist/chunks/index-D3Q0mQNf.js +325 -0
- package/dist/chunks/index-D3Q0mQNf.js.map +1 -0
- package/dist/chunks/index-D6HBfqAu.js +2 -0
- package/dist/chunks/index-D6HBfqAu.js.map +1 -0
- package/dist/chunks/index-D6c4fMjg.js +2 -0
- package/dist/chunks/index-D6c4fMjg.js.map +1 -0
- package/dist/chunks/{index-CfqoBQoP.js → index-D7QT9KIZ.js} +9 -9
- package/dist/chunks/{index-CfqoBQoP.js.map → index-D7QT9KIZ.js.map} +1 -1
- package/dist/chunks/{index-WYcfOUFA.js → index-DIszpWqO.js} +2 -2
- package/dist/chunks/{index-WYcfOUFA.js.map → index-DIszpWqO.js.map} +1 -1
- package/dist/chunks/{index-D0HCo_Ly.js → index-DLe40do7.js} +2 -2
- package/dist/chunks/{index-D0HCo_Ly.js.map → index-DLe40do7.js.map} +1 -1
- package/dist/chunks/index-DS4KlAkI.js +371 -0
- package/dist/chunks/index-DS4KlAkI.js.map +1 -0
- package/dist/chunks/{index-nNZWP0FQ.js → index-DTVestnf.js} +2 -2
- package/dist/chunks/{index-nNZWP0FQ.js.map → index-DTVestnf.js.map} +1 -1
- package/dist/chunks/index-DVyODQn6.js +8 -0
- package/dist/chunks/index-DVyODQn6.js.map +1 -0
- package/dist/chunks/index-D_vndwae.js +3 -0
- package/dist/chunks/index-D_vndwae.js.map +1 -0
- package/dist/chunks/index-DfzXSlq1.js +2477 -0
- package/dist/chunks/index-DfzXSlq1.js.map +1 -0
- package/dist/chunks/{index-BhSvtzbY.js → index-QVc_GVoE.js} +13 -13
- package/dist/chunks/{index-BhSvtzbY.js.map → index-QVc_GVoE.js.map} +1 -1
- package/dist/chunks/index-Ts8g8jZd.js +2 -0
- package/dist/chunks/index-Ts8g8jZd.js.map +1 -0
- package/dist/chunks/index-_913FPya.js +2 -0
- package/dist/chunks/{index-A_vmTNU7.js.map → index-_913FPya.js.map} +1 -1
- package/dist/chunks/index-fHSGm2nC.js +1044 -0
- package/dist/chunks/index-fHSGm2nC.js.map +1 -0
- package/dist/chunks/{index-eNFIsSpE.js → index-kpOEHtZZ.js} +2 -2
- package/dist/chunks/{index-eNFIsSpE.js.map → index-kpOEHtZZ.js.map} +1 -1
- package/dist/chunks/index-rSq6Bry6.js +2 -0
- package/dist/chunks/{index-DAI6_P9H.js.map → index-rSq6Bry6.js.map} +1 -1
- package/dist/chunks/{index-BhPrz8Zu.js → index-wV4hG2vI.js} +19 -19
- package/dist/chunks/{index-BhPrz8Zu.js.map → index-wV4hG2vI.js.map} +1 -1
- package/dist/chunks/index-yh2QitBe.js +2 -0
- package/dist/chunks/index-yh2QitBe.js.map +1 -0
- package/dist/chunks/input-group-CFelIL63.js +78 -0
- package/dist/chunks/input-group-CFelIL63.js.map +1 -0
- package/dist/chunks/input-group-DUdSDk4o.js +2 -0
- package/dist/chunks/input-group-DUdSDk4o.js.map +1 -0
- package/dist/chunks/isToday-BgNkHh5t.js +2 -0
- package/dist/chunks/isToday-BgNkHh5t.js.map +1 -0
- package/dist/chunks/isToday-iCYsPDMT.js +23 -0
- package/dist/chunks/isToday-iCYsPDMT.js.map +1 -0
- package/dist/chunks/link.component--URNKuK2.js +44 -0
- package/dist/chunks/link.component--URNKuK2.js.map +1 -0
- package/dist/chunks/link.component-_YXG8MDq.js +2 -0
- package/dist/chunks/link.component-_YXG8MDq.js.map +1 -0
- package/dist/chunks/{list-D22V_L58.js → list-DTRn3TmT.js} +2 -2
- package/dist/chunks/{list-D22V_L58.js.map → list-DTRn3TmT.js.map} +1 -1
- package/dist/chunks/{list-DwRM9eA_.js → list-v83ZN2MC.js} +2 -2
- package/dist/chunks/{list-DwRM9eA_.js.map → list-v83ZN2MC.js.map} +1 -1
- package/dist/chunks/logo.types-88a31xCx.js +2 -0
- package/dist/chunks/logo.types-88a31xCx.js.map +1 -0
- package/dist/chunks/logo.types-C5GwpHjM.js +51 -0
- package/dist/chunks/logo.types-C5GwpHjM.js.map +1 -0
- package/dist/chunks/menu.component-D4-4xRDj.js +2 -0
- package/dist/chunks/menu.component-D4-4xRDj.js.map +1 -0
- package/dist/chunks/menu.component-DwTen8Uv.js +704 -0
- package/dist/chunks/menu.component-DwTen8Uv.js.map +1 -0
- package/dist/chunks/modal.types-74os4Bqi.js +2 -0
- package/dist/chunks/modal.types-74os4Bqi.js.map +1 -0
- package/dist/chunks/modal.types-B0rK6xJy.js +115 -0
- package/dist/chunks/modal.types-B0rK6xJy.js.map +1 -0
- package/dist/chunks/{notificationCounter.component-Lu4_Owvr.js → notificationCounter.component-BexkISUl.js} +37 -18
- package/dist/chunks/notificationCounter.component-BexkISUl.js.map +1 -0
- package/dist/chunks/notificationCounter.component-DJpUXeXm.js +2 -0
- package/dist/chunks/notificationCounter.component-DJpUXeXm.js.map +1 -0
- package/dist/chunks/numberInput.component-DIABzNV6.js +2 -0
- package/dist/chunks/numberInput.component-DIABzNV6.js.map +1 -0
- package/dist/chunks/numberInput.component-RCwUUzmH.js +227 -0
- package/dist/chunks/numberInput.component-RCwUUzmH.js.map +1 -0
- package/dist/chunks/picture.component-BA2hgdZy.js +2 -0
- package/dist/chunks/picture.component-BA2hgdZy.js.map +1 -0
- package/dist/chunks/picture.component-DzdHIFN_.js +28 -0
- package/dist/chunks/picture.component-DzdHIFN_.js.map +1 -0
- package/dist/chunks/pinInput.types-BCzsoF9r.js +2 -0
- package/dist/chunks/{pinInput.types-Cqm1Px5l.js.map → pinInput.types-BCzsoF9r.js.map} +1 -1
- package/dist/chunks/pinInput.types-CcaAN6P2.js +155 -0
- package/dist/chunks/{pinInput.types-CcN0aX_i.js.map → pinInput.types-CcaAN6P2.js.map} +1 -1
- package/dist/chunks/popover-C7aj8Iwj.js +2 -0
- package/dist/chunks/popover-C7aj8Iwj.js.map +1 -0
- package/dist/chunks/popover-pd70xkY_.js +111 -0
- package/dist/chunks/popover-pd70xkY_.js.map +1 -0
- package/dist/chunks/popover-root-provider-CZDbUJ2K.js +2 -0
- package/dist/chunks/{popover-root-provider-ZB5BcrXn.js.map → popover-root-provider-CZDbUJ2K.js.map} +1 -1
- package/dist/chunks/popover-root-provider-DR0Iuda1.js +44 -0
- package/dist/chunks/{popover-root-provider-CkW1eCBQ.js.map → popover-root-provider-DR0Iuda1.js.map} +1 -1
- package/dist/chunks/popover.component-BBp_5m8e.js +2 -0
- package/dist/chunks/popover.component-BBp_5m8e.js.map +1 -0
- package/dist/chunks/popover.component-DEOUdSu3.js +220 -0
- package/dist/chunks/popover.component-DEOUdSu3.js.map +1 -0
- package/dist/chunks/popover.recipe-B9bkpDfc.js +126 -0
- package/dist/chunks/popover.recipe-B9bkpDfc.js.map +1 -0
- package/dist/chunks/popover.recipe-Czy8Aeft.js +2 -0
- package/dist/chunks/popover.recipe-Czy8Aeft.js.map +1 -0
- package/dist/chunks/popover.types-CQJj3uOX.js +7 -0
- package/dist/chunks/popover.types-CQJj3uOX.js.map +1 -0
- package/dist/chunks/popover.types-ChA9ccQ2.js +2 -0
- package/dist/chunks/popover.types-ChA9ccQ2.js.map +1 -0
- package/dist/chunks/progress-value-text-CFVhPKYk.js +2 -0
- package/dist/chunks/progress-value-text-CFVhPKYk.js.map +1 -0
- package/dist/chunks/progress-value-text-DZkUF2cO.js +58 -0
- package/dist/chunks/progress-value-text-DZkUF2cO.js.map +1 -0
- package/dist/chunks/radioGroup.types-C7A8mLMz.js +2 -0
- package/dist/chunks/radioGroup.types-C7A8mLMz.js.map +1 -0
- package/dist/chunks/radioGroup.types-DJ68ERdO.js +228 -0
- package/dist/chunks/radioGroup.types-DJ68ERdO.js.map +1 -0
- package/dist/chunks/radiomark-Cj0NEJeE.js +2 -0
- package/dist/chunks/radiomark-Cj0NEJeE.js.map +1 -0
- package/dist/chunks/radiomark-DdwVpBDT.js +22 -0
- package/dist/chunks/radiomark-DdwVpBDT.js.map +1 -0
- package/dist/chunks/radiomark.component-D_7wT5VA.js +11 -0
- package/dist/chunks/radiomark.component-D_7wT5VA.js.map +1 -0
- package/dist/chunks/radiomark.component-YJNr68s7.js +2 -0
- package/dist/chunks/radiomark.component-YJNr68s7.js.map +1 -0
- package/dist/chunks/rating-group-CfwdAW9a.js +133 -0
- package/dist/chunks/rating-group-CfwdAW9a.js.map +1 -0
- package/dist/chunks/rating-group-D8QA23q6.js +2 -0
- package/dist/chunks/rating-group-D8QA23q6.js.map +1 -0
- package/dist/chunks/rating.component-BsuGbcxP.js +2 -0
- package/dist/chunks/rating.component-BsuGbcxP.js.map +1 -0
- package/dist/chunks/rating.component-ChzcvUl6.js +70 -0
- package/dist/chunks/rating.component-ChzcvUl6.js.map +1 -0
- package/dist/chunks/ratingDots.component-CVjSZ9JJ.js +2 -0
- package/dist/chunks/ratingDots.component-CVjSZ9JJ.js.map +1 -0
- package/dist/chunks/ratingDots.component-D9WQGVcj.js +147 -0
- package/dist/chunks/ratingDots.component-D9WQGVcj.js.map +1 -0
- package/dist/chunks/{render-strategy-CfHUEDVm.js → render-strategy-kPh1pd2U.js} +2 -2
- package/dist/chunks/{render-strategy-CfHUEDVm.js.map → render-strategy-kPh1pd2U.js.map} +1 -1
- package/dist/chunks/{render-strategy-Dr73HbQf.js → render-strategy-munDZLwL.js} +2 -2
- package/dist/chunks/{render-strategy-Dr73HbQf.js.map → render-strategy-munDZLwL.js.map} +1 -1
- package/dist/chunks/select.component-B4mAPqzN.js +1099 -0
- package/dist/chunks/select.component-B4mAPqzN.js.map +1 -0
- package/dist/chunks/select.component-CCNxMGvb.js +2 -0
- package/dist/chunks/select.component-CCNxMGvb.js.map +1 -0
- package/dist/chunks/{sortableList.component-vxiA7bvr.js → sortableList.component-BlwtnxVj.js} +3 -3
- package/dist/chunks/{sortableList.component-vxiA7bvr.js.map → sortableList.component-BlwtnxVj.js.map} +1 -1
- package/dist/chunks/{sortableList.component-i4dJ9oHN.js → sortableList.component-XfURY7C2.js} +384 -379
- package/dist/chunks/{sortableList.component-i4dJ9oHN.js.map → sortableList.component-XfURY7C2.js.map} +1 -1
- package/dist/chunks/spinner-B9ytCKVs.js +8 -0
- package/dist/chunks/{spinner-C31ZWQmA.js.map → spinner-B9ytCKVs.js.map} +1 -1
- package/dist/chunks/{spinner.component-DPYj17HK.js → spinner.component-B3dkvoO9.js} +53 -45
- package/dist/chunks/spinner.component-B3dkvoO9.js.map +1 -0
- package/dist/chunks/spinner.component-DuW1_IWM.js +2 -0
- package/dist/chunks/spinner.component-DuW1_IWM.js.map +1 -0
- package/dist/chunks/styledAvatar.types-CcP-Vl9c.js +2 -0
- package/dist/chunks/styledAvatar.types-CcP-Vl9c.js.map +1 -0
- package/dist/chunks/styledAvatar.types-cR6PNPxA.js +69 -0
- package/dist/chunks/styledAvatar.types-cR6PNPxA.js.map +1 -0
- package/dist/chunks/swatch.types-AZLB8OWG.js +2 -0
- package/dist/chunks/swatch.types-AZLB8OWG.js.map +1 -0
- package/dist/chunks/{swatch.types-CXlghcLw.js → swatch.types-CkrkMi11.js} +21 -20
- package/dist/chunks/swatch.types-CkrkMi11.js.map +1 -0
- package/dist/chunks/switch.component-CgzCLoTB.js +2 -0
- package/dist/chunks/{switch.component-Cke7O8gk.js.map → switch.component-CgzCLoTB.js.map} +1 -1
- package/dist/chunks/switch.component-CpV7mnhR.js +155 -0
- package/dist/chunks/{switch.component-C88jBbo_.js.map → switch.component-CpV7mnhR.js.map} +1 -1
- package/dist/chunks/{tab.types-DCkus0y2.js → tab.types-DaJfFBvr.js} +136 -117
- package/dist/chunks/{tab.types-DCkus0y2.js.map → tab.types-DaJfFBvr.js.map} +1 -1
- package/dist/chunks/tab.types-DwPEP_5N.js +2 -0
- package/dist/chunks/{tab.types-DpmXyw5C.js.map → tab.types-DwPEP_5N.js.map} +1 -1
- package/dist/chunks/tag.component-B7V76XfM.js +84 -0
- package/dist/chunks/tag.component-B7V76XfM.js.map +1 -0
- package/dist/chunks/tag.component-C98Wf07v.js +2 -0
- package/dist/chunks/tag.component-C98Wf07v.js.map +1 -0
- package/dist/chunks/tagBlock.component-BGEvRu81.js +2 -0
- package/dist/chunks/tagBlock.component-BGEvRu81.js.map +1 -0
- package/dist/chunks/tagBlock.component-Cor6eakc.js +170 -0
- package/dist/chunks/tagBlock.component-Cor6eakc.js.map +1 -0
- package/dist/chunks/text.component-CdTyTFds.js +12 -0
- package/dist/chunks/text.component-CdTyTFds.js.map +1 -0
- package/dist/chunks/text.component-CeioUl0G.js +2 -0
- package/dist/chunks/text.component-CeioUl0G.js.map +1 -0
- package/dist/chunks/textInput.component-BC0Hi8R_.js +108 -0
- package/dist/chunks/textInput.component-BC0Hi8R_.js.map +1 -0
- package/dist/chunks/textInput.component-C1vwy6pL.js +2 -0
- package/dist/chunks/textInput.component-C1vwy6pL.js.map +1 -0
- package/dist/chunks/textarea.component-D15hA9Jb.js +2 -0
- package/dist/chunks/{textarea.component-Dk2IMKkr.js.map → textarea.component-D15hA9Jb.js.map} +1 -1
- package/dist/chunks/textarea.component-axjxiv82.js +96 -0
- package/dist/chunks/{textarea.component-BYexywy1.js.map → textarea.component-axjxiv82.js.map} +1 -1
- package/dist/chunks/{theme.provider-w_I9S10D.js → theme.provider-BD7qyu-B.js} +1405 -1339
- package/dist/chunks/theme.provider-BD7qyu-B.js.map +1 -0
- package/dist/chunks/theme.provider-DFwAy7tr.js +28 -0
- package/dist/chunks/theme.provider-DFwAy7tr.js.map +1 -0
- package/dist/chunks/timePicker.component-Cz2XxVL6.js +2 -0
- package/dist/chunks/timePicker.component-Cz2XxVL6.js.map +1 -0
- package/dist/chunks/timePicker.component-u34pHrzr.js +220 -0
- package/dist/chunks/timePicker.component-u34pHrzr.js.map +1 -0
- package/dist/chunks/timeRange.component-BiA1VWQ8.js +19 -0
- package/dist/chunks/timeRange.component-BiA1VWQ8.js.map +1 -0
- package/dist/chunks/timeRange.component-tU_nCTmS.js +2 -0
- package/dist/chunks/timeRange.component-tU_nCTmS.js.map +1 -0
- package/dist/chunks/timestamp.component-DBmc7D23.js +36 -0
- package/dist/chunks/timestamp.component-DBmc7D23.js.map +1 -0
- package/dist/chunks/timestamp.component-DYZHgaas.js +2 -0
- package/dist/chunks/timestamp.component-DYZHgaas.js.map +1 -0
- package/dist/chunks/toaster.records-CDSkoMuU.js +2 -0
- package/dist/chunks/{toaster.records-eCXbM85Z.js.map → toaster.records-CDSkoMuU.js.map} +1 -1
- package/dist/chunks/{toaster.records-oryzm5Go.js → toaster.records-Cb3hbtuY.js} +103 -102
- package/dist/chunks/{toaster.records-oryzm5Go.js.map → toaster.records-Cb3hbtuY.js.map} +1 -1
- package/dist/chunks/tooltip.component-BkFDi5yK.js +2 -0
- package/dist/chunks/{tooltip.component-CATpCSkf.js.map → tooltip.component-BkFDi5yK.js.map} +1 -1
- package/dist/chunks/{tooltip.component-mjdP7nPN.js → tooltip.component-C_NS-AoH.js} +126 -103
- package/dist/chunks/{tooltip.component-mjdP7nPN.js.map → tooltip.component-C_NS-AoH.js.map} +1 -1
- package/dist/chunks/{typography.records-CpYV1kns.js → typography.records-BEd2lI_g.js} +10 -22
- package/dist/chunks/typography.records-BEd2lI_g.js.map +1 -0
- package/dist/chunks/typography.records-Cg_lT1Z3.js +2 -0
- package/dist/chunks/typography.records-Cg_lT1Z3.js.map +1 -0
- package/dist/chunks/{use-field-context-BTxME29X.js → use-field-context-Cm29IQ7H.js} +2 -2
- package/dist/chunks/{use-field-context-BTxME29X.js.map → use-field-context-Cm29IQ7H.js.map} +1 -1
- package/dist/chunks/{use-field-context-RQeEcNpb.js → use-field-context-DrC9mrDd.js} +2 -2
- package/dist/chunks/{use-field-context-RQeEcNpb.js.map → use-field-context-DrC9mrDd.js.map} +1 -1
- package/dist/chunks/use-locale-context-Bw4Gg9Z0.js +738 -0
- package/dist/chunks/use-locale-context-Bw4Gg9Z0.js.map +1 -0
- package/dist/chunks/use-locale-context-ym21RUxU.js +22 -0
- package/dist/chunks/use-locale-context-ym21RUxU.js.map +1 -0
- package/dist/chunks/useIconTextSizeMap-BK-pUrQv.js.map +1 -1
- package/dist/chunks/useIconTextSizeMap-BXmABb54.js.map +1 -1
- package/dist/chunks/withFormControl-DePFf9SY.js +367 -0
- package/dist/chunks/withFormControl-DePFf9SY.js.map +1 -0
- package/dist/chunks/withFormControl-wZA87Sd4.js +2 -0
- package/dist/chunks/withFormControl-wZA87Sd4.js.map +1 -0
- package/dist/chunks/withTruncation-DE3FFPE7.js +2 -0
- package/dist/chunks/withTruncation-DE3FFPE7.js.map +1 -0
- package/dist/chunks/withTruncation-DTCfQ2yk.js +92 -0
- package/dist/chunks/withTruncation-DTCfQ2yk.js.map +1 -0
- package/dist/chunks/{wrap-CRNL4bE6.js → wrap-Cu5ZEseD.js} +2 -2
- package/dist/chunks/{wrap-CRNL4bE6.js.map → wrap-Cu5ZEseD.js.map} +1 -1
- package/dist/cjs/chakra/index.cjs +2 -2
- package/dist/cjs/chakra/index.cjs.map +1 -1
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/Avatar/index.cjs +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/Button/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Calendar/index.cjs +2 -0
- package/dist/cjs/components/Calendar/index.cjs.map +1 -0
- package/dist/cjs/components/Card/index.cjs +1 -1
- package/dist/cjs/components/CharacterCounter/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/DateTimePicker/index.cjs +2 -0
- package/dist/cjs/components/DateTimePicker/index.cjs.map +1 -0
- package/dist/cjs/components/Divider/index.cjs +1 -1
- package/dist/cjs/components/Heading/index.cjs +1 -1
- package/dist/cjs/components/Icon/generated/index.cjs +1 -1
- package/dist/cjs/components/Icon/generated/index.cjs.map +1 -1
- package/dist/cjs/components/Icon/index.cjs +1 -1
- package/dist/cjs/components/Link/index.cjs +1 -1
- package/dist/cjs/components/Logo/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/Modal/index.cjs +1 -1
- package/dist/cjs/components/NotificationCounter/index.cjs +1 -1
- package/dist/cjs/components/NumberInput/index.cjs +2 -0
- package/dist/cjs/components/NumberInput/index.cjs.map +1 -0
- package/dist/cjs/components/Picture/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/Popover/index.cjs +1 -1
- package/dist/cjs/components/Progress/index.cjs +2 -0
- package/dist/cjs/components/Progress/index.cjs.map +1 -0
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/Radiomark/index.cjs +2 -0
- package/dist/cjs/components/Radiomark/index.cjs.map +1 -0
- package/dist/cjs/components/Rating/index.cjs +2 -0
- package/dist/cjs/components/Rating/index.cjs.map +1 -0
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/SortableList/index.cjs +1 -1
- package/dist/cjs/components/Spinner/index.cjs +1 -1
- package/dist/cjs/components/StyledAvatar/index.cjs +1 -1
- package/dist/cjs/components/Swatch/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/Tabs/index.cjs +1 -1
- package/dist/cjs/components/Tag/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/Text/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/Timestamp/index.cjs +1 -1
- package/dist/cjs/components/Toast/index.cjs +1 -1
- package/dist/cjs/components/Toast/index.cjs.map +1 -1
- package/dist/cjs/components/Tooltip/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/hooks/useBreakpoint/index.cjs.map +1 -1
- package/dist/cjs/hooks/useColorMode/index.cjs.map +1 -1
- package/dist/cjs/hooks/useColorModeValue/index.cjs.map +1 -1
- package/dist/cjs/hooks/useDeviceType/index.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/cjs/theme/semanticTokens/index.cjs +1 -1
- package/dist/cjs/theme/semanticTokens/index.cjs.map +1 -1
- package/dist/esm/chakra/index.js +1682 -1997
- package/dist/esm/chakra/index.js.map +1 -1
- package/dist/esm/components/Alert/index.js +1 -1
- package/dist/esm/components/Avatar/index.js +1 -1
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/Button/index.js +2 -2
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Calendar/index.js +5 -0
- package/dist/esm/components/Calendar/index.js.map +1 -0
- package/dist/esm/components/Card/index.js +1 -1
- package/dist/esm/components/CharacterCounter/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +4 -3
- package/dist/esm/components/DatePicker/index.js.map +1 -1
- package/dist/esm/components/DateTimePicker/index.js +7 -0
- package/dist/esm/components/DateTimePicker/index.js.map +1 -0
- package/dist/esm/components/Divider/index.js +6 -5
- package/dist/esm/components/Divider/index.js.map +1 -1
- package/dist/esm/components/Heading/index.js +1 -1
- package/dist/esm/components/Icon/generated/index.js +556 -342
- package/dist/esm/components/Icon/generated/index.js.map +1 -1
- package/dist/esm/components/Icon/index.js +1 -1
- package/dist/esm/components/Link/index.js +1 -1
- package/dist/esm/components/Logo/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/NotificationCounter/index.js +1 -1
- package/dist/esm/components/NumberInput/index.js +5 -0
- package/dist/esm/components/NumberInput/index.js.map +1 -0
- package/dist/esm/components/Picture/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/Popover/index.js +2 -2
- package/dist/esm/components/Progress/index.js +57 -0
- package/dist/esm/components/Progress/index.js.map +1 -0
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/Radiomark/index.js +5 -0
- package/dist/esm/components/Radiomark/index.js.map +1 -0
- package/dist/esm/components/Rating/index.js +5 -0
- package/dist/esm/components/Rating/index.js.map +1 -0
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/SortableList/index.js +1 -1
- package/dist/esm/components/Spinner/index.js +1 -1
- package/dist/esm/components/StyledAvatar/index.js +1 -1
- package/dist/esm/components/Swatch/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/Tag/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/Text/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/Timestamp/index.js +1 -1
- package/dist/esm/components/Toast/index.js +26 -23
- package/dist/esm/components/Toast/index.js.map +1 -1
- package/dist/esm/components/Tooltip/index.js +1 -1
- package/dist/esm/components/index.js +131 -117
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/hooks/useBreakpoint/index.js.map +1 -1
- package/dist/esm/hooks/useColorMode/index.js.map +1 -1
- package/dist/esm/hooks/useColorModeValue/index.js.map +1 -1
- package/dist/esm/hooks/useDeviceType/index.js.map +1 -1
- package/dist/esm/index.js +148 -134
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/theme/index.js +1 -1
- package/dist/esm/theme/semanticTokens/index.js +4 -4
- package/dist/esm/theme/semanticTokens/index.js.map +1 -1
- package/dist/types/chakra/index.d.ts +2 -4
- package/dist/types/components/Alert/alert.component.d.ts +28 -1
- package/dist/types/components/Alert/alert.recipe.d.ts +3 -2
- package/dist/types/components/Alert/components/AlertButton/alertButton.component.d.ts +12 -1
- package/dist/types/components/Avatar/avatar.component.d.ts +30 -2
- package/dist/types/components/Avatar/avatar.recipe.d.ts +3 -2
- package/dist/types/components/Avatar/avatar.records.d.ts +2 -0
- package/dist/types/components/Avatar/components/AvatarBadge/avatarBadge.component.d.ts +9 -1
- package/dist/types/components/Avatar/components/AvatarRemoveButton/avatarRemoveButton.component.d.ts +15 -6
- package/dist/types/components/Avatar/components/AvatarTooltipTriggerWrapper/avatarTooltipTriggerWrapper.component.d.ts +2 -0
- package/dist/types/components/AvatarGroup/avatarGroup.component.d.ts +27 -3
- package/dist/types/components/Button/button.component.d.ts +14 -1
- package/dist/types/components/Button/button.recipe.d.ts +3 -1
- package/dist/types/components/Button/button.types.d.ts +2 -2
- package/dist/types/components/ButtonGroup/buttonGroup.component.d.ts +12 -1
- package/dist/types/components/Calendar/calendar.component.d.ts +19 -0
- package/dist/types/components/Calendar/index.d.ts +1 -0
- package/dist/types/components/Card/card.component.d.ts +41 -1
- package/dist/types/components/CharacterCounter/characterCounter.component.d.ts +9 -1
- package/dist/types/components/Checkbox/checkbox.component.d.ts +19 -2
- package/dist/types/components/Checkbox/checkbox.recipe.d.ts +3 -2
- package/dist/types/components/Checkbox/checkbox.types.d.ts +4 -0
- package/dist/types/components/Checkbox/index.d.ts +1 -0
- package/dist/types/components/CheckboxGroup/checkboxGroup.component.d.ts +12 -2
- package/dist/types/components/ConversationCard/components/ConversationCardAvatarGroup/conversationCardAvatarGroup.component.d.ts +11 -1
- package/dist/types/components/ConversationCard/components/ConversationCardButtons/conversationCardButtons.component.d.ts +22 -1
- package/dist/types/components/ConversationCard/components/ConversationCardContent/conversationCardContent.component.d.ts +8 -1
- package/dist/types/components/ConversationCard/components/ConversationCardFooter/conversationCardFooter.component.d.ts +8 -1
- package/dist/types/components/ConversationCard/components/ConversationCardHeader/conversationCardHeader.component.d.ts +12 -1
- package/dist/types/components/ConversationCard/components/ConversationCardTags/conversationCardTags.component.d.ts +7 -1
- package/dist/types/components/ConversationCard/conversationCard.component.d.ts +29 -1
- package/dist/types/components/DatePicker/components/DatePickerCalendar/datePickerCalendar.component.d.ts +10 -1
- package/dist/types/components/DatePicker/components/DatePickerDay/datePickerCalendarDay.component.d.ts +11 -1
- package/dist/types/components/DatePicker/components/DatePickerDay/datePickerCalendarDay.recipe.d.ts +5 -4
- package/dist/types/components/DatePicker/components/DatePickerDay/datePickerCalendarDay.types.d.ts +1 -1
- package/dist/types/components/DatePicker/components/DatePickerFooter/datePickerFooter.component.d.ts +9 -0
- package/dist/types/components/DatePicker/components/DatePickerHeader/datePickerHeader.component.d.ts +15 -1
- package/dist/types/components/DatePicker/components/DatePickerInput/datePickerInput.component.d.ts +6 -1
- package/dist/types/components/DatePicker/components/DatePickerMonth/datePickerCalendarMonth.component.d.ts +11 -1
- package/dist/types/components/DatePicker/context/datePicker.context.d.ts +3 -0
- package/dist/types/components/DatePicker/context/datePicker.provider.d.ts +10 -1
- package/dist/types/components/DatePicker/datePicker.component.d.ts +25 -11
- package/dist/types/components/DatePicker/datePicker.types.d.ts +18 -0
- package/dist/types/components/DatePicker/hooks/useComputeCornerRoundingFlags.d.ts +10 -0
- package/dist/types/components/DatePicker/utils/getDayVariant.d.ts +12 -0
- package/dist/types/components/DateTimePicker/components/DateTimePickerCustomView/dateTimePickerCustomView.component.d.ts +7 -0
- package/dist/types/components/DateTimePicker/components/DateTimePickerQuickOptions/dateTimePickerQuickOptions.component.d.ts +14 -0
- package/dist/types/components/DateTimePicker/components/DateTimePickerRangeSelector/dateTimePickerRangeSelector.component.d.ts +10 -0
- package/dist/types/components/DateTimePicker/dateTimePicker.component.d.ts +33 -0
- package/dist/types/components/DateTimePicker/dateTimePicker.records.d.ts +8 -0
- package/dist/types/components/DateTimePicker/dateTimePicker.types.d.ts +11 -0
- package/dist/types/components/DateTimePicker/index.d.ts +2 -0
- package/dist/types/components/DateTimePicker/utils/quickOptions.d.ts +13 -0
- package/dist/types/components/Divider/divider.component.d.ts +7 -2
- package/dist/types/components/Heading/heading.component.d.ts +12 -0
- package/dist/types/components/Icon/generated/Backspace.d.ts +10 -0
- package/dist/types/components/Icon/generated/CaretLeft.d.ts +10 -0
- package/dist/types/components/Icon/generated/CheckList.d.ts +10 -0
- package/dist/types/components/Icon/generated/Globe.d.ts +10 -0
- package/dist/types/components/Icon/generated/InputAlt.d.ts +10 -0
- package/dist/types/components/Icon/generated/LightBulb.d.ts +10 -0
- package/dist/types/components/Icon/generated/SelectDropDown.d.ts +10 -0
- package/dist/types/components/Icon/generated/TextArea.d.ts +10 -0
- package/dist/types/components/Icon/generated/TextBlock.d.ts +10 -0
- package/dist/types/components/Icon/generated/index.d.ts +1 -1
- package/dist/types/components/Icon/icon.component.d.ts +10 -0
- package/dist/types/components/Link/components/LinkIcon/linkIcon.component.d.ts +7 -0
- package/dist/types/components/Link/link.component.d.ts +19 -0
- package/dist/types/components/Logo/logo.component.d.ts +14 -1
- package/dist/types/components/Menu/components/MenuButton/menuButton.component.d.ts +22 -0
- package/dist/types/components/Menu/components/MenuItem/menuItem.component.d.ts +34 -5
- package/dist/types/components/Menu/components/MenuList/menuList.types.d.ts +18 -0
- package/dist/types/components/Menu/components/MenuToggleButtons/menuToggleButtons.component.d.ts +17 -0
- package/dist/types/components/Menu/index.d.ts +4 -0
- package/dist/types/components/Menu/menu.component.d.ts +22 -19
- package/dist/types/components/Menu/menu.recipe.d.ts +1 -1
- package/dist/types/components/Menu/menu.types.d.ts +17 -0
- package/dist/types/components/Modal/components/ModalFooter/modalFooter.component.d.ts +24 -1
- package/dist/types/components/Modal/modal.component.d.ts +46 -1
- package/dist/types/components/Modal/modal.recipe.d.ts +2 -2
- package/dist/types/components/NotificationCounter/notificationCounter.component.d.ts +19 -1
- package/dist/types/components/NotificationCounter/notificationCounter.records.d.ts +5 -0
- package/dist/types/components/NumberInput/index.d.ts +2 -0
- package/dist/types/components/NumberInput/numberInput.component.d.ts +40 -0
- package/dist/types/components/NumberInput/numberInput.recipe.d.ts +21 -0
- package/dist/types/components/NumberInput/numberInput.types.d.ts +4 -0
- package/dist/types/components/Picture/picture.component.d.ts +9 -1
- package/dist/types/components/PinInput/pinInput.component.d.ts +19 -1
- package/dist/types/components/PinInput/pinInput.recipe.d.ts +1 -1
- package/dist/types/components/Popover/components/PopoverFooter/popoverFooter.component.d.ts +26 -1
- package/dist/types/components/Popover/components/PopoverHeader/popoverHeader.component.d.ts +19 -1
- package/dist/types/components/Popover/popover.component.d.ts +45 -2
- package/dist/types/components/Popover/popover.recipe.d.ts +4 -3
- package/dist/types/components/Popover/popover.types.d.ts +1 -1
- package/dist/types/components/Progress/index.d.ts +2 -0
- package/dist/types/components/Progress/progress.component.d.ts +26 -0
- package/dist/types/components/Progress/progress.recipe.d.ts +38 -0
- package/dist/types/components/Progress/progress.types.d.ts +9 -0
- package/dist/types/components/RadioGroup/components/Radio/radio.component.d.ts +15 -0
- package/dist/types/components/RadioGroup/radioGroup.component.d.ts +22 -2
- package/dist/types/components/RadioGroup/radioGroup.recipe.d.ts +4 -2
- package/dist/types/components/Radiomark/index.d.ts +1 -0
- package/dist/types/components/Radiomark/radiomark.component.d.ts +12 -0
- package/dist/types/components/Radiomark/radiomark.recipe.d.ts +2 -0
- package/dist/types/components/Rating/index.d.ts +1 -0
- package/dist/types/components/Rating/rating.component.d.ts +37 -0
- package/dist/types/components/Rating/rating.recipe.d.ts +10 -0
- package/dist/types/components/RatingDots/components/RatingDot/ratingDot.component.d.ts +10 -1
- package/dist/types/components/RatingDots/ratingDots.component.d.ts +12 -0
- package/dist/types/components/Select/components/SelectItemContent/selectItemContent.component.d.ts +6 -0
- package/dist/types/components/Select/components/SelectTrigger/selectTrigger.component.d.ts +7 -2
- package/dist/types/components/Select/select.component.d.ts +53 -3
- package/dist/types/components/Select/select.types.d.ts +3 -0
- package/dist/types/components/SortableList/components/SortableListDragHandle/sortableListDragHandle.component.d.ts +1 -1
- package/dist/types/components/SortableList/components/SortableListItem/sortableListItem.component.d.ts +13 -1
- package/dist/types/components/SortableList/sortableList.component.d.ts +13 -1
- package/dist/types/components/Spinner/spinner.component.d.ts +28 -2
- package/dist/types/components/Spinner/spinner.recipe.d.ts +16 -1
- package/dist/types/components/StyledAvatar/styledAvatar.component.d.ts +10 -1
- package/dist/types/components/StyledAvatar/styledAvatar.types.d.ts +1 -1
- package/dist/types/components/Swatch/swatch.component.d.ts +10 -1
- package/dist/types/components/Switch/switch.component.d.ts +15 -0
- package/dist/types/components/Switch/switch.recipe.d.ts +3 -2
- package/dist/types/components/Tabs/components/Tab/tab.component.d.ts +14 -1
- package/dist/types/components/Tabs/tabs.component.d.ts +17 -2
- package/dist/types/components/Tabs/tabs.recipe.d.ts +3 -2
- package/dist/types/components/Tag/tag.component.d.ts +31 -0
- package/dist/types/components/Tag/tag.recipe.d.ts +3 -2
- package/dist/types/components/TagBlock/tagBlock.component.d.ts +34 -1
- package/dist/types/components/Text/text.component.d.ts +13 -0
- package/dist/types/components/TextInput/textInput.component.d.ts +28 -0
- package/dist/types/components/Textarea/textarea.component.d.ts +13 -0
- package/dist/types/components/TimePicker/components/TimeList/timeList.component.d.ts +10 -1
- package/dist/types/components/TimePicker/components/TimeOption/timeOption.component.d.ts +9 -1
- package/dist/types/components/TimePicker/timePicker.component.d.ts +19 -1
- package/dist/types/components/TimeRange/timeRange.component.d.ts +12 -1
- package/dist/types/components/Timestamp/timestamp.component.d.ts +18 -1
- package/dist/types/components/Toast/components/ToastAction/toastAction.component.d.ts +12 -1
- package/dist/types/components/Toast/components/Toaster/toaster.component.d.ts +6 -1
- package/dist/types/components/Toast/toast.component.d.ts +19 -1
- package/dist/types/components/Toast/toast.recipe.d.ts +3 -2
- package/dist/types/components/Toast/toast.types.d.ts +13 -0
- package/dist/types/components/Toast/useToast.d.ts +5 -0
- package/dist/types/components/Tooltip/tooltip.component.d.ts +26 -0
- package/dist/types/components/Tooltip/tooltip.recipe.d.ts +10 -1
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/hocs/withFormControl/withFormControl.d.ts +44 -0
- package/dist/types/hocs/withTruncation.d.ts +8 -0
- package/dist/types/hooks/useBreakpoint/index.d.ts +4 -0
- package/dist/types/hooks/useColorMode/index.d.ts +39 -0
- package/dist/types/hooks/useColorModeValue/index.d.ts +6 -0
- package/dist/types/hooks/useDeviceType/index.d.ts +4 -0
- package/dist/types/hooks/useIconTextSizeMap.d.ts +5 -0
- package/dist/types/shared/components/withVariantStory.d.ts +6 -0
- package/dist/types/shared/types/index.d.ts +1 -0
- package/dist/types/theme/providers/theme.provider.d.ts +1 -0
- package/dist/types/theme/recipes/List/list.recipe.d.ts +14 -0
- package/dist/types/theme/recipes/Table/table.recipe.d.ts +29 -0
- package/dist/types/theme/semanticTokens/semanticTokens.config.d.ts +91 -82
- package/dist/types/theme/semanticTokens/semanticTokens.records.d.ts +182 -164
- package/dist/types/theme/semanticTokens/semanticTokens.types.d.ts +4 -3
- package/dist/types/theme/tokens/sizes/sizes.config.d.ts +2 -2
- package/dist/types/theme/tokens/zIndices/zIndices.config.d.ts +10 -10
- package/package.json +21 -18
- package/dist/chunks/alert.types-De_IDZNV.js +0 -2
- package/dist/chunks/alert.types-De_IDZNV.js.map +0 -1
- package/dist/chunks/alert.types-NkOwCG0-.js +0 -139
- package/dist/chunks/alert.types-NkOwCG0-.js.map +0 -1
- package/dist/chunks/avatar.component-CqFsGMt6.js +0 -2
- package/dist/chunks/avatar.component-CqFsGMt6.js.map +0 -1
- package/dist/chunks/avatar.component-lHszPWEi.js +0 -394
- package/dist/chunks/avatar.component-lHszPWEi.js.map +0 -1
- package/dist/chunks/avatarGroup.component-BPYIE5NT.js +0 -2
- package/dist/chunks/avatarGroup.component-BPYIE5NT.js.map +0 -1
- package/dist/chunks/avatarGroup.component-EFxRAKiJ.js +0 -67
- package/dist/chunks/avatarGroup.component-EFxRAKiJ.js.map +0 -1
- package/dist/chunks/button.component-BE20YKDd.js +0 -67
- package/dist/chunks/button.component-BE20YKDd.js.map +0 -1
- package/dist/chunks/button.component-DAv5WxDc.js +0 -2
- package/dist/chunks/button.component-DAv5WxDc.js.map +0 -1
- package/dist/chunks/button.recipe-7PSQJbyz.js +0 -2
- package/dist/chunks/button.recipe-7PSQJbyz.js.map +0 -1
- package/dist/chunks/button.recipe-ClmsjdZI.js +0 -910
- package/dist/chunks/button.recipe-ClmsjdZI.js.map +0 -1
- package/dist/chunks/button.types-BKXZNvN1.js.map +0 -1
- package/dist/chunks/button.types-Bl1awbi0.js +0 -2
- package/dist/chunks/button.types-Bl1awbi0.js.map +0 -1
- package/dist/chunks/buttonGroup.component-CQBXYOhq.js +0 -2
- package/dist/chunks/buttonGroup.component-CQBXYOhq.js.map +0 -1
- package/dist/chunks/buttonGroup.component-CheBkHw6.js +0 -68
- package/dist/chunks/buttonGroup.component-CheBkHw6.js.map +0 -1
- package/dist/chunks/card.component-BZxC19F_.js +0 -2
- package/dist/chunks/card.component-BZxC19F_.js.map +0 -1
- package/dist/chunks/card.component-DJcYzMX1.js +0 -58
- package/dist/chunks/card.component-DJcYzMX1.js.map +0 -1
- package/dist/chunks/characterCounter.component-C6ZwdIiA.js +0 -84
- package/dist/chunks/characterCounter.component-C6ZwdIiA.js.map +0 -1
- package/dist/chunks/characterCounter.component-D0ccCiBG.js +0 -2
- package/dist/chunks/characterCounter.component-D0ccCiBG.js.map +0 -1
- package/dist/chunks/checkbox.component-DNOkXggb.js +0 -260
- package/dist/chunks/checkbox.component-Dhjcu89D.js +0 -2
- package/dist/chunks/checkboxGroup.component-BNKJqMKi.js +0 -52
- package/dist/chunks/checkboxGroup.component-BNKJqMKi.js.map +0 -1
- package/dist/chunks/checkboxGroup.component-M-nvlAbK.js +0 -2
- package/dist/chunks/checkboxGroup.component-M-nvlAbK.js.map +0 -1
- package/dist/chunks/conversationCard.component-BRJbMpwH.js +0 -2
- package/dist/chunks/conversationCard.component-BRJbMpwH.js.map +0 -1
- package/dist/chunks/conversationCard.component-DmSuBQ4_.js +0 -330
- package/dist/chunks/conversationCard.component-DmSuBQ4_.js.map +0 -1
- package/dist/chunks/create-slot-recipe-context-CViypfwB.js +0 -2
- package/dist/chunks/create-slot-recipe-context-CViypfwB.js.map +0 -1
- package/dist/chunks/create-slot-recipe-context-CrlT_nGQ.js +0 -97
- package/dist/chunks/create-slot-recipe-context-CrlT_nGQ.js.map +0 -1
- package/dist/chunks/datePicker.component-BOsFZiDy.js +0 -15
- package/dist/chunks/datePicker.component-BOsFZiDy.js.map +0 -1
- package/dist/chunks/datePicker.component-Dzh4WccC.js +0 -3019
- package/dist/chunks/datePicker.component-Dzh4WccC.js.map +0 -1
- package/dist/chunks/dialog-BPhjKQkb.js +0 -2
- package/dist/chunks/divider.types-Dht8eAh4.js +0 -2
- package/dist/chunks/divider.types-Dht8eAh4.js.map +0 -1
- package/dist/chunks/divider.types-ZN_wlva7.js +0 -47
- package/dist/chunks/divider.types-ZN_wlva7.js.map +0 -1
- package/dist/chunks/grid-item-DPdTp_nI.js +0 -94
- package/dist/chunks/grid-item-DPdTp_nI.js.map +0 -1
- package/dist/chunks/grid-item-qnuioQmr.js +0 -2
- package/dist/chunks/grid-item-qnuioQmr.js.map +0 -1
- package/dist/chunks/heading.component-C_cdAGTd.js +0 -2
- package/dist/chunks/heading.component-C_cdAGTd.js.map +0 -1
- package/dist/chunks/heading.component-SiJnYLOw.js +0 -12
- package/dist/chunks/heading.component-SiJnYLOw.js.map +0 -1
- package/dist/chunks/icon.component-Bhnf2n1O.js +0 -2
- package/dist/chunks/icon.component-Bhnf2n1O.js.map +0 -1
- package/dist/chunks/icon.component-C5bgxAD2.js +0 -32
- package/dist/chunks/icon.component-C5bgxAD2.js.map +0 -1
- package/dist/chunks/index-2glJ2faJ.js +0 -2
- package/dist/chunks/index-7Jpijbq_.js +0 -3
- package/dist/chunks/index-7Jpijbq_.js.map +0 -1
- package/dist/chunks/index-A_vmTNU7.js +0 -2
- package/dist/chunks/index-BEfEzWJx.js +0 -2
- package/dist/chunks/index-Bm5QBNWR.js +0 -8190
- package/dist/chunks/index-Bm5QBNWR.js.map +0 -1
- package/dist/chunks/index-Cv06PsSJ.js.map +0 -1
- package/dist/chunks/index-DA90Dqf9.js +0 -1362
- package/dist/chunks/index-DA90Dqf9.js.map +0 -1
- package/dist/chunks/index-DAI6_P9H.js +0 -2
- package/dist/chunks/index-DMcwHRZ5.js +0 -11
- package/dist/chunks/index-DMcwHRZ5.js.map +0 -1
- package/dist/chunks/index-jnwdAJ25.js +0 -2
- package/dist/chunks/index-jnwdAJ25.js.map +0 -1
- package/dist/chunks/link.component-CvR5CbiT.js +0 -36
- package/dist/chunks/link.component-CvR5CbiT.js.map +0 -1
- package/dist/chunks/link.component-yUJIJbIP.js +0 -2
- package/dist/chunks/link.component-yUJIJbIP.js.map +0 -1
- package/dist/chunks/logo.types-DF4eLSR9.js +0 -45
- package/dist/chunks/logo.types-DF4eLSR9.js.map +0 -1
- package/dist/chunks/logo.types-Zt-yfFAQ.js +0 -2
- package/dist/chunks/logo.types-Zt-yfFAQ.js.map +0 -1
- package/dist/chunks/menu.component-DylZiPAE.js +0 -2
- package/dist/chunks/menu.component-DylZiPAE.js.map +0 -1
- package/dist/chunks/menu.component-xhHsHlGT.js +0 -599
- package/dist/chunks/menu.component-xhHsHlGT.js.map +0 -1
- package/dist/chunks/modal.types-CBos7aXO.js +0 -2
- package/dist/chunks/modal.types-CBos7aXO.js.map +0 -1
- package/dist/chunks/modal.types-CkQIOPTa.js +0 -95
- package/dist/chunks/modal.types-CkQIOPTa.js.map +0 -1
- package/dist/chunks/notificationCounter.component-Lu4_Owvr.js.map +0 -1
- package/dist/chunks/notificationCounter.component-gp2ULnY_.js +0 -2
- package/dist/chunks/notificationCounter.component-gp2ULnY_.js.map +0 -1
- package/dist/chunks/picture.component-CKK-SMvr.js +0 -22
- package/dist/chunks/picture.component-CKK-SMvr.js.map +0 -1
- package/dist/chunks/picture.component-CR6e0wRG.js +0 -2
- package/dist/chunks/picture.component-CR6e0wRG.js.map +0 -1
- package/dist/chunks/pinInput.types-CcN0aX_i.js +0 -145
- package/dist/chunks/pinInput.types-Cqm1Px5l.js +0 -2
- package/dist/chunks/popover-root-provider-CkW1eCBQ.js +0 -43
- package/dist/chunks/popover-root-provider-ZB5BcrXn.js +0 -2
- package/dist/chunks/popover.component-BjS13k9K.js +0 -2
- package/dist/chunks/popover.component-BjS13k9K.js.map +0 -1
- package/dist/chunks/popover.component-C4WKxh4d.js +0 -196
- package/dist/chunks/popover.component-C4WKxh4d.js.map +0 -1
- package/dist/chunks/popover.recipe-Bx25Jhgs.js +0 -2
- package/dist/chunks/popover.recipe-Bx25Jhgs.js.map +0 -1
- package/dist/chunks/popover.recipe-C2nbfvL6.js +0 -241
- package/dist/chunks/popover.recipe-C2nbfvL6.js.map +0 -1
- package/dist/chunks/popover.types-BF2KRf_I.js +0 -2
- package/dist/chunks/popover.types-BF2KRf_I.js.map +0 -1
- package/dist/chunks/popover.types-D1O-Ehsz.js +0 -7
- package/dist/chunks/popover.types-D1O-Ehsz.js.map +0 -1
- package/dist/chunks/radioGroup.types-CZA7RcAn.js +0 -2
- package/dist/chunks/radioGroup.types-CZA7RcAn.js.map +0 -1
- package/dist/chunks/radioGroup.types-Dld5lmgo.js +0 -231
- package/dist/chunks/radioGroup.types-Dld5lmgo.js.map +0 -1
- package/dist/chunks/ratingDots.component-DcrCudac.js +0 -2
- package/dist/chunks/ratingDots.component-DcrCudac.js.map +0 -1
- package/dist/chunks/ratingDots.component-G4GMWvFy.js +0 -138
- package/dist/chunks/ratingDots.component-G4GMWvFy.js.map +0 -1
- package/dist/chunks/select.component-BTWHWvZV.js +0 -1058
- package/dist/chunks/select.component-BTWHWvZV.js.map +0 -1
- package/dist/chunks/select.component-Dyc1yQPO.js +0 -2
- package/dist/chunks/select.component-Dyc1yQPO.js.map +0 -1
- package/dist/chunks/spinner-C31ZWQmA.js +0 -8
- package/dist/chunks/spinner.component-CVVOuFka.js +0 -2
- package/dist/chunks/spinner.component-CVVOuFka.js.map +0 -1
- package/dist/chunks/spinner.component-DPYj17HK.js.map +0 -1
- package/dist/chunks/styledAvatar.types-CMpyDxAM.js +0 -2
- package/dist/chunks/styledAvatar.types-CMpyDxAM.js.map +0 -1
- package/dist/chunks/styledAvatar.types-CS07Zk7c.js +0 -51
- package/dist/chunks/styledAvatar.types-CS07Zk7c.js.map +0 -1
- package/dist/chunks/swatch.types-CXlghcLw.js.map +0 -1
- package/dist/chunks/swatch.types-jaI0KFHU.js +0 -2
- package/dist/chunks/swatch.types-jaI0KFHU.js.map +0 -1
- package/dist/chunks/switch.component-C88jBbo_.js +0 -2
- package/dist/chunks/switch.component-Cke7O8gk.js +0 -154
- package/dist/chunks/tab.types-DpmXyw5C.js +0 -2
- package/dist/chunks/tag.component-79aRVI7u.js +0 -82
- package/dist/chunks/tag.component-79aRVI7u.js.map +0 -1
- package/dist/chunks/tag.component-CAWh9OYa.js +0 -2
- package/dist/chunks/tag.component-CAWh9OYa.js.map +0 -1
- package/dist/chunks/tagBlock.component-Dn7coOgp.js +0 -2
- package/dist/chunks/tagBlock.component-Dn7coOgp.js.map +0 -1
- package/dist/chunks/tagBlock.component-vLA90b5S.js +0 -169
- package/dist/chunks/tagBlock.component-vLA90b5S.js.map +0 -1
- package/dist/chunks/text.component-CHpMvCFa.js +0 -2
- package/dist/chunks/text.component-CHpMvCFa.js.map +0 -1
- package/dist/chunks/text.component-D9w-u_dB.js +0 -12
- package/dist/chunks/text.component-D9w-u_dB.js.map +0 -1
- package/dist/chunks/textInput.component-Dpxb2RI-.js +0 -169
- package/dist/chunks/textInput.component-Dpxb2RI-.js.map +0 -1
- package/dist/chunks/textInput.component-Dx_Ktcmr.js +0 -2
- package/dist/chunks/textInput.component-Dx_Ktcmr.js.map +0 -1
- package/dist/chunks/textarea.component-BYexywy1.js +0 -2
- package/dist/chunks/textarea.component-Dk2IMKkr.js +0 -79
- package/dist/chunks/theme.provider-XYBMZJTB.js +0 -28
- package/dist/chunks/theme.provider-XYBMZJTB.js.map +0 -1
- package/dist/chunks/theme.provider-w_I9S10D.js.map +0 -1
- package/dist/chunks/timePicker.component-Bbd3BOA6.js +0 -209
- package/dist/chunks/timePicker.component-Bbd3BOA6.js.map +0 -1
- package/dist/chunks/timePicker.component-DcNgUFGj.js +0 -2
- package/dist/chunks/timePicker.component-DcNgUFGj.js.map +0 -1
- package/dist/chunks/timeRange.component-BBhPc2LP.js +0 -18
- package/dist/chunks/timeRange.component-BBhPc2LP.js.map +0 -1
- package/dist/chunks/timeRange.component-Bb-xDHWT.js +0 -2
- package/dist/chunks/timeRange.component-Bb-xDHWT.js.map +0 -1
- package/dist/chunks/timestamp.component-CrY5t68x.js +0 -2
- package/dist/chunks/timestamp.component-CrY5t68x.js.map +0 -1
- package/dist/chunks/timestamp.component-m0FTjlAi.js +0 -51
- package/dist/chunks/timestamp.component-m0FTjlAi.js.map +0 -1
- package/dist/chunks/toaster.records-eCXbM85Z.js +0 -2
- package/dist/chunks/tooltip.component-CATpCSkf.js +0 -2
- package/dist/chunks/typography.records-CpYV1kns.js.map +0 -1
- package/dist/chunks/typography.records-Dbw3sz4i.js +0 -2
- package/dist/chunks/typography.records-Dbw3sz4i.js.map +0 -1
- package/dist/chunks/use-locale-context-CazVZ4Kg.js +0 -2315
- package/dist/chunks/use-locale-context-CazVZ4Kg.js.map +0 -1
- package/dist/chunks/use-locale-context-Dv7DQ_mn.js +0 -22
- package/dist/chunks/use-locale-context-Dv7DQ_mn.js.map +0 -1
- package/dist/chunks/use-slot-recipe-8liupslO.js +0 -2
- package/dist/chunks/use-slot-recipe-8liupslO.js.map +0 -1
- package/dist/chunks/use-slot-recipe-DhtQ1j_5.js +0 -13
- package/dist/chunks/use-slot-recipe-DhtQ1j_5.js.map +0 -1
- package/dist/chunks/withFormControl-BdiccBy5.js +0 -2
- package/dist/chunks/withFormControl-BdiccBy5.js.map +0 -1
- package/dist/chunks/withFormControl-CRXVopOk.js +0 -361
- package/dist/chunks/withFormControl-CRXVopOk.js.map +0 -1
- package/dist/chunks/withTruncation-C9XLf_j6.js +0 -67
- package/dist/chunks/withTruncation-C9XLf_j6.js.map +0 -1
- package/dist/chunks/withTruncation-Ddr3jvAO.js +0 -2
- package/dist/chunks/withTruncation-Ddr3jvAO.js.map +0 -1
- package/dist/types/components/Menu/components/MenuButton/menuButton.components.d.ts +0 -9
- package/dist/types/components/Menu/components/MenuToggleButtons/menuToggleButtons.d.ts +0 -10
- package/dist/types/shared/utils/argTypes.d.ts +0 -6
|
@@ -0,0 +1,4115 @@
|
|
|
1
|
+
import { au as k, aK as O, aL as it, t as ge, aM as ie, aN as Ae, e as W, n as z, A as ot, r as $, aO as jt, d as st, aP as Wt, aQ as lt, E as ut, b as d, v as dt, aA as ve, j as oe, w as se, h as be, F as Ee, H as zt, at as Y, G as ke, q as le, y as qt, ai as ct, aR as Kt, aS as Xt, _ as gt, $ as pt, aT as Yt, aU as Zt, x as Jt, ap as Qt, L as ht, c as X, g as ea, aV as ta, ab as ue, ae as aa, a0 as Me, aW as na, W as Ue, K as ft, a as Z, C as ra, i as ia, aX as mt, aY as oa, aZ as sa, a_ as la, ay as ua, a$ as Ge, b0 as Ce, b1 as da } from "./index-fHSGm2nC.js";
|
|
2
|
+
import { c as _ } from "./use-locale-context-Bw4Gg9Z0.js";
|
|
3
|
+
import { g as ca, a as ga } from "./index-C9UYIjEB.js";
|
|
4
|
+
import { t as pa, b as ha } from "./index-D3Q0mQNf.js";
|
|
5
|
+
var fa = Object.defineProperty, ma = (e, t, a) => t in e ? fa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, Ve = (e, t, a) => ma(e, t + "", a), va = (e, t, a) => {
|
|
6
|
+
const n = `linear-gradient(to ${e[+!t]}, transparent, #000)`;
|
|
7
|
+
return {
|
|
8
|
+
areaStyles: {
|
|
9
|
+
backgroundImage: `linear-gradient(to ${e[Number(t)]},rgb(${a},0,0),rgb(${a},255,0))`
|
|
10
|
+
},
|
|
11
|
+
areaGradientStyles: {
|
|
12
|
+
backgroundImage: `linear-gradient(to ${e[Number(t)]},rgb(${a},0,255),rgb(${a},255,255))`,
|
|
13
|
+
WebkitMaskImage: n,
|
|
14
|
+
maskImage: n
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}, ba = (e, t, a) => {
|
|
18
|
+
const n = `linear-gradient(to ${e[+!t]}, transparent, #000)`;
|
|
19
|
+
return {
|
|
20
|
+
areaStyles: {
|
|
21
|
+
backgroundImage: `linear-gradient(to ${e[Number(t)]},rgb(0,${a},0),rgb(255,${a},0))`
|
|
22
|
+
},
|
|
23
|
+
areaGradientStyles: {
|
|
24
|
+
backgroundImage: `linear-gradient(to ${e[Number(t)]},rgb(0,${a},255),rgb(255,${a},255))`,
|
|
25
|
+
WebkitMaskImage: n,
|
|
26
|
+
maskImage: n
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}, Ea = (e, t, a) => {
|
|
30
|
+
const n = `linear-gradient(to ${e[+!t]}, transparent, #000)`;
|
|
31
|
+
return {
|
|
32
|
+
areaStyles: {
|
|
33
|
+
backgroundImage: `linear-gradient(to ${e[Number(t)]},rgb(0,0,${a}),rgb(255,0,${a}))`
|
|
34
|
+
},
|
|
35
|
+
areaGradientStyles: {
|
|
36
|
+
backgroundImage: `linear-gradient(to ${e[Number(t)]},rgb(0,255,${a}),rgb(255,255,${a}))`,
|
|
37
|
+
WebkitMaskImage: n,
|
|
38
|
+
maskImage: n
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}, Ca = (e, t, a) => ({
|
|
42
|
+
areaStyles: {},
|
|
43
|
+
areaGradientStyles: {
|
|
44
|
+
background: [
|
|
45
|
+
`linear-gradient(to ${e[Number(t)]}, hsla(0,0%,0%,1) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,1) 100%)`,
|
|
46
|
+
`linear-gradient(to ${e[+!t]},hsl(0,0%,50%),hsla(0,0%,50%,0))`,
|
|
47
|
+
`hsl(${a}, 100%, 50%)`
|
|
48
|
+
].join(",")
|
|
49
|
+
}
|
|
50
|
+
}), ya = (e, t, a) => ({
|
|
51
|
+
areaStyles: {},
|
|
52
|
+
areaGradientStyles: {
|
|
53
|
+
background: [
|
|
54
|
+
`linear-gradient(to ${e[+!t]}, hsla(0,0%,0%,${a}) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,${a}) 100%)`,
|
|
55
|
+
`linear-gradient(to ${e[Number(t)]},hsla(0,100%,50%,${a}),hsla(60,100%,50%,${a}),hsla(120,100%,50%,${a}),hsla(180,100%,50%,${a}),hsla(240,100%,50%,${a}),hsla(300,100%,50%,${a}),hsla(359,100%,50%,${a}))`,
|
|
56
|
+
"hsl(0, 0%, 50%)"
|
|
57
|
+
].join(",")
|
|
58
|
+
}
|
|
59
|
+
}), Ia = (e, t, a) => ({
|
|
60
|
+
areaStyles: {},
|
|
61
|
+
areaGradientStyles: {
|
|
62
|
+
backgroundImage: [
|
|
63
|
+
`linear-gradient(to ${e[+!t]},hsl(0,0%,${a}%),hsla(0,0%,${a}%,0))`,
|
|
64
|
+
`linear-gradient(to ${e[Number(t)]},hsl(0,100%,${a}%),hsl(60,100%,${a}%),hsl(120,100%,${a}%),hsl(180,100%,${a}%),hsl(240,100%,${a}%),hsl(300,100%,${a}%),hsl(360,100%,${a}%))`
|
|
65
|
+
].join(",")
|
|
66
|
+
}
|
|
67
|
+
}), Sa = (e, t, a) => ({
|
|
68
|
+
areaStyles: {},
|
|
69
|
+
areaGradientStyles: {
|
|
70
|
+
background: [
|
|
71
|
+
`linear-gradient(to ${e[Number(t)]},hsl(0,0%,0%),hsla(0,0%,0%,0))`,
|
|
72
|
+
`linear-gradient(to ${e[+!t]},hsl(0,0%,100%),hsla(0,0%,100%,0))`,
|
|
73
|
+
`hsl(${a}, 100%, 50%)`
|
|
74
|
+
].join(",")
|
|
75
|
+
}
|
|
76
|
+
}), Oa = (e, t, a) => ({
|
|
77
|
+
areaStyles: {},
|
|
78
|
+
areaGradientStyles: {
|
|
79
|
+
background: [
|
|
80
|
+
`linear-gradient(to ${e[+!t]},hsla(0,0%,0%,${a}),hsla(0,0%,0%,0))`,
|
|
81
|
+
`linear-gradient(to ${e[Number(t)]},hsla(0,100%,50%,${a}),hsla(60,100%,50%,${a}),hsla(120,100%,50%,${a}),hsla(180,100%,50%,${a}),hsla(240,100%,50%,${a}),hsla(300,100%,50%,${a}),hsla(359,100%,50%,${a}))`,
|
|
82
|
+
`linear-gradient(to ${e[+!t]},hsl(0,0%,0%),hsl(0,0%,100%))`
|
|
83
|
+
].join(",")
|
|
84
|
+
}
|
|
85
|
+
}), Ta = (e, t, a) => ({
|
|
86
|
+
areaStyles: {},
|
|
87
|
+
areaGradientStyles: {
|
|
88
|
+
background: [
|
|
89
|
+
`linear-gradient(to ${e[+!t]},hsla(0,0%,100%,${a}),hsla(0,0%,100%,0))`,
|
|
90
|
+
`linear-gradient(to ${e[Number(t)]},hsla(0,100%,50%,${a}),hsla(60,100%,50%,${a}),hsla(120,100%,50%,${a}),hsla(180,100%,50%,${a}),hsla(240,100%,50%,${a}),hsla(300,100%,50%,${a}),hsla(359,100%,50%,${a}))`,
|
|
91
|
+
"#000"
|
|
92
|
+
].join(",")
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
function Be(e, t) {
|
|
96
|
+
const { xChannel: a, yChannel: n, dir: r = "ltr" } = t, { zChannel: i } = e.getColorAxes({ xChannel: a, yChannel: n }), o = e.getChannelValue(i), { minValue: s, maxValue: l } = e.getChannelRange(i), h = ["top", r === "rtl" ? "left" : "right"];
|
|
97
|
+
let v = !1, b = { areaStyles: {}, areaGradientStyles: {} }, m = (o - s) / (l - s), u = e.getFormat() === "hsla";
|
|
98
|
+
switch (i) {
|
|
99
|
+
case "red": {
|
|
100
|
+
v = a === "green", b = va(h, v, o);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case "green": {
|
|
104
|
+
v = a === "red", b = ba(h, v, o);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case "blue": {
|
|
108
|
+
v = a === "red", b = Ea(h, v, o);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case "hue": {
|
|
112
|
+
v = a !== "saturation", u ? b = Ca(h, v, o) : b = Sa(h, v, o);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
case "saturation": {
|
|
116
|
+
v = a === "hue", u ? b = ya(h, v, m) : b = Oa(h, v, m);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
case "brightness": {
|
|
120
|
+
v = a === "hue", b = Ta(h, v, m);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case "lightness": {
|
|
124
|
+
v = a === "hue", b = Ia(h, v, o);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return b;
|
|
129
|
+
}
|
|
130
|
+
var Ra = (e, t) => {
|
|
131
|
+
if (Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
132
|
+
for (let a in e) if (e[a] !== t[a]) return !1;
|
|
133
|
+
return !0;
|
|
134
|
+
}, Ne = class {
|
|
135
|
+
toHexInt() {
|
|
136
|
+
return this.toFormat("rgba").toHexInt();
|
|
137
|
+
}
|
|
138
|
+
getChannelValue(e) {
|
|
139
|
+
if (e in this) return this[e];
|
|
140
|
+
throw new Error("Unsupported color channel: " + e);
|
|
141
|
+
}
|
|
142
|
+
getChannelValuePercent(e, t) {
|
|
143
|
+
const a = t ?? this.getChannelValue(e), { minValue: n, maxValue: r } = this.getChannelRange(e);
|
|
144
|
+
return ge(a, n, r);
|
|
145
|
+
}
|
|
146
|
+
getChannelPercentValue(e, t) {
|
|
147
|
+
const { minValue: a, maxValue: n, step: r } = this.getChannelRange(e), i = Ae(t, a, n, r);
|
|
148
|
+
return ie(i, a, n, r);
|
|
149
|
+
}
|
|
150
|
+
withChannelValue(e, t) {
|
|
151
|
+
const { minValue: a, maxValue: n } = this.getChannelRange(e);
|
|
152
|
+
if (e in this) {
|
|
153
|
+
let r = this.clone();
|
|
154
|
+
return r[e] = k(t, a, n), r;
|
|
155
|
+
}
|
|
156
|
+
throw new Error("Unsupported color channel: " + e);
|
|
157
|
+
}
|
|
158
|
+
getColorAxes(e) {
|
|
159
|
+
let { xChannel: t, yChannel: a } = e, n = t || this.getChannels().find((o) => o !== a), r = a || this.getChannels().find((o) => o !== n), i = this.getChannels().find((o) => o !== n && o !== r);
|
|
160
|
+
return { xChannel: n, yChannel: r, zChannel: i };
|
|
161
|
+
}
|
|
162
|
+
incrementChannel(e, t) {
|
|
163
|
+
const { minValue: a, maxValue: n, step: r } = this.getChannelRange(e), i = ie(
|
|
164
|
+
k(this.getChannelValue(e) + t, a, n),
|
|
165
|
+
a,
|
|
166
|
+
n,
|
|
167
|
+
r
|
|
168
|
+
);
|
|
169
|
+
return this.withChannelValue(e, i);
|
|
170
|
+
}
|
|
171
|
+
decrementChannel(e, t) {
|
|
172
|
+
return this.incrementChannel(e, -t);
|
|
173
|
+
}
|
|
174
|
+
isEqual(e) {
|
|
175
|
+
return Ra(this.toJSON(), e.toJSON()) && this.getChannelValue("alpha") === e.getChannelValue("alpha");
|
|
176
|
+
}
|
|
177
|
+
}, wa = /^#[\da-f]+$/i, Pa = /^rgba?\((.*)\)$/, Fa = /[^#]/gi, vt = class ee extends Ne {
|
|
178
|
+
constructor(t, a, n, r) {
|
|
179
|
+
super(), this.red = t, this.green = a, this.blue = n, this.alpha = r;
|
|
180
|
+
}
|
|
181
|
+
static parse(t) {
|
|
182
|
+
let a = [];
|
|
183
|
+
if (wa.test(t) && [4, 5, 7, 9].includes(t.length)) {
|
|
184
|
+
const r = (t.length < 6 ? t.replace(Fa, "$&$&") : t).slice(1).split("");
|
|
185
|
+
for (; r.length > 0; )
|
|
186
|
+
a.push(parseInt(r.splice(0, 2).join(""), 16));
|
|
187
|
+
a[3] = a[3] !== void 0 ? a[3] / 255 : void 0;
|
|
188
|
+
}
|
|
189
|
+
const n = t.match(Pa);
|
|
190
|
+
return n?.[1] && (a = n[1].split(",").map((r) => Number(r.trim())).map((r, i) => k(r, 0, i < 3 ? 255 : 1))), a.length < 3 ? void 0 : new ee(a[0], a[1], a[2], a[3] ?? 1);
|
|
191
|
+
}
|
|
192
|
+
toString(t) {
|
|
193
|
+
switch (t) {
|
|
194
|
+
case "hex":
|
|
195
|
+
return "#" + (this.red.toString(16).padStart(2, "0") + this.green.toString(16).padStart(2, "0") + this.blue.toString(16).padStart(2, "0")).toUpperCase();
|
|
196
|
+
case "hexa":
|
|
197
|
+
return "#" + (this.red.toString(16).padStart(2, "0") + this.green.toString(16).padStart(2, "0") + this.blue.toString(16).padStart(2, "0") + Math.round(this.alpha * 255).toString(16).padStart(2, "0")).toUpperCase();
|
|
198
|
+
case "rgb":
|
|
199
|
+
return `rgb(${this.red}, ${this.green}, ${this.blue})`;
|
|
200
|
+
case "css":
|
|
201
|
+
case "rgba":
|
|
202
|
+
return `rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;
|
|
203
|
+
case "hsl":
|
|
204
|
+
return this.toHSL().toString("hsl");
|
|
205
|
+
case "hsb":
|
|
206
|
+
return this.toHSB().toString("hsb");
|
|
207
|
+
default:
|
|
208
|
+
return this.toFormat(t).toString(t);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
toFormat(t) {
|
|
212
|
+
switch (t) {
|
|
213
|
+
case "rgba":
|
|
214
|
+
return this;
|
|
215
|
+
case "hsba":
|
|
216
|
+
return this.toHSB();
|
|
217
|
+
case "hsla":
|
|
218
|
+
return this.toHSL();
|
|
219
|
+
default:
|
|
220
|
+
throw new Error("Unsupported color conversion: rgb -> " + t);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
toHexInt() {
|
|
224
|
+
return this.red << 16 | this.green << 8 | this.blue;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Converts an RGB color value to HSB.
|
|
228
|
+
* Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#From_RGB.
|
|
229
|
+
* @returns An HSBColor object.
|
|
230
|
+
*/
|
|
231
|
+
toHSB() {
|
|
232
|
+
const t = this.red / 255, a = this.green / 255, n = this.blue / 255, r = Math.min(t, a, n), i = Math.max(t, a, n), o = i - r, s = i === 0 ? 0 : o / i;
|
|
233
|
+
let l = 0;
|
|
234
|
+
if (o !== 0) {
|
|
235
|
+
switch (i) {
|
|
236
|
+
case t:
|
|
237
|
+
l = (a - n) / o + (a < n ? 6 : 0);
|
|
238
|
+
break;
|
|
239
|
+
case a:
|
|
240
|
+
l = (n - t) / o + 2;
|
|
241
|
+
break;
|
|
242
|
+
case n:
|
|
243
|
+
l = (t - a) / o + 4;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
l /= 6;
|
|
247
|
+
}
|
|
248
|
+
return new De(
|
|
249
|
+
O(l * 360, 2),
|
|
250
|
+
O(s * 100, 2),
|
|
251
|
+
O(i * 100, 2),
|
|
252
|
+
O(this.alpha, 2)
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Converts an RGB color value to HSL.
|
|
257
|
+
* Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#From_RGB.
|
|
258
|
+
* @returns An HSLColor object.
|
|
259
|
+
*/
|
|
260
|
+
toHSL() {
|
|
261
|
+
const t = this.red / 255, a = this.green / 255, n = this.blue / 255, r = Math.min(t, a, n), i = Math.max(t, a, n), o = (i + r) / 2, s = i - r;
|
|
262
|
+
let l = -1, h = -1;
|
|
263
|
+
if (s === 0)
|
|
264
|
+
l = h = 0;
|
|
265
|
+
else {
|
|
266
|
+
switch (h = s / (o < 0.5 ? i + r : 2 - i - r), i) {
|
|
267
|
+
case t:
|
|
268
|
+
l = (a - n) / s + (a < n ? 6 : 0);
|
|
269
|
+
break;
|
|
270
|
+
case a:
|
|
271
|
+
l = (n - t) / s + 2;
|
|
272
|
+
break;
|
|
273
|
+
case n:
|
|
274
|
+
l = (t - a) / s + 4;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
l /= 6;
|
|
278
|
+
}
|
|
279
|
+
return new Le(
|
|
280
|
+
O(l * 360, 2),
|
|
281
|
+
O(h * 100, 2),
|
|
282
|
+
O(o * 100, 2),
|
|
283
|
+
O(this.alpha, 2)
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
clone() {
|
|
287
|
+
return new ee(this.red, this.green, this.blue, this.alpha);
|
|
288
|
+
}
|
|
289
|
+
getChannelFormatOptions(t) {
|
|
290
|
+
switch (t) {
|
|
291
|
+
case "red":
|
|
292
|
+
case "green":
|
|
293
|
+
case "blue":
|
|
294
|
+
return { style: "decimal" };
|
|
295
|
+
case "alpha":
|
|
296
|
+
return { style: "percent" };
|
|
297
|
+
default:
|
|
298
|
+
throw new Error("Unknown color channel: " + t);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
formatChannelValue(t, a) {
|
|
302
|
+
let n = this.getChannelFormatOptions(t), r = this.getChannelValue(t);
|
|
303
|
+
return new Intl.NumberFormat(a, n).format(r);
|
|
304
|
+
}
|
|
305
|
+
getChannelRange(t) {
|
|
306
|
+
switch (t) {
|
|
307
|
+
case "red":
|
|
308
|
+
case "green":
|
|
309
|
+
case "blue":
|
|
310
|
+
return { minValue: 0, maxValue: 255, step: 1, pageSize: 17 };
|
|
311
|
+
case "alpha":
|
|
312
|
+
return { minValue: 0, maxValue: 1, step: 0.01, pageSize: 0.1 };
|
|
313
|
+
default:
|
|
314
|
+
throw new Error("Unknown color channel: " + t);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
toJSON() {
|
|
318
|
+
return { r: this.red, g: this.green, b: this.blue, a: this.alpha };
|
|
319
|
+
}
|
|
320
|
+
getFormat() {
|
|
321
|
+
return "rgba";
|
|
322
|
+
}
|
|
323
|
+
getChannels() {
|
|
324
|
+
return ee.colorChannels;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
Ve(vt, "colorChannels", ["red", "green", "blue"]);
|
|
328
|
+
var $e = vt, _a = /hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/, bt = class te extends Ne {
|
|
329
|
+
constructor(t, a, n, r) {
|
|
330
|
+
super(), this.hue = t, this.saturation = a, this.lightness = n, this.alpha = r;
|
|
331
|
+
}
|
|
332
|
+
static parse(t) {
|
|
333
|
+
let a;
|
|
334
|
+
if (a = t.match(_a)) {
|
|
335
|
+
const [n, r, i, o] = (a[1] ?? a[2]).split(",").map((s) => Number(s.trim().replace("%", "")));
|
|
336
|
+
return new te(it(n, 360), k(r, 0, 100), k(i, 0, 100), k(o ?? 1, 0, 1));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
toString(t) {
|
|
340
|
+
switch (t) {
|
|
341
|
+
case "hex":
|
|
342
|
+
return this.toRGB().toString("hex");
|
|
343
|
+
case "hexa":
|
|
344
|
+
return this.toRGB().toString("hexa");
|
|
345
|
+
case "hsl":
|
|
346
|
+
return `hsl(${this.hue}, ${O(this.saturation, 2)}%, ${O(this.lightness, 2)}%)`;
|
|
347
|
+
case "css":
|
|
348
|
+
case "hsla":
|
|
349
|
+
return `hsla(${this.hue}, ${O(this.saturation, 2)}%, ${O(this.lightness, 2)}%, ${this.alpha})`;
|
|
350
|
+
case "hsb":
|
|
351
|
+
return this.toHSB().toString("hsb");
|
|
352
|
+
case "rgb":
|
|
353
|
+
return this.toRGB().toString("rgb");
|
|
354
|
+
default:
|
|
355
|
+
return this.toFormat(t).toString(t);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
toFormat(t) {
|
|
359
|
+
switch (t) {
|
|
360
|
+
case "hsla":
|
|
361
|
+
return this;
|
|
362
|
+
case "hsba":
|
|
363
|
+
return this.toHSB();
|
|
364
|
+
case "rgba":
|
|
365
|
+
return this.toRGB();
|
|
366
|
+
default:
|
|
367
|
+
throw new Error("Unsupported color conversion: hsl -> " + t);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Converts a HSL color to HSB.
|
|
372
|
+
* Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV.
|
|
373
|
+
* @returns An HSBColor object.
|
|
374
|
+
*/
|
|
375
|
+
toHSB() {
|
|
376
|
+
let t = this.saturation / 100, a = this.lightness / 100, n = a + t * Math.min(a, 1 - a);
|
|
377
|
+
return t = n === 0 ? 0 : 2 * (1 - a / n), new De(
|
|
378
|
+
O(this.hue, 2),
|
|
379
|
+
O(t * 100, 2),
|
|
380
|
+
O(n * 100, 2),
|
|
381
|
+
O(this.alpha, 2)
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Converts a HSL color to RGB.
|
|
386
|
+
* Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative.
|
|
387
|
+
* @returns An RGBColor object.
|
|
388
|
+
*/
|
|
389
|
+
toRGB() {
|
|
390
|
+
let t = this.hue, a = this.saturation / 100, n = this.lightness / 100, r = a * Math.min(n, 1 - n), i = (o, s = (o + t / 30) % 12) => n - r * Math.max(Math.min(s - 3, 9 - s, 1), -1);
|
|
391
|
+
return new $e(
|
|
392
|
+
Math.round(i(0) * 255),
|
|
393
|
+
Math.round(i(8) * 255),
|
|
394
|
+
Math.round(i(4) * 255),
|
|
395
|
+
O(this.alpha, 2)
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
clone() {
|
|
399
|
+
return new te(this.hue, this.saturation, this.lightness, this.alpha);
|
|
400
|
+
}
|
|
401
|
+
getChannelFormatOptions(t) {
|
|
402
|
+
switch (t) {
|
|
403
|
+
case "hue":
|
|
404
|
+
return { style: "unit", unit: "degree", unitDisplay: "narrow" };
|
|
405
|
+
case "saturation":
|
|
406
|
+
case "lightness":
|
|
407
|
+
case "alpha":
|
|
408
|
+
return { style: "percent" };
|
|
409
|
+
default:
|
|
410
|
+
throw new Error("Unknown color channel: " + t);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
formatChannelValue(t, a) {
|
|
414
|
+
let n = this.getChannelFormatOptions(t), r = this.getChannelValue(t);
|
|
415
|
+
return (t === "saturation" || t === "lightness") && (r /= 100), new Intl.NumberFormat(a, n).format(r);
|
|
416
|
+
}
|
|
417
|
+
getChannelRange(t) {
|
|
418
|
+
switch (t) {
|
|
419
|
+
case "hue":
|
|
420
|
+
return { minValue: 0, maxValue: 360, step: 1, pageSize: 15 };
|
|
421
|
+
case "saturation":
|
|
422
|
+
case "lightness":
|
|
423
|
+
return { minValue: 0, maxValue: 100, step: 1, pageSize: 10 };
|
|
424
|
+
case "alpha":
|
|
425
|
+
return { minValue: 0, maxValue: 1, step: 0.01, pageSize: 0.1 };
|
|
426
|
+
default:
|
|
427
|
+
throw new Error("Unknown color channel: " + t);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
toJSON() {
|
|
431
|
+
return { h: this.hue, s: this.saturation, l: this.lightness, a: this.alpha };
|
|
432
|
+
}
|
|
433
|
+
getFormat() {
|
|
434
|
+
return "hsla";
|
|
435
|
+
}
|
|
436
|
+
getChannels() {
|
|
437
|
+
return te.colorChannels;
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
Ve(bt, "colorChannels", ["hue", "saturation", "lightness"]);
|
|
441
|
+
var Le = bt, xa = /hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/, Et = class ae extends Ne {
|
|
442
|
+
constructor(t, a, n, r) {
|
|
443
|
+
super(), this.hue = t, this.saturation = a, this.brightness = n, this.alpha = r;
|
|
444
|
+
}
|
|
445
|
+
static parse(t) {
|
|
446
|
+
let a;
|
|
447
|
+
if (a = t.match(xa)) {
|
|
448
|
+
const [n, r, i, o] = (a[1] ?? a[2]).split(",").map((s) => Number(s.trim().replace("%", "")));
|
|
449
|
+
return new ae(it(n, 360), k(r, 0, 100), k(i, 0, 100), k(o ?? 1, 0, 1));
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
toString(t) {
|
|
453
|
+
switch (t) {
|
|
454
|
+
case "css":
|
|
455
|
+
return this.toHSL().toString("css");
|
|
456
|
+
case "hex":
|
|
457
|
+
return this.toRGB().toString("hex");
|
|
458
|
+
case "hexa":
|
|
459
|
+
return this.toRGB().toString("hexa");
|
|
460
|
+
case "hsb":
|
|
461
|
+
return `hsb(${this.hue}, ${O(this.saturation, 2)}%, ${O(this.brightness, 2)}%)`;
|
|
462
|
+
case "hsba":
|
|
463
|
+
return `hsba(${this.hue}, ${O(this.saturation, 2)}%, ${O(this.brightness, 2)}%, ${this.alpha})`;
|
|
464
|
+
case "hsl":
|
|
465
|
+
return this.toHSL().toString("hsl");
|
|
466
|
+
case "rgb":
|
|
467
|
+
return this.toRGB().toString("rgb");
|
|
468
|
+
default:
|
|
469
|
+
return this.toFormat(t).toString(t);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
toFormat(t) {
|
|
473
|
+
switch (t) {
|
|
474
|
+
case "hsba":
|
|
475
|
+
return this;
|
|
476
|
+
case "hsla":
|
|
477
|
+
return this.toHSL();
|
|
478
|
+
case "rgba":
|
|
479
|
+
return this.toRGB();
|
|
480
|
+
default:
|
|
481
|
+
throw new Error("Unsupported color conversion: hsb -> " + t);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Converts a HSB color to HSL.
|
|
486
|
+
* Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_HSL.
|
|
487
|
+
* @returns An HSLColor object.
|
|
488
|
+
*/
|
|
489
|
+
toHSL() {
|
|
490
|
+
let t = this.saturation / 100, a = this.brightness / 100, n = a * (1 - t / 2);
|
|
491
|
+
return t = n === 0 || n === 1 ? 0 : (a - n) / Math.min(n, 1 - n), new Le(
|
|
492
|
+
O(this.hue, 2),
|
|
493
|
+
O(t * 100, 2),
|
|
494
|
+
O(n * 100, 2),
|
|
495
|
+
O(this.alpha, 2)
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Converts a HSV color value to RGB.
|
|
500
|
+
* Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_RGB_alternative.
|
|
501
|
+
* @returns An RGBColor object.
|
|
502
|
+
*/
|
|
503
|
+
toRGB() {
|
|
504
|
+
let t = this.hue, a = this.saturation / 100, n = this.brightness / 100, r = (i, o = (i + t / 60) % 6) => n - a * n * Math.max(Math.min(o, 4 - o, 1), 0);
|
|
505
|
+
return new $e(
|
|
506
|
+
Math.round(r(5) * 255),
|
|
507
|
+
Math.round(r(3) * 255),
|
|
508
|
+
Math.round(r(1) * 255),
|
|
509
|
+
O(this.alpha, 2)
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
clone() {
|
|
513
|
+
return new ae(this.hue, this.saturation, this.brightness, this.alpha);
|
|
514
|
+
}
|
|
515
|
+
getChannelFormatOptions(t) {
|
|
516
|
+
switch (t) {
|
|
517
|
+
case "hue":
|
|
518
|
+
return { style: "unit", unit: "degree", unitDisplay: "narrow" };
|
|
519
|
+
case "saturation":
|
|
520
|
+
case "brightness":
|
|
521
|
+
case "alpha":
|
|
522
|
+
return { style: "percent" };
|
|
523
|
+
default:
|
|
524
|
+
throw new Error("Unknown color channel: " + t);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
formatChannelValue(t, a) {
|
|
528
|
+
let n = this.getChannelFormatOptions(t), r = this.getChannelValue(t);
|
|
529
|
+
return (t === "saturation" || t === "brightness") && (r /= 100), new Intl.NumberFormat(a, n).format(r);
|
|
530
|
+
}
|
|
531
|
+
getChannelRange(t) {
|
|
532
|
+
switch (t) {
|
|
533
|
+
case "hue":
|
|
534
|
+
return { minValue: 0, maxValue: 360, step: 1, pageSize: 15 };
|
|
535
|
+
case "saturation":
|
|
536
|
+
case "brightness":
|
|
537
|
+
return { minValue: 0, maxValue: 100, step: 1, pageSize: 10 };
|
|
538
|
+
case "alpha":
|
|
539
|
+
return { minValue: 0, maxValue: 1, step: 0.01, pageSize: 0.1 };
|
|
540
|
+
default:
|
|
541
|
+
throw new Error("Unknown color channel: " + t);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
toJSON() {
|
|
545
|
+
return { h: this.hue, s: this.saturation, b: this.brightness, a: this.alpha };
|
|
546
|
+
}
|
|
547
|
+
getFormat() {
|
|
548
|
+
return "hsba";
|
|
549
|
+
}
|
|
550
|
+
getChannels() {
|
|
551
|
+
return ae.colorChannels;
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
Ve(Et, "colorChannels", ["hue", "saturation", "brightness"]);
|
|
555
|
+
var De = Et, Aa = "aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32", ka = (e) => {
|
|
556
|
+
const t = /* @__PURE__ */ new Map(), a = e.split(",");
|
|
557
|
+
for (let n = 0; n < a.length; n++) {
|
|
558
|
+
const [r, i] = a[n].split(":");
|
|
559
|
+
t.set(r, `#${i}`), r.includes("gray") && t.set(r.replace("gray", "grey"), `#${i}`);
|
|
560
|
+
}
|
|
561
|
+
return t;
|
|
562
|
+
}, He = ka(Aa), G = (e) => {
|
|
563
|
+
if (He.has(e))
|
|
564
|
+
return G(He.get(e));
|
|
565
|
+
const t = $e.parse(e) || De.parse(e) || Le.parse(e);
|
|
566
|
+
if (!t) {
|
|
567
|
+
const a = new Error("Invalid color value: " + e);
|
|
568
|
+
throw Error.captureStackTrace?.(a, G), a;
|
|
569
|
+
}
|
|
570
|
+
return t;
|
|
571
|
+
}, je = (e) => typeof e == "string" ? G(e) : e, Ct = W("color-picker", [
|
|
572
|
+
"root",
|
|
573
|
+
"label",
|
|
574
|
+
"control",
|
|
575
|
+
"trigger",
|
|
576
|
+
"positioner",
|
|
577
|
+
"content",
|
|
578
|
+
"area",
|
|
579
|
+
"areaThumb",
|
|
580
|
+
"valueText",
|
|
581
|
+
"areaBackground",
|
|
582
|
+
"channelSlider",
|
|
583
|
+
"channelSliderLabel",
|
|
584
|
+
"channelSliderTrack",
|
|
585
|
+
"channelSliderThumb",
|
|
586
|
+
"channelSliderValueText",
|
|
587
|
+
"channelInput",
|
|
588
|
+
"transparencyGrid",
|
|
589
|
+
"swatchGroup",
|
|
590
|
+
"swatchTrigger",
|
|
591
|
+
"swatchIndicator",
|
|
592
|
+
"swatch",
|
|
593
|
+
"eyeDropperTrigger",
|
|
594
|
+
"formatTrigger",
|
|
595
|
+
"formatSelect"
|
|
596
|
+
]), T = Ct.build(), Va = (e) => e.ids?.root ?? `color-picker:${e.id}`, We = (e) => e.ids?.label ?? `color-picker:${e.id}:label`, ye = (e) => e.ids?.hiddenInput ?? `color-picker:${e.id}:hidden-input`, yt = (e) => e.ids?.control ?? `color-picker:${e.id}:control`, It = (e) => e.ids?.trigger ?? `color-picker:${e.id}:trigger`, Ie = (e) => e.ids?.content ?? `color-picker:${e.id}:content`, St = (e) => e.ids?.positioner ?? `color-picker:${e.id}:positioner`, Na = (e) => e.ids?.formatSelect ?? `color-picker:${e.id}:format-select`, Ot = (e) => e.ids?.area ?? `color-picker:${e.id}:area`, $a = (e) => e.ids?.areaGradient ?? `color-picker:${e.id}:area-gradient`, Tt = (e) => e.ids?.areaThumb ?? `color-picker:${e.id}:area-thumb`, Rt = (e, t) => e.ids?.channelSliderTrack?.(t) ?? `color-picker:${e.id}:slider-track:${t}`, Se = (e, t) => e.ids?.channelSliderThumb?.(t) ?? `color-picker:${e.id}:slider-thumb:${t}`, ne = (e) => e.getById(Ie(e)), La = (e) => e.getById(Tt(e)), Da = (e, t) => e.getById(Se(e, t)), Ma = (e) => e.getById(Na(e)), ze = (e) => e.getById(ye(e)), Ua = (e) => e.getById(Ot(e)), Ga = (e, t) => {
|
|
597
|
+
const a = Ua(e);
|
|
598
|
+
if (!a) return;
|
|
599
|
+
const { percent: n } = ke(t, a);
|
|
600
|
+
return n;
|
|
601
|
+
}, wt = (e) => e.getById(yt(e)), me = (e) => e.getById(It(e)), Ba = (e) => e.getById(St(e)), Ha = (e, t) => e.getById(Rt(e, t)), ja = (e, t, a) => {
|
|
602
|
+
const n = Ha(e, a);
|
|
603
|
+
if (!n) return;
|
|
604
|
+
const { percent: r } = ke(t, n);
|
|
605
|
+
return r;
|
|
606
|
+
}, Wa = (e) => [
|
|
607
|
+
...le(ne(e), "input[data-channel]"),
|
|
608
|
+
...le(wt(e), "input[data-channel]")
|
|
609
|
+
];
|
|
610
|
+
function za(e, t) {
|
|
611
|
+
switch (t) {
|
|
612
|
+
case "hue":
|
|
613
|
+
return G(`hsl(${e.getChannelValue("hue")}, 100%, 50%)`);
|
|
614
|
+
case "lightness":
|
|
615
|
+
case "brightness":
|
|
616
|
+
case "saturation":
|
|
617
|
+
case "red":
|
|
618
|
+
case "green":
|
|
619
|
+
case "blue":
|
|
620
|
+
return e.withChannelValue("alpha", 1);
|
|
621
|
+
case "alpha":
|
|
622
|
+
return e;
|
|
623
|
+
default:
|
|
624
|
+
throw new Error("Unknown color channel: " + t);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
function Oe(e, t) {
|
|
628
|
+
if (t == null) return "";
|
|
629
|
+
if (t === "hex")
|
|
630
|
+
return e.toString("hex");
|
|
631
|
+
if (t === "css")
|
|
632
|
+
return e.toString("css");
|
|
633
|
+
if (t in e)
|
|
634
|
+
return e.getChannelValue(t).toString();
|
|
635
|
+
const a = e.getFormat() === "hsla";
|
|
636
|
+
switch (t) {
|
|
637
|
+
case "hue":
|
|
638
|
+
return a ? e.toFormat("hsla").getChannelValue("hue").toString() : e.toFormat("hsba").getChannelValue("hue").toString();
|
|
639
|
+
case "saturation":
|
|
640
|
+
return a ? e.toFormat("hsla").getChannelValue("saturation").toString() : e.toFormat("hsba").getChannelValue("saturation").toString();
|
|
641
|
+
case "lightness":
|
|
642
|
+
return e.toFormat("hsla").getChannelValue("lightness").toString();
|
|
643
|
+
case "brightness":
|
|
644
|
+
return e.toFormat("hsba").getChannelValue("brightness").toString();
|
|
645
|
+
case "red":
|
|
646
|
+
case "green":
|
|
647
|
+
case "blue":
|
|
648
|
+
return e.toFormat("rgba").getChannelValue(t).toString();
|
|
649
|
+
default:
|
|
650
|
+
return e.getChannelValue(t).toString();
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
function qa(e, t) {
|
|
654
|
+
switch (t) {
|
|
655
|
+
case "hex":
|
|
656
|
+
const a = G("#000000"), n = G("#FFFFFF");
|
|
657
|
+
return {
|
|
658
|
+
minValue: a.toHexInt(),
|
|
659
|
+
maxValue: n.toHexInt(),
|
|
660
|
+
pageSize: 10,
|
|
661
|
+
step: 1
|
|
662
|
+
};
|
|
663
|
+
case "css":
|
|
664
|
+
return;
|
|
665
|
+
case "hue":
|
|
666
|
+
case "saturation":
|
|
667
|
+
case "lightness":
|
|
668
|
+
return e.toFormat("hsla").getChannelRange(t);
|
|
669
|
+
case "brightness":
|
|
670
|
+
return e.toFormat("hsba").getChannelRange(t);
|
|
671
|
+
case "red":
|
|
672
|
+
case "green":
|
|
673
|
+
case "blue":
|
|
674
|
+
return e.toFormat("rgba").getChannelRange(t);
|
|
675
|
+
default:
|
|
676
|
+
return e.getChannelRange(t);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
function Ka(e, t) {
|
|
680
|
+
return e === "vertical" ? "top" : t === "ltr" ? "right" : "left";
|
|
681
|
+
}
|
|
682
|
+
var Xa = (e) => {
|
|
683
|
+
const { channel: t, value: a, dir: n, orientation: r } = e, i = Ka(r, n), { minValue: o, maxValue: s } = a.getChannelRange(t);
|
|
684
|
+
switch (t) {
|
|
685
|
+
case "hue":
|
|
686
|
+
return `linear-gradient(to ${i}, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)`;
|
|
687
|
+
case "lightness": {
|
|
688
|
+
let l = a.withChannelValue(t, o).toString("css"), h = a.withChannelValue(t, (s - o) / 2).toString("css"), v = a.withChannelValue(t, s).toString("css");
|
|
689
|
+
return `linear-gradient(to ${i}, ${l}, ${h}, ${v})`;
|
|
690
|
+
}
|
|
691
|
+
case "saturation":
|
|
692
|
+
case "brightness":
|
|
693
|
+
case "red":
|
|
694
|
+
case "green":
|
|
695
|
+
case "blue":
|
|
696
|
+
case "alpha": {
|
|
697
|
+
let l = a.withChannelValue(t, o).toString("css"), h = a.withChannelValue(t, s).toString("css");
|
|
698
|
+
return `linear-gradient(to ${i}, ${l}, ${h})`;
|
|
699
|
+
}
|
|
700
|
+
default:
|
|
701
|
+
throw new Error("Unknown color channel: " + t);
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
function Ur(e, t) {
|
|
705
|
+
const { context: a, send: n, prop: r, computed: i, state: o, scope: s } = e, l = a.get("value"), h = a.get("format"), v = i("areaValue"), b = i("valueAsString"), m = i("disabled"), u = i("interactive"), p = o.hasTag("dragging"), E = o.hasTag("open"), I = o.hasTag("focused"), F = (g) => {
|
|
706
|
+
const c = v.getChannels();
|
|
707
|
+
return {
|
|
708
|
+
xChannel: g.xChannel ?? c[1],
|
|
709
|
+
yChannel: g.yChannel ?? c[2]
|
|
710
|
+
};
|
|
711
|
+
}, P = a.get("currentPlacement"), B = ga({
|
|
712
|
+
...r("positioning"),
|
|
713
|
+
placement: P
|
|
714
|
+
});
|
|
715
|
+
function S(g) {
|
|
716
|
+
const c = je(g.value).toFormat(a.get("format"));
|
|
717
|
+
return {
|
|
718
|
+
value: c,
|
|
719
|
+
valueAsString: c.toString("hex"),
|
|
720
|
+
checked: c.isEqual(l),
|
|
721
|
+
disabled: g.disabled || !u
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
return {
|
|
725
|
+
dragging: p,
|
|
726
|
+
open: E,
|
|
727
|
+
valueAsString: b,
|
|
728
|
+
value: l,
|
|
729
|
+
inline: !!r("inline"),
|
|
730
|
+
setOpen(g) {
|
|
731
|
+
r("inline") || o.hasTag("open") === g || n({ type: g ? "OPEN" : "CLOSE" });
|
|
732
|
+
},
|
|
733
|
+
setValue(g) {
|
|
734
|
+
n({ type: "VALUE.SET", value: je(g), src: "set-color" });
|
|
735
|
+
},
|
|
736
|
+
getChannelValue(g) {
|
|
737
|
+
return Oe(l, g);
|
|
738
|
+
},
|
|
739
|
+
getChannelValueText(g, c) {
|
|
740
|
+
return l.formatChannelValue(g, c);
|
|
741
|
+
},
|
|
742
|
+
setChannelValue(g, c) {
|
|
743
|
+
const f = l.withChannelValue(g, c);
|
|
744
|
+
n({ type: "VALUE.SET", value: f, src: "set-channel" });
|
|
745
|
+
},
|
|
746
|
+
format: a.get("format"),
|
|
747
|
+
setFormat(g) {
|
|
748
|
+
const c = l.toFormat(g);
|
|
749
|
+
n({ type: "VALUE.SET", value: c, src: "set-format" });
|
|
750
|
+
},
|
|
751
|
+
alpha: l.getChannelValue("alpha"),
|
|
752
|
+
setAlpha(g) {
|
|
753
|
+
const c = l.withChannelValue("alpha", g);
|
|
754
|
+
n({ type: "VALUE.SET", value: c, src: "set-alpha" });
|
|
755
|
+
},
|
|
756
|
+
getRootProps() {
|
|
757
|
+
return t.element({
|
|
758
|
+
...T.root.attrs,
|
|
759
|
+
dir: r("dir"),
|
|
760
|
+
id: Va(s),
|
|
761
|
+
"data-disabled": d(m),
|
|
762
|
+
"data-readonly": d(r("readOnly")),
|
|
763
|
+
"data-invalid": d(r("invalid")),
|
|
764
|
+
style: {
|
|
765
|
+
"--value": l.toString("css")
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
},
|
|
769
|
+
getLabelProps() {
|
|
770
|
+
return t.element({
|
|
771
|
+
...T.label.attrs,
|
|
772
|
+
dir: r("dir"),
|
|
773
|
+
id: We(s),
|
|
774
|
+
htmlFor: ye(s),
|
|
775
|
+
"data-disabled": d(m),
|
|
776
|
+
"data-readonly": d(r("readOnly")),
|
|
777
|
+
"data-invalid": d(r("invalid")),
|
|
778
|
+
"data-focus": d(I),
|
|
779
|
+
onClick(g) {
|
|
780
|
+
g.preventDefault(), zt(wt(s), "[data-channel=hex]")?.focus({ preventScroll: !0 });
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
},
|
|
784
|
+
getControlProps() {
|
|
785
|
+
return t.element({
|
|
786
|
+
...T.control.attrs,
|
|
787
|
+
id: yt(s),
|
|
788
|
+
dir: r("dir"),
|
|
789
|
+
"data-disabled": d(m),
|
|
790
|
+
"data-readonly": d(r("readOnly")),
|
|
791
|
+
"data-invalid": d(r("invalid")),
|
|
792
|
+
"data-state": E ? "open" : "closed",
|
|
793
|
+
"data-focus": d(I)
|
|
794
|
+
});
|
|
795
|
+
},
|
|
796
|
+
getTriggerProps() {
|
|
797
|
+
return t.button({
|
|
798
|
+
...T.trigger.attrs,
|
|
799
|
+
id: It(s),
|
|
800
|
+
dir: r("dir"),
|
|
801
|
+
disabled: m,
|
|
802
|
+
"aria-label": `select color. current color is ${b}`,
|
|
803
|
+
"aria-controls": Ie(s),
|
|
804
|
+
"aria-labelledby": We(s),
|
|
805
|
+
"data-disabled": d(m),
|
|
806
|
+
"data-readonly": d(r("readOnly")),
|
|
807
|
+
"data-invalid": d(r("invalid")),
|
|
808
|
+
"data-placement": P,
|
|
809
|
+
"aria-expanded": d(E),
|
|
810
|
+
"data-state": E ? "open" : "closed",
|
|
811
|
+
"data-focus": d(I),
|
|
812
|
+
type: "button",
|
|
813
|
+
onClick() {
|
|
814
|
+
u && n({ type: "TRIGGER.CLICK" });
|
|
815
|
+
},
|
|
816
|
+
onBlur() {
|
|
817
|
+
u && n({ type: "TRIGGER.BLUR" });
|
|
818
|
+
},
|
|
819
|
+
style: {
|
|
820
|
+
position: "relative"
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
},
|
|
824
|
+
getPositionerProps() {
|
|
825
|
+
return t.element({
|
|
826
|
+
...T.positioner.attrs,
|
|
827
|
+
id: St(s),
|
|
828
|
+
dir: r("dir"),
|
|
829
|
+
style: B.floating
|
|
830
|
+
});
|
|
831
|
+
},
|
|
832
|
+
getContentProps() {
|
|
833
|
+
return t.element({
|
|
834
|
+
...T.content.attrs,
|
|
835
|
+
id: Ie(s),
|
|
836
|
+
dir: r("dir"),
|
|
837
|
+
tabIndex: -1,
|
|
838
|
+
"data-placement": P,
|
|
839
|
+
"data-state": E ? "open" : "closed",
|
|
840
|
+
hidden: !E
|
|
841
|
+
});
|
|
842
|
+
},
|
|
843
|
+
getValueTextProps() {
|
|
844
|
+
return t.element({
|
|
845
|
+
...T.valueText.attrs,
|
|
846
|
+
dir: r("dir"),
|
|
847
|
+
"data-disabled": d(m),
|
|
848
|
+
"data-focus": d(I)
|
|
849
|
+
});
|
|
850
|
+
},
|
|
851
|
+
getAreaProps(g = {}) {
|
|
852
|
+
const { xChannel: c, yChannel: f } = F(g), { areaStyles: y } = Be(v, {
|
|
853
|
+
xChannel: c,
|
|
854
|
+
yChannel: f,
|
|
855
|
+
dir: r("dir")
|
|
856
|
+
});
|
|
857
|
+
return t.element({
|
|
858
|
+
...T.area.attrs,
|
|
859
|
+
id: Ot(s),
|
|
860
|
+
role: "group",
|
|
861
|
+
"data-invalid": d(r("invalid")),
|
|
862
|
+
"data-disabled": d(m),
|
|
863
|
+
"data-readonly": d(r("readOnly")),
|
|
864
|
+
onPointerDown(C) {
|
|
865
|
+
if (!u || !se(C) || be(C)) return;
|
|
866
|
+
const R = Ee(C);
|
|
867
|
+
n({ type: "AREA.POINTER_DOWN", point: R, channel: { xChannel: c, yChannel: f }, id: "area" }), C.preventDefault();
|
|
868
|
+
},
|
|
869
|
+
style: {
|
|
870
|
+
position: "relative",
|
|
871
|
+
touchAction: "none",
|
|
872
|
+
forcedColorAdjust: "none",
|
|
873
|
+
...y
|
|
874
|
+
}
|
|
875
|
+
});
|
|
876
|
+
},
|
|
877
|
+
getAreaBackgroundProps(g = {}) {
|
|
878
|
+
const { xChannel: c, yChannel: f } = F(g), { areaGradientStyles: y } = Be(v, {
|
|
879
|
+
xChannel: c,
|
|
880
|
+
yChannel: f,
|
|
881
|
+
dir: r("dir")
|
|
882
|
+
});
|
|
883
|
+
return t.element({
|
|
884
|
+
...T.areaBackground.attrs,
|
|
885
|
+
id: $a(s),
|
|
886
|
+
"data-invalid": d(r("invalid")),
|
|
887
|
+
"data-disabled": d(m),
|
|
888
|
+
"data-readonly": d(r("readOnly")),
|
|
889
|
+
style: {
|
|
890
|
+
position: "relative",
|
|
891
|
+
touchAction: "none",
|
|
892
|
+
forcedColorAdjust: "none",
|
|
893
|
+
...y
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
},
|
|
897
|
+
getAreaThumbProps(g = {}) {
|
|
898
|
+
const { xChannel: c, yChannel: f } = F(g), y = { xChannel: c, yChannel: f }, C = v.getChannelValuePercent(c), R = 1 - v.getChannelValuePercent(f), L = v.getChannelValue(c), H = v.getChannelValue(f), x = v.withChannelValue("alpha", 1).toString("css");
|
|
899
|
+
return t.element({
|
|
900
|
+
...T.areaThumb.attrs,
|
|
901
|
+
id: Tt(s),
|
|
902
|
+
dir: r("dir"),
|
|
903
|
+
tabIndex: m ? void 0 : 0,
|
|
904
|
+
"data-disabled": d(m),
|
|
905
|
+
"data-invalid": d(r("invalid")),
|
|
906
|
+
"data-readonly": d(r("readOnly")),
|
|
907
|
+
role: "slider",
|
|
908
|
+
"aria-valuemin": 0,
|
|
909
|
+
"aria-valuemax": 100,
|
|
910
|
+
"aria-valuenow": L,
|
|
911
|
+
"aria-label": `${c} and ${f}`,
|
|
912
|
+
"aria-roledescription": "2d slider",
|
|
913
|
+
"aria-valuetext": `${c} ${L}, ${f} ${H}`,
|
|
914
|
+
style: {
|
|
915
|
+
position: "absolute",
|
|
916
|
+
left: `${C * 100}%`,
|
|
917
|
+
top: `${R * 100}%`,
|
|
918
|
+
transform: "translate(-50%, -50%)",
|
|
919
|
+
touchAction: "none",
|
|
920
|
+
forcedColorAdjust: "none",
|
|
921
|
+
"--color": x,
|
|
922
|
+
background: x
|
|
923
|
+
},
|
|
924
|
+
onFocus() {
|
|
925
|
+
u && n({ type: "AREA.FOCUS", id: "area", channel: y });
|
|
926
|
+
},
|
|
927
|
+
onKeyDown(w) {
|
|
928
|
+
if (w.defaultPrevented || !u) return;
|
|
929
|
+
const A = ve(w), M = {
|
|
930
|
+
ArrowUp() {
|
|
931
|
+
n({ type: "AREA.ARROW_UP", channel: y, step: A });
|
|
932
|
+
},
|
|
933
|
+
ArrowDown() {
|
|
934
|
+
n({ type: "AREA.ARROW_DOWN", channel: y, step: A });
|
|
935
|
+
},
|
|
936
|
+
ArrowLeft() {
|
|
937
|
+
n({ type: "AREA.ARROW_LEFT", channel: y, step: A });
|
|
938
|
+
},
|
|
939
|
+
ArrowRight() {
|
|
940
|
+
n({ type: "AREA.ARROW_RIGHT", channel: y, step: A });
|
|
941
|
+
},
|
|
942
|
+
PageUp() {
|
|
943
|
+
n({ type: "AREA.PAGE_UP", channel: y, step: A });
|
|
944
|
+
},
|
|
945
|
+
PageDown() {
|
|
946
|
+
n({ type: "AREA.PAGE_DOWN", channel: y, step: A });
|
|
947
|
+
},
|
|
948
|
+
Escape(fe) {
|
|
949
|
+
fe.stopPropagation();
|
|
950
|
+
}
|
|
951
|
+
}[oe(w, {
|
|
952
|
+
dir: r("dir")
|
|
953
|
+
})];
|
|
954
|
+
M && (M(w), w.preventDefault());
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
},
|
|
958
|
+
getTransparencyGridProps(g = {}) {
|
|
959
|
+
const { size: c = "12px" } = g;
|
|
960
|
+
return t.element({
|
|
961
|
+
...T.transparencyGrid.attrs,
|
|
962
|
+
style: {
|
|
963
|
+
"--size": c,
|
|
964
|
+
width: "100%",
|
|
965
|
+
height: "100%",
|
|
966
|
+
position: "absolute",
|
|
967
|
+
backgroundColor: "#fff",
|
|
968
|
+
backgroundImage: "conic-gradient(#eeeeee 0 25%, transparent 0 50%, #eeeeee 0 75%, transparent 0)",
|
|
969
|
+
backgroundSize: "var(--size) var(--size)",
|
|
970
|
+
inset: "0px",
|
|
971
|
+
zIndex: "auto",
|
|
972
|
+
pointerEvents: "none"
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
},
|
|
976
|
+
getChannelSliderProps(g) {
|
|
977
|
+
const { orientation: c = "horizontal", channel: f, format: y } = g;
|
|
978
|
+
return t.element({
|
|
979
|
+
...T.channelSlider.attrs,
|
|
980
|
+
"data-channel": f,
|
|
981
|
+
"data-orientation": c,
|
|
982
|
+
role: "presentation",
|
|
983
|
+
onPointerDown(C) {
|
|
984
|
+
if (!u || !se(C) || be(C)) return;
|
|
985
|
+
const R = Ee(C);
|
|
986
|
+
n({ type: "CHANNEL_SLIDER.POINTER_DOWN", channel: f, format: y, point: R, id: f, orientation: c }), C.preventDefault();
|
|
987
|
+
},
|
|
988
|
+
style: {
|
|
989
|
+
position: "relative",
|
|
990
|
+
touchAction: "none"
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
},
|
|
994
|
+
getChannelSliderTrackProps(g) {
|
|
995
|
+
const { orientation: c = "horizontal", channel: f, format: y } = g, C = y ? l.toFormat(y) : v;
|
|
996
|
+
return t.element({
|
|
997
|
+
...T.channelSliderTrack.attrs,
|
|
998
|
+
id: Rt(s, f),
|
|
999
|
+
role: "group",
|
|
1000
|
+
"data-channel": f,
|
|
1001
|
+
"data-orientation": c,
|
|
1002
|
+
style: {
|
|
1003
|
+
position: "relative",
|
|
1004
|
+
forcedColorAdjust: "none",
|
|
1005
|
+
backgroundImage: Xa({
|
|
1006
|
+
orientation: c,
|
|
1007
|
+
channel: f,
|
|
1008
|
+
dir: r("dir"),
|
|
1009
|
+
value: C
|
|
1010
|
+
})
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
},
|
|
1014
|
+
getChannelSliderLabelProps(g) {
|
|
1015
|
+
const { channel: c } = g;
|
|
1016
|
+
return t.element({
|
|
1017
|
+
...T.channelSliderLabel.attrs,
|
|
1018
|
+
"data-channel": c,
|
|
1019
|
+
onClick(f) {
|
|
1020
|
+
if (!u) return;
|
|
1021
|
+
f.preventDefault();
|
|
1022
|
+
const y = Se(s, c);
|
|
1023
|
+
s.getById(y)?.focus({ preventScroll: !0 });
|
|
1024
|
+
},
|
|
1025
|
+
style: {
|
|
1026
|
+
userSelect: "none",
|
|
1027
|
+
WebkitUserSelect: "none"
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
},
|
|
1031
|
+
getChannelSliderValueTextProps(g) {
|
|
1032
|
+
return t.element({
|
|
1033
|
+
...T.channelSliderValueText.attrs,
|
|
1034
|
+
"data-channel": g.channel
|
|
1035
|
+
});
|
|
1036
|
+
},
|
|
1037
|
+
getChannelSliderThumbProps(g) {
|
|
1038
|
+
const { orientation: c = "horizontal", channel: f, format: y } = g, C = y ? l.toFormat(y) : v, R = C.getChannelRange(f), L = C.getChannelValue(f), H = (L - R.minValue) / (R.maxValue - R.minValue), x = c === "horizontal" ? { left: `${H * 100}%`, top: "50%" } : { top: `${H * 100}%`, left: "50%" };
|
|
1039
|
+
return t.element({
|
|
1040
|
+
...T.channelSliderThumb.attrs,
|
|
1041
|
+
id: Se(s, f),
|
|
1042
|
+
role: "slider",
|
|
1043
|
+
"aria-label": f,
|
|
1044
|
+
tabIndex: m ? void 0 : 0,
|
|
1045
|
+
"data-channel": f,
|
|
1046
|
+
"data-disabled": d(m),
|
|
1047
|
+
"data-orientation": c,
|
|
1048
|
+
"aria-disabled": d(m),
|
|
1049
|
+
"aria-orientation": c,
|
|
1050
|
+
"aria-valuemax": R.maxValue,
|
|
1051
|
+
"aria-valuemin": R.minValue,
|
|
1052
|
+
"aria-valuenow": L,
|
|
1053
|
+
"aria-valuetext": `${f} ${L}`,
|
|
1054
|
+
style: {
|
|
1055
|
+
forcedColorAdjust: "none",
|
|
1056
|
+
position: "absolute",
|
|
1057
|
+
background: za(v, f).toString("css"),
|
|
1058
|
+
...x
|
|
1059
|
+
},
|
|
1060
|
+
onFocus() {
|
|
1061
|
+
u && n({ type: "CHANNEL_SLIDER.FOCUS", channel: f });
|
|
1062
|
+
},
|
|
1063
|
+
onKeyDown(w) {
|
|
1064
|
+
if (w.defaultPrevented || !u) return;
|
|
1065
|
+
const A = ve(w) * R.step, M = {
|
|
1066
|
+
ArrowUp() {
|
|
1067
|
+
n({ type: "CHANNEL_SLIDER.ARROW_UP", channel: f, step: A });
|
|
1068
|
+
},
|
|
1069
|
+
ArrowDown() {
|
|
1070
|
+
n({ type: "CHANNEL_SLIDER.ARROW_DOWN", channel: f, step: A });
|
|
1071
|
+
},
|
|
1072
|
+
ArrowLeft() {
|
|
1073
|
+
n({ type: "CHANNEL_SLIDER.ARROW_LEFT", channel: f, step: A });
|
|
1074
|
+
},
|
|
1075
|
+
ArrowRight() {
|
|
1076
|
+
n({ type: "CHANNEL_SLIDER.ARROW_RIGHT", channel: f, step: A });
|
|
1077
|
+
},
|
|
1078
|
+
PageUp() {
|
|
1079
|
+
n({ type: "CHANNEL_SLIDER.PAGE_UP", channel: f });
|
|
1080
|
+
},
|
|
1081
|
+
PageDown() {
|
|
1082
|
+
n({ type: "CHANNEL_SLIDER.PAGE_DOWN", channel: f });
|
|
1083
|
+
},
|
|
1084
|
+
Home() {
|
|
1085
|
+
n({ type: "CHANNEL_SLIDER.HOME", channel: f });
|
|
1086
|
+
},
|
|
1087
|
+
End() {
|
|
1088
|
+
n({ type: "CHANNEL_SLIDER.END", channel: f });
|
|
1089
|
+
},
|
|
1090
|
+
Escape(fe) {
|
|
1091
|
+
fe.stopPropagation();
|
|
1092
|
+
}
|
|
1093
|
+
}[oe(w, {
|
|
1094
|
+
dir: r("dir")
|
|
1095
|
+
})];
|
|
1096
|
+
M && (M(w), w.preventDefault());
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
},
|
|
1100
|
+
getChannelInputProps(g) {
|
|
1101
|
+
const { channel: c } = g, f = c === "hex" || c === "css", y = qa(l, c);
|
|
1102
|
+
return t.input({
|
|
1103
|
+
...T.channelInput.attrs,
|
|
1104
|
+
dir: r("dir"),
|
|
1105
|
+
type: f ? "text" : "number",
|
|
1106
|
+
"data-channel": c,
|
|
1107
|
+
"aria-label": c,
|
|
1108
|
+
spellCheck: !1,
|
|
1109
|
+
autoComplete: "off",
|
|
1110
|
+
disabled: m,
|
|
1111
|
+
"data-disabled": d(m),
|
|
1112
|
+
"data-invalid": d(r("invalid")),
|
|
1113
|
+
"data-readonly": d(r("readOnly")),
|
|
1114
|
+
readOnly: r("readOnly"),
|
|
1115
|
+
defaultValue: Oe(l, c),
|
|
1116
|
+
min: y?.minValue,
|
|
1117
|
+
max: y?.maxValue,
|
|
1118
|
+
step: y?.step,
|
|
1119
|
+
onBeforeInput(C) {
|
|
1120
|
+
if (f || !u) return;
|
|
1121
|
+
C.currentTarget.value.match(/[^0-9.]/g) && C.preventDefault();
|
|
1122
|
+
},
|
|
1123
|
+
onFocus(C) {
|
|
1124
|
+
u && (n({ type: "CHANNEL_INPUT.FOCUS", channel: c }), C.currentTarget.select());
|
|
1125
|
+
},
|
|
1126
|
+
onBlur(C) {
|
|
1127
|
+
if (!u) return;
|
|
1128
|
+
const R = f ? C.currentTarget.value : C.currentTarget.valueAsNumber;
|
|
1129
|
+
n({ type: "CHANNEL_INPUT.BLUR", channel: c, value: R, isTextField: f });
|
|
1130
|
+
},
|
|
1131
|
+
onKeyDown(C) {
|
|
1132
|
+
if (!C.defaultPrevented && u && C.key === "Enter") {
|
|
1133
|
+
const R = f ? C.currentTarget.value : C.currentTarget.valueAsNumber;
|
|
1134
|
+
n({ type: "CHANNEL_INPUT.CHANGE", channel: c, value: R, isTextField: f }), C.preventDefault();
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
style: {
|
|
1138
|
+
appearance: "none",
|
|
1139
|
+
WebkitAppearance: "none",
|
|
1140
|
+
MozAppearance: "textfield"
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
},
|
|
1144
|
+
getHiddenInputProps() {
|
|
1145
|
+
return t.input({
|
|
1146
|
+
type: "text",
|
|
1147
|
+
disabled: m,
|
|
1148
|
+
name: r("name"),
|
|
1149
|
+
tabIndex: -1,
|
|
1150
|
+
readOnly: r("readOnly"),
|
|
1151
|
+
required: r("required"),
|
|
1152
|
+
id: ye(s),
|
|
1153
|
+
style: dt,
|
|
1154
|
+
defaultValue: b
|
|
1155
|
+
});
|
|
1156
|
+
},
|
|
1157
|
+
getEyeDropperTriggerProps() {
|
|
1158
|
+
return t.button({
|
|
1159
|
+
...T.eyeDropperTrigger.attrs,
|
|
1160
|
+
type: "button",
|
|
1161
|
+
dir: r("dir"),
|
|
1162
|
+
disabled: m,
|
|
1163
|
+
"data-disabled": d(m),
|
|
1164
|
+
"data-invalid": d(r("invalid")),
|
|
1165
|
+
"data-readonly": d(r("readOnly")),
|
|
1166
|
+
"aria-label": "Pick a color from the screen",
|
|
1167
|
+
onClick() {
|
|
1168
|
+
u && n({ type: "EYEDROPPER.CLICK" });
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
},
|
|
1172
|
+
getSwatchGroupProps() {
|
|
1173
|
+
return t.element({
|
|
1174
|
+
...T.swatchGroup.attrs,
|
|
1175
|
+
role: "group"
|
|
1176
|
+
});
|
|
1177
|
+
},
|
|
1178
|
+
getSwatchTriggerState: S,
|
|
1179
|
+
getSwatchTriggerProps(g) {
|
|
1180
|
+
const c = S(g);
|
|
1181
|
+
return t.button({
|
|
1182
|
+
...T.swatchTrigger.attrs,
|
|
1183
|
+
disabled: c.disabled,
|
|
1184
|
+
dir: r("dir"),
|
|
1185
|
+
type: "button",
|
|
1186
|
+
"aria-label": `select ${c.valueAsString} as the color`,
|
|
1187
|
+
"data-state": c.checked ? "checked" : "unchecked",
|
|
1188
|
+
"data-value": c.valueAsString,
|
|
1189
|
+
"data-disabled": d(c.disabled),
|
|
1190
|
+
onClick() {
|
|
1191
|
+
c.disabled || n({ type: "SWATCH_TRIGGER.CLICK", value: c.value });
|
|
1192
|
+
},
|
|
1193
|
+
style: {
|
|
1194
|
+
"--color": c.valueAsString,
|
|
1195
|
+
position: "relative"
|
|
1196
|
+
}
|
|
1197
|
+
});
|
|
1198
|
+
},
|
|
1199
|
+
getSwatchIndicatorProps(g) {
|
|
1200
|
+
const c = S(g);
|
|
1201
|
+
return t.element({
|
|
1202
|
+
...T.swatchIndicator.attrs,
|
|
1203
|
+
dir: r("dir"),
|
|
1204
|
+
hidden: !c.checked
|
|
1205
|
+
});
|
|
1206
|
+
},
|
|
1207
|
+
getSwatchProps(g) {
|
|
1208
|
+
const { respectAlpha: c = !0 } = g, f = S(g), y = f.value.toString(c ? "css" : "hex");
|
|
1209
|
+
return t.element({
|
|
1210
|
+
...T.swatch.attrs,
|
|
1211
|
+
dir: r("dir"),
|
|
1212
|
+
"data-state": f.checked ? "checked" : "unchecked",
|
|
1213
|
+
"data-value": f.valueAsString,
|
|
1214
|
+
style: {
|
|
1215
|
+
"--color": y,
|
|
1216
|
+
position: "relative",
|
|
1217
|
+
background: y
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
},
|
|
1221
|
+
getFormatTriggerProps() {
|
|
1222
|
+
return t.button({
|
|
1223
|
+
...T.formatTrigger.attrs,
|
|
1224
|
+
dir: r("dir"),
|
|
1225
|
+
type: "button",
|
|
1226
|
+
"aria-label": `change color format to ${qe(h)}`,
|
|
1227
|
+
onClick(g) {
|
|
1228
|
+
if (g.currentTarget.disabled) return;
|
|
1229
|
+
const c = qe(h);
|
|
1230
|
+
n({ type: "FORMAT.SET", format: c, src: "format-trigger" });
|
|
1231
|
+
}
|
|
1232
|
+
});
|
|
1233
|
+
},
|
|
1234
|
+
getFormatSelectProps() {
|
|
1235
|
+
return t.select({
|
|
1236
|
+
...T.formatSelect.attrs,
|
|
1237
|
+
"aria-label": "change color format",
|
|
1238
|
+
dir: r("dir"),
|
|
1239
|
+
defaultValue: r("format"),
|
|
1240
|
+
disabled: m,
|
|
1241
|
+
onChange(g) {
|
|
1242
|
+
const c = Za(g.currentTarget.value);
|
|
1243
|
+
n({ type: "FORMAT.SET", format: c, src: "format-select" });
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
};
|
|
1248
|
+
}
|
|
1249
|
+
var re = ["hsba", "hsla", "rgba"], Ya = new RegExp(`^(${re.join("|")})$`);
|
|
1250
|
+
function qe(e) {
|
|
1251
|
+
const t = re.indexOf(e);
|
|
1252
|
+
return re[t + 1] ?? re[0];
|
|
1253
|
+
}
|
|
1254
|
+
function Za(e) {
|
|
1255
|
+
if (Ya.test(e)) return e;
|
|
1256
|
+
throw new Error(`Unsupported color format: ${e}`);
|
|
1257
|
+
}
|
|
1258
|
+
var Ke = (e) => G(e), Ja = /^[0-9a-fA-F]{3,8}$/;
|
|
1259
|
+
function Qa(e) {
|
|
1260
|
+
return Ja.test(e);
|
|
1261
|
+
}
|
|
1262
|
+
function en(e) {
|
|
1263
|
+
return e.startsWith("#") ? e : Qa(e) ? `#${e}` : e;
|
|
1264
|
+
}
|
|
1265
|
+
var { and: tn } = ot(), Gr = z({
|
|
1266
|
+
props({ props: e }) {
|
|
1267
|
+
return {
|
|
1268
|
+
dir: "ltr",
|
|
1269
|
+
defaultValue: Ke("#000000"),
|
|
1270
|
+
defaultFormat: "rgba",
|
|
1271
|
+
openAutoFocus: !0,
|
|
1272
|
+
...e,
|
|
1273
|
+
positioning: {
|
|
1274
|
+
placement: "bottom",
|
|
1275
|
+
...e.positioning
|
|
1276
|
+
}
|
|
1277
|
+
};
|
|
1278
|
+
},
|
|
1279
|
+
initialState({ prop: e }) {
|
|
1280
|
+
return e("open") || e("defaultOpen") || e("inline") ? "open" : "idle";
|
|
1281
|
+
},
|
|
1282
|
+
context({ prop: e, bindable: t, getContext: a }) {
|
|
1283
|
+
return {
|
|
1284
|
+
value: t(() => ({
|
|
1285
|
+
defaultValue: e("defaultValue"),
|
|
1286
|
+
value: e("value"),
|
|
1287
|
+
isEqual(n, r) {
|
|
1288
|
+
return n.toString("css") === r?.toString("css");
|
|
1289
|
+
},
|
|
1290
|
+
hash(n) {
|
|
1291
|
+
return n.toString("css");
|
|
1292
|
+
},
|
|
1293
|
+
onChange(n) {
|
|
1294
|
+
const r = a(), i = n.toString(r.get("format"));
|
|
1295
|
+
e("onValueChange")?.({ value: n, valueAsString: i });
|
|
1296
|
+
}
|
|
1297
|
+
})),
|
|
1298
|
+
format: t(() => ({
|
|
1299
|
+
defaultValue: e("defaultFormat"),
|
|
1300
|
+
value: e("format"),
|
|
1301
|
+
onChange(n) {
|
|
1302
|
+
e("onFormatChange")?.({ format: n });
|
|
1303
|
+
}
|
|
1304
|
+
})),
|
|
1305
|
+
activeId: t(() => ({ defaultValue: null })),
|
|
1306
|
+
activeChannel: t(() => ({ defaultValue: null })),
|
|
1307
|
+
activeOrientation: t(() => ({ defaultValue: null })),
|
|
1308
|
+
fieldsetDisabled: t(() => ({ defaultValue: !1 })),
|
|
1309
|
+
restoreFocus: t(() => ({ defaultValue: !0 })),
|
|
1310
|
+
currentPlacement: t(() => ({
|
|
1311
|
+
defaultValue: void 0
|
|
1312
|
+
}))
|
|
1313
|
+
};
|
|
1314
|
+
},
|
|
1315
|
+
computed: {
|
|
1316
|
+
rtl: ({ prop: e }) => e("dir") === "rtl",
|
|
1317
|
+
disabled: ({ prop: e, context: t }) => !!e("disabled") || t.get("fieldsetDisabled"),
|
|
1318
|
+
interactive: ({ prop: e }) => !(e("disabled") || e("readOnly")),
|
|
1319
|
+
valueAsString: ({ context: e }) => e.get("value").toString(e.get("format")),
|
|
1320
|
+
areaValue: ({ context: e }) => {
|
|
1321
|
+
const t = e.get("format").startsWith("hsl") ? "hsla" : "hsba";
|
|
1322
|
+
return e.get("value").toFormat(t);
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
effects: ["trackFormControl"],
|
|
1326
|
+
watch({ prop: e, context: t, action: a, track: n }) {
|
|
1327
|
+
n([() => t.hash("value")], () => {
|
|
1328
|
+
a(["syncInputElements", "dispatchChangeEvent"]);
|
|
1329
|
+
}), n([() => t.get("format")], () => {
|
|
1330
|
+
a(["syncFormatSelectElement"]);
|
|
1331
|
+
}), n([() => e("open")], () => {
|
|
1332
|
+
a(["toggleVisibility"]);
|
|
1333
|
+
});
|
|
1334
|
+
},
|
|
1335
|
+
on: {
|
|
1336
|
+
"VALUE.SET": {
|
|
1337
|
+
actions: ["setValue"]
|
|
1338
|
+
},
|
|
1339
|
+
"FORMAT.SET": {
|
|
1340
|
+
actions: ["setFormat"]
|
|
1341
|
+
},
|
|
1342
|
+
"CHANNEL_INPUT.CHANGE": {
|
|
1343
|
+
actions: ["setChannelColorFromInput"]
|
|
1344
|
+
},
|
|
1345
|
+
"EYEDROPPER.CLICK": {
|
|
1346
|
+
actions: ["openEyeDropper"]
|
|
1347
|
+
},
|
|
1348
|
+
"SWATCH_TRIGGER.CLICK": {
|
|
1349
|
+
actions: ["setValue"]
|
|
1350
|
+
}
|
|
1351
|
+
},
|
|
1352
|
+
states: {
|
|
1353
|
+
idle: {
|
|
1354
|
+
tags: ["closed"],
|
|
1355
|
+
on: {
|
|
1356
|
+
"CONTROLLED.OPEN": {
|
|
1357
|
+
target: "open",
|
|
1358
|
+
actions: ["setInitialFocus"]
|
|
1359
|
+
},
|
|
1360
|
+
OPEN: [
|
|
1361
|
+
{
|
|
1362
|
+
guard: "isOpenControlled",
|
|
1363
|
+
actions: ["invokeOnOpen"]
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
target: "open",
|
|
1367
|
+
actions: ["invokeOnOpen", "setInitialFocus"]
|
|
1368
|
+
}
|
|
1369
|
+
],
|
|
1370
|
+
"TRIGGER.CLICK": [
|
|
1371
|
+
{
|
|
1372
|
+
guard: "isOpenControlled",
|
|
1373
|
+
actions: ["invokeOnOpen"]
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
target: "open",
|
|
1377
|
+
actions: ["invokeOnOpen", "setInitialFocus"]
|
|
1378
|
+
}
|
|
1379
|
+
],
|
|
1380
|
+
"CHANNEL_INPUT.FOCUS": {
|
|
1381
|
+
target: "focused",
|
|
1382
|
+
actions: ["setActiveChannel"]
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1386
|
+
focused: {
|
|
1387
|
+
tags: ["closed", "focused"],
|
|
1388
|
+
on: {
|
|
1389
|
+
"CONTROLLED.OPEN": {
|
|
1390
|
+
target: "open",
|
|
1391
|
+
actions: ["setInitialFocus"]
|
|
1392
|
+
},
|
|
1393
|
+
OPEN: [
|
|
1394
|
+
{
|
|
1395
|
+
guard: "isOpenControlled",
|
|
1396
|
+
actions: ["invokeOnOpen"]
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
target: "open",
|
|
1400
|
+
actions: ["invokeOnOpen", "setInitialFocus"]
|
|
1401
|
+
}
|
|
1402
|
+
],
|
|
1403
|
+
"TRIGGER.CLICK": [
|
|
1404
|
+
{
|
|
1405
|
+
guard: "isOpenControlled",
|
|
1406
|
+
actions: ["invokeOnOpen"]
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
target: "open",
|
|
1410
|
+
actions: ["invokeOnOpen", "setInitialFocus"]
|
|
1411
|
+
}
|
|
1412
|
+
],
|
|
1413
|
+
"CHANNEL_INPUT.FOCUS": {
|
|
1414
|
+
actions: ["setActiveChannel"]
|
|
1415
|
+
},
|
|
1416
|
+
"CHANNEL_INPUT.BLUR": {
|
|
1417
|
+
target: "idle",
|
|
1418
|
+
actions: ["setChannelColorFromInput"]
|
|
1419
|
+
},
|
|
1420
|
+
"TRIGGER.BLUR": {
|
|
1421
|
+
target: "idle"
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
},
|
|
1425
|
+
open: {
|
|
1426
|
+
tags: ["open"],
|
|
1427
|
+
effects: ["trackPositioning", "trackDismissableElement"],
|
|
1428
|
+
on: {
|
|
1429
|
+
"CONTROLLED.CLOSE": [
|
|
1430
|
+
{
|
|
1431
|
+
guard: "shouldRestoreFocus",
|
|
1432
|
+
target: "focused",
|
|
1433
|
+
actions: ["setReturnFocus"]
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
target: "idle"
|
|
1437
|
+
}
|
|
1438
|
+
],
|
|
1439
|
+
"TRIGGER.CLICK": [
|
|
1440
|
+
{
|
|
1441
|
+
guard: "isOpenControlled",
|
|
1442
|
+
actions: ["invokeOnClose"]
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
target: "idle",
|
|
1446
|
+
actions: ["invokeOnClose"]
|
|
1447
|
+
}
|
|
1448
|
+
],
|
|
1449
|
+
"AREA.POINTER_DOWN": {
|
|
1450
|
+
target: "open:dragging",
|
|
1451
|
+
actions: ["setActiveChannel", "setAreaColorFromPoint", "focusAreaThumb"]
|
|
1452
|
+
},
|
|
1453
|
+
"AREA.FOCUS": {
|
|
1454
|
+
actions: ["setActiveChannel"]
|
|
1455
|
+
},
|
|
1456
|
+
"CHANNEL_SLIDER.POINTER_DOWN": {
|
|
1457
|
+
target: "open:dragging",
|
|
1458
|
+
actions: ["setActiveChannel", "setChannelColorFromPoint", "focusChannelThumb"]
|
|
1459
|
+
},
|
|
1460
|
+
"CHANNEL_SLIDER.FOCUS": {
|
|
1461
|
+
actions: ["setActiveChannel"]
|
|
1462
|
+
},
|
|
1463
|
+
"AREA.ARROW_LEFT": {
|
|
1464
|
+
actions: ["decrementAreaXChannel"]
|
|
1465
|
+
},
|
|
1466
|
+
"AREA.ARROW_RIGHT": {
|
|
1467
|
+
actions: ["incrementAreaXChannel"]
|
|
1468
|
+
},
|
|
1469
|
+
"AREA.ARROW_UP": {
|
|
1470
|
+
actions: ["incrementAreaYChannel"]
|
|
1471
|
+
},
|
|
1472
|
+
"AREA.ARROW_DOWN": {
|
|
1473
|
+
actions: ["decrementAreaYChannel"]
|
|
1474
|
+
},
|
|
1475
|
+
"AREA.PAGE_UP": {
|
|
1476
|
+
actions: ["incrementAreaXChannel"]
|
|
1477
|
+
},
|
|
1478
|
+
"AREA.PAGE_DOWN": {
|
|
1479
|
+
actions: ["decrementAreaXChannel"]
|
|
1480
|
+
},
|
|
1481
|
+
"CHANNEL_SLIDER.ARROW_LEFT": {
|
|
1482
|
+
actions: ["decrementChannel"]
|
|
1483
|
+
},
|
|
1484
|
+
"CHANNEL_SLIDER.ARROW_RIGHT": {
|
|
1485
|
+
actions: ["incrementChannel"]
|
|
1486
|
+
},
|
|
1487
|
+
"CHANNEL_SLIDER.ARROW_UP": {
|
|
1488
|
+
actions: ["incrementChannel"]
|
|
1489
|
+
},
|
|
1490
|
+
"CHANNEL_SLIDER.ARROW_DOWN": {
|
|
1491
|
+
actions: ["decrementChannel"]
|
|
1492
|
+
},
|
|
1493
|
+
"CHANNEL_SLIDER.PAGE_UP": {
|
|
1494
|
+
actions: ["incrementChannel"]
|
|
1495
|
+
},
|
|
1496
|
+
"CHANNEL_SLIDER.PAGE_DOWN": {
|
|
1497
|
+
actions: ["decrementChannel"]
|
|
1498
|
+
},
|
|
1499
|
+
"CHANNEL_SLIDER.HOME": {
|
|
1500
|
+
actions: ["setChannelToMin"]
|
|
1501
|
+
},
|
|
1502
|
+
"CHANNEL_SLIDER.END": {
|
|
1503
|
+
actions: ["setChannelToMax"]
|
|
1504
|
+
},
|
|
1505
|
+
"CHANNEL_INPUT.BLUR": {
|
|
1506
|
+
actions: ["setChannelColorFromInput"]
|
|
1507
|
+
},
|
|
1508
|
+
INTERACT_OUTSIDE: [
|
|
1509
|
+
{
|
|
1510
|
+
guard: "isOpenControlled",
|
|
1511
|
+
actions: ["invokeOnClose"]
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
guard: "shouldRestoreFocus",
|
|
1515
|
+
target: "focused",
|
|
1516
|
+
actions: ["invokeOnClose", "setReturnFocus"]
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
target: "idle",
|
|
1520
|
+
actions: ["invokeOnClose"]
|
|
1521
|
+
}
|
|
1522
|
+
],
|
|
1523
|
+
CLOSE: [
|
|
1524
|
+
{
|
|
1525
|
+
guard: "isOpenControlled",
|
|
1526
|
+
actions: ["invokeOnClose"]
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
target: "idle",
|
|
1530
|
+
actions: ["invokeOnClose"]
|
|
1531
|
+
}
|
|
1532
|
+
],
|
|
1533
|
+
"SWATCH_TRIGGER.CLICK": [
|
|
1534
|
+
{
|
|
1535
|
+
guard: tn("isOpenControlled", "closeOnSelect"),
|
|
1536
|
+
actions: ["setValue", "invokeOnClose"]
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
guard: "closeOnSelect",
|
|
1540
|
+
target: "focused",
|
|
1541
|
+
actions: ["setValue", "invokeOnClose", "setReturnFocus"]
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
actions: ["setValue"]
|
|
1545
|
+
}
|
|
1546
|
+
]
|
|
1547
|
+
}
|
|
1548
|
+
},
|
|
1549
|
+
"open:dragging": {
|
|
1550
|
+
tags: ["open"],
|
|
1551
|
+
exit: ["clearActiveChannel"],
|
|
1552
|
+
effects: ["trackPointerMove", "disableTextSelection", "trackPositioning", "trackDismissableElement"],
|
|
1553
|
+
on: {
|
|
1554
|
+
"CONTROLLED.CLOSE": [
|
|
1555
|
+
{
|
|
1556
|
+
guard: "shouldRestoreFocus",
|
|
1557
|
+
target: "focused",
|
|
1558
|
+
actions: ["setReturnFocus"]
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
target: "idle"
|
|
1562
|
+
}
|
|
1563
|
+
],
|
|
1564
|
+
"AREA.POINTER_MOVE": {
|
|
1565
|
+
actions: ["setAreaColorFromPoint", "focusAreaThumb"]
|
|
1566
|
+
},
|
|
1567
|
+
"AREA.POINTER_UP": {
|
|
1568
|
+
target: "open",
|
|
1569
|
+
actions: ["invokeOnChangeEnd"]
|
|
1570
|
+
},
|
|
1571
|
+
"CHANNEL_SLIDER.POINTER_MOVE": {
|
|
1572
|
+
actions: ["setChannelColorFromPoint", "focusChannelThumb"]
|
|
1573
|
+
},
|
|
1574
|
+
"CHANNEL_SLIDER.POINTER_UP": {
|
|
1575
|
+
target: "open",
|
|
1576
|
+
actions: ["invokeOnChangeEnd"]
|
|
1577
|
+
},
|
|
1578
|
+
INTERACT_OUTSIDE: [
|
|
1579
|
+
{
|
|
1580
|
+
guard: "isOpenControlled",
|
|
1581
|
+
actions: ["invokeOnClose"]
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
guard: "shouldRestoreFocus",
|
|
1585
|
+
target: "focused",
|
|
1586
|
+
actions: ["invokeOnClose", "setReturnFocus"]
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
target: "idle",
|
|
1590
|
+
actions: ["invokeOnClose"]
|
|
1591
|
+
}
|
|
1592
|
+
],
|
|
1593
|
+
CLOSE: [
|
|
1594
|
+
{
|
|
1595
|
+
guard: "isOpenControlled",
|
|
1596
|
+
actions: ["invokeOnClose"]
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
target: "idle",
|
|
1600
|
+
actions: ["invokeOnClose"]
|
|
1601
|
+
}
|
|
1602
|
+
]
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
},
|
|
1606
|
+
implementations: {
|
|
1607
|
+
guards: {
|
|
1608
|
+
closeOnSelect: ({ prop: e }) => !!e("closeOnSelect"),
|
|
1609
|
+
isOpenControlled: ({ prop: e }) => e("open") != null || !!e("inline"),
|
|
1610
|
+
shouldRestoreFocus: ({ context: e }) => !!e.get("restoreFocus")
|
|
1611
|
+
},
|
|
1612
|
+
effects: {
|
|
1613
|
+
trackPositioning({ context: e, prop: t, scope: a }) {
|
|
1614
|
+
if (t("inline")) return;
|
|
1615
|
+
e.get("currentPlacement") || e.set("currentPlacement", t("positioning")?.placement);
|
|
1616
|
+
const n = me(a);
|
|
1617
|
+
return ca(n, () => Ba(a), {
|
|
1618
|
+
...t("positioning"),
|
|
1619
|
+
defer: !0,
|
|
1620
|
+
onComplete(i) {
|
|
1621
|
+
e.set("currentPlacement", i.placement);
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
},
|
|
1625
|
+
trackDismissableElement({ context: e, scope: t, prop: a, send: n }) {
|
|
1626
|
+
return a("inline") ? void 0 : pa(() => ne(t), {
|
|
1627
|
+
exclude: me(t),
|
|
1628
|
+
defer: !0,
|
|
1629
|
+
onInteractOutside(i) {
|
|
1630
|
+
a("onInteractOutside")?.(i), !i.defaultPrevented && e.set("restoreFocus", !(i.detail.focusable || i.detail.contextmenu));
|
|
1631
|
+
},
|
|
1632
|
+
onPointerDownOutside: a("onPointerDownOutside"),
|
|
1633
|
+
onFocusOutside: a("onFocusOutside"),
|
|
1634
|
+
onDismiss() {
|
|
1635
|
+
n({ type: "INTERACT_OUTSIDE" });
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
},
|
|
1639
|
+
trackFormControl({ context: e, scope: t, send: a }) {
|
|
1640
|
+
const n = ze(t);
|
|
1641
|
+
return ut(n, {
|
|
1642
|
+
onFieldsetDisabledChange(r) {
|
|
1643
|
+
e.set("fieldsetDisabled", r);
|
|
1644
|
+
},
|
|
1645
|
+
onFormReset() {
|
|
1646
|
+
a({ type: "VALUE.SET", value: e.initial("value"), src: "form.reset" });
|
|
1647
|
+
}
|
|
1648
|
+
});
|
|
1649
|
+
},
|
|
1650
|
+
trackPointerMove({ context: e, scope: t, event: a, send: n }) {
|
|
1651
|
+
return lt(t.getDoc(), {
|
|
1652
|
+
onPointerMove({ point: r }) {
|
|
1653
|
+
const i = e.get("activeId") === "area" ? "AREA.POINTER_MOVE" : "CHANNEL_SLIDER.POINTER_MOVE";
|
|
1654
|
+
n({ type: i, point: r, format: a.format });
|
|
1655
|
+
},
|
|
1656
|
+
onPointerUp() {
|
|
1657
|
+
const r = e.get("activeId") === "area" ? "AREA.POINTER_UP" : "CHANNEL_SLIDER.POINTER_UP";
|
|
1658
|
+
n({ type: r });
|
|
1659
|
+
}
|
|
1660
|
+
});
|
|
1661
|
+
},
|
|
1662
|
+
disableTextSelection({ scope: e }) {
|
|
1663
|
+
return Wt({
|
|
1664
|
+
doc: e.getDoc(),
|
|
1665
|
+
target: ne(e)
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1669
|
+
actions: {
|
|
1670
|
+
openEyeDropper({ scope: e, context: t }) {
|
|
1671
|
+
const a = e.getWin();
|
|
1672
|
+
if (!("EyeDropper" in a)) return;
|
|
1673
|
+
new a.EyeDropper().open().then(({ sRGBHex: i }) => {
|
|
1674
|
+
const o = t.get("value").getFormat(), s = G(i).toFormat(o);
|
|
1675
|
+
t.set("value", s);
|
|
1676
|
+
}).catch(() => {
|
|
1677
|
+
});
|
|
1678
|
+
},
|
|
1679
|
+
setActiveChannel({ context: e, event: t }) {
|
|
1680
|
+
e.set("activeId", t.id), t.channel && e.set("activeChannel", t.channel), t.orientation && e.set("activeOrientation", t.orientation);
|
|
1681
|
+
},
|
|
1682
|
+
clearActiveChannel({ context: e }) {
|
|
1683
|
+
e.set("activeChannel", null), e.set("activeId", null), e.set("activeOrientation", null);
|
|
1684
|
+
},
|
|
1685
|
+
setAreaColorFromPoint({ context: e, event: t, computed: a, scope: n }) {
|
|
1686
|
+
const r = t.format ? e.get("value").toFormat(t.format) : a("areaValue"), { xChannel: i, yChannel: o } = t.channel || e.get("activeChannel"), s = Ga(n, t.point);
|
|
1687
|
+
if (!s) return;
|
|
1688
|
+
const l = r.getChannelPercentValue(i, s.x), h = r.getChannelPercentValue(o, 1 - s.y), v = r.withChannelValue(i, l).withChannelValue(o, h);
|
|
1689
|
+
e.set("value", v);
|
|
1690
|
+
},
|
|
1691
|
+
setChannelColorFromPoint({ context: e, event: t, computed: a, scope: n }) {
|
|
1692
|
+
const r = t.channel || e.get("activeId"), i = t.format ? e.get("value").toFormat(t.format) : a("areaValue"), o = ja(n, t.point, r);
|
|
1693
|
+
if (!o) return;
|
|
1694
|
+
const l = (e.get("activeOrientation") || "horizontal") === "horizontal" ? o.x : o.y, h = i.getChannelPercentValue(r, l), v = i.withChannelValue(r, h);
|
|
1695
|
+
e.set("value", v);
|
|
1696
|
+
},
|
|
1697
|
+
setValue({ context: e, event: t }) {
|
|
1698
|
+
e.set("value", t.value);
|
|
1699
|
+
},
|
|
1700
|
+
setFormat({ context: e, event: t }) {
|
|
1701
|
+
e.set("format", t.format);
|
|
1702
|
+
},
|
|
1703
|
+
dispatchChangeEvent({ scope: e, computed: t }) {
|
|
1704
|
+
st(ze(e), { value: t("valueAsString") });
|
|
1705
|
+
},
|
|
1706
|
+
syncInputElements({ context: e, scope: t }) {
|
|
1707
|
+
Xe(t, e.get("value"));
|
|
1708
|
+
},
|
|
1709
|
+
invokeOnChangeEnd({ context: e, prop: t, computed: a }) {
|
|
1710
|
+
t("onValueChangeEnd")?.({
|
|
1711
|
+
value: e.get("value"),
|
|
1712
|
+
valueAsString: a("valueAsString")
|
|
1713
|
+
});
|
|
1714
|
+
},
|
|
1715
|
+
setChannelColorFromInput({ context: e, event: t, scope: a, prop: n }) {
|
|
1716
|
+
const { channel: r, isTextField: i, value: o } = t, s = e.get("value").getChannelValue("alpha");
|
|
1717
|
+
let l;
|
|
1718
|
+
if (r === "alpha") {
|
|
1719
|
+
let h = parseFloat(o);
|
|
1720
|
+
h = Number.isNaN(h) ? s : h, l = e.get("value").withChannelValue("alpha", h);
|
|
1721
|
+
} else if (i)
|
|
1722
|
+
l = jt(
|
|
1723
|
+
() => {
|
|
1724
|
+
const h = r === "hex" ? en(o) : o;
|
|
1725
|
+
return Ke(h).withChannelValue("alpha", s);
|
|
1726
|
+
},
|
|
1727
|
+
() => e.get("value")
|
|
1728
|
+
);
|
|
1729
|
+
else {
|
|
1730
|
+
const h = e.get("value").toFormat(e.get("format")), v = Number.isNaN(o) ? h.getChannelValue(r) : o;
|
|
1731
|
+
l = h.withChannelValue(r, v);
|
|
1732
|
+
}
|
|
1733
|
+
Xe(a, e.get("value"), l), e.set("value", l), n("onValueChangeEnd")?.({
|
|
1734
|
+
value: l,
|
|
1735
|
+
valueAsString: l.toString(e.get("format"))
|
|
1736
|
+
});
|
|
1737
|
+
},
|
|
1738
|
+
incrementChannel({ context: e, event: t }) {
|
|
1739
|
+
const a = e.get("value").incrementChannel(t.channel, t.step);
|
|
1740
|
+
e.set("value", a);
|
|
1741
|
+
},
|
|
1742
|
+
decrementChannel({ context: e, event: t }) {
|
|
1743
|
+
const a = e.get("value").decrementChannel(t.channel, t.step);
|
|
1744
|
+
e.set("value", a);
|
|
1745
|
+
},
|
|
1746
|
+
incrementAreaXChannel({ context: e, event: t, computed: a }) {
|
|
1747
|
+
const { xChannel: n } = t.channel, r = a("areaValue").incrementChannel(n, t.step);
|
|
1748
|
+
e.set("value", r);
|
|
1749
|
+
},
|
|
1750
|
+
decrementAreaXChannel({ context: e, event: t, computed: a }) {
|
|
1751
|
+
const { xChannel: n } = t.channel, r = a("areaValue").decrementChannel(n, t.step);
|
|
1752
|
+
e.set("value", r);
|
|
1753
|
+
},
|
|
1754
|
+
incrementAreaYChannel({ context: e, event: t, computed: a }) {
|
|
1755
|
+
const { yChannel: n } = t.channel, r = a("areaValue").incrementChannel(n, t.step);
|
|
1756
|
+
e.set("value", r);
|
|
1757
|
+
},
|
|
1758
|
+
decrementAreaYChannel({ context: e, event: t, computed: a }) {
|
|
1759
|
+
const { yChannel: n } = t.channel, r = a("areaValue").decrementChannel(n, t.step);
|
|
1760
|
+
e.set("value", r);
|
|
1761
|
+
},
|
|
1762
|
+
setChannelToMax({ context: e, event: t }) {
|
|
1763
|
+
const a = e.get("value"), n = a.getChannelRange(t.channel), r = a.withChannelValue(t.channel, n.maxValue);
|
|
1764
|
+
e.set("value", r);
|
|
1765
|
+
},
|
|
1766
|
+
setChannelToMin({ context: e, event: t }) {
|
|
1767
|
+
const a = e.get("value"), n = a.getChannelRange(t.channel), r = a.withChannelValue(t.channel, n.minValue);
|
|
1768
|
+
e.set("value", r);
|
|
1769
|
+
},
|
|
1770
|
+
focusAreaThumb({ scope: e }) {
|
|
1771
|
+
$(() => {
|
|
1772
|
+
La(e)?.focus({ preventScroll: !0 });
|
|
1773
|
+
});
|
|
1774
|
+
},
|
|
1775
|
+
focusChannelThumb({ event: e, scope: t }) {
|
|
1776
|
+
$(() => {
|
|
1777
|
+
Da(t, e.channel)?.focus({ preventScroll: !0 });
|
|
1778
|
+
});
|
|
1779
|
+
},
|
|
1780
|
+
setInitialFocus({ prop: e, scope: t }) {
|
|
1781
|
+
e("openAutoFocus") && $(() => {
|
|
1782
|
+
qt({
|
|
1783
|
+
root: ne(t),
|
|
1784
|
+
getInitialEl: e("initialFocusEl")
|
|
1785
|
+
})?.focus({ preventScroll: !0 });
|
|
1786
|
+
});
|
|
1787
|
+
},
|
|
1788
|
+
setReturnFocus({ scope: e }) {
|
|
1789
|
+
$(() => {
|
|
1790
|
+
me(e)?.focus({ preventScroll: !0 });
|
|
1791
|
+
});
|
|
1792
|
+
},
|
|
1793
|
+
syncFormatSelectElement({ context: e, scope: t }) {
|
|
1794
|
+
an(t, e.get("format"));
|
|
1795
|
+
},
|
|
1796
|
+
invokeOnOpen({ prop: e }) {
|
|
1797
|
+
e("inline") || e("onOpenChange")?.({ open: !0 });
|
|
1798
|
+
},
|
|
1799
|
+
invokeOnClose({ prop: e }) {
|
|
1800
|
+
e("inline") || e("onOpenChange")?.({ open: !1 });
|
|
1801
|
+
},
|
|
1802
|
+
toggleVisibility({ prop: e, event: t, send: a }) {
|
|
1803
|
+
a({ type: e("open") ? "CONTROLLED.OPEN" : "CONTROLLED.CLOSE", previousEvent: t });
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1808
|
+
function Xe(e, t, a) {
|
|
1809
|
+
const n = Wa(e);
|
|
1810
|
+
$(() => {
|
|
1811
|
+
n.forEach((r) => {
|
|
1812
|
+
const i = r.dataset.channel;
|
|
1813
|
+
Y(r, Oe(a || t, i));
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
function an(e, t) {
|
|
1818
|
+
const a = Ma(e);
|
|
1819
|
+
a && $(() => Y(a, t));
|
|
1820
|
+
}
|
|
1821
|
+
_()([
|
|
1822
|
+
"closeOnSelect",
|
|
1823
|
+
"dir",
|
|
1824
|
+
"disabled",
|
|
1825
|
+
"format",
|
|
1826
|
+
"defaultFormat",
|
|
1827
|
+
"getRootNode",
|
|
1828
|
+
"id",
|
|
1829
|
+
"ids",
|
|
1830
|
+
"initialFocusEl",
|
|
1831
|
+
"inline",
|
|
1832
|
+
"name",
|
|
1833
|
+
"positioning",
|
|
1834
|
+
"onFocusOutside",
|
|
1835
|
+
"onFormatChange",
|
|
1836
|
+
"onInteractOutside",
|
|
1837
|
+
"onOpenChange",
|
|
1838
|
+
"onPointerDownOutside",
|
|
1839
|
+
"onValueChange",
|
|
1840
|
+
"onValueChangeEnd",
|
|
1841
|
+
"defaultOpen",
|
|
1842
|
+
"open",
|
|
1843
|
+
"positioning",
|
|
1844
|
+
"required",
|
|
1845
|
+
"readOnly",
|
|
1846
|
+
"value",
|
|
1847
|
+
"defaultValue",
|
|
1848
|
+
"invalid",
|
|
1849
|
+
"openAutoFocus"
|
|
1850
|
+
]);
|
|
1851
|
+
_()(["xChannel", "yChannel"]);
|
|
1852
|
+
_()(["channel", "orientation"]);
|
|
1853
|
+
_()(["value", "disabled"]);
|
|
1854
|
+
_()(["value", "respectAlpha"]);
|
|
1855
|
+
_()(["size"]);
|
|
1856
|
+
var nn = W("accordion").parts("root", "item", "itemTrigger", "itemContent", "itemIndicator"), q = nn.build(), de = (e) => e.ids?.root ?? `accordion:${e.id}`, rn = (e, t) => e.ids?.item?.(t) ?? `accordion:${e.id}:item:${t}`, Ye = (e, t) => e.ids?.itemContent?.(t) ?? `accordion:${e.id}:content:${t}`, ce = (e, t) => e.ids?.itemTrigger?.(t) ?? `accordion:${e.id}:trigger:${t}`, on = (e) => e.getById(de(e)), pe = (e) => {
|
|
1857
|
+
const a = `[aria-controls][data-ownedby='${CSS.escape(de(e))}']:not([disabled])`;
|
|
1858
|
+
return le(on(e), a);
|
|
1859
|
+
}, sn = (e) => pt(pe(e)), ln = (e) => gt(pe(e)), un = (e, t) => Xt(pe(e), ce(e, t)), dn = (e, t) => Kt(pe(e), ce(e, t));
|
|
1860
|
+
function Br(e, t) {
|
|
1861
|
+
const { send: a, context: n, prop: r, scope: i, computed: o } = e, s = n.get("focusedValue"), l = n.get("value"), h = r("multiple");
|
|
1862
|
+
function v(m) {
|
|
1863
|
+
let u = m;
|
|
1864
|
+
!h && u.length > 1 && (u = [u[0]]), a({ type: "VALUE.SET", value: u });
|
|
1865
|
+
}
|
|
1866
|
+
function b(m) {
|
|
1867
|
+
return {
|
|
1868
|
+
expanded: l.includes(m.value),
|
|
1869
|
+
focused: s === m.value,
|
|
1870
|
+
disabled: !!(m.disabled ?? r("disabled"))
|
|
1871
|
+
};
|
|
1872
|
+
}
|
|
1873
|
+
return {
|
|
1874
|
+
focusedValue: s,
|
|
1875
|
+
value: l,
|
|
1876
|
+
setValue: v,
|
|
1877
|
+
getItemState: b,
|
|
1878
|
+
getRootProps() {
|
|
1879
|
+
return t.element({
|
|
1880
|
+
...q.root.attrs,
|
|
1881
|
+
dir: r("dir"),
|
|
1882
|
+
id: de(i),
|
|
1883
|
+
"data-orientation": r("orientation")
|
|
1884
|
+
});
|
|
1885
|
+
},
|
|
1886
|
+
getItemProps(m) {
|
|
1887
|
+
const u = b(m);
|
|
1888
|
+
return t.element({
|
|
1889
|
+
...q.item.attrs,
|
|
1890
|
+
dir: r("dir"),
|
|
1891
|
+
id: rn(i, m.value),
|
|
1892
|
+
"data-state": u.expanded ? "open" : "closed",
|
|
1893
|
+
"data-focus": d(u.focused),
|
|
1894
|
+
"data-disabled": d(u.disabled),
|
|
1895
|
+
"data-orientation": r("orientation")
|
|
1896
|
+
});
|
|
1897
|
+
},
|
|
1898
|
+
getItemContentProps(m) {
|
|
1899
|
+
const u = b(m);
|
|
1900
|
+
return t.element({
|
|
1901
|
+
...q.itemContent.attrs,
|
|
1902
|
+
dir: r("dir"),
|
|
1903
|
+
role: "region",
|
|
1904
|
+
id: Ye(i, m.value),
|
|
1905
|
+
"aria-labelledby": ce(i, m.value),
|
|
1906
|
+
hidden: !u.expanded,
|
|
1907
|
+
"data-state": u.expanded ? "open" : "closed",
|
|
1908
|
+
"data-disabled": d(u.disabled),
|
|
1909
|
+
"data-focus": d(u.focused),
|
|
1910
|
+
"data-orientation": r("orientation")
|
|
1911
|
+
});
|
|
1912
|
+
},
|
|
1913
|
+
getItemIndicatorProps(m) {
|
|
1914
|
+
const u = b(m);
|
|
1915
|
+
return t.element({
|
|
1916
|
+
...q.itemIndicator.attrs,
|
|
1917
|
+
dir: r("dir"),
|
|
1918
|
+
"aria-hidden": !0,
|
|
1919
|
+
"data-state": u.expanded ? "open" : "closed",
|
|
1920
|
+
"data-disabled": d(u.disabled),
|
|
1921
|
+
"data-focus": d(u.focused),
|
|
1922
|
+
"data-orientation": r("orientation")
|
|
1923
|
+
});
|
|
1924
|
+
},
|
|
1925
|
+
getItemTriggerProps(m) {
|
|
1926
|
+
const { value: u } = m, p = b(m);
|
|
1927
|
+
return t.button({
|
|
1928
|
+
...q.itemTrigger.attrs,
|
|
1929
|
+
type: "button",
|
|
1930
|
+
dir: r("dir"),
|
|
1931
|
+
id: ce(i, u),
|
|
1932
|
+
"aria-controls": Ye(i, u),
|
|
1933
|
+
"aria-expanded": p.expanded,
|
|
1934
|
+
disabled: p.disabled,
|
|
1935
|
+
"data-orientation": r("orientation"),
|
|
1936
|
+
"aria-disabled": p.disabled,
|
|
1937
|
+
"data-state": p.expanded ? "open" : "closed",
|
|
1938
|
+
"data-ownedby": de(i),
|
|
1939
|
+
onFocus() {
|
|
1940
|
+
p.disabled || a({ type: "TRIGGER.FOCUS", value: u });
|
|
1941
|
+
},
|
|
1942
|
+
onBlur() {
|
|
1943
|
+
p.disabled || a({ type: "TRIGGER.BLUR" });
|
|
1944
|
+
},
|
|
1945
|
+
onClick(E) {
|
|
1946
|
+
p.disabled || (Jt() && E.currentTarget.focus(), a({ type: "TRIGGER.CLICK", value: u }));
|
|
1947
|
+
},
|
|
1948
|
+
onKeyDown(E) {
|
|
1949
|
+
if (E.defaultPrevented || p.disabled) return;
|
|
1950
|
+
const I = {
|
|
1951
|
+
ArrowDown() {
|
|
1952
|
+
o("isHorizontal") || a({ type: "GOTO.NEXT", value: u });
|
|
1953
|
+
},
|
|
1954
|
+
ArrowUp() {
|
|
1955
|
+
o("isHorizontal") || a({ type: "GOTO.PREV", value: u });
|
|
1956
|
+
},
|
|
1957
|
+
ArrowRight() {
|
|
1958
|
+
o("isHorizontal") && a({ type: "GOTO.NEXT", value: u });
|
|
1959
|
+
},
|
|
1960
|
+
ArrowLeft() {
|
|
1961
|
+
o("isHorizontal") && a({ type: "GOTO.PREV", value: u });
|
|
1962
|
+
},
|
|
1963
|
+
Home() {
|
|
1964
|
+
a({ type: "GOTO.FIRST", value: u });
|
|
1965
|
+
},
|
|
1966
|
+
End() {
|
|
1967
|
+
a({ type: "GOTO.LAST", value: u });
|
|
1968
|
+
}
|
|
1969
|
+
}, F = oe(E, {
|
|
1970
|
+
dir: r("dir"),
|
|
1971
|
+
orientation: r("orientation")
|
|
1972
|
+
}), P = I[F];
|
|
1973
|
+
P && (P(E), E.preventDefault());
|
|
1974
|
+
}
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
var { and: cn, not: gn } = ot(), Hr = z({
|
|
1980
|
+
props({ props: e }) {
|
|
1981
|
+
return {
|
|
1982
|
+
collapsible: !1,
|
|
1983
|
+
multiple: !1,
|
|
1984
|
+
orientation: "vertical",
|
|
1985
|
+
defaultValue: [],
|
|
1986
|
+
...e
|
|
1987
|
+
};
|
|
1988
|
+
},
|
|
1989
|
+
initialState() {
|
|
1990
|
+
return "idle";
|
|
1991
|
+
},
|
|
1992
|
+
context({ prop: e, bindable: t }) {
|
|
1993
|
+
return {
|
|
1994
|
+
focusedValue: t(() => ({
|
|
1995
|
+
defaultValue: null,
|
|
1996
|
+
sync: !0,
|
|
1997
|
+
onChange(a) {
|
|
1998
|
+
e("onFocusChange")?.({ value: a });
|
|
1999
|
+
}
|
|
2000
|
+
})),
|
|
2001
|
+
value: t(() => ({
|
|
2002
|
+
defaultValue: e("defaultValue"),
|
|
2003
|
+
value: e("value"),
|
|
2004
|
+
onChange(a) {
|
|
2005
|
+
e("onValueChange")?.({ value: a });
|
|
2006
|
+
}
|
|
2007
|
+
}))
|
|
2008
|
+
};
|
|
2009
|
+
},
|
|
2010
|
+
computed: {
|
|
2011
|
+
isHorizontal: ({ prop: e }) => e("orientation") === "horizontal"
|
|
2012
|
+
},
|
|
2013
|
+
on: {
|
|
2014
|
+
"VALUE.SET": {
|
|
2015
|
+
actions: ["setValue"]
|
|
2016
|
+
}
|
|
2017
|
+
},
|
|
2018
|
+
states: {
|
|
2019
|
+
idle: {
|
|
2020
|
+
on: {
|
|
2021
|
+
"TRIGGER.FOCUS": {
|
|
2022
|
+
target: "focused",
|
|
2023
|
+
actions: ["setFocusedValue"]
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
},
|
|
2027
|
+
focused: {
|
|
2028
|
+
on: {
|
|
2029
|
+
"GOTO.NEXT": {
|
|
2030
|
+
actions: ["focusNextTrigger"]
|
|
2031
|
+
},
|
|
2032
|
+
"GOTO.PREV": {
|
|
2033
|
+
actions: ["focusPrevTrigger"]
|
|
2034
|
+
},
|
|
2035
|
+
"TRIGGER.CLICK": [
|
|
2036
|
+
{
|
|
2037
|
+
guard: cn("isExpanded", "canToggle"),
|
|
2038
|
+
actions: ["collapse"]
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
guard: gn("isExpanded"),
|
|
2042
|
+
actions: ["expand"]
|
|
2043
|
+
}
|
|
2044
|
+
],
|
|
2045
|
+
"GOTO.FIRST": {
|
|
2046
|
+
actions: ["focusFirstTrigger"]
|
|
2047
|
+
},
|
|
2048
|
+
"GOTO.LAST": {
|
|
2049
|
+
actions: ["focusLastTrigger"]
|
|
2050
|
+
},
|
|
2051
|
+
"TRIGGER.BLUR": {
|
|
2052
|
+
target: "idle",
|
|
2053
|
+
actions: ["clearFocusedValue"]
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
},
|
|
2058
|
+
implementations: {
|
|
2059
|
+
guards: {
|
|
2060
|
+
canToggle: ({ prop: e }) => !!e("collapsible") || !!e("multiple"),
|
|
2061
|
+
isExpanded: ({ context: e, event: t }) => e.get("value").includes(t.value)
|
|
2062
|
+
},
|
|
2063
|
+
actions: {
|
|
2064
|
+
collapse({ context: e, prop: t, event: a }) {
|
|
2065
|
+
const n = t("multiple") ? Zt(e.get("value"), a.value) : [];
|
|
2066
|
+
e.set("value", n);
|
|
2067
|
+
},
|
|
2068
|
+
expand({ context: e, prop: t, event: a }) {
|
|
2069
|
+
const n = t("multiple") ? Yt(e.get("value"), a.value) : [a.value];
|
|
2070
|
+
e.set("value", n);
|
|
2071
|
+
},
|
|
2072
|
+
focusFirstTrigger({ scope: e }) {
|
|
2073
|
+
sn(e)?.focus();
|
|
2074
|
+
},
|
|
2075
|
+
focusLastTrigger({ scope: e }) {
|
|
2076
|
+
ln(e)?.focus();
|
|
2077
|
+
},
|
|
2078
|
+
focusNextTrigger({ context: e, scope: t }) {
|
|
2079
|
+
const a = e.get("focusedValue");
|
|
2080
|
+
if (!a) return;
|
|
2081
|
+
un(t, a)?.focus();
|
|
2082
|
+
},
|
|
2083
|
+
focusPrevTrigger({ context: e, scope: t }) {
|
|
2084
|
+
const a = e.get("focusedValue");
|
|
2085
|
+
if (!a) return;
|
|
2086
|
+
dn(t, a)?.focus();
|
|
2087
|
+
},
|
|
2088
|
+
setFocusedValue({ context: e, event: t }) {
|
|
2089
|
+
e.set("focusedValue", t.value);
|
|
2090
|
+
},
|
|
2091
|
+
clearFocusedValue({ context: e }) {
|
|
2092
|
+
e.set("focusedValue", null);
|
|
2093
|
+
},
|
|
2094
|
+
setValue({ context: e, event: t }) {
|
|
2095
|
+
e.set("value", t.value);
|
|
2096
|
+
},
|
|
2097
|
+
coarseValue({ context: e, prop: t }) {
|
|
2098
|
+
!t("multiple") && e.get("value").length > 1 && (ct("The value of accordion should be a single value when multiple is false."), e.set("value", [e.get("value")[0]]));
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
});
|
|
2103
|
+
_()([
|
|
2104
|
+
"collapsible",
|
|
2105
|
+
"dir",
|
|
2106
|
+
"disabled",
|
|
2107
|
+
"getRootNode",
|
|
2108
|
+
"id",
|
|
2109
|
+
"ids",
|
|
2110
|
+
"multiple",
|
|
2111
|
+
"onFocusChange",
|
|
2112
|
+
"onValueChange",
|
|
2113
|
+
"orientation",
|
|
2114
|
+
"value",
|
|
2115
|
+
"defaultValue"
|
|
2116
|
+
]);
|
|
2117
|
+
_()(["value", "disabled"]);
|
|
2118
|
+
var pn = W("clipboard").parts("root", "control", "trigger", "indicator", "input", "label"), j = pn.build(), hn = (e) => e.ids?.root ?? `clip:${e.id}`, Te = (e) => e.ids?.input ?? `clip:${e.id}:input`, fn = (e) => e.ids?.label ?? `clip:${e.id}:label`, mn = (e) => e.getById(Te(e)), vn = (e, t) => Cn(e.getDoc(), t);
|
|
2119
|
+
function bn(e, t) {
|
|
2120
|
+
const a = e.createElement("pre");
|
|
2121
|
+
return Object.assign(a.style, {
|
|
2122
|
+
width: "1px",
|
|
2123
|
+
height: "1px",
|
|
2124
|
+
position: "fixed",
|
|
2125
|
+
top: "5px"
|
|
2126
|
+
}), a.textContent = t, a;
|
|
2127
|
+
}
|
|
2128
|
+
function En(e) {
|
|
2129
|
+
const a = ht(e).getSelection();
|
|
2130
|
+
if (a == null)
|
|
2131
|
+
return Promise.reject(new Error());
|
|
2132
|
+
a.removeAllRanges();
|
|
2133
|
+
const n = e.ownerDocument, r = n.createRange();
|
|
2134
|
+
return r.selectNodeContents(e), a.addRange(r), n.execCommand("copy"), a.removeAllRanges(), Promise.resolve();
|
|
2135
|
+
}
|
|
2136
|
+
function Cn(e, t) {
|
|
2137
|
+
const a = e.defaultView || window;
|
|
2138
|
+
if (a.navigator.clipboard?.writeText !== void 0)
|
|
2139
|
+
return a.navigator.clipboard.writeText(t);
|
|
2140
|
+
if (!e.body)
|
|
2141
|
+
return Promise.reject(new Error());
|
|
2142
|
+
const n = bn(e, t);
|
|
2143
|
+
return e.body.appendChild(n), En(n), e.body.removeChild(n), Promise.resolve();
|
|
2144
|
+
}
|
|
2145
|
+
function jr(e, t) {
|
|
2146
|
+
const { state: a, send: n, context: r, scope: i } = e, o = a.matches("copied");
|
|
2147
|
+
return {
|
|
2148
|
+
copied: o,
|
|
2149
|
+
value: r.get("value"),
|
|
2150
|
+
setValue(s) {
|
|
2151
|
+
n({ type: "VALUE.SET", value: s });
|
|
2152
|
+
},
|
|
2153
|
+
copy() {
|
|
2154
|
+
n({ type: "COPY" });
|
|
2155
|
+
},
|
|
2156
|
+
getRootProps() {
|
|
2157
|
+
return t.element({
|
|
2158
|
+
...j.root.attrs,
|
|
2159
|
+
"data-copied": d(o),
|
|
2160
|
+
id: hn(i)
|
|
2161
|
+
});
|
|
2162
|
+
},
|
|
2163
|
+
getLabelProps() {
|
|
2164
|
+
return t.label({
|
|
2165
|
+
...j.label.attrs,
|
|
2166
|
+
htmlFor: Te(i),
|
|
2167
|
+
"data-copied": d(o),
|
|
2168
|
+
id: fn(i)
|
|
2169
|
+
});
|
|
2170
|
+
},
|
|
2171
|
+
getControlProps() {
|
|
2172
|
+
return t.element({
|
|
2173
|
+
...j.control.attrs,
|
|
2174
|
+
"data-copied": d(o)
|
|
2175
|
+
});
|
|
2176
|
+
},
|
|
2177
|
+
getInputProps() {
|
|
2178
|
+
return t.input({
|
|
2179
|
+
...j.input.attrs,
|
|
2180
|
+
defaultValue: r.get("value"),
|
|
2181
|
+
"data-copied": d(o),
|
|
2182
|
+
readOnly: !0,
|
|
2183
|
+
"data-readonly": "true",
|
|
2184
|
+
id: Te(i),
|
|
2185
|
+
onFocus(s) {
|
|
2186
|
+
s.currentTarget.select();
|
|
2187
|
+
},
|
|
2188
|
+
onCopy() {
|
|
2189
|
+
n({ type: "INPUT.COPY" });
|
|
2190
|
+
}
|
|
2191
|
+
});
|
|
2192
|
+
},
|
|
2193
|
+
getTriggerProps() {
|
|
2194
|
+
return t.button({
|
|
2195
|
+
...j.trigger.attrs,
|
|
2196
|
+
type: "button",
|
|
2197
|
+
"aria-label": o ? "Copied to clipboard" : "Copy to clipboard",
|
|
2198
|
+
"data-copied": d(o),
|
|
2199
|
+
onClick() {
|
|
2200
|
+
n({ type: "COPY" });
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
},
|
|
2204
|
+
getIndicatorProps(s) {
|
|
2205
|
+
return t.element({
|
|
2206
|
+
...j.indicator.attrs,
|
|
2207
|
+
hidden: s.copied !== o
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
var Wr = z({
|
|
2213
|
+
props({ props: e }) {
|
|
2214
|
+
return {
|
|
2215
|
+
timeout: 3e3,
|
|
2216
|
+
defaultValue: "",
|
|
2217
|
+
...e
|
|
2218
|
+
};
|
|
2219
|
+
},
|
|
2220
|
+
initialState() {
|
|
2221
|
+
return "idle";
|
|
2222
|
+
},
|
|
2223
|
+
context({ prop: e, bindable: t }) {
|
|
2224
|
+
return {
|
|
2225
|
+
value: t(() => ({
|
|
2226
|
+
defaultValue: e("defaultValue"),
|
|
2227
|
+
value: e("value"),
|
|
2228
|
+
onChange(a) {
|
|
2229
|
+
e("onValueChange")?.({ value: a });
|
|
2230
|
+
}
|
|
2231
|
+
}))
|
|
2232
|
+
};
|
|
2233
|
+
},
|
|
2234
|
+
watch({ track: e, context: t, action: a }) {
|
|
2235
|
+
e([() => t.get("value")], () => {
|
|
2236
|
+
a(["syncInputElement"]);
|
|
2237
|
+
});
|
|
2238
|
+
},
|
|
2239
|
+
on: {
|
|
2240
|
+
"VALUE.SET": {
|
|
2241
|
+
actions: ["setValue"]
|
|
2242
|
+
},
|
|
2243
|
+
COPY: {
|
|
2244
|
+
target: "copied",
|
|
2245
|
+
actions: ["copyToClipboard", "invokeOnCopy"]
|
|
2246
|
+
}
|
|
2247
|
+
},
|
|
2248
|
+
states: {
|
|
2249
|
+
idle: {
|
|
2250
|
+
on: {
|
|
2251
|
+
"INPUT.COPY": {
|
|
2252
|
+
target: "copied",
|
|
2253
|
+
actions: ["invokeOnCopy"]
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
},
|
|
2257
|
+
copied: {
|
|
2258
|
+
effects: ["waitForTimeout"],
|
|
2259
|
+
on: {
|
|
2260
|
+
"COPY.DONE": {
|
|
2261
|
+
target: "idle"
|
|
2262
|
+
},
|
|
2263
|
+
COPY: {
|
|
2264
|
+
target: "copied",
|
|
2265
|
+
actions: ["copyToClipboard", "invokeOnCopy"]
|
|
2266
|
+
},
|
|
2267
|
+
"INPUT.COPY": {
|
|
2268
|
+
actions: ["invokeOnCopy"]
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
},
|
|
2273
|
+
implementations: {
|
|
2274
|
+
effects: {
|
|
2275
|
+
waitForTimeout({ prop: e, send: t }) {
|
|
2276
|
+
return Qt(() => {
|
|
2277
|
+
t({ type: "COPY.DONE" });
|
|
2278
|
+
}, e("timeout"));
|
|
2279
|
+
}
|
|
2280
|
+
},
|
|
2281
|
+
actions: {
|
|
2282
|
+
setValue({ context: e, event: t }) {
|
|
2283
|
+
e.set("value", t.value);
|
|
2284
|
+
},
|
|
2285
|
+
copyToClipboard({ context: e, scope: t }) {
|
|
2286
|
+
vn(t, e.get("value"));
|
|
2287
|
+
},
|
|
2288
|
+
invokeOnCopy({ prop: e }) {
|
|
2289
|
+
e("onStatusChange")?.({ copied: !0 });
|
|
2290
|
+
},
|
|
2291
|
+
syncInputElement({ context: e, scope: t }) {
|
|
2292
|
+
const a = mn(t);
|
|
2293
|
+
a && Y(a, e.get("value"));
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
});
|
|
2298
|
+
_()([
|
|
2299
|
+
"getRootNode",
|
|
2300
|
+
"id",
|
|
2301
|
+
"ids",
|
|
2302
|
+
"value",
|
|
2303
|
+
"defaultValue",
|
|
2304
|
+
"timeout",
|
|
2305
|
+
"onStatusChange",
|
|
2306
|
+
"onValueChange"
|
|
2307
|
+
]);
|
|
2308
|
+
_()(["copied"]);
|
|
2309
|
+
const zr = Ct.extendWith("view");
|
|
2310
|
+
var yn = (e) => typeof e.getAsEntry == "function" ? e.getAsEntry() : typeof e.webkitGetAsEntry == "function" ? e.webkitGetAsEntry() : null, Pt = (e) => e.isDirectory, Re = (e) => e.isFile, we = (e, t) => (Object.defineProperty(e, "relativePath", { value: t ? `${t}/${e.name}` : e.name }), e), In = (e, t) => Promise.all(
|
|
2311
|
+
Array.from(e).filter((a) => a.kind === "file").map((a) => {
|
|
2312
|
+
const n = yn(a);
|
|
2313
|
+
if (!n) return null;
|
|
2314
|
+
if (Pt(n) && t)
|
|
2315
|
+
return Ft(n.createReader(), `${n.name}`);
|
|
2316
|
+
if (Re(n) && typeof a.getAsFile == "function") {
|
|
2317
|
+
const r = a.getAsFile();
|
|
2318
|
+
return Promise.resolve(r ? we(r, "") : null);
|
|
2319
|
+
}
|
|
2320
|
+
if (Re(n))
|
|
2321
|
+
return new Promise((r) => {
|
|
2322
|
+
n.file((i) => {
|
|
2323
|
+
r(we(i, ""));
|
|
2324
|
+
});
|
|
2325
|
+
});
|
|
2326
|
+
}).filter((a) => a)
|
|
2327
|
+
), Ft = (e, t = "") => new Promise((a) => {
|
|
2328
|
+
const n = [], r = () => {
|
|
2329
|
+
e.readEntries((i) => {
|
|
2330
|
+
if (i.length === 0) {
|
|
2331
|
+
a(Promise.all(n).then((s) => s.flat()));
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2334
|
+
const o = i.map((s) => {
|
|
2335
|
+
if (!s) return null;
|
|
2336
|
+
if (Pt(s))
|
|
2337
|
+
return Ft(s.createReader(), `${t}${s.name}`);
|
|
2338
|
+
if (Re(s))
|
|
2339
|
+
return new Promise((l) => {
|
|
2340
|
+
s.file((h) => {
|
|
2341
|
+
l(we(h, t));
|
|
2342
|
+
});
|
|
2343
|
+
});
|
|
2344
|
+
}).filter((s) => s);
|
|
2345
|
+
n.push(Promise.all(o)), r();
|
|
2346
|
+
});
|
|
2347
|
+
};
|
|
2348
|
+
r();
|
|
2349
|
+
}), Sn = /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i, On = /Macintosh/, Tn = /AppleWebKit/, Rn = /Safari/;
|
|
2350
|
+
function wn(e, t, a) {
|
|
2351
|
+
let n = typeof e == "string" ? new Blob([e], { type: t }) : e;
|
|
2352
|
+
return a && Sn.test(n.type) ? new Blob(["\uFEFF", n], { type: n.type }) : n;
|
|
2353
|
+
}
|
|
2354
|
+
function Pn(e) {
|
|
2355
|
+
return !!(e.navigator && e.navigator.msSaveOrOpenBlob);
|
|
2356
|
+
}
|
|
2357
|
+
function Fn(e) {
|
|
2358
|
+
return e.navigator && On.test(e.navigator.userAgent) && Tn.test(e.navigator.userAgent) && !Rn.test(e.navigator.userAgent);
|
|
2359
|
+
}
|
|
2360
|
+
function qr(e) {
|
|
2361
|
+
const { file: t, win: a = window, type: n, name: r, appendBOM: i, revokeTimeout: o = 0 } = e, s = a.document, l = wn(t, n, i), h = (t instanceof File ? r || t.name : r) || "file-download";
|
|
2362
|
+
if (Pn(a)) {
|
|
2363
|
+
a.navigator.msSaveOrOpenBlob(l, h);
|
|
2364
|
+
return;
|
|
2365
|
+
}
|
|
2366
|
+
const v = Fn(a), b = s.createElement("a");
|
|
2367
|
+
if ("download" in b && !v) {
|
|
2368
|
+
const E = a.URL.createObjectURL(l);
|
|
2369
|
+
b.href = E, b.rel = "noopener", b.download = h, b.style.display = "none", s.body.appendChild(b), b.dispatchEvent(new a.MouseEvent("click")), setTimeout(() => {
|
|
2370
|
+
a.URL.revokeObjectURL(E), b.remove();
|
|
2371
|
+
}, o);
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
const u = a.URL.createObjectURL(l);
|
|
2375
|
+
a.open(u, "_blank") || (a.location.href = u), setTimeout(() => {
|
|
2376
|
+
a.URL.revokeObjectURL(u);
|
|
2377
|
+
}, o);
|
|
2378
|
+
}
|
|
2379
|
+
function _n(e) {
|
|
2380
|
+
return e === "audio/*" || e === "video/*" || e === "image/*" || e === "text/*" || /\w+\/[-+.\w]+/g.test(e);
|
|
2381
|
+
}
|
|
2382
|
+
function xn(e) {
|
|
2383
|
+
return /^.*\.[\w]+$/.test(e);
|
|
2384
|
+
}
|
|
2385
|
+
var Ze = (e) => _n(e) || xn(e);
|
|
2386
|
+
function An(e) {
|
|
2387
|
+
if (e != null)
|
|
2388
|
+
return typeof e == "string" ? e : Array.isArray(e) ? e.filter(Ze).join(",") : Object.entries(e).reduce((t, [a, n]) => [...t, a, ...n], []).filter(Ze).join(",");
|
|
2389
|
+
}
|
|
2390
|
+
var J = (e, t) => e.name === t.name && e.size === t.size && e.type === t.type, K = (e) => e != null;
|
|
2391
|
+
function kn(e, t, a) {
|
|
2392
|
+
if (K(e.size))
|
|
2393
|
+
if (K(t) && K(a)) {
|
|
2394
|
+
if (e.size > a) return [!1, "FILE_TOO_LARGE"];
|
|
2395
|
+
if (e.size < t) return [!1, "FILE_TOO_SMALL"];
|
|
2396
|
+
} else {
|
|
2397
|
+
if (K(t) && e.size < t)
|
|
2398
|
+
return [!1, "FILE_TOO_SMALL"];
|
|
2399
|
+
if (K(a) && e.size > a)
|
|
2400
|
+
return [!1, "FILE_TOO_LARGE"];
|
|
2401
|
+
}
|
|
2402
|
+
return [!0, null];
|
|
2403
|
+
}
|
|
2404
|
+
var Vn = "3g2_video/3gpp2[3gp,3gpp_video/3gpp[3mf_model/3mf[7z_application/x-7z-compressed[aac_audio/aac[ac_application/pkix-attr-cert[adp_audio/adpcm[adts_audio/aac[ai_application/postscript[aml_application/automationml-aml+xml[amlx_application/automationml-amlx+zip[amr_audio/amr[apk_application/vnd.android.package-archive[apng_image/apng[appcache,manifest_text/cache-manifest[appinstaller_application/appinstaller[appx_application/appx[appxbundle_application/appxbundle[asc_application/pgp-keys[atom_application/atom+xml[atomcat_application/atomcat+xml[atomdeleted_application/atomdeleted+xml[atomsvc_application/atomsvc+xml[au,snd_audio/basic[avi_video/x-msvideo[avci_image/avci[avcs_image/avcs[avif_image/avif[aw_application/applixware[bdoc_application/bdoc[bin,bpk,buffer,deb,deploy,dist,distz,dll,dmg,dms,dump,elc,exe,img,iso,lrf,mar,msi,msm,msp,pkg,so_application/octet-stream[bmp,dib_image/bmp[btf,btif_image/prs.btif[bz2_application/x-bzip2[c_text/x-c[ccxml_application/ccxml+xml[cdfx_application/cdfx+xml[cdmia_application/cdmi-capability[cdmic_application/cdmi-container[cdmid_application/cdmi-domain[cdmio_application/cdmi-object[cdmiq_application/cdmi-queue[cer_application/pkix-cert[cgm_image/cgm[cjs_application/node[class_application/java-vm[coffee,litcoffee_text/coffeescript[conf,def,in,ini,list,log,text,txt_text/plain[cpp,cxx,cc_text/x-c++src[cpl_application/cpl+xml[cpt_application/mac-compactpro[crl_application/pkix-crl[css_text/css[csv_text/csv[cu_application/cu-seeme[cwl_application/cwl[cww_application/prs.cww[davmount_application/davmount+xml[dbk_application/docbook+xml[doc_application/msword[docx_application/vnd.openxmlformats-officedocument.wordprocessingml.document[dsc_text/prs.lines.tag[dssc_application/dssc+der[dtd_application/xml-dtd[dwd_application/atsc-dwd+xml[ear,jar,war_application/java-archive[ecma_application/ecmascript[emf_image/emf[eml,mime_message/rfc822[emma_application/emma+xml[emotionml_application/emotionml+xml[eot_application/vnd.ms-fontobject[eps,ps_application/postscript[epub_application/epub+zip[exi_application/exi[exp_application/express[exr_image/aces[ez_application/andrew-inset[fdf_application/fdf[fdt_application/fdt+xml[fits_image/fits[flac_audio/flac[flv_video/x-flv[g3_image/g3fax[geojson_application/geo+json[gif_image/gif[glb_model/gltf-binary[gltf_model/gltf+json[gml_application/gml+xml[go_text/x-go[gpx_application/gpx+xml[gz_application/gzip[h_text/x-h[h261_video/h261[h263_video/h263[h264_video/h264[heic_image/heic[heics_image/heic-sequence[heif_image/heif[heifs_image/heif-sequence[htm,html,shtml_text/html[ico_image/x-icon[icns_image/x-icns[ics,ifb_text/calendar[iges,igs_model/iges[ink,inkml_application/inkml+xml[ipa_application/octet-stream[java_text/x-java-source[jp2,jpg2_image/jp2[jpeg,jpe,jpg_image/jpeg[jpf,jpx_image/jpx[jpm,jpgm_image/jpm[jpgv_video/jpeg[jph_image/jph[js,mjs_text/javascript[json_application/json[json5_application/json5[jsonld_application/ld+json[jsx_text/jsx[jxl_image/jxl[jxr_image/jxr[ktx_image/ktx[ktx2_image/ktx2[less_text/less[m1v,m2v,mpe,mpeg,mpg_video/mpeg[m4a_audio/mp4[m4v_video/x-m4v[md,markdown_text/markdown[mid,midi,kar,rmi_audio/midi[mkv_video/x-matroska[mp2,mp2a,mp3,mpga,m3a,m2a_audio/mpeg[mp4,mp4v,mpg4_video/mp4[mp4a_audio/mp4[mp4s,m4p_application/mp4[odp_application/vnd.oasis.opendocument.presentation[oda_application/oda[ods_application/vnd.oasis.opendocument.spreadsheet[odt_application/vnd.oasis.opendocument.text[oga,ogg,opus,spx_audio/ogg[ogv_video/ogg[ogx_application/ogg[otf_font/otf[p12,pfx_application/x-pkcs12[pdf_application/pdf[pem_application/x-pem-file[php_text/x-php[png_image/png[ppt_application/vnd.ms-powerpoint[pptx_application/vnd.openxmlformats-officedocument.presentationml.presentation[pskcxml_application/pskc+xml[psd_image/vnd.adobe.photoshop[py_text/x-python[qt,mov_video/quicktime[rar_application/vnd.rar[rdf_application/rdf+xml[rtf_text/rtf[sass_text/x-sass[scss_text/x-scss[sgm,sgml_text/sgml[sh_application/x-sh[svg,svgz_image/svg+xml[swf_application/x-shockwave-flash[tar_application/x-tar[tif,tiff_image/tiff[toml_application/toml[ts_video/mp2t[tsx_text/tsx[tsv_text/tab-separated-values[ttc_font/collection[ttf_font/ttf[vtt_text/vtt[wasm_application/wasm[wav_audio/wav[weba_audio/webm[webm_video/webm[webmanifest_application/manifest+json[webp_image/webp[wma_audio/x-ms-wma[wmv_video/x-ms-wmv[woff_font/woff[woff2_font/woff2[xls_application/vnd.ms-excel[xlsx_application/vnd.openxmlformats-officedocument.spreadsheetml.sheet[xml_application/xml[xz_application/x-xz[yaml,yml_text/yaml[zip_application/zip", Nn = new Map(
|
|
2405
|
+
Vn.split("[").flatMap((e) => {
|
|
2406
|
+
const [t, a] = e.split("_");
|
|
2407
|
+
return t.split(",").map((n) => [n, a]);
|
|
2408
|
+
})
|
|
2409
|
+
);
|
|
2410
|
+
function $n(e) {
|
|
2411
|
+
const t = e.split(".").pop();
|
|
2412
|
+
return t && Nn.get(t) || null;
|
|
2413
|
+
}
|
|
2414
|
+
function Ln(e, t) {
|
|
2415
|
+
if (e && t) {
|
|
2416
|
+
const a = Array.isArray(t) ? t : typeof t == "string" ? t.split(",") : [];
|
|
2417
|
+
if (a.length === 0) return !0;
|
|
2418
|
+
const n = e.name || "", r = (e.type || $n(n) || "").toLowerCase(), i = r.replace(/\/.*$/, "");
|
|
2419
|
+
return a.some((o) => {
|
|
2420
|
+
const s = o.trim().toLowerCase();
|
|
2421
|
+
return s.charAt(0) === "." ? n.toLowerCase().endsWith(s) : s.endsWith("/*") ? i === s.replace(/\/.*$/, "") : r === s;
|
|
2422
|
+
});
|
|
2423
|
+
}
|
|
2424
|
+
return !0;
|
|
2425
|
+
}
|
|
2426
|
+
function Dn(e, t) {
|
|
2427
|
+
const a = e.type === "application/x-moz-file" || Ln(e, t);
|
|
2428
|
+
return [a, a ? null : "FILE_INVALID_TYPE"];
|
|
2429
|
+
}
|
|
2430
|
+
var Mn = W("editable").parts(
|
|
2431
|
+
"root",
|
|
2432
|
+
"area",
|
|
2433
|
+
"label",
|
|
2434
|
+
"preview",
|
|
2435
|
+
"input",
|
|
2436
|
+
"editTrigger",
|
|
2437
|
+
"submitTrigger",
|
|
2438
|
+
"cancelTrigger",
|
|
2439
|
+
"control"
|
|
2440
|
+
), D = Mn.build(), Un = (e) => e.ids?.root ?? `editable:${e.id}`, Gn = (e) => e.ids?.area ?? `editable:${e.id}:area`, Bn = (e) => e.ids?.label ?? `editable:${e.id}:label`, _t = (e) => e.ids?.preview ?? `editable:${e.id}:preview`, Pe = (e) => e.ids?.input ?? `editable:${e.id}:input`, Hn = (e) => e.ids?.control ?? `editable:${e.id}:control`, xt = (e) => e.ids?.submitTrigger ?? `editable:${e.id}:submit`, At = (e) => e.ids?.cancelTrigger ?? `editable:${e.id}:cancel`, kt = (e) => e.ids?.editTrigger ?? `editable:${e.id}:edit`, Q = (e) => e.getById(Pe(e)), jn = (e) => e.getById(_t(e)), Wn = (e) => e.getById(xt(e)), zn = (e) => e.getById(At(e)), qn = (e) => e.getById(kt(e));
|
|
2441
|
+
function Kr(e, t) {
|
|
2442
|
+
const { state: a, context: n, send: r, prop: i, scope: o, computed: s } = e, l = i("disabled"), h = s("isInteractive"), v = i("readOnly"), b = i("invalid"), m = i("autoResize"), u = i("translations"), p = a.matches("edit"), E = i("placeholder"), I = typeof E == "string" ? { edit: E, preview: E } : E, F = n.get("value"), P = F.trim() === "", B = P ? I?.preview ?? "" : F;
|
|
2443
|
+
return {
|
|
2444
|
+
editing: p,
|
|
2445
|
+
empty: P,
|
|
2446
|
+
value: F,
|
|
2447
|
+
valueText: B,
|
|
2448
|
+
setValue(S) {
|
|
2449
|
+
r({ type: "VALUE.SET", value: S, src: "setValue" });
|
|
2450
|
+
},
|
|
2451
|
+
clearValue() {
|
|
2452
|
+
r({ type: "VALUE.SET", value: "", src: "clearValue" });
|
|
2453
|
+
},
|
|
2454
|
+
edit() {
|
|
2455
|
+
h && r({ type: "EDIT" });
|
|
2456
|
+
},
|
|
2457
|
+
cancel() {
|
|
2458
|
+
h && r({ type: "CANCEL" });
|
|
2459
|
+
},
|
|
2460
|
+
submit() {
|
|
2461
|
+
h && r({ type: "SUBMIT" });
|
|
2462
|
+
},
|
|
2463
|
+
getRootProps() {
|
|
2464
|
+
return t.element({
|
|
2465
|
+
...D.root.attrs,
|
|
2466
|
+
id: Un(o),
|
|
2467
|
+
dir: i("dir")
|
|
2468
|
+
});
|
|
2469
|
+
},
|
|
2470
|
+
getAreaProps() {
|
|
2471
|
+
return t.element({
|
|
2472
|
+
...D.area.attrs,
|
|
2473
|
+
id: Gn(o),
|
|
2474
|
+
dir: i("dir"),
|
|
2475
|
+
style: m ? { display: "inline-grid" } : void 0,
|
|
2476
|
+
"data-focus": d(p),
|
|
2477
|
+
"data-disabled": d(l),
|
|
2478
|
+
"data-placeholder-shown": d(P)
|
|
2479
|
+
});
|
|
2480
|
+
},
|
|
2481
|
+
getLabelProps() {
|
|
2482
|
+
return t.label({
|
|
2483
|
+
...D.label.attrs,
|
|
2484
|
+
id: Bn(o),
|
|
2485
|
+
dir: i("dir"),
|
|
2486
|
+
htmlFor: Pe(o),
|
|
2487
|
+
"data-focus": d(p),
|
|
2488
|
+
"data-invalid": d(b),
|
|
2489
|
+
onClick() {
|
|
2490
|
+
if (p) return;
|
|
2491
|
+
jn(o)?.focus({ preventScroll: !0 });
|
|
2492
|
+
}
|
|
2493
|
+
});
|
|
2494
|
+
},
|
|
2495
|
+
getInputProps() {
|
|
2496
|
+
return t.input({
|
|
2497
|
+
...D.input.attrs,
|
|
2498
|
+
dir: i("dir"),
|
|
2499
|
+
"aria-label": u?.input,
|
|
2500
|
+
name: i("name"),
|
|
2501
|
+
form: i("form"),
|
|
2502
|
+
id: Pe(o),
|
|
2503
|
+
hidden: m ? void 0 : !p,
|
|
2504
|
+
placeholder: I?.edit,
|
|
2505
|
+
maxLength: i("maxLength"),
|
|
2506
|
+
required: i("required"),
|
|
2507
|
+
disabled: l,
|
|
2508
|
+
"data-disabled": d(l),
|
|
2509
|
+
readOnly: v,
|
|
2510
|
+
"data-readonly": d(v),
|
|
2511
|
+
"aria-invalid": X(b),
|
|
2512
|
+
"data-invalid": d(b),
|
|
2513
|
+
"data-autoresize": d(m),
|
|
2514
|
+
defaultValue: F,
|
|
2515
|
+
size: m ? 1 : void 0,
|
|
2516
|
+
onChange(S) {
|
|
2517
|
+
r({
|
|
2518
|
+
type: "VALUE.SET",
|
|
2519
|
+
src: "input.change",
|
|
2520
|
+
value: S.currentTarget.value
|
|
2521
|
+
});
|
|
2522
|
+
},
|
|
2523
|
+
onKeyDown(S) {
|
|
2524
|
+
if (S.defaultPrevented || ea(S)) return;
|
|
2525
|
+
const c = {
|
|
2526
|
+
Escape() {
|
|
2527
|
+
r({ type: "CANCEL" }), S.preventDefault();
|
|
2528
|
+
},
|
|
2529
|
+
Enter(f) {
|
|
2530
|
+
if (!s("submitOnEnter")) return;
|
|
2531
|
+
const { localName: y } = f.currentTarget;
|
|
2532
|
+
if (y === "textarea") {
|
|
2533
|
+
if (!(ta() ? f.metaKey : f.ctrlKey)) return;
|
|
2534
|
+
r({ type: "SUBMIT", src: "keydown.enter" });
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
y === "input" && !f.shiftKey && !f.metaKey && (r({ type: "SUBMIT", src: "keydown.enter" }), f.preventDefault());
|
|
2538
|
+
}
|
|
2539
|
+
}[S.key];
|
|
2540
|
+
c && c(S);
|
|
2541
|
+
},
|
|
2542
|
+
style: m ? {
|
|
2543
|
+
gridArea: "1 / 1 / auto / auto",
|
|
2544
|
+
visibility: p ? void 0 : "hidden"
|
|
2545
|
+
} : void 0
|
|
2546
|
+
});
|
|
2547
|
+
},
|
|
2548
|
+
getPreviewProps() {
|
|
2549
|
+
return t.element({
|
|
2550
|
+
id: _t(o),
|
|
2551
|
+
...D.preview.attrs,
|
|
2552
|
+
dir: i("dir"),
|
|
2553
|
+
"data-placeholder-shown": d(P),
|
|
2554
|
+
"aria-readonly": X(v),
|
|
2555
|
+
"data-readonly": d(l),
|
|
2556
|
+
"data-disabled": d(l),
|
|
2557
|
+
"aria-disabled": X(l),
|
|
2558
|
+
"aria-invalid": X(b),
|
|
2559
|
+
"data-invalid": d(b),
|
|
2560
|
+
"aria-label": u?.edit,
|
|
2561
|
+
"data-autoresize": d(m),
|
|
2562
|
+
children: B,
|
|
2563
|
+
hidden: m ? void 0 : p,
|
|
2564
|
+
tabIndex: h ? 0 : void 0,
|
|
2565
|
+
onClick() {
|
|
2566
|
+
h && i("activationMode") === "click" && r({ type: "EDIT", src: "click" });
|
|
2567
|
+
},
|
|
2568
|
+
onFocus() {
|
|
2569
|
+
h && i("activationMode") === "focus" && r({ type: "EDIT", src: "focus" });
|
|
2570
|
+
},
|
|
2571
|
+
onDoubleClick(S) {
|
|
2572
|
+
S.defaultPrevented || h && i("activationMode") === "dblclick" && r({ type: "EDIT", src: "dblclick" });
|
|
2573
|
+
},
|
|
2574
|
+
style: m ? {
|
|
2575
|
+
whiteSpace: "pre",
|
|
2576
|
+
userSelect: "none",
|
|
2577
|
+
gridArea: "1 / 1 / auto / auto",
|
|
2578
|
+
visibility: p ? "hidden" : void 0,
|
|
2579
|
+
// in event the preview overflow's the parent element
|
|
2580
|
+
overflow: "hidden",
|
|
2581
|
+
textOverflow: "ellipsis"
|
|
2582
|
+
} : void 0
|
|
2583
|
+
});
|
|
2584
|
+
},
|
|
2585
|
+
getEditTriggerProps() {
|
|
2586
|
+
return t.button({
|
|
2587
|
+
...D.editTrigger.attrs,
|
|
2588
|
+
id: kt(o),
|
|
2589
|
+
dir: i("dir"),
|
|
2590
|
+
"aria-label": u?.edit,
|
|
2591
|
+
hidden: p,
|
|
2592
|
+
type: "button",
|
|
2593
|
+
disabled: l,
|
|
2594
|
+
onClick(S) {
|
|
2595
|
+
S.defaultPrevented || h && r({ type: "EDIT", src: "edit.click" });
|
|
2596
|
+
}
|
|
2597
|
+
});
|
|
2598
|
+
},
|
|
2599
|
+
getControlProps() {
|
|
2600
|
+
return t.element({
|
|
2601
|
+
id: Hn(o),
|
|
2602
|
+
...D.control.attrs,
|
|
2603
|
+
dir: i("dir")
|
|
2604
|
+
});
|
|
2605
|
+
},
|
|
2606
|
+
getSubmitTriggerProps() {
|
|
2607
|
+
return t.button({
|
|
2608
|
+
...D.submitTrigger.attrs,
|
|
2609
|
+
dir: i("dir"),
|
|
2610
|
+
id: xt(o),
|
|
2611
|
+
"aria-label": u?.submit,
|
|
2612
|
+
hidden: !p,
|
|
2613
|
+
disabled: l,
|
|
2614
|
+
type: "button",
|
|
2615
|
+
onClick(S) {
|
|
2616
|
+
S.defaultPrevented || h && r({ type: "SUBMIT", src: "submit.click" });
|
|
2617
|
+
}
|
|
2618
|
+
});
|
|
2619
|
+
},
|
|
2620
|
+
getCancelTriggerProps() {
|
|
2621
|
+
return t.button({
|
|
2622
|
+
...D.cancelTrigger.attrs,
|
|
2623
|
+
dir: i("dir"),
|
|
2624
|
+
"aria-label": u?.cancel,
|
|
2625
|
+
id: At(o),
|
|
2626
|
+
hidden: !p,
|
|
2627
|
+
type: "button",
|
|
2628
|
+
disabled: l,
|
|
2629
|
+
onClick(S) {
|
|
2630
|
+
S.defaultPrevented || h && r({ type: "CANCEL", src: "cancel.click" });
|
|
2631
|
+
}
|
|
2632
|
+
});
|
|
2633
|
+
}
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
var Xr = z({
|
|
2637
|
+
props({ props: e }) {
|
|
2638
|
+
return {
|
|
2639
|
+
activationMode: "focus",
|
|
2640
|
+
submitMode: "both",
|
|
2641
|
+
defaultValue: "",
|
|
2642
|
+
selectOnFocus: !0,
|
|
2643
|
+
...e,
|
|
2644
|
+
translations: {
|
|
2645
|
+
input: "editable input",
|
|
2646
|
+
edit: "edit",
|
|
2647
|
+
submit: "submit",
|
|
2648
|
+
cancel: "cancel",
|
|
2649
|
+
...e.translations
|
|
2650
|
+
}
|
|
2651
|
+
};
|
|
2652
|
+
},
|
|
2653
|
+
initialState({ prop: e }) {
|
|
2654
|
+
return e("edit") || e("defaultEdit") ? "edit" : "preview";
|
|
2655
|
+
},
|
|
2656
|
+
entry: ["focusInputIfNeeded"],
|
|
2657
|
+
context: ({ bindable: e, prop: t }) => ({
|
|
2658
|
+
value: e(() => ({
|
|
2659
|
+
defaultValue: t("defaultValue"),
|
|
2660
|
+
value: t("value"),
|
|
2661
|
+
onChange(a) {
|
|
2662
|
+
return t("onValueChange")?.({ value: a });
|
|
2663
|
+
}
|
|
2664
|
+
})),
|
|
2665
|
+
previousValue: e(() => ({
|
|
2666
|
+
defaultValue: ""
|
|
2667
|
+
}))
|
|
2668
|
+
}),
|
|
2669
|
+
watch({ track: e, action: t, context: a, prop: n }) {
|
|
2670
|
+
e([() => a.get("value")], () => {
|
|
2671
|
+
t(["syncInputValue"]);
|
|
2672
|
+
}), e([() => n("edit")], () => {
|
|
2673
|
+
t(["toggleEditing"]);
|
|
2674
|
+
});
|
|
2675
|
+
},
|
|
2676
|
+
computed: {
|
|
2677
|
+
submitOnEnter({ prop: e }) {
|
|
2678
|
+
const t = e("submitMode");
|
|
2679
|
+
return t === "both" || t === "enter";
|
|
2680
|
+
},
|
|
2681
|
+
submitOnBlur({ prop: e }) {
|
|
2682
|
+
const t = e("submitMode");
|
|
2683
|
+
return t === "both" || t === "blur";
|
|
2684
|
+
},
|
|
2685
|
+
isInteractive({ prop: e }) {
|
|
2686
|
+
return !(e("disabled") || e("readOnly"));
|
|
2687
|
+
}
|
|
2688
|
+
},
|
|
2689
|
+
on: {
|
|
2690
|
+
"VALUE.SET": {
|
|
2691
|
+
actions: ["setValue"]
|
|
2692
|
+
}
|
|
2693
|
+
},
|
|
2694
|
+
states: {
|
|
2695
|
+
preview: {
|
|
2696
|
+
entry: ["blurInputIfNeeded"],
|
|
2697
|
+
on: {
|
|
2698
|
+
"CONTROLLED.EDIT": {
|
|
2699
|
+
target: "edit",
|
|
2700
|
+
actions: ["setPreviousValue", "focusInput"]
|
|
2701
|
+
},
|
|
2702
|
+
EDIT: [
|
|
2703
|
+
{
|
|
2704
|
+
guard: "isEditControlled",
|
|
2705
|
+
actions: ["invokeOnEdit"]
|
|
2706
|
+
},
|
|
2707
|
+
{
|
|
2708
|
+
target: "edit",
|
|
2709
|
+
actions: ["setPreviousValue", "focusInput", "invokeOnEdit"]
|
|
2710
|
+
}
|
|
2711
|
+
]
|
|
2712
|
+
}
|
|
2713
|
+
},
|
|
2714
|
+
edit: {
|
|
2715
|
+
effects: ["trackInteractOutside"],
|
|
2716
|
+
on: {
|
|
2717
|
+
"CONTROLLED.PREVIEW": [
|
|
2718
|
+
{
|
|
2719
|
+
guard: "isSubmitEvent",
|
|
2720
|
+
target: "preview",
|
|
2721
|
+
actions: ["setPreviousValue", "restoreFocus", "invokeOnSubmit"]
|
|
2722
|
+
},
|
|
2723
|
+
{
|
|
2724
|
+
target: "preview",
|
|
2725
|
+
actions: ["revertValue", "restoreFocus", "invokeOnCancel"]
|
|
2726
|
+
}
|
|
2727
|
+
],
|
|
2728
|
+
CANCEL: [
|
|
2729
|
+
{
|
|
2730
|
+
guard: "isEditControlled",
|
|
2731
|
+
actions: ["invokeOnPreview"]
|
|
2732
|
+
},
|
|
2733
|
+
{
|
|
2734
|
+
target: "preview",
|
|
2735
|
+
actions: ["revertValue", "restoreFocus", "invokeOnCancel", "invokeOnPreview"]
|
|
2736
|
+
}
|
|
2737
|
+
],
|
|
2738
|
+
SUBMIT: [
|
|
2739
|
+
{
|
|
2740
|
+
guard: "isEditControlled",
|
|
2741
|
+
actions: ["invokeOnPreview"]
|
|
2742
|
+
},
|
|
2743
|
+
{
|
|
2744
|
+
target: "preview",
|
|
2745
|
+
actions: ["setPreviousValue", "restoreFocus", "invokeOnSubmit", "invokeOnPreview"]
|
|
2746
|
+
}
|
|
2747
|
+
]
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
implementations: {
|
|
2752
|
+
guards: {
|
|
2753
|
+
isEditControlled: ({ prop: e }) => e("edit") != null,
|
|
2754
|
+
isSubmitEvent: ({ event: e }) => e.previousEvent?.type === "SUBMIT"
|
|
2755
|
+
},
|
|
2756
|
+
effects: {
|
|
2757
|
+
trackInteractOutside({ send: e, scope: t, prop: a, computed: n }) {
|
|
2758
|
+
return ha(Q(t), {
|
|
2759
|
+
exclude(r) {
|
|
2760
|
+
return [zn(t), Wn(t)].some((o) => ue(o, r));
|
|
2761
|
+
},
|
|
2762
|
+
onFocusOutside: a("onFocusOutside"),
|
|
2763
|
+
onPointerDownOutside: a("onPointerDownOutside"),
|
|
2764
|
+
onInteractOutside(r) {
|
|
2765
|
+
if (a("onInteractOutside")?.(r), r.defaultPrevented) return;
|
|
2766
|
+
const { focusable: i } = r.detail;
|
|
2767
|
+
e({
|
|
2768
|
+
type: n("submitOnBlur") ? "SUBMIT" : "CANCEL",
|
|
2769
|
+
src: "interact-outside",
|
|
2770
|
+
focusable: i
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
});
|
|
2774
|
+
}
|
|
2775
|
+
},
|
|
2776
|
+
actions: {
|
|
2777
|
+
restoreFocus({ event: e, scope: t, prop: a }) {
|
|
2778
|
+
e.focusable || $(() => {
|
|
2779
|
+
(a("finalFocusEl")?.() ?? qn(t))?.focus({ preventScroll: !0 });
|
|
2780
|
+
});
|
|
2781
|
+
},
|
|
2782
|
+
clearValue({ context: e }) {
|
|
2783
|
+
e.set("value", "");
|
|
2784
|
+
},
|
|
2785
|
+
focusInputIfNeeded({ action: e, prop: t }) {
|
|
2786
|
+
(t("edit") || t("defaultEdit")) && e(["focusInput"]);
|
|
2787
|
+
},
|
|
2788
|
+
focusInput({ scope: e, prop: t }) {
|
|
2789
|
+
$(() => {
|
|
2790
|
+
const a = Q(e);
|
|
2791
|
+
a && (t("selectOnFocus") ? a.select() : a.focus({ preventScroll: !0 }));
|
|
2792
|
+
});
|
|
2793
|
+
},
|
|
2794
|
+
invokeOnCancel({ prop: e, context: t }) {
|
|
2795
|
+
const a = t.get("previousValue");
|
|
2796
|
+
e("onValueRevert")?.({ value: a });
|
|
2797
|
+
},
|
|
2798
|
+
invokeOnSubmit({ prop: e, context: t }) {
|
|
2799
|
+
const a = t.get("value");
|
|
2800
|
+
e("onValueCommit")?.({ value: a });
|
|
2801
|
+
},
|
|
2802
|
+
invokeOnEdit({ prop: e }) {
|
|
2803
|
+
e("onEditChange")?.({ edit: !0 });
|
|
2804
|
+
},
|
|
2805
|
+
invokeOnPreview({ prop: e }) {
|
|
2806
|
+
e("onEditChange")?.({ edit: !1 });
|
|
2807
|
+
},
|
|
2808
|
+
toggleEditing({ prop: e, send: t, event: a }) {
|
|
2809
|
+
t({
|
|
2810
|
+
type: e("edit") ? "CONTROLLED.EDIT" : "CONTROLLED.PREVIEW",
|
|
2811
|
+
previousEvent: a
|
|
2812
|
+
});
|
|
2813
|
+
},
|
|
2814
|
+
syncInputValue({ context: e, scope: t }) {
|
|
2815
|
+
const a = Q(t);
|
|
2816
|
+
a && Y(a, e.get("value"));
|
|
2817
|
+
},
|
|
2818
|
+
setValue({ context: e, prop: t, event: a }) {
|
|
2819
|
+
const n = t("maxLength"), r = n != null ? a.value.slice(0, n) : a.value;
|
|
2820
|
+
e.set("value", r);
|
|
2821
|
+
},
|
|
2822
|
+
setPreviousValue({ context: e }) {
|
|
2823
|
+
e.set("previousValue", e.get("value"));
|
|
2824
|
+
},
|
|
2825
|
+
revertValue({ context: e }) {
|
|
2826
|
+
const t = e.get("previousValue");
|
|
2827
|
+
t && e.set("value", t);
|
|
2828
|
+
},
|
|
2829
|
+
blurInputIfNeeded({ scope: e }) {
|
|
2830
|
+
Q(e)?.blur();
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
});
|
|
2835
|
+
_()([
|
|
2836
|
+
"activationMode",
|
|
2837
|
+
"autoResize",
|
|
2838
|
+
"dir",
|
|
2839
|
+
"disabled",
|
|
2840
|
+
"finalFocusEl",
|
|
2841
|
+
"form",
|
|
2842
|
+
"getRootNode",
|
|
2843
|
+
"id",
|
|
2844
|
+
"ids",
|
|
2845
|
+
"invalid",
|
|
2846
|
+
"maxLength",
|
|
2847
|
+
"name",
|
|
2848
|
+
"onEditChange",
|
|
2849
|
+
"onFocusOutside",
|
|
2850
|
+
"onInteractOutside",
|
|
2851
|
+
"onPointerDownOutside",
|
|
2852
|
+
"onValueChange",
|
|
2853
|
+
"onValueCommit",
|
|
2854
|
+
"onValueRevert",
|
|
2855
|
+
"placeholder",
|
|
2856
|
+
"readOnly",
|
|
2857
|
+
"required",
|
|
2858
|
+
"selectOnFocus",
|
|
2859
|
+
"edit",
|
|
2860
|
+
"defaultEdit",
|
|
2861
|
+
"submitMode",
|
|
2862
|
+
"translations",
|
|
2863
|
+
"defaultValue",
|
|
2864
|
+
"value"
|
|
2865
|
+
]);
|
|
2866
|
+
function Kn(e) {
|
|
2867
|
+
const t = /* @__PURE__ */ new Map();
|
|
2868
|
+
return function(n, r) {
|
|
2869
|
+
const i = n + (r ? Object.entries(r).sort((s, l) => s[0] < l[0] ? -1 : 1).join() : "");
|
|
2870
|
+
if (t.has(i))
|
|
2871
|
+
return t.get(i);
|
|
2872
|
+
let o = new e(n, r);
|
|
2873
|
+
return t.set(i, o), o;
|
|
2874
|
+
};
|
|
2875
|
+
}
|
|
2876
|
+
var Xn = Kn(Intl.NumberFormat);
|
|
2877
|
+
function Yn(e, t, a = {}) {
|
|
2878
|
+
return Xn(t, a).format(e);
|
|
2879
|
+
}
|
|
2880
|
+
var Zn = ["", "kilo", "mega", "giga", "tera"], Jn = ["", "kilo", "mega", "giga", "tera", "peta"], Qn = (e, t = "en-US", a = {}) => {
|
|
2881
|
+
if (isNaN(e)) return "";
|
|
2882
|
+
if (e === 0) return "0 B";
|
|
2883
|
+
const { unit: n = "byte", unitDisplay: r = "short" } = a, i = n === "bit" ? Zn : Jn, o = Math.max(0, Math.min(Math.floor(Math.log10(e) / 3), i.length - 1)), s = i[o] + n, l = r || "short", h = parseFloat((e / Math.pow(1e3, o)).toPrecision(3));
|
|
2884
|
+
return Yn(h, t, {
|
|
2885
|
+
style: "unit",
|
|
2886
|
+
unit: s,
|
|
2887
|
+
unitDisplay: l
|
|
2888
|
+
});
|
|
2889
|
+
}, er = W("file-upload").parts(
|
|
2890
|
+
"root",
|
|
2891
|
+
"dropzone",
|
|
2892
|
+
"item",
|
|
2893
|
+
"itemDeleteTrigger",
|
|
2894
|
+
"itemGroup",
|
|
2895
|
+
"itemName",
|
|
2896
|
+
"itemPreview",
|
|
2897
|
+
"itemPreviewImage",
|
|
2898
|
+
"itemSizeText",
|
|
2899
|
+
"label",
|
|
2900
|
+
"trigger",
|
|
2901
|
+
"clearTrigger"
|
|
2902
|
+
), V = er.build(), Vt = (e) => e.ids?.root ?? `file:${e.id}`, Nt = (e) => e.ids?.dropzone ?? `file:${e.id}:dropzone`, Fe = (e) => e.ids?.hiddenInput ?? `file:${e.id}:input`, tr = (e) => e.ids?.trigger ?? `file:${e.id}:trigger`, ar = (e) => e.ids?.label ?? `file:${e.id}:label`, nr = (e, t) => e.ids?.item?.(t) ?? `file:${e.id}:item:${t}`, rr = (e, t) => e.ids?.itemName?.(t) ?? `file:${e.id}:item-name:${t}`, ir = (e, t) => e.ids?.itemSizeText?.(t) ?? `file:${e.id}:item-size:${t}`, or = (e, t) => e.ids?.itemPreview?.(t) ?? `file:${e.id}:item-preview:${t}`, sr = (e) => e.getById(Vt(e)), Je = (e) => e.getById(Fe(e)), lr = (e) => e.getById(Nt(e));
|
|
2903
|
+
function Qe(e) {
|
|
2904
|
+
const t = ft(e);
|
|
2905
|
+
return e.dataTransfer ? e.dataTransfer.types.some((a) => a === "Files" || a === "application/x-moz-file") : !!t && "files" in t;
|
|
2906
|
+
}
|
|
2907
|
+
function ur(e, t, a) {
|
|
2908
|
+
const { prop: n, computed: r } = e;
|
|
2909
|
+
return !r("multiple") && t > 1 ? !1 : !r("multiple") && t + a.length === 2 ? !0 : !(t + a.length > n("maxFiles"));
|
|
2910
|
+
}
|
|
2911
|
+
function et(e, t, a = [], n = []) {
|
|
2912
|
+
const { prop: r, computed: i } = e, o = [], s = [], l = {
|
|
2913
|
+
acceptedFiles: a,
|
|
2914
|
+
rejectedFiles: n
|
|
2915
|
+
};
|
|
2916
|
+
return t.forEach((h) => {
|
|
2917
|
+
const [v, b] = Dn(h, i("acceptAttr")), [m, u] = kn(h, r("minFileSize"), r("maxFileSize")), p = r("validate")?.(h, l), E = p ? p.length === 0 : !0;
|
|
2918
|
+
if (v && m && E)
|
|
2919
|
+
o.push(h);
|
|
2920
|
+
else {
|
|
2921
|
+
const I = [b, u];
|
|
2922
|
+
E || I.push(...p ?? []), s.push({ file: h, errors: I.filter(Boolean) });
|
|
2923
|
+
}
|
|
2924
|
+
}), ur(e, o.length, a) || (o.forEach((h) => {
|
|
2925
|
+
s.push({ file: h, errors: ["TOO_MANY_FILES"] });
|
|
2926
|
+
}), o.splice(0)), {
|
|
2927
|
+
acceptedFiles: o,
|
|
2928
|
+
rejectedFiles: s
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
function dr(e, t) {
|
|
2932
|
+
const a = ht(e);
|
|
2933
|
+
try {
|
|
2934
|
+
if ("DataTransfer" in a) {
|
|
2935
|
+
const n = new a.DataTransfer();
|
|
2936
|
+
t.forEach((r) => {
|
|
2937
|
+
n.items.add(r);
|
|
2938
|
+
}), e.files = n.files;
|
|
2939
|
+
}
|
|
2940
|
+
} catch {
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
function Yr(e, t) {
|
|
2944
|
+
const { state: a, send: n, prop: r, computed: i, scope: o, context: s } = e, l = r("disabled"), h = r("allowDrop"), v = r("translations"), b = a.matches("dragging"), m = a.matches("focused") && !l;
|
|
2945
|
+
return {
|
|
2946
|
+
dragging: b,
|
|
2947
|
+
focused: m,
|
|
2948
|
+
disabled: !!l,
|
|
2949
|
+
transforming: s.get("transforming"),
|
|
2950
|
+
openFilePicker() {
|
|
2951
|
+
l || n({ type: "OPEN" });
|
|
2952
|
+
},
|
|
2953
|
+
deleteFile(u) {
|
|
2954
|
+
n({ type: "FILE.DELETE", file: u });
|
|
2955
|
+
},
|
|
2956
|
+
acceptedFiles: s.get("acceptedFiles"),
|
|
2957
|
+
rejectedFiles: s.get("rejectedFiles"),
|
|
2958
|
+
setFiles(u) {
|
|
2959
|
+
n({ type: "FILES.SET", files: u, count: u.length });
|
|
2960
|
+
},
|
|
2961
|
+
clearRejectedFiles() {
|
|
2962
|
+
n({ type: "REJECTED_FILES.CLEAR" });
|
|
2963
|
+
},
|
|
2964
|
+
clearFiles() {
|
|
2965
|
+
n({ type: "FILES.CLEAR" });
|
|
2966
|
+
},
|
|
2967
|
+
getFileSize(u) {
|
|
2968
|
+
return Qn(u.size, r("locale"));
|
|
2969
|
+
},
|
|
2970
|
+
createFileUrl(u, p) {
|
|
2971
|
+
const E = o.getWin(), I = E.URL.createObjectURL(u);
|
|
2972
|
+
return p(I), () => E.URL.revokeObjectURL(I);
|
|
2973
|
+
},
|
|
2974
|
+
setClipboardFiles(u) {
|
|
2975
|
+
if (l) return !1;
|
|
2976
|
+
const E = Array.from(u?.items ?? []).reduce((I, F) => {
|
|
2977
|
+
if (F.kind !== "file") return I;
|
|
2978
|
+
const P = F.getAsFile();
|
|
2979
|
+
return P ? [...I, P] : I;
|
|
2980
|
+
}, []);
|
|
2981
|
+
return E.length ? (n({ type: "FILES.SET", files: E }), !0) : !1;
|
|
2982
|
+
},
|
|
2983
|
+
getRootProps() {
|
|
2984
|
+
return t.element({
|
|
2985
|
+
...V.root.attrs,
|
|
2986
|
+
dir: r("dir"),
|
|
2987
|
+
id: Vt(o),
|
|
2988
|
+
"data-disabled": d(l),
|
|
2989
|
+
"data-dragging": d(b)
|
|
2990
|
+
});
|
|
2991
|
+
},
|
|
2992
|
+
getDropzoneProps(u = {}) {
|
|
2993
|
+
return t.element({
|
|
2994
|
+
...V.dropzone.attrs,
|
|
2995
|
+
dir: r("dir"),
|
|
2996
|
+
id: Nt(o),
|
|
2997
|
+
tabIndex: l || u.disableClick ? void 0 : 0,
|
|
2998
|
+
role: u.disableClick ? "application" : "button",
|
|
2999
|
+
"aria-label": v.dropzone,
|
|
3000
|
+
"aria-disabled": l,
|
|
3001
|
+
"data-invalid": d(r("invalid")),
|
|
3002
|
+
"data-disabled": d(l),
|
|
3003
|
+
"data-dragging": d(b),
|
|
3004
|
+
onKeyDown(p) {
|
|
3005
|
+
l || p.defaultPrevented || Ue(p) && (u.disableClick || p.key !== "Enter" && p.key !== " " || n({ type: "DROPZONE.CLICK", src: "keydown" }));
|
|
3006
|
+
},
|
|
3007
|
+
onClick(p) {
|
|
3008
|
+
l || p.defaultPrevented || u.disableClick || Ue(p) && (p.currentTarget.localName === "label" && p.preventDefault(), n({ type: "DROPZONE.CLICK" }));
|
|
3009
|
+
},
|
|
3010
|
+
onDragOver(p) {
|
|
3011
|
+
if (l || !h) return;
|
|
3012
|
+
p.preventDefault(), p.stopPropagation();
|
|
3013
|
+
try {
|
|
3014
|
+
p.dataTransfer.dropEffect = "copy";
|
|
3015
|
+
} catch {
|
|
3016
|
+
}
|
|
3017
|
+
if (!Qe(p)) return;
|
|
3018
|
+
const I = p.dataTransfer.items.length;
|
|
3019
|
+
n({ type: "DROPZONE.DRAG_OVER", count: I });
|
|
3020
|
+
},
|
|
3021
|
+
onDragLeave(p) {
|
|
3022
|
+
l || h && (ue(p.currentTarget, p.relatedTarget) || n({ type: "DROPZONE.DRAG_LEAVE" }));
|
|
3023
|
+
},
|
|
3024
|
+
onDrop(p) {
|
|
3025
|
+
if (l) return;
|
|
3026
|
+
h && (p.preventDefault(), p.stopPropagation());
|
|
3027
|
+
const E = Qe(p);
|
|
3028
|
+
l || !E || In(p.dataTransfer.items, r("directory")).then((I) => {
|
|
3029
|
+
n({ type: "DROPZONE.DROP", files: na(I) });
|
|
3030
|
+
});
|
|
3031
|
+
},
|
|
3032
|
+
onFocus() {
|
|
3033
|
+
l || n({ type: "DROPZONE.FOCUS" });
|
|
3034
|
+
},
|
|
3035
|
+
onBlur() {
|
|
3036
|
+
l || n({ type: "DROPZONE.BLUR" });
|
|
3037
|
+
}
|
|
3038
|
+
});
|
|
3039
|
+
},
|
|
3040
|
+
getTriggerProps() {
|
|
3041
|
+
return t.button({
|
|
3042
|
+
...V.trigger.attrs,
|
|
3043
|
+
dir: r("dir"),
|
|
3044
|
+
id: tr(o),
|
|
3045
|
+
disabled: l,
|
|
3046
|
+
"data-disabled": d(l),
|
|
3047
|
+
"data-invalid": d(r("invalid")),
|
|
3048
|
+
type: "button",
|
|
3049
|
+
onClick(u) {
|
|
3050
|
+
l || (ue(lr(o), u.currentTarget) && u.stopPropagation(), n({ type: "OPEN" }));
|
|
3051
|
+
}
|
|
3052
|
+
});
|
|
3053
|
+
},
|
|
3054
|
+
getHiddenInputProps() {
|
|
3055
|
+
return t.input({
|
|
3056
|
+
id: Fe(o),
|
|
3057
|
+
tabIndex: -1,
|
|
3058
|
+
disabled: l,
|
|
3059
|
+
type: "file",
|
|
3060
|
+
required: r("required"),
|
|
3061
|
+
capture: r("capture"),
|
|
3062
|
+
name: r("name"),
|
|
3063
|
+
accept: i("acceptAttr"),
|
|
3064
|
+
webkitdirectory: r("directory") ? "" : void 0,
|
|
3065
|
+
multiple: i("multiple") || r("maxFiles") > 1,
|
|
3066
|
+
onClick(u) {
|
|
3067
|
+
u.stopPropagation(), u.currentTarget.value = "";
|
|
3068
|
+
},
|
|
3069
|
+
onInput(u) {
|
|
3070
|
+
if (l) return;
|
|
3071
|
+
const { files: p } = u.currentTarget;
|
|
3072
|
+
n({ type: "FILE.SELECT", files: p ? Array.from(p) : [] });
|
|
3073
|
+
},
|
|
3074
|
+
style: dt
|
|
3075
|
+
});
|
|
3076
|
+
},
|
|
3077
|
+
getItemGroupProps() {
|
|
3078
|
+
return t.element({
|
|
3079
|
+
...V.itemGroup.attrs,
|
|
3080
|
+
dir: r("dir"),
|
|
3081
|
+
"data-disabled": d(l)
|
|
3082
|
+
});
|
|
3083
|
+
},
|
|
3084
|
+
getItemProps(u) {
|
|
3085
|
+
const { file: p } = u;
|
|
3086
|
+
return t.element({
|
|
3087
|
+
...V.item.attrs,
|
|
3088
|
+
dir: r("dir"),
|
|
3089
|
+
id: nr(o, p.name),
|
|
3090
|
+
"data-disabled": d(l)
|
|
3091
|
+
});
|
|
3092
|
+
},
|
|
3093
|
+
getItemNameProps(u) {
|
|
3094
|
+
const { file: p } = u;
|
|
3095
|
+
return t.element({
|
|
3096
|
+
...V.itemName.attrs,
|
|
3097
|
+
dir: r("dir"),
|
|
3098
|
+
id: rr(o, p.name),
|
|
3099
|
+
"data-disabled": d(l)
|
|
3100
|
+
});
|
|
3101
|
+
},
|
|
3102
|
+
getItemSizeTextProps(u) {
|
|
3103
|
+
const { file: p } = u;
|
|
3104
|
+
return t.element({
|
|
3105
|
+
...V.itemSizeText.attrs,
|
|
3106
|
+
dir: r("dir"),
|
|
3107
|
+
id: ir(o, p.name),
|
|
3108
|
+
"data-disabled": d(l)
|
|
3109
|
+
});
|
|
3110
|
+
},
|
|
3111
|
+
getItemPreviewProps(u) {
|
|
3112
|
+
const { file: p } = u;
|
|
3113
|
+
return t.element({
|
|
3114
|
+
...V.itemPreview.attrs,
|
|
3115
|
+
dir: r("dir"),
|
|
3116
|
+
id: or(o, p.name),
|
|
3117
|
+
"data-disabled": d(l)
|
|
3118
|
+
});
|
|
3119
|
+
},
|
|
3120
|
+
getItemPreviewImageProps(u) {
|
|
3121
|
+
const { file: p, url: E } = u;
|
|
3122
|
+
if (!p.type.startsWith("image/"))
|
|
3123
|
+
throw new Error("Preview Image is only supported for image files");
|
|
3124
|
+
return t.img({
|
|
3125
|
+
...V.itemPreviewImage.attrs,
|
|
3126
|
+
alt: v.itemPreview?.(p),
|
|
3127
|
+
src: E,
|
|
3128
|
+
"data-disabled": d(l)
|
|
3129
|
+
});
|
|
3130
|
+
},
|
|
3131
|
+
getItemDeleteTriggerProps(u) {
|
|
3132
|
+
const { file: p } = u;
|
|
3133
|
+
return t.button({
|
|
3134
|
+
...V.itemDeleteTrigger.attrs,
|
|
3135
|
+
dir: r("dir"),
|
|
3136
|
+
type: "button",
|
|
3137
|
+
disabled: l,
|
|
3138
|
+
"data-disabled": d(l),
|
|
3139
|
+
"aria-label": v.deleteFile?.(p),
|
|
3140
|
+
onClick() {
|
|
3141
|
+
l || n({ type: "FILE.DELETE", file: p });
|
|
3142
|
+
}
|
|
3143
|
+
});
|
|
3144
|
+
},
|
|
3145
|
+
getLabelProps() {
|
|
3146
|
+
return t.label({
|
|
3147
|
+
...V.label.attrs,
|
|
3148
|
+
dir: r("dir"),
|
|
3149
|
+
id: ar(o),
|
|
3150
|
+
htmlFor: Fe(o),
|
|
3151
|
+
"data-disabled": d(l)
|
|
3152
|
+
});
|
|
3153
|
+
},
|
|
3154
|
+
getClearTriggerProps() {
|
|
3155
|
+
return t.button({
|
|
3156
|
+
...V.clearTrigger.attrs,
|
|
3157
|
+
dir: r("dir"),
|
|
3158
|
+
type: "button",
|
|
3159
|
+
disabled: l,
|
|
3160
|
+
hidden: s.get("acceptedFiles").length === 0,
|
|
3161
|
+
"data-disabled": d(l),
|
|
3162
|
+
onClick(u) {
|
|
3163
|
+
u.defaultPrevented || l || n({ type: "FILES.CLEAR" });
|
|
3164
|
+
}
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
3167
|
+
};
|
|
3168
|
+
}
|
|
3169
|
+
var Zr = z({
|
|
3170
|
+
props({ props: e }) {
|
|
3171
|
+
return {
|
|
3172
|
+
minFileSize: 0,
|
|
3173
|
+
maxFileSize: Number.POSITIVE_INFINITY,
|
|
3174
|
+
maxFiles: 1,
|
|
3175
|
+
allowDrop: !0,
|
|
3176
|
+
preventDocumentDrop: !0,
|
|
3177
|
+
defaultAcceptedFiles: [],
|
|
3178
|
+
...e,
|
|
3179
|
+
translations: {
|
|
3180
|
+
dropzone: "dropzone",
|
|
3181
|
+
itemPreview: (t) => `preview of ${t.name}`,
|
|
3182
|
+
deleteFile: (t) => `delete file ${t.name}`,
|
|
3183
|
+
...e.translations
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
},
|
|
3187
|
+
initialState() {
|
|
3188
|
+
return "idle";
|
|
3189
|
+
},
|
|
3190
|
+
context({ prop: e, bindable: t, getContext: a }) {
|
|
3191
|
+
return {
|
|
3192
|
+
acceptedFiles: t(() => ({
|
|
3193
|
+
defaultValue: e("defaultAcceptedFiles"),
|
|
3194
|
+
value: e("acceptedFiles"),
|
|
3195
|
+
isEqual: (n, r) => n.length === r?.length && n.every((i, o) => J(i, r[o])),
|
|
3196
|
+
hash(n) {
|
|
3197
|
+
return n.map((r) => `${r.name}-${r.size}`).join(",");
|
|
3198
|
+
},
|
|
3199
|
+
onChange(n) {
|
|
3200
|
+
const r = a();
|
|
3201
|
+
e("onFileAccept")?.({ files: n }), e("onFileChange")?.({ acceptedFiles: n, rejectedFiles: r.get("rejectedFiles") });
|
|
3202
|
+
}
|
|
3203
|
+
})),
|
|
3204
|
+
rejectedFiles: t(() => ({
|
|
3205
|
+
defaultValue: [],
|
|
3206
|
+
isEqual: (n, r) => n.length === r?.length && n.every((i, o) => J(i.file, r[o].file)),
|
|
3207
|
+
onChange(n) {
|
|
3208
|
+
const r = a();
|
|
3209
|
+
e("onFileReject")?.({ files: n }), e("onFileChange")?.({ acceptedFiles: r.get("acceptedFiles"), rejectedFiles: n });
|
|
3210
|
+
}
|
|
3211
|
+
})),
|
|
3212
|
+
transforming: t(() => ({
|
|
3213
|
+
defaultValue: !1
|
|
3214
|
+
}))
|
|
3215
|
+
};
|
|
3216
|
+
},
|
|
3217
|
+
computed: {
|
|
3218
|
+
acceptAttr: ({ prop: e }) => An(e("accept")),
|
|
3219
|
+
multiple: ({ prop: e }) => e("maxFiles") > 1
|
|
3220
|
+
},
|
|
3221
|
+
watch({ track: e, context: t, action: a }) {
|
|
3222
|
+
e([() => t.hash("acceptedFiles")], () => {
|
|
3223
|
+
a(["syncInputElement"]);
|
|
3224
|
+
});
|
|
3225
|
+
},
|
|
3226
|
+
on: {
|
|
3227
|
+
"FILES.SET": {
|
|
3228
|
+
actions: ["setFiles"]
|
|
3229
|
+
},
|
|
3230
|
+
"FILE.SELECT": {
|
|
3231
|
+
actions: ["setEventFiles"]
|
|
3232
|
+
},
|
|
3233
|
+
"FILE.DELETE": {
|
|
3234
|
+
actions: ["removeFile"]
|
|
3235
|
+
},
|
|
3236
|
+
"FILES.CLEAR": {
|
|
3237
|
+
actions: ["clearFiles"]
|
|
3238
|
+
},
|
|
3239
|
+
"REJECTED_FILES.CLEAR": {
|
|
3240
|
+
actions: ["clearRejectedFiles"]
|
|
3241
|
+
}
|
|
3242
|
+
},
|
|
3243
|
+
effects: ["preventDocumentDrop"],
|
|
3244
|
+
states: {
|
|
3245
|
+
idle: {
|
|
3246
|
+
on: {
|
|
3247
|
+
OPEN: {
|
|
3248
|
+
actions: ["openFilePicker"]
|
|
3249
|
+
},
|
|
3250
|
+
"DROPZONE.CLICK": {
|
|
3251
|
+
actions: ["openFilePicker"]
|
|
3252
|
+
},
|
|
3253
|
+
"DROPZONE.FOCUS": {
|
|
3254
|
+
target: "focused"
|
|
3255
|
+
},
|
|
3256
|
+
"DROPZONE.DRAG_OVER": {
|
|
3257
|
+
target: "dragging"
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
},
|
|
3261
|
+
focused: {
|
|
3262
|
+
on: {
|
|
3263
|
+
"DROPZONE.BLUR": {
|
|
3264
|
+
target: "idle"
|
|
3265
|
+
},
|
|
3266
|
+
OPEN: {
|
|
3267
|
+
actions: ["openFilePicker"]
|
|
3268
|
+
},
|
|
3269
|
+
"DROPZONE.CLICK": {
|
|
3270
|
+
actions: ["openFilePicker"]
|
|
3271
|
+
},
|
|
3272
|
+
"DROPZONE.DRAG_OVER": {
|
|
3273
|
+
target: "dragging"
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
},
|
|
3277
|
+
dragging: {
|
|
3278
|
+
on: {
|
|
3279
|
+
"DROPZONE.DROP": {
|
|
3280
|
+
target: "idle",
|
|
3281
|
+
actions: ["setEventFiles"]
|
|
3282
|
+
},
|
|
3283
|
+
"DROPZONE.DRAG_LEAVE": {
|
|
3284
|
+
target: "idle"
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
},
|
|
3289
|
+
implementations: {
|
|
3290
|
+
effects: {
|
|
3291
|
+
preventDocumentDrop({ prop: e, scope: t }) {
|
|
3292
|
+
if (!e("preventDocumentDrop") || !e("allowDrop") || e("disabled")) return;
|
|
3293
|
+
const a = t.getDoc(), n = (i) => {
|
|
3294
|
+
i?.preventDefault();
|
|
3295
|
+
}, r = (i) => {
|
|
3296
|
+
ue(sr(t), ft(i)) || i.preventDefault();
|
|
3297
|
+
};
|
|
3298
|
+
return aa(Me(a, "dragover", n, !1), Me(a, "drop", r, !1));
|
|
3299
|
+
}
|
|
3300
|
+
},
|
|
3301
|
+
actions: {
|
|
3302
|
+
syncInputElement({ scope: e, context: t }) {
|
|
3303
|
+
queueMicrotask(() => {
|
|
3304
|
+
const a = Je(e);
|
|
3305
|
+
if (!a) return;
|
|
3306
|
+
dr(a, t.get("acceptedFiles"));
|
|
3307
|
+
const n = e.getWin();
|
|
3308
|
+
a.dispatchEvent(new n.Event("change", { bubbles: !0 }));
|
|
3309
|
+
});
|
|
3310
|
+
},
|
|
3311
|
+
openFilePicker({ scope: e }) {
|
|
3312
|
+
$(() => {
|
|
3313
|
+
Je(e)?.click();
|
|
3314
|
+
});
|
|
3315
|
+
},
|
|
3316
|
+
setFiles(e) {
|
|
3317
|
+
const { computed: t, context: a, event: n } = e, { acceptedFiles: r, rejectedFiles: i } = et(e, n.files);
|
|
3318
|
+
a.set(
|
|
3319
|
+
"acceptedFiles",
|
|
3320
|
+
t("multiple") ? r : r.length > 0 ? [r[0]] : []
|
|
3321
|
+
), a.set("rejectedFiles", i);
|
|
3322
|
+
},
|
|
3323
|
+
setEventFiles(e) {
|
|
3324
|
+
const { computed: t, context: a, event: n, prop: r } = e, i = a.get("acceptedFiles"), o = a.get("rejectedFiles"), { acceptedFiles: s, rejectedFiles: l } = et(
|
|
3325
|
+
e,
|
|
3326
|
+
n.files,
|
|
3327
|
+
i,
|
|
3328
|
+
o
|
|
3329
|
+
), h = (b) => {
|
|
3330
|
+
if (t("multiple")) {
|
|
3331
|
+
a.set("acceptedFiles", (m) => [...m, ...b]), a.set("rejectedFiles", l);
|
|
3332
|
+
return;
|
|
3333
|
+
}
|
|
3334
|
+
if (b.length) {
|
|
3335
|
+
a.set("acceptedFiles", [b[0]]), a.set("rejectedFiles", l);
|
|
3336
|
+
return;
|
|
3337
|
+
}
|
|
3338
|
+
l.length && (a.set("acceptedFiles", a.get("acceptedFiles")), a.set("rejectedFiles", l));
|
|
3339
|
+
}, v = r("transformFiles");
|
|
3340
|
+
v ? (a.set("transforming", !0), v(s).then(h).catch((b) => {
|
|
3341
|
+
ct(`[zag-js/file-upload] error transforming files
|
|
3342
|
+
${b}`);
|
|
3343
|
+
}).finally(() => {
|
|
3344
|
+
a.set("transforming", !1);
|
|
3345
|
+
})) : h(s);
|
|
3346
|
+
},
|
|
3347
|
+
removeFile({ context: e, event: t }) {
|
|
3348
|
+
const a = e.get("acceptedFiles").filter((r) => !J(r, t.file)), n = e.get("rejectedFiles").filter((r) => !J(r.file, t.file));
|
|
3349
|
+
e.set("acceptedFiles", a), e.set("rejectedFiles", n);
|
|
3350
|
+
},
|
|
3351
|
+
clearRejectedFiles({ context: e }) {
|
|
3352
|
+
e.set("rejectedFiles", []);
|
|
3353
|
+
},
|
|
3354
|
+
clearFiles({ context: e }) {
|
|
3355
|
+
e.set("acceptedFiles", []), e.set("rejectedFiles", []);
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
});
|
|
3360
|
+
_()([
|
|
3361
|
+
"accept",
|
|
3362
|
+
"acceptedFiles",
|
|
3363
|
+
"allowDrop",
|
|
3364
|
+
"capture",
|
|
3365
|
+
"defaultAcceptedFiles",
|
|
3366
|
+
"dir",
|
|
3367
|
+
"directory",
|
|
3368
|
+
"disabled",
|
|
3369
|
+
"getRootNode",
|
|
3370
|
+
"id",
|
|
3371
|
+
"ids",
|
|
3372
|
+
"invalid",
|
|
3373
|
+
"locale",
|
|
3374
|
+
"maxFiles",
|
|
3375
|
+
"maxFileSize",
|
|
3376
|
+
"minFileSize",
|
|
3377
|
+
"name",
|
|
3378
|
+
"onFileAccept",
|
|
3379
|
+
"onFileChange",
|
|
3380
|
+
"onFileReject",
|
|
3381
|
+
"preventDocumentDrop",
|
|
3382
|
+
"required",
|
|
3383
|
+
"transformFiles",
|
|
3384
|
+
"translations",
|
|
3385
|
+
"validate"
|
|
3386
|
+
]);
|
|
3387
|
+
_()(["file"]);
|
|
3388
|
+
var cr = W("slider").parts(
|
|
3389
|
+
"root",
|
|
3390
|
+
"label",
|
|
3391
|
+
"thumb",
|
|
3392
|
+
"valueText",
|
|
3393
|
+
"track",
|
|
3394
|
+
"range",
|
|
3395
|
+
"control",
|
|
3396
|
+
"markerGroup",
|
|
3397
|
+
"marker",
|
|
3398
|
+
"draggingIndicator"
|
|
3399
|
+
), N = cr.build(), $t = (e) => e.ids?.root ?? `slider:${e.id}`, Lt = (e, t) => e.ids?.thumb?.(t) ?? `slider:${e.id}:thumb:${t}`, _e = (e, t) => e.ids?.hiddenInput?.(t) ?? `slider:${e.id}:input:${t}`, Dt = (e) => e.ids?.control ?? `slider:${e.id}:control`, gr = (e) => e.ids?.track ?? `slider:${e.id}:track`, pr = (e) => e.ids?.range ?? `slider:${e.id}:range`, tt = (e) => e.ids?.label ?? `slider:${e.id}:label`, hr = (e) => e.ids?.valueText ?? `slider:${e.id}:value-text`, fr = (e, t) => e.ids?.marker?.(t) ?? `slider:${e.id}:marker:${t}`, mr = (e) => e.getById($t(e)), vr = (e, t) => e.getById(Lt(e, t)), Mt = (e) => le(Gt(e), "[role=slider]"), br = (e) => Mt(e)[0], Ut = (e, t) => e.getById(_e(e, t)), Gt = (e) => e.getById(Dt(e)), at = (e, t) => {
|
|
3400
|
+
const { prop: a, scope: n } = e, r = Gt(n);
|
|
3401
|
+
if (!r) return;
|
|
3402
|
+
const o = ke(t, r).getPercentValue({
|
|
3403
|
+
orientation: a("orientation"),
|
|
3404
|
+
dir: a("dir"),
|
|
3405
|
+
inverted: { y: !0 }
|
|
3406
|
+
});
|
|
3407
|
+
return Ae(o, a("min"), a("max"), a("step"));
|
|
3408
|
+
}, Er = (e, t) => {
|
|
3409
|
+
t.forEach((a, n) => {
|
|
3410
|
+
const r = Ut(e, n);
|
|
3411
|
+
r && st(r, { value: a });
|
|
3412
|
+
});
|
|
3413
|
+
}, Cr = (e) => ({
|
|
3414
|
+
left: e?.offsetLeft ?? 0,
|
|
3415
|
+
top: e?.offsetTop ?? 0,
|
|
3416
|
+
width: e?.offsetWidth ?? 0,
|
|
3417
|
+
height: e?.offsetHeight ?? 0
|
|
3418
|
+
});
|
|
3419
|
+
function yr(e) {
|
|
3420
|
+
const t = e[0], a = e[e.length - 1];
|
|
3421
|
+
return [t, a];
|
|
3422
|
+
}
|
|
3423
|
+
function Ir(e) {
|
|
3424
|
+
const { prop: t, computed: a } = e, n = a("valuePercent"), [r, i] = yr(n);
|
|
3425
|
+
if (n.length === 1) {
|
|
3426
|
+
if (t("origin") === "center") {
|
|
3427
|
+
const o = n[0] < 50, s = o ? `${n[0]}%` : "50%", l = o ? "50%" : `${100 - n[0]}%`;
|
|
3428
|
+
return { start: s, end: l };
|
|
3429
|
+
}
|
|
3430
|
+
return t("origin") === "end" ? { start: `${i}%`, end: "0%" } : { start: "0%", end: `${100 - i}%` };
|
|
3431
|
+
}
|
|
3432
|
+
return { start: `${r}%`, end: `${100 - i}%` };
|
|
3433
|
+
}
|
|
3434
|
+
function Sr(e) {
|
|
3435
|
+
const { computed: t } = e, a = t("isVertical"), n = t("isRtl");
|
|
3436
|
+
return a ? {
|
|
3437
|
+
position: "absolute",
|
|
3438
|
+
bottom: "var(--slider-range-start)",
|
|
3439
|
+
top: "var(--slider-range-end)"
|
|
3440
|
+
} : {
|
|
3441
|
+
position: "absolute",
|
|
3442
|
+
[n ? "right" : "left"]: "var(--slider-range-start)",
|
|
3443
|
+
[n ? "left" : "right"]: "var(--slider-range-end)"
|
|
3444
|
+
};
|
|
3445
|
+
}
|
|
3446
|
+
function Or(e, t) {
|
|
3447
|
+
const { context: a, prop: n } = e, { height: r = 0 } = a.get("thumbSize") ?? {}, i = Ce([n("min"), n("max")], [-r / 2, r / 2]);
|
|
3448
|
+
return parseFloat(i(t).toFixed(2));
|
|
3449
|
+
}
|
|
3450
|
+
function Tr(e, t) {
|
|
3451
|
+
const { computed: a, context: n, prop: r } = e, { width: i = 0 } = n.get("thumbSize") ?? {};
|
|
3452
|
+
if (a("isRtl")) {
|
|
3453
|
+
const l = Ce([r("max"), r("min")], [-i / 2, i / 2]);
|
|
3454
|
+
return -1 * parseFloat(l(t).toFixed(2));
|
|
3455
|
+
}
|
|
3456
|
+
const s = Ce([r("min"), r("max")], [-i / 2, i / 2]);
|
|
3457
|
+
return parseFloat(s(t).toFixed(2));
|
|
3458
|
+
}
|
|
3459
|
+
function Rr(e, t, a) {
|
|
3460
|
+
const { computed: n, prop: r } = e;
|
|
3461
|
+
if (r("thumbAlignment") === "center") return `${t}%`;
|
|
3462
|
+
const i = n("isVertical") ? Or(e, a) : Tr(e, a);
|
|
3463
|
+
return `calc(${t}% - ${i}px)`;
|
|
3464
|
+
}
|
|
3465
|
+
function Bt(e, t) {
|
|
3466
|
+
const { prop: a } = e, n = ge(t, a("min"), a("max")) * 100;
|
|
3467
|
+
return Rr(e, n, t);
|
|
3468
|
+
}
|
|
3469
|
+
function Ht(e) {
|
|
3470
|
+
const { computed: t, prop: a } = e;
|
|
3471
|
+
let n = "visible";
|
|
3472
|
+
return a("thumbAlignment") === "contain" && !t("hasMeasuredThumbSize") && (n = "hidden"), n;
|
|
3473
|
+
}
|
|
3474
|
+
function nt(e, t) {
|
|
3475
|
+
const { computed: a } = e, n = a("isVertical") ? "bottom" : "insetInlineStart";
|
|
3476
|
+
return {
|
|
3477
|
+
visibility: Ht(e),
|
|
3478
|
+
position: "absolute",
|
|
3479
|
+
transform: "var(--slider-thumb-transform)",
|
|
3480
|
+
[n]: `var(--slider-thumb-offset-${t})`
|
|
3481
|
+
};
|
|
3482
|
+
}
|
|
3483
|
+
function wr() {
|
|
3484
|
+
return {
|
|
3485
|
+
touchAction: "none",
|
|
3486
|
+
userSelect: "none",
|
|
3487
|
+
WebkitUserSelect: "none",
|
|
3488
|
+
position: "relative"
|
|
3489
|
+
};
|
|
3490
|
+
}
|
|
3491
|
+
function Pr(e) {
|
|
3492
|
+
const { context: t, computed: a } = e, n = a("isVertical"), r = a("isRtl"), i = Ir(e), o = t.get("thumbSize");
|
|
3493
|
+
return {
|
|
3494
|
+
...t.get("value").reduce((l, h, v) => {
|
|
3495
|
+
const b = Bt(e, h);
|
|
3496
|
+
return { ...l, [`--slider-thumb-offset-${v}`]: b };
|
|
3497
|
+
}, {}),
|
|
3498
|
+
"--slider-thumb-width": Ge(o?.width),
|
|
3499
|
+
"--slider-thumb-height": Ge(o?.height),
|
|
3500
|
+
"--slider-thumb-transform": n ? "translateY(50%)" : r ? "translateX(50%)" : "translateX(-50%)",
|
|
3501
|
+
"--slider-range-start": i.start,
|
|
3502
|
+
"--slider-range-end": i.end
|
|
3503
|
+
};
|
|
3504
|
+
}
|
|
3505
|
+
function Fr(e, t) {
|
|
3506
|
+
const { computed: a } = e, n = a("isHorizontal"), r = a("isRtl");
|
|
3507
|
+
return {
|
|
3508
|
+
visibility: Ht(e),
|
|
3509
|
+
position: "absolute",
|
|
3510
|
+
pointerEvents: "none",
|
|
3511
|
+
[n ? "insetInlineStart" : "bottom"]: Bt(e, t),
|
|
3512
|
+
translate: "var(--tx) var(--ty)",
|
|
3513
|
+
"--tx": n ? r ? "50%" : "-50%" : "0%",
|
|
3514
|
+
"--ty": n ? "0%" : "50%"
|
|
3515
|
+
};
|
|
3516
|
+
}
|
|
3517
|
+
function _r() {
|
|
3518
|
+
return {
|
|
3519
|
+
userSelect: "none",
|
|
3520
|
+
WebkitUserSelect: "none",
|
|
3521
|
+
pointerEvents: "none",
|
|
3522
|
+
position: "relative"
|
|
3523
|
+
};
|
|
3524
|
+
}
|
|
3525
|
+
function xr(e, t) {
|
|
3526
|
+
return t.map((a, n) => xe(e, a, n));
|
|
3527
|
+
}
|
|
3528
|
+
function U(e, t) {
|
|
3529
|
+
const { context: a, prop: n } = e, r = n("step") * n("minStepsBetweenThumbs");
|
|
3530
|
+
return mt(a.get("value"), n("min"), n("max"), r)[t];
|
|
3531
|
+
}
|
|
3532
|
+
function xe(e, t, a) {
|
|
3533
|
+
const { prop: n } = e, r = U(e, a), i = ie(t, n("min"), n("max"), n("step"));
|
|
3534
|
+
return k(i, r.min, r.max);
|
|
3535
|
+
}
|
|
3536
|
+
function Ar(e, t, a) {
|
|
3537
|
+
const { context: n, prop: r } = e, i = t ?? n.get("focusedIndex"), o = U(e, i), s = sa(i, {
|
|
3538
|
+
...o,
|
|
3539
|
+
step: a ?? r("step"),
|
|
3540
|
+
values: n.get("value")
|
|
3541
|
+
});
|
|
3542
|
+
return s[i] = k(s[i], o.min, o.max), s;
|
|
3543
|
+
}
|
|
3544
|
+
function kr(e, t, a) {
|
|
3545
|
+
const { context: n, prop: r } = e, i = t ?? n.get("focusedIndex"), o = U(e, i), s = oa(i, {
|
|
3546
|
+
...o,
|
|
3547
|
+
step: a ?? r("step"),
|
|
3548
|
+
values: n.get("value")
|
|
3549
|
+
});
|
|
3550
|
+
return s[i] = k(s[i], o.min, o.max), s;
|
|
3551
|
+
}
|
|
3552
|
+
function Vr(e, t) {
|
|
3553
|
+
const { context: a } = e;
|
|
3554
|
+
return la(a.get("value"), t);
|
|
3555
|
+
}
|
|
3556
|
+
function Jr(e, t) {
|
|
3557
|
+
const { state: a, send: n, context: r, prop: i, computed: o, scope: s } = e, l = i("aria-label"), h = i("aria-labelledby"), v = r.get("value"), b = r.get("focusedIndex"), m = a.matches("focus"), u = a.matches("dragging"), p = o("isDisabled"), E = i("invalid"), I = o("isInteractive"), F = i("orientation") === "horizontal", P = i("orientation") === "vertical";
|
|
3558
|
+
function B(g) {
|
|
3559
|
+
return ge(g, i("min"), i("max"));
|
|
3560
|
+
}
|
|
3561
|
+
function S(g) {
|
|
3562
|
+
return Ae(g, i("min"), i("max"), i("step"));
|
|
3563
|
+
}
|
|
3564
|
+
return {
|
|
3565
|
+
value: v,
|
|
3566
|
+
dragging: u,
|
|
3567
|
+
focused: m,
|
|
3568
|
+
setValue(g) {
|
|
3569
|
+
n({ type: "SET_VALUE", value: g });
|
|
3570
|
+
},
|
|
3571
|
+
getThumbValue(g) {
|
|
3572
|
+
return v[g];
|
|
3573
|
+
},
|
|
3574
|
+
setThumbValue(g, c) {
|
|
3575
|
+
n({ type: "SET_VALUE", index: g, value: c });
|
|
3576
|
+
},
|
|
3577
|
+
getValuePercent: B,
|
|
3578
|
+
getPercentValue: S,
|
|
3579
|
+
getThumbPercent(g) {
|
|
3580
|
+
return B(v[g]);
|
|
3581
|
+
},
|
|
3582
|
+
setThumbPercent(g, c) {
|
|
3583
|
+
const f = S(c);
|
|
3584
|
+
n({ type: "SET_VALUE", index: g, value: f });
|
|
3585
|
+
},
|
|
3586
|
+
getThumbMin(g) {
|
|
3587
|
+
return U(e, g).min;
|
|
3588
|
+
},
|
|
3589
|
+
getThumbMax(g) {
|
|
3590
|
+
return U(e, g).max;
|
|
3591
|
+
},
|
|
3592
|
+
increment(g) {
|
|
3593
|
+
n({ type: "INCREMENT", index: g });
|
|
3594
|
+
},
|
|
3595
|
+
decrement(g) {
|
|
3596
|
+
n({ type: "DECREMENT", index: g });
|
|
3597
|
+
},
|
|
3598
|
+
focus() {
|
|
3599
|
+
I && n({ type: "FOCUS", index: 0 });
|
|
3600
|
+
},
|
|
3601
|
+
getLabelProps() {
|
|
3602
|
+
return t.label({
|
|
3603
|
+
...N.label.attrs,
|
|
3604
|
+
dir: i("dir"),
|
|
3605
|
+
"data-disabled": d(p),
|
|
3606
|
+
"data-orientation": i("orientation"),
|
|
3607
|
+
"data-invalid": d(E),
|
|
3608
|
+
"data-dragging": d(u),
|
|
3609
|
+
"data-focus": d(m),
|
|
3610
|
+
id: tt(s),
|
|
3611
|
+
htmlFor: _e(s, 0),
|
|
3612
|
+
onClick(g) {
|
|
3613
|
+
I && (g.preventDefault(), br(s)?.focus());
|
|
3614
|
+
},
|
|
3615
|
+
style: {
|
|
3616
|
+
userSelect: "none",
|
|
3617
|
+
WebkitUserSelect: "none"
|
|
3618
|
+
}
|
|
3619
|
+
});
|
|
3620
|
+
},
|
|
3621
|
+
getRootProps() {
|
|
3622
|
+
return t.element({
|
|
3623
|
+
...N.root.attrs,
|
|
3624
|
+
"data-disabled": d(p),
|
|
3625
|
+
"data-orientation": i("orientation"),
|
|
3626
|
+
"data-dragging": d(u),
|
|
3627
|
+
"data-invalid": d(E),
|
|
3628
|
+
"data-focus": d(m),
|
|
3629
|
+
id: $t(s),
|
|
3630
|
+
dir: i("dir"),
|
|
3631
|
+
style: Pr(e)
|
|
3632
|
+
});
|
|
3633
|
+
},
|
|
3634
|
+
getValueTextProps() {
|
|
3635
|
+
return t.element({
|
|
3636
|
+
...N.valueText.attrs,
|
|
3637
|
+
dir: i("dir"),
|
|
3638
|
+
"data-disabled": d(p),
|
|
3639
|
+
"data-orientation": i("orientation"),
|
|
3640
|
+
"data-invalid": d(E),
|
|
3641
|
+
"data-focus": d(m),
|
|
3642
|
+
id: hr(s)
|
|
3643
|
+
});
|
|
3644
|
+
},
|
|
3645
|
+
getTrackProps() {
|
|
3646
|
+
return t.element({
|
|
3647
|
+
...N.track.attrs,
|
|
3648
|
+
dir: i("dir"),
|
|
3649
|
+
id: gr(s),
|
|
3650
|
+
"data-disabled": d(p),
|
|
3651
|
+
"data-invalid": d(E),
|
|
3652
|
+
"data-dragging": d(u),
|
|
3653
|
+
"data-orientation": i("orientation"),
|
|
3654
|
+
"data-focus": d(m),
|
|
3655
|
+
style: { position: "relative" }
|
|
3656
|
+
});
|
|
3657
|
+
},
|
|
3658
|
+
getThumbProps(g) {
|
|
3659
|
+
const { index: c = 0, name: f } = g, y = v[c], C = U(e, c), R = i("getAriaValueText")?.({ value: y, index: c }), L = Array.isArray(l) ? l[c] : l, H = Array.isArray(h) ? h[c] : h;
|
|
3660
|
+
return t.element({
|
|
3661
|
+
...N.thumb.attrs,
|
|
3662
|
+
dir: i("dir"),
|
|
3663
|
+
"data-index": c,
|
|
3664
|
+
"data-name": f,
|
|
3665
|
+
id: Lt(s, c),
|
|
3666
|
+
"data-disabled": d(p),
|
|
3667
|
+
"data-orientation": i("orientation"),
|
|
3668
|
+
"data-focus": d(m && b === c),
|
|
3669
|
+
"data-dragging": d(u && b === c),
|
|
3670
|
+
draggable: !1,
|
|
3671
|
+
"aria-disabled": X(p),
|
|
3672
|
+
"aria-label": L,
|
|
3673
|
+
"aria-labelledby": H ?? tt(s),
|
|
3674
|
+
"aria-orientation": i("orientation"),
|
|
3675
|
+
"aria-valuemax": C.max,
|
|
3676
|
+
"aria-valuemin": C.min,
|
|
3677
|
+
"aria-valuenow": v[c],
|
|
3678
|
+
"aria-valuetext": R,
|
|
3679
|
+
role: "slider",
|
|
3680
|
+
tabIndex: p ? void 0 : 0,
|
|
3681
|
+
style: nt(e, c),
|
|
3682
|
+
onPointerDown(x) {
|
|
3683
|
+
I && se(x) && (n({ type: "THUMB_POINTER_DOWN", index: c }), x.stopPropagation());
|
|
3684
|
+
},
|
|
3685
|
+
onBlur() {
|
|
3686
|
+
I && n({ type: "BLUR" });
|
|
3687
|
+
},
|
|
3688
|
+
onFocus() {
|
|
3689
|
+
I && n({ type: "FOCUS", index: c });
|
|
3690
|
+
},
|
|
3691
|
+
onKeyDown(x) {
|
|
3692
|
+
if (x.defaultPrevented || !I) return;
|
|
3693
|
+
const w = ve(x) * i("step"), A = {
|
|
3694
|
+
ArrowUp() {
|
|
3695
|
+
F || n({ type: "ARROW_INC", step: w, src: "ArrowUp" });
|
|
3696
|
+
},
|
|
3697
|
+
ArrowDown() {
|
|
3698
|
+
F || n({ type: "ARROW_DEC", step: w, src: "ArrowDown" });
|
|
3699
|
+
},
|
|
3700
|
+
ArrowLeft() {
|
|
3701
|
+
P || n({ type: "ARROW_DEC", step: w, src: "ArrowLeft" });
|
|
3702
|
+
},
|
|
3703
|
+
ArrowRight() {
|
|
3704
|
+
P || n({ type: "ARROW_INC", step: w, src: "ArrowRight" });
|
|
3705
|
+
},
|
|
3706
|
+
PageUp() {
|
|
3707
|
+
n({ type: "ARROW_INC", step: w, src: "PageUp" });
|
|
3708
|
+
},
|
|
3709
|
+
PageDown() {
|
|
3710
|
+
n({ type: "ARROW_DEC", step: w, src: "PageDown" });
|
|
3711
|
+
},
|
|
3712
|
+
Home() {
|
|
3713
|
+
n({ type: "HOME" });
|
|
3714
|
+
},
|
|
3715
|
+
End() {
|
|
3716
|
+
n({ type: "END" });
|
|
3717
|
+
}
|
|
3718
|
+
}, he = oe(x, {
|
|
3719
|
+
dir: i("dir"),
|
|
3720
|
+
orientation: i("orientation")
|
|
3721
|
+
}), M = A[he];
|
|
3722
|
+
M && (M(x), x.preventDefault(), x.stopPropagation());
|
|
3723
|
+
}
|
|
3724
|
+
});
|
|
3725
|
+
},
|
|
3726
|
+
getHiddenInputProps(g) {
|
|
3727
|
+
const { index: c = 0, name: f } = g;
|
|
3728
|
+
return t.input({
|
|
3729
|
+
name: f ?? (i("name") ? i("name") + (v.length > 1 ? "[]" : "") : void 0),
|
|
3730
|
+
form: i("form"),
|
|
3731
|
+
type: "text",
|
|
3732
|
+
hidden: !0,
|
|
3733
|
+
defaultValue: v[c],
|
|
3734
|
+
id: _e(s, c)
|
|
3735
|
+
});
|
|
3736
|
+
},
|
|
3737
|
+
getRangeProps() {
|
|
3738
|
+
return t.element({
|
|
3739
|
+
id: pr(s),
|
|
3740
|
+
...N.range.attrs,
|
|
3741
|
+
dir: i("dir"),
|
|
3742
|
+
"data-dragging": d(u),
|
|
3743
|
+
"data-focus": d(m),
|
|
3744
|
+
"data-invalid": d(E),
|
|
3745
|
+
"data-disabled": d(p),
|
|
3746
|
+
"data-orientation": i("orientation"),
|
|
3747
|
+
style: Sr(e)
|
|
3748
|
+
});
|
|
3749
|
+
},
|
|
3750
|
+
getControlProps() {
|
|
3751
|
+
return t.element({
|
|
3752
|
+
...N.control.attrs,
|
|
3753
|
+
dir: i("dir"),
|
|
3754
|
+
id: Dt(s),
|
|
3755
|
+
"data-dragging": d(u),
|
|
3756
|
+
"data-disabled": d(p),
|
|
3757
|
+
"data-orientation": i("orientation"),
|
|
3758
|
+
"data-invalid": d(E),
|
|
3759
|
+
"data-focus": d(m),
|
|
3760
|
+
style: wr(),
|
|
3761
|
+
onPointerDown(g) {
|
|
3762
|
+
if (!I || !se(g) || be(g)) return;
|
|
3763
|
+
const c = Ee(g);
|
|
3764
|
+
n({ type: "POINTER_DOWN", point: c }), g.preventDefault(), g.stopPropagation();
|
|
3765
|
+
}
|
|
3766
|
+
});
|
|
3767
|
+
},
|
|
3768
|
+
getMarkerGroupProps() {
|
|
3769
|
+
return t.element({
|
|
3770
|
+
...N.markerGroup.attrs,
|
|
3771
|
+
role: "presentation",
|
|
3772
|
+
dir: i("dir"),
|
|
3773
|
+
"aria-hidden": !0,
|
|
3774
|
+
"data-orientation": i("orientation"),
|
|
3775
|
+
style: _r()
|
|
3776
|
+
});
|
|
3777
|
+
},
|
|
3778
|
+
getMarkerProps(g) {
|
|
3779
|
+
const c = Fr(e, g.value);
|
|
3780
|
+
let f;
|
|
3781
|
+
return g.value < pt(v) ? f = "under-value" : g.value > gt(v) ? f = "over-value" : f = "at-value", t.element({
|
|
3782
|
+
...N.marker.attrs,
|
|
3783
|
+
id: fr(s, g.value),
|
|
3784
|
+
role: "presentation",
|
|
3785
|
+
dir: i("dir"),
|
|
3786
|
+
"data-orientation": i("orientation"),
|
|
3787
|
+
"data-value": g.value,
|
|
3788
|
+
"data-disabled": d(p),
|
|
3789
|
+
"data-state": f,
|
|
3790
|
+
style: c
|
|
3791
|
+
});
|
|
3792
|
+
},
|
|
3793
|
+
getDraggingIndicatorProps(g) {
|
|
3794
|
+
const { index: c = 0 } = g, f = c === b && u;
|
|
3795
|
+
return t.element({
|
|
3796
|
+
...N.draggingIndicator.attrs,
|
|
3797
|
+
role: "presentation",
|
|
3798
|
+
dir: i("dir"),
|
|
3799
|
+
hidden: !f,
|
|
3800
|
+
"data-orientation": i("orientation"),
|
|
3801
|
+
"data-state": f ? "open" : "closed",
|
|
3802
|
+
style: nt(e, c)
|
|
3803
|
+
});
|
|
3804
|
+
}
|
|
3805
|
+
};
|
|
3806
|
+
}
|
|
3807
|
+
var Nr = (e, t) => e?.width === t?.width && e?.height === t?.height, rt = (e, t, a, n, r) => mt(e, t, a, r * n).map((o) => {
|
|
3808
|
+
const s = ie(o.value, o.min, o.max, n), l = k(s, o.min, o.max);
|
|
3809
|
+
if (!ua(l, t, a))
|
|
3810
|
+
throw new Error(
|
|
3811
|
+
"[zag-js/slider] The configured `min`, `max`, `step` or `minStepsBetweenThumbs` values are invalid"
|
|
3812
|
+
);
|
|
3813
|
+
return l;
|
|
3814
|
+
}), Qr = z({
|
|
3815
|
+
props({ props: e }) {
|
|
3816
|
+
const t = e.min ?? 0, a = e.max ?? 100, n = e.step ?? 1, r = e.defaultValue ?? [t], i = e.minStepsBetweenThumbs ?? 0;
|
|
3817
|
+
return {
|
|
3818
|
+
dir: "ltr",
|
|
3819
|
+
thumbAlignment: "contain",
|
|
3820
|
+
origin: "start",
|
|
3821
|
+
orientation: "horizontal",
|
|
3822
|
+
minStepsBetweenThumbs: i,
|
|
3823
|
+
...e,
|
|
3824
|
+
defaultValue: rt(r, t, a, n, i),
|
|
3825
|
+
value: e.value ? rt(e.value, t, a, n, i) : void 0,
|
|
3826
|
+
max: a,
|
|
3827
|
+
step: n,
|
|
3828
|
+
min: t
|
|
3829
|
+
};
|
|
3830
|
+
},
|
|
3831
|
+
initialState() {
|
|
3832
|
+
return "idle";
|
|
3833
|
+
},
|
|
3834
|
+
context({ prop: e, bindable: t, getContext: a }) {
|
|
3835
|
+
return {
|
|
3836
|
+
thumbSize: t(() => ({
|
|
3837
|
+
defaultValue: e("thumbSize") || null
|
|
3838
|
+
})),
|
|
3839
|
+
value: t(() => ({
|
|
3840
|
+
defaultValue: e("defaultValue"),
|
|
3841
|
+
value: e("value"),
|
|
3842
|
+
isEqual: ia,
|
|
3843
|
+
hash(n) {
|
|
3844
|
+
return n.join(",");
|
|
3845
|
+
},
|
|
3846
|
+
onChange(n) {
|
|
3847
|
+
e("onValueChange")?.({ value: n });
|
|
3848
|
+
}
|
|
3849
|
+
})),
|
|
3850
|
+
focusedIndex: t(() => ({
|
|
3851
|
+
defaultValue: -1,
|
|
3852
|
+
onChange(n) {
|
|
3853
|
+
const r = a();
|
|
3854
|
+
e("onFocusChange")?.({ focusedIndex: n, value: r.get("value") });
|
|
3855
|
+
}
|
|
3856
|
+
})),
|
|
3857
|
+
fieldsetDisabled: t(() => ({
|
|
3858
|
+
defaultValue: !1
|
|
3859
|
+
}))
|
|
3860
|
+
};
|
|
3861
|
+
},
|
|
3862
|
+
computed: {
|
|
3863
|
+
isHorizontal: ({ prop: e }) => e("orientation") === "horizontal",
|
|
3864
|
+
isVertical: ({ prop: e }) => e("orientation") === "vertical",
|
|
3865
|
+
isRtl: ({ prop: e }) => e("orientation") === "horizontal" && e("dir") === "rtl",
|
|
3866
|
+
isDisabled: ({ context: e, prop: t }) => !!t("disabled") || e.get("fieldsetDisabled"),
|
|
3867
|
+
isInteractive: ({ prop: e, computed: t }) => !(e("readOnly") || t("isDisabled")),
|
|
3868
|
+
hasMeasuredThumbSize: ({ context: e }) => e.get("thumbSize") != null,
|
|
3869
|
+
valuePercent({ context: e, prop: t }) {
|
|
3870
|
+
return e.get("value").map((a) => 100 * ge(a, t("min"), t("max")));
|
|
3871
|
+
}
|
|
3872
|
+
},
|
|
3873
|
+
watch({ track: e, action: t, context: a }) {
|
|
3874
|
+
e([() => a.hash("value")], () => {
|
|
3875
|
+
t(["syncInputElements", "dispatchChangeEvent"]);
|
|
3876
|
+
});
|
|
3877
|
+
},
|
|
3878
|
+
effects: ["trackFormControlState", "trackThumbSize"],
|
|
3879
|
+
on: {
|
|
3880
|
+
SET_VALUE: [
|
|
3881
|
+
{
|
|
3882
|
+
guard: "hasIndex",
|
|
3883
|
+
actions: ["setValueAtIndex"]
|
|
3884
|
+
},
|
|
3885
|
+
{
|
|
3886
|
+
actions: ["setValue"]
|
|
3887
|
+
}
|
|
3888
|
+
],
|
|
3889
|
+
INCREMENT: {
|
|
3890
|
+
actions: ["incrementThumbAtIndex"]
|
|
3891
|
+
},
|
|
3892
|
+
DECREMENT: {
|
|
3893
|
+
actions: ["decrementThumbAtIndex"]
|
|
3894
|
+
}
|
|
3895
|
+
},
|
|
3896
|
+
states: {
|
|
3897
|
+
idle: {
|
|
3898
|
+
on: {
|
|
3899
|
+
POINTER_DOWN: {
|
|
3900
|
+
target: "dragging",
|
|
3901
|
+
actions: ["setClosestThumbIndex", "setPointerValue", "focusActiveThumb"]
|
|
3902
|
+
},
|
|
3903
|
+
FOCUS: {
|
|
3904
|
+
target: "focus",
|
|
3905
|
+
actions: ["setFocusedIndex"]
|
|
3906
|
+
},
|
|
3907
|
+
THUMB_POINTER_DOWN: {
|
|
3908
|
+
target: "dragging",
|
|
3909
|
+
actions: ["setFocusedIndex", "focusActiveThumb"]
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3912
|
+
},
|
|
3913
|
+
focus: {
|
|
3914
|
+
entry: ["focusActiveThumb"],
|
|
3915
|
+
on: {
|
|
3916
|
+
POINTER_DOWN: {
|
|
3917
|
+
target: "dragging",
|
|
3918
|
+
actions: ["setClosestThumbIndex", "setPointerValue", "focusActiveThumb"]
|
|
3919
|
+
},
|
|
3920
|
+
THUMB_POINTER_DOWN: {
|
|
3921
|
+
target: "dragging",
|
|
3922
|
+
actions: ["setFocusedIndex", "focusActiveThumb"]
|
|
3923
|
+
},
|
|
3924
|
+
ARROW_DEC: {
|
|
3925
|
+
actions: ["decrementThumbAtIndex", "invokeOnChangeEnd"]
|
|
3926
|
+
},
|
|
3927
|
+
ARROW_INC: {
|
|
3928
|
+
actions: ["incrementThumbAtIndex", "invokeOnChangeEnd"]
|
|
3929
|
+
},
|
|
3930
|
+
HOME: {
|
|
3931
|
+
actions: ["setFocusedThumbToMin", "invokeOnChangeEnd"]
|
|
3932
|
+
},
|
|
3933
|
+
END: {
|
|
3934
|
+
actions: ["setFocusedThumbToMax", "invokeOnChangeEnd"]
|
|
3935
|
+
},
|
|
3936
|
+
BLUR: {
|
|
3937
|
+
target: "idle",
|
|
3938
|
+
actions: ["clearFocusedIndex"]
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
},
|
|
3942
|
+
dragging: {
|
|
3943
|
+
entry: ["focusActiveThumb"],
|
|
3944
|
+
effects: ["trackPointerMove"],
|
|
3945
|
+
on: {
|
|
3946
|
+
POINTER_UP: {
|
|
3947
|
+
target: "focus",
|
|
3948
|
+
actions: ["invokeOnChangeEnd"]
|
|
3949
|
+
},
|
|
3950
|
+
POINTER_MOVE: {
|
|
3951
|
+
actions: ["setPointerValue"]
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
},
|
|
3956
|
+
implementations: {
|
|
3957
|
+
guards: {
|
|
3958
|
+
hasIndex: ({ event: e }) => e.index != null
|
|
3959
|
+
},
|
|
3960
|
+
effects: {
|
|
3961
|
+
trackFormControlState({ context: e, scope: t }) {
|
|
3962
|
+
return ut(mr(t), {
|
|
3963
|
+
onFieldsetDisabledChange(a) {
|
|
3964
|
+
e.set("fieldsetDisabled", a);
|
|
3965
|
+
},
|
|
3966
|
+
onFormReset() {
|
|
3967
|
+
e.set("value", e.initial("value"));
|
|
3968
|
+
}
|
|
3969
|
+
});
|
|
3970
|
+
},
|
|
3971
|
+
trackPointerMove({ scope: e, send: t }) {
|
|
3972
|
+
return lt(e.getDoc(), {
|
|
3973
|
+
onPointerMove(a) {
|
|
3974
|
+
t({ type: "POINTER_MOVE", point: a.point });
|
|
3975
|
+
},
|
|
3976
|
+
onPointerUp() {
|
|
3977
|
+
t({ type: "POINTER_UP" });
|
|
3978
|
+
}
|
|
3979
|
+
});
|
|
3980
|
+
},
|
|
3981
|
+
trackThumbSize({ context: e, scope: t, prop: a }) {
|
|
3982
|
+
if (!(a("thumbAlignment") !== "contain" || a("thumbSize")))
|
|
3983
|
+
return ra(Mt(t), {
|
|
3984
|
+
box: "border-box",
|
|
3985
|
+
measure(n) {
|
|
3986
|
+
return Cr(n);
|
|
3987
|
+
},
|
|
3988
|
+
onEntry({ rects: n }) {
|
|
3989
|
+
if (n.length === 0) return;
|
|
3990
|
+
const r = da(n[0], ["width", "height"]);
|
|
3991
|
+
Nr(e.get("thumbSize"), r) || e.set("thumbSize", r);
|
|
3992
|
+
}
|
|
3993
|
+
});
|
|
3994
|
+
}
|
|
3995
|
+
},
|
|
3996
|
+
actions: {
|
|
3997
|
+
dispatchChangeEvent({ context: e, scope: t }) {
|
|
3998
|
+
Er(t, e.get("value"));
|
|
3999
|
+
},
|
|
4000
|
+
syncInputElements({ context: e, scope: t }) {
|
|
4001
|
+
e.get("value").forEach((a, n) => {
|
|
4002
|
+
const r = Ut(t, n);
|
|
4003
|
+
Y(r, a.toString());
|
|
4004
|
+
});
|
|
4005
|
+
},
|
|
4006
|
+
invokeOnChangeEnd({ prop: e, context: t }) {
|
|
4007
|
+
queueMicrotask(() => {
|
|
4008
|
+
e("onValueChangeEnd")?.({ value: t.get("value") });
|
|
4009
|
+
});
|
|
4010
|
+
},
|
|
4011
|
+
setClosestThumbIndex(e) {
|
|
4012
|
+
const { context: t, event: a } = e, n = at(e, a.point);
|
|
4013
|
+
if (n == null) return;
|
|
4014
|
+
const r = Vr(e, n);
|
|
4015
|
+
t.set("focusedIndex", r);
|
|
4016
|
+
},
|
|
4017
|
+
setFocusedIndex({ context: e, event: t }) {
|
|
4018
|
+
e.set("focusedIndex", t.index);
|
|
4019
|
+
},
|
|
4020
|
+
clearFocusedIndex({ context: e }) {
|
|
4021
|
+
e.set("focusedIndex", -1);
|
|
4022
|
+
},
|
|
4023
|
+
setPointerValue(e) {
|
|
4024
|
+
queueMicrotask(() => {
|
|
4025
|
+
const { context: t, event: a } = e, n = at(e, a.point);
|
|
4026
|
+
if (n == null) return;
|
|
4027
|
+
const r = t.get("focusedIndex"), i = xe(e, n, r);
|
|
4028
|
+
t.set("value", (o) => Z(o, r, i));
|
|
4029
|
+
});
|
|
4030
|
+
},
|
|
4031
|
+
focusActiveThumb({ scope: e, context: t }) {
|
|
4032
|
+
$(() => {
|
|
4033
|
+
vr(e, t.get("focusedIndex"))?.focus({ preventScroll: !0 });
|
|
4034
|
+
});
|
|
4035
|
+
},
|
|
4036
|
+
decrementThumbAtIndex(e) {
|
|
4037
|
+
const { context: t, event: a } = e, n = Ar(e, a.index, a.step);
|
|
4038
|
+
t.set("value", n);
|
|
4039
|
+
},
|
|
4040
|
+
incrementThumbAtIndex(e) {
|
|
4041
|
+
const { context: t, event: a } = e, n = kr(e, a.index, a.step);
|
|
4042
|
+
t.set("value", n);
|
|
4043
|
+
},
|
|
4044
|
+
setFocusedThumbToMin(e) {
|
|
4045
|
+
const { context: t } = e, a = t.get("focusedIndex"), { min: n } = U(e, a);
|
|
4046
|
+
t.set("value", (r) => Z(r, a, n));
|
|
4047
|
+
},
|
|
4048
|
+
setFocusedThumbToMax(e) {
|
|
4049
|
+
const { context: t } = e, a = t.get("focusedIndex"), { max: n } = U(e, a);
|
|
4050
|
+
t.set("value", (r) => Z(r, a, n));
|
|
4051
|
+
},
|
|
4052
|
+
setValueAtIndex(e) {
|
|
4053
|
+
const { context: t, event: a } = e, n = xe(e, a.value, a.index);
|
|
4054
|
+
t.set("value", (r) => Z(r, a.index, n));
|
|
4055
|
+
},
|
|
4056
|
+
setValue(e) {
|
|
4057
|
+
const { context: t, event: a } = e, n = xr(e, a.value);
|
|
4058
|
+
t.set("value", n);
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
});
|
|
4063
|
+
_()([
|
|
4064
|
+
"aria-label",
|
|
4065
|
+
"aria-labelledby",
|
|
4066
|
+
"dir",
|
|
4067
|
+
"disabled",
|
|
4068
|
+
"form",
|
|
4069
|
+
"getAriaValueText",
|
|
4070
|
+
"getRootNode",
|
|
4071
|
+
"id",
|
|
4072
|
+
"ids",
|
|
4073
|
+
"invalid",
|
|
4074
|
+
"max",
|
|
4075
|
+
"min",
|
|
4076
|
+
"minStepsBetweenThumbs",
|
|
4077
|
+
"name",
|
|
4078
|
+
"onFocusChange",
|
|
4079
|
+
"onValueChange",
|
|
4080
|
+
"onValueChangeEnd",
|
|
4081
|
+
"orientation",
|
|
4082
|
+
"origin",
|
|
4083
|
+
"readOnly",
|
|
4084
|
+
"step",
|
|
4085
|
+
"thumbAlignment",
|
|
4086
|
+
"thumbAlignment",
|
|
4087
|
+
"thumbSize",
|
|
4088
|
+
"value",
|
|
4089
|
+
"defaultValue"
|
|
4090
|
+
]);
|
|
4091
|
+
_()(["index", "name"]);
|
|
4092
|
+
export {
|
|
4093
|
+
nn as a,
|
|
4094
|
+
Mn as b,
|
|
4095
|
+
er as c,
|
|
4096
|
+
cr as d,
|
|
4097
|
+
zr as e,
|
|
4098
|
+
pn as f,
|
|
4099
|
+
Br as g,
|
|
4100
|
+
Wr as h,
|
|
4101
|
+
jr as i,
|
|
4102
|
+
Gr as j,
|
|
4103
|
+
Ur as k,
|
|
4104
|
+
qr as l,
|
|
4105
|
+
Hr as m,
|
|
4106
|
+
Xr as n,
|
|
4107
|
+
Kr as o,
|
|
4108
|
+
Zr as p,
|
|
4109
|
+
Yr as q,
|
|
4110
|
+
Qn as r,
|
|
4111
|
+
Yn as s,
|
|
4112
|
+
Qr as t,
|
|
4113
|
+
Jr as u
|
|
4114
|
+
};
|
|
4115
|
+
//# sourceMappingURL=index-BrJtqTzN.js.map
|