@apple-pie/slice 0.1.5 → 0.1.7
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/cjs/chunks/{Avatar-YNcGDUzr.js → Avatar-8XLnVICd.js} +6 -4
- package/dist/cjs/chunks/{AvatarGroup-Dn5R1XIU.js → AvatarGroup-BhKZvX8M.js} +1 -1
- package/dist/cjs/chunks/{Button-Ck4syxwn.js → Button-D8_eyuOA.js} +9 -6
- package/dist/cjs/chunks/{ButtonBar-Cx9Xwddh.js → ButtonBar-DwMLfvi8.js} +11 -15
- package/dist/cjs/chunks/{Camera-BrLRwcw1.js → Camera-CxHdYGEa.js} +11 -8
- package/dist/cjs/chunks/{Card-CYDP4vAN.js → Card-D4YkmNC7.js} +5 -8
- package/dist/cjs/chunks/{CheckBox-DYG1fNWy.js → CheckBox-CmTQ6KW1.js} +9 -14
- package/dist/cjs/chunks/{Chip-CqOwsrmt.js → Chip-CwMJOnBV.js} +5 -5
- package/dist/cjs/chunks/{DivInput-C73sqUF3.js → DivInput-DdZA8S1k.js} +1 -1
- package/dist/cjs/chunks/{DocIcons-B5TcBqSH.js → DocIcons-BZI6JMyw.js} +1 -1
- package/dist/cjs/chunks/{DrggablePanel-BzvBBhS7.js → DrggablePanel-CkhCXqKv.js} +1 -1
- package/dist/cjs/chunks/{DropDown-Bo0bxkFk.js → DropDown-Ce8aU2va.js} +2 -2
- package/dist/cjs/chunks/{FileIcon-hYwcre20.js → FileIcon-CZLe2S2l.js} +3 -3
- package/dist/cjs/chunks/{FileList-bA8PoGOh.js → FileList-tivoUJSP.js} +11 -4
- package/dist/cjs/chunks/{Grouper-BszVihfB.js → Grouper-BbovOSYw.js} +8 -7
- package/dist/cjs/chunks/{_types-NyUTfBLR.js → Icon-N0YJuKQf.js} +68 -44
- package/dist/cjs/chunks/{IconButton-yWq-C437.js → IconButton-BXotgG2u.js} +9 -6
- package/dist/cjs/chunks/{Label-D15cIroT.js → Label-CZvJbATa.js} +16 -11
- package/dist/cjs/chunks/{Overlay-DL0EJDyk.js → Overlay-BX6vXX9F.js} +1 -1
- package/dist/cjs/chunks/{Pager-TUxcWbmn.js → Pager-Da9AqSFN.js} +1 -1
- package/dist/cjs/chunks/{ProgressIndicator-Dvq4eIWW.js → ProgressIndicator-opbbADog.js} +2 -2
- package/dist/cjs/chunks/{PromptInput-Hgh6995X.js → PromptInput-tA4fpOTk.js} +1 -1
- package/dist/cjs/chunks/{RadioButton-Cu-laBV5.js → RadioButton-B8GIKGm-.js} +9 -10
- package/dist/cjs/chunks/{RadioButtonList-COS7jfsC.js → RadioButtonList-3o1IvhdC.js} +11 -5
- package/dist/cjs/chunks/{SSEConnection-B_yE8cXz.js → SSEConnection-C-1OzEOp.js} +29 -15
- package/dist/cjs/chunks/{Slider-BeXrWjVx.js → Slider-CnXBacf-.js} +65 -36
- package/dist/cjs/chunks/{Switch-Xqf0vwul.js → Switch-BiTshVLM.js} +6 -3
- package/dist/cjs/chunks/{TabBar-DCRr3l9L.js → TabBar-DZ2y7owf.js} +48 -12
- package/dist/cjs/chunks/{TextArea-DM0aHGGt.js → TextArea-DXcMRUfI.js} +1 -1
- package/dist/cjs/chunks/{TextField-DQgpDpR1.js → TextField-CkfTNM6_.js} +11 -6
- package/dist/cjs/chunks/{Tip-ik8-p4_4.js → Tip-59T3TUN4.js} +1 -1
- package/dist/cjs/chunks/{Toast-D-Y1Ytnb.js → Toast-skIBuJ3b.js} +2 -2
- package/dist/cjs/chunks/{UploadArea-Y_B35qjZ.js → UploadArea-B8mJRc0a.js} +15 -10
- package/dist/cjs/chunks/{WSConnection-DCBuJGmb.js → WSConnection-DrOC8Z0R.js} +32 -23
- package/dist/cjs/chunks/_types-BD6txsj1.js +118 -0
- package/dist/cjs/chunks/{colors-uej0anrN.js → colors-njquvHkx.js} +1 -1
- package/dist/cjs/chunks/debounce-BF4i6uIC.js +18 -0
- package/dist/cjs/chunks/{misc-C-M6KKsH.js → misc-BTF7BCZW.js} +21 -12
- package/dist/cjs/chunks/{sseStore-CIIeshjm.js → sseStore-1OeJ9TRP.js} +1 -1
- package/dist/cjs/components/Avatar/index.js +2 -2
- package/dist/cjs/components/AvatarGroup/index.js +2 -2
- package/dist/cjs/components/Button/index.js +3 -3
- package/dist/cjs/components/ButtonBar/index.js +3 -3
- package/dist/cjs/components/Camera/index.js +4 -4
- package/dist/cjs/components/Card/index.js +5 -6
- package/dist/cjs/components/CheckBox/index.js +6 -7
- package/dist/cjs/components/Chip/index.js +2 -2
- package/dist/cjs/components/DivInput/index.js +2 -2
- package/dist/cjs/components/DocIcon/index.js +1 -1
- package/dist/cjs/components/DraggablePanel/index.js +2 -2
- package/dist/cjs/components/DropDown/index.js +2 -2
- package/dist/cjs/components/FileIcon/index.js +2 -2
- package/dist/cjs/components/FileList/index.js +4 -4
- package/dist/cjs/components/Grouper/index.js +3 -3
- package/dist/cjs/components/Icon/index.js +3 -8
- package/dist/cjs/components/IconButton/index.js +3 -3
- package/dist/cjs/components/Label/index.js +2 -2
- package/dist/cjs/components/Overlay/index.js +1 -1
- package/dist/cjs/components/Pager/index.js +2 -2
- package/dist/cjs/components/Progress/index.js +3 -3
- package/dist/cjs/components/PromptInput/index.js +6 -6
- package/dist/cjs/components/RadioButton/index.js +2 -2
- package/dist/cjs/components/RadioButtonList/index.js +7 -7
- package/dist/cjs/components/Slider/index.js +4 -3
- package/dist/cjs/components/Switch/index.js +1 -1
- package/dist/cjs/components/TabBar/index.js +3 -3
- package/dist/cjs/components/TextArea/index.js +6 -7
- package/dist/cjs/components/Textfield/index.js +5 -5
- package/dist/cjs/components/Tip/index.js +2 -2
- package/dist/cjs/components/Toast/index.js +2 -2
- package/dist/cjs/components/UploadArea/index.js +6 -6
- package/dist/cjs/hooks/useTrackRenders.js +1 -1
- package/dist/cjs/index.js +9 -14
- package/dist/cjs/stores/SSE.js +2 -2
- package/dist/cjs/stores/WS.js +1 -1
- package/dist/cjs/stores.js +2 -2
- package/dist/cjs/utils/index.js +4 -3
- package/dist/cjs/utils/objects/index.js +1 -1
- package/dist/esm/chunks/{Avatar-CDMV6f9w.mjs → Avatar-DGRMsHdO.mjs} +7 -5
- package/dist/esm/chunks/{AvatarGroup-BZ18GwhK.mjs → AvatarGroup-C9Ka1e9P.mjs} +1 -1
- package/dist/esm/chunks/{Button-DexmN81C.mjs → Button-DAvVj4YV.mjs} +8 -5
- package/dist/esm/chunks/{ButtonBar-C-LwBxlY.mjs → ButtonBar-Cw73kooJ.mjs} +11 -15
- package/dist/esm/chunks/{Camera-DdUBZi52.mjs → Camera-BrdJGlv6.mjs} +12 -9
- package/dist/esm/chunks/{Card-DUfnTA5v.mjs → Card-DGlv1PII.mjs} +4 -7
- package/dist/esm/chunks/{CheckBox-Bnd3UAt0.mjs → CheckBox-B7UCZvRv.mjs} +9 -14
- package/dist/esm/chunks/{Chip-BJS4oJBL.mjs → Chip-BPF7fBba.mjs} +5 -3
- package/dist/esm/chunks/{DivInput-B7BliU1p.mjs → DivInput-Ch9XjfWd.mjs} +1 -1
- package/dist/esm/chunks/{DocIcons-BxtcXsWI.mjs → DocIcons-B4xsPrXM.mjs} +1 -1
- package/dist/esm/chunks/{DrggablePanel-DvactFf5.mjs → DrggablePanel-Ddi0vPRp.mjs} +1 -1
- package/dist/esm/chunks/{DropDown-CbX16ETP.mjs → DropDown-Cvf2d_3u.mjs} +1 -1
- package/dist/esm/chunks/{FileIcon-CC_k5dUW.mjs → FileIcon-ePouoJpT.mjs} +3 -3
- package/dist/esm/chunks/{FileList-E5uvcN2J.mjs → FileList-BHCGzX_0.mjs} +11 -6
- package/dist/esm/chunks/{Grouper-X9OursiT.mjs → Grouper-B_FutfjV.mjs} +6 -5
- package/dist/esm/chunks/{_types-C8GP_aSD.mjs → Icon-C92f63Ib.mjs} +69 -46
- package/dist/esm/chunks/{IconButton-B5WEf-v5.mjs → IconButton-4O5S9S9G.mjs} +9 -6
- package/dist/esm/chunks/{Label-DOvquc82.mjs → Label-7ezP3eHw.mjs} +16 -11
- package/dist/esm/chunks/{Overlay-Cw9o1fHb.mjs → Overlay-TOzZXnwF.mjs} +1 -1
- package/dist/esm/chunks/{Pager-BX4TMwD_.mjs → Pager-BlLYeA2F.mjs} +1 -1
- package/dist/esm/chunks/{ProgressIndicator-DeLwB3Rb.mjs → ProgressIndicator-BVwQNOcV.mjs} +1 -1
- package/dist/esm/chunks/{PromptInput-BdMotrXA.mjs → PromptInput-pKwwzyAd.mjs} +2 -2
- package/dist/esm/chunks/{RadioButton-D6kP8p0n.mjs → RadioButton-COEnChNW.mjs} +9 -10
- package/dist/esm/chunks/{RadioButtonList-guQECpwi.mjs → RadioButtonList-De3rbLQb.mjs} +12 -6
- package/dist/esm/chunks/{SSEConnection-Dj9P0SWE.mjs → SSEConnection-DcA3wFsO.mjs} +29 -14
- package/dist/esm/chunks/{Slider-ZuSvETfo.mjs → Slider-DL2iuNlh.mjs} +69 -34
- package/dist/esm/chunks/{Switch-nWg2Ykea.mjs → Switch-Cv6LABsW.mjs} +6 -3
- package/dist/esm/chunks/{TabBar-BYtGaj_A.mjs → TabBar-qiozE5zA.mjs} +49 -13
- package/dist/esm/chunks/{TextArea-D88dZrXm.mjs → TextArea-yF2pGeel.mjs} +1 -1
- package/dist/esm/chunks/{TextField-DvTB_JoS.mjs → TextField-CgnPj6oK.mjs} +11 -6
- package/dist/esm/chunks/{Tip-B-cDOFvV.mjs → Tip-CroDIKO4.mjs} +1 -1
- package/dist/esm/chunks/{Toast-BdlopzJ6.mjs → Toast-CM493gMR.mjs} +2 -2
- package/dist/esm/chunks/{UploadArea--i-bbRIJ.mjs → UploadArea-BNf1y8Ep.mjs} +18 -13
- package/dist/esm/chunks/{WSConnection-DlYSitff.mjs → WSConnection-D9mpsVdc.mjs} +32 -23
- package/dist/esm/chunks/_types-C2C2Zwd0.mjs +118 -0
- package/dist/esm/chunks/{colors-DR9fLI5X.mjs → colors-FQ0uNQcW.mjs} +2 -2
- package/dist/esm/chunks/debounce-Bst1jxMS.mjs +19 -0
- package/dist/esm/chunks/{misc-cg9I7drO.mjs → misc-N8KLjOXc.mjs} +22 -12
- package/dist/esm/chunks/{sseStore-DdqmnAAf.mjs → sseStore-2JIpEKfz.mjs} +1 -1
- package/dist/esm/components/Avatar/index.mjs +2 -2
- package/dist/esm/components/AvatarGroup/index.mjs +3 -3
- package/dist/esm/components/Button/index.mjs +4 -4
- package/dist/esm/components/ButtonBar/index.mjs +4 -4
- package/dist/esm/components/Camera/index.mjs +5 -5
- package/dist/esm/components/Card/index.mjs +3 -3
- package/dist/esm/components/CheckBox/index.mjs +5 -5
- package/dist/esm/components/Chip/index.mjs +3 -3
- package/dist/esm/components/DivInput/index.mjs +2 -2
- package/dist/esm/components/DocIcon/index.mjs +1 -1
- package/dist/esm/components/DraggablePanel/index.mjs +2 -2
- package/dist/esm/components/DropDown/index.mjs +3 -3
- package/dist/esm/components/FileIcon/index.mjs +2 -2
- package/dist/esm/components/FileList/index.mjs +5 -5
- package/dist/esm/components/Grouper/index.mjs +3 -3
- package/dist/esm/components/Icon/index.mjs +4 -2
- package/dist/esm/components/IconButton/index.mjs +3 -3
- package/dist/esm/components/Label/index.mjs +2 -2
- package/dist/esm/components/Overlay/index.mjs +1 -1
- package/dist/esm/components/Pager/index.mjs +2 -2
- package/dist/esm/components/Progress/index.mjs +3 -3
- package/dist/esm/components/PromptInput/index.mjs +7 -7
- package/dist/esm/components/RadioButton/index.mjs +3 -3
- package/dist/esm/components/RadioButtonList/index.mjs +4 -4
- package/dist/esm/components/Slider/index.mjs +4 -2
- package/dist/esm/components/Switch/index.mjs +1 -1
- package/dist/esm/components/TabBar/index.mjs +4 -4
- package/dist/esm/components/TextArea/index.mjs +5 -5
- package/dist/esm/components/Textfield/index.mjs +6 -6
- package/dist/esm/components/Tip/index.mjs +2 -2
- package/dist/esm/components/Toast/index.mjs +3 -3
- package/dist/esm/components/UploadArea/index.mjs +6 -6
- package/dist/esm/hooks/useTrackRenders.mjs +1 -1
- package/dist/esm/index.mjs +38 -34
- package/dist/esm/stores/SSE.mjs +2 -2
- package/dist/esm/stores/WS.mjs +1 -1
- package/dist/esm/stores.mjs +2 -2
- package/dist/esm/utils/index.mjs +6 -4
- package/dist/esm/utils/objects/index.mjs +2 -2
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/Button/_types.d.ts +2 -2
- package/dist/types/components/Camera/_types.d.ts +1 -0
- package/dist/types/components/Card/_types.d.ts +1 -1
- package/dist/types/components/Chip/_types.d.ts +1 -2
- package/dist/types/components/Grouper/_types.d.ts +1 -1
- package/dist/types/components/Icon/_types.d.ts +116 -83
- package/dist/types/components/Icon/index.d.ts +1 -1
- package/dist/types/components/IconButton/_types.d.ts +2 -2
- package/dist/types/components/Label/_types.d.ts +1 -1
- package/dist/types/components/RadioButton/_types.d.ts +2 -1
- package/dist/types/components/Switch/_types.d.ts +1 -1
- package/dist/types/components/TabBar/_types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/functions/colors.d.ts +2 -2
- package/dist/types/utils/functions/debounce.d.ts +1 -2
- package/dist/types/utils/functions/files.d.ts +7 -1
- package/dist/types/utils/functions/misc.d.ts +19 -11
- package/dist/types/utils/index.d.ts +3 -2
- package/dist/types/utils/objects/SSEConnection/SSEConnection.d.ts +29 -8
- package/dist/types/utils/objects/WSConnection/WSConnection.d.ts +32 -20
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ var jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_u
|
|
|
4
4
|
|
|
5
5
|
require("../theme/colors.js"), require("../hooks/useWindow.js");
|
|
6
6
|
|
|
7
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"),
|
|
7
|
+
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), Icon = require("./Icon-N0YJuKQf.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), react = require("motion/react"), css$1_wrapper = "DoneCheck-module_wrapper__AlISD flexBox-module_row__z24tF", css$1_icon = "DoneCheck-module_icon__bKaFp flexBox-module_row__z24tF";
|
|
8
8
|
|
|
9
9
|
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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.DoneCheck-module_wrapper__AlISD {\n\theight: var(--icon-height);\n\tmax-height: var(--icon-height);\n\twidth: var(--icon-width);\n\tmax-width: var(--icon-width);\n\toverflow: visible;\n}\n\n.DoneCheck-module_icon__bKaFp {\n\theight: var(--icon-height);\n\tmax-height: var(--icon-height);\n\twidth: var(--icon-width);\n\tmax-width: var(--icon-width);\n\tscale: var(--icon-scale);\n\ttransition: var(--icon-transition);\n}\n");
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ const DoneCheck = React.memo(props => {
|
|
|
25
25
|
style: cssVars,
|
|
26
26
|
onTransitionEnd: () => null == didEnd ? void 0 : didEnd(),
|
|
27
27
|
onTransitionStart: () => null == didStart ? void 0 : didStart(),
|
|
28
|
-
children: jsxRuntime.jsx(
|
|
28
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
29
29
|
name: "check circle",
|
|
30
30
|
size: size,
|
|
31
31
|
color: color,
|
|
@@ -4,7 +4,7 @@ var jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_u
|
|
|
4
4
|
|
|
5
5
|
require("../theme/colors.js"), require("../hooks/useWindow.js");
|
|
6
6
|
|
|
7
|
-
var Button = require("./Button-
|
|
7
|
+
var Button = require("./Button-D8_eyuOA.js"), FileList = require("./FileList-tivoUJSP.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css = {
|
|
8
8
|
wrapperBg: "PromptInput-module_wrapperBg__zabZq flexBox-module_columnStart__C7P44",
|
|
9
9
|
bgRotate: "PromptInput-module_bgRotate__Um720",
|
|
10
10
|
textareaWrapper: "PromptInput-module_textareaWrapper__KusiV flexBox-module_columnStart__C7P44",
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-
|
|
3
|
+
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-BTF7BCZW.js"), Icon = require("./Icon-N0YJuKQf.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "RadioButton-module_wrapper__-pWRe flexBox-module_row__z24tF", css_radioIcon = "RadioButton-module_radioIcon__I27Xv flexBox-module_column__ezvMq", css_radioTitle = "RadioButton-module_radioTitle__zCQII flexBox-module_rowStart__4tcxS type-module_body-m-regular__LuQBA", css_radioSummary = "RadioButton-module_radioSummary__PNr0Z flexBox-module_rowStart__4tcxS type-module_body-s-regular__vRHSP", css_radioContent = "RadioButton-module_radioContent__38xVx flexBox-module_columnStart__C7P44";
|
|
4
4
|
|
|
5
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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__ZAFft {\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__s3KvF {\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__Lhqqq {\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__vRHSP {\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__tjdFc {\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__Iy-VX {\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__LuQBA {\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__uW1on {\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__UBcvQ {\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__lOYbg {\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__BqRC7 {\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__Fh2dt {\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__pF2kC {\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__BeyrH {\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__Ruknj {\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__z8L3G {\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__0O3g6 {\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__KXxEB {\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__cJeEA {\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__eRe05 {\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__Xmwtf {\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__5q1m3 {\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__k9VFV {\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__-pWRe {\n\tpadding: var(--rb-padding) !important;\n\tmax-width: var(--rb-max-width);\n\tflex: var(--rb-flex);\n\tborder: var(--rb-border);\n\tbackground: var(--rb-bg);\n\tgap: var(--rb-gap);\n\tborder-radius: 8px;\n\tcursor: pointer;\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\toutline: none;\n}\n\n.RadioButton-module_radioIcon__I27Xv {\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__zCQII {\n\tcolor: var(--core-text-primary);\n\twhite-space: nowrap;\n\tflex: 1;\n}\n\n.RadioButton-module_radioSummary__PNr0Z {\n\tcolor: var(--core-text-primary);\n\tflex: 1;\n}\n\n.RadioButton-module_radioContent__38xVx {\n\twidth: 100%;\n}\n");
|
|
5
|
+
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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__ZAFft {\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__s3KvF {\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__Lhqqq {\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__vRHSP {\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__tjdFc {\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__Iy-VX {\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__LuQBA {\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__uW1on {\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__UBcvQ {\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__lOYbg {\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__BqRC7 {\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__Fh2dt {\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__pF2kC {\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__BeyrH {\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__Ruknj {\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__z8L3G {\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__0O3g6 {\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__KXxEB {\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__cJeEA {\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__eRe05 {\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__Xmwtf {\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__5q1m3 {\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__k9VFV {\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__-pWRe {\n\tpadding: var(--rb-padding) !important;\n\tmax-width: var(--rb-max-width);\n\tflex: var(--rb-flex);\n\tborder: var(--rb-border);\n\tbackground: var(--rb-bg);\n\tgap: var(--rb-gap);\n\tborder-radius: 8px;\n\tcursor: pointer;\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\tappearance: none;\n\t-webkit-appearance: none;\n\tbackground-image: none;\n\toutline: none;\n}\n\n.RadioButton-module_radioIcon__I27Xv {\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__zCQII {\n\tcolor: var(--core-text-primary);\n\twhite-space: nowrap;\n\tflex: 1;\n}\n\n.RadioButton-module_radioSummary__PNr0Z {\n\tcolor: var(--core-text-primary);\n\tflex: 1;\n}\n\n.RadioButton-module_radioContent__38xVx {\n\twidth: 100%;\n}\n");
|
|
6
6
|
|
|
7
7
|
const RadioButton = React.memo(props => {
|
|
8
|
-
const {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 = !0, checkedIcon: checkedIcon = "check circle", iconColor: iconColor, gap: gap = 6, onChange: onChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "option", "selected", "deselect", "tabIndex", "wrap", "list", "hideRadio", "toggleIcon", "noFrame", "checkedIcon", "iconColor", "gap", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [isSelected, setIsSelected] = React.useState(selected);
|
|
8
|
+
const {option: option, selected: selected = !1, controlType: controlType = "radio", deselect: deselect = !0, tabIndex: tabIndex = 1, wrap: wrap = !1, list: list = !1, hideRadio: hideRadio = !1, toggleIcon: toggleIcon = !0, noFrame: noFrame = !0, checkedIcon: checkedIcon = "check circle", iconColor: iconColor, gap: gap = 6, onChange: onChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "option", "selected", "controlType", "deselect", "tabIndex", "wrap", "list", "hideRadio", "toggleIcon", "noFrame", "checkedIcon", "iconColor", "gap", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [isSelected, setIsSelected] = React.useState(selected);
|
|
9
9
|
React.useEffect(() => setIsSelected(selected), [ selected ]);
|
|
10
10
|
const handleChange = React.useCallback(() => {
|
|
11
11
|
isSelected && !deselect || (setIsSelected(!isSelected), onChange(option, !isSelected));
|
|
12
|
-
}, [ isSelected, deselect, onChange, option ]),
|
|
13
|
-
"Space" === e.code && (e.preventDefault(), e.stopPropagation(), handleChange());
|
|
14
|
-
}, [ handleChange ]), setIconColor = React.useMemo(() => iconColor || ("circle fill" === checkedIcon ? "var(--core-text-primary)" : toggleIcon && isSelected ? "var(--core-text-special)" : "var(--core-text-primary)"), [ iconColor, toggleIcon, isSelected, checkedIcon ]), iconName = React.useMemo(() => toggleIcon && isSelected ? checkedIcon : "circle", [ toggleIcon, isSelected, checkedIcon ]), setFlex = React.useMemo(() => list ? "unset" : wrap ? "40%" : "1", [ list, wrap ]), cssVars = React.useMemo(() => ({
|
|
12
|
+
}, [ isSelected, deselect, onChange, option ]), setIconColor = React.useMemo(() => iconColor || ("circle fill" === checkedIcon ? "var(--core-text-primary)" : toggleIcon && isSelected ? "var(--core-text-special)" : "var(--core-text-primary)"), [ iconColor, toggleIcon, isSelected, checkedIcon ]), iconName = React.useMemo(() => toggleIcon && isSelected ? checkedIcon : "circle", [ toggleIcon, isSelected, checkedIcon ]), setFlex = React.useMemo(() => list ? "unset" : wrap ? "40%" : "1", [ list, wrap ]), cssVars = React.useMemo(() => ({
|
|
15
13
|
"--rb-max-width": wrap ? "50%" : "100%",
|
|
16
14
|
"--rb-flex": setFlex,
|
|
17
15
|
"--rb-padding": noFrame ? "0" : "8px 16px 8px 10px",
|
|
@@ -19,19 +17,20 @@ const RadioButton = React.memo(props => {
|
|
|
19
17
|
"--rb-border": noFrame ? "none" : "1px solid var(--core-outline-primary)",
|
|
20
18
|
"--rb-gap": misc.setStyle(gap)
|
|
21
19
|
}), [ setFlex, isSelected, wrap, noFrame, gap ]);
|
|
22
|
-
return jsxRuntime.jsxs("
|
|
20
|
+
return jsxRuntime.jsxs("button", Object.assign({
|
|
23
21
|
id: divId,
|
|
22
|
+
type: "button",
|
|
24
23
|
className: `${css_wrapper}${divClass}`,
|
|
25
24
|
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
26
25
|
onClick: handleChange,
|
|
27
|
-
|
|
26
|
+
role: controlType,
|
|
28
27
|
tabIndex: tabIndex,
|
|
29
28
|
"aria-label": option.title,
|
|
30
|
-
"aria-
|
|
29
|
+
"aria-checked": isSelected
|
|
31
30
|
}, rest, {
|
|
32
31
|
children: [ option.icon && !hideRadio && jsxRuntime.jsx("div", {
|
|
33
32
|
className: css_radioIcon,
|
|
34
|
-
children: jsxRuntime.jsx(
|
|
33
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
35
34
|
name: iconName,
|
|
36
35
|
strokeColor: setIconColor,
|
|
37
36
|
size: 20
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), RadioButton = require("./RadioButton-
|
|
3
|
+
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), RadioButton = require("./RadioButton-B8GIKGm-.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "RadioButtonList-module_wrapper__wnq1-", css_column = "RadioButtonList-module_column__Bq16e flexBox-module_columnStart__C7P44", css_row = "RadioButtonList-module_row__D3szq flexBox-module_rowStart__4tcxS";
|
|
4
4
|
|
|
5
5
|
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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__wnq1- {\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__Bq16e {\n}\n\n.RadioButtonList-module_row__D3szq {\n}\n");
|
|
6
6
|
|
|
7
7
|
const RadioButtonList = React.memo(props => {
|
|
8
|
-
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 = !0, toggleIcon: toggleIcon = !0, iconColor: iconColor, checkedIcon: checkedIcon = "check circle", iconSelectedColor: iconSelectedColor, onChange: onChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "options", "selectedIndexes", "selectedOptions", "label", "deselect", "multiSelect", "wrap", "tabIndexSeed", "spacer", "custom", "gap", "hideRadio", "noFrame", "toggleIcon", "iconColor", "checkedIcon", "iconSelectedColor", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [selected, setSelected] = React.useState(selectedIndexes);
|
|
8
|
+
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 = !0, toggleIcon: toggleIcon = !0, iconColor: iconColor, checkedIcon: checkedIcon = "check circle", iconSelectedColor: iconSelectedColor, onChange: onChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "options", "selectedIndexes", "selectedOptions", "label", "deselect", "multiSelect", "wrap", "tabIndexSeed", "spacer", "custom", "gap", "hideRadio", "noFrame", "toggleIcon", "iconColor", "checkedIcon", "iconSelectedColor", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", labelId = React.useId(), [selected, setSelected] = React.useState(selectedIndexes);
|
|
9
9
|
React.useEffect(() => setSelected(selectedIndexes), [ selectedIndexes ]), React.useEffect(() => {
|
|
10
10
|
if (!selectedOptions || !options) return;
|
|
11
11
|
const selections = [];
|
|
@@ -34,6 +34,7 @@ const RadioButtonList = React.memo(props => {
|
|
|
34
34
|
}, [ multiSelect, doMultiSelection, doSingleSelection ]), renderedOptions = React.useMemo(() => options.map((option, i) => jsxRuntime.jsx(RadioButton.RadioButton, {
|
|
35
35
|
option: option,
|
|
36
36
|
selected: isSelected(i),
|
|
37
|
+
controlType: multiSelect ? "checkbox" : "radio",
|
|
37
38
|
deselect: deselect,
|
|
38
39
|
wrap: wrap,
|
|
39
40
|
noFrame: noFrame,
|
|
@@ -43,7 +44,7 @@ const RadioButtonList = React.memo(props => {
|
|
|
43
44
|
toggleIcon: toggleIcon,
|
|
44
45
|
iconColor: isSelected(i) ? iconSelectedColor : iconColor,
|
|
45
46
|
checkedIcon: checkedIcon
|
|
46
|
-
}, `${option.fieldName}_${i}`)), [ options, isSelected, deselect, wrap, noFrame, hideRadio, handleChange, tabIndexSeed, toggleIcon, iconColor, iconSelectedColor, checkedIcon ]), margin = React.useMemo(() => "none" === spacer ? 0 : "custom" === spacer ? custom : 0, [ spacer, custom ]), cssVars = React.useMemo(() => ({
|
|
47
|
+
}, `${option.fieldName}_${i}`)), [ options, isSelected, deselect, wrap, noFrame, hideRadio, handleChange, tabIndexSeed, toggleIcon, iconColor, iconSelectedColor, checkedIcon, multiSelect ]), margin = React.useMemo(() => "none" === spacer ? 0 : "custom" === spacer ? custom : 0, [ spacer, custom ]), cssVars = React.useMemo(() => ({
|
|
47
48
|
"--rb-list-flex-wrap": wrap ? "wrap" : "nowrap",
|
|
48
49
|
"--rb-list-margin-bottom": noFrame ? 0 : `${margin}px`,
|
|
49
50
|
"--rb-gap": `${gap}px`
|
|
@@ -51,9 +52,14 @@ const RadioButtonList = React.memo(props => {
|
|
|
51
52
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
52
53
|
id: divId,
|
|
53
54
|
className: `${css_wrapper} ${noFrame ? css_column : css_row}${divClass}`,
|
|
54
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars)
|
|
55
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
56
|
+
role: multiSelect ? "group" : "radiogroup",
|
|
57
|
+
"aria-labelledby": label ? labelId : void 0
|
|
55
58
|
}, rest, {
|
|
56
|
-
children: [ label,
|
|
59
|
+
children: [ label && jsxRuntime.jsx("div", {
|
|
60
|
+
id: labelId,
|
|
61
|
+
children: label
|
|
62
|
+
}), renderedOptions ]
|
|
57
63
|
}));
|
|
58
64
|
});
|
|
59
65
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Manage an EventSource connection with optional unified callbacks and typed custom events.
|
|
5
|
+
*/ exports.SSEConnection = class {
|
|
4
6
|
/**
|
|
5
7
|
* Whether the underlying EventSource is currently open.
|
|
6
8
|
*/
|
|
@@ -14,12 +16,12 @@ exports.SSEConnection = class {
|
|
|
14
16
|
return this.sseConnection;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
|
-
* Create
|
|
19
|
+
* Create the EventSource connection and attach its initial listeners.
|
|
18
20
|
*/ constructor(options) {
|
|
19
21
|
var _a, _b, _c;
|
|
20
22
|
this.sseConnection = null, this.customEventHandlers = new Map, this.unifiedOnMessage = !1,
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* Parse and emit the default `message` event payload.
|
|
23
25
|
*/
|
|
24
26
|
this.onMessage = event => {
|
|
25
27
|
const data = this.parseEventData(event.data);
|
|
@@ -30,7 +32,7 @@ exports.SSEConnection = class {
|
|
|
30
32
|
}), this.emitParsedMessage(data), this.shouldCloseFromMessage(event.data, data) && this.closeFromConnectionEvent();
|
|
31
33
|
},
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* Forward EventSource errors through the configured callbacks.
|
|
34
36
|
*/
|
|
35
37
|
this.onError = event => {
|
|
36
38
|
var _a;
|
|
@@ -40,7 +42,7 @@ exports.SSEConnection = class {
|
|
|
40
42
|
});
|
|
41
43
|
},
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
45
|
+
* Forward EventSource open events through the configured callbacks.
|
|
44
46
|
*/
|
|
45
47
|
this.onOpen = event => {
|
|
46
48
|
var _a;
|
|
@@ -74,35 +76,47 @@ exports.SSEConnection = class {
|
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
/**
|
|
77
|
-
* Attach default
|
|
79
|
+
* Attach the default EventSource listeners for message, error, and open events.
|
|
78
80
|
*/ attachDefaultEventListeners(connection) {
|
|
79
81
|
connection.addEventListener("message", this.onMessage), connection.addEventListener("error", this.onError),
|
|
80
82
|
connection.addEventListener("open", this.onOpen);
|
|
81
83
|
}
|
|
82
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Emit parsed message data when standard callback mode is enabled.
|
|
86
|
+
*/ emitParsedMessage(data) {
|
|
83
87
|
var _a;
|
|
84
88
|
this.unifiedOnMessage || null === (_a = this.onMessageCallback) || void 0 === _a || _a.call(this, data);
|
|
85
89
|
}
|
|
86
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Emit a unified message object when unified callback mode is enabled.
|
|
92
|
+
*/ emitUnifiedMessage(message) {
|
|
87
93
|
var _a;
|
|
88
94
|
this.unifiedOnMessage && (null === (_a = this.onMessageCallback) || void 0 === _a || _a.call(this, message));
|
|
89
95
|
}
|
|
90
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Emit the close callback and unified close event.
|
|
98
|
+
*/ emitCloseEvent(event) {
|
|
91
99
|
var _a;
|
|
92
100
|
null === (_a = this.onCloseCallback) || void 0 === _a || _a.call(this, event), this.emitUnifiedMessage({
|
|
93
101
|
type: "close",
|
|
94
102
|
event: event
|
|
95
103
|
});
|
|
96
104
|
}
|
|
97
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Close the connection in response to an SSE-level close condition.
|
|
107
|
+
*/ closeFromConnectionEvent() {
|
|
98
108
|
const closeEvent = new Event("close");
|
|
99
109
|
this.emitCloseEvent(closeEvent), this.close();
|
|
100
110
|
}
|
|
101
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Check whether an incoming message should close the connection.
|
|
113
|
+
*/ shouldCloseFromMessage(rawData, data) {
|
|
102
114
|
var _a;
|
|
103
115
|
return !!(null === (_a = this.connectionClose) || void 0 === _a ? void 0 : _a.message) && (rawData === this.connectionClose.message || data === this.connectionClose.message);
|
|
104
116
|
}
|
|
105
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Emit one custom event through unified callback mode.
|
|
119
|
+
*/ emitUnifiedCustomMessage(customEvent, data, event) {
|
|
106
120
|
this.emitUnifiedMessage({
|
|
107
121
|
type: customEvent.name,
|
|
108
122
|
data: data,
|
|
@@ -110,7 +124,7 @@ exports.SSEConnection = class {
|
|
|
110
124
|
});
|
|
111
125
|
}
|
|
112
126
|
/**
|
|
113
|
-
* Attach custom event
|
|
127
|
+
* Attach one typed custom event listener to the SSE connection.
|
|
114
128
|
*/ attachCustomEventListener(customEvent) {
|
|
115
129
|
var _a;
|
|
116
130
|
if (!this.sseConnection) return;
|
|
@@ -124,13 +138,13 @@ exports.SSEConnection = class {
|
|
|
124
138
|
this.sseConnection.addEventListener(customEvent.name, handler);
|
|
125
139
|
}
|
|
126
140
|
/**
|
|
127
|
-
* Attach custom event listeners to the SSE connection
|
|
141
|
+
* Attach all configured custom event listeners to the SSE connection.
|
|
128
142
|
*/ attachCustomEventListeners(customEvents) {
|
|
129
143
|
const events = Array.isArray(customEvents) ? customEvents : [ customEvents ];
|
|
130
144
|
for (const event of events) this.attachCustomEventListener(event);
|
|
131
145
|
}
|
|
132
146
|
/**
|
|
133
|
-
*
|
|
147
|
+
* Detach every default and custom listener from the current EventSource.
|
|
134
148
|
*/ detachAllEventListeners(connection) {
|
|
135
149
|
connection.removeEventListener("message", this.onMessage), connection.removeEventListener("error", this.onError),
|
|
136
150
|
connection.removeEventListener("open", this.onOpen);
|
|
@@ -1,59 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_useObserveResize = require("../hooks/useObserveResize.js"), misc = require("./misc-
|
|
3
|
+
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_useObserveResize = require("../hooks/useObserveResize.js"), misc = require("./misc-BTF7BCZW.js"), debounce = require("./debounce-BF4i6uIC.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "Slider-module_wrapper__KCCs1", css_trackBg = "Slider-module_trackBg__7zfqm flexBox-module_rowStart__4tcxS", css_track = "Slider-module_track__kaJkL flexBox-module_rowStart__4tcxS", css_trackHead = "Slider-module_trackHead__W-UdG", css_trackWrapper = "Slider-module_trackWrapper__Ot0Wh flexBox-module_rowStart__4tcxS";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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.Slider-module_wrapper__KCCs1 {\n\tposition: relative;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0 var(--slider-padding);\n\tmargin: 0;\n\twidth: var(--slider-width);\n\theight: auto;\n\tmin-height: var(--slider-touch-height);\n\tcursor: var(--slider-cursor);\n\tbackground: transparent;\n}\n\n.Slider-module_trackBg__7zfqm {\n\tposition: relative;\n\twidth: 100%;\n\theight: var(--slider-height);\n\tbackground-color: var(--slider-track-color);\n\toverflow: visible;\n\tborder-radius: 100px;\n}\n\n.Slider-module_track__kaJkL {\n\tposition: relative;\n\twidth: 0;\n\theight: var(--slider-height);\n\tbackground-color: var(--slider-progress-color);\n\toverflow: visible;\n\tborder-radius: 100px;\n}\n\n.Slider-module_trackHead__W-UdG {\n\tposition: absolute;\n\tdisplay: var(--slider-head-display);\n\tbackground-color: var(--slider-head-color);\n\tborder-radius: var(--slider-head-radius);\n\tmax-width: var(--slider-head-width);\n\tmax-height: var(--slider-head-size);\n\tmin-width: var(--slider-head-width);\n\tmin-height: var(--slider-head-size);\n\ttop: 50%;\n\ttransform: translateY(-50%) translateX(-50%);\n}\n\n.Slider-module_trackWrapper__Ot0Wh {\n\tposition: relative;\n\twidth: 100%;\n\theight: var(--slider-height);\n\tmin-height: var(--slider-touch-height);\n\tbackground-color: transparent;\n\tborder-radius: 100px;\n\toverflow: visible;\n}\n");
|
|
5
|
+
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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.Slider-module_wrapper__KCCs1 {\n\tposition: relative;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0 var(--slider-padding);\n\tmargin: 0;\n\twidth: var(--slider-width);\n\theight: auto;\n\tmin-height: var(--slider-touch-height);\n\tcursor: var(--slider-cursor);\n\tbackground: transparent;\n}\n\n.Slider-module_trackBg__7zfqm {\n\tposition: relative;\n\twidth: 100%;\n\theight: var(--slider-height);\n\tbackground-color: var(--slider-track-color);\n\toverflow: hidden;\n\tborder-radius: 100px;\n}\n\n.Slider-module_track__kaJkL {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\twidth: 0;\n\tbackground-color: var(--slider-progress-color);\n\toverflow: visible;\n\tborder-radius: 100px;\n}\n\n.Slider-module_trackHead__W-UdG {\n\tposition: absolute;\n\tdisplay: var(--slider-head-display);\n\tbackground-color: var(--slider-head-color);\n\tborder-radius: var(--slider-head-radius);\n\tmax-width: var(--slider-head-width);\n\tmax-height: var(--slider-head-size);\n\tmin-width: var(--slider-head-width);\n\tmin-height: var(--slider-head-size);\n\ttop: 50%;\n\ttransform: translateY(-50%) translateX(-50%);\n}\n\n.Slider-module_trackWrapper__Ot0Wh {\n\tposition: relative;\n\twidth: 100%;\n\theight: var(--slider-height);\n\tmin-height: var(--slider-touch-height);\n\tbackground-color: transparent;\n\tborder-radius: 100px;\n\toverflow: visible;\n\toutline: none;\n}\n\n.Slider-module_trackWrapper__Ot0Wh:focus-visible {\n\toutline: 2px solid var(--core-link-primary);\n\toutline-offset: 2px;\n}\n");
|
|
8
6
|
|
|
9
7
|
const Slider = React.memo(props => {
|
|
10
|
-
const {value: value = 25, scaleMin: scaleMin = 0, scaleMax: scaleMax = 100, width: width, height: height = 2, touchHeight: touchHeight = 24, trackHeadSize: trackHeadSize = 7, cursor: cursor = "default", headColor: headColor = "var(--core-text-primary)", trackColor: trackColor = "var(--core-surface-secondary)", progressColor: progressColor = "var(--core-text-primary)", onChange: onChange = () => null, onDragChange: onDragChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "value", "scaleMin", "scaleMax", "width", "height", "touchHeight", "trackHeadSize", "cursor", "headColor", "trackColor", "progressColor", "onChange", "onDragChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", ref = React.useRef(null), track = React.useRef(null), head = React.useRef(null), absProgressRef = React.useRef(value), relativeProgressRef = React.useRef(
|
|
8
|
+
const {value: value = 25, scaleMin: scaleMin = 0, scaleMax: scaleMax = 100, width: width, height: height = 2, touchHeight: touchHeight = 24, trackHeadSize: trackHeadSize = 7, cursor: cursor = "default", headColor: headColor = "var(--core-text-primary)", trackColor: trackColor = "var(--core-surface-secondary)", progressColor: progressColor = "var(--core-text-primary)", onChange: onChange = () => null, onDragChange: onDragChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "value", "scaleMin", "scaleMax", "width", "height", "touchHeight", "trackHeadSize", "cursor", "headColor", "trackColor", "progressColor", "onChange", "onDragChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", ref = React.useRef(null), track = React.useRef(null), head = React.useRef(null), [currentValue, setCurrentValue] = React.useState(value), absProgressRef = React.useRef(value), relativeProgressRef = React.useRef(0), didMount = React.useRef(!1), size = hooks_useObserveResize.useObserveResize(ref, {
|
|
11
9
|
ignore: "height"
|
|
12
|
-
}), debouncedOnChange =
|
|
13
|
-
/**
|
|
14
|
-
* General debounce utility with delay setting and cancel/flush methods
|
|
15
|
-
* to clear a "debounce" or immediately "execute" the debounced function
|
|
16
|
-
*/
|
|
17
|
-
function(func, delay) {
|
|
18
|
-
let timeoutId = null, lastArgs = null;
|
|
19
|
-
const debounced = function(...args) {
|
|
20
|
-
lastArgs = args, null !== timeoutId && clearTimeout(timeoutId), timeoutId = setTimeout(() => {
|
|
21
|
-
func.apply(this, null != lastArgs ? lastArgs : []), timeoutId = null, lastArgs = null;
|
|
22
|
-
}, delay);
|
|
23
|
-
};
|
|
24
|
-
return debounced.cancel = () => {
|
|
25
|
-
null !== timeoutId && (clearTimeout(timeoutId), timeoutId = null, lastArgs = null);
|
|
26
|
-
}, debounced.flush = function() {
|
|
27
|
-
null !== timeoutId && null !== lastArgs && (clearTimeout(timeoutId), func.apply(this, lastArgs),
|
|
28
|
-
timeoutId = null, lastArgs = null);
|
|
29
|
-
}, debounced;
|
|
30
|
-
}((value, percent) => {
|
|
10
|
+
}), debouncedOnChange = debounce.debounce((value, percent) => {
|
|
31
11
|
onChange(value, percent);
|
|
32
|
-
}, 0), padding = React.useMemo(() => trackHeadSize ? Math.ceil(trackHeadSize / 2) : 0, [ trackHeadSize ]),
|
|
12
|
+
}, 0), padding = React.useMemo(() => trackHeadSize ? Math.ceil(trackHeadSize / 2) : 0, [ trackHeadSize ]), clampValue = React.useCallback(nextValue => Math.min(scaleMax, Math.max(scaleMin, nextValue)), [ scaleMax, scaleMin ]), valueToPercent = React.useCallback(nextValue => {
|
|
13
|
+
const range = scaleMax - scaleMin;
|
|
14
|
+
return range <= 0 ? 0 : (nextValue - scaleMin) / range;
|
|
15
|
+
}, [ scaleMax, scaleMin ]), setTrackAndHead = React.useCallback(pixelPos => {
|
|
33
16
|
const hd = head.current, tr = track.current;
|
|
34
17
|
hd && (hd.style.left = `${pixelPos}px`), tr && (tr.style.width = `${pixelPos}px`),
|
|
35
18
|
didMount.current = !0;
|
|
36
19
|
}, []), initialProgress = React.useCallback(current => {
|
|
37
20
|
if (!(null == ref ? void 0 : ref.current)) return;
|
|
38
|
-
const sliderWidth = ref.current.getBoundingClientRect().width;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
adjustedCurrent = (scaleMax - scaleMin) / 2);
|
|
42
|
-
const normalized = (adjustedCurrent - scaleMin) / (scaleMax - scaleMin), pixelPos = normalized * sliderWidth;
|
|
21
|
+
const sliderWidth = ref.current.getBoundingClientRect().width, adjustedCurrent = clampValue(current);
|
|
22
|
+
adjustedCurrent !== current && console.warn("Slider outside range. Adjusted to nearest bound.");
|
|
23
|
+
const normalized = valueToPercent(adjustedCurrent), pixelPos = normalized * sliderWidth;
|
|
43
24
|
absProgressRef.current = adjustedCurrent, relativeProgressRef.current = normalized,
|
|
44
|
-
setTrackAndHead(pixelPos), didMount.current = !0;
|
|
45
|
-
}, [
|
|
25
|
+
setCurrentValue(adjustedCurrent), setTrackAndHead(pixelPos), didMount.current = !0;
|
|
26
|
+
}, [ clampValue, valueToPercent, setTrackAndHead ]), progress = React.useCallback(posX => {
|
|
46
27
|
const el = null == ref ? void 0 : ref.current;
|
|
47
28
|
if (!el) return {
|
|
48
29
|
value: 0,
|
|
49
30
|
percent: 0
|
|
50
31
|
};
|
|
51
32
|
const sliderWidth = el.getBoundingClientRect().width;
|
|
52
|
-
relativeProgressRef.current = posX / sliderWidth, absProgressRef.current = scaleMin + relativeProgressRef.current * (scaleMax - scaleMin)
|
|
53
|
-
|
|
33
|
+
relativeProgressRef.current = sliderWidth > 0 ? posX / sliderWidth : 0, absProgressRef.current = scaleMin + relativeProgressRef.current * (scaleMax - scaleMin),
|
|
34
|
+
setCurrentValue(absProgressRef.current);
|
|
35
|
+
}, [ scaleMax, scaleMin ]), commitValue = React.useCallback((nextValue, notify = "change") => {
|
|
36
|
+
const el = ref.current;
|
|
37
|
+
if (!el) return;
|
|
38
|
+
const sliderWidth = el.getBoundingClientRect().width, clampedValue = clampValue(nextValue), percent = valueToPercent(clampedValue);
|
|
39
|
+
absProgressRef.current = clampedValue, relativeProgressRef.current = percent, setCurrentValue(clampedValue),
|
|
40
|
+
setTrackAndHead(percent * sliderWidth), "change" !== notify && "both" !== notify || onChange(clampedValue, percent),
|
|
41
|
+
"drag" !== notify && "both" !== notify || onDragChange(clampedValue, percent);
|
|
42
|
+
}, [ clampValue, valueToPercent, setTrackAndHead, onChange, onDragChange ]), updateSlider = React.useCallback(e => {
|
|
54
43
|
const newPos = misc.pointerPosition(e), el = null == ref ? void 0 : ref.current;
|
|
55
44
|
if (!el) return 0;
|
|
56
|
-
const rect = el.getBoundingClientRect(), sliderWidth =
|
|
45
|
+
const rect = el.getBoundingClientRect(), sliderWidth = rect.width;
|
|
57
46
|
let pos = newPos - rect.x;
|
|
58
47
|
return pos > sliderWidth ? pos = sliderWidth : pos < 0 && (pos = 0), setTrackAndHead(pos),
|
|
59
48
|
pos;
|
|
@@ -72,7 +61,39 @@ const Slider = React.memo(props => {
|
|
|
72
61
|
}
|
|
73
62
|
globalThis.removeEventListener("mousemove", handleMouseMove, !1), globalThis.removeEventListener("touchmove", handleMouseMove, !1),
|
|
74
63
|
globalThis.removeEventListener("mouseup", handleMouseUp, !1), globalThis.removeEventListener("touchend", handleMouseUp, !1);
|
|
75
|
-
}, [ handleMouseMove, progress, updateSlider, debouncedOnChange, onDragChange, onChange ]),
|
|
64
|
+
}, [ handleMouseMove, progress, updateSlider, debouncedOnChange, onDragChange, onChange ]), handleKeyDown = React.useCallback(event => {
|
|
65
|
+
const range = scaleMax - scaleMin;
|
|
66
|
+
if (range <= 0) return;
|
|
67
|
+
const step = Number.isInteger(scaleMin) && Number.isInteger(scaleMax) ? 1 : Math.max(range / 100, .01), pageStep = Math.max(step, range / 10);
|
|
68
|
+
let nextValue = null;
|
|
69
|
+
switch (event.key) {
|
|
70
|
+
case "ArrowRight":
|
|
71
|
+
case "ArrowUp":
|
|
72
|
+
nextValue = absProgressRef.current + step;
|
|
73
|
+
break;
|
|
74
|
+
|
|
75
|
+
case "ArrowLeft":
|
|
76
|
+
case "ArrowDown":
|
|
77
|
+
nextValue = absProgressRef.current - step;
|
|
78
|
+
break;
|
|
79
|
+
|
|
80
|
+
case "PageUp":
|
|
81
|
+
nextValue = absProgressRef.current + pageStep;
|
|
82
|
+
break;
|
|
83
|
+
|
|
84
|
+
case "PageDown":
|
|
85
|
+
nextValue = absProgressRef.current - pageStep;
|
|
86
|
+
break;
|
|
87
|
+
|
|
88
|
+
case "Home":
|
|
89
|
+
nextValue = scaleMin;
|
|
90
|
+
break;
|
|
91
|
+
|
|
92
|
+
case "End":
|
|
93
|
+
nextValue = scaleMax;
|
|
94
|
+
}
|
|
95
|
+
null !== nextValue && (event.preventDefault(), debouncedOnChange.cancel(), commitValue(nextValue, "change"));
|
|
96
|
+
}, [ scaleMin, scaleMax, debouncedOnChange, commitValue ]), handleMouseDown = React.useCallback(e => {
|
|
76
97
|
e.preventDefault(), e.stopPropagation(), globalThis.addEventListener("mousemove", handleMouseMove, !1),
|
|
77
98
|
globalThis.addEventListener("touchmove", handleMouseMove, !1), globalThis.addEventListener("mouseup", handleMouseUp, !1),
|
|
78
99
|
globalThis.addEventListener("touchend", handleMouseUp, !1);
|
|
@@ -119,6 +140,14 @@ const Slider = React.memo(props => {
|
|
|
119
140
|
children: jsxRuntime.jsxs("div", {
|
|
120
141
|
ref: ref,
|
|
121
142
|
className: css_trackWrapper,
|
|
143
|
+
role: "slider",
|
|
144
|
+
tabIndex: 0,
|
|
145
|
+
"aria-label": "Slider",
|
|
146
|
+
"aria-valuemin": scaleMin,
|
|
147
|
+
"aria-valuemax": scaleMax,
|
|
148
|
+
"aria-valuenow": currentValue,
|
|
149
|
+
"aria-orientation": "horizontal",
|
|
150
|
+
onKeyDown: handleKeyDown,
|
|
122
151
|
children: [ jsxRuntime.jsx("div", {
|
|
123
152
|
className: css_trackBg,
|
|
124
153
|
children: jsxRuntime.jsx("div", {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), react = require("motion/react"), React = require("react"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "Switch-module_wrapper__kudO9 flexBox-module_row__z24tF", css_knob = "Switch-module_knob__vKNOc flexBox-module_row__z24tF";
|
|
4
4
|
|
|
5
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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.Switch-module_wrapper__kudO9 {\n\tpadding: var(--switch-padding) !important;\n\twidth: var(--switch-width);\n\theight: var(--switch-height);\n\tborder-radius: 100px;\n\tcursor: pointer;\n\tbackground: var(--switch-bg-color);\n\ttransition: background var(--motion-water-duration) var(--motion-water) 0s;\n}\n\n.Switch-module_knob__vKNOc {\n\twidth: var(--switch-knob-size);\n\theight: var(--switch-knob-size);\n\tbackground: var(--switch-knob-color);\n\tborder-radius: 100%;\n}\n");
|
|
5
|
+
styleInject_es.styleInject(".flexBox-module_row__z24tF {\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__5FEvi {\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__4tcxS {\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__rVdVm {\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__ezvMq {\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__C7P44 {\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__PKcrG {\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__ERfp7 {\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__lLJuc {\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.Switch-module_wrapper__kudO9 {\n\tpadding: var(--switch-padding) !important;\n\twidth: var(--switch-width);\n\theight: var(--switch-height);\n\tborder-radius: 100px;\n\tcursor: pointer;\n\tbackground: var(--switch-bg-color);\n\ttransition: background var(--motion-water-duration) var(--motion-water) 0s;\n\tappearance: none;\n\t-webkit-appearance: none;\n\tborder: 0;\n\toutline: none;\n}\n\n.Switch-module_knob__vKNOc {\n\twidth: var(--switch-knob-size);\n\theight: var(--switch-knob-size);\n\tbackground: var(--switch-knob-color);\n\tborder-radius: 100%;\n}\n");
|
|
6
6
|
|
|
7
7
|
const Switch = React.memo(props => {
|
|
8
8
|
const {state: state = !1, height: height = 22, width: width = 44, padding: padding = 3, bgColorOn: bgColorOn = "var(--feedback-positive)", bgColorOff: bgColorOff = "var(--core-text-disabled)", knobColor: knobColor = "var(--core-surface-primary)", onChange: onChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "state", "height", "width", "padding", "bgColorOn", "bgColorOff", "knobColor", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [on, setOn] = React.useState(state);
|
|
@@ -21,11 +21,14 @@ const Switch = React.memo(props => {
|
|
|
21
21
|
"--switch-knob-color": knobColor,
|
|
22
22
|
"--switch-bg-color": on ? bgColorOn : bgColorOff
|
|
23
23
|
}), [ width, height, padding, bgColorOff, bgColorOn, on, knobColor ]);
|
|
24
|
-
return jsxRuntime.jsx(react.motion.
|
|
24
|
+
return jsxRuntime.jsx(react.motion.button, Object.assign({
|
|
25
25
|
id: divId,
|
|
26
|
+
type: "button",
|
|
26
27
|
className: `${css_wrapper}${divClass}`,
|
|
27
28
|
style: Object.assign(Object.assign(Object.assign({}, divStyle), justify), cssVars),
|
|
28
|
-
onClick: handleClick
|
|
29
|
+
onClick: handleClick,
|
|
30
|
+
role: "switch",
|
|
31
|
+
"aria-checked": on
|
|
29
32
|
}, rest, {
|
|
30
33
|
children: jsxRuntime.jsx(react.motion.div, {
|
|
31
34
|
className: css_knob,
|