@apple-pie/slice 0.0.6 → 0.0.8
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/README.md +34 -4
- package/dist/cjs/chunks/Avatar-0EXaRG4e.js +54 -0
- package/dist/cjs/chunks/AvatarGroup-BsRUAZl0.js +37 -0
- package/dist/cjs/chunks/Badge-Bv6c2YVC.js +23 -0
- package/dist/cjs/chunks/Button-DFAWHJmQ.js +246 -0
- package/dist/cjs/chunks/ButtonBar-DOgYDAda.js +53 -0
- package/dist/cjs/chunks/Card-BPClSuHa.js +37 -0
- package/dist/cjs/chunks/CheckBox-tsExpwtr.js +56 -0
- package/dist/cjs/chunks/Chip-CPHF1zn-.js +84 -0
- package/dist/cjs/chunks/DivInput-DDQVtlot.js +102 -0
- package/dist/cjs/chunks/DocIcons-B5TcBqSH.js +108 -0
- package/dist/cjs/chunks/Dot-BSSClfHQ.js +73 -0
- package/dist/cjs/chunks/DrggablePanel-wWLPesc8.js +202 -0
- package/dist/cjs/chunks/DropDown-COdCr77A.js +102 -0
- package/dist/cjs/chunks/ErrorSummary-CIUqlSLC.js +60 -0
- package/dist/cjs/chunks/FileIcon-DTQaXxfC.js +221 -0
- package/dist/cjs/chunks/FileList-J2EgJyCo.js +217 -0
- package/dist/cjs/chunks/FlexDiv-CW5gSa4V.js +65 -0
- package/dist/cjs/chunks/Grouper-QwwunKen.js +61 -0
- package/dist/cjs/chunks/IconButton-B53y3z1_.js +77 -0
- package/dist/cjs/chunks/Label-DoiS07-y.js +111 -0
- package/dist/cjs/chunks/Logos-CAHU-eIP.js +483 -0
- package/dist/cjs/chunks/Overlay-Bb2YoSKr.js +36 -0
- package/dist/cjs/chunks/Pager-CN2z8M9E.js +37 -0
- package/dist/cjs/chunks/ProgressIndicator-BbrZ7Aoc.js +157 -0
- package/dist/cjs/chunks/PromptInput-BXDqUXFQ.js +150 -0
- package/dist/cjs/chunks/RadioButton-GKRhZEmb.js +56 -0
- package/dist/cjs/chunks/RadioButtonList-CFpZmyAX.js +59 -0
- package/dist/cjs/chunks/Slider-CZvCAodl.js +136 -0
- package/dist/cjs/chunks/Spacer-CtxV2Pww.js +18 -0
- package/dist/cjs/chunks/Switch-C94aofxQ.js +37 -0
- package/dist/cjs/chunks/TabBar-D6akzNUf.js +123 -0
- package/dist/cjs/chunks/TextArea-DjF8Koup.js +82 -0
- package/dist/cjs/chunks/TextField-Cg6mQcYl.js +204 -0
- package/dist/cjs/chunks/Tip-CjMHa-fD.js +88 -0
- package/dist/cjs/chunks/Toast-Cdyh6T-l.js +163 -0
- package/dist/cjs/chunks/UploadArea-BmZ50EEl.js +123 -0
- package/dist/cjs/chunks/_types-B5xXv4NA.js +1386 -0
- package/dist/cjs/chunks/sharedTypes-gCECyn2N.js +6 -0
- package/dist/cjs/chunks/style-inject.es-CMuL-BfJ.js +11 -0
- package/dist/cjs/chunks/tipStore-Ck4NLvml.js +17 -0
- package/dist/cjs/chunks/toastStore-CSStgB9d.js +17 -0
- package/dist/cjs/chunks/tslib.es6-C8dZW5nY.js +49 -0
- package/dist/cjs/chunks/uploads-worker-mD8pcsGP.js +221 -0
- package/dist/cjs/chunks/uploadsStore-CxWIctvI.js +75 -0
- package/dist/cjs/chunks/utils-BsBHecUI.js +70 -0
- package/dist/cjs/chunks/windowStore-RaJswiHM.js +70 -0
- package/dist/cjs/hooks/useDoubleClick.js +11 -23
- package/dist/cjs/hooks/useKeyboardShortcuts.js +18 -35
- package/dist/cjs/hooks/useLastUpdated.js +20 -42
- package/dist/cjs/hooks/useLocalStore.js +23 -39
- package/dist/cjs/hooks/useObserveResize.js +26 -44
- package/dist/cjs/hooks/useObserveTheme.js +18 -36
- package/dist/cjs/hooks/useTheme.js +17 -40
- package/dist/cjs/hooks/useToolTip.js +19 -32
- package/dist/cjs/hooks/useTrackRenders.js +11 -29
- package/dist/cjs/hooks/useWindow.js +29 -65
- package/dist/cjs/hooks.js +12 -30
- package/dist/cjs/index.js +46 -134
- package/dist/cjs/providers/ThemeProvider.js +27 -45
- package/dist/cjs/providers.js +5 -12
- package/dist/cjs/stores/tip.js +4 -9
- package/dist/cjs/stores/toast.js +4 -9
- package/dist/cjs/stores/uploads.js +11 -0
- package/dist/cjs/stores/window.js +8 -10
- package/dist/cjs/stores.js +18 -21
- package/dist/cjs/theme/colors.js +371 -379
- package/dist/cjs/theme/corners.js +10 -12
- package/dist/cjs/theme/elevations.js +10 -13
- package/dist/cjs/theme/themes.js +8 -13
- package/dist/cjs/theme/type.js +225 -384
- package/dist/cjs/theme.js +5 -13
- package/dist/cjs/uikit/Avatar/index.js +6 -0
- package/dist/cjs/uikit/AvatarGroup/index.js +7 -0
- package/dist/cjs/uikit/Badge/index.js +6 -0
- package/dist/cjs/uikit/Button/index.js +12 -0
- package/dist/cjs/uikit/ButtonBar/index.js +12 -0
- package/dist/cjs/uikit/Card/index.js +10 -0
- package/dist/cjs/uikit/CheckBox/index.js +10 -0
- package/dist/cjs/uikit/Chip/index.js +11 -0
- package/dist/cjs/uikit/DivInput/index.js +7 -0
- package/dist/cjs/uikit/DocIcon/index.js +9 -0
- package/dist/cjs/uikit/Dot/index.js +6 -0
- package/dist/cjs/uikit/DraggablePanel/index.js +10 -0
- package/dist/cjs/uikit/DropDown/index.js +10 -0
- package/dist/cjs/uikit/ErrorSummary/index.js +6 -0
- package/dist/cjs/uikit/FileIcon/index.js +15 -0
- package/dist/cjs/uikit/FileList/index.js +11 -0
- package/dist/cjs/uikit/FlexDiv/index.js +6 -0
- package/dist/cjs/uikit/Grouper/index.js +11 -0
- package/dist/cjs/uikit/Icon/index.js +14 -0
- package/dist/cjs/uikit/IconButton/index.js +12 -0
- package/dist/cjs/uikit/Label/index.js +10 -0
- package/dist/cjs/uikit/Logos/index.js +9 -0
- package/dist/cjs/uikit/Overlay/index.js +6 -0
- package/dist/cjs/uikit/Pager/index.js +7 -0
- package/dist/cjs/uikit/Progress/index.js +10 -0
- package/dist/cjs/uikit/PromptInput/index.js +14 -0
- package/dist/cjs/uikit/RadioButton/index.js +12 -0
- package/dist/cjs/uikit/RadioButtonList/index.js +13 -0
- package/dist/cjs/uikit/Slider/index.js +7 -0
- package/dist/cjs/uikit/Spacer/index.js +6 -0
- package/dist/cjs/uikit/Switch/index.js +6 -0
- package/dist/cjs/uikit/TabBar/index.js +12 -0
- package/dist/cjs/uikit/TextArea/index.js +13 -0
- package/dist/cjs/uikit/Textfield/index.js +13 -0
- package/dist/cjs/uikit/Tip/index.js +7 -0
- package/dist/cjs/uikit/Toast/index.js +16 -0
- package/dist/cjs/uikit/UploadArea/index.js +15 -0
- package/dist/cjs/workers/uploads/uploads.js +5 -0
- package/dist/esm/chunks/Avatar-D_W5zErj.mjs +60 -0
- package/dist/esm/chunks/AvatarGroup-Dbfmz0Yz.mjs +45 -0
- package/dist/esm/chunks/Badge-BISGWj5-.mjs +29 -0
- package/dist/esm/chunks/Button-B_aIY6wE.mjs +264 -0
- package/dist/esm/chunks/ButtonBar-Cr6TFvvD.mjs +66 -0
- package/dist/esm/chunks/Card-BzKBF0ny.mjs +45 -0
- package/dist/esm/chunks/CheckBox-CYggPKaT.mjs +68 -0
- package/dist/esm/chunks/Chip-B3wb9g1U.mjs +96 -0
- package/dist/esm/chunks/DivInput-_VL6PAqT.mjs +114 -0
- package/dist/esm/chunks/DocIcons-BxtcXsWI.mjs +114 -0
- package/dist/esm/chunks/Dot-C-Xu24wF.mjs +81 -0
- package/dist/esm/chunks/DrggablePanel-Bg3UKK1k.mjs +214 -0
- package/dist/esm/chunks/DropDown-D7KyGLkM.mjs +114 -0
- package/dist/esm/chunks/ErrorSummary-CZw06dSh.mjs +68 -0
- package/dist/esm/chunks/FileIcon-BcIJzIwA.mjs +233 -0
- package/dist/esm/chunks/FileList-DUzgHfE-.mjs +229 -0
- package/dist/esm/chunks/FlexDiv-BLYDgWu2.mjs +73 -0
- package/dist/esm/chunks/Grouper-CRldBHSw.mjs +75 -0
- package/dist/esm/chunks/IconButton-BBiZrXlS.mjs +93 -0
- package/dist/esm/chunks/Label-DPIAVkn1.mjs +124 -0
- package/dist/esm/chunks/Logos-CpcaarOG.mjs +493 -0
- package/dist/esm/chunks/Overlay-Bh0enFIe.mjs +44 -0
- package/dist/esm/chunks/Pager-B-1ZRUzU.mjs +45 -0
- package/dist/esm/chunks/ProgressIndicator-CNOBQ_Fv.mjs +167 -0
- package/dist/esm/chunks/PromptInput-DdsIgZ3T.mjs +160 -0
- package/dist/esm/chunks/RadioButton-D-TdQu3a.mjs +66 -0
- package/dist/esm/chunks/RadioButtonList-CEScWkbT.mjs +67 -0
- package/dist/esm/chunks/Slider-C3A8GCfH.mjs +142 -0
- package/dist/esm/chunks/Spacer-BlgEdKEM.mjs +20 -0
- package/dist/esm/chunks/Switch-obpmvCGd.mjs +45 -0
- package/dist/esm/chunks/TabBar-DFj021UP.mjs +141 -0
- package/dist/esm/chunks/TextArea-D_hq6VF3.mjs +90 -0
- package/dist/esm/chunks/TextField-Co0u-xdd.mjs +222 -0
- package/dist/esm/chunks/Tip-CHQh-Yq0.mjs +98 -0
- package/dist/esm/chunks/Toast-BiXzVFtM.mjs +179 -0
- package/dist/esm/chunks/UploadArea-B9685Z06.mjs +133 -0
- package/dist/esm/chunks/_types-KZDzhaiK.mjs +1395 -0
- package/dist/esm/chunks/sharedTypes-tn9-uJvb.mjs +8 -0
- package/dist/esm/chunks/style-inject.es-D0BjEaN8.mjs +11 -0
- package/dist/esm/chunks/tipStore-CL5a95Bl.mjs +15 -0
- package/dist/esm/chunks/toastStore-D2PEIqCo.mjs +15 -0
- package/dist/esm/chunks/tslib.es6-c-7TIv71.mjs +53 -0
- package/dist/esm/chunks/uploads-worker-Dv-4zGnC.mjs +224 -0
- package/dist/esm/chunks/uploadsStore-D69fEXMY.mjs +72 -0
- package/dist/esm/chunks/utils-BQ1v7VE4.mjs +74 -0
- package/dist/esm/chunks/windowStore-CwW0i_le.mjs +71 -0
- package/dist/esm/hooks/useDoubleClick.mjs +14 -0
- package/dist/esm/hooks/useKeyboardShortcuts.mjs +27 -0
- package/dist/esm/hooks/useLastUpdated.mjs +31 -0
- package/dist/esm/hooks/useLocalStore.mjs +36 -0
- package/dist/esm/hooks/useObserveResize.mjs +38 -0
- package/dist/esm/hooks/useObserveTheme.mjs +34 -0
- package/dist/esm/hooks/useTheme.mjs +73 -0
- package/dist/esm/hooks/useToolTip.mjs +23 -0
- package/dist/esm/hooks/useTrackRenders.mjs +23 -0
- package/dist/esm/hooks/useWindow.mjs +52 -0
- package/dist/esm/hooks.mjs +29 -0
- package/dist/esm/index.mjs +117 -0
- package/dist/esm/providers/ThemeProvider.mjs +49 -0
- package/dist/esm/providers.mjs +15 -0
- package/dist/esm/stores/tip.mjs +3 -0
- package/dist/esm/stores/toast.mjs +3 -0
- package/dist/esm/stores/uploads.mjs +7 -0
- package/dist/esm/stores/window.mjs +3 -0
- package/dist/esm/stores.mjs +13 -0
- package/dist/esm/theme/colors.mjs +373 -0
- package/dist/esm/theme/corners.mjs +12 -0
- package/dist/esm/theme/elevations.mjs +15 -0
- package/dist/esm/theme/themes.mjs +25 -0
- package/dist/esm/theme/type.mjs +236 -0
- package/dist/esm/theme.mjs +9 -0
- package/dist/esm/uikit/Avatar/index.mjs +9 -0
- package/dist/esm/uikit/AvatarGroup/index.mjs +11 -0
- package/dist/esm/uikit/Badge/index.mjs +9 -0
- package/dist/esm/uikit/Button/index.mjs +39 -0
- package/dist/esm/uikit/ButtonBar/index.mjs +39 -0
- package/dist/esm/uikit/Card/index.mjs +29 -0
- package/dist/esm/uikit/CheckBox/index.mjs +31 -0
- package/dist/esm/uikit/Chip/index.mjs +31 -0
- package/dist/esm/uikit/DivInput/index.mjs +13 -0
- package/dist/esm/uikit/DocIcon/index.mjs +23 -0
- package/dist/esm/uikit/Dot/index.mjs +11 -0
- package/dist/esm/uikit/DraggablePanel/index.mjs +29 -0
- package/dist/esm/uikit/DropDown/index.mjs +29 -0
- package/dist/esm/uikit/ErrorSummary/index.mjs +11 -0
- package/dist/esm/uikit/FileIcon/index.mjs +25 -0
- package/dist/esm/uikit/FileList/index.mjs +35 -0
- package/dist/esm/uikit/FlexDiv/index.mjs +11 -0
- package/dist/esm/uikit/Grouper/index.mjs +33 -0
- package/dist/esm/uikit/Icon/index.mjs +25 -0
- package/dist/esm/uikit/IconButton/index.mjs +37 -0
- package/dist/esm/uikit/Label/index.mjs +27 -0
- package/dist/esm/uikit/Logos/index.mjs +23 -0
- package/dist/esm/uikit/Overlay/index.mjs +11 -0
- package/dist/esm/uikit/Pager/index.mjs +11 -0
- package/dist/esm/uikit/Progress/index.mjs +27 -0
- package/dist/esm/uikit/PromptInput/index.mjs +45 -0
- package/dist/esm/uikit/RadioButton/index.mjs +39 -0
- package/dist/esm/uikit/RadioButtonList/index.mjs +41 -0
- package/dist/esm/uikit/Slider/index.mjs +13 -0
- package/dist/esm/uikit/Spacer/index.mjs +7 -0
- package/dist/esm/uikit/Switch/index.mjs +11 -0
- package/dist/esm/uikit/TabBar/index.mjs +39 -0
- package/dist/esm/uikit/TextArea/index.mjs +41 -0
- package/dist/esm/uikit/Textfield/index.mjs +43 -0
- package/dist/esm/uikit/Tip/index.mjs +13 -0
- package/dist/esm/uikit/Toast/index.mjs +31 -0
- package/dist/esm/uikit/UploadArea/index.mjs +37 -0
- package/dist/esm/workers/uploads/uploads.mjs +5 -0
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/uploads/_types.d.ts +16 -0
- package/dist/types/stores/uploads/index.d.ts +2 -0
- package/dist/types/stores/uploads/uploadsStore.d.ts +22 -0
- package/dist/types/workers/uploads/uploads-worker.d.ts +129 -0
- package/dist/types/workers/uploads/uploads.d.ts +1 -0
- package/dist/types/workers/uploads/uploads.runtime.d.ts +1 -0
- package/package.json +23 -17
- package/dist/cjs/chunks/Avatar-z2YcOAoP.js +0 -68
- package/dist/cjs/chunks/AvatarGroup-Cz8369zI.js +0 -39
- package/dist/cjs/chunks/Badge-COSg__VJ.js +0 -41
- package/dist/cjs/chunks/Button-BNXqiA13.js +0 -312
- package/dist/cjs/chunks/ButtonBar-CeDdAOlH.js +0 -58
- package/dist/cjs/chunks/Card-Cc_c-S7i.js +0 -36
- package/dist/cjs/chunks/CheckBox-hTWIPqV_.js +0 -76
- package/dist/cjs/chunks/Chip-CLKVldi4.js +0 -93
- package/dist/cjs/chunks/DivInput-DnY2emt-.js +0 -204
- package/dist/cjs/chunks/DocIcons-BRWOzK96.js +0 -41
- package/dist/cjs/chunks/Dot-B5dO8kSS.js +0 -80
- package/dist/cjs/chunks/DrggablePanel-BtsURL9o.js +0 -302
- package/dist/cjs/chunks/DropDown-COr9u96t.js +0 -154
- package/dist/cjs/chunks/ErrorSummary-BrSHbGpk.js +0 -42
- package/dist/cjs/chunks/FileIcon-CEMQK_Je.js +0 -132
- package/dist/cjs/chunks/FileList-BHMne9Mr.js +0 -163
- package/dist/cjs/chunks/FlexDiv-BHl29ywz.js +0 -103
- package/dist/cjs/chunks/Grouper-EyHoeA8w.js +0 -50
- package/dist/cjs/chunks/IconButton-9QZ4eKBZ.js +0 -84
- package/dist/cjs/chunks/Label-s1aCv2Y1.js +0 -134
- package/dist/cjs/chunks/Logos-DSlAUz8l.js +0 -119
- package/dist/cjs/chunks/Overlay-DV3C5NDO.js +0 -45
- package/dist/cjs/chunks/Pager-CRjpl1FZ.js +0 -42
- package/dist/cjs/chunks/ProgressIndicator-BAwAaw58.js +0 -121
- package/dist/cjs/chunks/PromptInput-CfzofBTJ.js +0 -212
- package/dist/cjs/chunks/RadioButton-DA9YUGEF.js +0 -65
- package/dist/cjs/chunks/RadioButtonList-BtsT7GJc.js +0 -116
- package/dist/cjs/chunks/Slider-CqrIwn-L.js +0 -285
- package/dist/cjs/chunks/Spacer-BEY2-_PB.js +0 -16
- package/dist/cjs/chunks/Switch-CtkFtogd.js +0 -43
- package/dist/cjs/chunks/TabBar-WsNlr-aZ.js +0 -176
- package/dist/cjs/chunks/TextArea-BMJWUH2H.js +0 -153
- package/dist/cjs/chunks/TextField-mfwz79cD.js +0 -248
- package/dist/cjs/chunks/Tip-Af6FMEDi.js +0 -91
- package/dist/cjs/chunks/Toast-CxAEOW4z.js +0 -158
- package/dist/cjs/chunks/UploadArea-DunGYE1_.js +0 -155
- package/dist/cjs/chunks/_types-BNlHsGMQ.js +0 -714
- package/dist/cjs/chunks/sharedTypes-BvTjh6M5.js +0 -9
- package/dist/cjs/chunks/style-inject.es-XZHJH68X.js +0 -30
- package/dist/cjs/chunks/tipStore-C9oV9SIh.js +0 -23
- package/dist/cjs/chunks/toastStore-C-ETP9H6.js +0 -23
- package/dist/cjs/chunks/tslib.es6-4H29ixHs.js +0 -48
- package/dist/cjs/chunks/utils-BwNacfBU.js +0 -128
- package/dist/cjs/chunks/windowStore-CPcVHJq6.js +0 -93
- package/dist/cjs/uikit/Avatar.js +0 -11
- package/dist/cjs/uikit/AvatarGroup.js +0 -12
- package/dist/cjs/uikit/Badge.js +0 -11
- package/dist/cjs/uikit/Button.js +0 -26
- package/dist/cjs/uikit/ButtonBar.js +0 -26
- package/dist/cjs/uikit/Card.js +0 -21
- package/dist/cjs/uikit/CheckBox.js +0 -22
- package/dist/cjs/uikit/Chip.js +0 -22
- package/dist/cjs/uikit/DivInput.js +0 -13
- package/dist/cjs/uikit/DocIcon.js +0 -18
- package/dist/cjs/uikit/Dot.js +0 -12
- package/dist/cjs/uikit/DraggablePanel.js +0 -21
- package/dist/cjs/uikit/DropDown.js +0 -21
- package/dist/cjs/uikit/ErrorSummary.js +0 -12
- package/dist/cjs/uikit/FileIcon.js +0 -23
- package/dist/cjs/uikit/FileList.js +0 -24
- package/dist/cjs/uikit/FlexDiv.js +0 -12
- package/dist/cjs/uikit/Grouper.js +0 -23
- package/dist/cjs/uikit/Icon.js +0 -23
- package/dist/cjs/uikit/IconButton.js +0 -25
- package/dist/cjs/uikit/Label.js +0 -20
- package/dist/cjs/uikit/Logos.js +0 -18
- package/dist/cjs/uikit/Overlay.js +0 -12
- package/dist/cjs/uikit/Pager.js +0 -12
- package/dist/cjs/uikit/Progress.js +0 -21
- package/dist/cjs/uikit/PromptInput.js +0 -29
- package/dist/cjs/uikit/RadioButton.js +0 -26
- package/dist/cjs/uikit/RadioButtonList.js +0 -27
- package/dist/cjs/uikit/Slider.js +0 -13
- package/dist/cjs/uikit/Spacer.js +0 -10
- package/dist/cjs/uikit/Switch.js +0 -12
- package/dist/cjs/uikit/TabBar.js +0 -26
- package/dist/cjs/uikit/TextArea.js +0 -27
- package/dist/cjs/uikit/Textfield.js +0 -28
- package/dist/cjs/uikit/Tip.js +0 -13
- package/dist/cjs/uikit/Toast.js +0 -26
- package/dist/cjs/uikit/UploadArea.js +0 -31
- package/dist/esm/chunks/Avatar-BtkvMV1v.js +0 -66
- package/dist/esm/chunks/AvatarGroup-pbqdS56o.js +0 -37
- package/dist/esm/chunks/Badge-DtxDLSO0.js +0 -39
- package/dist/esm/chunks/Button-BUJkJqdO.js +0 -310
- package/dist/esm/chunks/ButtonBar-Bl0oCxd8.js +0 -56
- package/dist/esm/chunks/Card-Bjk0kgQh.js +0 -34
- package/dist/esm/chunks/CheckBox-CvkZuSeB.js +0 -74
- package/dist/esm/chunks/Chip-o-YG_HAf.js +0 -91
- package/dist/esm/chunks/DivInput-D6ORPrkT.js +0 -202
- package/dist/esm/chunks/DocIcons-CbOX4n8Y.js +0 -39
- package/dist/esm/chunks/Dot-BZcEZbnm.js +0 -78
- package/dist/esm/chunks/DrggablePanel-DWrTjXvf.js +0 -300
- package/dist/esm/chunks/DropDown-BDIvYWI-.js +0 -152
- package/dist/esm/chunks/ErrorSummary-DzDnacH0.js +0 -40
- package/dist/esm/chunks/FileIcon-Cxh-QsYb.js +0 -130
- package/dist/esm/chunks/FileList-CdUgbpYF.js +0 -161
- package/dist/esm/chunks/FlexDiv-CFyndG99.js +0 -101
- package/dist/esm/chunks/Grouper-NJbpaaQG.js +0 -48
- package/dist/esm/chunks/IconButton-3m9ugITV.js +0 -82
- package/dist/esm/chunks/Label-BRon-ejm.js +0 -132
- package/dist/esm/chunks/Logos-DwZP-TR2.js +0 -117
- package/dist/esm/chunks/Overlay-BolsHW9S.js +0 -43
- package/dist/esm/chunks/Pager-BHLyXq9p.js +0 -40
- package/dist/esm/chunks/ProgressIndicator-uI9BZwBB.js +0 -118
- package/dist/esm/chunks/PromptInput-DodTBG82.js +0 -210
- package/dist/esm/chunks/RadioButton-D8otD_Jj.js +0 -63
- package/dist/esm/chunks/RadioButtonList-CtX1j7rO.js +0 -114
- package/dist/esm/chunks/Slider-O6UelMjh.js +0 -283
- package/dist/esm/chunks/Spacer-DbZSG5x3.js +0 -14
- package/dist/esm/chunks/Switch-DjfrSiQz.js +0 -41
- package/dist/esm/chunks/TabBar-C0NgwRa2.js +0 -174
- package/dist/esm/chunks/TextArea-DK0giDGR.js +0 -151
- package/dist/esm/chunks/TextField-CQ4XYYNm.js +0 -246
- package/dist/esm/chunks/Tip-iFECDhwN.js +0 -89
- package/dist/esm/chunks/Toast-ZxMZtbd0.js +0 -156
- package/dist/esm/chunks/UploadArea-C0YHy4Z9.js +0 -147
- package/dist/esm/chunks/_types-RJ7q8S0B.js +0 -712
- package/dist/esm/chunks/sharedTypes-BfZzG1KX.js +0 -9
- package/dist/esm/chunks/style-inject.es-tgCJW-Cu.js +0 -28
- package/dist/esm/chunks/tipStore-nBYJ6tmE.js +0 -17
- package/dist/esm/chunks/toastStore-r3pvNa28.js +0 -17
- package/dist/esm/chunks/tslib.es6-0pkUdtrF.js +0 -45
- package/dist/esm/chunks/utils-CZ1LWeN6.js +0 -121
- package/dist/esm/chunks/windowStore-Cu4W4zJM.js +0 -91
- package/dist/esm/hooks/useDoubleClick.js +0 -24
- package/dist/esm/hooks/useKeyboardShortcuts.js +0 -42
- package/dist/esm/hooks/useLastUpdated.js +0 -51
- package/dist/esm/hooks/useLocalStore.js +0 -50
- package/dist/esm/hooks/useObserveResize.js +0 -54
- package/dist/esm/hooks/useObserveTheme.js +0 -41
- package/dist/esm/hooks/useTheme.js +0 -84
- package/dist/esm/hooks/useToolTip.js +0 -34
- package/dist/esm/hooks/useTrackRenders.js +0 -37
- package/dist/esm/hooks/useWindow.js +0 -84
- package/dist/esm/hooks.js +0 -15
- package/dist/esm/index.js +0 -59
- package/dist/esm/providers/ThemeProvider.js +0 -56
- package/dist/esm/providers.js +0 -8
- package/dist/esm/stores/tip.js +0 -2
- package/dist/esm/stores/toast.js +0 -2
- package/dist/esm/stores/window.js +0 -2
- package/dist/esm/stores.js +0 -4
- package/dist/esm/theme/colors.js +0 -377
- package/dist/esm/theme/corners.js +0 -12
- package/dist/esm/theme/elevations.js +0 -15
- package/dist/esm/theme/themes.js +0 -23
- package/dist/esm/theme/type.js +0 -393
- package/dist/esm/theme.js +0 -5
- package/dist/esm/uikit/Avatar.js +0 -5
- package/dist/esm/uikit/AvatarGroup.js +0 -6
- package/dist/esm/uikit/Badge.js +0 -5
- package/dist/esm/uikit/Button.js +0 -20
- package/dist/esm/uikit/ButtonBar.js +0 -20
- package/dist/esm/uikit/Card.js +0 -15
- package/dist/esm/uikit/CheckBox.js +0 -16
- package/dist/esm/uikit/Chip.js +0 -16
- package/dist/esm/uikit/DivInput.js +0 -7
- package/dist/esm/uikit/DocIcon.js +0 -12
- package/dist/esm/uikit/Dot.js +0 -6
- package/dist/esm/uikit/DraggablePanel.js +0 -15
- package/dist/esm/uikit/DropDown.js +0 -15
- package/dist/esm/uikit/ErrorSummary.js +0 -6
- package/dist/esm/uikit/FileIcon.js +0 -13
- package/dist/esm/uikit/FileList.js +0 -18
- package/dist/esm/uikit/FlexDiv.js +0 -6
- package/dist/esm/uikit/Grouper.js +0 -17
- package/dist/esm/uikit/Icon.js +0 -13
- package/dist/esm/uikit/IconButton.js +0 -19
- package/dist/esm/uikit/Label.js +0 -14
- package/dist/esm/uikit/Logos.js +0 -12
- package/dist/esm/uikit/Overlay.js +0 -6
- package/dist/esm/uikit/Pager.js +0 -6
- package/dist/esm/uikit/Progress.js +0 -14
- package/dist/esm/uikit/PromptInput.js +0 -23
- package/dist/esm/uikit/RadioButton.js +0 -20
- package/dist/esm/uikit/RadioButtonList.js +0 -21
- package/dist/esm/uikit/Slider.js +0 -7
- package/dist/esm/uikit/Spacer.js +0 -4
- package/dist/esm/uikit/Switch.js +0 -6
- package/dist/esm/uikit/TabBar.js +0 -20
- package/dist/esm/uikit/TextArea.js +0 -21
- package/dist/esm/uikit/Textfield.js +0 -22
- package/dist/esm/uikit/Tip.js +0 -7
- package/dist/esm/uikit/Toast.js +0 -16
- package/dist/esm/uikit/UploadArea.js +0 -19
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { _ as __rest } from "./tslib.es6-c-7TIv71.mjs";
|
|
2
|
+
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
import React, { useState, useMemo, useEffect, useCallback } from "react";
|
|
6
|
+
|
|
7
|
+
import { a as accessibleKeyDown } from "./utils-BQ1v7VE4.mjs";
|
|
8
|
+
|
|
9
|
+
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
10
|
+
|
|
11
|
+
var css_wrapper = "Pager-module_wrapper__L8AZG flexBox-module_row__PWxbe", css_bullet = "Pager-module_bullet__tj-vE flexBox-module_row__PWxbe", css_selected = "Pager-module_selected__EdNnR";
|
|
12
|
+
|
|
13
|
+
styleInject(".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.Pager-module_wrapper__L8AZG {\n\tgap: var(--pager-gap);\n\twidth: 100%;\n\tz-index: var(--elevation-status);\n}\n\n.Pager-module_bullet__tj-vE {\n\twidth: var(--pager-size);\n\theight: var(--pager-size);\n\tmax-width: var(--pager-size);\n\tmax-height: var(--pager-size);\n\tbackground: var(--pager-color);\n\tborder-radius: 100%;\n\tborder: 0;\n\tcursor: pointer;\n\ttransition: background 0.25s ease-in-out 0s;\n\t&:hover {\n\t\tbackground: var(--pager-colorHover);\n\t}\n}\n\n.Pager-module_selected__EdNnR {\n\tbackground: var(--pager-colorOn);\n\t&:hover {\n\t\tbackground: var(--pager-colorOn);\n\t}\n}\n");
|
|
14
|
+
|
|
15
|
+
const Pager = React.memo(props => {
|
|
16
|
+
const {size: size = 8, index: index = 0, color: color, colorHover: colorHover, colorOn: colorOn, pages: pages = 2, gap: gap = 4, onChange: onChange = () => null} = props, divAttributes = __rest(props, [ "size", "index", "color", "colorHover", "colorOn", "pages", "gap", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [selected, setSelected] = useState(index), bullets = useMemo(() => Array.from({
|
|
17
|
+
length: pages
|
|
18
|
+
}, (_, i) => i), [ pages ]);
|
|
19
|
+
useEffect(() => setSelected(index), [ index ]);
|
|
20
|
+
const handleClick = useCallback(i => {
|
|
21
|
+
setSelected(i), onChange(i);
|
|
22
|
+
}, [ onChange ]), cssVars = useMemo(() => ({
|
|
23
|
+
"--pager-gap": `${gap}px`,
|
|
24
|
+
"--pager-size": `${size}px`,
|
|
25
|
+
"--pager-color": null != color ? color : "var(--core-text-disabled)",
|
|
26
|
+
"--pager-colorOn": null != colorOn ? colorOn : "var(--core-text-primary)",
|
|
27
|
+
"--pager-colorHover": null != colorHover ? colorHover : "var(--core-text-disabled)"
|
|
28
|
+
}), [ gap, size, color, colorOn, colorHover ]);
|
|
29
|
+
return jsx("div", Object.assign({
|
|
30
|
+
id: divId,
|
|
31
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
32
|
+
className: `${css_wrapper}${divClass}`
|
|
33
|
+
}, rest, {
|
|
34
|
+
children: bullets.map(bulletId => jsx("input", {
|
|
35
|
+
className: `${css_bullet} ${selected === bulletId ? css_selected : ""}`,
|
|
36
|
+
type: "button",
|
|
37
|
+
onClick: () => handleClick(bulletId),
|
|
38
|
+
onKeyDown: e => accessibleKeyDown(e, () => handleClick(bulletId)),
|
|
39
|
+
onTouchStart: () => handleClick(bulletId),
|
|
40
|
+
tabIndex: bulletId
|
|
41
|
+
}, `paging_bullet_${bulletId}`))
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { Pager as P };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { _ as __rest, a as __awaiter } from "./tslib.es6-c-7TIv71.mjs";
|
|
2
|
+
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
import { useAnimate, usePresence, AnimatePresence, motion } from "motion/react";
|
|
6
|
+
|
|
7
|
+
import React, { useEffect, useState, useRef, useMemo } from "react";
|
|
8
|
+
|
|
9
|
+
import { useTheme } from "../hooks/useTheme.mjs";
|
|
10
|
+
|
|
11
|
+
import "../theme/colors.mjs";
|
|
12
|
+
|
|
13
|
+
import "../hooks/useWindow.mjs";
|
|
14
|
+
|
|
15
|
+
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
16
|
+
|
|
17
|
+
const DoneCheck = React.memo(props => {
|
|
18
|
+
const theme = useTheme(), {size: size = 88, stroke: stroke = .75, duration: duration = .35, bounce: bounce = .7, delay: delay = .5, color: color = theme.current.colors["feedback-positive"], didEnd: didEnd = () => null, didStart: didStart = () => null, play: play = !1} = props, svgAttributes = __rest(props, [ "size", "stroke", "duration", "bounce", "delay", "color", "didEnd", "didStart", "play" ]), {id: svgId, className: className, style: style} = svgAttributes, rest = __rest(svgAttributes, [ "id", "className", "style" ]), [check, animateCheck] = useAnimate(), [isPresent, safeToRemove] = usePresence();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const variants_initial = {
|
|
21
|
+
scale: .9
|
|
22
|
+
}, variants_animate = {
|
|
23
|
+
scale: 1
|
|
24
|
+
}, spring = {
|
|
25
|
+
type: "spring",
|
|
26
|
+
time: duration,
|
|
27
|
+
bounce: bounce,
|
|
28
|
+
delay: delay
|
|
29
|
+
}, instant = {
|
|
30
|
+
ease: "linear",
|
|
31
|
+
duration: 0,
|
|
32
|
+
delay: 0
|
|
33
|
+
};
|
|
34
|
+
if (isPresent && play) {
|
|
35
|
+
(() => __awaiter(void 0, void 0, void 0, function*() {
|
|
36
|
+
didStart(), yield animateCheck(check.current, variants_initial, instant), yield animateCheck(check.current, variants_animate, spring),
|
|
37
|
+
didEnd();
|
|
38
|
+
}))();
|
|
39
|
+
} else if (isPresent && !play) {
|
|
40
|
+
(() => __awaiter(void 0, void 0, void 0, function*() {
|
|
41
|
+
yield animateCheck(check.current, variants_animate, instant);
|
|
42
|
+
}))();
|
|
43
|
+
} else if (!isPresent) {
|
|
44
|
+
(() => __awaiter(void 0, void 0, void 0, function*() {
|
|
45
|
+
yield animateCheck(check.current, variants_initial, instant), safeToRemove();
|
|
46
|
+
}))();
|
|
47
|
+
}
|
|
48
|
+
}, [ isPresent, play, animateCheck, check, didEnd, didStart, safeToRemove, bounce, delay, duration ]);
|
|
49
|
+
return jsxs("svg", Object.assign({
|
|
50
|
+
id: svgId,
|
|
51
|
+
className: className,
|
|
52
|
+
ref: check,
|
|
53
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
54
|
+
width: size,
|
|
55
|
+
height: size,
|
|
56
|
+
scale: .9,
|
|
57
|
+
viewBox: "0 0 20 20",
|
|
58
|
+
fill: "none",
|
|
59
|
+
style: null != style ? style : {},
|
|
60
|
+
"aria-label": "Checkmark icon"
|
|
61
|
+
}, rest, {
|
|
62
|
+
children: [ jsx("title", {
|
|
63
|
+
children: "Checkmark"
|
|
64
|
+
}), jsx("path", {
|
|
65
|
+
d: "M 1 1 L 19 1 L 19 19 L 1 19 Z",
|
|
66
|
+
fill: "transparent"
|
|
67
|
+
}), jsx("path", {
|
|
68
|
+
d: "M 10 2 C 14.418 2 18 5.582 18 10 C 18 14.418 14.418 18 10 18 C 5.582 18 2 14.418 2 10 C 2 5.582 5.582 2 10 2 Z",
|
|
69
|
+
fill: "transparent",
|
|
70
|
+
strokeWidth: stroke,
|
|
71
|
+
stroke: color
|
|
72
|
+
}), jsx("path", {
|
|
73
|
+
d: "M 6.5 9.5 L 9 12 L 13.5 7.5",
|
|
74
|
+
fill: "transparent",
|
|
75
|
+
strokeWidth: stroke,
|
|
76
|
+
stroke: color
|
|
77
|
+
}) ]
|
|
78
|
+
}));
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
var css_container = "ProgressIndicator-module_container__CZDPk flexBox-module_column__MP2Xd";
|
|
82
|
+
|
|
83
|
+
function ProgressIndicator(props) {
|
|
84
|
+
const theme = useTheme(), {size: size = 20, secondsPerSpin: secondsPerSpin = 1, show: show = !1, color: color = theme.current.colors["core-icon-primary"], stroke: stroke = 1.5, inline: inline = !1, duration: duration, didStart: didStart = () => null, didStop: didStop = () => null} = props, divAttributes = __rest(props, [ "size", "secondsPerSpin", "show", "color", "stroke", "inline", "duration", "didStart", "didStop" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [playing, setPlaying] = useState(show), timer = useRef(null);
|
|
85
|
+
useEffect(() => (show ? (setPlaying(!0), didStart(), duration && (timer.current = setTimeout(() => {
|
|
86
|
+
setPlaying(!1), didStop();
|
|
87
|
+
}, 1e3 * duration))) : (setPlaying(!1), didStop()), () => {
|
|
88
|
+
(null == timer ? void 0 : timer.current) && clearTimeout(timer.current);
|
|
89
|
+
}), [ show, didStart, didStop, duration ]);
|
|
90
|
+
const cssVars = useMemo(() => ({
|
|
91
|
+
"--pi-position": inline ? "relative" : "absolute",
|
|
92
|
+
"--pi-inset": inline ? "unset" : "0",
|
|
93
|
+
"--pi-icon-size": `${null != size ? size : 0}px`
|
|
94
|
+
}), [ inline, size ]), openCircle = useMemo(() => OpenCircle(size, secondsPerSpin, color, stroke, playing), [ size, secondsPerSpin, color, stroke, playing ]);
|
|
95
|
+
return jsx(AnimatePresence, {
|
|
96
|
+
initial: !0,
|
|
97
|
+
children: show && jsx(motion.div, Object.assign({
|
|
98
|
+
id: divId,
|
|
99
|
+
className: `${css_container}${divClass}`,
|
|
100
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
101
|
+
initial: {
|
|
102
|
+
opacity: 0
|
|
103
|
+
},
|
|
104
|
+
animate: {
|
|
105
|
+
opacity: 1
|
|
106
|
+
},
|
|
107
|
+
exit: {
|
|
108
|
+
opacity: 0
|
|
109
|
+
}
|
|
110
|
+
}, rest, {
|
|
111
|
+
children: openCircle
|
|
112
|
+
}))
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
styleInject(".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.ProgressIndicator-module_container__CZDPk {\n\tposition: var(--pi-position);\n\ttop: var(--pi-inset);\n\tbottom: var(--pi-inset);\n\tleft: var(--pi-inset);\n\tright: var(--pi-inset);\n\tcolor: var(--core-text-disabled);\n\tz-index: var(--elevation-status);\n}\n\n.ProgressIndicator-module_iconWrapper__jPIBx {\n\tmin-width: var(--pi-icon-size);\n\tmax-width: var(--pi-icon-size);\n\tmax-height: var(--pi-icon-size);\n\tmin-height: var(--pi-icon-size);\n\theight: var(--pi-icon-size);\n\twidth: var(--pi-icon-size);\n\tpadding: 0;\n\tbackground: none;\n\tborder-radius: 100%;\n}\n");
|
|
117
|
+
|
|
118
|
+
const OpenCircle = (size, secondsPerSpin, color, stroke = 1.5, playing = !1) => jsxs(motion.svg, {
|
|
119
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
120
|
+
width: size,
|
|
121
|
+
height: size,
|
|
122
|
+
viewBox: "0 0 20 20",
|
|
123
|
+
role: "img",
|
|
124
|
+
"aria-label": "Loading spinner",
|
|
125
|
+
transition: {
|
|
126
|
+
ease: "linear",
|
|
127
|
+
repeatType: "loop",
|
|
128
|
+
repeat: playing ? Number.POSITIVE_INFINITY : 0,
|
|
129
|
+
duration: secondsPerSpin
|
|
130
|
+
},
|
|
131
|
+
animate: playing ? {
|
|
132
|
+
rotate: 360
|
|
133
|
+
} : {
|
|
134
|
+
rotate: 0
|
|
135
|
+
},
|
|
136
|
+
children: [ jsx("title", {
|
|
137
|
+
children: "Loading"
|
|
138
|
+
}), jsx("defs", {
|
|
139
|
+
children: jsxs("linearGradient", {
|
|
140
|
+
id: "strokeFill",
|
|
141
|
+
x1: "0%",
|
|
142
|
+
y1: "0%",
|
|
143
|
+
x2: "100%",
|
|
144
|
+
y2: "0%",
|
|
145
|
+
children: [ jsx("stop", {
|
|
146
|
+
offset: "0%",
|
|
147
|
+
stopColor: color,
|
|
148
|
+
stopOpacity: 1
|
|
149
|
+
}), jsx("stop", {
|
|
150
|
+
offset: "50%",
|
|
151
|
+
stopColor: color,
|
|
152
|
+
stopOpacity: 1
|
|
153
|
+
}), jsx("stop", {
|
|
154
|
+
offset: "100%",
|
|
155
|
+
stopColor: color,
|
|
156
|
+
stopOpacity: 0
|
|
157
|
+
}) ]
|
|
158
|
+
})
|
|
159
|
+
}), jsx(motion.path, {
|
|
160
|
+
d: "M 17.371 6.886 C 17.776 7.843 18 8.895 18 10 C 18 14.418 14.418 18 10 18 C 5.582 18 2 14.418 2 10 C 2 5.582 5.582 2 10 2",
|
|
161
|
+
fill: "transparent",
|
|
162
|
+
strokeWidth: stroke,
|
|
163
|
+
stroke: "url(#strokeFill)"
|
|
164
|
+
}) ]
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
export { DoneCheck as D, ProgressIndicator as P };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
import React, { useState, useRef, useCallback, useMemo, useEffect } from "react";
|
|
4
|
+
|
|
5
|
+
import { useTheme } from "../hooks/useTheme.mjs";
|
|
6
|
+
|
|
7
|
+
import "../theme/colors.mjs";
|
|
8
|
+
|
|
9
|
+
import "../hooks/useWindow.mjs";
|
|
10
|
+
|
|
11
|
+
import { B as Button } from "./Button-B_aIY6wE.mjs";
|
|
12
|
+
|
|
13
|
+
import { F as FileList } from "./FileList-DUzgHfE-.mjs";
|
|
14
|
+
|
|
15
|
+
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
16
|
+
|
|
17
|
+
var css = {
|
|
18
|
+
wrapperBg: "PromptInput-module_wrapperBg__9QWdq flexBox-module_columnStart__Kg8cV",
|
|
19
|
+
bgRotate: "PromptInput-module_bgRotate__xvvtD",
|
|
20
|
+
textareaWrapper: "PromptInput-module_textareaWrapper__4hWyM flexBox-module_columnStart__Kg8cV",
|
|
21
|
+
attachments: "PromptInput-module_attachments__R0egZ flexBox-module_rowStart__nJZnW",
|
|
22
|
+
clear: "PromptInput-module_clear__tjFZ- flexBox-module_row__PWxbe",
|
|
23
|
+
buttonBar: "PromptInput-module_buttonBar__9Ol9O flexBox-module_rowBetween__27lKK",
|
|
24
|
+
toolBar: "PromptInput-module_toolBar__CmIf- flexBox-module_rowStart__nJZnW",
|
|
25
|
+
textarea: "PromptInput-module_textarea__ZuzrC",
|
|
26
|
+
s: "PromptInput-module_s__Z684A type-module_body-s-regular__8-FO-",
|
|
27
|
+
m: "PromptInput-module_m__NxLh6 type-module_body-m-regular__Qtp5G",
|
|
28
|
+
l: "PromptInput-module_l__BaGnx type-module_body-l-regular__Ar4d3"
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
styleInject('.flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.PromptInput-module_wrapperBg__9QWdq {\n\tposition: relative;\n\t--border-angle: 0turn;\n\t--conic-gradient-dark: conic-gradient(\n\t\tfrom var(--border-angle),\n\t\tvar(--core-text-special) 0deg,\n\t\tvar(--core-text-special) 45deg,\n\t\tvar(--core-text-special) 90deg,\n\t\tvar(--array-magenta-label) 135deg,\n\t\tvar(--array-magenta-label) 180deg,\n\t\tvar(--array-magenta-label) 225deg,\n\t\tvar(--array-land) 270deg,\n\t\tvar(--array-land) 315deg,\n\t\tvar(--array-land) 360deg\n\t);\n\t--conic-gradient-light: conic-gradient(\n\t\tfrom var(--border-angle),\n\t\tvar(--core-text-special) 0deg,\n\t\tvar(--core-text-special) 45deg,\n\t\tvar(--core-text-special) 90deg,\n\t\tvar(--array-magenta-label) 135deg,\n\t\tvar(--array-magenta-label) 180deg,\n\t\tvar(--array-magenta-label) 225deg,\n\t\tvar(--array-land-label) 270deg,\n\t\tvar(--array-land-label) 315deg,\n\t\tvar(--array-land-label) 360deg\n\t);\n\tz-index: 0;\n\theight: auto;\n\tmax-height: var(--prompt-max-height);\n\twidth: 100%;\n\tborder-radius: var(--prompt-border-radius);\n\toverflow: hidden;\n\tpadding: var(--prompt-border-width) !important;\n\tbackground: var(--prompt-border-color);\n\tanimation: PromptInput-module_bgRotate__xvvtD 3s linear infinite;\n\tanimation-play-state: var(--prompt-state);\n\ttransition: background 0.25s ease-in-out 0s;\n}\n\n@property --border-angle {\n\tsyntax: "<angle>";\n\tinherits: false;\n\tinitial-value: 0turn;\n}\n\n@keyframes PromptInput-module_bgRotate__xvvtD {\n\t100% {\n\t\t--border-angle: 1turn;\n\t}\n}\n\n.PromptInput-module_textareaWrapper__4hWyM {\n\talign-items: flex-start;\n\twidth: 100%;\n\theight: min-content;\n\tmax-height: 400px;\n\toverflow: hidden;\n\toverflow-y: auto;\n\tborder-radius: var(--prompt-inner-border-radius);\n\tbackground: var(--core-surface-secondary);\n}\n\n.PromptInput-module_attachments__R0egZ {\n\tpadding: 16px 16px 0 16px !important;\n\twidth: 100%;\n}\n\n.PromptInput-module_clear__tjFZ- {\n\tpadding: 12px 8px 0 0 !important;\n\tdisplay: var(--prompt-clear) !important;\n}\n\n.PromptInput-module_buttonBar__9Ol9O {\n\tpadding: 8px 16px 16px 16px !important;\n\twidth: 100%;\n\tcursor: text;\n}\n\n.PromptInput-module_toolBar__CmIf- {\n\tflex: 1;\n\tgap: 8px;\n}\n\n.PromptInput-module_textarea__ZuzrC {\n\tpadding: 16px !important;\n\tbox-sizing: border-box;\n\tfield-sizing: content;\n\twidth: 100%;\n\tresize: none;\n\tborder: 0;\n\toutline: none;\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tborder-radius: var(--prompt-border-radius);\n\t&::placeholder {\n\t\tcolor: var(--core-text-disabled);\n\t}\n}\n\n.PromptInput-module_s__Z684A {\n}\n\n.PromptInput-module_m__NxLh6 {\n}\n\n.PromptInput-module_l__BaGnx {\n}\n');
|
|
32
|
+
|
|
33
|
+
const PromptInputBase = React.forwardRef((props, ref) => {
|
|
34
|
+
const {children: children, attachments: attachments = [], value: value = "", working: working = !1, maxHeight: maxHeight, borderStyle: borderStyle = "gradient", borderColor: borderColor, borderColorOn: borderColorOn, borderAnimate: borderAnimate = !0, borderWidth: borderWidth = 1, borderRadius: borderRadius = 8, focused: focused = !1, placeholder: placeholder = "Ask me anything ...", placeholderWorking: placeholderWorking = "Working ...", submitClears: submitClears = !0, submitEnablesStop: submitEnablesStop = !0, enterSubmits: enterSubmits = !0, attachButton: attachButton = !0, sendButton: sendButton = !0, stopEnabled: stopEnabled = !1, textSize: textSize = "m", maxLength: maxLength, toolbarGap: toolbarGap = 8, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, onStop: onStop, onAttachmentsChange: onAttachmentsChange} = props, {isDark: isDark} = useTheme(), [isFocused, setIsFocused] = useState(null != focused && focused), [isWorking, setIsWorking] = useState(null != working && working), [isStopEnabled, setIsStopEnabled] = useState(stopEnabled), [textValue, setTextValue] = useState(value), textAreaRef = useRef(null), handleFocus = useCallback(() => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
setIsFocused(!0), null === (_a = null == textAreaRef ? void 0 : textAreaRef.current) || void 0 === _a || _a.focus(),
|
|
37
|
+
null == onFocus || onFocus(null === (_b = textAreaRef.current) || void 0 === _b ? void 0 : _b.value, attachments);
|
|
38
|
+
}, [ onFocus, attachments ]), handleBlur = useCallback(() => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
setIsFocused(!1), null === (_a = textAreaRef.current) || void 0 === _a || _a.blur(),
|
|
41
|
+
null == onBlur || onBlur(null === (_b = textAreaRef.current) || void 0 === _b ? void 0 : _b.value, attachments);
|
|
42
|
+
}, [ onBlur, attachments ]), handleAttachmentsChange = useCallback(newFiles => {
|
|
43
|
+
var _a;
|
|
44
|
+
null == onAttachmentsChange || onAttachmentsChange(newFiles), null == onChange || onChange(null === (_a = textAreaRef.current) || void 0 === _a ? void 0 : _a.value, newFiles);
|
|
45
|
+
}, [ onAttachmentsChange, onChange ]), handleChange = useCallback(e => {
|
|
46
|
+
const newValue = e.target.value;
|
|
47
|
+
setTextValue(newValue), null == onChange || onChange(newValue, attachments);
|
|
48
|
+
}, [ onChange, attachments ]), handleSubmit = useCallback(() => {
|
|
49
|
+
var _a;
|
|
50
|
+
if (isWorking || isStopEnabled) return;
|
|
51
|
+
const currentValue = null === (_a = textAreaRef.current) || void 0 === _a ? void 0 : _a.value;
|
|
52
|
+
currentValue && (null == onSubmit || onSubmit(currentValue, attachments), setIsWorking(!0),
|
|
53
|
+
submitClears && setTextValue(""), submitEnablesStop && setIsStopEnabled(!0), handleBlur());
|
|
54
|
+
}, [ submitClears, onSubmit, handleBlur, submitEnablesStop, isWorking, isStopEnabled, attachments ]), handleStop = useCallback(() => {
|
|
55
|
+
setIsWorking(!1), setIsStopEnabled(!1), null == onStop || onStop(), handleFocus();
|
|
56
|
+
}, [ onStop, handleFocus ]), handleKeyDown = useCallback(e => {
|
|
57
|
+
if ("Enter" === e.key && enterSubmits) {
|
|
58
|
+
if (e.preventDefault(), isWorking) return;
|
|
59
|
+
handleSubmit();
|
|
60
|
+
}
|
|
61
|
+
}, [ handleSubmit, isWorking, enterSubmits ]), handleClickSend = useCallback(e => {
|
|
62
|
+
e.preventDefault(), e.stopPropagation(), isWorking && !isStopEnabled || (isStopEnabled ? handleStop() : handleSubmit());
|
|
63
|
+
}, [ handleSubmit, handleStop, isStopEnabled, isWorking ]), handleClickAttach = useCallback(e => {
|
|
64
|
+
e.preventDefault(), e.stopPropagation();
|
|
65
|
+
}, []), handleClickButtonBar = useCallback(e => {
|
|
66
|
+
e.preventDefault(), isWorking || handleFocus();
|
|
67
|
+
}, [ handleFocus, isWorking ]), setBorderColor = useMemo(() => {
|
|
68
|
+
if ("gradient" === borderStyle) {
|
|
69
|
+
const radial = isDark ? "var(--conic-gradient-dark)" : "var(--conic-gradient-light)";
|
|
70
|
+
return isWorking && borderAnimate ? radial : isFocused ? null != borderColorOn ? borderColorOn : radial : null != borderColor ? borderColor : radial;
|
|
71
|
+
}
|
|
72
|
+
return "solid" === borderStyle ? isWorking || isFocused ? null != borderColorOn ? borderColorOn : "var(--core-outline-special)" : null != borderColor ? borderColor : "transparent" : "transparent";
|
|
73
|
+
}, [ borderStyle, isFocused, borderColorOn, borderColor, isWorking, borderAnimate, isDark ]), setPlaceholder = useMemo(() => isWorking && placeholderWorking ? placeholderWorking : placeholder, [ isWorking, placeholder, placeholderWorking ]), setSendIconColor = useMemo(() => isStopEnabled || isWorking ? "var(--core-text-primary)" : "" !== textValue ? "var(--core-text-light)" : "var(--core-text-disabled)", [ textValue, isWorking, isStopEnabled ]), sendButtonState = useMemo(() => isStopEnabled || "" !== textValue || isWorking ? "normal" : "disabled", [ textValue, isStopEnabled, isWorking ]), attachState = useMemo(() => isWorking ? "disabled" : "normal", [ isWorking ]);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
focused ? null === (_a = textAreaRef.current) || void 0 === _a || _a.focus() : null === (_b = textAreaRef.current) || void 0 === _b || _b.blur();
|
|
77
|
+
}, [ focused ]), useEffect(() => {
|
|
78
|
+
var _a;
|
|
79
|
+
(null === (_a = textAreaRef.current) || void 0 === _a ? void 0 : _a.value) !== value && setTextValue(value);
|
|
80
|
+
}, [ value ]), useEffect(() => {
|
|
81
|
+
void 0 !== working && setIsWorking(working);
|
|
82
|
+
}, [ working ]), useEffect(() => setIsStopEnabled(stopEnabled), [ stopEnabled ]);
|
|
83
|
+
const cssVars = useMemo(() => ({
|
|
84
|
+
"--prompt-border-color": setBorderColor,
|
|
85
|
+
"--prompt-max-height": maxHeight ? `${maxHeight}px` : "unset",
|
|
86
|
+
"--prompt-border-width": borderWidth ? `${borderWidth}px` : "0",
|
|
87
|
+
"--prompt-state": isWorking && borderAnimate ? "running" : "paused",
|
|
88
|
+
"--prompt-border-radius": borderRadius ? `${borderRadius}px` : "8px",
|
|
89
|
+
"--prompt-inner-border-radius": borderRadius ? borderRadius - 1 + "px" : "7px"
|
|
90
|
+
}), [ isWorking, borderAnimate, setBorderColor, borderWidth, borderRadius, maxHeight ]);
|
|
91
|
+
return jsx("div", {
|
|
92
|
+
className: css.wrapperBg,
|
|
93
|
+
ref: ref,
|
|
94
|
+
style: cssVars,
|
|
95
|
+
children: jsxs("div", {
|
|
96
|
+
className: css.textareaWrapper,
|
|
97
|
+
children: [ attachments.length > 0 && jsx("div", {
|
|
98
|
+
className: css.attachments,
|
|
99
|
+
children: jsx(FileList, {
|
|
100
|
+
files: attachments,
|
|
101
|
+
onChange: handleAttachmentsChange,
|
|
102
|
+
bgColor: "var(--core-surface-primary)",
|
|
103
|
+
size: "s",
|
|
104
|
+
direction: "row",
|
|
105
|
+
gap: 8,
|
|
106
|
+
iconSize: 24
|
|
107
|
+
})
|
|
108
|
+
}), jsx("textarea", {
|
|
109
|
+
id: "promptInput",
|
|
110
|
+
name: "promptInput",
|
|
111
|
+
className: `${css.textarea} ${css[textSize]}`,
|
|
112
|
+
ref: textAreaRef,
|
|
113
|
+
value: null != textValue ? textValue : "",
|
|
114
|
+
onChange: handleChange,
|
|
115
|
+
placeholder: setPlaceholder,
|
|
116
|
+
onFocus: handleFocus,
|
|
117
|
+
onBlur: handleBlur,
|
|
118
|
+
onKeyDown: handleKeyDown,
|
|
119
|
+
maxLength: maxLength,
|
|
120
|
+
rows: 1
|
|
121
|
+
}), (children || attachButton || sendButton) && jsxs("div", {
|
|
122
|
+
className: css.buttonBar,
|
|
123
|
+
onMouseDown: handleClickButtonBar,
|
|
124
|
+
children: [ jsxs("div", {
|
|
125
|
+
className: css.toolBar,
|
|
126
|
+
style: {
|
|
127
|
+
gap: toolbarGap
|
|
128
|
+
},
|
|
129
|
+
children: [ attachButton && jsx(Button, {
|
|
130
|
+
round: !0,
|
|
131
|
+
label: void 0,
|
|
132
|
+
variant: "outline",
|
|
133
|
+
iconLeft: "plus",
|
|
134
|
+
iconSize: 20,
|
|
135
|
+
state: attachState,
|
|
136
|
+
onMouseDown: handleClickAttach
|
|
137
|
+
}), children ]
|
|
138
|
+
}), sendButton && jsx(Button, {
|
|
139
|
+
round: !0,
|
|
140
|
+
label: void 0,
|
|
141
|
+
variant: isStopEnabled ? "outline" : "solid",
|
|
142
|
+
iconLeft: isStopEnabled ? "stop" : "arrow up",
|
|
143
|
+
iconSize: isStopEnabled ? 16 : 20,
|
|
144
|
+
state: sendButtonState,
|
|
145
|
+
bgColorDisabled: "var(--core-outline-primary)",
|
|
146
|
+
progress: !isStopEnabled,
|
|
147
|
+
working: !isStopEnabled && isWorking,
|
|
148
|
+
onMouseDown: handleClickSend,
|
|
149
|
+
iconColor: setSendIconColor
|
|
150
|
+
}) ]
|
|
151
|
+
}) ]
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
PromptInputBase.displayName = "PromptInput";
|
|
157
|
+
|
|
158
|
+
const PromptInput = React.memo(PromptInputBase);
|
|
159
|
+
|
|
160
|
+
export { PromptInput as P };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { _ as __rest } from "./tslib.es6-c-7TIv71.mjs";
|
|
2
|
+
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
|
6
|
+
|
|
7
|
+
import { useTheme } from "../hooks/useTheme.mjs";
|
|
8
|
+
|
|
9
|
+
import "../theme/colors.mjs";
|
|
10
|
+
|
|
11
|
+
import "../hooks/useWindow.mjs";
|
|
12
|
+
|
|
13
|
+
import { I as IconButton } from "./IconButton-BBiZrXlS.mjs";
|
|
14
|
+
|
|
15
|
+
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
16
|
+
|
|
17
|
+
var css_wrapper = "RadioButton-module_wrapper__ezvz- flexBox-module_row__PWxbe", css_radioIcon = "RadioButton-module_radioIcon__6ddS9 flexBox-module_column__MP2Xd", css_radioTitle = "RadioButton-module_radioTitle__R1R2D flexBox-module_rowStart__nJZnW type-module_body-m-regular__Qtp5G", css_radioSummary = "RadioButton-module_radioSummary__-RRdT flexBox-module_rowStart__nJZnW type-module_body-s-regular__8-FO-", css_radioContent = "RadioButton-module_radioContent__Fq-Ry flexBox-module_columnStart__Kg8cV";
|
|
18
|
+
|
|
19
|
+
styleInject(".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__zDf-z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__R5GpK {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__SI-hC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__PUi44 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__1B6fk {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.RadioButton-module_wrapper__ezvz- {\n\tpadding: var(--rb-padding) !important;\n\tmax-width: var(--rb-max-width);\n\tflex: var(--rb-flex);\n\tborder: 1px solid var(--core-outline-primary);\n\tbackground: var(--rb-bg);\n\tgap: 8px;\n\tborder-radius: 8px;\n\tcursor: pointer;\n\ttransition: all 0.25s ease-in-out 0s;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.RadioButton-module_radioIcon__6ddS9 {\n\twidth: 20px;\n\theight: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n\tmin-height: 20px;\n\tmin-width: 20px;\n}\n\n.RadioButton-module_radioTitle__R1R2D {\n\tcolor: var(--core-text-primary);\n\twhite-space: nowrap;\n\tflex: 1;\n}\n\n.RadioButton-module_radioSummary__-RRdT {\n\tcolor: var(--core-text-primary);\n\tflex: 1;\n}\n\n.RadioButton-module_radioContent__Fq-Ry {\n\twidth: 100%;\n}\n");
|
|
20
|
+
|
|
21
|
+
const RadioButton = React.memo(props => {
|
|
22
|
+
const theme = useTheme(), {option: option, selected: selected = !1, deselect: deselect = !0, tabIndex: tabIndex = 1, wrap: wrap = !1, list: list = !1, hideRadio: hideRadio = !1, toggleIcon: toggleIcon = !0, noFrame: noFrame = !1, iconColor: iconColor, onChange: onChange = () => null} = props, divAttributes = __rest(props, [ "option", "selected", "deselect", "tabIndex", "wrap", "list", "hideRadio", "toggleIcon", "noFrame", "iconColor", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [isSelected, setIsSelected] = useState(selected);
|
|
23
|
+
useEffect(() => setIsSelected(selected), [ selected ]);
|
|
24
|
+
const handleChange = useCallback(() => {
|
|
25
|
+
isSelected && !deselect || (setIsSelected(!isSelected), onChange(option, !isSelected));
|
|
26
|
+
}, [ isSelected, deselect, onChange, option ]), handleKeyDown = useCallback(e => {
|
|
27
|
+
"Space" === e.code && (e.preventDefault(), e.stopPropagation(), handleChange());
|
|
28
|
+
}, [ handleChange ]), setIconColor = useMemo(() => iconColor || (toggleIcon && isSelected ? theme.current.colors["core-button-primary"] : theme.current.colors["core-icon-primary"]), [ iconColor, toggleIcon, isSelected, theme ]), iconName = useMemo(() => toggleIcon && isSelected ? "checked" : "unchecked", [ toggleIcon, isSelected ]), setFlex = useMemo(() => list ? "unset" : wrap ? "40%" : "1", [ list, wrap ]), cssVars = useMemo(() => ({
|
|
29
|
+
"--rb-max-width": wrap ? "50%" : "100%",
|
|
30
|
+
"--rb-flex": setFlex,
|
|
31
|
+
"--rb-padding": noFrame ? "0" : "8px 16px 8px 10px",
|
|
32
|
+
"--rb-bg": isSelected ? "var(--core-surface-secondary)" : "transparent"
|
|
33
|
+
}), [ setFlex, isSelected, wrap, noFrame ]);
|
|
34
|
+
return jsxs("div", Object.assign({
|
|
35
|
+
id: divId,
|
|
36
|
+
className: `${css_wrapper}${divClass}`,
|
|
37
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
38
|
+
onClick: handleChange,
|
|
39
|
+
onKeyDown: handleKeyDown,
|
|
40
|
+
tabIndex: tabIndex,
|
|
41
|
+
"aria-label": option.title,
|
|
42
|
+
"aria-selected": isSelected
|
|
43
|
+
}, rest, {
|
|
44
|
+
children: [ option.icon && !hideRadio && jsx("div", {
|
|
45
|
+
className: css_radioIcon,
|
|
46
|
+
children: jsx(IconButton, {
|
|
47
|
+
toggle: !1,
|
|
48
|
+
icon: iconName,
|
|
49
|
+
color: setIconColor,
|
|
50
|
+
frameSize: 20,
|
|
51
|
+
iconSize: 20
|
|
52
|
+
})
|
|
53
|
+
}), jsxs("div", {
|
|
54
|
+
className: css_radioContent,
|
|
55
|
+
children: [ jsx("div", {
|
|
56
|
+
className: css_radioTitle,
|
|
57
|
+
children: option.title
|
|
58
|
+
}), option.description && "" !== option.description && jsx("div", {
|
|
59
|
+
className: css_radioSummary,
|
|
60
|
+
children: option.description
|
|
61
|
+
}) ]
|
|
62
|
+
}) ]
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export { RadioButton as R };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { _ as __rest } from "./tslib.es6-c-7TIv71.mjs";
|
|
2
|
+
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
|
6
|
+
|
|
7
|
+
import { R as RadioButton } from "./RadioButton-D-TdQu3a.mjs";
|
|
8
|
+
|
|
9
|
+
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
10
|
+
|
|
11
|
+
var css_wrapper = "RadioButtonList-module_wrapper__UMlAV", css_column = "RadioButtonList-module_column__E9MfY flexBox-module_columnStart__Kg8cV", css_row = "RadioButtonList-module_row__l88Vt flexBox-module_rowStart__nJZnW";
|
|
12
|
+
|
|
13
|
+
styleInject(".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.RadioButtonList-module_wrapper__UMlAV {\n\talign-items: flex-start;\n\twidth: 100%;\n\tflex-wrap: var(--rb-list-flex-wrap);\n\tmargin-bottom: var(--rb-list-margin-bottom);\n\tgap: var(--rb-gap);\n}\n\n.RadioButtonList-module_column__E9MfY {\n}\n\n.RadioButtonList-module_row__l88Vt {\n}\n");
|
|
14
|
+
|
|
15
|
+
const RadioButtonList = React.memo(props => {
|
|
16
|
+
const {options: options = [], selectedIndexes: selectedIndexes = null, selectedOptions: selectedOptions = null, label: label = null, deselect: deselect = !1, multiSelect: multiSelect = !1, wrap: wrap = !1, tabIndexSeed: tabIndexSeed = 0, spacer: spacer = "none", custom: custom = 0, gap: gap = 16, hideRadio: hideRadio = !1, noFrame: noFrame = !1, toggleIcon: toggleIcon = !0, iconColor: iconColor, iconSelectedColor: iconSelectedColor, onChange: onChange = () => null} = props, divAttributes = __rest(props, [ "options", "selectedIndexes", "selectedOptions", "label", "deselect", "multiSelect", "wrap", "tabIndexSeed", "spacer", "custom", "gap", "hideRadio", "noFrame", "toggleIcon", "iconColor", "iconSelectedColor", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [selected, setSelected] = useState(selectedIndexes);
|
|
17
|
+
useEffect(() => setSelected(selectedIndexes), [ selectedIndexes ]), useEffect(() => {
|
|
18
|
+
if (!selectedOptions || !options) return;
|
|
19
|
+
const selections = [];
|
|
20
|
+
for (const item of selectedOptions) for (let i = 0; i < options.length; i++) {
|
|
21
|
+
options[i].fieldName === item && selections.push(i);
|
|
22
|
+
}
|
|
23
|
+
setSelected(selections);
|
|
24
|
+
}, [ selectedOptions, options ]);
|
|
25
|
+
const isSelected = useCallback(index => !!selected && selected.includes(index), [ selected ]), doMultiSelection = useCallback((selection, state) => {
|
|
26
|
+
let indexesSelected = selected ? [ ...selected ] : [];
|
|
27
|
+
if (!state && selected) {
|
|
28
|
+
const removeAt = indexesSelected.indexOf(selection);
|
|
29
|
+
indexesSelected.splice(removeAt, 1);
|
|
30
|
+
} else if (state) {
|
|
31
|
+
indexesSelected = selected ? [ ...selected ] : [];
|
|
32
|
+
indexesSelected.includes(selection) || indexesSelected.push(selection);
|
|
33
|
+
}
|
|
34
|
+
let updatedSelections = [];
|
|
35
|
+
for (const index of indexesSelected || []) updatedSelections && updatedSelections.push(options[index]);
|
|
36
|
+
updatedSelections.length < 1 && (updatedSelections = null), setSelected(indexesSelected || null),
|
|
37
|
+
onChange(updatedSelections, indexesSelected || null);
|
|
38
|
+
}, [ selected, options, onChange ]), doSingleSelection = useCallback((selection, state) => {
|
|
39
|
+
onChange(state ? [ options[selection] ] : [], state ? [ selection ] : []), setSelected(state ? [ selection ] : null);
|
|
40
|
+
}, [ options, onChange ]), handleChange = useCallback((selection, state) => {
|
|
41
|
+
multiSelect ? doMultiSelection(selection, state) : doSingleSelection(selection, state);
|
|
42
|
+
}, [ multiSelect, doMultiSelection, doSingleSelection ]), renderedOptions = useMemo(() => options.map((option, i) => jsx(RadioButton, {
|
|
43
|
+
option: option,
|
|
44
|
+
selected: isSelected(i),
|
|
45
|
+
deselect: deselect,
|
|
46
|
+
wrap: wrap,
|
|
47
|
+
noFrame: noFrame,
|
|
48
|
+
hideRadio: hideRadio,
|
|
49
|
+
onChange: (_option, state) => handleChange(i, state),
|
|
50
|
+
tabIndex: i + 1 + 100 * tabIndexSeed,
|
|
51
|
+
toggleIcon: toggleIcon,
|
|
52
|
+
iconColor: isSelected(i) ? iconSelectedColor : iconColor
|
|
53
|
+
}, `${option.fieldName}_${i}`)), [ options, isSelected, deselect, wrap, noFrame, hideRadio, handleChange, tabIndexSeed, toggleIcon, iconColor, iconSelectedColor ]), margin = useMemo(() => "none" === spacer ? 0 : "custom" === spacer ? custom : 0, [ spacer, custom ]), cssVars = useMemo(() => ({
|
|
54
|
+
"--rb-list-flex-wrap": wrap ? "wrap" : "nowrap",
|
|
55
|
+
"--rb-list-margin-bottom": noFrame ? 0 : `${margin}px`,
|
|
56
|
+
"--rb-gap": `${gap}px`
|
|
57
|
+
}), [ wrap, margin, gap, noFrame ]);
|
|
58
|
+
return jsxs("div", Object.assign({
|
|
59
|
+
id: divId,
|
|
60
|
+
className: `${css_wrapper} ${noFrame ? css_column : css_row}${divClass}`,
|
|
61
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars)
|
|
62
|
+
}, rest, {
|
|
63
|
+
children: [ label, renderedOptions ]
|
|
64
|
+
}));
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export { RadioButtonList as R };
|